@v-c/tree-select 0.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/LICENSE +21 -0
- package/dist/LegacyContext.cjs +12 -0
- package/dist/LegacyContext.d.ts +25 -0
- package/dist/LegacyContext.js +9 -0
- package/dist/OptionList.cjs +230 -0
- package/dist/OptionList.d.ts +2 -0
- package/dist/OptionList.js +223 -0
- package/dist/TreeNode.cjs +11 -0
- package/dist/TreeNode.d.ts +7 -0
- package/dist/TreeNode.js +5 -0
- package/dist/TreeSelect.cjs +953 -0
- package/dist/TreeSelect.d.ts +76 -0
- package/dist/TreeSelect.js +947 -0
- package/dist/TreeSelectContext.cjs +12 -0
- package/dist/TreeSelectContext.d.ts +28 -0
- package/dist/TreeSelectContext.js +9 -0
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/hooks/useCache.cjs +25 -0
- package/dist/hooks/useCache.d.ts +6 -0
- package/dist/hooks/useCache.js +20 -0
- package/dist/hooks/useCheckedKeys.cjs +25 -0
- package/dist/hooks/useCheckedKeys.d.ts +4 -0
- package/dist/hooks/useCheckedKeys.js +20 -0
- package/dist/hooks/useDataEntities.cjs +40 -0
- package/dist/hooks/useDataEntities.d.ts +7 -0
- package/dist/hooks/useDataEntities.js +35 -0
- package/dist/hooks/useFilterTreeData.cjs +28 -0
- package/dist/hooks/useFilterTreeData.d.ts +8 -0
- package/dist/hooks/useFilterTreeData.js +23 -0
- package/dist/hooks/useRefFunc.cjs +15 -0
- package/dist/hooks/useRefFunc.d.ts +5 -0
- package/dist/hooks/useRefFunc.js +10 -0
- package/dist/hooks/useSearchConfig.cjs +23 -0
- package/dist/hooks/useSearchConfig.d.ts +6 -0
- package/dist/hooks/useSearchConfig.js +18 -0
- package/dist/hooks/useTreeData.cjs +43 -0
- package/dist/hooks/useTreeData.d.ts +6 -0
- package/dist/hooks/useTreeData.js +38 -0
- package/dist/index.cjs +18 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +10 -0
- package/dist/interface.cjs +1 -0
- package/dist/interface.d.ts +57 -0
- package/dist/interface.js +0 -0
- package/dist/utils/legacyUtil.cjs +85 -0
- package/dist/utils/legacyUtil.d.ts +5 -0
- package/dist/utils/legacyUtil.js +80 -0
- package/dist/utils/strategyUtil.cjs +22 -0
- package/dist/utils/strategyUtil.d.ts +7 -0
- package/dist/utils/strategyUtil.js +18 -0
- package/dist/utils/valueUtil.cjs +36 -0
- package/dist/utils/valueUtil.d.ts +11 -0
- package/dist/utils/valueUtil.js +31 -0
- package/dist/utils/warningPropsUtil.cjs +18 -0
- package/dist/utils/warningPropsUtil.d.ts +4 -0
- package/dist/utils/warningPropsUtil.js +12 -0
- package/package.json +43 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { BaseSelectPropsWithoutPrivate, BaseSelectSemanticName } from '@v-c/select';
|
|
2
|
+
import { ExpandAction, IconType } from '@v-c/tree';
|
|
3
|
+
import { VueNode } from '@v-c/util';
|
|
4
|
+
import { CSSProperties } from 'vue';
|
|
5
|
+
import { DataNode, FieldNames, SafeKey, SimpleModeConfig } from './interface';
|
|
6
|
+
import { CheckedStrategy } from './utils/strategyUtil';
|
|
7
|
+
export type SemanticName = BaseSelectSemanticName;
|
|
8
|
+
export type PopupSemantic = 'item' | 'itemTitle';
|
|
9
|
+
export interface SearchConfig {
|
|
10
|
+
searchValue?: string;
|
|
11
|
+
onSearch?: (value: string) => void;
|
|
12
|
+
autoClearSearchValue?: boolean;
|
|
13
|
+
filterTreeNode?: boolean | ((inputValue: string, treeNode: DataNode) => boolean);
|
|
14
|
+
treeNodeFilterProp?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TreeSelectProps<ValueType = any, OptionType extends DataNode = DataNode> extends Omit<BaseSelectPropsWithoutPrivate, 'mode' | 'classNames' | 'styles' | 'showSearch'> {
|
|
17
|
+
prefixCls?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
classNames?: Partial<Record<SemanticName, string>> & {
|
|
20
|
+
popup?: Partial<Record<PopupSemantic, string>>;
|
|
21
|
+
};
|
|
22
|
+
styles?: Partial<Record<SemanticName, CSSProperties>> & {
|
|
23
|
+
popup?: Partial<Record<PopupSemantic, CSSProperties>>;
|
|
24
|
+
};
|
|
25
|
+
value?: ValueType;
|
|
26
|
+
defaultValue?: ValueType;
|
|
27
|
+
onChange?: (value: ValueType, labelList: VueNode[] | null, extra: any) => void;
|
|
28
|
+
showSearch?: boolean | SearchConfig;
|
|
29
|
+
/** @deprecated Use `showSearch.searchValue` instead */
|
|
30
|
+
searchValue?: string;
|
|
31
|
+
/** @deprecated Use `showSearch.searchValue` instead */
|
|
32
|
+
inputValue?: string;
|
|
33
|
+
/** @deprecated Use `showSearch.onSearch` instead */
|
|
34
|
+
onSearch?: (value: string) => void;
|
|
35
|
+
/** @deprecated Use `showSearch.autoClearSearchValue` instead */
|
|
36
|
+
autoClearSearchValue?: boolean;
|
|
37
|
+
/** @deprecated Use `showSearch.filterTreeNode` instead */
|
|
38
|
+
filterTreeNode?: boolean | ((inputValue: string, treeNode: DataNode) => boolean);
|
|
39
|
+
/** @deprecated Use `showSearch.treeNodeFilterProp` instead */
|
|
40
|
+
treeNodeFilterProp?: string;
|
|
41
|
+
onSelect?: (value: ValueType, option: OptionType) => void;
|
|
42
|
+
onDeselect?: (value: ValueType, option: OptionType) => void;
|
|
43
|
+
showCheckedStrategy?: CheckedStrategy;
|
|
44
|
+
treeNodeLabelProp?: string;
|
|
45
|
+
fieldNames?: FieldNames;
|
|
46
|
+
multiple?: boolean;
|
|
47
|
+
treeCheckable?: boolean | VueNode;
|
|
48
|
+
treeCheckStrictly?: boolean;
|
|
49
|
+
labelInValue?: boolean;
|
|
50
|
+
maxCount?: number;
|
|
51
|
+
treeData?: OptionType[];
|
|
52
|
+
treeDataSimpleMode?: boolean | SimpleModeConfig;
|
|
53
|
+
loadData?: (dataNode: any) => Promise<unknown>;
|
|
54
|
+
treeLoadedKeys?: SafeKey[];
|
|
55
|
+
onTreeLoad?: (loadedKeys: SafeKey[]) => void;
|
|
56
|
+
treeDefaultExpandAll?: boolean;
|
|
57
|
+
treeExpandedKeys?: SafeKey[];
|
|
58
|
+
treeDefaultExpandedKeys?: SafeKey[];
|
|
59
|
+
onTreeExpand?: (expandedKeys: SafeKey[]) => void;
|
|
60
|
+
treeExpandAction?: ExpandAction;
|
|
61
|
+
virtual?: boolean;
|
|
62
|
+
listHeight?: number;
|
|
63
|
+
listItemHeight?: number;
|
|
64
|
+
listItemScrollOffset?: number;
|
|
65
|
+
onPopupVisibleChange?: (open: boolean) => void;
|
|
66
|
+
treeTitleRender?: (node: OptionType) => VueNode;
|
|
67
|
+
treeLine?: boolean;
|
|
68
|
+
treeIcon?: IconType;
|
|
69
|
+
showTreeIcon?: boolean;
|
|
70
|
+
switcherIcon?: IconType;
|
|
71
|
+
treeMotion?: any;
|
|
72
|
+
onPopupScroll?: (event: Event) => void;
|
|
73
|
+
popupMatchSelectWidth?: boolean | number;
|
|
74
|
+
}
|
|
75
|
+
declare const TreeSelect: import('vue').DefineComponent<TreeSelectProps<any, DataNode>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TreeSelectProps<any, DataNode>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
76
|
+
export default TreeSelect;
|