vlite3 1.2.8 → 1.2.10
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/Button.vue.d.ts +5 -1
- package/components/Button.vue.js +164 -72
- package/components/CategoryManager/CategoryManager.vue.js +1 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/Dropdown/Dropdown.vue.d.ts +3 -3
- package/components/Dropdown/Dropdown.vue.js +14 -14
- package/components/Dropdown/DropdownGroupedLayout.vue.js +12 -12
- package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +1 -1
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +29 -25
- package/components/ImportData/ImportStep2.vue.js +0 -1
- package/components/Input.vue.js +6 -5
- package/components/Label.vue.d.ts +5 -2
- package/components/Label.vue.js +18 -11
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Splitter/Splitter.vue.d.ts +1 -1
- package/components/Tabes/Tabes.vue.js +2 -2
- package/components/Tabes/Tabes.vue2.js +53 -51
- package/components/Workbook/Sheet.vue.js +61 -57
- package/components/Workbook/Workbook.vue.js +2 -2
- package/components/Workbook/Workbook.vue2.js +25 -25
- package/components/Workbook/WorkbookAddButton.vue.js +9 -8
- package/directives/vRipple.d.ts +3 -1
- package/directives/vRipple.js +11 -11
- package/package.json +1 -1
- package/style.css +22 -3
- package/types/button.d.ts +2 -0
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ButtonVariant, ButtonSize, ButtonRounded, ButtonProps } from '../types';
|
|
2
|
+
export interface LocalButtonProps extends ButtonProps {
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
2
5
|
declare function __VLS_template(): {
|
|
3
6
|
attrs: Partial<{}>;
|
|
4
7
|
slots: {
|
|
@@ -9,7 +12,7 @@ declare function __VLS_template(): {
|
|
|
9
12
|
rootEl: HTMLButtonElement;
|
|
10
13
|
};
|
|
11
14
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<LocalButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<LocalButtonProps> & Readonly<{}>, {
|
|
13
16
|
type: "button" | "submit" | "reset";
|
|
14
17
|
class: any;
|
|
15
18
|
variant: ButtonVariant;
|
|
@@ -17,6 +20,7 @@ declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}
|
|
|
17
20
|
rounded: ButtonRounded;
|
|
18
21
|
loading: boolean;
|
|
19
22
|
disabled: boolean;
|
|
23
|
+
layout: "horizontal" | "vertical" | "tile";
|
|
20
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
|
|
21
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
26
|
export default _default;
|
package/components/Button.vue.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { vRipple as
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as N, useAttrs as T, computed as s, useSlots as A, withDirectives as G, openBlock as i, createElementBlock as l, normalizeClass as a, Fragment as C, createElementVNode as k, createBlock as f, createCommentVNode as c, renderSlot as S, createTextVNode as $, toDisplayString as v, unref as F } from "vue";
|
|
2
|
+
import p from "./Icon.vue.js";
|
|
3
|
+
import { vRipple as H } from "../directives/vRipple.js";
|
|
4
|
+
import { $t as M } from "../utils/i18n.js";
|
|
5
|
+
const O = ["type", "disabled", "data-testid"], Z = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "text-xs font-medium leading-tight truncate max-w-full"
|
|
8
|
+
}, q = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "text-[10px] font-normal opacity-70 mt-0.5 leading-tight truncate max-w-full"
|
|
11
|
+
}, J = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-[0.75em] font-normal opacity-70 mt-0.5 leading-tight"
|
|
14
|
+
}, X = /* @__PURE__ */ N({
|
|
6
15
|
__name: "Button",
|
|
7
16
|
props: {
|
|
17
|
+
description: {},
|
|
8
18
|
variant: { default: "primary" },
|
|
9
19
|
size: { default: "md" },
|
|
10
20
|
class: { default: "" },
|
|
@@ -19,18 +29,51 @@ const S = ["type", "disabled", "data-testid"], T = /* @__PURE__ */ k({
|
|
|
19
29
|
textClass: {},
|
|
20
30
|
iconClass: {},
|
|
21
31
|
iconRightClass: {},
|
|
22
|
-
asIcon: { type: Boolean }
|
|
32
|
+
asIcon: { type: Boolean },
|
|
33
|
+
layout: { default: "horizontal" }
|
|
23
34
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
setup(t) {
|
|
36
|
+
const z = {
|
|
37
|
+
primary: "bg-primary text-primary-foreground",
|
|
38
|
+
"primary-light": "bg-primary-light text-primary-fg-light",
|
|
39
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
40
|
+
danger: "bg-danger text-danger-fg",
|
|
41
|
+
"danger-light": "bg-danger-light text-destructive",
|
|
42
|
+
warning: "bg-warning text-warning-fg",
|
|
43
|
+
"warning-light": "bg-warning-light text-warning-fg-light",
|
|
44
|
+
info: "bg-info text-info-fg",
|
|
45
|
+
"info-light": "bg-info-light text-info-fg-light",
|
|
46
|
+
success: "bg-success text-success-fg",
|
|
47
|
+
"success-light": "bg-success-light text-success-fg-light",
|
|
48
|
+
outline: "bg-muted text-foreground",
|
|
49
|
+
"outline-floating": "bg-muted text-foreground",
|
|
50
|
+
"outline-primary": "bg-primary/10 text-primary",
|
|
51
|
+
"outline-danger": "bg-destructive/10 text-destructive",
|
|
52
|
+
"outline-warning": "bg-warning/10 text-warning",
|
|
53
|
+
"outline-info": "bg-info/10 text-info",
|
|
54
|
+
"outline-success": "bg-success/10 text-success",
|
|
55
|
+
ghost: "bg-accent text-accent-foreground",
|
|
56
|
+
link: "bg-primary/10 text-primary",
|
|
57
|
+
transparent: "bg-muted text-foreground"
|
|
58
|
+
}, e = t, I = T(), o = s(() => {
|
|
59
|
+
const n = e.layout || I.layout;
|
|
60
|
+
return n === "tile" ? "tile" : n === "vertical" ? "vertical" : "horizontal";
|
|
61
|
+
}), h = s(() => o.value === "tile"), j = s(() => z[e.variant] ?? z.primary), b = s(() => ({
|
|
62
|
+
xs: "w-9 h-9",
|
|
63
|
+
sm: "w-10 h-10",
|
|
64
|
+
sm2: "w-11 h-11",
|
|
65
|
+
md: "w-12 h-12",
|
|
66
|
+
lg: "w-14 h-14",
|
|
67
|
+
xl: "w-16 h-16"
|
|
68
|
+
})[e.size]), r = s(() => e.textI18n ? M(e.textI18n) : e.text), B = A(), x = s(
|
|
69
|
+
() => e?.asIcon || e.icon && !r.value && !B.default
|
|
70
|
+
), u = s(() => e.icon ? e.icon.startsWith("http://") || e.icon.startsWith("https://") || e.icon.startsWith("data:image/") ? !0 : [".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".ico", ".avif"].some((g) => e.icon.toLowerCase().endsWith(g)) : !1), R = s(() => {
|
|
71
|
+
const g = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer ${o.value === "tile" ? "flex-col gap-1.5 items-center" : o.value === "vertical" ? "flex-col gap-2" : e.description ? "gap-3" : "gap-2"} ${x.value ? "icon-only shrink-0" : ""}`, y = {
|
|
29
72
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
30
73
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/15",
|
|
31
74
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
32
75
|
danger: "bg-danger text-danger-fg hover:bg-danger/90",
|
|
33
|
-
"danger-light": "bg-danger-light text-
|
|
76
|
+
"danger-light": "bg-danger-light text-danger hover:bg-danger/20 dark:hover:bg-danger/40",
|
|
34
77
|
warning: "bg-warning text-warning-fg hover:bg-warning/80",
|
|
35
78
|
"warning-light": "bg-warning-light text-warning-fg-light hover:bg-warning/25",
|
|
36
79
|
info: "bg-info text-info-fg hover:bg-info/80",
|
|
@@ -47,21 +90,21 @@ const S = ["type", "disabled", "data-testid"], T = /* @__PURE__ */ k({
|
|
|
47
90
|
ghost: "hover:bg-accent hover:text-accent-foreground text-foreground",
|
|
48
91
|
link: "text-primary underline-offset-4 hover:underline",
|
|
49
92
|
transparent: ""
|
|
50
|
-
},
|
|
51
|
-
xs: "h-6.5 px-2",
|
|
52
|
-
sm: "h-7.5 px-3",
|
|
53
|
-
sm2: "h-8 px-3",
|
|
54
|
-
md: "h-9 px-4 py-2",
|
|
55
|
-
lg: "h-10 px-4",
|
|
56
|
-
xl: "h-12 px-10"
|
|
57
|
-
},
|
|
93
|
+
}, d = {
|
|
94
|
+
xs: e.description ? "h-auto py-1.5 px-2" : "h-6.5 px-2",
|
|
95
|
+
sm: e.description ? "h-auto py-2 px-3" : "h-7.5 px-3",
|
|
96
|
+
sm2: e.description ? "h-auto py-2 px-3" : "h-8 px-3",
|
|
97
|
+
md: e.description ? "h-auto py-2.5 px-4" : "h-9 px-4 py-2",
|
|
98
|
+
lg: e.description ? "h-auto py-3 px-4" : "h-10 px-4",
|
|
99
|
+
xl: e.description ? "h-auto py-4 px-10" : "h-12 px-10"
|
|
100
|
+
}, V = {
|
|
58
101
|
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
59
102
|
sm: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
|
|
60
103
|
sm2: "h-8 w-8 min-h-8 min-w-8",
|
|
61
104
|
md: "h-9 w-9 min-h-9 min-w-9",
|
|
62
105
|
lg: "h-10 w-10 min-h-10 min-w-10",
|
|
63
106
|
xl: "h-12 w-12 min-h-12 min-w-12"
|
|
64
|
-
},
|
|
107
|
+
}, W = {
|
|
65
108
|
none: "rounded-none",
|
|
66
109
|
sm: "rounded-sm",
|
|
67
110
|
sm2: "rounded-sm",
|
|
@@ -71,23 +114,37 @@ const S = ["type", "disabled", "data-testid"], T = /* @__PURE__ */ k({
|
|
|
71
114
|
"2xl": "rounded-2xl",
|
|
72
115
|
full: "rounded-full"
|
|
73
116
|
};
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
p
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
117
|
+
let w = x.value ? V[e.size] : d[e.size];
|
|
118
|
+
o.value === "tile" ? w = {
|
|
119
|
+
xs: "h-auto p-0!",
|
|
120
|
+
sm: "h-auto p-0!",
|
|
121
|
+
sm2: "h-auto p-0!",
|
|
122
|
+
md: "h-auto p-0!",
|
|
123
|
+
lg: "h-auto p-0!",
|
|
124
|
+
xl: "h-auto p-0!"
|
|
125
|
+
}[e.size] : o.value === "vertical" && (w = {
|
|
126
|
+
xs: "h-auto py-1.5 px-2 min-w-16",
|
|
127
|
+
sm: "h-auto py-2 px-3 min-w-20",
|
|
128
|
+
sm2: "h-auto py-2 px-3 min-w-20",
|
|
129
|
+
md: "h-auto py-2.5 px-4 min-w-24",
|
|
130
|
+
lg: "h-auto py-3 px-4 min-w-28",
|
|
131
|
+
xl: "h-auto py-4 px-10 min-w-32"
|
|
132
|
+
}[e.size]);
|
|
133
|
+
const D = h.value ? "group text-foreground focus:outline-none focus-visible:outline-none active:scale-100!" : y[e.variant];
|
|
134
|
+
return [g, D, W[e.rounded], w, e.class].join(
|
|
135
|
+
" "
|
|
136
|
+
);
|
|
137
|
+
}), m = s(() => {
|
|
138
|
+
if (h.value && u.value)
|
|
139
|
+
return `${b.value} object-cover`;
|
|
140
|
+
const n = e.description && o.value === "horizontal", g = {
|
|
141
|
+
xs: n ? "w-3.5 h-3.5" : "w-3 h-3",
|
|
142
|
+
sm: n ? "w-5 h-5" : "w-4 h-4",
|
|
143
|
+
sm2: n ? "w-5 h-5" : "w-4 h-4",
|
|
144
|
+
md: n ? "w-5 h-5" : "w-4 h-4",
|
|
145
|
+
lg: n ? "w-5 h-5" : "w-4 h-4",
|
|
146
|
+
xl: n ? "w-5 h-5" : "w-4 h-4"
|
|
147
|
+
}, y = {
|
|
91
148
|
xs: "w-3 h-3",
|
|
92
149
|
sm: "w-4 h-4",
|
|
93
150
|
sm2: "w-4 h-4",
|
|
@@ -95,43 +152,78 @@ const S = ["type", "disabled", "data-testid"], T = /* @__PURE__ */ k({
|
|
|
95
152
|
lg: "w-4 h-4",
|
|
96
153
|
xl: "w-4 h-4"
|
|
97
154
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
155
|
+
let d = x.value ? y[e.size] : g[e.size];
|
|
156
|
+
return u.value && (d += " object-cover"), h.value ? d += " scale-[1.45]!" : o.value === "vertical" && (d += " scale-[1.35]! mt-1"), d;
|
|
157
|
+
}), E = s(() => o.value === "vertical" ? "scale-[0.9]" : "");
|
|
158
|
+
return (n, g) => G((i(), l("button", {
|
|
159
|
+
type: t.type,
|
|
160
|
+
class: a([R.value, "cursor-pointer"]),
|
|
161
|
+
disabled: t.disabled || t.loading,
|
|
162
|
+
"data-testid": n.$attrs["data-testid"] || (r.value ? `btn-${r.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : t.icon ? `btn-${t.icon.replace(/[^a-zA-Z0-9]+/g, "-")}` : "button")
|
|
105
163
|
}, [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
164
|
+
h.value ? (i(), l(C, { key: 0 }, [
|
|
165
|
+
k("span", {
|
|
166
|
+
class: a(["inline-flex items-center justify-center shrink-0 transition-transform duration-150 ease-out group-active:scale-[0.92]", [
|
|
167
|
+
u.value ? "" : "rounded-full",
|
|
168
|
+
u.value ? "" : j.value,
|
|
169
|
+
u.value ? "" : b.value
|
|
170
|
+
]])
|
|
171
|
+
}, [
|
|
172
|
+
t.loading ? (i(), f(p, {
|
|
173
|
+
key: 0,
|
|
174
|
+
icon: "lucide:loader-2",
|
|
175
|
+
class: a(["animate-spin pointer-events-none", [m.value, u.value ? b.value : ""]])
|
|
176
|
+
}, null, 8, ["class"])) : t.icon ? (i(), f(p, {
|
|
177
|
+
key: 1,
|
|
178
|
+
icon: t.icon,
|
|
179
|
+
class: a(["pointer-events-none", [t.iconClass, m.value]])
|
|
180
|
+
}, null, 8, ["icon", "class"])) : c("", !0)
|
|
181
|
+
], 2),
|
|
182
|
+
r.value || n.$slots.default || e.description ? (i(), l("span", {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: a(["flex flex-col items-center max-w-full", t.textClass])
|
|
185
|
+
}, [
|
|
186
|
+
r.value || n.$slots.default ? (i(), l("span", Z, [
|
|
187
|
+
S(n.$slots, "default", {}, () => [
|
|
188
|
+
$(v(r.value), 1)
|
|
189
|
+
])
|
|
190
|
+
])) : c("", !0),
|
|
191
|
+
e.description ? (i(), l("span", q, v(e.description), 1)) : c("", !0)
|
|
192
|
+
], 2)) : c("", !0)
|
|
193
|
+
], 64)) : (i(), l(C, { key: 1 }, [
|
|
194
|
+
t.loading ? (i(), f(p, {
|
|
195
|
+
key: 0,
|
|
196
|
+
icon: "lucide:loader-2",
|
|
197
|
+
class: a(["animate-spin pointer-events-none", m.value])
|
|
198
|
+
}, null, 8, ["class"])) : t.icon ? (i(), f(p, {
|
|
199
|
+
key: 1,
|
|
200
|
+
icon: t.icon,
|
|
201
|
+
class: a(["pointer-events-none", [t.iconClass, m.value, x.value ? "mx-auto" : ""]])
|
|
202
|
+
}, null, 8, ["icon", "class"])) : c("", !0),
|
|
203
|
+
r.value || n.$slots.default || e.description ? (i(), l("div", {
|
|
204
|
+
key: 2,
|
|
205
|
+
class: a(["flex flex-col justify-center", o.value === "vertical" ? "items-center text-center" : "items-start text-left"])
|
|
206
|
+
}, [
|
|
207
|
+
k("span", {
|
|
208
|
+
class: a([[t.textClass, E.value], "leading-tight"])
|
|
209
|
+
}, [
|
|
210
|
+
S(n.$slots, "default", {}, () => [
|
|
211
|
+
$(v(r.value), 1)
|
|
212
|
+
])
|
|
213
|
+
], 2),
|
|
214
|
+
e.description ? (i(), l("span", J, v(e.description), 1)) : c("", !0)
|
|
215
|
+
], 2)) : c("", !0),
|
|
216
|
+
t.iconRight && !t.loading ? (i(), f(p, {
|
|
217
|
+
key: 3,
|
|
218
|
+
icon: t.iconRight,
|
|
219
|
+
class: a([[t.iconRightClass, m.value], "h-4 w-4 pointer-events-none"])
|
|
220
|
+
}, null, 8, ["icon", "class"])) : c("", !0)
|
|
221
|
+
], 64))
|
|
222
|
+
], 10, O)), [
|
|
223
|
+
[F(H), !h.value]
|
|
132
224
|
]);
|
|
133
225
|
}
|
|
134
226
|
});
|
|
135
227
|
export {
|
|
136
|
-
|
|
228
|
+
X as default
|
|
137
229
|
};
|
|
@@ -6,8 +6,8 @@ import O from "../Input.vue.js";
|
|
|
6
6
|
import "../../core/config.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import y from "../Button.vue.js";
|
|
9
|
-
import E from "./ColorIro.
|
|
10
|
-
/* empty css
|
|
9
|
+
import E from "./ColorIro.vue.js";
|
|
10
|
+
/* empty css */
|
|
11
11
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
12
12
|
const I = {
|
|
13
13
|
key: 0,
|
|
@@ -39,7 +39,7 @@ type __VLS_Props = {
|
|
|
39
39
|
isNested?: boolean;
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
readonly?: boolean;
|
|
42
|
-
|
|
42
|
+
variant?: 'default' | 'transparent' | 'secondary';
|
|
43
43
|
};
|
|
44
44
|
declare function __VLS_template(): {
|
|
45
45
|
attrs: Partial<{}>;
|
|
@@ -88,16 +88,17 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
88
88
|
onOnOpen?: () => any;
|
|
89
89
|
"onUpdate:isOpen"?: (value: boolean) => any;
|
|
90
90
|
}>, {
|
|
91
|
+
variant: "default" | "transparent" | "secondary";
|
|
91
92
|
columns: number | string;
|
|
92
93
|
loading: boolean;
|
|
93
94
|
readonly: boolean;
|
|
94
95
|
disabled: boolean;
|
|
96
|
+
layout: "default" | "grouped";
|
|
95
97
|
direction: "ltr" | "rtl";
|
|
96
98
|
selectable: boolean;
|
|
97
99
|
options: (IDropdownOption | string | number)[];
|
|
98
100
|
selectedIndex: number | null;
|
|
99
101
|
maxHeight: string;
|
|
100
|
-
layout: "default" | "grouped";
|
|
101
102
|
hasMore: boolean;
|
|
102
103
|
searchable: boolean;
|
|
103
104
|
remote: boolean;
|
|
@@ -113,7 +114,6 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
113
114
|
showSelectedIcon: boolean;
|
|
114
115
|
doubleConfirmation: boolean;
|
|
115
116
|
isNested: boolean;
|
|
116
|
-
unstyled: boolean;
|
|
117
117
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
118
118
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
119
119
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as le, ref as i, computed as f, inject as ne, onMounted as oe, onUnmounted as ae, watch as M, provide as L, reactive as ie, toRefs as se, openBlock as V, createElementBlock as re, normalizeStyle as de, createVNode as P, unref as u, withCtx as m, createBlock as ue, normalizeClass as ce, createSlots as fe, renderSlot as v, normalizeProps as R, guardReactiveProps as z, createCommentVNode as me } from "vue";
|
|
2
2
|
import ve from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import he from "./DropdownMenu.vue.js";
|
|
5
|
+
import ye from "./DropdownTrigger.vue.js";
|
|
6
6
|
import ge from "../ConfirmationModal.vue.js";
|
|
7
7
|
import { useDropdownIds as be } from "./composables/useDropdownIds.js";
|
|
8
8
|
import { useDropdownSelection as Ce } from "./composables/useDropdownSelection.js";
|
|
@@ -48,11 +48,11 @@ const Ne = /* @__PURE__ */ le({
|
|
|
48
48
|
isNested: { type: Boolean, default: !1 },
|
|
49
49
|
disabled: { type: Boolean, default: !1 },
|
|
50
50
|
readonly: { type: Boolean, default: !1 },
|
|
51
|
-
|
|
51
|
+
variant: { default: "default" }
|
|
52
52
|
},
|
|
53
53
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
54
54
|
setup(t, { emit: j }) {
|
|
55
|
-
const l = t,
|
|
55
|
+
const l = t, h = j, b = i(!1), y = i(null), r = i({
|
|
56
56
|
title: "Confirm Selection",
|
|
57
57
|
description: "Are you sure you want to select this option?",
|
|
58
58
|
confirmText: "Confirm",
|
|
@@ -78,10 +78,10 @@ const Ne = /* @__PURE__ */ le({
|
|
|
78
78
|
);
|
|
79
79
|
const N = (e) => {
|
|
80
80
|
if (l.disabled || l.readonly) {
|
|
81
|
-
C.value = !1,
|
|
81
|
+
C.value = !1, h("update:isOpen", !1);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
C.value = e,
|
|
84
|
+
C.value = e, h("update:isOpen", e), h(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
|
|
85
85
|
}, O = () => {
|
|
86
86
|
N(!1);
|
|
87
87
|
}, J = (e) => {
|
|
@@ -128,7 +128,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
128
128
|
options: c
|
|
129
129
|
}), { currentValue: B, selectedLabel: A, selectedIcon: H, selectOption: Y } = Ce(
|
|
130
130
|
X,
|
|
131
|
-
|
|
131
|
+
h
|
|
132
132
|
), Z = f(() => {
|
|
133
133
|
const e = l.ignoreClickOutside || [], o = Q(c.value);
|
|
134
134
|
return [.../* @__PURE__ */ new Set([...e, ...o, ...g.value])];
|
|
@@ -142,7 +142,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
142
142
|
);
|
|
143
143
|
const _ = (e) => {
|
|
144
144
|
if (l.disabled || l.readonly || e.disabled) return;
|
|
145
|
-
l.doubleConfirmation || !!e.confirmation ? (
|
|
145
|
+
l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ? r.value = {
|
|
146
146
|
title: e.confirmation.title || "Confirm Selection",
|
|
147
147
|
description: e.confirmation.description || "Are you sure you want to select this option?",
|
|
148
148
|
confirmText: e.confirmation.confirmText || "Confirm",
|
|
@@ -172,9 +172,9 @@ const Ne = /* @__PURE__ */ le({
|
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
}, ee = () => {
|
|
175
|
-
|
|
175
|
+
y.value && (D(y.value), y.value = null, b.value = !1);
|
|
176
176
|
}, te = () => {
|
|
177
|
-
|
|
177
|
+
y.value = null, b.value = !1;
|
|
178
178
|
};
|
|
179
179
|
return (e, o) => (V(), re("div", {
|
|
180
180
|
class: "relative inline-block text-left",
|
|
@@ -192,7 +192,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
192
192
|
menuId: w.value,
|
|
193
193
|
ignoreClickOutside: Z.value,
|
|
194
194
|
class: "w-full",
|
|
195
|
-
className: "dropdown " + (t.className || "") + (t.
|
|
195
|
+
className: "dropdown " + (t.className || "") + (t.variant === "transparent" ? " unstyled-dropdown" : "") + (t.variant === "secondary" ? " dropdown-secondary" : ""),
|
|
196
196
|
onOnShow: o[2] || (o[2] = (n) => e.$emit("onOpen")),
|
|
197
197
|
onOnHide: o[3] || (o[3] = (n) => e.$emit("onClose")),
|
|
198
198
|
"onUpdate:isOpen": N,
|
|
@@ -200,7 +200,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
200
200
|
styles: {
|
|
201
201
|
padding: "0",
|
|
202
202
|
...t.width ? { width: t.width, maxWidth: t.width } : {},
|
|
203
|
-
...t.
|
|
203
|
+
...t.variant === "transparent" ? { background: "transparent", border: "none", boxShadow: "none" } : {}
|
|
204
204
|
}
|
|
205
205
|
}, {
|
|
206
206
|
trigger: m(({ isOpen: n }) => [
|
|
@@ -209,7 +209,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
209
209
|
selectedIcon: t.showSelectedIcon ? u(H) : void 0,
|
|
210
210
|
isOpen: n
|
|
211
211
|
})), () => [
|
|
212
|
-
P(
|
|
212
|
+
P(ye, {
|
|
213
213
|
"selected-label": u(A),
|
|
214
214
|
"selected-icon": t.showSelectedIcon ? u(H) : void 0,
|
|
215
215
|
"is-open": n,
|
|
@@ -222,7 +222,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
222
222
|
])
|
|
223
223
|
]),
|
|
224
224
|
default: m(() => [
|
|
225
|
-
!(t.disabled || t.readonly) && ($.value.length || c.value.length || e.$slots.menu || e.$slots.item || e.$slots.default || t.remote || t.searchable) ? (V(), ue(
|
|
225
|
+
!(t.disabled || t.readonly) && ($.value.length || c.value.length || e.$slots.menu || e.$slots.item || e.$slots.default || t.remote || t.searchable) ? (V(), ue(he, {
|
|
226
226
|
key: 0,
|
|
227
227
|
options: $.value,
|
|
228
228
|
cachedOptions: c.value,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _, computed as C, openBlock as l, createElementBlock as
|
|
1
|
+
import { defineComponent as _, computed as C, openBlock as l, createElementBlock as n, normalizeStyle as $, Fragment as a, renderList as i, createElementVNode as m, normalizeClass as h, toDisplayString as j, createBlock as u, createCommentVNode as f, createVNode as w } from "vue";
|
|
2
2
|
import B from "../Icon.vue.js";
|
|
3
3
|
import y from "./DropdownItem.vue.js";
|
|
4
4
|
import { $t as N } from "../../utils/i18n.js";
|
|
@@ -24,13 +24,13 @@ const S = { class: "font-semibold text-sm text-foreground" }, L = { class: "flex
|
|
|
24
24
|
const e = s.columns;
|
|
25
25
|
return typeof e == "number" ? { gridTemplateColumns: `repeat(${e}, minmax(0, 1fr))` } : { gridTemplateColumns: e };
|
|
26
26
|
}), d = (e) => s.selected ? Array.isArray(s.selected) ? s.selected.includes(e.value) : typeof s.selected == "object" && s.selected !== null && e.key && e.key in s.selected ? s.selected[e.key] === e.value : s.selected === e.value : !1, b = (e) => e.labelI18n ? N(e.labelI18n) : e.label;
|
|
27
|
-
return (e, D) => (l(),
|
|
27
|
+
return (e, D) => (l(), n("div", {
|
|
28
28
|
class: "grid gap-6 p-4",
|
|
29
29
|
style: $(k.value)
|
|
30
30
|
}, [
|
|
31
|
-
(l(!0),
|
|
31
|
+
(l(!0), n(a, null, i(r.options, (t, x) => (l(), n("div", {
|
|
32
32
|
key: t.key || t.value || x,
|
|
33
|
-
class: "flex flex-col space-y-2
|
|
33
|
+
class: "flex flex-col space-y-2"
|
|
34
34
|
}, [
|
|
35
35
|
m("div", {
|
|
36
36
|
class: h(["flex items-center gap-2 px-2 py-1 mb-1", r.headerClass])
|
|
@@ -44,18 +44,18 @@ const S = { class: "font-semibold text-sm text-foreground" }, L = { class: "flex
|
|
|
44
44
|
}, null, 8, ["icon", "emoji"])) : f("", !0)
|
|
45
45
|
], 2),
|
|
46
46
|
m("div", L, [
|
|
47
|
-
t.children && t.children.length ? (l(!0),
|
|
48
|
-
key:
|
|
47
|
+
t.children && t.children.length ? (l(!0), n(a, { key: 0 }, i(t.children, (c, p) => (l(), n(a, {
|
|
48
|
+
key: c.key || c.value || p
|
|
49
49
|
}, [
|
|
50
50
|
w(y, {
|
|
51
|
-
option:
|
|
52
|
-
selected: d(
|
|
51
|
+
option: c,
|
|
52
|
+
selected: d(c),
|
|
53
53
|
selectable: r.selectable,
|
|
54
54
|
class: "w-full",
|
|
55
|
-
onClick: (o) => e.$emit("select",
|
|
55
|
+
onClick: (o) => e.$emit("select", c)
|
|
56
56
|
}, null, 8, ["option", "selected", "selectable", "onClick"]),
|
|
57
|
-
|
|
58
|
-
(l(!0),
|
|
57
|
+
c.children && c.children.length ? (l(), n("div", V, [
|
|
58
|
+
(l(!0), n(a, null, i(c.children, (o, v) => (l(), u(y, {
|
|
59
59
|
key: o.key || o.value || v,
|
|
60
60
|
option: o,
|
|
61
61
|
selected: d(o),
|
|
@@ -64,7 +64,7 @@ const S = { class: "font-semibold text-sm text-foreground" }, L = { class: "flex
|
|
|
64
64
|
onClick: (E) => e.$emit("select", o)
|
|
65
65
|
}, null, 8, ["option", "selected", "selectable", "onClick"]))), 128))
|
|
66
66
|
])) : f("", !0)
|
|
67
|
-
], 64))), 128)) : (l(),
|
|
67
|
+
], 64))), 128)) : (l(), n("div", z, "No items"))
|
|
68
68
|
])
|
|
69
69
|
]))), 128))
|
|
70
70
|
], 4));
|
|
@@ -53,6 +53,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
53
53
|
class: string;
|
|
54
54
|
columns: number | string;
|
|
55
55
|
loading: boolean;
|
|
56
|
+
layout: "default" | "grouped";
|
|
56
57
|
direction: "ltr" | "rtl";
|
|
57
58
|
selectable: boolean;
|
|
58
59
|
options: (IDropdownOption | string | number)[];
|
|
@@ -62,7 +63,6 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
62
63
|
nestedPosition: any;
|
|
63
64
|
nestedOffset: [number, number];
|
|
64
65
|
isCustomSlotMenu: boolean;
|
|
65
|
-
layout: "default" | "grouped";
|
|
66
66
|
hasMore: boolean;
|
|
67
67
|
searchable: boolean;
|
|
68
68
|
remote: boolean;
|
|
@@ -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
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5cf38b33"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -131,7 +131,7 @@ const ve = ["dir"], ye = {
|
|
|
131
131
|
});
|
|
132
132
|
const X = (e) => e.labelI18n ? $(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
|
|
133
133
|
return (e, s) => (o(), i("div", {
|
|
134
|
-
class: "dropdown-menu w-full
|
|
134
|
+
class: "dropdown-menu w-full flex flex-col",
|
|
135
135
|
dir: a.direction
|
|
136
136
|
}, [
|
|
137
137
|
B.value ? (o(), i("div", ye, [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormFields.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-330a03fe"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|