tanxin-ui 0.8.3 → 0.8.4
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/tanxin-ui.es.js +7 -4
- package/dist/tanxin-ui.umd.js +5 -5
- package/es/tree/index.d.ts +18 -0
- package/es/tree/src/context.d.ts +5 -0
- package/es/tree/src/context.js +1 -0
- package/es/tree/src/tree.d.ts +17 -2
- package/es/tree/src/tree.js +6 -4
- package/lib/tree/index.d.ts +18 -0
- package/lib/tree/src/context.d.ts +5 -0
- package/lib/tree/src/context.js +1 -0
- package/lib/tree/src/tree.d.ts +17 -2
- package/lib/tree/src/tree.js +6 -4
- package/package.json +1 -1
package/dist/tanxin-ui.es.js
CHANGED
|
@@ -19108,6 +19108,7 @@ const treeProps = {
|
|
|
19108
19108
|
expandOnClick: PropTypes.bool.def(true),
|
|
19109
19109
|
checkOnClick: PropTypes.bool.def(false),
|
|
19110
19110
|
checkRelated: PropTypes.bool.def(true),
|
|
19111
|
+
checkRelatedOnlySon: PropTypes.bool.def(false),
|
|
19111
19112
|
single: PropTypes.bool.def(false),
|
|
19112
19113
|
onlyLeaf: PropTypes.bool.def(false),
|
|
19113
19114
|
loadMethod: {
|
|
@@ -19307,9 +19308,11 @@ var Tree = defineComponent({
|
|
|
19307
19308
|
const checkedChange = (item, checked) => {
|
|
19308
19309
|
if (props.checkRelated && !props.single) {
|
|
19309
19310
|
setSonChecked(item, checked);
|
|
19310
|
-
|
|
19311
|
-
|
|
19312
|
-
|
|
19311
|
+
if (props.checkRelatedOnlySon) {
|
|
19312
|
+
const fatherKeyPath = cloneDeep(item.keyPath);
|
|
19313
|
+
fatherKeyPath.pop();
|
|
19314
|
+
setFatherChecked(nodeList.value, fatherKeyPath);
|
|
19315
|
+
}
|
|
19313
19316
|
}
|
|
19314
19317
|
if (props.single) {
|
|
19315
19318
|
checkedValues.value = [singleValue.value];
|
|
@@ -19318,7 +19321,7 @@ var Tree = defineComponent({
|
|
|
19318
19321
|
emit("nodeChecked", item, checkedValues.value);
|
|
19319
19322
|
};
|
|
19320
19323
|
const setFatherChecked = (nodeList2, fatherKeyPath) => {
|
|
19321
|
-
if (!props.checkRelated || props.single)
|
|
19324
|
+
if (!props.checkRelated || props.single || props.checkRelatedOnlySon)
|
|
19322
19325
|
return;
|
|
19323
19326
|
const index2 = nodeList2.findIndex((son) => fatherKeyPath.includes(son[props.valueKey]));
|
|
19324
19327
|
if (index2 >= 0) {
|