@silver-formily/element-plus 2.0.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.en-US.md +32 -0
  2. package/README.md +32 -35
  3. package/esm/__builtins__/index.mjs +15 -16
  4. package/esm/__builtins__/shared/index.mjs +11 -12
  5. package/esm/__builtins__/shared/transform-component.d.ts +2 -6
  6. package/esm/__builtins__/shared/transform-component.mjs +16 -33
  7. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  8. package/esm/__builtins__/shared/utils.mjs +10 -10
  9. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  10. package/esm/array-base/index.mjs +58 -58
  11. package/esm/array-base/index.mjs.map +1 -1
  12. package/esm/array-cards/index.mjs +44 -44
  13. package/esm/array-cards/index.mjs.map +1 -1
  14. package/esm/array-collapse/index.mjs +59 -58
  15. package/esm/array-collapse/index.mjs.map +1 -1
  16. package/esm/array-items/index.mjs +46 -43
  17. package/esm/array-items/index.mjs.map +1 -1
  18. package/esm/array-list-tabs/index.mjs +15 -14
  19. package/esm/array-list-tabs/index.mjs.map +1 -1
  20. package/esm/array-table/array-table.d.ts +28 -0
  21. package/esm/array-table/index.d.ts +28 -0
  22. package/esm/array-table/index.mjs +113 -111
  23. package/esm/array-table/index.mjs.map +1 -1
  24. package/esm/array-table/types.d.ts +1 -0
  25. package/esm/cascader/index.mjs +19 -20
  26. package/esm/cascader/index.mjs.map +1 -1
  27. package/esm/checkbox/checkbox-group.d.ts +1 -4
  28. package/esm/checkbox/index.d.ts +442 -379
  29. package/esm/checkbox/index.mjs.map +1 -1
  30. package/esm/editable/editable.d.ts +16 -12
  31. package/esm/editable/index.d.ts +8 -6
  32. package/esm/editable/index.mjs +110 -112
  33. package/esm/editable/index.mjs.map +1 -1
  34. package/esm/form-button-group/index.mjs +29 -28
  35. package/esm/form-button-group/index.mjs.map +1 -1
  36. package/esm/form-collapse/index.mjs +42 -43
  37. package/esm/form-collapse/index.mjs.map +1 -1
  38. package/esm/form-dialog/index.d.ts +1 -1
  39. package/esm/form-dialog/index.mjs +4 -4
  40. package/esm/form-dialog/index.mjs.map +1 -1
  41. package/esm/form-dialog/types.d.ts +6 -6
  42. package/esm/form-drawer/index.d.ts +1 -1
  43. package/esm/form-drawer/index.mjs +4 -4
  44. package/esm/form-drawer/index.mjs.map +1 -1
  45. package/esm/form-drawer/types.d.ts +6 -6
  46. package/esm/form-grid/index.d.ts +1 -183
  47. package/esm/form-grid/index.mjs +1 -1
  48. package/esm/form-grid/index.mjs.map +1 -1
  49. package/esm/form-item/form-item.d.ts +2 -1
  50. package/esm/form-item/index.d.ts +12 -6
  51. package/esm/form-item/index.mjs +163 -155
  52. package/esm/form-item/index.mjs.map +1 -1
  53. package/esm/form-item/types.d.ts +0 -1
  54. package/esm/form-layout/form-layout.d.ts +0 -1
  55. package/esm/form-layout/form-layout.mjs +53 -52
  56. package/esm/form-layout/form-layout.mjs.map +1 -1
  57. package/esm/form-layout/types.d.ts +0 -2
  58. package/esm/form-layout/utils.d.ts +3 -3
  59. package/esm/form-layout/utils.mjs +48 -43
  60. package/esm/form-layout/utils.mjs.map +1 -1
  61. package/esm/form-step/index.mjs +27 -25
  62. package/esm/form-step/index.mjs.map +1 -1
  63. package/esm/form-tab/index.d.ts +1 -26
  64. package/esm/form-tab/index.mjs +30 -30
  65. package/esm/form-tab/index.mjs.map +1 -1
  66. package/esm/index.d.ts +3 -0
  67. package/esm/index.mjs +44 -38
  68. package/esm/index.mjs.map +1 -1
  69. package/esm/input/index.mjs.map +1 -1
  70. package/esm/input-number/index.d.ts +258 -147
  71. package/esm/pagination/pagination.mjs +109 -110
  72. package/esm/pagination/pagination.mjs.map +1 -1
  73. package/esm/password/index.mjs.map +1 -1
  74. package/esm/preview-text/index.d.ts +5 -0
  75. package/esm/preview-text/index.mjs +165 -141
  76. package/esm/preview-text/index.mjs.map +1 -1
  77. package/esm/preview-text/rate.d.ts +5 -0
  78. package/esm/preview-text/utils.d.ts +5 -5
  79. package/esm/preview-text/utils.mjs.map +1 -1
  80. package/esm/radio/index.d.ts +344 -194
  81. package/esm/radio/index.mjs.map +1 -1
  82. package/esm/rate/index.d.ts +187 -0
  83. package/esm/rate/index.mjs +14 -0
  84. package/esm/rate/index.mjs.map +1 -0
  85. package/esm/reset/index.d.ts +1 -62
  86. package/esm/reset/index.mjs +1 -1
  87. package/esm/reset/index.mjs.map +1 -1
  88. package/esm/segmented/index.d.ts +26 -0
  89. package/esm/segmented/index.mjs +37 -0
  90. package/esm/segmented/index.mjs.map +1 -0
  91. package/esm/segmented/segmented.d.ts +25 -0
  92. package/esm/select/index.mjs +8 -8
  93. package/esm/select/index.mjs.map +1 -1
  94. package/esm/select-table/index.d.ts +28 -0
  95. package/esm/select-table/index.mjs +48 -47
  96. package/esm/select-table/index.mjs.map +1 -1
  97. package/esm/select-table/select-table.d.ts +56 -0
  98. package/esm/slider/index.d.ts +177 -0
  99. package/esm/slider/index.mjs +14 -0
  100. package/esm/slider/index.mjs.map +1 -0
  101. package/esm/submit/index.d.ts +1 -47
  102. package/esm/submit/index.mjs +1 -1
  103. package/esm/submit/index.mjs.map +1 -1
  104. package/esm/switch/index.d.ts +225 -189
  105. package/esm/time-select/index.d.ts +163 -103
  106. package/esm/transfer/index.d.ts +196 -115
  107. package/esm/transfer/index.mjs.map +1 -1
  108. package/esm/tree/index.mjs +26 -26
  109. package/esm/tree/index.mjs.map +1 -1
  110. package/esm/tree-select/index.mjs.map +1 -1
  111. package/esm/upload/index.d.ts +404 -399
  112. package/esm/upload/index.mjs.map +1 -1
  113. package/esm/upload/upload.d.ts +800 -790
  114. package/esm/vendor/icon.mjs.map +1 -1
  115. package/esm/vendor/lodash.mjs +12 -20
  116. package/esm/vendor/lodash.mjs.map +1 -1
  117. package/esm/vendor/runtime.mjs +29 -24
  118. package/esm/vendor/runtime.mjs.map +1 -1
  119. package/esm/vendor/shared.esm-bundler.mjs +2 -2
  120. package/esm/vendor/sizes.mjs.map +1 -1
  121. package/esm/vendor/types.mjs +5 -5
  122. package/esm/vendor/types.mjs.map +1 -1
  123. package/package.json +8 -9
@@ -55,6 +55,9 @@ declare const SelectTable: {
55
55
  emptyText: StringConstructor;
56
56
  expandRowKeys: import('vue').PropType<import('element-plus').TableProps<any>["expandRowKeys"]>;
57
57
  defaultExpandAll: BooleanConstructor;
58
+ rowExpandable: {
59
+ type: import('vue').PropType<import('element-plus').TableProps<any>["rowExpandable"]>;
60
+ };
58
61
  defaultSort: import('vue').PropType<import('element-plus').TableProps<any>["defaultSort"]>;
59
62
  tooltipEffect: StringConstructor;
60
63
  tooltipOptions: import('vue').PropType<import('element-plus').TableProps<any>["tooltipOptions"]>;
@@ -181,6 +184,7 @@ declare const SelectTable: {
181
184
  reserveSelection: import('vue').Ref<boolean>;
182
185
  selectOnIndeterminate: import('vue').Ref<boolean>;
183
186
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
187
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
184
188
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
185
189
  filteredData: import('vue').Ref<any[] | null>;
186
190
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -223,6 +227,7 @@ declare const SelectTable: {
223
227
  reserveSelection: import('vue').Ref<boolean>;
224
228
  selectOnIndeterminate: import('vue').Ref<boolean>;
225
229
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
230
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
226
231
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
227
232
  filteredData: import('vue').Ref<any[] | null>;
228
233
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -265,6 +270,7 @@ declare const SelectTable: {
265
270
  reserveSelection: import('vue').Ref<boolean>;
266
271
  selectOnIndeterminate: import('vue').Ref<boolean>;
267
272
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
273
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
268
274
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
269
275
  filteredData: import('vue').Ref<any[] | null>;
270
276
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -307,6 +313,7 @@ declare const SelectTable: {
307
313
  reserveSelection: import('vue').Ref<boolean>;
308
314
  selectOnIndeterminate: import('vue').Ref<boolean>;
309
315
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
316
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
310
317
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
311
318
  filteredData: import('vue').Ref<any[] | null>;
312
319
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -349,6 +356,7 @@ declare const SelectTable: {
349
356
  reserveSelection: import('vue').Ref<boolean>;
350
357
  selectOnIndeterminate: import('vue').Ref<boolean>;
351
358
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
359
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
352
360
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
353
361
  filteredData: import('vue').Ref<any[] | null>;
354
362
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -391,6 +399,7 @@ declare const SelectTable: {
391
399
  reserveSelection: import('vue').Ref<boolean>;
392
400
  selectOnIndeterminate: import('vue').Ref<boolean>;
393
401
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
402
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
394
403
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
395
404
  filteredData: import('vue').Ref<any[] | null>;
396
405
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -433,6 +442,7 @@ declare const SelectTable: {
433
442
  reserveSelection: import('vue').Ref<boolean>;
434
443
  selectOnIndeterminate: import('vue').Ref<boolean>;
435
444
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
445
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
436
446
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
437
447
  filteredData: import('vue').Ref<any[] | null>;
438
448
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -476,6 +486,7 @@ declare const SelectTable: {
476
486
  reserveSelection: import('vue').Ref<boolean>;
477
487
  selectOnIndeterminate: import('vue').Ref<boolean>;
478
488
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
489
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
479
490
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
480
491
  filteredData: import('vue').Ref<any[] | null>;
481
492
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -518,6 +529,7 @@ declare const SelectTable: {
518
529
  reserveSelection: import('vue').Ref<boolean>;
519
530
  selectOnIndeterminate: import('vue').Ref<boolean>;
520
531
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
532
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
521
533
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
522
534
  filteredData: import('vue').Ref<any[] | null>;
523
535
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -560,6 +572,7 @@ declare const SelectTable: {
560
572
  reserveSelection: import('vue').Ref<boolean>;
561
573
  selectOnIndeterminate: import('vue').Ref<boolean>;
562
574
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
575
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
563
576
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
564
577
  filteredData: import('vue').Ref<any[] | null>;
565
578
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -636,6 +649,7 @@ declare const SelectTable: {
636
649
  reserveSelection: import('vue').Ref<boolean>;
637
650
  selectOnIndeterminate: import('vue').Ref<boolean>;
638
651
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
652
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
639
653
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
640
654
  filteredData: import('vue').Ref<any[] | null>;
641
655
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -793,6 +807,9 @@ declare const SelectTable: {
793
807
  emptyText: StringConstructor;
794
808
  expandRowKeys: import('vue').PropType<import('element-plus').TableProps<any>["expandRowKeys"]>;
795
809
  defaultExpandAll: BooleanConstructor;
810
+ rowExpandable: {
811
+ type: import('vue').PropType<import('element-plus').TableProps<any>["rowExpandable"]>;
812
+ };
796
813
  defaultSort: import('vue').PropType<import('element-plus').TableProps<any>["defaultSort"]>;
797
814
  tooltipEffect: StringConstructor;
798
815
  tooltipOptions: import('vue').PropType<import('element-plus').TableProps<any>["tooltipOptions"]>;
@@ -919,6 +936,7 @@ declare const SelectTable: {
919
936
  reserveSelection: import('vue').Ref<boolean>;
920
937
  selectOnIndeterminate: import('vue').Ref<boolean>;
921
938
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
939
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
922
940
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
923
941
  filteredData: import('vue').Ref<any[] | null>;
924
942
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -961,6 +979,7 @@ declare const SelectTable: {
961
979
  reserveSelection: import('vue').Ref<boolean>;
962
980
  selectOnIndeterminate: import('vue').Ref<boolean>;
963
981
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
982
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
964
983
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
965
984
  filteredData: import('vue').Ref<any[] | null>;
966
985
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1003,6 +1022,7 @@ declare const SelectTable: {
1003
1022
  reserveSelection: import('vue').Ref<boolean>;
1004
1023
  selectOnIndeterminate: import('vue').Ref<boolean>;
1005
1024
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1025
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1006
1026
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1007
1027
  filteredData: import('vue').Ref<any[] | null>;
1008
1028
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1045,6 +1065,7 @@ declare const SelectTable: {
1045
1065
  reserveSelection: import('vue').Ref<boolean>;
1046
1066
  selectOnIndeterminate: import('vue').Ref<boolean>;
1047
1067
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1068
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1048
1069
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1049
1070
  filteredData: import('vue').Ref<any[] | null>;
1050
1071
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1087,6 +1108,7 @@ declare const SelectTable: {
1087
1108
  reserveSelection: import('vue').Ref<boolean>;
1088
1109
  selectOnIndeterminate: import('vue').Ref<boolean>;
1089
1110
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1111
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1090
1112
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1091
1113
  filteredData: import('vue').Ref<any[] | null>;
1092
1114
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1129,6 +1151,7 @@ declare const SelectTable: {
1129
1151
  reserveSelection: import('vue').Ref<boolean>;
1130
1152
  selectOnIndeterminate: import('vue').Ref<boolean>;
1131
1153
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1154
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1132
1155
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1133
1156
  filteredData: import('vue').Ref<any[] | null>;
1134
1157
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1171,6 +1194,7 @@ declare const SelectTable: {
1171
1194
  reserveSelection: import('vue').Ref<boolean>;
1172
1195
  selectOnIndeterminate: import('vue').Ref<boolean>;
1173
1196
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1197
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1174
1198
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1175
1199
  filteredData: import('vue').Ref<any[] | null>;
1176
1200
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1214,6 +1238,7 @@ declare const SelectTable: {
1214
1238
  reserveSelection: import('vue').Ref<boolean>;
1215
1239
  selectOnIndeterminate: import('vue').Ref<boolean>;
1216
1240
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1241
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1217
1242
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1218
1243
  filteredData: import('vue').Ref<any[] | null>;
1219
1244
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1256,6 +1281,7 @@ declare const SelectTable: {
1256
1281
  reserveSelection: import('vue').Ref<boolean>;
1257
1282
  selectOnIndeterminate: import('vue').Ref<boolean>;
1258
1283
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1284
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1259
1285
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1260
1286
  filteredData: import('vue').Ref<any[] | null>;
1261
1287
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1298,6 +1324,7 @@ declare const SelectTable: {
1298
1324
  reserveSelection: import('vue').Ref<boolean>;
1299
1325
  selectOnIndeterminate: import('vue').Ref<boolean>;
1300
1326
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1327
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1301
1328
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1302
1329
  filteredData: import('vue').Ref<any[] | null>;
1303
1330
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1374,6 +1401,7 @@ declare const SelectTable: {
1374
1401
  reserveSelection: import('vue').Ref<boolean>;
1375
1402
  selectOnIndeterminate: import('vue').Ref<boolean>;
1376
1403
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1404
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1377
1405
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1378
1406
  filteredData: import('vue').Ref<any[] | null>;
1379
1407
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1,7 +1,7 @@
1
1
  import { useField as W, connect as z, mapProps as G } from "@silver-formily/vue";
2
- import { defineComponent as U, ref as g, computed as j, watch as R, nextTick as v, createElementBlock as S, openBlock as s, normalizeClass as A, unref as r, createCommentVNode as J, withDirectives as Q, createElementVNode as X, createVNode as V, toDisplayString as Y, withCtx as f, createTextVNode as C, createBlock as y, mergeProps as w, renderSlot as Z, Fragment as ee, renderList as le } from "vue";
2
+ import { defineComponent as U, ref as g, computed as j, watch as R, nextTick as v, createElementBlock as S, openBlock as c, normalizeClass as A, unref as n, createCommentVNode as J, withDirectives as Q, createElementVNode as X, createVNode as V, toDisplayString as Y, withCtx as f, createTextVNode as C, createBlock as y, mergeProps as w, renderSlot as Z, Fragment as ee, renderList as le } from "vue";
3
3
  import { isValid as te, isEqual as oe, isFn as ae } from "@formily/shared";
4
- import { useAttrs as ne, ElLink as re, version as E, ElTable as ue, ElTableColumn as b, ElRadioGroup as ie, ElRadio as se, vLoading as ce } from "element-plus";
4
+ import { useAttrs as re, ElLink as ne, version as E, ElTable as ue, ElTableColumn as b, ElRadioGroup as ie, ElRadio as se, vLoading as ce } from "element-plus";
5
5
  import { u as x, x as de, d as me, a as fe, r as pe } from "../vendor/lodash.mjs";
6
6
  import { stylePrefix as K } from "../__builtins__/configs/index.mjs";
7
7
  import { lt as L } from "../__builtins__/shared/simple-version-compare.mjs";
@@ -16,21 +16,21 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
16
16
  optionAsValue: { type: Boolean, default: !1 },
17
17
  valueType: { default: "all" },
18
18
  loading: { type: Boolean, default: !1 },
19
- rowKey: null,
19
+ rowKey: {},
20
20
  clickRowToSelect: { type: Boolean, default: !0 },
21
21
  showAlertToolbar: { type: Boolean, default: !0 },
22
- modelValue: null,
23
- data: null,
24
- selectable: { type: Function },
22
+ modelValue: {},
23
+ data: {},
24
+ selectable: {},
25
25
  ignoreSelectable: { type: Boolean, default: !0 }
26
26
  },
27
27
  emits: ["update:modelValue"],
28
28
  setup(B, { emit: D }) {
29
- const e = B, c = D, _ = ne(), q = W();
29
+ const e = B, d = D, _ = re(), q = W();
30
30
  function F(l) {
31
31
  return L(E, "2.6.0") ? { label: l } : { value: l };
32
32
  }
33
- const d = g(), t = e.rowKey;
33
+ const s = g(), t = e.rowKey;
34
34
  function M() {
35
35
  return e.mode === "multiple" ? e.modelValue?.map((l) => e.optionAsValue ? l : {
36
36
  [t]: l
@@ -45,9 +45,9 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
45
45
  const l = x(
46
46
  u.value.map((a) => a[t])
47
47
  );
48
- await v();
49
- for (const a of e.dataSource)
50
- l.includes(a[t]) && (e.mode === "multiple" ? d.value.toggleRowSelection(a, !0, e.ignoreSelectable) : (d.value.setCurrentRow(a), T(a))), await v(), p = d.value?.getSelectionRows();
48
+ if (await v(), !!s.value)
49
+ for (const a of e.dataSource)
50
+ l.includes(a[t]) && (e.mode === "multiple" ? s.value?.toggleRowSelection(a, !0, e.ignoreSelectable) : (s.value?.setCurrentRow(a), T(a))), await v(), p = s.value?.getSelectionRows();
51
51
  },
52
52
  { immediate: !0 }
53
53
  ), R(
@@ -57,17 +57,18 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
57
57
  if (e.mode === "single")
58
58
  m.value = e.optionAsValue ? l[t] : l;
59
59
  else {
60
- await v();
61
- const n = d.value?.getSelectionRows().map((i) => i[t]), o = e.optionAsValue ? l?.map((i) => i[t]) : l ?? [];
60
+ if (await v(), !s.value)
61
+ return;
62
+ const r = s.value?.getSelectionRows().map((i) => i[t]), o = e.optionAsValue ? l?.map((i) => i[t]) : l ?? [];
62
63
  if (u.value = u.value.filter(
63
64
  (i) => o.includes(i[t])
64
- ), oe(o, n))
65
+ ), oe(o, r))
65
66
  return;
66
- const I = de(o, n);
67
+ const I = de(o, r);
67
68
  for (const i of e.dataSource)
68
69
  if (I.includes(i[t])) {
69
70
  const O = o.includes(i[t]);
70
- d.value.toggleRowSelection(i, O, e.ignoreSelectable);
71
+ s.value.toggleRowSelection(i, O, e.ignoreSelectable);
71
72
  }
72
73
  }
73
74
  },
@@ -82,54 +83,54 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
82
83
  const a = p.length > l.length ? me(
83
84
  p,
84
85
  l,
85
- (n, o) => n[t] === o[t]
86
+ (r, o) => r[t] === o[t]
86
87
  ) : [];
87
88
  if (p = [...l], u.value = fe(
88
89
  [...u.value, ...l],
89
- (n, o) => n[t] === o[t]
90
+ (r, o) => r[t] === o[t]
90
91
  ), a.length > 0) {
91
- const n = x(a.map((o) => o[t]));
92
- pe(u.value, (o) => n.includes(o[t]));
92
+ const r = x(a.map((o) => o[t]));
93
+ pe(u.value, (o) => r.includes(o[t]));
93
94
  }
94
95
  if (e.optionAsValue)
95
- c("update:modelValue", u.value);
96
+ d("update:modelValue", u.value);
96
97
  else {
97
- const n = u.value.map(
98
+ const r = u.value.map(
98
99
  (o) => o[t]
99
100
  );
100
- c("update:modelValue", n);
101
+ d("update:modelValue", r);
101
102
  }
102
103
  }
103
104
  function T(l) {
104
- m.value = l[t], e.optionAsValue ? c("update:modelValue", l) : c("update:modelValue", l[t]);
105
+ m.value = l[t], e.optionAsValue ? d("update:modelValue", l) : d("update:modelValue", l[t]);
105
106
  }
106
- function P(l, a, n) {
107
+ function P(l, a, r) {
107
108
  if (e.clickRowToSelect)
108
109
  if (e.mode === "multiple") {
109
- const o = n.target.closest("tr").querySelector('input[type="checkbox"]');
110
+ const o = r.target.closest("tr").querySelector('input[type="checkbox"]');
110
111
  o instanceof HTMLElement && o.click();
111
112
  } else {
112
- const o = n.target.closest("tr").querySelector('input[type="radio"]');
113
+ const o = r.target.closest("tr").querySelector('input[type="radio"]');
113
114
  o instanceof HTMLElement && o.click();
114
115
  }
115
116
  }
116
117
  function $() {
117
- e.mode === "multiple" ? (c("update:modelValue", []), u.value = []) : (m.value = null, c("update:modelValue", null));
118
+ e.mode === "multiple" ? (d("update:modelValue", []), u.value = []) : (m.value = null, d("update:modelValue", null));
118
119
  }
119
120
  function H(l, a) {
120
121
  return e.selectable && ae(e.selectable) ? e.selectable(l, a, q.value) : !0;
121
122
  }
122
- return (l, a) => (s(), S("div", {
123
- class: A(`${r(K)}-select-table`)
123
+ return (l, a) => (c(), S("div", {
124
+ class: A(`${n(K)}-select-table`)
124
125
  }, [
125
- k.value > 0 && e.showAlertToolbar ? (s(), S("div", {
126
+ k.value > 0 && e.showAlertToolbar ? (c(), S("div", {
126
127
  key: 0,
127
- class: A(`${r(K)}-select-table-alert-container`)
128
+ class: A(`${n(K)}-select-table-alert-container`)
128
129
  }, [
129
130
  X("span", null, "已选择 " + Y(k.value) + " 项", 1),
130
- V(r(re), {
131
+ V(n(ne), {
131
132
  type: "primary",
132
- underline: r(L)(r(E), "2.9.9") ? !1 : "never",
133
+ underline: n(L)(n(E), "2.9.9") ? !1 : "never",
133
134
  style: { "margin-left": "8px" },
134
135
  onClick: $
135
136
  }, {
@@ -139,11 +140,11 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
139
140
  _: 1
140
141
  }, 8, ["underline"])
141
142
  ], 2)) : J("", !0),
142
- Q((s(), y(r(ue), w({
143
+ Q((c(), y(n(ue), w({
143
144
  ref_key: "elTableRef",
144
- ref: d
145
- }, r(_), {
146
- "row-key": r(t),
145
+ ref: s
146
+ }, n(_), {
147
+ "row-key": n(t),
147
148
  "row-class-name": e.clickRowToSelect ? "--click-row-select" : "",
148
149
  data: e.dataSource,
149
150
  "highlight-current-row": e.mode === "single",
@@ -152,23 +153,23 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
152
153
  onRowClick: P
153
154
  }), {
154
155
  default: f(() => [
155
- e.mode === "multiple" ? (s(), y(r(b), {
156
+ e.mode === "multiple" ? (c(), y(n(b), {
156
157
  key: 0,
157
158
  type: "selection",
158
159
  selectable: H
159
- })) : (s(), y(r(b), {
160
+ })) : (c(), y(n(b), {
160
161
  key: 1,
161
162
  width: "46"
162
163
  }, {
163
- default: f(({ row: n }) => [
164
- V(r(ie), {
164
+ default: f(({ row: r }) => [
165
+ V(n(ie), {
165
166
  modelValue: m.value,
166
167
  "onUpdate:modelValue": a[0] || (a[0] = (o) => m.value = o),
167
168
  style: { width: "100%" }
168
169
  }, {
169
170
  default: f(() => [
170
- V(r(se), w(F(n[r(t)]), {
171
- onChange: () => T(n)
171
+ V(n(se), w(F(r[n(t)]), {
172
+ onChange: () => T(r)
172
173
  }), {
173
174
  default: f(() => [...a[2] || (a[2] = [
174
175
  C("   ", -1)
@@ -181,13 +182,13 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
181
182
  ]),
182
183
  _: 1
183
184
  })),
184
- e.columns.length === 0 ? Z(l.$slots, "default", { key: 2 }) : (s(!0), S(ee, { key: 3 }, le(e.columns, (n) => (s(), y(r(b), w({ ref_for: !0 }, n, {
185
- key: n.prop || n.type
185
+ e.columns.length === 0 ? Z(l.$slots, "default", { key: 2 }) : (c(!0), S(ee, { key: 3 }, le(e.columns, (r) => (c(), y(n(b), w({ ref_for: !0 }, r, {
186
+ key: r.prop || r.type
186
187
  }), null, 16))), 128))
187
188
  ]),
188
189
  _: 3
189
190
  }, 16, ["row-key", "row-class-name", "data", "highlight-current-row"])), [
190
- [r(ce), e.loading]
191
+ [n(ce), e.loading]
191
192
  ])
192
193
  ], 2));
193
194
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/select-table/select-table.vue","../../src/select-table/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { TableInstance } from 'element-plus'\r\nimport type { ISelectTableProps } from './types'\r\nimport { isEqual, isFn, isValid } from '@formily/shared'\r\nimport { useField } from '@silver-formily/vue'\r\nimport {\r\n ElLink,\r\n ElRadio,\r\n ElRadioGroup,\r\n ElTable,\r\n ElTableColumn,\r\n useAttrs,\r\n version,\r\n vLoading,\r\n} from 'element-plus'\r\nimport { differenceWith, remove, uniq, uniqWith, xor } from 'lodash-es'\r\nimport { computed, nextTick, ref, watch } from 'vue'\r\nimport { lt, stylePrefix } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FSelectTable',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\n columns: { default: () => [] },\n mode: { default: 'multiple' },\n dataSource: { default: () => [] },\n optionAsValue: { type: Boolean, default: false },\n valueType: { default: 'all' },\n loading: { type: Boolean, default: false },\n rowKey: null,\n clickRowToSelect: { type: Boolean, default: true },\n showAlertToolbar: { type: Boolean, default: true },\n modelValue: null,\n data: null,\n selectable: { type: Function },\n ignoreSelectable: { type: Boolean, default: true }\n})\r\n\r\nconst emit = defineEmits(['update:modelValue'])\r\n\r\nconst elTableProps = useAttrs()\r\nconst field = useField()\r\n\r\nfunction compatibleRadioValue(key: string) {\r\n return lt(version, '2.6.0') ? { label: key } : { value: key }\r\n}\r\n\r\nconst elTableRef = ref<TableInstance>()\r\nconst rowKey = props.rowKey\r\nfunction getInitialSelectedList() {\r\n if (props.mode === 'multiple') {\r\n return props.modelValue?.map((item) => {\r\n if (!props.optionAsValue) {\r\n return {\r\n [rowKey]: item,\r\n }\r\n }\r\n return item\r\n }) ?? []\r\n }\r\n else {\r\n return props.optionAsValue ? [props.modelValue] : [{ [rowKey]: props.modelValue }]\r\n }\r\n}\r\nconst initialSelectedList = getInitialSelectedList()\r\nconst selectedFlatDataSource = ref(initialSelectedList)\r\n// 为了获取移除的项而缓存的当前页面的前一次选择。由于element-plus没有获取移除项的方法,需要通过这种方式移除field中移除的项\r\nlet prevSelection = []\r\n\r\nconst radioSelectedKey = ref()\r\n\r\nconst currentSelectLength = computed(() => {\r\n if (props.mode === 'multiple') {\r\n return Array.isArray(props.modelValue) ? props.modelValue.length : 0\r\n }\r\n else {\r\n return isValid(radioSelectedKey.value) ? 1 : 0\r\n }\r\n})\r\n\r\nwatch(\r\n () => props.dataSource,\r\n async () => {\r\n const selectedKeys = uniq(\r\n selectedFlatDataSource.value.map(item => item[rowKey]),\r\n )\r\n await nextTick()\r\n for (const item of props.dataSource) {\r\n if (selectedKeys.includes(item[rowKey])) {\r\n if (props.mode === 'multiple') {\r\n elTableRef.value.toggleRowSelection(item, true, props.ignoreSelectable)\r\n }\r\n else {\r\n elTableRef.value.setCurrentRow(item)\r\n onRadioClick(item)\r\n }\r\n }\r\n await nextTick()\r\n prevSelection = elTableRef.value?.getSelectionRows()\r\n }\r\n },\r\n { immediate: true },\r\n)\r\n\r\nwatch(\r\n () => [props.modelValue, props.loading],\r\n async ([value, loading]) => {\r\n if (loading) {\r\n return\r\n }\r\n if (props.mode === 'single') {\r\n radioSelectedKey.value = props.optionAsValue ? value[rowKey] : value\r\n }\r\n else {\r\n await nextTick()\r\n const currentDisplayDataKeys = elTableRef.value\r\n ?.getSelectionRows()\r\n .map(item => item[rowKey])\r\n const valueKeys = props.optionAsValue\r\n ? value?.map(item => item[rowKey])\r\n : value ?? []\r\n selectedFlatDataSource.value = selectedFlatDataSource.value.filter(\r\n item => valueKeys.includes(item[rowKey]),\r\n )\r\n if (isEqual(valueKeys, currentDisplayDataKeys)) {\r\n return\r\n }\r\n const diffItems = xor(valueKeys, currentDisplayDataKeys)\r\n for (const tableItem of props.dataSource) {\r\n if (diffItems.includes(tableItem[rowKey])) {\r\n const shouldSelect = valueKeys.includes(tableItem[rowKey])\r\n elTableRef.value.toggleRowSelection(tableItem, shouldSelect, props.ignoreSelectable)\r\n }\r\n }\r\n }\r\n },\r\n {\r\n immediate: true,\r\n },\r\n)\r\n\r\nfunction onSelect(newSelection: Record<string, any>[]) {\r\n /* istanbul ignore if -- @preserve */\r\n if (!rowKey) {\r\n throw new Error('rowKey is required')\r\n }\r\n\r\n const removedItemList\r\n = prevSelection.length > newSelection.length\r\n ? differenceWith(\r\n prevSelection,\r\n newSelection,\r\n (itemPrev, itemNext) => {\r\n return itemPrev[rowKey] === itemNext[rowKey]\r\n },\r\n )\r\n : []\r\n prevSelection = [...newSelection]\r\n selectedFlatDataSource.value = uniqWith(\r\n [...selectedFlatDataSource.value, ...newSelection],\r\n (itemPrev, itemNext) => {\r\n return itemPrev[rowKey] === itemNext[rowKey]\r\n },\r\n )\r\n if (removedItemList.length > 0) {\r\n const removedKeys = uniq(removedItemList.map(item => item[rowKey]))\r\n remove(selectedFlatDataSource.value, item =>\r\n removedKeys.includes(item[rowKey]))\r\n }\r\n\r\n if (props.optionAsValue) {\r\n emit('update:modelValue', selectedFlatDataSource.value)\r\n }\r\n else {\r\n const selectedKeys = selectedFlatDataSource.value.map(\r\n item => item[rowKey],\r\n )\r\n emit('update:modelValue', selectedKeys)\r\n }\r\n}\r\n\r\nfunction onRadioClick(item) {\r\n radioSelectedKey.value = item[rowKey]\r\n if (props.optionAsValue) {\r\n emit('update:modelValue', item)\r\n }\r\n else {\r\n emit('update:modelValue', item[rowKey])\r\n }\r\n}\r\n\r\nfunction onRowClick(row: Record<string, any>, _, event: Event) {\r\n if (!props.clickRowToSelect)\r\n return\r\n\r\n if (props.mode === 'multiple') {\r\n const checkboxDOM = (event.target as Element)\r\n .closest('tr')\r\n .querySelector('input[type=\"checkbox\"]')\r\n if (checkboxDOM instanceof HTMLElement) {\r\n checkboxDOM.click()\r\n }\r\n }\r\n else {\r\n const radioDOM = (event.target as Element)\r\n .closest('tr')\r\n .querySelector('input[type=\"radio\"]')\r\n if (radioDOM instanceof HTMLElement) {\r\n radioDOM.click()\r\n }\r\n }\r\n}\r\n\r\nfunction onClearSelectionClick() {\r\n if (props.mode === 'multiple') {\r\n emit('update:modelValue', [])\r\n selectedFlatDataSource.value = []\r\n }\r\n else {\r\n radioSelectedKey.value = null\r\n emit('update:modelValue', null)\r\n }\r\n}\r\n\r\nfunction selectable(row: Record<string, any>, index: number) {\r\n if (props.selectable && isFn(props.selectable)) {\r\n return props.selectable(row, index, field.value)\r\n }\r\n return true\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"`${stylePrefix}-select-table`\">\r\n <div\r\n v-if=\"currentSelectLength > 0 && props.showAlertToolbar\"\r\n :class=\"`${stylePrefix}-select-table-alert-container`\"\r\n >\r\n <span>已选择 {{ currentSelectLength }} 项</span>\r\n <ElLink\r\n type=\"primary\"\r\n :underline=\"lt(version, '2.9.9') ? false : 'never'\"\r\n style=\"margin-left: 8px;\"\r\n @click=\"onClearSelectionClick\"\r\n >\r\n 取消选择\r\n </ElLink>\r\n </div>\r\n <ElTable\r\n ref=\"elTableRef\"\r\n v-loading=\"props.loading\"\r\n v-bind=\"elTableProps\"\r\n :row-key=\"rowKey\"\r\n :row-class-name=\"props.clickRowToSelect ? `--click-row-select` : ''\"\r\n :data=\"props.dataSource\"\r\n :highlight-current-row=\"props.mode === 'single'\"\r\n @select=\"onSelect\"\r\n @select-all=\"onSelect\"\r\n @row-click=\"onRowClick\"\r\n >\r\n <ElTableColumn\r\n v-if=\"props.mode === 'multiple'\"\r\n type=\"selection\"\r\n :selectable=\"selectable\"\r\n />\r\n <ElTableColumn\r\n v-else\r\n width=\"46\"\r\n >\r\n <template #default=\"{ row }\">\r\n <ElRadioGroup v-model=\"radioSelectedKey\" style=\"width: 100%;\">\r\n <ElRadio\r\n v-bind=\"compatibleRadioValue(row[rowKey])\"\r\n @change=\"() => onRadioClick(row)\"\r\n >\r\n &nbsp;\r\n </ElRadio>\r\n </ElRadioGroup>\r\n </template>\r\n </ElTableColumn>\r\n <template v-if=\"props.columns.length === 0\">\r\n <slot />\r\n </template>\r\n <template v-else>\r\n <ElTableColumn\r\n v-for=\"colItem of props.columns\"\r\n v-bind=\"colItem\"\r\n :key=\"colItem.prop || colItem.type\"\r\n />\r\n </template>\r\n </ElTable>\r\n </div>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport InnerSelectTable from './select-table.vue'\r\nimport './style.scss'\r\n\r\nconst SelectTable = connect(\r\n InnerSelectTable,\r\n mapProps({ dataSource: 'dataSource', loading: 'loading' }),\r\n)\r\n\r\nexport { SelectTable }\r\n\r\nexport default SelectTable\r\n"],"names":["props","__props","emit","__emit","elTableProps","useAttrs","field","useField","compatibleRadioValue","key","lt","version","elTableRef","ref","rowKey","getInitialSelectedList","item","initialSelectedList","selectedFlatDataSource","prevSelection","radioSelectedKey","currentSelectLength","computed","isValid","watch","selectedKeys","uniq","nextTick","onRadioClick","value","loading","currentDisplayDataKeys","valueKeys","isEqual","diffItems","xor","tableItem","shouldSelect","onSelect","newSelection","removedItemList","differenceWith","itemPrev","itemNext","uniqWith","removedKeys","remove","onRowClick","row","_","event","checkboxDOM","radioDOM","onClearSelectionClick","selectable","index","isFn","_createElementBlock","_unref","stylePrefix","_createElementVNode","_toDisplayString","_createVNode","ElLink","_cache","_withDirectives","_openBlock","_createBlock","_mergeProps","ElTableColumn","_withCtx","ElRadioGroup","$event","_renderSlot","_ctx","_Fragment","_renderList","colItem","vLoading","SelectTable","connect","InnerSelectTable","mapProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAMA,IAAQC,GAgBRC,IAAOC,GAEPC,IAAeC,GAAA,GACfC,IAAQC,EAAA;AAEd,aAASC,EAAqBC,GAAa;AACzC,aAAOC,EAAGC,GAAS,OAAO,IAAI,EAAE,OAAOF,EAAA,IAAQ,EAAE,OAAOA,EAAA;AAAA,IAC1D;AAEA,UAAMG,IAAaC,EAAA,GACbC,IAASd,EAAM;AACrB,aAASe,IAAyB;AAChC,aAAIf,EAAM,SAAS,aACVA,EAAM,YAAY,IAAI,CAACgB,MACvBhB,EAAM,gBAKJgB,IAJE;AAAA,QACL,CAACF,CAAM,GAAGE;AAAA,MAAA,CAIf,KAAK,CAAA,IAGChB,EAAM,gBAAgB,CAACA,EAAM,UAAU,IAAI,CAAC,EAAE,CAACc,CAAM,GAAGd,EAAM,YAAY;AAAA,IAErF;AACA,UAAMiB,IAAsBF,EAAA,GACtBG,IAAyBL,EAAII,CAAmB;AAEtD,QAAIE,IAAgB,CAAA;AAEpB,UAAMC,IAAmBP,EAAA,GAEnBQ,IAAsBC,EAAS,MAC/BtB,EAAM,SAAS,aACV,MAAM,QAAQA,EAAM,UAAU,IAAIA,EAAM,WAAW,SAAS,IAG5DuB,GAAQH,EAAiB,KAAK,IAAI,IAAI,CAEhD;AAED,IAAAI;AAAA,MACE,MAAMxB,EAAM;AAAA,MACZ,YAAY;AACV,cAAMyB,IAAeC;AAAA,UACnBR,EAAuB,MAAM,IAAI,CAAAF,MAAQA,EAAK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,MAAA;;;ICxPxB+E,KAAcC;AAAA,EAClBC;AAAAA,EACAC,EAAS,EAAE,YAAY,cAAc,SAAS,WAAW;AAC3D;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/select-table/select-table.vue","../../src/select-table/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { TableInstance } from 'element-plus'\r\nimport type { ISelectTableProps } from './types'\r\nimport { isEqual, isFn, isValid } from '@formily/shared'\r\nimport { useField } from '@silver-formily/vue'\r\nimport {\r\n ElLink,\r\n ElRadio,\r\n ElRadioGroup,\r\n ElTable,\r\n ElTableColumn,\r\n useAttrs,\r\n version,\r\n vLoading,\r\n} from 'element-plus'\r\nimport { differenceWith, remove, uniq, uniqWith, xor } from 'lodash-es'\r\nimport { computed, nextTick, ref, watch } from 'vue'\r\nimport { lt, stylePrefix } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FSelectTable',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = withDefaults(defineProps<ISelectTableProps>(), {\r\n columns: () => [],\r\n mode: 'multiple',\r\n dataSource: () => [],\r\n optionAsValue: false,\r\n valueType: 'all',\r\n loading: false,\r\n clickRowToSelect: true,\r\n showAlertToolbar: true,\r\n ignoreSelectable: true,\r\n})\r\n\r\nconst emit = defineEmits(['update:modelValue'])\r\n\r\nconst elTableProps = useAttrs()\r\nconst field = useField()\r\n\r\nfunction compatibleRadioValue(key: string) {\r\n return lt(version, '2.6.0') ? { label: key } : { value: key }\r\n}\r\n\r\nconst elTableRef = ref<TableInstance>()\r\nconst rowKey = props.rowKey\r\nfunction getInitialSelectedList() {\r\n if (props.mode === 'multiple') {\r\n return props.modelValue?.map((item) => {\r\n if (!props.optionAsValue) {\r\n return {\r\n [rowKey]: item,\r\n }\r\n }\r\n return item\r\n }) ?? []\r\n }\r\n else {\r\n return props.optionAsValue ? [props.modelValue] : [{ [rowKey]: props.modelValue }]\r\n }\r\n}\r\nconst initialSelectedList = getInitialSelectedList()\r\nconst selectedFlatDataSource = ref(initialSelectedList)\r\n// 为了获取移除的项而缓存的当前页面的前一次选择。由于element-plus没有获取移除项的方法,需要通过这种方式移除field中移除的项\r\nlet prevSelection = []\r\n\r\nconst radioSelectedKey = ref()\r\n\r\nconst currentSelectLength = computed(() => {\r\n if (props.mode === 'multiple') {\r\n return Array.isArray(props.modelValue) ? props.modelValue.length : 0\r\n }\r\n else {\r\n return isValid(radioSelectedKey.value) ? 1 : 0\r\n }\r\n})\r\n\r\nwatch(\r\n () => props.dataSource,\r\n async () => {\n const selectedKeys = uniq(\n selectedFlatDataSource.value.map(item => item[rowKey]),\n )\n await nextTick()\n if (!elTableRef.value) {\n return\n }\n for (const item of props.dataSource) {\n if (selectedKeys.includes(item[rowKey])) {\n if (props.mode === 'multiple') {\n elTableRef.value?.toggleRowSelection(item, true, props.ignoreSelectable)\n }\n else {\n elTableRef.value?.setCurrentRow(item)\n onRadioClick(item)\n }\n }\n await nextTick()\n prevSelection = elTableRef.value?.getSelectionRows()\n }\n },\n { immediate: true },\n)\n\r\nwatch(\r\n () => [props.modelValue, props.loading],\r\n async ([value, loading]) => {\r\n if (loading) {\r\n return\r\n }\r\n if (props.mode === 'single') {\n radioSelectedKey.value = props.optionAsValue ? value[rowKey] : value\n }\n else {\n await nextTick()\n if (!elTableRef.value) {\n return\n }\n const currentDisplayDataKeys = elTableRef.value\n ?.getSelectionRows()\n .map(item => item[rowKey])\n const valueKeys = props.optionAsValue\r\n ? value?.map(item => item[rowKey])\r\n : value ?? []\r\n selectedFlatDataSource.value = selectedFlatDataSource.value.filter(\r\n item => valueKeys.includes(item[rowKey]),\r\n )\r\n if (isEqual(valueKeys, currentDisplayDataKeys)) {\r\n return\r\n }\r\n const diffItems = xor(valueKeys, currentDisplayDataKeys)\r\n for (const tableItem of props.dataSource) {\r\n if (diffItems.includes(tableItem[rowKey])) {\r\n const shouldSelect = valueKeys.includes(tableItem[rowKey])\r\n elTableRef.value.toggleRowSelection(tableItem, shouldSelect, props.ignoreSelectable)\r\n }\r\n }\r\n }\r\n },\r\n {\r\n immediate: true,\r\n },\r\n)\r\n\r\nfunction onSelect(newSelection: Record<string, any>[]) {\r\n /* istanbul ignore if -- @preserve */\r\n if (!rowKey) {\r\n throw new Error('rowKey is required')\r\n }\r\n\r\n const removedItemList\r\n = prevSelection.length > newSelection.length\r\n ? differenceWith(\r\n prevSelection,\r\n newSelection,\r\n (itemPrev, itemNext) => {\r\n return itemPrev[rowKey] === itemNext[rowKey]\r\n },\r\n )\r\n : []\r\n prevSelection = [...newSelection]\r\n selectedFlatDataSource.value = uniqWith(\r\n [...selectedFlatDataSource.value, ...newSelection],\r\n (itemPrev, itemNext) => {\r\n return itemPrev[rowKey] === itemNext[rowKey]\r\n },\r\n )\r\n if (removedItemList.length > 0) {\r\n const removedKeys = uniq(removedItemList.map(item => item[rowKey]))\r\n remove(selectedFlatDataSource.value, item =>\r\n removedKeys.includes(item[rowKey]))\r\n }\r\n\r\n if (props.optionAsValue) {\r\n emit('update:modelValue', selectedFlatDataSource.value)\r\n }\r\n else {\r\n const selectedKeys = selectedFlatDataSource.value.map(\r\n item => item[rowKey],\r\n )\r\n emit('update:modelValue', selectedKeys)\r\n }\r\n}\r\n\r\nfunction onRadioClick(item) {\r\n radioSelectedKey.value = item[rowKey]\r\n if (props.optionAsValue) {\r\n emit('update:modelValue', item)\r\n }\r\n else {\r\n emit('update:modelValue', item[rowKey])\r\n }\r\n}\r\n\r\nfunction onRowClick(row: Record<string, any>, _, event: Event) {\r\n if (!props.clickRowToSelect)\r\n return\r\n\r\n if (props.mode === 'multiple') {\r\n const checkboxDOM = (event.target as Element)\r\n .closest('tr')\r\n .querySelector('input[type=\"checkbox\"]')\r\n if (checkboxDOM instanceof HTMLElement) {\r\n checkboxDOM.click()\r\n }\r\n }\r\n else {\r\n const radioDOM = (event.target as Element)\r\n .closest('tr')\r\n .querySelector('input[type=\"radio\"]')\r\n if (radioDOM instanceof HTMLElement) {\r\n radioDOM.click()\r\n }\r\n }\r\n}\r\n\r\nfunction onClearSelectionClick() {\r\n if (props.mode === 'multiple') {\r\n emit('update:modelValue', [])\r\n selectedFlatDataSource.value = []\r\n }\r\n else {\r\n radioSelectedKey.value = null\r\n emit('update:modelValue', null)\r\n }\r\n}\r\n\r\nfunction selectable(row: Record<string, any>, index: number) {\r\n if (props.selectable && isFn(props.selectable)) {\r\n return props.selectable(row, index, field.value)\r\n }\r\n return true\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"`${stylePrefix}-select-table`\">\r\n <div\r\n v-if=\"currentSelectLength > 0 && props.showAlertToolbar\"\r\n :class=\"`${stylePrefix}-select-table-alert-container`\"\r\n >\r\n <span>已选择 {{ currentSelectLength }} 项</span>\r\n <ElLink\r\n type=\"primary\"\r\n :underline=\"lt(version, '2.9.9') ? false : 'never'\"\r\n style=\"margin-left: 8px;\"\r\n @click=\"onClearSelectionClick\"\r\n >\r\n 取消选择\r\n </ElLink>\r\n </div>\r\n <ElTable\r\n ref=\"elTableRef\"\r\n v-loading=\"props.loading\"\r\n v-bind=\"elTableProps\"\r\n :row-key=\"rowKey\"\r\n :row-class-name=\"props.clickRowToSelect ? `--click-row-select` : ''\"\r\n :data=\"props.dataSource\"\r\n :highlight-current-row=\"props.mode === 'single'\"\r\n @select=\"onSelect\"\r\n @select-all=\"onSelect\"\r\n @row-click=\"onRowClick\"\r\n >\r\n <ElTableColumn\r\n v-if=\"props.mode === 'multiple'\"\r\n type=\"selection\"\r\n :selectable=\"selectable\"\r\n />\r\n <ElTableColumn\r\n v-else\r\n width=\"46\"\r\n >\r\n <template #default=\"{ row }\">\r\n <ElRadioGroup v-model=\"radioSelectedKey\" style=\"width: 100%;\">\r\n <ElRadio\r\n v-bind=\"compatibleRadioValue(row[rowKey])\"\r\n @change=\"() => onRadioClick(row)\"\r\n >\r\n &nbsp;\r\n </ElRadio>\r\n </ElRadioGroup>\r\n </template>\r\n </ElTableColumn>\r\n <template v-if=\"props.columns.length === 0\">\r\n <slot />\r\n </template>\r\n <template v-else>\r\n <ElTableColumn\r\n v-for=\"colItem of props.columns\"\r\n v-bind=\"colItem\"\r\n :key=\"colItem.prop || colItem.type\"\r\n />\r\n </template>\r\n </ElTable>\r\n </div>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport InnerSelectTable from './select-table.vue'\r\nimport './style.scss'\r\n\r\nconst SelectTable = connect<typeof InnerSelectTable>(\n InnerSelectTable,\n mapProps({ dataSource: 'dataSource', loading: 'loading' }),\r\n)\r\n\r\nexport { SelectTable }\r\n\r\nexport default SelectTable\r\n"],"names":["props","__props","emit","__emit","elTableProps","useAttrs","field","useField","compatibleRadioValue","key","lt","version","elTableRef","ref","rowKey","getInitialSelectedList","item","initialSelectedList","selectedFlatDataSource","prevSelection","radioSelectedKey","currentSelectLength","computed","isValid","watch","selectedKeys","uniq","nextTick","onRadioClick","value","loading","currentDisplayDataKeys","valueKeys","isEqual","diffItems","xor","tableItem","shouldSelect","onSelect","newSelection","removedItemList","differenceWith","itemPrev","itemNext","uniqWith","removedKeys","remove","onRowClick","row","_","event","checkboxDOM","radioDOM","onClearSelectionClick","selectable","index","isFn","_createElementBlock","_unref","stylePrefix","_createElementVNode","_toDisplayString","_createVNode","ElLink","_cache","_withDirectives","_openBlock","_createBlock","_mergeProps","ElTableColumn","_withCtx","ElRadioGroup","$event","_renderSlot","_ctx","_Fragment","_renderList","colItem","vLoading","SelectTable","connect","InnerSelectTable","mapProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAMA,IAAQC,GAYRC,IAAOC,GAEPC,IAAeC,GAAA,GACfC,IAAQC,EAAA;AAEd,aAASC,EAAqBC,GAAa;AACzC,aAAOC,EAAGC,GAAS,OAAO,IAAI,EAAE,OAAOF,EAAA,IAAQ,EAAE,OAAOA,EAAA;AAAA,IAC1D;AAEA,UAAMG,IAAaC,EAAA,GACbC,IAASd,EAAM;AACrB,aAASe,IAAyB;AAChC,aAAIf,EAAM,SAAS,aACVA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