@wikicasa-dev/components 2.0.47 → 2.0.49

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.
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.B8fWfyF7.js";
1
+ import { _ as f } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.Dpwbklqk.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CThPNixl.js";
1
+ import { _ as f } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.B31Vyyn6.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
1
+ import { _ as f } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CpbjEyOl.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -2,9 +2,10 @@ import { AccessibleSelectOptions } from './types';
2
2
  import { ClassType, Optional } from '@wikicasa-dev/types';
3
3
  declare const _default: <T, LabelID extends string | number | undefined>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly onClick?: ((args_0: MouseEvent) => any) | undefined;
5
6
  readonly "onUpdate:modelValue"?: ((modelValue: Optional<AccessibleSelectOptions<T, LabelID>>) => any) | undefined;
6
7
  readonly "onUpdate:toggleDropdown"?: ((toggleDropdown: Optional<boolean>) => any) | undefined;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:toggleDropdown"> & ({
8
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick" | "onUpdate:modelValue" | "onUpdate:toggleDropdown"> & ({
8
9
  modelValue?: Optional<AccessibleSelectOptions<T, LabelID>>;
9
10
  toggleDropdown?: Optional<boolean>;
10
11
  } & {
@@ -43,7 +44,7 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
43
44
  slots: {
44
45
  lefticon?(_: {}): any;
45
46
  };
46
- emit: {
47
+ emit: ((evt: "click", args_0: MouseEvent) => void) & {
47
48
  'update:modelValue': [modelValue: Optional<AccessibleSelectOptions<T, LabelID>>];
48
49
  'update:toggleDropdown': [toggleDropdown: Optional<boolean>];
49
50
  };
@@ -1,5 +1,28 @@
1
- import { Nullable } from '@wikicasa-dev/types';
1
+ import { Nullable, Optional } from '@wikicasa-dev/types';
2
2
  import { ClassType } from './types';
3
+ declare let __VLS_typeProps: {
4
+ dropdownClasses?: ClassType;
5
+ btnClasses?: string;
6
+ withArrowIcon?: boolean;
7
+ btnLabel?: string;
8
+ labelClasses?: ClassType;
9
+ direction?: "up" | "down";
10
+ arrowWidth?: number;
11
+ arrowStrokeColor?: `#${string}`;
12
+ isAbsolute?: boolean;
13
+ /**
14
+ * @deprecated Use v-model:toggleDropdown instead
15
+ */
16
+ openDropdown?: boolean;
17
+ closeWhenClickedOutside?: boolean;
18
+ dropdownElement?: "div" | "ul" | "ol";
19
+ keepState?: "opened" | "closed" | "";
20
+ activateKeyboardController?: boolean;
21
+ dataCy?: string;
22
+ };
23
+ type __VLS_PublicProps = {
24
+ "toggleDropdown"?: Optional<boolean>;
25
+ } & typeof __VLS_typeProps;
3
26
  declare function __VLS_template(): {
4
27
  slots: {
5
28
  btn_slot?(_: {
@@ -21,43 +44,13 @@ declare function __VLS_template(): {
21
44
  attrs: Partial<{}>;
22
45
  };
23
46
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
24
- declare const __VLS_component: import('vue').DefineComponent<{
25
- dropdownClasses?: ClassType;
26
- btnClasses?: string;
27
- withArrowIcon?: boolean;
28
- btnLabel?: string;
29
- labelClasses?: ClassType;
30
- direction?: "up" | "down";
31
- arrowWidth?: number;
32
- arrowStrokeColor?: `#${string}`;
33
- isAbsolute?: boolean;
34
- openDropdown?: boolean;
35
- closeWhenClickedOutside?: boolean;
36
- dropdownElement?: "div" | "ul" | "ol";
37
- keepState?: "opened" | "closed" | "";
38
- activateKeyboardController?: boolean;
39
- dataCy?: string;
40
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
47
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
41
48
  click: () => any;
49
+ "update:toggleDropdown": (toggleDropdown: Optional<boolean>) => any;
42
50
  "update:dropdownState": (args_0: boolean) => any;
43
- }, string, import('vue').PublicProps, Readonly<{
44
- dropdownClasses?: ClassType;
45
- btnClasses?: string;
46
- withArrowIcon?: boolean;
47
- btnLabel?: string;
48
- labelClasses?: ClassType;
49
- direction?: "up" | "down";
50
- arrowWidth?: number;
51
- arrowStrokeColor?: `#${string}`;
52
- isAbsolute?: boolean;
53
- openDropdown?: boolean;
54
- closeWhenClickedOutside?: boolean;
55
- dropdownElement?: "div" | "ul" | "ol";
56
- keepState?: "opened" | "closed" | "";
57
- activateKeyboardController?: boolean;
58
- dataCy?: string;
59
- }> & Readonly<{
51
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
60
52
  onClick?: (() => any) | undefined;
53
+ "onUpdate:toggleDropdown"?: ((toggleDropdown: Optional<boolean>) => any) | undefined;
61
54
  "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
62
55
  }>, {
63
56
  dataCy: string;
@@ -1,33 +1,33 @@
1
- import { h as m, defineComponent as F, mergeModels as I, useModel as $, useId as A, computed as M, ref as L, watch as V, onMounted as D, onUnmounted as z, openBlock as o, createElementBlock as n, normalizeClass as a, createElementVNode as s, createCommentVNode as k, withModifiers as p, renderSlot as E, unref as b, createBlock as P, createVNode as N, Fragment as T, renderList as O } from "vue";
2
- import { A as q } from "./useKeyboardController.CutKeclN.js";
3
- import { a as j } from "./ArrowIcon.CCFMdsq6.js";
4
- import { e as S } from "./PharmacyIcon.56ql_DYl.js";
5
- const U = (t, { attrs: r }) => {
6
- t = { ...S(), ...t };
7
- const { width: c, height: w } = t;
8
- return m(
1
+ import { h as f, defineComponent as D, mergeModels as M, useModel as L, useId as z, computed as V, ref as T, watch as B, onMounted as E, onUnmounted as P, openBlock as o, createElementBlock as n, normalizeClass as a, createElementVNode as s, createCommentVNode as k, withModifiers as p, renderSlot as N, unref as b, createBlock as O, createVNode as q, Fragment as H, renderList as j } from "vue";
2
+ import { A as S } from "./useKeyboardController.CutKeclN.js";
3
+ import { a as U } from "./ArrowIcon.CCFMdsq6.js";
4
+ import { e as G } from "./PharmacyIcon.56ql_DYl.js";
5
+ const J = (t, { attrs: m }) => {
6
+ t = { ...G(), ...t };
7
+ const { width: w, height: r } = t;
8
+ return f(
9
9
  "svg",
10
10
  {
11
11
  xmlns: "http://www.w3.org/2000/svg",
12
12
  viewBox: "0 0 11.175 13.409",
13
- width: `${c}`,
14
- height: `${w}`,
13
+ width: `${w}`,
14
+ height: `${r}`,
15
15
  class: t.class ?? "",
16
- "aria-hidden": r["aria-hidden"] ?? "true",
16
+ "aria-hidden": m["aria-hidden"] ?? "true",
17
17
  fill: "none",
18
18
  stroke: t["stroke-color"] ?? "#FA4F64"
19
19
  },
20
20
  [
21
- m("circle", {
21
+ f("circle", {
22
22
  cx: 6,
23
23
  cy: 6,
24
24
  r: 4.5
25
25
  }),
26
- m("path", {
26
+ f("path", {
27
27
  "stroke-linejoin": "round",
28
28
  d: "M5.8 3.6h.4L6 6.5z"
29
29
  }),
30
- m("circle", {
30
+ f("circle", {
31
31
  cx: 6,
32
32
  cy: 8.2,
33
33
  r: 0.6,
@@ -36,10 +36,10 @@ const U = (t, { attrs: r }) => {
36
36
  })
37
37
  ]
38
38
  );
39
- }, G = ["id", "innerHTML"], J = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby"], K = ["innerHTML"], Q = { class: "uikit-pointer-events-none uikit-mt-1 uikit-inline-flex" }, R = ["innerHTML"], W = ["data-cy"], X = ["id", "aria-selected", "onClick", "onMouseover"], Y = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, Z = ["name", "checked", "onInput"], x = ["innerHTML"], _ = ["id", "arial-live", "innerHTML"], ee = ["id", "arial-live", "innerHTML"], oe = /* @__PURE__ */ F({
39
+ }, K = ["id", "innerHTML"], Q = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby"], R = ["innerHTML"], W = { class: "uikit-pointer-events-none uikit-mt-1 uikit-inline-flex" }, X = ["innerHTML"], Y = ["data-cy"], Z = ["id", "aria-selected", "onClick", "onMouseover"], x = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, _ = ["name", "checked", "onInput"], ii = ["innerHTML"], ei = ["id", "arial-live", "innerHTML"], ti = ["id", "arial-live", "innerHTML"], ni = /* @__PURE__ */ D({
40
40
  inheritAttrs: !1,
41
41
  __name: "AccessibleSelect",
42
- props: /* @__PURE__ */ I({
42
+ props: /* @__PURE__ */ M({
43
43
  label: { default: "" },
44
44
  dropdownPosition: { default: "bottom" },
45
45
  namespace: {},
@@ -68,175 +68,177 @@ const U = (t, { attrs: r }) => {
68
68
  },
69
69
  toggleDropdownModifiers: {}
70
70
  }),
71
- emits: ["update:modelValue", "update:toggleDropdown"],
72
- setup(t) {
73
- const r = $(t, "modelValue"), c = $(t, "toggleDropdown"), w = A(), l = M(() => t.namespace || w), i = L(!1), B = L(null), h = M(() => !!r.value.label), { activeIdx: v, selectedIdx: H } = q({
71
+ emits: /* @__PURE__ */ M(["click"], ["update:modelValue", "update:toggleDropdown"]),
72
+ setup(t, { emit: m }) {
73
+ const w = m, r = L(t, "modelValue"), g = L(t, "toggleDropdown"), F = z(), l = V(() => t.namespace || F), e = T(!1), I = T(null), h = V(() => !!r.value.label), { activeIdx: c, selectedIdx: A } = S({
74
74
  optionsLength: t.options.length,
75
- isDropdownOpen: i
76
- }), y = (e) => {
77
- i.value = !1, r.value = e;
75
+ isDropdownOpen: e
76
+ }), y = (i) => {
77
+ e.value = !1, r.value = i;
78
78
  };
79
- V(H, (e) => {
80
- y(t.options[e]), i.value = !1;
81
- }), V(c, (e) => {
82
- e && (i.value = !i.value, c.value = !1);
79
+ B(A, (i) => {
80
+ y(t.options[i]), e.value = !1;
81
+ }), B(g, (i) => {
82
+ i && (e.value = !e.value, g.value = !1);
83
83
  });
84
- const g = ({ target: e }) => {
85
- `${l.value}_btn` !== e.id && (i.value = !1);
84
+ const C = ({ target: i }) => {
85
+ `${l.value}_btn` !== i.id && (e.value = !1);
86
86
  };
87
- return D(() => {
88
- t.closeOnBodyPressed && document.addEventListener("click", g);
89
- }), z(() => {
90
- t.closeOnBodyPressed && document.removeEventListener("click", g);
91
- }), (e, u) => (o(), n("div", {
92
- class: a(e.$attrs.class)
87
+ return E(() => {
88
+ t.closeOnBodyPressed && document.addEventListener("click", C);
89
+ }), P(() => {
90
+ t.closeOnBodyPressed && document.removeEventListener("click", C);
91
+ }), (i, u) => (o(), n("div", {
92
+ class: a(i.$attrs.class)
93
93
  }, [
94
94
  s("div", {
95
- class: a(["uikit-relative uikit-flex uikit-h-12 uikit-items-center", e.wrapperClasses])
95
+ class: a(["uikit-relative uikit-flex uikit-h-12 uikit-items-center", i.wrapperClasses])
96
96
  }, [
97
- e.label ? (o(), n("label", {
97
+ i.label ? (o(), n("label", {
98
98
  key: 0,
99
99
  id: `${l.value}_label`,
100
100
  class: a(["uikit-pointer-events-none uikit-absolute uikit-z-10 uikit-text-sm uikit-font-medium uikit-transition-all uikit-ease-in-out", [
101
101
  h.value ? "as-floating -uikit-top-1 uikit-left-[22px] uikit-text-w-black" : "as-inline uikit-top-4 uikit-text-w-gray",
102
- e.labelClasses,
103
- { "uikit-left-9": e.$slots.lefticon && !h.value },
104
- { "uikit-left-4": !e.$slots.lefticon && !h.value }
102
+ i.labelClasses,
103
+ { "uikit-left-9": i.$slots.lefticon && !h.value },
104
+ { "uikit-left-4": !i.$slots.lefticon && !h.value }
105
105
  ]]),
106
- innerHTML: e.label
107
- }, null, 10, G)) : k("", !0),
108
- e.$slots.lefticon ? (o(), n("span", {
106
+ innerHTML: i.label
107
+ }, null, 10, K)) : k("", !0),
108
+ i.$slots.lefticon ? (o(), n("span", {
109
109
  key: 1,
110
110
  class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
111
- onClick: u[0] || (u[0] = p((d) => i.value = !i.value, ["stop"]))
111
+ onClick: u[0] || (u[0] = p((d) => e.value = !e.value, ["stop"]))
112
112
  }, [
113
- E(e.$slots, "lefticon")
113
+ N(i.$slots, "lefticon")
114
114
  ])) : k("", !0),
115
115
  s("button", {
116
116
  id: `${l.value}_btn`,
117
117
  ref_key: "btnEl",
118
- ref: B,
118
+ ref: I,
119
119
  type: "button",
120
- "data-cy": e.dataCy,
121
- class: a(["uikit-peer uikit-relative uikit-z-10 uikit-flex uikit-h-full uikit-w-full uikit-items-center uikit-justify-between uikit-truncate uikit-border-0 uikit-bg-transparent uikit-pr-4 uikit-text-left focus-visible:uikit-outline-0", [e.$slots.lefticon ? "uikit-pl-2" : "uikit-pl-4", e.btnClasses]]),
122
- "aria-required": !!e.$attrs.required,
120
+ "data-cy": i.dataCy,
121
+ class: a(["uikit-peer uikit-relative uikit-z-10 uikit-flex uikit-h-full uikit-w-full uikit-items-center uikit-justify-between uikit-truncate uikit-border-0 uikit-bg-transparent uikit-pr-4 uikit-text-left focus-visible:uikit-outline-0", [i.$slots.lefticon ? "uikit-pl-2" : "uikit-pl-4", i.btnClasses]]),
122
+ "aria-required": !!i.$attrs.required,
123
123
  role: "combobox",
124
124
  "aria-haspopup": "listbox",
125
125
  "aria-controls": `${l.value}_dropdown`,
126
126
  "aria-labelledby": `${l.value}_label ${l.value}_btn`,
127
- "aria-expanded": i.value,
128
- "aria-activedescendant": b(v) >= 0 && i.value ? `${l.value}_element_${e.options[b(v)].label}` : "",
129
- "aria-invalid": e.isValid === !1,
130
- "aria-describedby": e.isValid === !1 ? `${l.value}_invalid_msg` : void 0,
131
- onClick: u[1] || (u[1] = (d) => i.value = !i.value)
127
+ "aria-expanded": e.value,
128
+ "aria-activedescendant": b(c) >= 0 && e.value ? `${l.value}_element_${i.options[b(c)].label}` : "",
129
+ "aria-invalid": i.isValid === !1,
130
+ "aria-describedby": i.isValid === !1 ? `${l.value}_invalid_msg` : void 0,
131
+ onClick: u[1] || (u[1] = (d) => {
132
+ e.value = !e.value, w("click", d);
133
+ })
132
134
  }, [
133
135
  s("span", {
134
- class: a(["uikit-pointer-events-none uikit-mt-1", e.btnTextClasses]),
136
+ class: a(["uikit-pointer-events-none uikit-mt-1", i.btnTextClasses]),
135
137
  innerHTML: r.value.visibleLabel || r.value.label
136
- }, null, 10, K),
137
- s("span", Q, [
138
- e.isValid == !1 ? (o(), P(b(U), {
138
+ }, null, 10, R),
139
+ s("span", W, [
140
+ i.isValid == !1 ? (o(), O(b(J), {
139
141
  key: 0,
140
142
  class: "uikit-mr-1",
141
143
  width: 20,
142
144
  height: 20,
143
145
  "stroke-color": "#FA4F64"
144
146
  })) : k("", !0),
145
- N(b(j), {
147
+ q(b(U), {
146
148
  class: a(["uikit-transition-transform motion-reduce:uikit-transition-none", [
147
- i.value ? "uikit-rotate-180" : "",
148
- e.arrowIcon?.classes
149
+ e.value ? "uikit-rotate-180" : "",
150
+ i.arrowIcon?.classes
149
151
  ]]),
150
- width: e.arrowIcon?.width ?? 18,
151
- height: e.arrowIcon?.height ?? 18,
152
- "stroke-color": e.isValid ? "#2B5DFF" : e.isValid === !1 ? "#FA4F64" : e.arrowIcon?.strokeColor ?? "#222"
152
+ width: i.arrowIcon?.width ?? 18,
153
+ height: i.arrowIcon?.height ?? 18,
154
+ "stroke-color": i.isValid ? "#2B5DFF" : i.isValid === !1 ? "#FA4F64" : i.arrowIcon?.strokeColor ?? "#222"
153
155
  }, null, 8, ["class", "width", "height", "stroke-color"])
154
156
  ])
155
- ], 10, J),
157
+ ], 10, Q),
156
158
  s("fieldset", {
157
159
  "aria-hidden": "true",
158
160
  class: a(["uikit-pointer-events-none uikit-absolute uikit-bottom-0 uikit-left-0 uikit-right-0 uikit-m-0 uikit-box-border uikit-h-12 uikit-cursor-pointer uikit-rounded-xs uikit-bg-white uikit-px-2 uikit-py-0 peer-focus:uikit-border-2", [
159
- e.fieldsetClasses,
160
- e.isValid ? "uikit-border-w-primary" : e.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary",
161
+ i.fieldsetClasses,
162
+ i.isValid ? "uikit-border-w-primary" : i.isValid === !1 ? "uikit-border-w-danger" : "uikit-border-w-secondary",
161
163
  {
162
- "uikit-border uikit-border-solid peer-focus:uikit-border-w-primary peer-focus-visible:uikit-border-2 peer-focus-visible:uikit-border-w-primary peer-aria-invalid:uikit-border-w-danger": e.border
164
+ "uikit-border uikit-border-solid peer-focus:uikit-border-w-primary peer-focus-visible:uikit-border-2 peer-focus-visible:uikit-border-w-primary peer-aria-invalid:uikit-border-w-danger": i.border
163
165
  },
164
- { "uikit-border-0 peer-focus:uikit-border-0": !e.border }
166
+ { "uikit-border-0 peer-focus:uikit-border-0": !i.border }
165
167
  ]])
166
168
  }, [
167
169
  s("legend", {
168
- class: a([[e.legendClasses, { "uikit-m-0 uikit-w-0": !e.label }], "uikit-ml-2 uikit-h-3 uikit-px-0 uikit-text-sm"])
170
+ class: a([[i.legendClasses, { "uikit-m-0 uikit-w-0": !i.label }], "uikit-ml-2 uikit-h-3 uikit-px-0 uikit-text-sm"])
169
171
  }, [
170
- e.label ? (o(), n("span", {
172
+ i.label ? (o(), n("span", {
171
173
  key: 0,
172
174
  class: a(["uikit-mx-5px", [r.value.label ? "uikit-invisible" : "uikit-hidden"]]),
173
- innerHTML: e.label
174
- }, null, 10, R)) : k("", !0)
175
+ innerHTML: i.label
176
+ }, null, 10, X)) : k("", !0)
175
177
  ], 2)
176
178
  ], 2),
177
179
  s("ul", {
178
- "data-cy": e.dataCy && `${e.dataCy}_dropdown`,
180
+ "data-cy": i.dataCy && `${i.dataCy}_dropdown`,
179
181
  role: "listbox",
180
182
  tabindex: -1,
181
183
  "aria-multiselectable": !1,
182
184
  class: a(["uikit-absolute uikit-z-30 uikit-m-0 uikit-max-h-[225px] uikit-w-full uikit-min-w-full uikit-list-none uikit-overflow-y-auto uikit-p-0 uikit-no-scrollbar", [
183
- { "uikit-h-0 uikit-w-0 uikit-overflow-hidden": !i.value },
185
+ { "uikit-h-0 uikit-w-0 uikit-overflow-hidden": !e.value },
184
186
  {
185
- "uikit-rounded-xs uikit-border uikit-border-solid uikit-border-w-secondary uikit-bg-white": i.value
187
+ "uikit-rounded-xs uikit-border uikit-border-solid uikit-border-w-secondary uikit-bg-white": e.value
186
188
  },
187
- { "uikit-bottom-[55px]": e.dropdownPosition === "top" },
188
- { "uikit-top-[55px]": e.dropdownPosition === "bottom" },
189
- e.dropdownClasses
189
+ { "uikit-bottom-[55px]": i.dropdownPosition === "top" },
190
+ { "uikit-top-[55px]": i.dropdownPosition === "bottom" },
191
+ i.dropdownClasses
190
192
  ]]),
191
193
  onClick: u[3] || (u[3] = p(() => {
192
194
  }, ["stop"]))
193
195
  }, [
194
- (o(!0), n(T, null, O(e.options, (d, f) => (o(), n("li", {
195
- id: `${l.value}_element_${e.options[f].label}`,
196
- key: `${d.label}_${f}`,
196
+ (o(!0), n(H, null, j(i.options, (d, v) => (o(), n("li", {
197
+ id: `${l.value}_element_${i.options[v].label}`,
198
+ key: `${d.label}_${v}`,
197
199
  role: "option",
198
- "aria-selected": b(v) === f,
199
- class: a(["uikit-m-1 uikit-cursor-pointer uikit-px-20px uikit-py-10px uikit-text aria-selected:uikit-rounded-xs aria-selected:uikit-bg-w-cultured", e.dropdownItemClasses]),
200
- onClick: p((C) => y(d), ["stop"]),
201
- onMouseover: p((C) => v.value = f, ["stop"]),
200
+ "aria-selected": b(c) === v,
201
+ class: a(["uikit-m-1 uikit-cursor-pointer uikit-px-20px uikit-py-10px uikit-text aria-selected:uikit-rounded-xs aria-selected:uikit-bg-w-cultured", i.dropdownItemClasses]),
202
+ onClick: p(($) => y(d), ["stop"]),
203
+ onMouseover: p(($) => c.value = v, ["stop"]),
202
204
  onBlur: u[2] || (u[2] = p(() => {
203
205
  }, ["stop"]))
204
206
  }, [
205
- s("label", Y, [
207
+ s("label", x, [
206
208
  s("input", {
207
209
  tabindex: "-1",
208
210
  class: "uikit-m-0 uikit-appearance-none",
209
211
  name: `${l.value}_radio`,
210
212
  type: "radio",
211
213
  checked: d.label === r.value.label,
212
- onInput: p((C) => y(d), ["stop"])
213
- }, null, 40, Z),
214
+ onInput: p(($) => y(d), ["stop"])
215
+ }, null, 40, _),
214
216
  s("span", {
215
217
  innerHTML: d.label
216
- }, null, 8, x)
218
+ }, null, 8, ii)
217
219
  ])
218
- ], 42, X))), 128))
219
- ], 10, W)
220
+ ], 42, Z))), 128))
221
+ ], 10, Y)
220
222
  ], 2),
221
- e.feedback ? (o(), n(T, { key: 0 }, [
222
- e.feedback.valid ? (o(), n("span", {
223
+ i.feedback ? (o(), n(H, { key: 0 }, [
224
+ i.feedback.valid ? (o(), n("span", {
223
225
  key: 0,
224
226
  id: `${l.value}_valid_msg`,
225
- "arial-live": e.$attrs["aria-live"],
227
+ "arial-live": i.$attrs["aria-live"],
226
228
  class: "uikit-mt-1 uikit-inline-block uikit-text-12",
227
- innerHTML: e.isValid ? e.feedback.valid : ""
228
- }, null, 8, _)) : k("", !0),
229
- e.feedback.invalid ? (o(), n("span", {
229
+ innerHTML: i.isValid ? i.feedback.valid : ""
230
+ }, null, 8, ei)) : k("", !0),
231
+ i.feedback.invalid ? (o(), n("span", {
230
232
  key: 1,
231
233
  id: `${l.value}_invalid_msg`,
232
- "arial-live": e.$attrs["aria-live"],
234
+ "arial-live": i.$attrs["aria-live"],
233
235
  class: "uikit-mt-1 uikit-inline-block uikit-text-12 uikit-text-w-danger",
234
- innerHTML: e.isValid === !1 ? e.feedback.invalid : ""
235
- }, null, 8, ee)) : k("", !0)
236
+ innerHTML: i.isValid === !1 ? i.feedback.invalid : ""
237
+ }, null, 8, ti)) : k("", !0)
236
238
  ], 64)) : k("", !0)
237
239
  ], 2));
238
240
  }
239
241
  });
240
242
  export {
241
- oe as _
243
+ ni as _
242
244
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as T, mergeModels as $, useModel as L, ref as r, computed as k, onBeforeMount as F, watch as f, openBlock as C, createBlock as S, normalizeClass as H, withCtx as s, createVNode as z, renderSlot as V, createElementBlock as A, Fragment as K, renderList as N, unref as U, createElementVNode as W } from "vue";
2
2
  import j from "../BaseInput.js";
3
- import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
3
+ import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.CpbjEyOl.js";
4
4
  import "./types-B0dZ7OiV.D29wNgoj.js";
5
5
  import { _ as G } from "./SelectItem.vue_vue_type_script_setup_true_lang.GPFf7fjA.js";
6
6
  import { A as J } from "./useKeyboardController.CutKeclN.js";
@@ -1,12 +1,12 @@
1
- import { defineComponent as I, useId as L, ref as w, computed as A, useTemplateRef as E, watch as s, onBeforeMount as O, onMounted as W, onUnmounted as $, openBlock as u, createElementBlock as M, normalizeClass as i, withModifiers as v, renderSlot as b, createVNode as H, unref as a, withCtx as h, createElementVNode as N, createBlock as C, createCommentVNode as T, resolveDynamicComponent as V } from "vue";
2
- import { _ as K } from "./BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
3
- import { a as q } from "./ArrowIcon.CCFMdsq6.js";
1
+ import { defineComponent as M, mergeModels as b, useId as A, useModel as E, ref as h, computed as O, useTemplateRef as W, watch as n, onBeforeMount as $, onMounted as H, onUnmounted as N, openBlock as u, createElementBlock as T, normalizeClass as i, withModifiers as g, renderSlot as C, createVNode as V, unref as l, withCtx as y, createElementVNode as K, createBlock as D, createCommentVNode as q, resolveDynamicComponent as z } from "vue";
2
+ import { _ as R } from "./BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
3
+ import { a as U } from "./ArrowIcon.CCFMdsq6.js";
4
4
  import "./PharmacyIcon.56ql_DYl.js";
5
- import { A as z } from "./useKeyboardController.CutKeclN.js";
6
- const R = ["innerHTML"], Q = /* @__PURE__ */ I({
5
+ import { A as j } from "./useKeyboardController.CutKeclN.js";
6
+ const F = ["innerHTML"], Z = /* @__PURE__ */ M({
7
7
  inheritAttrs: !1,
8
8
  __name: "BaseDropDown",
9
- props: {
9
+ props: /* @__PURE__ */ b({
10
10
  dropdownClasses: { default: "" },
11
11
  btnClasses: { default: "" },
12
12
  withArrowIcon: { type: Boolean, default: !1 },
@@ -22,15 +22,20 @@ const R = ["innerHTML"], Q = /* @__PURE__ */ I({
22
22
  keepState: { default: "" },
23
23
  activateKeyboardController: { type: Boolean, default: !0 },
24
24
  dataCy: { default: "" }
25
- },
26
- emits: ["click", "update:dropdownState"],
27
- setup(y, { emit: g }) {
28
- const o = y, c = L(), p = g, t = w(!1), n = w([]), B = A(() => n.value.length), k = E("dropdown"), { activeIdx: f, selectedIdx: d } = z({
29
- optionsLength: B,
25
+ }, {
26
+ toggleDropdown: {
27
+ default: void 0
28
+ },
29
+ toggleDropdownModifiers: {}
30
+ }),
31
+ emits: /* @__PURE__ */ b(["click", "update:dropdownState"], ["update:toggleDropdown"]),
32
+ setup(p, { emit: B }) {
33
+ const o = p, c = A(), k = B, f = E(p, "toggleDropdown"), t = h(!1), d = h([]), S = O(() => d.value.length), w = W("dropdown"), { activeIdx: m, selectedIdx: r } = j({
34
+ optionsLength: S,
30
35
  isDropdownOpen: t,
31
36
  activate: o.activateKeyboardController
32
37
  });
33
- s(
38
+ n(
34
39
  () => o.openDropdown,
35
40
  (e) => {
36
41
  t.value = e;
@@ -38,38 +43,40 @@ const R = ["innerHTML"], Q = /* @__PURE__ */ I({
38
43
  {
39
44
  immediate: !0
40
45
  }
41
- ), s(t, (e) => {
42
- p("update:dropdownState", e);
43
- }), s(d, (e) => {
44
- e !== -1 && n.value[e].querySelector("a")?.click();
46
+ ), n(t, (e) => {
47
+ k("update:dropdownState", e);
48
+ }), n(f, (e) => {
49
+ e && (t.value = !t.value, f.value = !1);
50
+ }), n(r, (e) => {
51
+ e !== -1 && d.value[e].querySelector("a")?.click();
45
52
  });
46
- const m = () => {
53
+ const v = () => {
47
54
  t.value = !1;
48
- }, r = () => {
55
+ }, s = () => {
49
56
  o.keepState === "closed" && !t.value || o.keepState === "opened" && t.value || (t.value = !t.value);
50
- }, S = (e) => {
51
- e != null && (f.value = e);
52
- }, D = (e) => {
53
- e != null && (d.value = e);
57
+ }, I = (e) => {
58
+ e != null && (m.value = e);
59
+ }, L = (e) => {
60
+ e != null && (r.value = e);
54
61
  };
55
- return O(() => {
56
- o.closeWhenClickedOutside && document.body.addEventListener("click", m);
57
- }), W(() => {
58
- k.value && (n.value = k.value.children || []);
59
- }), $(() => {
60
- o.closeWhenClickedOutside && document.body.removeEventListener("click", m);
61
- }), (e, l) => (u(), M("div", {
62
+ return $(() => {
63
+ o.closeWhenClickedOutside && document.body.addEventListener("click", v);
64
+ }), H(() => {
65
+ w.value && (d.value = w.value.children || []);
66
+ }), N(() => {
67
+ o.closeWhenClickedOutside && document.body.removeEventListener("click", v);
68
+ }), (e, a) => (u(), T("div", {
62
69
  class: i(["uikit-relative uikit-block", e.$attrs.class]),
63
- onClick: l[1] || (l[1] = v((U) => {
64
- p("click"), r();
70
+ onClick: a[1] || (a[1] = g((G) => {
71
+ k("click"), s();
65
72
  }, ["stop"]))
66
73
  }, [
67
- b(e.$slots, "btn_slot", {
68
- toggleDropdown: r,
74
+ C(e.$slots, "btn_slot", {
75
+ toggleDropdown: s,
69
76
  isOpen: t.value
70
77
  }, () => [
71
- H(K, {
72
- id: a(c),
78
+ V(R, {
79
+ id: l(c),
73
80
  type: "button",
74
81
  "data-cy": e.dataCy,
75
82
  class: i([
@@ -79,24 +86,24 @@ const R = ["innerHTML"], Q = /* @__PURE__ */ I({
79
86
  "aria-expanded": t.value,
80
87
  "btn-class": "uikit-btn-single-selection"
81
88
  }, {
82
- default: h(() => [
83
- N("span", {
89
+ default: y(() => [
90
+ K("span", {
84
91
  class: i(["uikit-mr-5px", e.labelClasses]),
85
92
  innerHTML: e.btnLabel
86
- }, null, 10, R),
87
- e.withArrowIcon ? (u(), C(a(q), {
93
+ }, null, 10, F),
94
+ e.withArrowIcon ? (u(), D(l(U), {
88
95
  key: 0,
89
96
  class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
90
97
  width: e.arrowWidth,
91
98
  height: e.arrowWidth,
92
99
  "stroke-color": e.arrowStrokeColor
93
- }, null, 8, ["class", "width", "height", "stroke-color"])) : T("", !0)
100
+ }, null, 8, ["class", "width", "height", "stroke-color"])) : q("", !0)
94
101
  ]),
95
102
  _: 1
96
103
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
97
104
  ]),
98
- (u(), C(V(e.dropdownElement), {
99
- id: "dropdown_" + a(c),
105
+ (u(), D(z(e.dropdownElement), {
106
+ id: "dropdown_" + l(c),
100
107
  ref: "dropdown",
101
108
  "data-cy": e.dataCy && `${e.dataCy}_dropdown`,
102
109
  class: i(["uikit-max-h-[220px] uikit-w-full uikit-min-w-[90px] uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-border-w-lavender uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
@@ -107,17 +114,17 @@ const R = ["innerHTML"], Q = /* @__PURE__ */ I({
107
114
  { "uikit-absolute": e.isAbsolute }
108
115
  ]]),
109
116
  "aria-hidden": !t.value,
110
- onClick: l[0] || (l[0] = v(() => {
117
+ onClick: a[0] || (a[0] = g(() => {
111
118
  }, ["stop"]))
112
119
  }, {
113
- default: h(() => [
114
- b(e.$slots, "default", {
120
+ default: y(() => [
121
+ C(e.$slots, "default", {
115
122
  isOpen: t.value,
116
- toggleDropdown: r,
117
- activeIdx: a(f),
118
- selectedIdx: a(d),
119
- setActiveIdx: S,
120
- setSelectedIdx: D
123
+ toggleDropdown: s,
124
+ activeIdx: l(m),
125
+ selectedIdx: l(r),
126
+ setActiveIdx: I,
127
+ setSelectedIdx: L
121
128
  })
122
129
  ]),
123
130
  _: 3
@@ -126,5 +133,5 @@ const R = ["innerHTML"], Q = /* @__PURE__ */ I({
126
133
  }
127
134
  });
128
135
  export {
129
- Q as _
136
+ Z as _
130
137
  };
package/dist/index.js CHANGED
@@ -9,14 +9,14 @@ import { _ } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.Cu67jd8K
9
9
  import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.DTPN9Rg-.js";
10
10
  import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.CiJAhkRj.js";
11
11
  import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DdmSUyxZ.js";
12
- import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.B8fWfyF7.js";
12
+ import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.Dpwbklqk.js";
13
13
  import { _ as w } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js";
14
- import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CThPNixl.js";
14
+ import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.B31Vyyn6.js";
15
15
  import { _ as v } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
16
16
  import { _ as G } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
17
17
  import { default as O } from "./BaseCard.js";
18
18
  import { default as R } from "./BaseComplexToggle.js";
19
- import { _ as V } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
19
+ import { _ as V } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CpbjEyOl.js";
20
20
  import { default as q } from "./BaseFloatingLabel.js";
21
21
  import { default as z } from "./BaseIcon.js";
22
22
  import { default as H } from "./BaseInput.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.0.47",
3
+ "version": "2.0.49",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",