@fangzhongya/fang-ui 0.1.27 → 0.1.29

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 (219) hide show
  1. package/dist/components/array/index.css +4 -0
  2. package/dist/components/array/src/index2.cjs +5 -5
  3. package/dist/components/array/src/index2.js +2 -2
  4. package/dist/components/audios/index.css +4 -0
  5. package/dist/components/box/index.css +4 -0
  6. package/dist/components/box-adjust/index.css +4 -0
  7. package/dist/components/box-local/index.css +4 -0
  8. package/dist/components/box-mask/index.css +4 -0
  9. package/dist/components/box-title/index.css +4 -0
  10. package/dist/components/buttons/index.css +4 -0
  11. package/dist/components/cascaders/index.css +4 -0
  12. package/dist/components/checks/index.css +4 -0
  13. package/dist/components/common/compons/components.cjs +52 -0
  14. package/dist/components/common/compons/components.d.ts +27 -0
  15. package/dist/components/common/compons/components.js +52 -0
  16. package/dist/components/common/compons/index.scss +23 -0
  17. package/dist/components/common/compons/index2.scss +23 -0
  18. package/dist/components/common/use.cjs +87 -16
  19. package/dist/components/common/use.d.ts +28 -5
  20. package/dist/components/common/use.js +88 -17
  21. package/dist/components/dates/index.css +4 -0
  22. package/dist/components/dates-divide/index.css +4 -0
  23. package/dist/components/dates-picker/index.css +4 -0
  24. package/dist/components/dates2/index.css +4 -0
  25. package/dist/components/dialogs/index.css +4 -0
  26. package/dist/components/edit/index.css +4 -0
  27. package/dist/components/edit-float/index.css +4 -0
  28. package/dist/components/forms/common/config.cjs +11 -1
  29. package/dist/components/forms/common/config.d.ts +1 -0
  30. package/dist/components/forms/common/config.js +11 -1
  31. package/dist/components/forms/index.css +10 -6
  32. package/dist/components/forms/index.scss +2 -1
  33. package/dist/components/forms/src/data.cjs +7 -0
  34. package/dist/components/forms/src/data.d.ts +7 -0
  35. package/dist/components/forms/src/data.js +7 -0
  36. package/dist/components/forms/src/setup.cjs +6 -13
  37. package/dist/components/forms/src/setup.d.ts +1 -1
  38. package/dist/components/forms/src/setup.js +8 -15
  39. package/dist/components/forms/src/util.cjs +1 -2
  40. package/dist/components/forms/src/util.d.ts +1 -1
  41. package/dist/components/forms/src/util.js +1 -2
  42. package/dist/components/forms/style/index2.scss +3 -1
  43. package/dist/components/forms-div/index.css +4 -0
  44. package/dist/components/forms-div/src/index2.cjs +11 -5
  45. package/dist/components/forms-div/src/index2.js +10 -4
  46. package/dist/components/forms-item/index.css +4 -0
  47. package/dist/components/forms-item/src/indexts.d.ts +1 -1
  48. package/dist/components/forms-item/src/label.cjs +16 -29
  49. package/dist/components/forms-item/src/label.js +17 -30
  50. package/dist/components/full-screen/index.css +4 -0
  51. package/dist/components/global-config/index.css +4 -0
  52. package/dist/components/history/index.css +4 -0
  53. package/dist/components/icon/index.css +4 -0
  54. package/dist/components/icon-picker/index.css +4 -0
  55. package/dist/components/iframe/index.css +4 -0
  56. package/dist/components/images/index.css +4 -0
  57. package/dist/components/index.cjs +2 -0
  58. package/dist/components/index.d.ts +1 -0
  59. package/dist/components/index.js +2 -0
  60. package/dist/components/index2.scss +2 -1
  61. package/dist/components/input-array/index.css +4 -0
  62. package/dist/components/input-history/index.css +4 -0
  63. package/dist/components/input-num/index.css +4 -0
  64. package/dist/components/input-select/index.css +4 -0
  65. package/dist/components/inputs/index.css +4 -0
  66. package/dist/components/labels/index.css +4 -0
  67. package/dist/components/list/index.css +4 -0
  68. package/dist/components/list/src/data.cjs +6 -0
  69. package/dist/components/list/src/data.d.ts +6 -0
  70. package/dist/components/list/src/data.js +6 -0
  71. package/dist/components/list/src/index2.cjs +6 -6
  72. package/dist/components/list/src/index2.js +2 -2
  73. package/dist/components/list/src/util.cjs +12 -26
  74. package/dist/components/list/src/util.d.ts +1 -1
  75. package/dist/components/list/src/util.js +13 -27
  76. package/dist/components/lists/index.css +4 -0
  77. package/dist/components/listsp/index.css +4 -0
  78. package/dist/components/listspd/index.css +4 -0
  79. package/dist/components/menus/index.css +4 -0
  80. package/dist/components/no-data/index.css +4 -0
  81. package/dist/components/page/index.css +10 -6
  82. package/dist/components/paging/index.css +4 -0
  83. package/dist/components/popup/index.css +4 -0
  84. package/dist/components/retract/index.css +4 -0
  85. package/dist/components/right-key/index.css +4 -0
  86. package/dist/components/scss/common.scss +4 -0
  87. package/dist/components/seamless-scroll/index.css +4 -0
  88. package/dist/components/select-scroll/index.css +4 -0
  89. package/dist/components/selector/index.css +4 -0
  90. package/dist/components/selects/index.css +4 -0
  91. package/dist/components/sliders/index.css +4 -0
  92. package/dist/components/switchs/index.css +4 -0
  93. package/dist/components/tables/common/config.cjs +1 -1
  94. package/dist/components/tables/common/config.js +1 -1
  95. package/dist/components/tables/common/pagin.cjs +74 -32
  96. package/dist/components/tables/common/pagin.d.ts +10 -1
  97. package/dist/components/tables/common/pagin.js +74 -32
  98. package/dist/components/tables/index.css +4 -0
  99. package/dist/components/tables/src/column.cjs +22 -20
  100. package/dist/components/tables/src/column.d.ts +1 -0
  101. package/dist/components/tables/src/column.js +14 -12
  102. package/dist/components/tables/src/data.cjs +15 -0
  103. package/dist/components/tables/src/data.d.ts +13 -0
  104. package/dist/components/tables/src/data.js +15 -0
  105. package/dist/components/tables/src/index2.cjs +17 -9
  106. package/dist/components/tables/src/index2.js +11 -3
  107. package/dist/components/tablesp/index.css +4 -0
  108. package/dist/components/tablespd/index.css +4 -0
  109. package/dist/components/tabless/index.css +4 -0
  110. package/dist/components/tablesv/index.css +4 -0
  111. package/dist/components/tablesv/src/column.cjs +116 -112
  112. package/dist/components/tablesv/src/column.js +110 -106
  113. package/dist/components/tablesv/src/data.cjs +44 -0
  114. package/dist/components/tablesv/src/data.d.ts +43 -1
  115. package/dist/components/tablesv/src/data.js +44 -0
  116. package/dist/components/tablesv/src/index2.cjs +37 -14
  117. package/dist/components/tablesv/src/index2.js +36 -13
  118. package/dist/components/tablesv/style/index2.scss +3 -1
  119. package/dist/components/tablesvp/index.css +10 -0
  120. package/dist/components/tablesvp/index.scss +8 -0
  121. package/dist/components/tablesvp/src/index2.cjs +15 -5
  122. package/dist/components/tablesvp/src/index2.js +15 -5
  123. package/dist/components/tablesvpd/index.cjs +9 -0
  124. package/dist/components/tablesvpd/index.css +157 -0
  125. package/dist/components/tablesvpd/index.d.ts +4 -0
  126. package/dist/components/tablesvpd/index.js +9 -0
  127. package/dist/components/tablesvpd/index.scss +41 -0
  128. package/dist/components/tablesvpd/src/data.cjs +13 -0
  129. package/dist/components/tablesvpd/src/data.d.ts +18 -0
  130. package/dist/components/tablesvpd/src/data.js +13 -0
  131. package/dist/components/tablesvpd/src/index.cjs +4 -0
  132. package/dist/components/tablesvpd/src/index.js +4 -0
  133. package/dist/components/tablesvpd/src/index2.cjs +107 -0
  134. package/dist/components/tablesvpd/src/index2.js +107 -0
  135. package/dist/components/tablesvpd/style/index2.scss +4 -0
  136. package/dist/components/uploads/index.css +4 -0
  137. package/dist/components/videos/index.css +4 -0
  138. package/dist/components/window/index.css +4 -0
  139. package/dist/css/array.css +4 -0
  140. package/dist/css/audios.css +4 -0
  141. package/dist/css/box-adjust.css +4 -0
  142. package/dist/css/box-local.css +4 -0
  143. package/dist/css/box-mask.css +4 -0
  144. package/dist/css/box-title.css +4 -0
  145. package/dist/css/box.css +4 -0
  146. package/dist/css/buttons.css +4 -0
  147. package/dist/css/cascaders.css +4 -0
  148. package/dist/css/checks.css +4 -0
  149. package/dist/css/dates-divide.css +4 -0
  150. package/dist/css/dates-picker.css +4 -0
  151. package/dist/css/dates.css +4 -0
  152. package/dist/css/dates2.css +4 -0
  153. package/dist/css/dialogs.css +4 -0
  154. package/dist/css/edit-float.css +4 -0
  155. package/dist/css/edit.css +4 -0
  156. package/dist/css/forms-div.css +4 -0
  157. package/dist/css/forms-item.css +4 -0
  158. package/dist/css/forms.css +10 -6
  159. package/dist/css/full-screen.css +4 -0
  160. package/dist/css/global-config.css +4 -0
  161. package/dist/css/history.css +4 -0
  162. package/dist/css/icon-picker.css +4 -0
  163. package/dist/css/icon.css +4 -0
  164. package/dist/css/iframe.css +4 -0
  165. package/dist/css/images.css +4 -0
  166. package/dist/css/index.css +16 -6
  167. package/dist/css/input-array.css +4 -0
  168. package/dist/css/input-history.css +4 -0
  169. package/dist/css/input-num.css +4 -0
  170. package/dist/css/input-select.css +4 -0
  171. package/dist/css/inputs.css +4 -0
  172. package/dist/css/labels.css +4 -0
  173. package/dist/css/list.css +4 -0
  174. package/dist/css/lists.css +4 -0
  175. package/dist/css/listsp.css +4 -0
  176. package/dist/css/listspd.css +4 -0
  177. package/dist/css/menus.css +4 -0
  178. package/dist/css/no-data.css +4 -0
  179. package/dist/css/page.css +10 -6
  180. package/dist/css/paging.css +4 -0
  181. package/dist/css/popup.css +4 -0
  182. package/dist/css/retract.css +4 -0
  183. package/dist/css/right-key.css +4 -0
  184. package/dist/css/seamless-scroll.css +4 -0
  185. package/dist/css/select-scroll.css +4 -0
  186. package/dist/css/selector.css +4 -0
  187. package/dist/css/selects.css +4 -0
  188. package/dist/css/sliders.css +4 -0
  189. package/dist/css/switchs.css +4 -0
  190. package/dist/css/tables.css +4 -0
  191. package/dist/css/tablesp.css +4 -0
  192. package/dist/css/tablespd.css +4 -0
  193. package/dist/css/tabless.css +4 -0
  194. package/dist/css/tablesv.css +4 -0
  195. package/dist/css/tablesvp.css +10 -0
  196. package/dist/css/tablesvpd.css +157 -0
  197. package/dist/css/uploads.css +4 -0
  198. package/dist/css/videos.css +4 -0
  199. package/dist/css/window.css +4 -0
  200. package/dist/expand/{chunk-MC76Q3TQ.cjs → chunk-3HP2ZDNG.cjs} +3 -1
  201. package/dist/expand/{chunk-CV4O5V2F.js → chunk-7C25SBCF.js} +3 -1
  202. package/dist/expand/components.cjs +5 -5
  203. package/dist/expand/components.js +1 -1
  204. package/dist/expand/config.cjs +2 -2
  205. package/dist/expand/config.js +1 -1
  206. package/dist/hooks/compons/index.cjs +44 -0
  207. package/dist/hooks/compons/index.d.ts +7 -0
  208. package/dist/hooks/compons/index.js +44 -0
  209. package/dist/icons/index.json +1 -1
  210. package/dist/index.cjs +24 -22
  211. package/dist/index.css +16 -6
  212. package/dist/index.js +2 -0
  213. package/dist/type.d.ts +4 -0
  214. package/package.json +12 -12
  215. package/dist/components/common/compons.cjs +0 -76
  216. package/dist/components/common/compons.d.ts +0 -9
  217. package/dist/components/common/compons.js +0 -76
  218. package/dist/components/common/compons.scss +0 -26
  219. package/dist/components/common/compons2.scss +0 -26
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .paging {
21
25
  width: 100%;
22
26
  padding: 10px;
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .box-mask {
21
25
  display: block;
22
26
  opacity: 0.5;
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .retract {
21
25
  position: relative;
22
26
  }
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .right-key-box {
21
25
  width: 140px;
22
26
  position: absolute;
@@ -22,3 +22,7 @@
22
22
  border-top: 1px solid var(--#{$cssname}border);
23
23
  padding: 20px 20px;
24
24
  }
25
+
26
+ .com-lable-array {
27
+ line-height: 18px;
28
+ }
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .seamless-scroll {
21
25
  position: relative;
22
26
  overflow: hidden;
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .select-scroll {
21
25
  flex: 1;
22
26
  float: left;
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .select-scroll {
21
25
  flex: 1;
22
26
  float: left;
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .selects-select {
21
25
  height: 100%;
22
26
  min-width: 60px;
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .sliders {
21
25
  width: 100%;
22
26
  position: relative;
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .switchs-switch {
21
25
  height: 100%;
22
26
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const provides = {
4
- compons: "table-compons"
4
+ compons: "table"
5
5
  };
6
6
  exports.provides = provides;
@@ -1,5 +1,5 @@
1
1
  const provides = {
2
- compons: "table-compons"
2
+ compons: "table"
3
3
  };
4
4
  export {
5
5
  provides
@@ -56,6 +56,12 @@ const dataProps = {
56
56
  return {};
57
57
  }
58
58
  },
59
+ /**
60
+ * @props { Boolean } isCompons 是否使用默认的配置
61
+ */
62
+ isCompons: {
63
+ type: Boolean
64
+ },
59
65
  /**
60
66
  * @props { Object } compons 外部组件集合
61
67
  */
@@ -352,69 +358,104 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
352
358
  return arr;
353
359
  }
354
360
  }
361
+ const selections = vue.ref([]);
355
362
  function getSelection() {
356
- return refTable.value.getSelections();
363
+ return selections.value;
364
+ }
365
+ function setSelection(array) {
366
+ selections.value = array;
367
+ emit("selection", selections.value);
357
368
  }
358
369
  function onChange(arr) {
359
370
  var _a2;
371
+ console.log("onChange");
360
372
  if (!((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
361
- console.log("onChange");
362
- emit("selection", getSelectionValue(arr, paginat.current));
373
+ setSelection(getSelectionValue(arr, paginat.current));
374
+ }
375
+ }
376
+ const isHighlight = vue.computed(() => {
377
+ const c = tableConfig.value.config || {};
378
+ if ((c == null ? void 0 : c.highlightCurrentRow) || c["highlight-current-row"]) {
379
+ return true;
380
+ } else {
381
+ return false;
382
+ }
383
+ });
384
+ function setSelectRow(row, is) {
385
+ var _a2, _b2;
386
+ if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
387
+ if ((_b2 = tableConfig.value.config) == null ? void 0 : _b2.isCancelAgain) {
388
+ if (selections.value[0] == row) {
389
+ refTable.value.clearSelection();
390
+ refTable.value.clearCurrentRow();
391
+ setSelection([]);
392
+ } else {
393
+ refTable.value.clearSelection();
394
+ refTable.value.toggleRowSelection(row, true);
395
+ setSelection([row]);
396
+ }
397
+ } else {
398
+ refTable.value.clearSelection();
399
+ refTable.value.toggleRowSelection(row, true);
400
+ setSelection([row]);
401
+ }
402
+ } else {
403
+ if (is) {
404
+ refTable.value.toggleRowSelection(row);
405
+ }
363
406
  }
364
407
  }
365
408
  function onRowClick(row) {
366
- var _a2, _b2, _c, _d;
367
- if (!((_a2 = tableConfig.value.config) == null ? void 0 : _a2.noRowSelect)) {
409
+ var _a2, _b2;
410
+ if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isRowSelect) {
368
411
  const selectable = (_b2 = tableConfig.value.config) == null ? void 0 : _b2.selectable;
369
412
  if (selectable) {
370
413
  const index = data.list.findIndex((obj) => {
371
414
  obj === row;
372
415
  });
373
416
  if (selectable(row, index)) {
374
- if ((_c = tableConfig.value.config) == null ? void 0 : _c.isradio) {
375
- refTable.value.clearSelection();
376
- refTable.value.toggleRowSelection(row, true);
377
- console.log("onRowClick");
378
- emit("selection", [row]);
379
- } else {
380
- refTable.value.toggleRowSelection(row);
381
- }
417
+ setSelectRow(row, true);
382
418
  }
383
419
  } else {
384
- if ((_d = tableConfig.value.config) == null ? void 0 : _d.isradio) {
385
- refTable.value.clearSelection();
386
- refTable.value.toggleRowSelection(row, true);
387
- console.log("onRowClick");
388
- emit("selection", [row]);
389
- } else {
390
- refTable.value.toggleRowSelection(row);
391
- }
420
+ setSelectRow(row, true);
421
+ }
422
+ } else {
423
+ if (!isHighlight.value) {
424
+ refTable.value.clearCurrentRow();
392
425
  }
393
426
  }
394
427
  }
395
428
  function empty() {
396
- var _a2, _b2, _c;
429
+ var _a2, _b2, _c, _d;
397
430
  if (istype.value && ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
398
431
  (_b2 = refTable.value) == null ? void 0 : _b2.clearRadioRow();
399
432
  }
400
433
  (_c = refTable.value) == null ? void 0 : _c.clearSelection();
401
- console.log("empty");
402
- emit("selection", []);
434
+ (_d = refTable.value) == null ? void 0 : _d.clearCurrentRow();
435
+ setSelection([]);
403
436
  }
404
437
  function onSelect(s, row) {
405
- var _a2;
438
+ setSelectRow(row, false);
439
+ }
440
+ function onCellClick(row) {
441
+ var _a2, _b2;
406
442
  if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
407
- refTable.value.clearSelection();
408
- refTable.value.toggleRowSelection(row, true);
409
- console.log("onSelect");
410
- emit("selection", [row]);
443
+ if ((_b2 = tableConfig.value.config) == null ? void 0 : _b2.isCancelAgain) {
444
+ if (selections.value[0] == row) {
445
+ console.log("onCellClick", row);
446
+ refTable.value.clearSelection();
447
+ refTable.value.clearCurrentRow();
448
+ setSelection([]);
449
+ }
450
+ }
411
451
  }
412
452
  }
413
453
  function onRadioChange(obj) {
414
454
  var _a2;
415
455
  if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
416
- console.log("onRadioChange");
417
- emit("selection", [obj.row]);
456
+ vue.nextTick(() => {
457
+ onRowClick(obj.row);
458
+ });
418
459
  }
419
460
  }
420
461
  function getFrontSort(ao, bo, prop) {
@@ -498,7 +539,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
498
539
  console.log("clean");
499
540
  (_a2 = refTable.value) == null ? void 0 : _a2.clearSelection();
500
541
  crossPageData.value = [];
501
- emit("selection", []);
542
+ setSelection([]);
502
543
  }
503
544
  function getParam(param) {
504
545
  var _a2;
@@ -726,6 +767,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
726
767
  onListEvents,
727
768
  onSelect,
728
769
  onRowClick,
770
+ onCellClick,
729
771
  onChange,
730
772
  pagconfig,
731
773
  formEvent,
@@ -57,6 +57,12 @@ export declare const dataProps: {
57
57
  type: ObjectConstructor;
58
58
  default(): {};
59
59
  };
60
+ /**
61
+ * @props { Boolean } isCompons 是否使用默认的配置
62
+ */
63
+ isCompons: {
64
+ type: BooleanConstructor;
65
+ };
60
66
  /**
61
67
  * @props { Object } compons 外部组件集合
62
68
  */
@@ -218,6 +224,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
218
224
  default?: any;
219
225
  value?: any;
220
226
  label?: string | /*elided*/ any | undefined;
227
+ labelText?: string | undefined;
221
228
  hideLabel?: boolean | undefined;
222
229
  prop?: string | undefined;
223
230
  slot?: string | undefined;
@@ -250,6 +257,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
250
257
  default?: any;
251
258
  value?: any;
252
259
  label?: string | /*elided*/ any | undefined;
260
+ labelText?: string | undefined;
253
261
  hideLabel?: boolean | undefined;
254
262
  prop?: string | undefined;
255
263
  slot?: string | undefined;
@@ -276,7 +284,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
276
284
  type?: string | undefined;
277
285
  }[]>;
278
286
  onRadioChange: (obj: ObjAny) => void;
279
- getSelection: () => any;
287
+ getSelection: () => ObjStr[];
280
288
  initData: (callback?: () => void) => void;
281
289
  getData: (p?: ObjAny, callback?: (d?: ObjAny) => void) => void;
282
290
  clean: () => void;
@@ -301,6 +309,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
301
309
  onListEvents: (...arr: any) => void;
302
310
  onSelect: (s: ObjAny, row: ObjStr) => void;
303
311
  onRowClick: (row: ObjAny) => void;
312
+ onCellClick: (row: ObjAny) => void;
304
313
  onChange: (arr: ObjStr[]) => void;
305
314
  pagconfig: Ref<{
306
315
  pageSize: number;
@@ -54,6 +54,12 @@ const dataProps = {
54
54
  return {};
55
55
  }
56
56
  },
57
+ /**
58
+ * @props { Boolean } isCompons 是否使用默认的配置
59
+ */
60
+ isCompons: {
61
+ type: Boolean
62
+ },
57
63
  /**
58
64
  * @props { Object } compons 外部组件集合
59
65
  */
@@ -350,69 +356,104 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
350
356
  return arr;
351
357
  }
352
358
  }
359
+ const selections = ref([]);
353
360
  function getSelection() {
354
- return refTable.value.getSelections();
361
+ return selections.value;
362
+ }
363
+ function setSelection(array) {
364
+ selections.value = array;
365
+ emit("selection", selections.value);
355
366
  }
356
367
  function onChange(arr) {
357
368
  var _a2;
369
+ console.log("onChange");
358
370
  if (!((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
359
- console.log("onChange");
360
- emit("selection", getSelectionValue(arr, paginat.current));
371
+ setSelection(getSelectionValue(arr, paginat.current));
372
+ }
373
+ }
374
+ const isHighlight = computed(() => {
375
+ const c = tableConfig.value.config || {};
376
+ if ((c == null ? void 0 : c.highlightCurrentRow) || c["highlight-current-row"]) {
377
+ return true;
378
+ } else {
379
+ return false;
380
+ }
381
+ });
382
+ function setSelectRow(row, is) {
383
+ var _a2, _b2;
384
+ if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
385
+ if ((_b2 = tableConfig.value.config) == null ? void 0 : _b2.isCancelAgain) {
386
+ if (selections.value[0] == row) {
387
+ refTable.value.clearSelection();
388
+ refTable.value.clearCurrentRow();
389
+ setSelection([]);
390
+ } else {
391
+ refTable.value.clearSelection();
392
+ refTable.value.toggleRowSelection(row, true);
393
+ setSelection([row]);
394
+ }
395
+ } else {
396
+ refTable.value.clearSelection();
397
+ refTable.value.toggleRowSelection(row, true);
398
+ setSelection([row]);
399
+ }
400
+ } else {
401
+ if (is) {
402
+ refTable.value.toggleRowSelection(row);
403
+ }
361
404
  }
362
405
  }
363
406
  function onRowClick(row) {
364
- var _a2, _b2, _c, _d;
365
- if (!((_a2 = tableConfig.value.config) == null ? void 0 : _a2.noRowSelect)) {
407
+ var _a2, _b2;
408
+ if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isRowSelect) {
366
409
  const selectable = (_b2 = tableConfig.value.config) == null ? void 0 : _b2.selectable;
367
410
  if (selectable) {
368
411
  const index = data.list.findIndex((obj) => {
369
412
  obj === row;
370
413
  });
371
414
  if (selectable(row, index)) {
372
- if ((_c = tableConfig.value.config) == null ? void 0 : _c.isradio) {
373
- refTable.value.clearSelection();
374
- refTable.value.toggleRowSelection(row, true);
375
- console.log("onRowClick");
376
- emit("selection", [row]);
377
- } else {
378
- refTable.value.toggleRowSelection(row);
379
- }
415
+ setSelectRow(row, true);
380
416
  }
381
417
  } else {
382
- if ((_d = tableConfig.value.config) == null ? void 0 : _d.isradio) {
383
- refTable.value.clearSelection();
384
- refTable.value.toggleRowSelection(row, true);
385
- console.log("onRowClick");
386
- emit("selection", [row]);
387
- } else {
388
- refTable.value.toggleRowSelection(row);
389
- }
418
+ setSelectRow(row, true);
419
+ }
420
+ } else {
421
+ if (!isHighlight.value) {
422
+ refTable.value.clearCurrentRow();
390
423
  }
391
424
  }
392
425
  }
393
426
  function empty() {
394
- var _a2, _b2, _c;
427
+ var _a2, _b2, _c, _d;
395
428
  if (istype.value && ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
396
429
  (_b2 = refTable.value) == null ? void 0 : _b2.clearRadioRow();
397
430
  }
398
431
  (_c = refTable.value) == null ? void 0 : _c.clearSelection();
399
- console.log("empty");
400
- emit("selection", []);
432
+ (_d = refTable.value) == null ? void 0 : _d.clearCurrentRow();
433
+ setSelection([]);
401
434
  }
402
435
  function onSelect(s, row) {
403
- var _a2;
436
+ setSelectRow(row, false);
437
+ }
438
+ function onCellClick(row) {
439
+ var _a2, _b2;
404
440
  if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
405
- refTable.value.clearSelection();
406
- refTable.value.toggleRowSelection(row, true);
407
- console.log("onSelect");
408
- emit("selection", [row]);
441
+ if ((_b2 = tableConfig.value.config) == null ? void 0 : _b2.isCancelAgain) {
442
+ if (selections.value[0] == row) {
443
+ console.log("onCellClick", row);
444
+ refTable.value.clearSelection();
445
+ refTable.value.clearCurrentRow();
446
+ setSelection([]);
447
+ }
448
+ }
409
449
  }
410
450
  }
411
451
  function onRadioChange(obj) {
412
452
  var _a2;
413
453
  if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
414
- console.log("onRadioChange");
415
- emit("selection", [obj.row]);
454
+ nextTick(() => {
455
+ onRowClick(obj.row);
456
+ });
416
457
  }
417
458
  }
418
459
  function getFrontSort(ao, bo, prop) {
@@ -496,7 +537,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
496
537
  console.log("clean");
497
538
  (_a2 = refTable.value) == null ? void 0 : _a2.clearSelection();
498
539
  crossPageData.value = [];
499
- emit("selection", []);
540
+ setSelection([]);
500
541
  }
501
542
  function getParam(param) {
502
543
  var _a2;
@@ -724,6 +765,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
724
765
  onListEvents,
725
766
  onSelect,
726
767
  onRowClick,
768
+ onCellClick,
727
769
  onChange,
728
770
  pagconfig,
729
771
  formEvent,
@@ -17,6 +17,10 @@
17
17
  padding: 20px 20px;
18
18
  }
19
19
 
20
+ .com-lable-array {
21
+ line-height: 18px;
22
+ }
23
+
20
24
  .tables {
21
25
  width: 100%;
22
26
  min-height: var(--tables-min-height, 70px);
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
- const util = require("../common/util.cjs");
5
- const index = require("../../table-column/index.cjs");
6
4
  const use = require("../../common/use.cjs");
7
5
  const getAttrValue = require("../../../utils/vues/getAttrValue.cjs");
8
- const compons = require("../../common/compons.cjs");
6
+ const index = require("../../../hooks/compons/index.cjs");
9
7
  const config = require("../common/config.cjs");
8
+ const util = require("../common/util.cjs");
9
+ const index$1 = require("../../table-column/index.cjs");
10
10
  const noProps = ["children", "class", "minWidth", "label"];
11
11
  function setProps(obj, props) {
12
12
  const table = props.table;
@@ -17,19 +17,20 @@ function setProps(obj, props) {
17
17
  Object.keys(obj).forEach((key) => {
18
18
  if (!noProps.includes(key)) {
19
19
  if (obj[key] !== "") {
20
- robj[key] = obj[key];
21
20
  if (key == "sortable") {
22
21
  if (obj[key]) {
23
22
  robj[key] = "custom";
24
23
  }
24
+ } else {
25
+ robj[key] = obj[key];
25
26
  }
26
27
  }
27
28
  }
28
29
  });
29
30
  return robj;
30
31
  }
31
- function setSslot(obj, scope, emit, slots, props, index2) {
32
- const slot = use.useSetSlot(obj, scope.row, slots, index2, scope);
32
+ function setSslot(obj, scope, emit, slots, props, index$12) {
33
+ const slot = use.useSetSlot(obj, scope.row, slots, index$12, scope);
33
34
  if (slot) {
34
35
  return slot;
35
36
  }
@@ -41,9 +42,9 @@ function setSslot(obj, scope, emit, slots, props, index2) {
41
42
  obj,
42
43
  scope.row,
43
44
  optionss,
44
- compons.useGetCompons(config.provides.compons),
45
+ index.useComponsGet(config.provides.compons),
45
46
  emit,
46
- index2,
47
+ index$12,
47
48
  scope
48
49
  );
49
50
  if (column) {
@@ -51,7 +52,7 @@ function setSslot(obj, scope, emit, slots, props, index2) {
51
52
  }
52
53
  }
53
54
  }
54
- return defaultDom(obj, scope, props, index2);
55
+ return defaultDom(obj, scope, props, index$12);
55
56
  }
56
57
  function defaultDom(obj, scope, props, index2) {
57
58
  var _a;
@@ -85,7 +86,7 @@ function defaultDom(obj, scope, props, index2) {
85
86
  domValue ?? table.emptyDisplay ?? ""
86
87
  );
87
88
  }
88
- function setHeader(obj, scope, slots, emit, props, index2) {
89
+ function setHeader(obj, scope, slots, emit, props, index$12) {
89
90
  const optionss = props.options || {};
90
91
  return use.useGetDomLabel(
91
92
  obj.label,
@@ -93,17 +94,22 @@ function setHeader(obj, scope, slots, emit, props, index2) {
93
94
  scope.row,
94
95
  slots,
95
96
  optionss,
96
- compons.useGetCompons(config.provides.compons),
97
+ index.useComponsGet(config.provides.compons),
97
98
  emit,
98
- index2
99
+ index$12
99
100
  );
100
101
  }
101
- function getTableColumn(obj, emit, props, slots, index$1, def) {
102
+ function getDom(obj, emit, propss, slots, index2) {
103
+ return getTableColumn(obj, emit, propss, slots, index2, (scope) => {
104
+ return setSslot(obj, scope, emit, slots, propss, index2);
105
+ });
106
+ }
107
+ function getTableColumn(obj, emit, props, slots, index2, def) {
102
108
  if (obj.type == "selection") {
103
109
  def = void 0;
104
110
  }
105
111
  return vue.h(
106
- index.TableColumn,
112
+ index$1.TableColumn,
107
113
  {
108
114
  ...setProps(obj, props),
109
115
  className: obj.class,
@@ -112,18 +118,14 @@ function getTableColumn(obj, emit, props, slots, index$1, def) {
112
118
  {
113
119
  default: def,
114
120
  header: (scope) => {
115
- return setHeader(obj, scope, slots, emit, props, index$1);
121
+ return setHeader(obj, scope, slots, emit, props, index2);
116
122
  }
117
123
  }
118
124
  );
119
125
  }
120
- function getDom(obj, emit, props, slots, index2) {
121
- return getTableColumn(obj, emit, props, slots, index2, (scope) => {
122
- return setSslot(obj, scope, emit, slots, props, index2);
123
- });
124
- }
125
126
  function columnRender(obj, emit, props, slots, index2) {
126
127
  return getDom(obj, emit, props, slots, index2);
127
128
  }
128
129
  exports.columnRender = columnRender;
129
130
  exports.getTableColumn = getTableColumn;
131
+ exports.setHeader = setHeader;
@@ -1,4 +1,5 @@
1
1
  import { VNode, RendererNode, RendererElement } from 'vue';
2
+ export declare function setHeader(obj: ListObj, scope: ObjAny, slots: ObjAny, emit: Function, props: ObjAny, index: number): any;
2
3
  export declare function getTableColumn(obj: ListObj, emit: Function, props: ObjAny, slots: ObjAny, index: number, def?: Function): VNode<RendererNode, RendererElement, {
3
4
  [key: string]: any;
4
5
  }>;