@xn-lib/component 0.0.19 → 0.0.20
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/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +256 -8
- package/dist/index.iife.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
- package/dist/types/cascader/CascaderMenu.vue.d.ts +0 -45
- package/dist/types/cascader/CascaderOption.vue.d.ts +0 -20
- package/dist/types/cascader/CascaderSelectMenu.vue.d.ts +0 -38
- package/dist/types/cascader/index.d.ts +0 -6
- package/dist/types/cascader/index.vue.d.ts +0 -90
- package/dist/types/cascader/props.d.ts +0 -119
- package/dist/types/cascader/types.d.ts +0 -69
- package/dist/types/cascader/utils.d.ts +0 -53
- package/dist/types/index.d.ts +0 -9
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import type { CascaderOption, CascaderValue, ExpandTrigger, CheckStrategy, Filter, OnLoad } from './types';
|
|
3
|
-
export declare const cascaderProps: {
|
|
4
|
-
readonly modelValue: {
|
|
5
|
-
readonly type: PropType<CascaderValue | null>;
|
|
6
|
-
readonly default: null;
|
|
7
|
-
};
|
|
8
|
-
readonly options: {
|
|
9
|
-
readonly type: PropType<CascaderOption[]>;
|
|
10
|
-
readonly default: () => never[];
|
|
11
|
-
};
|
|
12
|
-
readonly placeholder: {
|
|
13
|
-
readonly type: StringConstructor;
|
|
14
|
-
readonly default: "请选择";
|
|
15
|
-
};
|
|
16
|
-
readonly disabled: {
|
|
17
|
-
readonly type: BooleanConstructor;
|
|
18
|
-
readonly default: false;
|
|
19
|
-
};
|
|
20
|
-
readonly clearable: {
|
|
21
|
-
readonly type: BooleanConstructor;
|
|
22
|
-
readonly default: false;
|
|
23
|
-
};
|
|
24
|
-
readonly filterable: {
|
|
25
|
-
readonly type: BooleanConstructor;
|
|
26
|
-
readonly default: false;
|
|
27
|
-
};
|
|
28
|
-
readonly multiple: {
|
|
29
|
-
readonly type: BooleanConstructor;
|
|
30
|
-
readonly default: false;
|
|
31
|
-
};
|
|
32
|
-
readonly size: {
|
|
33
|
-
readonly type: PropType<"large" | "default" | "small">;
|
|
34
|
-
readonly default: "default";
|
|
35
|
-
};
|
|
36
|
-
readonly expandTrigger: {
|
|
37
|
-
readonly type: PropType<ExpandTrigger>;
|
|
38
|
-
readonly default: "click";
|
|
39
|
-
};
|
|
40
|
-
readonly separator: {
|
|
41
|
-
readonly type: StringConstructor;
|
|
42
|
-
readonly default: " / ";
|
|
43
|
-
};
|
|
44
|
-
readonly showPath: {
|
|
45
|
-
readonly type: BooleanConstructor;
|
|
46
|
-
readonly default: true;
|
|
47
|
-
};
|
|
48
|
-
readonly cascade: {
|
|
49
|
-
readonly type: BooleanConstructor;
|
|
50
|
-
readonly default: true;
|
|
51
|
-
};
|
|
52
|
-
readonly checkStrategy: {
|
|
53
|
-
readonly type: PropType<CheckStrategy>;
|
|
54
|
-
readonly default: "all";
|
|
55
|
-
};
|
|
56
|
-
readonly remote: {
|
|
57
|
-
readonly type: BooleanConstructor;
|
|
58
|
-
readonly default: false;
|
|
59
|
-
};
|
|
60
|
-
readonly onLoad: {
|
|
61
|
-
readonly type: PropType<OnLoad>;
|
|
62
|
-
readonly default: undefined;
|
|
63
|
-
};
|
|
64
|
-
readonly filter: {
|
|
65
|
-
readonly type: PropType<Filter>;
|
|
66
|
-
readonly default: undefined;
|
|
67
|
-
};
|
|
68
|
-
readonly valueField: {
|
|
69
|
-
readonly type: StringConstructor;
|
|
70
|
-
readonly default: "value";
|
|
71
|
-
};
|
|
72
|
-
readonly labelField: {
|
|
73
|
-
readonly type: StringConstructor;
|
|
74
|
-
readonly default: "label";
|
|
75
|
-
};
|
|
76
|
-
readonly childrenField: {
|
|
77
|
-
readonly type: StringConstructor;
|
|
78
|
-
readonly default: "children";
|
|
79
|
-
};
|
|
80
|
-
readonly disabledField: {
|
|
81
|
-
readonly type: StringConstructor;
|
|
82
|
-
readonly default: "disabled";
|
|
83
|
-
};
|
|
84
|
-
readonly maxTagCount: {
|
|
85
|
-
readonly type: NumberConstructor;
|
|
86
|
-
readonly default: 1;
|
|
87
|
-
};
|
|
88
|
-
readonly popperClass: {
|
|
89
|
-
readonly type: StringConstructor;
|
|
90
|
-
readonly default: "";
|
|
91
|
-
};
|
|
92
|
-
readonly getColumnStyle: {
|
|
93
|
-
readonly type: PropType<(detail: {
|
|
94
|
-
level: number;
|
|
95
|
-
}) => string | Record<string, any>>;
|
|
96
|
-
readonly default: undefined;
|
|
97
|
-
};
|
|
98
|
-
readonly clearFilterAfterSelect: {
|
|
99
|
-
readonly type: BooleanConstructor;
|
|
100
|
-
readonly default: true;
|
|
101
|
-
};
|
|
102
|
-
readonly virtualScroll: {
|
|
103
|
-
readonly type: BooleanConstructor;
|
|
104
|
-
readonly default: true;
|
|
105
|
-
};
|
|
106
|
-
readonly optionHeight: {
|
|
107
|
-
readonly type: NumberConstructor;
|
|
108
|
-
readonly default: 34;
|
|
109
|
-
};
|
|
110
|
-
readonly showCheckbox: {
|
|
111
|
-
readonly type: BooleanConstructor;
|
|
112
|
-
readonly default: undefined;
|
|
113
|
-
};
|
|
114
|
-
readonly emitPath: {
|
|
115
|
-
readonly type: BooleanConstructor;
|
|
116
|
-
readonly default: false;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
export type CascaderProps = ExtractPropTypes<typeof cascaderProps>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export type ValueAtom = string | number;
|
|
2
|
-
export type CascaderValue = ValueAtom | ValueAtom[] | ValueAtom[][];
|
|
3
|
-
export type Key = ValueAtom;
|
|
4
|
-
export interface CascaderOption {
|
|
5
|
-
label?: string;
|
|
6
|
-
value?: ValueAtom;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
children?: CascaderOption[];
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
export type ExpandTrigger = 'hover' | 'click';
|
|
12
|
-
export type CheckStrategy = 'all' | 'parent' | 'child';
|
|
13
|
-
export type Filter = (pattern: string, option: CascaderOption, path: CascaderOption[]) => boolean;
|
|
14
|
-
export type OnLoad = (option: CascaderOption) => Promise<void>;
|
|
15
|
-
export type OnUpdateValue = (value: CascaderValue | null, option: CascaderOption | null | Array<CascaderOption | null>, path: Array<CascaderOption[] | null> | CascaderOption[] | null) => void;
|
|
16
|
-
export interface TreeNode {
|
|
17
|
-
key: Key;
|
|
18
|
-
rawNode: CascaderOption;
|
|
19
|
-
level: number;
|
|
20
|
-
index: number;
|
|
21
|
-
isLeaf: boolean;
|
|
22
|
-
isGroup: boolean;
|
|
23
|
-
ignored: boolean;
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
shallowLoaded: boolean;
|
|
26
|
-
parent: TreeNode | null;
|
|
27
|
-
children?: TreeNode[];
|
|
28
|
-
siblings: TreeNode[];
|
|
29
|
-
}
|
|
30
|
-
export interface CascaderInst {
|
|
31
|
-
focus: () => void;
|
|
32
|
-
blur: () => void;
|
|
33
|
-
getCheckedData: () => {
|
|
34
|
-
keys: Key[];
|
|
35
|
-
options: Array<CascaderOption | null>;
|
|
36
|
-
};
|
|
37
|
-
getIndeterminateData: () => {
|
|
38
|
-
keys: Key[];
|
|
39
|
-
options: Array<CascaderOption | null>;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export interface CascaderContext {
|
|
43
|
-
mergedValue: CascaderValue | null;
|
|
44
|
-
checkedKeys: Key[];
|
|
45
|
-
indeterminateKeys: Key[];
|
|
46
|
-
hoverKeyPath: Key[];
|
|
47
|
-
keyboardKey: Key | null;
|
|
48
|
-
hoverKey: Key | null;
|
|
49
|
-
loadingKeySet: Set<Key>;
|
|
50
|
-
multiple: boolean;
|
|
51
|
-
cascade: boolean;
|
|
52
|
-
checkStrategy: CheckStrategy;
|
|
53
|
-
expandTrigger: ExpandTrigger;
|
|
54
|
-
remote: boolean;
|
|
55
|
-
showCheckbox: boolean;
|
|
56
|
-
labelField: string;
|
|
57
|
-
valueField: string;
|
|
58
|
-
childrenField: string;
|
|
59
|
-
disabledField: string;
|
|
60
|
-
onLoad?: OnLoad;
|
|
61
|
-
updateHoverKey: (key: Key | null) => void;
|
|
62
|
-
updateKeyboardKey: (key: Key | null) => void;
|
|
63
|
-
addLoadingKey: (key: Key) => void;
|
|
64
|
-
deleteLoadingKey: (key: Key) => void;
|
|
65
|
-
doCheck: (key: Key) => boolean;
|
|
66
|
-
doUncheck: (key: Key) => void;
|
|
67
|
-
closeMenu: (returnFocus?: boolean) => void;
|
|
68
|
-
clearPattern: () => void;
|
|
69
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { CascaderOption, TreeNode, Key, CheckStrategy } from './types';
|
|
2
|
-
export declare function createTreeMate(options: CascaderOption[], config: {
|
|
3
|
-
getKey: (node: CascaderOption) => Key;
|
|
4
|
-
getChildren: (node: CascaderOption) => CascaderOption[] | undefined;
|
|
5
|
-
getDisabled: (node: CascaderOption) => boolean;
|
|
6
|
-
}): {
|
|
7
|
-
treeNodes: TreeNode[];
|
|
8
|
-
getNode: (key: Key) => TreeNode | null;
|
|
9
|
-
getPath: (key: Key | null) => {
|
|
10
|
-
treeNodePath: TreeNode[];
|
|
11
|
-
keyPath: Key[];
|
|
12
|
-
treeNode: TreeNode | null;
|
|
13
|
-
};
|
|
14
|
-
getCheckedKeys: (keys: Key[], options: {
|
|
15
|
-
cascade: boolean;
|
|
16
|
-
checkStrategy: CheckStrategy;
|
|
17
|
-
allowNotLoaded?: boolean;
|
|
18
|
-
}) => {
|
|
19
|
-
checkedKeys: Key[];
|
|
20
|
-
indeterminateKeys: Key[];
|
|
21
|
-
};
|
|
22
|
-
check: (key: Key, checkedKeys: Key[], options: {
|
|
23
|
-
cascade: boolean;
|
|
24
|
-
checkStrategy: CheckStrategy;
|
|
25
|
-
allowNotLoaded?: boolean;
|
|
26
|
-
}) => {
|
|
27
|
-
checkedKeys: Key[];
|
|
28
|
-
};
|
|
29
|
-
uncheck: (key: Key, checkedKeys: Key[], options: {
|
|
30
|
-
cascade: boolean;
|
|
31
|
-
checkStrategy: CheckStrategy;
|
|
32
|
-
allowNotLoaded?: boolean;
|
|
33
|
-
}) => {
|
|
34
|
-
checkedKeys: Key[];
|
|
35
|
-
};
|
|
36
|
-
getPrev: (key: Key, options: {
|
|
37
|
-
loop: boolean;
|
|
38
|
-
}) => TreeNode | null;
|
|
39
|
-
getNext: (key: Key, options: {
|
|
40
|
-
loop: boolean;
|
|
41
|
-
}) => TreeNode | null;
|
|
42
|
-
getChild: (key: Key) => TreeNode | null;
|
|
43
|
-
getParent: (key: Key) => TreeNode | null;
|
|
44
|
-
getFirstAvailableNode: () => TreeNode | null;
|
|
45
|
-
};
|
|
46
|
-
export declare function getRawNodePath(tmNodes: TreeNode[] | undefined): CascaderOption[] | null;
|
|
47
|
-
export declare function getPathLabel(node: TreeNode | null, separator: string, labelField: string): string;
|
|
48
|
-
export declare function createSelectOptions(tmNodes: TreeNode[], checkStrategyIsChild: boolean, labelField: string, separator: string): Array<{
|
|
49
|
-
label: string;
|
|
50
|
-
value: Key;
|
|
51
|
-
rawNode: CascaderOption;
|
|
52
|
-
path: CascaderOption[];
|
|
53
|
-
}>;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'vue';
|
|
2
|
-
import type { Component } from 'vue';
|
|
3
|
-
import XnCascader from './cascader/index';
|
|
4
|
-
export { XnCascader };
|
|
5
|
-
export declare const components: Record<string, Component>;
|
|
6
|
-
export type { CascaderProps } from './cascader/props';
|
|
7
|
-
export type { CascaderOption, CascaderValue, CascaderInst, ExpandTrigger, CheckStrategy, Filter, OnLoad, ValueAtom, Key, TreeNode, OnUpdateValue } from './cascader/types';
|
|
8
|
-
declare const plugin: Plugin;
|
|
9
|
-
export default plugin;
|