fast-element-plus 2.0.19 → 2.0.21
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/CHANGELOG.md +47 -20
- package/CONTRIBUTING.md +3 -4
- package/README.md +80 -27
- package/README.zh.md +66 -27
- package/dist/component.d.ts +110 -110
- package/dist/components/avatar/src/avatar.d.ts +26 -26
- package/dist/components/avatar/src/avatar.mjs +10 -10
- package/dist/components/avatar/src/avatar.mjs.map +1 -1
- package/dist/components/button/src/button.d.ts +32 -27
- package/dist/components/button/src/button.mjs +57 -36
- package/dist/components/button/src/button.mjs.map +1 -1
- package/dist/components/carNumber/src/carNumber.d.ts +8 -8
- package/dist/components/carNumber/src/carNumber.mjs +5 -5
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.d.ts +6 -6
- package/dist/components/contextMenu/src/contextMenu.mjs +5 -5
- package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.type.d.ts +7 -7
- package/dist/components/dialog/src/dialog.d.ts +74 -74
- package/dist/components/dialog/src/dialog.mjs +31 -31
- package/dist/components/dialog/src/dialog.mjs.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +57 -57
- package/dist/components/drawer/src/drawer.mjs +24 -24
- package/dist/components/drawer/src/drawer.mjs.map +1 -1
- package/dist/components/form/src/form.d.ts +30 -30
- package/dist/components/form/src/form.mjs +16 -16
- package/dist/components/form/src/form.mjs.map +1 -1
- package/dist/components/form/src/formItem.d.ts +30 -30
- package/dist/components/form/src/formItem.mjs +13 -13
- package/dist/components/form/src/formItem.mjs.map +1 -1
- package/dist/components/formItemTip/src/formItemTip.d.ts +9 -9
- package/dist/components/formItemTip/src/formItemTip.mjs +3 -3
- package/dist/components/formItemTip/src/formItemTip.mjs.map +1 -1
- package/dist/components/icon/src/icon.d.ts +10 -10
- package/dist/components/icon/src/icon.mjs +4 -4
- package/dist/components/icon/src/icon.mjs.map +1 -1
- package/dist/components/iconSelector/src/iconSelector.d.ts +6 -6
- package/dist/components/iconSelector/src/iconSelector.mjs +4 -4
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/dist/components/image/src/image.d.ts +36 -36
- package/dist/components/image/src/image.mjs +11 -11
- package/dist/components/image/src/image.mjs.map +1 -1
- package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +37 -37
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs +16 -16
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.d.ts +12 -12
- package/dist/components/layoutGrid/src/layoutGrid.mjs +6 -6
- package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.d.ts +18 -18
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +8 -8
- package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/dist/components/select/src/select.d.ts +88 -88
- package/dist/components/select/src/select.mjs +28 -28
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/select/src/selectOption.d.ts +13 -13
- package/dist/components/select/src/selectOption.mjs +6 -6
- package/dist/components/select/src/selectOption.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.d.ts +78 -84
- package/dist/components/selectPage/src/selectPage.mjs +49 -35
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/index.mjs +2 -1
- package/dist/components/selectV2/index.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.d.ts +160 -851
- package/dist/components/selectV2/src/selectV2.mjs +30 -338
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/index.mjs +3 -2
- package/dist/components/table/index.mjs.map +1 -1
- package/dist/components/table/src/page.type.d.ts +1 -1
- package/dist/components/table/src/table.d.ts +211 -744
- package/dist/components/table/src/table.mjs +131 -327
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/table.state.d.ts +3 -3
- package/dist/components/table/src/table.type.d.ts +1 -9
- package/dist/components/table/src/table.type.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.d.ts +102 -399
- package/dist/components/table/src/tableColumn.mjs +62 -213
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/table/src/tableColumnSettingDialog.d.ts +4 -4
- package/dist/components/table/src/tableColumnSettingDialog.mjs +3 -3
- package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
- package/dist/components/table/src/tablePagination.d.ts +4 -4
- package/dist/components/table/src/tablePagination.mjs +3 -3
- package/dist/components/table/src/tablePagination.mjs.map +1 -1
- package/dist/components/table/src/tableSearchForm.d.ts +12 -12
- package/dist/components/table/src/tableSearchForm.mjs +6 -6
- package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
- package/dist/components/table/src/tableSearchFormItem.d.ts +4 -4
- package/dist/components/table/src/tableSearchFormItem.mjs +2 -2
- package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
- package/dist/components/table/src/useTable.d.ts +1 -0
- package/dist/components/table/src/useTable.mjs +109 -65
- package/dist/components/table/src/useTable.mjs.map +1 -1
- package/dist/components/table/utils/table.d.ts +4 -4
- package/dist/components/table/utils/table.mjs +6 -6
- package/dist/components/table/utils/table.mjs.map +1 -1
- package/dist/components/tree/src/tree.d.ts +86 -86
- package/dist/components/tree/src/tree.mjs +46 -46
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.d.ts +144 -150
- package/dist/components/treeSelect/src/treeSelect.mjs +55 -55
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/upload/src/upload.d.ts +36 -36
- package/dist/components/upload/src/upload.mjs +17 -17
- package/dist/components/upload/src/upload.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.d.ts +47 -47
- package/dist/components/uploadImage/src/uploadImage.mjs +23 -23
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/components/uploadImages/src/uploadImages.d.ts +41 -41
- package/dist/components/uploadImages/src/uploadImages.mjs +21 -21
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
- package/dist/directives/click-debounce/index.mjs +19 -11
- package/dist/directives/click-debounce/index.mjs.map +1 -1
- package/dist/directives/click-throttle/index.d.ts +4 -2
- package/dist/directives/click-throttle/index.mjs +21 -11
- package/dist/directives/click-throttle/index.mjs.map +1 -1
- package/dist/index.global.min.js +4 -4
- package/dist/index.global.min.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal/props.d.ts +685 -0
- package/dist/internal/props.mjs +683 -0
- package/dist/internal/props.mjs.map +1 -0
- package/dist/utils/loading-tasks.d.ts +5 -0
- package/dist/utils/loading-tasks.mjs +32 -0
- package/dist/utils/loading-tasks.mjs.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +5 -10
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from "../../select";
|
|
2
2
|
import type { SelectComponentProps } from "../../select/src/select";
|
|
3
3
|
import type { PagedInput, PagedResult } from "../../table";
|
|
4
|
-
/** FaSelectPage 的运行时 Props
|
|
4
|
+
/** FaSelectPage 的运行时 Props 定义 */
|
|
5
5
|
export declare const faSelectPageProps: {
|
|
6
|
-
/**
|
|
6
|
+
/** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
|
|
7
7
|
disabled: {
|
|
8
8
|
type: BooleanConstructor;
|
|
9
9
|
default: undefined;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
11
|
+
/** 远程数据加载时显示的文本;默认显示“加载中...”。 */
|
|
12
12
|
loadingText: {
|
|
13
13
|
type: StringConstructor;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
-
/**
|
|
16
|
+
/** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
|
|
17
17
|
noMatchText: {
|
|
18
18
|
type: StringConstructor;
|
|
19
19
|
default: string;
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
21
|
+
/** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
|
|
22
22
|
noDataText: {
|
|
23
23
|
type: StringConstructor;
|
|
24
24
|
default: string;
|
|
25
25
|
};
|
|
26
|
-
/**
|
|
26
|
+
/** 多选时是否折叠已选标签 */
|
|
27
27
|
collapseTags: {
|
|
28
28
|
type: BooleanConstructor;
|
|
29
29
|
default: boolean;
|
|
30
30
|
};
|
|
31
|
-
/**
|
|
31
|
+
/** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
|
|
32
32
|
collapseTagsTooltip: {
|
|
33
33
|
type: BooleanConstructor;
|
|
34
34
|
default: boolean;
|
|
35
35
|
};
|
|
36
|
-
/**
|
|
36
|
+
/** v-model 绑定值 */
|
|
37
37
|
modelValue: {
|
|
38
38
|
type: import("vue").PropType<ElSelectorModelValue>;
|
|
39
39
|
default: undefined;
|
|
40
40
|
};
|
|
41
|
-
/**
|
|
41
|
+
/** v-model:label 绑定值 */
|
|
42
42
|
label: import("vue").PropType<string | string[] | null>;
|
|
43
|
-
/**
|
|
43
|
+
/** 宽度 */
|
|
44
44
|
width: {
|
|
45
45
|
type: (NumberConstructor | StringConstructor)[];
|
|
46
46
|
default: string;
|
|
47
47
|
};
|
|
48
|
-
/**
|
|
48
|
+
/** 插槽使用的附加状态 */
|
|
49
49
|
moreDetail: BooleanConstructor;
|
|
50
|
-
/**
|
|
50
|
+
/** 配置选项 */
|
|
51
51
|
props: {
|
|
52
52
|
type: import("vue").PropType<SelectComponentProps>;
|
|
53
53
|
default: () => {
|
|
@@ -57,7 +57,7 @@ export declare const faSelectPageProps: {
|
|
|
57
57
|
children: string;
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
/**
|
|
60
|
+
/** 请求数据的函数 */
|
|
61
61
|
requestApi: {
|
|
62
62
|
type: import("vue").PropType<(params?: PagedInput) => Promise<PagedResult<ElSelectorOutput>>>;
|
|
63
63
|
required: true;
|
|
@@ -83,9 +83,7 @@ export declare const faSelectPageProps: {
|
|
|
83
83
|
allowCreate: BooleanConstructor;
|
|
84
84
|
loading: BooleanConstructor;
|
|
85
85
|
popperClass: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue)) | null)[], unknown, unknown, string, boolean>;
|
|
86
|
-
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (
|
|
87
|
-
/** @description 下拉列表底部的内容 */
|
|
88
|
-
...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
86
|
+
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
89
87
|
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>) | (((new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>)) | null)[], unknown, unknown, () => Partial<import("element-plus").Options>, boolean>;
|
|
90
88
|
remote: BooleanConstructor;
|
|
91
89
|
debounce: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
@@ -153,15 +151,15 @@ export declare const faSelectPageProps: {
|
|
|
153
151
|
__epPropKey: true;
|
|
154
152
|
};
|
|
155
153
|
};
|
|
156
|
-
/** FaSelectPage 的运行时 Emits
|
|
154
|
+
/** FaSelectPage 的运行时 Emits 定义 */
|
|
157
155
|
export declare const faSelectPageEmits: {
|
|
158
|
-
/**
|
|
156
|
+
/** v-model 回调 */
|
|
159
157
|
"update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
|
|
160
|
-
/**
|
|
158
|
+
/** 选中数据改变 */
|
|
161
159
|
change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
|
|
162
|
-
/**
|
|
160
|
+
/** v-model:label 回调 */
|
|
163
161
|
"update:label": (value: string | string[] | null) => boolean;
|
|
164
|
-
/**
|
|
162
|
+
/** 数据改变 */
|
|
165
163
|
dataChange: (data: ElSelectorOutput[]) => boolean;
|
|
166
164
|
'popup-scroll': ({ scrollTop, scrollLeft }: {
|
|
167
165
|
scrollTop: number;
|
|
@@ -174,74 +172,74 @@ export declare const faSelectPageEmits: {
|
|
|
174
172
|
blur: (evt: FocusEvent) => boolean;
|
|
175
173
|
clear: () => boolean;
|
|
176
174
|
};
|
|
177
|
-
/** FaSelectPage
|
|
175
|
+
/** FaSelectPage 的插槽参数 */
|
|
178
176
|
export interface FaSelectPageSlots extends Record<string, unknown> {
|
|
179
|
-
/**
|
|
177
|
+
/** FaSelectOption 默认内容插槽 */
|
|
180
178
|
default: ElSelectorOutput;
|
|
181
|
-
/**
|
|
179
|
+
/** 下拉列表顶部的内容 */
|
|
182
180
|
header: never;
|
|
183
|
-
/**
|
|
181
|
+
/** 下拉列表底部的内容 */
|
|
184
182
|
footer: never;
|
|
185
|
-
/**
|
|
183
|
+
/** Select 组件头部内容 */
|
|
186
184
|
prefix: never;
|
|
187
|
-
/**
|
|
185
|
+
/** 无选项时的列表 */
|
|
188
186
|
empty: never;
|
|
189
|
-
/**
|
|
187
|
+
/** select 组件自定义标签内容 */
|
|
190
188
|
tag: never;
|
|
191
|
-
/**
|
|
189
|
+
/** Select 组件自定义加载内容 */
|
|
192
190
|
loading: never;
|
|
193
|
-
/**
|
|
191
|
+
/** select 组件自定义标签内容 */
|
|
194
192
|
label: {
|
|
195
193
|
label: string;
|
|
196
194
|
value: string | number | boolean | object;
|
|
197
195
|
};
|
|
198
196
|
}
|
|
199
197
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
200
|
-
/**
|
|
198
|
+
/** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
|
|
201
199
|
disabled: {
|
|
202
200
|
type: BooleanConstructor;
|
|
203
201
|
default: undefined;
|
|
204
202
|
};
|
|
205
|
-
/**
|
|
203
|
+
/** 远程数据加载时显示的文本;默认显示“加载中...”。 */
|
|
206
204
|
loadingText: {
|
|
207
205
|
type: StringConstructor;
|
|
208
206
|
default: string;
|
|
209
207
|
};
|
|
210
|
-
/**
|
|
208
|
+
/** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
|
|
211
209
|
noMatchText: {
|
|
212
210
|
type: StringConstructor;
|
|
213
211
|
default: string;
|
|
214
212
|
};
|
|
215
|
-
/**
|
|
213
|
+
/** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
|
|
216
214
|
noDataText: {
|
|
217
215
|
type: StringConstructor;
|
|
218
216
|
default: string;
|
|
219
217
|
};
|
|
220
|
-
/**
|
|
218
|
+
/** 多选时是否折叠已选标签 */
|
|
221
219
|
collapseTags: {
|
|
222
220
|
type: BooleanConstructor;
|
|
223
221
|
default: boolean;
|
|
224
222
|
};
|
|
225
|
-
/**
|
|
223
|
+
/** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
|
|
226
224
|
collapseTagsTooltip: {
|
|
227
225
|
type: BooleanConstructor;
|
|
228
226
|
default: boolean;
|
|
229
227
|
};
|
|
230
|
-
/**
|
|
228
|
+
/** v-model 绑定值 */
|
|
231
229
|
modelValue: {
|
|
232
230
|
type: import("vue").PropType<ElSelectorModelValue>;
|
|
233
231
|
default: undefined;
|
|
234
232
|
};
|
|
235
|
-
/**
|
|
233
|
+
/** v-model:label 绑定值 */
|
|
236
234
|
label: import("vue").PropType<string | string[] | null>;
|
|
237
|
-
/**
|
|
235
|
+
/** 宽度 */
|
|
238
236
|
width: {
|
|
239
237
|
type: (NumberConstructor | StringConstructor)[];
|
|
240
238
|
default: string;
|
|
241
239
|
};
|
|
242
|
-
/**
|
|
240
|
+
/** 插槽使用的附加状态 */
|
|
243
241
|
moreDetail: BooleanConstructor;
|
|
244
|
-
/**
|
|
242
|
+
/** 配置选项 */
|
|
245
243
|
props: {
|
|
246
244
|
type: import("vue").PropType<SelectComponentProps>;
|
|
247
245
|
default: () => {
|
|
@@ -251,7 +249,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
251
249
|
children: string;
|
|
252
250
|
};
|
|
253
251
|
};
|
|
254
|
-
/**
|
|
252
|
+
/** 请求数据的函数 */
|
|
255
253
|
requestApi: {
|
|
256
254
|
type: import("vue").PropType<(params?: PagedInput) => Promise<PagedResult<ElSelectorOutput>>>;
|
|
257
255
|
required: true;
|
|
@@ -277,9 +275,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
277
275
|
allowCreate: BooleanConstructor;
|
|
278
276
|
loading: BooleanConstructor;
|
|
279
277
|
popperClass: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue)) | null)[], unknown, unknown, string, boolean>;
|
|
280
|
-
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (
|
|
281
|
-
/** @description 下拉列表底部的内容 */
|
|
282
|
-
...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
278
|
+
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
283
279
|
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>) | (((new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>)) | null)[], unknown, unknown, () => Partial<import("element-plus").Options>, boolean>;
|
|
284
280
|
remote: BooleanConstructor;
|
|
285
281
|
debounce: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
@@ -347,15 +343,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
347
343
|
__epPropKey: true;
|
|
348
344
|
};
|
|
349
345
|
}>, {
|
|
350
|
-
/**
|
|
346
|
+
/** 使选择器的输入框获取焦点 */
|
|
351
347
|
focus: import("vue").ComputedRef<(() => void) | undefined>;
|
|
352
|
-
/**
|
|
348
|
+
/** 使选择器的输入框失去焦点,并隐藏下拉框 */
|
|
353
349
|
blur: import("vue").ComputedRef<(() => void) | undefined>;
|
|
354
|
-
/**
|
|
350
|
+
/** 获取当前选中的标签 */
|
|
355
351
|
selectedLabel: import("vue").ComputedRef<string | string[] | undefined>;
|
|
356
|
-
/**
|
|
352
|
+
/** 加载状态 */
|
|
357
353
|
loading: import("vue").Ref<boolean, boolean>;
|
|
358
|
-
/**
|
|
354
|
+
/** 选中的数据 */
|
|
359
355
|
selectedList: import("vue").ComputedRef<{
|
|
360
356
|
[x: string]: any;
|
|
361
357
|
label?: string | undefined;
|
|
@@ -365,20 +361,20 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
365
361
|
disabled?: boolean | undefined;
|
|
366
362
|
children?: /*elided*/ any[] | undefined;
|
|
367
363
|
}[]>;
|
|
368
|
-
/**
|
|
364
|
+
/** 刷新 */
|
|
369
365
|
refresh: (pageIndex?: number) => Promise<void>;
|
|
370
|
-
/**
|
|
366
|
+
/** 设置选择 */
|
|
371
367
|
setSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => void;
|
|
372
|
-
/**
|
|
368
|
+
/** 清除选择 */
|
|
373
369
|
clearSelection: () => void;
|
|
374
370
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
375
|
-
/**
|
|
371
|
+
/** v-model 回调 */
|
|
376
372
|
"update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
|
|
377
|
-
/**
|
|
373
|
+
/** 选中数据改变 */
|
|
378
374
|
change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
|
|
379
|
-
/**
|
|
375
|
+
/** v-model:label 回调 */
|
|
380
376
|
"update:label": (value: string | string[] | null) => boolean;
|
|
381
|
-
/**
|
|
377
|
+
/** 数据改变 */
|
|
382
378
|
dataChange: (data: ElSelectorOutput[]) => boolean;
|
|
383
379
|
'popup-scroll': ({ scrollTop, scrollLeft }: {
|
|
384
380
|
scrollTop: number;
|
|
@@ -391,51 +387,51 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
391
387
|
blur: (evt: FocusEvent) => boolean;
|
|
392
388
|
clear: () => boolean;
|
|
393
389
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
394
|
-
/**
|
|
390
|
+
/** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
|
|
395
391
|
disabled: {
|
|
396
392
|
type: BooleanConstructor;
|
|
397
393
|
default: undefined;
|
|
398
394
|
};
|
|
399
|
-
/**
|
|
395
|
+
/** 远程数据加载时显示的文本;默认显示“加载中...”。 */
|
|
400
396
|
loadingText: {
|
|
401
397
|
type: StringConstructor;
|
|
402
398
|
default: string;
|
|
403
399
|
};
|
|
404
|
-
/**
|
|
400
|
+
/** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
|
|
405
401
|
noMatchText: {
|
|
406
402
|
type: StringConstructor;
|
|
407
403
|
default: string;
|
|
408
404
|
};
|
|
409
|
-
/**
|
|
405
|
+
/** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
|
|
410
406
|
noDataText: {
|
|
411
407
|
type: StringConstructor;
|
|
412
408
|
default: string;
|
|
413
409
|
};
|
|
414
|
-
/**
|
|
410
|
+
/** 多选时是否折叠已选标签 */
|
|
415
411
|
collapseTags: {
|
|
416
412
|
type: BooleanConstructor;
|
|
417
413
|
default: boolean;
|
|
418
414
|
};
|
|
419
|
-
/**
|
|
415
|
+
/** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
|
|
420
416
|
collapseTagsTooltip: {
|
|
421
417
|
type: BooleanConstructor;
|
|
422
418
|
default: boolean;
|
|
423
419
|
};
|
|
424
|
-
/**
|
|
420
|
+
/** v-model 绑定值 */
|
|
425
421
|
modelValue: {
|
|
426
422
|
type: import("vue").PropType<ElSelectorModelValue>;
|
|
427
423
|
default: undefined;
|
|
428
424
|
};
|
|
429
|
-
/**
|
|
425
|
+
/** v-model:label 绑定值 */
|
|
430
426
|
label: import("vue").PropType<string | string[] | null>;
|
|
431
|
-
/**
|
|
427
|
+
/** 宽度 */
|
|
432
428
|
width: {
|
|
433
429
|
type: (NumberConstructor | StringConstructor)[];
|
|
434
430
|
default: string;
|
|
435
431
|
};
|
|
436
|
-
/**
|
|
432
|
+
/** 插槽使用的附加状态 */
|
|
437
433
|
moreDetail: BooleanConstructor;
|
|
438
|
-
/**
|
|
434
|
+
/** 配置选项 */
|
|
439
435
|
props: {
|
|
440
436
|
type: import("vue").PropType<SelectComponentProps>;
|
|
441
437
|
default: () => {
|
|
@@ -445,7 +441,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
445
441
|
children: string;
|
|
446
442
|
};
|
|
447
443
|
};
|
|
448
|
-
/**
|
|
444
|
+
/** 请求数据的函数 */
|
|
449
445
|
requestApi: {
|
|
450
446
|
type: import("vue").PropType<(params?: PagedInput) => Promise<PagedResult<ElSelectorOutput>>>;
|
|
451
447
|
required: true;
|
|
@@ -471,9 +467,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
471
467
|
allowCreate: BooleanConstructor;
|
|
472
468
|
loading: BooleanConstructor;
|
|
473
469
|
popperClass: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | (((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue)) | null)[], unknown, unknown, string, boolean>;
|
|
474
|
-
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (
|
|
475
|
-
/** @description 下拉列表底部的内容 */
|
|
476
|
-
...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
470
|
+
popperStyle: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
477
471
|
popperOptions: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>) | (((new (...args: any[]) => Partial<import("element-plus").Options>) | (() => Partial<import("element-plus").Options>)) | null)[], unknown, unknown, () => Partial<import("element-plus").Options>, boolean>;
|
|
478
472
|
remote: BooleanConstructor;
|
|
479
473
|
debounce: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
@@ -578,27 +572,27 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
578
572
|
teleported: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
579
573
|
width: string | number;
|
|
580
574
|
filterable: boolean;
|
|
581
|
-
loadingText: string;
|
|
582
575
|
valueOnClear: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | null)[], unknown, unknown>;
|
|
576
|
+
allowCreate: boolean;
|
|
583
577
|
automaticDropdown: boolean;
|
|
584
|
-
moreDetail: boolean;
|
|
585
|
-
noMatchText: string;
|
|
586
|
-
noDataText: string;
|
|
587
578
|
collapseTags: boolean;
|
|
588
579
|
collapseTagsTooltip: boolean;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
580
|
+
tagTooltip: import("element-plus").TagTooltipProps;
|
|
581
|
+
maxCollapseTags: number;
|
|
582
|
+
defaultFirstOption: boolean;
|
|
583
|
+
loadingText: string;
|
|
592
584
|
multiple: boolean;
|
|
593
585
|
multipleLimit: number;
|
|
594
|
-
|
|
586
|
+
noDataText: string;
|
|
587
|
+
noMatchText: string;
|
|
595
588
|
reserveKeyword: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
589
|
+
remote: boolean;
|
|
590
|
+
debounce: number;
|
|
596
591
|
valueKey: string;
|
|
597
|
-
|
|
598
|
-
maxCollapseTags: number;
|
|
599
|
-
fitInputWidth: boolean;
|
|
592
|
+
remoteShowSuffix: boolean;
|
|
600
593
|
tagType: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>;
|
|
601
594
|
tagEffect: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "plain" | "dark" | "light", unknown>;
|
|
602
|
-
|
|
595
|
+
fitInputWidth: boolean;
|
|
596
|
+
moreDetail: boolean;
|
|
603
597
|
}, import("../../../utils").TypedSlotsDeclaration<FaSelectPageSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
604
598
|
export default _default;
|
|
@@ -7,44 +7,44 @@ import { useRender } from "../../../utils/vue/render.mjs";
|
|
|
7
7
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
8
8
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
9
9
|
import { FaSelectOption } from "../../select/index.mjs";
|
|
10
|
-
import { Fragment, computed, createTextVNode, createVNode, defineComponent, mergeProps, reactive, shallowRef, toRef, useModel, watch } from "vue";
|
|
10
|
+
import { Fragment, computed, createTextVNode, createVNode, defineComponent, mergeProps, onBeforeUnmount, reactive, shallowRef, toRef, useModel, watch } from "vue";
|
|
11
11
|
import { Search } from "@element-plus/icons-vue";
|
|
12
12
|
import { ElButton, ElInput, ElOption, ElPagination, ElSelect, selectEmits, selectProps, useGlobalSize } from "element-plus";
|
|
13
13
|
//#region src/components/selectPage/src/selectPage.tsx
|
|
14
|
-
/** FaSelectPage 的运行时 Props
|
|
14
|
+
/** FaSelectPage 的运行时 Props 定义 */
|
|
15
15
|
const faSelectPageProps = {
|
|
16
16
|
...selectProps,
|
|
17
|
-
/**
|
|
17
|
+
/** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
|
|
18
18
|
disabled: {
|
|
19
19
|
type: Boolean,
|
|
20
20
|
default: void 0
|
|
21
21
|
},
|
|
22
|
-
/**
|
|
22
|
+
/** 远程数据加载时显示的文本;默认显示“加载中...”。 */
|
|
23
23
|
loadingText: {
|
|
24
24
|
type: String,
|
|
25
25
|
default: "加载中..."
|
|
26
26
|
},
|
|
27
|
-
/**
|
|
27
|
+
/** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
|
|
28
28
|
noMatchText: {
|
|
29
29
|
type: String,
|
|
30
30
|
default: "暂无匹配的数据"
|
|
31
31
|
},
|
|
32
|
-
/**
|
|
32
|
+
/** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
|
|
33
33
|
noDataText: {
|
|
34
34
|
type: String,
|
|
35
35
|
default: "暂无数据"
|
|
36
36
|
},
|
|
37
|
-
/**
|
|
37
|
+
/** 多选时是否折叠已选标签 */
|
|
38
38
|
collapseTags: {
|
|
39
39
|
type: Boolean,
|
|
40
40
|
default: true
|
|
41
41
|
},
|
|
42
|
-
/**
|
|
42
|
+
/** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
|
|
43
43
|
collapseTagsTooltip: {
|
|
44
44
|
type: Boolean,
|
|
45
45
|
default: true
|
|
46
46
|
},
|
|
47
|
-
/**
|
|
47
|
+
/** v-model 绑定值 */
|
|
48
48
|
modelValue: {
|
|
49
49
|
type: definePropType([
|
|
50
50
|
String,
|
|
@@ -55,16 +55,16 @@ const faSelectPageProps = {
|
|
|
55
55
|
]),
|
|
56
56
|
default: void 0
|
|
57
57
|
},
|
|
58
|
-
/**
|
|
58
|
+
/** v-model:label 绑定值 */
|
|
59
59
|
label: definePropType([String, Array]),
|
|
60
|
-
/**
|
|
60
|
+
/** 宽度 */
|
|
61
61
|
width: {
|
|
62
62
|
type: [String, Number],
|
|
63
63
|
default: "100%"
|
|
64
64
|
},
|
|
65
|
-
/**
|
|
65
|
+
/** 插槽使用的附加状态 */
|
|
66
66
|
moreDetail: Boolean,
|
|
67
|
-
/**
|
|
67
|
+
/** 配置选项 */
|
|
68
68
|
props: {
|
|
69
69
|
type: definePropType(Object),
|
|
70
70
|
default: () => ({
|
|
@@ -74,7 +74,7 @@ const faSelectPageProps = {
|
|
|
74
74
|
children: "children"
|
|
75
75
|
})
|
|
76
76
|
},
|
|
77
|
-
/**
|
|
77
|
+
/** 请求数据的函数 */
|
|
78
78
|
requestApi: {
|
|
79
79
|
type: definePropType(Function),
|
|
80
80
|
required: true
|
|
@@ -86,16 +86,16 @@ const faSelectPageProps = {
|
|
|
86
86
|
Object
|
|
87
87
|
])
|
|
88
88
|
};
|
|
89
|
-
/** FaSelectPage 的运行时 Emits
|
|
89
|
+
/** FaSelectPage 的运行时 Emits 定义 */
|
|
90
90
|
const faSelectPageEmits = {
|
|
91
91
|
...selectEmits,
|
|
92
|
-
/**
|
|
92
|
+
/** v-model 回调 */
|
|
93
93
|
"update:modelValue": (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object" && value !== null || value == null,
|
|
94
|
-
/**
|
|
94
|
+
/** 选中数据改变 */
|
|
95
95
|
change: (_data, _value) => true,
|
|
96
|
-
/**
|
|
96
|
+
/** v-model:label 回调 */
|
|
97
97
|
"update:label": (value) => typeof value === "string" || Array.isArray(value) || value === null,
|
|
98
|
-
/**
|
|
98
|
+
/** 数据改变 */
|
|
99
99
|
dataChange: (data) => Array.isArray(data)
|
|
100
100
|
};
|
|
101
101
|
var selectPage_default = defineComponent({
|
|
@@ -126,6 +126,7 @@ var selectPage_default = defineComponent({
|
|
|
126
126
|
defaultSelectorData: withDefineType()
|
|
127
127
|
});
|
|
128
128
|
let requestVersion = 0;
|
|
129
|
+
let disposed = false;
|
|
129
130
|
const handleData = (data) => {
|
|
130
131
|
return data.map((item) => {
|
|
131
132
|
const value = item[props.valueKey];
|
|
@@ -144,7 +145,9 @@ var selectPage_default = defineComponent({
|
|
|
144
145
|
};
|
|
145
146
|
}).filter((item) => item.hide !== true);
|
|
146
147
|
};
|
|
148
|
+
const flattenOptions = (data) => data.flatMap((item) => [item, ...flattenOptions(item.children ?? [])]);
|
|
147
149
|
const loadData = async (pageIndex) => {
|
|
150
|
+
if (disposed) return;
|
|
148
151
|
const currentRequestVersion = ++requestVersion;
|
|
149
152
|
state.loading = true;
|
|
150
153
|
state.pageIndex = pageIndex ?? state.pageIndex;
|
|
@@ -156,19 +159,20 @@ var selectPage_default = defineComponent({
|
|
|
156
159
|
};
|
|
157
160
|
try {
|
|
158
161
|
const resData = await props.requestApi(params);
|
|
159
|
-
if (currentRequestVersion !== requestVersion) return;
|
|
162
|
+
if (disposed || currentRequestVersion !== requestVersion) return;
|
|
160
163
|
state.echo = false;
|
|
161
164
|
state.totalRows = resData.totalRows ?? 0;
|
|
162
165
|
state.selectorData = handleData(resData.rows ?? []);
|
|
166
|
+
state.defaultSelectorData &&= flattenOptions(state.selectorData).find((item) => isEqual(item.value, state.defaultSelectorData?.value)) ?? state.defaultSelectorData;
|
|
163
167
|
emit("dataChange", state.selectorData);
|
|
164
168
|
} catch (error) {
|
|
165
|
-
if (currentRequestVersion !== requestVersion) return;
|
|
169
|
+
if (disposed || currentRequestVersion !== requestVersion) return;
|
|
166
170
|
state.pageIndex = 1;
|
|
167
171
|
state.totalRows = 0;
|
|
168
172
|
state.selectorData = [];
|
|
169
173
|
throw error;
|
|
170
174
|
} finally {
|
|
171
|
-
if (currentRequestVersion === requestVersion) state.loading = false;
|
|
175
|
+
if (!disposed && currentRequestVersion === requestVersion) state.loading = false;
|
|
172
176
|
}
|
|
173
177
|
};
|
|
174
178
|
const pageIndexModel = computed({
|
|
@@ -193,12 +197,11 @@ var selectPage_default = defineComponent({
|
|
|
193
197
|
}
|
|
194
198
|
emit("visible-change", visible);
|
|
195
199
|
};
|
|
196
|
-
const flattenOptions = (data) => data.flatMap((item) => [item, ...flattenOptions(item.children ?? [])]);
|
|
197
200
|
const handleChange = (value) => {
|
|
198
201
|
const selectorData = flattenOptions([
|
|
202
|
+
...state.selectorData,
|
|
199
203
|
...state.selectedList,
|
|
200
|
-
...state.defaultSelectorData ? [state.defaultSelectorData] : []
|
|
201
|
-
...state.selectorData
|
|
204
|
+
...state.defaultSelectorData ? [state.defaultSelectorData] : []
|
|
202
205
|
]);
|
|
203
206
|
if (props.multiple) {
|
|
204
207
|
const valueList = Array.isArray(value) ? value : [];
|
|
@@ -254,9 +257,9 @@ var selectPage_default = defineComponent({
|
|
|
254
257
|
}, { immediate: true });
|
|
255
258
|
watch([() => state.value, () => state.selectorData], ([value]) => {
|
|
256
259
|
const selectorData = flattenOptions([
|
|
260
|
+
...state.selectorData,
|
|
257
261
|
...state.selectedList,
|
|
258
|
-
...state.defaultSelectorData ? [state.defaultSelectorData] : []
|
|
259
|
-
...state.selectorData
|
|
262
|
+
...state.defaultSelectorData ? [state.defaultSelectorData] : []
|
|
260
263
|
]);
|
|
261
264
|
if (props.multiple) {
|
|
262
265
|
if (!Array.isArray(value)) {
|
|
@@ -272,6 +275,7 @@ var selectPage_default = defineComponent({
|
|
|
272
275
|
}
|
|
273
276
|
if (value == null || Array.isArray(value)) {
|
|
274
277
|
state.selectedList = [];
|
|
278
|
+
state.defaultSelectorData = void 0;
|
|
275
279
|
selectedLabel.value = null;
|
|
276
280
|
return;
|
|
277
281
|
}
|
|
@@ -285,10 +289,20 @@ var selectPage_default = defineComponent({
|
|
|
285
289
|
});
|
|
286
290
|
watch(() => props.initParam, (newValue, oldValue) => {
|
|
287
291
|
if (!isEqual(newValue, oldValue)) {
|
|
292
|
+
requestVersion++;
|
|
293
|
+
state.loading = false;
|
|
294
|
+
state.selectorData = [];
|
|
295
|
+
state.selectedList = [];
|
|
296
|
+
state.defaultSelectorData = void 0;
|
|
297
|
+
state.pageIndex = 1;
|
|
288
298
|
state.nextRefresh = true;
|
|
289
299
|
if (state.value != null) handleModelValueUpdate(props.multiple ? [] : void 0);
|
|
290
300
|
}
|
|
291
301
|
});
|
|
302
|
+
onBeforeUnmount(() => {
|
|
303
|
+
disposed = true;
|
|
304
|
+
requestVersion++;
|
|
305
|
+
});
|
|
292
306
|
const elSelectProps = useProps(props, selectProps, [
|
|
293
307
|
"modelValue",
|
|
294
308
|
"popperClass",
|
|
@@ -369,21 +383,21 @@ var selectPage_default = defineComponent({
|
|
|
369
383
|
}) ?? [] }
|
|
370
384
|
}));
|
|
371
385
|
return useExpose(expose, {
|
|
372
|
-
/**
|
|
386
|
+
/** 使选择器的输入框获取焦点 */
|
|
373
387
|
focus: computed(() => selectRef.value?.focus),
|
|
374
|
-
/**
|
|
388
|
+
/** 使选择器的输入框失去焦点,并隐藏下拉框 */
|
|
375
389
|
blur: computed(() => selectRef.value?.blur),
|
|
376
|
-
/**
|
|
390
|
+
/** 获取当前选中的标签 */
|
|
377
391
|
selectedLabel: computed(() => selectRef.value?.selectedLabel),
|
|
378
|
-
/**
|
|
392
|
+
/** 加载状态 */
|
|
379
393
|
loading: toRef(state, "loading"),
|
|
380
|
-
/**
|
|
394
|
+
/** 选中的数据 */
|
|
381
395
|
selectedList: computed(() => state.selectedList),
|
|
382
|
-
/**
|
|
396
|
+
/** 刷新 */
|
|
383
397
|
refresh: loadData,
|
|
384
|
-
/**
|
|
398
|
+
/** 设置选择 */
|
|
385
399
|
setSelection: (value) => handleModelValueUpdate(value),
|
|
386
|
-
/**
|
|
400
|
+
/** 清除选择 */
|
|
387
401
|
clearSelection: () => handleModelValueUpdate(props.multiple ? [] : void 0)
|
|
388
402
|
});
|
|
389
403
|
}
|