@v-c/tree 1.1.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/dist/Tree.js +11 -4
  2. package/package.json +8 -3
package/dist/Tree.js CHANGED
@@ -82,7 +82,12 @@ var Tree = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) =>
82
82
  return keys;
83
83
  };
84
84
  const expandedKeys = shallowRef(getInitExpandedKeys());
85
+ /**
86
+ * Set the uncontrolled `expandedKeys`. Guarded centrally so a controlled
87
+ * `expandedKeys` is never clobbered — the watcher below owns it in that case.
88
+ */
85
89
  const setExpandedKeys = (keys) => {
90
+ if (props.expandedKeys !== void 0) return;
86
91
  expandedKeys.value = keys;
87
92
  };
88
93
  watch(() => props.expandedKeys, () => {
@@ -121,7 +126,8 @@ var Tree = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) =>
121
126
  };
122
127
  watch(() => props.checkedKeys, () => {
123
128
  if (props.checkedKeys === void 0) return;
124
- rawCheckedKeys.value = parseCheckedKeys(props.checkedKeys)?.checkedKeys || [];
129
+ const parsed = parseCheckedKeys(props.checkedKeys);
130
+ rawCheckedKeys.value = parsed?.checkedKeys || [];
125
131
  });
126
132
  const rawHalfCheckedKeys = shallowRef(defaultCheckedKeyEntity.halfCheckedKeys);
127
133
  const setRawHalfCheckedKeys = (keys) => {
@@ -129,7 +135,8 @@ var Tree = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) =>
129
135
  };
130
136
  watch(() => props.checkedKeys, () => {
131
137
  if (props.checkedKeys === void 0) return;
132
- rawHalfCheckedKeys.value = parseCheckedKeys(props.checkedKeys)?.halfCheckedKeys || [];
138
+ const parsed = parseCheckedKeys(props.checkedKeys);
139
+ rawHalfCheckedKeys.value = parsed?.halfCheckedKeys || [];
133
140
  });
134
141
  const mergedChecked = computed(() => {
135
142
  if (!mergedCheckable.value) return {
@@ -473,7 +480,7 @@ var Tree = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) =>
473
480
  let newExpandedKeys = [...expandedKeys.value];
474
481
  const entity = getEntity(keyEntities.value, nodeProps.eventKey);
475
482
  if (entity && (entity.children || []).length) newExpandedKeys = arrAdd(expandedKeys.value, nodeProps.eventKey);
476
- if (props.expandedKeys === void 0) setExpandedKeys(newExpandedKeys);
483
+ setExpandedKeys(newExpandedKeys);
477
484
  props.onExpand?.(newExpandedKeys, {
478
485
  node: convertNodePropsToEventData(nodeProps),
479
486
  expanded: true,
@@ -753,7 +760,7 @@ var Tree = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) =>
753
760
  }, getTreeNodeRequiredProps.value, domProps), null)]);
754
761
  };
755
762
  }, {
756
- props: /* @__PURE__ */ mergeDefaults({
763
+ props: /*@__PURE__*/ mergeDefaults({
757
764
  prefixCls: {
758
765
  type: String,
759
766
  required: false,
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@v-c/tree",
3
3
  "type": "module",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "author": "",
10
10
  "license": "MIT",
11
+ "homepage": "https://github.com/antdv-next/vue-components/tree/next/packages/tree",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/antdv-next/vue-components.git"
15
+ },
11
16
  "keywords": [
12
17
  "trigger"
13
18
  ],
@@ -29,8 +34,8 @@
29
34
  "vue": "^3.0.0"
30
35
  },
31
36
  "dependencies": {
32
- "@v-c/util": "^1.0.19",
33
- "@v-c/virtual-list": "^1.0.9"
37
+ "@v-c/util": "^1.1.0",
38
+ "@v-c/virtual-list": "^1.1.0"
34
39
  },
35
40
  "scripts": {
36
41
  "build": "vite build",