x-next 1.13.0 → 1.15.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_CODING.md +6 -5
- package/AI_USAGE/catalog.md +108 -105
- package/AI_USAGE/components/alert-api.md +48 -0
- package/AI_USAGE/components/alert.md +222 -3
- package/AI_USAGE/components/bar-chart-api.md +177 -0
- package/AI_USAGE/components/bar-chart.md +297 -3
- package/AI_USAGE/components/boxicons.md +147 -0
- package/AI_USAGE/components/button-api.md +144 -0
- package/AI_USAGE/components/button.md +447 -3
- package/AI_USAGE/components/charts.md +81 -0
- package/AI_USAGE/components/checkbox-api.md +145 -0
- package/AI_USAGE/components/checkbox.md +365 -3
- package/AI_USAGE/components/color-picker-api.md +52 -0
- package/AI_USAGE/components/color-picker.md +211 -3
- package/AI_USAGE/components/config-provider-api.md +38 -0
- package/AI_USAGE/components/config-provider.md +250 -3
- package/AI_USAGE/components/date-picker-api.md +1114 -0
- package/AI_USAGE/components/date-picker.md +378 -3
- package/AI_USAGE/components/dialog-api.md +142 -0
- package/AI_USAGE/components/dialog.md +284 -3
- package/AI_USAGE/components/draggable-api.md +146 -0
- package/AI_USAGE/components/draggable.md +259 -0
- package/AI_USAGE/components/drawer-api.md +78 -0
- package/AI_USAGE/components/drawer.md +256 -0
- package/AI_USAGE/components/dropdown-api.md +529 -0
- package/AI_USAGE/components/dropdown.md +392 -3
- package/AI_USAGE/components/empty-api.md +36 -0
- package/AI_USAGE/components/empty.md +227 -3
- package/AI_USAGE/components/finicon.md +88 -0
- package/AI_USAGE/components/form-api.md +524 -0
- package/AI_USAGE/components/form.md +454 -0
- package/AI_USAGE/components/grid-api.md +527 -0
- package/AI_USAGE/components/grid.md +224 -0
- package/AI_USAGE/components/heatmap-api.md +122 -0
- package/AI_USAGE/components/heatmap.md +220 -0
- package/AI_USAGE/components/icon-api.md +4707 -0
- package/AI_USAGE/components/icon.md +257 -0
- package/AI_USAGE/components/image-api.md +440 -0
- package/AI_USAGE/components/image.md +465 -0
- package/AI_USAGE/components/input-api.md +184 -0
- package/AI_USAGE/components/input-number-api.md +66 -0
- package/AI_USAGE/components/input-number.md +294 -0
- package/AI_USAGE/components/input-tag-api.md +114 -0
- package/AI_USAGE/components/input-tag.md +482 -0
- package/AI_USAGE/components/input.md +293 -3
- package/AI_USAGE/components/layout-api.md +147 -0
- package/AI_USAGE/components/layout.md +230 -0
- package/AI_USAGE/components/line-chart-api.md +197 -0
- package/AI_USAGE/components/line-chart.md +306 -3
- package/AI_USAGE/components/link-api.md +42 -0
- package/AI_USAGE/components/link.md +197 -0
- package/AI_USAGE/components/menu-api.md +516 -0
- package/AI_USAGE/components/menu.md +268 -0
- package/AI_USAGE/components/message-api.md +215 -0
- package/AI_USAGE/components/message-box-api.md +108 -0
- package/AI_USAGE/components/message-box.md +268 -3
- package/AI_USAGE/components/message.md +231 -3
- package/AI_USAGE/components/network-api.md +91 -0
- package/AI_USAGE/components/network.md +378 -0
- package/AI_USAGE/components/notification-api.md +236 -0
- package/AI_USAGE/components/notification.md +275 -3
- package/AI_USAGE/components/pagination-api.md +62 -0
- package/AI_USAGE/components/pagination.md +380 -3
- package/AI_USAGE/components/pie-chart-api.md +109 -0
- package/AI_USAGE/components/pie-chart.md +245 -3
- package/AI_USAGE/components/popconfirm-api.md +75 -0
- package/AI_USAGE/components/popconfirm.md +231 -3
- package/AI_USAGE/components/popover-api.md +75 -0
- package/AI_USAGE/components/popover.md +208 -3
- package/AI_USAGE/components/popup-api.md +75 -0
- package/AI_USAGE/components/popup.md +52 -0
- package/AI_USAGE/components/progress-api.md +44 -0
- package/AI_USAGE/components/progress.md +248 -3
- package/AI_USAGE/components/radio-api.md +165 -0
- package/AI_USAGE/components/radio.md +259 -3
- package/AI_USAGE/components/rate-api.md +54 -0
- package/AI_USAGE/components/rate.md +233 -3
- package/AI_USAGE/components/resize-box-api.md +56 -0
- package/AI_USAGE/components/resize-box.md +231 -0
- package/AI_USAGE/components/scrollbar-api.md +77 -0
- package/AI_USAGE/components/scrollbar.md +218 -0
- package/AI_USAGE/components/select-api.md +758 -0
- package/AI_USAGE/components/select.md +640 -3
- package/AI_USAGE/components/skeleton-api.md +85 -0
- package/AI_USAGE/components/skeleton.md +150 -0
- package/AI_USAGE/components/slider-api.md +51 -0
- package/AI_USAGE/components/slider.md +233 -3
- package/AI_USAGE/components/space-api.md +38 -0
- package/AI_USAGE/components/space.md +145 -0
- package/AI_USAGE/components/spin-api.md +43 -0
- package/AI_USAGE/components/spin.md +205 -0
- package/AI_USAGE/components/steps-api.md +111 -0
- package/AI_USAGE/components/steps.md +201 -3
- package/AI_USAGE/components/switch-api.md +58 -0
- package/AI_USAGE/components/switch.md +290 -3
- package/AI_USAGE/components/table-api.md +2919 -0
- package/AI_USAGE/components/table.md +1457 -0
- package/AI_USAGE/components/tabs-api.md +135 -0
- package/AI_USAGE/components/tabs.md +308 -3
- package/AI_USAGE/components/tag-api.md +124 -0
- package/AI_USAGE/components/tag.md +292 -0
- package/AI_USAGE/components/textarea-api.md +55 -0
- package/AI_USAGE/components/textarea.md +326 -3
- package/AI_USAGE/components/time-picker-api.md +137 -0
- package/AI_USAGE/components/time-picker.md +271 -3
- package/AI_USAGE/components/time-range-selector-api.md +44 -0
- package/AI_USAGE/components/time-range-selector.md +355 -0
- package/AI_USAGE/components/timeline-api.md +93 -0
- package/AI_USAGE/components/timeline.md +312 -0
- package/AI_USAGE/components/tooltip-api.md +77 -0
- package/AI_USAGE/components/tooltip.md +182 -0
- 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 +119 -0
- package/AI_USAGE/components/trend-chart.md +335 -0
- package/AI_USAGE/components/trigger-api.md +124 -0
- package/AI_USAGE/components/trigger.md +185 -0
- package/AI_USAGE/components/upload-api.md +200 -0
- package/AI_USAGE/components/upload.md +711 -3
- package/AI_USAGE/components/watermark-api.md +87 -0
- package/AI_USAGE/components/watermark.md +200 -0
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +36 -7
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +34972 -5
- package/CHANGELOG.md +39 -0
- package/dist/_props/css.d.ts +2 -1
- package/dist/_utils/inherit-component-type.d.ts +11 -0
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/index.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +420 -5
- package/dist/components/form-input/index.d.ts +617 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts +689 -1
- 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/menu/index.d.ts +786 -1
- 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/_utils/inherit-component-type.js +6 -0
- package/dist/es/components/_components/feedback-icon/index.vue2.js +10 -10
- package/dist/es/components/button/Button.js +9 -9
- package/dist/es/components/date-picker/index.js +18 -17
- package/dist/es/components/drawer/src/Drawer.vue.js +6 -6
- package/dist/es/components/form-input/index.js +12 -11
- 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/layout/index.js +10 -9
- package/dist/es/components/link/Link.vue2.js +12 -12
- package/dist/es/components/menu/hooks/use-level.js +5 -5
- package/dist/es/components/menu/index.js +13 -10
- 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 +11 -5
- 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
|
});
|
|
@@ -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", {
|
|
@@ -3,25 +3,26 @@ import { defineComponent as c, h as k } from "vue";
|
|
|
3
3
|
import { generateComponent as e } from "../../_utils/vue-eco.js";
|
|
4
4
|
import { getComponentPrefix as r } from "../../_utils/config.js";
|
|
5
5
|
import { getRangePickerType as s } from "./utils.js";
|
|
6
|
-
|
|
6
|
+
import { inheritComponentType as P } from "../../_utils/inherit-component-type.js";
|
|
7
|
+
const R = e(r("DatePicker"), n), i = (t, o) => P(c({
|
|
7
8
|
name: t,
|
|
8
9
|
inheritAttrs: !1,
|
|
9
|
-
setup(a, { attrs:
|
|
10
|
-
return () => k(n, { ...
|
|
10
|
+
setup(a, { attrs: m, slots: p }) {
|
|
11
|
+
return () => k(n, { ...m, type: o }, p);
|
|
11
12
|
}
|
|
12
|
-
}),
|
|
13
|
+
})), C = e(
|
|
13
14
|
r("MonthPicker"),
|
|
14
15
|
i("MonthPicker", "month")
|
|
15
|
-
),
|
|
16
|
+
), D = e(
|
|
16
17
|
r("YearPicker"),
|
|
17
18
|
i("YearPicker", "year")
|
|
18
|
-
),
|
|
19
|
+
), M = e(
|
|
19
20
|
r("QuarterPicker"),
|
|
20
21
|
i("QuarterPicker", "quarter")
|
|
21
|
-
),
|
|
22
|
+
), Q = e(
|
|
22
23
|
r("WeekPicker"),
|
|
23
24
|
i("WeekPicker", "week")
|
|
24
|
-
),
|
|
25
|
+
), f = c({
|
|
25
26
|
name: "RangePicker",
|
|
26
27
|
inheritAttrs: !1,
|
|
27
28
|
props: {
|
|
@@ -41,16 +42,16 @@ const l = e(r("DatePicker"), n), i = (t, o) => c({
|
|
|
41
42
|
a
|
|
42
43
|
);
|
|
43
44
|
}
|
|
44
|
-
}),
|
|
45
|
+
}), T = e(
|
|
45
46
|
r("RangePicker"),
|
|
46
|
-
|
|
47
|
+
P(f)
|
|
47
48
|
);
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
R as DatePicker,
|
|
51
|
+
C as MonthPicker,
|
|
52
|
+
M as QuarterPicker,
|
|
53
|
+
T as RangePicker,
|
|
54
|
+
Q as WeekPicker,
|
|
55
|
+
D as YearPicker,
|
|
56
|
+
R as default
|
|
56
57
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import $ from "./Drawer.vue2.js";
|
|
2
|
-
import { resolveComponent as f, openBlock as a, createBlock as
|
|
2
|
+
import { resolveComponent as f, openBlock as a, createBlock as g, Teleport as N, withDirectives as k, createElementBlock as d, mergeProps as m, createVNode as t, Transition as b, withCtx as n, withModifiers as S, normalizeClass as s, vShow as u, createCommentVNode as i, createElementVNode as r, renderSlot as p, toDisplayString as y, normalizeStyle as T, createTextVNode as w } from "vue";
|
|
3
3
|
import B from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const V = ["data-theme"], c = ["aria-modal"], O = ["id"], A = ["aria-label"];
|
|
5
5
|
function K(e, o, M, j, z, E) {
|
|
6
6
|
const h = f("Scrollbar"), C = f("Button"), v = f("Space");
|
|
7
|
-
return a(),
|
|
7
|
+
return a(), g(N, {
|
|
8
8
|
to: e.teleportContainer,
|
|
9
9
|
disabled: e.disabled || !e.teleportContainer
|
|
10
10
|
}, [
|
|
@@ -15,7 +15,7 @@ function K(e, o, M, j, z, E) {
|
|
|
15
15
|
style: [e.drawerStyle, e.$attrs.style],
|
|
16
16
|
"data-theme": e.popupThemeName
|
|
17
17
|
}, e.rootAttrs()), [
|
|
18
|
-
t(
|
|
18
|
+
t(b, {
|
|
19
19
|
name: "x-fade-in-standard",
|
|
20
20
|
appear: ""
|
|
21
21
|
}, {
|
|
@@ -30,7 +30,7 @@ function K(e, o, M, j, z, E) {
|
|
|
30
30
|
]),
|
|
31
31
|
_: 1
|
|
32
32
|
}),
|
|
33
|
-
t(
|
|
33
|
+
t(b, {
|
|
34
34
|
name: `x-slide-${e.placement}`,
|
|
35
35
|
appear: "",
|
|
36
36
|
onAfterEnter: e.afterEnter,
|
|
@@ -62,7 +62,7 @@ function K(e, o, M, j, z, E) {
|
|
|
62
62
|
class: s([e.className.element("body"), e.bodyClass]),
|
|
63
63
|
style: T(e.mergedBodyStyle)
|
|
64
64
|
}, [
|
|
65
|
-
t(h, { style: { overflow: "auto" } }, {
|
|
65
|
+
t(h, { style: { height: "100%", overflow: "auto" } }, {
|
|
66
66
|
default: n(() => [
|
|
67
67
|
p(e.$slots, "default")
|
|
68
68
|
]),
|
|
@@ -90,7 +90,7 @@ function K(e, o, M, j, z, E) {
|
|
|
90
90
|
]),
|
|
91
91
|
_: 1
|
|
92
92
|
}, 16, ["loading", "onClick"]),
|
|
93
|
-
e.hideCancel ? i("", !0) : (a(),
|
|
93
|
+
e.hideCancel ? i("", !0) : (a(), g(C, m({
|
|
94
94
|
key: 0,
|
|
95
95
|
loading: e.loadingObj.cancel,
|
|
96
96
|
size: "small"
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import r from "./Input.js";
|
|
2
|
+
import n from "./InputSearch.js";
|
|
3
|
+
import m from "./InputPassword.vue.js";
|
|
4
4
|
import u from "./InputGroup.vue.js";
|
|
5
|
-
import { generateComponent as
|
|
6
|
-
import { getComponentPrefix as
|
|
7
|
-
|
|
5
|
+
import { generateComponent as o } from "../../_utils/vue-eco.js";
|
|
6
|
+
import { getComponentPrefix as t } from "../../_utils/config.js";
|
|
7
|
+
import { inheritComponentType as p } from "../../_utils/inherit-component-type.js";
|
|
8
|
+
const d = o(t("Input"), r), h = o(t("InputSearch"), p(n)), P = o(t("InputPassword"), p(m)), w = o(t("InputGroup"), u);
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
d as Input,
|
|
11
|
+
w as InputGroup,
|
|
12
|
+
P as InputPassword,
|
|
13
|
+
h as InputSearch,
|
|
14
|
+
d as default
|
|
14
15
|
};
|
|
@@ -176,24 +176,24 @@ const ne = $({
|
|
|
176
176
|
* @en The icon on the button when closed
|
|
177
177
|
* @slot unchecked-icon
|
|
178
178
|
*/
|
|
179
|
-
setup(e, { emit: n, expose: b, slots:
|
|
179
|
+
setup(e, { emit: n, expose: b, slots: y, attrs: S }) {
|
|
180
180
|
const { disabled: w, size: x, modelValue: B } = q(e), c = Y("switch"), {
|
|
181
181
|
formItemCtx: z,
|
|
182
182
|
mergedDisabled: o,
|
|
183
|
-
mergedSize:
|
|
183
|
+
mergedSize: F,
|
|
184
184
|
eventHandlers: s
|
|
185
185
|
} = J({
|
|
186
186
|
disabled: w,
|
|
187
187
|
size: x
|
|
188
|
-
}),
|
|
188
|
+
}), N = O(z, () => S, { required: !1 }), { mergedSize: g } = P(F), d = k(e.defaultChecked ? e.checkedValue : e.uncheckedValue), a = r(
|
|
189
189
|
() => (e.modelValue ?? d.value) === e.checkedValue
|
|
190
190
|
), m = k(!1);
|
|
191
191
|
let v = !1;
|
|
192
192
|
H(() => {
|
|
193
193
|
v = !0;
|
|
194
194
|
});
|
|
195
|
-
const f = r(() => m.value || e.loading), h = k(),
|
|
196
|
-
() => e.type !== "line" &&
|
|
195
|
+
const f = r(() => m.value || e.loading), h = k(), R = r(
|
|
196
|
+
() => e.type !== "line" && g.value !== "mini" && (!!e.checkedText || !!e.uncheckedText || !!y.checked || !!y.unchecked)
|
|
197
197
|
), C = (t, l) => {
|
|
198
198
|
var u, i;
|
|
199
199
|
d.value = t ? e.checkedValue : e.uncheckedValue, n("update:modelValue", d.value), n("change", d.value, l), (i = (u = s.value) == null ? void 0 : u.onChange) == null || i.call(u, l);
|
|
@@ -211,29 +211,29 @@ const ne = $({
|
|
|
211
211
|
}
|
|
212
212
|
} else
|
|
213
213
|
C(t, l);
|
|
214
|
-
},
|
|
214
|
+
}, T = async (t) => {
|
|
215
215
|
const l = a.value ? e.uncheckedValue : e.checkedValue;
|
|
216
216
|
n("click", l, t), await V(!a.value, t);
|
|
217
|
-
},
|
|
217
|
+
}, A = async (t) => {
|
|
218
218
|
if (t.key !== "ArrowLeft" && t.key !== "Left" && t.key !== "ArrowRight" && t.key !== "Right")
|
|
219
219
|
return;
|
|
220
220
|
t.preventDefault();
|
|
221
221
|
const l = t.key === "ArrowRight" || t.key === "Right";
|
|
222
222
|
l !== a.value && await V(l, t);
|
|
223
|
-
},
|
|
223
|
+
}, _ = (t) => {
|
|
224
224
|
var l, u;
|
|
225
225
|
n("focus", t), (u = (l = s.value) == null ? void 0 : l.onFocus) == null || u.call(l, t);
|
|
226
|
-
},
|
|
226
|
+
}, I = (t) => {
|
|
227
227
|
var l, u;
|
|
228
228
|
n("blur", t), (u = (l = s.value) == null ? void 0 : l.onBlur) == null || u.call(l, t);
|
|
229
229
|
};
|
|
230
230
|
K(B, (t) => {
|
|
231
231
|
(Q(t) || W(t)) && (d.value = e.uncheckedValue);
|
|
232
232
|
});
|
|
233
|
-
const
|
|
233
|
+
const L = r(() => [
|
|
234
234
|
c.block,
|
|
235
235
|
c.modifier(`type-${e.type}`),
|
|
236
|
-
c.modifier(`size-${
|
|
236
|
+
c.modifier(`size-${g.value}`),
|
|
237
237
|
{
|
|
238
238
|
[c.modifier("checked")]: a.value,
|
|
239
239
|
[c.modifier("disabled")]: o.value,
|
|
@@ -261,19 +261,19 @@ const ne = $({
|
|
|
261
261
|
focus: M,
|
|
262
262
|
blur: U
|
|
263
263
|
}), {
|
|
264
|
-
formControlAttrs:
|
|
264
|
+
formControlAttrs: N,
|
|
265
265
|
className: c,
|
|
266
|
-
cls:
|
|
266
|
+
cls: L,
|
|
267
267
|
switchRef: h,
|
|
268
268
|
mergedDisabled: o,
|
|
269
269
|
buttonStyle: D,
|
|
270
270
|
computedCheck: a,
|
|
271
271
|
computedLoading: f,
|
|
272
|
-
showText:
|
|
273
|
-
handleClick:
|
|
274
|
-
handleKeydown:
|
|
275
|
-
handleFocus:
|
|
276
|
-
handleBlur:
|
|
272
|
+
showText: R,
|
|
273
|
+
handleClick: T,
|
|
274
|
+
handleKeydown: A,
|
|
275
|
+
handleFocus: _,
|
|
276
|
+
handleBlur: I
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
279
|
});
|