@wikicasa-dev/components 2.0.29 → 2.0.30
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/CheckboxGroup.js +1 -1
- package/dist/UIKit/BaseDropDown.vue.d.ts +1 -1
- package/dist/UIKit/types.d.ts +1 -0
- package/dist/chunks/{CheckboxGroup.vue_vue_type_script_setup_true_lang.C1NwpE7V.js → CheckboxGroup.vue_vue_type_script_setup_true_lang.Cf8YnCGf.js} +22 -22
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/CheckboxGroup.js
CHANGED
|
@@ -57,8 +57,8 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
|
57
57
|
onClick?: (() => any) | undefined;
|
|
58
58
|
"onUpdate:dropdownState"?: ((args_0: boolean) => any) | undefined;
|
|
59
59
|
}>, {
|
|
60
|
-
arrowWidth: number;
|
|
61
60
|
dataCy: string;
|
|
61
|
+
arrowWidth: number;
|
|
62
62
|
btnClasses: string;
|
|
63
63
|
labelClasses: ClassType;
|
|
64
64
|
dropdownClasses: ClassType;
|
package/dist/UIKit/types.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type CheckboxButtonType<T = string | number, T1 = string | number, T2 = u
|
|
|
31
31
|
checked?: boolean;
|
|
32
32
|
reset?: boolean;
|
|
33
33
|
payload?: T2;
|
|
34
|
+
dataCy?: string;
|
|
34
35
|
};
|
|
35
36
|
export type CheckboxButtonTypeObj = Omit<CheckboxButtonType, "checked"> & {
|
|
36
37
|
checked: boolean;
|
|
@@ -21,12 +21,12 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
|
|
|
21
21
|
dataCy: { default: "" }
|
|
22
22
|
},
|
|
23
23
|
emits: ["resetted", "update:modelValue", "checkedGroup"],
|
|
24
|
-
setup(a, { emit:
|
|
25
|
-
const
|
|
26
|
-
for (const e of
|
|
24
|
+
setup(a, { emit: C }) {
|
|
25
|
+
const c = a, s = C, l = x(/* @__PURE__ */ new Map()), r = i(() => {
|
|
26
|
+
for (const e of c.checkboxData)
|
|
27
27
|
if (e.reset) return e;
|
|
28
28
|
return null;
|
|
29
|
-
}),
|
|
29
|
+
}), g = i(() => c.checkboxData.length), f = i(() => {
|
|
30
30
|
let e = 0;
|
|
31
31
|
return l.value.forEach((t) => {
|
|
32
32
|
t.checked && e++;
|
|
@@ -34,7 +34,7 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
|
|
|
34
34
|
});
|
|
35
35
|
(() => {
|
|
36
36
|
const e = [];
|
|
37
|
-
for (const t of
|
|
37
|
+
for (const t of c.checkboxData)
|
|
38
38
|
t.checked = !!t.checked, l.value.set(
|
|
39
39
|
`${t.id}`,
|
|
40
40
|
t
|
|
@@ -42,13 +42,13 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
|
|
|
42
42
|
s("update:modelValue", e);
|
|
43
43
|
})();
|
|
44
44
|
const u = (e, t) => {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
45
|
+
const o = l.value.get(e);
|
|
46
|
+
if (o) {
|
|
47
47
|
if (t) {
|
|
48
|
-
l.value.set(e, { ...
|
|
48
|
+
l.value.set(e, { ...o, ...t });
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
l.value.set(e, { ...
|
|
51
|
+
l.value.set(e, { ...o, checked: !o.checked });
|
|
52
52
|
}
|
|
53
53
|
}, k = () => {
|
|
54
54
|
l.value.forEach((e) => {
|
|
@@ -56,19 +56,19 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
|
|
|
56
56
|
});
|
|
57
57
|
}, p = () => {
|
|
58
58
|
k(), s("update:modelValue", []), s("resetted");
|
|
59
|
-
}, d = (e) => l.value.get(
|
|
60
|
-
if (w(
|
|
59
|
+
}, d = (e) => l.value.get(c.getKey(e))?.checked ?? !1, h = (e) => {
|
|
60
|
+
if (w(c.checkboxData)) return;
|
|
61
61
|
const t = l.value.get(e.id);
|
|
62
|
-
t?.reset && e.checked ? k() : r.value && !t?.reset && u(
|
|
62
|
+
t?.reset && e.checked ? k() : r.value && !t?.reset && u(c.getKey(r.value), { checked: !1 }), u(`${e.id}`), c.autoCheckResetAll && r.value && f.value === g.value - 1 && l.value.forEach((n) => {
|
|
63
63
|
n.checked = !!n.reset;
|
|
64
|
-
}),
|
|
65
|
-
const
|
|
64
|
+
}), c.autoCheckResetEmpty && r.value && !f.value && (!c.manualToggleResetButton || !t?.reset) && u(c.getKey(r.value), { checked: !0 });
|
|
65
|
+
const o = [];
|
|
66
66
|
l.value.forEach((n) => {
|
|
67
|
-
n.checked &&
|
|
68
|
-
}), s("update:modelValue",
|
|
67
|
+
n.checked && o.push(n);
|
|
68
|
+
}), s("update:modelValue", o), s("checkedGroup", c.groupId);
|
|
69
69
|
};
|
|
70
70
|
return D(
|
|
71
|
-
() =>
|
|
71
|
+
() => c.reset,
|
|
72
72
|
(e) => {
|
|
73
73
|
e && p();
|
|
74
74
|
}
|
|
@@ -88,13 +88,13 @@ const w = (a) => !a?.length, G = (a = "") => !a || !a.trim() ? "" : (a = a.trim(
|
|
|
88
88
|
checkboxesData: e.checkboxData,
|
|
89
89
|
reset: p
|
|
90
90
|
}, () => [
|
|
91
|
-
e.checkboxData ? (b(!0), B(I, { key: 0 }, R(e.checkboxData, (
|
|
92
|
-
id: e.getKey(
|
|
91
|
+
e.checkboxData ? (b(!0), B(I, { key: 0 }, R(e.checkboxData, (o, n, y) => (b(), A(V, {
|
|
92
|
+
id: e.getKey(o),
|
|
93
93
|
key: y,
|
|
94
|
-
"data-cy": `checkbox_${K(G)(`${
|
|
95
|
-
label:
|
|
94
|
+
"data-cy": o.dataCy ?? `checkbox_${K(G)(`${o.label}`)}`,
|
|
95
|
+
label: o.label,
|
|
96
96
|
inline: e.formCheckInline,
|
|
97
|
-
"model-value": d(
|
|
97
|
+
"model-value": d(o),
|
|
98
98
|
"container-class": [
|
|
99
99
|
e.formCheckInline ? "uikit-mr-10px" : "uikit-mb-10px",
|
|
100
100
|
e.checkboxContainerClasses
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { _ as f } from "./chunks/BaseAccordionContent.vue_vue_type_script_setup_
|
|
|
4
4
|
import { _ as m } from "./chunks/BaseAccordionItem.vue_vue_type_script_setup_true_lang.Caagpb9M.js";
|
|
5
5
|
import { _ as l } from "./chunks/SelectItem.vue_vue_type_script_setup_true_lang.GPFf7fjA.js";
|
|
6
6
|
import { default as d } from "./CheckboxBtn.js";
|
|
7
|
-
import { _ as u } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.
|
|
7
|
+
import { _ as u } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.Cf8YnCGf.js";
|
|
8
8
|
import { _ } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.Cu67jd8K.js";
|
|
9
9
|
import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.DjAQCt5a.js";
|
|
10
10
|
import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.CiJAhkRj.js";
|