vlite3 1.2.9 → 1.2.12
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 -1
- package/components/Dropdown/Dropdown.vue.js +17 -15
- package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
- package/components/Form/Form.vue.d.ts +1 -0
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +29 -28
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +29 -25
- package/components/ImportData/ImportStep2.vue.js +6 -6
- package/components/Input.vue.js +6 -5
- package/components/Kanban/Kanban.vue.js +1 -1
- package/components/Kanban/Kanban.vue2.js +1 -1
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +17 -17
- package/components/Label.vue.d.ts +5 -2
- package/components/Label.vue.js +18 -11
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +1 -1
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +1 -1
- package/components/PermissionMatrix/PermissionMatrix.vue.js +1 -1
- package/components/PermissionMatrix/PermissionMatrix.vue2.js +1 -1
- package/components/Screen/ScreenFilter.vue.js +34 -31
- package/components/SidePanel.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 +76 -70
- package/components/Workbook/Workbook.vue.js +2 -2
- package/components/Workbook/Workbook.vue2.js +88 -84
- package/components/Workbook/WorkbookAddButton.vue.js +9 -8
- package/directives/vRipple.d.ts +3 -1
- package/directives/vRipple.js +11 -11
- package/package.json +13 -1
- package/style.css +83 -72
- package/test/VliteScreen.d.ts +120 -0
- package/test/VliteScreen.js +328 -0
- package/test/createDataFactory.d.ts +24 -0
- package/test/createDataFactory.js +59 -0
- package/test/extractSchemaFields.d.ts +14 -0
- package/test/extractSchemaFields.js +11 -0
- package/test/index.d.ts +39 -0
- package/test/index.js +10 -0
- package/test/renderVlite.d.ts +30 -0
- package/test/renderVlite.js +12 -0
- package/test/types.d.ts +39 -0
- package/types/button.d.ts +2 -0
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.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.vue2.js";
|
|
10
|
+
/* empty css */
|
|
11
11
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
12
12
|
const I = {
|
|
13
13
|
key: 0,
|
|
@@ -18,6 +18,7 @@ type __VLS_Props = {
|
|
|
18
18
|
selectedIndex?: number | null;
|
|
19
19
|
maxHeight?: string;
|
|
20
20
|
width?: string;
|
|
21
|
+
minWidth?: string;
|
|
21
22
|
ignoreClickOutside?: string[];
|
|
22
23
|
menuId?: string;
|
|
23
24
|
nestedPosition?: TooltTipPlacement;
|
|
@@ -93,12 +94,12 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
93
94
|
loading: boolean;
|
|
94
95
|
readonly: boolean;
|
|
95
96
|
disabled: boolean;
|
|
97
|
+
layout: "default" | "grouped";
|
|
96
98
|
direction: "ltr" | "rtl";
|
|
97
99
|
selectable: boolean;
|
|
98
100
|
options: (IDropdownOption | string | number)[];
|
|
99
101
|
selectedIndex: number | null;
|
|
100
102
|
maxHeight: string;
|
|
101
|
-
layout: "default" | "grouped";
|
|
102
103
|
hasMore: boolean;
|
|
103
104
|
searchable: boolean;
|
|
104
105
|
remote: boolean;
|
|
@@ -110,6 +111,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
110
111
|
offset: [number, number];
|
|
111
112
|
isOpen: boolean;
|
|
112
113
|
teleport: boolean;
|
|
114
|
+
minWidth: string;
|
|
113
115
|
showSelectedLabel: boolean;
|
|
114
116
|
showSelectedIcon: boolean;
|
|
115
117
|
doubleConfirmation: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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 W, createCommentVNode as me } from "vue";
|
|
2
2
|
import ve from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
4
|
import he from "./DropdownMenu.vue.js";
|
|
@@ -7,7 +7,7 @@ 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";
|
|
9
9
|
import { useDropdownHydration as pe } from "./composables/useDropdownHydration.js";
|
|
10
|
-
const
|
|
10
|
+
const xe = /* @__PURE__ */ le({
|
|
11
11
|
__name: "Dropdown",
|
|
12
12
|
props: {
|
|
13
13
|
selected: {},
|
|
@@ -27,6 +27,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
27
27
|
selectedIndex: { default: null },
|
|
28
28
|
maxHeight: { default: "300px" },
|
|
29
29
|
width: {},
|
|
30
|
+
minWidth: { default: "130px" },
|
|
30
31
|
ignoreClickOutside: {},
|
|
31
32
|
menuId: {},
|
|
32
33
|
nestedPosition: {},
|
|
@@ -51,14 +52,14 @@ const Ne = /* @__PURE__ */ le({
|
|
|
51
52
|
variant: { default: "default" }
|
|
52
53
|
},
|
|
53
54
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
54
|
-
setup(t, { emit:
|
|
55
|
-
const l = t, h =
|
|
55
|
+
setup(t, { emit: z }) {
|
|
56
|
+
const l = t, h = z, b = i(!1), y = i(null), r = i({
|
|
56
57
|
title: "Confirm Selection",
|
|
57
58
|
description: "Are you sure you want to select this option?",
|
|
58
59
|
confirmText: "Confirm",
|
|
59
60
|
cancelText: "Cancel",
|
|
60
61
|
variant: "primary"
|
|
61
|
-
}),
|
|
62
|
+
}), j = f(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), U = f(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), C = i(l.isOpen || !1), p = i(0), q = `dropdown-${Math.random().toString(36).substring(2, 9)}`, w = f(() => l.menuId || q), g = i([]), s = ne("dropdown-context", null), F = (e) => {
|
|
62
63
|
g.value.includes(e) || g.value.push(e), s?.registerChildId?.(e);
|
|
63
64
|
}, G = (e) => {
|
|
64
65
|
g.value = g.value.filter((o) => o !== e), s?.unregisterChildId?.(e);
|
|
@@ -76,14 +77,14 @@ const Ne = /* @__PURE__ */ le({
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
);
|
|
79
|
-
const
|
|
80
|
+
const x = (e) => {
|
|
80
81
|
if (l.disabled || l.readonly) {
|
|
81
82
|
C.value = !1, h("update:isOpen", !1);
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
85
|
C.value = e, h("update:isOpen", e), h(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
|
|
85
86
|
}, O = () => {
|
|
86
|
-
|
|
87
|
+
x(!1);
|
|
87
88
|
}, J = (e) => {
|
|
88
89
|
e ? p.value++ : p.value = Math.max(0, p.value - 1);
|
|
89
90
|
};
|
|
@@ -95,7 +96,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
95
96
|
registerChildId: F,
|
|
96
97
|
unregisterChildId: G
|
|
97
98
|
}), L("modal-context", null);
|
|
98
|
-
const $ = f(() => l.options ? l.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), S = i([]),
|
|
99
|
+
const $ = f(() => l.options ? l.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), S = i([]), N = i(!1), I = i(!1);
|
|
99
100
|
M(
|
|
100
101
|
$,
|
|
101
102
|
(e) => {
|
|
@@ -107,7 +108,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
107
108
|
}), S.value = o;
|
|
108
109
|
} else
|
|
109
110
|
S.value = e;
|
|
110
|
-
!
|
|
111
|
+
!N.value && e.length > 0 && (N.value = !0, setTimeout(() => {
|
|
111
112
|
I.value = !0, E(B.value);
|
|
112
113
|
}, 10));
|
|
113
114
|
}
|
|
@@ -186,7 +187,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
186
187
|
arrow: !1,
|
|
187
188
|
teleport: t.teleport,
|
|
188
189
|
offset: t.offset,
|
|
189
|
-
placement:
|
|
190
|
+
placement: j.value,
|
|
190
191
|
isOpen: C.value,
|
|
191
192
|
keepAlive: p.value > 0,
|
|
192
193
|
menuId: w.value,
|
|
@@ -195,16 +196,17 @@ const Ne = /* @__PURE__ */ le({
|
|
|
195
196
|
className: "dropdown " + (t.className || "") + (t.variant === "transparent" ? " unstyled-dropdown" : "") + (t.variant === "secondary" ? " dropdown-secondary" : ""),
|
|
196
197
|
onOnShow: o[2] || (o[2] = (n) => e.$emit("onOpen")),
|
|
197
198
|
onOnHide: o[3] || (o[3] = (n) => e.$emit("onClose")),
|
|
198
|
-
"onUpdate:isOpen":
|
|
199
|
+
"onUpdate:isOpen": x,
|
|
199
200
|
triggerClass: "w-full",
|
|
200
201
|
styles: {
|
|
201
202
|
padding: "0",
|
|
202
203
|
...t.width ? { width: t.width, maxWidth: t.width } : {},
|
|
204
|
+
...t.minWidth ? { minWidth: t.minWidth } : {},
|
|
203
205
|
...t.variant === "transparent" ? { background: "transparent", border: "none", boxShadow: "none" } : {}
|
|
204
206
|
}
|
|
205
207
|
}, {
|
|
206
208
|
trigger: m(({ isOpen: n }) => [
|
|
207
|
-
v(e.$slots, "trigger", R(
|
|
209
|
+
v(e.$slots, "trigger", R(W({
|
|
208
210
|
selectedLabel: u(A),
|
|
209
211
|
selectedIcon: t.showSelectedIcon ? u(H) : void 0,
|
|
210
212
|
isOpen: n
|
|
@@ -232,7 +234,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
232
234
|
selected: u(B),
|
|
233
235
|
selectedIndex: t.selectedIndex,
|
|
234
236
|
maxHeight: t.maxHeight,
|
|
235
|
-
nestedPosition:
|
|
237
|
+
nestedPosition: U.value,
|
|
236
238
|
nestedOffset: t.nestedOffset,
|
|
237
239
|
selectable: t.selectable,
|
|
238
240
|
direction: t.direction,
|
|
@@ -260,7 +262,7 @@ const Ne = /* @__PURE__ */ le({
|
|
|
260
262
|
e.$slots.item ? {
|
|
261
263
|
name: "item",
|
|
262
264
|
fn: m((n) => [
|
|
263
|
-
v(e.$slots, "item", R(
|
|
265
|
+
v(e.$slots, "item", R(W(n)))
|
|
264
266
|
]),
|
|
265
267
|
key: "1"
|
|
266
268
|
} : void 0,
|
|
@@ -296,5 +298,5 @@ const Ne = /* @__PURE__ */ le({
|
|
|
296
298
|
}
|
|
297
299
|
});
|
|
298
300
|
export {
|
|
299
|
-
|
|
301
|
+
xe as default
|
|
300
302
|
};
|
|
@@ -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;
|
|
@@ -69,6 +69,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
|
69
69
|
resetForm: () => void;
|
|
70
70
|
setFieldError: (name: string, error: string) => void;
|
|
71
71
|
clearErrors: () => void;
|
|
72
|
+
setFieldValue: (name: string, value: any, data?: any) => Promise<void>;
|
|
72
73
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
73
74
|
onSubmit: (payload: IFormSubmitPayload, close: () => void) => any;
|
|
74
75
|
onCancel: () => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Form.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fdd38572"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|