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,231 @@
1
+ import { defineComponent as V, ref as w, watch as L, computed as u, openBlock as d, createBlock as m, unref as h, withCtx as y, createElementVNode as i, createElementBlock as x, Fragment as z, renderList as B, createCommentVNode as E, createVNode as g, normalizeClass as k, toDisplayString as R } from "vue";
2
+ import T from "./Dropdown/Dropdown.vue.js";
3
+ import f from "./Icon.vue.js";
4
+ import { $t as l } from "../utils/i18n.js";
5
+ import P from "./Button.vue.js";
6
+ import p from "v-datepicker-lite";
7
+ import "v-datepicker-lite/style.css";
8
+ const $ = { class: "flex items-center gap-2" }, H = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, Q = {
9
+ key: 0,
10
+ class: "flex flex-col gap-1 sm:pr-3 py-2 sm:border-r border-border max-h-[280px]"
11
+ }, j = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, O = { class: "border border-border rounded-md overflow-hidden bg-background" }, I = { class: "flex items-center justify-center shrink-0" }, U = { class: "border border-border rounded-md overflow-hidden bg-background" }, Z = /* @__PURE__ */ V({
12
+ __name: "DateRangePicker",
13
+ props: {
14
+ modelValue: {},
15
+ placeholderStart: { default: "Start Date" },
16
+ placeholderEnd: { default: "End Date" },
17
+ minDate: {},
18
+ maxDate: {},
19
+ disabled: { type: Boolean },
20
+ readonly: { type: Boolean },
21
+ size: {},
22
+ variant: {},
23
+ showQuickRanges: { type: Boolean, default: !0 }
24
+ },
25
+ emits: ["update:modelValue", "change"],
26
+ setup(r, { emit: M }) {
27
+ const v = r, D = M, o = w(!1), c = w(0);
28
+ L(o, (t) => {
29
+ t && c.value++;
30
+ });
31
+ const n = u({
32
+ get: () => v.modelValue || { start: null, end: null },
33
+ set: (t) => {
34
+ D("update:modelValue", t), D("change", t);
35
+ }
36
+ }), Y = (t) => {
37
+ n.value = { ...n.value, start: t };
38
+ }, _ = (t) => {
39
+ n.value = { ...n.value, end: t };
40
+ }, S = u(() => {
41
+ if (n.value.end) {
42
+ const t = new Date(n.value.end);
43
+ if (!isNaN(t.getTime())) return t.toISOString();
44
+ }
45
+ return v.maxDate;
46
+ }), N = u(() => {
47
+ if (n.value.start) {
48
+ const t = new Date(n.value.start);
49
+ if (!isNaN(t.getTime())) return t.toISOString();
50
+ }
51
+ return v.minDate;
52
+ }), b = (t) => {
53
+ if (!t) return "";
54
+ try {
55
+ const e = new Date(t);
56
+ return isNaN(e.getTime()) ? "" : e.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
57
+ } catch {
58
+ return "";
59
+ }
60
+ }, C = u(() => [
61
+ {
62
+ label: l("vlite.dateRangePicker.today") !== "vlite.dateRangePicker.today" ? l("vlite.dateRangePicker.today") : "Today",
63
+ value: "today",
64
+ icon: "lucide:calendar"
65
+ },
66
+ {
67
+ label: l("vlite.dateRangePicker.yesterday") !== "vlite.dateRangePicker.yesterday" ? l("vlite.dateRangePicker.yesterday") : "Yesterday",
68
+ value: "yesterday",
69
+ icon: "lucide:calendar-minus"
70
+ },
71
+ {
72
+ label: l("vlite.dateRangePicker.last7Days") !== "vlite.dateRangePicker.last7Days" ? l("vlite.dateRangePicker.last7Days") : "Last 7 Days",
73
+ value: "last_7_days",
74
+ icon: "lucide:calendar-days"
75
+ },
76
+ {
77
+ label: l("vlite.dateRangePicker.last30Days") !== "vlite.dateRangePicker.last30Days" ? l("vlite.dateRangePicker.last30Days") : "Last 30 Days",
78
+ value: "last_30_days",
79
+ icon: "lucide:calendar-days"
80
+ },
81
+ {
82
+ label: l("vlite.dateRangePicker.thisMonth") !== "vlite.dateRangePicker.thisMonth" ? l("vlite.dateRangePicker.thisMonth") : "This Month",
83
+ value: "this_month",
84
+ icon: "lucide:calendar-range"
85
+ },
86
+ {
87
+ label: l("vlite.dateRangePicker.lastMonth") !== "vlite.dateRangePicker.lastMonth" ? l("vlite.dateRangePicker.lastMonth") : "Last Month",
88
+ value: "last_month",
89
+ icon: "lucide:calendar-range"
90
+ },
91
+ {
92
+ label: l("vlite.dateRangePicker.last6Months") !== "vlite.dateRangePicker.last6Months" ? l("vlite.dateRangePicker.last6Months") : "Last 6 Months",
93
+ value: "last_6_months",
94
+ icon: "lucide:history"
95
+ },
96
+ {
97
+ label: l("vlite.dateRangePicker.thisYear") !== "vlite.dateRangePicker.thisYear" ? l("vlite.dateRangePicker.thisYear") : "This Year",
98
+ value: "this_year",
99
+ icon: "lucide:calendar-check"
100
+ },
101
+ {
102
+ label: l("vlite.dateRangePicker.lastYear") !== "vlite.dateRangePicker.lastYear" ? l("vlite.dateRangePicker.lastYear") : "Last Year",
103
+ value: "last_year",
104
+ icon: "lucide:history"
105
+ }
106
+ ]), F = (t) => {
107
+ const e = /* @__PURE__ */ new Date();
108
+ let a = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
109
+ switch (e.setHours(0, 0, 0, 0), a.setHours(0, 0, 0, 0), s.setHours(0, 0, 0, 0), t.value) {
110
+ case "today":
111
+ a = new Date(e), s = new Date(e);
112
+ break;
113
+ case "yesterday":
114
+ a = new Date(e), a.setDate(a.getDate() - 1), s = new Date(a);
115
+ break;
116
+ case "last_7_days":
117
+ a = new Date(e), a.setDate(a.getDate() - 6), s = new Date(e);
118
+ break;
119
+ case "last_30_days":
120
+ a = new Date(e), a.setDate(a.getDate() - 29), s = new Date(e);
121
+ break;
122
+ case "this_month":
123
+ a = new Date(e.getFullYear(), e.getMonth(), 1), s = new Date(e);
124
+ break;
125
+ case "last_month":
126
+ a = new Date(e.getFullYear(), e.getMonth() - 1, 1), s = new Date(e.getFullYear(), e.getMonth(), 0);
127
+ break;
128
+ case "last_6_months":
129
+ a = new Date(e.getFullYear(), e.getMonth() - 5, 1), s = new Date(e);
130
+ break;
131
+ case "this_year":
132
+ a = new Date(e.getFullYear(), 0, 1), s = new Date(e);
133
+ break;
134
+ case "last_year":
135
+ a = new Date(e.getFullYear() - 1, 0, 1), s = new Date(e.getFullYear() - 1, 11, 31);
136
+ break;
137
+ }
138
+ n.value = { start: a, end: s }, c.value++, o.value = !1;
139
+ };
140
+ return (t, e) => (d(), m(h(T), {
141
+ isOpen: o.value,
142
+ "onUpdate:isOpen": e[0] || (e[0] = (a) => o.value = a),
143
+ position: "bottom-start",
144
+ disabled: r.disabled || r.readonly,
145
+ class: "w-full sm:w-auto inline-block",
146
+ maxHeight: "none"
147
+ }, {
148
+ trigger: y(({ isOpen: a }) => [
149
+ g(P, {
150
+ icon: "lucide:calendar",
151
+ variant: r.variant || "outline",
152
+ size: r.size || "md",
153
+ disabled: r.disabled,
154
+ class: k(["w-full sm:min-w-[280px] justify-start text-left font-normal", { "ring-2 ring-ring ring-offset-2": a }])
155
+ }, {
156
+ default: y(() => [
157
+ i("div", $, [
158
+ i("span", {
159
+ class: k({ "text-muted-foreground": !n.value.start })
160
+ }, R(n.value.start ? b(n.value.start) : r.placeholderStart), 3),
161
+ g(f, {
162
+ icon: "lucide:arrow-right",
163
+ class: "w-4 h-4 text-muted-foreground opacity-50 shrink-0"
164
+ }),
165
+ i("span", {
166
+ class: k({ "text-muted-foreground": !n.value.end })
167
+ }, R(n.value.end ? b(n.value.end) : r.placeholderEnd), 3)
168
+ ])
169
+ ]),
170
+ _: 1
171
+ }, 8, ["variant", "size", "disabled", "class"])
172
+ ]),
173
+ menu: y(() => [
174
+ i("div", H, [
175
+ r.showQuickRanges ? (d(), x("div", Q, [
176
+ e[1] || (e[1] = i("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
177
+ (d(!0), x(z, null, B(C.value, (a) => (d(), m(P, {
178
+ key: a.value,
179
+ text: a.label,
180
+ icon: a.icon,
181
+ variant: "ghost",
182
+ size: "sm",
183
+ class: "justify-start w-full font-normal",
184
+ onClick: (s) => F(a)
185
+ }, null, 8, ["text", "icon", "onClick"]))), 128))
186
+ ])) : E("", !0),
187
+ i("div", j, [
188
+ i("div", O, [
189
+ (d(), m(h(p), {
190
+ key: "start-" + c.value,
191
+ value: n.value.start,
192
+ onChange: Y,
193
+ mode: "date",
194
+ "max-date": S.value,
195
+ "min-date": r.minDate,
196
+ disabled: r.disabled,
197
+ readonly: r.readonly
198
+ }, null, 8, ["value", "max-date", "min-date", "disabled", "readonly"]))
199
+ ]),
200
+ i("div", I, [
201
+ g(f, {
202
+ icon: "lucide:arrow-right",
203
+ class: "w-5 h-5 text-muted-foreground hidden sm:block opacity-50"
204
+ }),
205
+ g(f, {
206
+ icon: "lucide:arrow-down",
207
+ class: "w-5 h-5 text-muted-foreground sm:hidden opacity-50"
208
+ })
209
+ ]),
210
+ i("div", U, [
211
+ (d(), m(h(p), {
212
+ key: "end-" + c.value,
213
+ value: n.value.end,
214
+ onChange: _,
215
+ mode: "date",
216
+ "min-date": N.value,
217
+ "max-date": r.maxDate,
218
+ disabled: r.disabled,
219
+ readonly: r.readonly
220
+ }, null, 8, ["value", "min-date", "max-date", "disabled", "readonly"]))
221
+ ])
222
+ ])
223
+ ])
224
+ ]),
225
+ _: 1
226
+ }, 8, ["isOpen", "disabled"]));
227
+ }
228
+ });
229
+ export {
230
+ Z as default
231
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./DateRangePicker.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,4 +1,4 @@
1
- import { IDropdownOptions, IDropdownOption } from '../../types';
1
+ import { IDropdownOption, ButtonProps } from '../../types';
2
2
  import { TooltTipPlacement } from 'v-tooltip-lite/types';
3
3
  type __VLS_Props = {
4
4
  selected?: any;
@@ -8,7 +8,7 @@ type __VLS_Props = {
8
8
  position?: TooltTipPlacement;
9
9
  closeOnSelect?: boolean;
10
10
  toggleSelection?: boolean;
11
- options?: IDropdownOptions;
11
+ options?: (IDropdownOption | string | number)[];
12
12
  canCloseOutside?: boolean;
13
13
  caret?: boolean;
14
14
  offset?: [number, number];
@@ -30,6 +30,9 @@ type __VLS_Props = {
30
30
  hasMore?: boolean;
31
31
  searchable?: boolean;
32
32
  remote?: boolean;
33
+ debounceTime?: number;
34
+ fetchSelected?: (ids: any[]) => Promise<IDropdownOption[]>;
35
+ triggerProps?: ButtonProps;
33
36
  direction?: 'ltr' | 'rtl';
34
37
  };
35
38
  declare function __VLS_template(): {
@@ -60,8 +63,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
60
63
  data?: any;
61
64
  }) => any;
62
65
  "update:modelValue": (value: any) => any;
63
- onClose: () => any;
64
66
  onOpen: () => any;
67
+ onClose: () => any;
65
68
  "update:isOpen": (value: boolean) => any;
66
69
  "load-more": () => any;
67
70
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
@@ -71,21 +74,21 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
71
74
  data?: any;
72
75
  }) => any;
73
76
  "onUpdate:modelValue"?: (value: any) => any;
74
- onOnClose?: () => any;
75
77
  onOnOpen?: () => any;
78
+ onOnClose?: () => any;
76
79
  "onUpdate:isOpen"?: (value: boolean) => any;
77
80
  "onLoad-more"?: () => any;
78
81
  }>, {
79
- isOpen: boolean;
80
82
  loading: boolean;
81
- direction: "ltr" | "rtl";
82
83
  selectable: boolean;
84
+ options: (IDropdownOption | string | number)[];
83
85
  columns: number | string;
84
86
  canCloseOutside: boolean;
85
87
  closeOnSelect: boolean;
86
88
  toggleSelection: boolean;
87
89
  emptyMessage: string;
88
90
  offset: [number, number];
91
+ isOpen: boolean;
89
92
  teleport: boolean;
90
93
  selectedIndex: number | null;
91
94
  maxHeight: string;
@@ -95,6 +98,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
95
98
  hasMore: boolean;
96
99
  searchable: boolean;
97
100
  remote: boolean;
101
+ debounceTime: number;
102
+ direction: "ltr" | "rtl";
98
103
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
99
104
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
100
105
  export default _default;
@@ -1,12 +1,12 @@
1
- import { defineComponent as z, ref as d, computed as C, watch as $, reactive as D, toRefs as R, openBlock as k, createElementBlock as j, normalizeStyle as E, createVNode as h, unref as v, withCtx as r, renderSlot as c, createBlock as U, normalizeClass as q, createSlots as F, normalizeProps as S, guardReactiveProps as w, createCommentVNode as G } from "vue";
2
- import J from "v-tooltip-lite";
1
+ import { defineComponent as G, ref as r, computed as v, watch as w, reactive as J, toRefs as K, openBlock as N, createElementBlock as Q, normalizeStyle as W, createVNode as $, unref as g, withCtx as c, renderSlot as u, createBlock as X, normalizeClass as Y, createSlots as Z, normalizeProps as x, guardReactiveProps as H, createCommentVNode as _ } from "vue";
2
+ import ee from "v-tooltip-lite";
3
3
  import "v-tooltip-lite/style.css";
4
- import K from "./DropdownMenu.vue.js";
5
- import Q from "./DropdownTrigger.vue.js";
6
- import W from "../ConfirmationModal.vue.js";
7
- import { useDropdownIds as X } from "./composables/useDropdownIds.js";
8
- import { useDropdownSelection as Y } from "./composables/useDropdownSelection.js";
9
- const se = /* @__PURE__ */ z({
4
+ import te from "./DropdownMenu.vue.js";
5
+ import ne from "./DropdownTrigger.vue.js";
6
+ import oe from "../ConfirmationModal.vue.js";
7
+ import { useDropdownIds as le } from "./composables/useDropdownIds.js";
8
+ import { useDropdownSelection as ae } from "./composables/useDropdownSelection.js";
9
+ const ve = /* @__PURE__ */ G({
10
10
  __name: "Dropdown",
11
11
  props: {
12
12
  selected: {},
@@ -16,7 +16,7 @@ const se = /* @__PURE__ */ z({
16
16
  position: {},
17
17
  closeOnSelect: { type: Boolean, default: !0 },
18
18
  toggleSelection: { type: Boolean, default: !0 },
19
- options: {},
19
+ options: { default: () => [] },
20
20
  canCloseOutside: { type: Boolean, default: !0 },
21
21
  caret: { type: Boolean },
22
22
  offset: { default: () => [0, 8] },
@@ -38,175 +38,213 @@ const se = /* @__PURE__ */ z({
38
38
  hasMore: { type: Boolean, default: !1 },
39
39
  searchable: { type: Boolean, default: !0 },
40
40
  remote: { type: Boolean, default: !1 },
41
+ debounceTime: { default: 300 },
42
+ fetchSelected: {},
43
+ triggerProps: {},
41
44
  direction: { default: "ltr" }
42
45
  },
43
46
  emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
44
- setup(t, { emit: B }) {
45
- const l = t, f = B, m = d(!1), u = d(null), a = d({
47
+ setup(o, { emit: M }) {
48
+ const l = o, y = M, h = r(!1), d = r(null), s = r({
46
49
  title: "Confirm Selection",
47
50
  description: "Are you sure you want to select this option?",
48
51
  confirmText: "Confirm",
49
52
  cancelText: "Cancel",
50
53
  variant: "primary"
51
- }), I = C(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), T = C(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), y = d(l.isOpen || !1);
52
- $(
54
+ }), A = v(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), L = v(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), b = r(l.isOpen || !1);
55
+ w(
53
56
  () => l.isOpen,
54
57
  (e) => {
55
- e !== void 0 && (y.value = e);
58
+ e !== void 0 && (b.value = e);
56
59
  }
57
60
  );
58
- const O = (e) => {
59
- y.value = e, f("update:isOpen", e), f(e ? "onOpen" : "onClose");
60
- }, s = d([]);
61
- $(
62
- () => l.options,
61
+ const k = (e) => {
62
+ b.value = e, y("update:isOpen", e), y(e ? "onOpen" : "onClose");
63
+ }, O = v(() => l.options ? l.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), f = r([]);
64
+ w(
65
+ O,
63
66
  (e) => {
64
67
  if (e)
65
68
  if (l.remote) {
66
- const n = [...s.value];
67
- e.forEach((o) => {
68
- n.some((i) => i.value !== void 0 && o.value !== void 0 ? typeof i.value == "object" && i.key && o.key ? i.key === o.key && i.value[i.key] === o.value[o.key] : i.value === o.value : i.label === o.label) || n.push(o);
69
- }), s.value = n;
69
+ const t = [...f.value];
70
+ e.forEach((n) => {
71
+ t.some((a) => a.value !== void 0 && n.value !== void 0 ? typeof a.value == "object" && a.key && n.key ? a.key === n.key && a.value[a.key] === n.value[n.key] : a.value === n.value : a.label === n.label) || t.push(n);
72
+ }), f.value = t;
70
73
  } else
71
- s.value = e;
74
+ f.value = e;
72
75
  },
73
76
  { immediate: !0, deep: !0 }
74
77
  );
75
- const { getAllRecursiveIds: P } = X(), N = D({
76
- ...R(l),
77
- options: s
78
- }), { currentValue: x, selectedLabel: g, selectOption: M } = Y(
79
- N,
80
- // Cast to any to satisfy strict prop types if needed, or define interface
81
- f
82
- ), H = C(() => {
83
- const e = l.ignoreClickOutside || [], n = P(s.value);
84
- return [.../* @__PURE__ */ new Set([...e, ...n])];
85
- }), L = (e) => {
86
- l.doubleConfirmation || !!e.confirmation ? (u.value = e, typeof e.confirmation == "object" ? a.value = {
78
+ const m = r(/* @__PURE__ */ new Map()), C = r(!1), V = async (e) => {
79
+ if (!l.fetchSelected || e === void 0 || e === null) return;
80
+ let t = [];
81
+ Array.isArray(e) ? t = e : typeof e == "object" ? t = Object.values(e) : t = [e];
82
+ const n = t.filter((i) => {
83
+ const a = m.value.has(i), q = f.value.some((I) => (I.value ?? I.label) === i);
84
+ return !a && !q;
85
+ });
86
+ if (n.length) {
87
+ C.value = !0;
88
+ try {
89
+ (await l.fetchSelected(n)).forEach((a) => {
90
+ m.value.set(a.value ?? a.label, a);
91
+ });
92
+ } catch (i) {
93
+ console.error("[Dropdown] Hydration failed:", i);
94
+ } finally {
95
+ C.value = !1;
96
+ }
97
+ }
98
+ }, p = v(() => {
99
+ const e = [...f.value], t = new Set(e.map((n) => n.value ?? n.label));
100
+ return m.value.forEach((n, i) => {
101
+ t.has(i) || (e.unshift(n), t.add(i));
102
+ }), e;
103
+ }), { getAllRecursiveIds: j } = le(), z = J({
104
+ ...K(l),
105
+ options: p
106
+ }), { currentValue: B, selectedLabel: T, selectOption: D } = ae(
107
+ z,
108
+ y
109
+ );
110
+ w(
111
+ () => B.value,
112
+ (e) => {
113
+ V(e);
114
+ },
115
+ { immediate: !0, deep: !0 }
116
+ );
117
+ const E = v(() => {
118
+ const e = l.ignoreClickOutside || [], t = j(p.value);
119
+ return [.../* @__PURE__ */ new Set([...e, ...t])];
120
+ }), R = (e) => {
121
+ l.doubleConfirmation || !!e.confirmation ? (d.value = e, typeof e.confirmation == "object" ? s.value = {
87
122
  title: e.confirmation.title || "Confirm Selection",
88
123
  description: e.confirmation.description || "Are you sure you want to select this option?",
89
124
  confirmText: e.confirmation.confirmText || "Confirm",
90
125
  cancelText: e.confirmation.cancelText || "Cancel",
91
126
  variant: e.confirmation.variant || "primary"
92
- } : a.value = {
127
+ } : s.value = {
93
128
  title: "Confirm Selection",
94
129
  description: `Are you sure you want to select "${e.label}"?`,
95
130
  confirmText: "Confirm",
96
131
  cancelText: "Cancel",
97
132
  variant: "primary"
98
- }, m.value = !0, p()) : (b(e), l.closeOnSelect && p());
99
- }, b = (e) => {
100
- M(e);
101
- }, A = () => {
102
- u.value && (b(u.value), u.value = null, m.value = !1);
103
- }, V = () => {
104
- u.value = null, m.value = !1;
105
- }, p = () => {
106
- O(!1);
133
+ }, h.value = !0, S()) : (P(e), l.closeOnSelect && S());
134
+ }, P = (e) => {
135
+ const t = e.value ?? e.label;
136
+ m.value.has(t) || m.value.set(t, e), D(e);
137
+ }, F = () => {
138
+ d.value && (P(d.value), d.value = null, h.value = !1);
139
+ }, U = () => {
140
+ d.value = null, h.value = !1;
141
+ }, S = () => {
142
+ k(!1);
107
143
  };
108
- return (e, n) => (k(), j("div", {
144
+ return (e, t) => (N(), Q("div", {
109
145
  class: "relative inline-block text-left",
110
- style: E({ direction: t.direction })
146
+ style: W({ direction: o.direction })
111
147
  }, [
112
- h(v(J), {
148
+ $(g(ee), {
113
149
  content: "",
114
150
  trigger: "click",
115
151
  arrow: !1,
116
- teleport: t.teleport,
117
- offset: t.offset,
118
- placement: I.value,
119
- isOpen: y.value,
120
- menuId: t.menuId,
121
- ignoreClickOutside: H.value,
152
+ teleport: o.teleport,
153
+ offset: o.offset,
154
+ placement: A.value,
155
+ isOpen: b.value,
156
+ menuId: o.menuId,
157
+ ignoreClickOutside: E.value,
122
158
  class: "w-full",
123
- className: "dropdown " + (t.className || ""),
124
- onOnShow: n[2] || (n[2] = (o) => e.$emit("onOpen")),
125
- onOnHide: n[3] || (n[3] = (o) => e.$emit("onClose")),
126
- "onUpdate:isOpen": O,
159
+ className: "dropdown " + (o.className || ""),
160
+ onOnShow: t[2] || (t[2] = (n) => e.$emit("onOpen")),
161
+ onOnHide: t[3] || (t[3] = (n) => e.$emit("onClose")),
162
+ "onUpdate:isOpen": k,
127
163
  triggerClass: "w-full",
128
164
  styles: { padding: "0" }
129
165
  }, {
130
- trigger: r(({ isOpen: o }) => [
131
- c(e.$slots, "trigger", S(w({ selectedLabel: v(g), isOpen: o })), () => [
132
- h(Q, {
133
- "selected-label": v(g),
134
- "is-open": o,
135
- direction: t.direction,
166
+ trigger: c(({ isOpen: n }) => [
167
+ u(e.$slots, "trigger", x(H({ selectedLabel: g(T), isOpen: n })), () => [
168
+ $(ne, {
169
+ "selected-label": g(T),
170
+ "is-open": n,
171
+ direction: o.direction,
172
+ triggerProps: o.triggerProps,
136
173
  class: "w-full"
137
- }, null, 8, ["selected-label", "is-open", "direction"])
174
+ }, null, 8, ["selected-label", "is-open", "direction", "triggerProps"])
138
175
  ])
139
176
  ]),
140
- default: r(() => [
141
- c(e.$slots, "default"),
142
- t.options?.length || s.value.length || e.$slots.menu || e.$slots.item || t.remote || t.searchable ? (k(), U(K, {
177
+ default: c(() => [
178
+ u(e.$slots, "default"),
179
+ O.value.length || p.value.length || e.$slots.menu || e.$slots.item || o.remote || o.searchable ? (N(), X(te, {
143
180
  key: 0,
144
- options: t.options,
145
- cachedOptions: s.value,
146
- class: q(t.className),
147
- selected: v(x),
148
- selectedIndex: t.selectedIndex,
149
- maxHeight: t.maxHeight,
150
- nestedPosition: T.value,
151
- nestedOffset: t.nestedOffset,
152
- selectable: t.selectable,
153
- direction: t.direction,
154
- layout: t.layout,
155
- columns: t.columns,
156
- loading: t.loading,
157
- hasMore: t.hasMore,
158
- searchable: t.searchable,
159
- remote: t.remote,
160
- onSelect: L,
161
- onClose: p,
162
- onLoadMore: n[0] || (n[0] = (o) => e.$emit("load-more")),
163
- onSearch: n[1] || (n[1] = (o) => e.$emit("search", o))
164
- }, F({ _: 2 }, [
181
+ options: O.value,
182
+ cachedOptions: p.value,
183
+ class: Y(o.className),
184
+ selected: g(B),
185
+ selectedIndex: o.selectedIndex,
186
+ maxHeight: o.maxHeight,
187
+ nestedPosition: L.value,
188
+ nestedOffset: o.nestedOffset,
189
+ selectable: o.selectable,
190
+ direction: o.direction,
191
+ layout: o.layout,
192
+ columns: o.columns,
193
+ loading: o.loading || C.value,
194
+ hasMore: o.hasMore,
195
+ searchable: o.searchable,
196
+ remote: o.remote,
197
+ debounceTime: o.debounceTime,
198
+ onSelect: R,
199
+ onClose: S,
200
+ onLoadMore: t[0] || (t[0] = (n) => e.$emit("load-more")),
201
+ onSearch: t[1] || (t[1] = (n) => e.$emit("search", n))
202
+ }, Z({ _: 2 }, [
165
203
  e.$slots.menu ? {
166
204
  name: "menu",
167
- fn: r(() => [
168
- c(e.$slots, "menu")
205
+ fn: c(() => [
206
+ u(e.$slots, "menu")
169
207
  ]),
170
208
  key: "0"
171
209
  } : void 0,
172
210
  e.$slots.item ? {
173
211
  name: "item",
174
- fn: r((o) => [
175
- c(e.$slots, "item", S(w(o)))
212
+ fn: c((n) => [
213
+ u(e.$slots, "item", x(H(n)))
176
214
  ]),
177
215
  key: "1"
178
216
  } : void 0,
179
217
  e.$slots.header ? {
180
218
  name: "header",
181
- fn: r(() => [
182
- c(e.$slots, "header")
219
+ fn: c(() => [
220
+ u(e.$slots, "header")
183
221
  ]),
184
222
  key: "2"
185
223
  } : void 0,
186
224
  e.$slots.footer ? {
187
225
  name: "footer",
188
- fn: r(() => [
189
- c(e.$slots, "footer")
226
+ fn: c(() => [
227
+ u(e.$slots, "footer")
190
228
  ]),
191
229
  key: "3"
192
230
  } : void 0
193
- ]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote"])) : G("", !0)
231
+ ]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : _("", !0)
194
232
  ]),
195
233
  _: 3
196
234
  }, 8, ["teleport", "offset", "placement", "isOpen", "menuId", "ignoreClickOutside", "className"]),
197
- h(W, {
198
- show: m.value,
199
- title: a.value.title,
200
- description: a.value.description,
201
- "confirm-text": a.value.confirmText,
202
- "cancel-text": a.value.cancelText,
203
- variant: a.value.variant,
204
- onConfirm: A,
205
- onCancel: V
235
+ $(oe, {
236
+ show: h.value,
237
+ title: s.value.title,
238
+ description: s.value.description,
239
+ "confirm-text": s.value.confirmText,
240
+ "cancel-text": s.value.cancelText,
241
+ variant: s.value.variant,
242
+ onConfirm: F,
243
+ onCancel: U
206
244
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
207
245
  ], 4));
208
246
  }
209
247
  });
210
248
  export {
211
- se as default
249
+ ve as default
212
250
  };