@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,442 @@
1
+ import { defineComponent as oe, ref as z, computed as k, withDirectives as se, openBlock as c, createElementBlock as m, normalizeStyle as y, createElementVNode as s, toDisplayString as p, createVNode as o, withCtx as b, createCommentVNode as x, Fragment as j, renderList as U, renderSlot as q, createBlock as G, vShow as de } from "vue";
2
+ import V from "./CuiButton.vue.js";
3
+ import v from "./CuiIcon.vue.js";
4
+ import J from "./CuiInput.vue.js";
5
+ const ue = { style: { padding: "calc(0.625rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))", display: "flex", justifyContent: "space-between", alignItems: "center" } }, ce = { style: { fontSize: "0.6875rem", color: "var(--cui-text-tertiary)" } }, ve = {
6
+ key: 0,
7
+ style: { padding: "0 calc(0.5rem * var(--cui-density-scale, 1)) calc(0.375rem * var(--cui-density-scale, 1))" }
8
+ }, fe = ["draggable", "onClick", "onDblclick", "onDragstart", "onDragover"], me = { style: { flex: "1", minWidth: "0" } }, ge = { style: { lineHeight: "1.3" } }, ye = {
9
+ key: 0,
10
+ style: { fontSize: "0.6875rem", color: "var(--cui-text-tertiary)", lineHeight: "1.3" }
11
+ }, pe = {
12
+ key: 0,
13
+ style: { padding: "calc(1rem * var(--cui-density-scale, 1))", textAlign: "center", fontSize: "0.8125rem", color: "var(--cui-text-tertiary)" }
14
+ }, be = { style: { display: "flex", flexDirection: "column", justifyContent: "center", gap: "calc(0.25rem * var(--cui-density-scale, 1))", flexShrink: "0" } }, xe = { style: { padding: "calc(0.625rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))", display: "flex", justifyContent: "space-between", alignItems: "center" } }, he = { style: { fontSize: "0.6875rem", color: "var(--cui-text-tertiary)" } }, Se = {
15
+ key: 0,
16
+ style: { padding: "0 calc(0.5rem * var(--cui-density-scale, 1)) calc(0.375rem * var(--cui-density-scale, 1))" }
17
+ }, ze = ["onClick", "onDblclick", "onDragstart", "onDragover"], ke = { style: { flex: "1", minWidth: "0" } }, De = { style: { lineHeight: "1.3" } }, Ve = {
18
+ key: 0,
19
+ style: { fontSize: "0.6875rem", color: "var(--cui-text-tertiary)", lineHeight: "1.3" }
20
+ }, Ce = {
21
+ key: 0,
22
+ style: { padding: "calc(1rem * var(--cui-density-scale, 1))", textAlign: "center", fontSize: "0.8125rem", color: "var(--cui-text-tertiary)" }
23
+ }, Be = /* @__PURE__ */ oe({
24
+ __name: "CuiTransferList",
25
+ props: {
26
+ items: {},
27
+ modelValue: { default: () => [] },
28
+ sourceTitle: { default: "Available" },
29
+ targetTitle: { default: "Selected" },
30
+ filterable: { type: Boolean, default: !0 },
31
+ sourcePlaceholder: { default: "Filter..." },
32
+ targetPlaceholder: { default: "Filter..." },
33
+ height: { default: "320px" },
34
+ size: { default: "md" },
35
+ hidden: { type: Boolean, default: !1 },
36
+ disabled: { type: Boolean, default: !1 }
37
+ },
38
+ emits: ["update:modelValue"],
39
+ setup(n, { emit: K }) {
40
+ const r = n, f = K, C = z(""), w = z(""), h = z(/* @__PURE__ */ new Set()), u = z(/* @__PURE__ */ new Set()), M = k(() => new Set(r.modelValue)), T = k(
41
+ () => r.items.filter((l) => !M.value.has(l.value))
42
+ ), P = k(() => {
43
+ if (!C.value) return T.value;
44
+ const l = C.value.toLowerCase();
45
+ return T.value.filter(
46
+ (e) => e.label.toLowerCase().includes(l) || e.description && e.description.toLowerCase().includes(l)
47
+ );
48
+ }), B = k(
49
+ () => r.modelValue.map((l) => r.items.find((e) => e.value === l)).filter(Boolean)
50
+ ), L = k(() => {
51
+ if (!w.value) return B.value;
52
+ const l = w.value.toLowerCase();
53
+ return B.value.filter(
54
+ (e) => e.label.toLowerCase().includes(l) || e.description && e.description.toLowerCase().includes(l)
55
+ );
56
+ });
57
+ function Q() {
58
+ if (r.disabled) return;
59
+ const l = [...r.modelValue, ...h.value];
60
+ h.value = /* @__PURE__ */ new Set(), f("update:modelValue", l);
61
+ }
62
+ function X() {
63
+ if (r.disabled) return;
64
+ const l = [...r.modelValue, ...T.value.filter((e) => !e.disabled).map((e) => e.value)];
65
+ h.value = /* @__PURE__ */ new Set(), f("update:modelValue", l);
66
+ }
67
+ function Z() {
68
+ if (r.disabled) return;
69
+ const l = u.value, e = r.modelValue.filter((a) => !l.has(a));
70
+ u.value = /* @__PURE__ */ new Set(), f("update:modelValue", e);
71
+ }
72
+ function _() {
73
+ r.disabled || (u.value = /* @__PURE__ */ new Set(), f("update:modelValue", []));
74
+ }
75
+ function ee() {
76
+ if (r.disabled || u.value.size !== 1) return;
77
+ const l = [...u.value][0], e = [...r.modelValue], a = e.indexOf(l);
78
+ a > 0 && ([e[a - 1], e[a]] = [e[a], e[a - 1]], f("update:modelValue", e));
79
+ }
80
+ function te() {
81
+ if (r.disabled || u.value.size !== 1) return;
82
+ const l = [...u.value][0], e = [...r.modelValue], a = e.indexOf(l);
83
+ a < e.length - 1 && ([e[a], e[a + 1]] = [e[a + 1], e[a]], f("update:modelValue", e));
84
+ }
85
+ function le(l) {
86
+ if (r.disabled) return;
87
+ const e = new Set(h.value);
88
+ e.has(l) ? e.delete(l) : e.add(l), h.value = e;
89
+ }
90
+ function ae(l) {
91
+ if (r.disabled) return;
92
+ const e = new Set(u.value);
93
+ e.has(l) ? e.delete(l) : e.add(l), u.value = e;
94
+ }
95
+ function re(l) {
96
+ r.disabled || l.disabled || f("update:modelValue", [...r.modelValue, l.value]);
97
+ }
98
+ function ie(l) {
99
+ r.disabled || f("update:modelValue", r.modelValue.filter((e) => e !== l.value));
100
+ }
101
+ const S = z(null), d = z(null), D = z(null);
102
+ function O(l, e, a) {
103
+ if (r.disabled) {
104
+ l.preventDefault();
105
+ return;
106
+ }
107
+ S.value = { value: e, from: a }, l.dataTransfer.effectAllowed = "move", l.dataTransfer.setData("text/plain", String(e));
108
+ }
109
+ function A() {
110
+ S.value = null, d.value = null, D.value = null;
111
+ }
112
+ function H(l, e, a) {
113
+ l.preventDefault(), l.dataTransfer.dropEffect = "move";
114
+ const g = l.currentTarget.getBoundingClientRect(), t = g.top + g.height / 2, i = l.clientY < t ? "before" : "after";
115
+ d.value = { value: e, side: a, position: i };
116
+ }
117
+ function $(l, e) {
118
+ l.preventDefault(), l.dataTransfer.dropEffect = "move", D.value = e;
119
+ }
120
+ function E() {
121
+ D.value = null;
122
+ }
123
+ function N(l, e) {
124
+ if (l.preventDefault(), !S.value) return;
125
+ const { value: a, from: g } = S.value;
126
+ if (g === "source" && e === "target") {
127
+ const t = [...r.modelValue];
128
+ if (d.value && d.value.side === "target") {
129
+ const i = t.indexOf(d.value.value);
130
+ if (i >= 0) {
131
+ const F = d.value.position === "after" ? i + 1 : i;
132
+ t.splice(F, 0, a);
133
+ } else
134
+ t.push(a);
135
+ } else
136
+ t.push(a);
137
+ f("update:modelValue", t);
138
+ } else if (g === "target" && e === "source")
139
+ f("update:modelValue", r.modelValue.filter((t) => t !== a));
140
+ else if (g === "target" && e === "target") {
141
+ const t = r.modelValue.filter((i) => i !== a);
142
+ if (d.value && d.value.side === "target") {
143
+ const i = t.indexOf(d.value.value);
144
+ if (i >= 0) {
145
+ const F = d.value.position === "after" ? i + 1 : i;
146
+ t.splice(F, 0, a);
147
+ } else
148
+ t.push(a);
149
+ } else
150
+ t.push(a);
151
+ f("update:modelValue", t);
152
+ }
153
+ S.value = null, d.value = null, D.value = null;
154
+ }
155
+ function R(l, e) {
156
+ if (!d.value || d.value.value !== l || d.value.side !== e) return;
157
+ const a = "2px solid var(--cui-primary)";
158
+ return d.value.position === "before" ? { borderTop: a } : { borderBottom: a };
159
+ }
160
+ const ne = {
161
+ sm: { fontSize: "0.8125rem", itemPad: "0.3125rem 0.5rem", titleFont: "0.75rem" },
162
+ md: { fontSize: "0.875rem", itemPad: "0.4375rem 0.625rem", titleFont: "0.8125rem" },
163
+ lg: { fontSize: "0.9375rem", itemPad: "0.5rem 0.75rem", titleFont: "0.875rem" }
164
+ }, I = k(() => ne[r.size]);
165
+ function W(l, e) {
166
+ return {
167
+ display: "flex",
168
+ alignItems: "center",
169
+ gap: "calc(0.5rem * var(--cui-density-scale, 1))",
170
+ padding: I.value.itemPad,
171
+ fontSize: I.value.fontSize,
172
+ cursor: e ? "default" : "pointer",
173
+ borderRadius: "0.25rem",
174
+ background: l ? "var(--cui-primary-bg)" : "transparent",
175
+ color: e ? "var(--cui-text-tertiary)" : "var(--cui-text-body)",
176
+ opacity: e ? "0.5" : "1",
177
+ transition: "background 0.1s ease",
178
+ userSelect: "none"
179
+ };
180
+ }
181
+ const Y = k(() => ({
182
+ flex: "1",
183
+ minWidth: "0",
184
+ border: "1px solid var(--cui-border)",
185
+ borderRadius: "0.5rem",
186
+ background: "var(--cui-surface-base, white)",
187
+ display: "flex",
188
+ flexDirection: "column",
189
+ overflow: "hidden"
190
+ }));
191
+ return (l, e) => {
192
+ var a, g;
193
+ return se((c(), m("div", {
194
+ style: y({
195
+ display: "flex",
196
+ gap: "calc(0.5rem * var(--cui-density-scale, 1))",
197
+ alignItems: "stretch",
198
+ opacity: n.disabled ? "0.5" : "1"
199
+ })
200
+ }, [
201
+ s("div", {
202
+ style: y(Y.value)
203
+ }, [
204
+ s("div", ue, [
205
+ s("span", {
206
+ style: y({ fontSize: I.value.titleFont, fontWeight: "600", color: "var(--cui-text-body)", textTransform: "uppercase", letterSpacing: "0.03em" })
207
+ }, p(n.sourceTitle), 5),
208
+ s("span", ce, p(P.value.length), 1)
209
+ ]),
210
+ n.filterable ? (c(), m("div", ve, [
211
+ o(J, {
212
+ modelValue: C.value,
213
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => C.value = t),
214
+ placeholder: n.sourcePlaceholder,
215
+ size: "sm"
216
+ }, {
217
+ prefix: b(() => [
218
+ o(v, {
219
+ name: "magnifying-glass",
220
+ size: "0.75rem"
221
+ })
222
+ ]),
223
+ _: 1
224
+ }, 8, ["modelValue", "placeholder"])
225
+ ])) : x("", !0),
226
+ s("div", {
227
+ style: y({
228
+ flex: "1",
229
+ overflowY: "auto",
230
+ padding: "0 calc(0.375rem * var(--cui-density-scale, 1)) calc(0.375rem * var(--cui-density-scale, 1))",
231
+ maxHeight: n.height,
232
+ outline: D.value === "source" && ((a = S.value) == null ? void 0 : a.from) === "target" ? "2px dashed var(--cui-primary)" : "none",
233
+ outlineOffset: "-2px",
234
+ borderRadius: "0 0 0.5rem 0.5rem"
235
+ }),
236
+ onDragover: e[1] || (e[1] = (t) => $(t, "source")),
237
+ onDragleave: E,
238
+ onDrop: e[2] || (e[2] = (t) => N(t, "source"))
239
+ }, [
240
+ (c(!0), m(j, null, U(P.value, (t) => (c(), m("div", {
241
+ key: String(t.value),
242
+ draggable: !t.disabled && !n.disabled,
243
+ style: y({ ...W(h.value.has(t.value), t.disabled), ...R(t.value, "source") }),
244
+ onClick: (i) => !t.disabled && le(t.value),
245
+ onDblclick: (i) => re(t),
246
+ onDragstart: (i) => O(i, t.value, "source"),
247
+ onDragend: A,
248
+ onDragover: (i) => H(i, t.value, "source")
249
+ }, [
250
+ o(v, {
251
+ name: "dots-six-vertical",
252
+ size: "0.75rem",
253
+ style: { flexShrink: "0", color: "var(--cui-text-tertiary)", cursor: "grab", opacity: "0.4" }
254
+ }),
255
+ q(l.$slots, "item", {
256
+ item: t,
257
+ side: "source"
258
+ }, () => [
259
+ t.icon ? (c(), G(v, {
260
+ key: 0,
261
+ name: t.icon,
262
+ size: "0.875rem",
263
+ style: { flexShrink: "0", color: "var(--cui-text-secondary)" }
264
+ }, null, 8, ["name"])) : x("", !0),
265
+ s("div", me, [
266
+ s("div", ge, p(t.label), 1),
267
+ t.description ? (c(), m("div", ye, p(t.description), 1)) : x("", !0)
268
+ ])
269
+ ])
270
+ ], 44, fe))), 128)),
271
+ P.value.length === 0 ? (c(), m("div", pe, " No items ")) : x("", !0)
272
+ ], 36)
273
+ ], 4),
274
+ s("div", be, [
275
+ o(V, {
276
+ variant: "outline",
277
+ size: "xs",
278
+ disabled: n.disabled || h.value.size === 0,
279
+ onClick: Q
280
+ }, {
281
+ default: b(() => [
282
+ o(v, {
283
+ name: "caret-right",
284
+ size: "0.875rem"
285
+ })
286
+ ]),
287
+ _: 1
288
+ }, 8, ["disabled"]),
289
+ o(V, {
290
+ variant: "outline",
291
+ size: "xs",
292
+ disabled: n.disabled || T.value.length === 0,
293
+ onClick: X
294
+ }, {
295
+ default: b(() => [
296
+ o(v, {
297
+ name: "caret-double-right",
298
+ size: "0.875rem"
299
+ })
300
+ ]),
301
+ _: 1
302
+ }, 8, ["disabled"]),
303
+ o(V, {
304
+ variant: "outline",
305
+ size: "xs",
306
+ disabled: n.disabled || u.value.size === 0,
307
+ onClick: Z
308
+ }, {
309
+ default: b(() => [
310
+ o(v, {
311
+ name: "caret-left",
312
+ size: "0.875rem"
313
+ })
314
+ ]),
315
+ _: 1
316
+ }, 8, ["disabled"]),
317
+ o(V, {
318
+ variant: "outline",
319
+ size: "xs",
320
+ disabled: n.disabled || B.value.length === 0,
321
+ onClick: _
322
+ }, {
323
+ default: b(() => [
324
+ o(v, {
325
+ name: "caret-double-left",
326
+ size: "0.875rem"
327
+ })
328
+ ]),
329
+ _: 1
330
+ }, 8, ["disabled"]),
331
+ e[6] || (e[6] = s("div", { style: { height: "0.5rem" } }, null, -1)),
332
+ o(V, {
333
+ variant: "outline",
334
+ size: "xs",
335
+ disabled: n.disabled || u.value.size !== 1,
336
+ onClick: ee
337
+ }, {
338
+ default: b(() => [
339
+ o(v, {
340
+ name: "caret-up",
341
+ size: "0.875rem"
342
+ })
343
+ ]),
344
+ _: 1
345
+ }, 8, ["disabled"]),
346
+ o(V, {
347
+ variant: "outline",
348
+ size: "xs",
349
+ disabled: n.disabled || u.value.size !== 1,
350
+ onClick: te
351
+ }, {
352
+ default: b(() => [
353
+ o(v, {
354
+ name: "caret-down",
355
+ size: "0.875rem"
356
+ })
357
+ ]),
358
+ _: 1
359
+ }, 8, ["disabled"])
360
+ ]),
361
+ s("div", {
362
+ style: y(Y.value)
363
+ }, [
364
+ s("div", xe, [
365
+ s("span", {
366
+ style: y({ fontSize: I.value.titleFont, fontWeight: "600", color: "var(--cui-text-body)", textTransform: "uppercase", letterSpacing: "0.03em" })
367
+ }, p(n.targetTitle), 5),
368
+ s("span", he, p(L.value.length), 1)
369
+ ]),
370
+ n.filterable ? (c(), m("div", Se, [
371
+ o(J, {
372
+ modelValue: w.value,
373
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => w.value = t),
374
+ placeholder: n.targetPlaceholder,
375
+ size: "sm"
376
+ }, {
377
+ prefix: b(() => [
378
+ o(v, {
379
+ name: "magnifying-glass",
380
+ size: "0.75rem"
381
+ })
382
+ ]),
383
+ _: 1
384
+ }, 8, ["modelValue", "placeholder"])
385
+ ])) : x("", !0),
386
+ s("div", {
387
+ style: y({
388
+ flex: "1",
389
+ overflowY: "auto",
390
+ padding: "0 calc(0.375rem * var(--cui-density-scale, 1)) calc(0.375rem * var(--cui-density-scale, 1))",
391
+ maxHeight: n.height,
392
+ outline: D.value === "target" && ((g = S.value) == null ? void 0 : g.from) === "source" ? "2px dashed var(--cui-primary)" : "none",
393
+ outlineOffset: "-2px",
394
+ borderRadius: "0 0 0.5rem 0.5rem"
395
+ }),
396
+ onDragover: e[4] || (e[4] = (t) => $(t, "target")),
397
+ onDragleave: E,
398
+ onDrop: e[5] || (e[5] = (t) => N(t, "target"))
399
+ }, [
400
+ (c(!0), m(j, null, U(L.value, (t) => (c(), m("div", {
401
+ key: String(t.value),
402
+ draggable: "true",
403
+ style: y({ ...W(u.value.has(t.value)), ...R(t.value, "target") }),
404
+ onClick: (i) => ae(t.value),
405
+ onDblclick: (i) => ie(t),
406
+ onDragstart: (i) => O(i, t.value, "target"),
407
+ onDragend: A,
408
+ onDragover: (i) => H(i, t.value, "target")
409
+ }, [
410
+ o(v, {
411
+ name: "dots-six-vertical",
412
+ size: "0.75rem",
413
+ style: { flexShrink: "0", color: "var(--cui-text-tertiary)", cursor: "grab", opacity: "0.4" }
414
+ }),
415
+ q(l.$slots, "item", {
416
+ item: t,
417
+ side: "target"
418
+ }, () => [
419
+ t.icon ? (c(), G(v, {
420
+ key: 0,
421
+ name: t.icon,
422
+ size: "0.875rem",
423
+ style: { flexShrink: "0", color: "var(--cui-text-secondary)" }
424
+ }, null, 8, ["name"])) : x("", !0),
425
+ s("div", ke, [
426
+ s("div", De, p(t.label), 1),
427
+ t.description ? (c(), m("div", Ve, p(t.description), 1)) : x("", !0)
428
+ ])
429
+ ])
430
+ ], 44, ze))), 128)),
431
+ L.value.length === 0 ? (c(), m("div", Ce, " No items ")) : x("", !0)
432
+ ], 36)
433
+ ], 4)
434
+ ], 4)), [
435
+ [de, !n.hidden]
436
+ ]);
437
+ };
438
+ }
439
+ });
440
+ export {
441
+ Be as default
442
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CuiTransferList.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,180 @@
1
+ import { defineComponent as I, computed as y, ref as b, watch as E, nextTick as H, resolveComponent as R, openBlock as n, createElementBlock as o, normalizeStyle as l, createCommentVNode as c, createElementVNode as k, createBlock as $, renderSlot as S, createTextVNode as Y, toDisplayString as V, Fragment as F, renderList as P, withCtx as W, mergeProps as X } from "vue";
2
+ import C from "./CuiIcon.vue.js";
3
+ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, w = "var(--cui-border-strong, var(--cui-border))", O = /* @__PURE__ */ I({
4
+ __name: "CuiTreeNode",
5
+ props: {
6
+ node: {},
7
+ depth: {},
8
+ isLast: { type: Boolean },
9
+ expanded: {},
10
+ selectedSet: {},
11
+ selectable: { type: Boolean },
12
+ showLines: { type: Boolean },
13
+ animated: { type: Boolean },
14
+ cfg: {}
15
+ },
16
+ emits: ["toggle-expand", "select-node"],
17
+ setup(e, { emit: z }) {
18
+ const t = e, r = z, s = y(() => t.node.children && t.node.children.length > 0), u = y(() => t.expanded.has(t.node.id)), v = y(() => t.selectedSet.has(t.node.id)), f = b(null), i = b(void 0), h = b(u.value);
19
+ E(u, (d) => {
20
+ if (!t.animated) {
21
+ h.value = d;
22
+ return;
23
+ }
24
+ d ? (h.value = !0, i.value = "0px", H(() => {
25
+ f.value && (i.value = f.value.scrollHeight + "px", setTimeout(() => {
26
+ i.value = void 0;
27
+ }, 250));
28
+ })) : f.value && (i.value = f.value.scrollHeight + "px", requestAnimationFrame(() => {
29
+ i.value = "0px", setTimeout(() => {
30
+ h.value = !1, i.value = void 0;
31
+ }, 250);
32
+ }));
33
+ });
34
+ function L(d) {
35
+ d.stopPropagation(), r("toggle-expand", t.node);
36
+ }
37
+ function T() {
38
+ s.value && !t.selectable ? r("toggle-expand", t.node) : r("select-node", t.node);
39
+ }
40
+ const m = y(() => t.cfg.padX);
41
+ return (d, a) => {
42
+ const B = R("CuiTreeNode", !0);
43
+ return n(), o("div", {
44
+ role: "treeitem",
45
+ "aria-expanded": s.value ? u.value : void 0,
46
+ style: { position: "relative" }
47
+ }, [
48
+ e.showLines && e.depth > 0 && !e.isLast ? (n(), o("div", {
49
+ key: 0,
50
+ style: l({
51
+ position: "absolute",
52
+ left: `calc((${e.depth} - 1) * ${e.cfg.indent} + ${m.value} + 0.5rem)`,
53
+ top: "0",
54
+ bottom: "0",
55
+ width: "0",
56
+ borderLeft: `1px solid ${w}`,
57
+ zIndex: "0"
58
+ })
59
+ }, null, 4)) : c("", !0),
60
+ e.showLines && e.depth > 0 && e.isLast ? (n(), o("div", {
61
+ key: 1,
62
+ style: l({
63
+ position: "absolute",
64
+ left: `calc((${e.depth} - 1) * ${e.cfg.indent} + ${m.value} + 0.5rem)`,
65
+ top: "0",
66
+ height: `calc(${e.cfg.padY} + 0.625em)`,
67
+ width: "0",
68
+ borderLeft: `1px solid ${w}`,
69
+ zIndex: "0"
70
+ })
71
+ }, null, 4)) : c("", !0),
72
+ e.showLines && e.depth > 0 ? (n(), o("div", {
73
+ key: 2,
74
+ style: l({
75
+ position: "absolute",
76
+ left: `calc((${e.depth} - 1) * ${e.cfg.indent} + ${m.value} + 0.5rem)`,
77
+ top: `calc(${e.cfg.padY} + 0.625em)`,
78
+ width: `calc(${e.cfg.indent} * 0.5)`,
79
+ height: "0",
80
+ borderTop: `1px solid ${w}`,
81
+ zIndex: "0"
82
+ })
83
+ }, null, 4)) : c("", !0),
84
+ k("div", {
85
+ style: l({
86
+ display: "flex",
87
+ alignItems: "center",
88
+ gap: "calc(0.25rem * var(--cui-density-scale, 1))",
89
+ paddingTop: e.cfg.padY,
90
+ paddingRight: e.cfg.padX,
91
+ paddingBottom: e.cfg.padY,
92
+ paddingLeft: `calc(${m.value} + ${e.depth} * ${e.cfg.indent})`,
93
+ fontSize: e.cfg.fontSize,
94
+ cursor: e.node.disabled ? "default" : "pointer",
95
+ borderRadius: "0.25rem",
96
+ background: v.value ? "var(--cui-primary-bg)" : "transparent",
97
+ color: e.node.disabled ? "var(--cui-text-tertiary)" : v.value ? "var(--cui-primary)" : "var(--cui-text-body)",
98
+ fontWeight: v.value ? "600" : "400",
99
+ opacity: e.node.disabled ? "0.5" : "1",
100
+ transition: "background 0.1s ease",
101
+ position: "relative",
102
+ zIndex: "1"
103
+ }),
104
+ onClick: T
105
+ }, [
106
+ k("div", {
107
+ style: l({
108
+ width: e.cfg.iconSize,
109
+ height: e.cfg.iconSize,
110
+ display: "flex",
111
+ alignItems: "center",
112
+ justifyContent: "center",
113
+ flexShrink: "0",
114
+ transition: "transform 0.15s ease",
115
+ transform: u.value ? "rotate(90deg)" : "rotate(0deg)"
116
+ }),
117
+ onClick: a[0] || (a[0] = (x) => s.value && L(x))
118
+ }, [
119
+ s.value ? (n(), $(C, {
120
+ key: 0,
121
+ name: "caret-right",
122
+ size: e.cfg.iconSize,
123
+ style: { color: "var(--cui-text-tertiary)" }
124
+ }, null, 8, ["size"])) : c("", !0)
125
+ ], 4),
126
+ e.node.icon ? (n(), $(C, {
127
+ key: 0,
128
+ name: e.node.icon,
129
+ size: e.cfg.iconSize,
130
+ style: l({ flexShrink: "0", color: v.value ? "var(--cui-primary)" : "var(--cui-text-secondary)" })
131
+ }, null, 8, ["name", "size", "style"])) : c("", !0),
132
+ k("div", q, [
133
+ S(d.$slots, "node", {
134
+ node: e.node,
135
+ selected: v.value,
136
+ expanded: u.value,
137
+ depth: e.depth
138
+ }, () => [
139
+ Y(V(e.node.label), 1)
140
+ ])
141
+ ])
142
+ ], 4),
143
+ s.value && h.value ? (n(), o("div", {
144
+ key: 3,
145
+ ref_key: "childrenRef",
146
+ ref: f,
147
+ style: l({
148
+ position: "relative",
149
+ overflow: e.animated ? "hidden" : void 0,
150
+ maxHeight: i.value,
151
+ transition: e.animated ? "max-height 0.25s ease" : void 0
152
+ })
153
+ }, [
154
+ (n(!0), o(F, null, P(e.node.children, (x, N) => (n(), $(B, {
155
+ key: String(x.id),
156
+ node: x,
157
+ depth: e.depth + 1,
158
+ "is-last": N === e.node.children.length - 1,
159
+ expanded: e.expanded,
160
+ "selected-set": e.selectedSet,
161
+ selectable: e.selectable,
162
+ "show-lines": e.showLines,
163
+ animated: e.animated,
164
+ cfg: e.cfg,
165
+ onToggleExpand: a[1] || (a[1] = (g) => r("toggle-expand", g)),
166
+ onSelectNode: a[2] || (a[2] = (g) => r("select-node", g))
167
+ }, {
168
+ node: W((g) => [
169
+ S(d.$slots, "node", X({ ref_for: !0 }, g))
170
+ ]),
171
+ _: 3
172
+ }, 8, ["node", "depth", "is-last", "expanded", "selected-set", "selectable", "show-lines", "animated", "cfg"]))), 128))
173
+ ], 4)) : c("", !0)
174
+ ], 8, j);
175
+ };
176
+ }
177
+ });
178
+ export {
179
+ O as default
180
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CuiTreeNode.vue.js";
2
+ export {
3
+ f as default
4
+ };