@v-c/cascader 1.0.0 → 1.0.1
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/List.d.ts +1 -0
- package/dist/OptionList/List.js +15 -6
- package/dist/OptionList/index.js +6 -3
- package/package.json +5 -5
- package/dist/Cascader.cjs +0 -647
- package/dist/OptionList/CacheContent.cjs +0 -38
- package/dist/OptionList/CacheContent.d.ts +0 -7
- package/dist/OptionList/CacheContent.js +0 -32
- package/dist/OptionList/Checkbox.cjs +0 -75
- package/dist/OptionList/Column.cjs +0 -224
- package/dist/OptionList/List.cjs +0 -195
- package/dist/OptionList/index.cjs +0 -24
- package/dist/OptionList/useActive.cjs +0 -19
- package/dist/OptionList/useKeyboard.cjs +0 -108
- package/dist/Panel.cjs +0 -209
- package/dist/_virtual/rolldown_runtime.cjs +0 -21
- package/dist/context.cjs +0 -12
- package/dist/hooks/useDisplayValues.cjs +0 -39
- package/dist/hooks/useEntities.cjs +0 -41
- package/dist/hooks/useMissingValues.cjs +0 -17
- package/dist/hooks/useOptions.cjs +0 -25
- package/dist/hooks/useSearchConfig.cjs +0 -34
- package/dist/hooks/useSearchOptions.cjs +0 -46
- package/dist/hooks/useSelect.cjs +0 -36
- package/dist/hooks/useValues.cjs +0 -25
- package/dist/index.cjs +0 -16
- package/dist/utils/commonUtil.cjs +0 -56
- package/dist/utils/treeUtil.cjs +0 -34
- package/dist/utils/warningPropsUtil.cjs +0 -19
|
@@ -7,6 +7,7 @@ export interface RawOptionListProps {
|
|
|
7
7
|
direction?: 'ltr' | 'rtl';
|
|
8
8
|
open?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
lockOptions?: boolean;
|
|
10
11
|
}
|
|
11
12
|
declare const RawOptionList: import('vue').DefineSetupFnComponent<RawOptionListProps, {}, {}, RawOptionListProps & {}, import('vue').PublicProps>;
|
|
12
13
|
export default RawOptionList;
|
package/dist/OptionList/List.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useCascaderContext } from "../context.js";
|
|
2
2
|
import { getFullPathKeys, isLeaf, scrollIntoParentView, toPathKey, toPathKeys, toPathValueStr } from "../utils/commonUtil.js";
|
|
3
3
|
import { toPathOptions } from "../utils/treeUtil.js";
|
|
4
|
-
import CacheContent_default from "./CacheContent.js";
|
|
5
4
|
import Column_default, { FIX_LABEL } from "./Column.js";
|
|
6
5
|
import useActive_default from "./useActive.js";
|
|
7
6
|
import useKeyboard from "./useKeyboard.js";
|
|
8
|
-
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, nextTick, ref, watch, watchEffect } from "vue";
|
|
7
|
+
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, nextTick, ref, shallowRef, watch, watchEffect } from "vue";
|
|
9
8
|
import { clsx } from "@v-c/util";
|
|
10
9
|
var List_default = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
11
10
|
const containerRef = ref(null);
|
|
@@ -57,10 +56,14 @@ var List_default = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
57
56
|
context.value?.onSelect(valuePath);
|
|
58
57
|
if (!props.multiple && (leaf || context.value?.changeOnSelect && (context.value?.expandTrigger === "hover" || fromKeyboard))) props.toggleOpen(false);
|
|
59
58
|
};
|
|
60
|
-
const
|
|
59
|
+
const filteredOptions = computed(() => {
|
|
61
60
|
if (props.searchValue) return context.value?.searchOptions || [];
|
|
62
61
|
return context.value?.options || [];
|
|
63
62
|
});
|
|
63
|
+
const mergedOptions = shallowRef(filteredOptions.value);
|
|
64
|
+
watch([() => props.open, () => props.lockOptions], () => {
|
|
65
|
+
mergedOptions.value = filteredOptions.value;
|
|
66
|
+
});
|
|
64
67
|
const optionColumns = computed(() => {
|
|
65
68
|
const fieldNames = mergedFieldNames.value;
|
|
66
69
|
if (!fieldNames) return [];
|
|
@@ -125,13 +128,13 @@ var List_default = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
125
128
|
"activeValue": activeValue
|
|
126
129
|
}), null);
|
|
127
130
|
});
|
|
128
|
-
return createVNode(
|
|
131
|
+
return createVNode("div", {
|
|
129
132
|
"class": clsx(`${mergedPrefixCls.value}-menus`, {
|
|
130
133
|
[`${mergedPrefixCls.value}-menu-empty`]: isEmpty,
|
|
131
134
|
[`${mergedPrefixCls.value}-rtl`]: rtl.value
|
|
132
135
|
}),
|
|
133
136
|
"ref": containerRef
|
|
134
|
-
}, [columnNodes])
|
|
137
|
+
}, [columnNodes]);
|
|
135
138
|
};
|
|
136
139
|
}, {
|
|
137
140
|
props: /* @__PURE__ */ mergeDefaults({
|
|
@@ -173,6 +176,11 @@ var List_default = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
173
176
|
type: Boolean,
|
|
174
177
|
required: false,
|
|
175
178
|
default: void 0
|
|
179
|
+
},
|
|
180
|
+
lockOptions: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
required: false,
|
|
183
|
+
default: void 0
|
|
176
184
|
}
|
|
177
185
|
}, {
|
|
178
186
|
prefixCls: "",
|
|
@@ -181,7 +189,8 @@ var List_default = /* @__PURE__ */ defineComponent((props, { expose }) => {
|
|
|
181
189
|
toggleOpen: () => {},
|
|
182
190
|
open: false,
|
|
183
191
|
direction: "ltr",
|
|
184
|
-
disabled: false
|
|
192
|
+
disabled: false,
|
|
193
|
+
lockOptions: false
|
|
185
194
|
}),
|
|
186
195
|
name: "RawOptionList",
|
|
187
196
|
inheritAttrs: false
|
package/dist/OptionList/index.js
CHANGED
|
@@ -8,9 +8,12 @@ var OptionList_default = /* @__PURE__ */ defineComponent((_, { expose }) => {
|
|
|
8
8
|
onKeyDown: (event) => listRef.value?.onKeyDown(event),
|
|
9
9
|
onKeyUp: (event) => listRef.value?.onKeyUp(event)
|
|
10
10
|
});
|
|
11
|
-
return () => createVNode(List_default, mergeProps(baseProps.value || {}, {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
return () => createVNode(List_default, mergeProps(baseProps.value || {}, {
|
|
12
|
+
"lockOptions": baseProps.value?.lockOptions,
|
|
13
|
+
"ref": (el) => {
|
|
14
|
+
listRef.value = el;
|
|
15
|
+
}
|
|
16
|
+
}), null);
|
|
14
17
|
}, {
|
|
15
18
|
name: "OptionList",
|
|
16
19
|
inheritAttrs: false
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/cascader",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
|
-
"
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./dist/*": "./dist/*",
|
|
16
16
|
"./package.json": "./package.json"
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"vue": "^3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@v-c/select": "^1.0.
|
|
28
|
-
"@v-c/tree": "^1.0.
|
|
29
|
-
"@v-c/util": "^1.0.
|
|
27
|
+
"@v-c/select": "^1.0.10",
|
|
28
|
+
"@v-c/tree": "^1.0.3",
|
|
29
|
+
"@v-c/util": "^1.0.14"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "vite build",
|