@itguy614/clean-ui 1.2.2 → 1.3.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 (245) hide show
  1. package/README.md +12 -0
  2. package/dist/clean-ui.css +1 -1
  3. package/dist/components/CuiAccordion.vue.js +2 -2
  4. package/dist/components/CuiAlert.vue.d.ts +3 -5
  5. package/dist/components/CuiAlert.vue.d.ts.map +1 -1
  6. package/dist/components/CuiAlert.vue.js +1 -1
  7. package/dist/components/CuiAlert.vue2.js +54 -50
  8. package/dist/components/CuiBadge.vue.js +3 -3
  9. package/dist/components/CuiBadge.vue2.js +23 -23
  10. package/dist/components/CuiBanner.vue.d.ts +15 -10
  11. package/dist/components/CuiBanner.vue.d.ts.map +1 -1
  12. package/dist/components/CuiBanner.vue.js +5 -80
  13. package/dist/components/CuiBanner.vue2.js +90 -2
  14. package/dist/components/CuiButton.vue.d.ts +9 -0
  15. package/dist/components/CuiButton.vue.d.ts.map +1 -1
  16. package/dist/components/CuiButton.vue.js +1 -1
  17. package/dist/components/CuiButton.vue2.js +77 -83
  18. package/dist/components/CuiButtonGroup.vue.d.ts +4 -2
  19. package/dist/components/CuiButtonGroup.vue.d.ts.map +1 -1
  20. package/dist/components/CuiButtonGroup.vue.js +1 -1
  21. package/dist/components/CuiButtonGroup.vue2.js +18 -9
  22. package/dist/components/CuiCard.vue.d.ts.map +1 -1
  23. package/dist/components/CuiCard.vue.js +5 -33
  24. package/dist/components/CuiCard.vue2.js +32 -2
  25. package/dist/components/CuiCardBody.vue.d.ts.map +1 -1
  26. package/dist/components/CuiCardBody.vue.js +5 -18
  27. package/dist/components/CuiCardBody.vue2.js +18 -2
  28. package/dist/components/CuiCardFooter.vue.d.ts.map +1 -1
  29. package/dist/components/CuiCardFooter.vue.js +5 -30
  30. package/dist/components/CuiCardFooter.vue2.js +25 -2
  31. package/dist/components/CuiCardHeader.vue.d.ts +5 -4
  32. package/dist/components/CuiCardHeader.vue.d.ts.map +1 -1
  33. package/dist/components/CuiCardHeader.vue.js +5 -49
  34. package/dist/components/CuiCardHeader.vue2.js +40 -2
  35. package/dist/components/CuiCardMedia.vue.d.ts.map +1 -1
  36. package/dist/components/CuiCardMedia.vue.js +3 -3
  37. package/dist/components/CuiCardMedia.vue2.js +6 -6
  38. package/dist/components/CuiCheckbox.vue.d.ts +2 -2
  39. package/dist/components/CuiCheckbox.vue.d.ts.map +1 -1
  40. package/dist/components/CuiCheckbox.vue.js +1 -1
  41. package/dist/components/CuiCheckbox.vue2.js +46 -34
  42. package/dist/components/CuiCheckboxGroup.vue.d.ts +2 -2
  43. package/dist/components/CuiCheckboxGroup.vue.d.ts.map +1 -1
  44. package/dist/components/CuiCheckboxGroup.vue.js +2 -2
  45. package/dist/components/CuiCheckboxGroup.vue2.js +45 -35
  46. package/dist/components/CuiCodeBlock.vue.d.ts.map +1 -1
  47. package/dist/components/CuiCodeBlock.vue.js +14 -11
  48. package/dist/components/CuiColorPicker.vue.d.ts +2 -2
  49. package/dist/components/CuiColorPicker.vue.d.ts.map +1 -1
  50. package/dist/components/CuiColorPicker.vue.js +117 -104
  51. package/dist/components/CuiCombobox.vue.d.ts +2 -2
  52. package/dist/components/CuiCombobox.vue.d.ts.map +1 -1
  53. package/dist/components/CuiCombobox.vue.js +5 -330
  54. package/dist/components/CuiCombobox.vue2.js +330 -2
  55. package/dist/components/CuiConfirmDialog.vue.d.ts +5 -4
  56. package/dist/components/CuiConfirmDialog.vue.d.ts.map +1 -1
  57. package/dist/components/CuiConfirmDialog.vue.js +84 -73
  58. package/dist/components/CuiContextMenu.vue.d.ts +40 -1
  59. package/dist/components/CuiContextMenu.vue.d.ts.map +1 -1
  60. package/dist/components/CuiContextMenu.vue.js +1 -1
  61. package/dist/components/CuiContextMenu.vue2.js +149 -91
  62. package/dist/components/CuiCopyButton.vue.d.ts.map +1 -1
  63. package/dist/components/CuiCopyButton.vue.js +5 -61
  64. package/dist/components/CuiCopyButton.vue2.js +68 -2
  65. package/dist/components/CuiDataGridCardView.vue.d.ts.map +1 -1
  66. package/dist/components/CuiDataGridCardView.vue.js +10 -9
  67. package/dist/components/CuiDataGridColumnManager.vue.d.ts.map +1 -1
  68. package/dist/components/CuiDataGridColumnManager.vue.js +12 -11
  69. package/dist/components/CuiDataGridPagination.vue.d.ts.map +1 -1
  70. package/dist/components/CuiDataGridPagination.vue.js +9 -8
  71. package/dist/components/CuiDataGridSearch.vue.d.ts.map +1 -1
  72. package/dist/components/CuiDataGridSearch.vue.js +12 -9
  73. package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
  74. package/dist/components/CuiDataGridTable.vue.js +213 -190
  75. package/dist/components/CuiDataGridViewManager.vue.d.ts.map +1 -1
  76. package/dist/components/CuiDataGridViewManager.vue.js +21 -20
  77. package/dist/components/CuiDatePicker.vue.d.ts +2 -2
  78. package/dist/components/CuiDatePicker.vue.d.ts.map +1 -1
  79. package/dist/components/CuiDatePicker.vue.js +257 -173
  80. package/dist/components/CuiDateRangePicker.vue.d.ts +2 -2
  81. package/dist/components/CuiDateRangePicker.vue.d.ts.map +1 -1
  82. package/dist/components/CuiDateRangePicker.vue.js +262 -179
  83. package/dist/components/CuiDivider.vue.d.ts +1 -3
  84. package/dist/components/CuiDivider.vue.d.ts.map +1 -1
  85. package/dist/components/CuiDivider.vue.js +47 -59
  86. package/dist/components/CuiDropdownMenu.vue.js +2 -2
  87. package/dist/components/CuiDropdownRadioGroup.vue.d.ts +4 -1
  88. package/dist/components/CuiDropdownRadioGroup.vue.d.ts.map +1 -1
  89. package/dist/components/CuiDropdownRadioGroup.vue.js +27 -14
  90. package/dist/components/CuiDropdownSub.vue.js +2 -2
  91. package/dist/components/CuiEmptyState.vue.d.ts +5 -4
  92. package/dist/components/CuiEmptyState.vue.d.ts.map +1 -1
  93. package/dist/components/CuiEmptyState.vue.js +1 -1
  94. package/dist/components/CuiEmptyState.vue2.js +30 -24
  95. package/dist/components/CuiFieldset.vue.d.ts.map +1 -1
  96. package/dist/components/CuiFieldset.vue.js +1 -1
  97. package/dist/components/CuiFieldset.vue2.js +21 -21
  98. package/dist/components/CuiFileUpload.vue.d.ts +2 -2
  99. package/dist/components/CuiFileUpload.vue.d.ts.map +1 -1
  100. package/dist/components/CuiFileUpload.vue.js +70 -57
  101. package/dist/components/CuiFormField.vue.d.ts.map +1 -1
  102. package/dist/components/CuiFormField.vue.js +2 -2
  103. package/dist/components/CuiFormField.vue2.js +48 -42
  104. package/dist/components/CuiInput.vue.d.ts +2 -2
  105. package/dist/components/CuiInput.vue.d.ts.map +1 -1
  106. package/dist/components/CuiInput.vue.js +1 -1
  107. package/dist/components/CuiInput.vue2.js +97 -85
  108. package/dist/components/CuiInputStepper.vue.d.ts +2 -2
  109. package/dist/components/CuiInputStepper.vue.d.ts.map +1 -1
  110. package/dist/components/CuiInputStepper.vue.js +5 -187
  111. package/dist/components/CuiInputStepper.vue2.js +237 -2
  112. package/dist/components/CuiKbd.vue.d.ts.map +1 -1
  113. package/dist/components/CuiKbd.vue.js +6 -5
  114. package/dist/components/CuiMaskedInput.vue.d.ts +9 -3
  115. package/dist/components/CuiMaskedInput.vue.d.ts.map +1 -1
  116. package/dist/components/CuiMaskedInput.vue.js +132 -117
  117. package/dist/components/CuiModal.vue.d.ts +10 -2
  118. package/dist/components/CuiModal.vue.d.ts.map +1 -1
  119. package/dist/components/CuiModal.vue.js +2 -2
  120. package/dist/components/CuiModal.vue2.js +48 -44
  121. package/dist/components/CuiModalBody.vue.d.ts.map +1 -1
  122. package/dist/components/CuiModalBody.vue.js +16 -13
  123. package/dist/components/CuiModalFooter.vue.d.ts.map +1 -1
  124. package/dist/components/CuiModalFooter.vue.js +3 -2
  125. package/dist/components/CuiModalHeader.vue.d.ts +13 -4
  126. package/dist/components/CuiModalHeader.vue.d.ts.map +1 -1
  127. package/dist/components/CuiModalHeader.vue.js +54 -42
  128. package/dist/components/CuiPagination.vue.d.ts.map +1 -1
  129. package/dist/components/CuiPagination.vue.js +1 -1
  130. package/dist/components/CuiPagination.vue2.js +28 -25
  131. package/dist/components/CuiPopover.vue.d.ts.map +1 -1
  132. package/dist/components/CuiPopover.vue.js +80 -72
  133. package/dist/components/CuiRadio.vue.d.ts +2 -4
  134. package/dist/components/CuiRadio.vue.d.ts.map +1 -1
  135. package/dist/components/CuiRadio.vue.js +2 -2
  136. package/dist/components/CuiRadio.vue2.js +88 -74
  137. package/dist/components/CuiRadioGroup.vue.d.ts +2 -2
  138. package/dist/components/CuiRadioGroup.vue.d.ts.map +1 -1
  139. package/dist/components/CuiRadioGroup.vue.js +3 -3
  140. package/dist/components/CuiRadioGroup.vue2.js +47 -37
  141. package/dist/components/CuiRating.vue.d.ts.map +1 -1
  142. package/dist/components/CuiRating.vue.js +15 -14
  143. package/dist/components/CuiResizablePanels.vue.d.ts.map +1 -1
  144. package/dist/components/CuiResizablePanels.vue.js +10 -9
  145. package/dist/components/CuiSelect.vue.d.ts +2 -2
  146. package/dist/components/CuiSelect.vue.d.ts.map +1 -1
  147. package/dist/components/CuiSelect.vue.js +2 -2
  148. package/dist/components/CuiSelect.vue2.js +161 -151
  149. package/dist/components/CuiSkeleton.vue.js +2 -2
  150. package/dist/components/CuiSkeleton.vue2.js +10 -10
  151. package/dist/components/CuiSlideover.vue.d.ts +2 -2
  152. package/dist/components/CuiSlideover.vue.d.ts.map +1 -1
  153. package/dist/components/CuiSlideover.vue.js +34 -30
  154. package/dist/components/CuiSlider.vue.d.ts +2 -2
  155. package/dist/components/CuiSlider.vue.d.ts.map +1 -1
  156. package/dist/components/CuiSlider.vue.js +5 -154
  157. package/dist/components/CuiSlider.vue2.js +171 -2
  158. package/dist/components/CuiSpinner.vue.d.ts.map +1 -1
  159. package/dist/components/CuiSpinner.vue.js +5 -4
  160. package/dist/components/CuiTable.vue.d.ts.map +1 -1
  161. package/dist/components/CuiTable.vue.js +4 -1
  162. package/dist/components/CuiTableBody.vue.d.ts.map +1 -1
  163. package/dist/components/CuiTableBody.vue.js +6 -6
  164. package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
  165. package/dist/components/CuiTableCell.vue.js +11 -10
  166. package/dist/components/CuiTableFoot.vue.d.ts.map +1 -1
  167. package/dist/components/CuiTableFoot.vue.js +7 -7
  168. package/dist/components/CuiTableHead.vue.d.ts.map +1 -1
  169. package/dist/components/CuiTableHead.vue.js +7 -7
  170. package/dist/components/CuiTabs.vue.d.ts.map +1 -1
  171. package/dist/components/CuiTabs.vue.js +2 -2
  172. package/dist/components/CuiTabs.vue2.js +81 -76
  173. package/dist/components/CuiTagInput.vue.d.ts +2 -2
  174. package/dist/components/CuiTagInput.vue.d.ts.map +1 -1
  175. package/dist/components/CuiTagInput.vue.js +5 -294
  176. package/dist/components/CuiTagInput.vue2.js +276 -2
  177. package/dist/components/CuiTextarea.vue.d.ts +2 -2
  178. package/dist/components/CuiTextarea.vue.d.ts.map +1 -1
  179. package/dist/components/CuiTextarea.vue.js +4 -4
  180. package/dist/components/CuiTextarea.vue2.js +73 -59
  181. package/dist/components/CuiTimePicker.vue.d.ts +2 -2
  182. package/dist/components/CuiTimePicker.vue.d.ts.map +1 -1
  183. package/dist/components/CuiTimePicker.vue.js +172 -97
  184. package/dist/components/CuiTimeline.vue.d.ts.map +1 -1
  185. package/dist/components/CuiTimeline.vue.js +6 -5
  186. package/dist/components/CuiTimelineItem.vue.d.ts.map +1 -1
  187. package/dist/components/CuiTimelineItem.vue.js +11 -10
  188. package/dist/components/CuiToast.vue.d.ts +8 -10
  189. package/dist/components/CuiToast.vue.d.ts.map +1 -1
  190. package/dist/components/CuiToast.vue.js +2 -2
  191. package/dist/components/CuiToast.vue2.js +69 -67
  192. package/dist/components/CuiToggle.vue.d.ts +2 -2
  193. package/dist/components/CuiToggle.vue.d.ts.map +1 -1
  194. package/dist/components/CuiToggle.vue.js +2 -2
  195. package/dist/components/CuiToggle.vue2.js +71 -59
  196. package/dist/components/CuiToggleGroup.vue.d.ts +2 -2
  197. package/dist/components/CuiToggleGroup.vue.d.ts.map +1 -1
  198. package/dist/components/CuiToggleGroup.vue.js +2 -2
  199. package/dist/components/CuiToggleGroup.vue2.js +45 -35
  200. package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
  201. package/dist/components/CuiTooltip.vue.js +2 -2
  202. package/dist/components/CuiTooltip.vue2.js +49 -45
  203. package/dist/components/CuiTransferList.vue.d.ts.map +1 -1
  204. package/dist/components/CuiTransferList.vue.js +31 -30
  205. package/dist/components/CuiTreeNode.vue.d.ts +9 -2
  206. package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
  207. package/dist/components/CuiTreeNode.vue.js +5 -179
  208. package/dist/components/CuiTreeNode.vue2.js +198 -2
  209. package/dist/components/CuiTreeView.vue.d.ts +33 -5
  210. package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
  211. package/dist/components/CuiTreeView.vue.js +187 -44
  212. package/dist/composables/useCalendarKeyboard.d.ts +48 -0
  213. package/dist/composables/useCalendarKeyboard.d.ts.map +1 -0
  214. package/dist/composables/useCalendarKeyboard.js +91 -0
  215. package/dist/composables/useFieldDescribedBy.d.ts +30 -0
  216. package/dist/composables/useFieldDescribedBy.d.ts.map +1 -0
  217. package/dist/composables/useFieldDescribedBy.js +11 -0
  218. package/dist/composables/useMessages.d.ts.map +1 -1
  219. package/dist/composables/useMessages.js +6 -6
  220. package/dist/composables/usePopover.d.ts.map +1 -1
  221. package/dist/composables/usePopover.js +10 -0
  222. package/dist/composables/useScrollShadows.d.ts +3 -0
  223. package/dist/composables/useScrollShadows.d.ts.map +1 -1
  224. package/dist/composables/useScrollShadows.js +15 -12
  225. package/dist/icons/builtin.d.ts.map +1 -1
  226. package/dist/icons/builtin.js +38 -37
  227. package/dist/index.d.ts +3 -2
  228. package/dist/index.d.ts.map +1 -1
  229. package/dist/index.js +185 -182
  230. package/dist/messages.d.ts +39 -4
  231. package/dist/messages.d.ts.map +1 -1
  232. package/dist/messages.js +8 -7
  233. package/dist/types/common.d.ts +90 -0
  234. package/dist/types/common.d.ts.map +1 -1
  235. package/dist/utils/colorIconMap.d.ts +47 -3
  236. package/dist/utils/colorIconMap.d.ts.map +1 -1
  237. package/dist/utils/colorIconMap.js +20 -5
  238. package/dist/utils/date.d.ts +13 -0
  239. package/dist/utils/date.d.ts.map +1 -1
  240. package/dist/utils/date.js +46 -40
  241. package/dist/utils/sizing.d.ts +26 -1
  242. package/dist/utils/sizing.d.ts.map +1 -1
  243. package/dist/utils/sizing.js +22 -21
  244. package/dist/version.js +1 -1
  245. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
- import { defineComponent as t, provide as n, withDirectives as l, openBlock as r, createElementBlock as a, renderSlot as i, vShow as d } from "vue";
2
- import { TableSectionContextKey as s } from "./table-context.js";
3
- const m = /* @__PURE__ */ t({
1
+ import { defineComponent as t, provide as n, withDirectives as a, openBlock as i, createElementBlock as l, renderSlot as r, vShow as s } from "vue";
2
+ import { TableSectionContextKey as c } from "./table-context.js";
3
+ const d = { class: "cui-table-foot" }, u = /* @__PURE__ */ t({
4
4
  __name: "CuiTableFoot",
5
5
  props: {
6
6
  hidden: { type: Boolean, default: !1 }
7
7
  },
8
8
  setup(e) {
9
- return n(s, { isHead: !1 }), (o, f) => l((r(), a("tfoot", null, [
10
- i(o.$slots, "default")
9
+ return n(c, { isHead: !1 }), (o, f) => a((i(), l("tfoot", d, [
10
+ r(o.$slots, "default")
11
11
  ], 512)), [
12
- [d, !e.hidden]
12
+ [s, !e.hidden]
13
13
  ]);
14
14
  }
15
15
  });
16
16
  export {
17
- m as default
17
+ u as default
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CuiTableHead.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTableHead.vue"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;CACvD;AAgCD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAoB/C,QAAA,MAAM,eAAe;;6EAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CuiTableHead.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTableHead.vue"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;CACvD;AAkCD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAoB/C,QAAA,MAAM,eAAe;;6EAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,18 +1,18 @@
1
- import { defineComponent as o, provide as n, withDirectives as r, openBlock as a, createElementBlock as l, renderSlot as d, vShow as i } from "vue";
2
- import { TableSectionContextKey as p } from "./table-context.js";
3
- const f = /* @__PURE__ */ o({
1
+ import { defineComponent as o, provide as a, withDirectives as n, openBlock as r, createElementBlock as d, renderSlot as i, vShow as l } from "vue";
2
+ import { TableSectionContextKey as s } from "./table-context.js";
3
+ const c = { class: "cui-table-head" }, h = /* @__PURE__ */ o({
4
4
  __name: "CuiTableHead",
5
5
  props: {
6
6
  hidden: { type: Boolean, default: !1 }
7
7
  },
8
8
  setup(e) {
9
- return n(p, { isHead: !0 }), (t, s) => r((a(), l("thead", null, [
10
- d(t.$slots, "default")
9
+ return a(s, { isHead: !0 }), (t, p) => n((r(), d("thead", c, [
10
+ i(t.$slots, "default")
11
11
  ], 512)), [
12
- [i, !e.hidden]
12
+ [l, !e.hidden]
13
13
  ]);
14
14
  }
15
15
  });
16
16
  export {
17
- f as default
17
+ h as default
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CuiTabs.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTabs.vue"],"names":[],"mappings":"AA2fA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGrE,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,cAAc;IACjE,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AA2WD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAgC/C,QAAA,MAAM,eAAe;;;;;;;;;aApZT,UAAU;iBAEN,cAAc;gBAIf,aAAa;eAFd,OAAO;6EAwZnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CuiTabs.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTabs.vue"],"names":[],"mappings":"AA8gBA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGrE,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,cAAc;IACjE,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAyXD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAgC/C,QAAA,MAAM,eAAe;;;;;;;;;aAlaT,UAAU;iBAEN,cAAc;gBAIf,aAAa;eAFd,OAAO;6EAsanB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./CuiTabs.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ed16f53a"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3da0079d"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as H, ref as b, watch as _, provide as K, toRef as m, onMounted as M, nextTick as S, onBeforeUnmount as N, computed as L, withDirectives as O, openBlock as v, createElementBlock as h, normalizeClass as T, createElementVNode as k, Fragment as $, renderList as U, normalizeStyle as W, createBlock as q, resolveDynamicComponent as F, createTextVNode as j, toDisplayString as G, withModifiers as J, unref as P, createVNode as Q, createCommentVNode as X, renderSlot as Y, vShow as Z } from "vue";
2
- import ee from "./CuiIcon.vue.js";
3
- import { TabsContextKey as te } from "./tabs-context.js";
4
- import { useMessages as ae } from "../composables/useMessages.js";
5
- const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-overflow"], ne = ["data-cui-tab-value", "aria-selected", "aria-disabled", "tabindex", "onClick"], ie = { class: "cui-tabs__tab-content" }, re = ["aria-label", "onClick"], ue = { class: "cui-tabs__panels" }, fe = /* @__PURE__ */ H({
1
+ import { defineComponent as M, ref as b, watch as _, provide as N, toRef as m, onMounted as L, nextTick as z, onBeforeUnmount as O, computed as U, withDirectives as W, openBlock as v, createElementBlock as h, normalizeClass as T, createElementVNode as k, Fragment as A, renderList as q, normalizeStyle as F, createBlock as j, resolveDynamicComponent as G, createTextVNode as J, toDisplayString as P, withModifiers as Q, unref as X, createVNode as Y, createCommentVNode as Z, renderSlot as ee, vShow as te } from "vue";
2
+ import ae from "./CuiIcon.vue.js";
3
+ import { TabsContextKey as oe } from "./tabs-context.js";
4
+ import { useMessages as le } from "../composables/useMessages.js";
5
+ const ne = { class: "cui-tabs__bar-outer" }, ie = ["aria-orientation", "data-overflow"], re = ["data-cui-tab-value", "aria-selected", "aria-disabled", "tabindex", "onClick"], se = { class: "cui-tabs__tab-content" }, ue = ["aria-label", "onClick"], ce = { class: "cui-tabs__panels" }, me = /* @__PURE__ */ M({
6
6
  __name: "CuiTabs",
7
7
  props: {
8
8
  modelValue: {},
@@ -14,29 +14,29 @@ const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-ove
14
14
  color: { default: "primary" }
15
15
  },
16
16
  emits: ["update:modelValue", "close"],
17
- setup(r, { emit: A }) {
18
- const n = r, x = A, o = b(n.modelValue ?? ""), p = b(""), l = b([]), f = b(null);
17
+ setup(i, { emit: D }) {
18
+ const n = i, g = D, o = b(n.modelValue ?? ""), p = b(""), l = b([]), f = b(null);
19
19
  _(
20
20
  () => n.modelValue,
21
21
  (e) => {
22
22
  e !== void 0 && e !== o.value && (p.value = o.value, o.value = e);
23
23
  }
24
24
  );
25
- function D(e) {
25
+ function B(e) {
26
26
  const a = l.value.findIndex((t) => t.value === e.value);
27
- a >= 0 ? l.value[a] = e : l.value.push(e), !o.value && !e.disabled && (o.value = e.value, x("update:modelValue", e.value));
27
+ a >= 0 ? l.value[a] = e : l.value.push(e), !o.value && !e.disabled && (o.value = e.value, g("update:modelValue", e.value));
28
28
  }
29
- function B(e) {
29
+ function E(e) {
30
30
  l.value = l.value.filter((a) => a.value !== e);
31
31
  }
32
- function w(e) {
32
+ function x(e) {
33
33
  const a = l.value.find((t) => t.value === e);
34
- a != null && a.disabled || (p.value = o.value, o.value = e, x("update:modelValue", e));
34
+ a != null && a.disabled || (p.value = o.value, o.value = e, g("update:modelValue", e));
35
35
  }
36
- function V(e) {
37
- x("close", e);
36
+ function C(e) {
37
+ g("close", e);
38
38
  }
39
- K(te, {
39
+ N(oe, {
40
40
  activeTab: o,
41
41
  variant: m(n, "variant"),
42
42
  orientation: m(n, "orientation"),
@@ -44,119 +44,124 @@ const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-ove
44
44
  keepAlive: m(n, "keepAlive"),
45
45
  transition: m(n, "transition"),
46
46
  previousTab: p,
47
- register: D,
48
- unregister: B,
49
- activate: w,
50
- close: V
47
+ register: B,
48
+ unregister: E,
49
+ activate: x,
50
+ close: C
51
51
  });
52
- function E(e) {
53
- const a = l.value.filter((d) => !d.disabled), t = a.findIndex((d) => d.value === o.value);
52
+ function R(e) {
53
+ const a = l.value.filter((u) => !u.disabled), t = a.findIndex((u) => u.value === o.value);
54
54
  if (t < 0) return;
55
- const u = n.orientation === "horizontal", y = u ? "ArrowRight" : "ArrowDown", I = u ? "ArrowLeft" : "ArrowUp";
56
- let i = -1;
57
- e.key === y ? (e.preventDefault(), i = t < a.length - 1 ? t + 1 : 0) : e.key === I ? (e.preventDefault(), i = t > 0 ? t - 1 : a.length - 1) : e.key === "Home" ? (e.preventDefault(), i = 0) : e.key === "End" && (e.preventDefault(), i = a.length - 1), i >= 0 && (w(a[i].value), S(() => {
58
- var d;
59
- (d = C(a[i].value)) == null || d.focus();
60
- }));
55
+ const s = n.orientation === "horizontal", y = s ? "ArrowRight" : "ArrowDown", V = s ? "ArrowLeft" : "ArrowUp";
56
+ let r = -1;
57
+ if (e.key === y ? (e.preventDefault(), r = t < a.length - 1 ? t + 1 : 0) : e.key === V ? (e.preventDefault(), r = t > 0 ? t - 1 : a.length - 1) : e.key === "Home" ? (e.preventDefault(), r = 0) : e.key === "End" && (e.preventDefault(), r = a.length - 1), r >= 0) {
58
+ const u = a[r].value, K = u !== o.value;
59
+ x(u), z(() => {
60
+ var $;
61
+ ($ = S(u)) == null || $.focus({ preventScroll: !0 }), K || I();
62
+ });
63
+ }
61
64
  }
62
- function C(e) {
63
- var a;
64
- return ((a = f.value) == null ? void 0 : a.querySelector(`[data-cui-tab-value="${e}"]`)) ?? null;
65
+ function S(e) {
66
+ var t;
67
+ const a = e.replace(/["\\]/g, "\\$&");
68
+ return ((t = f.value) == null ? void 0 : t.querySelector(`[data-cui-tab-value="${a}"]`)) ?? null;
65
69
  }
66
- const g = b("none");
67
- function s() {
70
+ const w = b("none");
71
+ function c() {
68
72
  const e = f.value;
69
73
  if (!e) return;
70
- const a = n.orientation === "horizontal", t = a ? e.clientWidth : e.clientHeight, u = a ? e.scrollWidth : e.scrollHeight, y = Math.abs(a ? e.scrollLeft : e.scrollTop);
71
- if (u - t <= 1) {
72
- g.value = "none";
74
+ const a = n.orientation === "horizontal", t = a ? e.clientWidth : e.clientHeight, s = a ? e.scrollWidth : e.scrollHeight, y = Math.abs(a ? e.scrollLeft : e.scrollTop);
75
+ if (s - t <= 1) {
76
+ w.value = "none";
73
77
  return;
74
78
  }
75
- const I = y <= 1, i = y >= u - t - 1;
76
- g.value = I ? "end" : i ? "start" : "both";
79
+ const V = y <= 1, r = y >= s - t - 1;
80
+ w.value = V ? "end" : r ? "start" : "both";
77
81
  }
78
- function z() {
82
+ function I() {
79
83
  var e, a;
80
- (a = (e = C(o.value)) == null ? void 0 : e.scrollIntoView) == null || a.call(e, { inline: "nearest", block: "nearest" });
84
+ (a = (e = S(o.value)) == null ? void 0 : e.scrollIntoView) == null || a.call(e, { inline: "nearest", block: "nearest" });
81
85
  }
82
- let c;
83
- M(() => {
84
- S(() => {
85
- z(), s();
86
- }), typeof ResizeObserver < "u" && f.value && (c = new ResizeObserver(s), c.observe(f.value));
87
- }), N(() => {
88
- c == null || c.disconnect(), c = void 0;
86
+ let d;
87
+ L(() => {
88
+ z(() => {
89
+ I(), c();
90
+ }), typeof ResizeObserver < "u" && f.value && (d = new ResizeObserver(c), d.observe(f.value));
91
+ }), O(() => {
92
+ d == null || d.disconnect(), d = void 0;
89
93
  }), _(o, () => {
90
- z(), s();
91
- }, { flush: "post" }), _(() => l.value.length, s, { flush: "post" }), _(() => n.orientation, s, { flush: "post" }), L(() => {
94
+ I(), c();
95
+ }, { flush: "post" }), _(() => l.value.length, c, { flush: "post" }), _(() => n.orientation, c, { flush: "post" }), U(() => {
92
96
  const e = l.value.findIndex((t) => t.value === p.value);
93
97
  return l.value.findIndex((t) => t.value === o.value) >= e ? "left" : "right";
94
98
  });
95
- const R = ae();
96
- return (e, a) => O((v(), h("div", {
99
+ const H = le();
100
+ return (e, a) => W((v(), h("div", {
97
101
  class: T(["cui-tabs", [
98
- `cui-tabs--${r.variant}`,
99
- `cui-tabs--${r.orientation}`
102
+ `cui-tabs--${i.variant}`,
103
+ `cui-tabs--${i.orientation}`
100
104
  ]])
101
105
  }, [
102
- k("div", oe, [
106
+ k("div", ne, [
103
107
  k("div", {
104
108
  ref_key: "barRef",
105
109
  ref: f,
106
110
  class: "cui-tabs__bar",
107
111
  role: "tablist",
108
- "aria-orientation": r.orientation,
109
- "data-overflow": g.value,
110
- onKeydown: E,
111
- onScroll: s
112
+ "aria-orientation": i.orientation,
113
+ "data-overflow": w.value,
114
+ onKeydown: R,
115
+ onScroll: c
112
116
  }, [
113
- (v(!0), h($, null, U(l.value, (t) => (v(), h("button", {
117
+ (v(!0), h(A, null, q(l.value, (t) => (v(), h("button", {
114
118
  key: t.value,
119
+ type: "button",
115
120
  "data-cui-tab-value": t.value,
116
121
  class: T(["cui-tabs__tab", {
117
122
  "cui-tabs__tab--active": o.value === t.value,
118
123
  "cui-tabs__tab--disabled": t.disabled
119
124
  }]),
120
- style: W({
121
- "--_tab-color": `var(--cui-${r.color})`,
122
- "--_tab-hover": `var(--cui-${r.color}-hover)`,
123
- "--_tab-bg": `var(--cui-${r.color}-bg)`
125
+ style: F({
126
+ "--_tab-color": `var(--cui-${i.color})`,
127
+ "--_tab-hover": `var(--cui-${i.color}-hover)`,
128
+ "--_tab-bg": `var(--cui-${i.color}-bg)`
124
129
  }),
125
130
  role: "tab",
126
131
  "aria-selected": o.value === t.value,
127
132
  "aria-disabled": t.disabled || void 0,
128
133
  tabindex: o.value === t.value ? 0 : -1,
129
- onClick: (u) => w(t.value)
134
+ onClick: (s) => x(t.value)
130
135
  }, [
131
- k("span", ie, [
132
- t.labelSlot ? (v(), q(F(t.labelSlot), { key: 0 })) : (v(), h($, { key: 1 }, [
133
- j(G(t.label), 1)
136
+ k("span", se, [
137
+ t.labelSlot ? (v(), j(G(t.labelSlot), { key: 0 })) : (v(), h(A, { key: 1 }, [
138
+ J(P(t.label), 1)
134
139
  ], 64))
135
140
  ]),
136
141
  t.closeable ? (v(), h("button", {
137
142
  key: 0,
138
143
  type: "button",
139
144
  class: "cui-tabs__tab-close",
140
- "aria-label": P(R).tabs.closeTab,
145
+ "aria-label": X(H).tabs.closeTab,
141
146
  tabindex: "-1",
142
- onClick: J((u) => V(t.value), ["stop"])
147
+ onClick: Q((s) => C(t.value), ["stop"])
143
148
  }, [
144
- Q(ee, {
149
+ Y(ae, {
145
150
  name: "x",
146
151
  size: "0.75rem"
147
152
  })
148
- ], 8, re)) : X("", !0)
149
- ], 14, ne))), 128))
150
- ], 40, le)
153
+ ], 8, ue)) : Z("", !0)
154
+ ], 14, re))), 128))
155
+ ], 40, ie)
151
156
  ]),
152
- k("div", ue, [
153
- Y(e.$slots, "default", {}, void 0, !0)
157
+ k("div", ce, [
158
+ ee(e.$slots, "default", {}, void 0, !0)
154
159
  ])
155
160
  ], 2)), [
156
- [Z, !r.hidden]
161
+ [te, !i.hidden]
157
162
  ]);
158
163
  }
159
164
  });
160
165
  export {
161
- fe as default
166
+ me as default
162
167
  };
@@ -1,11 +1,11 @@
1
- import type { CuiColor, CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps, CuiRounded } from "../types/common";
1
+ import type { CuiColor, CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps, CuiRounded, NativeControlProps } from "../types/common";
2
2
  export interface TagOption {
3
3
  value: string;
4
4
  label?: string;
5
5
  color?: CuiColor;
6
6
  [key: string]: unknown;
7
7
  }
8
- export interface CuiTagInputProps extends HideableProps, ColorableProps, SizeableProps, DisableableProps {
8
+ export interface CuiTagInputProps extends NativeControlProps, HideableProps, ColorableProps, SizeableProps, DisableableProps {
9
9
  /** Selected tags */
10
10
  modelValue?: string[];
11
11
  /** Predefined tag suggestions */
@@ -1 +1 @@
1
- {"version":3,"file":"CuiTagInput.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTagInput.vue"],"names":[],"mappings":"AA8ZA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO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E,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,296 +1,7 @@
1
- import { defineComponent as le, ref as v, computed as h, onMounted as ne, onUnmounted as re, watch as oe, nextTick as L, withDirectives as ue, openBlock as s, createElementBlock as d, toDisplayString as x, createCommentVNode as w, createElementVNode as $, normalizeStyle as k, Fragment as q, renderList as F, createBlock as O, withCtx as ie, createTextVNode as se, Teleport as ce, createVNode as P, withModifiers as U, renderSlot as de, vShow as ve } from "vue";
2
- import { clampSize as fe } from "../utils/sizing.js";
3
- import me from "./CuiIcon.vue.js";
4
- import ge from "./CuiBadge.vue.js";
5
- import pe from "./CuiSpinner.vue.js";
6
- /* empty css */
7
- const ye = {
8
- key: 0,
9
- style: { display: "block", marginBottom: "calc(0.25rem * var(--cui-density-scale, 1))", fontSize: "0.875rem", fontWeight: "500", color: "var(--cui-text-secondary)" }
10
- }, be = ["value", "placeholder", "disabled"], he = {
11
- key: 1,
12
- style: { fontSize: "0.75rem", color: "var(--cui-error)", marginTop: "calc(0.25rem * var(--cui-density-scale, 1))" }
13
- }, xe = {
14
- key: 0,
15
- style: { padding: "calc(0.75rem * var(--cui-density-scale, 1))", textAlign: "center" }
16
- }, we = ["data-index", "onClick", "onMouseenter"], Me = /* @__PURE__ */ le({
17
- __name: "CuiTagInput",
18
- props: {
19
- modelValue: { default: () => [] },
20
- suggestions: { default: () => [] },
21
- fetchSuggestions: {},
22
- allowCreate: { type: Boolean, default: !0 },
23
- debounce: { default: 300 },
24
- minChars: { default: 0 },
25
- maxTags: { default: 0 },
26
- placeholder: { default: "Add tag..." },
27
- label: {},
28
- error: { type: Boolean, default: !1 },
29
- errorMessage: {},
30
- noSuggestionsText: { default: "No suggestions" },
31
- createText: { default: "Create" },
32
- hidden: { type: Boolean, default: !1 },
33
- rounded: { default: "md" },
34
- color: { default: "primary" },
35
- size: { default: "md" },
36
- disabled: { type: Boolean, default: !1 }
37
- },
38
- emits: ["update:modelValue"],
39
- setup(r, { expose: K, emit: Y }) {
40
- const l = r, Z = {
41
- none: "0",
42
- sm: "0.25rem",
43
- md: "var(--cui-button-radius, 0.375rem)",
44
- lg: "0.5rem",
45
- full: "9999px"
46
- }, B = Y, o = v(""), c = v(!1), u = v(-1), V = v(!1), m = v([]), f = v(null), E = v(null), g = v(null), I = v({});
47
- let S = null;
48
- const z = h(() => new Set(l.modelValue)), C = h(() => l.maxTags > 0 && l.modelValue.length >= l.maxTags);
49
- function j(e) {
50
- const a = [...l.suggestions, ...m.value].find((t) => t.value === e);
51
- return (a == null ? void 0 : a.label) ?? e;
52
- }
53
- function G(e) {
54
- const a = [...l.suggestions, ...m.value].find((t) => t.value === e);
55
- return (a == null ? void 0 : a.color) ?? l.color;
56
- }
57
- const i = h(() => {
58
- const a = (l.fetchSuggestions ? m.value : l.suggestions).filter((n) => !z.value.has(n.value));
59
- if (!o.value || l.fetchSuggestions) return a;
60
- const t = o.value.toLowerCase();
61
- return a.filter(
62
- (n) => n.value.toLowerCase().includes(t) || n.label && n.label.toLowerCase().includes(t)
63
- );
64
- }), p = h(() => {
65
- if (!l.allowCreate || !o.value.trim() || C.value) return !1;
66
- const e = o.value.trim().toLowerCase();
67
- return z.value.has(e) || z.value.has(o.value.trim()) ? !1 : ![...l.suggestions, ...m.value].map((t) => t.value.toLowerCase()).includes(e);
68
- }), D = h(() => V.value), J = ["sm", "md", "lg"], Q = {
69
- sm: { fontSize: "0.8125rem", padding: "calc(0.25rem * var(--cui-density-scale, 1)) calc(0.5rem * var(--cui-density-scale, 1))", tagSize: "sm", inputHeight: "2rem" },
70
- md: { fontSize: "0.875rem", padding: "calc(0.3125rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))", tagSize: "sm", inputHeight: "2.375rem" },
71
- lg: { fontSize: "0.9375rem", padding: "calc(0.4375rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))", tagSize: "md", inputHeight: "2.75rem" }
72
- }, y = h(() => Q[fe(l.size, J)]);
73
- function b() {
74
- if (!g.value) return;
75
- const e = g.value.getBoundingClientRect(), a = window.innerHeight, t = a - e.bottom, n = t < 200 && e.top > t, M = Math.min(240, Math.max(t, e.top) - 16), R = {
76
- position: "fixed",
77
- zIndex: "9990",
78
- left: `${e.left}px`,
79
- width: `${e.width}px`,
80
- maxHeight: `${M}px`,
81
- overflowY: "auto",
82
- background: "var(--cui-surface-base)",
83
- border: "1px solid var(--cui-border)",
84
- borderRadius: "0.5rem",
85
- boxShadow: "0 8px 24px -4px rgba(0,0,0,0.12), 0 2px 8px -2px rgba(0,0,0,0.08)",
86
- padding: "calc(0.25rem * var(--cui-density-scale, 1))"
87
- };
88
- n ? R.bottom = `${a - e.top + 4}px` : R.top = `${e.bottom + 4}px`, I.value = R;
89
- }
90
- function X(e) {
91
- if (o.value = e.target.value, u.value = -1, c.value || (c.value = !0, b()), l.fetchSuggestions) {
92
- if (o.value.length < l.minChars) {
93
- m.value = [];
94
- return;
95
- }
96
- S && clearTimeout(S), S = setTimeout(async () => {
97
- V.value = !0;
98
- try {
99
- m.value = await l.fetchSuggestions(o.value);
100
- } finally {
101
- V.value = !1;
102
- }
103
- }, l.debounce);
104
- }
105
- }
106
- function H(e) {
107
- if (l.disabled || C.value) return;
108
- const a = e.trim();
109
- !a || z.value.has(a) || (B("update:modelValue", [...l.modelValue, a]), o.value = "", u.value = -1, L(() => {
110
- var t;
111
- return (t = f.value) == null ? void 0 : t.focus();
112
- }));
113
- }
114
- function A(e) {
115
- H(e.value);
116
- }
117
- function T() {
118
- p.value && H(o.value.trim());
119
- }
120
- function N(e) {
121
- l.disabled || (B("update:modelValue", l.modelValue.filter((a) => a !== e)), L(() => {
122
- var a;
123
- return (a = f.value) == null ? void 0 : a.focus();
124
- }));
125
- }
126
- function _(e) {
127
- const a = i.value.length + (p.value ? 1 : 0);
128
- if (e.key === "ArrowDown") {
129
- if (e.preventDefault(), !c.value) {
130
- c.value = !0, b();
131
- return;
132
- }
133
- u.value = Math.min(u.value + 1, a - 1);
134
- } else e.key === "ArrowUp" ? (e.preventDefault(), u.value = Math.max(u.value - 1, 0)) : e.key === "Enter" ? (e.preventDefault(), u.value >= 0 && u.value < i.value.length ? A(i.value[u.value]) : (p.value && (u.value === i.value.length || u.value === -1) || p.value && o.value.trim()) && T()) : e.key === "," || e.key === "Tab" ? o.value.trim() && l.allowCreate && (e.preventDefault(), T()) : e.key === "Escape" ? c.value = !1 : e.key === "Backspace" && !o.value && l.modelValue.length > 0 && N(l.modelValue[l.modelValue.length - 1]);
135
- }
136
- function W(e) {
137
- var t, n;
138
- const a = e.target;
139
- (t = g.value) != null && t.contains(a) || (n = E.value) != null && n.contains(a) || (c.value = !1);
140
- }
141
- function ee() {
142
- !l.disabled && !C.value && (c.value = !0, b());
143
- }
144
- ne(() => {
145
- document.addEventListener("mousedown", W), window.addEventListener("scroll", () => {
146
- c.value && b();
147
- }, !0), window.addEventListener("resize", () => {
148
- c.value && b();
149
- });
150
- }), re(() => {
151
- document.removeEventListener("mousedown", W), S && clearTimeout(S);
152
- }), oe(c, (e) => {
153
- e || (o.value = ""), e && L(b);
154
- });
155
- function ae(e) {
156
- var a;
157
- f.value ? f.value.focus(e) : (a = g.value) == null || a.focus(e);
158
- }
159
- function te() {
160
- var e;
161
- (e = f.value) == null || e.blur();
162
- }
163
- return K({ el: g, focus: ae, blur: te }), (e, a) => ue((s(), d("div", {
164
- ref_key: "wrapperRef",
165
- ref: g,
166
- style: { position: "relative" }
167
- }, [
168
- r.label ? (s(), d("label", ye, x(r.label), 1)) : w("", !0),
169
- $("div", {
170
- style: k({
171
- display: "flex",
172
- flexWrap: "wrap",
173
- alignItems: "center",
174
- gap: "calc(0.25rem * var(--cui-density-scale, 1))",
175
- padding: y.value.padding,
176
- border: `1px solid ${r.error ? "var(--cui-error)" : "var(--cui-border-strong, var(--cui-border))"}`,
177
- borderRadius: Z[r.rounded],
178
- background: "var(--cui-surface-base, white)",
179
- cursor: r.disabled ? "default" : "text",
180
- opacity: r.disabled ? "0.5" : "1",
181
- minHeight: y.value.inputHeight
182
- }),
183
- onClick: a[0] || (a[0] = (t) => {
184
- var n;
185
- return (n = f.value) == null ? void 0 : n.focus();
186
- })
187
- }, [
188
- (s(!0), d(q, null, F(r.modelValue, (t) => (s(), O(ge, {
189
- key: t,
190
- color: G(t),
191
- size: y.value.tagSize,
192
- removable: "",
193
- onRemove: (n) => N(t)
194
- }, {
195
- default: ie(() => [
196
- se(x(j(t)), 1)
197
- ]),
198
- _: 2
199
- }, 1032, ["color", "size", "onRemove"]))), 128)),
200
- C.value ? w("", !0) : (s(), d("input", {
201
- key: 0,
202
- ref_key: "inputRef",
203
- ref: f,
204
- value: o.value,
205
- placeholder: r.modelValue.length > 0 ? "" : r.placeholder,
206
- disabled: r.disabled,
207
- style: k({
208
- flex: "1",
209
- minWidth: "4rem",
210
- border: "none",
211
- outline: "none",
212
- background: "transparent",
213
- fontSize: y.value.fontSize,
214
- color: "var(--cui-text-body)",
215
- padding: "calc(0.125rem * var(--cui-density-scale, 1)) 0",
216
- fontFamily: "inherit"
217
- }),
218
- onInput: X,
219
- onFocus: ee,
220
- onKeydown: _
221
- }, null, 44, be))
222
- ], 4),
223
- r.error && r.errorMessage ? (s(), d("div", he, x(r.errorMessage), 1)) : w("", !0),
224
- (s(), O(ce, { to: "body" }, [
225
- c.value && (i.value.length > 0 || p.value || D.value) ? (s(), d("div", {
226
- key: 0,
227
- ref_key: "dropdownRef",
228
- ref: E,
229
- style: k(I.value)
230
- }, [
231
- D.value && i.value.length === 0 ? (s(), d("div", xe, [
232
- P(pe, {
233
- size: "xs",
234
- "show-label": "",
235
- label: "Searching..."
236
- })
237
- ])) : w("", !0),
238
- (s(!0), d(q, null, F(i.value, (t, n) => (s(), d("div", {
239
- key: t.value,
240
- "data-index": n,
241
- style: k({
242
- display: "flex",
243
- alignItems: "center",
244
- gap: "calc(0.5rem * var(--cui-density-scale, 1))",
245
- padding: "calc(0.4375rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))",
246
- cursor: "pointer",
247
- fontSize: y.value.fontSize,
248
- borderRadius: "0.25rem",
249
- background: u.value === n ? "var(--cui-primary-bg)" : "transparent",
250
- color: "var(--cui-text-body)",
251
- transition: "background 0.1s ease"
252
- }),
253
- onClick: U((M) => A(t), ["stop"]),
254
- onMouseenter: (M) => u.value = n
255
- }, [
256
- de(e.$slots, "suggestion", { suggestion: t }, () => [
257
- $("span", null, x(t.label || t.value), 1)
258
- ])
259
- ], 44, we))), 128)),
260
- p.value ? (s(), d("div", {
261
- key: 1,
262
- style: k({
263
- display: "flex",
264
- alignItems: "center",
265
- gap: "calc(0.375rem * var(--cui-density-scale, 1))",
266
- padding: "calc(0.4375rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))",
267
- cursor: "pointer",
268
- fontSize: y.value.fontSize,
269
- borderRadius: "0.25rem",
270
- background: u.value === i.value.length ? "var(--cui-primary-bg)" : "transparent",
271
- color: "var(--cui-primary)",
272
- fontWeight: "500",
273
- transition: "background 0.1s ease",
274
- borderTop: i.value.length > 0 ? "1px solid color-mix(in srgb, var(--cui-border) 50%, transparent)" : "none",
275
- marginTop: i.value.length > 0 ? "calc(0.125rem * var(--cui-density-scale, 1))" : "0",
276
- paddingTop: i.value.length > 0 ? "calc(0.5rem * var(--cui-density-scale, 1))" : void 0
277
- }),
278
- onClick: U(T, ["stop"]),
279
- onMouseenter: a[1] || (a[1] = (t) => u.value = i.value.length)
280
- }, [
281
- P(me, {
282
- name: "plus",
283
- size: "0.75rem"
284
- }),
285
- $("span", null, x(r.createText) + " “" + x(o.value.trim()) + "”", 1)
286
- ], 36)) : w("", !0)
287
- ], 4)) : w("", !0)
288
- ]))
289
- ], 512)), [
290
- [ve, !r.hidden]
291
- ]);
292
- }
293
- });
1
+ import o from "./CuiTagInput.vue2.js";
2
+ /* empty css */
3
+ import t from "../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-532a086a"]]);
294
5
  export {
295
- Me as default
6
+ m as default
296
7
  };