-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vite): bundle js & css into the same file
- Loading branch information
1 parent
47fde22
commit d3f304a
Showing
9 changed files
with
55 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
import { defineComponent as m, ref as f, computed as o, watch as x, openBlock as y, createElementBlock as _, withDirectives as h, createElementVNode as a, vModelText as b, toDisplayString as n } from "vue"; | ||
const w = { class: "relative" }, R = { class: "absolute left-3 top-1/2 -translate-y-1/2" }, g = { class: "ml-0.5 py-1 text-xl text-black" }, C = { class: "text-xl text-gray-400" }, k = /* @__PURE__ */ m({ | ||
__name: "TabComplete", | ||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".vue-tab-complete-wrapper{position:relative}.vue-tab-complete-wrapper input{z-index:10;padding:.5rem;padding-left:14px;width:100%;height:100%;color:#fff;border-color:#ced7d0;caret-color:#63666c}.vue-tab-complete-wrapper .input-overlay{position:absolute;left:.75rem;top:50%;transform:translateY(-50%)}.vue-tab-complete-wrapper .input-overlay .result-query{padding-top:.25rem;padding-bottom:.25rem;margin-left:.125rem;color:#000}.vue-tab-complete-wrapper .input-overlay .result-suggest{color:#9ca3af}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); | ||
import { defineComponent as _, ref as m, computed as a, watch as f, openBlock as h, createElementBlock as g, withDirectives as y, createElementVNode as n, vModelText as x, toDisplayString as u } from "vue"; | ||
const R = { class: "vue-tab-complete-wrapper" }, w = ["placeholder"], b = { class: "input-overlay" }, D = { class: "result-query" }, N = { class: "result-suggest" }, C = /* @__PURE__ */ _({ | ||
__name: "NextHint", | ||
props: { | ||
results: { default: () => [] } | ||
suggestions: { default: () => [] }, | ||
placeholder: { default: "" } | ||
}, | ||
emits: ["change"], | ||
setup(r, { emit: u }) { | ||
const c = r, i = u, e = f(""), l = o(() => e.value === "" ? null : c.results.find((s) => s.toLowerCase().startsWith(e.value.toLowerCase()))), p = o(() => { | ||
setup(r, { emit: c }) { | ||
const o = r, i = c, e = m(""), s = a(() => e.value === "" ? null : o.suggestions.find((l) => l.toLowerCase().startsWith(e.value.toLowerCase()))), p = a(() => { | ||
var t; | ||
return e.value === "" || l.value === null ? null : (t = l.value) == null ? void 0 : t.substring(e.value.length); | ||
return e.value === "" || s.value === null ? null : (t = s.value) == null ? void 0 : t.substring(e.value.length); | ||
}), d = (t) => { | ||
t.key === "Tab" && (t.preventDefault(), l.value && (e.value = l.value)); | ||
t.key === "Tab" && (t.preventDefault(), s.value && (e.value = s.value)); | ||
}; | ||
return x(e, () => { | ||
return f(e, () => { | ||
i("change", e.value); | ||
}), (t, s) => (y(), _("div", w, [ | ||
h(a("input", { | ||
"onUpdate:modelValue": s[0] || (s[0] = (v) => e.value = v), | ||
}), (t, l) => (h(), g("div", R, [ | ||
y(n("input", { | ||
"onUpdate:modelValue": l[0] || (l[0] = (v) => e.value = v), | ||
type: "text", | ||
class: "z-10 h-[76px] w-full rounded border border-[#CED7D0] p-2 pl-3.5 text-xl text-white caret-gray-600", | ||
onKeydown: d | ||
}, null, 544), [ | ||
[b, e.value] | ||
class: "vue-tab-complete-input", | ||
onKeydown: d, | ||
placeholder: o.placeholder | ||
}, null, 40, w), [ | ||
[x, e.value] | ||
]), | ||
a("div", R, [ | ||
a("span", g, n(e.value), 1), | ||
a("span", C, n(p.value), 1) | ||
n("div", b, [ | ||
n("span", D, u(e.value), 1), | ||
n("span", N, u(p.value), 1) | ||
]) | ||
])); | ||
} | ||
}); | ||
export { | ||
k as TabComplete | ||
C as NextHint | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{ | ||
"name": "vue-tab-complete", | ||
"name": "vue-nexthint", | ||
"version": "1.0.0", | ||
"description": "A Vue 3 component for tab completion", | ||
"description": "A Vue component that creates autocomplete functionality for your input fields, but works as tab suggestions instead of dropdown.", | ||
"author": { | ||
"name": "Phuc Hong.", | ||
"email": "[email protected]" | ||
}, | ||
"license": "MIT", | ||
"type": "module", | ||
"main": "./dist/main.umd.js", | ||
"module": "./dist/main.es.js", | ||
|
@@ -17,18 +18,19 @@ | |
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.3.4", | ||
"tailwindcss": "^3.3.2", | ||
"postcss": "^8.4.23", | ||
"@headlessui/vue": "^1.7.13", | ||
"autoprefixer": "^10.4.14", | ||
"@headlessui/vue": "^1.7.13" | ||
"postcss": "^8.4.23", | ||
"tailwindcss": "^3.3.2", | ||
"vite-plugin-css-injected-by-js": "^3.4.0", | ||
"vue": "^3.3.4" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^4.2.3", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.4.5", | ||
"sass": "^1.38.0", | ||
"sass-loader": "^10.0.0", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.4.5", | ||
"vue-tsc": "^1.8.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters