@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
@@ -44,6 +44,9 @@ export declare const ArrayTable: {
44
44
  emptyText: StringConstructor;
45
45
  expandRowKeys: import('vue').PropType<import('element-plus').TableProps<any>["expandRowKeys"]>;
46
46
  defaultExpandAll: BooleanConstructor;
47
+ rowExpandable: {
48
+ type: import('vue').PropType<import('element-plus').TableProps<any>["rowExpandable"]>;
49
+ };
47
50
  defaultSort: import('vue').PropType<import('element-plus').TableProps<any>["defaultSort"]>;
48
51
  tooltipEffect: StringConstructor;
49
52
  tooltipOptions: import('vue').PropType<import('element-plus').TableProps<any>["tooltipOptions"]>;
@@ -170,6 +173,7 @@ export declare const ArrayTable: {
170
173
  reserveSelection: import('vue').Ref<boolean>;
171
174
  selectOnIndeterminate: import('vue').Ref<boolean>;
172
175
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
176
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
173
177
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
174
178
  filteredData: import('vue').Ref<any[] | null>;
175
179
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -212,6 +216,7 @@ export declare const ArrayTable: {
212
216
  reserveSelection: import('vue').Ref<boolean>;
213
217
  selectOnIndeterminate: import('vue').Ref<boolean>;
214
218
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
219
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
215
220
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
216
221
  filteredData: import('vue').Ref<any[] | null>;
217
222
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -254,6 +259,7 @@ export declare const ArrayTable: {
254
259
  reserveSelection: import('vue').Ref<boolean>;
255
260
  selectOnIndeterminate: import('vue').Ref<boolean>;
256
261
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
262
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
257
263
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
258
264
  filteredData: import('vue').Ref<any[] | null>;
259
265
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -296,6 +302,7 @@ export declare const ArrayTable: {
296
302
  reserveSelection: import('vue').Ref<boolean>;
297
303
  selectOnIndeterminate: import('vue').Ref<boolean>;
298
304
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
305
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
299
306
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
300
307
  filteredData: import('vue').Ref<any[] | null>;
301
308
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -338,6 +345,7 @@ export declare const ArrayTable: {
338
345
  reserveSelection: import('vue').Ref<boolean>;
339
346
  selectOnIndeterminate: import('vue').Ref<boolean>;
340
347
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
348
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
341
349
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
342
350
  filteredData: import('vue').Ref<any[] | null>;
343
351
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -380,6 +388,7 @@ export declare const ArrayTable: {
380
388
  reserveSelection: import('vue').Ref<boolean>;
381
389
  selectOnIndeterminate: import('vue').Ref<boolean>;
382
390
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
391
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
383
392
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
384
393
  filteredData: import('vue').Ref<any[] | null>;
385
394
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -422,6 +431,7 @@ export declare const ArrayTable: {
422
431
  reserveSelection: import('vue').Ref<boolean>;
423
432
  selectOnIndeterminate: import('vue').Ref<boolean>;
424
433
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
434
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
425
435
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
426
436
  filteredData: import('vue').Ref<any[] | null>;
427
437
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -465,6 +475,7 @@ export declare const ArrayTable: {
465
475
  reserveSelection: import('vue').Ref<boolean>;
466
476
  selectOnIndeterminate: import('vue').Ref<boolean>;
467
477
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
478
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
468
479
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
469
480
  filteredData: import('vue').Ref<any[] | null>;
470
481
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -507,6 +518,7 @@ export declare const ArrayTable: {
507
518
  reserveSelection: import('vue').Ref<boolean>;
508
519
  selectOnIndeterminate: import('vue').Ref<boolean>;
509
520
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
521
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
510
522
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
511
523
  filteredData: import('vue').Ref<any[] | null>;
512
524
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -549,6 +561,7 @@ export declare const ArrayTable: {
549
561
  reserveSelection: import('vue').Ref<boolean>;
550
562
  selectOnIndeterminate: import('vue').Ref<boolean>;
551
563
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
564
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
552
565
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
553
566
  filteredData: import('vue').Ref<any[] | null>;
554
567
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -625,6 +638,7 @@ export declare const ArrayTable: {
625
638
  reserveSelection: import('vue').Ref<boolean>;
626
639
  selectOnIndeterminate: import('vue').Ref<boolean>;
627
640
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
641
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
628
642
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
629
643
  filteredData: import('vue').Ref<any[] | null>;
630
644
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -782,6 +796,9 @@ export declare const ArrayTable: {
782
796
  emptyText: StringConstructor;
783
797
  expandRowKeys: import('vue').PropType<import('element-plus').TableProps<any>["expandRowKeys"]>;
784
798
  defaultExpandAll: BooleanConstructor;
799
+ rowExpandable: {
800
+ type: import('vue').PropType<import('element-plus').TableProps<any>["rowExpandable"]>;
801
+ };
785
802
  defaultSort: import('vue').PropType<import('element-plus').TableProps<any>["defaultSort"]>;
786
803
  tooltipEffect: StringConstructor;
787
804
  tooltipOptions: import('vue').PropType<import('element-plus').TableProps<any>["tooltipOptions"]>;
@@ -908,6 +925,7 @@ export declare const ArrayTable: {
908
925
  reserveSelection: import('vue').Ref<boolean>;
909
926
  selectOnIndeterminate: import('vue').Ref<boolean>;
910
927
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
928
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
911
929
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
912
930
  filteredData: import('vue').Ref<any[] | null>;
913
931
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -950,6 +968,7 @@ export declare const ArrayTable: {
950
968
  reserveSelection: import('vue').Ref<boolean>;
951
969
  selectOnIndeterminate: import('vue').Ref<boolean>;
952
970
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
971
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
953
972
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
954
973
  filteredData: import('vue').Ref<any[] | null>;
955
974
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -992,6 +1011,7 @@ export declare const ArrayTable: {
992
1011
  reserveSelection: import('vue').Ref<boolean>;
993
1012
  selectOnIndeterminate: import('vue').Ref<boolean>;
994
1013
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1014
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
995
1015
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
996
1016
  filteredData: import('vue').Ref<any[] | null>;
997
1017
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1034,6 +1054,7 @@ export declare const ArrayTable: {
1034
1054
  reserveSelection: import('vue').Ref<boolean>;
1035
1055
  selectOnIndeterminate: import('vue').Ref<boolean>;
1036
1056
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1057
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1037
1058
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1038
1059
  filteredData: import('vue').Ref<any[] | null>;
1039
1060
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1076,6 +1097,7 @@ export declare const ArrayTable: {
1076
1097
  reserveSelection: import('vue').Ref<boolean>;
1077
1098
  selectOnIndeterminate: import('vue').Ref<boolean>;
1078
1099
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1100
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1079
1101
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1080
1102
  filteredData: import('vue').Ref<any[] | null>;
1081
1103
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1118,6 +1140,7 @@ export declare const ArrayTable: {
1118
1140
  reserveSelection: import('vue').Ref<boolean>;
1119
1141
  selectOnIndeterminate: import('vue').Ref<boolean>;
1120
1142
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1143
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1121
1144
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1122
1145
  filteredData: import('vue').Ref<any[] | null>;
1123
1146
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1160,6 +1183,7 @@ export declare const ArrayTable: {
1160
1183
  reserveSelection: import('vue').Ref<boolean>;
1161
1184
  selectOnIndeterminate: import('vue').Ref<boolean>;
1162
1185
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1186
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1163
1187
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1164
1188
  filteredData: import('vue').Ref<any[] | null>;
1165
1189
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1203,6 +1227,7 @@ export declare const ArrayTable: {
1203
1227
  reserveSelection: import('vue').Ref<boolean>;
1204
1228
  selectOnIndeterminate: import('vue').Ref<boolean>;
1205
1229
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1230
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1206
1231
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1207
1232
  filteredData: import('vue').Ref<any[] | null>;
1208
1233
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1245,6 +1270,7 @@ export declare const ArrayTable: {
1245
1270
  reserveSelection: import('vue').Ref<boolean>;
1246
1271
  selectOnIndeterminate: import('vue').Ref<boolean>;
1247
1272
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1273
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1248
1274
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1249
1275
  filteredData: import('vue').Ref<any[] | null>;
1250
1276
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1287,6 +1313,7 @@ export declare const ArrayTable: {
1287
1313
  reserveSelection: import('vue').Ref<boolean>;
1288
1314
  selectOnIndeterminate: import('vue').Ref<boolean>;
1289
1315
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1316
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1290
1317
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1291
1318
  filteredData: import('vue').Ref<any[] | null>;
1292
1319
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1363,6 +1390,7 @@ export declare const ArrayTable: {
1363
1390
  reserveSelection: import('vue').Ref<boolean>;
1364
1391
  selectOnIndeterminate: import('vue').Ref<boolean>;
1365
1392
  selectable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1393
+ rowExpandable: import('vue').Ref<((row: any, index: number) => boolean) | null>;
1366
1394
  filters: import('vue').Ref<import('element-plus/es/components/table/src/store/index.mjs').StoreFilter>;
1367
1395
  filteredData: import('vue').Ref<any[] | null>;
1368
1396
  sortingColumn: import('vue').Ref<import('element-plus').TableColumnCtx<any> | null>;
@@ -1,95 +1,97 @@
1
1
  import { ArrayBase as o } from "../array-base/index.mjs";
2
- import { defineComponent as X, computed as z, ref as y, watch as Y, createElementBlock as m, openBlock as n, normalizeClass as F, unref as a, createBlock as i, withCtx as f, createVNode as Z, createCommentVNode as A, withDirectives as ee, mergeProps as b, Fragment as k, renderList as _, resolveDynamicComponent as re, createElementVNode as ae, createTextVNode as te, toDisplayString as ne, nextTick as oe } from "vue";
3
- import { reaction as le, autorun as se, observable as S } from "@formily/reactive";
4
- import { isEqual as ue, isArr as R } from "@formily/shared";
5
- import { useField as ie, useFieldSchema as pe, RecursionField as w } from "@silver-formily/vue";
6
- import { ElTable as de, ElTableColumn as ce, vLoading as me } from "element-plus";
7
- import { VueDraggable as fe } from "vue-draggable-plus";
8
- import { isAdditionComponent as ve } from "../array-base/utils.mjs";
9
- import ye from "../pagination/pagination.mjs";
10
- import { isColumnComponent as V, prefixCls as D, isTableComponent as ge, hasRequiredProperty as be } from "./utils.mjs";
11
- import { o as ke } from "../vendor/lodash.mjs";
12
- import { useCleanAttrs as xe, composeExport as he } from "../__builtins__/shared/utils.mjs";
13
- import { stylePrefix as Pe } from "../__builtins__/configs/index.mjs";
14
- import '../styles/array-table/index.css';const Ce = { key: 1 }, Te = /* @__PURE__ */ X({
2
+ import { defineComponent as Y, computed as y, ref as g, watch as Z, createElementBlock as m, openBlock as n, normalizeClass as z, unref as t, createBlock as i, withCtx as f, createVNode as ee, createCommentVNode as A, withDirectives as re, mergeProps as k, Fragment as h, renderList as _, resolveDynamicComponent as ae, createElementVNode as te, createTextVNode as ne, toDisplayString as oe, nextTick as le } from "vue";
3
+ import { reaction as se, autorun as ue } from "@formily/reactive";
4
+ import { isEqual as ie, isArr as R } from "@formily/shared";
5
+ import { formilyComputed as pe } from "@silver-formily/reactive-vue";
6
+ import { useField as ce, useFieldSchema as de, RecursionField as w } from "@silver-formily/vue";
7
+ import { ElTable as me, ElTableColumn as fe, vLoading as ve } from "element-plus";
8
+ import { VueDraggable as ye } from "vue-draggable-plus";
9
+ import { isAdditionComponent as ge } from "../array-base/utils.mjs";
10
+ import be from "../pagination/pagination.mjs";
11
+ import { isColumnComponent as F, prefixCls as D, isTableComponent as ke, hasRequiredProperty as he } from "./utils.mjs";
12
+ import { o as xe } from "../vendor/lodash.mjs";
13
+ import { useCleanAttrs as Ce, composeExport as Pe } from "../__builtins__/shared/utils.mjs";
14
+ import { stylePrefix as Se } from "../__builtins__/configs/index.mjs";
15
+ import '../styles/array-table/index.css';const Te = { key: 1 }, Ae = /* @__PURE__ */ Y({
15
16
  name: "FArrayTable",
16
17
  inheritAttrs: !1,
17
18
  __name: "array-table",
18
19
  props: {
19
20
  modelValue: { default: () => [] },
20
21
  pagination: { type: Boolean, default: !0 },
21
- paginationProps: null
22
+ paginationProps: {},
23
+ height: {}
22
24
  },
23
- setup(B) {
24
- const d = B, { props: N } = xe(), U = z(() => ke(d.paginationProps, ["pageSize", "currentPage"])), x = ie(), l = x.value, h = pe(), { getKey: P, keyMap: $ } = o.useKey(h.value), E = y();
25
- function I(e) {
26
- return ge(e) ? H(e) : e.properties ? Object.values(e.properties).flatMap((t) => I(t)) : [];
25
+ setup(V) {
26
+ const c = V, { props: B } = Ce(), N = y(() => xe(c.paginationProps, ["pageSize", "currentPage"])), x = ce(), l = x.value, C = de(), U = y(() => C.value?.properties ?? {}), { getKey: P, keyMap: $ } = o.useKey(C.value), E = g();
27
+ function I(a) {
28
+ return ke(a) ? H(a) : a.properties ? Object.values(a.properties).flatMap((r) => I(r)) : [];
27
29
  }
28
- function H(e) {
29
- const t = e["x-component-props"]?.prop || e.name;
30
+ function H(a) {
31
+ const r = a["x-component-props"]?.prop || a.name;
30
32
  /* istanbul ignore if -- @preserve */
31
- if (!t)
33
+ if (!r)
32
34
  return [];
33
- const r = x.value.query(x.value.address.concat(t)).take();
35
+ const e = x.value.query(x.value.address.concat(r)).take();
34
36
  return [{
35
- name: t,
36
- display: r?.display || e["x-display"],
37
- required: be(e),
38
- field: r,
39
- fieldProps: r?.props || e.toFieldProps(),
40
- schema: e,
41
- columnProps: r?.component?.[1] || e["x-component-props"] || {}
37
+ name: r,
38
+ display: e?.display || a["x-display"],
39
+ required: he(a),
40
+ field: e,
41
+ fieldProps: e?.props || a.toFieldProps(),
42
+ schema: a,
43
+ columnProps: e?.component?.[1] || a["x-component-props"] || {}
42
44
  }];
43
45
  }
44
- const C = y(0);
45
- le(() => {
46
- const e = l.path.entire;
47
- return l.query(`${e}.*`).map((t) => ({
48
- name: t.component[0],
49
- visible: t.visible
50
- })).filter((t) => t.name.includes("Column"));
46
+ const S = g(0);
47
+ se(() => {
48
+ const a = l.path.entire;
49
+ return l.query(`${a}.*`).map((r) => ({
50
+ name: r.component[0],
51
+ visible: r.visible
52
+ })).filter((r) => r.name.includes("Column"));
51
53
  }, async () => {
52
- C.value++;
53
- }, { equals: ue });
54
- const v = y([]), c = y(d.paginationProps?.pageSize ?? 10), p = y(d.paginationProps?.currentPage ?? 1);
54
+ S.value++;
55
+ }, { equals: ie });
56
+ const v = g([]), d = g(c.paginationProps?.pageSize ?? 10), p = g(c.paginationProps?.currentPage ?? 1);
55
57
  function M() {
56
58
  /* istanbul ignore if -- @preserve */
57
59
  if (!R(l.value)) {
58
60
  v.value = [];
59
61
  return;
60
62
  }
61
- if (d.pagination === !1) {
63
+ if (c.pagination === !1) {
62
64
  v.value = [...l.value];
63
65
  return;
64
66
  }
65
- v.value = l.value.slice((p.value - 1) * c.value, p.value * c.value);
67
+ v.value = l.value.slice((p.value - 1) * d.value, p.value * d.value);
66
68
  }
67
- Y([c, p], M), se(M);
68
- const T = S.computed(() => {
69
- const e = h.value.items;
70
- return (R(e) ? e : [e]).reduce((r, u) => {
69
+ Z([d, p], M), ue(M);
70
+ const T = pe(() => {
71
+ const a = C.value.items;
72
+ return (R(a) ? a : [a]).reduce((e, u) => {
71
73
  const s = I(u);
72
- return r.concat(s);
73
- }, []).filter((r) => r.display !== "none");
74
- }), K = S.computed(() => T.value.map((e, t) => ({ source: e, index: t })).filter(({ source: e }) => e.display === "visible" && V(e.schema)).map(({ source: e, index: t }) => {
75
- const { name: r, columnProps: u, required: s, field: g } = e, { title: W, asterisk: G, ...J } = u, Q = {
76
- label: W,
77
- ...J,
78
- prop: r
74
+ return e.concat(s);
75
+ }, []).filter((e) => e.display !== "none");
76
+ }), K = y(() => (T.value ?? []).map((r, e) => ({ source: r, index: e })).filter(({ source: r }) => r.display === "visible" && F(r.schema)).map(({ source: r, index: e }) => {
77
+ const { name: u, columnProps: s, required: b, field: W } = r, { title: G, asterisk: J, ...Q } = s, X = {
78
+ label: G,
79
+ ...Q,
80
+ prop: u
79
81
  };
80
82
  return {
81
- key: t,
82
- props: Q,
83
- field: g,
84
- asterisk: G ?? s
83
+ key: e,
84
+ props: X,
85
+ field: W,
86
+ asterisk: J ?? b
85
87
  };
86
- })), L = S.computed(() => T.value.filter((e) => e.display !== "none" && V(e.schema))), q = z(() => (p.value - 1) * c.value);
88
+ })), L = y(() => (T.value ?? []).filter((r) => r.display !== "none" && F(r.schema))), q = y(() => (p.value - 1) * d.value);
87
89
  async function O() {
88
- if (d.pagination === !1) {
89
- await oe();
90
- const e = E.value?.$el.querySelector(".el-scrollbar__wrap");
91
- e?.scrollTo({
92
- top: e.scrollHeight,
90
+ if (c.pagination === !1) {
91
+ await le();
92
+ const a = E.value?.$el.querySelector(".el-scrollbar__wrap");
93
+ a?.scrollTo({
94
+ top: a.scrollHeight,
93
95
  behavior: "smooth"
94
96
  });
95
97
  return;
@@ -98,51 +100,51 @@ import '../styles/array-table/index.css';const Ce = { key: 1 }, Te = /* @__PURE_
98
100
  p.value = 1;
99
101
  return;
100
102
  }
101
- p.value = Math.ceil(l.value.length / c.value);
103
+ p.value = Math.ceil(l.value.length / d.value);
102
104
  }
103
- async function j(e) {
104
- const { oldIndex: t, newIndex: r } = e;
105
- await l.move(t, r), C.value++;
105
+ async function j(a) {
106
+ const { oldIndex: r, newIndex: e } = a;
107
+ await l.move(r, e), S.value++;
106
108
  }
107
- return (e, t) => (n(), m("div", {
108
- class: F(a(D))
109
+ return (a, r) => (n(), m("div", {
110
+ class: z(t(D))
109
111
  }, [
110
- (n(), i(a(o), {
111
- key: C.value,
112
- "key-map": a($),
112
+ (n(), i(t(o), {
113
+ key: S.value,
114
+ "key-map": t($),
113
115
  add: O
114
116
  }, {
115
117
  default: f(() => [
116
- Z(a(fe), {
118
+ ee(t(ye), {
117
119
  "model-value": v.value,
118
120
  target: "tbody",
119
- handle: `.${a(Pe)}-array-base-sort-handle`,
121
+ handle: `.${t(Se)}-array-base-sort-handle`,
120
122
  animation: 150,
121
123
  onEnd: j
122
124
  }, {
123
125
  default: f(() => [
124
- ee((n(), i(a(de), b({
126
+ re((n(), i(t(me), k({
125
127
  ref_key: "elTableRef",
126
128
  ref: E,
127
- "row-key": a(P),
129
+ "row-key": t(P),
128
130
  data: v.value
129
- }, a(N)), {
131
+ }, t(B)), {
130
132
  default: f(() => [
131
- (n(!0), m(k, null, _(a(K).value, (r, u) => (n(), i(a(ce), b({
132
- key: r.key,
133
+ (n(!0), m(h, null, _(K.value, (e, u) => (n(), i(t(fe), k({
134
+ key: e.key,
133
135
  ref_for: !0
134
- }, r.props), {
135
- default: f(({ row: s, $index: g }) => [
136
- (n(), i(a(o).Item, {
137
- key: a(P)(s),
138
- index: g + q.value,
136
+ }, e.props), {
137
+ default: f(({ row: s, $index: b }) => [
138
+ (n(), i(t(o).Item, {
139
+ key: t(P)(s),
140
+ index: b + q.value,
139
141
  record: s
140
142
  }, {
141
143
  default: f(() => [
142
- (n(), i(a(w), {
143
- key: `${a(P)(s)}`,
144
- schema: a(T).value[u].schema,
145
- name: g + q.value,
144
+ (n(), i(t(w), {
145
+ key: `${t(P)(s)}`,
146
+ schema: t(T)[u].schema,
147
+ name: b + q.value,
146
148
  "only-render-properties": ""
147
149
  }, null, 8, ["schema", "name"]))
148
150
  ]),
@@ -150,14 +152,14 @@ import '../styles/array-table/index.css';const Ce = { key: 1 }, Te = /* @__PURE_
150
152
  }, 1032, ["index", "record"]))
151
153
  ]),
152
154
  header: f(({ column: s }) => [
153
- r.field.content?.header ? (n(), i(re(r.field.content.header), b({
155
+ e.field.content?.header ? (n(), i(ae(e.field.content.header), k({
154
156
  key: 0,
155
157
  ref_for: !0
156
- }, { ...s, field: a(l) }), null, 16)) : r.asterisk ? (n(), m("span", Ce, [
157
- ae("span", {
158
- class: F(`${a(D)}-asterisk`)
158
+ }, { ...s, field: t(l) }), null, 16)) : e.asterisk ? (n(), m("span", Te, [
159
+ te("span", {
160
+ class: z(`${t(D)}-asterisk`)
159
161
  }, "*", 2),
160
- te(" " + ne(s.label), 1)
162
+ ne(" " + oe(s.label), 1)
161
163
  ])) : A("", !0)
162
164
  ]),
163
165
  _: 2
@@ -165,32 +167,32 @@ import '../styles/array-table/index.css';const Ce = { key: 1 }, Te = /* @__PURE_
165
167
  ]),
166
168
  _: 1
167
169
  }, 16, ["row-key", "data"])), [
168
- [a(me), a(l).loading]
170
+ [t(ve), t(l).loading]
169
171
  ])
170
172
  ]),
171
173
  _: 1
172
174
  }, 8, ["model-value", "handle"]),
173
- (n(!0), m(k, null, _(a(L).value, (r, u) => (n(), i(a(w), {
175
+ (n(!0), m(h, null, _(L.value, (e, u) => (n(), i(t(w), {
174
176
  key: u,
175
- name: r.name,
176
- schema: r.schema,
177
+ name: e.name,
178
+ schema: e.schema,
177
179
  "only-render-self": !0
178
180
  }, null, 8, ["name", "schema"]))), 128)),
179
- d.pagination ? (n(), i(a(ye), b({
181
+ c.pagination ? (n(), i(t(be), k({
180
182
  key: 0,
181
183
  "current-page": p.value,
182
- "onUpdate:currentPage": t[0] || (t[0] = (r) => p.value = r),
183
- "page-size": c.value,
184
- "onUpdate:pageSize": t[1] || (t[1] = (r) => c.value = r),
185
- class: `${a(D)}-pagination`,
184
+ "onUpdate:currentPage": r[0] || (r[0] = (e) => p.value = e),
185
+ "page-size": d.value,
186
+ "onUpdate:pageSize": r[1] || (r[1] = (e) => d.value = e),
187
+ class: `${t(D)}-pagination`,
186
188
  background: "",
187
189
  layout: "total, sizes, prev, pager, next",
188
- total: d.modelValue.length
189
- }, U.value), null, 16, ["current-page", "page-size", "class", "total"])) : A("", !0),
190
- (n(!0), m(k, null, _(a(h).properties, (r, u) => (n(), m(k, { key: u }, [
191
- a(ve)(r) ? (n(), i(a(w), {
190
+ total: c.modelValue.length
191
+ }, N.value), null, 16, ["current-page", "page-size", "class", "total"])) : A("", !0),
192
+ (n(!0), m(h, null, _(U.value, (e, u) => (n(), m(h, { key: u }, [
193
+ t(ge)(e) ? (n(), i(t(w), {
192
194
  key: 0,
193
- schema: r,
195
+ schema: e,
194
196
  name: "addition"
195
197
  }, null, 8, ["schema"])) : A("", !0)
196
198
  ], 64))), 128))
@@ -199,13 +201,13 @@ import '../styles/array-table/index.css';const Ce = { key: 1 }, Te = /* @__PURE_
199
201
  }, 8, ["key-map"]))
200
202
  ], 2));
201
203
  }
202
- }), Ae = {
204
+ }), _e = {
203
205
  name: "FArrayTableColumn",
204
206
  render() {
205
207
  return null;
206
208
  }
207
- }, Ne = he(Te, {
208
- Column: Ae,
209
+ }, He = Pe(Ae, {
210
+ Column: _e,
209
211
  Index: o.Index,
210
212
  SortHandle: o.SortHandle,
211
213
  Addition: o.Addition,
@@ -217,7 +219,7 @@ import '../styles/array-table/index.css';const Ce = { key: 1 }, Te = /* @__PURE_
217
219
  useRecord: o.useRecord
218
220
  });
219
221
  export {
220
- Ne as ArrayTable,
221
- Ne as default
222
+ He as ArrayTable,
223
+ He as default
222
224
  };
223
225
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/array-table/array-table.vue","../../src/array-table/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { ArrayField } from '@formily/core'\r\nimport type { Schema } from '@formily/json-schema'\r\nimport type { TableInstance } from 'element-plus'\r\nimport type { IArrayTableProps } from './types'\r\nimport { autorun, observable, reaction } from '@formily/reactive'\r\nimport { isArr, isEqual } from '@formily/shared'\r\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\r\nimport { ElTable, ElTableColumn, vLoading } from 'element-plus'\r\nimport { omit } from 'lodash-es'\r\nimport { computed, nextTick, ref, watch } from 'vue'\r\nimport { VueDraggable } from 'vue-draggable-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { ArrayBase } from '../array-base'\r\nimport { isAdditionComponent } from '../array-base/utils'\r\nimport ElPagination from '../pagination/pagination'\r\nimport { hasRequiredProperty, isColumnComponent, isTableComponent, prefixCls } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FArrayTable',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\n modelValue: { default: () => [] },\n pagination: { type: Boolean, default: true },\n paginationProps: null\n})\r\nconst { props: elTableProps } = useCleanAttrs()\r\nconst paginationProps = computed(() => omit(props.paginationProps, ['pageSize', 'currentPage']))\r\nconst fieldRef = useField<ArrayField>()\r\nconst field = fieldRef.value\r\nconst schemaRef = useFieldSchema()\r\nconst { getKey, keyMap } = ArrayBase.useKey(schemaRef.value)\r\n\r\nconst elTableRef = ref<TableInstance>()\r\n\r\nfunction extractTableSources(schema: Schema): any[] {\r\n if (isTableComponent(schema)) {\r\n return createTableSource(schema)\r\n }\r\n return schema.properties\r\n ? Object.values(schema.properties).flatMap(element => extractTableSources(element))\r\n : []\r\n}\r\n\r\nfunction createTableSource(schema: Schema): any[] {\r\n const propName = schema['x-component-props']?.prop || schema.name\r\n /* istanbul ignore if -- @preserve */\r\n if (!propName)\r\n return []\r\n\r\n const field = fieldRef.value.query(fieldRef.value.address.concat(propName)).take()\r\n\r\n return [{\r\n name: propName,\r\n display: field?.display || schema['x-display'],\r\n required: hasRequiredProperty(schema),\r\n field,\r\n fieldProps: field?.props || schema.toFieldProps(),\r\n schema,\r\n columnProps: (field?.component as any[])?.[1] || schema['x-component-props'] || {},\r\n }]\r\n}\r\n\r\nconst triggerUpdateKey = ref(0)\r\nreaction(() => {\r\n const path = field.path.entire\r\n return field.query(`${path}.*`).map((item) => {\r\n return {\r\n name: item.component[0],\r\n visible: item.visible,\r\n }\r\n }).filter(item => item.name.includes('Column'))\r\n}, async () => {\r\n triggerUpdateKey.value++\r\n}, { equals: isEqual })\r\n\r\nconst dataSource = ref([])\r\nconst pageSize = ref(props.paginationProps?.pageSize ?? 10)\r\nconst currentPage = ref(props.paginationProps?.currentPage ?? 1)\r\n\r\nfunction updateDataSource() {\r\n /* istanbul ignore if -- @preserve */\r\n if (!isArr(field.value)) {\r\n dataSource.value = []\r\n return\r\n }\r\n if (props.pagination === false) {\r\n dataSource.value = [...field.value]\r\n return\r\n }\r\n dataSource.value = field.value.slice((currentPage.value - 1) * pageSize.value, (currentPage.value) * pageSize.value)\r\n}\r\nwatch([pageSize, currentPage], updateDataSource)\r\nautorun(updateDataSource)\r\n\r\nconst sources = observable.computed(() => {\r\n const schema = schemaRef.value.items\r\n const items = isArr(schema) ? schema : [schema]\r\n return items.reduce((columns, schema) => {\r\n const item = extractTableSources(schema)\r\n return columns.concat(item)\r\n }, []).filter(item => item.display !== 'none')\r\n})\r\n\r\nconst columns = observable.computed(() => {\r\n return sources.value\r\n .map((source, index) => ({ source, index }))\r\n .filter(({ source }) => source.display === 'visible' && isColumnComponent(source.schema))\r\n .map(({ source, index: key }) => {\r\n const { name, columnProps, required, field } = source\r\n const { title, asterisk, ...restProps } = columnProps\r\n const props = {\r\n label: title,\r\n ...restProps,\r\n prop: name,\r\n }\r\n return {\r\n key,\r\n props,\r\n field,\r\n asterisk: asterisk ?? required,\r\n }\r\n })\r\n})\r\n\r\nconst stateManagerColumns = observable.computed(() => {\r\n return sources.value.filter((column) => {\r\n return column.display !== 'none' && isColumnComponent(column.schema)\r\n })\r\n})\r\n\r\nconst baseIndex = computed(() => {\r\n return (currentPage.value - 1) * pageSize.value\r\n})\r\n\r\nasync function onAddItemClick() {\r\n if (props.pagination === false) {\r\n await nextTick()\r\n const scrollWarpDOM = elTableRef.value?.$el.querySelector('.el-scrollbar__wrap')\r\n scrollWarpDOM?.scrollTo({\r\n top: scrollWarpDOM.scrollHeight,\r\n behavior: 'smooth',\r\n })\r\n return\r\n }\r\n if (!isArr(field.value)) {\r\n currentPage.value = 1\r\n return\r\n }\r\n currentPage.value = Math.ceil(field.value.length / pageSize.value)\r\n}\r\n\r\nasync function handleDragEnd(evt: { oldIndex: number, newIndex: number }) {\r\n const { oldIndex, newIndex } = evt\r\n await field.move(oldIndex, newIndex)\r\n triggerUpdateKey.value++\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <ArrayBase :key=\"triggerUpdateKey\" :key-map=\"keyMap\" :add=\"onAddItemClick\">\r\n <VueDraggable\r\n :model-value=\"dataSource\" target=\"tbody\" :handle=\"`.${stylePrefix}-array-base-sort-handle`\"\r\n :animation=\"150\" @end=\"handleDragEnd\"\r\n >\r\n <ElTable ref=\"elTableRef\" v-loading=\"field.loading\" :row-key=\"getKey\" :data=\"dataSource\" v-bind=\"elTableProps\">\r\n <template v-for=\"(column, colIndex) of columns.value\" :key=\"column.key\">\r\n <ElTableColumn v-bind=\"column.props\">\r\n <template #default=\"{ row, $index }\">\r\n <ArrayBase.Item :key=\"getKey(row)\" :index=\"$index + baseIndex\" :record=\"row\">\r\n <RecursionField\r\n :key=\"`${getKey(row)}`\" :schema=\"sources.value[colIndex].schema\"\r\n :name=\"$index + baseIndex\" only-render-properties\r\n />\r\n </ArrayBase.Item>\r\n </template>\r\n <template #header=\"{ column: col }\">\r\n <template v-if=\"column.field.content?.header\">\r\n <component :is=\"column.field.content.header\" v-bind=\"{ ...col, field }\" />\r\n </template>\r\n <span v-else-if=\"column.asterisk\">\r\n <span :class=\"`${prefixCls}-asterisk`\">*</span>\r\n {{ col.label }}\r\n </span>\r\n </template>\r\n </ElTableColumn>\r\n </template>\r\n </ElTable>\r\n </VueDraggable>\r\n\r\n <!-- 状态管理器 -->\r\n <template v-for=\"(column, key) of stateManagerColumns.value\" :key=\"key\">\r\n <RecursionField :name=\"column.name\" :schema=\"column.schema\" :only-render-self=\"true\" />\r\n </template>\r\n <ElPagination\r\n v-if=\"props.pagination\" v-model:current-page=\"currentPage\" v-model:page-size=\"pageSize\"\r\n :class=\"`${prefixCls}-pagination`\" background layout=\"total, sizes, prev, pager, next\"\r\n :total=\"props.modelValue.length\" v-bind=\"paginationProps\"\r\n />\r\n <template v-for=\"(itemSchema, key) of schemaRef.properties\" :key=\"key\">\r\n <RecursionField v-if=\"isAdditionComponent(itemSchema)\" :schema=\"itemSchema\" name=\"addition\" />\r\n </template>\r\n </ArrayBase>\r\n </div>\r\n</template>\r\n","import type { Component } from 'vue'\r\nimport { composeExport } from '../__builtins__/shared'\r\nimport { ArrayBase } from '../array-base'\r\nimport ArrayTableInner from './array-table.vue'\r\nimport './style.scss'\r\n\r\nconst ArrayTableColumn: Component = {\r\n name: 'FArrayTableColumn',\r\n render() {\r\n return null\r\n },\r\n}\r\n\r\nexport const ArrayTable = composeExport(ArrayTableInner, {\r\n Column: ArrayTableColumn,\r\n Index: ArrayBase.Index,\r\n SortHandle: ArrayBase.SortHandle,\r\n Addition: ArrayBase.Addition,\r\n Remove: ArrayBase.Remove,\r\n MoveDown: ArrayBase.MoveDown,\r\n MoveUp: ArrayBase.MoveUp,\r\n useArray: ArrayBase.useArray,\r\n useIndex: ArrayBase.useIndex,\r\n useRecord: ArrayBase.useRecord,\r\n})\r\n\r\nexport default ArrayTable\r\n"],"names":["props","__props","elTableProps","useCleanAttrs","paginationProps","computed","omit","fieldRef","useField","field","schemaRef","useFieldSchema","getKey","keyMap","ArrayBase","elTableRef","ref","extractTableSources","schema","isTableComponent","createTableSource","element","propName","hasRequiredProperty","triggerUpdateKey","reaction","path","item","isEqual","dataSource","pageSize","currentPage","updateDataSource","isArr","watch","autorun","sources","observable","columns","source","index","isColumnComponent","key","name","columnProps","required","title","asterisk","restProps","stateManagerColumns","column","baseIndex","onAddItemClick","nextTick","scrollWarpDOM","handleDragEnd","evt","oldIndex","newIndex","_createElementBlock","_unref","prefixCls","_createBlock","_createVNode","VueDraggable","stylePrefix","_withDirectives","_openBlock","_mergeProps","_Fragment","colIndex","_withCtx","row","$index","RecursionField","col","_resolveDynamicComponent","_hoisted_1","_createElementVNode","_toDisplayString","vLoading","$event","itemSchema","isAdditionComponent","ArrayTableColumn","ArrayTable","composeExport","ArrayTableInner"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,UAAMA,IAAQC,GAKR,EAAE,OAAOC,EAAA,IAAiBC,GAAA,GAC1BC,IAAkBC,EAAS,MAAMC,GAAKN,EAAM,iBAAiB,CAAC,YAAY,aAAa,CAAC,CAAC,GACzFO,IAAWC,GAAA,GACXC,IAAQF,EAAS,OACjBG,IAAYC,GAAA,GACZ,EAAE,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAU,OAAOJ,EAAU,KAAK,GAErDK,IAAaC,EAAA;AAEnB,aAASC,EAAoBC,GAAuB;AAClD,aAAIC,GAAiBD,CAAM,IAClBE,EAAkBF,CAAM,IAE1BA,EAAO,aACV,OAAO,OAAOA,EAAO,UAAU,EAAE,QAAQ,CAAAG,MAAWJ,EAAoBI,CAAO,CAAC,IAChF,CAAA;AAAA,IACN;AAEA,aAASD,EAAkBF,GAAuB;AAChD,YAAMI,IAAWJ,EAAO,mBAAmB,GAAG,QAAQA,EAAO;AAAA,MAAA;AAE7D,UAAI,CAACI;AACH,eAAO,CAAA;AAET,YAAMb,IAAQF,EAAS,MAAM,MAAMA,EAAS,MAAM,QAAQ,OAAOe,CAAQ,CAAC,EAAE,KAAA;AAE5E,aAAO,CAAC;AAAA,QACN,MAAMA;AAAA,QACN,SAASb,GAAO,WAAWS,EAAO,WAAW;AAAA,QAC7C,UAAUK,GAAoBL,CAAM;AAAA,QACpC,OAAAT;AAAAA,QACA,YAAYA,GAAO,SAASS,EAAO,aAAA;AAAA,QACnC,QAAAA;AAAA,QACA,aAAcT,GAAO,YAAsB,CAAC,KAAKS,EAAO,mBAAmB,KAAK,CAAA;AAAA,MAAC,CAClF;AAAA,IACH;AAEA,UAAMM,IAAmBR,EAAI,CAAC;AAC9B,IAAAS,GAAS,MAAM;AACb,YAAMC,IAAOjB,EAAM,KAAK;AACxB,aAAOA,EAAM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,CAAA;WAE1D+D,EAAA,EAAA,GAAAR,EAEWU,WAF2BT,EAAAlD,CAAA,EAAU,YAAU,CAAxCwE,GAAYxC,6BAAuC;AAAA,YAC7CkB,EAAAuB,EAAA,EAAoBD,CAAU,UAApDpB,EAA8FF,EAAAc,CAAA,GAAA;AAAA;cAAtC,QAAQQ;AAAA,cAAY,MAAK;AAAA,YAAA;;;;;;;ICrMnFE,KAA8B;AAAA,EAClC,MAAM;AAAA,EACN,SAAS;AACP,WAAO;AAAA,EACT;AACF,GAEaC,KAAaC,GAAcC,IAAiB;AAAA,EACvD,QAAQH;AAAA,EACR,OAAOtE,EAAU;AAAA,EACjB,YAAYA,EAAU;AAAA,EACtB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,UAAUA,EAAU;AAAA,EACpB,WAAWA,EAAU;AACvB,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/array-table/array-table.vue","../../src/array-table/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { ArrayField } from '@formily/core'\r\nimport type { Schema } from '@formily/json-schema'\r\nimport type { TableInstance } from 'element-plus'\r\nimport type { IArrayTableProps } from './types'\r\nimport { autorun, reaction } from '@formily/reactive'\r\nimport { isArr, isEqual } from '@formily/shared'\r\nimport { formilyComputed } from '@silver-formily/reactive-vue'\r\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\r\nimport { ElTable, ElTableColumn, vLoading } from 'element-plus'\r\nimport { omit } from 'lodash-es'\r\nimport { computed, nextTick, ref, watch } from 'vue'\r\nimport { VueDraggable } from 'vue-draggable-plus'\r\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\r\nimport { ArrayBase } from '../array-base'\r\nimport { isAdditionComponent } from '../array-base/utils'\r\nimport ElPagination from '../pagination/pagination'\r\nimport { hasRequiredProperty, isColumnComponent, isTableComponent, prefixCls } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FArrayTable',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = withDefaults(defineProps<IArrayTableProps>(), {\r\n modelValue: () => [],\r\n pagination: true,\r\n})\r\nconst { props: elTableProps } = useCleanAttrs()\r\nconst paginationProps = computed(() => omit(props.paginationProps, ['pageSize', 'currentPage']))\r\nconst fieldRef = useField<ArrayField>()\r\nconst field = fieldRef.value\r\nconst schemaRef = useFieldSchema()\r\nconst additionSchemas = computed<Record<string, Schema>>(() => schemaRef.value?.properties ?? {})\r\nconst { getKey, keyMap } = ArrayBase.useKey(schemaRef.value)\r\n\r\nconst elTableRef = ref<TableInstance>()\r\n\r\nfunction extractTableSources(schema: Schema): any[] {\r\n if (isTableComponent(schema)) {\r\n return createTableSource(schema)\r\n }\r\n return schema.properties\r\n ? Object.values(schema.properties).flatMap(element => extractTableSources(element))\r\n : []\r\n}\r\n\r\nfunction createTableSource(schema: Schema): any[] {\r\n const propName = schema['x-component-props']?.prop || schema.name\r\n /* istanbul ignore if -- @preserve */\r\n if (!propName)\r\n return []\r\n\r\n const field = fieldRef.value.query(fieldRef.value.address.concat(propName)).take()\r\n\r\n return [{\r\n name: propName,\r\n display: field?.display || schema['x-display'],\r\n required: hasRequiredProperty(schema),\r\n field,\r\n fieldProps: field?.props || schema.toFieldProps(),\r\n schema,\r\n columnProps: (field?.component as any[])?.[1] || schema['x-component-props'] || {},\r\n }]\r\n}\r\n\r\nconst triggerUpdateKey = ref(0)\r\nreaction(() => {\r\n const path = field.path.entire\r\n return field.query(`${path}.*`).map((item) => {\r\n return {\r\n name: item.component[0],\r\n visible: item.visible,\r\n }\r\n }).filter(item => item.name.includes('Column'))\r\n}, async () => {\r\n triggerUpdateKey.value++\r\n}, { equals: isEqual })\r\n\r\nconst dataSource = ref([])\r\nconst pageSize = ref(props.paginationProps?.pageSize ?? 10)\r\nconst currentPage = ref(props.paginationProps?.currentPage ?? 1)\r\n\r\nfunction updateDataSource() {\r\n /* istanbul ignore if -- @preserve */\r\n if (!isArr(field.value)) {\r\n dataSource.value = []\r\n return\r\n }\r\n if (props.pagination === false) {\r\n dataSource.value = [...field.value]\r\n return\r\n }\r\n dataSource.value = field.value.slice((currentPage.value - 1) * pageSize.value, (currentPage.value) * pageSize.value)\r\n}\r\nwatch([pageSize, currentPage], updateDataSource)\r\nautorun(updateDataSource)\r\n\r\nconst sources = formilyComputed(() => {\r\n const schema = schemaRef.value.items\r\n const items = isArr(schema) ? schema : [schema]\r\n return items.reduce((columns, schema) => {\r\n const item = extractTableSources(schema)\r\n return columns.concat(item)\r\n }, []).filter(item => item.display !== 'none')\r\n})\r\n\r\nconst columns = computed(() => {\r\n const currentSources = sources.value ?? []\r\n return currentSources\r\n .map((source, index) => ({ source, index }))\r\n .filter(({ source }) => source.display === 'visible' && isColumnComponent(source.schema))\r\n .map(({ source, index: key }) => {\r\n const { name, columnProps, required, field } = source\r\n const { title, asterisk, ...restProps } = columnProps\r\n const props = {\r\n label: title,\r\n ...restProps,\r\n prop: name,\r\n }\r\n return {\r\n key,\r\n props,\r\n field,\r\n asterisk: asterisk ?? required,\r\n }\r\n })\r\n})\r\n\r\nconst stateManagerColumns = computed(() => {\r\n const currentSources = sources.value ?? []\r\n return currentSources.filter((column) => {\r\n return column.display !== 'none' && isColumnComponent(column.schema)\r\n })\r\n})\r\n\r\nconst baseIndex = computed(() => {\r\n return (currentPage.value - 1) * pageSize.value\r\n})\r\n\r\nasync function onAddItemClick() {\r\n if (props.pagination === false) {\r\n await nextTick()\r\n const scrollWarpDOM = elTableRef.value?.$el.querySelector('.el-scrollbar__wrap')\r\n scrollWarpDOM?.scrollTo({\r\n top: scrollWarpDOM.scrollHeight,\r\n behavior: 'smooth',\r\n })\r\n return\r\n }\r\n if (!isArr(field.value)) {\r\n currentPage.value = 1\r\n return\r\n }\r\n currentPage.value = Math.ceil(field.value.length / pageSize.value)\r\n}\r\n\r\nasync function handleDragEnd(evt: { oldIndex: number, newIndex: number }) {\r\n const { oldIndex, newIndex } = evt\r\n await field.move(oldIndex, newIndex)\r\n triggerUpdateKey.value++\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <ArrayBase :key=\"triggerUpdateKey\" :key-map=\"keyMap\" :add=\"onAddItemClick\">\r\n <VueDraggable\r\n :model-value=\"dataSource\" target=\"tbody\" :handle=\"`.${stylePrefix}-array-base-sort-handle`\"\r\n :animation=\"150\" @end=\"handleDragEnd\"\r\n >\r\n <ElTable ref=\"elTableRef\" v-loading=\"field.loading\" :row-key=\"getKey\" :data=\"dataSource\" v-bind=\"elTableProps\">\r\n <template v-for=\"(column, colIndex) of columns\" :key=\"column.key\">\r\n <ElTableColumn v-bind=\"column.props\">\r\n <template #default=\"{ row, $index }\">\r\n <ArrayBase.Item :key=\"getKey(row)\" :index=\"$index + baseIndex\" :record=\"row\">\r\n <RecursionField\r\n :key=\"`${getKey(row)}`\" :schema=\"sources[colIndex].schema\"\r\n :name=\"$index + baseIndex\" only-render-properties\r\n />\r\n </ArrayBase.Item>\r\n </template>\r\n <template #header=\"{ column: col }\">\r\n <template v-if=\"column.field.content?.header\">\r\n <component :is=\"column.field.content.header\" v-bind=\"{ ...col, field }\" />\r\n </template>\r\n <span v-else-if=\"column.asterisk\">\r\n <span :class=\"`${prefixCls}-asterisk`\">*</span>\r\n {{ col.label }}\r\n </span>\r\n </template>\r\n </ElTableColumn>\r\n </template>\r\n </ElTable>\r\n </VueDraggable>\r\n\r\n <!-- 状态管理器 -->\r\n <template v-for=\"(column, key) of stateManagerColumns\" :key=\"key\">\r\n <RecursionField :name=\"column.name\" :schema=\"column.schema\" :only-render-self=\"true\" />\r\n </template>\r\n <ElPagination\r\n v-if=\"props.pagination\" v-model:current-page=\"currentPage\" v-model:page-size=\"pageSize\"\r\n :class=\"`${prefixCls}-pagination`\" background layout=\"total, sizes, prev, pager, next\"\r\n :total=\"props.modelValue.length\" v-bind=\"paginationProps\"\r\n />\r\n <template v-for=\"(itemSchema, key) of additionSchemas\" :key=\"key\">\r\n <RecursionField v-if=\"isAdditionComponent(itemSchema)\" :schema=\"itemSchema\" name=\"addition\" />\r\n </template>\r\n </ArrayBase>\r\n </div>\r\n</template>\r\n","import type { Component } from 'vue'\r\nimport { composeExport } from '../__builtins__/shared'\r\nimport { ArrayBase } from '../array-base'\r\nimport ArrayTableInner from './array-table.vue'\r\nimport './style.scss'\r\n\r\nconst ArrayTableColumn: Component = {\r\n name: 'FArrayTableColumn',\r\n render() {\r\n return null\r\n },\r\n}\r\n\r\nexport const ArrayTable = composeExport(ArrayTableInner, {\r\n Column: ArrayTableColumn,\r\n Index: ArrayBase.Index,\r\n SortHandle: ArrayBase.SortHandle,\r\n Addition: ArrayBase.Addition,\r\n Remove: ArrayBase.Remove,\r\n MoveDown: ArrayBase.MoveDown,\r\n MoveUp: ArrayBase.MoveUp,\r\n useArray: ArrayBase.useArray,\r\n useIndex: ArrayBase.useIndex,\r\n useRecord: ArrayBase.useRecord,\r\n})\r\n\r\nexport default ArrayTable\r\n"],"names":["props","__props","elTableProps","useCleanAttrs","paginationProps","computed","omit","fieldRef","useField","field","schemaRef","useFieldSchema","additionSchemas","getKey","keyMap","ArrayBase","elTableRef","ref","extractTableSources","schema","isTableComponent","createTableSource","element","propName","hasRequiredProperty","triggerUpdateKey","reaction","path","item","isEqual","dataSource","pageSize","currentPage","updateDataSource","isArr","watch","autorun","sources","formilyComputed","columns","source","index","isColumnComponent","key","name","columnProps","required","title","asterisk","restProps","stateManagerColumns","column","baseIndex","onAddItemClick","nextTick","scrollWarpDOM","handleDragEnd","evt","oldIndex","newIndex","_createElementBlock","_unref","prefixCls","_createBlock","_createVNode","VueDraggable","stylePrefix","_withDirectives","_openBlock","_mergeProps","_Fragment","_renderList","colIndex","_withCtx","row","$index","RecursionField","col","_resolveDynamicComponent","_hoisted_1","_createElementVNode","_toDisplayString","vLoading","$event","itemSchema","isAdditionComponent","ArrayTableColumn","ArrayTable","composeExport","ArrayTable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,EAAA,EAAA,GAAAR,EAEWU,GAAA,MAAAC,EAF2B3D,EAAA,OAAe,CAAnCwE,GAAYzC,6BAAkC;AAAA,YACxCkB,EAAAwB,EAAA,EAAoBD,CAAU,UAApDrB,EAA8FF,EAAAe,CAAA,GAAA;AAAA;cAAtC,QAAQQ;AAAA,cAAY,MAAK;AAAA,YAAA;;;;;;;ICxMnFE,KAA8B;AAAA,EAClC,MAAM;AAAA,EACN,SAAS;AACP,WAAO;AAAA,EACT;AACF,GAEaC,KAAaC,GAAcC,IAAiB;AAAA,EACvD,QAAQH;AAAA,EACR,OAAOvE,EAAU;AAAA,EACjB,YAAYA,EAAU;AAAA,EACtB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,UAAUA,EAAU;AAAA,EACpB,WAAWA,EAAU;AACvB,CAAC;"}
@@ -3,4 +3,5 @@ export interface IArrayTableProps {
3
3
  modelValue?: any[];
4
4
  pagination?: boolean;
5
5
  paginationProps?: Partial<PaginationProps>;
6
+ height?: string | number;
6
7
  }