fast-element-plus 2.0.19 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +40 -20
  2. package/CONTRIBUTING.md +3 -4
  3. package/README.md +80 -27
  4. package/README.zh.md +66 -27
  5. package/dist/component.d.ts +110 -110
  6. package/dist/components/avatar/src/avatar.d.ts +26 -26
  7. package/dist/components/avatar/src/avatar.mjs +10 -10
  8. package/dist/components/avatar/src/avatar.mjs.map +1 -1
  9. package/dist/components/button/src/button.d.ts +32 -27
  10. package/dist/components/button/src/button.mjs +57 -36
  11. package/dist/components/button/src/button.mjs.map +1 -1
  12. package/dist/components/carNumber/src/carNumber.d.ts +8 -8
  13. package/dist/components/carNumber/src/carNumber.mjs +5 -5
  14. package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
  15. package/dist/components/contextMenu/src/contextMenu.d.ts +6 -6
  16. package/dist/components/contextMenu/src/contextMenu.mjs +5 -5
  17. package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
  18. package/dist/components/contextMenu/src/contextMenu.type.d.ts +7 -7
  19. package/dist/components/dialog/src/dialog.d.ts +74 -74
  20. package/dist/components/dialog/src/dialog.mjs +31 -31
  21. package/dist/components/dialog/src/dialog.mjs.map +1 -1
  22. package/dist/components/drawer/src/drawer.d.ts +57 -57
  23. package/dist/components/drawer/src/drawer.mjs +24 -24
  24. package/dist/components/drawer/src/drawer.mjs.map +1 -1
  25. package/dist/components/form/src/form.d.ts +30 -30
  26. package/dist/components/form/src/form.mjs +16 -16
  27. package/dist/components/form/src/form.mjs.map +1 -1
  28. package/dist/components/form/src/formItem.d.ts +30 -30
  29. package/dist/components/form/src/formItem.mjs +13 -13
  30. package/dist/components/form/src/formItem.mjs.map +1 -1
  31. package/dist/components/formItemTip/src/formItemTip.d.ts +9 -9
  32. package/dist/components/formItemTip/src/formItemTip.mjs +3 -3
  33. package/dist/components/formItemTip/src/formItemTip.mjs.map +1 -1
  34. package/dist/components/icon/src/icon.d.ts +10 -10
  35. package/dist/components/icon/src/icon.mjs +4 -4
  36. package/dist/components/icon/src/icon.mjs.map +1 -1
  37. package/dist/components/iconSelector/src/iconSelector.d.ts +6 -6
  38. package/dist/components/iconSelector/src/iconSelector.mjs +4 -4
  39. package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
  40. package/dist/components/image/src/image.d.ts +36 -36
  41. package/dist/components/image/src/image.mjs +11 -11
  42. package/dist/components/image/src/image.mjs.map +1 -1
  43. package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +37 -37
  44. package/dist/components/inputDialogPage/src/inputDialogPage.mjs +16 -16
  45. package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
  46. package/dist/components/layoutGrid/src/layoutGrid.d.ts +12 -12
  47. package/dist/components/layoutGrid/src/layoutGrid.mjs +6 -6
  48. package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
  49. package/dist/components/layoutGrid/src/layoutGridItem.d.ts +18 -18
  50. package/dist/components/layoutGrid/src/layoutGridItem.mjs +8 -8
  51. package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
  52. package/dist/components/select/src/select.d.ts +88 -88
  53. package/dist/components/select/src/select.mjs +28 -28
  54. package/dist/components/select/src/select.mjs.map +1 -1
  55. package/dist/components/select/src/selectOption.d.ts +13 -13
  56. package/dist/components/select/src/selectOption.mjs +6 -6
  57. package/dist/components/select/src/selectOption.mjs.map +1 -1
  58. package/dist/components/selectPage/src/selectPage.d.ts +78 -84
  59. package/dist/components/selectPage/src/selectPage.mjs +49 -35
  60. package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
  61. package/dist/components/selectV2/index.mjs +2 -1
  62. package/dist/components/selectV2/index.mjs.map +1 -1
  63. package/dist/components/selectV2/src/selectV2.d.ts +160 -851
  64. package/dist/components/selectV2/src/selectV2.mjs +30 -338
  65. package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
  66. package/dist/components/table/index.mjs +3 -2
  67. package/dist/components/table/index.mjs.map +1 -1
  68. package/dist/components/table/src/page.type.d.ts +1 -1
  69. package/dist/components/table/src/table.d.ts +211 -744
  70. package/dist/components/table/src/table.mjs +111 -307
  71. package/dist/components/table/src/table.mjs.map +1 -1
  72. package/dist/components/table/src/table.state.d.ts +3 -3
  73. package/dist/components/table/src/table.type.d.ts +1 -9
  74. package/dist/components/table/src/table.type.mjs.map +1 -1
  75. package/dist/components/table/src/tableColumn.d.ts +102 -399
  76. package/dist/components/table/src/tableColumn.mjs +28 -185
  77. package/dist/components/table/src/tableColumn.mjs.map +1 -1
  78. package/dist/components/table/src/tableColumnSettingDialog.d.ts +4 -4
  79. package/dist/components/table/src/tableColumnSettingDialog.mjs +3 -3
  80. package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
  81. package/dist/components/table/src/tablePagination.d.ts +4 -4
  82. package/dist/components/table/src/tablePagination.mjs +3 -3
  83. package/dist/components/table/src/tablePagination.mjs.map +1 -1
  84. package/dist/components/table/src/tableSearchForm.d.ts +12 -12
  85. package/dist/components/table/src/tableSearchForm.mjs +6 -6
  86. package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
  87. package/dist/components/table/src/tableSearchFormItem.d.ts +4 -4
  88. package/dist/components/table/src/tableSearchFormItem.mjs +2 -2
  89. package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
  90. package/dist/components/table/src/useTable.d.ts +1 -0
  91. package/dist/components/table/src/useTable.mjs +109 -65
  92. package/dist/components/table/src/useTable.mjs.map +1 -1
  93. package/dist/components/table/utils/table.d.ts +4 -4
  94. package/dist/components/table/utils/table.mjs +4 -4
  95. package/dist/components/table/utils/table.mjs.map +1 -1
  96. package/dist/components/tree/src/tree.d.ts +86 -86
  97. package/dist/components/tree/src/tree.mjs +46 -46
  98. package/dist/components/tree/src/tree.mjs.map +1 -1
  99. package/dist/components/treeSelect/src/treeSelect.d.ts +144 -150
  100. package/dist/components/treeSelect/src/treeSelect.mjs +55 -55
  101. package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
  102. package/dist/components/upload/src/upload.d.ts +36 -36
  103. package/dist/components/upload/src/upload.mjs +17 -17
  104. package/dist/components/upload/src/upload.mjs.map +1 -1
  105. package/dist/components/uploadImage/src/uploadImage.d.ts +47 -47
  106. package/dist/components/uploadImage/src/uploadImage.mjs +23 -23
  107. package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
  108. package/dist/components/uploadImages/src/uploadImages.d.ts +41 -41
  109. package/dist/components/uploadImages/src/uploadImages.mjs +21 -21
  110. package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
  111. package/dist/directives/click-debounce/index.mjs +19 -11
  112. package/dist/directives/click-debounce/index.mjs.map +1 -1
  113. package/dist/directives/click-throttle/index.d.ts +4 -2
  114. package/dist/directives/click-throttle/index.mjs +21 -11
  115. package/dist/directives/click-throttle/index.mjs.map +1 -1
  116. package/dist/index.global.min.js +3 -3
  117. package/dist/index.global.min.js.map +1 -1
  118. package/dist/index.mjs +3 -3
  119. package/dist/internal/props.d.ts +685 -0
  120. package/dist/internal/props.mjs +683 -0
  121. package/dist/internal/props.mjs.map +1 -0
  122. package/dist/utils/loading-tasks.d.ts +5 -0
  123. package/dist/utils/loading-tasks.mjs +32 -0
  124. package/dist/utils/loading-tasks.mjs.map +1 -0
  125. package/dist/version.d.ts +1 -1
  126. package/dist/version.mjs +1 -1
  127. package/dist/version.mjs.map +1 -1
  128. 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
- /** @description whether Select is disabled 重载使其支持 ElForm*/
6
+ /** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
7
7
  disabled: {
8
8
  type: BooleanConstructor;
9
9
  default: undefined;
10
10
  };
11
- /** @description displayed text while loading data from server, default is 'Loading' */
11
+ /** 远程数据加载时显示的文本;默认显示“加载中...”。 */
12
12
  loadingText: {
13
13
  type: StringConstructor;
14
14
  default: string;
15
15
  };
16
- /** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */
16
+ /** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
17
17
  noMatchText: {
18
18
  type: StringConstructor;
19
19
  default: string;
20
20
  };
21
- /** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */
21
+ /** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
22
22
  noDataText: {
23
23
  type: StringConstructor;
24
24
  default: string;
25
25
  };
26
- /** @description whether to collapse tags to a text when multiple selecting */
26
+ /** 多选时是否折叠已选标签 */
27
27
  collapseTags: {
28
28
  type: BooleanConstructor;
29
29
  default: boolean;
30
30
  };
31
- /** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */
31
+ /** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
32
32
  collapseTagsTooltip: {
33
33
  type: BooleanConstructor;
34
34
  default: boolean;
35
35
  };
36
- /** @description v-model绑定值 */
36
+ /** v-model 绑定值 */
37
37
  modelValue: {
38
38
  type: import("vue").PropType<ElSelectorModelValue>;
39
39
  default: undefined;
40
40
  };
41
- /** @description v-model:label绑定值 */
41
+ /** v-model:label 绑定值 */
42
42
  label: import("vue").PropType<string | string[] | null>;
43
- /** @description 宽度 */
43
+ /** 宽度 */
44
44
  width: {
45
45
  type: (NumberConstructor | StringConstructor)[];
46
46
  default: string;
47
47
  };
48
- /** @description 更多细节,只有使用slot的时候有用 */
48
+ /** 插槽使用的附加状态 */
49
49
  moreDetail: BooleanConstructor;
50
- /** @description 配置选项 */
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
- /** @description 请求api */
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
- /** @description v-model 回调 */
156
+ /** v-model 回调 */
159
157
  "update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
160
- /** @description 选中数据改变 */
158
+ /** 选中数据改变 */
161
159
  change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
162
- /** @description v-model:label 回调 */
160
+ /** v-model:label 回调 */
163
161
  "update:label": (value: string | string[] | null) => boolean;
164
- /** @description 数据改变 */
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
- /** @description FaSelectOption 默认内容插槽 */
177
+ /** FaSelectOption 默认内容插槽 */
180
178
  default: ElSelectorOutput;
181
- /** @description 下拉列表顶部的内容 */
179
+ /** 下拉列表顶部的内容 */
182
180
  header: never;
183
- /** @description 下拉列表底部的内容 */
181
+ /** 下拉列表底部的内容 */
184
182
  footer: never;
185
- /** @description Select 组件头部内容 */
183
+ /** Select 组件头部内容 */
186
184
  prefix: never;
187
- /** @description 无选项时的列表 */
185
+ /** 无选项时的列表 */
188
186
  empty: never;
189
- /** @description select 组件自定义标签内容 */
187
+ /** select 组件自定义标签内容 */
190
188
  tag: never;
191
- /** @description select 组件自定义 loading内容 */
189
+ /** Select 组件自定义加载内容 */
192
190
  loading: never;
193
- /** @description select 组件自定义标签内容 */
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
- /** @description whether Select is disabled 重载使其支持 ElForm*/
198
+ /** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
201
199
  disabled: {
202
200
  type: BooleanConstructor;
203
201
  default: undefined;
204
202
  };
205
- /** @description displayed text while loading data from server, default is 'Loading' */
203
+ /** 远程数据加载时显示的文本;默认显示“加载中...”。 */
206
204
  loadingText: {
207
205
  type: StringConstructor;
208
206
  default: string;
209
207
  };
210
- /** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */
208
+ /** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
211
209
  noMatchText: {
212
210
  type: StringConstructor;
213
211
  default: string;
214
212
  };
215
- /** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */
213
+ /** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
216
214
  noDataText: {
217
215
  type: StringConstructor;
218
216
  default: string;
219
217
  };
220
- /** @description whether to collapse tags to a text when multiple selecting */
218
+ /** 多选时是否折叠已选标签 */
221
219
  collapseTags: {
222
220
  type: BooleanConstructor;
223
221
  default: boolean;
224
222
  };
225
- /** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */
223
+ /** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
226
224
  collapseTagsTooltip: {
227
225
  type: BooleanConstructor;
228
226
  default: boolean;
229
227
  };
230
- /** @description v-model绑定值 */
228
+ /** v-model 绑定值 */
231
229
  modelValue: {
232
230
  type: import("vue").PropType<ElSelectorModelValue>;
233
231
  default: undefined;
234
232
  };
235
- /** @description v-model:label绑定值 */
233
+ /** v-model:label 绑定值 */
236
234
  label: import("vue").PropType<string | string[] | null>;
237
- /** @description 宽度 */
235
+ /** 宽度 */
238
236
  width: {
239
237
  type: (NumberConstructor | StringConstructor)[];
240
238
  default: string;
241
239
  };
242
- /** @description 更多细节,只有使用slot的时候有用 */
240
+ /** 插槽使用的附加状态 */
243
241
  moreDetail: BooleanConstructor;
244
- /** @description 配置选项 */
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
- /** @description 请求api */
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
- /** @description 使选择器的输入框获取焦点 */
346
+ /** 使选择器的输入框获取焦点 */
351
347
  focus: import("vue").ComputedRef<(() => void) | undefined>;
352
- /** @description 使选择器的输入框失去焦点,并隐藏下拉框 */
348
+ /** 使选择器的输入框失去焦点,并隐藏下拉框 */
353
349
  blur: import("vue").ComputedRef<(() => void) | undefined>;
354
- /** @description 获取当前选中的标签 */
350
+ /** 获取当前选中的标签 */
355
351
  selectedLabel: import("vue").ComputedRef<string | string[] | undefined>;
356
- /** @description 加载状态 */
352
+ /** 加载状态 */
357
353
  loading: import("vue").Ref<boolean, boolean>;
358
- /** @description 选中的数据 */
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
- /** @description 刷新 */
364
+ /** 刷新 */
369
365
  refresh: (pageIndex?: number) => Promise<void>;
370
- /** @description 设置选择 */
366
+ /** 设置选择 */
371
367
  setSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => void;
372
- /** @description 清除选择 */
368
+ /** 清除选择 */
373
369
  clearSelection: () => void;
374
370
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
375
- /** @description v-model 回调 */
371
+ /** v-model 回调 */
376
372
  "update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
377
- /** @description 选中数据改变 */
373
+ /** 选中数据改变 */
378
374
  change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
379
- /** @description v-model:label 回调 */
375
+ /** v-model:label 回调 */
380
376
  "update:label": (value: string | string[] | null) => boolean;
381
- /** @description 数据改变 */
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
- /** @description whether Select is disabled 重载使其支持 ElForm*/
390
+ /** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
395
391
  disabled: {
396
392
  type: BooleanConstructor;
397
393
  default: undefined;
398
394
  };
399
- /** @description displayed text while loading data from server, default is 'Loading' */
395
+ /** 远程数据加载时显示的文本;默认显示“加载中...”。 */
400
396
  loadingText: {
401
397
  type: StringConstructor;
402
398
  default: string;
403
399
  };
404
- /** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */
400
+ /** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
405
401
  noMatchText: {
406
402
  type: StringConstructor;
407
403
  default: string;
408
404
  };
409
- /** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */
405
+ /** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
410
406
  noDataText: {
411
407
  type: StringConstructor;
412
408
  default: string;
413
409
  };
414
- /** @description whether to collapse tags to a text when multiple selecting */
410
+ /** 多选时是否折叠已选标签 */
415
411
  collapseTags: {
416
412
  type: BooleanConstructor;
417
413
  default: boolean;
418
414
  };
419
- /** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */
415
+ /** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
420
416
  collapseTagsTooltip: {
421
417
  type: BooleanConstructor;
422
418
  default: boolean;
423
419
  };
424
- /** @description v-model绑定值 */
420
+ /** v-model 绑定值 */
425
421
  modelValue: {
426
422
  type: import("vue").PropType<ElSelectorModelValue>;
427
423
  default: undefined;
428
424
  };
429
- /** @description v-model:label绑定值 */
425
+ /** v-model:label 绑定值 */
430
426
  label: import("vue").PropType<string | string[] | null>;
431
- /** @description 宽度 */
427
+ /** 宽度 */
432
428
  width: {
433
429
  type: (NumberConstructor | StringConstructor)[];
434
430
  default: string;
435
431
  };
436
- /** @description 更多细节,只有使用slot的时候有用 */
432
+ /** 插槽使用的附加状态 */
437
433
  moreDetail: BooleanConstructor;
438
- /** @description 配置选项 */
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
- /** @description 请求api */
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
- allowCreate: boolean;
590
- remote: boolean;
591
- debounce: number;
580
+ tagTooltip: import("element-plus").TagTooltipProps;
581
+ maxCollapseTags: number;
582
+ defaultFirstOption: boolean;
583
+ loadingText: string;
592
584
  multiple: boolean;
593
585
  multipleLimit: number;
594
- defaultFirstOption: boolean;
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
- tagTooltip: import("element-plus").TagTooltipProps;
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
- remoteShowSuffix: boolean;
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
- /** @description whether Select is disabled 重载使其支持 ElForm*/
17
+ /** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */
18
18
  disabled: {
19
19
  type: Boolean,
20
20
  default: void 0
21
21
  },
22
- /** @description displayed text while loading data from server, default is 'Loading' */
22
+ /** 远程数据加载时显示的文本;默认显示“加载中...”。 */
23
23
  loadingText: {
24
24
  type: String,
25
25
  default: "加载中..."
26
26
  },
27
- /** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */
27
+ /** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */
28
28
  noMatchText: {
29
29
  type: String,
30
30
  default: "暂无匹配的数据"
31
31
  },
32
- /** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */
32
+ /** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */
33
33
  noDataText: {
34
34
  type: String,
35
35
  default: "暂无数据"
36
36
  },
37
- /** @description whether to collapse tags to a text when multiple selecting */
37
+ /** 多选时是否折叠已选标签 */
38
38
  collapseTags: {
39
39
  type: Boolean,
40
40
  default: true
41
41
  },
42
- /** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */
42
+ /** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */
43
43
  collapseTagsTooltip: {
44
44
  type: Boolean,
45
45
  default: true
46
46
  },
47
- /** @description v-model绑定值 */
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
- /** @description v-model:label绑定值 */
58
+ /** v-model:label 绑定值 */
59
59
  label: definePropType([String, Array]),
60
- /** @description 宽度 */
60
+ /** 宽度 */
61
61
  width: {
62
62
  type: [String, Number],
63
63
  default: "100%"
64
64
  },
65
- /** @description 更多细节,只有使用slot的时候有用 */
65
+ /** 插槽使用的附加状态 */
66
66
  moreDetail: Boolean,
67
- /** @description 配置选项 */
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
- /** @description 请求api */
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
- /** @description v-model 回调 */
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
- /** @description 选中数据改变 */
94
+ /** 选中数据改变 */
95
95
  change: (_data, _value) => true,
96
- /** @description v-model:label 回调 */
96
+ /** v-model:label 回调 */
97
97
  "update:label": (value) => typeof value === "string" || Array.isArray(value) || value === null,
98
- /** @description 数据改变 */
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
- /** @description 使选择器的输入框获取焦点 */
386
+ /** 使选择器的输入框获取焦点 */
373
387
  focus: computed(() => selectRef.value?.focus),
374
- /** @description 使选择器的输入框失去焦点,并隐藏下拉框 */
388
+ /** 使选择器的输入框失去焦点,并隐藏下拉框 */
375
389
  blur: computed(() => selectRef.value?.blur),
376
- /** @description 获取当前选中的标签 */
390
+ /** 获取当前选中的标签 */
377
391
  selectedLabel: computed(() => selectRef.value?.selectedLabel),
378
- /** @description 加载状态 */
392
+ /** 加载状态 */
379
393
  loading: toRef(state, "loading"),
380
- /** @description 选中的数据 */
394
+ /** 选中的数据 */
381
395
  selectedList: computed(() => state.selectedList),
382
- /** @description 刷新 */
396
+ /** 刷新 */
383
397
  refresh: loadData,
384
- /** @description 设置选择 */
398
+ /** 设置选择 */
385
399
  setSelection: (value) => handleModelValueUpdate(value),
386
- /** @description 清除选择 */
400
+ /** 清除选择 */
387
401
  clearSelection: () => handleModelValueUpdate(props.multiple ? [] : void 0)
388
402
  });
389
403
  }