@wikicasa-dev/components 2.0.47 → 2.0.50

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.tcyWuhKm.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,11 @@ 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
+ readonly "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
9
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick" | "onUpdate:modelValue" | "onUpdate:toggleDropdown" | "onUpdate:dropdownState"> & ({
8
10
  modelValue?: Optional<AccessibleSelectOptions<T, LabelID>>;
9
11
  toggleDropdown?: Optional<boolean>;
10
12
  } & {
@@ -43,7 +45,7 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
43
45
  slots: {
44
46
  lefticon?(_: {}): any;
45
47
  };
46
- emit: {
48
+ emit: (((evt: "click", args_0: MouseEvent) => void) & ((evt: "update:dropdownState", args_0: boolean) => void)) & {
47
49
  'update:modelValue': [modelValue: Optional<AccessibleSelectOptions<T, LabelID>>];
48
50
  'update:toggleDropdown': [toggleDropdown: Optional<boolean>];
49
51
  };
@@ -4,11 +4,11 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
4
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
5
  readonly onClick?: (() => any) | undefined;
6
6
  readonly "onUpdate:modelValue"?: ((modelValue: AccessibleSelectOptions<T, LabelID> | undefined) => any) | undefined;
7
+ readonly "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
7
8
  readonly onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
8
9
  readonly onKeydownEnterPressed?: (() => any) | undefined;
9
- readonly "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
10
10
  readonly onChangedValue?: ((args_0: string) => any) | undefined;
11
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick" | "onKeydown" | "onUpdate:modelValue" | "onKeydownEnterPressed" | "onUpdate:dropdownState" | "onChangedValue"> & ({
11
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick" | "onKeydown" | "onUpdate:modelValue" | "onUpdate:dropdownState" | "onKeydownEnterPressed" | "onChangedValue"> & ({
12
12
  modelValue?: AccessibleSelectOptions<T, LabelID> | undefined;
13
13
  } & {
14
14
  isValid?: Nullable<boolean>;
@@ -38,7 +38,7 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
38
38
  handleClean: () => void;
39
39
  }): any;
40
40
  };
41
- emit: (((evt: "click") => void) & ((evt: "keydown", args_0: KeyboardEvent) => void) & ((evt: "keydownEnterPressed") => void) & ((evt: "update:dropdownState", args_0: boolean) => void) & ((evt: "changedValue", args_0: string) => void)) & {
41
+ emit: (((evt: "click") => void) & ((evt: "update:dropdownState", args_0: boolean) => void) & ((evt: "keydown", args_0: KeyboardEvent) => void) & ((evt: "keydownEnterPressed") => void) & ((evt: "changedValue", args_0: string) => void)) & {
42
42
  'update:modelValue': [modelValue: AccessibleSelectOptions<T, LabelID> | undefined];
43
43
  };
44
44
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
@@ -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,19 +1,19 @@
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;
1
+ import { h as m, defineComponent as D, mergeModels as L, useModel as V, useId as z, computed as T, ref as B, watch as g, 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 S, Fragment as H, renderList as q } from "vue";
2
+ import { A as j } 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: w }) => {
6
+ t = { ...G(), ...t };
7
+ const { width: c, height: r } = t;
8
8
  return m(
9
9
  "svg",
10
10
  {
11
11
  xmlns: "http://www.w3.org/2000/svg",
12
12
  viewBox: "0 0 11.175 13.409",
13
13
  width: `${c}`,
14
- height: `${w}`,
14
+ height: `${r}`,
15
15
  class: t.class ?? "",
16
- "aria-hidden": r["aria-hidden"] ?? "true",
16
+ "aria-hidden": w["aria-hidden"] ?? "true",
17
17
  fill: "none",
18
18
  stroke: t["stroke-color"] ?? "#FA4F64"
19
19
  },
@@ -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"], ee = ["innerHTML"], ie = ["id", "arial-live", "innerHTML"], te = ["id", "arial-live", "innerHTML"], ne = /* @__PURE__ */ D({
40
40
  inheritAttrs: !1,
41
41
  __name: "AccessibleSelect",
42
- props: /* @__PURE__ */ I({
42
+ props: /* @__PURE__ */ L({
43
43
  label: { default: "" },
44
44
  dropdownPosition: { default: "bottom" },
45
45
  namespace: {},
@@ -68,26 +68,28 @@ 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__ */ L(["click", "update:dropdownState"], ["update:modelValue", "update:toggleDropdown"]),
72
+ setup(t, { emit: w }) {
73
+ const c = w, r = V(t, "modelValue"), C = V(t, "toggleDropdown"), F = z(), l = T(() => t.namespace || F), i = B(!1), I = B(null), h = T(() => !!r.value.label), { activeIdx: v, selectedIdx: A } = j({
74
74
  optionsLength: t.options.length,
75
75
  isDropdownOpen: i
76
76
  }), y = (e) => {
77
77
  i.value = !1, r.value = e;
78
78
  };
79
- V(H, (e) => {
79
+ g(A, (e) => {
80
80
  y(t.options[e]), i.value = !1;
81
- }), V(c, (e) => {
82
- e && (i.value = !i.value, c.value = !1);
81
+ }), g(C, (e) => {
82
+ e && (i.value = !i.value, C.value = !1);
83
+ }), g(i, (e) => {
84
+ c("update:dropdownState", e);
83
85
  });
84
- const g = ({ target: e }) => {
86
+ const $ = ({ target: e }) => {
85
87
  `${l.value}_btn` !== e.id && (i.value = !1);
86
88
  };
87
- return D(() => {
88
- t.closeOnBodyPressed && document.addEventListener("click", g);
89
- }), z(() => {
90
- t.closeOnBodyPressed && document.removeEventListener("click", g);
89
+ return E(() => {
90
+ t.closeOnBodyPressed && document.addEventListener("click", $);
91
+ }), P(() => {
92
+ t.closeOnBodyPressed && document.removeEventListener("click", $);
91
93
  }), (e, u) => (o(), n("div", {
92
94
  class: a(e.$attrs.class)
93
95
  }, [
@@ -104,18 +106,18 @@ const U = (t, { attrs: r }) => {
104
106
  { "uikit-left-4": !e.$slots.lefticon && !h.value }
105
107
  ]]),
106
108
  innerHTML: e.label
107
- }, null, 10, G)) : k("", !0),
109
+ }, null, 10, K)) : k("", !0),
108
110
  e.$slots.lefticon ? (o(), n("span", {
109
111
  key: 1,
110
112
  class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
111
113
  onClick: u[0] || (u[0] = p((d) => i.value = !i.value, ["stop"]))
112
114
  }, [
113
- E(e.$slots, "lefticon")
115
+ N(e.$slots, "lefticon")
114
116
  ])) : k("", !0),
115
117
  s("button", {
116
118
  id: `${l.value}_btn`,
117
119
  ref_key: "btnEl",
118
- ref: B,
120
+ ref: I,
119
121
  type: "button",
120
122
  "data-cy": e.dataCy,
121
123
  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]]),
@@ -128,21 +130,23 @@ const U = (t, { attrs: r }) => {
128
130
  "aria-activedescendant": b(v) >= 0 && i.value ? `${l.value}_element_${e.options[b(v)].label}` : "",
129
131
  "aria-invalid": e.isValid === !1,
130
132
  "aria-describedby": e.isValid === !1 ? `${l.value}_invalid_msg` : void 0,
131
- onClick: u[1] || (u[1] = (d) => i.value = !i.value)
133
+ onClick: u[1] || (u[1] = (d) => {
134
+ i.value = !i.value, c("click", d);
135
+ })
132
136
  }, [
133
137
  s("span", {
134
138
  class: a(["uikit-pointer-events-none uikit-mt-1", e.btnTextClasses]),
135
139
  innerHTML: r.value.visibleLabel || r.value.label
136
- }, null, 10, K),
137
- s("span", Q, [
138
- e.isValid == !1 ? (o(), P(b(U), {
140
+ }, null, 10, R),
141
+ s("span", W, [
142
+ e.isValid == !1 ? (o(), O(b(J), {
139
143
  key: 0,
140
144
  class: "uikit-mr-1",
141
145
  width: 20,
142
146
  height: 20,
143
147
  "stroke-color": "#FA4F64"
144
148
  })) : k("", !0),
145
- N(b(j), {
149
+ S(b(U), {
146
150
  class: a(["uikit-transition-transform motion-reduce:uikit-transition-none", [
147
151
  i.value ? "uikit-rotate-180" : "",
148
152
  e.arrowIcon?.classes
@@ -152,7 +156,7 @@ const U = (t, { attrs: r }) => {
152
156
  "stroke-color": e.isValid ? "#2B5DFF" : e.isValid === !1 ? "#FA4F64" : e.arrowIcon?.strokeColor ?? "#222"
153
157
  }, null, 8, ["class", "width", "height", "stroke-color"])
154
158
  ])
155
- ], 10, J),
159
+ ], 10, Q),
156
160
  s("fieldset", {
157
161
  "aria-hidden": "true",
158
162
  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", [
@@ -171,7 +175,7 @@ const U = (t, { attrs: r }) => {
171
175
  key: 0,
172
176
  class: a(["uikit-mx-5px", [r.value.label ? "uikit-invisible" : "uikit-hidden"]]),
173
177
  innerHTML: e.label
174
- }, null, 10, R)) : k("", !0)
178
+ }, null, 10, X)) : k("", !0)
175
179
  ], 2)
176
180
  ], 2),
177
181
  s("ul", {
@@ -191,52 +195,52 @@ const U = (t, { attrs: r }) => {
191
195
  onClick: u[3] || (u[3] = p(() => {
192
196
  }, ["stop"]))
193
197
  }, [
194
- (o(!0), n(T, null, O(e.options, (d, f) => (o(), n("li", {
198
+ (o(!0), n(H, null, q(e.options, (d, f) => (o(), n("li", {
195
199
  id: `${l.value}_element_${e.options[f].label}`,
196
200
  key: `${d.label}_${f}`,
197
201
  role: "option",
198
202
  "aria-selected": b(v) === f,
199
203
  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"]),
204
+ onClick: p((M) => y(d), ["stop"]),
205
+ onMouseover: p((M) => v.value = f, ["stop"]),
202
206
  onBlur: u[2] || (u[2] = p(() => {
203
207
  }, ["stop"]))
204
208
  }, [
205
- s("label", Y, [
209
+ s("label", x, [
206
210
  s("input", {
207
211
  tabindex: "-1",
208
212
  class: "uikit-m-0 uikit-appearance-none",
209
213
  name: `${l.value}_radio`,
210
214
  type: "radio",
211
215
  checked: d.label === r.value.label,
212
- onInput: p((C) => y(d), ["stop"])
213
- }, null, 40, Z),
216
+ onInput: p((M) => y(d), ["stop"])
217
+ }, null, 40, _),
214
218
  s("span", {
215
219
  innerHTML: d.label
216
- }, null, 8, x)
220
+ }, null, 8, ee)
217
221
  ])
218
- ], 42, X))), 128))
219
- ], 10, W)
222
+ ], 42, Z))), 128))
223
+ ], 10, Y)
220
224
  ], 2),
221
- e.feedback ? (o(), n(T, { key: 0 }, [
225
+ e.feedback ? (o(), n(H, { key: 0 }, [
222
226
  e.feedback.valid ? (o(), n("span", {
223
227
  key: 0,
224
228
  id: `${l.value}_valid_msg`,
225
229
  "arial-live": e.$attrs["aria-live"],
226
230
  class: "uikit-mt-1 uikit-inline-block uikit-text-12",
227
231
  innerHTML: e.isValid ? e.feedback.valid : ""
228
- }, null, 8, _)) : k("", !0),
232
+ }, null, 8, ie)) : k("", !0),
229
233
  e.feedback.invalid ? (o(), n("span", {
230
234
  key: 1,
231
235
  id: `${l.value}_invalid_msg`,
232
236
  "arial-live": e.$attrs["aria-live"],
233
237
  class: "uikit-mt-1 uikit-inline-block uikit-text-12 uikit-text-w-danger",
234
238
  innerHTML: e.isValid === !1 ? e.feedback.invalid : ""
235
- }, null, 8, ee)) : k("", !0)
239
+ }, null, 8, te)) : k("", !0)
236
240
  ], 64)) : k("", !0)
237
241
  ], 2));
238
242
  }
239
243
  });
240
244
  export {
241
- oe as _
245
+ ne as _
242
246
  };
@@ -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.tcyWuhKm.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.50",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",