vlite3 1.1.1 → 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.
Files changed (117) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +2 -17
  2. package/components/AttachmentsList/AttachmentsList.vue.js +273 -175
  3. package/components/Avatar.vue.js +1 -1
  4. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  5. package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
  6. package/components/Button.vue.d.ts +1 -1
  7. package/components/Button.vue.js +30 -28
  8. package/components/Calendar/Calendar.vue.d.ts +6 -6
  9. package/components/Carousel/Carousel.vue.d.ts +2 -2
  10. package/components/CategoryManager/CategoryManager.vue.d.ts +12 -3
  11. package/components/CategoryManager/CategoryManager.vue.js +204 -145
  12. package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
  13. package/components/CategoryManager/CategoryNode.vue.js +93 -88
  14. package/components/CategoryManager/types.d.ts +14 -0
  15. package/components/Chat/ChatBubble.vue.js +22 -22
  16. package/components/CheckBox.vue.js +29 -28
  17. package/components/Chip/Chip.vue.d.ts +2 -2
  18. package/components/ConfirmationModal.vue.d.ts +2 -2
  19. package/components/ConfirmationModal.vue.js +30 -28
  20. package/components/CopyButton.vue.d.ts +50 -0
  21. package/components/CopyButton.vue.js +69 -0
  22. package/components/CopyButton.vue2.js +4 -0
  23. package/components/CustomFieldsDisplay/CustomFieldsDisplay.vue.d.ts +1 -1
  24. package/components/DataTable/DataTable.vue.d.ts +3 -3
  25. package/components/DataTable/DataTable.vue.js +44 -44
  26. package/components/DatePicker.vue.js +41 -35
  27. package/components/DateRangePicker.vue.js +18 -17
  28. package/components/Dropdown/Dropdown.vue.d.ts +5 -2
  29. package/components/Dropdown/Dropdown.vue.js +117 -115
  30. package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
  31. package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
  32. package/components/Dropdown/DropdownItem.vue.js +21 -20
  33. package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
  34. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  35. package/components/Dropdown/DropdownMenu.vue2.js +13 -12
  36. package/components/Dropdown/DropdownTrigger.vue.d.ts +3 -1
  37. package/components/Dropdown/DropdownTrigger.vue.js +10 -6
  38. package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
  39. package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
  40. package/components/Dropdown/composables/useDropdownSelection.js +46 -31
  41. package/components/FilePicker/FilePicker.vue.d.ts +1 -1
  42. package/components/FilePicker/FilePicker.vue.js +93 -90
  43. package/components/Form/CustomFields.vue.js +2 -2
  44. package/components/Form/Form.vue.js +1 -1
  45. package/components/Form/Form.vue2.js +230 -238
  46. package/components/Form/FormField.vue.d.ts +1 -1
  47. package/components/Form/FormField.vue.js +204 -148
  48. package/components/Form/FormFields.vue.js +2 -2
  49. package/components/Form/FormFields.vue2.js +28 -27
  50. package/components/Form/types.d.ts +2 -2
  51. package/components/Form/utils/form.utils.d.ts +3 -3
  52. package/components/Form/utils/form.utils.js +37 -37
  53. package/components/Input.vue.d.ts +3 -3
  54. package/components/Input.vue.js +64 -62
  55. package/components/Invoice/Invoice.vue.d.ts +1 -4
  56. package/components/Invoice/Invoice.vue.js +22 -13
  57. package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
  58. package/components/Invoice/InvoiceTotals.vue.js +86 -0
  59. package/components/Invoice/InvoiceTotals.vue2.js +4 -0
  60. package/components/Invoice/InvoiceVariant1.vue.d.ts +6 -1
  61. package/components/Invoice/InvoiceVariant1.vue.js +304 -271
  62. package/components/Invoice/InvoiceVariant2.vue.d.ts +6 -1
  63. package/components/Invoice/InvoiceVariant2.vue.js +168 -181
  64. package/components/Invoice/InvoiceVariant3.vue.d.ts +6 -1
  65. package/components/Invoice/InvoiceVariant3.vue.js +215 -182
  66. package/components/Invoice/InvoiceVariant4.vue.d.ts +6 -1
  67. package/components/Invoice/InvoiceVariant4.vue.js +281 -238
  68. package/components/Invoice/index.d.ts +1 -0
  69. package/components/Invoice/types.d.ts +26 -0
  70. package/components/List/List.vue.d.ts +1 -9
  71. package/components/List/List.vue.js +166 -165
  72. package/components/List/ListFieldRow.vue.d.ts +2 -2
  73. package/components/List/ListFieldRow.vue.js +50 -50
  74. package/components/Masonry/Masonry.vue.d.ts +1 -1
  75. package/components/Modal.vue.js +1 -1
  76. package/components/Modal.vue2.js +60 -54
  77. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  78. package/components/MultiSelect/MultiSelect.vue.js +47 -46
  79. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
  80. package/components/Navbar/NavbarItem.vue.d.ts +1 -1
  81. package/components/NumberInput.vue.d.ts +2 -2
  82. package/components/NumberInput.vue.js +2 -2
  83. package/components/NumberInput.vue2.js +121 -116
  84. package/components/OTPInput/OTPInput.vue.d.ts +1 -1
  85. package/components/PricingPlan/PricingPlan.vue.d.ts +2 -2
  86. package/components/SidePanel.vue.js +2 -2
  87. package/components/SidePanel.vue2.js +58 -52
  88. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  89. package/components/Stats/StatItem.vue.js +96 -91
  90. package/components/Stats/Stats.vue.d.ts +1 -1
  91. package/components/Stats/types.d.ts +1 -0
  92. package/components/StatusChip/status-map.js +27 -7
  93. package/components/Switch.vue.d.ts +6 -1
  94. package/components/Switch.vue.js +61 -24
  95. package/components/TagInput/TagInput.vue.d.ts +187 -0
  96. package/components/TagInput/TagInput.vue.js +113 -0
  97. package/components/TagInput/TagInput.vue2.js +4 -0
  98. package/components/TagInput/index.d.ts +1 -0
  99. package/components/Textarea.vue.js +19 -18
  100. package/components/ThumbnailSelector/ThumbnailSelector.vue.d.ts +2 -2
  101. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  102. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
  103. package/components/Workbook/Workbook.vue.d.ts +3 -3
  104. package/core/config.d.ts +112 -0
  105. package/core/index.js +17 -5
  106. package/index.d.ts +2 -0
  107. package/index.js +279 -271
  108. package/package.json +1 -1
  109. package/style.css +617 -2
  110. package/types/button.d.ts +1 -1
  111. package/types/config.type.d.ts +6 -0
  112. package/types/list.type.d.ts +6 -0
  113. package/types/styles.d.ts +1 -0
  114. package/utils/configUtils.d.ts +9 -0
  115. package/utils/configUtils.js +7 -0
  116. package/utils/functions.js +9 -9
  117. package/utils/index.d.ts +1 -0
@@ -1,8 +1,12 @@
1
+ type SwitchVariant = 'basic' | 'card';
1
2
  interface Props {
2
3
  modelValue?: boolean;
3
4
  disabled?: boolean;
4
5
  label?: string;
5
6
  labelI18n?: string;
7
+ description?: string;
8
+ descriptionI18n?: string;
9
+ variant?: SwitchVariant;
6
10
  class?: string;
7
11
  id?: string;
8
12
  }
@@ -12,7 +16,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
12
16
  "onUpdate:modelValue"?: (value: boolean) => any;
13
17
  }>, {
14
18
  class: string;
19
+ variant: SwitchVariant;
15
20
  disabled: boolean;
16
21
  modelValue: boolean;
17
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
23
  export default _default;
@@ -1,47 +1,84 @@
1
- import { defineComponent as u, computed as c, openBlock as n, createElementBlock as i, createElementVNode as r, normalizeClass as t, toDisplayString as m, createCommentVNode as b } from "vue";
2
- import { $t as f } from "../utils/i18n.js";
3
- const p = { class: "flex items-center gap-2" }, g = ["id", "aria-checked", "aria-label", "disabled"], v = /* @__PURE__ */ u({
1
+ import { defineComponent as h, computed as b, openBlock as n, createElementBlock as s, normalizeClass as i, createElementVNode as o, toDisplayString as d, createCommentVNode as u, withModifiers as v } from "vue";
2
+ import { $t as m } from "../utils/i18n.js";
3
+ const w = { class: "flex flex-col gap-0.5 min-w-0" }, p = {
4
+ key: 0,
5
+ class: "text-sm font-medium text-foreground leading-snug select-none"
6
+ }, k = {
7
+ key: 1,
8
+ class: "text-xs text-muted-foreground leading-snug select-none"
9
+ }, y = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], x = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], I = /* @__PURE__ */ h({
4
10
  __name: "Switch",
5
11
  props: {
6
12
  modelValue: { type: Boolean, default: !1 },
7
13
  disabled: { type: Boolean, default: !1 },
8
14
  label: {},
9
15
  labelI18n: {},
16
+ description: {},
17
+ descriptionI18n: {},
18
+ variant: { default: "basic" },
10
19
  class: { default: "" },
11
20
  id: {}
12
21
  },
13
22
  emits: ["update:modelValue"],
14
- setup(e, { emit: s }) {
15
- const l = e, d = s, o = () => {
16
- l.disabled || d("update:modelValue", !l.modelValue);
17
- }, a = c(() => l.labelI18n ? f(l.labelI18n) : l.label);
18
- return (h, k) => (n(), i("div", p, [
19
- r("button", {
23
+ setup(e, { emit: f }) {
24
+ const a = e, g = f, r = () => {
25
+ a.disabled || g("update:modelValue", !a.modelValue);
26
+ }, t = b(() => a.labelI18n ? m(a.labelI18n) : a.label), c = b(
27
+ () => a.descriptionI18n ? m(a.descriptionI18n) : a.description
28
+ );
29
+ return (l, $) => e.variant === "card" ? (n(), s("div", {
30
+ key: 0,
31
+ class: i(["flex items-start justify-between gap-4 w-full rounded-md border border-border bg-background px-4 py-3 cursor-pointer", e.disabled ? "opacity-50 pointer-events-none" : ""]),
32
+ onClick: r
33
+ }, [
34
+ o("div", w, [
35
+ t.value ? (n(), s("span", p, d(t.value), 1)) : u("", !0),
36
+ c.value ? (n(), s("span", k, d(c.value), 1)) : u("", !0)
37
+ ]),
38
+ o("button", {
20
39
  id: e.id,
21
40
  type: "button",
22
41
  role: "switch",
23
42
  "aria-checked": e.modelValue,
24
- "aria-label": a.value || "Toggle",
43
+ "aria-label": t.value || "Toggle",
25
44
  disabled: e.disabled,
26
- class: t(["relative inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", [e.modelValue ? "bg-primary" : "bg-input", l.class]]),
27
- onClick: o
45
+ class: i(["relative mt-0.5 inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", e.modelValue ? "bg-primary" : "bg-input"]),
46
+ "data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
47
+ onClick: v(r, ["stop"])
28
48
  }, [
29
- r("span", {
49
+ o("span", {
30
50
  "aria-hidden": "true",
31
- class: t([
32
- "pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out",
33
- e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"
34
- ])
51
+ class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
35
52
  }, null, 2)
36
- ], 10, g),
37
- a.value ? (n(), i("label", {
53
+ ], 10, y)
54
+ ], 2)) : (n(), s("div", {
55
+ key: 1,
56
+ class: i(["inline-flex items-center gap-2", a.class])
57
+ }, [
58
+ o("button", {
59
+ id: e.id,
60
+ type: "button",
61
+ role: "switch",
62
+ "aria-checked": e.modelValue,
63
+ "aria-label": t.value || "Toggle",
64
+ disabled: e.disabled,
65
+ class: i(["relative inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", e.modelValue ? "bg-primary" : "bg-input"]),
66
+ "data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
67
+ onClick: r
68
+ }, [
69
+ o("span", {
70
+ "aria-hidden": "true",
71
+ class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
72
+ }, null, 2)
73
+ ], 10, x),
74
+ t.value ? (n(), s("label", {
38
75
  key: 0,
39
- class: t([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
40
- onClick: o
41
- }, m(a.value), 3)) : b("", !0)
42
- ]));
76
+ class: i([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
77
+ onClick: r
78
+ }, d(t.value), 3)) : u("", !0)
79
+ ], 2));
43
80
  }
44
81
  });
45
82
  export {
46
- v as default
83
+ I as default
47
84
  };
@@ -0,0 +1,187 @@
1
+ interface Props {
2
+ modelValue?: string[];
3
+ placeholder?: string;
4
+ placeholderI18n?: string;
5
+ disabled?: boolean;
6
+ maxTags?: number;
7
+ variant?: 'outline' | 'solid' | 'transparent' | 'outline-b' | 'floating';
8
+ size?: 'sm' | 'md' | 'lg';
9
+ rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
10
+ error?: string;
11
+ class?: string;
12
+ }
13
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
14
+ change: (value: string[]) => any;
15
+ "update:modelValue": (value: string[]) => any;
16
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
17
+ onChange?: (value: string[]) => any;
18
+ "onUpdate:modelValue"?: (value: string[]) => any;
19
+ }>, {
20
+ class: string;
21
+ variant: "outline" | "solid" | "transparent" | "outline-b" | "floating";
22
+ size: "sm" | "md" | "lg";
23
+ rounded: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
24
+ placeholder: string;
25
+ disabled: boolean;
26
+ modelValue: string[];
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
28
+ inputRef: {
29
+ $: import('vue').ComponentInternalInstance;
30
+ $data: {};
31
+ $props: Partial<{
32
+ type: import('../..').InputType;
33
+ class: string;
34
+ variant: import('../..').InputVariant;
35
+ size: import('../..').InputSize;
36
+ rounded: import('../..').InputRounded;
37
+ loading: boolean;
38
+ readonly: boolean;
39
+ disabled: boolean;
40
+ modelValue: string | number;
41
+ rows: number;
42
+ showClearButton: boolean;
43
+ autofocus: boolean;
44
+ inputClass: string;
45
+ lazy: boolean;
46
+ labelPosition: import('../..').LabelPosition;
47
+ addonLeftClass: string;
48
+ addonRightClass: string;
49
+ }> & Omit<{
50
+ readonly modelValue?: string | number;
51
+ readonly type?: import('../..').InputType;
52
+ readonly label?: string;
53
+ readonly labelI18n?: string;
54
+ readonly placeholder?: string;
55
+ readonly placeholderI18n?: string;
56
+ readonly disabled?: boolean;
57
+ readonly readonly?: boolean;
58
+ readonly loading?: boolean;
59
+ readonly error?: string;
60
+ readonly icon?: string;
61
+ readonly iconClass?: string;
62
+ readonly iconRight?: string;
63
+ readonly iconRightClass?: string;
64
+ readonly showClearButton?: boolean;
65
+ readonly autofocus?: boolean;
66
+ readonly class?: string;
67
+ readonly inputClass?: string;
68
+ readonly rows?: number;
69
+ readonly lazy?: boolean;
70
+ readonly variant?: import('../..').InputVariant;
71
+ readonly size?: import('../..').InputSize;
72
+ readonly rounded?: import('../..').InputRounded;
73
+ readonly labelPosition?: import('../..').LabelPosition;
74
+ readonly addonLeft?: string | Record<string, any>;
75
+ readonly addonRight?: string | Record<string, any>;
76
+ readonly addonLeftClass?: string;
77
+ readonly addonRightClass?: string;
78
+ readonly min?: number;
79
+ readonly max?: number;
80
+ readonly onBlur?: (event: FocusEvent) => any;
81
+ readonly onFocus?: (event: FocusEvent) => any;
82
+ readonly onChange?: (value: string | number) => any;
83
+ readonly "onUpdate:modelValue"?: (value: string | number) => any;
84
+ readonly "onClick:icon"?: (event: MouseEvent) => any;
85
+ readonly "onClick:icon-right"?: (event: MouseEvent) => any;
86
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "type" | "class" | "variant" | "size" | "rounded" | "loading" | "readonly" | "disabled" | "modelValue" | "rows" | "showClearButton" | "autofocus" | "inputClass" | "lazy" | "labelPosition" | "addonLeftClass" | "addonRightClass">;
87
+ $attrs: {
88
+ [x: string]: unknown;
89
+ };
90
+ $refs: {
91
+ [x: string]: unknown;
92
+ } & {
93
+ inputRef: HTMLInputElement;
94
+ };
95
+ $slots: Readonly<{
96
+ [name: string]: import('vue').Slot<any>;
97
+ }>;
98
+ $root: import('vue').ComponentPublicInstance | null;
99
+ $parent: import('vue').ComponentPublicInstance | null;
100
+ $host: Element | null;
101
+ $emit: ((event: "blur", event: FocusEvent) => void) & ((event: "focus", event: FocusEvent) => void) & ((event: "change", value: string | number) => void) & ((event: "update:modelValue", value: string | number) => void) & ((event: "click:icon", event: MouseEvent) => void) & ((event: "click:icon-right", event: MouseEvent) => void);
102
+ $el: HTMLDivElement;
103
+ $options: import('vue').ComponentOptionsBase<Readonly<import('../..').InputProps> & Readonly<{
104
+ onBlur?: (event: FocusEvent) => any;
105
+ onFocus?: (event: FocusEvent) => any;
106
+ onChange?: (value: string | number) => any;
107
+ "onUpdate:modelValue"?: (value: string | number) => any;
108
+ "onClick:icon"?: (event: MouseEvent) => any;
109
+ "onClick:icon-right"?: (event: MouseEvent) => any;
110
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
111
+ blur: (event: FocusEvent) => any;
112
+ focus: (event: FocusEvent) => any;
113
+ change: (value: string | number) => any;
114
+ "update:modelValue": (value: string | number) => any;
115
+ "click:icon": (event: MouseEvent) => any;
116
+ "click:icon-right": (event: MouseEvent) => any;
117
+ }, string, {
118
+ type: import('../..').InputType;
119
+ class: string;
120
+ variant: import('../..').InputVariant;
121
+ size: import('../..').InputSize;
122
+ rounded: import('../..').InputRounded;
123
+ loading: boolean;
124
+ readonly: boolean;
125
+ disabled: boolean;
126
+ modelValue: string | number;
127
+ rows: number;
128
+ showClearButton: boolean;
129
+ autofocus: boolean;
130
+ inputClass: string;
131
+ lazy: boolean;
132
+ labelPosition: import('../..').LabelPosition;
133
+ addonLeftClass: string;
134
+ addonRightClass: string;
135
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
136
+ beforeCreate?: (() => void) | (() => void)[];
137
+ created?: (() => void) | (() => void)[];
138
+ beforeMount?: (() => void) | (() => void)[];
139
+ mounted?: (() => void) | (() => void)[];
140
+ beforeUpdate?: (() => void) | (() => void)[];
141
+ updated?: (() => void) | (() => void)[];
142
+ activated?: (() => void) | (() => void)[];
143
+ deactivated?: (() => void) | (() => void)[];
144
+ beforeDestroy?: (() => void) | (() => void)[];
145
+ beforeUnmount?: (() => void) | (() => void)[];
146
+ destroyed?: (() => void) | (() => void)[];
147
+ unmounted?: (() => void) | (() => void)[];
148
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
149
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
150
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
151
+ };
152
+ $forceUpdate: () => void;
153
+ $nextTick: typeof import('vue').nextTick;
154
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
155
+ } & Readonly<{
156
+ type: import('../..').InputType;
157
+ class: string;
158
+ variant: import('../..').InputVariant;
159
+ size: import('../..').InputSize;
160
+ rounded: import('../..').InputRounded;
161
+ loading: boolean;
162
+ readonly: boolean;
163
+ disabled: boolean;
164
+ modelValue: string | number;
165
+ rows: number;
166
+ showClearButton: boolean;
167
+ autofocus: boolean;
168
+ inputClass: string;
169
+ lazy: boolean;
170
+ labelPosition: import('../..').LabelPosition;
171
+ addonLeftClass: string;
172
+ addonRightClass: string;
173
+ }> & Omit<Readonly<import('../..').InputProps> & Readonly<{
174
+ onBlur?: (event: FocusEvent) => any;
175
+ onFocus?: (event: FocusEvent) => any;
176
+ onChange?: (value: string | number) => any;
177
+ "onUpdate:modelValue"?: (value: string | number) => any;
178
+ "onClick:icon"?: (event: MouseEvent) => any;
179
+ "onClick:icon-right"?: (event: MouseEvent) => any;
180
+ }>, "type" | "class" | "variant" | "size" | "rounded" | "loading" | "readonly" | "disabled" | "modelValue" | "rows" | "showClearButton" | "autofocus" | "inputClass" | "lazy" | "labelPosition" | "addonLeftClass" | "addonRightClass"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
181
+ $slots: {
182
+ 'addon-left'?(_: {}): any;
183
+ 'addon-right'?(_: {}): any;
184
+ };
185
+ };
186
+ }, HTMLDivElement>;
187
+ export default _default;
@@ -0,0 +1,113 @@
1
+ import { defineComponent as k, ref as g, computed as z, openBlock as i, createElementBlock as c, normalizeClass as p, createVNode as h, Fragment as C, renderList as I, createTextVNode as D, toDisplayString as $, createElementVNode as B, withModifiers as E, createCommentVNode as N } from "vue";
2
+ import R from "../Icon.vue.js";
3
+ import M from "../Input.vue.js";
4
+ /* empty css */
5
+ import { $t as x } from "../../utils/i18n.js";
6
+ const P = {
7
+ key: 0,
8
+ class: "flex flex-wrap gap-1.5 mt-2.5"
9
+ }, j = ["disabled", "onClick"], F = /* @__PURE__ */ k({
10
+ __name: "TagInput",
11
+ props: {
12
+ modelValue: { default: () => [] },
13
+ placeholder: { default: "Add tag..." },
14
+ placeholderI18n: {},
15
+ disabled: { type: Boolean, default: !1 },
16
+ maxTags: {},
17
+ variant: { default: "outline" },
18
+ size: { default: "md" },
19
+ rounded: { default: "md" },
20
+ error: {},
21
+ class: { default: "" }
22
+ },
23
+ emits: ["update:modelValue", "change"],
24
+ setup(l, { emit: v }) {
25
+ const e = l, d = v, r = g(""), u = g(null), m = (t, a, o) => {
26
+ const n = o ? x(t, o) : x(t);
27
+ return n !== t ? n : a;
28
+ }, V = z(() => e.maxTags && e.modelValue.length >= e.maxTags ? m("vlite.tagInput.maxTagsReached", "Max tags reached") : e.placeholderI18n ? m(e.placeholderI18n, e.placeholder) : e.placeholder), b = () => {
29
+ if (u.value) {
30
+ const t = u.value.$el || u.value, a = t instanceof HTMLElement ? t.querySelector("input") : null;
31
+ a && a.focus();
32
+ }
33
+ }, f = () => {
34
+ if (e.disabled) return;
35
+ const t = r.value.trim();
36
+ if (t) {
37
+ if (e.maxTags && e.modelValue.length >= e.maxTags) {
38
+ r.value = "";
39
+ return;
40
+ }
41
+ if (!e.modelValue.includes(t)) {
42
+ const a = [...e.modelValue, t];
43
+ d("update:modelValue", a), d("change", a);
44
+ }
45
+ r.value = "", b();
46
+ }
47
+ }, T = (t) => {
48
+ if (e.disabled) return;
49
+ const a = [...e.modelValue];
50
+ a.splice(t, 1), d("update:modelValue", a), d("change", a);
51
+ }, y = (t) => {
52
+ (t.key === "Enter" || t.key === ",") && (t.preventDefault(), f());
53
+ }, w = (t) => {
54
+ if (e.disabled) return;
55
+ const a = t.clipboardData?.getData("text");
56
+ if (a && a.includes(",")) {
57
+ t.preventDefault();
58
+ const o = a.split(",").map((s) => s.trim()).filter(Boolean);
59
+ let n = [...e.modelValue];
60
+ for (const s of o) {
61
+ if (e.maxTags && n.length >= e.maxTags) break;
62
+ n.includes(s) || n.push(s);
63
+ }
64
+ d("update:modelValue", n), d("change", n), r.value = "";
65
+ }
66
+ };
67
+ return (t, a) => (i(), c("div", {
68
+ class: p(["w-full flex flex-col", e.class])
69
+ }, [
70
+ h(M, {
71
+ ref_key: "inputRef",
72
+ ref: u,
73
+ modelValue: r.value,
74
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => r.value = o),
75
+ placeholder: V.value,
76
+ disabled: l.disabled || (l.maxTags ? l.modelValue.length >= l.maxTags : !1),
77
+ variant: l.variant,
78
+ size: l.size,
79
+ rounded: l.rounded,
80
+ error: l.error,
81
+ "show-clear-button": !1,
82
+ "icon-right": "lucide:plus",
83
+ "onClick:iconRight": f,
84
+ onKeydown: y,
85
+ onPaste: w
86
+ }, null, 8, ["modelValue", "placeholder", "disabled", "variant", "size", "rounded", "error"]),
87
+ l.modelValue.length > 0 ? (i(), c("div", P, [
88
+ (i(!0), c(C, null, I(l.modelValue, (o, n) => (i(), c("span", {
89
+ key: o + n,
90
+ class: p(["inline-flex items-center justify-center gap-1 bg-accent text-accent-foreground border border-border whitespace-nowrap px-2 py-0.5", [
91
+ l.size === "sm" ? "text-[10px] rounded-sm" : l.size === "lg" ? "text-sm rounded-md px-2.5 py-1" : "text-xs rounded"
92
+ ]])
93
+ }, [
94
+ D($(o) + " ", 1),
95
+ B("button", {
96
+ type: "button",
97
+ class: "hover:text-foreground focus:outline-none disabled:opacity-50 text-muted-foreground hover:text-destructive transition-colors flex items-center justify-center",
98
+ disabled: l.disabled,
99
+ onClick: E((s) => T(n), ["stop"])
100
+ }, [
101
+ h(R, {
102
+ icon: "lucide:x",
103
+ class: "w-3 h-3"
104
+ })
105
+ ], 8, j)
106
+ ], 2))), 128))
107
+ ])) : N("", !0)
108
+ ], 2));
109
+ }
110
+ });
111
+ export {
112
+ F as default
113
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./TagInput.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1 @@
1
+ export { default as TagInput } from './TagInput.vue';
@@ -1,6 +1,6 @@
1
- import { defineComponent as i, computed as r, openBlock as p, createElementBlock as m, normalizeClass as f } from "vue";
1
+ import { defineComponent as c, computed as r, openBlock as p, createElementBlock as m, normalizeClass as f } from "vue";
2
2
  import { $t as b } from "../utils/i18n.js";
3
- const x = ["value", "rows", "disabled", "placeholder"], g = /* @__PURE__ */ i({
3
+ const h = ["value", "rows", "disabled", "placeholder", "data-testid"], g = /* @__PURE__ */ c({
4
4
  __name: "Textarea",
5
5
  props: {
6
6
  modelValue: { default: "" },
@@ -11,26 +11,27 @@ const x = ["value", "rows", "disabled", "placeholder"], g = /* @__PURE__ */ i({
11
11
  class: { default: "" }
12
12
  },
13
13
  emits: ["update:modelValue", "focus", "blur"],
14
- setup(l, { emit: s }) {
15
- const o = l, t = s, n = r(() => [
14
+ setup(t, { emit: s }) {
15
+ const a = t, o = s, n = r(() => [
16
16
  "flex min-h-[80px] w-full rounded-md border border-input px-3 py-2 text-sm placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
17
- o.class
18
- ].join(" ")), u = (d) => {
19
- const e = d.target;
20
- t("update:modelValue", e.value);
21
- }, c = r(
22
- () => o.placeholderI18n ? b(o.placeholderI18n) : o.placeholder
17
+ a.class
18
+ ].join(" ")), u = (l) => {
19
+ const e = l.target;
20
+ o("update:modelValue", e.value);
21
+ }, i = r(
22
+ () => a.placeholderI18n ? b(a.placeholderI18n) : a.placeholder
23
23
  );
24
- return (d, e) => (p(), m("textarea", {
25
- value: l.modelValue,
26
- rows: l.rows,
27
- disabled: l.disabled,
28
- placeholder: c.value,
24
+ return (l, e) => (p(), m("textarea", {
25
+ value: t.modelValue,
26
+ rows: t.rows,
27
+ disabled: t.disabled,
28
+ placeholder: i.value,
29
29
  class: f(n.value),
30
30
  onInput: u,
31
- onFocus: e[0] || (e[0] = (a) => t("focus", a)),
32
- onBlur: e[1] || (e[1] = (a) => t("blur", a))
33
- }, null, 42, x));
31
+ onFocus: e[0] || (e[0] = (d) => o("focus", d)),
32
+ onBlur: e[1] || (e[1] = (d) => o("blur", d)),
33
+ "data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `textarea-${l.$attrs.name}` : "textarea")
34
+ }, null, 42, h));
34
35
  }
35
36
  });
36
37
  export {
@@ -27,9 +27,9 @@ declare const _default: import('vue').DefineComponent<ThumbnailSelectorProps, {}
27
27
  "onUpdate:images"?: (value: string[]) => any;
28
28
  "onUpdate:thumbnail"?: (value: string) => any;
29
29
  }>, {
30
- disabled: boolean;
31
30
  loading: boolean;
32
- images: string[];
33
31
  thumbnail: string | null;
32
+ disabled: boolean;
33
+ images: string[];
34
34
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
35
35
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./ThumbnailSelector.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-74a988ab"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9fd1363d"]]);
5
5
  export {
6
- e as default
6
+ p as default
7
7
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as L, ref as w, watch as _, computed as m, openBlock as i, createElementBlock as d, toDisplayString as p, createCommentVNode as g, createElementVNode as v, createVNode as f, unref as P, withCtx as k, Fragment as V, renderList as F, normalizeClass as S, withModifiers as C, createBlock as y } from "vue";
1
+ import { defineComponent as L, ref as w, watch as k, computed as m, openBlock as i, createElementBlock as d, toDisplayString as p, createCommentVNode as g, createElementVNode as v, createVNode as f, unref as P, withCtx as _, Fragment as V, renderList as F, normalizeClass as S, withModifiers as C, createBlock as y } from "vue";
2
2
  import h from "../Icon.vue.js";
3
3
  import M from "../FilePicker/FilePicker.vue.js";
4
4
  import { VueDraggable as O } from "vue-draggable-plus";
5
5
  import { $t as z } from "../../utils/i18n.js";
6
- const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
6
+ const q = ["data-testid"], G = {
7
7
  key: 0,
8
8
  class: "text-sm font-medium text-foreground"
9
9
  }, H = {
@@ -27,14 +27,14 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
27
27
  label: {}
28
28
  },
29
29
  emits: ["update:images", "update:thumbnail", "change"],
30
- setup(l, { emit: j }) {
31
- const c = l, n = j, r = w([...c.images || []]), o = w(c.thumbnail ?? null);
32
- _(
30
+ setup(l, { emit: $ }) {
31
+ const c = l, n = $, r = w([...c.images || []]), o = w(c.thumbnail ?? null);
32
+ k(
33
33
  () => c.images,
34
34
  (e) => {
35
35
  r.value = [...e || []];
36
36
  }
37
- ), _(
37
+ ), k(
38
38
  () => c.thumbnail,
39
39
  (e) => {
40
40
  o.value = e ?? null;
@@ -43,7 +43,7 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
43
43
  const x = m(() => o.value || r.value[0] || null), b = (e, u, t) => {
44
44
  const a = t ? z(e, t) : z(e);
45
45
  return a !== e ? a : u;
46
- }, T = m(() => b("vlite.thumbnailSelector.preview", "Thumbnail preview")), U = m(() => b("vlite.thumbnailSelector.noImageSelected", "No image selected")), I = m(() => b("vlite.thumbnailSelector.image", "Image")), R = m(() => b("vlite.thumbnailSelector.removeImage", "Remove image")), $ = m(() => b("vlite.thumbnailSelector.upload", "Upload")), B = m(() => b("vlite.thumbnailSelector.dragToReorder", "Drag to reorder")), D = (e) => {
46
+ }, j = m(() => b("vlite.thumbnailSelector.preview", "Thumbnail preview")), T = m(() => b("vlite.thumbnailSelector.noImageSelected", "No image selected")), U = m(() => b("vlite.thumbnailSelector.image", "Image")), I = m(() => b("vlite.thumbnailSelector.removeImage", "Remove image")), R = m(() => b("vlite.thumbnailSelector.upload", "Upload")), B = m(() => b("vlite.thumbnailSelector.dragToReorder", "Drag to reorder")), D = (e) => {
47
47
  c.disabled || c.loading || (o.value = e, n("update:thumbnail", e), n("change", { images: r.value, thumbnail: e }));
48
48
  }, N = (e, u) => {
49
49
  if (u.stopPropagation(), c.disabled || c.loading) return;
@@ -68,20 +68,23 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
68
68
  }, E = (e) => {
69
69
  r.value = e, n("update:images", e), n("change", { images: e, thumbnail: o.value });
70
70
  };
71
- return (e, u) => (i(), d("div", q, [
71
+ return (e, u) => (i(), d("div", {
72
+ class: "vl-thumbnail-selector flex flex-col gap-3",
73
+ "data-testid": e.$attrs["data-testid"] || (e.$attrs.name ? `thumbnail-${e.$attrs.name}` : "thumbnail-selector")
74
+ }, [
72
75
  l.label ? (i(), d("p", G, p(l.label), 1)) : g("", !0),
73
76
  v("div", H, [
74
77
  x.value ? (i(), d("img", {
75
78
  key: 0,
76
79
  src: x.value,
77
80
  class: "w-full h-full object-cover",
78
- alt: T.value
81
+ alt: j.value
79
82
  }, null, 8, J)) : (i(), d("div", K, [
80
83
  f(h, {
81
84
  icon: "lucide:image",
82
85
  class: "w-10 h-10"
83
86
  }),
84
- v("span", Q, p(U.value), 1)
87
+ v("span", Q, p(T.value), 1)
85
88
  ]))
86
89
  ]),
87
90
  f(P(O), {
@@ -96,7 +99,7 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
96
99
  class: "vl-thumbnail-selector__grid grid grid-cols-3 sm:grid-cols-4 gap-2",
97
100
  style: { "will-change": "transform", contain: "layout style" }
98
101
  }, {
99
- default: k(() => [
102
+ default: _(() => [
100
103
  (i(!0), d(V, null, F(r.value, (t, a) => (i(), d("div", {
101
104
  key: t,
102
105
  class: S(["vl-thumbnail-selector__card relative rounded-md overflow-hidden cursor-pointer border-2 transition-all duration-150 w-full", [
@@ -109,7 +112,7 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
109
112
  v("img", {
110
113
  src: t,
111
114
  class: "w-full h-full object-cover",
112
- alt: `${I.value} ${a + 1}`
115
+ alt: `${U.value} ${a + 1}`
113
116
  }, null, 8, X),
114
117
  l.disabled ? g("", !0) : (i(), d("div", {
115
118
  key: 0,
@@ -127,7 +130,7 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
127
130
  key: 1,
128
131
  type: "button",
129
132
  class: "vl-thumbnail-selector__delete absolute top-0.5 right-0.5 z-10 w-5 h-5 flex items-center justify-center rounded-full bg-background/90 border border-border text-muted-foreground shadow-sm opacity-0 transition-opacity duration-150 hover:text-destructive hover:border-destructive",
130
- title: R.value,
133
+ title: I.value,
131
134
  onClick: C((s) => N(t, s), ["stop"])
132
135
  }, [
133
136
  f(h, {
@@ -152,7 +155,7 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
152
155
  class: "vl-thumbnail-selector__filepicker-inline",
153
156
  onChange: A
154
157
  }, {
155
- trigger: k(({ trigger: t, isLoading: a }) => [
158
+ trigger: _(({ trigger: t, isLoading: a }) => [
156
159
  v("button", {
157
160
  type: "button",
158
161
  class: S(["vl-thumbnail-selector__upload flex flex-col items-center justify-center rounded-md border-2 border-dashed border-border text-muted-foreground/60 hover:border-primary/50 hover:text-primary/60 transition-all cursor-pointer w-full", a || l.loading ? "opacity-60 pointer-events-none" : ""]),
@@ -168,7 +171,7 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
168
171
  icon: "lucide:plus",
169
172
  class: "w-5 h-5"
170
173
  })),
171
- v("span", le, p($.value), 1)
174
+ v("span", le, p(R.value), 1)
172
175
  ], 10, te)
173
176
  ]),
174
177
  _: 1
@@ -176,7 +179,7 @@ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
176
179
  ]),
177
180
  _: 1
178
181
  }, 8, ["model-value", "disabled"])
179
- ]));
182
+ ], 8, q));
180
183
  }
181
184
  });
182
185
  export {