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
@@ -4,11 +4,11 @@ type __VLS_Props = {
4
4
  type?: 'modal' | 'dropdown';
5
5
  };
6
6
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
7
- "update:modelValue": (val: Record<string, any>) => any;
8
7
  change: (val: Record<string, any>) => any;
8
+ "update:modelValue": (val: Record<string, any>) => any;
9
9
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- "onUpdate:modelValue"?: (val: Record<string, any>) => any;
11
10
  onChange?: (val: Record<string, any>) => any;
11
+ "onUpdate:modelValue"?: (val: Record<string, any>) => any;
12
12
  }>, {
13
13
  type: "modal" | "dropdown";
14
14
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,7 +1,7 @@
1
- import { defineComponent as $, ref as S, computed as p, openBlock as o, createBlock as a, withCtx as r, createElementVNode as l, createVNode as n, unref as w, toDisplayString as v, withModifiers as F } from "vue";
1
+ import { defineComponent as $, ref as M, computed as p, openBlock as o, createBlock as a, withCtx as r, createElementVNode as l, createVNode as n, unref as w, toDisplayString as v, withModifiers as F } from "vue";
2
2
  import f from "../Button.vue.js";
3
- import j from "../Modal.vue.js";
4
- import z from "../Dropdown/Dropdown.vue.js";
3
+ import S from "../Modal.vue.js";
4
+ import j from "../Dropdown/Dropdown.vue.js";
5
5
  import h from "../Icon.vue.js";
6
6
  import { $t as x } from "../../utils/i18n.js";
7
7
  import C from "../Form/Form.vue.js";
@@ -16,7 +16,7 @@ import "iconify-icon-picker/style.css";
16
16
  /* empty css */
17
17
  /* empty css */
18
18
  import "../../core/config.js";
19
- const B = { class: "" }, M = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-[85vh] overflow-y-auto bg-card rounded-md border border-border shadow-lg text-left" }, X = /* @__PURE__ */ $({
19
+ const z = { class: "" }, B = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-[85vh] overflow-y-auto bg-card rounded-md border border-border shadow-lg text-left" }, X = /* @__PURE__ */ $({
20
20
  __name: "ScreenFilter",
21
21
  props: {
22
22
  schema: {},
@@ -25,7 +25,7 @@ const B = { class: "" }, M = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
25
25
  },
26
26
  emits: ["update:modelValue", "change"],
27
27
  setup(i, { emit: O }) {
28
- const u = i, m = O, s = S(!1), d = p(() => u.modelValue ? Object.keys(u.modelValue).filter(
28
+ const u = i, m = O, s = M(!1), d = p(() => u.modelValue ? Object.keys(u.modelValue).filter(
29
29
  (e) => u.modelValue[e] !== "" && u.modelValue[e] !== null && u.modelValue[e] !== void 0
30
30
  ).length : 0), k = (e) => {
31
31
  m("update:modelValue", e.values), m("change", e.values), s.value = !1;
@@ -41,7 +41,7 @@ const B = { class: "" }, M = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
41
41
  const e = x("vlite.screen.filter");
42
42
  return e !== "vlite.screen.filter" ? e : "Filter";
43
43
  });
44
- return (e, t) => i.type === "modal" ? (o(), a(j, {
44
+ return (e, t) => i.type === "modal" ? (o(), a(S, {
45
45
  key: 0,
46
46
  title: g.value,
47
47
  show: s.value,
@@ -104,7 +104,7 @@ const B = { class: "" }, M = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
104
104
  }, 8, ["title"]))
105
105
  ]),
106
106
  default: r(() => [
107
- l("div", B, [
107
+ l("div", z, [
108
108
  n(w(C), {
109
109
  schema: i.schema,
110
110
  values: i.modelValue,
@@ -114,7 +114,7 @@ const B = { class: "" }, M = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
114
114
  ])
115
115
  ]),
116
116
  _: 1
117
- }, 8, ["title", "show"])) : (o(), a(w(z), {
117
+ }, 8, ["title", "show"])) : (o(), a(w(j), {
118
118
  key: 1,
119
119
  isOpen: s.value,
120
120
  "onUpdate:isOpen": t[3] || (t[3] = (c) => s.value = c),
@@ -156,7 +156,7 @@ const B = { class: "" }, M = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
156
156
  }, null, 8, ["title"]))
157
157
  ]),
158
158
  default: r(() => [
159
- l("div", M, [
159
+ l("div", B, [
160
160
  n(w(C), {
161
161
  schema: i.schema,
162
162
  values: i.modelValue,
@@ -2,6 +2,8 @@ import { Component } from 'vue';
2
2
  import { PageInfo, PaginationProps } from '../Pagination';
3
3
  import { ButtonVariant } from '../../types';
4
4
  import { IForm } from '../Form';
5
+ import { ExportField } from '../ExportData/types';
6
+ import { ImportField } from '../ImportData/types';
5
7
  export interface ScreenPaginationProps extends Omit<PaginationProps, 'currentPage' | 'totalPages'> {
6
8
  }
7
9
  export interface AddBtnConfig {
@@ -23,6 +25,8 @@ export interface ScreenProps {
23
25
  titleI18n?: string;
24
26
  description?: string;
25
27
  descriptionI18n?: string;
28
+ info?: string;
29
+ infoI18n?: string;
26
30
  pageInfo?: PageInfo;
27
31
  data?: any[];
28
32
  loading?: boolean;
@@ -46,6 +50,14 @@ export interface ScreenProps {
46
50
  emptyIcon?: string;
47
51
  addComponent?: Component | any;
48
52
  addBtn?: AddBtnConfig;
53
+ /** Generic properties for Export and Import capabilities */
54
+ exportSchema?: ExportField[] | any[];
55
+ importSchema?: ImportField[] | any[];
56
+ exportProps?: Record<string, any> | boolean;
57
+ importProps?: Record<string, any> | boolean;
58
+ exportMode?: 'frontend' | 'backend';
59
+ importType?: string;
60
+ exportType?: string;
49
61
  list?: Component | any;
50
62
  table?: Component | any;
51
63
  customHeader?: boolean;
@@ -50,14 +50,14 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
50
50
  onOnAfterOpen?: () => any;
51
51
  onOnAfterClose?: () => any;
52
52
  }>, {
53
- class: string;
54
53
  size: SidePanelSize;
55
- triggerClass: string;
54
+ class: string;
56
55
  headerClass: string;
57
56
  position: SidePanelPosition;
58
57
  show: boolean;
59
58
  closeOutside: boolean;
60
59
  backdrop: boolean;
60
+ triggerClass: string;
61
61
  bodyClass: string;
62
62
  footerClass: string;
63
63
  hideCloseButton: boolean;
@@ -1,11 +1,24 @@
1
1
  import { SidebarMenuProps, SidebarMenuItemSchema } from './types';
2
2
  declare const _default: import('vue').DefineComponent<SidebarMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SidebarMenuProps> & Readonly<{}>, {
3
3
  variant: "default" | "ghost";
4
+ compact: boolean;
4
5
  items: SidebarMenuItemSchema[];
6
+ iconSize: string;
7
+ mobileBreakpoint: "sm" | "md" | "lg" | "xl" | "none";
8
+ orientation: "vertical" | "horizontal";
5
9
  allowMultiple: boolean;
6
- compact: boolean;
10
+ menuOffset: [number, number];
7
11
  indentSize: number;
8
12
  defaultExpanded: string[];
9
13
  showCompactLabels: boolean;
10
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
14
+ renderMode: "tree" | "popover";
15
+ compactIconSize: string;
16
+ labelClass: string;
17
+ compactLabelClass: string;
18
+ itemPadding: string;
19
+ compactItemPadding: string;
20
+ nestedMenuWidth: string;
21
+ nestedMenuMaxHeight: string;
22
+ showTooltip: boolean;
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
11
24
  export default _default;
@@ -1,12 +1,9 @@
1
- import { defineComponent as y, ref as v, watch as h, reactive as E, computed as r, provide as _, openBlock as f, createElementBlock as x, Fragment as w, renderList as M, createBlock as B } from "vue";
2
- import { useRoute as S } from "vue-router";
3
- import k from "./SidebarMenuItem.vue.js";
1
+ import { defineComponent as S, inject as I, ref as w, computed as n, watch as h, reactive as E, provide as N, openBlock as g, createElementBlock as y, normalizeClass as L, Fragment as P, renderList as A, createBlock as O } from "vue";
2
+ import { useRoute as F } from "vue-router";
3
+ import { useBreakpoints as W, breakpointsTailwind as H } from "@vueuse/core";
4
+ import D from "./SidebarMenuItem.vue.js";
4
5
  /* empty css */
5
- const C = {
6
- class: "flex flex-col space-y-1 w-full",
7
- role: "tree",
8
- "aria-label": "Sidebar Menu"
9
- }, W = /* @__PURE__ */ y({
6
+ const J = /* @__PURE__ */ S({
10
7
  __name: "SidebarMenu",
11
8
  props: {
12
9
  items: { default: () => [] },
@@ -15,64 +12,137 @@ const C = {
15
12
  variant: { default: "default" },
16
13
  defaultExpanded: { default: () => [] },
17
14
  compact: { type: Boolean, default: !1 },
18
- renderMode: {},
19
- showCompactLabels: { type: Boolean, default: !1 }
15
+ showCompactLabels: { type: Boolean, default: !1 },
16
+ renderMode: { default: "tree" },
17
+ iconSize: { default: "16px" },
18
+ compactIconSize: { default: "20px" },
19
+ labelClass: { default: "text-sm" },
20
+ compactLabelClass: { default: "text-[11.5px] mt-1" },
21
+ itemPadding: { default: "py-2 px-2" },
22
+ compactItemPadding: { default: "py-2 px-1" },
23
+ nestedMenuWidth: { default: "220px" },
24
+ nestedMenuMaxHeight: { default: "300px" },
25
+ itemClass: {},
26
+ menuOffset: { default: () => [0, 10] },
27
+ orientation: { default: "vertical" },
28
+ mobileBreakpoint: { default: "none" },
29
+ showTooltip: { type: Boolean, default: !0 }
20
30
  },
21
- setup(p) {
22
- const a = p, u = S(), l = v([...a.defaultExpanded]), i = v(null), b = (e, o) => {
23
- if (i.value === e.id) return !0;
24
- if (e.to) {
25
- const t = typeof e.to == "string" ? e.to : e.to.path;
26
- if (t && (o === t || o.startsWith(t) && t !== "/" && t.length > 1))
31
+ setup(m) {
32
+ const d = I("navbar-context", null), t = m, c = F(), T = W(H), u = w([...t.defaultExpanded]), i = w(null), k = n(() => !t.mobileBreakpoint || t.mobileBreakpoint === "none" ? !0 : T.greaterOrEqual(t.mobileBreakpoint).value), v = n(() => k.value && t.orientation || "vertical"), M = (l, s) => {
33
+ if (i.value === l.id) return !0;
34
+ if (l.to) {
35
+ const a = typeof l.to == "string" ? l.to : l.to.path;
36
+ if (a && (s === a || s.startsWith(a) && a !== "/" && a.length > 1))
27
37
  return !0;
28
38
  }
29
39
  return !1;
30
- }, s = (e, o, t = []) => {
31
- let c = !1;
32
- for (const n of e) {
33
- const m = n.id || (typeof n.to == "string" ? n.to : null) || n.label;
34
- b(n, o) && (i.value = m, t.forEach((d) => {
35
- l.value.includes(d) || l.value.push(d);
36
- }), c = !0), n.children && s(n.children, o, [...t, m]) && (c = !0);
40
+ }, b = (l, s, a = []) => {
41
+ let r = !1;
42
+ for (const e of l) {
43
+ const o = e.id || (typeof e.to == "string" ? e.to : null) || e.label;
44
+ let f = !1;
45
+ e.children && (f = b(e.children, s, [...a, o]), f && (r = !0));
46
+ const p = M(e, s), z = f && d?.renderNestedTabs?.value && a.length === 0;
47
+ (p || z) && (i.value = o, a.forEach((C) => {
48
+ u.value.includes(C) || u.value.push(C);
49
+ }), r = !0);
37
50
  }
38
- return c;
51
+ return r;
52
+ }, x = (l) => {
53
+ if (!d?.renderNestedTabs?.value) return;
54
+ const s = t.items.find((a) => i.value === (a.id || a.label || a.to) ? !0 : a.children?.some((e) => i.value === (e.id || e.label || e.to) || e.children && e.children.some(
55
+ (o) => i.value === (o.id || o.label || o.to)
56
+ )) || M(a, l));
57
+ if (s && s.children) {
58
+ const a = s.children.map((e) => ({
59
+ label: e.label,
60
+ labelI18n: e.labelI18n,
61
+ value: e.id || (typeof e.to == "string" ? e.to : null) || e.label,
62
+ icon: e.icon,
63
+ disabled: e.disabled,
64
+ to: e.to,
65
+ href: e.href
66
+ }));
67
+ let r = a[0].value;
68
+ if (i.value) {
69
+ const e = a.find((o) => o.value === i.value);
70
+ if (e)
71
+ r = e.value;
72
+ else {
73
+ const o = s.children.find((f) => f.children?.some(
74
+ (p) => (p.id || p.label || p.to) === i.value
75
+ ));
76
+ o && (r = o.id || (typeof o.to == "string" ? o.to : null) || o.label);
77
+ }
78
+ }
79
+ d.setNestedTabs(a, r);
80
+ } else
81
+ t.items.some(
82
+ (r) => r.children?.some((e) => (e.id || e.label || e.to) === i.value)
83
+ ) || d.setNestedTabs([], "");
39
84
  };
40
85
  h(
41
- () => u?.path,
42
- (e) => {
43
- e && s(a.items, e);
86
+ () => c?.path,
87
+ (l) => {
88
+ l && (b(t.items, l), x(l));
44
89
  },
45
90
  { immediate: !0 }
46
91
  ), h(
47
- () => a.items,
92
+ () => t.items,
48
93
  () => {
49
- u?.path && s(a.items, u.path);
94
+ c?.path && (b(t.items, c.path), x(c.path));
50
95
  },
51
96
  { deep: !0 }
97
+ ), h(
98
+ () => i.value,
99
+ () => {
100
+ d?.renderNestedTabs?.value && x(c?.path || "");
101
+ }
52
102
  );
53
- const g = E({
103
+ const B = E({
54
104
  activeItem: i,
55
- expandedItems: l,
56
- toggleExpand: (e) => {
57
- l.value.includes(e) ? l.value = l.value.filter((t) => t !== e) : (a.allowMultiple, l.value.push(e));
105
+ expandedItems: u,
106
+ toggleExpand: (l) => {
107
+ u.value.includes(l) ? u.value = u.value.filter((a) => a !== l) : t.allowMultiple ? u.value.push(l) : u.value = [l];
58
108
  },
59
- setActive: (e) => {
60
- i.value = e;
109
+ setActive: (l) => {
110
+ i.value = l;
61
111
  },
62
- indentSize: r(() => a.indentSize),
63
- variant: r(() => a.variant),
64
- renderMode: r(() => a.renderMode || "tree"),
65
- compact: r(() => a.compact),
66
- showCompactLabels: r(() => a.showCompactLabels)
112
+ indentSize: n(() => t.indentSize),
113
+ variant: n(() => t.variant),
114
+ renderMode: n(() => t.renderMode || "tree"),
115
+ renderNestedTabs: n(() => !!d?.renderNestedTabs?.value),
116
+ compact: n(() => t.compact),
117
+ showCompactLabels: n(() => t.showCompactLabels),
118
+ iconSize: n(() => t.iconSize),
119
+ compactIconSize: n(() => t.compactIconSize),
120
+ labelClass: n(() => t.labelClass),
121
+ compactLabelClass: n(() => t.compactLabelClass),
122
+ itemPadding: n(() => t.itemPadding),
123
+ compactItemPadding: n(() => t.compactItemPadding),
124
+ nestedMenuWidth: n(() => t.nestedMenuWidth),
125
+ nestedMenuMaxHeight: n(() => t.nestedMenuMaxHeight),
126
+ currentOrientation: v,
127
+ showTooltip: n(() => t.showTooltip)
67
128
  });
68
- return _("sidebar-menu-ctx", g), (e, o) => (f(), x("nav", C, [
69
- (f(!0), x(w, null, M(p.items, (t) => (f(), B(k, {
70
- key: t.id || t.label,
71
- item: t
72
- }, null, 8, ["item"]))), 128))
73
- ]));
129
+ return N("sidebar-menu-ctx", B), (l, s) => (g(), y("nav", {
130
+ class: L(["flex w-full transition-all duration-300", [
131
+ v.value === "horizontal" ? "flex-row flex-wrap gap-2 items-center" : "flex-col",
132
+ v.value === "vertical" && !t.compact ? "space-y-1" : ""
133
+ ]]),
134
+ role: "tree",
135
+ "aria-label": "Sidebar Menu"
136
+ }, [
137
+ (g(!0), y(P, null, A(m.items, (a) => (g(), O(D, {
138
+ key: a.id || a.label,
139
+ item: a,
140
+ itemClass: m.itemClass,
141
+ menuOffset: m.menuOffset
142
+ }, null, 8, ["item", "itemClass", "menuOffset"]))), 128))
143
+ ], 2));
74
144
  }
75
145
  });
76
146
  export {
77
- W as default
147
+ J as default
78
148
  };
@@ -2,6 +2,8 @@ import { SidebarMenuItemSchema } from './types';
2
2
  interface Props {
3
3
  item: SidebarMenuItemSchema;
4
4
  depth?: number;
5
+ menuOffset?: [number, number];
6
+ itemClass?: string;
5
7
  }
6
8
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
7
9
  depth: number;