@nutui/nutui 4.0.8-beta.1 → 4.0.8
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/CHANGELOG.md +15 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.umd.js +2 -2
- package/dist/packages/_es/Checkbox.js +4 -4
- package/dist/packages/_es/CheckboxGroup.js +15 -30
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +46 -46
- package/dist/styles/themes/jdb.scss +46 -46
- package/dist/styles/themes/jddkh.scss +46 -46
- package/dist/styles/themes/jdt.scss +46 -46
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -56,7 +56,7 @@ const component = (componentName2, components) => {
|
|
|
56
56
|
});
|
|
57
57
|
const checked = computed(() => !!props.modelValue);
|
|
58
58
|
const color = computed(() => {
|
|
59
|
-
return !pDisabled.value ?
|
|
59
|
+
return !pDisabled.value ? state.partialSelect ? "nut-checkbox__icon--indeterminate" : !pValue.value ? "nut-checkbox__icon--unchecked" : "nut-checkbox__icon" : "nut-checkbox__icon--disable";
|
|
60
60
|
});
|
|
61
61
|
let updateType = "";
|
|
62
62
|
const emitChange = (value, label) => {
|
|
@@ -81,7 +81,7 @@ const component = (componentName2, components) => {
|
|
|
81
81
|
Checked: slots.checkedIcon ? slots.checkedIcon : components.Checked,
|
|
82
82
|
CheckDisabled: slots.indeterminate ? slots.indeterminate : components.CheckDisabled
|
|
83
83
|
};
|
|
84
|
-
const iconNode =
|
|
84
|
+
const iconNode = state.partialSelect ? iconNodeMap.CheckDisabled : !pValue.value ? iconNodeMap.CheckNormal : iconNodeMap.Checked;
|
|
85
85
|
const size = pxCheck(iconSize);
|
|
86
86
|
return h(iconNode, {
|
|
87
87
|
width: size,
|
|
@@ -134,10 +134,10 @@ const component = (componentName2, components) => {
|
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
onMounted(() => {
|
|
137
|
-
hasParent.value && parent
|
|
137
|
+
hasParent.value && parent.link(getCurrentInstance());
|
|
138
138
|
});
|
|
139
139
|
onBeforeUnmount(() => {
|
|
140
|
-
hasParent.value && parent
|
|
140
|
+
hasParent.value && parent.unlink(getCurrentInstance());
|
|
141
141
|
});
|
|
142
142
|
watch(
|
|
143
143
|
() => props.indeterminate,
|
|
@@ -23,31 +23,19 @@ const _sfc_main = create({
|
|
|
23
23
|
const state = reactive({
|
|
24
24
|
children: []
|
|
25
25
|
});
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} else {
|
|
32
|
-
let key_1 = state.children.indexOf(child.proxy);
|
|
33
|
-
if (key_1 > -1) {
|
|
34
|
-
state.children.splice(key_1, 1);
|
|
35
|
-
}
|
|
36
|
-
let key_2 = props.modelValue.indexOf((_a = child.proxy) == null ? void 0 : _a.label);
|
|
37
|
-
if (key_2 > -1) {
|
|
38
|
-
const value = props.modelValue.filter((_, index) => index !== key_2);
|
|
39
|
-
emit("update:modelValue", value);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
26
|
+
const link = (child) => {
|
|
27
|
+
child.proxy && state.children.push(child.proxy);
|
|
28
|
+
};
|
|
29
|
+
const unlink = (child) => {
|
|
30
|
+
child.proxy && (state.children = state.children.filter((p) => p !== child.proxy));
|
|
43
31
|
};
|
|
44
32
|
const updateValue = (value) => {
|
|
45
33
|
emit("update:modelValue", value);
|
|
46
34
|
emit("change", value);
|
|
47
35
|
};
|
|
48
36
|
const toggleAll = (checked) => {
|
|
49
|
-
|
|
50
|
-
if (
|
|
37
|
+
const values = [];
|
|
38
|
+
if (checked) {
|
|
51
39
|
state.children.forEach((item) => {
|
|
52
40
|
if (!(item == null ? void 0 : item.disabled)) {
|
|
53
41
|
values.push(item == null ? void 0 : item.label);
|
|
@@ -57,25 +45,22 @@ const _sfc_main = create({
|
|
|
57
45
|
emit("update:modelValue", values);
|
|
58
46
|
};
|
|
59
47
|
const toggleReverse = () => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (findIndex > -1) {
|
|
64
|
-
values.splice(findIndex, 1);
|
|
48
|
+
const value = state.children.filter((item) => {
|
|
49
|
+
if (item == null ? void 0 : item.disabled) {
|
|
50
|
+
return false;
|
|
65
51
|
} else {
|
|
66
|
-
|
|
67
|
-
values.push(item == null ? void 0 : item.label);
|
|
68
|
-
}
|
|
52
|
+
return !props.modelValue.includes(item.label);
|
|
69
53
|
}
|
|
70
|
-
});
|
|
71
|
-
emit("update:modelValue",
|
|
54
|
+
}).map((item) => item.label);
|
|
55
|
+
emit("update:modelValue", value);
|
|
72
56
|
};
|
|
73
57
|
provide("parent", {
|
|
74
58
|
value: computed(() => props.modelValue),
|
|
75
59
|
disabled: computed(() => props.disabled),
|
|
76
60
|
max: computed(() => props.max),
|
|
77
61
|
updateValue,
|
|
78
|
-
|
|
62
|
+
link,
|
|
63
|
+
unlink
|
|
79
64
|
});
|
|
80
65
|
watch(
|
|
81
66
|
() => props.modelValue,
|