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.
Files changed (53) hide show
  1. package/components/Button.vue.d.ts +5 -1
  2. package/components/Button.vue.js +164 -72
  3. package/components/CategoryManager/CategoryManager.vue.js +1 -1
  4. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  5. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  6. package/components/Dropdown/Dropdown.vue.d.ts +3 -1
  7. package/components/Dropdown/Dropdown.vue.js +17 -15
  8. package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
  9. package/components/Form/Form.vue.d.ts +1 -0
  10. package/components/Form/Form.vue.js +1 -1
  11. package/components/Form/Form.vue2.js +29 -28
  12. package/components/Form/FormFields.vue.js +2 -2
  13. package/components/Form/FormFields.vue2.js +29 -25
  14. package/components/ImportData/ImportStep2.vue.js +6 -6
  15. package/components/Input.vue.js +6 -5
  16. package/components/Kanban/Kanban.vue.js +1 -1
  17. package/components/Kanban/Kanban.vue2.js +1 -1
  18. package/components/Kanban/KanbanBoard.vue.js +1 -1
  19. package/components/Kanban/KanbanBoard.vue2.js +17 -17
  20. package/components/Label.vue.d.ts +5 -2
  21. package/components/Label.vue.js +18 -11
  22. package/components/Modal.vue.js +1 -1
  23. package/components/Modal.vue2.js +1 -1
  24. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  25. package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +1 -1
  26. package/components/PermissionMatrix/PermissionMatrix.vue.js +1 -1
  27. package/components/PermissionMatrix/PermissionMatrix.vue2.js +1 -1
  28. package/components/Screen/ScreenFilter.vue.js +34 -31
  29. package/components/SidePanel.vue.js +1 -1
  30. package/components/Splitter/Splitter.vue.d.ts +1 -1
  31. package/components/Tabes/Tabes.vue.js +2 -2
  32. package/components/Tabes/Tabes.vue2.js +53 -51
  33. package/components/Workbook/Sheet.vue.js +76 -70
  34. package/components/Workbook/Workbook.vue.js +2 -2
  35. package/components/Workbook/Workbook.vue2.js +88 -84
  36. package/components/Workbook/WorkbookAddButton.vue.js +9 -8
  37. package/directives/vRipple.d.ts +3 -1
  38. package/directives/vRipple.js +11 -11
  39. package/package.json +13 -1
  40. package/style.css +83 -72
  41. package/test/VliteScreen.d.ts +120 -0
  42. package/test/VliteScreen.js +328 -0
  43. package/test/createDataFactory.d.ts +24 -0
  44. package/test/createDataFactory.js +59 -0
  45. package/test/extractSchemaFields.d.ts +14 -0
  46. package/test/extractSchemaFields.js +11 -0
  47. package/test/index.d.ts +39 -0
  48. package/test/index.js +10 -0
  49. package/test/renderVlite.d.ts +30 -0
  50. package/test/renderVlite.js +12 -0
  51. package/test/types.d.ts +39 -0
  52. package/types/button.d.ts +2 -0
  53. /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<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
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;
@@ -1,10 +1,20 @@
1
- import { defineComponent as k, computed as l, useSlots as z, withDirectives as $, openBlock as o, createElementBlock as u, normalizeClass as s, createBlock as d, createCommentVNode as h, renderSlot as m, createTextVNode as b, toDisplayString as f, unref as B } from "vue";
2
- import g from "./Icon.vue.js";
3
- import { vRipple as I } from "../directives/vRipple.js";
4
- import { $t as R } from "../utils/i18n.js";
5
- const S = ["type", "disabled", "data-testid"], T = /* @__PURE__ */ k({
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(e) {
25
- const t = e, r = l(() => t.textI18n ? R(t.textI18n) : t.text), x = z(), i = l(
26
- () => t?.asIcon || t.icon && !r.value && !x.default
27
- ), v = l(() => {
28
- const n = `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 gap-2 ${i.value ? "icon-only shrink-0" : ""}`, a = {
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-destructive hover:bg-danger/20 dark:hover:bg-danger/40",
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
- }, w = {
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
- }, y = {
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
- }, p = {
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 C = i.value ? y[t.size] : w[t.size];
75
- return [
76
- n,
77
- a[t.variant],
78
- p[t.rounded],
79
- C,
80
- t.class
81
- ].join(" ");
82
- }), c = l(() => {
83
- const n = {
84
- xs: "w-3 h-3",
85
- sm: "w-4 h-4",
86
- sm2: "w-4 h-4",
87
- md: "w-4 h-4",
88
- lg: "w-4 h-4",
89
- xl: "w-4 h-4"
90
- }, a = {
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
- return i.value ? a[t.size] : n[t.size];
99
- });
100
- return (n, a) => $((o(), u("button", {
101
- type: e.type,
102
- class: s([v.value, "cursor-pointer"]),
103
- disabled: e.disabled || e.loading,
104
- "data-testid": n.$attrs["data-testid"] || (r.value ? `btn-${r.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : e.icon ? `btn-${e.icon.replace(/[^a-zA-Z0-9]+/g, "-")}` : "button")
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
- e.loading ? (o(), d(g, {
107
- key: 0,
108
- icon: "lucide:loader-2",
109
- class: s(["animate-spin pointer-events-none", c.value])
110
- }, null, 8, ["class"])) : e.icon ? (o(), d(g, {
111
- key: 1,
112
- icon: e.icon,
113
- class: s(["pointer-events-none", [e.iconClass, c.value, i.value ? "mx-auto" : ""]])
114
- }, null, 8, ["icon", "class"])) : h("", !0),
115
- e.textClass ? (o(), u("span", {
116
- key: 2,
117
- class: s(e.textClass)
118
- }, [
119
- m(n.$slots, "default", {}, () => [
120
- b(f(r.value), 1)
121
- ])
122
- ], 2)) : m(n.$slots, "default", { key: 3 }, () => [
123
- b(f(r.value), 1)
124
- ]),
125
- e.iconRight && !e.loading ? (o(), d(g, {
126
- key: 4,
127
- icon: e.iconRight,
128
- class: s([[e.iconRightClass, c.value], "h-4 w-4 pointer-events-none"])
129
- }, null, 8, ["icon", "class"])) : h("", !0)
130
- ], 10, S)), [
131
- [B(I)]
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
- T as default
228
+ X as default
137
229
  };
@@ -16,7 +16,7 @@ import "v-datepicker-lite";
16
16
  import "v-datepicker-lite/style.css";
17
17
  import "@jaames/iro";
18
18
  import "@vueuse/core";
19
- /* empty css */
19
+ /* empty css */
20
20
  import me from "../IconPicker.vue.js";
21
21
  /* empty css */
22
22
  /* empty css */
@@ -1,5 +1,5 @@
1
- import o from "./ColorIro.vue.js";
2
- /* empty css */
1
+ import o from "./ColorIro.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -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.vue.js";
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 z, createCommentVNode as me } from "vue";
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 Ne = /* @__PURE__ */ le({
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: j }) {
55
- const l = t, h = j, b = i(!1), y = i(null), r = i({
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
- }), U = f(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), q = f(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), C = i(l.isOpen || !1), p = i(0), W = `dropdown-${Math.random().toString(36).substring(2, 9)}`, w = f(() => l.menuId || W), g = i([]), s = ne("dropdown-context", null), F = (e) => {
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 N = (e) => {
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
- N(!1);
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([]), x = i(!1), I = i(!1);
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
- !x.value && e.length > 0 && (x.value = !0, setTimeout(() => {
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: U.value,
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": N,
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(z({
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: q.value,
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(z(n)))
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
- Ne as default
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-e758152a"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fdd38572"]]);
5
5
  export {
6
6
  p as default
7
7
  };