@itguy614/clean-ui 0.9.0 → 1.0.0

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 (255) 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.js +7 -0
  8. package/dist/components/CuiAlert.vue2.js +110 -0
  9. package/dist/components/CuiAvatar.vue.js +99 -0
  10. package/dist/components/CuiAvatar.vue3.js +5 -0
  11. package/dist/components/CuiAvatarGroup.vue.js +22 -0
  12. package/dist/components/CuiAvatarGroup.vue3.js +5 -0
  13. package/dist/components/CuiBackdrop.vue.js +7 -0
  14. package/dist/components/CuiBackdrop.vue2.js +49 -0
  15. package/dist/components/CuiBadge.vue.js +7 -0
  16. package/dist/components/CuiBadge.vue2.js +79 -0
  17. package/dist/components/CuiBanner.vue.js +81 -0
  18. package/dist/components/CuiBanner.vue2.js +4 -0
  19. package/dist/components/CuiBreadcrumb.vue.js +7 -0
  20. package/dist/components/CuiBreadcrumb.vue2.js +29 -0
  21. package/dist/components/CuiBreadcrumbItem.vue.js +7 -0
  22. package/dist/components/CuiBreadcrumbItem.vue2.js +46 -0
  23. package/dist/components/CuiButton.vue.js +7 -0
  24. package/dist/components/CuiButton.vue2.js +133 -0
  25. package/dist/components/CuiButtonGroup.vue.js +7 -0
  26. package/dist/components/CuiButtonGroup.vue2.js +21 -0
  27. package/dist/components/CuiCard.vue.js +35 -0
  28. package/dist/components/CuiCard.vue2.js +4 -0
  29. package/dist/components/CuiCardBody.vue.js +20 -0
  30. package/dist/components/CuiCardBody.vue2.js +4 -0
  31. package/dist/components/CuiCardFooter.vue.js +32 -0
  32. package/dist/components/CuiCardFooter.vue2.js +4 -0
  33. package/dist/components/CuiCardHeader.vue.js +51 -0
  34. package/dist/components/CuiCardHeader.vue2.js +4 -0
  35. package/dist/components/CuiCardMedia.vue.js +7 -0
  36. package/dist/components/CuiCardMedia.vue2.js +38 -0
  37. package/dist/components/CuiCheckbox.vue.js +7 -0
  38. package/dist/components/CuiCheckbox.vue2.js +105 -0
  39. package/dist/components/CuiCheckboxGroup.vue.js +7 -0
  40. package/dist/components/CuiCheckboxGroup.vue2.js +59 -0
  41. package/dist/components/CuiCodeBlock.vue.js +129 -0
  42. package/dist/components/CuiCodeBlock.vue2.js +4 -0
  43. package/dist/components/CuiColorPicker.vue.js +348 -0
  44. package/dist/components/CuiColorPicker.vue2.js +4 -0
  45. package/dist/components/CuiCombobox.vue.js +332 -0
  46. package/dist/components/CuiCombobox.vue2.js +4 -0
  47. package/dist/components/CuiConfigProvider.vue.js +18 -0
  48. package/dist/components/CuiConfigProvider.vue2.js +4 -0
  49. package/dist/components/CuiConfirmDialog.vue.js +208 -0
  50. package/dist/components/CuiConfirmDialog.vue2.js +4 -0
  51. package/dist/components/CuiContainer.vue.js +35 -0
  52. package/dist/components/CuiContainer.vue2.js +4 -0
  53. package/dist/components/CuiContextMenu.vue.js +7 -0
  54. package/dist/components/CuiContextMenu.vue2.js +136 -0
  55. package/dist/components/CuiCopyButton.vue.js +63 -0
  56. package/dist/components/CuiCopyButton.vue2.js +4 -0
  57. package/dist/components/CuiDataGrid.vue.js +176 -0
  58. package/dist/components/CuiDataGrid.vue3.js +5 -0
  59. package/dist/components/CuiDataGridActiveFilters.vue.js +47 -0
  60. package/dist/components/CuiDataGridActiveFilters.vue3.js +5 -0
  61. package/dist/components/CuiDataGridBulkBar.vue.d.ts.map +1 -1
  62. package/dist/components/CuiDataGridBulkBar.vue.js +70 -0
  63. package/dist/components/CuiDataGridBulkBar.vue3.js +5 -0
  64. package/dist/components/CuiDataGridCardView.vue.js +31 -0
  65. package/dist/components/CuiDataGridCardView.vue2.js +4 -0
  66. package/dist/components/CuiDataGridColumnManager.vue.js +86 -0
  67. package/dist/components/CuiDataGridColumnManager.vue2.js +4 -0
  68. package/dist/components/CuiDataGridFilterPanel.vue.js +181 -0
  69. package/dist/components/CuiDataGridFilterPanel.vue3.js +5 -0
  70. package/dist/components/CuiDataGridPagination.vue.js +28 -0
  71. package/dist/components/CuiDataGridPagination.vue2.js +4 -0
  72. package/dist/components/CuiDataGridSearch.vue.js +69 -0
  73. package/dist/components/CuiDataGridSearch.vue2.js +4 -0
  74. package/dist/components/CuiDataGridTable.vue.js +336 -0
  75. package/dist/components/CuiDataGridTable.vue2.js +4 -0
  76. package/dist/components/CuiDataGridToolbar.vue.js +73 -0
  77. package/dist/components/CuiDataGridToolbar.vue3.js +5 -0
  78. package/dist/components/CuiDataGridViewManager.vue.js +209 -0
  79. package/dist/components/CuiDataGridViewManager.vue2.js +4 -0
  80. package/dist/components/CuiDataGridViewToggle.vue.js +43 -0
  81. package/dist/components/CuiDataGridViewToggle.vue3.js +5 -0
  82. package/dist/components/CuiDatePicker.vue.js +382 -0
  83. package/dist/components/CuiDatePicker.vue2.js +4 -0
  84. package/dist/components/CuiDateRangePicker.vue.js +376 -0
  85. package/dist/components/CuiDateRangePicker.vue2.js +4 -0
  86. package/dist/components/CuiDivider.vue.js +124 -0
  87. package/dist/components/CuiDivider.vue2.js +4 -0
  88. package/dist/components/CuiDropdown.vue.js +7 -0
  89. package/dist/components/CuiDropdown.vue2.js +110 -0
  90. package/dist/components/CuiDropdownCheckItem.vue.js +7 -0
  91. package/dist/components/CuiDropdownCheckItem.vue2.js +45 -0
  92. package/dist/components/CuiDropdownDivider.vue.js +14 -0
  93. package/dist/components/CuiDropdownHeader.vue.js +16 -0
  94. package/dist/components/CuiDropdownItem.vue.js +7 -0
  95. package/dist/components/CuiDropdownItem.vue2.js +55 -0
  96. package/dist/components/CuiDropdownMenu.vue.js +7 -0
  97. package/dist/components/CuiDropdownMenu.vue2.js +79 -0
  98. package/dist/components/CuiDropdownRadioGroup.vue.js +23 -0
  99. package/dist/components/CuiDropdownRadioGroup.vue2.js +4 -0
  100. package/dist/components/CuiDropdownRadioItem.vue.js +7 -0
  101. package/dist/components/CuiDropdownRadioItem.vue2.js +43 -0
  102. package/dist/components/CuiDropdownSub.vue.js +7 -0
  103. package/dist/components/CuiDropdownSub.vue2.js +91 -0
  104. package/dist/components/CuiDropdownTrigger.vue.js +7 -0
  105. package/dist/components/CuiDropdownTrigger.vue2.js +25 -0
  106. package/dist/components/CuiEmptyState.vue.js +7 -0
  107. package/dist/components/CuiEmptyState.vue2.js +70 -0
  108. package/dist/components/CuiFieldset.vue.js +7 -0
  109. package/dist/components/CuiFieldset.vue2.js +79 -0
  110. package/dist/components/CuiFileUpload.vue.js +254 -0
  111. package/dist/components/CuiFileUpload.vue2.js +4 -0
  112. package/dist/components/CuiFlex.vue.js +7 -0
  113. package/dist/components/CuiFlex.vue2.js +72 -0
  114. package/dist/components/CuiFlexItem.vue.js +35 -0
  115. package/dist/components/CuiFlexItem.vue2.js +4 -0
  116. package/dist/components/CuiForm.vue.js +116 -0
  117. package/dist/components/CuiForm.vue2.js +4 -0
  118. package/dist/components/CuiFormField.vue.js +7 -0
  119. package/dist/components/CuiFormField.vue2.js +73 -0
  120. package/dist/components/CuiGrid.vue.js +7 -0
  121. package/dist/components/CuiGrid.vue2.js +51 -0
  122. package/dist/components/CuiGridItem.vue.js +30 -0
  123. package/dist/components/CuiGridItem.vue2.js +4 -0
  124. package/dist/components/CuiIcon.vue.js +7 -0
  125. package/dist/components/CuiIcon.vue2.js +72 -0
  126. package/dist/components/CuiInput.vue.js +7 -0
  127. package/dist/components/CuiInput.vue2.js +148 -0
  128. package/dist/components/CuiInputStepper.vue.js +189 -0
  129. package/dist/components/CuiInputStepper.vue2.js +4 -0
  130. package/dist/components/CuiKbd.vue.js +44 -0
  131. package/dist/components/CuiKbd.vue2.js +4 -0
  132. package/dist/components/CuiMaskedInput.vue.js +256 -0
  133. package/dist/components/CuiMaskedInput.vue2.js +4 -0
  134. package/dist/components/CuiModal.vue.js +7 -0
  135. package/dist/components/CuiModal.vue2.js +98 -0
  136. package/dist/components/CuiModalBody.vue.js +50 -0
  137. package/dist/components/CuiModalBody.vue2.js +4 -0
  138. package/dist/components/CuiModalFooter.vue.js +36 -0
  139. package/dist/components/CuiModalFooter.vue2.js +4 -0
  140. package/dist/components/CuiModalHeader.vue.js +85 -0
  141. package/dist/components/CuiModalHeader.vue2.js +4 -0
  142. package/dist/components/CuiPagination.vue.js +7 -0
  143. package/dist/components/CuiPagination.vue2.js +136 -0
  144. package/dist/components/CuiPopover.vue.js +227 -0
  145. package/dist/components/CuiPopover.vue2.js +4 -0
  146. package/dist/components/CuiProgress.vue.js +7 -0
  147. package/dist/components/CuiProgress.vue2.js +132 -0
  148. package/dist/components/CuiRadio.vue.d.ts.map +1 -1
  149. package/dist/components/CuiRadio.vue.js +7 -0
  150. package/dist/components/CuiRadio.vue2.js +139 -0
  151. package/dist/components/CuiRadioGroup.vue.js +7 -0
  152. package/dist/components/CuiRadioGroup.vue2.js +78 -0
  153. package/dist/components/CuiRating.vue.js +129 -0
  154. package/dist/components/CuiRating.vue2.js +4 -0
  155. package/dist/components/CuiResizablePanels.vue.js +147 -0
  156. package/dist/components/CuiResizablePanels.vue2.js +4 -0
  157. package/dist/components/CuiSelect.vue.d.ts.map +1 -1
  158. package/dist/components/CuiSelect.vue.js +7 -0
  159. package/dist/components/CuiSelect.vue2.js +359 -0
  160. package/dist/components/CuiSkeleton.vue.js +7 -0
  161. package/dist/components/CuiSkeleton.vue2.js +80 -0
  162. package/dist/components/CuiSlideover.vue.js +109 -0
  163. package/dist/components/CuiSlideover.vue2.js +4 -0
  164. package/dist/components/CuiSlider.vue.js +156 -0
  165. package/dist/components/CuiSlider.vue2.js +4 -0
  166. package/dist/components/CuiSpacer.vue.js +32 -0
  167. package/dist/components/CuiSpacer.vue2.js +4 -0
  168. package/dist/components/CuiSpinner.vue.js +99 -0
  169. package/dist/components/CuiSpinner.vue3.js +5 -0
  170. package/dist/components/CuiStack.vue.js +30 -0
  171. package/dist/components/CuiStack.vue2.js +4 -0
  172. package/dist/components/CuiStepper.vue.js +153 -0
  173. package/dist/components/CuiStepper.vue2.js +4 -0
  174. package/dist/components/CuiTab.vue.js +7 -0
  175. package/dist/components/CuiTab.vue2.js +73 -0
  176. package/dist/components/CuiTable.vue.js +90 -0
  177. package/dist/components/CuiTable.vue3.js +5 -0
  178. package/dist/components/CuiTableBody.vue.js +18 -0
  179. package/dist/components/CuiTableBody.vue2.js +4 -0
  180. package/dist/components/CuiTableCell.vue.js +36 -0
  181. package/dist/components/CuiTableCell.vue2.js +4 -0
  182. package/dist/components/CuiTableFoot.vue.js +18 -0
  183. package/dist/components/CuiTableFoot.vue2.js +4 -0
  184. package/dist/components/CuiTableHead.vue.js +18 -0
  185. package/dist/components/CuiTableHead.vue2.js +4 -0
  186. package/dist/components/CuiTableRow.vue.js +23 -0
  187. package/dist/components/CuiTableRow.vue2.js +4 -0
  188. package/dist/components/CuiTabs.vue.js +7 -0
  189. package/dist/components/CuiTabs.vue2.js +124 -0
  190. package/dist/components/CuiTagInput.vue.js +296 -0
  191. package/dist/components/CuiTagInput.vue2.js +4 -0
  192. package/dist/components/CuiTextarea.vue.js +7 -0
  193. package/dist/components/CuiTextarea.vue2.js +112 -0
  194. package/dist/components/CuiTimePicker.vue.js +193 -0
  195. package/dist/components/CuiTimePicker.vue2.js +4 -0
  196. package/dist/components/CuiTimeline.vue.js +25 -0
  197. package/dist/components/CuiTimeline.vue2.js +4 -0
  198. package/dist/components/CuiTimelineItem.vue.js +113 -0
  199. package/dist/components/CuiTimelineItem.vue2.js +4 -0
  200. package/dist/components/CuiToast.vue.js +7 -0
  201. package/dist/components/CuiToast.vue2.js +129 -0
  202. package/dist/components/CuiToastProvider.vue.js +7 -0
  203. package/dist/components/CuiToastProvider.vue2.js +87 -0
  204. package/dist/components/CuiToggle.vue.d.ts.map +1 -1
  205. package/dist/components/CuiToggle.vue.js +7 -0
  206. package/dist/components/CuiToggle.vue2.js +116 -0
  207. package/dist/components/CuiToggleGroup.vue.js +7 -0
  208. package/dist/components/CuiToggleGroup.vue2.js +59 -0
  209. package/dist/components/CuiTooltip.vue.js +7 -0
  210. package/dist/components/CuiTooltip.vue2.js +128 -0
  211. package/dist/components/CuiTransferList.vue.js +442 -0
  212. package/dist/components/CuiTransferList.vue2.js +4 -0
  213. package/dist/components/CuiTreeNode.vue.js +180 -0
  214. package/dist/components/CuiTreeNode.vue2.js +4 -0
  215. package/dist/components/CuiTreeView.vue.js +73 -0
  216. package/dist/components/CuiTreeView.vue2.js +4 -0
  217. package/dist/components/accordion-context.js +4 -0
  218. package/dist/components/breadcrumb-context.js +4 -0
  219. package/dist/components/config-context.js +4 -0
  220. package/dist/components/data-grid-context.js +4 -0
  221. package/dist/components/dropdown-context.js +30 -0
  222. package/dist/components/form-context.js +4 -0
  223. package/dist/components/multi-select-group-context.js +5 -0
  224. package/dist/components/radio-context.js +4 -0
  225. package/dist/components/table-context.js +5 -0
  226. package/dist/components/tabs-context.js +4 -0
  227. package/dist/components/toast-context.js +45 -0
  228. package/dist/composables/useBreakpoint.js +34 -0
  229. package/dist/composables/useClickOutside.js +14 -0
  230. package/dist/composables/useCopyToClipboard.js +25 -0
  231. package/dist/composables/useDataGrid.js +269 -0
  232. package/dist/composables/useDataGridInertia.js +35 -0
  233. package/dist/composables/useDataGridViews.js +67 -0
  234. package/dist/composables/useDensity.js +42 -0
  235. package/dist/composables/useLayoutContext.js +21 -0
  236. package/dist/composables/useMessages.js +10 -0
  237. package/dist/composables/useOverlay.js +57 -0
  238. package/dist/composables/usePopover.js +53 -0
  239. package/dist/composables/useScrollShadows.js +56 -0
  240. package/dist/composables/useTheme.js +57 -0
  241. package/dist/composables/useToast.js +23 -0
  242. package/dist/composables/useVirtualScroll.js +69 -0
  243. package/dist/index.js +290 -0
  244. package/dist/messages.js +57 -0
  245. package/dist/ssr-theme-init.js +13 -0
  246. package/dist/utils/color.js +195 -0
  247. package/dist/utils/colorIconMap.js +11 -0
  248. package/dist/utils/date.js +114 -0
  249. package/dist/utils/liveRegion.js +12 -0
  250. package/dist/utils/resolvers.js +28 -0
  251. package/dist/utils/responsive.js +68 -0
  252. package/dist/utils/sizing.js +39 -0
  253. package/package.json +8 -7
  254. package/dist/clean-ui.js +0 -11937
  255. package/dist/clean-ui.umd.cjs +0 -11
@@ -0,0 +1,181 @@
1
+ import { defineComponent as U, ref as B, watch as D, computed as O, unref as n, openBlock as u, createElementBlock as o, createElementVNode as s, toDisplayString as c, createVNode as d, normalizeStyle as N, withCtx as y, Fragment as h, renderList as x, createBlock as m, createCommentVNode as V, createTextVNode as C } from "vue";
2
+ import { useDataGridState as M } from "../composables/useDataGrid.js";
3
+ import $ from "./CuiInput.vue.js";
4
+ import w from "./CuiSelect.vue.js";
5
+ import E from "./CuiCheckbox.vue.js";
6
+ import p from "./CuiButton.vue.js";
7
+ import b from "./CuiIcon.vue.js";
8
+ import { useMessages as R } from "../composables/useMessages.js";
9
+ const j = {
10
+ key: 0,
11
+ class: "cui-data-grid-filter-panel"
12
+ }, L = { class: "cui-data-grid-filter-panel__header" }, q = { class: "cui-data-grid-filter-panel__title" }, H = { style: { display: "flex", gap: "calc(0.25rem * var(--cui-density-scale, 1))" } }, J = { class: "cui-data-grid-filter-panel__body" }, Q = { class: "cui-data-grid-filter-panel__label" }, W = {
13
+ key: 2,
14
+ style: { display: "flex", "flex-direction": "column", gap: "calc(0.25rem * var(--cui-density-scale, 1))" }
15
+ }, X = {
16
+ key: 3,
17
+ style: { display: "flex", gap: "calc(0.5rem * var(--cui-density-scale, 1))" }
18
+ }, Y = ["value", "onInput"], Z = ["value", "onInput"], ee = { class: "cui-data-grid-filter-panel__footer" }, de = /* @__PURE__ */ U({
19
+ __name: "CuiDataGridFilterPanel",
20
+ setup(te) {
21
+ const f = R(), r = M(), i = B({});
22
+ D(
23
+ () => r.filterPanelOpen.value,
24
+ (t) => {
25
+ t && A();
26
+ },
27
+ { immediate: !0 }
28
+ );
29
+ function A() {
30
+ const t = {};
31
+ for (const l of r.filters.value)
32
+ t[l.key] = l.value;
33
+ i.value = t;
34
+ }
35
+ function S(t) {
36
+ return String(i.value[t] ?? "");
37
+ }
38
+ function K(t, l) {
39
+ i.value = { ...i.value, [t]: String(l) };
40
+ }
41
+ function z(t) {
42
+ return String(i.value[t] ?? "");
43
+ }
44
+ function T(t, l) {
45
+ i.value = { ...i.value, [t]: String(l) };
46
+ }
47
+ function _(t) {
48
+ const l = i.value[t];
49
+ return Array.isArray(l) ? l : l ? [l] : [];
50
+ }
51
+ function F(t, l) {
52
+ const e = _(t), a = e.includes(l) ? e.filter((k) => k !== l) : [...e, l];
53
+ i.value = { ...i.value, [t]: a };
54
+ }
55
+ function v(t) {
56
+ const l = i.value[t];
57
+ return Array.isArray(l) && l.length === 2 ? [l[0], l[1]] : ["", ""];
58
+ }
59
+ function g(t, l, e) {
60
+ const a = v(t);
61
+ a[l] = String(e), i.value = { ...i.value, [t]: [...a] };
62
+ }
63
+ function P() {
64
+ r.clearFilters();
65
+ for (const t of r.filterableColumns.value) {
66
+ const l = t.filterKey ?? t.key, e = i.value[l];
67
+ !e || Array.isArray(e) && e.length === 0 || e === "" || t.filterType === "date-range" && Array.isArray(e) && (!e[0] || !e[1]) || r.applyFilter({
68
+ key: l,
69
+ value: e,
70
+ type: t.filterType ?? "text"
71
+ });
72
+ }
73
+ }
74
+ function G() {
75
+ i.value = {}, r.clearFilters();
76
+ }
77
+ const I = O(() => Object.values(i.value).some((t) => Array.isArray(t) ? t.length > 0 && t.some(Boolean) : !!t));
78
+ return (t, l) => n(r).filterPanelOpen.value ? (u(), o("div", j, [
79
+ s("div", L, [
80
+ s("span", q, c(n(f).dataGrid.filters), 1),
81
+ s("div", H, [
82
+ d(p, {
83
+ variant: "ghost",
84
+ size: "xs",
85
+ style: N({ color: n(r).filterPanelPinned.value ? "var(--cui-primary)" : void 0 }),
86
+ onClick: l[0] || (l[0] = (e) => n(r).toggleFilterPanelPin())
87
+ }, {
88
+ default: y(() => [
89
+ d(b, {
90
+ name: "push-pin",
91
+ size: "0.875rem"
92
+ })
93
+ ]),
94
+ _: 1
95
+ }, 8, ["style"]),
96
+ d(p, {
97
+ variant: "ghost",
98
+ size: "xs",
99
+ onClick: l[1] || (l[1] = (e) => n(r).toggleFilterPanel())
100
+ }, {
101
+ default: y(() => [
102
+ d(b, {
103
+ name: "x",
104
+ size: "0.875rem"
105
+ })
106
+ ]),
107
+ _: 1
108
+ })
109
+ ])
110
+ ]),
111
+ s("div", J, [
112
+ (u(!0), o(h, null, x(n(r).filterableColumns.value, (e) => (u(), o("div", {
113
+ key: e.key,
114
+ class: "cui-data-grid-filter-panel__field"
115
+ }, [
116
+ s("label", Q, c(e.label), 1),
117
+ e.filterType === "text" || !e.filterType ? (u(), m($, {
118
+ key: 0,
119
+ "model-value": S(e.filterKey ?? e.key),
120
+ placeholder: n(f).dataGrid.filterColumn(e.label),
121
+ size: "sm",
122
+ "onUpdate:modelValue": (a) => K(e.filterKey ?? e.key, a)
123
+ }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : e.filterType === "select" ? (u(), m(w, {
124
+ key: 1,
125
+ "model-value": z(e.filterKey ?? e.key),
126
+ options: [{ label: n(f).dataGrid.all, value: "" }, ...e.filterOptions ?? []],
127
+ size: "sm",
128
+ "onUpdate:modelValue": (a) => T(e.filterKey ?? e.key, String(a ?? ""))
129
+ }, null, 8, ["model-value", "options", "onUpdate:modelValue"])) : e.filterType === "multi-select" ? (u(), o("div", W, [
130
+ (u(!0), o(h, null, x(e.filterOptions ?? [], (a) => (u(), m(E, {
131
+ key: a.value,
132
+ "model-value": _(e.filterKey ?? e.key).includes(a.value),
133
+ label: a.label,
134
+ size: "sm",
135
+ "onUpdate:modelValue": (k) => F(e.filterKey ?? e.key, a.value)
136
+ }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))
137
+ ])) : e.filterType === "date-range" ? (u(), o("div", X, [
138
+ s("input", {
139
+ type: "date",
140
+ class: "cui-data-grid-filter-panel__date-input",
141
+ value: v(e.filterKey ?? e.key)[0],
142
+ onInput: (a) => g(e.filterKey ?? e.key, 0, a.target.value)
143
+ }, null, 40, Y),
144
+ s("input", {
145
+ type: "date",
146
+ class: "cui-data-grid-filter-panel__date-input",
147
+ value: v(e.filterKey ?? e.key)[1],
148
+ onInput: (a) => g(e.filterKey ?? e.key, 1, a.target.value)
149
+ }, null, 40, Z)
150
+ ])) : V("", !0)
151
+ ]))), 128))
152
+ ]),
153
+ s("div", ee, [
154
+ d(p, {
155
+ size: "xs",
156
+ variant: "solid",
157
+ onClick: P
158
+ }, {
159
+ default: y(() => [
160
+ C(c(n(f).apply), 1)
161
+ ]),
162
+ _: 1
163
+ }),
164
+ d(p, {
165
+ size: "xs",
166
+ variant: "ghost",
167
+ disabled: !I.value,
168
+ onClick: G
169
+ }, {
170
+ default: y(() => [
171
+ C(c(n(f).clearAll), 1)
172
+ ]),
173
+ _: 1
174
+ }, 8, ["disabled"])
175
+ ])
176
+ ])) : V("", !0);
177
+ }
178
+ });
179
+ export {
180
+ de as default
181
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./CuiDataGridFilterPanel.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as p, openBlock as g, createBlock as u, unref as t } from "vue";
2
+ import { useDataGridState as c } from "../composables/useDataGrid.js";
3
+ import s from "./CuiPagination.vue.js";
4
+ const d = /* @__PURE__ */ p({
5
+ __name: "CuiDataGridPagination",
6
+ emits: ["navigate"],
7
+ setup(l, { emit: o }) {
8
+ const a = c(), n = o;
9
+ function i(e) {
10
+ a.setPage(e), n("navigate");
11
+ }
12
+ function r(e) {
13
+ a.setPerPage(e), n("navigate");
14
+ }
15
+ return (e, m) => (g(), u(s, {
16
+ "current-page": t(a).paginationMeta.value.current_page,
17
+ "total-pages": t(a).paginationMeta.value.last_page,
18
+ "per-page": t(a).paginationMeta.value.per_page,
19
+ total: t(a).paginationMeta.value.total,
20
+ size: "sm",
21
+ "onUpdate:currentPage": i,
22
+ "onUpdate:perPage": r
23
+ }, null, 8, ["current-page", "total-pages", "per-page", "total"]));
24
+ }
25
+ });
26
+ export {
27
+ d as default
28
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CuiDataGridPagination.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as m, ref as c, watch as d, openBlock as f, createElementBlock as p, createVNode as r, withKeys as h, unref as v, createSlots as _, withCtx as i } from "vue";
2
+ import { useDataGridState as g } from "../composables/useDataGrid.js";
3
+ import x from "./CuiInput.vue.js";
4
+ import s from "./CuiIcon.vue.js";
5
+ import y from "./CuiButton.vue.js";
6
+ import { useMessages as C } from "../composables/useMessages.js";
7
+ const w = { style: { position: "relative", "max-width": "20rem", flex: "1" } }, D = /* @__PURE__ */ m({
8
+ __name: "CuiDataGridSearch",
9
+ setup(S) {
10
+ const l = C();
11
+ let o = null;
12
+ const a = g(), e = c(a.searchQuery.value);
13
+ d(
14
+ () => a.searchQuery.value,
15
+ (t) => {
16
+ e.value = t;
17
+ }
18
+ );
19
+ function u(t) {
20
+ e.value = String(t), o && clearTimeout(o), o = setTimeout(() => {
21
+ a.search(e.value);
22
+ }, 300);
23
+ }
24
+ function n() {
25
+ e.value = "", a.clearSearch();
26
+ }
27
+ return (t, k) => (f(), p("div", w, [
28
+ r(x, {
29
+ "model-value": e.value,
30
+ placeholder: v(l).dataGrid.search,
31
+ size: "sm",
32
+ "onUpdate:modelValue": u,
33
+ onKeydown: h(n, ["escape"])
34
+ }, _({
35
+ prefix: i(() => [
36
+ r(s, {
37
+ name: "magnifying-glass",
38
+ size: "0.875rem"
39
+ })
40
+ ]),
41
+ _: 2
42
+ }, [
43
+ e.value ? {
44
+ name: "suffix",
45
+ fn: i(() => [
46
+ r(y, {
47
+ variant: "ghost",
48
+ size: "xs",
49
+ onClick: n,
50
+ style: { margin: "-0.25rem" }
51
+ }, {
52
+ default: i(() => [
53
+ r(s, {
54
+ name: "x",
55
+ size: "0.75rem"
56
+ })
57
+ ]),
58
+ _: 1
59
+ })
60
+ ]),
61
+ key: "0"
62
+ } : void 0
63
+ ]), 1032, ["model-value", "placeholder"])
64
+ ]));
65
+ }
66
+ });
67
+ export {
68
+ D as default
69
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CuiDataGridSearch.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,336 @@
1
+ import { defineComponent as X, computed as c, ref as Y, openBlock as r, createBlock as s, unref as d, withCtx as n, createVNode as f, normalizeStyle as p, createCommentVNode as y, createElementBlock as k, Fragment as b, renderList as w, createElementVNode as _, createTextVNode as S, toDisplayString as z, withModifiers as T, renderSlot as Z } from "vue";
2
+ import { useDataGridState as ee } from "../composables/useDataGrid.js";
3
+ import { useVirtualScroll as te } from "../composables/useVirtualScroll.js";
4
+ import le from "./CuiTable.vue.js";
5
+ /* empty css */
6
+ import ae from "./CuiTableHead.vue.js";
7
+ import ie from "./CuiTableBody.vue.js";
8
+ import M from "./CuiTableRow.vue.js";
9
+ import h from "./CuiTableCell.vue.js";
10
+ import N from "./CuiCheckbox.vue.js";
11
+ import W from "./CuiIcon.vue.js";
12
+ import re from "./CuiDropdown.vue.js";
13
+ import ne from "./CuiDropdownTrigger.vue.js";
14
+ import oe from "./CuiDropdownMenu.vue.js";
15
+ import E from "./CuiDropdownItem.vue.js";
16
+ import ue from "./CuiButton.vue.js";
17
+ import se from "./CuiContextMenu.vue.js";
18
+ const de = { style: { display: "inline-flex", "align-items": "center", gap: "calc(0.25rem * var(--cui-density-scale, 1))" } }, ce = ["colspan"], fe = ["colspan"], He = /* @__PURE__ */ X({
19
+ __name: "CuiDataGridTable",
20
+ props: {
21
+ rowKey: { default: "id" },
22
+ bulkActions: {},
23
+ showSelectAll: { type: Boolean, default: !0 },
24
+ stickyHeader: { type: Boolean, default: !0 },
25
+ maxHeight: {},
26
+ striped: { type: Boolean, default: !1 },
27
+ hoverable: { type: Boolean, default: !0 },
28
+ bordered: { type: Boolean, default: !1 },
29
+ size: { default: "md" },
30
+ virtualize: { type: Boolean, default: !1 },
31
+ virtualRowHeight: {}
32
+ },
33
+ emits: ["row-click", "row-action"],
34
+ setup(u, { emit: U }) {
35
+ const m = u, $ = U, i = ee(), g = c(() => {
36
+ var t;
37
+ return (((t = m.bulkActions) == null ? void 0 : t.length) ?? 0) > 0;
38
+ }), C = c(
39
+ () => i.displayData.value.some((t) => t._actions && t._actions.length > 0)
40
+ );
41
+ function B(t) {
42
+ return String(t[m.rowKey] ?? "");
43
+ }
44
+ function D(t) {
45
+ return i.selectedRows.value.has(B(t));
46
+ }
47
+ const H = c(() => {
48
+ const t = i.displayData.value;
49
+ if (t.length === 0) return !1;
50
+ const a = t.filter((e) => D(e)).length;
51
+ return a === 0 ? !1 : a === t.length ? !0 : "indeterminate";
52
+ });
53
+ function G(t) {
54
+ t ? i.selectAll(i.displayData.value) : i.clearSelection();
55
+ }
56
+ function x(t) {
57
+ return t._actions ?? [];
58
+ }
59
+ function O(t) {
60
+ var o;
61
+ const a = i.columns.find((l) => l.key === t), e = (a == null ? void 0 : a.sortKey) ?? t;
62
+ return ((o = i.sort.value) == null ? void 0 : o.key) === e ? i.sort.value.direction === "asc" ? "caret-up" : "caret-down" : "caret-up-down";
63
+ }
64
+ function F(t) {
65
+ var o;
66
+ const a = i.columns.find((l) => l.key === t), e = (a == null ? void 0 : a.sortKey) ?? t;
67
+ return ((o = i.sort.value) == null ? void 0 : o.key) === e ? "1" : "0.3";
68
+ }
69
+ const L = c(() => {
70
+ const t = i.visibleColumns.value;
71
+ if (!t.some((o) => o.width)) return;
72
+ let e = 0;
73
+ g.value && (e += 48);
74
+ for (const o of t)
75
+ e += parseInt(o.width ?? "150", 10) || 150;
76
+ return C.value && (e += 48), `${e}px`;
77
+ }), V = c(() => {
78
+ const t = /* @__PURE__ */ new Map();
79
+ let a = 0;
80
+ g.value && (a += 48);
81
+ for (const e of i.visibleColumns.value)
82
+ e.sticky && e.width ? (t.set(e.key, `${a}px`), a += parseInt(e.width, 10) || 0) : e.sticky && t.set(e.key, `${a}px`);
83
+ return t;
84
+ }), A = c(() => {
85
+ const t = i.visibleColumns.value;
86
+ for (let a = t.length - 1; a >= 0; a--)
87
+ if (t[a].sticky) return t[a].key;
88
+ return null;
89
+ });
90
+ function j(t) {
91
+ const a = V.value.get(t);
92
+ if (!a) return;
93
+ const e = {
94
+ position: "sticky",
95
+ left: a,
96
+ zIndex: 4,
97
+ background: "var(--cui-table-head-bg, var(--color-surface-50))"
98
+ };
99
+ return t === A.value && (e.boxShadow = "2px 0 4px -1px rgba(0,0,0,0.08)"), e;
100
+ }
101
+ function q(t) {
102
+ const a = V.value.get(t.key), e = !!a, o = m.stickyHeader, l = t.sortable ? { cursor: "pointer", userSelect: "none" } : {};
103
+ return (e || o) && (l.position = "sticky", l.background = "var(--cui-table-head-bg, var(--color-surface-50))", l.zIndex = e && o ? 11 : e ? 5 : 10), o && (l.top = 0), e && (l.left = a, t.key === A.value && (l.boxShadow = "2px 0 4px -1px rgba(0,0,0,0.08)")), l;
104
+ }
105
+ const I = c(
106
+ () => m.stickyHeader ? {
107
+ position: "sticky",
108
+ top: 0,
109
+ zIndex: 10,
110
+ background: "var(--cui-table-head-bg, var(--color-surface-50))"
111
+ } : {}
112
+ ), R = Y(null);
113
+ function J(t) {
114
+ R.value = m.virtualize && m.maxHeight ? t : null;
115
+ }
116
+ const v = te(
117
+ c(() => i.displayData.value),
118
+ {
119
+ containerRef: R,
120
+ rowHeight: m.virtualRowHeight
121
+ }
122
+ ), P = c(
123
+ () => m.virtualize ? v.visibleRows.value : i.displayData.value
124
+ ), K = c(() => {
125
+ let t = i.visibleColumns.value.length;
126
+ return g.value && (t += 1), C.value && (t += 1), t;
127
+ });
128
+ return (t, a) => (r(), s(le, {
129
+ ref: (e) => J((e == null ? void 0 : e.scrollWrapper) ?? null),
130
+ size: u.size,
131
+ striped: u.striped,
132
+ hoverable: u.hoverable,
133
+ bordered: u.bordered,
134
+ "sticky-header": u.stickyHeader,
135
+ "max-height": u.maxHeight,
136
+ "min-width": L.value,
137
+ "aria-rowcount": u.virtualize ? d(i).displayData.value.length + 1 : void 0
138
+ }, {
139
+ default: n(() => [
140
+ f(ae, null, {
141
+ default: n(() => [
142
+ f(M, {
143
+ "aria-rowindex": u.virtualize ? 1 : void 0
144
+ }, {
145
+ default: n(() => [
146
+ g.value ? (r(), s(h, {
147
+ key: 0,
148
+ width: "3rem",
149
+ align: "center",
150
+ style: p(I.value)
151
+ }, {
152
+ default: n(() => [
153
+ u.showSelectAll ? (r(), s(N, {
154
+ key: 0,
155
+ "model-value": H.value === !0,
156
+ indeterminate: H.value === "indeterminate",
157
+ "onUpdate:modelValue": G
158
+ }, null, 8, ["model-value", "indeterminate"])) : y("", !0)
159
+ ]),
160
+ _: 1
161
+ }, 8, ["style"])) : y("", !0),
162
+ (r(!0), k(b, null, w(d(i).visibleColumns.value, (e) => (r(), s(h, {
163
+ key: e.key,
164
+ align: e.align,
165
+ width: e.width,
166
+ nowrap: e.nowrap,
167
+ style: p(q(e)),
168
+ onClick: (o) => e.sortable ? d(i).applySort(e.key) : void 0
169
+ }, {
170
+ default: n(() => [
171
+ _("span", de, [
172
+ S(z(e.label) + " ", 1),
173
+ e.sortable ? (r(), s(W, {
174
+ key: 0,
175
+ name: O(e.key),
176
+ size: "0.875rem",
177
+ style: p({ opacity: F(e.key) })
178
+ }, null, 8, ["name", "style"])) : y("", !0)
179
+ ])
180
+ ]),
181
+ _: 2
182
+ }, 1032, ["align", "width", "nowrap", "style", "onClick"]))), 128)),
183
+ C.value ? (r(), s(h, {
184
+ key: 1,
185
+ width: "3rem",
186
+ style: p(I.value)
187
+ }, null, 8, ["style"])) : y("", !0)
188
+ ]),
189
+ _: 1
190
+ }, 8, ["aria-rowindex"])
191
+ ]),
192
+ _: 1
193
+ }),
194
+ f(ie, null, {
195
+ default: n(() => [
196
+ u.virtualize && d(v).paddingTop.value > 0 ? (r(), k("tr", {
197
+ key: 0,
198
+ "aria-hidden": "true",
199
+ style: p({ height: `${d(v).paddingTop.value}px`, padding: 0, border: 0 })
200
+ }, [
201
+ _("td", {
202
+ colspan: K.value,
203
+ style: { padding: "0", border: "none" }
204
+ }, null, 8, ce)
205
+ ], 4)) : y("", !0),
206
+ (r(!0), k(b, null, w(P.value, (e, o) => (r(), s(se, {
207
+ key: B(e),
208
+ disabled: x(e).length === 0
209
+ }, {
210
+ menu: n(() => [
211
+ (r(!0), k(b, null, w(x(e), (l) => (r(), s(E, {
212
+ key: l.key,
213
+ onSelect: (Q) => $("row-action", { action: l, row: e })
214
+ }, {
215
+ default: n(() => [
216
+ S(z(l.label), 1)
217
+ ]),
218
+ _: 2
219
+ }, 1032, ["onSelect"]))), 128))
220
+ ]),
221
+ default: n(() => [
222
+ f(M, {
223
+ ref_for: !0,
224
+ ref: (l) => {
225
+ u.virtualize && o === 0 && d(v).measureRow((l == null ? void 0 : l.rowEl) ?? null);
226
+ },
227
+ selected: D(e),
228
+ "aria-rowindex": u.virtualize ? d(v).firstVisibleIndex.value + o + 2 : void 0,
229
+ style: { cursor: "pointer" },
230
+ onClick: (l) => $("row-click", { row: e })
231
+ }, {
232
+ default: n(() => [
233
+ g.value ? (r(), s(h, {
234
+ key: 0,
235
+ align: "center",
236
+ onClick: a[0] || (a[0] = T(() => {
237
+ }, ["stop"]))
238
+ }, {
239
+ default: n(() => [
240
+ f(N, {
241
+ "model-value": D(e),
242
+ "onUpdate:modelValue": (l) => d(i).toggleSelection(B(e))
243
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
244
+ ]),
245
+ _: 2
246
+ }, 1024)) : y("", !0),
247
+ (r(!0), k(b, null, w(d(i).visibleColumns.value, (l) => (r(), s(h, {
248
+ key: l.key,
249
+ align: l.align,
250
+ nowrap: l.nowrap,
251
+ style: p(j(l.key))
252
+ }, {
253
+ default: n(() => [
254
+ Z(t.$slots, `cell-${l.key}`, {
255
+ value: e[l.key],
256
+ row: e
257
+ }, () => [
258
+ S(z(e[l.key]), 1)
259
+ ])
260
+ ]),
261
+ _: 2
262
+ }, 1032, ["align", "nowrap", "style"]))), 128)),
263
+ C.value ? (r(), s(h, {
264
+ key: 1,
265
+ align: "right",
266
+ onClick: a[1] || (a[1] = T(() => {
267
+ }, ["stop"]))
268
+ }, {
269
+ default: n(() => [
270
+ x(e).length > 0 ? (r(), s(re, { key: 0 }, {
271
+ default: n(() => [
272
+ f(ne, null, {
273
+ default: n(() => [
274
+ f(ue, {
275
+ variant: "ghost",
276
+ size: "xs",
277
+ style: { opacity: "0.4" }
278
+ }, {
279
+ default: n(() => [
280
+ f(W, {
281
+ name: "dots-three",
282
+ size: "1rem"
283
+ })
284
+ ]),
285
+ _: 1
286
+ })
287
+ ]),
288
+ _: 1
289
+ }),
290
+ f(oe, null, {
291
+ default: n(() => [
292
+ (r(!0), k(b, null, w(x(e), (l) => (r(), s(E, {
293
+ key: l.key,
294
+ onSelect: (Q) => $("row-action", { action: l, row: e })
295
+ }, {
296
+ default: n(() => [
297
+ S(z(l.label), 1)
298
+ ]),
299
+ _: 2
300
+ }, 1032, ["onSelect"]))), 128))
301
+ ]),
302
+ _: 2
303
+ }, 1024)
304
+ ]),
305
+ _: 2
306
+ }, 1024)) : y("", !0)
307
+ ]),
308
+ _: 2
309
+ }, 1024)) : y("", !0)
310
+ ]),
311
+ _: 2
312
+ }, 1032, ["selected", "aria-rowindex", "onClick"])
313
+ ]),
314
+ _: 2
315
+ }, 1032, ["disabled"]))), 128)),
316
+ u.virtualize && d(v).paddingBottom.value > 0 ? (r(), k("tr", {
317
+ key: 1,
318
+ "aria-hidden": "true",
319
+ style: p({ height: `${d(v).paddingBottom.value}px`, padding: 0, border: 0 })
320
+ }, [
321
+ _("td", {
322
+ colspan: K.value,
323
+ style: { padding: "0", border: "none" }
324
+ }, null, 8, fe)
325
+ ], 4)) : y("", !0)
326
+ ]),
327
+ _: 3
328
+ })
329
+ ]),
330
+ _: 3
331
+ }, 8, ["size", "striped", "hoverable", "bordered", "sticky-header", "max-height", "min-width", "aria-rowcount"]));
332
+ }
333
+ });
334
+ export {
335
+ He as default
336
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CuiDataGridTable.vue.js";
2
+ export {
3
+ f as default
4
+ };