@enos5/enos-vue-default 1.5.9 → 1.6.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/dist/components/CustomSelect.vue.d.ts +12 -3
- package/dist/components/InputGroup.vue.d.ts +9 -0
- package/dist/components/SelectInput.vue.d.ts +12 -3
- package/dist/index.js +1 -1
- package/dist/index.node.js +1 -1
- package/dist/{plugin-sa3VYroS.js → plugin-BWHPeYQC.js} +115 -33
- package/dist/plugin-BWHPeYQC.js.map +1 -0
- package/package.json +36 -36
- package/dist/plugin-sa3VYroS.js.map +0 -1
|
@@ -2,7 +2,7 @@ declare const _default: typeof __VLS_export;
|
|
|
2
2
|
export default _default;
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
modelValue: {
|
|
5
|
-
type: (StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
5
|
+
type: (ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
8
|
modelModifiers: {
|
|
@@ -21,6 +21,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
21
21
|
type: BooleanConstructor;
|
|
22
22
|
default: boolean;
|
|
23
23
|
};
|
|
24
|
+
multiple: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
24
28
|
disabled: {
|
|
25
29
|
type: BooleanConstructor;
|
|
26
30
|
default: boolean;
|
|
@@ -85,7 +89,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
85
89
|
"update:modelValue": (...args: any[]) => void;
|
|
86
90
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
87
91
|
modelValue: {
|
|
88
|
-
type: (StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
92
|
+
type: (ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
89
93
|
default: string;
|
|
90
94
|
};
|
|
91
95
|
modelModifiers: {
|
|
@@ -104,6 +108,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
104
108
|
type: BooleanConstructor;
|
|
105
109
|
default: boolean;
|
|
106
110
|
};
|
|
111
|
+
multiple: {
|
|
112
|
+
type: BooleanConstructor;
|
|
113
|
+
default: boolean;
|
|
114
|
+
};
|
|
107
115
|
disabled: {
|
|
108
116
|
type: BooleanConstructor;
|
|
109
117
|
default: boolean;
|
|
@@ -168,11 +176,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
168
176
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
169
177
|
}>, {
|
|
170
178
|
disabled: boolean;
|
|
171
|
-
modelValue: string | number | boolean | null;
|
|
179
|
+
modelValue: string | number | boolean | unknown[] | null;
|
|
172
180
|
modelModifiers: Record<string, any>;
|
|
173
181
|
options: unknown[];
|
|
174
182
|
placeholder: string;
|
|
175
183
|
placeholderDisabled: boolean;
|
|
184
|
+
multiple: boolean;
|
|
176
185
|
softDeleteAware: boolean;
|
|
177
186
|
labelKey: string;
|
|
178
187
|
valueKey: string;
|
|
@@ -57,6 +57,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
57
57
|
type: BooleanConstructor;
|
|
58
58
|
default: boolean;
|
|
59
59
|
};
|
|
60
|
+
multiple: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
60
64
|
softDeleteAware: {
|
|
61
65
|
type: BooleanConstructor;
|
|
62
66
|
default: boolean;
|
|
@@ -201,6 +205,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
201
205
|
type: BooleanConstructor;
|
|
202
206
|
default: boolean;
|
|
203
207
|
};
|
|
208
|
+
multiple: {
|
|
209
|
+
type: BooleanConstructor;
|
|
210
|
+
default: boolean;
|
|
211
|
+
};
|
|
204
212
|
softDeleteAware: {
|
|
205
213
|
type: BooleanConstructor;
|
|
206
214
|
default: boolean;
|
|
@@ -302,6 +310,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
302
310
|
options: unknown[];
|
|
303
311
|
placeholder: string;
|
|
304
312
|
placeholderDisabled: boolean;
|
|
313
|
+
multiple: boolean;
|
|
305
314
|
softDeleteAware: boolean;
|
|
306
315
|
labelKey: string;
|
|
307
316
|
valueKey: string;
|
|
@@ -2,7 +2,7 @@ declare const _default: typeof __VLS_export;
|
|
|
2
2
|
export default _default;
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
modelValue: {
|
|
5
|
-
type: (StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
5
|
+
type: (ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
8
|
modelModifiers: {
|
|
@@ -21,6 +21,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
21
21
|
type: BooleanConstructor;
|
|
22
22
|
default: boolean;
|
|
23
23
|
};
|
|
24
|
+
multiple: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
24
28
|
disabled: {
|
|
25
29
|
type: BooleanConstructor;
|
|
26
30
|
default: boolean;
|
|
@@ -85,7 +89,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
85
89
|
"update:modelValue": (...args: any[]) => void;
|
|
86
90
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
87
91
|
modelValue: {
|
|
88
|
-
type: (StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
92
|
+
type: (ArrayConstructor | StringConstructor | BooleanConstructor | NumberConstructor | null)[];
|
|
89
93
|
default: string;
|
|
90
94
|
};
|
|
91
95
|
modelModifiers: {
|
|
@@ -104,6 +108,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
104
108
|
type: BooleanConstructor;
|
|
105
109
|
default: boolean;
|
|
106
110
|
};
|
|
111
|
+
multiple: {
|
|
112
|
+
type: BooleanConstructor;
|
|
113
|
+
default: boolean;
|
|
114
|
+
};
|
|
107
115
|
disabled: {
|
|
108
116
|
type: BooleanConstructor;
|
|
109
117
|
default: boolean;
|
|
@@ -168,11 +176,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
168
176
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
169
177
|
}>, {
|
|
170
178
|
disabled: boolean;
|
|
171
|
-
modelValue: string | number | boolean | null;
|
|
179
|
+
modelValue: string | number | boolean | unknown[] | null;
|
|
172
180
|
modelModifiers: Record<string, any>;
|
|
173
181
|
options: unknown[];
|
|
174
182
|
placeholder: string;
|
|
175
183
|
placeholderDisabled: boolean;
|
|
184
|
+
multiple: boolean;
|
|
176
185
|
softDeleteAware: boolean;
|
|
177
186
|
labelKey: string;
|
|
178
187
|
valueKey: string;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './styles.css';
|
|
2
|
-
import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-
|
|
2
|
+
import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-BWHPeYQC.js";
|
|
3
3
|
export {
|
|
4
4
|
_ as ActionCard,
|
|
5
5
|
a as ActionMessage,
|
package/dist/index.node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-
|
|
1
|
+
import { _, a, b, c, d, e, f, g, h, i, j, k, D, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, S, B, C, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z, $, a0, a1 } from "./plugin-BWHPeYQC.js";
|
|
2
2
|
export {
|
|
3
3
|
_ as ActionCard,
|
|
4
4
|
a as ActionMessage,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref, computed, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, normalizeStyle, toDisplayString, createBlock, createCommentVNode, renderSlot, createVNode, Transition, withCtx, mergeProps, useSlots, unref, withDirectives, vShow, useAttrs, vModelCheckbox, onMounted, nextTick, onBeforeUnmount, Teleport, withModifiers, onUnmounted, inject, provide, defineComponent, isVNode, cloneVNode, resolveDynamicComponent,
|
|
1
|
+
import { ref, computed, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, normalizeStyle, toDisplayString, createBlock, createCommentVNode, renderSlot, createVNode, Transition, withCtx, mergeProps, useSlots, unref, withDirectives, vShow, useAttrs, vModelCheckbox, onMounted, nextTick, onBeforeUnmount, Teleport, withModifiers, createTextVNode, onUnmounted, inject, provide, defineComponent, isVNode, cloneVNode, resolveDynamicComponent, h, vModelText, createSlots } from "vue";
|
|
2
2
|
import { LockClosedIcon, ChevronDownIcon, PhotoIcon, ExclamationCircleIcon, ExclamationTriangleIcon, ChevronUpIcon, MagnifyingGlassIcon, CheckIcon, PencilSquareIcon } from "@heroicons/vue/24/outline";
|
|
3
3
|
import Editor from "@tinymce/tinymce-vue";
|
|
4
4
|
import { Link } from "@inertiajs/vue3";
|
|
5
5
|
const _hoisted_1$C = { class: "border-b border-neutral-200 bg-neutral-50/80 p-2 dark:border-neutral-800 dark:bg-neutral-900/80" };
|
|
6
|
-
const _hoisted_2$
|
|
6
|
+
const _hoisted_2$m = {
|
|
7
7
|
role: "tablist",
|
|
8
8
|
class: "flex overflow-hidden rounded-lg bg-white shadow-sm ring-1 ring-neutral-200 dark:bg-neutral-950 dark:ring-neutral-800"
|
|
9
9
|
};
|
|
10
|
-
const _hoisted_3$
|
|
10
|
+
const _hoisted_3$f = ["aria-selected", "tabindex", "onClick", "onKeydown"];
|
|
11
11
|
const _sfc_main$R = {
|
|
12
12
|
__name: "CardTabs",
|
|
13
13
|
props: {
|
|
@@ -78,7 +78,7 @@ const _sfc_main$R = {
|
|
|
78
78
|
};
|
|
79
79
|
return (_ctx, _cache) => {
|
|
80
80
|
return openBlock(), createElementBlock("div", _hoisted_1$C, [
|
|
81
|
-
createElementVNode("div", _hoisted_2$
|
|
81
|
+
createElementVNode("div", _hoisted_2$m, [
|
|
82
82
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.tabs, (tab, index) => {
|
|
83
83
|
return openBlock(), createElementBlock("button", {
|
|
84
84
|
key: tab.value,
|
|
@@ -98,7 +98,7 @@ const _sfc_main$R = {
|
|
|
98
98
|
]),
|
|
99
99
|
onClick: ($event) => activateTab(tab.value),
|
|
100
100
|
onKeydown: ($event) => onTabKeydown($event, index)
|
|
101
|
-
}, toDisplayString(tab.label), 47, _hoisted_3$
|
|
101
|
+
}, toDisplayString(tab.label), 47, _hoisted_3$f);
|
|
102
102
|
}), 128))
|
|
103
103
|
])
|
|
104
104
|
]);
|
|
@@ -109,7 +109,7 @@ const _hoisted_1$B = {
|
|
|
109
109
|
key: 0,
|
|
110
110
|
class: "mb-4"
|
|
111
111
|
};
|
|
112
|
-
const _hoisted_2$
|
|
112
|
+
const _hoisted_2$l = {
|
|
113
113
|
key: 1,
|
|
114
114
|
class: "mb-4 text-xl font-semibold tracking-tight text-neutral-950 dark:text-neutral-50"
|
|
115
115
|
};
|
|
@@ -186,7 +186,7 @@ const _sfc_main$Q = {
|
|
|
186
186
|
}, [
|
|
187
187
|
_ctx.$slots.customTitle ? (openBlock(), createElementBlock("div", _hoisted_1$B, [
|
|
188
188
|
renderSlot(_ctx.$slots, "customTitle")
|
|
189
|
-
])) : __props.title ? (openBlock(), createElementBlock("h3", _hoisted_2$
|
|
189
|
+
])) : __props.title ? (openBlock(), createElementBlock("h3", _hoisted_2$l, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
190
190
|
createElementVNode("div", {
|
|
191
191
|
class: normalizeClass(["relative", __props.tabs.length > 0 ? "overflow-hidden" : "overflow-visible"])
|
|
192
192
|
}, [
|
|
@@ -303,14 +303,14 @@ const _export_sfc = (sfc, props) => {
|
|
|
303
303
|
};
|
|
304
304
|
const _sfc_main$M = {};
|
|
305
305
|
const _hoisted_1$z = { class: "md:col-span-1 flex justify-between" };
|
|
306
|
-
const _hoisted_2$
|
|
307
|
-
const _hoisted_3$
|
|
306
|
+
const _hoisted_2$k = { class: "px-4 sm:px-0" };
|
|
307
|
+
const _hoisted_3$e = { class: "text-xl font-semibold tracking-tight text-neutral-950 dark:text-neutral-50" };
|
|
308
308
|
const _hoisted_4$9 = { class: "mt-1 max-w-2xl text-sm text-neutral-600 dark:text-neutral-200" };
|
|
309
309
|
const _hoisted_5$7 = { class: "px-4 sm:px-0" };
|
|
310
310
|
function _sfc_render(_ctx, _cache) {
|
|
311
311
|
return openBlock(), createElementBlock("div", _hoisted_1$z, [
|
|
312
|
-
createElementVNode("div", _hoisted_2$
|
|
313
|
-
createElementVNode("h3", _hoisted_3$
|
|
312
|
+
createElementVNode("div", _hoisted_2$k, [
|
|
313
|
+
createElementVNode("h3", _hoisted_3$e, [
|
|
314
314
|
renderSlot(_ctx.$slots, "title")
|
|
315
315
|
]),
|
|
316
316
|
createElementVNode("p", _hoisted_4$9, [
|
|
@@ -324,8 +324,8 @@ function _sfc_render(_ctx, _cache) {
|
|
|
324
324
|
}
|
|
325
325
|
const SectionTitle = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render]]);
|
|
326
326
|
const _hoisted_1$y = { class: "md:grid md:grid-cols-3 md:gap-6" };
|
|
327
|
-
const _hoisted_2$
|
|
328
|
-
const _hoisted_3$
|
|
327
|
+
const _hoisted_2$j = { class: "mt-5 md:mt-0 md:col-span-2" };
|
|
328
|
+
const _hoisted_3$d = { class: "rounded-lg border border-neutral-200 bg-white px-4 py-5 shadow-sm dark:border-neutral-800 dark:bg-neutral-950 sm:p-6" };
|
|
329
329
|
const _sfc_main$L = {
|
|
330
330
|
__name: "ActionSection",
|
|
331
331
|
setup(__props) {
|
|
@@ -340,8 +340,8 @@ const _sfc_main$L = {
|
|
|
340
340
|
]),
|
|
341
341
|
_: 3
|
|
342
342
|
}),
|
|
343
|
-
createElementVNode("div", _hoisted_2$
|
|
344
|
-
createElementVNode("div", _hoisted_3$
|
|
343
|
+
createElementVNode("div", _hoisted_2$j, [
|
|
344
|
+
createElementVNode("div", _hoisted_3$d, [
|
|
345
345
|
renderSlot(_ctx.$slots, "content")
|
|
346
346
|
])
|
|
347
347
|
])
|
|
@@ -615,11 +615,11 @@ const _sfc_main$H = {
|
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
617
|
const _hoisted_1$t = { class: "relative flex items-center" };
|
|
618
|
-
const _hoisted_2$
|
|
618
|
+
const _hoisted_2$i = {
|
|
619
619
|
key: 0,
|
|
620
620
|
class: "absolute inset-y-0 left-0 flex items-center pointer-events-none pl-3"
|
|
621
621
|
};
|
|
622
|
-
const _hoisted_3$
|
|
622
|
+
const _hoisted_3$c = ["type", "value", "disabled"];
|
|
623
623
|
const _hoisted_4$8 = ["aria-label"];
|
|
624
624
|
const _hoisted_5$6 = {
|
|
625
625
|
key: 0,
|
|
@@ -696,7 +696,7 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
696
696
|
__expose({ focus: () => input.value?.focus() });
|
|
697
697
|
return (_ctx, _cache) => {
|
|
698
698
|
return openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
699
|
-
isPasswordField.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
699
|
+
isPasswordField.value ? (openBlock(), createElementBlock("div", _hoisted_2$i, [
|
|
700
700
|
createVNode(unref(LockClosedIcon), { class: "h-5 w-5 text-neutral-400 dark:text-neutral-200" })
|
|
701
701
|
])) : createCommentVNode("", true),
|
|
702
702
|
createElementVNode("input", mergeProps({
|
|
@@ -710,7 +710,7 @@ const _sfc_main$G = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
710
710
|
onInput: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event.target.value)),
|
|
711
711
|
onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event)),
|
|
712
712
|
onWheel: handleWheel
|
|
713
|
-
}), null, 16, _hoisted_3$
|
|
713
|
+
}), null, 16, _hoisted_3$c),
|
|
714
714
|
isPasswordField.value ? (openBlock(), createElementBlock("button", {
|
|
715
715
|
key: 1,
|
|
716
716
|
type: "button",
|
|
@@ -822,11 +822,16 @@ const _sfc_main$F = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
822
822
|
}
|
|
823
823
|
});
|
|
824
824
|
const _hoisted_1$r = ["onClick"];
|
|
825
|
+
const _hoisted_2$h = {
|
|
826
|
+
key: 0,
|
|
827
|
+
class: "flex items-center gap-3"
|
|
828
|
+
};
|
|
829
|
+
const _hoisted_3$b = ["checked", "disabled", "onChange"];
|
|
825
830
|
const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
826
831
|
__name: "CustomSelect",
|
|
827
832
|
props: {
|
|
828
833
|
modelValue: {
|
|
829
|
-
type: [String, Number, Boolean, null],
|
|
834
|
+
type: [String, Number, Boolean, Array, null],
|
|
830
835
|
default: ""
|
|
831
836
|
},
|
|
832
837
|
modelModifiers: {
|
|
@@ -845,6 +850,10 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
845
850
|
type: Boolean,
|
|
846
851
|
default: false
|
|
847
852
|
},
|
|
853
|
+
multiple: {
|
|
854
|
+
type: Boolean,
|
|
855
|
+
default: false
|
|
856
|
+
},
|
|
848
857
|
disabled: {
|
|
849
858
|
type: Boolean,
|
|
850
859
|
default: false
|
|
@@ -938,9 +947,11 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
938
947
|
}
|
|
939
948
|
return Boolean(option[props.deletedKey]);
|
|
940
949
|
};
|
|
950
|
+
const modelValueArray = computed(() => Array.isArray(props.modelValue) ? props.modelValue : []);
|
|
941
951
|
const modelValueAsString = computed(() => String(props.modelValue ?? ""));
|
|
952
|
+
const modelValueSet = computed(() => new Set(modelValueArray.value.map((value) => String(value))));
|
|
942
953
|
const selectedDeletedOption = computed(() => {
|
|
943
|
-
if (!props.softDeleteAware || modelValueAsString.value === "") {
|
|
954
|
+
if (props.multiple || !props.softDeleteAware || modelValueAsString.value === "") {
|
|
944
955
|
return null;
|
|
945
956
|
}
|
|
946
957
|
return props.options.find((option) => optionDeleted(option) && String(optionValue(option) ?? "") === modelValueAsString.value) ?? null;
|
|
@@ -951,7 +962,39 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
951
962
|
}
|
|
952
963
|
return props.options.filter((option) => !optionDeleted(option));
|
|
953
964
|
});
|
|
965
|
+
const selectedDeletedOptions = computed(() => {
|
|
966
|
+
if (!props.softDeleteAware || !props.multiple || modelValueSet.value.size === 0) {
|
|
967
|
+
return [];
|
|
968
|
+
}
|
|
969
|
+
return props.options.filter((option) => optionDeleted(option) && modelValueSet.value.has(String(optionValue(option) ?? "")));
|
|
970
|
+
});
|
|
971
|
+
const multipleOptions = computed(() => {
|
|
972
|
+
if (!props.multiple) {
|
|
973
|
+
return availableOptions.value;
|
|
974
|
+
}
|
|
975
|
+
const seen = /* @__PURE__ */ new Set();
|
|
976
|
+
return [...selectedDeletedOptions.value, ...availableOptions.value].filter((option) => {
|
|
977
|
+
const key = String(optionValue(option) ?? "");
|
|
978
|
+
if (seen.has(key)) {
|
|
979
|
+
return false;
|
|
980
|
+
}
|
|
981
|
+
seen.add(key);
|
|
982
|
+
return true;
|
|
983
|
+
});
|
|
984
|
+
});
|
|
985
|
+
const selectedMultipleOptions = computed(() => {
|
|
986
|
+
if (!props.multiple || modelValueSet.value.size === 0) {
|
|
987
|
+
return [];
|
|
988
|
+
}
|
|
989
|
+
return multipleOptions.value.filter((option) => modelValueSet.value.has(String(optionValue(option) ?? "")));
|
|
990
|
+
});
|
|
954
991
|
const displayText = computed(() => {
|
|
992
|
+
if (props.multiple) {
|
|
993
|
+
if (selectedMultipleOptions.value.length === 0) {
|
|
994
|
+
return props.placeholder;
|
|
995
|
+
}
|
|
996
|
+
return selectedMultipleOptions.value.map((option) => optionText(option)).join(", ");
|
|
997
|
+
}
|
|
955
998
|
if (props.modelValue === null || props.modelValue === void 0 || props.modelValue === "" && !props.options.some((option) => optionValue(option) === "")) {
|
|
956
999
|
return props.placeholder;
|
|
957
1000
|
}
|
|
@@ -970,6 +1013,8 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
970
1013
|
}
|
|
971
1014
|
return value;
|
|
972
1015
|
};
|
|
1016
|
+
const normalizeEmittedValues = (values) => values.map((value) => normalizeEmittedValue(value));
|
|
1017
|
+
const optionIsSelected = (option) => modelValueSet.value.has(String(optionValue(option) ?? ""));
|
|
973
1018
|
const toggleDropdown = () => {
|
|
974
1019
|
if (!props.disabled) {
|
|
975
1020
|
isOpen.value = !isOpen.value;
|
|
@@ -982,10 +1027,21 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
982
1027
|
};
|
|
983
1028
|
const selectPlaceholder = () => {
|
|
984
1029
|
if (!props.placeholderDisabled) {
|
|
985
|
-
emit("update:modelValue", normalizeEmittedValue(""));
|
|
1030
|
+
emit("update:modelValue", props.multiple ? [] : normalizeEmittedValue(""));
|
|
986
1031
|
isOpen.value = false;
|
|
987
1032
|
}
|
|
988
1033
|
};
|
|
1034
|
+
const toggleMultipleOption = (option) => {
|
|
1035
|
+
const normalizedValue = normalizeEmittedValue(optionValue(option));
|
|
1036
|
+
const currentValues = [...modelValueArray.value];
|
|
1037
|
+
const selectedIndex = currentValues.findIndex((value) => String(value) === String(normalizedValue));
|
|
1038
|
+
if (selectedIndex >= 0) {
|
|
1039
|
+
currentValues.splice(selectedIndex, 1);
|
|
1040
|
+
} else {
|
|
1041
|
+
currentValues.push(normalizedValue);
|
|
1042
|
+
}
|
|
1043
|
+
emit("update:modelValue", normalizeEmittedValues(currentValues));
|
|
1044
|
+
};
|
|
989
1045
|
const updateDropdownPosition = () => {
|
|
990
1046
|
if (!triggerRef.value) {
|
|
991
1047
|
return;
|
|
@@ -1043,13 +1099,13 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1043
1099
|
ref: triggerRef,
|
|
1044
1100
|
class: [
|
|
1045
1101
|
__props.baseClass,
|
|
1046
|
-
selectedDeletedOption.value ? __props.deletedSelectedClass : __props.normalTextClass,
|
|
1102
|
+
selectedDeletedOption.value || __props.multiple && selectedMultipleOptions.value.some(optionDeleted) ? __props.deletedSelectedClass : __props.normalTextClass,
|
|
1047
1103
|
"flex items-center justify-between cursor-pointer",
|
|
1048
1104
|
unref(attrs).class
|
|
1049
1105
|
]
|
|
1050
1106
|
}, unref(attrs), { tabindex: "0" }), [
|
|
1051
1107
|
createElementVNode("span", {
|
|
1052
|
-
class: normalizeClass(!__props.modelValue && __props.placeholder ? __props.placeholderClass : null)
|
|
1108
|
+
class: normalizeClass((__props.multiple && selectedMultipleOptions.value.length === 0 || !__props.multiple && !__props.modelValue) && __props.placeholder ? __props.placeholderClass : null)
|
|
1053
1109
|
}, toDisplayString(displayText.value), 3),
|
|
1054
1110
|
createVNode(unref(ChevronDownIcon), {
|
|
1055
1111
|
class: normalizeClass(["size-5 text-neutral-400 transition-transform dark:text-neutral-200", { "rotate-180": isOpen.value }])
|
|
@@ -1072,7 +1128,7 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1072
1128
|
class: normalizeClass(__props.dropdownClass),
|
|
1073
1129
|
style: normalizeStyle(dropdownStyle.value)
|
|
1074
1130
|
}, [
|
|
1075
|
-
__props.placeholder ? (openBlock(), createElementBlock("div", {
|
|
1131
|
+
__props.placeholder && !__props.multiple ? (openBlock(), createElementBlock("div", {
|
|
1076
1132
|
key: 0,
|
|
1077
1133
|
class: normalizeClass([
|
|
1078
1134
|
__props.dropdownOptionClass,
|
|
@@ -1089,20 +1145,36 @@ const _sfc_main$E = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1089
1145
|
__props.dropdownSelectedClass
|
|
1090
1146
|
])
|
|
1091
1147
|
}, toDisplayString(optionText(selectedDeletedOption.value)), 3)) : createCommentVNode("", true),
|
|
1092
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(availableOptions.value, (option) => {
|
|
1148
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.multiple ? multipleOptions.value : availableOptions.value, (option) => {
|
|
1093
1149
|
return openBlock(), createElementBlock("div", {
|
|
1094
1150
|
key: String(optionValue(option)),
|
|
1095
1151
|
class: normalizeClass([
|
|
1096
1152
|
__props.dropdownOptionClass,
|
|
1097
|
-
__props.optionClass,
|
|
1153
|
+
optionDeleted(option) ? __props.deletedOptionClass : __props.optionClass,
|
|
1098
1154
|
{
|
|
1099
|
-
[__props.dropdownSelectedClass]: optionValue(option) === __props.modelValue || String(optionValue(option)) === String(__props.modelValue),
|
|
1155
|
+
[__props.dropdownSelectedClass]: __props.multiple ? optionIsSelected(option) : optionValue(option) === __props.modelValue || String(optionValue(option)) === String(__props.modelValue),
|
|
1100
1156
|
"rounded-b-lg": option === availableOptions.value[availableOptions.value.length - 1] && !__props.placeholder,
|
|
1101
1157
|
"rounded-lg": !__props.placeholder && availableOptions.value.length === 1
|
|
1102
1158
|
}
|
|
1103
1159
|
]),
|
|
1104
|
-
onClick: withModifiers(($event) => selectOption(option), ["stop"])
|
|
1105
|
-
},
|
|
1160
|
+
onClick: withModifiers(($event) => __props.multiple ? toggleMultipleOption(option) : selectOption(option), ["stop"])
|
|
1161
|
+
}, [
|
|
1162
|
+
__props.multiple ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
1163
|
+
createElementVNode("input", {
|
|
1164
|
+
type: "checkbox",
|
|
1165
|
+
class: "h-4 w-4 rounded border-neutral-300 text-neutral-900 focus:ring-neutral-900",
|
|
1166
|
+
checked: optionIsSelected(option),
|
|
1167
|
+
disabled: __props.disabled,
|
|
1168
|
+
tabindex: "-1",
|
|
1169
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1170
|
+
}, ["stop"])),
|
|
1171
|
+
onChange: withModifiers(($event) => toggleMultipleOption(option), ["stop"])
|
|
1172
|
+
}, null, 40, _hoisted_3$b),
|
|
1173
|
+
createElementVNode("span", null, toDisplayString(optionText(option)), 1)
|
|
1174
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1175
|
+
createTextVNode(toDisplayString(optionText(option)), 1)
|
|
1176
|
+
], 64))
|
|
1177
|
+
], 10, _hoisted_1$r);
|
|
1106
1178
|
}), 128))
|
|
1107
1179
|
], 6)) : createCommentVNode("", true)
|
|
1108
1180
|
]))
|
|
@@ -1117,7 +1189,7 @@ const _sfc_main$D = {
|
|
|
1117
1189
|
__name: "SelectInput",
|
|
1118
1190
|
props: {
|
|
1119
1191
|
modelValue: {
|
|
1120
|
-
type: [String, Number, Boolean, null],
|
|
1192
|
+
type: [String, Number, Boolean, Array, null],
|
|
1121
1193
|
default: ""
|
|
1122
1194
|
},
|
|
1123
1195
|
modelModifiers: {
|
|
@@ -1136,6 +1208,10 @@ const _sfc_main$D = {
|
|
|
1136
1208
|
type: Boolean,
|
|
1137
1209
|
default: false
|
|
1138
1210
|
},
|
|
1211
|
+
multiple: {
|
|
1212
|
+
type: Boolean,
|
|
1213
|
+
default: false
|
|
1214
|
+
},
|
|
1139
1215
|
disabled: {
|
|
1140
1216
|
type: Boolean,
|
|
1141
1217
|
default: false
|
|
@@ -1207,6 +1283,7 @@ const _sfc_main$D = {
|
|
|
1207
1283
|
options: __props.options,
|
|
1208
1284
|
placeholder: __props.placeholder,
|
|
1209
1285
|
"placeholder-disabled": __props.placeholderDisabled,
|
|
1286
|
+
multiple: __props.multiple,
|
|
1210
1287
|
disabled: __props.disabled,
|
|
1211
1288
|
"soft-delete-aware": __props.softDeleteAware,
|
|
1212
1289
|
"label-key": __props.labelKey,
|
|
@@ -1223,7 +1300,7 @@ const _sfc_main$D = {
|
|
|
1223
1300
|
"dropdown-option-class": __props.dropdownOptionClass,
|
|
1224
1301
|
"dropdown-selected-class": __props.dropdownSelectedClass,
|
|
1225
1302
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
|
|
1226
|
-
}, _ctx.$attrs), null, 16, ["model-value", "model-modifiers", "options", "placeholder", "placeholder-disabled", "disabled", "soft-delete-aware", "label-key", "value-key", "deleted-key", "option-label", "base-class", "normal-text-class", "deleted-selected-class", "option-class", "deleted-option-class", "placeholder-class", "dropdown-class", "dropdown-option-class", "dropdown-selected-class"]);
|
|
1303
|
+
}, _ctx.$attrs), null, 16, ["model-value", "model-modifiers", "options", "placeholder", "placeholder-disabled", "multiple", "disabled", "soft-delete-aware", "label-key", "value-key", "deleted-key", "option-label", "base-class", "normal-text-class", "deleted-selected-class", "option-class", "deleted-option-class", "placeholder-class", "dropdown-class", "dropdown-option-class", "dropdown-selected-class"]);
|
|
1227
1304
|
};
|
|
1228
1305
|
}
|
|
1229
1306
|
};
|
|
@@ -1814,6 +1891,10 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1814
1891
|
type: Boolean,
|
|
1815
1892
|
default: false
|
|
1816
1893
|
},
|
|
1894
|
+
multiple: {
|
|
1895
|
+
type: Boolean,
|
|
1896
|
+
default: false
|
|
1897
|
+
},
|
|
1817
1898
|
softDeleteAware: {
|
|
1818
1899
|
type: Boolean,
|
|
1819
1900
|
default: false
|
|
@@ -1982,6 +2063,7 @@ const _sfc_main$v = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
|
1982
2063
|
options: props.options,
|
|
1983
2064
|
placeholder: props.placeholder,
|
|
1984
2065
|
placeholderDisabled: props.placeholderDisabled,
|
|
2066
|
+
multiple: props.multiple,
|
|
1985
2067
|
disabled: props.disabled,
|
|
1986
2068
|
softDeleteAware: props.softDeleteAware,
|
|
1987
2069
|
labelKey: props.labelKey,
|
|
@@ -4766,4 +4848,4 @@ export {
|
|
|
4766
4848
|
_sfc_main$z as y,
|
|
4767
4849
|
_sfc_main$x as z
|
|
4768
4850
|
};
|
|
4769
|
-
//# sourceMappingURL=plugin-
|
|
4851
|
+
//# sourceMappingURL=plugin-BWHPeYQC.js.map
|