@wikicasa-dev/components 2.6.13 → 2.6.14-alpha.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 (215) hide show
  1. package/dist/UIKit/AccessibleSelect.js +5 -5
  2. package/dist/UIKit/AccessibleSelect.vue.js +217 -205
  3. package/dist/UIKit/Accordion/AccordionContentPrimitive.js +5 -4
  4. package/dist/UIKit/Accordion/AccordionContentPrimitive.vue.js +19 -21
  5. package/dist/UIKit/Accordion/AccordionHeaderPrimitive.js +5 -4
  6. package/dist/UIKit/Accordion/AccordionHeaderPrimitive.vue.js +18 -20
  7. package/dist/UIKit/Accordion/AccordionItemPrimitive.js +5 -4
  8. package/dist/UIKit/Accordion/AccordionItemPrimitive.vue.js +21 -23
  9. package/dist/UIKit/Accordion/AccordionTriggerPrimitive.js +5 -4
  10. package/dist/UIKit/Accordion/AccordionTriggerPrimitive.vue.js +19 -21
  11. package/dist/UIKit/Accordion/BaseAccordion.js +5 -4
  12. package/dist/UIKit/Accordion/BaseAccordion.vue.js +38 -36
  13. package/dist/UIKit/Accordion/BaseAccordionItem.js +5 -5
  14. package/dist/UIKit/Accordion/BaseAccordionItem.vue.js +64 -81
  15. package/dist/UIKit/Autocomplete/ClearableAutocomplete.js +5 -5
  16. package/dist/UIKit/Autocomplete/ClearableAutocomplete.vue.js +232 -226
  17. package/dist/UIKit/BaseAlert.js +5 -5
  18. package/dist/UIKit/BaseAlert.vue.js +14 -18
  19. package/dist/UIKit/BaseAutocomplete.js +5 -5
  20. package/dist/UIKit/BaseAutocomplete.vue.js +197 -194
  21. package/dist/UIKit/BaseBadge.js +5 -5
  22. package/dist/UIKit/BaseBadge.vue.js +17 -17
  23. package/dist/UIKit/BaseBreadcrumb.js +5 -4
  24. package/dist/UIKit/BaseBreadcrumb.vue.js +39 -56
  25. package/dist/UIKit/BaseButton.js +5 -4
  26. package/dist/UIKit/BaseButton.vue.js +93 -87
  27. package/dist/UIKit/BaseComplexToggle.js +5 -6
  28. package/dist/UIKit/BaseComplexToggle.vue.js +87 -105
  29. package/dist/UIKit/BaseDropDown.js +5 -5
  30. package/dist/UIKit/BaseDropDown.vue.js +171 -152
  31. package/dist/UIKit/BaseFloatingLabel.js +6 -7
  32. package/dist/UIKit/BaseFloatingLabel.vue.js +43 -39
  33. package/dist/UIKit/BaseInput.js +6 -7
  34. package/dist/UIKit/BaseInput.vue.js +191 -210
  35. package/dist/UIKit/BaseModal.js +5 -5
  36. package/dist/UIKit/BaseModal.vue.js +160 -169
  37. package/dist/UIKit/BasePagination.js +5 -4
  38. package/dist/UIKit/BasePagination.vue.js +192 -229
  39. package/dist/UIKit/BaseSelect/SelectItem.js +5 -4
  40. package/dist/UIKit/BaseSelect/SelectItem.vue.js +34 -41
  41. package/dist/UIKit/BaseSlider.js +6 -7
  42. package/dist/UIKit/BaseSlider.vue.js +153 -203
  43. package/dist/UIKit/BaseSnackbar.js +5 -5
  44. package/dist/UIKit/BaseSnackbar.vue.js +144 -146
  45. package/dist/UIKit/BaseTextarea.js +5 -6
  46. package/dist/UIKit/BaseTextarea.vue.js +118 -126
  47. package/dist/UIKit/BaseToggle.js +5 -4
  48. package/dist/UIKit/BaseToggle.vue.js +37 -38
  49. package/dist/UIKit/BaseTooltip.js +6 -7
  50. package/dist/UIKit/BaseTooltip.vue.js +31 -40
  51. package/dist/UIKit/BaseUploadFile.js +5 -4
  52. package/dist/UIKit/BaseUploadFile.vue.js +63 -70
  53. package/dist/UIKit/Card/BaseCard.js +5 -5
  54. package/dist/UIKit/Card/BaseCard.vue.js +23 -36
  55. package/dist/UIKit/Card/CardDescriptionPrimitive.js +9 -11
  56. package/dist/UIKit/Card/CardImagePrimitive.js +5 -4
  57. package/dist/UIKit/Card/CardImagePrimitive.vue.js +11 -15
  58. package/dist/UIKit/Card/CardRootPrimitive.js +5 -5
  59. package/dist/UIKit/Card/CardRootPrimitive.vue.js +22 -26
  60. package/dist/UIKit/Card/type.js +4 -4
  61. package/dist/UIKit/Checkbox/CheckboxBtn.js +5 -5
  62. package/dist/UIKit/Checkbox/CheckboxBtn.vue.js +76 -81
  63. package/dist/UIKit/Checkbox/CheckboxGroup.js +5 -4
  64. package/dist/UIKit/Checkbox/CheckboxGroup.vue.js +137 -116
  65. package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.js +5 -4
  66. package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.vue.js +71 -77
  67. package/dist/UIKit/Checkbox/v2/CheckboxGroupItemPrimitive.js +5 -4
  68. package/dist/UIKit/Checkbox/v2/CheckboxGroupItemPrimitive.vue.js +32 -34
  69. package/dist/UIKit/Checkbox/v2/CheckboxGroupPrimitive.js +5 -4
  70. package/dist/UIKit/Checkbox/v2/CheckboxGroupPrimitive.vue.js +32 -34
  71. package/dist/UIKit/ProgressBar/ProgressIndicatorPrimitive.js +5 -4
  72. package/dist/UIKit/ProgressBar/ProgressIndicatorPrimitive.vue.js +15 -15
  73. package/dist/UIKit/ProgressBar/ProgressRootPrimitive.js +5 -4
  74. package/dist/UIKit/ProgressBar/ProgressRootPrimitive.vue.js +29 -31
  75. package/dist/UIKit/Radio/RadioButton.js +5 -4
  76. package/dist/UIKit/Radio/RadioButton.vue.js +51 -59
  77. package/dist/UIKit/Radio/RadioGroup.js +5 -4
  78. package/dist/UIKit/Radio/RadioGroup.vue.js +67 -63
  79. package/dist/UIKit/Radio/v2/RadioButtonGroup.js +5 -4
  80. package/dist/UIKit/Radio/v2/RadioButtonGroup.vue.js +38 -47
  81. package/dist/UIKit/Radio/v2/RadioButtonItem.js +5 -5
  82. package/dist/UIKit/Radio/v2/RadioButtonItem.vue.js +42 -44
  83. package/dist/UIKit/Radio/v2/RadioGroupItemPrimitive.js +5 -4
  84. package/dist/UIKit/Radio/v2/RadioGroupItemPrimitive.vue.js +28 -30
  85. package/dist/UIKit/ShimmerLoader/BaseShimmerLoader.js +6 -7
  86. package/dist/UIKit/ShimmerLoader/BaseShimmerLoader.vue.js +19 -19
  87. package/dist/UIKit/ShimmerLoader/ShimmerMultiLine.js +5 -4
  88. package/dist/UIKit/ShimmerLoader/ShimmerMultiLine.vue.js +41 -30
  89. package/dist/UIKit/Slider/SimpleSlider.js +6 -7
  90. package/dist/UIKit/Slider/SimpleSlider.vue.js +74 -81
  91. package/dist/UIKit/StaticSpinner.js +6 -7
  92. package/dist/UIKit/StaticSpinner.vue.js +24 -26
  93. package/dist/UIKit/Tab/BaseTab.js +5 -4
  94. package/dist/UIKit/Tab/BaseTab.vue.js +14 -14
  95. package/dist/UIKit/Tab/BaseTabList.js +5 -4
  96. package/dist/UIKit/Tab/BaseTabList.vue.js +45 -44
  97. package/dist/UIKit/Tab/BaseTabPanel.js +5 -4
  98. package/dist/UIKit/Tab/BaseTabPanel.vue.js +27 -24
  99. package/dist/UIKit/Tab/BaseTabView.js +5 -4
  100. package/dist/UIKit/Tab/BaseTabView.vue.js +107 -105
  101. package/dist/UIKit/Tab/v2/BaseTabs.js +5 -5
  102. package/dist/UIKit/Tab/v2/BaseTabs.vue.js +34 -38
  103. package/dist/UIKit/Tab/v2/BaseTabsContent.js +5 -4
  104. package/dist/UIKit/Tab/v2/BaseTabsContent.vue.js +21 -23
  105. package/dist/UIKit/Tab/v2/BaseTabsIndicator.js +5 -5
  106. package/dist/UIKit/Tab/v2/BaseTabsIndicator.vue.js +24 -33
  107. package/dist/UIKit/Tab/v2/BaseTabsList.js +5 -4
  108. package/dist/UIKit/Tab/v2/BaseTabsList.vue.js +20 -22
  109. package/dist/UIKit/Tab/v2/BaseTabsTrigger.js +5 -4
  110. package/dist/UIKit/Tab/v2/BaseTabsTrigger.vue.js +21 -30
  111. package/dist/UIKit/types.js +0 -1
  112. package/dist/_virtual/_plugin-vue_export-helper.js +7 -8
  113. package/dist/assets/AccessibleSelect.css +1 -1
  114. package/dist/assets/BaseAccordionItem.css +1 -1
  115. package/dist/assets/BaseAutocomplete.css +1 -1
  116. package/dist/assets/BaseBadge.css +1 -1
  117. package/dist/assets/BaseComplexToggle2.css +1 -1
  118. package/dist/assets/BaseDropDown.css +1 -1
  119. package/dist/assets/BaseFloatingLabel2.css +1 -1
  120. package/dist/assets/BaseInput2.css +1 -1
  121. package/dist/assets/BaseShimmerLoader.css +1 -1
  122. package/dist/assets/BaseSlider2.css +1 -1
  123. package/dist/assets/BaseSnackbar.css +1 -1
  124. package/dist/assets/BaseTabs.css +1 -1
  125. package/dist/assets/BaseTextarea2.css +1 -1
  126. package/dist/assets/BaseTooltip2.css +1 -1
  127. package/dist/assets/CheckboxBtn.css +1 -1
  128. package/dist/assets/ClearableAutocomplete.css +1 -1
  129. package/dist/assets/RadioButtonItem.css +1 -1
  130. package/dist/assets/StaticSpinner.css +1 -1
  131. package/dist/assets/SwiperCarousel.css +1 -1
  132. package/dist/assets/baseAlert.css +1 -1
  133. package/dist/assets/baseCard.css +1 -1
  134. package/dist/assets/baseComplexToggle.css +1 -1
  135. package/dist/assets/baseFloatingLabel.css +1 -1
  136. package/dist/assets/baseInput.css +1 -1
  137. package/dist/assets/baseModal.css +1 -1
  138. package/dist/assets/baseSlider.css +1 -1
  139. package/dist/assets/baseSpinner.css +1 -1
  140. package/dist/assets/baseTextarea.css +1 -1
  141. package/dist/assets/baseTooltip.css +1 -1
  142. package/dist/assets/swiper-free-mode.css +1 -1
  143. package/dist/assets/swiper-navigation.css +1 -1
  144. package/dist/assets/swiper-pagination.css +1 -1
  145. package/dist/assets/swiper-swiper.css +1 -1
  146. package/dist/assets/swiper-thumbs.css +1 -0
  147. package/dist/assets/swiper-zoom.css +1 -1
  148. package/dist/assets/swiperPaginationBullet.css +1 -1
  149. package/dist/assets/tailwind.css +1 -1
  150. package/dist/chart/DoughnutChart.js +5 -4
  151. package/dist/chart/DoughnutChart.vue.js +25 -25
  152. package/dist/chart/LineChart.js +5 -4
  153. package/dist/chart/LineChart.vue.js +27 -29
  154. package/dist/components/IntersectionObserver/IntersectionObservable.js +5 -4
  155. package/dist/components/IntersectionObserver/IntersectionObservable.vue.js +24 -23
  156. package/dist/components/IntersectionObserver/IntersectionObserver.js +5 -4
  157. package/dist/components/IntersectionObserver/IntersectionObserver.vue.js +55 -49
  158. package/dist/components/IntersectionObserver/v2/IntersectionObserverProvider.js +5 -4
  159. package/dist/components/IntersectionObserver/v2/IntersectionObserverProvider.vue.js +43 -38
  160. package/dist/components/IntersectionObserver/v2/IntersectionObserverTarget.js +5 -4
  161. package/dist/components/IntersectionObserver/v2/IntersectionObserverTarget.vue.js +27 -30
  162. package/dist/components/IntersectionObserver/v2/types.js +4 -6
  163. package/dist/components/carousel/Primitive/SwiperNavigationPrimitive.js +5 -4
  164. package/dist/components/carousel/Primitive/SwiperNavigationPrimitive.vue.js +30 -38
  165. package/dist/components/carousel/Primitive/SwiperPaginationPrimitive.js +5 -4
  166. package/dist/components/carousel/Primitive/SwiperPaginationPrimitive.vue.js +28 -32
  167. package/dist/components/carousel/Primitive/SwiperPrimitive.js +5 -4
  168. package/dist/components/carousel/Primitive/SwiperPrimitive.vue.js +16 -20
  169. package/dist/components/carousel/Primitive/SwiperRootPrimitive.js +5 -10
  170. package/dist/components/carousel/Primitive/SwiperRootPrimitive.vue.js +82 -112
  171. package/dist/components/carousel/Primitive/SwiperSlideImagePrimitive.js +5 -5
  172. package/dist/components/carousel/Primitive/SwiperSlideImagePrimitive.vue.js +44 -39
  173. package/dist/components/carousel/SwiperCarousel.js +6 -7
  174. package/dist/components/carousel/SwiperCarousel.vue.js +195 -229
  175. package/dist/components/carousel/SwiperSlide.js +9 -13
  176. package/dist/composables/mock.js +50 -48
  177. package/dist/composables/useFloatingLabel.js +32 -32
  178. package/dist/composables/useValidator.js +5 -7
  179. package/dist/index.js +67 -150
  180. package/dist/lazyModules/ChartJs/Chart.js +2 -4
  181. package/dist/lazyModules/ChartJs/DoughnutChart/core.js +5 -6
  182. package/dist/lazyModules/ChartJs/LineChart/cartesian.js +5 -6
  183. package/dist/lazyModules/ChartJs/LineChart/core.js +5 -6
  184. package/dist/lazyModules/ChartJs/Plugins/Legend.js +4 -2
  185. package/dist/lazyModules/ChartJs/Plugins/TimeScale.js +4 -2
  186. package/dist/lazyModules/ChartJs/Plugins/Title.js +4 -2
  187. package/dist/lazyModules/ChartJs/Plugins/Tooltip.js +4 -2
  188. package/dist/lazyModules/Swiper/Autoplay/factory.js +6 -8
  189. package/dist/lazyModules/Swiper/Autoplay/index.js +3 -6
  190. package/dist/lazyModules/Swiper/Controller/factory.js +6 -6
  191. package/dist/lazyModules/Swiper/Controller/index.js +3 -6
  192. package/dist/lazyModules/Swiper/FreeMode/factory.js +6 -8
  193. package/dist/lazyModules/Swiper/FreeMode/index.js +3 -6
  194. package/dist/lazyModules/Swiper/Keyboard/factory.js +6 -8
  195. package/dist/lazyModules/Swiper/Keyboard/index.js +3 -6
  196. package/dist/lazyModules/Swiper/Navigation/factory.js +6 -8
  197. package/dist/lazyModules/Swiper/Navigation/index.js +3 -6
  198. package/dist/lazyModules/Swiper/Pagination/factory.js +6 -6
  199. package/dist/lazyModules/Swiper/Pagination/index.js +3 -6
  200. package/dist/lazyModules/Swiper/Thumbs/factory.js +6 -6
  201. package/dist/lazyModules/Swiper/Thumbs/index.js +3 -6
  202. package/dist/lazyModules/Swiper/Zoom/factory.js +6 -8
  203. package/dist/lazyModules/Swiper/Zoom/index.js +3 -6
  204. package/dist/lazyModules/Swiper/factory.js +9 -12
  205. package/dist/lazyModules/Swiper/index.js +2 -4
  206. package/dist/lazyModules/Swiper/swiper-css.d.js +0 -1
  207. package/dist/lazyModules/Swiper/types.js +0 -1
  208. package/dist/lazyModules/VueChartJs/Doughnut/factory.js +8 -11
  209. package/dist/lazyModules/VueChartJs/Doughnut/index.js +2 -5
  210. package/dist/lazyModules/VueChartJs/Line/factory.js +8 -13
  211. package/dist/lazyModules/VueChartJs/Line/index.js +2 -5
  212. package/dist/types/index.js +0 -1
  213. package/dist/types.js +0 -1
  214. package/dist/utils.js +4 -5
  215. package/package.json +8 -8
@@ -1,227 +1,233 @@
1
- import { defineComponent as ee, useModel as U, useId as te, useTemplateRef as f, shallowRef as r, onBeforeMount as le, onMounted as ae, onUnmounted as ne, watch as V, nextTick as oe, openBlock as w, createBlock as I, withCtx as M, renderSlot as p, createCommentVNode as O, createElementBlock as P, createElementVNode as d, Fragment as ue, renderList as ie, normalizeClass as v, withDirectives as A, unref as se, vModelText as re, toDisplayString as de, withModifiers as ce, normalizeStyle as fe, createTextVNode as pe, vShow as ve, mergeModels as z } from "vue";
2
- import ke from "../BaseDropDown.vue.js";
3
- import '../../assets/BaseDropDown.css';/* empty css */
4
- import me from "../BaseSelect/SelectItem.vue.js";
5
- import { debounce as ye } from "@wikicasa-dev/utilities";
6
- const he = ["id", "data-cy", "placeholder"], we = {
7
- key: 1,
8
- name: "loading-state",
9
- class: "uikit-progress-bar-track uikit-absolute uikit-left-0 uikit-top-0 uikit-w-full"
10
- }, be = ["innerHTML"], Ue = /* @__PURE__ */ ee({
11
- __name: "ClearableAutocomplete",
12
- props: /* @__PURE__ */ z({
13
- dataCy: {},
14
- placeholder: {},
15
- enableKeyboardController: { type: Boolean, default: !0 },
16
- triggerWrapperClasses: {},
17
- inputWrapperClasses: {},
18
- inputClasses: {},
19
- hiddenTextClasses: {},
20
- dropdownClasses: {},
21
- clearButton: {},
22
- keepState: {},
23
- disableCb: { type: Boolean, default: !1 },
24
- onInputChangeCb: { type: Function },
25
- onOptionSelectedCb: { type: [Function, null] }
26
- }, {
27
- open: { type: Boolean, default: !1 },
28
- openModifiers: {},
29
- modelValue: { default: null },
30
- modelModifiers: {},
31
- inputValue: {
32
- default: ""
33
- },
34
- inputValueModifiers: {}
35
- }),
36
- emits: /* @__PURE__ */ z(["input", "click", "inputClick", "keydown"], ["update:open", "update:modelValue", "update:inputValue"]),
37
- setup(t, { expose: K, emit: L }) {
38
- const u = U(t, "open"), k = U(t, "modelValue"), i = U(t, "inputValue"), m = L, N = te(), b = f("inputRef"), y = r(0), c = r(!1), h = r(!1), n = r(-1), C = r(-1), W = r(null), o = r([]), H = f("dropdownRef"), g = f("hiddenSpan"), B = f("inputWrapperRef"), x = f("clearButtonRef"), E = () => {
39
- n.value = -1, C.value = -1;
40
- }, X = () => {
41
- i.value = "", k.value = null, c.value = !1, E();
42
- }, j = async (e) => {
43
- if (!e) {
44
- o.value = [], u.value = !1, E();
45
- return;
46
- }
47
- t.disableCb || (h.value = !0, o.value = await W.value?.(e)?.catch(() => []) || [], E(), h.value = !1, u.value = !!o.value.length);
48
- }, q = (e) => {
49
- m("input", e), c.value = !1;
50
- }, D = (e = -1, l) => {
51
- const a = o.value[e];
52
- !a || a.id === k.value?.id || (C.value = e, t.onOptionSelectedCb?.(a, { trigger: l }), i.value = a.label, u.value = !1, k.value = a, c.value = !0, o.value = []);
53
- }, R = (e) => {
54
- if (!t.enableKeyboardController || !u.value || ![
55
- "ArrowUp",
56
- "ArrowDown",
57
- "Enter",
58
- "Escape",
59
- "PageUp",
60
- "Home",
61
- "PageDown",
62
- "End"
63
- ].includes(e.key))
64
- return;
65
- if (e.key === "Escape") {
66
- n.value = C.value, u.value = !1, e.stopPropagation();
67
- return;
68
- }
69
- if (!o.value.length)
70
- return;
71
- const l = o.value.length - 1;
72
- if (["ArrowUp", "ArrowDown", "PageUp", "Home", "PageDown", "End"].includes(
73
- e.key
74
- ) && e.preventDefault(), e.key === "ArrowUp")
75
- n.value = n.value <= 0 ? l : n.value - 1;
76
- else if (e.key === "ArrowDown")
77
- n.value = n.value >= l ? 0 : n.value + 1;
78
- else if (e.key === "Enter") {
79
- if (n.value === -1) return;
80
- e.preventDefault(), D(n.value, "enter");
81
- } else e.key === "PageUp" || e.key === "Home" ? n.value = 0 : (e.key === "PageDown" || e.key === "End") && (n.value = l);
82
- e.stopPropagation();
83
- }, G = (e) => {
84
- m("keydown", e), R(e);
85
- }, J = () => {
86
- b.value?.select();
87
- }, Q = () => {
88
- b.value?.focus();
89
- };
90
- let T = null;
91
- const $ = () => {
92
- const e = g.value, l = B.value, a = x.value;
93
- if (!e || !l) return;
94
- const s = e.offsetWidth, S = l.offsetWidth, Y = t.clearButton?.offset || 0, Z = t.clearButton?.width || a?.offsetWidth || 0, _ = S - Y - Z, F = Math.min(s, _);
95
- F !== y.value && (y.value = F);
96
- };
97
- return le(() => {
98
- W.value = ye({ delay: 300 }, async (e = "") => (u.value = !0, await t.onInputChangeCb(e)));
99
- }), ae(() => {
100
- B.value && (T = new ResizeObserver(() => {
101
- $();
102
- }), T.observe(B.value));
103
- }), ne(() => {
104
- T?.disconnect();
105
- }), V([i, g, x], () => {
106
- oe($);
107
- }), V(
108
- k,
109
- (e) => {
110
- if (e?.label === i.value) return;
111
- const l = e?.label || "";
112
- i.value = l, l && (c.value = !0);
113
- },
114
- { immediate: !0 }
115
- ), K({
116
- getRootElement: () => H.value?.getRootElement(),
117
- select: J,
118
- focus: Q
119
- }), (e, l) => (w(), I(ke, {
120
- ref: "dropdownRef",
121
- class: "uikit-clearable-autocomplete",
122
- "data-cy": t.dataCy,
123
- "dropdown-element": "ul",
124
- "dropdown-classes": ["uikit-z-30", t.dropdownClasses],
125
- "keep-state": t.keepState === "closed" ? "closed" : "opened",
126
- "activate-keyboard-controller": !1,
127
- open: u.value,
128
- "onUpdate:open": l[3] || (l[3] = (a) => u.value = a)
129
- }, {
130
- btn_slot: M(() => [
131
- d("div", {
132
- class: v(["uikit-text-16", t.triggerWrapperClasses]),
133
- onClick: l[2] || (l[2] = (a) => m("click", a))
134
- }, [
135
- p(e.$slots, "left-icon"),
136
- d("div", {
137
- ref: "inputWrapperRef",
138
- class: v(["uikit-relative", t.inputWrapperClasses])
139
- }, [
140
- A(d("input", {
141
- ref: "inputRef",
142
- "onUpdate:modelValue": [
143
- l[0] || (l[0] = (a) => i.value = a),
144
- j
145
- ],
146
- id: se(N),
147
- "data-cy": t.dataCy ? `ac_input_${t.dataCy}` : "",
148
- type: "text",
149
- autocomplete: "off",
150
- class: v(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", t.inputClasses]),
151
- style: {
152
- font: "inherit",
153
- fontSize: "inherit"
154
- },
155
- placeholder: t.placeholder,
156
- onKeydown: G,
157
- onInput: q,
158
- onClick: l[1] || (l[1] = (a) => {
159
- m("inputClick", a), b.value?.select();
160
- })
161
- }, null, 42, he), [
162
- [re, i.value]
163
- ]),
164
- d("span", {
165
- ref_key: "hiddenSpan",
166
- ref: g,
167
- class: v(["uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-max-w-full uikit-overflow-hidden uikit-whitespace-pre", t.hiddenTextClasses]),
168
- style: {
169
- font: "inherit",
170
- fontSize: "inherit"
171
- }
172
- }, de(i.value), 3),
173
- A(d("button", {
174
- ref: "clearButtonRef",
175
- type: "button",
176
- class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", t.clearButton?.classes]),
177
- "aria-label": "Clear input",
178
- style: fe({
179
- left: `${y.value + (t.clearButton?.offset || 0)}px`,
180
- width: t.clearButton?.width ? `${t.clearButton.width}px` : "auto",
181
- height: t.clearButton?.height ? `${t.clearButton.height}px` : "auto"
182
- }),
183
- onClick: ce(X, ["stop"])
184
- }, [
185
- p(e.$slots, "clear-icon", {}, () => [
186
- l[4] || (l[4] = pe("X", -1))
187
- ])
188
- ], 6), [
189
- [ve, c.value && y.value]
190
- ])
191
- ], 2),
192
- p(e.$slots, "right-icon")
193
- ], 2)
194
- ]),
195
- default: M(() => [
196
- h.value && !o.value.length ? p(e.$slots, "loading-state", { key: 0 }) : O("", !0),
197
- h.value && o.value.length ? (w(), P("div", we, [...l[5] || (l[5] = [
198
- d("div", { class: "uikit-progress-bar-fill" }, null, -1)
199
- ])])) : O("", !0),
200
- o.value.length ? (w(!0), P(ue, { key: 2 }, ie(o.value, (a, s) => (w(), I(me, {
201
- key: s,
202
- active: n.value === s,
203
- class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
204
- onClick: (S) => D(s, "click"),
205
- onKeydown: R,
206
- onMouseover: (S) => n.value = s
207
- }, {
208
- default: M(() => [
209
- p(e.$slots, "option-content", {
210
- option: a,
211
- idx: s
212
- }, () => [
213
- d("span", {
214
- innerHTML: a.label
215
- }, null, 8, be)
216
- ])
217
- ]),
218
- _: 2
219
- }, 1032, ["active", "onClick", "onMouseover"]))), 128)) : O("", !0)
220
- ]),
221
- _: 3
222
- }, 8, ["data-cy", "dropdown-classes", "keep-state", "open"]));
223
- }
1
+ import e from "../BaseSelect/SelectItem.js";
2
+ import t from "../BaseDropDown.js";
3
+ import { Fragment as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, mergeModels as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeMount as p, onMounted as m, onUnmounted as h, openBlock as g, renderList as ee, renderSlot as _, shallowRef as v, toDisplayString as y, unref as b, useId as x, useModel as S, useTemplateRef as C, vModelText as w, vShow as T, watch as E, withCtx as D, withDirectives as O, withModifiers as te } from "vue";
4
+ import { debounce as ne } from "@wikicasa-dev/utilities";
5
+ import '../../assets/ClearableAutocomplete.css';//#region lib/UIKit/Autocomplete/ClearableAutocomplete.vue?vue&type=script&setup=true&lang.ts
6
+ var re = [
7
+ "id",
8
+ "data-cy",
9
+ "placeholder"
10
+ ], k = {
11
+ key: 1,
12
+ name: "loading-state",
13
+ class: "uikit-progress-bar-track uikit-absolute uikit-left-0 uikit-top-0 uikit-w-full"
14
+ }, A = ["innerHTML"], j = /*@__PURE__*/ c({
15
+ __name: "ClearableAutocomplete",
16
+ props: /*@__PURE__*/ l({
17
+ dataCy: {},
18
+ placeholder: {},
19
+ enableKeyboardController: {
20
+ type: Boolean,
21
+ default: !0
22
+ },
23
+ triggerWrapperClasses: {},
24
+ inputWrapperClasses: {},
25
+ inputClasses: {},
26
+ hiddenTextClasses: {},
27
+ dropdownClasses: {},
28
+ clearButton: {},
29
+ keepState: {},
30
+ disableCb: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ onInputChangeCb: { type: Function },
35
+ onOptionSelectedCb: { type: [Function, null] }
36
+ }, {
37
+ open: {
38
+ type: Boolean,
39
+ default: !1
40
+ },
41
+ openModifiers: {},
42
+ modelValue: { default: null },
43
+ modelModifiers: {},
44
+ inputValue: { default: "" },
45
+ inputValueModifiers: {}
46
+ }),
47
+ emits: /*@__PURE__*/ l([
48
+ "input",
49
+ "click",
50
+ "inputClick",
51
+ "keydown"
52
+ ], [
53
+ "update:open",
54
+ "update:modelValue",
55
+ "update:inputValue"
56
+ ]),
57
+ setup(c, { expose: l, emit: j }) {
58
+ let M = S(c, "open"), N = S(c, "modelValue"), P = S(c, "inputValue"), F = j, I = x(), L = C("inputRef"), R = v(0), z = v(!1), B = v(!1), V = v(-1), H = v(-1), U = v(null), W = v([]), G = C("dropdownRef"), K = C("hiddenSpan"), q = C("inputWrapperRef"), J = C("clearButtonRef"), Y = () => {
59
+ V.value = -1, H.value = -1;
60
+ }, ie = () => {
61
+ P.value = "", N.value = null, z.value = !1, Y();
62
+ }, ae = async (e) => {
63
+ if (!e) {
64
+ W.value = [], M.value = !1, Y();
65
+ return;
66
+ }
67
+ c.disableCb || (B.value = !0, W.value = await U.value?.(e)?.catch(() => []) || [], Y(), B.value = !1, M.value = !!W.value.length);
68
+ }, oe = (e) => {
69
+ F("input", e), z.value = !1;
70
+ }, X = (e = -1, t) => {
71
+ let n = W.value[e];
72
+ !n || n.id === N.value?.id || (H.value = e, c.onOptionSelectedCb?.(n, { trigger: t }), P.value = n.label, M.value = !1, N.value = n, z.value = !0, W.value = []);
73
+ }, Z = (e) => {
74
+ if (!c.enableKeyboardController || !M.value || ![
75
+ "ArrowUp",
76
+ "ArrowDown",
77
+ "Enter",
78
+ "Escape",
79
+ "PageUp",
80
+ "Home",
81
+ "PageDown",
82
+ "End"
83
+ ].includes(e.key)) return;
84
+ if (e.key === "Escape") {
85
+ V.value = H.value, M.value = !1, e.stopPropagation();
86
+ return;
87
+ }
88
+ if (!W.value.length) return;
89
+ let t = W.value.length - 1;
90
+ if ([
91
+ "ArrowUp",
92
+ "ArrowDown",
93
+ "PageUp",
94
+ "Home",
95
+ "PageDown",
96
+ "End"
97
+ ].includes(e.key) && e.preventDefault(), e.key === "ArrowUp") V.value = V.value <= 0 ? t : V.value - 1;
98
+ else if (e.key === "ArrowDown") V.value = V.value >= t ? 0 : V.value + 1;
99
+ else if (e.key === "Enter") {
100
+ if (V.value === -1) return;
101
+ e.preventDefault(), X(V.value, "enter");
102
+ } else e.key === "PageUp" || e.key === "Home" ? V.value = 0 : (e.key === "PageDown" || e.key === "End") && (V.value = t);
103
+ e.stopPropagation();
104
+ }, se = (e) => {
105
+ F("keydown", e), Z(e);
106
+ }, ce = () => {
107
+ L.value?.select();
108
+ }, le = () => {
109
+ L.value?.focus();
110
+ }, Q = null, $ = () => {
111
+ let e = K.value, t = q.value, n = J.value;
112
+ if (!e || !t) return;
113
+ let r = e.offsetWidth, i = t.offsetWidth, a = c.clearButton?.offset || 0, o = c.clearButton?.width || n?.offsetWidth || 0, s = i - a - o, l = Math.min(r, s);
114
+ l !== R.value && (R.value = l);
115
+ };
116
+ return p(() => {
117
+ U.value = ne({ delay: 300 }, async (e = "") => (M.value = !0, await c.onInputChangeCb(e)));
118
+ }), m(() => {
119
+ q.value && (Q = new ResizeObserver(() => {
120
+ $();
121
+ }), Q.observe(q.value));
122
+ }), h(() => {
123
+ Q?.disconnect();
124
+ }), E([
125
+ P,
126
+ K,
127
+ J
128
+ ], () => {
129
+ u($);
130
+ }), E(N, (e) => {
131
+ if (e?.label === P.value) return;
132
+ let t = e?.label || "";
133
+ P.value = t, t && (z.value = !0);
134
+ }, { immediate: !0 }), l({
135
+ getRootElement: () => G.value?.getRootElement(),
136
+ select: ce,
137
+ focus: le
138
+ }), (l, u) => (g(), r(t, {
139
+ ref: "dropdownRef",
140
+ class: "uikit-clearable-autocomplete",
141
+ "data-cy": c.dataCy,
142
+ "dropdown-element": "ul",
143
+ "dropdown-classes": ["uikit-z-30", c.dropdownClasses],
144
+ "keep-state": c.keepState === "closed" ? "closed" : "opened",
145
+ "activate-keyboard-controller": !1,
146
+ open: M.value,
147
+ "onUpdate:open": u[3] ||= (e) => M.value = e
148
+ }, {
149
+ btn_slot: D(() => [o("div", {
150
+ class: d(["uikit-text-16", c.triggerWrapperClasses]),
151
+ onClick: u[2] ||= (e) => F("click", e)
152
+ }, [
153
+ _(l.$slots, "left-icon"),
154
+ o("div", {
155
+ ref: "inputWrapperRef",
156
+ class: d(["uikit-relative", c.inputWrapperClasses])
157
+ }, [
158
+ O(o("input", {
159
+ ref: "inputRef",
160
+ "onUpdate:modelValue": [u[0] ||= (e) => P.value = e, ae],
161
+ id: b(I),
162
+ "data-cy": c.dataCy ? `ac_input_${c.dataCy}` : "",
163
+ type: "text",
164
+ autocomplete: "off",
165
+ class: d(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", c.inputClasses]),
166
+ style: {
167
+ font: "inherit",
168
+ fontSize: "inherit"
169
+ },
170
+ placeholder: c.placeholder,
171
+ onKeydown: se,
172
+ onInput: oe,
173
+ onClick: u[1] ||= (e) => {
174
+ F("inputClick", e), L.value?.select();
175
+ }
176
+ }, null, 42, re), [[w, P.value]]),
177
+ o("span", {
178
+ ref_key: "hiddenSpan",
179
+ ref: K,
180
+ class: d(["uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-max-w-full uikit-overflow-hidden uikit-whitespace-pre", c.hiddenTextClasses]),
181
+ style: {
182
+ font: "inherit",
183
+ fontSize: "inherit"
184
+ }
185
+ }, y(P.value), 3),
186
+ O(o("button", {
187
+ ref: "clearButtonRef",
188
+ type: "button",
189
+ class: d(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", c.clearButton?.classes]),
190
+ "aria-label": "Clear input",
191
+ style: f({
192
+ left: `${R.value + (c.clearButton?.offset || 0)}px`,
193
+ width: c.clearButton?.width ? `${c.clearButton.width}px` : "auto",
194
+ height: c.clearButton?.height ? `${c.clearButton.height}px` : "auto"
195
+ }),
196
+ onClick: te(ie, ["stop"])
197
+ }, [_(l.$slots, "clear-icon", {}, () => [u[4] ||= s("X", -1)])], 6), [[T, z.value && R.value]])
198
+ ], 2),
199
+ _(l.$slots, "right-icon")
200
+ ], 2)]),
201
+ default: D(() => [
202
+ B.value && !W.value.length ? _(l.$slots, "loading-state", { key: 0 }) : i("", !0),
203
+ B.value && W.value.length ? (g(), a("div", k, [...u[5] ||= [o("div", { class: "uikit-progress-bar-fill" }, null, -1)]])) : i("", !0),
204
+ W.value.length ? (g(!0), a(n, { key: 2 }, ee(W.value, (t, n) => (g(), r(e, {
205
+ key: n,
206
+ active: V.value === n,
207
+ class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
208
+ onClick: (e) => X(n, "click"),
209
+ onKeydown: Z,
210
+ onMouseover: (e) => V.value = n
211
+ }, {
212
+ default: D(() => [_(l.$slots, "option-content", {
213
+ option: t,
214
+ idx: n
215
+ }, () => [o("span", { innerHTML: t.label }, null, 8, A)])]),
216
+ _: 2
217
+ }, 1032, [
218
+ "active",
219
+ "onClick",
220
+ "onMouseover"
221
+ ]))), 128)) : i("", !0)
222
+ ]),
223
+ _: 3
224
+ }, 8, [
225
+ "data-cy",
226
+ "dropdown-classes",
227
+ "keep-state",
228
+ "open"
229
+ ]));
230
+ }
224
231
  });
225
- export {
226
- Ue as default
227
- };
232
+ //#endregion
233
+ export { j as default };
@@ -1,5 +1,5 @@
1
- import o from "./BaseAlert.vue.js";
2
- import '../assets/baseAlert.css';/* empty css */
3
- export {
4
- o as default
5
- };
1
+ import e from "./BaseAlert.vue.js";
2
+ //#region lib/UIKit/BaseAlert.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,19 +1,15 @@
1
- import { defineComponent as a, openBlock as l, createElementBlock as r, normalizeClass as s, renderSlot as o } from "vue";
2
- const n = ["id"], c = /* @__PURE__ */ a({
3
- __name: "BaseAlert",
4
- props: {
5
- alertClass: { default: "" }
6
- },
7
- setup(t) {
8
- return (e, i) => (l(), r("div", {
9
- id: e.$attrs.id,
10
- class: s(["uikit-alert", t.alertClass]),
11
- role: "alert"
12
- }, [
13
- o(e.$slots, "default")
14
- ], 10, n));
15
- }
1
+ import { createElementBlock as e, defineComponent as t, normalizeClass as n, openBlock as r, renderSlot as i } from "vue";
2
+ import '../assets/baseAlert.css';//#region lib/UIKit/BaseAlert.vue?vue&type=script&setup=true&lang.ts
3
+ var a = ["id"], o = /*@__PURE__*/ t({
4
+ __name: "BaseAlert",
5
+ props: { alertClass: { default: "" } },
6
+ setup(t) {
7
+ return (o, s) => (r(), e("div", {
8
+ id: o.$attrs.id,
9
+ class: n(["uikit-alert", t.alertClass]),
10
+ role: "alert"
11
+ }, [i(o.$slots, "default")], 10, a));
12
+ }
16
13
  });
17
- export {
18
- c as default
19
- };
14
+ //#endregion
15
+ export { o as default };
@@ -1,5 +1,5 @@
1
- import o from "./BaseAutocomplete.vue.js";
2
- import '../assets/BaseAutocomplete.css';/* empty css */
3
- export {
4
- o as default
5
- };
1
+ import e from "./BaseAutocomplete.vue.js";
2
+ //#region lib/UIKit/BaseAutocomplete.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };