@wikicasa-dev/components 2.2.9-alpha.9 → 2.3.1-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 (62) hide show
  1. package/dist/Swiper/autoplay.js +1 -1
  2. package/dist/Swiper/controller.js +1 -1
  3. package/dist/Swiper/keyboard.js +1 -1
  4. package/dist/Swiper/thumbs.js +1 -1
  5. package/dist/UIKit/AccessibleSelect.d.ts +5 -4
  6. package/dist/UIKit/AccessibleSelect.js +3 -2
  7. package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +7 -2
  8. package/dist/UIKit/BaseAutocomplete.d.ts +4 -4
  9. package/dist/UIKit/BaseButton.d.ts +14 -8
  10. package/dist/UIKit/BaseCard.js +1 -3
  11. package/dist/UIKit/BaseDropDown.d.ts +19 -13
  12. package/dist/UIKit/BaseFloatingLabel.js +4 -4
  13. package/dist/UIKit/BaseInput.d.ts +3 -2
  14. package/dist/UIKit/BaseInput.js +1 -1
  15. package/dist/UIKit/BaseSnackbar.d.ts +2 -2
  16. package/dist/UIKit/BaseTextarea.d.ts +2 -2
  17. package/dist/UIKit/BaseToggle.d.ts +5 -8
  18. package/dist/UIKit/BaseToggle.js +1 -4
  19. package/dist/UIKit/Checkbox/CheckboxBtn.d.ts +14 -7
  20. package/dist/UIKit/Checkbox/CheckboxGroup.d.ts +5 -2
  21. package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.d.ts +40 -0
  22. package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.js +4 -0
  23. package/dist/UIKit/Radio/RadioButton.d.ts +28 -23
  24. package/dist/UIKit/Radio/RadioGroup.d.ts +49 -50
  25. package/dist/UIKit/Radio/v2/RadioButtonGroup.d.ts +29 -0
  26. package/dist/UIKit/Radio/v2/RadioButtonGroup.js +4 -0
  27. package/dist/UIKit/Radio/v2/RadioButtonItem.d.ts +16 -0
  28. package/dist/UIKit/Radio/v2/RadioButtonItem.js +5 -0
  29. package/dist/assets/AccessibleSelect.css +1 -0
  30. package/dist/assets/BaseCard.css +1 -1
  31. package/dist/assets/BaseDropDown.css +1 -1
  32. package/dist/assets/BaseFloatingLabel.css +1 -1
  33. package/dist/assets/BaseInput.css +1 -1
  34. package/dist/assets/RadioButtonItem.css +1 -0
  35. package/dist/assets/tailwind.css +1 -1
  36. package/dist/composables/mock.d.ts +25 -0
  37. package/dist/composables/mock.js +49 -0
  38. package/dist/index.d.ts +4 -0
  39. package/dist/index.js +94 -83
  40. package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +158 -160
  41. package/dist/packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js +4 -6
  42. package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +112 -106
  43. package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +36 -36
  44. package/dist/packages/components/lib/UIKit/BaseButton.vue.js +28 -24
  45. package/dist/packages/components/lib/UIKit/BaseCard.vue.js +13 -13
  46. package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +102 -105
  47. package/dist/packages/components/lib/UIKit/BaseFloatingLabel.vue.js +8 -8
  48. package/dist/packages/components/lib/UIKit/BaseInput.vue.js +65 -64
  49. package/dist/packages/components/lib/UIKit/BaseModal.vue.js +42 -36
  50. package/dist/packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js +18 -17
  51. package/dist/packages/components/lib/UIKit/BaseToggle.vue.js +25 -29
  52. package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +48 -41
  53. package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +60 -55
  54. package/dist/packages/components/lib/UIKit/Checkbox/v2/CheckboxButtonGroup.vue.js +78 -0
  55. package/dist/packages/components/lib/UIKit/Radio/RadioButton.vue.js +16 -14
  56. package/dist/packages/components/lib/UIKit/Radio/RadioGroup.vue.js +37 -33
  57. package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonGroup.vue.js +49 -0
  58. package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonItem.vue.js +45 -0
  59. package/dist/types/index.d.ts +3 -0
  60. package/package.json +8 -7
  61. package/dist/assets/BaseToggle.css +0 -1
  62. /package/dist/assets/{swiper-thumbs.css → swiper-controller.css} +0 -0
@@ -1,11 +1,12 @@
1
- import { defineComponent as N, mergeModels as D, useId as R, useModel as E, shallowRef as x, computed as V, useTemplateRef as I, onMounted as z, onUnmounted as q, watch as l, nextTick as U, createElementBlock as j, openBlock as f, normalizeClass as i, renderSlot as K, createBlock as B, createVNode as F, unref as r, withCtx as L, createElementVNode as G, createCommentVNode as J, resolveDynamicComponent as P } from "vue";
2
- import Q from "./BaseButton.vue.js";
3
- import { ArrowIcon as X } from "@wikicasa-dev/svg-icons";
4
- import { useKeyboardController as Y } from "@wikicasa-dev/vue-composables";
5
- const Z = ["innerHTML"], le = /* @__PURE__ */ N({
1
+ import { defineComponent as T, mergeModels as I, useId as N, useModel as A, shallowRef as R, computed as V, useTemplateRef as x, onMounted as z, onUnmounted as P, watch as v, nextTick as q, createElementBlock as F, openBlock as m, normalizeClass as d, renderSlot as B, createBlock as L, unref as l, createVNode as U, withCtx as D, createElementVNode as j, createCommentVNode as G, resolveDynamicComponent as J, mergeProps as Q } from "vue";
2
+ import X from "./BaseButton.vue.js";
3
+ import { ArrowIcon as Y } from "@wikicasa-dev/svg-icons";
4
+ import { useKeyboardController as Z } from "../../../../composables/mock.js";
5
+ const _ = ["innerHTML"], le = /* @__PURE__ */ T({
6
6
  inheritAttrs: !1,
7
7
  __name: "BaseDropDown",
8
- props: /* @__PURE__ */ D({
8
+ props: /* @__PURE__ */ I({
9
+ dropdownAttrs: {},
9
10
  dropdownClasses: { default: "" },
10
11
  btnClasses: { default: "" },
11
12
  withArrowIcon: { type: Boolean, default: !1 },
@@ -15,138 +16,134 @@ const Z = ["innerHTML"], le = /* @__PURE__ */ N({
15
16
  arrowWidth: { default: 12 },
16
17
  arrowStrokeColor: { default: void 0 },
17
18
  isAbsolute: { type: Boolean, default: !0 },
18
- openDropdown: { type: Boolean, default: !1 },
19
19
  closeWhenClickedOutside: { type: Boolean, default: !0 },
20
20
  dropdownElement: { default: "div" },
21
21
  keepState: { default: "" },
22
22
  activateKeyboardController: { type: Boolean, default: !0 },
23
+ closeKeys: { type: [Boolean, Array], default: () => ["Escape", "Enter"] },
23
24
  dataCy: { default: "" }
24
25
  }, {
25
- toggleDropdown: { type: Boolean, default: void 0 },
26
- toggleDropdownModifiers: {},
27
26
  resetKeyboardController: { type: Boolean, default: !1 },
28
- resetKeyboardControllerModifiers: {}
27
+ resetKeyboardControllerModifiers: {},
28
+ open: { type: Boolean, default: !1 },
29
+ openModifiers: {}
29
30
  }),
30
- emits: /* @__PURE__ */ D(["click", "update:dropdownState"], ["update:toggleDropdown", "update:resetKeyboardController"]),
31
- setup(o, { expose: S, emit: A }) {
32
- const n = o, k = R(), v = A, w = E(o, "toggleDropdown"), m = E(
33
- o,
31
+ emits: /* @__PURE__ */ I(["click"], ["update:resetKeyboardController", "update:open"]),
32
+ setup(t, { expose: S, emit: M }) {
33
+ const n = t, y = N(), O = M, w = A(
34
+ t,
34
35
  "resetKeyboardController"
35
- );
36
- let p = !1;
37
- const t = x(!1), u = x([]), M = V(() => u.value.length), s = I("container"), y = I("dropdown"), { activeIdx: d, selectedIdx: a, onKeyDownHandler: O } = Y({
38
- optionsLength: M,
39
- isDropdownOpen: t,
40
- global: !1
41
- }), W = () => {
42
- t.value = !1;
43
- }, b = ({ target: e }) => {
44
- s.value?.contains(e) || W();
45
- }, h = (e) => {
46
- t.value && s.value?.contains(document.activeElement) && e.key === "Tab" && (t.value = !1);
47
- }, $ = (e) => {
48
- n.activateKeyboardController && O(e);
49
- }, c = () => {
50
- n.keepState === "closed" && !t.value || n.keepState === "opened" && t.value || (t.value = !t.value);
51
- }, T = (e) => {
52
- e != null && (d.value = e);
36
+ ), o = A(t, "open");
37
+ let C = !1;
38
+ const s = R([]), W = V(() => s.value.length), u = x("container"), c = x("dropdown"), { activeIdx: a, selectedIdx: i, onKeyDownHandler: $ } = Z({
39
+ optionsLength: W,
40
+ isDropdownOpen: o,
41
+ global: !1,
42
+ closeKeys: n.closeKeys ? n.closeKeys : []
43
+ }), b = () => {
44
+ o.value = !1;
45
+ }, h = ({ target: e }) => {
46
+ u.value?.contains(e) || b();
47
+ }, p = (e) => {
48
+ o.value && (u.value?.contains(e.target) || b());
53
49
  }, H = (e) => {
50
+ n.activateKeyboardController && $(e);
51
+ }, f = () => {
52
+ n.keepState === "closed" && !o.value || n.keepState === "opened" && o.value || (o.value = !o.value);
53
+ }, g = (e) => {
54
54
  e != null && (a.value = e);
55
- }, C = () => {
56
- y.value && (u.value = Array.from(y.value.children));
55
+ }, K = (e) => {
56
+ e != null && (i.value = e);
57
+ }, E = () => {
58
+ c.value && (s.value = Array.from(c.value.children));
57
59
  };
58
60
  return z(() => {
59
- C();
60
- }), q(() => {
61
- n.closeWhenClickedOutside && (document.removeEventListener("click", b), document.removeEventListener("keydown", h));
62
- }), l(m, (e) => {
63
- e && (d.value = -1, a.value = -1, U(() => {
64
- C(), m.value = !1;
61
+ E();
62
+ }), P(() => {
63
+ n.closeWhenClickedOutside && (document.removeEventListener("click", h), document.removeEventListener("focusin", p));
64
+ }), v(w, (e) => {
65
+ e && (a.value = -1, i.value = -1, q(() => {
66
+ E(), w.value = !1;
65
67
  }));
66
- }), l(
67
- () => n.openDropdown,
68
- (e) => {
69
- t.value = e;
70
- },
71
- {
72
- immediate: !0
73
- }
74
- ), l(t, (e) => {
75
- v("update:dropdownState", e);
76
- }), l(t, (e) => {
77
- !e || p || !n.closeWhenClickedOutside || (document.addEventListener("click", b), document.addEventListener("keydown", h), p = !0);
78
- }), l(w, (e) => {
79
- e && (t.value = !t.value, w.value = !1);
80
- }), l(a, (e) => {
81
- e !== -1 && u.value[e].querySelector("a")?.click();
68
+ }), v(o, (e) => {
69
+ !e || C || !n.closeWhenClickedOutside || (document.addEventListener("click", h), document.addEventListener("focusin", p), C = !0);
70
+ }), v(i, (e) => {
71
+ e !== -1 && s.value[e]?.querySelector("a")?.click();
82
72
  }), S({
83
- activeIdx: d,
84
- selectedIdx: a,
85
- getRootElement: () => s.value
86
- }), (e, g) => (f(), j("div", {
73
+ activeIdx: a,
74
+ selectedIdx: i,
75
+ getRootElement: () => u.value,
76
+ getContentElement: () => c.value
77
+ }), (e, r) => (m(), F("div", {
87
78
  ref: "container",
88
- class: i(["uikit-relative uikit-block", e.$attrs.class]),
89
- onKeydown: $
79
+ class: d(["uikit-relative uikit-block", e.$attrs.class]),
80
+ onKeydown: H
90
81
  }, [
91
- K(e.$slots, "btn_slot", {
92
- toggleDropdown: c,
93
- isOpen: t.value
82
+ B(e.$slots, "btn_slot", {
83
+ toggleDropdown: f,
84
+ isOpen: o.value,
85
+ activeIdx: l(a),
86
+ setActiveIdx: g,
87
+ setSelectedIdx: K
94
88
  }, () => [
95
- F(Q, {
96
- id: r(k),
89
+ U(X, {
90
+ id: l(y),
97
91
  type: "button",
98
- "data-cy": o.dataCy,
99
- class: i([
92
+ "data-cy": t.dataCy,
93
+ class: d([
100
94
  "!uikit-flex uikit-w-full uikit-items-center uikit-truncate",
101
- o.btnClasses
95
+ t.btnClasses
102
96
  ]),
103
- "aria-expanded": t.value,
97
+ "aria-expanded": o.value,
104
98
  "btn-class": "uikit-btn-single-selection",
105
- onClick: g[0] || (g[0] = (_) => {
106
- v("click"), c();
99
+ onClick: r[0] || (r[0] = (k) => {
100
+ O("click"), f();
101
+ }),
102
+ onKeydown: r[1] || (r[1] = (k) => {
103
+ Array.isArray(t.closeKeys) && !t.closeKeys.includes(k.key) || k.stopPropagation();
107
104
  })
108
105
  }, {
109
- default: L(() => [
110
- G("span", {
111
- class: i(["uikit-mr-5px", o.labelClasses]),
112
- innerHTML: o.btnLabel
113
- }, null, 10, Z),
114
- o.withArrowIcon ? (f(), B(r(X), {
106
+ default: D(() => [
107
+ j("span", {
108
+ class: d(["uikit-mr-5px", t.labelClasses]),
109
+ innerHTML: t.btnLabel
110
+ }, null, 10, _),
111
+ t.withArrowIcon ? (m(), L(l(Y), {
115
112
  key: 0,
116
- class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
117
- width: o.arrowWidth,
118
- height: o.arrowWidth,
119
- "stroke-color": o.arrowStrokeColor
120
- }, null, 8, ["class", "width", "height", "stroke-color"])) : J("", !0)
113
+ class: d(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", o.value ? "uikit-rotate-180" : ""]),
114
+ width: t.arrowWidth,
115
+ height: t.arrowWidth,
116
+ "stroke-color": t.arrowStrokeColor
117
+ }, null, 8, ["class", "width", "height", "stroke-color"])) : G("", !0)
121
118
  ]),
122
119
  _: 1
123
120
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
124
121
  ]),
125
- (f(), B(P(o.dropdownElement), {
126
- id: "dropdown_" + r(k),
122
+ (m(), L(J(t.dropdownElement), Q({
123
+ id: "dropdown_" + l(y),
127
124
  ref: "dropdown",
128
- "data-cy": o.dataCy && `${o.dataCy}_dropdown`,
129
- class: i(["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
130
- o.dropdownClasses,
131
- t.value ? "uikit-flex" : "uikit-hidden",
132
- { "uikit-bottom-[55px] uikit-rounded-xs": o.direction === "up" },
133
- { "uikit-rounded-b uikit-border-t-0": o.direction === "down" },
134
- { "uikit-absolute": o.isAbsolute }
135
- ]]),
136
- "aria-hidden": !t.value
137
- }, {
138
- default: L(() => [
139
- K(e.$slots, "default", {
140
- isOpen: t.value,
141
- toggleDropdown: c,
142
- activeIdx: r(d),
143
- selectedIdx: r(a),
144
- setActiveIdx: T,
145
- setSelectedIdx: H
125
+ "data-cy": t.dataCy && `${t.dataCy}_dropdown`,
126
+ class: ["uikit-dropdown-content uikit-w-full uikit-flex-col uikit-overflow-y-auto uikit-border-solid uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
127
+ t.dropdownClasses,
128
+ o.value ? "uikit-flex" : "uikit-hidden",
129
+ { "uikit-bottom-[55px]": t.direction === "up" },
130
+ { "uikit-absolute": t.isAbsolute }
131
+ ]],
132
+ "aria-hidden": !o.value,
133
+ "data-side": t.direction
134
+ }, t.dropdownAttrs), {
135
+ default: D(() => [
136
+ B(e.$slots, "default", {
137
+ isOpen: o.value,
138
+ toggleDropdown: f,
139
+ activeIdx: l(a),
140
+ selectedIdx: l(i),
141
+ setActiveIdx: g,
142
+ setSelectedIdx: K
146
143
  })
147
144
  ]),
148
145
  _: 3
149
- }, 8, ["id", "data-cy", "class", "aria-hidden"]))
146
+ }, 16, ["id", "data-cy", "class", "aria-hidden", "data-side"]))
150
147
  ], 34));
151
148
  }
152
149
  });
@@ -1,5 +1,5 @@
1
- import { defineComponent as d, createElementBlock as a, openBlock as s, withModifiers as u, normalizeClass as t, createElementVNode as r, createCommentVNode as k } from "vue";
2
- const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
1
+ import { defineComponent as u, createElementBlock as a, openBlock as n, withModifiers as d, normalizeClass as t, createElementVNode as r, createCommentVNode as k } from "vue";
2
+ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ u({
3
3
  __name: "BaseFloatingLabel",
4
4
  props: {
5
5
  labelState: { default: "inline-label" },
@@ -10,12 +10,12 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
10
10
  labelTextClasses: {}
11
11
  },
12
12
  emits: ["click"],
13
- setup(e, { emit: n }) {
14
- const o = n;
15
- return (i, l) => (s(), a("label", {
13
+ setup(e, { emit: s }) {
14
+ const o = s;
15
+ return (i, l) => (n(), a("label", {
16
16
  for: i.$attrs.for,
17
17
  class: t(["uikit-pointer-events-none uikit-absolute uikit-left-15px uikit-h-5", [e.labelState, { "uikit-text-w-secondary": e.disabled }, e.labelClasses]]),
18
- onClick: l[0] || (l[0] = u((f) => o("click"), ["stop"]))
18
+ onClick: l[0] || (l[0] = d((m) => o("click"), ["stop"]))
19
19
  }, [
20
20
  r("span", {
21
21
  class: t(["uikit-font-medium [font-size:inherit]", [
@@ -24,9 +24,9 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ d({
24
24
  ]]),
25
25
  innerHTML: e.labelText
26
26
  }, null, 10, c),
27
- i.$attrs.required ? (s(), a("sup", {
27
+ i.$attrs.required ? (n(), a("sup", {
28
28
  key: 0,
29
- class: t(["uikit-absolute -uikit-top-[0.3rem] [font-size:inherit]", [
29
+ class: t(["uikit-absolute -uikit-top-[0.4em] uikit-pl-[2px] uikit-leading-normal [font-size:inherit]", [
30
30
  { "uikit-text-w-secondary": e.disabled },
31
31
  { "uikit-text-w-danger": e.isValid === !1 },
32
32
  { "uikit-text-w-primary": (e.isValid || e.isValid === null) && !e.disabled }
@@ -1,13 +1,14 @@
1
- import { defineComponent as z, mergeModels as C, useModel as A, ref as m, watch as w, useAttrs as N, createElementBlock as r, openBlock as u, normalizeClass as v, unref as s, renderSlot as c, createElementVNode as h, createBlock as O, createCommentVNode as y, withKeys as j, withModifiers as $, Fragment as T, renderList as B } from "vue";
2
- import D from "../../../../UIKit/BaseFloatingLabel.js";
3
- import { useFloatingLabel as G } from "../../../../composables/useFloatingLabel.js";
4
- const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby", "readonly", "type", "pattern", "min", "max", "maxlength", "inputmode", "placeholder", "value"], Q = { class: "uikit-invisible uikit-float-none uikit-mb-2 uikit-ml-2 uikit-block uikit-h-3 uikit-w-auto uikit-max-w-full uikit-overflow-hidden uikit-whitespace-nowrap uikit-p-0 uikit-text uikit-transition-[max-width] uikit-duration-[50ms] uikit-ease-out" }, W = ["innerHTML"], X = ["innerHTML"], Y = ["innerHTML"], Z = {
1
+ import { defineComponent as A, mergeModels as C, useModel as N, ref as m, useId as O, computed as j, watch as y, useAttrs as D, createElementBlock as r, openBlock as u, normalizeClass as v, unref as d, renderSlot as h, createElementVNode as g, createBlock as G, createCommentVNode as x, withKeys as J, withModifiers as Q, Fragment as T, renderList as B } from "vue";
2
+ import W from "../../../../UIKit/BaseFloatingLabel.js";
3
+ import { useFloatingLabel as X } from "../../../../composables/useFloatingLabel.js";
4
+ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby", "readonly", "type", "pattern", "min", "max", "maxlength", "inputmode", "placeholder", "value"], Z = { class: "uikit-invisible uikit-float-none uikit-mb-2 uikit-ml-2 uikit-block uikit-h-3 uikit-w-auto uikit-max-w-full uikit-overflow-hidden uikit-whitespace-nowrap uikit-p-0 uikit-text uikit-transition-[max-width] uikit-duration-[50ms] uikit-ease-out" }, U = ["innerHTML"], p = ["innerHTML"], _ = ["innerHTML"], ee = {
5
5
  key: 1,
6
6
  class: "under-label uikit-absolute uikit-text-12"
7
- }, te = /* @__PURE__ */ z({
7
+ }, ne = /* @__PURE__ */ A({
8
8
  inheritAttrs: !1,
9
9
  __name: "BaseInput",
10
10
  props: /* @__PURE__ */ C({
11
+ id: {},
11
12
  inputClass: {},
12
13
  labelText: { default: "" },
13
14
  feedback: {},
@@ -28,14 +29,14 @@ const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
28
29
  }),
29
30
  emits: /* @__PURE__ */ C(["click", "keydownEnterPressed", "focusin", "focusout", "keydown", "keyup"], ["update:modelValue"]),
30
31
  setup(e, { expose: M, emit: E }) {
31
- const d = A(e, "modelValue"), a = m(""), k = E, {
32
- labelState: o,
32
+ const o = N(e, "modelValue"), a = m(""), k = E, {
33
+ labelState: s,
33
34
  handleFocusIn: H,
34
- handleFocusOut: x,
35
- setInlineLabel: V,
36
- setFloatingLabel: I
37
- } = G(k), n = m("text"), f = m({}), b = m(null), R = () => {
38
- e.feedback && (f.value = e.feedback, e.feedback.valid && typeof e.feedback.valid == "string" && (f.value.valid = [e.feedback.valid]), e.feedback.invalid && typeof e.feedback.invalid == "string" && (f.value.invalid = [e.feedback.invalid]));
35
+ handleFocusOut: $,
36
+ setInlineLabel: I,
37
+ setFloatingLabel: V
38
+ } = X(k), R = O(), f = j(() => e.id || R), n = m("text"), b = m({}), c = m(null), P = () => {
39
+ e.feedback && (b.value = e.feedback, e.feedback.valid && typeof e.feedback.valid == "string" && (b.value.valid = [e.feedback.valid]), e.feedback.invalid && typeof e.feedback.invalid == "string" && (b.value.invalid = [e.feedback.invalid]));
39
40
  }, L = (t, i) => {
40
41
  if (!e.formatter || !e.formatter.formatFn)
41
42
  return a.value = t, "";
@@ -43,56 +44,56 @@ const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
43
44
  return i && (i.value = l), a.value = l, l;
44
45
  }, F = (t, i = !0) => {
45
46
  if (i && (!e.formatter || !e.formatter.unFormatFn))
46
- return d.value = t, t;
47
+ return o.value = t, t;
47
48
  if (!i || !e.formatter || !e.formatter.unFormatFn) return;
48
49
  const l = e.formatter.unFormatFn(t);
49
- return d.value = l ?? "", l;
50
- }, P = ({ target: t }) => {
50
+ return o.value = l ?? "", l;
51
+ }, q = ({ target: t }) => {
51
52
  const i = t, l = F(i.value);
52
53
  L(
53
54
  `${l}`,
54
- l === d.value ? i : void 0
55
+ l === o.value ? i : void 0
55
56
  );
56
- }, q = () => {
57
- d.value = "", V();
58
57
  }, K = () => {
58
+ o.value = "", I();
59
+ }, S = () => {
59
60
  n.value === "password" ? n.value = "text" : n.value === "text" && (n.value = "password");
60
61
  };
61
- w(
62
+ y(
62
63
  () => e.feedback,
63
64
  () => {
64
- R();
65
+ P();
65
66
  },
66
67
  {
67
68
  immediate: !0
68
69
  }
69
- ), w(
70
- d,
70
+ ), y(
71
+ o,
71
72
  (t) => {
72
73
  L(
73
74
  `${t}`,
74
- F(`${t}`, !1) === t ? b.value : void 0
75
- ), a.value != null && a.value.length > 0 && o.value !== "floating-label" ? I() : !a.value && document && document.activeElement !== b.value && V();
75
+ F(`${t}`, !1) === t ? c.value : void 0
76
+ ), a.value != null && a.value.length > 0 && s.value !== "floating-label" ? V() : !a.value && document && document.activeElement !== c.value && I();
76
77
  },
77
78
  {
78
79
  immediate: !0
79
80
  }
80
- ), w(
81
+ ), y(
81
82
  () => e.keepFloatingLabel,
82
83
  (t) => {
83
- t ? I() : x(d.value);
84
+ t ? V() : $(o.value);
84
85
  }
85
86
  );
86
- const S = N();
87
- return n.value = S.type || "text", M({
87
+ const z = D();
88
+ return n.value = z.type || "text", M({
88
89
  select: () => {
89
- b.value?.select();
90
+ c.value?.select();
90
91
  }
91
92
  }), (t, i) => (u(), r("div", {
92
93
  class: v(["input-wrapper uikit-relative uikit-inline-block uikit-w-full [&.has-right-icon.is-invalid_.text-input-icon]:uikit-mr-25px [&.has-right-icon.is-valid_.text-input-icon]:uikit-mr-25px", [
93
94
  t.$attrs.class,
94
95
  { "floating-label": e.labelText },
95
- s(o) === "floating-label" ? "floating-state" : "inline-state",
96
+ d(s) === "floating-label" ? "floating-state" : "inline-state",
96
97
  {
97
98
  "has-right-icon": e.withRightIcon !== void 0 ? e.withRightIcon : !!t.$slots.righticon
98
99
  },
@@ -102,16 +103,16 @@ const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
102
103
  { "is-invalid": e.isValid === !1, "is-valid": e.isValid }
103
104
  ]])
104
105
  }, [
105
- c(t.$slots, "leftIcon", {}, void 0, !0),
106
- c(t.$slots, "righticon", {
107
- handleClean: q,
108
- handleShowPasswd: K,
106
+ h(t.$slots, "leftIcon", {}, void 0, !0),
107
+ h(t.$slots, "righticon", {
108
+ handleClean: K,
109
+ handleShowPasswd: S,
109
110
  curType: n.value
110
111
  }, void 0, !0),
111
- h("input", {
112
- id: t.$attrs.id,
112
+ g("input", {
113
+ id: f.value,
113
114
  ref_key: "baseInputEl",
114
- ref: b,
115
+ ref: c,
115
116
  "data-cy": e.dataCy,
116
117
  name: t.$attrs.name,
117
118
  class: v(["input-element uikit-peer uikit-relative uikit-ml-[1px] uikit-mt-[6px] uikit-box-border uikit-block uikit-h-[42px] uikit-w-[calc(100%-2px)] uikit-appearance-none uikit-truncate uikit-rounded-[11px] !uikit-border-none uikit-bg-white uikit-bg-no-repeat uikit-px-4 uikit-outline-0 focus:uikit-shadow-none focus:uikit-outline-none disabled:uikit-bg-w-cultured disabled:uikit-text-w-secondary", [
@@ -129,7 +130,7 @@ const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
129
130
  ]]),
130
131
  autocomplete: t.$attrs.autocomplete === "on" ? "on" : "off",
131
132
  disabled: t.$attrs.disabled,
132
- "aria-labelledby": t.$attrs.id,
133
+ "aria-labelledby": f.value,
133
134
  readonly: t.$attrs.readonly,
134
135
  type: n.value,
135
136
  pattern: t.$attrs.pattern,
@@ -140,16 +141,16 @@ const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
140
141
  placeholder: t.$attrs.placeholder,
141
142
  value: a.value,
142
143
  onClick: i[0] || (i[0] = (l) => k("click", l)),
143
- onFocusin: i[1] || (i[1] = $(() => e.labelText && s(H)(), ["stop"])),
144
- onFocusout: i[2] || (i[2] = $((l) => e.labelText && !e.keepFloatingLabel && s(x)(a.value), ["stop"])),
145
- onInput: $(P, ["stop"]),
144
+ onFocusin: i[1] || (i[1] = () => e.labelText && d(H)()),
145
+ onFocusout: i[2] || (i[2] = (l) => e.labelText && !e.keepFloatingLabel && d($)(a.value)),
146
+ onInput: Q(q, ["stop"]),
146
147
  onKeydown: [
147
- i[3] || (i[3] = j(() => k("keydownEnterPressed"), ["enter"])),
148
+ i[3] || (i[3] = J(() => k("keydownEnterPressed"), ["enter"])),
148
149
  i[4] || (i[4] = (l) => k("keydown", l))
149
150
  ],
150
151
  onKeyup: i[5] || (i[5] = (l) => k("keyup", l))
151
- }, null, 42, J),
152
- h("fieldset", {
152
+ }, null, 42, Y),
153
+ g("fieldset", {
153
154
  class: v(["uikit-pointer-events-none uikit-absolute uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-top-0 uikit-m-0 uikit-box-border uikit-h-12 uikit-overflow-hidden uikit-rounded-xs uikit-border uikit-border-solid uikit-px-2 uikit-py-0 uikit-text-left uikit-transition-[border] uikit-duration-100 uikit-ease-out peer-focus:uikit-border-2 peer-focus:uikit-border-w-primary peer-focus:[&.is-invalid]:uikit-border-w-danger", [
154
155
  {
155
156
  "is-invalid uikit-border-w-danger": e.isValid === !1,
@@ -160,52 +161,52 @@ const J = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
160
161
  e.fieldsetClasses
161
162
  ]])
162
163
  }, [
163
- h("legend", Q, [
164
- h("span", {
164
+ g("legend", Z, [
165
+ g("span", {
165
166
  class: v(["visible-label uikit-opacity-0", [
166
167
  { "uikit-mx-5px": e.labelText },
167
168
  {
168
- "uikit-visible uikit-inline-block": s(o) === "floating-label"
169
+ "uikit-visible uikit-inline-block": d(s) === "floating-label"
169
170
  },
170
171
  {
171
- "uikit-invisible uikit-hidden": s(o) === "inline-label"
172
+ "uikit-invisible uikit-hidden": d(s) === "inline-label"
172
173
  }
173
174
  ]]),
174
175
  innerHTML: e.labelText
175
- }, null, 10, W)
176
+ }, null, 10, U)
176
177
  ])
177
178
  ], 2),
178
- e.labelText ? (u(), O(D, {
179
+ e.labelText ? (u(), G(W, {
179
180
  key: 0,
180
- for: t.$attrs.id,
181
+ for: f.value,
181
182
  "label-text": e.labelText,
182
- "label-state": s(o),
183
+ "label-state": d(s),
183
184
  "is-valid": e.isValid,
184
185
  required: t.$attrs.required,
185
186
  disabled: t.$attrs.disabled,
186
187
  "label-classes": [
187
- s(o) === "floating-label" ? "!-uikit-top-1" : "!uikit-top-4",
188
+ d(s) === "floating-label" ? "!-uikit-top-1" : "!uikit-top-4",
188
189
  e.labelClasses
189
190
  ],
190
191
  "label-text-classes": e.labelTextClasses
191
- }, null, 8, ["for", "label-text", "label-state", "is-valid", "required", "disabled", "label-classes", "label-text-classes"])) : y("", !0),
192
- c(t.$slots, "feedback", {}, () => [
193
- e.isValid === !1 ? (u(!0), r(T, { key: 0 }, B(f.value.invalid, (l, g) => (u(), r("div", {
194
- key: `${t.$attrs.id}_invalid_${g}`,
192
+ }, null, 8, ["for", "label-text", "label-state", "is-valid", "required", "disabled", "label-classes", "label-text-classes"])) : x("", !0),
193
+ h(t.$slots, "feedback", {}, () => [
194
+ e.isValid === !1 ? (u(!0), r(T, { key: 0 }, B(b.value.invalid, (l, w) => (u(), r("div", {
195
+ key: `${f.value}_invalid_${w}`,
195
196
  class: "uikit-mt-1 uikit-text-12 uikit-text-w-danger",
196
197
  innerHTML: l
197
- }, null, 8, X))), 128)) : e.isValid === !0 ? (u(!0), r(T, { key: 1 }, B(f.value.valid, (l, g) => (u(), r("div", {
198
- key: `${t.$attrs.id}_valid_${g}`,
198
+ }, null, 8, p))), 128)) : e.isValid === !0 ? (u(!0), r(T, { key: 1 }, B(b.value.valid, (l, w) => (u(), r("div", {
199
+ key: `${f.value}_valid_${w}`,
199
200
  class: "uikit-mt-1 uikit-text-12 uikit-text-w-primary",
200
201
  innerHTML: l
201
- }, null, 8, Y))), 128)) : y("", !0)
202
+ }, null, 8, _))), 128)) : x("", !0)
202
203
  ], !0),
203
- t.$slots["under-label"] ? (u(), r("div", Z, [
204
- c(t.$slots, "under-label", {}, void 0, !0)
205
- ])) : y("", !0)
204
+ t.$slots["under-label"] ? (u(), r("div", ee, [
205
+ h(t.$slots, "under-label", {}, void 0, !0)
206
+ ])) : x("", !0)
206
207
  ], 2));
207
208
  }
208
209
  });
209
210
  export {
210
- te as default
211
+ ne as default
211
212
  };