@wikicasa-dev/components 2.2.9-alpha.66 → 2.2.9-alpha.8

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 (58) 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 +4 -5
  6. package/dist/UIKit/AccessibleSelect.js +2 -3
  7. package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +2 -7
  8. package/dist/UIKit/BaseAutocomplete.d.ts +4 -4
  9. package/dist/UIKit/BaseButton.d.ts +8 -14
  10. package/dist/UIKit/BaseCard.js +3 -1
  11. package/dist/UIKit/BaseDropDown.d.ts +11 -17
  12. package/dist/UIKit/BaseFloatingLabel.js +4 -4
  13. package/dist/UIKit/BaseInput.d.ts +2 -3
  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/Checkbox/CheckboxBtn.d.ts +7 -14
  18. package/dist/UIKit/Checkbox/CheckboxGroup.d.ts +2 -5
  19. package/dist/UIKit/Radio/RadioButton.d.ts +23 -28
  20. package/dist/UIKit/Radio/RadioGroup.d.ts +50 -49
  21. package/dist/assets/BaseCard.css +1 -1
  22. package/dist/assets/BaseDropDown.css +1 -1
  23. package/dist/assets/BaseFloatingLabel.css +1 -1
  24. package/dist/assets/BaseInput.css +1 -1
  25. package/dist/assets/tailwind.css +1 -1
  26. package/dist/index.d.ts +0 -3
  27. package/dist/index.js +83 -92
  28. package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +160 -158
  29. package/dist/packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js +6 -4
  30. package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +106 -112
  31. package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +36 -36
  32. package/dist/packages/components/lib/UIKit/BaseButton.vue.js +24 -28
  33. package/dist/packages/components/lib/UIKit/BaseCard.vue.js +13 -13
  34. package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +105 -102
  35. package/dist/packages/components/lib/UIKit/BaseFloatingLabel.vue.js +8 -8
  36. package/dist/packages/components/lib/UIKit/BaseInput.vue.js +64 -65
  37. package/dist/packages/components/lib/UIKit/BaseModal.vue.js +36 -42
  38. package/dist/packages/components/lib/UIKit/BaseSelect/SelectItem.vue.js +17 -18
  39. package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +37 -50
  40. package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +55 -60
  41. package/dist/packages/components/lib/UIKit/Radio/RadioButton.vue.js +14 -16
  42. package/dist/packages/components/lib/UIKit/Radio/RadioGroup.vue.js +33 -37
  43. package/dist/types/index.d.ts +0 -3
  44. package/package.json +7 -8
  45. package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.d.ts +0 -40
  46. package/dist/UIKit/Checkbox/v2/CheckboxButtonGroup.js +0 -4
  47. package/dist/UIKit/Radio/v2/RadioButtonGroup.d.ts +0 -29
  48. package/dist/UIKit/Radio/v2/RadioButtonGroup.js +0 -4
  49. package/dist/UIKit/Radio/v2/RadioButtonItem.d.ts +0 -16
  50. package/dist/UIKit/Radio/v2/RadioButtonItem.js +0 -5
  51. package/dist/assets/AccessibleSelect.css +0 -1
  52. package/dist/assets/RadioButtonItem.css +0 -1
  53. package/dist/composables/mock.d.ts +0 -25
  54. package/dist/composables/mock.js +0 -49
  55. package/dist/packages/components/lib/UIKit/Checkbox/v2/CheckboxButtonGroup.vue.js +0 -78
  56. package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonGroup.vue.js +0 -49
  57. package/dist/packages/components/lib/UIKit/Radio/v2/RadioButtonItem.vue.js +0 -45
  58. /package/dist/assets/{swiper-controller.css → swiper-thumbs.css} +0 -0
@@ -1,12 +1,11 @@
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({
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({
6
6
  inheritAttrs: !1,
7
7
  __name: "BaseDropDown",
8
- props: /* @__PURE__ */ I({
9
- dropdownAttrs: {},
8
+ props: /* @__PURE__ */ D({
10
9
  dropdownClasses: { default: "" },
11
10
  btnClasses: { default: "" },
12
11
  withArrowIcon: { type: Boolean, default: !1 },
@@ -16,134 +15,138 @@ const _ = ["innerHTML"], le = /* @__PURE__ */ T({
16
15
  arrowWidth: { default: 12 },
17
16
  arrowStrokeColor: { default: void 0 },
18
17
  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"] },
24
23
  dataCy: { default: "" }
25
24
  }, {
25
+ toggleDropdown: { type: Boolean, default: void 0 },
26
+ toggleDropdownModifiers: {},
26
27
  resetKeyboardController: { type: Boolean, default: !1 },
27
- resetKeyboardControllerModifiers: {},
28
- open: { type: Boolean, default: !1 },
29
- openModifiers: {}
28
+ resetKeyboardControllerModifiers: {}
30
29
  }),
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,
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,
35
34
  "resetKeyboardController"
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());
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);
49
53
  }, 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
- }, K = (e) => {
56
- e != null && (i.value = e);
57
- }, E = () => {
58
- c.value && (s.value = Array.from(c.value.children));
55
+ }, C = () => {
56
+ y.value && (u.value = Array.from(y.value.children));
59
57
  };
60
58
  return z(() => {
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;
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;
67
65
  }));
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();
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();
72
82
  }), S({
73
- activeIdx: a,
74
- selectedIdx: i,
75
- getRootElement: () => u.value,
76
- getContentElement: () => c.value
77
- }), (e, r) => (m(), F("div", {
83
+ activeIdx: d,
84
+ selectedIdx: a,
85
+ getRootElement: () => s.value
86
+ }), (e, g) => (f(), j("div", {
78
87
  ref: "container",
79
- class: d(["uikit-relative uikit-block", e.$attrs.class]),
80
- onKeydown: H
88
+ class: i(["uikit-relative uikit-block", e.$attrs.class]),
89
+ onKeydown: $
81
90
  }, [
82
- B(e.$slots, "btn_slot", {
83
- toggleDropdown: f,
84
- isOpen: o.value,
85
- activeIdx: l(a),
86
- setActiveIdx: g,
87
- setSelectedIdx: K
91
+ K(e.$slots, "btn_slot", {
92
+ toggleDropdown: c,
93
+ isOpen: t.value
88
94
  }, () => [
89
- U(X, {
90
- id: l(y),
95
+ F(Q, {
96
+ id: r(k),
91
97
  type: "button",
92
- "data-cy": t.dataCy,
93
- class: d([
98
+ "data-cy": o.dataCy,
99
+ class: i([
94
100
  "!uikit-flex uikit-w-full uikit-items-center uikit-truncate",
95
- t.btnClasses
101
+ o.btnClasses
96
102
  ]),
97
- "aria-expanded": o.value,
103
+ "aria-expanded": t.value,
98
104
  "btn-class": "uikit-btn-single-selection",
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();
105
+ onClick: g[0] || (g[0] = (_) => {
106
+ v("click"), c();
104
107
  })
105
108
  }, {
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), {
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), {
112
115
  key: 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)
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)
118
121
  ]),
119
122
  _: 1
120
123
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
121
124
  ]),
122
- (m(), L(J(t.dropdownElement), Q({
123
- id: "dropdown_" + l(y),
125
+ (f(), B(P(o.dropdownElement), {
126
+ id: "dropdown_" + r(k),
124
127
  ref: "dropdown",
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
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
143
146
  })
144
147
  ]),
145
148
  _: 3
146
- }, 16, ["id", "data-cy", "class", "aria-hidden", "data-side"]))
149
+ }, 8, ["id", "data-cy", "class", "aria-hidden"]))
147
150
  ], 34));
148
151
  }
149
152
  });
@@ -1,5 +1,5 @@
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({
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({
3
3
  __name: "BaseFloatingLabel",
4
4
  props: {
5
5
  labelState: { default: "inline-label" },
@@ -10,12 +10,12 @@ const b = ["for"], c = ["innerHTML"], x = /* @__PURE__ */ u({
10
10
  labelTextClasses: {}
11
11
  },
12
12
  emits: ["click"],
13
- setup(e, { emit: s }) {
14
- const o = s;
15
- return (i, l) => (n(), a("label", {
13
+ setup(e, { emit: n }) {
14
+ const o = n;
15
+ return (i, l) => (s(), 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] = d((m) => o("click"), ["stop"]))
18
+ onClick: l[0] || (l[0] = u((f) => 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__ */ u({
24
24
  ]]),
25
25
  innerHTML: e.labelText
26
26
  }, null, 10, c),
27
- i.$attrs.required ? (n(), a("sup", {
27
+ i.$attrs.required ? (s(), a("sup", {
28
28
  key: 0,
29
- class: t(["uikit-absolute -uikit-top-[0.4em] uikit-pl-[2px] uikit-leading-normal [font-size:inherit]", [
29
+ class: t(["uikit-absolute -uikit-top-[0.3rem] [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,14 +1,13 @@
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 = {
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 = {
5
5
  key: 1,
6
6
  class: "under-label uikit-absolute uikit-text-12"
7
- }, ne = /* @__PURE__ */ A({
7
+ }, te = /* @__PURE__ */ z({
8
8
  inheritAttrs: !1,
9
9
  __name: "BaseInput",
10
10
  props: /* @__PURE__ */ C({
11
- id: {},
12
11
  inputClass: {},
13
12
  labelText: { default: "" },
14
13
  feedback: {},
@@ -29,14 +28,14 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
29
28
  }),
30
29
  emits: /* @__PURE__ */ C(["click", "keydownEnterPressed", "focusin", "focusout", "keydown", "keyup"], ["update:modelValue"]),
31
30
  setup(e, { expose: M, emit: E }) {
32
- const o = N(e, "modelValue"), a = m(""), k = E, {
33
- labelState: s,
31
+ const d = A(e, "modelValue"), a = m(""), k = E, {
32
+ labelState: o,
34
33
  handleFocusIn: H,
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]));
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]));
40
39
  }, L = (t, i) => {
41
40
  if (!e.formatter || !e.formatter.formatFn)
42
41
  return a.value = t, "";
@@ -44,56 +43,56 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
44
43
  return i && (i.value = l), a.value = l, l;
45
44
  }, F = (t, i = !0) => {
46
45
  if (i && (!e.formatter || !e.formatter.unFormatFn))
47
- return o.value = t, t;
46
+ return d.value = t, t;
48
47
  if (!i || !e.formatter || !e.formatter.unFormatFn) return;
49
48
  const l = e.formatter.unFormatFn(t);
50
- return o.value = l ?? "", l;
51
- }, q = ({ target: t }) => {
49
+ return d.value = l ?? "", l;
50
+ }, P = ({ target: t }) => {
52
51
  const i = t, l = F(i.value);
53
52
  L(
54
53
  `${l}`,
55
- l === o.value ? i : void 0
54
+ l === d.value ? i : void 0
56
55
  );
56
+ }, q = () => {
57
+ d.value = "", V();
57
58
  }, K = () => {
58
- o.value = "", I();
59
- }, S = () => {
60
59
  n.value === "password" ? n.value = "text" : n.value === "text" && (n.value = "password");
61
60
  };
62
- y(
61
+ w(
63
62
  () => e.feedback,
64
63
  () => {
65
- P();
64
+ R();
66
65
  },
67
66
  {
68
67
  immediate: !0
69
68
  }
70
- ), y(
71
- o,
69
+ ), w(
70
+ d,
72
71
  (t) => {
73
72
  L(
74
73
  `${t}`,
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();
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();
77
76
  },
78
77
  {
79
78
  immediate: !0
80
79
  }
81
- ), y(
80
+ ), w(
82
81
  () => e.keepFloatingLabel,
83
82
  (t) => {
84
- t ? V() : $(o.value);
83
+ t ? I() : x(d.value);
85
84
  }
86
85
  );
87
- const z = D();
88
- return n.value = z.type || "text", M({
86
+ const S = N();
87
+ return n.value = S.type || "text", M({
89
88
  select: () => {
90
- c.value?.select();
89
+ b.value?.select();
91
90
  }
92
91
  }), (t, i) => (u(), r("div", {
93
92
  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", [
94
93
  t.$attrs.class,
95
94
  { "floating-label": e.labelText },
96
- d(s) === "floating-label" ? "floating-state" : "inline-state",
95
+ s(o) === "floating-label" ? "floating-state" : "inline-state",
97
96
  {
98
97
  "has-right-icon": e.withRightIcon !== void 0 ? e.withRightIcon : !!t.$slots.righticon
99
98
  },
@@ -103,16 +102,16 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
103
102
  { "is-invalid": e.isValid === !1, "is-valid": e.isValid }
104
103
  ]])
105
104
  }, [
106
- h(t.$slots, "leftIcon", {}, void 0, !0),
107
- h(t.$slots, "righticon", {
108
- handleClean: K,
109
- handleShowPasswd: S,
105
+ c(t.$slots, "leftIcon", {}, void 0, !0),
106
+ c(t.$slots, "righticon", {
107
+ handleClean: q,
108
+ handleShowPasswd: K,
110
109
  curType: n.value
111
110
  }, void 0, !0),
112
- g("input", {
113
- id: f.value,
111
+ h("input", {
112
+ id: t.$attrs.id,
114
113
  ref_key: "baseInputEl",
115
- ref: c,
114
+ ref: b,
116
115
  "data-cy": e.dataCy,
117
116
  name: t.$attrs.name,
118
117
  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", [
@@ -130,7 +129,7 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
130
129
  ]]),
131
130
  autocomplete: t.$attrs.autocomplete === "on" ? "on" : "off",
132
131
  disabled: t.$attrs.disabled,
133
- "aria-labelledby": f.value,
132
+ "aria-labelledby": t.$attrs.id,
134
133
  readonly: t.$attrs.readonly,
135
134
  type: n.value,
136
135
  pattern: t.$attrs.pattern,
@@ -141,16 +140,16 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
141
140
  placeholder: t.$attrs.placeholder,
142
141
  value: a.value,
143
142
  onClick: i[0] || (i[0] = (l) => k("click", l)),
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"]),
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"]),
147
146
  onKeydown: [
148
- i[3] || (i[3] = J(() => k("keydownEnterPressed"), ["enter"])),
147
+ i[3] || (i[3] = j(() => k("keydownEnterPressed"), ["enter"])),
149
148
  i[4] || (i[4] = (l) => k("keydown", l))
150
149
  ],
151
150
  onKeyup: i[5] || (i[5] = (l) => k("keyup", l))
152
- }, null, 42, Y),
153
- g("fieldset", {
151
+ }, null, 42, J),
152
+ h("fieldset", {
154
153
  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", [
155
154
  {
156
155
  "is-invalid uikit-border-w-danger": e.isValid === !1,
@@ -161,52 +160,52 @@ const Y = ["id", "data-cy", "name", "autocomplete", "disabled", "aria-labelledby
161
160
  e.fieldsetClasses
162
161
  ]])
163
162
  }, [
164
- g("legend", Z, [
165
- g("span", {
163
+ h("legend", Q, [
164
+ h("span", {
166
165
  class: v(["visible-label uikit-opacity-0", [
167
166
  { "uikit-mx-5px": e.labelText },
168
167
  {
169
- "uikit-visible uikit-inline-block": d(s) === "floating-label"
168
+ "uikit-visible uikit-inline-block": s(o) === "floating-label"
170
169
  },
171
170
  {
172
- "uikit-invisible uikit-hidden": d(s) === "inline-label"
171
+ "uikit-invisible uikit-hidden": s(o) === "inline-label"
173
172
  }
174
173
  ]]),
175
174
  innerHTML: e.labelText
176
- }, null, 10, U)
175
+ }, null, 10, W)
177
176
  ])
178
177
  ], 2),
179
- e.labelText ? (u(), G(W, {
178
+ e.labelText ? (u(), O(D, {
180
179
  key: 0,
181
- for: f.value,
180
+ for: t.$attrs.id,
182
181
  "label-text": e.labelText,
183
- "label-state": d(s),
182
+ "label-state": s(o),
184
183
  "is-valid": e.isValid,
185
184
  required: t.$attrs.required,
186
185
  disabled: t.$attrs.disabled,
187
186
  "label-classes": [
188
- d(s) === "floating-label" ? "!-uikit-top-1" : "!uikit-top-4",
187
+ s(o) === "floating-label" ? "!-uikit-top-1" : "!uikit-top-4",
189
188
  e.labelClasses
190
189
  ],
191
190
  "label-text-classes": e.labelTextClasses
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}`,
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}`,
196
195
  class: "uikit-mt-1 uikit-text-12 uikit-text-w-danger",
197
196
  innerHTML: l
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}`,
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}`,
200
199
  class: "uikit-mt-1 uikit-text-12 uikit-text-w-primary",
201
200
  innerHTML: l
202
- }, null, 8, _))), 128)) : x("", !0)
201
+ }, null, 8, Y))), 128)) : y("", !0)
203
202
  ], !0),
204
- t.$slots["under-label"] ? (u(), r("div", ee, [
205
- h(t.$slots, "under-label", {}, void 0, !0)
206
- ])) : x("", !0)
203
+ t.$slots["under-label"] ? (u(), r("div", Z, [
204
+ c(t.$slots, "under-label", {}, void 0, !0)
205
+ ])) : y("", !0)
207
206
  ], 2));
208
207
  }
209
208
  });
210
209
  export {
211
- ne as default
210
+ te as default
212
211
  };