@v-c/tree-select 1.0.2 → 1.0.3
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/OptionList.js +5 -3
- package/package.json +4 -4
package/dist/OptionList.js
CHANGED
|
@@ -112,15 +112,17 @@ var OptionList_default = /* @__PURE__ */ defineComponent({
|
|
|
112
112
|
};
|
|
113
113
|
const activeKey = ref(null);
|
|
114
114
|
const activeEntity = computed(() => legacyContext.value?.keyEntities?.[String(activeKey.value)]);
|
|
115
|
-
watch(() =>
|
|
115
|
+
watch([() => baseProps.value?.open, () => baseProps.value?.searchValue], ([open]) => {
|
|
116
116
|
if (!open) return;
|
|
117
117
|
const fieldNames = context.value?.fieldNames;
|
|
118
118
|
const getFirstNode = () => {
|
|
119
119
|
const firstNode = getFirstMatchingNode(memoTreeData.value);
|
|
120
120
|
return firstNode ? firstNode[fieldNames?.value] : null;
|
|
121
121
|
};
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
let nextActiveKey = null;
|
|
123
|
+
if (!baseProps.value?.multiple && legacyContext.value?.checkedKeys?.length && !baseProps.value?.searchValue) nextActiveKey = legacyContext.value.checkedKeys[0];
|
|
124
|
+
else nextActiveKey = getFirstNode();
|
|
125
|
+
activeKey.value = nextActiveKey;
|
|
124
126
|
}, { immediate: true });
|
|
125
127
|
const onKeyDown = (event) => {
|
|
126
128
|
switch (event.which || event.keyCode) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/tree-select",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"vue": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@v-c/select": "^1.0.
|
|
33
|
-
"@v-c/
|
|
34
|
-
"@v-c/
|
|
32
|
+
"@v-c/select": "^1.0.19",
|
|
33
|
+
"@v-c/util": "^1.0.18",
|
|
34
|
+
"@v-c/tree": "^1.0.5"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vite build",
|