@wikicasa-dev/components 2.2.9-alpha.30 → 2.2.9-alpha.32
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.
- package/dist/Swiper/autoplay.js +1 -1
- package/dist/Swiper/controller.js +1 -1
- package/dist/Swiper/keyboard.js +1 -1
- package/dist/Swiper/thumbs.js +1 -1
- package/dist/UIKit/AccessibleSelect.d.ts +3 -5
- package/dist/UIKit/Autocomplete/ClearableAutocomplete.d.ts +1 -1
- package/dist/UIKit/BaseAutocomplete.d.ts +2 -2
- package/dist/UIKit/BaseButton.d.ts +8 -6
- package/dist/UIKit/BaseDropDown.d.ts +2 -12
- package/dist/UIKit/BaseInput.d.ts +2 -2
- package/dist/UIKit/BaseTextarea.d.ts +2 -2
- package/dist/composables/mock.d.ts +25 -0
- package/dist/composables/mock.js +49 -0
- package/dist/packages/components/lib/UIKit/AccessibleSelect.vue.js +62 -63
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +3 -3
- package/dist/packages/components/lib/UIKit/BaseAutocomplete.vue.js +5 -5
- package/dist/packages/components/lib/UIKit/BaseButton.vue.js +20 -19
- package/dist/packages/components/lib/UIKit/BaseDropDown.vue.js +51 -66
- package/package.json +3 -3
- /package/dist/assets/{swiper-keyboard.css → swiper-thumbs.css} +0 -0
package/dist/Swiper/autoplay.js
CHANGED
package/dist/Swiper/keyboard.js
CHANGED
package/dist/Swiper/thumbs.js
CHANGED
|
@@ -7,13 +7,11 @@ declare const _default: <TID, TPayload>(__VLS_props: NonNullable<Awaited<typeof
|
|
|
7
7
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
8
8
|
readonly "onUpdate:modelValue"?: ((value: Optional<AccessibleSelectOptions<TPayload, TID>>) => any) | undefined;
|
|
9
9
|
readonly onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
10
|
-
readonly "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
11
|
-
readonly "onUpdate:toggleDropdown"?: ((value: Optional<boolean>) => any) | undefined;
|
|
12
10
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
13
|
-
|
|
11
|
+
readonly "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
12
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onUpdate:open" | "onUpdate:dropdownState"> & ({
|
|
14
13
|
modelValue?: Optional<AccessibleSelectOptions<TPayload, TID>>;
|
|
15
14
|
open?: boolean;
|
|
16
|
-
toggleDropdown?: Optional<boolean>;
|
|
17
15
|
} & {
|
|
18
16
|
label?: string;
|
|
19
17
|
dropdownPosition?: "top" | "bottom";
|
|
@@ -50,7 +48,7 @@ declare const _default: <TID, TPayload>(__VLS_props: NonNullable<Awaited<typeof
|
|
|
50
48
|
slots: {
|
|
51
49
|
lefticon?(_: {}): any;
|
|
52
50
|
};
|
|
53
|
-
emit: (((evt: "click", args_0: MouseEvent) => void) & ((evt: "update:dropdownState", args_0: boolean) => void)) & (((evt: "update:modelValue", value: Optional<AccessibleSelectOptions<TPayload, TID>>) => void) & ((evt: "update:
|
|
51
|
+
emit: (((evt: "click", args_0: MouseEvent) => void) & ((evt: "update:dropdownState", args_0: boolean) => void)) & (((evt: "update:modelValue", value: Optional<AccessibleSelectOptions<TPayload, TID>>) => void) & ((evt: "update:open", value: boolean) => void));
|
|
54
52
|
}>) => import('vue').VNode & {
|
|
55
53
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
56
54
|
};
|
|
@@ -27,8 +27,8 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
27
27
|
readonly "onUpdate:modelValue"?: ((value: Nullable<AccessibleSelectOptions<TPayload, TID>>) => any) | undefined;
|
|
28
28
|
readonly onInput?: ((args_0: InputEvent) => any) | undefined;
|
|
29
29
|
readonly onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
30
|
-
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
31
30
|
readonly onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
31
|
+
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
32
32
|
readonly "onUpdate:inputValue"?: ((value: string) => any) | undefined;
|
|
33
33
|
readonly onInputClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
34
34
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onInput" | "onKeydown" | "onUpdate:open" | "onUpdate:inputValue" | "onInputClick"> & ({
|
|
@@ -6,8 +6,8 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
6
6
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
7
7
|
readonly "onUpdate:modelValue"?: ((value: AccessibleSelectOptions<TPayload, TID> | undefined) => any) | undefined;
|
|
8
8
|
readonly onClick?: (() => any) | undefined;
|
|
9
|
-
readonly "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
10
9
|
readonly onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
10
|
+
readonly "onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
11
11
|
readonly onKeydownEnterPressed?: (() => any) | undefined;
|
|
12
12
|
readonly onChangedValue?: ((args_0: string) => any) | undefined;
|
|
13
13
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onKeydown" | "onUpdate:dropdownState" | "onKeydownEnterPressed" | "onChangedValue"> & ({
|
|
@@ -44,7 +44,7 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
|
|
|
44
44
|
idx: number;
|
|
45
45
|
}): any;
|
|
46
46
|
};
|
|
47
|
-
emit: (((evt: "click") => void) & ((evt: "
|
|
47
|
+
emit: (((evt: "click") => void) & ((evt: "keydown", args_0: KeyboardEvent) => void) & ((evt: "update:dropdownState", args_0: boolean) => void) & ((evt: "keydownEnterPressed") => void) & ((evt: "changedValue", args_0: string) => void)) & ((evt: "update:modelValue", value: AccessibleSelectOptions<TPayload, TID> | undefined) => void);
|
|
48
48
|
}>) => import('vue').VNode & {
|
|
49
49
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
50
50
|
};
|
|
@@ -19,9 +19,10 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
|
19
19
|
}, {
|
|
20
20
|
getRootElement: () => HTMLButtonElement | null;
|
|
21
21
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
-
click: (e:
|
|
23
|
-
mouseover: (e:
|
|
24
|
-
mouseout: (e:
|
|
22
|
+
click: (e: MouseEvent) => any;
|
|
23
|
+
mouseover: (e: MouseEvent) => any;
|
|
24
|
+
mouseout: (e: MouseEvent) => any;
|
|
25
|
+
keydown: (e: KeyboardEvent) => any;
|
|
25
26
|
}, string, import('vue').PublicProps, Readonly<{
|
|
26
27
|
btnClass?: ButtonType;
|
|
27
28
|
outlined?: boolean;
|
|
@@ -38,9 +39,10 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
|
38
39
|
dataCy?: string;
|
|
39
40
|
type?: "button" | "submit" | "reset" | undefined;
|
|
40
41
|
}> & Readonly<{
|
|
41
|
-
onClick?: ((e:
|
|
42
|
-
onMouseover?: ((e:
|
|
43
|
-
onMouseout?: ((e:
|
|
42
|
+
onClick?: ((e: MouseEvent) => any) | undefined;
|
|
43
|
+
onMouseover?: ((e: MouseEvent) => any) | undefined;
|
|
44
|
+
onMouseout?: ((e: MouseEvent) => any) | undefined;
|
|
45
|
+
onKeydown?: ((e: KeyboardEvent) => any) | undefined;
|
|
44
46
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
45
47
|
buttonEl: HTMLButtonElement;
|
|
46
48
|
}, HTMLButtonElement>, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nullable
|
|
1
|
+
import { Nullable } from '@wikicasa-dev/types';
|
|
2
2
|
import { ClassTypeProp } from './types';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
dropdownAttrs?: Record<string, unknown>;
|
|
@@ -11,10 +11,6 @@ type __VLS_Props = {
|
|
|
11
11
|
arrowWidth?: number;
|
|
12
12
|
arrowStrokeColor?: `#${string}`;
|
|
13
13
|
isAbsolute?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use v-model:toggleDropdown instead
|
|
16
|
-
*/
|
|
17
|
-
openDropdown?: boolean;
|
|
18
14
|
closeWhenClickedOutside?: boolean;
|
|
19
15
|
dropdownElement?: "div" | "ul" | "ol";
|
|
20
16
|
keepState?: "opened" | "closed" | "";
|
|
@@ -29,7 +25,6 @@ type __VLS_Props = {
|
|
|
29
25
|
dataCy?: string;
|
|
30
26
|
};
|
|
31
27
|
type __VLS_PublicProps = {
|
|
32
|
-
"toggleDropdown"?: Optional<boolean>;
|
|
33
28
|
"resetKeyboardController"?: boolean;
|
|
34
29
|
"open"?: boolean;
|
|
35
30
|
} & __VLS_Props;
|
|
@@ -64,20 +59,17 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
64
59
|
getContentElement: () => HTMLElement | null;
|
|
65
60
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
66
61
|
click: () => any;
|
|
67
|
-
"update:dropdownState": (args_0: boolean) => any;
|
|
68
|
-
"update:toggleDropdown": (value: Optional<boolean>) => any;
|
|
69
62
|
"update:resetKeyboardController": (value: boolean) => any;
|
|
70
63
|
"update:open": (value: boolean) => any;
|
|
71
64
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
72
65
|
onClick?: (() => any) | undefined;
|
|
73
|
-
"onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
74
|
-
"onUpdate:toggleDropdown"?: ((value: Optional<boolean>) => any) | undefined;
|
|
75
66
|
"onUpdate:resetKeyboardController"?: ((value: boolean) => any) | undefined;
|
|
76
67
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
77
68
|
}>, {
|
|
78
69
|
arrowWidth: number;
|
|
79
70
|
dataCy: string;
|
|
80
71
|
labelClasses: string | Record<string, boolean> | import('./types').ClassType[] | import('./types').ClassType[] | null;
|
|
72
|
+
closeKeys: false | string[];
|
|
81
73
|
dropdownClasses: string | Record<string, boolean> | import('./types').ClassType[] | import('./types').ClassType[] | null;
|
|
82
74
|
btnClasses: string;
|
|
83
75
|
withArrowIcon: boolean;
|
|
@@ -85,12 +77,10 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
85
77
|
direction: "up" | "down";
|
|
86
78
|
arrowStrokeColor: `#${string}`;
|
|
87
79
|
isAbsolute: boolean;
|
|
88
|
-
openDropdown: boolean;
|
|
89
80
|
closeWhenClickedOutside: boolean;
|
|
90
81
|
dropdownElement: "div" | "ul" | "ol";
|
|
91
82
|
keepState: "opened" | "closed" | "";
|
|
92
83
|
activateKeyboardController: boolean;
|
|
93
|
-
closeKeys: false | string[];
|
|
94
84
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
95
85
|
container: HTMLDivElement;
|
|
96
86
|
dropdown: unknown;
|
|
@@ -43,17 +43,17 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
43
43
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
44
44
|
"update:modelValue": (value: string | number | undefined) => any;
|
|
45
45
|
click: (args_0: MouseEvent) => any;
|
|
46
|
+
keydown: (args_0: KeyboardEvent) => any;
|
|
46
47
|
focusin: () => any;
|
|
47
48
|
focusout: () => any;
|
|
48
|
-
keydown: (args_0: KeyboardEvent) => any;
|
|
49
49
|
keyup: (args_0: KeyboardEvent) => any;
|
|
50
50
|
keydownEnterPressed: () => any;
|
|
51
51
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
52
52
|
"onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
|
|
53
53
|
onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
54
|
+
onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
54
55
|
onFocusin?: (() => any) | undefined;
|
|
55
56
|
onFocusout?: (() => any) | undefined;
|
|
56
|
-
onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
57
57
|
onKeyup?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
58
58
|
onKeydownEnterPressed?: (() => any) | undefined;
|
|
59
59
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -17,15 +17,15 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
17
17
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
18
|
"update:modelValue": (value: string | undefined) => any;
|
|
19
19
|
click: (args_0: MouseEvent) => any;
|
|
20
|
+
keydown: (args_0: KeyboardEvent) => any;
|
|
20
21
|
focusin: () => any;
|
|
21
22
|
focusout: () => any;
|
|
22
|
-
keydown: (args_0: KeyboardEvent) => any;
|
|
23
23
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
24
24
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
25
25
|
onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
26
|
+
onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
26
27
|
onFocusin?: (() => any) | undefined;
|
|
27
28
|
onFocusout?: (() => any) | undefined;
|
|
28
|
-
onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
|
|
29
29
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
30
30
|
textarea: HTMLTextAreaElement;
|
|
31
31
|
}, any>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
interface KeyboardControllerProps {
|
|
3
|
+
optionsLength: Ref<number> | number;
|
|
4
|
+
isDropdownOpen?: Ref<boolean>;
|
|
5
|
+
disableSpaceHandler?: boolean;
|
|
6
|
+
activate?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* If true, the listener will be initialized on the document element
|
|
9
|
+
*/
|
|
10
|
+
global?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* List of keys that will close the dropdown.
|
|
13
|
+
* For the full list of keys, see
|
|
14
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
15
|
+
* @default "Escape" and "Enter"
|
|
16
|
+
*/
|
|
17
|
+
closeKeys?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare const useKeyboardController: (props: KeyboardControllerProps) => {
|
|
20
|
+
activeIdx: Ref<number, number>;
|
|
21
|
+
selectedIdx: Ref<number, number>;
|
|
22
|
+
$reset: () => void;
|
|
23
|
+
onKeyDownHandler: (e: KeyboardEvent) => void;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ref as _, onMounted as A, onUnmounted as D, unref as p } from "vue";
|
|
2
|
+
const u = "ArrowUp", a = "ArrowDown", c = "Enter", i = "Escape", v = " ", d = "PageUp", K = "Home", E = "PageDown", m = "End", O = (l) => {
|
|
3
|
+
const {
|
|
4
|
+
isDropdownOpen: t,
|
|
5
|
+
disableSpaceHandler: P,
|
|
6
|
+
global: f = !0,
|
|
7
|
+
closeKeys: Y = [i, c]
|
|
8
|
+
} = l, n = _(-1), o = _(-1), w = l.activate === void 0 ? !0 : l.activate, y = () => {
|
|
9
|
+
n.value = -1, o.value = -1, t && (t.value = !1);
|
|
10
|
+
}, k = (e) => {
|
|
11
|
+
t && Y.includes(e) && (t.value = !1);
|
|
12
|
+
}, r = (e) => {
|
|
13
|
+
if (!t?.value || ![
|
|
14
|
+
u,
|
|
15
|
+
a,
|
|
16
|
+
c,
|
|
17
|
+
i,
|
|
18
|
+
v,
|
|
19
|
+
d,
|
|
20
|
+
K,
|
|
21
|
+
E,
|
|
22
|
+
m
|
|
23
|
+
].includes(e.key))
|
|
24
|
+
return;
|
|
25
|
+
const s = p(l.optionsLength);
|
|
26
|
+
if ([u, a, d, E].includes(e.key) && e.preventDefault(), e.key === u)
|
|
27
|
+
n.value = n.value === 0 ? s - 1 : n.value - 1;
|
|
28
|
+
else if (e.key === a)
|
|
29
|
+
n.value = (n.value + 1) % s;
|
|
30
|
+
else if (e.key === c || e.key === v) {
|
|
31
|
+
if (e.key === v && P) return;
|
|
32
|
+
o.value = n.value, k(e.key);
|
|
33
|
+
} else e.key === i ? (n.value = o.value, k(e.key)) : e.key === d || e.key === K ? n.value = 0 : (e.key === E || e.key === m) && (n.value = s - 1);
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
};
|
|
36
|
+
return w ? (A(() => {
|
|
37
|
+
!document || !f || document.addEventListener("keydown", r);
|
|
38
|
+
}), D(() => {
|
|
39
|
+
!document || !f || document.removeEventListener("keydown", r);
|
|
40
|
+
}), {
|
|
41
|
+
activeIdx: n,
|
|
42
|
+
selectedIdx: o,
|
|
43
|
+
onKeyDownHandler: r,
|
|
44
|
+
$reset: y
|
|
45
|
+
}) : { activeIdx: n, selectedIdx: o, $reset: y, onKeyDownHandler: r };
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
O as useKeyboardController
|
|
49
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { WarningIconRounded as
|
|
1
|
+
import { defineComponent as B, mergeModels as y, useModel as p, useId as F, useTemplateRef as I, computed as C, watch as z, createElementBlock as n, openBlock as a, createVNode as $, createCommentVNode as d, normalizeClass as o, withCtx as x, Fragment as g, renderList as E, withModifiers as f, createElementVNode as s, renderSlot as N, createBlock as P, unref as M } from "vue";
|
|
2
|
+
import { WarningIconRounded as A, ArrowIcon as R } from "@wikicasa-dev/svg-icons";
|
|
3
3
|
import q from "./BaseDropDown.vue.js";
|
|
4
4
|
import '../../../../assets/BaseDropDown.css';/* empty css */
|
|
5
|
-
const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" },
|
|
5
|
+
const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" }, j = ["id", "innerHTML"], K = ["onClick"], U = ["id", "data-cy", "aria-required", "aria-controls", "aria-labelledby", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "onClick"], W = ["innerHTML"], D = { class: "uikit-pointer-events-none uikit-mt-1 uikit-inline-flex" }, G = ["innerHTML"], J = ["id", "aria-selected", "onClick", "onMouseover"], O = { class: "uikit-inline-block uikit-cursor-pointer uikit-text-sm" }, Q = ["name", "checked", "onInput"], X = ["innerHTML"], Y = ["id", "arial-live", "innerHTML"], Z = ["id", "arial-live", "innerHTML"], le = /* @__PURE__ */ B({
|
|
6
6
|
__name: "AccessibleSelect",
|
|
7
7
|
props: /* @__PURE__ */ y({
|
|
8
8
|
label: { default: "" },
|
|
@@ -29,27 +29,23 @@ const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" },
|
|
|
29
29
|
},
|
|
30
30
|
modelModifiers: {},
|
|
31
31
|
open: { type: Boolean, default: !1 },
|
|
32
|
-
openModifiers: {}
|
|
33
|
-
toggleDropdown: { type: Boolean, default: void 0 },
|
|
34
|
-
toggleDropdownModifiers: {}
|
|
32
|
+
openModifiers: {}
|
|
35
33
|
}),
|
|
36
|
-
emits: /* @__PURE__ */ y(["click", "update:dropdownState"], ["update:modelValue", "update:open"
|
|
37
|
-
setup(e, { emit:
|
|
38
|
-
const
|
|
39
|
-
m.value = !1,
|
|
34
|
+
emits: /* @__PURE__ */ y(["click", "update:dropdownState"], ["update:modelValue", "update:open"]),
|
|
35
|
+
setup(e, { emit: V }) {
|
|
36
|
+
const T = V, r = p(e, "modelValue"), m = p(e, "open"), L = F(), H = I("dropdownRef"), t = C(() => e.namespace || L), v = C(() => !!r.value.label), w = (i) => {
|
|
37
|
+
m.value = !1, r.value = i;
|
|
40
38
|
};
|
|
41
|
-
return
|
|
39
|
+
return z(
|
|
42
40
|
() => H.value?.selectedIdx,
|
|
43
41
|
(i) => {
|
|
44
42
|
i === void 0 || i === -1 || (w(e.options[i]), m.value = !1);
|
|
45
43
|
}
|
|
46
|
-
), (i,
|
|
44
|
+
), (i, k) => (a(), n("div", null, [
|
|
47
45
|
$(q, {
|
|
48
46
|
ref: "dropdownRef",
|
|
49
47
|
open: m.value,
|
|
50
|
-
"onUpdate:open":
|
|
51
|
-
"toggle-dropdown": h.value,
|
|
52
|
-
"onUpdate:toggleDropdown": c[2] || (c[2] = (s) => h.value = s),
|
|
48
|
+
"onUpdate:open": k[2] || (k[2] = (c) => m.value = c),
|
|
53
49
|
class: o([e.wrapperClasses]),
|
|
54
50
|
"activate-keyboard-controller": "",
|
|
55
51
|
"close-when-clicked-outside": e.closeOnBodyPressed,
|
|
@@ -65,9 +61,9 @@ const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" },
|
|
|
65
61
|
"aria-multiselectable": !1
|
|
66
62
|
}
|
|
67
63
|
}, {
|
|
68
|
-
btn_slot: x(({ toggleDropdown:
|
|
69
|
-
|
|
70
|
-
e.label ? (
|
|
64
|
+
btn_slot: x(({ toggleDropdown: c, isOpen: b, activeIdx: u }) => [
|
|
65
|
+
s("div", S, [
|
|
66
|
+
e.label ? (a(), n("label", {
|
|
71
67
|
key: 0,
|
|
72
68
|
id: `${t.value}_label`,
|
|
73
69
|
class: o(["uikit-pointer-events-none uikit-absolute uikit-z-10 uikit-text-sm uikit-font-medium uikit-transition-all uikit-ease-in-out", [
|
|
@@ -77,15 +73,15 @@ const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" },
|
|
|
77
73
|
{ "uikit-left-4": !i.$slots.lefticon && !v.value }
|
|
78
74
|
]]),
|
|
79
75
|
innerHTML: e.label
|
|
80
|
-
}, null, 10,
|
|
81
|
-
i.$slots.lefticon ? (
|
|
76
|
+
}, null, 10, j)) : d("", !0),
|
|
77
|
+
i.$slots.lefticon ? (a(), n("span", {
|
|
82
78
|
key: 1,
|
|
83
79
|
class: "uikit-z-20 uikit-mt-2 uikit-pl-2",
|
|
84
|
-
onClick: f((
|
|
80
|
+
onClick: f((l) => c(), ["stop"])
|
|
85
81
|
}, [
|
|
86
|
-
|
|
87
|
-
], 8,
|
|
88
|
-
|
|
82
|
+
N(i.$slots, "lefticon")
|
|
83
|
+
], 8, K)) : d("", !0),
|
|
84
|
+
s("button", {
|
|
89
85
|
id: `${t.value}_btn`,
|
|
90
86
|
ref: "btnEl",
|
|
91
87
|
type: "button",
|
|
@@ -100,31 +96,34 @@ const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" },
|
|
|
100
96
|
"aria-activedescendant": u >= 0 && b ? `${t.value}_element_${e.options[u].label}` : "",
|
|
101
97
|
"aria-invalid": e.isValid === !1,
|
|
102
98
|
"aria-describedby": e.isValid === !1 ? `${t.value}_invalid_msg` : void 0,
|
|
103
|
-
onClick: (
|
|
104
|
-
|
|
105
|
-
}
|
|
99
|
+
onClick: (l) => {
|
|
100
|
+
c(), T("click", l);
|
|
101
|
+
},
|
|
102
|
+
onKeydown: k[0] || (k[0] = (l) => {
|
|
103
|
+
["Enter", "Enter"].includes(l.key) && l.stopPropagation();
|
|
104
|
+
})
|
|
106
105
|
}, [
|
|
107
|
-
|
|
106
|
+
s("span", {
|
|
108
107
|
class: o(["uikit-pointer-events-none uikit-mt-1", e.btnTextClasses]),
|
|
109
|
-
innerHTML:
|
|
108
|
+
innerHTML: r.value?.visibleLabel || r.value?.label
|
|
110
109
|
}, null, 10, W),
|
|
111
|
-
|
|
112
|
-
e.isValid == !1 ? (
|
|
110
|
+
s("span", D, [
|
|
111
|
+
e.isValid == !1 ? (a(), P(M(A), {
|
|
113
112
|
key: 0,
|
|
114
113
|
class: "uikit-mr-1",
|
|
115
114
|
width: 20,
|
|
116
115
|
height: 20,
|
|
117
116
|
"stroke-color": "#FA4F64"
|
|
118
|
-
})) :
|
|
119
|
-
$(
|
|
117
|
+
})) : d("", !0),
|
|
118
|
+
$(M(R), {
|
|
120
119
|
class: o(["uikit-transition-transform motion-reduce:uikit-transition-none", [b ? "uikit-rotate-180" : "", e.arrowIcon?.classes]]),
|
|
121
120
|
width: e.arrowIcon?.width ?? 18,
|
|
122
121
|
height: e.arrowIcon?.height ?? 18,
|
|
123
122
|
"stroke-color": e.isValid ? "#2B5DFF" : e.isValid === !1 ? "#FA4F64" : e.arrowIcon?.strokeColor ?? "#222"
|
|
124
123
|
}, null, 8, ["class", "width", "height", "stroke-color"])
|
|
125
124
|
])
|
|
126
|
-
],
|
|
127
|
-
|
|
125
|
+
], 42, U),
|
|
126
|
+
s("fieldset", {
|
|
128
127
|
"aria-hidden": "true",
|
|
129
128
|
class: o(["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", [
|
|
130
129
|
e.fieldsetClasses,
|
|
@@ -135,68 +134,68 @@ const S = { class: "uikit-relative uikit-flex uikit-h-12 uikit-items-center" },
|
|
|
135
134
|
{ "uikit-border-0 peer-focus:uikit-border-0": !e.border }
|
|
136
135
|
]])
|
|
137
136
|
}, [
|
|
138
|
-
|
|
137
|
+
s("legend", {
|
|
139
138
|
class: o([[e.legendClasses, { "uikit-m-0 uikit-w-0": !e.label }], "uikit-ml-2 uikit-h-3 uikit-px-0 uikit-text-sm"])
|
|
140
139
|
}, [
|
|
141
|
-
e.label ? (
|
|
140
|
+
e.label ? (a(), n("span", {
|
|
142
141
|
key: 0,
|
|
143
142
|
class: o(["uikit-mx-5px", [
|
|
144
|
-
|
|
143
|
+
r.value.label ? "uikit-invisible" : "uikit-hidden"
|
|
145
144
|
]]),
|
|
146
145
|
innerHTML: e.label
|
|
147
|
-
}, null, 10,
|
|
146
|
+
}, null, 10, G)) : d("", !0)
|
|
148
147
|
], 2)
|
|
149
148
|
], 2)
|
|
150
149
|
])
|
|
151
150
|
]),
|
|
152
|
-
default: x(({ activeIdx:
|
|
153
|
-
(
|
|
154
|
-
id: `${t.value}_element_${e.options[
|
|
155
|
-
key: `${u.label}_${
|
|
151
|
+
default: x(({ activeIdx: c, setActiveIdx: b }) => [
|
|
152
|
+
(a(!0), n(g, null, E(e.options, (u, l) => (a(), n("li", {
|
|
153
|
+
id: `${t.value}_element_${e.options[l].label}`,
|
|
154
|
+
key: `${u.label}_${l}`,
|
|
156
155
|
role: "option",
|
|
157
|
-
"aria-selected":
|
|
156
|
+
"aria-selected": c === l,
|
|
158
157
|
class: o(["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]),
|
|
159
|
-
onClick: f((
|
|
160
|
-
onMouseover: f((
|
|
161
|
-
onBlur:
|
|
158
|
+
onClick: f((h) => w(u), ["stop"]),
|
|
159
|
+
onMouseover: f((h) => b(l), ["stop"]),
|
|
160
|
+
onBlur: k[1] || (k[1] = f(() => {
|
|
162
161
|
}, ["stop"]))
|
|
163
162
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
s("label", O, [
|
|
164
|
+
s("input", {
|
|
166
165
|
tabindex: "-1",
|
|
167
166
|
class: "uikit-m-0 uikit-appearance-none",
|
|
168
167
|
name: `${t.value}_radio`,
|
|
169
168
|
type: "radio",
|
|
170
|
-
checked: u.label ===
|
|
171
|
-
onInput: f((
|
|
172
|
-
}, null, 40,
|
|
173
|
-
|
|
169
|
+
checked: u.label === r.value.label,
|
|
170
|
+
onInput: f((h) => w(u), ["stop"])
|
|
171
|
+
}, null, 40, Q),
|
|
172
|
+
s("span", {
|
|
174
173
|
innerHTML: u.label
|
|
175
|
-
}, null, 8,
|
|
174
|
+
}, null, 8, X)
|
|
176
175
|
])
|
|
177
|
-
], 42,
|
|
176
|
+
], 42, J))), 128))
|
|
178
177
|
]),
|
|
179
178
|
_: 3
|
|
180
|
-
}, 8, ["open", "
|
|
181
|
-
e.feedback ? (
|
|
182
|
-
e.feedback.valid ? (
|
|
179
|
+
}, 8, ["open", "class", "close-when-clicked-outside", "direction", "dropdown-classes"]),
|
|
180
|
+
e.feedback ? (a(), n(g, { key: 0 }, [
|
|
181
|
+
e.feedback.valid ? (a(), n("span", {
|
|
183
182
|
key: 0,
|
|
184
183
|
id: `${t.value}_valid_msg`,
|
|
185
184
|
"arial-live": i.$attrs["aria-live"],
|
|
186
185
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12",
|
|
187
186
|
innerHTML: e.isValid ? e.feedback.valid : ""
|
|
188
|
-
}, null, 8,
|
|
189
|
-
e.feedback.invalid ? (
|
|
187
|
+
}, null, 8, Y)) : d("", !0),
|
|
188
|
+
e.feedback.invalid ? (a(), n("span", {
|
|
190
189
|
key: 1,
|
|
191
190
|
id: `${t.value}_invalid_msg`,
|
|
192
191
|
"arial-live": i.$attrs["aria-live"],
|
|
193
192
|
class: "uikit-mt-1 uikit-inline-block uikit-text-12 uikit-text-w-danger",
|
|
194
193
|
innerHTML: e.isValid === !1 ? e.feedback.invalid : ""
|
|
195
|
-
}, null, 8,
|
|
196
|
-
], 64)) :
|
|
194
|
+
}, null, 8, Z)) : d("", !0)
|
|
195
|
+
], 64)) : d("", !0)
|
|
197
196
|
]));
|
|
198
197
|
}
|
|
199
198
|
});
|
|
200
199
|
export {
|
|
201
|
-
|
|
200
|
+
le as default
|
|
202
201
|
};
|
|
@@ -83,12 +83,12 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
83
83
|
"data-cy": t.dataCy,
|
|
84
84
|
"dropdown-element": "ul",
|
|
85
85
|
"dropdown-classes": ["uikit-z-30", t.dropdownClasses],
|
|
86
|
-
"open-dropdown": r.value,
|
|
87
86
|
"keep-state": !a.value.length || t.keepState === "closed" ? "closed" : "opened",
|
|
88
87
|
"activate-keyboard-controller": t.enableKeyboardController,
|
|
89
88
|
"reset-keyboard-controller": y.value,
|
|
90
89
|
"onUpdate:resetKeyboardController": e[5] || (e[5] = (n) => y.value = n),
|
|
91
|
-
|
|
90
|
+
open: r.value,
|
|
91
|
+
"onUpdate:open": e[6] || (e[6] = (n) => r.value = n)
|
|
92
92
|
}, {
|
|
93
93
|
btn_slot: S(() => [
|
|
94
94
|
s("div", {
|
|
@@ -179,7 +179,7 @@ const ue = ["id", "data-cy", "placeholder"], se = ["innerHTML"], ke = /* @__PURE
|
|
|
179
179
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
180
180
|
]),
|
|
181
181
|
_: 3
|
|
182
|
-
}, 8, ["data-cy", "dropdown-classes", "
|
|
182
|
+
}, 8, ["data-cy", "dropdown-classes", "keep-state", "activate-keyboard-controller", "reset-keyboard-controller", "open"]));
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
export {
|
|
@@ -30,13 +30,13 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
30
30
|
modelModifiers: {}
|
|
31
31
|
}),
|
|
32
32
|
emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
|
|
33
|
-
setup(t, { expose:
|
|
34
|
-
const u = F(t, "modelValue"), r =
|
|
33
|
+
setup(t, { expose: V, emit: B }) {
|
|
34
|
+
const u = F(t, "modelValue"), r = B, i = d(""), a = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), S = k(() => a.value.length);
|
|
35
35
|
L(() => {
|
|
36
36
|
v.value = q({ delay: 300 }, t.onInputChangeCb);
|
|
37
37
|
});
|
|
38
38
|
const { activeIdx: m, selectedIdx: h } = J({
|
|
39
|
-
optionsLength:
|
|
39
|
+
optionsLength: S,
|
|
40
40
|
isDropdownOpen: n,
|
|
41
41
|
disableSpaceHandler: !0
|
|
42
42
|
}), O = k(() => {
|
|
@@ -103,7 +103,7 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
103
103
|
}
|
|
104
104
|
), f(n, (e) => {
|
|
105
105
|
r("update:dropdownState", e);
|
|
106
|
-
}),
|
|
106
|
+
}), V({
|
|
107
107
|
select: () => {
|
|
108
108
|
C.value?.select();
|
|
109
109
|
}
|
|
@@ -126,7 +126,7 @@ const Q = ["innerHTML"], ne = /* @__PURE__ */ x({
|
|
|
126
126
|
"keep-state": !a.value.length || t.keepState === "closed" ? "closed" : "opened",
|
|
127
127
|
"close-when-clicked-outside": t.closeDropdownOnBodyPressed,
|
|
128
128
|
"activate-keyboard-controller": !1,
|
|
129
|
-
"onUpdate:
|
|
129
|
+
"onUpdate:open": l[3] || (l[3] = (o) => n.value = o),
|
|
130
130
|
onClick: l[4] || (l[4] = (o) => {
|
|
131
131
|
r("click"), E();
|
|
132
132
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, useTemplateRef as c, shallowRef as B, computed as l, createElementBlock as C, openBlock as w, withModifiers as s, normalizeStyle as M, normalizeClass as z, renderSlot as u, createVNode as L } from "vue";
|
|
2
2
|
import g from "../../../../UIKit/StaticSpinner.js";
|
|
3
|
-
const
|
|
3
|
+
const S = ["id", "data-cy", "type", "data-active", "disabled", "aria-label", "title"], A = /* @__PURE__ */ v({
|
|
4
4
|
__name: "BaseButton",
|
|
5
5
|
props: {
|
|
6
6
|
btnClass: { default: "uikit-btn-w-primary" },
|
|
@@ -15,18 +15,18 @@ const w = ["id", "data-cy", "type", "data-active", "disabled", "aria-label", "ti
|
|
|
15
15
|
dataCy: {},
|
|
16
16
|
type: {}
|
|
17
17
|
},
|
|
18
|
-
emits: ["mouseover", "mouseout", "click"],
|
|
18
|
+
emits: ["mouseover", "mouseout", "click", "keydown"],
|
|
19
19
|
setup(e, { expose: d, emit: r }) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
20
|
+
const o = r, m = c("buttonEl"), a = B(!1), y = l(() => e.size ? `uikit-btn-${e.size}` : ""), k = l(() => e.outlined ? "uikit-btn-outline" : ""), b = () => {
|
|
21
|
+
a.value = !0;
|
|
22
|
+
}, f = () => {
|
|
23
|
+
a.value = !1;
|
|
24
24
|
};
|
|
25
25
|
return d({
|
|
26
26
|
getRootElement: () => m.value
|
|
27
|
-
}), (
|
|
27
|
+
}), (n, t) => (w(), C("button", {
|
|
28
28
|
ref: "buttonEl",
|
|
29
|
-
id:
|
|
29
|
+
id: n.$attrs.id,
|
|
30
30
|
"data-cy": e.dataCy,
|
|
31
31
|
type: e.type,
|
|
32
32
|
class: z([
|
|
@@ -37,31 +37,32 @@ const w = ["id", "data-cy", "type", "data-active", "disabled", "aria-label", "ti
|
|
|
37
37
|
"uikit-flex uikit-items-center uikit-justify-center": e.isLoading
|
|
38
38
|
},
|
|
39
39
|
e.btnClass,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
y.value,
|
|
41
|
+
k.value
|
|
42
42
|
]),
|
|
43
|
-
style:
|
|
43
|
+
style: M(n.$attrs.style),
|
|
44
44
|
"data-active": e.keepActive,
|
|
45
45
|
disabled: e.isLoading || e.disabled,
|
|
46
46
|
"aria-label": e.ariaLabel,
|
|
47
47
|
title: e.title,
|
|
48
48
|
onMouseover: t[0] || (t[0] = s((i) => {
|
|
49
|
-
|
|
49
|
+
b(), o("mouseover", i);
|
|
50
50
|
}, ["stop"])),
|
|
51
51
|
onMouseout: t[1] || (t[1] = s((i) => {
|
|
52
|
-
|
|
52
|
+
f(), o("mouseout", i);
|
|
53
53
|
}, ["stop"])),
|
|
54
|
-
onClick: t[2] || (t[2] = (i) =>
|
|
54
|
+
onClick: t[2] || (t[2] = (i) => o("click", i)),
|
|
55
|
+
onKeydown: t[3] || (t[3] = (i) => o("keydown", i))
|
|
55
56
|
}, [
|
|
56
|
-
e.isLoading ? u(
|
|
57
|
+
e.isLoading ? u(n.$slots, "spinner", { key: 1 }, () => [
|
|
57
58
|
L(g, {
|
|
58
59
|
"stroke-color": e.outlined ? "#ACB4C3" : "#fff"
|
|
59
60
|
}, null, 8, ["stroke-color"])
|
|
60
|
-
]) : u(
|
|
61
|
+
]) : u(n.$slots, "default", {
|
|
61
62
|
key: 0,
|
|
62
|
-
hover:
|
|
63
|
+
hover: a.value
|
|
63
64
|
})
|
|
64
|
-
], 46,
|
|
65
|
+
], 46, S));
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as T, mergeModels as
|
|
1
|
+
import { defineComponent as T, mergeModels as K, useId as N, useModel as E, shallowRef as R, computed as V, useTemplateRef as I, onMounted as z, onUnmounted as P, watch as v, nextTick as q, createElementBlock as F, openBlock as m, normalizeClass as d, renderSlot as A, createBlock as x, unref as l, createVNode as U, withCtx as B, createElementVNode as j, createCommentVNode as G, resolveDynamicComponent as J, mergeProps as Q } from "vue";
|
|
2
2
|
import X from "./BaseButton.vue.js";
|
|
3
3
|
import { ArrowIcon as Y } from "@wikicasa-dev/svg-icons";
|
|
4
|
-
import { useKeyboardController as Z } from "
|
|
5
|
-
const _ = ["innerHTML"],
|
|
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__ */
|
|
8
|
+
props: /* @__PURE__ */ K({
|
|
9
9
|
dropdownAttrs: {},
|
|
10
10
|
dropdownClasses: { default: "" },
|
|
11
11
|
btnClasses: { default: "" },
|
|
@@ -16,7 +16,6 @@ const _ = ["innerHTML"], ae = /* @__PURE__ */ T({
|
|
|
16
16
|
arrowWidth: { default: 12 },
|
|
17
17
|
arrowStrokeColor: { default: void 0 },
|
|
18
18
|
isAbsolute: { type: Boolean, default: !0 },
|
|
19
|
-
openDropdown: { type: Boolean, default: !1 },
|
|
20
19
|
closeWhenClickedOutside: { type: Boolean, default: !0 },
|
|
21
20
|
dropdownElement: { default: "div" },
|
|
22
21
|
keepState: { default: "" },
|
|
@@ -24,86 +23,69 @@ const _ = ["innerHTML"], ae = /* @__PURE__ */ T({
|
|
|
24
23
|
closeKeys: { type: [Boolean, Array], default: () => ["Escape", "Enter"] },
|
|
25
24
|
dataCy: { default: "" }
|
|
26
25
|
}, {
|
|
27
|
-
toggleDropdown: { type: Boolean, default: void 0 },
|
|
28
|
-
toggleDropdownModifiers: {},
|
|
29
26
|
resetKeyboardController: { type: Boolean, default: !1 },
|
|
30
27
|
resetKeyboardControllerModifiers: {},
|
|
31
28
|
open: { type: Boolean, default: !1 },
|
|
32
29
|
openModifiers: {}
|
|
33
30
|
}),
|
|
34
|
-
emits: /* @__PURE__ */
|
|
35
|
-
setup(t, { expose: L, emit:
|
|
36
|
-
const n = t,
|
|
31
|
+
emits: /* @__PURE__ */ K(["click"], ["update:resetKeyboardController", "update:open"]),
|
|
32
|
+
setup(t, { expose: L, emit: D }) {
|
|
33
|
+
const n = t, y = N(), S = D, w = E(
|
|
37
34
|
t,
|
|
38
35
|
"resetKeyboardController"
|
|
39
|
-
), o =
|
|
40
|
-
let
|
|
41
|
-
const s = R([]), M = V(() => s.value.length), u =
|
|
36
|
+
), o = E(t, "open");
|
|
37
|
+
let C = !1;
|
|
38
|
+
const s = R([]), M = V(() => s.value.length), u = I("container"), c = I("dropdown"), { activeIdx: a, selectedIdx: i, onKeyDownHandler: O } = Z({
|
|
42
39
|
optionsLength: M,
|
|
43
40
|
isDropdownOpen: o,
|
|
44
41
|
global: !1,
|
|
45
42
|
closeKeys: n.closeKeys ? n.closeKeys : []
|
|
46
|
-
}),
|
|
43
|
+
}), b = () => {
|
|
47
44
|
o.value = !1;
|
|
48
|
-
},
|
|
49
|
-
u.value?.contains(e) ||
|
|
50
|
-
},
|
|
51
|
-
o.value && (u.value?.contains(e.target) ||
|
|
45
|
+
}, h = ({ target: e }) => {
|
|
46
|
+
u.value?.contains(e) || b();
|
|
47
|
+
}, p = (e) => {
|
|
48
|
+
o.value && (u.value?.contains(e.target) || b());
|
|
52
49
|
}, W = (e) => {
|
|
53
|
-
n.activateKeyboardController && (
|
|
54
|
-
key: e.key,
|
|
55
|
-
closeKeys: n.closeKeys ? n.closeKeys : []
|
|
56
|
-
}), O(e));
|
|
50
|
+
n.activateKeyboardController && O(e);
|
|
57
51
|
}, f = () => {
|
|
58
52
|
n.keepState === "closed" && !o.value || n.keepState === "opened" && o.value || (o.value = !o.value);
|
|
59
53
|
}, $ = (e) => {
|
|
60
|
-
e != null && (
|
|
54
|
+
e != null && (a.value = e);
|
|
61
55
|
}, H = (e) => {
|
|
62
|
-
e != null && (
|
|
63
|
-
},
|
|
56
|
+
e != null && (i.value = e);
|
|
57
|
+
}, g = () => {
|
|
64
58
|
c.value && (s.value = Array.from(c.value.children));
|
|
65
59
|
};
|
|
66
60
|
return z(() => {
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
-
n.closeWhenClickedOutside && (document.removeEventListener("click",
|
|
70
|
-
}),
|
|
71
|
-
e && (
|
|
72
|
-
|
|
61
|
+
g();
|
|
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
|
+
g(), w.value = !1;
|
|
73
67
|
}));
|
|
74
|
-
}),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
o.value = e;
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
immediate: !0
|
|
81
|
-
}
|
|
82
|
-
), l(o, (e) => {
|
|
83
|
-
m("update:dropdownState", e);
|
|
84
|
-
}), l(o, (e) => {
|
|
85
|
-
!e || h || !n.closeWhenClickedOutside || (document.addEventListener("click", g), document.addEventListener("focusin", b), h = !0);
|
|
86
|
-
}), l(y, (e) => {
|
|
87
|
-
e && (o.value = !o.value, y.value = !1);
|
|
88
|
-
}), l(r, (e) => {
|
|
68
|
+
}), v(o, (e) => {
|
|
69
|
+
!e || C || !n.closeWhenClickedOutside || (document.addEventListener("click", h), document.addEventListener("focusin", p), C = !0);
|
|
70
|
+
}), v(i, (e) => {
|
|
89
71
|
e !== -1 && s.value[e]?.querySelector("a")?.click();
|
|
90
72
|
}), L({
|
|
91
|
-
activeIdx:
|
|
92
|
-
selectedIdx:
|
|
73
|
+
activeIdx: a,
|
|
74
|
+
selectedIdx: i,
|
|
93
75
|
getRootElement: () => u.value,
|
|
94
76
|
getContentElement: () => c.value
|
|
95
|
-
}), (e,
|
|
77
|
+
}), (e, r) => (m(), F("div", {
|
|
96
78
|
ref: "container",
|
|
97
79
|
class: d(["uikit-relative uikit-block", e.$attrs.class]),
|
|
98
80
|
onKeydown: W
|
|
99
81
|
}, [
|
|
100
|
-
|
|
82
|
+
A(e.$slots, "btn_slot", {
|
|
101
83
|
toggleDropdown: f,
|
|
102
84
|
isOpen: o.value,
|
|
103
|
-
activeIdx: a
|
|
85
|
+
activeIdx: l(a)
|
|
104
86
|
}, () => [
|
|
105
|
-
|
|
106
|
-
id:
|
|
87
|
+
U(X, {
|
|
88
|
+
id: l(y),
|
|
107
89
|
type: "button",
|
|
108
90
|
"data-cy": t.dataCy,
|
|
109
91
|
class: d([
|
|
@@ -112,28 +94,31 @@ const _ = ["innerHTML"], ae = /* @__PURE__ */ T({
|
|
|
112
94
|
]),
|
|
113
95
|
"aria-expanded": o.value,
|
|
114
96
|
"btn-class": "uikit-btn-single-selection",
|
|
115
|
-
onClick:
|
|
116
|
-
|
|
97
|
+
onClick: r[0] || (r[0] = (k) => {
|
|
98
|
+
S("click"), f();
|
|
99
|
+
}),
|
|
100
|
+
onKeydown: r[1] || (r[1] = (k) => {
|
|
101
|
+
Array.isArray(t.closeKeys) && !t.closeKeys.includes(k.key) || k.stopPropagation();
|
|
117
102
|
})
|
|
118
103
|
}, {
|
|
119
|
-
default:
|
|
120
|
-
|
|
104
|
+
default: B(() => [
|
|
105
|
+
j("span", {
|
|
121
106
|
class: d(["uikit-mr-5px", t.labelClasses]),
|
|
122
107
|
innerHTML: t.btnLabel
|
|
123
108
|
}, null, 10, _),
|
|
124
|
-
t.withArrowIcon ? (
|
|
109
|
+
t.withArrowIcon ? (m(), x(l(Y), {
|
|
125
110
|
key: 0,
|
|
126
111
|
class: d(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", o.value ? "uikit-rotate-180" : ""]),
|
|
127
112
|
width: t.arrowWidth,
|
|
128
113
|
height: t.arrowWidth,
|
|
129
114
|
"stroke-color": t.arrowStrokeColor
|
|
130
|
-
}, null, 8, ["class", "width", "height", "stroke-color"])) :
|
|
115
|
+
}, null, 8, ["class", "width", "height", "stroke-color"])) : G("", !0)
|
|
131
116
|
]),
|
|
132
117
|
_: 1
|
|
133
118
|
}, 8, ["id", "data-cy", "class", "aria-expanded"])
|
|
134
119
|
]),
|
|
135
|
-
(
|
|
136
|
-
id: "dropdown_" +
|
|
120
|
+
(m(), x(J(t.dropdownElement), Q({
|
|
121
|
+
id: "dropdown_" + l(y),
|
|
137
122
|
ref: "dropdown",
|
|
138
123
|
"data-cy": t.dataCy && `${t.dataCy}_dropdown`,
|
|
139
124
|
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", [
|
|
@@ -145,12 +130,12 @@ const _ = ["innerHTML"], ae = /* @__PURE__ */ T({
|
|
|
145
130
|
"aria-hidden": !o.value,
|
|
146
131
|
"data-side": t.direction
|
|
147
132
|
}, t.dropdownAttrs), {
|
|
148
|
-
default:
|
|
149
|
-
|
|
133
|
+
default: B(() => [
|
|
134
|
+
A(e.$slots, "default", {
|
|
150
135
|
isOpen: o.value,
|
|
151
136
|
toggleDropdown: f,
|
|
152
|
-
activeIdx: a
|
|
153
|
-
selectedIdx:
|
|
137
|
+
activeIdx: l(a),
|
|
138
|
+
selectedIdx: l(i),
|
|
154
139
|
setActiveIdx: $,
|
|
155
140
|
setSelectedIdx: H
|
|
156
141
|
})
|
|
@@ -161,5 +146,5 @@ const _ = ["innerHTML"], ae = /* @__PURE__ */ T({
|
|
|
161
146
|
}
|
|
162
147
|
});
|
|
163
148
|
export {
|
|
164
|
-
|
|
149
|
+
le as default
|
|
165
150
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/components",
|
|
3
|
-
"version": "2.2.9-alpha.
|
|
3
|
+
"version": "2.2.9-alpha.32",
|
|
4
4
|
"description": "Wikicasa frontend components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vue": "^3.5.0",
|
|
45
45
|
"date-fns": "^4.0.0",
|
|
46
46
|
"@wikicasa-dev/svg-icons": "^1.2.28-alpha.1",
|
|
47
|
-
"@wikicasa-dev/vue-composables": "
|
|
47
|
+
"@wikicasa-dev/vue-composables": "0.0.33-alpha.2",
|
|
48
48
|
"@wikicasa-dev/types": "^2.4.0",
|
|
49
49
|
"@wikicasa-dev/utilities": "^1.2.0"
|
|
50
50
|
},
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
65
65
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
66
66
|
"@wikicasa-dev/svg-icons": "1.2.28-alpha.1",
|
|
67
|
-
"@wikicasa-dev/vue-composables": "0.0.
|
|
67
|
+
"@wikicasa-dev/vue-composables": "0.0.33-alpha.2",
|
|
68
68
|
"@wikicasa-dev/tailwind-plugins": "^0.0.3",
|
|
69
69
|
"@wikicasa-dev/types": "2.4.6",
|
|
70
70
|
"@wikicasa-dev/utilities": "1.2.0",
|
|
File without changes
|