vlite3 0.4.8 → 0.5.2

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 (268) hide show
  1. package/README.md +201 -100
  2. package/_virtual/Barcode.js +4 -0
  3. package/_virtual/CODE128.js +4 -0
  4. package/_virtual/CODE128A.js +4 -0
  5. package/_virtual/CODE128B.js +4 -0
  6. package/_virtual/CODE128C.js +4 -0
  7. package/_virtual/CODE128_AUTO.js +4 -0
  8. package/_virtual/CODE93.js +4 -0
  9. package/_virtual/CODE93FullASCII.js +4 -0
  10. package/_virtual/EAN.js +4 -0
  11. package/_virtual/EAN13.js +4 -0
  12. package/_virtual/EAN2.js +4 -0
  13. package/_virtual/EAN5.js +4 -0
  14. package/_virtual/EAN8.js +4 -0
  15. package/_virtual/ErrorHandler.js +4 -0
  16. package/_virtual/FileSaver.min.js +5 -0
  17. package/_virtual/FileSaver.min2.js +4 -0
  18. package/_virtual/ITF.js +4 -0
  19. package/_virtual/ITF14.js +4 -0
  20. package/_virtual/JsBarcode.js +7 -0
  21. package/_virtual/MSI.js +4 -0
  22. package/_virtual/MSI10.js +4 -0
  23. package/_virtual/MSI1010.js +4 -0
  24. package/_virtual/MSI11.js +4 -0
  25. package/_virtual/MSI1110.js +4 -0
  26. package/_virtual/UPC.js +4 -0
  27. package/_virtual/UPCE.js +4 -0
  28. package/_virtual/_commonjsHelpers.js +8 -0
  29. package/_virtual/alignment-pattern.js +4 -0
  30. package/_virtual/auto.js +4 -0
  31. package/_virtual/browser.js +7 -0
  32. package/_virtual/browser2.js +4 -0
  33. package/_virtual/canvas.js +4 -0
  34. package/_virtual/canvas2.js +4 -0
  35. package/_virtual/checksums.js +4 -0
  36. package/_virtual/constants.js +4 -0
  37. package/_virtual/constants2.js +4 -0
  38. package/_virtual/constants3.js +4 -0
  39. package/_virtual/constants4.js +4 -0
  40. package/_virtual/defaults.js +4 -0
  41. package/_virtual/dijkstra.js +4 -0
  42. package/_virtual/encoder.js +4 -0
  43. package/_virtual/error-correction-code.js +4 -0
  44. package/_virtual/error-correction-level.js +4 -0
  45. package/_virtual/exceptions.js +4 -0
  46. package/_virtual/finder-pattern.js +4 -0
  47. package/_virtual/fixOptions.js +4 -0
  48. package/_virtual/format-info.js +4 -0
  49. package/_virtual/galois-field.js +4 -0
  50. package/_virtual/getOptionsFromElement.js +4 -0
  51. package/_virtual/getRenderProperties.js +4 -0
  52. package/_virtual/index.js +4 -0
  53. package/_virtual/index10.js +4 -0
  54. package/_virtual/index11.js +4 -0
  55. package/_virtual/index2.js +4 -0
  56. package/_virtual/index3.js +4 -0
  57. package/_virtual/index4.js +4 -0
  58. package/_virtual/index5.js +4 -0
  59. package/_virtual/index6.js +4 -0
  60. package/_virtual/index7.js +4 -0
  61. package/_virtual/index8.js +4 -0
  62. package/_virtual/index9.js +4 -0
  63. package/_virtual/linearizeEncodings.js +4 -0
  64. package/_virtual/mask-pattern.js +4 -0
  65. package/_virtual/merge.js +4 -0
  66. package/_virtual/mode.js +4 -0
  67. package/_virtual/object.js +4 -0
  68. package/_virtual/optionsFromStrings.js +4 -0
  69. package/_virtual/papaparse.min.js +7 -0
  70. package/_virtual/papaparse.min2.js +4 -0
  71. package/_virtual/polynomial.js +4 -0
  72. package/_virtual/qrcode.js +4 -0
  73. package/_virtual/regex.js +4 -0
  74. package/_virtual/segments.js +4 -0
  75. package/_virtual/shared.js +4 -0
  76. package/_virtual/svg-tag.js +4 -0
  77. package/_virtual/svg.js +4 -0
  78. package/_virtual/utils.js +4 -0
  79. package/_virtual/utils2.js +4 -0
  80. package/_virtual/version-check.js +4 -0
  81. package/_virtual/version.js +4 -0
  82. package/components/Accordion/Accordion.vue.d.ts +7 -7
  83. package/components/Accordion/AccordionItem.vue.d.ts +4 -4
  84. package/components/Accordion/AccordionTrigger.vue.d.ts +2 -2
  85. package/components/Alert.vue.d.ts +1 -1
  86. package/components/Avatar.vue.d.ts +2 -2
  87. package/components/Avatar.vue.js +2 -2
  88. package/components/AvatarUploader/AvatarUploader.vue.d.ts +5 -5
  89. package/components/Badge.vue.d.ts +1 -1
  90. package/components/Barcode/Barcode.vue.d.ts +22 -0
  91. package/components/Barcode/Barcode.vue.js +58 -0
  92. package/components/Barcode/Barcode.vue2.js +4 -0
  93. package/components/Barcode/index.d.ts +2 -0
  94. package/components/Barcode/types.d.ts +5 -0
  95. package/components/Barcode/types.js +15 -0
  96. package/components/Breadcrumb/Breadcrumb.vue.d.ts +23 -0
  97. package/components/Breadcrumb/Breadcrumb.vue.js +7 -0
  98. package/components/Breadcrumb/Breadcrumb.vue2.js +84 -0
  99. package/components/Breadcrumb/BreadcrumbItem.vue.d.ts +27 -0
  100. package/components/Breadcrumb/BreadcrumbItem.vue.js +7 -0
  101. package/components/Breadcrumb/BreadcrumbItem.vue2.js +50 -0
  102. package/components/Breadcrumb/index.d.ts +3 -0
  103. package/components/Breadcrumb/types.d.ts +19 -0
  104. package/components/Button.vue.d.ts +4 -4
  105. package/components/Button.vue.js +32 -29
  106. package/components/ButtonGroup.vue.d.ts +1 -1
  107. package/components/Carousel/Carousel.vue.d.ts +58 -58
  108. package/components/CheckBox.vue.d.ts +2 -2
  109. package/components/Chip/Chip.vue.d.ts +3 -3
  110. package/components/ChoiceBox/ChoiceBox.vue.d.ts +4 -4
  111. package/components/ColorPicker/ColorPicker.vue.d.ts +3 -3
  112. package/components/ColorPicker/index.d.ts +1 -0
  113. package/components/CommandPaletteContent.vue.d.ts +15 -0
  114. package/components/CommandPaletteContent.vue.js +7 -0
  115. package/components/CommandPaletteContent.vue2.js +287 -0
  116. package/components/ConfirmationModal.vue.js +12 -10
  117. package/components/DataList/DataList.vue.d.ts +2 -2
  118. package/components/DataTable/DataTable.vue.d.ts +6 -6
  119. package/components/DataTable/DataTableRow.vue.d.ts +3 -3
  120. package/components/DatePicker.vue.d.ts +2 -2
  121. package/components/DatePicker.vue.js +7 -7
  122. package/components/DateRangePicker.vue.d.ts +29 -0
  123. package/components/DateRangePicker.vue.js +231 -0
  124. package/components/DateRangePicker.vue2.js +4 -0
  125. package/components/Dropdown/Dropdown.vue.d.ts +11 -6
  126. package/components/Dropdown/Dropdown.vue.js +147 -109
  127. package/components/Dropdown/DropdownBooleanItem.vue.js +9 -8
  128. package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
  129. package/components/Dropdown/DropdownGroupedLayout.vue.js +35 -34
  130. package/components/Dropdown/DropdownItem.vue.js +11 -10
  131. package/components/Dropdown/DropdownMenu.vue.d.ts +5 -3
  132. package/components/Dropdown/DropdownMenu.vue.js +114 -111
  133. package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
  134. package/components/Dropdown/DropdownTrigger.vue.js +9 -7
  135. package/components/ExportData/ExportData.vue.d.ts +16 -0
  136. package/components/ExportData/ExportData.vue.js +135 -0
  137. package/components/ExportData/ExportData.vue2.js +4 -0
  138. package/components/ExportData/index.d.ts +2 -0
  139. package/components/ExportData/types.d.ts +17 -0
  140. package/components/FilePicker/FilePicker.vue.d.ts +5 -5
  141. package/components/Form/CustomFields.vue.d.ts +6 -6
  142. package/components/Form/CustomFields.vue.js +1 -1
  143. package/components/Form/Form.vue.d.ts +4 -5
  144. package/components/Form/Form.vue.js +2 -2
  145. package/components/Form/Form.vue2.js +221 -178
  146. package/components/Form/FormField.vue.d.ts +4 -3
  147. package/components/Form/FormField.vue.js +70 -62
  148. package/components/Form/FormFields.vue.d.ts +3 -1
  149. package/components/Form/FormFields.vue.js +2 -2
  150. package/components/Form/FormFields.vue2.js +105 -59
  151. package/components/GoogleLogin.vue.d.ts +2 -2
  152. package/components/Icon.vue.d.ts +2 -0
  153. package/components/Icon.vue.js +12 -11
  154. package/components/ImportData/ImportData.vue.d.ts +31 -0
  155. package/components/ImportData/ImportData.vue.js +242 -0
  156. package/components/ImportData/ImportData.vue2.js +4 -0
  157. package/components/ImportData/ImportStep1.vue.d.ts +23 -0
  158. package/components/ImportData/ImportStep1.vue.js +162 -0
  159. package/components/ImportData/ImportStep1.vue2.js +4 -0
  160. package/components/ImportData/ImportStep2.vue.d.ts +20 -0
  161. package/components/ImportData/ImportStep2.vue.js +98 -0
  162. package/components/ImportData/ImportStep2.vue2.js +4 -0
  163. package/components/ImportData/ImportStep3.vue.d.ts +6 -0
  164. package/components/ImportData/ImportStep3.vue.js +98 -0
  165. package/components/ImportData/ImportStep3.vue2.js +4 -0
  166. package/components/ImportData/ImportStep4.vue.d.ts +6 -0
  167. package/components/ImportData/ImportStep4.vue.js +139 -0
  168. package/components/ImportData/ImportStep4.vue2.js +4 -0
  169. package/components/ImportData/index.d.ts +2 -0
  170. package/components/ImportData/types.d.ts +51 -0
  171. package/components/Input.vue.d.ts +9 -9
  172. package/components/Input.vue.js +137 -120
  173. package/components/List/List.vue.d.ts +18 -0
  174. package/components/List/List.vue.js +189 -0
  175. package/components/List/List.vue2.js +4 -0
  176. package/components/List/ListFieldRow.vue.d.ts +35 -0
  177. package/components/List/ListFieldRow.vue.js +119 -0
  178. package/components/List/ListFieldRow.vue2.js +4 -0
  179. package/components/List/index.d.ts +4 -0
  180. package/components/List/types.d.ts +1 -0
  181. package/components/List/utils.d.ts +9 -0
  182. package/components/List/utils.js +64 -0
  183. package/components/Masonry/Masonry.vue.d.ts +2 -2
  184. package/components/Modal.vue.js +5 -122
  185. package/components/Modal.vue2.js +133 -2
  186. package/components/MultiSelect/MultiSelect.vue.d.ts +12 -9
  187. package/components/MultiSelect/MultiSelect.vue.js +101 -64
  188. package/components/Navbar/Navbar.vue.d.ts +48 -9
  189. package/components/Navbar/Navbar.vue.js +418 -146
  190. package/components/Navbar/NavbarItem.vue.d.ts +2 -2
  191. package/components/Navbar/NavbarTabs.vue.d.ts +21 -0
  192. package/components/Navbar/NavbarTabs.vue.js +179 -0
  193. package/components/Navbar/NavbarTabs.vue3.js +5 -0
  194. package/components/Navbar/index.d.ts +3 -0
  195. package/components/NavbarCommandPalette.vue.d.ts +48 -0
  196. package/components/NumberInput.vue.d.ts +8 -8
  197. package/components/OTPInput/OTPInput.vue.d.ts +7 -7
  198. package/components/Pagination/Pagination.vue.d.ts +1 -1
  199. package/components/PermissionMatrix/PermissionEditor.vue.d.ts +36 -0
  200. package/components/PermissionMatrix/PermissionEditor.vue.js +323 -0
  201. package/components/PermissionMatrix/PermissionEditor.vue2.js +4 -0
  202. package/components/PermissionMatrix/PermissionMatrix.vue.d.ts +15 -0
  203. package/components/PermissionMatrix/PermissionMatrix.vue.js +7 -0
  204. package/components/PermissionMatrix/PermissionMatrix.vue2.js +245 -0
  205. package/components/PermissionMatrix/index.d.ts +3 -0
  206. package/components/PermissionMatrix/types.d.ts +59 -0
  207. package/components/PricingPlan/PricingPlan.vue.d.ts +3 -3
  208. package/components/ProgressBar/ProgressBar.vue.d.ts +3 -3
  209. package/components/QRCode/QRCode.vue.d.ts +15 -0
  210. package/components/QRCode/QRCode.vue.js +38 -0
  211. package/components/QRCode/QRCode.vue2.js +4 -0
  212. package/components/QRCode/index.d.ts +1 -0
  213. package/components/Screen/Screen.vue.d.ts +232 -5
  214. package/components/Screen/Screen.vue.js +423 -271
  215. package/components/Screen/ScreenFilter.vue.d.ts +2 -2
  216. package/components/Screen/ScreenFilter.vue.js +9 -9
  217. package/components/Screen/types.d.ts +12 -0
  218. package/components/SidePanel.vue.d.ts +2 -2
  219. package/components/SidebarMenu/SidebarMenu.vue.d.ts +15 -2
  220. package/components/SidebarMenu/SidebarMenu.vue.js +117 -47
  221. package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +2 -0
  222. package/components/SidebarMenu/SidebarMenuItem.vue.js +192 -175
  223. package/components/SidebarMenu/types.d.ts +32 -5
  224. package/components/Slider.vue.d.ts +2 -2
  225. package/components/Spinner/Spinner.vue.d.ts +2 -2
  226. package/components/Stats/Stats.vue.d.ts +14 -0
  227. package/components/Stats/Stats.vue.js +307 -0
  228. package/components/Stats/Stats.vue2.js +4 -0
  229. package/components/Stats/index.d.ts +2 -0
  230. package/components/Stats/types.d.ts +32 -0
  231. package/components/Switch.vue.d.ts +2 -1
  232. package/components/Switch.vue.js +4 -2
  233. package/components/Tabes/Tabes.vue.d.ts +3 -3
  234. package/components/Tabes/Tabes.vue.js +60 -57
  235. package/components/Tabes/types.d.ts +5 -0
  236. package/components/Textarea.vue.d.ts +3 -3
  237. package/components/{Timeline.vue.d.ts → Timeline/Timeline.vue.d.ts} +23 -2
  238. package/components/Timeline/Timeline.vue.js +92 -0
  239. package/components/Timeline/TimelineIndicator.vue.d.ts +9 -0
  240. package/components/Timeline/TimelineIndicator.vue.js +68 -0
  241. package/components/Timeline/TimelineIndicator.vue2.js +4 -0
  242. package/components/Timeline/TimelineItem.vue.d.ts +56 -0
  243. package/components/Timeline/TimelineItem.vue.js +173 -0
  244. package/components/Timeline/TimelineItem.vue2.js +4 -0
  245. package/components/Timeline/index.d.ts +3 -0
  246. package/components/Tooltip.vue.d.ts +2 -2
  247. package/components/Workbook/Sheet.vue.d.ts +2 -2
  248. package/components/Workbook/Workbook.vue.d.ts +3 -3
  249. package/components/index.d.ts +62 -0
  250. package/composables/useBreadcrumb.d.ts +17 -0
  251. package/composables/useBreadcrumb.js +27 -0
  252. package/core/config.d.ts +34 -0
  253. package/core/config.js +10 -7
  254. package/core/index.js +15 -8
  255. package/index.d.ts +55 -44
  256. package/index.js +243 -200
  257. package/package.json +12 -2
  258. package/router.d.ts +2 -0
  259. package/style.css +7 -5
  260. package/types/button.d.ts +1 -1
  261. package/types/config.type.d.ts +35 -0
  262. package/types/form.type.d.ts +3 -1
  263. package/types/index.d.ts +2 -1
  264. package/types/list.type.d.ts +57 -0
  265. package/types/navbar.type.d.ts +38 -1
  266. package/types/timeline.type.d.ts +14 -4
  267. package/components/Timeline.vue.js +0 -160
  268. /package/components/{Timeline.vue2.js → Timeline/Timeline.vue2.js} +0 -0
@@ -0,0 +1,119 @@
1
+ import { defineComponent as k, ref as w, computed as i, openBlock as n, createElementBlock as o, normalizeClass as c, createElementVNode as u, createBlock as y, createCommentVNode as p, toDisplayString as g, renderSlot as C, resolveDynamicComponent as B, Fragment as S, createVNode as T } from "vue";
2
+ import h from "../Icon.vue.js";
3
+ import { $t as L } from "../../utils/i18n.js";
4
+ import { getObjectValue as V, formatNumber as j, formatPrice as H, formatDate as f, getStatusColorClass as N } from "./utils.js";
5
+ const $ = { class: "flex items-center gap-1.5 shrink-0 min-w-0 max-w-[48%]" }, M = { class: "text-sm font-medium text-gray-800 truncate leading-snug" }, D = { class: "flex items-center justify-end gap-2 min-w-0 flex-1" }, I = ["innerHTML"], E = {
6
+ key: 1,
7
+ class: "text-sm text-gray-600 tracking-widest select-none",
8
+ "aria-hidden": "true"
9
+ }, F = ["aria-label"], O = ["src", "alt"], z = ["innerHTML"], G = /* @__PURE__ */ k({
10
+ __name: "ListFieldRow",
11
+ props: {
12
+ field: {},
13
+ data: {},
14
+ isLast: { type: Boolean, default: !1 },
15
+ showBorderBottom: { type: Boolean, default: !0 },
16
+ variant: { default: "default" },
17
+ showColon: { type: Boolean, default: !0 },
18
+ index: { default: 0 }
19
+ },
20
+ setup(a) {
21
+ const e = a, s = w(!1), d = i(() => V(e.field.key, e.data)), r = i(() => {
22
+ const t = d.value;
23
+ if (e.field.format)
24
+ return e.field.format(t, e.data);
25
+ if (t == null || t === "")
26
+ return e.field.emptyText ?? "--";
27
+ switch (e.field.type) {
28
+ case "date":
29
+ return f(t, !1);
30
+ case "dateTime":
31
+ return f(t, !0);
32
+ case "time":
33
+ return f(t, !0);
34
+ case "price":
35
+ return H(t);
36
+ case "number":
37
+ return j(t);
38
+ case "boolean":
39
+ return t ? "Yes" : "No";
40
+ default:
41
+ return String(t);
42
+ }
43
+ }), m = i(
44
+ () => e.field.titleI18n ? L(e.field.titleI18n) : e.field.title ?? e.field.key
45
+ ), v = i(() => {
46
+ const t = [];
47
+ if (e.field.addStatusColor) {
48
+ const l = N(r.value);
49
+ l && t.push(l);
50
+ }
51
+ if (e.field.class)
52
+ if (typeof e.field.class == "function") {
53
+ const l = e.field.class(d.value, e.data);
54
+ l && t.push(l);
55
+ } else
56
+ t.push(e.field.class);
57
+ return t.join(" ");
58
+ }), b = i(() => e.field.type === "image"), x = i(() => e.variant === "striped" && e.index % 2 !== 0);
59
+ return (t, l) => (n(), o("div", {
60
+ class: c(["list-field-row flex justify-between gap-3 px-3 py-2.5 transition-colors", [
61
+ a.showBorderBottom && !a.isLast ? "border-b border-border" : "",
62
+ x.value ? "bg-muted/40" : "",
63
+ a.variant === "compact" ? "py-1.5!" : "",
64
+ a.variant === "minimal" ? "px-0!" : ""
65
+ ]]),
66
+ role: "row"
67
+ }, [
68
+ u("div", $, [
69
+ a.field.icon ? (n(), y(h, {
70
+ key: 0,
71
+ icon: a.field.icon,
72
+ class: "w-3.5 h-3.5 text-gray-800 shrink-0"
73
+ }, null, 8, ["icon"])) : p("", !0),
74
+ u("span", M, g(m.value) + g(a.showColon ? ":" : ""), 1)
75
+ ]),
76
+ u("div", D, [
77
+ t.$slots[a.field.key] ? C(t.$slots, a.field.key, {
78
+ key: 0,
79
+ value: d.value,
80
+ resolved: r.value,
81
+ data: a.data
82
+ }) : a.field.component ? (n(), y(B(a.field.component), {
83
+ key: 1,
84
+ data: a.data,
85
+ value: d.value
86
+ }, null, 8, ["data", "value"])) : a.field.isSensitive ? (n(), o(S, { key: 2 }, [
87
+ s.value ? (n(), o("span", {
88
+ key: 0,
89
+ class: c(["text-sm text-gray-600 text-right break-words", v.value]),
90
+ innerHTML: r.value
91
+ }, null, 10, I)) : (n(), o("span", E, " •••••••• ")),
92
+ u("button", {
93
+ type: "button",
94
+ class: "shrink-0 p-1 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
95
+ "aria-label": s.value ? "Hide value" : "Show value",
96
+ onClick: l[0] || (l[0] = (P) => s.value = !s.value)
97
+ }, [
98
+ T(h, {
99
+ icon: s.value ? "lucide:eye-off" : "lucide:eye",
100
+ class: "w-3.5 h-3.5"
101
+ }, null, 8, ["icon"])
102
+ ], 8, F)
103
+ ], 64)) : b.value ? (n(), o("img", {
104
+ key: 3,
105
+ src: r.value,
106
+ alt: m.value,
107
+ class: "w-8 h-8 rounded-full object-cover border border-border"
108
+ }, null, 8, O)) : (n(), o("span", {
109
+ key: 4,
110
+ class: c(["text-sm text-gray-900 text-right break-words leading-snug", v.value]),
111
+ innerHTML: r.value
112
+ }, null, 10, z))
113
+ ])
114
+ ], 2));
115
+ }
116
+ });
117
+ export {
118
+ G as default
119
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ListFieldRow.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,4 @@
1
+ export { default as List } from './List.vue';
2
+ export { default as ListFieldRow } from './ListFieldRow.vue';
3
+ export * from './types';
4
+ export * from './utils';
@@ -0,0 +1 @@
1
+ export type { ListField, ListProps, ListVariant, ListColumns, ListFieldType, } from '../../types/list.type';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Resolves a dot-notation path from a nested object.
3
+ * e.g. getObjectValue('location.city', data) => 'New York'
4
+ */
5
+ export declare function getObjectValue(path: string, obj: Record<string, any>): any;
6
+ export declare function getStatusColorClass(value: any): string;
7
+ export declare function formatDate(value: any, hasTime?: boolean): string;
8
+ export declare function formatPrice(value: any): string;
9
+ export declare function formatNumber(value: any): string;
@@ -0,0 +1,64 @@
1
+ function u(t, e) {
2
+ if (!(!t || !e))
3
+ return t.includes(".") ? t.split(".").reduce((r, n) => r?.[n], e) : e[t];
4
+ }
5
+ const i = {
6
+ active: "text-success-dark font-medium",
7
+ inactive: "text-muted-foreground",
8
+ pending: "text-warning-dark font-medium",
9
+ completed: "text-success-dark font-medium",
10
+ cancelled: "text-danger-dark font-medium",
11
+ failed: "text-danger-dark font-medium",
12
+ success: "text-success-dark font-medium",
13
+ error: "text-danger-dark font-medium",
14
+ warning: "text-warning-dark font-medium",
15
+ info: "text-info-dark font-medium",
16
+ high: "text-danger-dark font-medium",
17
+ medium: "text-warning-dark font-medium",
18
+ low: "text-muted-foreground",
19
+ yes: "text-success-dark font-medium",
20
+ no: "text-danger-dark font-medium",
21
+ true: "text-success-dark font-medium",
22
+ false: "text-danger-dark font-medium",
23
+ enabled: "text-success-dark font-medium",
24
+ disabled: "text-muted-foreground"
25
+ };
26
+ function d(t) {
27
+ if (t == null) return "";
28
+ const e = String(t).toLowerCase().replace(/[-_\s]/g, "");
29
+ return i[e] || "";
30
+ }
31
+ function m(t, e = !1) {
32
+ if (!t) return "--";
33
+ try {
34
+ const r = new Date(t);
35
+ return isNaN(r.getTime()) ? String(t) : e ? r.toLocaleString("en-US", {
36
+ year: "numeric",
37
+ month: "short",
38
+ day: "numeric",
39
+ hour: "2-digit",
40
+ minute: "2-digit"
41
+ }) : r.toLocaleDateString("en-US", {
42
+ year: "numeric",
43
+ month: "short",
44
+ day: "numeric"
45
+ });
46
+ } catch {
47
+ return String(t);
48
+ }
49
+ }
50
+ function o(t) {
51
+ const e = Number(t);
52
+ return isNaN(e) ? String(t ?? "--") : new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(e);
53
+ }
54
+ function a(t) {
55
+ const e = Number(t);
56
+ return isNaN(e) ? String(t ?? "--") : new Intl.NumberFormat("en-US").format(e);
57
+ }
58
+ export {
59
+ m as formatDate,
60
+ a as formatNumber,
61
+ o as formatPrice,
62
+ u as getObjectValue,
63
+ d as getStatusColorClass
64
+ };
@@ -15,10 +15,10 @@ declare function __VLS_template(): {
15
15
  };
16
16
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
17
  declare const __VLS_component: import('vue').DefineComponent<MasonryProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<MasonryProps> & Readonly<{}>, {
18
- gap: number;
19
18
  tag: string;
20
- cols: number | Record<string | number, number>;
21
19
  itemKey: string;
20
+ gap: number;
21
+ cols: number | Record<string | number, number>;
22
22
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
23
23
  containerRef: unknown;
24
24
  }, any>;
@@ -1,124 +1,7 @@
1
- import { defineComponent as O, ref as S, watch as b, provide as z, onUnmounted as D, computed as p, openBlock as l, createElementBlock as a, Fragment as E, createElementVNode as n, mergeProps as v, withModifiers as h, renderSlot as c, createCommentVNode as i, createBlock as g, Teleport as N, createVNode as x, Transition as P, withCtx as T, normalizeClass as d, toDisplayString as k, resolveDynamicComponent as V } from "vue";
2
- import j from "./Button.vue.js";
3
- import { useKeyStroke as K } from "../composables/useKeyStroke.js";
4
- import { $t as C } from "../utils/i18n.js";
5
- const M = {
6
- key: 0,
7
- class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
8
- }, W = { class: "text-lg font-semibold leading-none tracking-tight" }, A = {
9
- key: 0,
10
- class: "text-sm text-muted-foreground mb-6.5"
11
- }, H = /* @__PURE__ */ O({
12
- inheritAttrs: !1,
13
- __name: "Modal",
14
- props: {
15
- show: { type: Boolean, default: !1 },
16
- title: {},
17
- titleI18n: {},
18
- maxWidth: { default: "sm:max-w-lg" },
19
- closeOutside: { type: Boolean, default: !0 },
20
- backdrop: { type: Boolean, default: !0 },
21
- description: {},
22
- descriptionI18n: {},
23
- triggerClass: {},
24
- bodyClass: {},
25
- headerClass: {},
26
- footerClass: {},
27
- body: {},
28
- bodyProps: {}
29
- },
30
- emits: ["close", "update:show", "onOpen"],
31
- setup(t, { emit: w }) {
32
- const o = t, u = w, r = S(o.show);
33
- b(
34
- () => o.show,
35
- (e) => {
36
- r.value = e, e && u("onOpen");
37
- }
38
- );
39
- const $ = () => {
40
- r.value = !0;
41
- }, s = () => {
42
- r.value = !1, u("update:show", !1), u("close");
43
- };
44
- z("modal-context", { close: s });
45
- const B = () => {
46
- o.closeOutside && s();
47
- }, { onKeyStroke: I } = K();
48
- I("Escape", s), b(r, (e) => {
49
- e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
50
- }), D(() => {
51
- document.body.style.overflow = "";
52
- });
53
- const f = p(() => o.titleI18n ? C(o.titleI18n) : o.title), m = p(() => o.descriptionI18n ? C(o.descriptionI18n) : o.description);
54
- return (e, y) => (l(), a(E, null, [
55
- n("span", v({
56
- onClick: h($, ["stop"]),
57
- class: `${t.triggerClass}`
58
- }, e.$attrs), [
59
- c(e.$slots, "trigger", {}, () => [
60
- t.body ? c(e.$slots, "default", { key: 0 }) : i("", !0)
61
- ])
62
- ], 16),
63
- (l(), g(N, { to: "body" }, [
64
- x(P, {
65
- "enter-active-class": "transition duration-200 ease-out",
66
- "enter-from-class": "opacity-0",
67
- "enter-to-class": "opacity-100",
68
- "leave-active-class": "transition duration-150 ease-in",
69
- "leave-from-class": "opacity-100",
70
- "leave-to-class": "opacity-0"
71
- }, {
72
- default: T(() => [
73
- r.value ? (l(), a("div", {
74
- key: 0,
75
- class: d(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", t.backdrop && "backdrop-blur-[2px]"]),
76
- onClick: B
77
- }, [
78
- n("div", {
79
- class: d(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh]", [t.maxWidth]]),
80
- onClick: y[0] || (y[0] = h(() => {
81
- }, ["stop"]))
82
- }, [
83
- f.value ? (l(), a("div", M, [
84
- n("div", {
85
- class: d(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
86
- }, [
87
- n("h3", W, k(f.value), 1),
88
- x(j, {
89
- rounded: "full",
90
- size: "sm",
91
- icon: "lucide:x",
92
- variant: "ghost",
93
- class: "hover:bg-gray-250/25!",
94
- onClick: s
95
- })
96
- ], 2)
97
- ])) : i("", !0),
98
- n("div", {
99
- class: d(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", t.bodyClass])
100
- }, [
101
- m.value ? (l(), a("p", A, k(m.value), 1)) : i("", !0),
102
- t.body ? (l(), g(V(t.body), v({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : c(e.$slots, "default", {
103
- key: 2,
104
- close: s
105
- })
106
- ], 2),
107
- e.$slots.footer ? (l(), a("div", {
108
- key: 1,
109
- class: d([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
110
- }, [
111
- c(e.$slots, "footer", { close: s })
112
- ], 2)) : i("", !0)
113
- ], 2)
114
- ], 2)) : i("", !0)
115
- ]),
116
- _: 3
117
- })
118
- ]))
119
- ], 64));
120
- }
121
- });
1
+ import o from "./Modal.vue2.js";
2
+ /* empty css */
3
+ import t from "../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-32c213fd"]]);
122
5
  export {
123
- H as default
6
+ m as default
124
7
  };
@@ -1,4 +1,135 @@
1
- import f from "./Modal.vue.js";
1
+ import { defineComponent as E, ref as b, watch as g, provide as N, onUnmounted as P, computed as k, openBlock as l, createElementBlock as r, Fragment as V, createElementVNode as d, mergeProps as x, withModifiers as C, renderSlot as u, createCommentVNode as c, createBlock as w, Teleport as j, createVNode as $, Transition as K, withCtx as M, normalizeClass as a, toDisplayString as B, resolveDynamicComponent as W } from "vue";
2
+ import A from "./Button.vue.js";
3
+ import { useKeyStroke as F } from "../composables/useKeyStroke.js";
4
+ import { $t as T } from "../utils/i18n.js";
5
+ const U = {
6
+ key: 0,
7
+ class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
8
+ }, q = { class: "text-lg font-semibold leading-none tracking-tight" }, G = {
9
+ key: 0,
10
+ class: "text-sm text-muted-foreground mb-6.5"
11
+ }, R = /* @__PURE__ */ E({
12
+ inheritAttrs: !1,
13
+ __name: "Modal",
14
+ props: {
15
+ show: { type: Boolean, default: !1 },
16
+ title: {},
17
+ titleI18n: {},
18
+ maxWidth: { default: "sm:max-w-lg" },
19
+ closeOutside: { type: Boolean, default: !0 },
20
+ backdrop: { type: Boolean, default: !0 },
21
+ description: {},
22
+ descriptionI18n: {},
23
+ triggerClass: {},
24
+ bodyClass: {},
25
+ headerClass: {},
26
+ footerClass: {},
27
+ body: {},
28
+ bodyProps: {}
29
+ },
30
+ emits: ["close", "update:show", "onOpen"],
31
+ setup(t, { emit: I }) {
32
+ const o = t, f = I, i = b(o.show), y = b(!1), m = b(!1);
33
+ let n = null;
34
+ g(
35
+ () => o.show,
36
+ (e) => {
37
+ i.value = e, e && f("onOpen");
38
+ }
39
+ );
40
+ const S = () => {
41
+ i.value = !0;
42
+ }, O = (e) => {
43
+ y.value = e;
44
+ }, s = () => {
45
+ if (y.value) {
46
+ m.value = !0, n && clearTimeout(n), n = setTimeout(() => {
47
+ m.value = !1;
48
+ }, 1e3);
49
+ return;
50
+ }
51
+ i.value = !1, f("update:show", !1), f("close");
52
+ };
53
+ N("modal-context", { close: s, setSubmitting: O });
54
+ const z = () => {
55
+ o.closeOutside && s();
56
+ }, { onKeyStroke: D } = F();
57
+ D("Escape", s), g(i, (e) => {
58
+ e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
59
+ }), P(() => {
60
+ document.body.style.overflow = "", n && clearTimeout(n);
61
+ });
62
+ const p = k(() => o.titleI18n ? T(o.titleI18n) : o.title), v = k(
63
+ () => o.descriptionI18n ? T(o.descriptionI18n) : o.description
64
+ );
65
+ return (e, h) => (l(), r(V, null, [
66
+ d("span", x({
67
+ onClick: C(S, ["stop"]),
68
+ class: `${t.triggerClass}`
69
+ }, e.$attrs), [
70
+ u(e.$slots, "trigger", {}, () => [
71
+ t.body ? u(e.$slots, "default", { key: 0 }, void 0, !0) : c("", !0)
72
+ ], !0)
73
+ ], 16),
74
+ (l(), w(j, { to: "body" }, [
75
+ $(K, {
76
+ "enter-active-class": "transition duration-200 ease-out",
77
+ "enter-from-class": "opacity-0",
78
+ "enter-to-class": "opacity-100",
79
+ "leave-active-class": "transition duration-150 ease-in",
80
+ "leave-from-class": "opacity-100",
81
+ "leave-to-class": "opacity-0"
82
+ }, {
83
+ default: M(() => [
84
+ i.value ? (l(), r("div", {
85
+ key: 0,
86
+ class: a(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", t.backdrop && "backdrop-blur-[2px]"]),
87
+ onClick: z
88
+ }, [
89
+ d("div", {
90
+ class: a(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh]", [t.maxWidth]]),
91
+ onClick: h[0] || (h[0] = C(() => {
92
+ }, ["stop"]))
93
+ }, [
94
+ p.value ? (l(), r("div", U, [
95
+ d("div", {
96
+ class: a(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
97
+ }, [
98
+ d("h3", q, B(p.value), 1),
99
+ $(A, {
100
+ rounded: "full",
101
+ size: "sm",
102
+ icon: "lucide:x",
103
+ variant: "ghost",
104
+ class: a(["hover:bg-gray-250/25! transition-all", { "blink-bg": m.value }]),
105
+ onClick: s
106
+ }, null, 8, ["class"])
107
+ ], 2)
108
+ ])) : c("", !0),
109
+ d("div", {
110
+ class: a(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", t.bodyClass])
111
+ }, [
112
+ v.value ? (l(), r("p", G, B(v.value), 1)) : c("", !0),
113
+ t.body ? (l(), w(W(t.body), x({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : u(e.$slots, "default", {
114
+ key: 2,
115
+ close: s
116
+ }, void 0, !0)
117
+ ], 2),
118
+ e.$slots.footer ? (l(), r("div", {
119
+ key: 1,
120
+ class: a([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
121
+ }, [
122
+ u(e.$slots, "footer", { close: s }, void 0, !0)
123
+ ], 2)) : c("", !0)
124
+ ], 2)
125
+ ], 2)) : c("", !0)
126
+ ]),
127
+ _: 3
128
+ })
129
+ ]))
130
+ ], 64));
131
+ }
132
+ });
2
133
  export {
3
- f as default
134
+ R as default
4
135
  };
@@ -1,40 +1,43 @@
1
- import { IDropdownOptions } from '../../types';
1
+ import { IDropdownOption } from '../../types';
2
2
  interface Props {
3
3
  modelValue?: any[];
4
- options?: IDropdownOptions;
4
+ options?: (IDropdownOption | string | number)[];
5
5
  placeholder?: string;
6
6
  placeholderI18n?: string;
7
7
  disabled?: boolean;
8
8
  searchable?: boolean;
9
- variant?: 'default' | 'outline' | 'solid';
9
+ variant?: 'default' | 'outline' | 'solid' | 'floating' | string;
10
10
  size?: 'sm' | 'md' | 'lg';
11
11
  maxVisible?: number;
12
12
  loading?: boolean;
13
13
  hasMore?: boolean;
14
14
  remote?: boolean;
15
+ debounceTime?: number;
16
+ fetchSelected?: (ids: any[]) => Promise<IDropdownOption[]>;
15
17
  layout?: 'default' | 'grouped';
16
18
  }
17
19
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
18
20
  search: (query: string) => any;
19
- "update:modelValue": (value: any[]) => any;
20
21
  change: (value: any[]) => any;
22
+ "update:modelValue": (value: any[]) => any;
21
23
  "load-more": () => any;
22
24
  }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
23
25
  onSearch?: (query: string) => any;
24
- "onUpdate:modelValue"?: (value: any[]) => any;
25
26
  onChange?: (value: any[]) => any;
27
+ "onUpdate:modelValue"?: (value: any[]) => any;
26
28
  "onLoad-more"?: () => any;
27
29
  }>, {
28
- disabled: boolean;
30
+ variant: "default" | "outline" | "solid" | "floating" | string;
29
31
  size: "sm" | "md" | "lg";
30
- variant: "default" | "outline" | "solid";
31
- modelValue: any[];
32
+ disabled: boolean;
32
33
  loading: boolean;
33
- options: IDropdownOptions;
34
+ modelValue: any[];
35
+ options: (IDropdownOption | string | number)[];
34
36
  layout: "default" | "grouped";
35
37
  hasMore: boolean;
36
38
  searchable: boolean;
37
39
  remote: boolean;
40
+ debounceTime: number;
38
41
  maxVisible: number;
39
42
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
40
43
  export default _default;