fast-element-plus 2.0.16 → 2.0.18
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 +26 -0
- package/CONTRIBUTING.md +8 -0
- package/dist/component.d.ts +6564 -2
- package/dist/component.mjs.map +1 -1
- package/dist/components/avatar/src/avatar.d.ts +19 -7
- package/dist/components/avatar/src/avatar.mjs +5 -0
- package/dist/components/avatar/src/avatar.mjs.map +1 -1
- package/dist/components/button/src/button.d.ts +4 -4
- package/dist/components/button/src/button.mjs +3 -4
- package/dist/components/button/src/button.mjs.map +1 -1
- package/dist/components/carNumber/src/carNumber.mjs +7 -9
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.mjs +8 -7
- package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/dist/components/dialog/src/dialog.d.ts +7 -4
- package/dist/components/dialog/src/dialog.mjs +6 -7
- package/dist/components/dialog/src/dialog.mjs.map +1 -1
- package/dist/components/drawer/src/drawer.mjs +14 -14
- package/dist/components/drawer/src/drawer.mjs.map +1 -1
- package/dist/components/form/src/form.d.ts +36 -24
- package/dist/components/form/src/form.mjs +8 -9
- package/dist/components/form/src/form.mjs.map +1 -1
- package/dist/components/form/src/formItem.d.ts +3 -3
- package/dist/components/form/src/formItem.mjs +18 -17
- package/dist/components/form/src/formItem.mjs.map +1 -1
- package/dist/components/form/utils/form.d.ts +2 -2
- package/dist/components/form/utils/form.mjs +2 -2
- package/dist/components/form/utils/form.mjs.map +1 -1
- package/dist/components/icon/src/icon.mjs.map +1 -1
- package/dist/components/iconSelector/src/iconSelector.d.ts +2 -2
- package/dist/components/iconSelector/src/iconSelector.mjs +4 -5
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/dist/components/image/src/image.d.ts +1 -1
- package/dist/components/image/src/image.mjs +2 -2
- package/dist/components/image/src/image.mjs.map +1 -1
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs +10 -12
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.d.ts +23 -11
- package/dist/components/layoutGrid/src/layoutGrid.mjs +42 -43
- package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.type.d.ts +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +13 -14
- package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/dist/components/select/src/select.d.ts +27 -12
- package/dist/components/select/src/select.mjs +46 -44
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/select/src/selectOption.mjs +4 -5
- package/dist/components/select/src/selectOption.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.d.ts +24 -9
- package/dist/components/selectPage/src/selectPage.mjs +45 -52
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.d.ts +49 -29
- package/dist/components/selectV2/src/selectV2.mjs +64 -62
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/src/table.d.ts +63 -29
- package/dist/components/table/src/table.mjs +77 -81
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/table.type.d.ts +2 -2
- package/dist/components/table/src/table.type.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.d.ts +13 -13
- package/dist/components/table/src/tableColumn.mjs +17 -30
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/table/src/tableColumnSettingDialog.mjs +24 -14
- package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
- package/dist/components/table/src/tablePagination.mjs +2 -3
- package/dist/components/table/src/tablePagination.mjs.map +1 -1
- package/dist/components/table/src/tableSearchForm.d.ts +4 -4
- package/dist/components/table/src/tableSearchForm.mjs +24 -27
- package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
- package/dist/components/table/src/tableSearchFormItem.d.ts +1 -7
- package/dist/components/table/src/tableSearchFormItem.mjs +3 -6
- package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
- package/dist/components/table/src/useTable.d.ts +4 -4
- package/dist/components/table/src/useTable.mjs +13 -14
- package/dist/components/table/src/useTable.mjs.map +1 -1
- package/dist/components/table/utils/table.mjs +5 -7
- package/dist/components/table/utils/table.mjs.map +1 -1
- package/dist/components/tree/src/tree.d.ts +6 -6
- package/dist/components/tree/src/tree.mjs +28 -26
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.d.ts +30 -27
- package/dist/components/treeSelect/src/treeSelect.mjs +45 -43
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/upload/src/upload.d.ts +1 -1
- package/dist/components/upload/src/upload.mjs +4 -5
- package/dist/components/upload/src/upload.mjs.map +1 -1
- package/dist/components/upload/src/useUpload.mjs +5 -7
- package/dist/components/upload/src/useUpload.mjs.map +1 -1
- package/dist/components/upload/utils/upload.mjs +1 -1
- package/dist/components/upload/utils/upload.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.d.ts +4 -16
- package/dist/components/uploadImage/src/uploadImage.mjs +7 -13
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/components/uploadImages/src/uploadImages.d.ts +1 -1
- package/dist/components/uploadImages/src/uploadImages.mjs +7 -8
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
- package/dist/directives/click-copy/index.mjs +5 -9
- package/dist/directives/click-copy/index.mjs.map +1 -1
- package/dist/element-plus.mjs +5 -6
- package/dist/element-plus.mjs.map +1 -1
- package/dist/hooks/use-screenFull/index.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.global.min.js +4 -4
- package/dist/index.global.min.js.map +1 -1
- package/dist/utils/async/index.mjs.map +1 -1
- package/dist/utils/date/index.mjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/object/index.d.ts +30 -0
- package/dist/utils/object/index.mjs +159 -0
- package/dist/utils/object/index.mjs.map +1 -0
- package/dist/utils/string/index.mjs.map +1 -1
- package/dist/utils/vue/emits.mjs.map +1 -1
- package/dist/utils/vue/install.mjs.map +1 -1
- package/dist/utils/vue/render.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +7 -11
|
@@ -58,7 +58,7 @@ export declare const SelectV2Props: {
|
|
|
58
58
|
/** @description collapse-tags tooltip configuration */
|
|
59
59
|
tagTooltip: {
|
|
60
60
|
type: PropType<import("element-plus/es/components/select-v2/src/defaults.mjs").TagTooltipProps>;
|
|
61
|
-
default: () =>
|
|
61
|
+
default: () => {};
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
64
|
* @description The max tags number to be shown. To use this, `collapse-tags` must be true
|
|
@@ -193,7 +193,7 @@ export declare const SelectV2Props: {
|
|
|
193
193
|
*/
|
|
194
194
|
popperOptions: {
|
|
195
195
|
type: PropType<Partial<Options>>;
|
|
196
|
-
default: () =>
|
|
196
|
+
default: () => {};
|
|
197
197
|
};
|
|
198
198
|
/**
|
|
199
199
|
* @description whether search data from server
|
|
@@ -218,7 +218,12 @@ export declare const SelectV2Props: {
|
|
|
218
218
|
*/
|
|
219
219
|
props: {
|
|
220
220
|
type: PropType<Props>;
|
|
221
|
-
default: () =>
|
|
221
|
+
default: () => {
|
|
222
|
+
label: string;
|
|
223
|
+
value: string;
|
|
224
|
+
disabled: string;
|
|
225
|
+
options: string;
|
|
226
|
+
};
|
|
222
227
|
};
|
|
223
228
|
/**
|
|
224
229
|
* @description unique identity key name for value, required when value is an object
|
|
@@ -313,14 +318,14 @@ export declare const SelectV2Props: {
|
|
|
313
318
|
};
|
|
314
319
|
/** 底层虚拟化选择器的运行时 Emits 定义。 */
|
|
315
320
|
export declare const selectV2Emits: {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
"update:modelValue": (_value: ElSelectorModelValue) => boolean;
|
|
322
|
+
change: (_value: ElSelectorModelValue) => boolean;
|
|
323
|
+
"end-reached": (_direction: ScrollbarDirection) => boolean;
|
|
324
|
+
"remove-tag": (_value: ElSelectorValue) => boolean;
|
|
325
|
+
"visible-change": (_visible: boolean) => boolean;
|
|
326
|
+
focus: (_event: FocusEvent) => boolean;
|
|
327
|
+
blur: (_event: FocusEvent) => boolean;
|
|
328
|
+
clear: () => boolean;
|
|
324
329
|
};
|
|
325
330
|
/** FaSelectV2 的运行时 Props 定义。 */
|
|
326
331
|
export declare const faSelectV2Props: {
|
|
@@ -378,7 +383,7 @@ export declare const faSelectV2Props: {
|
|
|
378
383
|
/** @description 下拉框数据 */
|
|
379
384
|
data: {
|
|
380
385
|
type: PropType<ElSelectorOutput<ElSelectorValue, any>[]>;
|
|
381
|
-
default: () =>
|
|
386
|
+
default: () => never[];
|
|
382
387
|
};
|
|
383
388
|
/** 分页返回 */
|
|
384
389
|
pageResult: BooleanConstructor;
|
|
@@ -427,7 +432,7 @@ export declare const faSelectV2Props: {
|
|
|
427
432
|
/** @description collapse-tags tooltip configuration */
|
|
428
433
|
tagTooltip: {
|
|
429
434
|
type: PropType<import("element-plus/es/components/select-v2/src/defaults.mjs").TagTooltipProps>;
|
|
430
|
-
default: () =>
|
|
435
|
+
default: () => {};
|
|
431
436
|
};
|
|
432
437
|
/**
|
|
433
438
|
* @description The max tags number to be shown. To use this, `collapse-tags` must be true
|
|
@@ -540,7 +545,7 @@ export declare const faSelectV2Props: {
|
|
|
540
545
|
*/
|
|
541
546
|
popperOptions: {
|
|
542
547
|
type: PropType<Partial<Options>>;
|
|
543
|
-
default: () =>
|
|
548
|
+
default: () => {};
|
|
544
549
|
};
|
|
545
550
|
/**
|
|
546
551
|
* @description whether search data from server
|
|
@@ -565,7 +570,12 @@ export declare const faSelectV2Props: {
|
|
|
565
570
|
*/
|
|
566
571
|
props: {
|
|
567
572
|
type: PropType<Props>;
|
|
568
|
-
default: () =>
|
|
573
|
+
default: () => {
|
|
574
|
+
label: string;
|
|
575
|
+
value: string;
|
|
576
|
+
disabled: string;
|
|
577
|
+
options: string;
|
|
578
|
+
};
|
|
569
579
|
};
|
|
570
580
|
/**
|
|
571
581
|
* @description unique identity key name for value, required when value is an object
|
|
@@ -661,13 +671,13 @@ export declare const faSelectV2Props: {
|
|
|
661
671
|
/** FaSelectV2 的运行时 Emits 定义。 */
|
|
662
672
|
export declare const faSelectV2Emits: {
|
|
663
673
|
/** @description v-model 回调 */
|
|
664
|
-
"update:modelValue": (value: ElSelectorModelValue) => boolean;
|
|
674
|
+
"update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
|
|
665
675
|
/** @description 选中数据改变 */
|
|
666
676
|
change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
|
|
667
677
|
/** @description v-model:label 回调 */
|
|
668
678
|
"update:label": (value: string | string[] | null) => boolean;
|
|
669
679
|
/** @description 数据改变 */
|
|
670
|
-
|
|
680
|
+
dataChange: (data: ElSelectorOutput[]) => boolean;
|
|
671
681
|
"end-reached": (_direction: ScrollbarDirection) => boolean;
|
|
672
682
|
"remove-tag": (_value: ElSelectorValue) => boolean;
|
|
673
683
|
"visible-change": (_visible: boolean) => boolean;
|
|
@@ -756,7 +766,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
756
766
|
/** @description 下拉框数据 */
|
|
757
767
|
data: {
|
|
758
768
|
type: PropType<ElSelectorOutput<ElSelectorValue, any>[]>;
|
|
759
|
-
default: () =>
|
|
769
|
+
default: () => never[];
|
|
760
770
|
};
|
|
761
771
|
/** 分页返回 */
|
|
762
772
|
pageResult: BooleanConstructor;
|
|
@@ -805,7 +815,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
805
815
|
/** @description collapse-tags tooltip configuration */
|
|
806
816
|
tagTooltip: {
|
|
807
817
|
type: PropType<import("element-plus/es/components/select-v2/src/defaults.mjs").TagTooltipProps>;
|
|
808
|
-
default: () =>
|
|
818
|
+
default: () => {};
|
|
809
819
|
};
|
|
810
820
|
/**
|
|
811
821
|
* @description The max tags number to be shown. To use this, `collapse-tags` must be true
|
|
@@ -918,7 +928,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
918
928
|
*/
|
|
919
929
|
popperOptions: {
|
|
920
930
|
type: PropType<Partial<Options>>;
|
|
921
|
-
default: () =>
|
|
931
|
+
default: () => {};
|
|
922
932
|
};
|
|
923
933
|
/**
|
|
924
934
|
* @description whether search data from server
|
|
@@ -943,7 +953,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
943
953
|
*/
|
|
944
954
|
props: {
|
|
945
955
|
type: PropType<Props>;
|
|
946
|
-
default: () =>
|
|
956
|
+
default: () => {
|
|
957
|
+
label: string;
|
|
958
|
+
value: string;
|
|
959
|
+
disabled: string;
|
|
960
|
+
options: string;
|
|
961
|
+
};
|
|
947
962
|
};
|
|
948
963
|
/**
|
|
949
964
|
* @description unique identity key name for value, required when value is an object
|
|
@@ -1054,13 +1069,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1054
1069
|
clearSelection: () => void;
|
|
1055
1070
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1056
1071
|
/** @description v-model 回调 */
|
|
1057
|
-
"update:modelValue": (value: ElSelectorModelValue) => boolean;
|
|
1072
|
+
"update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
|
|
1058
1073
|
/** @description 选中数据改变 */
|
|
1059
1074
|
change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
|
|
1060
1075
|
/** @description v-model:label 回调 */
|
|
1061
1076
|
"update:label": (value: string | string[] | null) => boolean;
|
|
1062
1077
|
/** @description 数据改变 */
|
|
1063
|
-
|
|
1078
|
+
dataChange: (data: ElSelectorOutput[]) => boolean;
|
|
1064
1079
|
"end-reached": (_direction: ScrollbarDirection) => boolean;
|
|
1065
1080
|
"remove-tag": (_value: ElSelectorValue) => boolean;
|
|
1066
1081
|
"visible-change": (_visible: boolean) => boolean;
|
|
@@ -1122,7 +1137,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1122
1137
|
/** @description 下拉框数据 */
|
|
1123
1138
|
data: {
|
|
1124
1139
|
type: PropType<ElSelectorOutput<ElSelectorValue, any>[]>;
|
|
1125
|
-
default: () =>
|
|
1140
|
+
default: () => never[];
|
|
1126
1141
|
};
|
|
1127
1142
|
/** 分页返回 */
|
|
1128
1143
|
pageResult: BooleanConstructor;
|
|
@@ -1171,7 +1186,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1171
1186
|
/** @description collapse-tags tooltip configuration */
|
|
1172
1187
|
tagTooltip: {
|
|
1173
1188
|
type: PropType<import("element-plus/es/components/select-v2/src/defaults.mjs").TagTooltipProps>;
|
|
1174
|
-
default: () =>
|
|
1189
|
+
default: () => {};
|
|
1175
1190
|
};
|
|
1176
1191
|
/**
|
|
1177
1192
|
* @description The max tags number to be shown. To use this, `collapse-tags` must be true
|
|
@@ -1284,7 +1299,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1284
1299
|
*/
|
|
1285
1300
|
popperOptions: {
|
|
1286
1301
|
type: PropType<Partial<Options>>;
|
|
1287
|
-
default: () =>
|
|
1302
|
+
default: () => {};
|
|
1288
1303
|
};
|
|
1289
1304
|
/**
|
|
1290
1305
|
* @description whether search data from server
|
|
@@ -1309,7 +1324,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1309
1324
|
*/
|
|
1310
1325
|
props: {
|
|
1311
1326
|
type: PropType<Props>;
|
|
1312
|
-
default: () =>
|
|
1327
|
+
default: () => {
|
|
1328
|
+
label: string;
|
|
1329
|
+
value: string;
|
|
1330
|
+
disabled: string;
|
|
1331
|
+
options: string;
|
|
1332
|
+
};
|
|
1313
1333
|
};
|
|
1314
1334
|
/**
|
|
1315
1335
|
* @description unique identity key name for value, required when value is an object
|
|
@@ -1410,14 +1430,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1410
1430
|
"onEnd-reached"?: ((_direction: ScrollbarDirection) => any) | undefined;
|
|
1411
1431
|
"onVisible-change"?: ((_visible: boolean) => any) | undefined;
|
|
1412
1432
|
"onUpdate:label"?: ((value: string | string[] | null) => any) | undefined;
|
|
1413
|
-
|
|
1433
|
+
onDataChange?: ((data: ElSelectorOutput<ElSelectorValue, any>[]) => any) | undefined;
|
|
1414
1434
|
"onRemove-tag"?: ((_value: ElSelectorValue) => any) | undefined;
|
|
1415
1435
|
}>, {
|
|
1416
1436
|
data: ElSelectorOutput<ElSelectorValue, any>[];
|
|
1437
|
+
loading: boolean;
|
|
1417
1438
|
props: Props;
|
|
1418
1439
|
offset: number;
|
|
1419
1440
|
placement: Placement;
|
|
1420
|
-
loading: boolean;
|
|
1421
1441
|
disabled: boolean;
|
|
1422
1442
|
modelValue: ElSelectorModelValue;
|
|
1423
1443
|
autocomplete: "none" | "both" | "inline" | "list";
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { addCssUnit } from "../../../utils/dom/index.mjs";
|
|
2
|
+
import { isEqual } from "../../../utils/object/index.mjs";
|
|
2
3
|
import { useEmits } from "../../../utils/vue/emits.mjs";
|
|
3
4
|
import { useExpose } from "../../../utils/vue/expose.mjs";
|
|
4
5
|
import { definePropType, useProps } from "../../../utils/vue/props.mjs";
|
|
5
6
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
6
7
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
7
8
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
8
|
-
import { computed, createVNode, defineComponent, mergeProps, onMounted, reactive,
|
|
9
|
+
import { computed, createVNode, defineComponent, mergeProps, onMounted, reactive, shallowRef, useModel, watch } from "vue";
|
|
9
10
|
import { ArrowDown, CircleClose } from "@element-plus/icons-vue";
|
|
10
11
|
import { ElSelectV2, tagProps, useAriaProps, useEmptyValuesProps, useGlobalSize, useSizeProp, useTooltipContentProps } from "element-plus";
|
|
11
|
-
import { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from "lodash-unified";
|
|
12
|
-
import { useVModel } from "@vueuse/core";
|
|
13
12
|
//#region src/components/selectV2/src/selectV2.tsx
|
|
14
13
|
/** FaSelectV2 支持的业务选择器 Props 定义。 */
|
|
15
14
|
const SelectV2Props = {
|
|
@@ -305,7 +304,7 @@ const SelectV2Props = {
|
|
|
305
304
|
fitInputWidth: {
|
|
306
305
|
type: [Boolean, Number],
|
|
307
306
|
default: true,
|
|
308
|
-
validator: (value) =>
|
|
307
|
+
validator: (value) => typeof value === "boolean" || typeof value === "number"
|
|
309
308
|
},
|
|
310
309
|
/** @description select suffix icon */
|
|
311
310
|
suffixIcon: {
|
|
@@ -410,13 +409,13 @@ const faSelectV2Props = {
|
|
|
410
409
|
const faSelectV2Emits = {
|
|
411
410
|
...selectV2Emits,
|
|
412
411
|
/** @description v-model 回调 */
|
|
413
|
-
"update:modelValue": (value) =>
|
|
412
|
+
"update:modelValue": (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object" && value !== null || value == null,
|
|
414
413
|
/** @description 选中数据改变 */
|
|
415
414
|
change: (_data, _value) => true,
|
|
416
415
|
/** @description v-model:label 回调 */
|
|
417
|
-
"update:label": (value) =>
|
|
416
|
+
"update:label": (value) => typeof value === "string" || Array.isArray(value) || value === null,
|
|
418
417
|
/** @description 数据改变 */
|
|
419
|
-
|
|
418
|
+
dataChange: (data) => Array.isArray(data)
|
|
420
419
|
};
|
|
421
420
|
var selectV2_default = defineComponent({
|
|
422
421
|
name: "FaSelectV2",
|
|
@@ -424,8 +423,9 @@ var selectV2_default = defineComponent({
|
|
|
424
423
|
emits: faSelectV2Emits,
|
|
425
424
|
slots: makeSlots(),
|
|
426
425
|
setup(props, { slots, emit, expose }) {
|
|
427
|
-
const selectedLabel =
|
|
428
|
-
const
|
|
426
|
+
const selectedLabel = useModel(props, "label");
|
|
427
|
+
const globalSize = useGlobalSize();
|
|
428
|
+
const selectV2Ref = shallowRef(null);
|
|
429
429
|
const state = reactive({
|
|
430
430
|
value: withDefineType(),
|
|
431
431
|
loading: false,
|
|
@@ -433,11 +433,10 @@ var selectV2_default = defineComponent({
|
|
|
433
433
|
/** 首次出现 */
|
|
434
434
|
debut: true,
|
|
435
435
|
/** 回显 */
|
|
436
|
-
echo:
|
|
436
|
+
echo: true,
|
|
437
437
|
/** 下次刷新 */
|
|
438
438
|
nextRefresh: false
|
|
439
439
|
});
|
|
440
|
-
const selectV2Ref = ref();
|
|
441
440
|
let requestVersion = 0;
|
|
442
441
|
const loadData = async () => {
|
|
443
442
|
const currentRequestVersion = ++requestVersion;
|
|
@@ -450,7 +449,7 @@ var selectV2_default = defineComponent({
|
|
|
450
449
|
state.echo = false;
|
|
451
450
|
if (props.pageResult) state.selectorData = resData.rows ?? [];
|
|
452
451
|
else state.selectorData = resData;
|
|
453
|
-
emit("
|
|
452
|
+
emit("dataChange", state.selectorData);
|
|
454
453
|
} catch (error) {
|
|
455
454
|
if (currentRequestVersion !== requestVersion) return;
|
|
456
455
|
state.selectorData = [];
|
|
@@ -480,43 +479,6 @@ var selectV2_default = defineComponent({
|
|
|
480
479
|
}
|
|
481
480
|
emit("visible-change", visible);
|
|
482
481
|
};
|
|
483
|
-
watch(() => props.modelValue, (newValue) => {
|
|
484
|
-
if (state.echo && !isNil(newValue)) {
|
|
485
|
-
const hasLabel = !isNil(props.label);
|
|
486
|
-
if (props.multiple) {
|
|
487
|
-
if (!Array.isArray(newValue)) {
|
|
488
|
-
console.error("[Fast:FaSelectV2]", "当启用 multiple 时,传入的 modelValue 必须是 Array。");
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
if (hasLabel && !isArray(props.label)) {
|
|
492
|
-
console.error("[Fast:FaSelectV2]", "当启用 multiple 时,传入的 modelValue:label 必须是 Array。");
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
state.selectorData = newValue.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length).map((item, index) => {
|
|
496
|
-
const value = item;
|
|
497
|
-
const label = Array.isArray(props.label) ? props.label[index] : void 0;
|
|
498
|
-
return {
|
|
499
|
-
value: value !== null && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object") ? value : void 0,
|
|
500
|
-
label: hasLabel && typeof label === "string" ? label : void 0
|
|
501
|
-
};
|
|
502
|
-
});
|
|
503
|
-
} else {
|
|
504
|
-
if (Array.isArray(newValue)) {
|
|
505
|
-
console.error("[Fast:FaSelectV2]", "当禁用 multiple 时,传入的 modelValue 不能是 Array。");
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
if (hasLabel && isArray(props.label)) {
|
|
509
|
-
console.error("[Fast:FaSelectV2]", "当禁用 multiple 时,传入的 modelValue:label 不能是 Array。");
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
state.selectorData = [{
|
|
513
|
-
value: newValue,
|
|
514
|
-
label: typeof props.label === "string" ? props.label : void 0
|
|
515
|
-
}];
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
state.value = newValue;
|
|
519
|
-
}, { immediate: true });
|
|
520
482
|
const getOptionValue = (item) => {
|
|
521
483
|
const value = item[props.props.value ?? "value"];
|
|
522
484
|
return value !== null && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object") ? value : void 0;
|
|
@@ -543,7 +505,7 @@ var selectV2_default = defineComponent({
|
|
|
543
505
|
})).filter((item) => item !== void 0), value);
|
|
544
506
|
return;
|
|
545
507
|
}
|
|
546
|
-
if (
|
|
508
|
+
if (value == null || Array.isArray(value)) {
|
|
547
509
|
emit("change", null, null);
|
|
548
510
|
return;
|
|
549
511
|
}
|
|
@@ -552,6 +514,43 @@ var selectV2_default = defineComponent({
|
|
|
552
514
|
return optionValue !== void 0 && isEqual(optionValue, value);
|
|
553
515
|
}) ?? null, value);
|
|
554
516
|
};
|
|
517
|
+
watch(() => props.modelValue, (newValue) => {
|
|
518
|
+
if (state.echo && newValue != null) {
|
|
519
|
+
const hasLabel = props.label != null;
|
|
520
|
+
if (props.multiple) {
|
|
521
|
+
if (!Array.isArray(newValue)) {
|
|
522
|
+
console.error("[Fast:FaSelectV2]", "当启用 multiple 时,传入的 modelValue 必须是 Array。");
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
if (hasLabel && !Array.isArray(props.label)) {
|
|
526
|
+
console.error("[Fast:FaSelectV2]", "当启用 multiple 时,传入的 modelValue:label 必须是 Array。");
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
state.selectorData = newValue.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length).map((item, index) => {
|
|
530
|
+
const value = item;
|
|
531
|
+
const label = Array.isArray(props.label) ? props.label[index] : void 0;
|
|
532
|
+
return {
|
|
533
|
+
value: value !== null && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object") ? value : void 0,
|
|
534
|
+
label: hasLabel && typeof label === "string" ? label : void 0
|
|
535
|
+
};
|
|
536
|
+
});
|
|
537
|
+
} else {
|
|
538
|
+
if (Array.isArray(newValue)) {
|
|
539
|
+
console.error("[Fast:FaSelectV2]", "当禁用 multiple 时,传入的 modelValue 不能是 Array。");
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
if (hasLabel && Array.isArray(props.label)) {
|
|
543
|
+
console.error("[Fast:FaSelectV2]", "当禁用 multiple 时,传入的 modelValue:label 不能是 Array。");
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
state.selectorData = [{
|
|
547
|
+
value: newValue,
|
|
548
|
+
label: typeof props.label === "string" ? props.label : void 0
|
|
549
|
+
}];
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
state.value = newValue;
|
|
553
|
+
}, { immediate: true });
|
|
555
554
|
watch([() => state.value, () => state.selectorData], ([value]) => {
|
|
556
555
|
const selectorData = flattenOptions(state.selectorData);
|
|
557
556
|
if (props.multiple) {
|
|
@@ -568,7 +567,7 @@ var selectV2_default = defineComponent({
|
|
|
568
567
|
});
|
|
569
568
|
return;
|
|
570
569
|
}
|
|
571
|
-
if (
|
|
570
|
+
if (value == null || Array.isArray(value)) {
|
|
572
571
|
selectedLabel.value = null;
|
|
573
572
|
return;
|
|
574
573
|
}
|
|
@@ -582,6 +581,18 @@ var selectV2_default = defineComponent({
|
|
|
582
581
|
flush: "sync",
|
|
583
582
|
immediate: true
|
|
584
583
|
});
|
|
584
|
+
watch(() => props.initParam, (newValue, oldValue) => {
|
|
585
|
+
if (!isEqual(newValue, oldValue)) {
|
|
586
|
+
state.nextRefresh = true;
|
|
587
|
+
if (state.value != null) handleModelValueUpdate(props.multiple ? [] : void 0);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
watch(() => props.data, () => {
|
|
591
|
+
if (!props.requestApi) return loadData();
|
|
592
|
+
}, { deep: true });
|
|
593
|
+
watch(() => props.data.length, (length) => {
|
|
594
|
+
if (state.debut) state.echo = length === 0;
|
|
595
|
+
}, { immediate: true });
|
|
585
596
|
onMounted(async () => {
|
|
586
597
|
if (props.defaultSelected) {
|
|
587
598
|
await loadData();
|
|
@@ -592,15 +603,6 @@ var selectV2_default = defineComponent({
|
|
|
592
603
|
state.debut = false;
|
|
593
604
|
await loadData();
|
|
594
605
|
} else if (!props.lazy) await loadData();
|
|
595
|
-
watch(() => props.initParam, (newValue, oldValue) => {
|
|
596
|
-
if (!isEqual(newValue, oldValue)) {
|
|
597
|
-
state.nextRefresh = true;
|
|
598
|
-
if (!isNil(state.value)) handleModelValueUpdate(props.multiple ? [] : void 0);
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
watch(() => props.data, () => {
|
|
602
|
-
if (!props.requestApi) return loadData();
|
|
603
|
-
}, { deep: true });
|
|
604
606
|
});
|
|
605
607
|
const elSelectV2Props = useProps(props, SelectV2Props, [
|
|
606
608
|
"modelValue",
|
|
@@ -616,7 +618,7 @@ var selectV2_default = defineComponent({
|
|
|
616
618
|
]);
|
|
617
619
|
const elPopperClass = computed(() => {
|
|
618
620
|
let localClass = `fa-select-v2-dropdown ${props.popperClass}`;
|
|
619
|
-
if (props.moreDetail) localClass += ` fa-select-v2-dropdown__more-detail fa-select-v2-dropdown__more-detail-${
|
|
621
|
+
if (props.moreDetail) localClass += ` fa-select-v2-dropdown__more-detail fa-select-v2-dropdown__more-detail-${globalSize.value}`;
|
|
620
622
|
return localClass;
|
|
621
623
|
});
|
|
622
624
|
useRender(() => createVNode(ElSelectV2, mergeProps(elSelectV2Props.value, elSelectV2Emits.value, {
|
|
@@ -629,7 +631,7 @@ var selectV2_default = defineComponent({
|
|
|
629
631
|
"onChange": handleChange,
|
|
630
632
|
"loading": state.loading,
|
|
631
633
|
"options": state.selectorData,
|
|
632
|
-
"itemHeight": props.itemHeight + (
|
|
634
|
+
"itemHeight": props.itemHeight + (globalSize.value === "small" ? 0 : 8),
|
|
633
635
|
"onVisible-change": handleVisibleChange
|
|
634
636
|
}), {
|
|
635
637
|
...slots.default && { default: ({ item, index, disabled }) => slots.default?.({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectV2.mjs","names":["update:modelValue","end-reached","remove-tag","visible-change","update:label"],"sources":["../../../../src/components/selectV2/src/selectV2.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { ArrowDown, CircleClose } from \"@element-plus/icons-vue\";\nimport { ElSelectV2, tagProps, useAriaProps, useEmptyValuesProps, useGlobalSize, useSizeProp, useTooltipContentProps } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { SelectV2Props as ElementPlusSelectV2Props, Options, Placement, ScrollbarDirection } from \"element-plus\";\nimport type { Component, PropType, VNode } from \"vue\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select/src/select.type\";\nimport type { PagedInput, PagedResult } from \"../../table\";\n\n/** 传递给底层 Element Plus 虚拟化选择器的扩展 Props。 */\nexport interface Props {\n\tlabel?: string;\n\tvalue?: string;\n\tdisabled?: string;\n\toptions?: string;\n}\n\n/** FaSelectV2 支持的业务选择器 Props 定义。 */\nexport const SelectV2Props = {\n\t/**\n\t * @description whether creating new items is allowed. To use this, `filterable` must be true\n\t */\n\tallowCreate: Boolean,\n\t/**\n\t * @description autocomplete of select input\n\t */\n\tautocomplete: {\n\t\ttype: definePropType<\"none\" | \"both\" | \"list\" | \"inline\">(String),\n\t\tdefault: \"none\",\n\t},\n\t/**\n\t * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n\t */\n\tautomaticDropdown: Boolean,\n\t/**\n\t * @description whether select can be cleared\n\t */\n\tclearable: Boolean,\n\t/**\n\t * @description custom clear icon\n\t */\n\tclearIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: CircleClose,\n\t},\n\t/**\n\t * @description tooltip theme, built-in theme: `dark` / `light`\n\t */\n\teffect: {\n\t\ttype: definePropType<string>(String),\n\t\tdefault: \"light\",\n\t},\n\t/**\n\t * @description whether to collapse tags to a text when multiple selecting\n\t */\n\tcollapseTags: Boolean,\n\t/**\n\t * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n\t */\n\tcollapseTagsTooltip: Boolean,\n\t/** @description collapse-tags tooltip configuration */\n\ttagTooltip: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"tagTooltip\"]>(Object),\n\t\tdefault: (): NonNullable<ElementPlusSelectV2Props[\"tagTooltip\"]> => ({}),\n\t},\n\t/**\n\t * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n\t */\n\tmaxCollapseTags: {\n\t\ttype: Number,\n\t\tdefault: 1,\n\t},\n\t/**\n\t * @description\n\t */\n\tdefaultFirstOption: Boolean,\n\t/**\n\t * @description is disabled\n\t */\n\tdisabled: Boolean,\n\t/**\n\t * @description\n\t */\n\testimatedOptionHeight: {\n\t\ttype: Number,\n\t\tdefault: undefined,\n\t},\n\t/**\n\t * @description is filterable\n\t */\n\tfilterable: Boolean,\n\t/**\n\t * @description\n\t */\n\tfilterMethod: Function as PropType<ElementPlusSelectV2Props[\"filterMethod\"]>,\n\t/**\n\t * @description The height of the dropdown panel, 34px for each item\n\t */\n\theight: {\n\t\ttype: Number,\n\t\tdefault: 274, // same as select dropdown menu\n\t},\n\t/**\n\t * @description The height of the dropdown item\n\t */\n\titemHeight: {\n\t\ttype: Number,\n\t\tdefault: 34,\n\t},\n\t/**\n\t * @description\n\t */\n\tid: String,\n\t/**\n\t * @description whether Select is loading data from server\n\t */\n\tloading: Boolean,\n\t/**\n\t * @description displayed text while loading data from server, default is 'Loading'\n\t */\n\tloadingText: String,\n\t/**\n\t * @description biding value\n\t */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([Array, String, Number, Boolean, Object]),\n\t},\n\t/**\n\t * @description is multiple\n\t */\n\tmultiple: Boolean,\n\t/**\n\t * @description maximum number of options user can select when multiple is true. No limit when set to 0\n\t */\n\tmultipleLimit: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description the name attribute of select input\n\t */\n\tname: String,\n\t/**\n\t * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n\t */\n\tnoDataText: String,\n\t/**\n\t * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n\t */\n\tnoMatchText: String,\n\t/**\n\t * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n\t */\n\tremoteMethod: Function as PropType<ElementPlusSelectV2Props[\"remoteMethod\"]>,\n\t/**\n\t * @description whether reserve the keyword after select filtered option.\n\t */\n\treserveKeyword: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description data of the options, the key of `value` and `label` can be customize by `props`\n\t */\n\toptions: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"options\"]>(Array),\n\t\t// required: true,\n\t},\n\t/**\n\t * @description placeholder, the default is 'Please select'\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t},\n\t/**\n\t * @description whether select dropdown is teleported to the body\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的运行时默认值与校验规则。\n\tteleported: useTooltipContentProps.teleported,\n\t/**\n\t * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n\t */\n\tpersistent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description custom class name for Select's dropdown\n\t */\n\tpopperClass: {\n\t\ttype: String,\n\t\tdefault: \"\",\n\t},\n\t/** @description custom style for Select's dropdown */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的运行时类型定义。\n\tpopperStyle: useTooltipContentProps.popperStyle,\n\t/**\n\t * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n\t */\n\tpopperOptions: {\n\t\ttype: definePropType<Partial<Options>>(Object),\n\t\tdefault: (): Partial<Options> => ({}),\n\t},\n\t/**\n\t * @description whether search data from server\n\t */\n\tremote: Boolean,\n\t/** @description debounce delay during remote search, in milliseconds */\n\tdebounce: {\n\t\ttype: Number,\n\t\tdefault: 300,\n\t},\n\t/**\n\t * @description size of component\n\t */\n\tsize: useSizeProp,\n\t/**\n\t * @description configuration options, see the following table\n\t */\n\tprops: {\n\t\ttype: definePropType<Props>(Object),\n\t\tdefault: (): Required<Props> => ({\n\t\t\tlabel: \"label\",\n\t\t\tvalue: \"value\",\n\t\t\tdisabled: \"disabled\",\n\t\t\toptions: \"options\",\n\t\t}),\n\t},\n\t/**\n\t * @description unique identity key name for value, required when value is an object\n\t */\n\tvalueKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/**\n\t * @description Controls whether the scrollbar is always displayed\n\t */\n\tscrollbarAlwaysOn: Boolean,\n\t/**\n\t * @description whether to trigger form validation\n\t */\n\tvalidateEvent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description offset of the dropdown\n\t */\n\toffset: {\n\t\ttype: Number,\n\t\tdefault: 12,\n\t},\n\t/** @description whether to show the suffix icon during remote search */\n\tremoteShowSuffix: Boolean,\n\t/**\n\t * @description Determines whether the arrow is displayed\n\t */\n\tshowArrow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description position of dropdown\n\t */\n\tplacement: {\n\t\ttype: definePropType<Placement>(String),\n\t\tdefault: \"bottom-start\",\n\t},\n\t/**\n\t * @description list of possible positions for dropdown\n\t */\n\tfallbackPlacements: {\n\t\ttype: definePropType<Placement[]>(Array),\n\t\tdefault: [\"bottom-start\", \"top-start\", \"right\", \"left\"],\n\t},\n\t/**\n\t * @description tag type\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的 Tag 运行时校验规则。\n\ttagType: { ...tagProps.type, default: \"info\" },\n\t/**\n\t * @description tag effect\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的 Tag 运行时校验规则。\n\ttagEffect: { ...tagProps.effect, default: \"light\" },\n\t/**\n\t * @description tabindex for input\n\t */\n\ttabindex: {\n\t\ttype: [String, Number],\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description which element the select dropdown appends to\n\t */\n\tappendTo: String,\n\t/** @description whether the dropdown width follows the input width, or a fixed width */\n\tfitInputWidth: {\n\t\ttype: [Boolean, Number],\n\t\tdefault: true,\n\t\tvalidator: (value: boolean | number): boolean => isBoolean(value) || isNumber(value),\n\t},\n\t/** @description select suffix icon */\n\tsuffixIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: ArrowDown,\n\t},\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的空值运行时约定。\n\t...useEmptyValuesProps,\n\t...useAriaProps([\"ariaLabel\"]),\n};\n\n/** 底层虚拟化选择器的运行时 Emits 定义。 */\nexport const selectV2Emits = {\n\t\"update:modelValue\": (_value: ElSelectorModelValue): boolean => true,\n\tchange: (_value: ElSelectorModelValue): boolean => true,\n\t\"end-reached\": (_direction: ScrollbarDirection): boolean => true,\n\t\"remove-tag\": (_value: ElSelectorValue): boolean => true,\n\t\"visible-change\": (_visible: boolean): boolean => true,\n\tfocus: (_event: FocusEvent): boolean => true,\n\tblur: (_event: FocusEvent): boolean => true,\n\tclear: (): boolean => true,\n} as const;\n\n/** FaSelectV2 的运行时 Props 定义。 */\nexport const faSelectV2Props = {\n\t...SelectV2Props,\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: (): ElSelectorOutput[] => [],\n\t},\n\t/** 分页返回 */\n\tpageResult: Boolean,\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[] | PagedResult<ElSelectorOutput>>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelectV2 的运行时 Emits 定义。 */\nexport const faSelectV2Emits = {\n\t...selectV2Emits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNil(value),\n\t/** @description 选中数据改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue): boolean => true,\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[]): boolean => isArray(data),\n};\n\n/** FaSelectV2 的插槽参数。 */\nexport interface FaSelectV2Slots extends Record<string, unknown> {\n\t/** @description FaSelectOption 默认内容插槽 */\n\tdefault: { item: ElSelectorOutput; index: number; disabled: boolean };\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaSelectV2\",\n\tprops: faSelectV2Props,\n\temits: faSelectV2Emits,\n\tslots: makeSlots<FaSelectV2Slots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: props.data.length > 0 ? false : true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tconst selectV2Ref = ref<InstanceType<typeof ElSelectV2>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\t// 判断是否为分页返回\n\t\t\t\t\tif (props.pageResult) {\n\t\t\t\t\t\tstate.selectorData = (resData as PagedResult<ElSelectorOutput>).rows ?? [];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.selectorData = resData as ElSelectorOutput[];\n\t\t\t\t\t}\n\t\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = props.data;\n\t\t\t}\n\t\t};\n\n\t\tconst handleModelValueUpdate = (value: ElSelectorModelValue): void => {\n\t\t\tstate.value = value;\n\t\t\temit(\"update:modelValue\", value);\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\t!props.defaultSelected && props.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tconst getOptionValue = (item: ElSelectorOutput): ElSelectorValue | undefined => {\n\t\t\tconst value: unknown = item[props.props.value ?? \"value\"];\n\t\t\treturn value !== null &&\n\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t? value\n\t\t\t\t: undefined;\n\t\t};\n\n\t\tconst getOptionLabel = (item: ElSelectorOutput): string | undefined => {\n\t\t\tconst label: unknown = item[props.props.label ?? \"label\"];\n\t\t\treturn typeof label === \"string\" ? label : undefined;\n\t\t};\n\n\t\tconst flattenOptions = (data: ElSelectorOutput[]): ElSelectorOutput[] =>\n\t\t\tdata.flatMap((item) => {\n\t\t\t\tconst children: unknown = item[props.props.options ?? \"options\"];\n\t\t\t\treturn [item, ...(Array.isArray(children) ? flattenOptions(children as ElSelectorOutput[]) : [])];\n\t\t\t});\n\n\t\tconst handleChange = (value?: ElSelectorModelValue): void => {\n\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\tif (props.multiple) {\n\t\t\t\tconst valueList = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueList.length === 0) {\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = valueList\n\t\t\t\t\t.map((item) =>\n\t\t\t\t\t\tselectorData.find((option) => {\n\t\t\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, item);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.filter((item): item is ElSelectorOutput => item !== undefined);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isNil(value) || Array.isArray(value)) {\n\t\t\t\temit(\"change\", null, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, value);\n\t\t\t});\n\t\t\temit(\"change\", data ?? null, value);\n\t\t};\n\n\t\twatch(\n\t\t\t[() => state.value, () => state.selectorData],\n\t\t\t([value]) => {\n\t\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tselectedLabel.value = value.map((item, index) => {\n\t\t\t\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, item);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn (data && getOptionLabel(data)) ?? (Array.isArray(props.label) ? (props.label[index] ?? \"\") : \"\");\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (isNil(value) || Array.isArray(value)) {\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, value);\n\t\t\t\t});\n\t\t\t\tselectedLabel.value = (data && getOptionLabel(data)) ?? (typeof props.label === \"string\" ? props.label : null);\n\t\t\t},\n\t\t\t{\n\t\t\t\tdeep: true,\n\t\t\t\tflush: \"sync\",\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tconst firstValue = firstItem && getOptionValue(firstItem);\n\t\t\t\tif (firstValue !== undefined) {\n\t\t\t\t\thandleModelValueUpdate(props.multiple ? [firstValue] : firstValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleModelValueUpdate(props.multiple ? [] : undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\n\t\t});\n\n\t\tconst elSelectV2Props = useProps(props, SelectV2Props, [\"modelValue\", \"popperClass\", \"loading\", \"options\", \"itemHeight\"]);\n\t\tconst elSelectV2Emits = useEmits(selectV2Emits, emit, [\"update:modelValue\", \"change\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => {\n\t\t\tlet localClass = `fa-select-v2-dropdown ${props.popperClass}`;\n\t\t\tif (props.moreDetail) {\n\t\t\t\tlocalClass += ` fa-select-v2-dropdown__more-detail fa-select-v2-dropdown__more-detail-${_globalSize.value}`;\n\t\t\t}\n\t\t\treturn localClass;\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<ElSelectV2\n\t\t\t\t{...elSelectV2Props.value}\n\t\t\t\t{...elSelectV2Emits.value}\n\t\t\t\tref={selectV2Ref}\n\t\t\t\tclass=\"fa-select-v2\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tmodelValue={state.value}\n\t\t\t\tonUpdate:modelValue={handleModelValueUpdate}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tloading={state.loading}\n\t\t\t\toptions={state.selectorData}\n\t\t\t\titemHeight={props.itemHeight + (_globalSize.value === \"small\" ? 0 : 8)}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ item, index, disabled }: { item: ElSelectorOutput; index: number; disabled: boolean }): VNode[] =>\n\t\t\t\t\t\t\tslots.default?.({ item, index, disabled }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: (): VNode[] => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: (): VNode[] => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElSelectV2>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectV2Ref.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectV2Ref.value?.blur),\n\t\t\t/** @description 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectV2Ref.value?.selectedLabel),\n\t\t\t/** @description 滚动到指定选项索引。 */\n\t\t\tscrollTo: computed(() => selectV2Ref.value?.scrollTo),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleModelValueUpdate(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleModelValueUpdate(props.multiple ? [] : undefined),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,gBAAgB;;;;CAI5B,aAAa;;;;CAIb,cAAc;EACb,MAAM,eAAoD,MAAM;EAChE,SAAS;CACV;;;;CAIA,mBAAmB;;;;CAInB,WAAW;;;;CAIX,WAAW;EACV,MAAM,eAAmC;GAAC;GAAQ;GAAQ;EAAQ,CAAC;EACnE,SAAS;CACV;;;;CAIA,QAAQ;EACP,MAAM,eAAuB,MAAM;EACnC,SAAS;CACV;;;;CAIA,cAAc;;;;CAId,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAAuD,MAAM;EACnE,gBAAqE,CAAC;CACvE;;;;CAIA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;;;CAIA,oBAAoB;;;;CAIpB,UAAU;;;;CAIV,uBAAuB;EACtB,MAAM;EACN,SAAS,KAAA;CACV;;;;CAIA,YAAY;;;;CAIZ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O;GAAS,CAAC,KAAK,CAAA,EAChD;GACA,GAAI,MAAM,UAAU,EAAE,cAAuB,MAAM,SAAS,KAAK,CAAA,EAAG;GACpE,GAAI,MAAM,UAAU,EAAE,cAAuB,MAAM,SAAS,KAAK,CAAA,EAAG;GACpE,GAAI,MAAM,UAAU,EAAE,cAAuB,MAAM,SAAS,KAAK,CAAA,EAAG;GACpE,GAAI,MAAM,SAAS,EAAE,aAAsB,MAAM,QAAQ,KAAK,CAAA,EAAG;GACjE,GAAI,MAAM,OAAO,EAAE,WAAoB,MAAM,MAAM,KAAK,CAAA,EAAG;GAC3D,GAAI,MAAM,WAAW,EAAE,eAAwB,MAAM,UAAU,KAAK,CAAA,EAAG;GACvE,GAAI,MAAM,SAAS,EAClB,QAAQ,EAAE,OAAO,YAChB,MAAM,QAAQ;IAAE;IAAO;GAAM,CAAC,KAAK,CAAA,EACrC;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,YAAY,OAAO,KAAK;;GAE9C,MAAM,eAAe,YAAY,OAAO,IAAI;;GAE5C,eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,UAAU,eAAe,YAAY,OAAO,QAAQ;;GAEpD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;;GAET,eAAe,UAA2D,uBAAuB,KAAK;;GAEtG,sBAAsB,uBAAuB,MAAM,WAAW,CAAA,IAAK,KAAA,CAAS;EAC7E,CAAC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"selectV2.mjs","names":["update:modelValue","end-reached","remove-tag","visible-change","update:label"],"sources":["../../../../src/components/selectV2/src/selectV2.tsx"],"sourcesContent":["import { computed, defineComponent, onMounted, reactive, shallowRef, useModel, watch } from \"vue\";\nimport { ArrowDown, CircleClose } from \"@element-plus/icons-vue\";\nimport { ElSelectV2, tagProps, useAriaProps, useEmptyValuesProps, useGlobalSize, useSizeProp, useTooltipContentProps } from \"element-plus\";\nimport { addCssUnit, definePropType, isEqual, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { SelectV2Props as ElementPlusSelectV2Props, Options, Placement, ScrollbarDirection } from \"element-plus\";\nimport type { Component, PropType } from \"vue\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select/src/select.type\";\nimport type { PagedInput, PagedResult } from \"../../table\";\n\n/** 传递给底层 Element Plus 虚拟化选择器的扩展 Props。 */\nexport interface Props {\n\tlabel?: string;\n\tvalue?: string;\n\tdisabled?: string;\n\toptions?: string;\n}\n\n/** FaSelectV2 支持的业务选择器 Props 定义。 */\nexport const SelectV2Props = {\n\t/**\n\t * @description whether creating new items is allowed. To use this, `filterable` must be true\n\t */\n\tallowCreate: Boolean,\n\t/**\n\t * @description autocomplete of select input\n\t */\n\tautocomplete: {\n\t\ttype: definePropType<\"none\" | \"both\" | \"list\" | \"inline\">(String),\n\t\tdefault: \"none\",\n\t},\n\t/**\n\t * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n\t */\n\tautomaticDropdown: Boolean,\n\t/**\n\t * @description whether select can be cleared\n\t */\n\tclearable: Boolean,\n\t/**\n\t * @description custom clear icon\n\t */\n\tclearIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: CircleClose,\n\t},\n\t/**\n\t * @description tooltip theme, built-in theme: `dark` / `light`\n\t */\n\teffect: {\n\t\ttype: definePropType<string>(String),\n\t\tdefault: \"light\",\n\t},\n\t/**\n\t * @description whether to collapse tags to a text when multiple selecting\n\t */\n\tcollapseTags: Boolean,\n\t/**\n\t * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n\t */\n\tcollapseTagsTooltip: Boolean,\n\t/** @description collapse-tags tooltip configuration */\n\ttagTooltip: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"tagTooltip\"]>(Object),\n\t\tdefault: () => ({}),\n\t},\n\t/**\n\t * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n\t */\n\tmaxCollapseTags: {\n\t\ttype: Number,\n\t\tdefault: 1,\n\t},\n\t/**\n\t * @description\n\t */\n\tdefaultFirstOption: Boolean,\n\t/**\n\t * @description is disabled\n\t */\n\tdisabled: Boolean,\n\t/**\n\t * @description\n\t */\n\testimatedOptionHeight: {\n\t\ttype: Number,\n\t\tdefault: undefined,\n\t},\n\t/**\n\t * @description is filterable\n\t */\n\tfilterable: Boolean,\n\t/**\n\t * @description\n\t */\n\tfilterMethod: Function as PropType<ElementPlusSelectV2Props[\"filterMethod\"]>,\n\t/**\n\t * @description The height of the dropdown panel, 34px for each item\n\t */\n\theight: {\n\t\ttype: Number,\n\t\tdefault: 274, // same as select dropdown menu\n\t},\n\t/**\n\t * @description The height of the dropdown item\n\t */\n\titemHeight: {\n\t\ttype: Number,\n\t\tdefault: 34,\n\t},\n\t/**\n\t * @description\n\t */\n\tid: String,\n\t/**\n\t * @description whether Select is loading data from server\n\t */\n\tloading: Boolean,\n\t/**\n\t * @description displayed text while loading data from server, default is 'Loading'\n\t */\n\tloadingText: String,\n\t/**\n\t * @description biding value\n\t */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([Array, String, Number, Boolean, Object]),\n\t},\n\t/**\n\t * @description is multiple\n\t */\n\tmultiple: Boolean,\n\t/**\n\t * @description maximum number of options user can select when multiple is true. No limit when set to 0\n\t */\n\tmultipleLimit: {\n\t\ttype: Number,\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description the name attribute of select input\n\t */\n\tname: String,\n\t/**\n\t * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n\t */\n\tnoDataText: String,\n\t/**\n\t * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n\t */\n\tnoMatchText: String,\n\t/**\n\t * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n\t */\n\tremoteMethod: Function as PropType<ElementPlusSelectV2Props[\"remoteMethod\"]>,\n\t/**\n\t * @description whether reserve the keyword after select filtered option.\n\t */\n\treserveKeyword: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description data of the options, the key of `value` and `label` can be customize by `props`\n\t */\n\toptions: {\n\t\ttype: definePropType<ElementPlusSelectV2Props[\"options\"]>(Array),\n\t},\n\t/**\n\t * @description placeholder, the default is 'Please select'\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t},\n\t/**\n\t * @description whether select dropdown is teleported to the body\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的运行时默认值与校验规则。\n\tteleported: useTooltipContentProps.teleported,\n\t/**\n\t * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n\t */\n\tpersistent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description custom class name for Select's dropdown\n\t */\n\tpopperClass: {\n\t\ttype: String,\n\t\tdefault: \"\",\n\t},\n\t/** @description custom style for Select's dropdown */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的运行时类型定义。\n\tpopperStyle: useTooltipContentProps.popperStyle,\n\t/**\n\t * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n\t */\n\tpopperOptions: {\n\t\ttype: definePropType<Partial<Options>>(Object),\n\t\tdefault: () => ({}),\n\t},\n\t/**\n\t * @description whether search data from server\n\t */\n\tremote: Boolean,\n\t/** @description debounce delay during remote search, in milliseconds */\n\tdebounce: {\n\t\ttype: Number,\n\t\tdefault: 300,\n\t},\n\t/**\n\t * @description size of component\n\t */\n\tsize: useSizeProp,\n\t/**\n\t * @description configuration options, see the following table\n\t */\n\tprops: {\n\t\ttype: definePropType<Props>(Object),\n\t\tdefault: () => ({\n\t\t\tlabel: \"label\",\n\t\t\tvalue: \"value\",\n\t\t\tdisabled: \"disabled\",\n\t\t\toptions: \"options\",\n\t\t}),\n\t},\n\t/**\n\t * @description unique identity key name for value, required when value is an object\n\t */\n\tvalueKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/**\n\t * @description Controls whether the scrollbar is always displayed\n\t */\n\tscrollbarAlwaysOn: Boolean,\n\t/**\n\t * @description whether to trigger form validation\n\t */\n\tvalidateEvent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description offset of the dropdown\n\t */\n\toffset: {\n\t\ttype: Number,\n\t\tdefault: 12,\n\t},\n\t/** @description whether to show the suffix icon during remote search */\n\tremoteShowSuffix: Boolean,\n\t/**\n\t * @description Determines whether the arrow is displayed\n\t */\n\tshowArrow: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/**\n\t * @description position of dropdown\n\t */\n\tplacement: {\n\t\ttype: definePropType<Placement>(String),\n\t\tdefault: \"bottom-start\",\n\t},\n\t/**\n\t * @description list of possible positions for dropdown\n\t */\n\tfallbackPlacements: {\n\t\ttype: definePropType<Placement[]>(Array),\n\t\tdefault: [\"bottom-start\", \"top-start\", \"right\", \"left\"],\n\t},\n\t/**\n\t * @description tag type\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的 Tag 运行时校验规则。\n\ttagType: { ...tagProps.type, default: \"info\" },\n\t/**\n\t * @description tag effect\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的 Tag 运行时校验规则。\n\ttagEffect: { ...tagProps.effect, default: \"light\" },\n\t/**\n\t * @description tabindex for input\n\t */\n\ttabindex: {\n\t\ttype: [String, Number],\n\t\tdefault: 0,\n\t},\n\t/**\n\t * @description which element the select dropdown appends to\n\t */\n\tappendTo: String,\n\t/** @description whether the dropdown width follows the input width, or a fixed width */\n\tfitInputWidth: {\n\t\ttype: [Boolean, Number],\n\t\tdefault: true,\n\t\tvalidator: (value: boolean | number) => typeof value === \"boolean\" || typeof value === \"number\",\n\t},\n\t/** @description select suffix icon */\n\tsuffixIcon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: ArrowDown,\n\t},\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 复用 Element Plus 2.x 的空值运行时约定。\n\t...useEmptyValuesProps,\n\t...useAriaProps([\"ariaLabel\"]),\n};\n\n/** 底层虚拟化选择器的运行时 Emits 定义。 */\nexport const selectV2Emits = {\n\t\"update:modelValue\": (_value: ElSelectorModelValue) => true,\n\tchange: (_value: ElSelectorModelValue) => true,\n\t\"end-reached\": (_direction: ScrollbarDirection) => true,\n\t\"remove-tag\": (_value: ElSelectorValue) => true,\n\t\"visible-change\": (_visible: boolean) => true,\n\tfocus: (_event: FocusEvent) => true,\n\tblur: (_event: FocusEvent) => true,\n\tclear: () => true,\n};\n\n/** FaSelectV2 的运行时 Props 定义。 */\nexport const faSelectV2Props = {\n\t...SelectV2Props,\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 懒加载远程数据,默认 true。当下拉框第一次显示的时候才会加载远程数据*/\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 默认选中。不能和懒加载一起使用 */\n\tdefaultSelected: Boolean,\n\t/** @description 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: () => [],\n\t},\n\t/** 分页返回 */\n\tpageResult: Boolean,\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[] | PagedResult<ElSelectorOutput>>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelectV2 的运行时 Emits 定义。 */\nexport const faSelectV2Emits = {\n\t...selectV2Emits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue) =>\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\" ||\n\t\t(typeof value === \"object\" && value !== null) ||\n\t\tvalue == null,\n\t/** @description 选中数据改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => true,\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null) => typeof value === \"string\" || Array.isArray(value) || value === null,\n\t/** @description 数据改变 */\n\tdataChange: (data: ElSelectorOutput[]) => Array.isArray(data),\n};\n\n/** FaSelectV2 的插槽参数。 */\nexport interface FaSelectV2Slots extends Record<string, unknown> {\n\t/** @description FaSelectOption 默认内容插槽 */\n\tdefault: { item: ElSelectorOutput; index: number; disabled: boolean };\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaSelectV2\",\n\tprops: faSelectV2Props,\n\temits: faSelectV2Emits,\n\tslots: makeSlots<FaSelectV2Slots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useModel(props, \"label\");\n\n\t\tconst globalSize = useGlobalSize();\n\t\tconst selectV2Ref = shallowRef<InstanceType<typeof ElSelectV2> | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async () => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\t// 判断是否为分页返回\n\t\t\t\t\tif (props.pageResult) {\n\t\t\t\t\t\tstate.selectorData = (resData as PagedResult<ElSelectorOutput>).rows ?? [];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.selectorData = resData as ElSelectorOutput[];\n\t\t\t\t\t}\n\t\t\t\t\temit(\"dataChange\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = props.data;\n\t\t\t}\n\t\t};\n\n\t\tconst handleModelValueUpdate = (value: ElSelectorModelValue) => {\n\t\t\tstate.value = value;\n\t\t\temit(\"update:modelValue\", value);\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean) => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\t!props.defaultSelected && props.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// eslint-disable-next-line vue/custom-event-name-casing -- Element Plus 的公开事件名为 visible-change,需要保持原始名称透传。\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\tconst getOptionValue = (item: ElSelectorOutput) => {\n\t\t\tconst value: unknown = item[props.props.value ?? \"value\"];\n\t\t\treturn value !== null &&\n\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t? value\n\t\t\t\t: undefined;\n\t\t};\n\n\t\tconst getOptionLabel = (item: ElSelectorOutput) => {\n\t\t\tconst label: unknown = item[props.props.label ?? \"label\"];\n\t\t\treturn typeof label === \"string\" ? label : undefined;\n\t\t};\n\n\t\tconst flattenOptions = (data: ElSelectorOutput[]): ElSelectorOutput[] =>\n\t\t\tdata.flatMap((item) => {\n\t\t\t\tconst children: unknown = item[props.props.options ?? \"options\"];\n\t\t\t\treturn [item, ...(Array.isArray(children) ? flattenOptions(children as ElSelectorOutput[]) : [])];\n\t\t\t});\n\n\t\tconst handleChange = (value?: ElSelectorModelValue) => {\n\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\tif (props.multiple) {\n\t\t\t\tconst valueList = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueList.length === 0) {\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = valueList\n\t\t\t\t\t.map((item) =>\n\t\t\t\t\t\tselectorData.find((option) => {\n\t\t\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, item);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t.filter((item) => item !== undefined);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (value == null || Array.isArray(value)) {\n\t\t\t\temit(\"change\", null, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, value);\n\t\t\t});\n\t\t\temit(\"change\", data ?? null, value);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && newValue != null) {\n\t\t\t\t\tconst hasLabel = props.label != null;\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !Array.isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && Array.isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectV2]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t[() => state.value, () => state.selectorData],\n\t\t\t([value]) => {\n\t\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tselectedLabel.value = value.map((item, index) => {\n\t\t\t\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, item);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn (data && getOptionLabel(data)) ?? (Array.isArray(props.label) ? (props.label[index] ?? \"\") : \"\");\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (value == null || Array.isArray(value)) {\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = selectorData.find((option) => {\n\t\t\t\t\tconst optionValue = getOptionValue(option);\n\t\t\t\t\treturn optionValue !== undefined && isEqual(optionValue, value);\n\t\t\t\t});\n\t\t\t\tselectedLabel.value = (data && getOptionLabel(data)) ?? (typeof props.label === \"string\" ? props.label : null);\n\t\t\t},\n\t\t\t{\n\t\t\t\tdeep: true,\n\t\t\t\tflush: \"sync\",\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.initParam,\n\t\t\t(newValue, oldValue) => {\n\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\tif (state.value != null) {\n\t\t\t\t\t\thandleModelValueUpdate(props.multiple ? [] : undefined);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data,\n\t\t\t() => {\n\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\treturn loadData();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data.length,\n\t\t\t(length) => {\n\t\t\t\tif (state.debut) state.echo = length === 0;\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tconst firstValue = firstItem && getOptionValue(firstItem);\n\t\t\t\tif (firstValue !== undefined) {\n\t\t\t\t\thandleModelValueUpdate(props.multiple ? [firstValue] : firstValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t});\n\n\t\tconst elSelectV2Props = useProps(props, SelectV2Props, [\"modelValue\", \"popperClass\", \"loading\", \"options\", \"itemHeight\"]);\n\t\tconst elSelectV2Emits = useEmits(selectV2Emits, emit, [\"update:modelValue\", \"change\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => {\n\t\t\tlet localClass = `fa-select-v2-dropdown ${props.popperClass}`;\n\t\t\tif (props.moreDetail) {\n\t\t\t\tlocalClass += ` fa-select-v2-dropdown__more-detail fa-select-v2-dropdown__more-detail-${globalSize.value}`;\n\t\t\t}\n\t\t\treturn localClass;\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<ElSelectV2\n\t\t\t\t{...elSelectV2Props.value}\n\t\t\t\t{...elSelectV2Emits.value}\n\t\t\t\tref={selectV2Ref}\n\t\t\t\tclass=\"fa-select-v2\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tmodelValue={state.value}\n\t\t\t\tonUpdate:modelValue={handleModelValueUpdate}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tloading={state.loading}\n\t\t\t\toptions={state.selectorData}\n\t\t\t\titemHeight={props.itemHeight + (globalSize.value === \"small\" ? 0 : 8)}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\t...(slots.default && {\n\t\t\t\t\t\tdefault: ({ item, index, disabled }: { item: ElSelectorOutput; index: number; disabled: boolean }) =>\n\t\t\t\t\t\t\tslots.default?.({ item, index, disabled }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.header && { header: () => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: () => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: () => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: () => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: () => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: () => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }) =>\n\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElSelectV2>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectV2Ref.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectV2Ref.value?.blur),\n\t\t\t/** @description 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectV2Ref.value?.selectedLabel),\n\t\t\t/** @description 滚动到指定选项索引。 */\n\t\t\tscrollTo: computed(() => selectV2Ref.value?.scrollTo),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleModelValueUpdate(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleModelValueUpdate(props.multiple ? [] : undefined),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAa,gBAAgB;;;;CAI5B,aAAa;;;;CAIb,cAAc;EACb,MAAM,eAAoD,MAAM;EAChE,SAAS;CACV;;;;CAIA,mBAAmB;;;;CAInB,WAAW;;;;CAIX,WAAW;EACV,MAAM,eAAmC;GAAC;GAAQ;GAAQ;EAAQ,CAAC;EACnE,SAAS;CACV;;;;CAIA,QAAQ;EACP,MAAM,eAAuB,MAAM;EACnC,SAAS;CACV;;;;CAIA,cAAc;;;;CAId,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAAuD,MAAM;EACnE,gBAAgB,CAAC;CAClB;;;;CAIA,iBAAiB;EAChB,MAAM;EACN,SAAS;CACV;;;;CAIA,oBAAoB;;;;CAIpB,UAAU;;;;CAIV,uBAAuB;EACtB,MAAM;EACN,SAAS,KAAA;CACV;;;;CAIA,YAAY;;;;CAIZ,cAAc;;;;CAId,QAAQ;EACP,MAAM;EACN,SAAS;CACV;;;;CAIA,YAAY;EACX,MAAM;EACN,SAAS;CACV;;;;CAIA,IAAI;;;;CAIJ,SAAS;;;;CAIT,aAAa;;;;CAIb,YAAY,EACX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