@fangzhongya/fang-ui 0.1.27 → 0.1.28

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 (214) 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 +29 -3
  19. package/dist/components/common/use.d.ts +2 -2
  20. package/dist/components/common/use.js +29 -3
  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 +3 -12
  37. package/dist/components/forms/src/setup.d.ts +1 -1
  38. package/dist/components/forms/src/setup.js +4 -13
  39. package/dist/components/forms/style/index2.scss +3 -1
  40. package/dist/components/forms-div/index.css +4 -0
  41. package/dist/components/forms-div/src/index2.cjs +4 -4
  42. package/dist/components/forms-div/src/index2.js +2 -2
  43. package/dist/components/forms-item/index.css +4 -0
  44. package/dist/components/forms-item/src/indexts.d.ts +1 -1
  45. package/dist/components/forms-item/src/label.cjs +15 -28
  46. package/dist/components/forms-item/src/label.js +16 -29
  47. package/dist/components/full-screen/index.css +4 -0
  48. package/dist/components/history/index.css +4 -0
  49. package/dist/components/icon/index.css +4 -0
  50. package/dist/components/icon-picker/index.css +4 -0
  51. package/dist/components/iframe/index.css +4 -0
  52. package/dist/components/images/index.css +4 -0
  53. package/dist/components/index.cjs +2 -0
  54. package/dist/components/index.d.ts +1 -0
  55. package/dist/components/index.js +2 -0
  56. package/dist/components/index.scss +2 -1
  57. package/dist/components/index2.scss +2 -1
  58. package/dist/components/input-array/index.css +4 -0
  59. package/dist/components/input-history/index.css +4 -0
  60. package/dist/components/input-num/index.css +4 -0
  61. package/dist/components/input-select/index.css +4 -0
  62. package/dist/components/inputs/index.css +4 -0
  63. package/dist/components/{global-config → keep-com}/index.css +4 -0
  64. package/dist/components/labels/index.css +4 -0
  65. package/dist/components/list/index.css +4 -0
  66. package/dist/components/list/src/data.cjs +6 -0
  67. package/dist/components/list/src/data.d.ts +6 -0
  68. package/dist/components/list/src/data.js +6 -0
  69. package/dist/components/list/src/index2.cjs +6 -6
  70. package/dist/components/list/src/index2.js +2 -2
  71. package/dist/components/lists/index.css +4 -0
  72. package/dist/components/listsp/index.css +4 -0
  73. package/dist/components/listspd/index.css +4 -0
  74. package/dist/components/menus/index.css +4 -0
  75. package/dist/components/no-data/index.css +4 -0
  76. package/dist/components/page/index.css +10 -6
  77. package/dist/components/paging/index.css +4 -0
  78. package/dist/components/popup/index.css +4 -0
  79. package/dist/components/retract/index.css +4 -0
  80. package/dist/components/right-key/index.css +4 -0
  81. package/dist/components/scss/common.scss +4 -0
  82. package/dist/components/seamless-scroll/index.css +4 -0
  83. package/dist/components/select-scroll/index.css +4 -0
  84. package/dist/components/selector/index.css +4 -0
  85. package/dist/components/selects/index.css +4 -0
  86. package/dist/components/sliders/index.css +4 -0
  87. package/dist/components/switchs/index.css +4 -0
  88. package/dist/components/tables/common/config.cjs +1 -1
  89. package/dist/components/tables/common/config.js +1 -1
  90. package/dist/components/tables/common/pagin.cjs +74 -32
  91. package/dist/components/tables/common/pagin.d.ts +8 -1
  92. package/dist/components/tables/common/pagin.js +74 -32
  93. package/dist/components/tables/index.css +4 -0
  94. package/dist/components/tables/src/column.cjs +22 -20
  95. package/dist/components/tables/src/column.d.ts +3 -0
  96. package/dist/components/tables/src/column.js +14 -12
  97. package/dist/components/tables/src/data.cjs +15 -0
  98. package/dist/components/tables/src/data.d.ts +13 -0
  99. package/dist/components/tables/src/data.js +15 -0
  100. package/dist/components/tables/src/index2.cjs +17 -9
  101. package/dist/components/tables/src/index2.js +11 -3
  102. package/dist/components/tablesp/index.css +4 -0
  103. package/dist/components/tablespd/index.css +4 -0
  104. package/dist/components/tabless/index.css +4 -0
  105. package/dist/components/tablesv/index.css +4 -0
  106. package/dist/components/tablesv/src/column.cjs +116 -112
  107. package/dist/components/tablesv/src/column.d.ts +3 -1
  108. package/dist/components/tablesv/src/column.js +110 -106
  109. package/dist/components/tablesv/src/data.cjs +44 -0
  110. package/dist/components/tablesv/src/data.d.ts +43 -1
  111. package/dist/components/tablesv/src/data.js +44 -0
  112. package/dist/components/tablesv/src/index2.cjs +37 -14
  113. package/dist/components/tablesv/src/index2.js +36 -13
  114. package/dist/components/tablesv/style/index2.scss +3 -1
  115. package/dist/components/tablesvp/index.css +10 -0
  116. package/dist/components/tablesvp/index.scss +8 -0
  117. package/dist/components/tablesvp/src/index2.cjs +15 -5
  118. package/dist/components/tablesvp/src/index2.js +15 -5
  119. package/dist/components/tablesvpd/index.cjs +9 -0
  120. package/dist/components/tablesvpd/index.css +157 -0
  121. package/dist/components/tablesvpd/index.d.ts +4 -0
  122. package/dist/components/tablesvpd/index.js +9 -0
  123. package/dist/components/tablesvpd/index.scss +41 -0
  124. package/dist/components/tablesvpd/src/data.cjs +13 -0
  125. package/dist/components/tablesvpd/src/data.d.ts +18 -0
  126. package/dist/components/tablesvpd/src/data.js +13 -0
  127. package/dist/components/tablesvpd/src/index.cjs +4 -0
  128. package/dist/components/tablesvpd/src/index.js +4 -0
  129. package/dist/components/tablesvpd/src/index2.cjs +107 -0
  130. package/dist/components/tablesvpd/src/index2.js +107 -0
  131. package/dist/components/tablesvpd/style/index2.scss +4 -0
  132. package/dist/components/uploads/index.css +4 -0
  133. package/dist/components/videos/index.css +4 -0
  134. package/dist/components/window/index.css +4 -0
  135. package/dist/css/array.css +4 -0
  136. package/dist/css/audios.css +4 -0
  137. package/dist/css/box-adjust.css +4 -0
  138. package/dist/css/box-local.css +4 -0
  139. package/dist/css/box-mask.css +4 -0
  140. package/dist/css/box-title.css +4 -0
  141. package/dist/css/box.css +4 -0
  142. package/dist/css/buttons.css +4 -0
  143. package/dist/css/cascaders.css +4 -0
  144. package/dist/css/checks.css +4 -0
  145. package/dist/css/dates-divide.css +4 -0
  146. package/dist/css/dates-picker.css +4 -0
  147. package/dist/css/dates.css +4 -0
  148. package/dist/css/dates2.css +4 -0
  149. package/dist/css/dialogs.css +4 -0
  150. package/dist/css/edit-float.css +4 -0
  151. package/dist/css/edit.css +4 -0
  152. package/dist/css/forms-div.css +4 -0
  153. package/dist/css/forms-item.css +4 -0
  154. package/dist/css/forms.css +10 -6
  155. package/dist/css/full-screen.css +4 -0
  156. package/dist/css/history.css +4 -0
  157. package/dist/css/icon-picker.css +4 -0
  158. package/dist/css/icon.css +4 -0
  159. package/dist/css/iframe.css +4 -0
  160. package/dist/css/images.css +4 -0
  161. package/dist/css/index.css +44 -6
  162. package/dist/css/input-array.css +4 -0
  163. package/dist/css/input-history.css +4 -0
  164. package/dist/css/input-num.css +4 -0
  165. package/dist/css/input-select.css +4 -0
  166. package/dist/css/inputs.css +4 -0
  167. package/dist/css/{global-config.css → keep-com.css} +4 -0
  168. package/dist/css/labels.css +4 -0
  169. package/dist/css/list.css +4 -0
  170. package/dist/css/lists.css +4 -0
  171. package/dist/css/listsp.css +4 -0
  172. package/dist/css/listspd.css +4 -0
  173. package/dist/css/menus.css +4 -0
  174. package/dist/css/no-data.css +4 -0
  175. package/dist/css/page.css +10 -6
  176. package/dist/css/paging.css +4 -0
  177. package/dist/css/popup.css +4 -0
  178. package/dist/css/retract.css +4 -0
  179. package/dist/css/right-key.css +4 -0
  180. package/dist/css/seamless-scroll.css +4 -0
  181. package/dist/css/select-scroll.css +4 -0
  182. package/dist/css/selector.css +4 -0
  183. package/dist/css/selects.css +4 -0
  184. package/dist/css/sliders.css +4 -0
  185. package/dist/css/switchs.css +4 -0
  186. package/dist/css/tables.css +4 -0
  187. package/dist/css/tablesp.css +4 -0
  188. package/dist/css/tablespd.css +4 -0
  189. package/dist/css/tabless.css +4 -0
  190. package/dist/css/tablesv.css +4 -0
  191. package/dist/css/tablesvp.css +10 -0
  192. package/dist/css/tablesvpd.css +157 -0
  193. package/dist/css/uploads.css +4 -0
  194. package/dist/css/videos.css +4 -0
  195. package/dist/css/window.css +4 -0
  196. package/dist/expand/{chunk-MC76Q3TQ.cjs → chunk-3HP2ZDNG.cjs} +3 -1
  197. package/dist/expand/{chunk-CV4O5V2F.js → chunk-7C25SBCF.js} +3 -1
  198. package/dist/expand/components.cjs +5 -5
  199. package/dist/expand/components.js +1 -1
  200. package/dist/expand/config.cjs +2 -2
  201. package/dist/expand/config.js +1 -1
  202. package/dist/hooks/compons/index.cjs +44 -0
  203. package/dist/hooks/compons/index.d.ts +7 -0
  204. package/dist/hooks/compons/index.js +44 -0
  205. package/dist/icons/index.json +1 -1
  206. package/dist/index.cjs +24 -22
  207. package/dist/index.css +44 -6
  208. package/dist/index.js +2 -0
  209. package/package.json +12 -12
  210. package/dist/components/common/compons.cjs +0 -76
  211. package/dist/components/common/compons.d.ts +0 -9
  212. package/dist/components/common/compons.js +0 -76
  213. package/dist/components/common/compons.scss +0 -26
  214. package/dist/components/common/compons2.scss +0 -26
@@ -2,7 +2,7 @@ import { defineComponent, ref, shallowRef, computed, h, onMounted } from "vue";
2
2
  import { setLabel, setSslot } from "./util.js";
3
3
  import { setStyles } from "../../common/css.js";
4
4
  import { useObjComponSelected, useHide } from "../../common/use.js";
5
- import { useCompons } from "../../common/compons.js";
5
+ import { useCompons } from "../../../hooks/compons/index.js";
6
6
  import { useCssName } from "../../../hooks/cssname/index.js";
7
7
  import { hideTooltip, showTooltip } from "../../tables/common/tooltip.js";
8
8
  import { usePropsDefault, viewProps, getProps } from "../../../hooks/props-default/index.js";
@@ -21,7 +21,7 @@ const _sfc_main = defineComponent({
21
21
  setup(prs, { emit, slots }) {
22
22
  const props = usePropsDefault(name, prs, dataProps);
23
23
  viewProps(props, name);
24
- const compons = useCompons("list-compons", props.compons);
24
+ const compons = useCompons(name, props);
25
25
  const cs = useCssName(name);
26
26
  const refDom = ref();
27
27
  const isfocus = ref(false);
@@ -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
  .lists {
21
25
  width: 100%;
22
26
  min-height: 100px;
@@ -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
  .lists {
21
25
  width: 100%;
22
26
  min-height: 100px;
@@ -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
  .lists {
21
25
  width: 100%;
22
26
  min-height: 100px;
@@ -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
  .menus .menu-li-item {
21
25
  display: flex;
22
26
  align-items: center;
@@ -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
  .no-data {
21
25
  text-align: center;
22
26
  display: flex;
@@ -18,6 +18,10 @@
18
18
  padding: 20px 20px;
19
19
  }
20
20
 
21
+ .com-lable-array {
22
+ line-height: 18px;
23
+ }
24
+
21
25
  .forms-div {
22
26
  width: 100%;
23
27
  height: 100%;
@@ -106,12 +110,6 @@
106
110
  font-size: 0;
107
111
  }
108
112
 
109
- .dates .dates-date {
110
- height: 100%;
111
- width: 100%;
112
- box-sizing: border-box;
113
- }
114
-
115
113
  .selects-select {
116
114
  height: 100%;
117
115
  min-width: 60px;
@@ -121,6 +119,12 @@
121
119
  height: 100%;
122
120
  }
123
121
 
122
+ .dates .dates-date {
123
+ height: 100%;
124
+ width: 100%;
125
+ box-sizing: border-box;
126
+ }
127
+
124
128
  .inputs-input {
125
129
  height: 100%;
126
130
  }
@@ -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
  */
@@ -276,7 +282,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
276
282
  type?: string | undefined;
277
283
  }[]>;
278
284
  onRadioChange: (obj: ObjAny) => void;
279
- getSelection: () => any;
285
+ getSelection: () => ObjStr[];
280
286
  initData: (callback?: () => void) => void;
281
287
  getData: (p?: ObjAny, callback?: (d?: ObjAny) => void) => void;
282
288
  clean: () => void;
@@ -301,6 +307,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
301
307
  onListEvents: (...arr: any) => void;
302
308
  onSelect: (s: ObjAny, row: ObjStr) => void;
303
309
  onRowClick: (row: ObjAny) => void;
310
+ onCellClick: (row: ObjAny) => void;
304
311
  onChange: (arr: ObjStr[]) => void;
305
312
  pagconfig: Ref<{
306
313
  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);