@itguy614/clean-ui 0.9.0 → 1.0.1

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/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/clean-ui.css +1 -1
  3. package/dist/components/CuiAccordion.vue.js +7 -0
  4. package/dist/components/CuiAccordion.vue2.js +55 -0
  5. package/dist/components/CuiAccordionItem.vue.js +7 -0
  6. package/dist/components/CuiAccordionItem.vue2.js +91 -0
  7. package/dist/components/CuiAlert.vue.d.ts.map +1 -1
  8. package/dist/components/CuiAlert.vue.js +7 -0
  9. package/dist/components/CuiAlert.vue2.js +113 -0
  10. package/dist/components/CuiAvatar.vue.js +99 -0
  11. package/dist/components/CuiAvatar.vue3.js +5 -0
  12. package/dist/components/CuiAvatarGroup.vue.js +22 -0
  13. package/dist/components/CuiAvatarGroup.vue3.js +5 -0
  14. package/dist/components/CuiBackdrop.vue.js +7 -0
  15. package/dist/components/CuiBackdrop.vue2.js +49 -0
  16. package/dist/components/CuiBadge.vue.d.ts.map +1 -1
  17. package/dist/components/CuiBadge.vue.js +7 -0
  18. package/dist/components/CuiBadge.vue2.js +82 -0
  19. package/dist/components/CuiBanner.vue.js +81 -0
  20. package/dist/components/CuiBanner.vue2.js +4 -0
  21. package/dist/components/CuiBreadcrumb.vue.js +7 -0
  22. package/dist/components/CuiBreadcrumb.vue2.js +29 -0
  23. package/dist/components/CuiBreadcrumbItem.vue.js +7 -0
  24. package/dist/components/CuiBreadcrumbItem.vue2.js +46 -0
  25. package/dist/components/CuiButton.vue.d.ts.map +1 -1
  26. package/dist/components/CuiButton.vue.js +7 -0
  27. package/dist/components/CuiButton.vue2.js +136 -0
  28. package/dist/components/CuiButtonGroup.vue.js +7 -0
  29. package/dist/components/CuiButtonGroup.vue2.js +21 -0
  30. package/dist/components/CuiCard.vue.js +35 -0
  31. package/dist/components/CuiCard.vue2.js +4 -0
  32. package/dist/components/CuiCardBody.vue.js +20 -0
  33. package/dist/components/CuiCardBody.vue2.js +4 -0
  34. package/dist/components/CuiCardFooter.vue.js +32 -0
  35. package/dist/components/CuiCardFooter.vue2.js +4 -0
  36. package/dist/components/CuiCardHeader.vue.js +51 -0
  37. package/dist/components/CuiCardHeader.vue2.js +4 -0
  38. package/dist/components/CuiCardMedia.vue.js +7 -0
  39. package/dist/components/CuiCardMedia.vue2.js +38 -0
  40. package/dist/components/CuiCheckbox.vue.js +7 -0
  41. package/dist/components/CuiCheckbox.vue2.js +105 -0
  42. package/dist/components/CuiCheckboxGroup.vue.js +7 -0
  43. package/dist/components/CuiCheckboxGroup.vue2.js +59 -0
  44. package/dist/components/CuiCodeBlock.vue.js +129 -0
  45. package/dist/components/CuiCodeBlock.vue2.js +4 -0
  46. package/dist/components/CuiColorPicker.vue.js +348 -0
  47. package/dist/components/CuiColorPicker.vue2.js +4 -0
  48. package/dist/components/CuiCombobox.vue.js +332 -0
  49. package/dist/components/CuiCombobox.vue2.js +4 -0
  50. package/dist/components/CuiConfigProvider.vue.js +18 -0
  51. package/dist/components/CuiConfigProvider.vue2.js +4 -0
  52. package/dist/components/CuiConfirmDialog.vue.js +208 -0
  53. package/dist/components/CuiConfirmDialog.vue2.js +4 -0
  54. package/dist/components/CuiContainer.vue.js +35 -0
  55. package/dist/components/CuiContainer.vue2.js +4 -0
  56. package/dist/components/CuiContextMenu.vue.js +7 -0
  57. package/dist/components/CuiContextMenu.vue2.js +136 -0
  58. package/dist/components/CuiCopyButton.vue.js +63 -0
  59. package/dist/components/CuiCopyButton.vue2.js +4 -0
  60. package/dist/components/CuiDataGrid.vue.d.ts +53 -79
  61. package/dist/components/CuiDataGrid.vue.d.ts.map +1 -1
  62. package/dist/components/CuiDataGrid.vue.js +178 -0
  63. package/dist/components/CuiDataGrid.vue3.js +5 -0
  64. package/dist/components/CuiDataGridActiveFilters.vue.js +47 -0
  65. package/dist/components/CuiDataGridActiveFilters.vue3.js +5 -0
  66. package/dist/components/CuiDataGridBulkBar.vue.d.ts.map +1 -1
  67. package/dist/components/CuiDataGridBulkBar.vue.js +70 -0
  68. package/dist/components/CuiDataGridBulkBar.vue3.js +5 -0
  69. package/dist/components/CuiDataGridCardView.vue.js +31 -0
  70. package/dist/components/CuiDataGridCardView.vue2.js +4 -0
  71. package/dist/components/CuiDataGridColumnManager.vue.js +86 -0
  72. package/dist/components/CuiDataGridColumnManager.vue2.js +4 -0
  73. package/dist/components/CuiDataGridFilterPanel.vue.js +181 -0
  74. package/dist/components/CuiDataGridFilterPanel.vue3.js +5 -0
  75. package/dist/components/CuiDataGridPagination.vue.js +28 -0
  76. package/dist/components/CuiDataGridPagination.vue2.js +4 -0
  77. package/dist/components/CuiDataGridSearch.vue.js +69 -0
  78. package/dist/components/CuiDataGridSearch.vue2.js +4 -0
  79. package/dist/components/CuiDataGridTable.vue.js +336 -0
  80. package/dist/components/CuiDataGridTable.vue2.js +4 -0
  81. package/dist/components/CuiDataGridToolbar.vue.js +73 -0
  82. package/dist/components/CuiDataGridToolbar.vue3.js +5 -0
  83. package/dist/components/CuiDataGridViewManager.vue.js +209 -0
  84. package/dist/components/CuiDataGridViewManager.vue2.js +4 -0
  85. package/dist/components/CuiDataGridViewToggle.vue.js +43 -0
  86. package/dist/components/CuiDataGridViewToggle.vue3.js +5 -0
  87. package/dist/components/CuiDatePicker.vue.js +382 -0
  88. package/dist/components/CuiDatePicker.vue2.js +4 -0
  89. package/dist/components/CuiDateRangePicker.vue.js +376 -0
  90. package/dist/components/CuiDateRangePicker.vue2.js +4 -0
  91. package/dist/components/CuiDivider.vue.js +124 -0
  92. package/dist/components/CuiDivider.vue2.js +4 -0
  93. package/dist/components/CuiDropdown.vue.js +7 -0
  94. package/dist/components/CuiDropdown.vue2.js +110 -0
  95. package/dist/components/CuiDropdownCheckItem.vue.js +7 -0
  96. package/dist/components/CuiDropdownCheckItem.vue2.js +45 -0
  97. package/dist/components/CuiDropdownDivider.vue.js +14 -0
  98. package/dist/components/CuiDropdownHeader.vue.js +16 -0
  99. package/dist/components/CuiDropdownItem.vue.js +7 -0
  100. package/dist/components/CuiDropdownItem.vue2.js +55 -0
  101. package/dist/components/CuiDropdownMenu.vue.js +7 -0
  102. package/dist/components/CuiDropdownMenu.vue2.js +79 -0
  103. package/dist/components/CuiDropdownRadioGroup.vue.js +23 -0
  104. package/dist/components/CuiDropdownRadioGroup.vue2.js +4 -0
  105. package/dist/components/CuiDropdownRadioItem.vue.js +7 -0
  106. package/dist/components/CuiDropdownRadioItem.vue2.js +43 -0
  107. package/dist/components/CuiDropdownSub.vue.js +7 -0
  108. package/dist/components/CuiDropdownSub.vue2.js +91 -0
  109. package/dist/components/CuiDropdownTrigger.vue.js +7 -0
  110. package/dist/components/CuiDropdownTrigger.vue2.js +25 -0
  111. package/dist/components/CuiEmptyState.vue.js +7 -0
  112. package/dist/components/CuiEmptyState.vue2.js +70 -0
  113. package/dist/components/CuiFieldset.vue.js +7 -0
  114. package/dist/components/CuiFieldset.vue2.js +79 -0
  115. package/dist/components/CuiFileUpload.vue.js +254 -0
  116. package/dist/components/CuiFileUpload.vue2.js +4 -0
  117. package/dist/components/CuiFlex.vue.js +7 -0
  118. package/dist/components/CuiFlex.vue2.js +72 -0
  119. package/dist/components/CuiFlexItem.vue.js +35 -0
  120. package/dist/components/CuiFlexItem.vue2.js +4 -0
  121. package/dist/components/CuiForm.vue.js +116 -0
  122. package/dist/components/CuiForm.vue2.js +4 -0
  123. package/dist/components/CuiFormField.vue.js +7 -0
  124. package/dist/components/CuiFormField.vue2.js +73 -0
  125. package/dist/components/CuiGrid.vue.js +7 -0
  126. package/dist/components/CuiGrid.vue2.js +51 -0
  127. package/dist/components/CuiGridItem.vue.js +30 -0
  128. package/dist/components/CuiGridItem.vue2.js +4 -0
  129. package/dist/components/CuiIcon.vue.js +7 -0
  130. package/dist/components/CuiIcon.vue2.js +72 -0
  131. package/dist/components/CuiInput.vue.d.ts +6 -6
  132. package/dist/components/CuiInput.vue.d.ts.map +1 -1
  133. package/dist/components/CuiInput.vue.js +7 -0
  134. package/dist/components/CuiInput.vue2.js +150 -0
  135. package/dist/components/CuiInputStepper.vue.js +189 -0
  136. package/dist/components/CuiInputStepper.vue2.js +4 -0
  137. package/dist/components/CuiKbd.vue.js +44 -0
  138. package/dist/components/CuiKbd.vue2.js +4 -0
  139. package/dist/components/CuiMaskedInput.vue.d.ts +8 -8
  140. package/dist/components/CuiMaskedInput.vue.js +256 -0
  141. package/dist/components/CuiMaskedInput.vue2.js +4 -0
  142. package/dist/components/CuiModal.vue.js +7 -0
  143. package/dist/components/CuiModal.vue2.js +98 -0
  144. package/dist/components/CuiModalBody.vue.js +50 -0
  145. package/dist/components/CuiModalBody.vue2.js +4 -0
  146. package/dist/components/CuiModalFooter.vue.js +36 -0
  147. package/dist/components/CuiModalFooter.vue2.js +4 -0
  148. package/dist/components/CuiModalHeader.vue.js +85 -0
  149. package/dist/components/CuiModalHeader.vue2.js +4 -0
  150. package/dist/components/CuiPagination.vue.js +7 -0
  151. package/dist/components/CuiPagination.vue2.js +136 -0
  152. package/dist/components/CuiPopover.vue.js +227 -0
  153. package/dist/components/CuiPopover.vue2.js +4 -0
  154. package/dist/components/CuiProgress.vue.js +7 -0
  155. package/dist/components/CuiProgress.vue2.js +132 -0
  156. package/dist/components/CuiRadio.vue.d.ts.map +1 -1
  157. package/dist/components/CuiRadio.vue.js +7 -0
  158. package/dist/components/CuiRadio.vue2.js +139 -0
  159. package/dist/components/CuiRadioGroup.vue.js +7 -0
  160. package/dist/components/CuiRadioGroup.vue2.js +78 -0
  161. package/dist/components/CuiRating.vue.js +129 -0
  162. package/dist/components/CuiRating.vue2.js +4 -0
  163. package/dist/components/CuiResizablePanels.vue.js +147 -0
  164. package/dist/components/CuiResizablePanels.vue2.js +4 -0
  165. package/dist/components/CuiSelect.vue.d.ts.map +1 -1
  166. package/dist/components/CuiSelect.vue.js +7 -0
  167. package/dist/components/CuiSelect.vue2.js +359 -0
  168. package/dist/components/CuiSkeleton.vue.js +7 -0
  169. package/dist/components/CuiSkeleton.vue2.js +80 -0
  170. package/dist/components/CuiSlideover.vue.js +109 -0
  171. package/dist/components/CuiSlideover.vue2.js +4 -0
  172. package/dist/components/CuiSlider.vue.js +156 -0
  173. package/dist/components/CuiSlider.vue2.js +4 -0
  174. package/dist/components/CuiSpacer.vue.js +32 -0
  175. package/dist/components/CuiSpacer.vue2.js +4 -0
  176. package/dist/components/CuiSpinner.vue.js +99 -0
  177. package/dist/components/CuiSpinner.vue3.js +5 -0
  178. package/dist/components/CuiStack.vue.js +30 -0
  179. package/dist/components/CuiStack.vue2.js +4 -0
  180. package/dist/components/CuiStepper.vue.js +153 -0
  181. package/dist/components/CuiStepper.vue2.js +4 -0
  182. package/dist/components/CuiTab.vue.js +7 -0
  183. package/dist/components/CuiTab.vue2.js +73 -0
  184. package/dist/components/CuiTable.vue.d.ts.map +1 -1
  185. package/dist/components/CuiTable.vue.js +90 -0
  186. package/dist/components/CuiTable.vue3.js +5 -0
  187. package/dist/components/CuiTableBody.vue.js +18 -0
  188. package/dist/components/CuiTableBody.vue2.js +4 -0
  189. package/dist/components/CuiTableCell.vue.js +36 -0
  190. package/dist/components/CuiTableCell.vue2.js +4 -0
  191. package/dist/components/CuiTableFoot.vue.js +18 -0
  192. package/dist/components/CuiTableFoot.vue2.js +4 -0
  193. package/dist/components/CuiTableHead.vue.js +18 -0
  194. package/dist/components/CuiTableHead.vue2.js +4 -0
  195. package/dist/components/CuiTableRow.vue.js +23 -0
  196. package/dist/components/CuiTableRow.vue2.js +4 -0
  197. package/dist/components/CuiTabs.vue.js +7 -0
  198. package/dist/components/CuiTabs.vue2.js +124 -0
  199. package/dist/components/CuiTagInput.vue.js +296 -0
  200. package/dist/components/CuiTagInput.vue2.js +4 -0
  201. package/dist/components/CuiTextarea.vue.js +7 -0
  202. package/dist/components/CuiTextarea.vue2.js +112 -0
  203. package/dist/components/CuiTimePicker.vue.js +193 -0
  204. package/dist/components/CuiTimePicker.vue2.js +4 -0
  205. package/dist/components/CuiTimeline.vue.js +25 -0
  206. package/dist/components/CuiTimeline.vue2.js +4 -0
  207. package/dist/components/CuiTimelineItem.vue.js +113 -0
  208. package/dist/components/CuiTimelineItem.vue2.js +4 -0
  209. package/dist/components/CuiToast.vue.js +7 -0
  210. package/dist/components/CuiToast.vue2.js +129 -0
  211. package/dist/components/CuiToastProvider.vue.js +7 -0
  212. package/dist/components/CuiToastProvider.vue2.js +87 -0
  213. package/dist/components/CuiToggle.vue.d.ts.map +1 -1
  214. package/dist/components/CuiToggle.vue.js +7 -0
  215. package/dist/components/CuiToggle.vue2.js +116 -0
  216. package/dist/components/CuiToggleGroup.vue.js +7 -0
  217. package/dist/components/CuiToggleGroup.vue2.js +59 -0
  218. package/dist/components/CuiTooltip.vue.js +7 -0
  219. package/dist/components/CuiTooltip.vue2.js +128 -0
  220. package/dist/components/CuiTransferList.vue.js +442 -0
  221. package/dist/components/CuiTransferList.vue2.js +4 -0
  222. package/dist/components/CuiTreeNode.vue.js +180 -0
  223. package/dist/components/CuiTreeNode.vue2.js +4 -0
  224. package/dist/components/CuiTreeView.vue.js +73 -0
  225. package/dist/components/CuiTreeView.vue2.js +4 -0
  226. package/dist/components/accordion-context.js +4 -0
  227. package/dist/components/breadcrumb-context.js +4 -0
  228. package/dist/components/config-context.js +4 -0
  229. package/dist/components/data-grid-context.js +4 -0
  230. package/dist/components/dropdown-context.js +30 -0
  231. package/dist/components/form-context.js +4 -0
  232. package/dist/components/multi-select-group-context.js +5 -0
  233. package/dist/components/radio-context.js +4 -0
  234. package/dist/components/table-context.js +5 -0
  235. package/dist/components/tabs-context.js +4 -0
  236. package/dist/components/toast-context.js +45 -0
  237. package/dist/composables/useBreakpoint.js +34 -0
  238. package/dist/composables/useClickOutside.js +14 -0
  239. package/dist/composables/useCopyToClipboard.js +25 -0
  240. package/dist/composables/useDataGrid.js +269 -0
  241. package/dist/composables/useDataGridInertia.js +35 -0
  242. package/dist/composables/useDataGridViews.js +67 -0
  243. package/dist/composables/useDensity.js +42 -0
  244. package/dist/composables/useLayoutContext.js +21 -0
  245. package/dist/composables/useMessages.js +10 -0
  246. package/dist/composables/useOverlay.d.ts.map +1 -1
  247. package/dist/composables/useOverlay.js +59 -0
  248. package/dist/composables/usePopover.js +53 -0
  249. package/dist/composables/useScrollShadows.js +56 -0
  250. package/dist/composables/useTheme.js +57 -0
  251. package/dist/composables/useToast.js +23 -0
  252. package/dist/composables/useVirtualScroll.js +69 -0
  253. package/dist/index.js +290 -0
  254. package/dist/messages.js +57 -0
  255. package/dist/ssr-theme-init.js +13 -0
  256. package/dist/utils/color.js +195 -0
  257. package/dist/utils/colorIconMap.js +11 -0
  258. package/dist/utils/date.js +114 -0
  259. package/dist/utils/devWarn.d.ts +15 -0
  260. package/dist/utils/devWarn.d.ts.map +1 -0
  261. package/dist/utils/devWarn.js +20 -0
  262. package/dist/utils/liveRegion.js +12 -0
  263. package/dist/utils/resolvers.js +28 -0
  264. package/dist/utils/responsive.js +68 -0
  265. package/dist/utils/sizing.js +39 -0
  266. package/package.json +8 -7
  267. package/dist/clean-ui.js +0 -11937
  268. package/dist/clean-ui.umd.cjs +0 -11
@@ -0,0 +1,136 @@
1
+ import { defineComponent as W, ref as f, onMounted as q, onUnmounted as z, provide as K, withDirectives as O, openBlock as y, createElementBlock as $, renderSlot as D, createBlock as I, Teleport as U, normalizeStyle as j, normalizeClass as N, createCommentVNode as P, vShow as V, nextTick as X } from "vue";
2
+ import { DropdownContextKey as Y } from "./dropdown-context.js";
3
+ const J = /* @__PURE__ */ W({
4
+ __name: "CuiContextMenu",
5
+ props: {
6
+ minWidth: { default: "12rem" },
7
+ hidden: { type: Boolean, default: !1 },
8
+ disabled: { type: Boolean, default: !1 }
9
+ },
10
+ setup(p, { expose: E }) {
11
+ const b = p, n = f(!1), s = f(!1), x = f(null), m = f(null), h = f({});
12
+ let i = null;
13
+ const k = `cui-ctx-${Math.random().toString(36).slice(2, 8)}`;
14
+ function v() {
15
+ b.disabled || (i && (clearTimeout(i), i = null), s.value = !1, n.value = !0);
16
+ }
17
+ function c() {
18
+ n.value && (s.value = !0, i = setTimeout(() => {
19
+ n.value = !1, s.value = !1;
20
+ }, 150));
21
+ }
22
+ function T() {
23
+ c();
24
+ }
25
+ function A(e, t) {
26
+ const o = window.innerWidth, u = window.innerHeight, l = 16, r = {
27
+ position: "fixed",
28
+ zIndex: "9990"
29
+ };
30
+ r.left = `${e}px`, r.top = `${t}px`, r.maxHeight = `${Math.min(u - t - l, 400)}px`, h.value = r, X(() => {
31
+ var M;
32
+ if (!m.value) return;
33
+ const d = m.value.getBoundingClientRect(), a = { ...r };
34
+ if (d.right > o - l && (a.left = `${Math.max(l, e - d.width)}px`), d.bottom > u - l) {
35
+ const L = Math.max(l, t - d.height);
36
+ a.top = `${L}px`, a.maxHeight = `${Math.min(t - l, 400)}px`;
37
+ }
38
+ h.value = a;
39
+ const w = (M = m.value) == null ? void 0 : M.querySelector(
40
+ '[role="menuitem"]:not([aria-disabled="true"])'
41
+ );
42
+ w == null || w.focus();
43
+ });
44
+ }
45
+ function B(e) {
46
+ b.disabled || (e.preventDefault(), n.value && (n.value = !1, s.value = !1, i && (clearTimeout(i), i = null)), A(e.clientX, e.clientY), v());
47
+ }
48
+ function _(e) {
49
+ var u, l, r, d;
50
+ if (!m.value) return;
51
+ if (e.key === "Escape") {
52
+ e.preventDefault(), e.stopPropagation(), c();
53
+ return;
54
+ }
55
+ const t = Array.from(m.value.querySelectorAll(
56
+ '[role="menuitem"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([aria-disabled="true"]), [role="menuitemradio"]:not([aria-disabled="true"])'
57
+ )), o = t.indexOf(document.activeElement);
58
+ if (e.key === "ArrowDown") {
59
+ e.preventDefault();
60
+ const a = o < t.length - 1 ? o + 1 : 0;
61
+ (u = t[a]) == null || u.focus();
62
+ } else if (e.key === "ArrowUp") {
63
+ e.preventDefault();
64
+ const a = o > 0 ? o - 1 : t.length - 1;
65
+ (l = t[a]) == null || l.focus();
66
+ } else e.key === "Home" ? (e.preventDefault(), (r = t[0]) == null || r.focus()) : e.key === "End" && (e.preventDefault(), (d = t[t.length - 1]) == null || d.focus());
67
+ }
68
+ function C(e) {
69
+ var u;
70
+ if (!n.value) return;
71
+ const t = e.target;
72
+ if ((u = x.value) != null && u.contains(t)) return;
73
+ const o = document.querySelector(`[data-cui-context-menu-id="${k}"]`);
74
+ o != null && o.contains(t) || c();
75
+ }
76
+ function S() {
77
+ n.value && c();
78
+ }
79
+ q(() => {
80
+ document.addEventListener("mousedown", C), window.addEventListener("scroll", S, !0);
81
+ }), z(() => {
82
+ document.removeEventListener("mousedown", C), window.removeEventListener("scroll", S, !0), i && clearTimeout(i);
83
+ });
84
+ const g = /* @__PURE__ */ new Set();
85
+ function R(e) {
86
+ return g.add(e), () => g.delete(e);
87
+ }
88
+ function H(e) {
89
+ for (const t of g)
90
+ t !== e && t();
91
+ }
92
+ return K(Y, {
93
+ isOpen: n,
94
+ isClosing: s,
95
+ trigger: f("click"),
96
+ triggerEl: x,
97
+ placement: f("bottom"),
98
+ open: v,
99
+ close: c,
100
+ toggle: () => {
101
+ n.value ? c() : v();
102
+ },
103
+ closeAll: T,
104
+ registerSubMenu: R,
105
+ closeSiblingSubMenus: H,
106
+ reposition: () => {
107
+ }
108
+ }), E({ open: v, close: c, isOpen: n }), (e, t) => O((y(), $("div", {
109
+ ref_key: "wrapperRef",
110
+ ref: x,
111
+ class: "cui-context-menu",
112
+ onContextmenu: B
113
+ }, [
114
+ D(e.$slots, "default", {}, void 0, !0),
115
+ (y(), I(U, { to: "body" }, [
116
+ n.value || s.value ? (y(), $("div", {
117
+ key: 0,
118
+ ref_key: "menuRef",
119
+ ref: m,
120
+ class: N(["cui-context-menu__panel", { "cui-context-menu__panel--closing": s.value }]),
121
+ "data-cui-context-menu-id": k,
122
+ style: j({ ...h.value, minWidth: p.minWidth }),
123
+ role: "menu",
124
+ onKeydown: _
125
+ }, [
126
+ D(e.$slots, "menu", {}, void 0, !0)
127
+ ], 38)) : P("", !0)
128
+ ]))
129
+ ], 544)), [
130
+ [V, !p.hidden]
131
+ ]);
132
+ }
133
+ });
134
+ export {
135
+ J as default
136
+ };
@@ -0,0 +1,63 @@
1
+ import { defineComponent as u, computed as p, withDirectives as f, openBlock as l, createBlock as y, unref as o, withCtx as i, createVNode as n, createElementBlock as C, toDisplayString as h, createCommentVNode as z, normalizeStyle as v, vShow as S } from "vue";
2
+ import { clampSize as x } from "../utils/sizing.js";
3
+ import B from "./CuiButton.vue.js";
4
+ import k from "./CuiIcon.vue.js";
5
+ import w from "./CuiTooltip.vue.js";
6
+ import { useCopyToClipboard as D } from "../composables/useCopyToClipboard.js";
7
+ const T = { key: 0 }, O = /* @__PURE__ */ u({
8
+ __name: "CuiCopyButton",
9
+ props: {
10
+ value: {},
11
+ variant: { default: "ghost" },
12
+ tooltip: { default: "Copy" },
13
+ copiedTooltip: { default: "Copied!" },
14
+ resetDelay: { default: 2e3 },
15
+ showLabel: { type: Boolean, default: !1 },
16
+ hidden: { type: Boolean, default: !1 },
17
+ color: { default: "primary" },
18
+ size: { default: "sm" }
19
+ },
20
+ setup(e) {
21
+ const r = ["xs", "sm", "md"], a = e, { copied: t, copy: c } = D(a.resetDelay);
22
+ function s() {
23
+ c(a.value);
24
+ }
25
+ const m = {
26
+ xs: "0.75rem",
27
+ sm: "0.875rem",
28
+ md: "1rem"
29
+ }, d = p(() => x(a.size, r));
30
+ return (b, E) => f((l(), y(w, {
31
+ text: o(t) ? e.copiedTooltip : e.tooltip,
32
+ placement: "top",
33
+ "show-delay": 300
34
+ }, {
35
+ default: i(() => [
36
+ n(B, {
37
+ size: e.size,
38
+ variant: e.variant,
39
+ color: o(t) ? "success" : e.color,
40
+ onClick: s
41
+ }, {
42
+ prefix: i(() => [
43
+ n(k, {
44
+ name: o(t) ? "check" : "copy",
45
+ size: m[d.value],
46
+ style: v({ transition: "transform 0.15s ease", transform: o(t) ? "scale(1.1)" : "scale(1)" })
47
+ }, null, 8, ["name", "size", "style"])
48
+ ]),
49
+ default: i(() => [
50
+ e.showLabel ? (l(), C("span", T, h(o(t) ? "Copied" : "Copy"), 1)) : z("", !0)
51
+ ]),
52
+ _: 1
53
+ }, 8, ["size", "variant", "color"])
54
+ ]),
55
+ _: 1
56
+ }, 8, ["text"])), [
57
+ [S, !e.hidden]
58
+ ]);
59
+ }
60
+ });
61
+ export {
62
+ O as default
63
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CuiCopyButton.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,11 +1,11 @@
1
1
  import type { DataGridColumn, DataGridRow, DataGridBulkAction, DataGridRowAction, DataGridQueryParams, DataGridViewConfig, DataGridViewAdapter, PaginatedData } from "../types/data-grid";
2
2
  import type { TableSize } from "./table-context";
3
3
  import type { HideableProps } from "../types/common";
4
- export interface CuiDataGridProps extends HideableProps {
4
+ export interface CuiDataGridProps<T extends object = DataGridRow> extends HideableProps {
5
5
  /** Column definitions */
6
6
  columns: DataGridColumn[];
7
- /** Data source — array for client-side, PaginatedData for server-side */
8
- data: DataGridRow[] | PaginatedData;
7
+ /** Data source — array for client-side, PaginatedData for server-side. Generic over the row type so cell slots, emits, and data are typed. */
8
+ data: T[] | PaginatedData<T>;
9
9
  /** Server-side mode — emits navigate events instead of processing locally */
10
10
  serverSide?: boolean;
11
11
  /** Row identifier key */
@@ -62,83 +62,57 @@ export interface CuiDataGridProps extends HideableProps {
62
62
  */
63
63
  virtualRowHeight?: number;
64
64
  }
65
- declare var __VLS_4: {}, __VLS_6: {}, __VLS_14: {}, __VLS_22: {
66
- row: DataGridRow;
67
- }, __VLS_33: `cell-${string}`, __VLS_34: {
68
- value: unknown;
69
- row: DataGridRow;
70
- };
71
- type __VLS_Slots = {} & {
72
- [K in NonNullable<typeof __VLS_33>]?: (props: typeof __VLS_34) => any;
73
- } & {
74
- 'toolbar-start'?: (props: typeof __VLS_4) => any;
75
- } & {
76
- 'toolbar-end'?: (props: typeof __VLS_6) => any;
77
- } & {
78
- empty?: (props: typeof __VLS_14) => any;
79
- } & {
80
- card?: (props: typeof __VLS_22) => any;
81
- };
82
- declare const __VLS_component: import("vue").DefineComponent<CuiDataGridProps, {
83
- clearSelection: () => void;
84
- getQueryParams: () => DataGridQueryParams;
85
- getConfig: () => DataGridViewConfig;
86
- loadConfig: (config: DataGridViewConfig) => void;
87
- resetToDefaults: () => void;
88
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
89
- "row-click": (payload: {
90
- row: DataGridRow;
91
- }) => any;
92
- "row-action": (payload: {
93
- action: DataGridRowAction;
94
- row: DataGridRow;
95
- }) => any;
96
- navigate: (params: DataGridQueryParams) => any;
97
- "bulk-action": (payload: {
98
- action: DataGridBulkAction;
99
- rows: DataGridRow[];
100
- }) => any;
101
- "selection-change": (selectedIds: string[]) => any;
102
- }, string, import("vue").PublicProps, Readonly<CuiDataGridProps> & Readonly<{
103
- "onRow-click"?: ((payload: {
104
- row: DataGridRow;
105
- }) => any) | undefined;
106
- "onRow-action"?: ((payload: {
65
+ declare const _default: <T extends object = DataGridRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
66
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
67
+ readonly "onRow-click"?: ((payload: {
68
+ row: T;
69
+ }) => any) | undefined;
70
+ readonly "onRow-action"?: ((payload: {
71
+ action: DataGridRowAction;
72
+ row: T;
73
+ }) => any) | undefined;
74
+ readonly onNavigate?: ((params: DataGridQueryParams) => any) | undefined;
75
+ readonly "onBulk-action"?: ((payload: {
76
+ action: DataGridBulkAction;
77
+ rows: T[];
78
+ }) => any) | undefined;
79
+ readonly "onSelection-change"?: ((selectedIds: string[]) => any) | undefined;
80
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onRow-click" | "onRow-action" | "onNavigate" | "onBulk-action" | "onSelection-change"> & CuiDataGridProps<T> & Partial<{}>> & import("vue").PublicProps;
81
+ expose(exposed: import("vue").ShallowUnwrapRef<{
82
+ clearSelection: () => void;
83
+ getQueryParams: () => DataGridQueryParams;
84
+ getConfig: () => DataGridViewConfig;
85
+ loadConfig: (config: DataGridViewConfig) => void;
86
+ resetToDefaults: () => void;
87
+ }>): void;
88
+ attrs: any;
89
+ slots: {
90
+ "toolbar-start"?: () => unknown;
91
+ "toolbar-end"?: () => unknown;
92
+ empty?: () => unknown;
93
+ card?: (props: {
94
+ row: T;
95
+ }) => unknown;
96
+ } & {
97
+ [x: `cell-${string}`]: ((props: {
98
+ value: unknown;
99
+ row: T;
100
+ }) => unknown) | undefined;
101
+ };
102
+ emit: ((evt: "row-click", payload: {
103
+ row: T;
104
+ }) => void) & ((evt: "row-action", payload: {
107
105
  action: DataGridRowAction;
108
- row: DataGridRow;
109
- }) => any) | undefined;
110
- onNavigate?: ((params: DataGridQueryParams) => any) | undefined;
111
- "onBulk-action"?: ((payload: {
106
+ row: T;
107
+ }) => void) & ((evt: "navigate", params: DataGridQueryParams) => void) & ((evt: "bulk-action", payload: {
112
108
  action: DataGridBulkAction;
113
- rows: DataGridRow[];
114
- }) => any) | undefined;
115
- "onSelection-change"?: ((selectedIds: string[]) => any) | undefined;
116
- }>, {
117
- hidden: boolean;
118
- size: TableSize;
119
- loading: boolean;
120
- perPageOptions: number[];
121
- striped: boolean;
122
- hoverable: boolean;
123
- bordered: boolean;
124
- stickyHeader: boolean;
125
- serverSide: boolean;
126
- rowKey: string;
127
- hideSearch: boolean;
128
- hideColumnManager: boolean;
129
- showSelectAll: boolean;
130
- virtualize: boolean;
131
- hideToolbar: boolean;
132
- hidePagination: boolean;
133
- hideFilterPanel: boolean;
134
- filterPanelSide: "left" | "right";
135
- hydrateUrl: boolean;
136
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
137
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
138
- export default _default;
139
- type __VLS_WithSlots<T, S> = T & {
140
- new (): {
141
- $slots: S;
142
- };
109
+ rows: T[];
110
+ }) => void) & ((evt: "selection-change", selectedIds: string[]) => void);
111
+ }>) => import("vue").VNode & {
112
+ __ctx?: Awaited<typeof __VLS_setup>;
143
113
  };
114
+ export default _default;
115
+ type __VLS_PrettifyLocal<T> = {
116
+ [K in keyof T]: T[K];
117
+ } & {};
144
118
  //# sourceMappingURL=CuiDataGrid.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CuiDataGrid.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiDataGrid.vue"],"names":[],"mappings":"AAmSA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAUjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,yBAAyB;IACzB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,yEAAyE;IACzE,IAAI,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;IACpC,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,yCAAyC;IACzC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CA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AAkB;cAAQ,CAAC,EAAE;;EA+W9D,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhZzE,wBAgZ4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,178 @@
1
+ import { defineComponent as p, useSlots as z, toRef as A, watch as b, withDirectives as D, openBlock as i, createElementBlock as c, createBlock as s, withCtx as f, renderSlot as u, createCommentVNode as h, createVNode as m, unref as n, normalizeStyle as R, createElementVNode as V, normalizeProps as S, guardReactiveProps as B, createSlots as x, renderList as H, createTextVNode as T, toDisplayString as G, vShow as K } from "vue";
2
+ import { useDataGrid as N, provideDataGrid as M } from "../composables/useDataGrid.js";
3
+ import Q from "./CuiDataGridToolbar.vue.js";
4
+ /* empty css */
5
+ import E from "./CuiDataGridTable.vue.js";
6
+ import F from "./CuiDataGridCardView.vue.js";
7
+ import U from "./CuiDataGridPagination.vue.js";
8
+ import I from "./CuiDataGridBulkBar.vue.js";
9
+ /* empty css */
10
+ import O from "./CuiDataGridFilterPanel.vue.js";
11
+ /* empty css */
12
+ import L from "./CuiDataGridActiveFilters.vue.js";
13
+ /* empty css */
14
+ import j from "./CuiEmptyState.vue.js";
15
+ import q from "./CuiSkeleton.vue.js";
16
+ import { useMessages as J } from "../composables/useMessages.js";
17
+ const W = { class: "cui-data-grid" }, X = {
18
+ key: 1,
19
+ style: { padding: "calc(1rem * var(--cui-density-scale, 1))" }
20
+ }, Y = { key: 2 }, Z = { style: { flex: "1", "min-width": "0" } }, ge = /* @__PURE__ */ p({
21
+ __name: "CuiDataGrid",
22
+ props: {
23
+ columns: {},
24
+ data: {},
25
+ serverSide: { type: Boolean, default: !1 },
26
+ rowKey: { default: "id" },
27
+ bulkActions: {},
28
+ showSelectAll: { type: Boolean, default: !0 },
29
+ stickyHeader: { type: Boolean, default: !0 },
30
+ maxHeight: {},
31
+ striped: { type: Boolean, default: !1 },
32
+ hoverable: { type: Boolean, default: !0 },
33
+ bordered: { type: Boolean, default: !1 },
34
+ size: { default: "md" },
35
+ loading: { type: Boolean, default: !1 },
36
+ perPageOptions: { default: () => [15, 25, 50, 100] },
37
+ hideToolbar: { type: Boolean, default: !1 },
38
+ hidePagination: { type: Boolean, default: !1 },
39
+ hideSearch: { type: Boolean, default: !1 },
40
+ hideColumnManager: { type: Boolean, default: !1 },
41
+ hideFilterPanel: { type: Boolean, default: !1 },
42
+ filterPanelSide: { default: "right" },
43
+ gridId: {},
44
+ viewAdapter: {},
45
+ initialView: {},
46
+ hydrateUrl: { type: Boolean, default: !1 },
47
+ virtualize: { type: Boolean, default: !1 },
48
+ virtualRowHeight: {},
49
+ hidden: { type: Boolean, default: !1 }
50
+ },
51
+ emits: ["navigate", "row-click", "row-action", "bulk-action", "selection-change"],
52
+ setup(e, { expose: C, emit: P }) {
53
+ var w;
54
+ const l = e, d = P, $ = z(), t = N({
55
+ columns: l.columns,
56
+ // The grid internals operate on the loose DataGridRow shape; T is a public-API
57
+ // refinement, so cast once here at the boundary.
58
+ data: A(l, "data"),
59
+ serverSide: l.serverSide,
60
+ rowKey: l.rowKey,
61
+ defaultPerPage: ((w = l.perPageOptions) == null ? void 0 : w[0]) ?? 15,
62
+ initialView: l.initialView,
63
+ hydrateFromUrl: l.hydrateUrl
64
+ });
65
+ M(t), b(
66
+ () => t.selectedRows.value,
67
+ (o) => {
68
+ d("selection-change", [...o]);
69
+ }
70
+ );
71
+ function g() {
72
+ l.serverSide && d("navigate", t.getQueryParams());
73
+ }
74
+ b(
75
+ [() => t.sort.value, () => t.filters.value, () => t.searchQuery.value, () => t.page.value, () => t.perPage.value],
76
+ () => {
77
+ g();
78
+ }
79
+ );
80
+ const y = !!$.card;
81
+ C({
82
+ clearSelection: t.clearSelection,
83
+ getQueryParams: t.getQueryParams,
84
+ getConfig: t.getConfig,
85
+ loadConfig: t.loadConfig,
86
+ resetToDefaults: t.resetToDefaults
87
+ });
88
+ const v = J();
89
+ return (o, r) => D((i(), c("div", W, [
90
+ e.hideToolbar ? h("", !0) : (i(), s(Q, {
91
+ key: 0,
92
+ "hide-search": e.hideSearch,
93
+ "hide-column-manager": e.hideColumnManager,
94
+ "hide-filter-toggle": e.hideFilterPanel,
95
+ "has-card-slot": y,
96
+ "grid-id": e.gridId,
97
+ "view-adapter": e.viewAdapter
98
+ }, {
99
+ "toolbar-start": f(() => [
100
+ u(o.$slots, "toolbar-start")
101
+ ]),
102
+ "toolbar-end": f(() => [
103
+ u(o.$slots, "toolbar-end")
104
+ ]),
105
+ _: 3
106
+ }, 8, ["hide-search", "hide-column-manager", "hide-filter-toggle", "grid-id", "view-adapter"])),
107
+ m(L),
108
+ e.loading ? (i(), c("div", X, [
109
+ m(q, { lines: 8 })
110
+ ])) : n(t).displayData.value.length === 0 ? (i(), c("div", Y, [
111
+ u(o.$slots, "empty", {}, () => [
112
+ m(j, {
113
+ icon: "magnifying-glass",
114
+ title: n(v).dataGrid.noResultsTitle,
115
+ description: n(v).dataGrid.noResultsDescription,
116
+ size: "md",
117
+ color: "secondary"
118
+ }, null, 8, ["title", "description"])
119
+ ])
120
+ ])) : (i(), c("div", {
121
+ key: 3,
122
+ class: "cui-data-grid__content",
123
+ style: R({ flexDirection: e.filterPanelSide === "left" ? "row-reverse" : "row" })
124
+ }, [
125
+ V("div", Z, [
126
+ n(t).viewMode.value === "card" && y ? (i(), s(F, {
127
+ key: 0,
128
+ "row-key": e.rowKey
129
+ }, {
130
+ card: f((a) => [
131
+ u(o.$slots, "card", S(B(a)))
132
+ ]),
133
+ _: 3
134
+ }, 8, ["row-key"])) : (i(), s(E, {
135
+ key: 1,
136
+ "row-key": e.rowKey,
137
+ "bulk-actions": e.bulkActions,
138
+ "show-select-all": e.showSelectAll,
139
+ "sticky-header": e.stickyHeader,
140
+ "max-height": e.maxHeight,
141
+ striped: e.striped,
142
+ hoverable: e.hoverable,
143
+ bordered: e.bordered,
144
+ size: e.size,
145
+ virtualize: e.virtualize,
146
+ "virtual-row-height": e.virtualRowHeight,
147
+ onRowClick: r[0] || (r[0] = (a) => d("row-click", a)),
148
+ onRowAction: r[1] || (r[1] = (a) => d("row-action", a))
149
+ }, x({ _: 2 }, [
150
+ H(n(t).visibleColumns.value, (a) => ({
151
+ name: `cell-${a.key}`,
152
+ fn: f((k) => [
153
+ u(o.$slots, `cell-${a.key}`, S(B(k)), () => [
154
+ T(G(k.value), 1)
155
+ ])
156
+ ])
157
+ }))
158
+ ]), 1032, ["row-key", "bulk-actions", "show-select-all", "sticky-header", "max-height", "striped", "hoverable", "bordered", "size", "virtualize", "virtual-row-height"]))
159
+ ]),
160
+ m(O)
161
+ ], 4)),
162
+ !e.hidePagination && !e.loading && n(t).displayData.value.length > 0 ? (i(), s(U, {
163
+ key: 4,
164
+ onNavigate: g
165
+ })) : h("", !0),
166
+ e.bulkActions && e.bulkActions.length > 0 ? (i(), s(I, {
167
+ key: 5,
168
+ actions: e.bulkActions,
169
+ onBulkAction: r[2] || (r[2] = (a) => d("bulk-action", a))
170
+ }, null, 8, ["actions"])) : h("", !0)
171
+ ], 512)), [
172
+ [K, !e.hidden]
173
+ ]);
174
+ }
175
+ });
176
+ export {
177
+ ge as default
178
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./CuiDataGrid.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,47 @@
1
+ import { defineComponent as p, computed as k, openBlock as l, createElementBlock as s, Fragment as g, renderList as C, createBlock as u, unref as m, withCtx as d, createTextVNode as v, toDisplayString as c, createCommentVNode as y } from "vue";
2
+ import { useDataGridState as _ } from "../composables/useDataGrid.js";
3
+ import f from "./CuiBadge.vue.js";
4
+ import b from "./CuiButton.vue.js";
5
+ const x = {
6
+ key: 0,
7
+ class: "cui-data-grid-active-filters"
8
+ }, h = /* @__PURE__ */ p({
9
+ __name: "CuiDataGridActiveFilters",
10
+ setup(B) {
11
+ const a = _(), o = k(
12
+ () => a.filters.value.map((t) => {
13
+ const e = a.columns.find((n) => (n.filterKey ?? n.key) === t.key), r = (e == null ? void 0 : e.label) ?? t.key, i = Array.isArray(t.value) ? t.value.join(", ") : t.value;
14
+ return { key: t.key, label: r, displayValue: i };
15
+ })
16
+ );
17
+ return (t, e) => o.value.length > 0 ? (l(), s("div", x, [
18
+ (l(!0), s(g, null, C(o.value, (r) => (l(), u(f, {
19
+ key: r.key,
20
+ variant: "subtle",
21
+ color: "primary",
22
+ size: "sm",
23
+ removable: "",
24
+ onRemove: (i) => m(a).removeFilter(r.key)
25
+ }, {
26
+ default: d(() => [
27
+ v(c(r.label) + ": " + c(r.displayValue), 1)
28
+ ]),
29
+ _: 2
30
+ }, 1032, ["onRemove"]))), 128)),
31
+ o.value.length > 1 ? (l(), u(b, {
32
+ key: 0,
33
+ variant: "ghost",
34
+ size: "xs",
35
+ onClick: e[0] || (e[0] = (r) => m(a).clearFilters())
36
+ }, {
37
+ default: d(() => [...e[1] || (e[1] = [
38
+ v(" Clear all ", -1)
39
+ ])]),
40
+ _: 1
41
+ })) : y("", !0)
42
+ ])) : y("", !0);
43
+ }
44
+ });
45
+ export {
46
+ h as default
47
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./CuiDataGridActiveFilters.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"CuiDataGridBulkBar.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiDataGridBulkBar.vue"],"names":[],"mappings":"AAqHA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAO1E,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B,CAAC;;;gBAImC,kBAAkB;cAAQ,WAAW,EAAE;;;;gBAAvC,kBAAkB;cAAQ,WAAW,EAAE;;;AAyJ5E,wBAOG"}
1
+ {"version":3,"file":"CuiDataGridBulkBar.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiDataGridBulkBar.vue"],"names":[],"mappings":"AAyHA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAO1E,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B,CAAC;;;gBAImC,kBAAkB;cAAQ,WAAW,EAAE;;;;gBAAvC,kBAAkB;cAAQ,WAAW,EAAE;;;AAyJ5E,wBAOG"}