x-next 1.14.0 → 1.16.0
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/AI_USAGE/catalog.md +4 -2
- package/AI_USAGE/components/alert-api.md +1 -1
- package/AI_USAGE/components/alert.md +1 -1
- package/AI_USAGE/components/bar-chart-api.md +1 -1
- package/AI_USAGE/components/bar-chart.md +1 -1
- package/AI_USAGE/components/boxicons.md +1 -1
- package/AI_USAGE/components/button-api.md +1 -1
- package/AI_USAGE/components/button.md +1 -1
- package/AI_USAGE/components/charts.md +1 -1
- package/AI_USAGE/components/checkbox-api.md +1 -1
- package/AI_USAGE/components/checkbox.md +1 -1
- package/AI_USAGE/components/color-picker-api.md +1 -1
- package/AI_USAGE/components/color-picker.md +1 -1
- package/AI_USAGE/components/config-provider-api.md +1 -1
- package/AI_USAGE/components/config-provider.md +1 -1
- package/AI_USAGE/components/date-picker-api.md +1 -1
- package/AI_USAGE/components/date-picker.md +1 -1
- package/AI_USAGE/components/dialog-api.md +1 -1
- package/AI_USAGE/components/dialog.md +1 -1
- package/AI_USAGE/components/draggable-api.md +1 -1
- package/AI_USAGE/components/draggable.md +1 -1
- package/AI_USAGE/components/drawer-api.md +1 -1
- package/AI_USAGE/components/drawer.md +30 -1
- package/AI_USAGE/components/dropdown-api.md +1 -1
- package/AI_USAGE/components/dropdown.md +1 -1
- package/AI_USAGE/components/empty-api.md +1 -1
- package/AI_USAGE/components/empty.md +1 -1
- package/AI_USAGE/components/finicon.md +1 -1
- package/AI_USAGE/components/form-api.md +1 -1
- package/AI_USAGE/components/form.md +1 -1
- package/AI_USAGE/components/grid-api.md +1 -1
- package/AI_USAGE/components/grid.md +1 -1
- package/AI_USAGE/components/heatmap-api.md +1 -1
- package/AI_USAGE/components/heatmap.md +1 -1
- package/AI_USAGE/components/icon-api.md +1 -1
- package/AI_USAGE/components/icon.md +1 -1
- package/AI_USAGE/components/image-api.md +1 -1
- package/AI_USAGE/components/image.md +1 -1
- package/AI_USAGE/components/input-api.md +1 -1
- package/AI_USAGE/components/input-number-api.md +1 -1
- package/AI_USAGE/components/input-number.md +1 -1
- package/AI_USAGE/components/input-tag-api.md +1 -1
- package/AI_USAGE/components/input-tag.md +1 -1
- package/AI_USAGE/components/input.md +1 -1
- package/AI_USAGE/components/layout-api.md +1 -1
- package/AI_USAGE/components/layout.md +1 -1
- package/AI_USAGE/components/line-chart-api.md +3 -3
- package/AI_USAGE/components/line-chart.md +28 -1
- package/AI_USAGE/components/link-api.md +1 -1
- package/AI_USAGE/components/link.md +1 -1
- package/AI_USAGE/components/menu-api.md +1 -1
- package/AI_USAGE/components/menu.md +1 -1
- package/AI_USAGE/components/message-api.md +1 -1
- package/AI_USAGE/components/message-box-api.md +1 -1
- package/AI_USAGE/components/message-box.md +1 -1
- package/AI_USAGE/components/message.md +1 -1
- package/AI_USAGE/components/network-api.md +1 -1
- package/AI_USAGE/components/network.md +1 -1
- package/AI_USAGE/components/notification-api.md +1 -1
- package/AI_USAGE/components/notification.md +1 -1
- package/AI_USAGE/components/pagination-api.md +1 -1
- package/AI_USAGE/components/pagination.md +1 -1
- package/AI_USAGE/components/pie-chart-api.md +1 -1
- package/AI_USAGE/components/pie-chart.md +1 -1
- package/AI_USAGE/components/popconfirm-api.md +1 -1
- package/AI_USAGE/components/popconfirm.md +1 -1
- package/AI_USAGE/components/popover-api.md +1 -1
- package/AI_USAGE/components/popover.md +1 -1
- package/AI_USAGE/components/popup-api.md +1 -1
- package/AI_USAGE/components/popup.md +1 -1
- package/AI_USAGE/components/progress-api.md +1 -1
- package/AI_USAGE/components/progress.md +1 -1
- package/AI_USAGE/components/radio-api.md +1 -1
- package/AI_USAGE/components/radio.md +1 -1
- package/AI_USAGE/components/rate-api.md +1 -1
- package/AI_USAGE/components/rate.md +1 -1
- package/AI_USAGE/components/resize-box-api.md +1 -1
- package/AI_USAGE/components/resize-box.md +1 -1
- package/AI_USAGE/components/scrollbar-api.md +1 -1
- package/AI_USAGE/components/scrollbar.md +1 -1
- package/AI_USAGE/components/select-api.md +1 -1
- package/AI_USAGE/components/select.md +1 -1
- package/AI_USAGE/components/skeleton-api.md +1 -1
- package/AI_USAGE/components/skeleton.md +1 -1
- package/AI_USAGE/components/slider-api.md +1 -1
- package/AI_USAGE/components/slider.md +1 -1
- package/AI_USAGE/components/space-api.md +1 -1
- package/AI_USAGE/components/space.md +1 -1
- package/AI_USAGE/components/spin-api.md +1 -1
- package/AI_USAGE/components/spin.md +1 -1
- package/AI_USAGE/components/steps-api.md +1 -1
- package/AI_USAGE/components/steps.md +1 -1
- package/AI_USAGE/components/switch-api.md +1 -1
- package/AI_USAGE/components/switch.md +1 -1
- package/AI_USAGE/components/table-api.md +1 -1
- package/AI_USAGE/components/table.md +44 -1
- package/AI_USAGE/components/tabs-api.md +1 -1
- package/AI_USAGE/components/tabs.md +1 -1
- package/AI_USAGE/components/tag-api.md +1 -1
- package/AI_USAGE/components/tag.md +1 -1
- package/AI_USAGE/components/textarea-api.md +1 -1
- package/AI_USAGE/components/textarea.md +1 -1
- package/AI_USAGE/components/time-picker-api.md +1 -1
- package/AI_USAGE/components/time-picker.md +1 -1
- package/AI_USAGE/components/time-range-selector-api.md +1 -1
- package/AI_USAGE/components/time-range-selector.md +1 -1
- package/AI_USAGE/components/timeline-api.md +1 -1
- package/AI_USAGE/components/timeline.md +1 -1
- package/AI_USAGE/components/tooltip-api.md +1 -1
- package/AI_USAGE/components/tooltip.md +1 -1
- package/AI_USAGE/components/tree-select-api.md +498 -0
- package/AI_USAGE/components/tree-select.md +744 -0
- package/AI_USAGE/components/trend-chart-api.md +1 -1
- package/AI_USAGE/components/trend-chart.md +1 -1
- package/AI_USAGE/components/trigger-api.md +1 -1
- package/AI_USAGE/components/trigger.md +1 -1
- package/AI_USAGE/components/upload-api.md +1 -1
- package/AI_USAGE/components/upload.md +1 -1
- package/AI_USAGE/components/watermark-api.md +1 -1
- package/AI_USAGE/components/watermark.md +1 -1
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +3 -2
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +1326 -5
- package/CHANGELOG.md +32 -0
- package/dist/_props/css.d.ts +2 -1
- package/dist/components/_components/input-label/input-label.d.ts +3 -0
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/index.d.ts +3 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/line-chart/LineChart.d.ts +1 -1
- package/dist/components/line-chart/index.d.ts +3 -3
- package/dist/components/line-chart/interface.d.ts +2 -2
- package/dist/components/tree-select/TreeNode.vue.d.ts +478 -0
- package/dist/components/tree-select/TreeSelect.d.ts +1549 -0
- package/dist/components/tree-select/TreeSelectDropdown.vue.d.ts +569 -0
- package/dist/components/tree-select/hooks/use-tree-select.d.ts +92 -0
- package/dist/components/tree-select/index.d.ts +3321 -0
- package/dist/components/tree-select/interface.d.ts +203 -0
- package/dist/components/tree-select/utils.d.ts +64 -0
- package/dist/es/_styles/palette-aliases.js +3 -0
- package/dist/es/components/_components/feedback-icon/index.vue2.js +10 -10
- package/dist/es/components/_components/input-label/input-label.js +69 -65
- package/dist/es/components/_components/select-view/select-view.js +1 -0
- package/dist/es/components/button/Button.js +9 -9
- package/dist/es/components/drawer/src/Drawer.vue.js +26 -26
- package/dist/es/components/form-switch/Switch.vue2.js +18 -18
- package/dist/es/components/image/Image.vue2.js +13 -13
- package/dist/es/components/image/ImagePreview.vue2.js +33 -33
- package/dist/es/components/index.js +55 -52
- package/dist/es/components/link/Link.vue2.js +12 -12
- package/dist/es/components/message/message.vue2.js +13 -13
- package/dist/es/components/spin/Spin.js +28 -28
- package/dist/es/components/tag/Tag.vue2.js +22 -22
- package/dist/es/components/timeline/src/Timeline.js +7 -7
- package/dist/es/components/tree-select/TreeNode.vue.js +91 -0
- package/dist/es/components/tree-select/TreeNode.vue2.js +162 -0
- package/dist/es/components/tree-select/TreeSelect.js +865 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue.js +57 -0
- package/dist/es/components/tree-select/TreeSelectDropdown.vue2.js +79 -0
- package/dist/es/components/tree-select/hooks/use-tree-select.js +376 -0
- package/dist/es/components/tree-select/index.js +13 -0
- package/dist/es/components/tree-select/utils.js +181 -0
- package/dist/es/icons/animation/animation-loading.js +2 -2
- package/dist/es/index.js +71 -68
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/base.css +1 -1
- package/dist/style/dependencies.json +10 -0
- package/dist/style/drawer.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style/tree-select.css +1 -0
- package/dist/style/tree-select.js +8 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +2 -1
- package/volar.d.ts +2 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { RenderFunction } from 'vue';
|
|
2
|
+
import { FieldString } from '../../_hooks/_types';
|
|
3
|
+
import { Size } from '../../_utils/constant';
|
|
4
|
+
import { VirtualListProps } from '../virtual-list-v2/interface';
|
|
5
|
+
import { TriggerProps } from '../trigger/interface';
|
|
6
|
+
import { ScrollbarProps } from '../scrollbar-v2';
|
|
7
|
+
/**
|
|
8
|
+
* @zh 树节点键值
|
|
9
|
+
* @en Tree node key
|
|
10
|
+
*/
|
|
11
|
+
export type TreeSelectKey = string | number;
|
|
12
|
+
/**
|
|
13
|
+
* @zh 树节点数据
|
|
14
|
+
* @en Tree node data
|
|
15
|
+
*/
|
|
16
|
+
export interface TreeSelectNodeData {
|
|
17
|
+
/**
|
|
18
|
+
* @zh 节点键值,全局唯一;不传时按节点路径自动生成
|
|
19
|
+
* @en Node key, unique in the whole tree; generated from the node path when omitted
|
|
20
|
+
*/
|
|
21
|
+
key?: TreeSelectKey;
|
|
22
|
+
/**
|
|
23
|
+
* @zh 节点标题
|
|
24
|
+
* @en Node title
|
|
25
|
+
*/
|
|
26
|
+
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @zh 子节点
|
|
29
|
+
* @en Child nodes
|
|
30
|
+
*/
|
|
31
|
+
children?: TreeSelectNodeData[];
|
|
32
|
+
/**
|
|
33
|
+
* @zh 是否禁用,禁用节点不可选中、不可勾选、不参与父子联动
|
|
34
|
+
* @en Whether disabled. Disabled nodes cannot be selected or checked and are excluded from cascade
|
|
35
|
+
*/
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @zh 是否可勾选,仅 `treeCheckable` 时生效
|
|
39
|
+
* @en Whether checkable, only works with `treeCheckable`
|
|
40
|
+
*/
|
|
41
|
+
checkable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @zh 是否禁用复选框,仍可被父节点联动勾选
|
|
44
|
+
* @en Whether the checkbox is disabled. The node can still be toggled by its parent
|
|
45
|
+
*/
|
|
46
|
+
disableCheckbox?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* @zh 是否可选中
|
|
49
|
+
* @en Whether selectable
|
|
50
|
+
*/
|
|
51
|
+
selectable?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* @zh 是否为叶子节点,配合 `loadMore` 判断是否需要异步加载子节点
|
|
54
|
+
* @en Whether it is a leaf, used with `loadMore` for lazy loading
|
|
55
|
+
*/
|
|
56
|
+
isLeaf?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* @zh 节点前缀图标
|
|
59
|
+
* @en Node prefix icon
|
|
60
|
+
*/
|
|
61
|
+
icon?: RenderFunction;
|
|
62
|
+
[other: string]: any;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @zh 自定义 `TreeSelectNodeData` 中的字段名
|
|
66
|
+
* @en Customize the field names of `TreeSelectNodeData`
|
|
67
|
+
*/
|
|
68
|
+
export type TreeSelectFieldNames = FieldString<TreeSelectNodeData>;
|
|
69
|
+
/**
|
|
70
|
+
* @zh 标签模式的选中项
|
|
71
|
+
* @en Selected item in label-in-value mode
|
|
72
|
+
*/
|
|
73
|
+
export interface TreeSelectLabelValue {
|
|
74
|
+
/**
|
|
75
|
+
* @zh 选中的键值
|
|
76
|
+
* @en Selected key
|
|
77
|
+
*/
|
|
78
|
+
value: TreeSelectKey;
|
|
79
|
+
/**
|
|
80
|
+
* @zh 选中的标题
|
|
81
|
+
* @en Selected title
|
|
82
|
+
*/
|
|
83
|
+
label: string;
|
|
84
|
+
/**
|
|
85
|
+
* @zh 节点原始数据
|
|
86
|
+
* @en Raw node data
|
|
87
|
+
*/
|
|
88
|
+
raw?: TreeSelectNodeData;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @zh 选中值
|
|
92
|
+
* @en Selected value
|
|
93
|
+
*/
|
|
94
|
+
export type TreeSelectValue = TreeSelectKey | TreeSelectLabelValue;
|
|
95
|
+
/**
|
|
96
|
+
* @zh 过滤节点的方法,返回 `true` 表示命中
|
|
97
|
+
* @en Filter node method, returns `true` when the node matches
|
|
98
|
+
*/
|
|
99
|
+
export type TreeSelectFilterNode = (inputValue: string, node: TreeSelectNodeData) => boolean;
|
|
100
|
+
/**
|
|
101
|
+
* @zh 节点是否可选中的判定
|
|
102
|
+
* @en Determine whether a node is selectable
|
|
103
|
+
*/
|
|
104
|
+
export type TreeSelectSelectable = boolean | 'leaf' | ((node: TreeSelectNodeData, info: {
|
|
105
|
+
isLeaf: boolean;
|
|
106
|
+
level: number;
|
|
107
|
+
}) => boolean);
|
|
108
|
+
export interface TreeSelectInstance {
|
|
109
|
+
/** 聚焦默认触发器 */
|
|
110
|
+
focus: () => void;
|
|
111
|
+
/** 失焦默认触发器 */
|
|
112
|
+
blur: () => void;
|
|
113
|
+
/** 展开 / 收起全部可展开节点,默认展开 */
|
|
114
|
+
expandAll: (expanded?: boolean) => void;
|
|
115
|
+
/** 全选 / 清空勾选,仅勾选模式生效,默认全选 */
|
|
116
|
+
checkAll: (checked?: boolean) => void;
|
|
117
|
+
}
|
|
118
|
+
export interface TreeSelectProps {
|
|
119
|
+
modelValue?: TreeSelectValue | TreeSelectValue[];
|
|
120
|
+
defaultValue?: TreeSelectValue | TreeSelectValue[];
|
|
121
|
+
multiple?: boolean;
|
|
122
|
+
treeCheckable?: boolean;
|
|
123
|
+
treeCheckStrictly?: boolean;
|
|
124
|
+
checkedStrategy?: 'all' | 'parent' | 'child';
|
|
125
|
+
data?: TreeSelectNodeData[];
|
|
126
|
+
fieldNames?: TreeSelectFieldNames;
|
|
127
|
+
labelInValue?: boolean;
|
|
128
|
+
selectable?: TreeSelectSelectable;
|
|
129
|
+
allowSearch?: boolean | {
|
|
130
|
+
retainInputValue?: boolean;
|
|
131
|
+
};
|
|
132
|
+
allowClear?: boolean;
|
|
133
|
+
filterTreeNode?: boolean | TreeSelectFilterNode;
|
|
134
|
+
searchDelay?: number;
|
|
135
|
+
inputValue?: string;
|
|
136
|
+
defaultInputValue?: string;
|
|
137
|
+
size?: Size;
|
|
138
|
+
placeholder?: string;
|
|
139
|
+
loading?: boolean;
|
|
140
|
+
disabled?: boolean;
|
|
141
|
+
error?: boolean;
|
|
142
|
+
bordered?: boolean;
|
|
143
|
+
maxTagCount?: number;
|
|
144
|
+
tagNowrap?: boolean;
|
|
145
|
+
popupVisible?: boolean;
|
|
146
|
+
defaultPopupVisible?: boolean;
|
|
147
|
+
unmountOnClose?: boolean;
|
|
148
|
+
popupContainer?: string | HTMLElement;
|
|
149
|
+
triggerProps?: TriggerProps;
|
|
150
|
+
defaultExpandAll?: boolean;
|
|
151
|
+
expandedKeys?: TreeSelectKey[];
|
|
152
|
+
defaultExpandedKeys?: TreeSelectKey[];
|
|
153
|
+
autoExpandParent?: boolean;
|
|
154
|
+
showLine?: boolean;
|
|
155
|
+
blockNode?: boolean;
|
|
156
|
+
virtualListProps?: VirtualListProps;
|
|
157
|
+
scrollbar?: boolean | ScrollbarProps;
|
|
158
|
+
maxHeight?: number | string;
|
|
159
|
+
loadMore?: (node: TreeSelectNodeData) => Promise<void>;
|
|
160
|
+
fallbackOption?: boolean | ((value: TreeSelectKey) => TreeSelectNodeData);
|
|
161
|
+
formatLabel?: (data: TreeSelectNodeData) => string;
|
|
162
|
+
showHeaderOnEmpty?: boolean;
|
|
163
|
+
showFooterOnEmpty?: boolean;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @zh 内部节点信息
|
|
167
|
+
* @en Internal node info
|
|
168
|
+
*/
|
|
169
|
+
export interface TreeSelectNodeInfo {
|
|
170
|
+
key: string;
|
|
171
|
+
value: TreeSelectKey;
|
|
172
|
+
title: string;
|
|
173
|
+
raw: TreeSelectNodeData;
|
|
174
|
+
level: number;
|
|
175
|
+
index: number;
|
|
176
|
+
parentKey?: string;
|
|
177
|
+
pathKeys: string[];
|
|
178
|
+
childrenKeys: string[];
|
|
179
|
+
siblingIndex: number;
|
|
180
|
+
siblingCount: number;
|
|
181
|
+
isLeaf: boolean;
|
|
182
|
+
disabled: boolean;
|
|
183
|
+
checkable: boolean;
|
|
184
|
+
disableCheckbox: boolean;
|
|
185
|
+
selectable: boolean;
|
|
186
|
+
loading: boolean;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @zh 树节点插槽参数
|
|
190
|
+
* @en Tree node slot props
|
|
191
|
+
*/
|
|
192
|
+
export interface TreeSelectNodeSlotProps {
|
|
193
|
+
node: TreeSelectNodeData;
|
|
194
|
+
value: TreeSelectKey;
|
|
195
|
+
title: string;
|
|
196
|
+
level: number;
|
|
197
|
+
checked: boolean;
|
|
198
|
+
halfChecked: boolean;
|
|
199
|
+
selected: boolean;
|
|
200
|
+
expanded: boolean;
|
|
201
|
+
disabled: boolean;
|
|
202
|
+
isLeaf: boolean;
|
|
203
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { TreeSelectFilterNode, TreeSelectKey, TreeSelectNodeData, TreeSelectNodeInfo, TreeSelectValue } from './interface';
|
|
2
|
+
export declare const DEFAULT_FIELD_NAMES: {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
children: string;
|
|
6
|
+
disabled: string;
|
|
7
|
+
checkable: string;
|
|
8
|
+
disableCheckbox: string;
|
|
9
|
+
selectable: string;
|
|
10
|
+
isLeaf: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
};
|
|
13
|
+
export type MergedFieldNames = typeof DEFAULT_FIELD_NAMES;
|
|
14
|
+
/** 归一化键值:区分数字与字符串键,避免 `1` 和 `'1'` 互相覆盖。 */
|
|
15
|
+
export declare const normalizeKey: (key: TreeSelectKey) => string;
|
|
16
|
+
export declare const getValueFromKey: (key: string) => TreeSelectKey;
|
|
17
|
+
/** 提取选中项中的键值,兼容 labelInValue 对象。 */
|
|
18
|
+
export declare const getKeyFromValue: (value: TreeSelectValue) => TreeSelectKey | undefined;
|
|
19
|
+
export declare const isValidKey: (key: unknown) => key is TreeSelectKey;
|
|
20
|
+
export interface TreeBuildResult {
|
|
21
|
+
nodeMap: Map<string, TreeSelectNodeInfo>;
|
|
22
|
+
orderedNodes: TreeSelectNodeInfo[];
|
|
23
|
+
rootKeys: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare const buildTree: (data: TreeSelectNodeData[], fieldNames: MergedFieldNames) => TreeBuildResult;
|
|
26
|
+
/** 参与父子联动的节点:可勾选且未禁用。 */
|
|
27
|
+
export declare const isCascadeCheckable: (info: TreeSelectNodeInfo) => boolean;
|
|
28
|
+
/** 某个节点下参与级联判定的直接子节点。 */
|
|
29
|
+
export declare const getEligibleChildren: (info: TreeSelectNodeInfo, nodeMap: Map<string, TreeSelectNodeInfo>) => TreeSelectNodeInfo[];
|
|
30
|
+
export declare const getDescendantKeys: (nodeMap: Map<string, TreeSelectNodeInfo>, info: TreeSelectNodeInfo, predicate?: (node: TreeSelectNodeInfo) => boolean) => string[];
|
|
31
|
+
/** 向下联动时的键集合:自身 + 可联动后代。 */
|
|
32
|
+
export declare const getCascadeKeys: (nodeMap: Map<string, TreeSelectNodeInfo>, info: TreeSelectNodeInfo) => string[];
|
|
33
|
+
export interface TreeSelectCheckState {
|
|
34
|
+
checked: Set<string>;
|
|
35
|
+
halfChecked: Set<string>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 由公开选中值推导完整勾选状态。
|
|
39
|
+
* 非严格模式下,父键会向下补齐可联动后代;随后自底向上重算半选。
|
|
40
|
+
*/
|
|
41
|
+
export declare const conductCheckState: (checkedKeys: string[], nodeMap: Map<string, TreeSelectNodeInfo>, orderedNodes: TreeSelectNodeInfo[], strict: boolean) => TreeSelectCheckState;
|
|
42
|
+
/** 切换单个节点的勾选,并向上联动父级状态。 */
|
|
43
|
+
export declare const toggleCheckState: (current: TreeSelectCheckState, info: TreeSelectNodeInfo, nextChecked: boolean, nodeMap: Map<string, TreeSelectNodeInfo>, strict: boolean) => TreeSelectCheckState;
|
|
44
|
+
/** 按选中策略过滤公开值:parent 保留最高层已选节点,child 保留最底层已选节点。 */
|
|
45
|
+
export declare const filterCheckedKeysByStrategy: (state: TreeSelectCheckState, strategy: "all" | "parent" | "child", orderedNodes: TreeSelectNodeInfo[], nodeMap: Map<string, TreeSelectNodeInfo>) => string[];
|
|
46
|
+
export interface TreeFilterResult {
|
|
47
|
+
keptKeys: Set<string>;
|
|
48
|
+
matchedKeys: Set<string>;
|
|
49
|
+
query: string;
|
|
50
|
+
}
|
|
51
|
+
/** 过滤树:命中节点保留自身与全部后代,并保留其所有祖先。 */
|
|
52
|
+
export declare const filterTreeNodes: (orderedNodes: TreeSelectNodeInfo[], nodeMap: Map<string, TreeSelectNodeInfo>, inputValue: string, filterTreeNode: boolean | TreeSelectFilterNode) => TreeFilterResult | null;
|
|
53
|
+
export type TreeSelectFlatNode = TreeSelectNodeInfo & {
|
|
54
|
+
lastChild: boolean;
|
|
55
|
+
};
|
|
56
|
+
/** 展开状态下的可见节点;过滤时展示命中集合及其祖先。 */
|
|
57
|
+
export declare const getVisibleNodes: (orderedNodes: TreeSelectNodeInfo[], expandedKeys: Set<string>, filterResult: TreeFilterResult | null) => TreeSelectFlatNode[];
|
|
58
|
+
/** 把标题按查询词切分为高亮片段。 */
|
|
59
|
+
export declare const splitHighlightText: (title: string, query: string) => {
|
|
60
|
+
text: string;
|
|
61
|
+
match: boolean;
|
|
62
|
+
}[];
|
|
63
|
+
/** 由显示值解析节点键列表。 */
|
|
64
|
+
export declare const getKeysFromValues: (values: TreeSelectValue[]) => TreeSelectKey[];
|
|
@@ -104,6 +104,9 @@ const r = {
|
|
|
104
104
|
"--x-time-range-selector-color-default": "var(--x-color-primary-6)",
|
|
105
105
|
"--x-timeline-dot-hollow-shadow": "0 0 0 1px color-mix( in srgb, var(--x-color-primary-solid) 10%, var(--x-color-transparent) )",
|
|
106
106
|
"--x-timeline-dot-shadow": "0 0 0 1px color-mix(in srgb, var(--x-color-primary-solid) 8%, var(--x-color-transparent))",
|
|
107
|
+
"--x-tree-select-highlight-color-text": "var(--x-color-primary)",
|
|
108
|
+
"--x-tree-select-node-color-bg_selected": "var(--x-color-primary-light-1)",
|
|
109
|
+
"--x-tree-select-node-color-text_selected": "var(--x-color-primary)",
|
|
107
110
|
"--x-upload-color-border-hover": "var(--x-color-primary)"
|
|
108
111
|
},
|
|
109
112
|
success: {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as i, computed as c } from "vue";
|
|
2
2
|
import l from "../../../icons/animation/animation-loading.js";
|
|
3
3
|
import t from "../../../icons/default/check-circle-fill.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getClassNameMixin as
|
|
7
|
-
const k =
|
|
4
|
+
import r from "../../../icons/default/exclamation-circle-fill.js";
|
|
5
|
+
import m from "../../../icons/default/close-circle-fill.js";
|
|
6
|
+
import { getClassNameMixin as n } from "../../../_utils/config.js";
|
|
7
|
+
const k = i({
|
|
8
8
|
name: "FeedbackIcon",
|
|
9
9
|
components: {
|
|
10
10
|
IconLoading: l,
|
|
11
11
|
IconCheckCircleFill: t,
|
|
12
|
-
IconExclamationCircleFill:
|
|
13
|
-
IconCloseCircleFill:
|
|
12
|
+
IconExclamationCircleFill: r,
|
|
13
|
+
IconCloseCircleFill: m
|
|
14
14
|
},
|
|
15
15
|
props: {
|
|
16
16
|
type: {
|
|
17
17
|
type: String
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const o =
|
|
20
|
+
setup(e) {
|
|
21
|
+
const o = n("feedback-icon");
|
|
22
22
|
return {
|
|
23
|
-
cls: c(() => [o.block, o.modifier(`status-${
|
|
23
|
+
cls: c(() => [o.block, o.modifier(`status-${e.type}`)])
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { omit as
|
|
3
|
-
import { INPUT_EVENTS as
|
|
4
|
-
import
|
|
5
|
-
import { useInput as
|
|
6
|
-
import { useFormItem as
|
|
7
|
-
import { useSize as
|
|
8
|
-
import { getClassNameMixin as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as K, toRefs as O, computed as l, createVNode as a, mergeProps as V, Fragment as T } from "vue";
|
|
2
|
+
import { omit as H } from "../../../_utils/omit.js";
|
|
3
|
+
import { INPUT_EVENTS as h } from "../../../_utils/constant.js";
|
|
4
|
+
import U from "../../../_utils/pick.js";
|
|
5
|
+
import { useInput as $ } from "../../../_hooks/use-input.js";
|
|
6
|
+
import { useFormItem as q } from "../../../_hooks/use-form-item.js";
|
|
7
|
+
import { useSize as G } from "../../../_hooks/use-size.js";
|
|
8
|
+
import { getClassNameMixin as I, getRemovePrefixComponentName as J } from "../../../_utils/config.js";
|
|
9
|
+
const ae = /* @__PURE__ */ K({
|
|
10
10
|
name: "InputLabel",
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
props: {
|
|
@@ -26,7 +26,9 @@ const ne = /* @__PURE__ */ _({
|
|
|
26
26
|
// used for outer focused
|
|
27
27
|
focused: Boolean,
|
|
28
28
|
uninjectFormItemContext: Boolean,
|
|
29
|
-
inputAttrs: Object
|
|
29
|
+
inputAttrs: Object,
|
|
30
|
+
// Select keeps its native combobox clickable while a label is displayed.
|
|
31
|
+
retainInputBox: Boolean
|
|
30
32
|
},
|
|
31
33
|
emits: {
|
|
32
34
|
"update:inputValue": (e) => !0,
|
|
@@ -41,83 +43,85 @@ const ne = /* @__PURE__ */ _({
|
|
|
41
43
|
slots: t
|
|
42
44
|
}) {
|
|
43
45
|
const {
|
|
44
|
-
size:
|
|
45
|
-
disabled:
|
|
46
|
-
error:
|
|
47
|
-
inputValue:
|
|
46
|
+
size: g,
|
|
47
|
+
disabled: C,
|
|
48
|
+
error: x,
|
|
49
|
+
inputValue: B,
|
|
48
50
|
uninjectFormItemContext: r
|
|
49
|
-
} =
|
|
50
|
-
mergedSize:
|
|
51
|
+
} = O(e), n = e.baseCls ? I(J(e.baseCls)) : I("input-label"), {
|
|
52
|
+
mergedSize: S,
|
|
51
53
|
mergedDisabled: s,
|
|
52
|
-
mergedError:
|
|
53
|
-
eventHandlers:
|
|
54
|
-
} =
|
|
55
|
-
size:
|
|
56
|
-
disabled:
|
|
57
|
-
error:
|
|
54
|
+
mergedError: w,
|
|
55
|
+
eventHandlers: N
|
|
56
|
+
} = q({
|
|
57
|
+
size: g,
|
|
58
|
+
disabled: C,
|
|
59
|
+
error: x,
|
|
58
60
|
uninject: r == null ? void 0 : r.value
|
|
59
61
|
}), {
|
|
60
|
-
mergedSize:
|
|
61
|
-
} =
|
|
62
|
+
mergedSize: z
|
|
63
|
+
} = G(S), {
|
|
62
64
|
inputRef: c,
|
|
63
65
|
_focused: f,
|
|
64
|
-
computedValue:
|
|
65
|
-
handleInput:
|
|
66
|
+
computedValue: y,
|
|
67
|
+
handleInput: F,
|
|
66
68
|
handleComposition: i,
|
|
67
|
-
handleFocus:
|
|
68
|
-
handleBlur:
|
|
69
|
-
handleMousedown:
|
|
70
|
-
} =
|
|
71
|
-
modelValue:
|
|
69
|
+
handleFocus: L,
|
|
70
|
+
handleBlur: A,
|
|
71
|
+
handleMousedown: E
|
|
72
|
+
} = $({
|
|
73
|
+
modelValue: B,
|
|
72
74
|
emit: m,
|
|
73
75
|
eventName: "inputValueChange",
|
|
74
76
|
updateEventName: "update:inputValue",
|
|
75
|
-
eventHandlers:
|
|
76
|
-
}),
|
|
77
|
+
eventHandlers: N
|
|
78
|
+
}), R = l(() => e.focused ?? f.value), p = l(() => e.enabledInput && f.value || !e.modelValue), d = () => {
|
|
77
79
|
var u;
|
|
78
80
|
return e.modelValue ? ((u = e.formatLabel) == null ? void 0 : u.call(e, e.modelValue)) ?? e.modelValue.label : "";
|
|
79
|
-
},
|
|
81
|
+
}, k = l(() => e.enabledInput && e.modelValue ? d() : e.placeholder), P = () => {
|
|
80
82
|
var u;
|
|
81
83
|
return e.modelValue ? ((u = t.default) == null ? void 0 : u.call(t, {
|
|
82
84
|
data: e.modelValue
|
|
83
85
|
})) ?? d() : null;
|
|
84
|
-
},
|
|
86
|
+
}, j = l(() => [n.block, n.modifier(`size-${z.value}`), {
|
|
85
87
|
[n.modifier("search")]: e.enabledInput,
|
|
86
|
-
[n.modifier("focus")]:
|
|
88
|
+
[n.modifier("focus")]: R.value,
|
|
87
89
|
[n.modifier("disabled")]: s.value,
|
|
88
|
-
[n.modifier("error")]:
|
|
89
|
-
}]),
|
|
90
|
+
[n.modifier("error")]: w.value
|
|
91
|
+
}]), M = l(() => H(o, h)), _ = l(() => U(o, h)), D = (u) => {
|
|
90
92
|
m("keydown", u);
|
|
91
|
-
}
|
|
93
|
+
}, b = () => a("input", V(_.value, e.inputAttrs, {
|
|
94
|
+
ref: c,
|
|
95
|
+
class: [n.element("input"), {
|
|
96
|
+
[n.element("input-hidden")]: !p.value
|
|
97
|
+
}],
|
|
98
|
+
value: y.value,
|
|
99
|
+
readonly: !e.enabledInput,
|
|
100
|
+
placeholder: k.value,
|
|
101
|
+
disabled: s.value,
|
|
102
|
+
onInput: F,
|
|
103
|
+
onKeydown: D,
|
|
104
|
+
onFocus: L,
|
|
105
|
+
onBlur: A,
|
|
106
|
+
onCompositionstart: i,
|
|
107
|
+
onCompositionupdate: i,
|
|
108
|
+
onCompositionend: i
|
|
109
|
+
}), null), v = () => a("span", {
|
|
110
|
+
class: [n.element("value"), {
|
|
111
|
+
[n.element("value-hidden")]: p.value
|
|
112
|
+
}]
|
|
113
|
+
}, [P()]);
|
|
92
114
|
return {
|
|
93
115
|
inputRef: c,
|
|
94
|
-
render: () =>
|
|
95
|
-
class:
|
|
116
|
+
render: () => a("span", V(M.value, {
|
|
117
|
+
class: j.value,
|
|
96
118
|
title: d(),
|
|
97
|
-
onMousedown:
|
|
98
|
-
}), [t.prefix &&
|
|
119
|
+
onMousedown: E
|
|
120
|
+
}), [t.prefix && a("span", {
|
|
99
121
|
class: n.element("prefix")
|
|
100
|
-
}, [t.prefix()]),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
[n.element("input-hidden")]: !p.value
|
|
104
|
-
}],
|
|
105
|
-
value: N.value,
|
|
106
|
-
readonly: !e.enabledInput,
|
|
107
|
-
placeholder: F.value,
|
|
108
|
-
disabled: s.value,
|
|
109
|
-
onInput: z,
|
|
110
|
-
onKeydown: M,
|
|
111
|
-
onFocus: y,
|
|
112
|
-
onBlur: L,
|
|
113
|
-
onCompositionstart: i,
|
|
114
|
-
onCompositionupdate: i,
|
|
115
|
-
onCompositionend: i
|
|
116
|
-
}), null), l("span", {
|
|
117
|
-
class: [n.element("value"), {
|
|
118
|
-
[n.element("value-hidden")]: p.value
|
|
119
|
-
}]
|
|
120
|
-
}, [R()]), t.suffix && l("span", {
|
|
122
|
+
}, [t.prefix()]), e.retainInputBox ? a("span", {
|
|
123
|
+
class: n.element("input-area")
|
|
124
|
+
}, [b(), v()]) : a(T, null, [b(), v()]), t.suffix && a("span", {
|
|
121
125
|
class: n.element("suffix")
|
|
122
126
|
}, [t.suffix()])])
|
|
123
127
|
};
|
|
@@ -137,5 +141,5 @@ const ne = /* @__PURE__ */ _({
|
|
|
137
141
|
}
|
|
138
142
|
});
|
|
139
143
|
export {
|
|
140
|
-
|
|
144
|
+
ae as default
|
|
141
145
|
};
|
|
@@ -26,7 +26,7 @@ const o = (e) => {
|
|
|
26
26
|
emits: ["click"],
|
|
27
27
|
setup(e, {
|
|
28
28
|
slots: n,
|
|
29
|
-
emit:
|
|
29
|
+
emit: T
|
|
30
30
|
}) {
|
|
31
31
|
const v = E(), a = M(_, void 0), {
|
|
32
32
|
mergedSize: F
|
|
@@ -35,24 +35,24 @@ const o = (e) => {
|
|
|
35
35
|
}), u = R({
|
|
36
36
|
clicked: !1,
|
|
37
37
|
isDebounce: !1
|
|
38
|
-
}), i = U("button"),
|
|
38
|
+
}), i = U("button"), A = (t) => t.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`), f = (t) => {
|
|
39
39
|
const c = (v == null ? void 0 : v.vnode.props) ?? {};
|
|
40
|
-
return Object.prototype.hasOwnProperty.call(c, t) || Object.prototype.hasOwnProperty.call(c,
|
|
41
|
-
},
|
|
40
|
+
return Object.prototype.hasOwnProperty.call(c, t) || Object.prototype.hasOwnProperty.call(c, A(t));
|
|
41
|
+
}, s = r(() => f("type") ? e.type : (a == null ? void 0 : a.type) ?? e.type), w = r(() => f("size") ? e.size : (a == null ? void 0 : a.size) ?? F.value), D = r(() => f("status") ? e.status : (a == null ? void 0 : a.status) ?? e.status), y = r(() => f("shape") ? e.shape : (a == null ? void 0 : a.shape) ?? e.shape), m = r(() => f("disabled") ? e.disabled : (a == null ? void 0 : a.disabled) ?? e.disabled), L = r(() => [i.block, s.value && s.value !== "default" && i.modifier(s.value), w.value && i.modifier(w.value), D.value && i.modifier(D.value), m.value && i.is("disabled"), e.block && i.modifier("block"), e.plain && i.modifier("plain"), y.value && i.modifier(y.value), e.link && i.modifier("link"), !e.border && i.modifier("hide-border"), l.value && i.modifier("loading"), e.narrow && i.modifier("narrow")]), N = () => {
|
|
42
42
|
e.debounce > 0 && !u.isDebounce && (u.isDebounce = !0, setTimeout(() => {
|
|
43
43
|
u.isDebounce = !1;
|
|
44
44
|
}, e.debounce));
|
|
45
|
-
}, l = r(() => e.loading || u.clicked || u.isDebounce), V = r(() =>
|
|
45
|
+
}, l = r(() => e.loading || u.clicked || u.isDebounce), V = r(() => m.value || l.value || e.link || s.value === "text"), B = (t) => {
|
|
46
46
|
var c;
|
|
47
|
-
t.detail > 0 && ((c = t.currentTarget) == null || c.blur()), !(
|
|
47
|
+
t.detail > 0 && ((c = t.currentTarget) == null || c.blur()), !(m.value || l.value) && (N(), T("click", t));
|
|
48
48
|
};
|
|
49
49
|
return () => {
|
|
50
|
-
var P, j,
|
|
51
|
-
const t = (P = n.default) == null ? void 0 : P.call(n), c = (j = n.prefix) == null ? void 0 : j.call(n), S = (
|
|
50
|
+
var P, j, I, O;
|
|
51
|
+
const t = (P = n.default) == null ? void 0 : P.call(n), c = (j = n.prefix) == null ? void 0 : j.call(n), S = (I = n.icon) == null ? void 0 : I.call(n), x = (O = n.suffix) == null ? void 0 : O.call(n), b = o(t), g = o(c), h = o(S), p = o(x), z = !b && !g && h && !p, k = e.loadingFill || l.value && (y.value === "circle" || z), K = l.value && !k && (b || g || h || p);
|
|
52
52
|
return Z(d("button", {
|
|
53
53
|
class: [L.value, !b && i.modifier("empty-content"), z && i.modifier("only-icon"), k && i.modifier("loading-fill")],
|
|
54
54
|
type: e.htmlType,
|
|
55
|
-
disabled:
|
|
55
|
+
disabled: m.value || l.value,
|
|
56
56
|
"aria-busy": l.value || void 0,
|
|
57
57
|
onClick: B
|
|
58
58
|
}, [d("span", {
|