vlite3 1.1.2 → 1.1.4
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/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
- package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
- package/components/Avatar.vue.js +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
- package/components/Button.vue.js +30 -28
- package/components/Carousel/Carousel.vue.d.ts +2 -2
- package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
- package/components/CategoryManager/CategoryManager.vue.js +137 -118
- package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
- package/components/CategoryManager/CategoryNode.vue.js +93 -88
- package/components/Chat/ChatBubble.vue.js +22 -22
- package/components/CheckBox.vue.js +29 -28
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/ConfirmationModal.vue.js +30 -28
- package/components/CopyButton.vue.d.ts +50 -0
- package/components/CopyButton.vue.js +69 -0
- package/components/CopyButton.vue2.js +4 -0
- package/components/DataTable/DataTable.vue.js +44 -44
- package/components/DatePicker.vue.js +41 -35
- package/components/DateRangePicker.vue.js +18 -17
- package/components/Dropdown/Dropdown.vue.d.ts +3 -0
- package/components/Dropdown/Dropdown.vue.js +117 -115
- package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
- package/components/Dropdown/DropdownItem.vue.js +21 -20
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/DropdownMenu.vue2.js +13 -12
- package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
- package/components/Dropdown/DropdownTrigger.vue.js +10 -6
- package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
- package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
- package/components/Dropdown/composables/useDropdownSelection.js +46 -31
- package/components/FilePicker/FilePicker.vue.js +93 -90
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +68 -64
- package/components/Form/FormField.vue.js +204 -148
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +28 -27
- package/components/Form/types.d.ts +2 -2
- package/components/Form/utils/form.utils.d.ts +3 -3
- package/components/Form/utils/form.utils.js +37 -37
- package/components/Input.vue.js +64 -62
- package/components/Invoice/Invoice.vue.js +9 -7
- package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
- package/components/Invoice/InvoiceTotals.vue.js +86 -0
- package/components/Invoice/InvoiceTotals.vue2.js +4 -0
- package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant1.vue.js +194 -207
- package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant2.vue.js +109 -118
- package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant3.vue.js +157 -167
- package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant4.vue.js +192 -202
- package/components/Invoice/index.d.ts +1 -0
- package/components/Invoice/types.d.ts +22 -0
- package/components/Masonry/Masonry.vue.d.ts +1 -1
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +60 -54
- package/components/MultiSelect/MultiSelect.vue.js +47 -46
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +121 -116
- package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +58 -52
- package/components/Stats/StatItem.vue.js +96 -91
- package/components/Stats/types.d.ts +1 -0
- package/components/Switch.vue.d.ts +6 -1
- package/components/Switch.vue.js +61 -24
- package/components/TagInput/TagInput.vue.d.ts +187 -0
- package/components/TagInput/TagInput.vue.js +113 -0
- package/components/TagInput/TagInput.vue2.js +4 -0
- package/components/TagInput/index.d.ts +1 -0
- package/components/Textarea.vue.js +19 -18
- package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
- package/core/config.d.ts +36 -0
- package/index.d.ts +2 -0
- package/index.js +130 -124
- package/package.json +1 -1
- package/style.css +616 -1
- package/types/button.d.ts +1 -1
- package/types/styles.d.ts +1 -0
- package/utils/functions.js +9 -9
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as g, computed as
|
|
1
|
+
import { defineComponent as g, computed as a, openBlock as n, createElementBlock as s, withKeys as w, withModifiers as k, normalizeClass as h, renderSlot as $, normalizeProps as I, guardReactiveProps as B, createBlock as p, createCommentVNode as i, createElementVNode as c, toDisplayString as d } from "vue";
|
|
2
2
|
import v from "../Icon.vue.js";
|
|
3
|
-
import { $t as
|
|
4
|
-
const j = ["tabindex", "data-disabled"], C = { class: "flex flex-col flex-1 min-w-0" },
|
|
3
|
+
import { $t as r } from "../../utils/i18n.js";
|
|
4
|
+
const j = ["tabindex", "data-disabled", "data-testid"], C = { class: "flex flex-col flex-1 min-w-0" }, S = { class: "flex items-center justify-between gap-2" }, z = { class: "truncate font-medium" }, D = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-xs text-muted-foreground whitespace-nowrap opacity-90"
|
|
7
7
|
}, E = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-[10px] text-muted-foreground truncate opacity-70"
|
|
10
|
-
},
|
|
10
|
+
}, N = /* @__PURE__ */ g({
|
|
11
11
|
__name: "DropdownItem",
|
|
12
12
|
props: {
|
|
13
13
|
option: {},
|
|
@@ -18,14 +18,14 @@ const j = ["tabindex", "data-disabled"], C = { class: "flex flex-col flex-1 min-
|
|
|
18
18
|
},
|
|
19
19
|
emits: ["click", "mouseenter"],
|
|
20
20
|
setup(e, { emit: x }) {
|
|
21
|
-
const t = e,
|
|
22
|
-
() => t.option.labelI18n ?
|
|
23
|
-
),
|
|
24
|
-
() => t.option.subtitleI18n ?
|
|
25
|
-
),
|
|
26
|
-
() => t.option.descriptionI18n ?
|
|
21
|
+
const t = e, u = x, y = a(
|
|
22
|
+
() => t.option.labelI18n ? r(t.option.labelI18n) : t.option.label
|
|
23
|
+
), m = a(
|
|
24
|
+
() => t.option.subtitleI18n ? r(t.option.subtitleI18n) : t.option.subtitle
|
|
25
|
+
), f = a(
|
|
26
|
+
() => t.option.descriptionI18n ? r(t.option.descriptionI18n) : t.option.description
|
|
27
27
|
);
|
|
28
|
-
return (
|
|
28
|
+
return (l, o) => (n(), s("div", {
|
|
29
29
|
tabindex: e.option.disabled ? -1 : 0,
|
|
30
30
|
"data-dropdown-item": "",
|
|
31
31
|
class: h(["relative w-full flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1 data-disabled:pointer-events-none data-disabled:opacity-50", [
|
|
@@ -35,11 +35,12 @@ const j = ["tabindex", "data-disabled"], C = { class: "flex flex-col flex-1 min-
|
|
|
35
35
|
e.option.class || ""
|
|
36
36
|
]]),
|
|
37
37
|
"data-disabled": e.option.disabled ? !0 : void 0,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
"data-testid": l.$attrs["data-testid"] || (e.option.value ? `dropdown-item-${e.option.value}` : `dropdown-item-${e.option.label}`).toString().toLowerCase().replace(/[^a-z0-9]+/g, "-"),
|
|
39
|
+
onClick: o[0] || (o[0] = (b) => u("click", e.option)),
|
|
40
|
+
onKeydown: o[1] || (o[1] = w(k((b) => u("click", e.option), ["prevent"]), ["enter"])),
|
|
41
|
+
onMouseenter: o[2] || (o[2] = (b) => l.$emit("mouseenter", e.index ?? -1))
|
|
41
42
|
}, [
|
|
42
|
-
|
|
43
|
+
$(l.$slots, "default", I(B({ option: e.option, index: e.index, selected: e.selected })), () => [
|
|
43
44
|
e.option.icon || e.option.emoji ? (n(), p(v, {
|
|
44
45
|
key: 0,
|
|
45
46
|
icon: e.option.icon,
|
|
@@ -47,11 +48,11 @@ const j = ["tabindex", "data-disabled"], C = { class: "flex flex-col flex-1 min-
|
|
|
47
48
|
class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
|
|
48
49
|
}, null, 8, ["icon", "emoji"])) : i("", !0),
|
|
49
50
|
c("div", C, [
|
|
50
|
-
c("div",
|
|
51
|
-
c("span",
|
|
52
|
-
|
|
51
|
+
c("div", S, [
|
|
52
|
+
c("span", z, d(y.value), 1),
|
|
53
|
+
m.value ? (n(), s("span", D, d(m.value), 1)) : i("", !0)
|
|
53
54
|
]),
|
|
54
|
-
|
|
55
|
+
f.value ? (n(), s("span", E, d(f.value), 1)) : i("", !0)
|
|
55
56
|
]),
|
|
56
57
|
e.selectable && e.selected ? (n(), p(v, {
|
|
57
58
|
key: 1,
|
|
@@ -63,5 +64,5 @@ const j = ["tabindex", "data-disabled"], C = { class: "flex flex-col flex-1 min-
|
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
N as default
|
|
67
68
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DropdownMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-77113fbb"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -21,7 +21,7 @@ const ve = ["dir"], ye = {
|
|
|
21
21
|
}, we = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "h-px bg-border my-1 mx-1"
|
|
24
|
-
},
|
|
24
|
+
}, pe = ["onMouseenter"], xe = { class: "flex items-center flex-1 min-w-0" }, Se = { class: "truncate" }, Oe = {
|
|
25
25
|
key: 3,
|
|
26
26
|
class: "flex justify-center py-2"
|
|
27
27
|
}, _e = {
|
|
@@ -70,11 +70,11 @@ const ve = ["dir"], ye = {
|
|
|
70
70
|
e.disabled || f("select", e);
|
|
71
71
|
}, {
|
|
72
72
|
focusedIndex: y,
|
|
73
|
-
isKeyboardMode:
|
|
73
|
+
isKeyboardMode: p,
|
|
74
74
|
filteredOptions: F,
|
|
75
75
|
handleKeyDown: M,
|
|
76
76
|
handleMouseMove: B,
|
|
77
|
-
onMouseEnterItem:
|
|
77
|
+
onMouseEnterItem: x,
|
|
78
78
|
scrollToIndex: K
|
|
79
79
|
} = fe({
|
|
80
80
|
options: u,
|
|
@@ -140,7 +140,8 @@ const ve = ["dir"], ye = {
|
|
|
140
140
|
"input-class": "-ml-1",
|
|
141
141
|
variant: "transparent",
|
|
142
142
|
"icon-class": "h-3.5! w-3.5!",
|
|
143
|
-
"show-clear-button": !1
|
|
143
|
+
"show-clear-button": !1,
|
|
144
|
+
"data-testid": "dropdown-search-input"
|
|
144
145
|
}, null, 8, ["modelValue", "placeholder"])
|
|
145
146
|
])) : d("", !0),
|
|
146
147
|
e.$slots.header ? (o(), i("div", ge, [
|
|
@@ -174,9 +175,9 @@ const ve = ["dir"], ye = {
|
|
|
174
175
|
key: 1,
|
|
175
176
|
option: l,
|
|
176
177
|
value: G(l),
|
|
177
|
-
focused: r(
|
|
178
|
+
focused: r(p) && r(y) === n,
|
|
178
179
|
onChange: J,
|
|
179
|
-
onMouseenter: (c) => r(
|
|
180
|
+
onMouseenter: (c) => r(x)(n)
|
|
180
181
|
}, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(he, {
|
|
181
182
|
key: 2,
|
|
182
183
|
"is-nested": !0,
|
|
@@ -198,13 +199,13 @@ const ve = ["dir"], ye = {
|
|
|
198
199
|
tabindex: 0,
|
|
199
200
|
"data-dropdown-item": "",
|
|
200
201
|
class: E(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1", [
|
|
201
|
-
r(
|
|
202
|
+
r(p) && r(y) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
202
203
|
l.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
203
204
|
l.triggerClass || l.class || ""
|
|
204
205
|
]]),
|
|
205
|
-
onMouseenter: (c) => r(
|
|
206
|
+
onMouseenter: (c) => r(x)(n)
|
|
206
207
|
}, [
|
|
207
|
-
S("div",
|
|
208
|
+
S("div", xe, [
|
|
208
209
|
l.icon || l.emoji ? (o(), m(O, {
|
|
209
210
|
key: 0,
|
|
210
211
|
icon: l.icon,
|
|
@@ -218,7 +219,7 @@ const ve = ["dir"], ye = {
|
|
|
218
219
|
icon: a.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
|
|
219
220
|
class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
|
|
220
221
|
}, null, 8, ["icon"])) : d("", !0)
|
|
221
|
-
], 42,
|
|
222
|
+
], 42, pe)
|
|
222
223
|
]),
|
|
223
224
|
_: 2
|
|
224
225
|
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ce, {
|
|
@@ -226,10 +227,10 @@ const ve = ["dir"], ye = {
|
|
|
226
227
|
option: l,
|
|
227
228
|
index: n,
|
|
228
229
|
selected: q(l),
|
|
229
|
-
focused: r(
|
|
230
|
+
focused: r(p) && r(y) === n,
|
|
230
231
|
selectable: a.selectable,
|
|
231
232
|
onClick: (c) => w(l),
|
|
232
|
-
onMouseenter: (c) => r(
|
|
233
|
+
onMouseenter: (c) => r(x)(n)
|
|
233
234
|
}, ne({ _: 2 }, [
|
|
234
235
|
e.$slots.item ? {
|
|
235
236
|
name: "default",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ButtonProps } from '../../types';
|
|
2
2
|
interface Props {
|
|
3
3
|
selectedLabel?: string;
|
|
4
|
+
selectedIcon?: string;
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
isOpen?: boolean;
|
|
6
7
|
disabled?: boolean;
|
|
@@ -13,5 +14,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
13
14
|
disabled: boolean;
|
|
14
15
|
direction: "ltr" | "rtl";
|
|
15
16
|
selectedLabel: string;
|
|
17
|
+
selectedIcon: string;
|
|
16
18
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
|
|
17
19
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const s = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as a, openBlock as l, createBlock as o, mergeProps as i } from "vue";
|
|
2
|
+
import d from "../Button.vue.js";
|
|
3
|
+
const s = /* @__PURE__ */ a({
|
|
4
4
|
__name: "DropdownTrigger",
|
|
5
5
|
props: {
|
|
6
6
|
selectedLabel: { default: "" },
|
|
7
|
+
selectedIcon: { default: "" },
|
|
7
8
|
placeholder: { default: "Select an option" },
|
|
8
9
|
isOpen: { type: Boolean },
|
|
9
10
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -12,15 +13,18 @@ const s = /* @__PURE__ */ t({
|
|
|
12
13
|
triggerProps: {}
|
|
13
14
|
},
|
|
14
15
|
setup(e) {
|
|
15
|
-
return (
|
|
16
|
+
return (t, n) => (l(), o(d, i({
|
|
16
17
|
text: e.selectedLabel || e.placeholder,
|
|
17
18
|
iconRight: "iconamoon:arrow-down-2",
|
|
18
19
|
variant: "outline",
|
|
19
20
|
disabled: e.disabled,
|
|
20
21
|
dir: e.direction
|
|
21
22
|
}, e.triggerProps, {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
icon: e.selectedIcon || e.triggerProps?.icon,
|
|
24
|
+
class: ["w-full justify-between! font-normal px-2.5!", e.className],
|
|
25
|
+
"icon-right-class": "ml-auto!",
|
|
26
|
+
"data-testid": t.$attrs["data-testid"] || "dropdown-trigger"
|
|
27
|
+
}), null, 16, ["text", "disabled", "dir", "icon", "class", "data-testid"]));
|
|
24
28
|
}
|
|
25
29
|
});
|
|
26
30
|
export {
|
|
@@ -27,6 +27,7 @@ export declare function useDropdownHydration(opts: UseDropdownHydrationOptions):
|
|
|
27
27
|
description?: string;
|
|
28
28
|
descriptionI18n?: string;
|
|
29
29
|
icon?: string;
|
|
30
|
+
badge?: string;
|
|
30
31
|
emoji?: string;
|
|
31
32
|
disabled?: {
|
|
32
33
|
valueOf: () => boolean;
|
|
@@ -67,6 +68,7 @@ export declare function useDropdownHydration(opts: UseDropdownHydrationOptions):
|
|
|
67
68
|
description?: string;
|
|
68
69
|
descriptionI18n?: string;
|
|
69
70
|
icon?: string;
|
|
71
|
+
badge?: string;
|
|
70
72
|
emoji?: string;
|
|
71
73
|
disabled?: {
|
|
72
74
|
valueOf: () => boolean;
|
|
@@ -11,6 +11,7 @@ type EmitFn = (event: 'update:modelValue' | 'onSelect', ...args: any[]) => void;
|
|
|
11
11
|
export declare function useDropdownSelection(props: UseDropdownSelectionProps, emit: EmitFn): {
|
|
12
12
|
currentValue: import('vue').ComputedRef<any>;
|
|
13
13
|
selectedLabel: import('vue').ComputedRef<string>;
|
|
14
|
+
selectedIcon: import('vue').ComputedRef<string>;
|
|
14
15
|
selectOption: (option: IDropdownOption) => any;
|
|
15
16
|
};
|
|
16
17
|
export {};
|
|
@@ -1,43 +1,58 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { deepMerge as
|
|
3
|
-
import { $t as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
for (const
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
if (
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
1
|
+
import { computed as d } from "vue";
|
|
2
|
+
import { deepMerge as V } from "../../../utils/object.js";
|
|
3
|
+
import { $t as g } from "../../../utils/i18n.js";
|
|
4
|
+
function I(r, u) {
|
|
5
|
+
const a = d(() => r.modelValue !== void 0 ? r.modelValue : r.selected), i = (l = [], t) => {
|
|
6
|
+
for (const e of l) {
|
|
7
|
+
const c = e.labelI18n ? g(e.labelI18n) : e.label;
|
|
8
|
+
if (e.value === t) return c;
|
|
9
|
+
if (e.key && typeof t == "object" && t !== null && e.key in t) {
|
|
10
|
+
if (e.children) {
|
|
11
|
+
const n = i(e.children, t[e.key]);
|
|
12
|
+
if (n) return `${c} / ${n}`;
|
|
13
13
|
}
|
|
14
|
-
return
|
|
14
|
+
return e.value === t[e.key], c;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
return "";
|
|
18
|
-
},
|
|
18
|
+
}, f = (l = [], t) => {
|
|
19
|
+
for (const e of l) {
|
|
20
|
+
if (e.value === t) return e.icon;
|
|
21
|
+
if (e.key && typeof t == "object" && t !== null && e.key in t) {
|
|
22
|
+
if (e.children) {
|
|
23
|
+
const c = f(e.children, t[e.key]);
|
|
24
|
+
if (c) return c;
|
|
25
|
+
}
|
|
26
|
+
return e.value === t[e.key], e.icon;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, y = d(() => !r.showSelectedLabel || !r.selectable || !r.options?.length ? "" : i(r.options, a.value)), b = d(() => {
|
|
30
|
+
if (r.showSelectedLabel && r.selectable && r.options?.length)
|
|
31
|
+
return f(r.options, a.value);
|
|
32
|
+
});
|
|
19
33
|
return {
|
|
20
|
-
currentValue:
|
|
21
|
-
selectedLabel:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
currentValue: a,
|
|
35
|
+
selectedLabel: y,
|
|
36
|
+
selectedIcon: b,
|
|
37
|
+
selectOption: (l) => {
|
|
38
|
+
if (typeof l != "string" && l?.disabled) return;
|
|
39
|
+
const t = a.value;
|
|
40
|
+
let e = l?.value ?? l?.label;
|
|
41
|
+
const c = l.data;
|
|
42
|
+
let n;
|
|
43
|
+
if (l.key && (typeof e == "object" && e !== null && l.key in e || (e = { [l.key]: e })), t && typeof t == "object" && !Array.isArray(t) && l.key) {
|
|
44
|
+
const o = l.key, k = l.value ?? l.label, v = t[o] === k;
|
|
45
|
+
if (r.toggleSelection && v) {
|
|
46
|
+
const s = { ...t };
|
|
47
|
+
return delete s[o], n = s, u("update:modelValue", n), u("onSelect", { value: n, data: c, option: l }), n;
|
|
33
48
|
}
|
|
34
|
-
|
|
49
|
+
n = V(t, e), u("update:modelValue", n), u("onSelect", { value: n, data: c, option: l });
|
|
35
50
|
} else
|
|
36
|
-
r.toggleSelection &&
|
|
37
|
-
return
|
|
51
|
+
r.toggleSelection && t === (l.value ?? l.label) ? (n = void 0, u("update:modelValue", void 0), u("onSelect", { value: void 0, data: c, option: l })) : (n = e, u("update:modelValue", n), u("onSelect", { value: n, data: c, option: l }));
|
|
52
|
+
return n;
|
|
38
53
|
}
|
|
39
54
|
};
|
|
40
55
|
}
|
|
41
56
|
export {
|
|
42
|
-
|
|
57
|
+
I as useDropdownSelection
|
|
43
58
|
};
|