numori-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +651 -0
- package/README.md +466 -0
- package/dist/components/Alert.js +137 -0
- package/dist/components/Alert.js.map +1 -0
- package/dist/components/Avatar.js +133 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Badge.js +93 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Button.js +428 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/ButtonsGroup.js +153 -0
- package/dist/components/ButtonsGroup.js.map +1 -0
- package/dist/components/Checkbox.js +93 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/Divider.js +79 -0
- package/dist/components/Divider.js.map +1 -0
- package/dist/components/Dropdown.js +166 -0
- package/dist/components/Dropdown.js.map +1 -0
- package/dist/components/DropdownItem.js +106 -0
- package/dist/components/DropdownItem.js.map +1 -0
- package/dist/components/DropdownRow.js +41 -0
- package/dist/components/DropdownRow.js.map +1 -0
- package/dist/components/DropdownSubmenu.js +142 -0
- package/dist/components/DropdownSubmenu.js.map +1 -0
- package/dist/components/FileInput.js +122 -0
- package/dist/components/FileInput.js.map +1 -0
- package/dist/components/FormField.js +112 -0
- package/dist/components/FormField.js.map +1 -0
- package/dist/components/Input.js +603 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/Kbd.js +35 -0
- package/dist/components/Kbd.js.map +1 -0
- package/dist/components/ListMenu.js +143 -0
- package/dist/components/ListMenu.js.map +1 -0
- package/dist/components/ListMenuItem.js +189 -0
- package/dist/components/ListMenuItem.js.map +1 -0
- package/dist/components/Modal.js +206 -0
- package/dist/components/Modal.js.map +1 -0
- package/dist/components/Numpad.js +123 -0
- package/dist/components/Numpad.js.map +1 -0
- package/dist/components/Popup.js +170 -0
- package/dist/components/Popup.js.map +1 -0
- package/dist/components/ProgressBar.js +118 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/Prompt.js +201 -0
- package/dist/components/Prompt.js.map +1 -0
- package/dist/components/Radio.js +81 -0
- package/dist/components/Radio.js.map +1 -0
- package/dist/components/Select.js +441 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/Slider.js +116 -0
- package/dist/components/Slider.js.map +1 -0
- package/dist/components/Stepper.js +65 -0
- package/dist/components/Stepper.js.map +1 -0
- package/dist/components/Toggle.js +133 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/components/Tooltip.js +120 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/index.js +81 -0
- package/dist/components/index.js.map +1 -0
- package/dist/composables/onClickOutside.js +51 -0
- package/dist/composables/onClickOutside.js.map +1 -0
- package/dist/composables/useBackButton.js +98 -0
- package/dist/composables/useBackButton.js.map +1 -0
- package/dist/composables/useEventListener.js +63 -0
- package/dist/composables/useEventListener.js.map +1 -0
- package/dist/icons/Icon.js +120 -0
- package/dist/icons/Icon.js.map +1 -0
- package/dist/icons/mdi.js +69 -0
- package/dist/icons/mdi.js.map +1 -0
- package/dist/icons/registry.js +63 -0
- package/dist/icons/registry.js.map +1 -0
- package/dist/icons/resolver.js +49 -0
- package/dist/icons/resolver.js.map +1 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.js +157 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.js +89 -0
- package/dist/manifest.js.map +1 -0
- package/dist/numori-ui.css +184 -0
- package/dist/nuxt.d.ts +35 -0
- package/dist/nuxt.mjs +243 -0
- package/dist/nuxt.mjs.map +1 -0
- package/dist/vite.d.ts +29 -0
- package/dist/vite.mjs +187 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +138 -0
- package/src/components/Alert.vue +127 -0
- package/src/components/Avatar.vue +100 -0
- package/src/components/Badge.vue +77 -0
- package/src/components/Button.vue +419 -0
- package/src/components/ButtonsGroup.vue +140 -0
- package/src/components/Checkbox.vue +81 -0
- package/src/components/Divider.vue +64 -0
- package/src/components/Dropdown.vue +150 -0
- package/src/components/DropdownItem.vue +78 -0
- package/src/components/DropdownRow.vue +37 -0
- package/src/components/DropdownSubmenu.vue +127 -0
- package/src/components/FileInput.vue +107 -0
- package/src/components/FormField.vue +86 -0
- package/src/components/Input.vue +619 -0
- package/src/components/Kbd.vue +30 -0
- package/src/components/ListMenu.vue +127 -0
- package/src/components/ListMenuItem.vue +171 -0
- package/src/components/Modal.vue +209 -0
- package/src/components/Numpad.vue +118 -0
- package/src/components/Popup.vue +156 -0
- package/src/components/ProgressBar.vue +107 -0
- package/src/components/Prompt.vue +161 -0
- package/src/components/Radio.vue +50 -0
- package/src/components/Select.vue +470 -0
- package/src/components/Slider.vue +93 -0
- package/src/components/Stepper.vue +53 -0
- package/src/components/Toggle.vue +125 -0
- package/src/components/Tooltip.vue +113 -0
- package/src/components/index.js +109 -0
- package/src/composables/onClickOutside.js +61 -0
- package/src/composables/useBackButton.js +98 -0
- package/src/composables/useEventListener.js +65 -0
- package/src/icons/Icon.vue +139 -0
- package/src/icons/mdi.js +67 -0
- package/src/icons/registry.js +64 -0
- package/src/icons/resolver.js +48 -0
- package/src/index.js +167 -0
- package/src/manifest.js +86 -0
- package/src/nuxt.js +315 -0
- package/src/style.css +20 -0
- package/src/tailwind.css +18 -0
- package/src/theme.css +172 -0
- package/src/vite.js +235 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prompt.js","names":["$slots"],"sources":["../../src/components/Prompt.vue"],"sourcesContent":["<template>\n <UiModal\n :show=\"show\"\n max-width=\"sm\"\n :fullscreen-mobile=\"fullscreenMobile\"\n :panel-class=\"panelClass\"\n @close=\"handleClose\"\n >\n <div\n ref=\"promptRef\"\n class=\"flex flex-col max-h-full\"\n :class=\"panelClass.includes('overflow-visible') ? 'overflow-visible' : 'overflow-hidden'\"\n @keydown=\"onKeydown\"\n >\n <div class=\"flex items-center justify-between p-4 pb-0 mb-3 shrink-0\">\n <div class=\"flex items-center gap-2\">\n <UiIcon v-if=\"icon\" :name=\"icon\" class=\"w-5 h-5\" :class=\"iconColorClass\" />\n <h2 class=\"text-sm font-semibold text-gray-900 dark:text-gray-200 leading-none\">\n {{ title }}\n </h2>\n </div>\n <UiButton variant=\"ghost\" color=\"gray\" icon-only @click=\"handleClose\">\n <UiIcon name=\"mdi:close\" class=\"block w-5 h-5\" />\n </UiButton>\n </div>\n\n <div\n v-if=\"body || $slots.default\"\n class=\"text-sm text-gray-600 dark:text-gray-400 mb-4 leading-relaxed px-4 min-h-0\"\n :class=\"panelClass.includes('overflow-visible') ? 'overflow-visible' : 'overflow-y-auto'\"\n >\n <slot>{{ body }}</slot>\n </div>\n\n <div class=\"flex justify-end gap-2 p-4 pt-0 shrink-0\">\n <slot name=\"actions\">\n <UiButton variant=\"ghost\" color=\"gray\" :disabled=\"loading\" @click=\"handleClose\">\n {{ cancelLabel }}\n </UiButton>\n <UiButton\n ref=\"confirmRef\"\n variant=\"solid\"\n :color=\"confirmColor\"\n :loading=\"loading\"\n @click=\"handleConfirm\"\n >\n {{ confirmLabel }}\n </UiButton>\n </slot>\n </div>\n </div>\n </UiModal>\n</template>\n\n<script setup>\n/**\n * UiPrompt — A modal prompt primitive for confirmations, choices, and user decisions.\n *\n * Wraps UiModal with a consistent header (icon + title + close), body content, and\n * action buttons. Handles keyboard (Escape to close, Enter to confirm), auto-focuses\n * the confirm button on open, and prevents double-submit while loading.\n *\n * For simple text prompts, use the `body` prop. For rich content, use the default slot.\n * Override the `#actions` slot for custom button layouts.\n *\n * @example Simple confirmation (props only, no slots needed)\n * <UiPrompt :show=\"confirming\" title=\"Delete item?\" body=\"This action cannot be undone.\"\n * icon=\"mdi:delete\" confirm-label=\"Delete\" confirm-color=\"red\"\n * @close=\"confirming = false\" @confirm=\"doDelete\" />\n *\n * @example Rich body content\n * <UiPrompt :show=\"open\" title=\"Warning\" @close=\"open = false\" @confirm=\"proceed\">\n * <p>This will affect <strong>{{ count }}</strong> items.</p>\n * </UiPrompt>\n *\n * @example Custom actions\n * <UiPrompt :show=\"choosing\" title=\"Export Options\" @close=\"choosing = false\">\n * Include results in the export?\n * <template #actions>\n * <UiButton variant=\"ghost\" color=\"gray\" @click=\"doExport(false)\">Without</UiButton>\n * <UiButton @click=\"doExport(true)\">With Results</UiButton>\n * </template>\n * </UiPrompt>\n *\n * @example Form prompt (disable Enter-to-confirm)\n * <UiPrompt :show=\"open\" title=\"New Group\" :confirm-on-enter=\"false\" @close=\"open = false\">\n * <UiInput v-model=\"name\" @keydown.enter=\"save\" />\n * </UiPrompt>\n */\nimport { ref, computed, watch, nextTick, useSlots } from 'vue'\nimport UiButton from './Button.vue'\nimport UiModal from './Modal.vue'\nimport UiIcon from '../icons/Icon.vue'\nconst props = defineProps({\n /** Controls prompt visibility. */\n show: { type: Boolean, default: false },\n /** Prompt heading text. */\n title: { type: String, default: 'Confirm' },\n /** Optional icon name displayed before the title. */\n icon: { type: String, default: null },\n /** Plain text body content. Ignored when the default slot is used. */\n body: { type: String, default: null },\n /** Label for the confirm button (default actions only). */\n confirmLabel: { type: String, default: 'Confirm' },\n /** Label for the cancel button (default actions only). */\n cancelLabel: { type: String, default: 'Cancel' },\n /** Color of the confirm button and icon. */\n confirmColor: { type: String, default: 'primary' },\n /** Shows a loading spinner on the confirm button and prevents double-submit. */\n loading: { type: Boolean, default: false },\n /** Whether pressing Enter triggers confirm. Disable for form-based prompts. */\n confirmOnEnter: { type: Boolean, default: true },\n /** Whether the prompt goes fullscreen on mobile viewports. */\n fullscreenMobile: { type: Boolean, default: false },\n /** Additional CSS class(es) applied to the modal panel element. */\n panelClass: { type: String, default: '' },\n})\n\nconst emit = defineEmits(['close', 'confirm'])\n\nconst confirmRef = ref(null)\nconst hasCustomActions = computed(() => !!useSlots().actions)\n\nconst iconColorClass = computed(() => {\n const map = {\n red: 'text-red-600 dark:text-red-400',\n amber: 'text-amber-600 dark:text-amber-400',\n primary: 'text-primary-600 dark:text-primary-400',\n gray: 'text-gray-500 dark:text-gray-400',\n }\n return map[props.confirmColor] || map.primary\n})\n\nconst handleClose = () => {\n if (!props.loading) emit('close')\n}\n\nconst handleConfirm = () => {\n if (!props.loading) emit('confirm')\n}\n\nconst onKeydown = (e) => {\n if (e.key === 'Enter' && props.confirmOnEnter && !hasCustomActions.value && !props.loading) {\n e.preventDefault()\n handleConfirm()\n }\n}\n\n// Auto-focus confirm button when prompt opens\nwatch(\n () => props.show,\n (open) => {\n if (open) {\n nextTick(() => {\n const el = confirmRef.value?.$el ?? confirmRef.value\n if (el instanceof HTMLElement) el.focus()\n })\n }\n },\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6FA,MAAM,QAAQ;EAyBd,MAAM,OAAO;EAEb,MAAM,aAAa,IAAI,IAAI;EAC3B,MAAM,mBAAmB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO;EAE5D,MAAM,iBAAiB,eAAe;GACpC,MAAM,MAAM;IACV,KAAK;IACL,OAAO;IACP,SAAS;IACT,MAAM;GACR;GACA,OAAO,IAAI,MAAM,iBAAiB,IAAI;EACxC,CAAC;EAED,MAAM,oBAAoB;GACxB,IAAI,CAAC,MAAM,SAAS,KAAK,OAAO;EAClC;EAEA,MAAM,sBAAsB;GAC1B,IAAI,CAAC,MAAM,SAAS,KAAK,SAAS;EACpC;EAEA,MAAM,aAAa,MAAM;GACvB,IAAI,EAAE,QAAQ,WAAW,MAAM,kBAAkB,CAAC,iBAAiB,SAAS,CAAC,MAAM,SAAS;IAC1F,EAAE,eAAe;IACjB,cAAc;GAChB;EACF;EAGA,YACQ,MAAM,OACX,SAAS;GACR,IAAI,MACF,eAAe;IACb,MAAM,KAAK,WAAW,OAAO,OAAO,WAAW;IAC/C,IAAI,cAAc,aAAa,GAAG,MAAM;GAC1C,CAAC;EAEL,CACF;;GA9JE,OAAA,UAAA,GAAA,YAkDU,aAAA;IAjDP,MAAM,Q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AAA;MAPL,SAAA;MAAJ,KAAI;MACJ,SAAQ;MACP,OAAO,QAAA;MACP,SAAS,QAAA;MACT,SAAO;;MAER,SAAA,cAAkB,CAAf,gBAAA,gBAAA,QAAA,YAAY,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { computed, createElementBlock, normalizeClass, openBlock } from "vue";
|
|
2
|
+
//#region src/components/Radio.vue
|
|
3
|
+
var _hoisted_1 = [
|
|
4
|
+
"checked",
|
|
5
|
+
"disabled",
|
|
6
|
+
"name",
|
|
7
|
+
"value"
|
|
8
|
+
];
|
|
9
|
+
var _sfc_main = {
|
|
10
|
+
__name: "Radio",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: [
|
|
14
|
+
String,
|
|
15
|
+
Number,
|
|
16
|
+
Boolean
|
|
17
|
+
],
|
|
18
|
+
default: null
|
|
19
|
+
},
|
|
20
|
+
value: {
|
|
21
|
+
type: [
|
|
22
|
+
String,
|
|
23
|
+
Number,
|
|
24
|
+
Boolean
|
|
25
|
+
],
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
name: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "md"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
emits: ["update:modelValue"],
|
|
42
|
+
setup(__props, { emit: __emit }) {
|
|
43
|
+
/**
|
|
44
|
+
* UiRadio — Simple styled radio input with configurable size.
|
|
45
|
+
*
|
|
46
|
+
* Wraps a native `<input type="radio">` with consistent Tailwind styling,
|
|
47
|
+
* primary color accent, and focus ring. Use with v-model for group selection.
|
|
48
|
+
*
|
|
49
|
+
* @example Radio group
|
|
50
|
+
* <UiRadio v-model="selected" value="a" name="choice" />
|
|
51
|
+
* <UiRadio v-model="selected" value="b" name="choice" />
|
|
52
|
+
*/
|
|
53
|
+
const props = __props;
|
|
54
|
+
const emit = __emit;
|
|
55
|
+
const sizeClass = computed(() => {
|
|
56
|
+
switch (props.size) {
|
|
57
|
+
case "sm": return "w-3.5 h-3.5";
|
|
58
|
+
case "lg": return "w-5 h-5";
|
|
59
|
+
default: return "w-4 h-4";
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
function onChange() {
|
|
63
|
+
emit("update:modelValue", props.value);
|
|
64
|
+
}
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return openBlock(), createElementBlock("input", {
|
|
67
|
+
type: "radio",
|
|
68
|
+
checked: __props.modelValue === __props.value,
|
|
69
|
+
disabled: __props.disabled,
|
|
70
|
+
name: __props.name,
|
|
71
|
+
value: __props.value,
|
|
72
|
+
class: normalizeClass(["rounded-full border-gray-300 dark:border-gray-600 text-primary-600 focus:ring-primary-500", sizeClass.value]),
|
|
73
|
+
onChange
|
|
74
|
+
}, null, 42, _hoisted_1);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { _sfc_main as default };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=Radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.js","names":[],"sources":["../../src/components/Radio.vue"],"sourcesContent":["<template>\n <input\n type=\"radio\"\n :checked=\"modelValue === value\"\n :disabled=\"disabled\"\n :name=\"name\"\n :value=\"value\"\n class=\"rounded-full border-gray-300 dark:border-gray-600 text-primary-600 focus:ring-primary-500\"\n :class=\"sizeClass\"\n @change=\"onChange\"\n />\n</template>\n\n<script setup>\n/**\n * UiRadio — Simple styled radio input with configurable size.\n *\n * Wraps a native `<input type=\"radio\">` with consistent Tailwind styling,\n * primary color accent, and focus ring. Use with v-model for group selection.\n *\n * @example Radio group\n * <UiRadio v-model=\"selected\" value=\"a\" name=\"choice\" />\n * <UiRadio v-model=\"selected\" value=\"b\" name=\"choice\" />\n */\nimport { computed } from 'vue'\nconst props = defineProps({\n modelValue: { type: [String, Number, Boolean], default: null },\n value: { type: [String, Number, Boolean], required: true },\n name: { type: String, default: undefined },\n disabled: { type: Boolean, default: false },\n size: { type: String, default: 'md' },\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst sizeClass = computed(() => {\n switch (props.size) {\n case 'sm':\n return 'w-3.5 h-3.5'\n case 'lg':\n return 'w-5 h-5'\n default:\n return 'w-4 h-4'\n }\n})\n\nfunction onChange() {\n emit('update:modelValue', props.value)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBA,MAAM,QAAQ;EAQd,MAAM,OAAO;EAEb,MAAM,YAAY,eAAe;GAC/B,QAAQ,MAAM,MAAd;IACE,KAAK,MACH,OAAO;IACT,KAAK,MACH,OAAO;IACT,SACE,OAAO;GACX;EACF,CAAC;EAED,SAAS,WAAW;GAClB,KAAK,qBAAqB,MAAM,KAAK;EACvC;;GA/CE,OAAA,UAAA,GAAA,mBASE,SAAA;IARA,MAAK;IACJ,SAAS,QAAA,eAAe,QAAA;IACxB,UAAU,QAAA;IACV,MAAM,QAAA;IACN,OAAO,QAAA;IACR,OAAK,eAAA,CAAC,6FACE,UAAA,KAAS,CAAA;IACR"}
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icons/Icon.js";
|
|
2
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, toDisplayString, vModelText, vShow, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
|
+
//#region src/components/Select.vue
|
|
4
|
+
var _hoisted_1 = { class: "inline-flex items-center gap-2" };
|
|
5
|
+
var _hoisted_2 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "w-4"
|
|
8
|
+
};
|
|
9
|
+
var _hoisted_3 = ["disabled", "aria-label"];
|
|
10
|
+
var _hoisted_4 = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "flex items-center gap-2 truncate text-gray-400 dark:text-gray-500"
|
|
13
|
+
};
|
|
14
|
+
var _hoisted_5 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "p-1.5"
|
|
17
|
+
};
|
|
18
|
+
var _hoisted_6 = ["onKeydown"];
|
|
19
|
+
var _hoisted_7 = { class: "max-h-64 overflow-y-auto py-1" };
|
|
20
|
+
var _hoisted_8 = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "px-3 py-2 text-sm text-gray-400 dark:text-gray-500"
|
|
23
|
+
};
|
|
24
|
+
var _hoisted_9 = ["onClick"];
|
|
25
|
+
var _hoisted_10 = { class: "min-w-0" };
|
|
26
|
+
var _hoisted_11 = { class: "block truncate text-sm" };
|
|
27
|
+
var _hoisted_12 = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "block truncate text-[11px] text-gray-400 dark:text-gray-500 leading-tight"
|
|
30
|
+
};
|
|
31
|
+
var _hoisted_13 = { class: "px-3 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400 dark:text-gray-500 select-none" };
|
|
32
|
+
var _hoisted_14 = ["onClick"];
|
|
33
|
+
var _hoisted_15 = { class: "min-w-0" };
|
|
34
|
+
var _hoisted_16 = { class: "block truncate text-sm" };
|
|
35
|
+
var _hoisted_17 = {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: "block truncate text-[11px] text-gray-400 dark:text-gray-500 leading-tight"
|
|
38
|
+
};
|
|
39
|
+
var _sfc_main = {
|
|
40
|
+
__name: "Select",
|
|
41
|
+
props: {
|
|
42
|
+
/**
|
|
43
|
+
* Currently selected value (v-model).
|
|
44
|
+
* @type {string | number | boolean | null}
|
|
45
|
+
* @default ''
|
|
46
|
+
*/
|
|
47
|
+
modelValue: {
|
|
48
|
+
type: [
|
|
49
|
+
String,
|
|
50
|
+
Number,
|
|
51
|
+
Boolean,
|
|
52
|
+
null
|
|
53
|
+
],
|
|
54
|
+
default: ""
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Array of selectable options. Each item can be:
|
|
58
|
+
* - A primitive (string/number) used as both value and label
|
|
59
|
+
* - An object: `{ value, label, icon?, group? }`
|
|
60
|
+
* @type {Array}
|
|
61
|
+
* @default []
|
|
62
|
+
*/
|
|
63
|
+
options: {
|
|
64
|
+
type: Array,
|
|
65
|
+
default: () => []
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* Placeholder text shown when no option is selected.
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @default ''
|
|
71
|
+
*/
|
|
72
|
+
placeholder: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ""
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Enable a search input inside the dropdown for filtering options.
|
|
78
|
+
* @type {boolean}
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
searchable: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Disabled state — dims the trigger and prevents opening.
|
|
87
|
+
* @type {boolean}
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
disabled: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: false
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Trigger button size controlling padding and font.
|
|
96
|
+
* @type {string}
|
|
97
|
+
* @default 'md'
|
|
98
|
+
* @values 'xs' | 'sm' | 'md'
|
|
99
|
+
*/
|
|
100
|
+
size: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: "md"
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Full-width mode — trigger stretches to fill its container.
|
|
106
|
+
* @type {boolean}
|
|
107
|
+
* @default true
|
|
108
|
+
*/
|
|
109
|
+
block: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Accessible label for the trigger button.
|
|
115
|
+
* @type {string}
|
|
116
|
+
* @default undefined
|
|
117
|
+
*/
|
|
118
|
+
ariaLabel: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: void 0
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* Loading state — shows a spinner and disables interaction.
|
|
124
|
+
* @type {boolean}
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
loading: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: false
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* Text displayed next to the spinner during loading.
|
|
133
|
+
* @type {string}
|
|
134
|
+
* @default 'Loading...'
|
|
135
|
+
*/
|
|
136
|
+
loadingText: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: "Loading..."
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* MDI icon name for the loading spinner.
|
|
142
|
+
* @type {string}
|
|
143
|
+
* @default 'mdi:loading'
|
|
144
|
+
*/
|
|
145
|
+
spinner: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: "mdi:loading"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
emits: ["update:modelValue"],
|
|
151
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
152
|
+
/**
|
|
153
|
+
* UiSelect — Custom dropdown select component with search, grouping, icons, and loading state.
|
|
154
|
+
*
|
|
155
|
+
* Renders a styled trigger button that opens a dropdown panel with filterable options.
|
|
156
|
+
* Supports flat option lists and grouped options (via `group` key on option objects).
|
|
157
|
+
* Includes keyboard navigation (Escape to close, Enter to select first match),
|
|
158
|
+
* automatic drop-up when near the bottom of the viewport, and a loading spinner state.
|
|
159
|
+
*
|
|
160
|
+
* @example Basic select
|
|
161
|
+
* <UiSelect v-model="color" :options="['Red', 'Green', 'Blue']" placeholder="Pick a color" />
|
|
162
|
+
*
|
|
163
|
+
* @example Searchable select with object options
|
|
164
|
+
* <UiSelect v-model="lang" :options="[{ value: 'en', label: 'English' }, { value: 'es', label: 'Spanish' }]" searchable />
|
|
165
|
+
*
|
|
166
|
+
* @example Grouped options with icons
|
|
167
|
+
* <UiSelect v-model="tool" :options="[
|
|
168
|
+
* { value: 'pen', label: 'Pen', icon: 'mdi:pen', group: 'Drawing' },
|
|
169
|
+
* { value: 'eraser', label: 'Eraser', icon: 'mdi:eraser', group: 'Drawing' },
|
|
170
|
+
* { value: 'text', label: 'Text', icon: 'mdi:format-text', group: 'Insert' },
|
|
171
|
+
* ]" searchable />
|
|
172
|
+
*
|
|
173
|
+
* @example Loading state
|
|
174
|
+
* <UiSelect v-model="val" :options="[]" :loading="true" loading-text="Fetching..." />
|
|
175
|
+
*
|
|
176
|
+
* @emits {string | number | boolean} update:modelValue — Emitted when an option is selected
|
|
177
|
+
*/
|
|
178
|
+
const props = __props;
|
|
179
|
+
const emit = __emit;
|
|
180
|
+
const containerRef = ref(null);
|
|
181
|
+
const triggerRef = ref(null);
|
|
182
|
+
const searchRef = ref(null);
|
|
183
|
+
const sizerRef = ref(null);
|
|
184
|
+
const panelRef = ref(null);
|
|
185
|
+
const isOpen = ref(false);
|
|
186
|
+
const searchQuery = ref("");
|
|
187
|
+
const measuredWidth = ref(0);
|
|
188
|
+
const panelStyle = ref({});
|
|
189
|
+
const reposition = () => {
|
|
190
|
+
const el = triggerRef.value;
|
|
191
|
+
if (!el) return;
|
|
192
|
+
const rect = el.getBoundingClientRect();
|
|
193
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
194
|
+
const openUp = spaceBelow < 260 && rect.top > spaceBelow;
|
|
195
|
+
const style = {
|
|
196
|
+
left: `${rect.left}px`,
|
|
197
|
+
minWidth: `${rect.width}px`
|
|
198
|
+
};
|
|
199
|
+
if (props.block) style.width = `${rect.width}px`;
|
|
200
|
+
if (openUp) style.bottom = `${window.innerHeight - rect.top + 4}px`;
|
|
201
|
+
else style.top = `${rect.bottom + 4}px`;
|
|
202
|
+
panelStyle.value = style;
|
|
203
|
+
};
|
|
204
|
+
const startTracking = () => {
|
|
205
|
+
window.addEventListener("scroll", reposition, true);
|
|
206
|
+
window.addEventListener("resize", reposition);
|
|
207
|
+
};
|
|
208
|
+
const stopTracking = () => {
|
|
209
|
+
window.removeEventListener("scroll", reposition, true);
|
|
210
|
+
window.removeEventListener("resize", reposition);
|
|
211
|
+
};
|
|
212
|
+
const sizerTextClass = computed(() => {
|
|
213
|
+
return {
|
|
214
|
+
xs: "text-xs",
|
|
215
|
+
sm: "text-sm",
|
|
216
|
+
md: "text-sm"
|
|
217
|
+
}[props.size] || "text-sm";
|
|
218
|
+
});
|
|
219
|
+
const measureSizer = () => {
|
|
220
|
+
if (!sizerRef.value) {
|
|
221
|
+
measuredWidth.value = 0;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
measuredWidth.value = sizerRef.value.scrollWidth;
|
|
225
|
+
};
|
|
226
|
+
onMounted(measureSizer);
|
|
227
|
+
watch(() => props.options, () => nextTick(measureSizer), { deep: true });
|
|
228
|
+
const autoMinWidth = computed(() => {
|
|
229
|
+
if (!measuredWidth.value) return void 0;
|
|
230
|
+
const pad = {
|
|
231
|
+
xs: 28,
|
|
232
|
+
sm: 24,
|
|
233
|
+
md: 30
|
|
234
|
+
}[props.size] || 30;
|
|
235
|
+
return { minWidth: `${measuredWidth.value + pad}px` };
|
|
236
|
+
});
|
|
237
|
+
const normalizedOptions = computed(() => props.options.map((opt) => typeof opt === "object" && opt !== null ? {
|
|
238
|
+
value: opt.value,
|
|
239
|
+
label: opt.label ?? String(opt.value),
|
|
240
|
+
subtitle: opt.subtitle || "",
|
|
241
|
+
icon: opt.icon || "",
|
|
242
|
+
group: opt.group || ""
|
|
243
|
+
} : {
|
|
244
|
+
value: opt,
|
|
245
|
+
label: String(opt),
|
|
246
|
+
subtitle: "",
|
|
247
|
+
icon: "",
|
|
248
|
+
group: ""
|
|
249
|
+
}));
|
|
250
|
+
const filteredNormalized = computed(() => {
|
|
251
|
+
if (!searchQuery.value) return normalizedOptions.value;
|
|
252
|
+
const q = searchQuery.value.toLowerCase();
|
|
253
|
+
return normalizedOptions.value.filter((opt) => opt.label.toLowerCase().includes(q) || opt.subtitle.toLowerCase().includes(q));
|
|
254
|
+
});
|
|
255
|
+
const hasGroups = computed(() => normalizedOptions.value.some((o) => o.group));
|
|
256
|
+
const filteredGroups = computed(() => {
|
|
257
|
+
if (!hasGroups.value) return [];
|
|
258
|
+
const map = /* @__PURE__ */ new Map();
|
|
259
|
+
for (const opt of filteredNormalized.value) {
|
|
260
|
+
const key = opt.group || "";
|
|
261
|
+
if (!map.has(key)) map.set(key, {
|
|
262
|
+
label: key,
|
|
263
|
+
options: []
|
|
264
|
+
});
|
|
265
|
+
map.get(key).options.push(opt);
|
|
266
|
+
}
|
|
267
|
+
return [...map.values()].filter((g) => g.options.length > 0);
|
|
268
|
+
});
|
|
269
|
+
const filteredOptions = computed(() => {
|
|
270
|
+
if (hasGroups.value) return [];
|
|
271
|
+
return filteredNormalized.value;
|
|
272
|
+
});
|
|
273
|
+
const selectedOpt = computed(() => normalizedOptions.value.find((o) => o.value === props.modelValue));
|
|
274
|
+
const selectedLabel = computed(() => selectedOpt.value?.label || "");
|
|
275
|
+
const selectedIcon = computed(() => selectedOpt.value?.icon || "");
|
|
276
|
+
const triggerClasses = computed(() => {
|
|
277
|
+
const base = "flex items-center justify-between gap-2 text-left border bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-400 outline-none transition-colors focus:ring-2 focus:ring-primary-500 focus:border-primary-500";
|
|
278
|
+
const width = props.block ? "w-full" : "";
|
|
279
|
+
const sizeMap = {
|
|
280
|
+
xs: "px-2.5 py-1.5 text-xs rounded-md border-gray-200 dark:border-gray-700",
|
|
281
|
+
sm: "px-2 py-1 text-sm rounded-lg border-gray-300 dark:border-gray-600",
|
|
282
|
+
md: "px-3 py-2 text-sm rounded-lg border-gray-300 dark:border-gray-700"
|
|
283
|
+
};
|
|
284
|
+
return `${base} ${width} ${sizeMap[props.size] || sizeMap.md}`;
|
|
285
|
+
});
|
|
286
|
+
const optionClass = (value) => props.modelValue === value ? "bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700";
|
|
287
|
+
const toggleOpen = () => {
|
|
288
|
+
if (props.disabled || props.loading) return;
|
|
289
|
+
isOpen.value = !isOpen.value;
|
|
290
|
+
if (isOpen.value) {
|
|
291
|
+
searchQuery.value = "";
|
|
292
|
+
reposition();
|
|
293
|
+
startTracking();
|
|
294
|
+
nextTick(() => {
|
|
295
|
+
reposition();
|
|
296
|
+
if (props.searchable) searchRef.value?.focus();
|
|
297
|
+
});
|
|
298
|
+
} else stopTracking();
|
|
299
|
+
};
|
|
300
|
+
const select = (value) => {
|
|
301
|
+
emit("update:modelValue", value);
|
|
302
|
+
close();
|
|
303
|
+
};
|
|
304
|
+
const selectFirst = () => {
|
|
305
|
+
const pool = hasGroups.value ? filteredGroups.value.flatMap((g) => g.options) : filteredOptions.value;
|
|
306
|
+
if (pool.length) select(pool[0].value);
|
|
307
|
+
};
|
|
308
|
+
const close = () => {
|
|
309
|
+
isOpen.value = false;
|
|
310
|
+
searchQuery.value = "";
|
|
311
|
+
stopTracking();
|
|
312
|
+
};
|
|
313
|
+
let skipNextOpen = false;
|
|
314
|
+
const toggle = () => {
|
|
315
|
+
if (props.disabled || props.loading) return;
|
|
316
|
+
if (skipNextOpen) {
|
|
317
|
+
skipNextOpen = false;
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
toggleOpen();
|
|
321
|
+
};
|
|
322
|
+
const closeFromOutside = () => {
|
|
323
|
+
if (isOpen.value) skipNextOpen = true;
|
|
324
|
+
close();
|
|
325
|
+
setTimeout(() => {
|
|
326
|
+
skipNextOpen = false;
|
|
327
|
+
}, 0);
|
|
328
|
+
};
|
|
329
|
+
const onDocumentClick = (e) => {
|
|
330
|
+
if (containerRef.value?.contains(e.target)) return;
|
|
331
|
+
if (panelRef.value?.contains(e.target)) return;
|
|
332
|
+
closeFromOutside();
|
|
333
|
+
};
|
|
334
|
+
onMounted(() => document.addEventListener("click", onDocumentClick, true));
|
|
335
|
+
onBeforeUnmount(() => {
|
|
336
|
+
document.removeEventListener("click", onDocumentClick, true);
|
|
337
|
+
stopTracking();
|
|
338
|
+
});
|
|
339
|
+
__expose({
|
|
340
|
+
toggle,
|
|
341
|
+
close,
|
|
342
|
+
isOpen
|
|
343
|
+
});
|
|
344
|
+
return (_ctx, _cache) => {
|
|
345
|
+
return openBlock(), createElementBlock("div", {
|
|
346
|
+
ref_key: "containerRef",
|
|
347
|
+
ref: containerRef,
|
|
348
|
+
class: normalizeClass(["relative", !__props.block ? "inline-block" : ""])
|
|
349
|
+
}, [
|
|
350
|
+
createElementVNode("div", {
|
|
351
|
+
ref_key: "sizerRef",
|
|
352
|
+
ref: sizerRef,
|
|
353
|
+
"aria-hidden": "true",
|
|
354
|
+
class: normalizeClass(["invisible absolute h-0 overflow-hidden pointer-events-none whitespace-nowrap", sizerTextClass.value])
|
|
355
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(normalizedOptions.value, (opt) => {
|
|
356
|
+
return openBlock(), createElementBlock("span", {
|
|
357
|
+
key: opt.value,
|
|
358
|
+
class: "block"
|
|
359
|
+
}, [createElementVNode("span", _hoisted_1, [
|
|
360
|
+
opt.icon ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true),
|
|
361
|
+
createTextVNode(" " + toDisplayString(opt.label) + " ", 1),
|
|
362
|
+
_cache[1] || (_cache[1] = createElementVNode("span", { class: "w-4" }, null, -1))
|
|
363
|
+
])]);
|
|
364
|
+
}), 128))], 2),
|
|
365
|
+
createElementVNode("button", {
|
|
366
|
+
ref_key: "triggerRef",
|
|
367
|
+
ref: triggerRef,
|
|
368
|
+
type: "button",
|
|
369
|
+
disabled: __props.disabled || __props.loading,
|
|
370
|
+
"aria-label": __props.ariaLabel,
|
|
371
|
+
class: normalizeClass([triggerClasses.value, __props.disabled || __props.loading ? "opacity-50 cursor-not-allowed" : ""]),
|
|
372
|
+
style: normalizeStyle(autoMinWidth.value),
|
|
373
|
+
onClick: toggleOpen
|
|
374
|
+
}, [__props.loading ? (openBlock(), createElementBlock("span", _hoisted_4, [createVNode(_sfc_main$1, {
|
|
375
|
+
name: __props.spinner,
|
|
376
|
+
class: "w-4 h-4 animate-spin shrink-0"
|
|
377
|
+
}, null, 8, ["name"]), createElementVNode("span", null, toDisplayString(__props.loadingText), 1)])) : (openBlock(), createElementBlock("span", {
|
|
378
|
+
key: 1,
|
|
379
|
+
class: normalizeClass(["flex items-center gap-2 truncate", selectedLabel.value ? "" : "text-gray-400 dark:text-gray-500"])
|
|
380
|
+
}, [selectedIcon.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
381
|
+
key: 0,
|
|
382
|
+
name: selectedIcon.value,
|
|
383
|
+
class: "w-4 h-4 shrink-0"
|
|
384
|
+
}, null, 8, ["name"])) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(selectedLabel.value || __props.placeholder || "Select..."), 1)], 2)), createVNode(_sfc_main$1, {
|
|
385
|
+
name: "mdi:chevron-down",
|
|
386
|
+
class: normalizeClass(["w-4 h-4 shrink-0 text-gray-400 transition-transform", { "rotate-180": isOpen.value }])
|
|
387
|
+
}, null, 8, ["class"])], 14, _hoisted_3),
|
|
388
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [createVNode(Transition, {
|
|
389
|
+
"enter-active-class": "transition duration-100 ease-out",
|
|
390
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
391
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
392
|
+
"leave-active-class": "transition duration-75 ease-in",
|
|
393
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
394
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
395
|
+
}, {
|
|
396
|
+
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
397
|
+
ref_key: "panelRef",
|
|
398
|
+
ref: panelRef,
|
|
399
|
+
class: "fixed z-[60] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",
|
|
400
|
+
style: normalizeStyle(panelStyle.value)
|
|
401
|
+
}, [__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_5, [withDirectives(createElementVNode("input", {
|
|
402
|
+
ref_key: "searchRef",
|
|
403
|
+
ref: searchRef,
|
|
404
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
|
|
405
|
+
type: "text",
|
|
406
|
+
placeholder: "Search...",
|
|
407
|
+
class: "w-full px-2.5 py-1.5 text-sm border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-300 outline-none focus:ring-1 focus:ring-primary-500 placeholder-gray-400",
|
|
408
|
+
onKeydown: [withKeys(close, ["escape"]), withKeys(withModifiers(selectFirst, ["prevent"]), ["enter"])]
|
|
409
|
+
}, null, 40, _hoisted_6), [[vModelText, searchQuery.value]])])) : createCommentVNode("", true), createElementVNode("ul", _hoisted_7, [filteredOptions.value.length === 0 && filteredGroups.value.length === 0 ? (openBlock(), createElementBlock("li", _hoisted_8, " No results ")) : createCommentVNode("", true), filteredGroups.value.length === 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(filteredOptions.value, (opt) => {
|
|
410
|
+
return openBlock(), createElementBlock("li", {
|
|
411
|
+
key: opt.value,
|
|
412
|
+
class: normalizeClass(["flex items-center gap-2 px-3 cursor-pointer transition-colors", [optionClass(opt.value), opt.subtitle ? "py-1.5" : "py-1.5"]]),
|
|
413
|
+
onClick: ($event) => select(opt.value)
|
|
414
|
+
}, [opt.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
415
|
+
key: 0,
|
|
416
|
+
name: opt.icon,
|
|
417
|
+
class: "w-4 h-4 shrink-0"
|
|
418
|
+
}, null, 8, ["name"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_10, [createElementVNode("span", _hoisted_11, toDisplayString(opt.label), 1), opt.subtitle ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(opt.subtitle), 1)) : createCommentVNode("", true)])], 10, _hoisted_9);
|
|
419
|
+
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(filteredGroups.value, (group) => {
|
|
420
|
+
return openBlock(), createElementBlock(Fragment, { key: group.label }, [createElementVNode("li", _hoisted_13, toDisplayString(group.label), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (opt) => {
|
|
421
|
+
return openBlock(), createElementBlock("li", {
|
|
422
|
+
key: opt.value,
|
|
423
|
+
class: normalizeClass(["flex items-center gap-2 px-3 cursor-pointer transition-colors", [optionClass(opt.value), opt.subtitle ? "py-1.5" : "py-1.5"]]),
|
|
424
|
+
onClick: ($event) => select(opt.value)
|
|
425
|
+
}, [opt.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
426
|
+
key: 0,
|
|
427
|
+
name: opt.icon,
|
|
428
|
+
class: "w-4 h-4 shrink-0"
|
|
429
|
+
}, null, 8, ["name"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_15, [createElementVNode("span", _hoisted_16, toDisplayString(opt.label), 1), opt.subtitle ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(opt.subtitle), 1)) : createCommentVNode("", true)])], 10, _hoisted_14);
|
|
430
|
+
}), 128))], 64);
|
|
431
|
+
}), 128))])], 4), [[vShow, isOpen.value]])]),
|
|
432
|
+
_: 1
|
|
433
|
+
})]))
|
|
434
|
+
], 2);
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
//#endregion
|
|
439
|
+
export { _sfc_main as default };
|
|
440
|
+
|
|
441
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","names":[],"sources":["../../src/components/Select.vue"],"sourcesContent":["<template>\n <div ref=\"containerRef\" class=\"relative\" :class=\"!block ? 'inline-block' : ''\">\n <!-- Hidden sizer: measures the widest option label so the trigger never shrinks below it -->\n <div\n ref=\"sizerRef\"\n aria-hidden=\"true\"\n class=\"invisible absolute h-0 overflow-hidden pointer-events-none whitespace-nowrap\"\n :class=\"sizerTextClass\"\n >\n <span v-for=\"opt in normalizedOptions\" :key=\"opt.value\" class=\"block\">\n <span class=\"inline-flex items-center gap-2\">\n <span v-if=\"opt.icon\" class=\"w-4\" />\n {{ opt.label }}\n <!-- account for chevron + padding -->\n <span class=\"w-4\" />\n </span>\n </span>\n </div>\n\n <!-- Trigger button: shows selected value, placeholder, or loading spinner -->\n <button\n ref=\"triggerRef\"\n type=\"button\"\n :disabled=\"disabled || loading\"\n :aria-label=\"ariaLabel\"\n :class=\"[triggerClasses, disabled || loading ? 'opacity-50 cursor-not-allowed' : '']\"\n :style=\"autoMinWidth\"\n @click=\"toggleOpen\"\n >\n <span\n v-if=\"loading\"\n class=\"flex items-center gap-2 truncate text-gray-400 dark:text-gray-500\"\n >\n <UiIcon :name=\"spinner\" class=\"w-4 h-4 animate-spin shrink-0\" />\n <span>{{ loadingText }}</span>\n </span>\n <template v-else>\n <span\n class=\"flex items-center gap-2 truncate\"\n :class=\"selectedLabel ? '' : 'text-gray-400 dark:text-gray-500'\"\n >\n <UiIcon v-if=\"selectedIcon\" :name=\"selectedIcon\" class=\"w-4 h-4 shrink-0\" />\n {{ selectedLabel || placeholder || 'Select...' }}\n </span>\n </template>\n <UiIcon\n name=\"mdi:chevron-down\"\n class=\"w-4 h-4 shrink-0 text-gray-400 transition-transform\"\n :class=\"{ 'rotate-180': isOpen }\"\n />\n </button>\n\n <!-- Dropdown panel: teleported to <body> and fixed-positioned so it is never\n clipped by an ancestor with overflow (e.g. a scrollable modal body). -->\n <Teleport to=\"body\">\n <Transition\n enter-active-class=\"transition duration-100 ease-out\"\n enter-from-class=\"opacity-0 scale-95\"\n enter-to-class=\"opacity-100 scale-100\"\n leave-active-class=\"transition duration-75 ease-in\"\n leave-from-class=\"opacity-100 scale-100\"\n leave-to-class=\"opacity-0 scale-95\"\n >\n <div\n v-show=\"isOpen\"\n ref=\"panelRef\"\n class=\"fixed z-[60] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden\"\n :style=\"panelStyle\"\n >\n <!-- Search input for filtering options -->\n <div v-if=\"searchable\" class=\"p-1.5\">\n <input\n ref=\"searchRef\"\n v-model=\"searchQuery\"\n type=\"text\"\n placeholder=\"Search...\"\n class=\"w-full px-2.5 py-1.5 text-sm border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-300 outline-none focus:ring-1 focus:ring-primary-500 placeholder-gray-400\"\n @keydown.escape=\"close\"\n @keydown.enter.prevent=\"selectFirst\"\n />\n </div>\n <!-- Options list: ungrouped flat list or grouped sections -->\n <ul class=\"max-h-64 overflow-y-auto py-1\">\n <li\n v-if=\"filteredOptions.length === 0 && filteredGroups.length === 0\"\n class=\"px-3 py-2 text-sm text-gray-400 dark:text-gray-500\"\n >\n No results\n </li>\n\n <!-- Ungrouped options -->\n <template v-if=\"filteredGroups.length === 0\">\n <li\n v-for=\"opt in filteredOptions\"\n :key=\"opt.value\"\n class=\"flex items-center gap-2 px-3 cursor-pointer transition-colors\"\n :class=\"[optionClass(opt.value), opt.subtitle ? 'py-1.5' : 'py-1.5']\"\n @click=\"select(opt.value)\"\n >\n <UiIcon v-if=\"opt.icon\" :name=\"opt.icon\" class=\"w-4 h-4 shrink-0\" />\n <div class=\"min-w-0\">\n <span class=\"block truncate text-sm\">{{ opt.label }}</span>\n <span\n v-if=\"opt.subtitle\"\n class=\"block truncate text-[11px] text-gray-400 dark:text-gray-500 leading-tight\"\n >{{ opt.subtitle }}</span\n >\n </div>\n </li>\n </template>\n\n <!-- Grouped options -->\n <template v-else>\n <template v-for=\"group in filteredGroups\" :key=\"group.label\">\n <li\n class=\"px-3 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wider text-gray-400 dark:text-gray-500 select-none\"\n >\n {{ group.label }}\n </li>\n <li\n v-for=\"opt in group.options\"\n :key=\"opt.value\"\n class=\"flex items-center gap-2 px-3 cursor-pointer transition-colors\"\n :class=\"[optionClass(opt.value), opt.subtitle ? 'py-1.5' : 'py-1.5']\"\n @click=\"select(opt.value)\"\n >\n <UiIcon v-if=\"opt.icon\" :name=\"opt.icon\" class=\"w-4 h-4 shrink-0\" />\n <div class=\"min-w-0\">\n <span class=\"block truncate text-sm\">{{ opt.label }}</span>\n <span\n v-if=\"opt.subtitle\"\n class=\"block truncate text-[11px] text-gray-400 dark:text-gray-500 leading-tight\"\n >{{ opt.subtitle }}</span\n >\n </div>\n </li>\n </template>\n </template>\n </ul>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n\n<script setup>\n/**\n * UiSelect — Custom dropdown select component with search, grouping, icons, and loading state.\n *\n * Renders a styled trigger button that opens a dropdown panel with filterable options.\n * Supports flat option lists and grouped options (via `group` key on option objects).\n * Includes keyboard navigation (Escape to close, Enter to select first match),\n * automatic drop-up when near the bottom of the viewport, and a loading spinner state.\n *\n * @example Basic select\n * <UiSelect v-model=\"color\" :options=\"['Red', 'Green', 'Blue']\" placeholder=\"Pick a color\" />\n *\n * @example Searchable select with object options\n * <UiSelect v-model=\"lang\" :options=\"[{ value: 'en', label: 'English' }, { value: 'es', label: 'Spanish' }]\" searchable />\n *\n * @example Grouped options with icons\n * <UiSelect v-model=\"tool\" :options=\"[\n * { value: 'pen', label: 'Pen', icon: 'mdi:pen', group: 'Drawing' },\n * { value: 'eraser', label: 'Eraser', icon: 'mdi:eraser', group: 'Drawing' },\n * { value: 'text', label: 'Text', icon: 'mdi:format-text', group: 'Insert' },\n * ]\" searchable />\n *\n * @example Loading state\n * <UiSelect v-model=\"val\" :options=\"[]\" :loading=\"true\" loading-text=\"Fetching...\" />\n *\n * @emits {string | number | boolean} update:modelValue — Emitted when an option is selected\n */\nimport { ref, computed, watch, nextTick, onMounted, onBeforeUnmount } from 'vue'\nimport UiIcon from '../icons/Icon.vue'\nconst props = defineProps({\n /**\n * Currently selected value (v-model).\n * @type {string | number | boolean | null}\n * @default ''\n */\n modelValue: { type: [String, Number, Boolean, null], default: '' },\n\n /**\n * Array of selectable options. Each item can be:\n * - A primitive (string/number) used as both value and label\n * - An object: `{ value, label, icon?, group? }`\n * @type {Array}\n * @default []\n */\n options: { type: Array, default: () => [] },\n\n /**\n * Placeholder text shown when no option is selected.\n * @type {string}\n * @default ''\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Enable a search input inside the dropdown for filtering options.\n * @type {boolean}\n * @default false\n */\n searchable: { type: Boolean, default: false },\n\n /**\n * Disabled state — dims the trigger and prevents opening.\n * @type {boolean}\n * @default false\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Trigger button size controlling padding and font.\n * @type {string}\n * @default 'md'\n * @values 'xs' | 'sm' | 'md'\n */\n size: { type: String, default: 'md' },\n\n /**\n * Full-width mode — trigger stretches to fill its container.\n * @type {boolean}\n * @default true\n */\n block: { type: Boolean, default: true },\n\n /**\n * Accessible label for the trigger button.\n * @type {string}\n * @default undefined\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Loading state — shows a spinner and disables interaction.\n * @type {boolean}\n * @default false\n */\n loading: { type: Boolean, default: false },\n\n /**\n * Text displayed next to the spinner during loading.\n * @type {string}\n * @default 'Loading...'\n */\n loadingText: { type: String, default: 'Loading...' },\n\n /**\n * MDI icon name for the loading spinner.\n * @type {string}\n * @default 'mdi:loading'\n */\n spinner: { type: String, default: 'mdi:loading' },\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst containerRef = ref(null)\nconst triggerRef = ref(null)\nconst searchRef = ref(null)\nconst sizerRef = ref(null)\nconst panelRef = ref(null)\nconst isOpen = ref(false)\nconst searchQuery = ref('')\nconst measuredWidth = ref(0)\nconst panelStyle = ref({})\n\n// Position the teleported panel under (or above) the trigger using fixed\n// coordinates so it overlays everything and is never clipped by a scrollable\n// ancestor. Re-run on scroll/resize while open so it stays anchored.\nconst reposition = () => {\n const el = triggerRef.value\n if (!el) return\n const rect = el.getBoundingClientRect()\n const spaceBelow = window.innerHeight - rect.bottom\n const openUp = spaceBelow < 260 && rect.top > spaceBelow\n const style = { left: `${rect.left}px`, minWidth: `${rect.width}px` }\n if (props.block) style.width = `${rect.width}px`\n if (openUp) style.bottom = `${window.innerHeight - rect.top + 4}px`\n else style.top = `${rect.bottom + 4}px`\n panelStyle.value = style\n}\n\nconst startTracking = () => {\n window.addEventListener('scroll', reposition, true)\n window.addEventListener('resize', reposition)\n}\nconst stopTracking = () => {\n window.removeEventListener('scroll', reposition, true)\n window.removeEventListener('resize', reposition)\n}\n\n// Text class for the hidden sizer — must match the trigger's font size\nconst sizerTextClass = computed(() => {\n const map = { xs: 'text-xs', sm: 'text-sm', md: 'text-sm' }\n return map[props.size] || 'text-sm'\n})\n\n// Measure the widest option on mount and when options change\nconst measureSizer = () => {\n if (!sizerRef.value) {\n measuredWidth.value = 0\n return\n }\n measuredWidth.value = sizerRef.value.scrollWidth\n}\n\nonMounted(measureSizer)\nwatch(\n () => props.options,\n () => nextTick(measureSizer),\n { deep: true },\n)\n\n// Auto min-width style: ensures trigger never shrinks below the widest option\nconst autoMinWidth = computed(() => {\n if (!measuredWidth.value) return undefined\n // Add padding for the trigger's horizontal padding + border\n const padMap = { xs: 28, sm: 24, md: 30 }\n const pad = padMap[props.size] || 30\n return { minWidth: `${measuredWidth.value + pad}px` }\n})\n\n// ── Normalize options ────────────────────────────────────\n// Convert primitive options (string/number) into { value, label, subtitle, icon, group } objects\nconst normalizedOptions = computed(() =>\n props.options.map((opt) =>\n typeof opt === 'object' && opt !== null\n ? {\n value: opt.value,\n label: opt.label ?? String(opt.value),\n subtitle: opt.subtitle || '',\n icon: opt.icon || '',\n group: opt.group || '',\n }\n : { value: opt, label: String(opt), subtitle: '', icon: '', group: '' },\n ),\n)\n\n// ── Filtering ────────────────────────────────────────────\n// Apply search query filter against option labels (case-insensitive)\nconst filteredNormalized = computed(() => {\n if (!searchQuery.value) return normalizedOptions.value\n const q = searchQuery.value.toLowerCase()\n return normalizedOptions.value.filter(\n (opt) => opt.label.toLowerCase().includes(q) || opt.subtitle.toLowerCase().includes(q),\n )\n})\n\n// ── Grouping ─────────────────────────────────────────────\n// Detect if any option has a group key to enable grouped rendering\nconst hasGroups = computed(() => normalizedOptions.value.some((o) => o.group))\n\n// Build grouped structure: Map<groupLabel, { label, options[] }>\nconst filteredGroups = computed(() => {\n if (!hasGroups.value) return []\n const map = new Map()\n for (const opt of filteredNormalized.value) {\n const key = opt.group || ''\n if (!map.has(key)) map.set(key, { label: key, options: [] })\n map.get(key).options.push(opt)\n }\n return [...map.values()].filter((g) => g.options.length > 0)\n})\n\nconst filteredOptions = computed(() => {\n if (hasGroups.value) return []\n return filteredNormalized.value\n})\n\n// ── Selected display ─────────────────────────────────────\nconst selectedOpt = computed(() =>\n normalizedOptions.value.find((o) => o.value === props.modelValue),\n)\nconst selectedLabel = computed(() => selectedOpt.value?.label || '')\nconst selectedIcon = computed(() => selectedOpt.value?.icon || '')\n\n// ── Styling ──────────────────────────────────────────────\nconst triggerClasses = computed(() => {\n const base =\n 'flex items-center justify-between gap-2 text-left border bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-400 outline-none transition-colors focus:ring-2 focus:ring-primary-500 focus:border-primary-500'\n const width = props.block ? 'w-full' : ''\n const sizeMap = {\n xs: 'px-2.5 py-1.5 text-xs rounded-md border-gray-200 dark:border-gray-700',\n sm: 'px-2 py-1 text-sm rounded-lg border-gray-300 dark:border-gray-600',\n md: 'px-3 py-2 text-sm rounded-lg border-gray-300 dark:border-gray-700',\n }\n return `${base} ${width} ${sizeMap[props.size] || sizeMap.md}`\n})\n\nconst optionClass = (value) =>\n props.modelValue === value\n ? 'bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300'\n : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700'\n\n// ── Interactions ─────────────────────────────────────────\n// Toggle dropdown open/close, auto-detect drop direction, and focus search input\nconst toggleOpen = () => {\n if (props.disabled || props.loading) return\n isOpen.value = !isOpen.value\n if (isOpen.value) {\n searchQuery.value = ''\n reposition()\n startTracking()\n nextTick(() => {\n reposition()\n if (props.searchable) searchRef.value?.focus()\n })\n } else {\n stopTracking()\n }\n}\n\nconst select = (value) => {\n emit('update:modelValue', value)\n close()\n}\n\nconst selectFirst = () => {\n const pool = hasGroups.value\n ? filteredGroups.value.flatMap((g) => g.options)\n : filteredOptions.value\n if (pool.length) select(pool[0].value)\n}\n\nconst close = () => {\n isOpen.value = false\n searchQuery.value = ''\n stopTracking()\n}\n\n// Programmatic toggle for parent row clicks.\n// Uses a skip flag to prevent the race with the document click handler:\n// when the row is clicked, the capture-phase listener fires first (closing the dropdown),\n// then the row handler calls toggle(). The flag lets us detect this and skip the re-open.\nlet skipNextOpen = false\nconst toggle = () => {\n if (props.disabled || props.loading) return\n if (skipNextOpen) {\n skipNextOpen = false\n return\n }\n toggleOpen()\n}\n\nconst closeFromOutside = () => {\n if (isOpen.value) skipNextOpen = true\n close()\n setTimeout(() => {\n skipNextOpen = false\n }, 0)\n}\n\nconst onDocumentClick = (e) => {\n // The panel is teleported to <body>, so clicks inside it are NOT inside the\n // container — check both before treating a click as \"outside\".\n if (containerRef.value?.contains(e.target)) return\n if (panelRef.value?.contains(e.target)) return\n closeFromOutside()\n}\n\nonMounted(() => document.addEventListener('click', onDocumentClick, true))\nonBeforeUnmount(() => {\n document.removeEventListener('click', onDocumentClick, true)\n stopTracking()\n})\n\ndefineExpose({ toggle, close, isOpen })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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