@wikicasa-dev/components 2.2.8-alpha.13 → 2.2.8-alpha.15
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/Autocomplete/ClearableAutocomplete.d.ts +1 -0
- package/dist/UIKit/Checkbox/CheckboxBtn.d.ts +34 -38
- package/dist/UIKit/Checkbox/CheckboxGroup.d.ts +6 -9
- package/dist/packages/components/lib/UIKit/Autocomplete/ClearableAutocomplete.vue.js +33 -31
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxBtn.vue.js +2 -2
- package/dist/packages/components/lib/UIKit/Checkbox/CheckboxGroup.vue.js +41 -39
- package/package.json +1 -1
- /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
|
@@ -4,6 +4,7 @@ import { Nullable } from '@wikicasa-dev/types';
|
|
|
4
4
|
export interface ClearableAutocompleteProps<TID extends string | number | undefined, TPayload> {
|
|
5
5
|
dataCy?: string;
|
|
6
6
|
placeholder?: string;
|
|
7
|
+
enableKeyboardController?: boolean;
|
|
7
8
|
triggerWrapperClasses?: ClassTypeProp;
|
|
8
9
|
inputWrapperClasses?: ClassTypeProp;
|
|
9
10
|
inputClasses?: ClassTypeProp;
|
|
@@ -1,44 +1,40 @@
|
|
|
1
1
|
import { ClassTypeProp } from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
declare const _default: <TID extends string | number, TLabel extends string | number>(__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<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly "onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
5
|
+
readonly onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
6
|
+
readonly onChange?: ((args_0: {
|
|
7
|
+
id: TID;
|
|
8
|
+
label: TLabel;
|
|
9
|
+
checked: boolean;
|
|
10
|
+
}) => any) | undefined;
|
|
11
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onChange"> & {
|
|
12
|
+
id?: TID;
|
|
13
|
+
dataCy?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use v-model instead
|
|
17
|
+
*/
|
|
18
|
+
checked?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
inputClass?: ClassTypeProp;
|
|
21
|
+
label?: TLabel;
|
|
22
|
+
modelValue?: boolean;
|
|
23
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
|
24
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
25
|
+
attrs: any;
|
|
22
26
|
slots: {
|
|
23
27
|
label?(_: {}): any;
|
|
24
28
|
};
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
emit: ((evt: "update:modelValue", args_0: boolean) => void) & ((evt: "click", args_0: MouseEvent) => void) & ((evt: "change", args_0: {
|
|
30
|
+
id: TID;
|
|
31
|
+
label: TLabel;
|
|
32
|
+
checked: boolean;
|
|
33
|
+
}) => void);
|
|
34
|
+
}>) => import('vue').VNode & {
|
|
35
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
27
36
|
};
|
|
28
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
30
|
-
"update:modelValue": (args_0: boolean) => any;
|
|
31
|
-
click: (args_0: MouseEvent) => any;
|
|
32
|
-
change: (args_0: EventPayload) => any;
|
|
33
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
-
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
35
|
-
onClick?: ((args_0: MouseEvent) => any) | undefined;
|
|
36
|
-
onChange?: ((args_0: EventPayload) => any) | undefined;
|
|
37
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLabelElement>;
|
|
38
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
39
37
|
export default _default;
|
|
40
|
-
type
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
};
|
|
38
|
+
type __VLS_PrettifyLocal<T> = {
|
|
39
|
+
[K in keyof T]: T[K];
|
|
40
|
+
} & {};
|
|
@@ -7,9 +7,6 @@ export type CheckboxButtonType<TID = string | number, TLabel = string | number,
|
|
|
7
7
|
payload?: TPayload;
|
|
8
8
|
dataCy?: string;
|
|
9
9
|
};
|
|
10
|
-
export type CheckboxButtonTypeObj = Omit<CheckboxButtonType, "checked"> & {
|
|
11
|
-
checked: boolean;
|
|
12
|
-
};
|
|
13
10
|
export type GetterIdType<T = CheckboxButtonType | string | number> = (checkboxBtn: T) => string;
|
|
14
11
|
export type CheckboxGroupProps<TID = string | number, TLabel = string | number, TPayload = unknown> = {
|
|
15
12
|
checkboxData?: CheckboxButtonType<TID, TLabel, TPayload>[];
|
|
@@ -36,7 +33,7 @@ export type CheckboxGroupProps<TID = string | number, TLabel = string | number,
|
|
|
36
33
|
};
|
|
37
34
|
declare const _default: <TID extends string | number, TLabel extends string | number, TPayload>(__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<{
|
|
38
35
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
39
|
-
readonly "onUpdate:modelValue"?: ((args_0: CheckboxButtonType<
|
|
36
|
+
readonly "onUpdate:modelValue"?: ((args_0: CheckboxButtonType<TID, TLabel, TPayload>[]) => any) | undefined;
|
|
40
37
|
readonly onResetted?: (() => any) | undefined;
|
|
41
38
|
readonly onCheckedGroup?: ((args_0: string) => any) | undefined;
|
|
42
39
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onResetted" | "onCheckedGroup"> & CheckboxGroupProps<TID, TLabel, TPayload> & Partial<{}>> & import('vue').PublicProps;
|
|
@@ -44,18 +41,18 @@ declare const _default: <TID extends string | number, TLabel extends string | nu
|
|
|
44
41
|
attrs: any;
|
|
45
42
|
slots: {
|
|
46
43
|
default?(_: {
|
|
47
|
-
isActive: (elem: CheckboxButtonType | string | number) => boolean;
|
|
48
|
-
handleChange: (checkboxValue: CheckboxButtonType) => void;
|
|
44
|
+
isActive: (elem: CheckboxButtonType<TID, TLabel, TPayload> | string | number) => boolean;
|
|
45
|
+
handleChange: (checkboxValue: CheckboxButtonType<TID, TLabel, TPayload>) => void;
|
|
49
46
|
checkboxesData: CheckboxButtonType<TID, TLabel, TPayload>[];
|
|
50
47
|
}): any;
|
|
51
48
|
checkbox_elements?(_: {
|
|
52
|
-
isActive: (elem: CheckboxButtonType | string | number) => boolean;
|
|
53
|
-
handleChange: (checkboxValue: CheckboxButtonType) => void;
|
|
49
|
+
isActive: (elem: CheckboxButtonType<TID, TLabel, TPayload> | string | number) => boolean;
|
|
50
|
+
handleChange: (checkboxValue: CheckboxButtonType<TID, TLabel, TPayload>) => void;
|
|
54
51
|
checkboxesData: CheckboxButtonType<TID, TLabel, TPayload>[];
|
|
55
52
|
reset: () => void;
|
|
56
53
|
}): any;
|
|
57
54
|
};
|
|
58
|
-
emit: ((evt: "update:modelValue", args_0: CheckboxButtonType<
|
|
55
|
+
emit: ((evt: "update:modelValue", args_0: CheckboxButtonType<TID, TLabel, TPayload>[]) => void) & ((evt: "resetted") => void) & ((evt: "checkedGroup", args_0: string) => void);
|
|
59
56
|
}>) => import('vue').VNode & {
|
|
60
57
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
61
58
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as L, mergeModels as
|
|
1
|
+
import { defineComponent as L, mergeModels as V, useModel as M, useTemplateRef as C, shallowRef as s, onBeforeMount as N, watch as b, nextTick as O, createBlock as $, openBlock as c, withCtx as y, createElementBlock as B, Fragment as U, renderList as D, renderSlot as v, createElementVNode as d, normalizeClass as f, withDirectives as H, createCommentVNode as A, vModelText as P, toDisplayString as X, normalizeStyle as j, createTextVNode as q } from "vue";
|
|
2
2
|
import G from "../BaseDropDown.vue.js";
|
|
3
3
|
import '../../../../../assets/BaseDropDown.css';/* empty css */
|
|
4
4
|
import J from "../BaseSelect/SelectItem.vue.js";
|
|
5
5
|
import { debounce as Q } from "@wikicasa-dev/utilities";
|
|
6
6
|
const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L({
|
|
7
7
|
__name: "ClearableAutocomplete",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ V({
|
|
9
9
|
dataCy: {},
|
|
10
10
|
placeholder: {},
|
|
11
|
+
enableKeyboardController: { type: Boolean, default: !0 },
|
|
11
12
|
triggerWrapperClasses: {},
|
|
12
13
|
inputWrapperClasses: {},
|
|
13
14
|
inputClasses: {},
|
|
@@ -22,12 +23,12 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
|
|
|
22
23
|
modelValue: { default: null },
|
|
23
24
|
modelModifiers: {}
|
|
24
25
|
}),
|
|
25
|
-
emits: /* @__PURE__ */
|
|
26
|
+
emits: /* @__PURE__ */ V(["click", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
|
|
26
27
|
setup(l, { expose: x, emit: R }) {
|
|
27
|
-
const u =
|
|
28
|
-
o.value = "", i.value = null;
|
|
29
|
-
},
|
|
30
|
-
if (
|
|
28
|
+
const u = M(l, "open"), i = M(l, "modelValue"), p = R, T = C("inputRef"), o = s(""), w = s(0), k = s(!1), h = s(null), a = s([]), z = C("dropdownRef"), m = C("hiddenSpan"), K = () => {
|
|
29
|
+
o.value = "", i.value = null, p("update:inputValue", "");
|
|
30
|
+
}, W = async (t) => {
|
|
31
|
+
if (p("update:inputValue", t), !t) {
|
|
31
32
|
a.value = [], u.value = !1;
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
@@ -35,7 +36,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
|
|
|
35
36
|
}, S = (t = -1) => {
|
|
36
37
|
const e = a.value[t];
|
|
37
38
|
!e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, u.value = !1, i.value = e, a.value = []);
|
|
38
|
-
},
|
|
39
|
+
}, I = () => {
|
|
39
40
|
T.value?.select();
|
|
40
41
|
};
|
|
41
42
|
return N(() => {
|
|
@@ -57,8 +58,8 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
|
|
|
57
58
|
},
|
|
58
59
|
{ immediate: !0 }
|
|
59
60
|
), x({
|
|
60
|
-
select:
|
|
61
|
-
}), (t, e) => (
|
|
61
|
+
select: I
|
|
62
|
+
}), (t, e) => (c(), $(G, {
|
|
62
63
|
ref: "dropdownRef",
|
|
63
64
|
class: "uikit-clearable-autocomplete",
|
|
64
65
|
"data-cy": l.dataCy,
|
|
@@ -66,33 +67,34 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
|
|
|
66
67
|
"dropdown-classes": ["uikit-z-30", l.dropdownClasses],
|
|
67
68
|
"open-dropdown": u.value,
|
|
68
69
|
"keep-state": !a.value.length || l.keepState === "closed" ? "closed" : "opened",
|
|
70
|
+
"activate-keyboard-controller": l.enableKeyboardController,
|
|
69
71
|
"reset-keyboard-controller": k.value,
|
|
70
72
|
"onUpdate:resetKeyboardController": e[2] || (e[2] = (n) => k.value = n),
|
|
71
73
|
"onUpdate:dropdownState": e[3] || (e[3] = (n) => u.value = n),
|
|
72
|
-
onClick: e[4] || (e[4] = (n) =>
|
|
74
|
+
onClick: e[4] || (e[4] = (n) => p("click"))
|
|
73
75
|
}, {
|
|
74
76
|
btn_slot: y(() => [
|
|
75
77
|
d("div", {
|
|
76
|
-
class:
|
|
78
|
+
class: f(["uikit-text-16", l.triggerWrapperClasses])
|
|
77
79
|
}, [
|
|
78
|
-
|
|
80
|
+
v(t.$slots, "left-icon"),
|
|
79
81
|
d("div", {
|
|
80
|
-
class:
|
|
82
|
+
class: f(["uikit-relative", l.inputWrapperClasses])
|
|
81
83
|
}, [
|
|
82
84
|
H(d("input", {
|
|
83
85
|
ref: "inputRef",
|
|
84
86
|
"onUpdate:modelValue": [
|
|
85
87
|
e[0] || (e[0] = (n) => o.value = n),
|
|
86
|
-
|
|
88
|
+
W
|
|
87
89
|
],
|
|
88
90
|
readonly: !!i.value?.label,
|
|
89
|
-
class:
|
|
91
|
+
class: f(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", l.inputClasses]),
|
|
90
92
|
style: {
|
|
91
93
|
font: "inherit",
|
|
92
94
|
fontSize: "inherit"
|
|
93
95
|
},
|
|
94
96
|
placeholder: l.placeholder,
|
|
95
|
-
onKeydown: e[1] || (e[1] = (n) =>
|
|
97
|
+
onKeydown: e[1] || (e[1] = (n) => p("keydown", n))
|
|
96
98
|
}, null, 42, Y), [
|
|
97
99
|
[P, o.value]
|
|
98
100
|
]),
|
|
@@ -105,36 +107,36 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
|
|
|
105
107
|
fontSize: "inherit"
|
|
106
108
|
}
|
|
107
109
|
}, X(o.value), 513),
|
|
108
|
-
i.value?.label ? (
|
|
110
|
+
i.value?.label ? (c(), B("button", {
|
|
109
111
|
key: 0,
|
|
110
112
|
type: "button",
|
|
111
|
-
class:
|
|
113
|
+
class: f(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButtonClasses]),
|
|
112
114
|
"aria-label": "Clear input",
|
|
113
115
|
style: j({
|
|
114
116
|
left: `${w.value + 16}px`
|
|
115
117
|
}),
|
|
116
|
-
onClick:
|
|
118
|
+
onClick: K
|
|
117
119
|
}, [
|
|
118
|
-
|
|
120
|
+
v(t.$slots, "clear-icon", {}, () => [
|
|
119
121
|
e[5] || (e[5] = q("X", -1))
|
|
120
122
|
])
|
|
121
123
|
], 6)) : A("", !0)
|
|
122
124
|
], 2),
|
|
123
|
-
|
|
125
|
+
v(t.$slots, "right-icon")
|
|
124
126
|
], 2)
|
|
125
127
|
]),
|
|
126
|
-
default: y(({ activeIdx: n, setActiveIdx:
|
|
127
|
-
(
|
|
128
|
-
key:
|
|
129
|
-
active: n ===
|
|
128
|
+
default: y(({ activeIdx: n, setActiveIdx: E }) => [
|
|
129
|
+
(c(!0), B(U, null, D(a.value, (g, r) => (c(), $(J, {
|
|
130
|
+
key: r,
|
|
131
|
+
active: n === r,
|
|
130
132
|
class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
|
|
131
|
-
onClick: (
|
|
132
|
-
onMouseover: (
|
|
133
|
+
onClick: (F) => S(r),
|
|
134
|
+
onMouseover: (F) => E(r)
|
|
133
135
|
}, {
|
|
134
136
|
default: y(() => [
|
|
135
|
-
|
|
137
|
+
v(t.$slots, "option-content", {
|
|
136
138
|
option: g,
|
|
137
|
-
idx:
|
|
139
|
+
idx: r
|
|
138
140
|
}, () => [
|
|
139
141
|
d("span", {
|
|
140
142
|
innerHTML: g.label
|
|
@@ -145,7 +147,7 @@ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L
|
|
|
145
147
|
}, 1032, ["active", "onClick", "onMouseover"]))), 128))
|
|
146
148
|
]),
|
|
147
149
|
_: 3
|
|
148
|
-
}, 8, ["data-cy", "dropdown-classes", "open-dropdown", "keep-state", "reset-keyboard-controller"]));
|
|
150
|
+
}, 8, ["data-cy", "dropdown-classes", "open-dropdown", "keep-state", "activate-keyboard-controller", "reset-keyboard-controller"]));
|
|
149
151
|
}
|
|
150
152
|
});
|
|
151
153
|
export {
|
|
@@ -14,7 +14,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
|
|
|
14
14
|
label: { default: "" },
|
|
15
15
|
modelValue: { type: Boolean, default: !1 }
|
|
16
16
|
},
|
|
17
|
-
emits: ["click", "
|
|
17
|
+
emits: ["click", "update:modelValue", "change"],
|
|
18
18
|
setup(e, { emit: r }) {
|
|
19
19
|
const l = f(), d = h(() => `${e.id ?? l}`), a = r;
|
|
20
20
|
b(
|
|
@@ -40,7 +40,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
|
|
|
40
40
|
"model-value": e.modelValue,
|
|
41
41
|
"data-cy": e.dataCy,
|
|
42
42
|
disabled: e.disabled,
|
|
43
|
-
class: y(["
|
|
43
|
+
class: y(["uikit-inline-flex uikit-size-[20px] uikit-items-center uikit-justify-center uikit-rounded-[4px] uikit-p-0 data-[state='unchecked']:uikit-border data-[state='unchecked']:uikit-border-solid data-[state='unchecked']:uikit-border-w-lightgray", [
|
|
44
44
|
{
|
|
45
45
|
"uikit-bg-white": !e.modelValue,
|
|
46
46
|
"uikit-bg-w-primary": e.modelValue
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { stringToHyphened as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as p, ref as v, computed as h, watch as D, renderSlot as b, createElementVNode as E, normalizeClass as $, createElementBlock as B, createCommentVNode as A, openBlock as g, Fragment as I, renderList as R, createBlock as K, unref as V } from "vue";
|
|
2
|
+
import { stringToHyphened as L, isArrNullOrEmpty as G } from "@wikicasa-dev/utilities";
|
|
3
|
+
import N from "./CheckboxBtn.vue.js";
|
|
4
|
+
const T = ["id", "data-cy"], S = /* @__PURE__ */ p({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "CheckboxGroup",
|
|
7
7
|
props: {
|
|
@@ -14,36 +14,38 @@ const N = ["id", "data-cy"], O = /* @__PURE__ */ x({
|
|
|
14
14
|
autoCheckResetAll: { type: Boolean, default: !1 },
|
|
15
15
|
autoCheckResetEmpty: { type: Boolean, default: !1 },
|
|
16
16
|
manualToggleResetButton: { type: Boolean, default: !1 },
|
|
17
|
-
getKey: { type: Function, default: (
|
|
17
|
+
getKey: { type: Function, default: (a) => typeof a == "string" || typeof a == "number" ? `${a}` : `${a.id}` },
|
|
18
18
|
groupId: { default: "" },
|
|
19
19
|
dataCy: { default: "" }
|
|
20
20
|
},
|
|
21
21
|
emits: ["resetted", "update:modelValue", "checkedGroup"],
|
|
22
|
-
setup(
|
|
23
|
-
const o =
|
|
22
|
+
setup(a, { emit: C }) {
|
|
23
|
+
const o = a, s = C, l = v(
|
|
24
|
+
/* @__PURE__ */ new Map()
|
|
25
|
+
), r = h(() => {
|
|
24
26
|
for (const e of o.checkboxData)
|
|
25
27
|
if (e.reset) return e;
|
|
26
28
|
return null;
|
|
27
29
|
}), y = h(() => o.checkboxData.length), f = h(() => {
|
|
28
30
|
let e = 0;
|
|
29
|
-
return l.value.forEach((
|
|
30
|
-
|
|
31
|
+
return l.value.forEach((t) => {
|
|
32
|
+
t.checked && e++;
|
|
31
33
|
}), e;
|
|
32
34
|
});
|
|
33
35
|
(() => {
|
|
34
36
|
const e = [];
|
|
35
|
-
for (const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
),
|
|
37
|
+
for (const t of o.checkboxData)
|
|
38
|
+
l.value.set(`${t.id}`, {
|
|
39
|
+
...t,
|
|
40
|
+
checked: !!t.checked
|
|
41
|
+
}), t.checked && e.push(t);
|
|
40
42
|
s("update:modelValue", e);
|
|
41
43
|
})();
|
|
42
|
-
const u = (e,
|
|
44
|
+
const u = (e, t) => {
|
|
43
45
|
const c = l.value.get(e);
|
|
44
46
|
if (c) {
|
|
45
|
-
if (
|
|
46
|
-
l.value.set(e, { ...c, ...
|
|
47
|
+
if (t) {
|
|
48
|
+
l.value.set(e, { ...c, ...t });
|
|
47
49
|
return;
|
|
48
50
|
}
|
|
49
51
|
l.value.set(e, { ...c, checked: !c.checked });
|
|
@@ -55,55 +57,55 @@ const N = ["id", "data-cy"], O = /* @__PURE__ */ x({
|
|
|
55
57
|
}, m = () => {
|
|
56
58
|
k(), s("update:modelValue", []), s("resetted");
|
|
57
59
|
}, d = (e) => l.value.get(o.getKey(e))?.checked ?? !1, i = (e) => {
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
|
|
60
|
+
if (G(o.checkboxData)) return;
|
|
61
|
+
const t = l.value.get(e.id);
|
|
62
|
+
t?.reset && e.checked ? k() : r.value && !t?.reset && u(o.getKey(r.value), { checked: !1 }), u(`${e.id}`), o.autoCheckResetAll && r.value && f.value === y.value - 1 && l.value.forEach((n) => {
|
|
61
63
|
n.checked = !!n.reset;
|
|
62
|
-
}), o.autoCheckResetEmpty && r.value && !f.value && (!o.manualToggleResetButton || !
|
|
64
|
+
}), o.autoCheckResetEmpty && r.value && !f.value && (!o.manualToggleResetButton || !t?.reset) && u(o.getKey(r.value), { checked: !0 });
|
|
63
65
|
const c = [];
|
|
64
66
|
l.value.forEach((n) => {
|
|
65
67
|
n.checked && c.push(n);
|
|
66
68
|
}), s("update:modelValue", c), s("checkedGroup", o.groupId);
|
|
67
69
|
};
|
|
68
|
-
return
|
|
70
|
+
return D(
|
|
69
71
|
() => o.reset,
|
|
70
72
|
(e) => {
|
|
71
73
|
e && m();
|
|
72
74
|
}
|
|
73
|
-
), (e,
|
|
75
|
+
), (e, t) => b(e.$slots, "default", {
|
|
74
76
|
isActive: d,
|
|
75
77
|
handleChange: i,
|
|
76
|
-
checkboxesData:
|
|
78
|
+
checkboxesData: a.checkboxData
|
|
77
79
|
}, () => [
|
|
78
|
-
|
|
79
|
-
id:
|
|
80
|
-
class:
|
|
81
|
-
"data-cy":
|
|
80
|
+
E("div", {
|
|
81
|
+
id: a.groupId,
|
|
82
|
+
class: $(["checkbox-group-container", e.$attrs.class || ""]),
|
|
83
|
+
"data-cy": a.dataCy
|
|
82
84
|
}, [
|
|
83
85
|
b(e.$slots, "checkbox_elements", {
|
|
84
86
|
isActive: d,
|
|
85
87
|
handleChange: i,
|
|
86
|
-
checkboxesData:
|
|
88
|
+
checkboxesData: a.checkboxData,
|
|
87
89
|
reset: m
|
|
88
90
|
}, () => [
|
|
89
|
-
|
|
90
|
-
id:
|
|
91
|
+
a.checkboxData ? (g(!0), B(I, { key: 0 }, R(a.checkboxData, (c, n) => (g(), K(N, {
|
|
92
|
+
id: a.getKey(c),
|
|
91
93
|
key: n,
|
|
92
|
-
"data-cy": c.dataCy ?? `checkbox_${
|
|
94
|
+
"data-cy": c.dataCy ?? `checkbox_${V(L)(`${c.label}`)}`,
|
|
93
95
|
label: c.label,
|
|
94
|
-
inline:
|
|
96
|
+
inline: a.formCheckInline,
|
|
95
97
|
"model-value": d(c),
|
|
96
98
|
"container-class": [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
a.formCheckInline ? "uikit-mr-10px" : "uikit-mb-10px",
|
|
100
|
+
a.checkboxContainerClasses
|
|
99
101
|
],
|
|
100
|
-
onChange: i
|
|
101
|
-
}, null, 8, ["id", "data-cy", "label", "inline", "model-value", "container-class"]))), 128)) :
|
|
102
|
+
onChange: t[0] || (t[0] = (x) => i(x))
|
|
103
|
+
}, null, 8, ["id", "data-cy", "label", "inline", "model-value", "container-class"]))), 128)) : A("", !0)
|
|
102
104
|
])
|
|
103
|
-
], 10,
|
|
105
|
+
], 10, T)
|
|
104
106
|
]);
|
|
105
107
|
}
|
|
106
108
|
});
|
|
107
109
|
export {
|
|
108
|
-
|
|
110
|
+
S as default
|
|
109
111
|
};
|
package/package.json
CHANGED
|
File without changes
|