@itguy614/clean-ui 1.2.2 → 1.3.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 (241) 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 +331 -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 +1 -0
  75. package/dist/components/CuiDataGridViewManager.vue.d.ts.map +1 -1
  76. package/dist/components/CuiDataGridViewManager.vue.js +17 -17
  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.map +1 -1
  84. package/dist/components/CuiDivider.vue.js +17 -13
  85. package/dist/components/CuiDropdownMenu.vue.js +2 -2
  86. package/dist/components/CuiDropdownRadioGroup.vue.d.ts +4 -1
  87. package/dist/components/CuiDropdownRadioGroup.vue.d.ts.map +1 -1
  88. package/dist/components/CuiDropdownRadioGroup.vue.js +27 -14
  89. package/dist/components/CuiDropdownSub.vue.js +2 -2
  90. package/dist/components/CuiEmptyState.vue.d.ts +5 -4
  91. package/dist/components/CuiEmptyState.vue.d.ts.map +1 -1
  92. package/dist/components/CuiEmptyState.vue.js +1 -1
  93. package/dist/components/CuiEmptyState.vue2.js +30 -24
  94. package/dist/components/CuiFieldset.vue.d.ts.map +1 -1
  95. package/dist/components/CuiFieldset.vue.js +1 -1
  96. package/dist/components/CuiFieldset.vue2.js +21 -21
  97. package/dist/components/CuiFileUpload.vue.d.ts +2 -2
  98. package/dist/components/CuiFileUpload.vue.d.ts.map +1 -1
  99. package/dist/components/CuiFileUpload.vue.js +70 -57
  100. package/dist/components/CuiFormField.vue.d.ts.map +1 -1
  101. package/dist/components/CuiFormField.vue.js +2 -2
  102. package/dist/components/CuiFormField.vue2.js +48 -42
  103. package/dist/components/CuiInput.vue.d.ts +2 -2
  104. package/dist/components/CuiInput.vue.d.ts.map +1 -1
  105. package/dist/components/CuiInput.vue.js +1 -1
  106. package/dist/components/CuiInput.vue2.js +97 -85
  107. package/dist/components/CuiInputStepper.vue.d.ts +2 -2
  108. package/dist/components/CuiInputStepper.vue.d.ts.map +1 -1
  109. package/dist/components/CuiInputStepper.vue.js +5 -187
  110. package/dist/components/CuiInputStepper.vue2.js +237 -2
  111. package/dist/components/CuiKbd.vue.d.ts.map +1 -1
  112. package/dist/components/CuiKbd.vue.js +6 -5
  113. package/dist/components/CuiMaskedInput.vue.d.ts +9 -3
  114. package/dist/components/CuiMaskedInput.vue.d.ts.map +1 -1
  115. package/dist/components/CuiMaskedInput.vue.js +132 -117
  116. package/dist/components/CuiModal.vue.d.ts +10 -2
  117. package/dist/components/CuiModal.vue.d.ts.map +1 -1
  118. package/dist/components/CuiModal.vue.js +2 -2
  119. package/dist/components/CuiModal.vue2.js +48 -44
  120. package/dist/components/CuiModalBody.vue.d.ts.map +1 -1
  121. package/dist/components/CuiModalBody.vue.js +16 -13
  122. package/dist/components/CuiModalFooter.vue.d.ts.map +1 -1
  123. package/dist/components/CuiModalFooter.vue.js +3 -2
  124. package/dist/components/CuiModalHeader.vue.d.ts +13 -4
  125. package/dist/components/CuiModalHeader.vue.d.ts.map +1 -1
  126. package/dist/components/CuiModalHeader.vue.js +54 -42
  127. package/dist/components/CuiPagination.vue.js +2 -2
  128. package/dist/components/CuiPopover.vue.d.ts.map +1 -1
  129. package/dist/components/CuiPopover.vue.js +70 -65
  130. package/dist/components/CuiRadio.vue.d.ts +2 -4
  131. package/dist/components/CuiRadio.vue.d.ts.map +1 -1
  132. package/dist/components/CuiRadio.vue.js +2 -2
  133. package/dist/components/CuiRadio.vue2.js +88 -74
  134. package/dist/components/CuiRadioGroup.vue.d.ts +2 -2
  135. package/dist/components/CuiRadioGroup.vue.d.ts.map +1 -1
  136. package/dist/components/CuiRadioGroup.vue.js +3 -3
  137. package/dist/components/CuiRadioGroup.vue2.js +47 -37
  138. package/dist/components/CuiRating.vue.d.ts.map +1 -1
  139. package/dist/components/CuiRating.vue.js +15 -14
  140. package/dist/components/CuiResizablePanels.vue.d.ts.map +1 -1
  141. package/dist/components/CuiResizablePanels.vue.js +10 -9
  142. package/dist/components/CuiSelect.vue.d.ts +2 -2
  143. package/dist/components/CuiSelect.vue.d.ts.map +1 -1
  144. package/dist/components/CuiSelect.vue.js +2 -2
  145. package/dist/components/CuiSelect.vue2.js +161 -151
  146. package/dist/components/CuiSkeleton.vue.js +2 -2
  147. package/dist/components/CuiSkeleton.vue2.js +10 -10
  148. package/dist/components/CuiSlideover.vue.d.ts +2 -2
  149. package/dist/components/CuiSlideover.vue.d.ts.map +1 -1
  150. package/dist/components/CuiSlideover.vue.js +34 -30
  151. package/dist/components/CuiSlider.vue.d.ts +2 -2
  152. package/dist/components/CuiSlider.vue.d.ts.map +1 -1
  153. package/dist/components/CuiSlider.vue.js +67 -54
  154. package/dist/components/CuiSpinner.vue.d.ts.map +1 -1
  155. package/dist/components/CuiSpinner.vue.js +5 -4
  156. package/dist/components/CuiTable.vue.d.ts.map +1 -1
  157. package/dist/components/CuiTable.vue.js +4 -1
  158. package/dist/components/CuiTableBody.vue.d.ts.map +1 -1
  159. package/dist/components/CuiTableBody.vue.js +6 -6
  160. package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
  161. package/dist/components/CuiTableCell.vue.js +11 -10
  162. package/dist/components/CuiTableFoot.vue.d.ts.map +1 -1
  163. package/dist/components/CuiTableFoot.vue.js +7 -7
  164. package/dist/components/CuiTableHead.vue.d.ts.map +1 -1
  165. package/dist/components/CuiTableHead.vue.js +7 -7
  166. package/dist/components/CuiTabs.vue.d.ts.map +1 -1
  167. package/dist/components/CuiTabs.vue.js +1 -1
  168. package/dist/components/CuiTabs.vue2.js +1 -0
  169. package/dist/components/CuiTagInput.vue.d.ts +2 -2
  170. package/dist/components/CuiTagInput.vue.d.ts.map +1 -1
  171. package/dist/components/CuiTagInput.vue.js +5 -294
  172. package/dist/components/CuiTagInput.vue2.js +277 -2
  173. package/dist/components/CuiTextarea.vue.d.ts +2 -2
  174. package/dist/components/CuiTextarea.vue.d.ts.map +1 -1
  175. package/dist/components/CuiTextarea.vue.js +4 -4
  176. package/dist/components/CuiTextarea.vue2.js +73 -59
  177. package/dist/components/CuiTimePicker.vue.d.ts +2 -2
  178. package/dist/components/CuiTimePicker.vue.d.ts.map +1 -1
  179. package/dist/components/CuiTimePicker.vue.js +172 -97
  180. package/dist/components/CuiTimeline.vue.d.ts.map +1 -1
  181. package/dist/components/CuiTimeline.vue.js +6 -5
  182. package/dist/components/CuiTimelineItem.vue.d.ts.map +1 -1
  183. package/dist/components/CuiTimelineItem.vue.js +11 -10
  184. package/dist/components/CuiToast.vue.d.ts +8 -10
  185. package/dist/components/CuiToast.vue.d.ts.map +1 -1
  186. package/dist/components/CuiToast.vue.js +2 -2
  187. package/dist/components/CuiToast.vue2.js +69 -67
  188. package/dist/components/CuiToggle.vue.d.ts +2 -2
  189. package/dist/components/CuiToggle.vue.d.ts.map +1 -1
  190. package/dist/components/CuiToggle.vue.js +2 -2
  191. package/dist/components/CuiToggle.vue2.js +71 -59
  192. package/dist/components/CuiToggleGroup.vue.d.ts +2 -2
  193. package/dist/components/CuiToggleGroup.vue.d.ts.map +1 -1
  194. package/dist/components/CuiToggleGroup.vue.js +2 -2
  195. package/dist/components/CuiToggleGroup.vue2.js +45 -35
  196. package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
  197. package/dist/components/CuiTooltip.vue.js +2 -2
  198. package/dist/components/CuiTooltip.vue2.js +47 -44
  199. package/dist/components/CuiTransferList.vue.d.ts.map +1 -1
  200. package/dist/components/CuiTransferList.vue.js +31 -30
  201. package/dist/components/CuiTreeNode.vue.d.ts +9 -2
  202. package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
  203. package/dist/components/CuiTreeNode.vue.js +5 -179
  204. package/dist/components/CuiTreeNode.vue2.js +198 -2
  205. package/dist/components/CuiTreeView.vue.d.ts +33 -5
  206. package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
  207. package/dist/components/CuiTreeView.vue.js +187 -44
  208. package/dist/composables/useCalendarKeyboard.d.ts +48 -0
  209. package/dist/composables/useCalendarKeyboard.d.ts.map +1 -0
  210. package/dist/composables/useCalendarKeyboard.js +91 -0
  211. package/dist/composables/useFieldDescribedBy.d.ts +30 -0
  212. package/dist/composables/useFieldDescribedBy.d.ts.map +1 -0
  213. package/dist/composables/useFieldDescribedBy.js +11 -0
  214. package/dist/composables/useMessages.d.ts.map +1 -1
  215. package/dist/composables/useMessages.js +6 -6
  216. package/dist/composables/usePopover.d.ts.map +1 -1
  217. package/dist/composables/usePopover.js +10 -0
  218. package/dist/composables/useScrollShadows.d.ts +3 -0
  219. package/dist/composables/useScrollShadows.d.ts.map +1 -1
  220. package/dist/composables/useScrollShadows.js +15 -12
  221. package/dist/icons/builtin.d.ts.map +1 -1
  222. package/dist/icons/builtin.js +38 -37
  223. package/dist/index.d.ts +3 -2
  224. package/dist/index.d.ts.map +1 -1
  225. package/dist/index.js +185 -182
  226. package/dist/messages.d.ts +39 -4
  227. package/dist/messages.d.ts.map +1 -1
  228. package/dist/messages.js +8 -7
  229. package/dist/types/common.d.ts +90 -0
  230. package/dist/types/common.d.ts.map +1 -1
  231. package/dist/utils/colorIconMap.d.ts +47 -3
  232. package/dist/utils/colorIconMap.d.ts.map +1 -1
  233. package/dist/utils/colorIconMap.js +20 -5
  234. package/dist/utils/date.d.ts +13 -0
  235. package/dist/utils/date.d.ts.map +1 -1
  236. package/dist/utils/date.js +46 -40
  237. package/dist/utils/sizing.d.ts +26 -1
  238. package/dist/utils/sizing.d.ts.map +1 -1
  239. package/dist/utils/sizing.js +22 -21
  240. package/dist/version.js +1 -1
  241. package/package.json +1 -1
@@ -1,23 +1,21 @@
1
- import { defineComponent as S, ref as _, computed as n, useTemplateRef as E, withDirectives as I, openBlock as u, createElementBlock as o, createElementVNode as m, normalizeStyle as M, normalizeClass as N, renderSlot as d, createCommentVNode as a, unref as v, createVNode as P, createBlock as h, toDisplayString as R, vShow as T } from "vue";
2
- import b from "./CuiIcon.vue.js";
3
- import { INPUT_SIZE_SCALE as D } from "../utils/sizing.js";
4
- import { useMessages as A } from "../composables/useMessages.js";
5
- const L = { class: "cui-input-wrapper" }, U = {
1
+ import { defineComponent as I, ref as M, computed as d, useTemplateRef as R, withDirectives as q, openBlock as i, createElementBlock as u, createElementVNode as p, normalizeStyle as D, normalizeClass as N, renderSlot as c, createCommentVNode as r, unref as s, createVNode as P, createBlock as h, toDisplayString as L, vShow as T } from "vue";
2
+ import v from "./CuiIcon.vue.js";
3
+ import { INPUT_SIZE_SCALE as A } from "../utils/sizing.js";
4
+ import { useFieldDescribedBy as F } from "../composables/useFieldDescribedBy.js";
5
+ import { useMessages as U } from "../composables/useMessages.js";
6
+ const Z = { class: "cui-input-wrapper" }, j = {
6
7
  key: 0,
7
8
  class: "cui-input__prefix-button"
8
- }, Z = { class: "cui-input__inner" }, j = {
9
+ }, G = { class: "cui-input__inner" }, H = {
9
10
  key: 0,
10
11
  class: "cui-input__prefix"
11
- }, q = ["type", "value", "placeholder", "disabled", "readonly", "aria-invalid"], F = ["aria-label"], G = ["aria-label"], H = {
12
+ }, J = ["id", "name", "autocomplete", "aria-describedby", "aria-required", "aria-labelledby", "type", "value", "placeholder", "disabled", "readonly", "aria-invalid"], K = ["aria-label"], O = ["aria-label"], Q = {
12
13
  key: 3,
13
14
  class: "cui-input__suffix"
14
- }, J = {
15
+ }, W = {
15
16
  key: 1,
16
17
  class: "cui-input__suffix-button"
17
- }, K = {
18
- key: 0,
19
- class: "cui-input__error"
20
- }, ee = /* @__PURE__ */ S({
18
+ }, X = ["id"], ue = /* @__PURE__ */ I({
21
19
  __name: "CuiInput",
22
20
  props: {
23
21
  modelValue: { default: "" },
@@ -28,123 +26,137 @@ const L = { class: "cui-input-wrapper" }, U = {
28
26
  errorMessage: {},
29
27
  readonly: { type: Boolean, default: !1 },
30
28
  rounded: { default: "md" },
29
+ name: {},
30
+ autocomplete: {},
31
+ id: {},
32
+ ariaDescribedby: {},
33
+ ariaLabelledby: {},
34
+ ariaRequired: { type: Boolean },
31
35
  hidden: { type: Boolean, default: !1 },
32
36
  color: { default: "primary" },
33
37
  size: { default: "md" },
34
38
  disabled: { type: Boolean, default: !1 }
35
39
  },
36
40
  emits: ["update:modelValue", "clear"],
37
- setup(t, { expose: x, emit: g }) {
41
+ setup(e, { expose: g, emit: x }) {
38
42
  const k = {
39
43
  none: "0",
40
- sm: "0.25rem",
41
- md: "var(--cui-button-radius, 0.375rem)",
42
- lg: "0.5rem",
44
+ sm: "var(--cui-radius-sm, 0.25rem)",
45
+ md: "var(--cui-button-radius, var(--cui-radius-md, 0.375rem))",
46
+ lg: "var(--cui-radius-lg, 0.5rem)",
43
47
  full: "9999px"
44
- }, i = t, c = g, l = _(!1), y = n(() => i.type === "password"), $ = n(() => y.value && l.value ? "text" : i.type), w = n(
45
- () => i.clearable && i.modelValue !== "" && i.modelValue != null && !i.disabled && !i.readonly
48
+ }, t = e, { errorId: $, describedBy: w } = F(t), f = x, l = M(!1), y = d(() => t.type === "password"), B = d(() => y.value && l.value ? "text" : t.type), V = d(
49
+ () => t.clearable && t.modelValue !== "" && t.modelValue != null && !t.disabled && !t.readonly
46
50
  );
47
- function V() {
48
- var e;
49
- c("update:modelValue", ""), c("clear"), (e = r.value) == null || e.focus();
51
+ function z() {
52
+ var a;
53
+ f("update:modelValue", ""), f("clear"), (a = n.value) == null || a.focus();
50
54
  }
51
- function z(e) {
52
- c("update:modelValue", e.target.value);
55
+ function C(a) {
56
+ f("update:modelValue", a.target.value);
53
57
  }
54
- const r = E("inputEl");
55
- function C(e) {
56
- var s;
57
- (s = r.value) == null || s.focus(e);
58
+ const n = R("inputEl");
59
+ function S(a) {
60
+ var o;
61
+ (o = n.value) == null || o.focus(a);
58
62
  }
59
- function B() {
60
- var e;
61
- (e = r.value) == null || e.blur();
63
+ function E() {
64
+ var a;
65
+ (a = n.value) == null || a.blur();
62
66
  }
63
- x({ el: r, focus: C, blur: B });
64
- const f = n(() => D[i.size]), p = A();
65
- return (e, s) => I((u(), o("div", L, [
66
- m("div", {
67
+ g({ el: n, focus: S, blur: E });
68
+ const m = d(() => A[t.size]), b = U();
69
+ return (a, o) => q((i(), u("div", Z, [
70
+ p("div", {
67
71
  class: N(["cui-input", {
68
- "cui-input--error": t.error,
69
- "cui-input--disabled": t.disabled,
72
+ "cui-input--error": e.error,
73
+ "cui-input--disabled": e.disabled,
70
74
  "cui-input--focused": !1,
71
- "cui-input--has-prefix-button": e.$slots["prefix-button"],
72
- "cui-input--has-suffix-button": e.$slots["suffix-button"]
75
+ "cui-input--has-prefix-button": a.$slots["prefix-button"],
76
+ "cui-input--has-suffix-button": a.$slots["suffix-button"]
73
77
  }]),
74
- style: M({
75
- borderRadius: k[t.rounded],
76
- "--_input-height": f.value.height,
77
- "--_input-font-size": f.value.fontSize,
78
- "--_input-px": f.value.px,
79
- "--_input-color": `var(--cui-${t.color})`,
80
- "--_input-focus-ring": `var(--cui-${t.color}-focus-ring)`,
81
- "--_input-border": t.error ? "var(--cui-error)" : "var(--cui-border-strong)",
82
- "--_input-focus-border": t.error ? "var(--cui-error)" : `var(--cui-${t.color})`
78
+ style: D({
79
+ borderRadius: k[e.rounded],
80
+ "--_input-height": m.value.height,
81
+ "--_input-font-size": m.value.fontSize,
82
+ "--_input-px": m.value.px,
83
+ "--_input-color": `var(--cui-${e.color})`,
84
+ "--_input-focus-ring": `var(--cui-${e.color}-focus-ring)`,
85
+ "--_input-border": e.error ? "var(--cui-error)" : "var(--cui-border-strong)",
86
+ "--_input-focus-border": e.error ? "var(--cui-error)" : `var(--cui-${e.color})`
83
87
  })
84
88
  }, [
85
- e.$slots["prefix-button"] ? (u(), o("div", U, [
86
- d(e.$slots, "prefix-button", {}, void 0, !0)
87
- ])) : a("", !0),
88
- m("div", Z, [
89
- e.$slots.prefix ? (u(), o("span", j, [
90
- d(e.$slots, "prefix", {}, void 0, !0)
91
- ])) : a("", !0),
92
- m("input", {
89
+ a.$slots["prefix-button"] ? (i(), u("div", j, [
90
+ c(a.$slots, "prefix-button", {}, void 0, !0)
91
+ ])) : r("", !0),
92
+ p("div", G, [
93
+ a.$slots.prefix ? (i(), u("span", H, [
94
+ c(a.$slots, "prefix", {}, void 0, !0)
95
+ ])) : r("", !0),
96
+ p("input", {
93
97
  ref: "inputEl",
94
- type: $.value,
95
- value: t.modelValue,
96
- placeholder: t.placeholder,
97
- disabled: t.disabled,
98
- readonly: t.readonly,
99
- "aria-invalid": t.error || void 0,
98
+ id: e.id,
99
+ name: e.name,
100
+ autocomplete: e.autocomplete,
101
+ "aria-describedby": s(w),
102
+ "aria-required": e.ariaRequired || void 0,
103
+ "aria-labelledby": e.ariaLabelledby,
104
+ type: B.value,
105
+ value: e.modelValue,
106
+ placeholder: e.placeholder,
107
+ disabled: e.disabled,
108
+ readonly: e.readonly,
109
+ "aria-invalid": e.error || void 0,
100
110
  class: "cui-input__native",
101
- onInput: z
102
- }, null, 40, q),
103
- w.value ? (u(), o("button", {
111
+ onInput: C
112
+ }, null, 40, J),
113
+ V.value ? (i(), u("button", {
104
114
  key: 1,
105
115
  type: "button",
106
116
  class: "cui-input__clear",
107
- tabindex: "-1",
108
- "aria-label": v(p).input.clear,
109
- onClick: V
117
+ "aria-label": s(b).input.clear,
118
+ onClick: z
110
119
  }, [
111
- P(b, {
120
+ P(v, {
112
121
  name: "x",
113
122
  size: "0.75rem"
114
123
  })
115
- ], 8, F)) : a("", !0),
116
- y.value ? (u(), o("button", {
124
+ ], 8, K)) : r("", !0),
125
+ y.value ? (i(), u("button", {
117
126
  key: 2,
118
127
  type: "button",
119
128
  class: "cui-input__password-toggle",
120
- tabindex: "-1",
121
- "aria-label": l.value ? v(p).input.hidePassword : v(p).input.showPassword,
122
- onClick: s[0] || (s[0] = (O) => l.value = !l.value)
129
+ "aria-label": l.value ? s(b).input.hidePassword : s(b).input.showPassword,
130
+ onClick: o[0] || (o[0] = (Y) => l.value = !l.value)
123
131
  }, [
124
- l.value ? (u(), h(b, {
132
+ l.value ? (i(), h(v, {
125
133
  key: 1,
126
134
  name: "eye-slash",
127
135
  size: "1rem"
128
- })) : (u(), h(b, {
136
+ })) : (i(), h(v, {
129
137
  key: 0,
130
138
  name: "eye",
131
139
  size: "1rem"
132
140
  }))
133
- ], 8, G)) : a("", !0),
134
- e.$slots.suffix ? (u(), o("span", H, [
135
- d(e.$slots, "suffix", {}, void 0, !0)
136
- ])) : a("", !0)
141
+ ], 8, O)) : r("", !0),
142
+ a.$slots.suffix ? (i(), u("span", Q, [
143
+ c(a.$slots, "suffix", {}, void 0, !0)
144
+ ])) : r("", !0)
137
145
  ]),
138
- e.$slots["suffix-button"] ? (u(), o("div", J, [
139
- d(e.$slots, "suffix-button", {}, void 0, !0)
140
- ])) : a("", !0)
146
+ a.$slots["suffix-button"] ? (i(), u("div", W, [
147
+ c(a.$slots, "suffix-button", {}, void 0, !0)
148
+ ])) : r("", !0)
141
149
  ], 6),
142
- t.error && t.errorMessage ? (u(), o("div", K, R(t.errorMessage), 1)) : a("", !0)
150
+ e.error && e.errorMessage ? (i(), u("div", {
151
+ key: 0,
152
+ id: s($),
153
+ class: "cui-input__error"
154
+ }, L(e.errorMessage), 9, X)) : r("", !0)
143
155
  ], 512)), [
144
- [T, !t.hidden]
156
+ [T, !e.hidden]
145
157
  ]);
146
158
  }
147
159
  });
148
160
  export {
149
- ee as default
161
+ ue as default
150
162
  };
@@ -1,6 +1,6 @@
1
- import type { CuiColor, CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps } from "../types/common";
1
+ import type { CuiColor, CuiSize, HideableProps, ColorableProps, SizeableProps, DisableableProps, NativeControlProps } from "../types/common";
2
2
  export type InputStepperOrientation = "horizontal" | "vertical";
3
- export interface CuiInputStepperProps extends HideableProps, ColorableProps, SizeableProps, DisableableProps {
3
+ export interface CuiInputStepperProps extends NativeControlProps, HideableProps, ColorableProps, SizeableProps, DisableableProps {
4
4
  /** Current value */
5
5
  modelValue?: number;
6
6
  /** Minimum value */
@@ -1 +1 @@
1
- {"version":3,"file":"CuiInputStepper.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiInputStepper.vue"],"names":[],"mappings":"AA8LA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKzH,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB;IAC1G,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA8ED,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAIjC;AAED,iBAAS,IAAI,SAEZ;;;;;;;;;;;UAvFQ,OAAO;;;;iBANA,uBAAuB;gBARxB,MAAM;UAMZ,MAAM;;AAsWf,wBASG"}
1
+ {"version":3,"file":"CuiInputStepper.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiInputStepper.vue"],"names":[],"mappings":"AAwXA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAK7I,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB;IAC9H,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAqJD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAIjC;AAED,iBAAS,IAAI,SAEZ;;;;;;;;;;;UA9JQ,OAAO;;;;iBANA,uBAAuB;gBARxB,MAAM;UAMZ,MAAM;;AAwdf,wBASG"}
@@ -1,189 +1,7 @@
1
- import { defineComponent as N, computed as u, useTemplateRef as y, withDirectives as A, openBlock as s, createElementBlock as c, normalizeStyle as r, toDisplayString as F, createCommentVNode as H, createVNode as a, withCtx as m, createElementVNode as W, vShow as T } from "vue";
2
- import { clampSize as P } from "../utils/sizing.js";
3
- import v from "./CuiButton.vue.js";
4
- import b from "./CuiIcon.vue.js";
5
- const L = ["value", "disabled"], O = ["value", "disabled"], G = /* @__PURE__ */ N({
6
- __name: "CuiInputStepper",
7
- props: {
8
- modelValue: { default: 0 },
9
- min: {},
10
- max: {},
11
- step: { default: 1 },
12
- orientation: { default: "horizontal" },
13
- label: {},
14
- pad: {},
15
- wrap: { type: Boolean, default: !1 },
16
- hidden: { type: Boolean, default: !1 },
17
- color: { default: "primary" },
18
- size: { default: "md" },
19
- disabled: { type: Boolean, default: !1 }
20
- },
21
- emits: ["update:modelValue"],
22
- setup(t, { expose: R, emit: B }) {
23
- const e = t, f = B, h = u(() => e.wrap || e.min === void 0 || e.modelValue - e.step >= e.min), p = u(() => e.wrap || e.max === void 0 || e.modelValue + e.step <= e.max);
24
- function S() {
25
- if (e.disabled || !h.value) return;
26
- let i = Math.round((e.modelValue - e.step) * 1e10) / 1e10;
27
- if (e.wrap && e.min !== void 0 && e.max !== void 0 && i < e.min) {
28
- const n = e.max - e.min + 1;
29
- i = e.min + Math.floor((n - 1) / e.step) * e.step;
30
- } else e.min !== void 0 && (i = Math.max(i, e.min));
31
- f("update:modelValue", i);
32
- }
33
- function V() {
34
- if (e.disabled || !p.value) return;
35
- let i = Math.round((e.modelValue + e.step) * 1e10) / 1e10;
36
- e.wrap && e.min !== void 0 && e.max !== void 0 && i > e.max ? i = e.min : e.max !== void 0 && (i = Math.min(i, e.max)), f("update:modelValue", i);
37
- }
38
- const w = u(() => e.pad && e.pad > 0 ? String(e.modelValue).padStart(e.pad, "0") : String(e.modelValue)), k = u(() => e.orientation === "vertical");
39
- function C(i) {
40
- const n = i.target.value, l = parseFloat(n);
41
- if (isNaN(l)) return;
42
- let d = l;
43
- e.min !== void 0 && (d = Math.max(d, e.min)), e.max !== void 0 && (d = Math.min(d, e.max)), f("update:modelValue", d);
44
- }
45
- const E = ["sm", "md", "lg"], I = {
46
- sm: { height: "1.75rem", inputWidth: "2.5rem", font: "0.8125rem", buttonSize: "xs", iconSize: "0.75rem" },
47
- md: { height: "2.25rem", inputWidth: "3rem", font: "0.875rem", buttonSize: "sm", iconSize: "0.875rem" },
48
- lg: { height: "2.75rem", inputWidth: "3.5rem", font: "1rem", buttonSize: "md", iconSize: "1rem" }
49
- }, o = u(() => I[P(e.size, E)]), g = y("rootEl"), z = y("inputH"), x = y("inputV");
50
- function M(i) {
51
- var l;
52
- const n = z.value ?? x.value;
53
- n ? n.focus(i) : (l = g.value) == null || l.focus(i);
54
- }
55
- function D() {
56
- var i;
57
- (i = z.value ?? x.value) == null || i.blur();
58
- }
59
- return R({ el: g, focus: M, blur: D }), (i, n) => A((s(), c("div", {
60
- ref_key: "rootEl",
61
- ref: g
62
- }, [
63
- t.label ? (s(), c("label", {
64
- key: 0,
65
- style: r({
66
- display: "block",
67
- marginBottom: "calc(0.25rem * var(--cui-density-scale, 1))",
68
- fontWeight: "500",
69
- color: "var(--cui-text-secondary)",
70
- fontSize: o.value.font,
71
- textAlign: k.value ? "center" : void 0
72
- })
73
- }, F(t.label), 5)) : H("", !0),
74
- k.value ? (s(), c("div", {
75
- key: 2,
76
- style: r({
77
- display: "inline-flex",
78
- flexDirection: "column",
79
- alignItems: "center",
80
- borderRadius: "var(--cui-button-radius, 0.375rem)",
81
- border: "1px solid var(--cui-border-strong, var(--cui-border))",
82
- opacity: t.disabled ? "0.5" : "1",
83
- overflow: "hidden"
84
- })
85
- }, [
86
- a(v, {
87
- variant: "ghost",
88
- size: o.value.buttonSize,
89
- disabled: t.disabled || !p.value,
90
- color: t.color,
91
- style: r({ border: "none", borderRadius: "0", width: "100%", minWidth: o.value.inputWidth }),
92
- onClick: V
93
- }, {
94
- default: m(() => [
95
- a(b, {
96
- name: "caret-up",
97
- size: o.value.iconSize
98
- }, null, 8, ["size"])
99
- ]),
100
- _: 1
101
- }, 8, ["size", "disabled", "color", "style"]),
102
- W("input", {
103
- ref_key: "inputV",
104
- ref: x,
105
- type: "text",
106
- inputmode: "numeric",
107
- value: w.value,
108
- disabled: t.disabled,
109
- style: r({ width: o.value.inputWidth, textAlign: "center", border: "none", borderTop: "1px solid var(--cui-border-strong, var(--cui-border))", borderBottom: "1px solid var(--cui-border-strong, var(--cui-border))", background: "var(--cui-surface-base, white)", color: "var(--cui-text-body)", fontSize: o.value.font, fontWeight: "600", outline: "none", padding: "calc(0.25rem * var(--cui-density-scale, 1)) 0", fontFamily: "inherit" }),
110
- onInput: C
111
- }, null, 44, O),
112
- a(v, {
113
- variant: "ghost",
114
- size: o.value.buttonSize,
115
- disabled: t.disabled || !h.value,
116
- color: t.color,
117
- style: { border: "none", borderRadius: "0", width: "100%" },
118
- onClick: S
119
- }, {
120
- default: m(() => [
121
- a(b, {
122
- name: "caret-down",
123
- size: o.value.iconSize
124
- }, null, 8, ["size"])
125
- ]),
126
- _: 1
127
- }, 8, ["size", "disabled", "color"])
128
- ], 4)) : (s(), c("div", {
129
- key: 1,
130
- style: r({
131
- display: "inline-flex",
132
- alignItems: "center",
133
- borderRadius: "var(--cui-button-radius, 0.375rem)",
134
- border: "1px solid var(--cui-border-strong, var(--cui-border))",
135
- opacity: t.disabled ? "0.5" : "1",
136
- height: o.value.height
137
- })
138
- }, [
139
- a(v, {
140
- variant: "ghost",
141
- size: o.value.buttonSize,
142
- disabled: t.disabled || !h.value,
143
- color: t.color,
144
- style: { borderRadius: "var(--cui-button-radius, 0.375rem) 0 0 var(--cui-button-radius, 0.375rem)", border: "none", height: "100%" },
145
- onClick: S
146
- }, {
147
- default: m(() => [
148
- a(b, {
149
- name: "minus",
150
- size: o.value.iconSize
151
- }, null, 8, ["size"])
152
- ]),
153
- _: 1
154
- }, 8, ["size", "disabled", "color"]),
155
- W("input", {
156
- ref_key: "inputH",
157
- ref: z,
158
- type: "text",
159
- inputmode: "numeric",
160
- value: w.value,
161
- disabled: t.disabled,
162
- style: r({ width: o.value.inputWidth, height: "100%", textAlign: "center", border: "none", borderLeft: "1px solid var(--cui-border-strong, var(--cui-border))", borderRight: "1px solid var(--cui-border-strong, var(--cui-border))", background: "var(--cui-surface-base, white)", color: "var(--cui-text-body)", fontSize: o.value.font, fontWeight: "600", outline: "none", padding: "0", fontFamily: "inherit" }),
163
- onInput: C
164
- }, null, 44, L),
165
- a(v, {
166
- variant: "ghost",
167
- size: o.value.buttonSize,
168
- disabled: t.disabled || !p.value,
169
- color: t.color,
170
- style: { borderRadius: "0 var(--cui-button-radius, 0.375rem) var(--cui-button-radius, 0.375rem) 0", border: "none", height: "100%" },
171
- onClick: V
172
- }, {
173
- default: m(() => [
174
- a(b, {
175
- name: "plus",
176
- size: o.value.iconSize
177
- }, null, 8, ["size"])
178
- ]),
179
- _: 1
180
- }, 8, ["size", "disabled", "color"])
181
- ], 4))
182
- ], 512)), [
183
- [T, !t.hidden]
184
- ]);
185
- }
186
- });
1
+ import t from "./CuiInputStepper.vue2.js";
2
+ /* empty css */
3
+ import o from "../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-0c3590bd"]]);
187
5
  export {
188
- G as default
6
+ m as default
189
7
  };