linkmore-design 1.1.28 → 1.1.30

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 (266) hide show
  1. package/dist/Form/FormItem/index.d.ts +1 -0
  2. package/dist/LmEditTable/DndContainer.d.ts +6 -3
  3. package/dist/LmEditTable/EditTable.d.ts +16 -5
  4. package/dist/LmEditTable/components/DraggableContainer.d.ts +10 -0
  5. package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
  6. package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
  7. package/dist/LmEditTable/components/customRenderEmpty.d.ts +2 -0
  8. package/dist/LmEditTable/components/index.d.ts +17 -0
  9. package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
  10. package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
  11. package/dist/LmEditTable/sortableItem.d.ts +3 -2
  12. package/dist/LmEditTable/util.d.ts +10 -0
  13. package/dist/LmEditTable/virtual/VirtualRow.d.ts +7 -0
  14. package/dist/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
  15. package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
  16. package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
  17. package/dist/LmEditTable/virtual/context.d.ts +13 -0
  18. package/dist/LmEditTable/virtual/index.d.ts +4 -0
  19. package/dist/LmTable/common/index.d.ts +10 -0
  20. package/dist/LmTable/components/CalcExpression.d.ts +9 -0
  21. package/dist/LmTable/components/Container/Container.d.ts +20 -0
  22. package/dist/LmTable/components/Container/index.d.ts +2 -0
  23. package/dist/LmTable/components/DndContainer.d.ts +37 -5
  24. package/dist/LmTable/components/HeaderCol.d.ts +1 -0
  25. package/dist/LmTable/components/Item/Item.d.ts +37 -0
  26. package/dist/LmTable/components/Item/components/Action/Action.d.ts +10 -0
  27. package/dist/LmTable/components/Item/components/Action/index.d.ts +2 -0
  28. package/dist/LmTable/components/Item/components/Handle/index.d.ts +4 -0
  29. package/dist/LmTable/components/Item/components/Remove/index.d.ts +2 -0
  30. package/dist/LmTable/components/Item/components/index.d.ts +3 -0
  31. package/dist/LmTable/components/Item/index.d.ts +2 -0
  32. package/dist/LmTable/components/{sortableBoxCol.d.ts → SortableBox.d.ts} +0 -0
  33. package/dist/LmTable/demos/{excelGroup.d.ts → draggable.d.ts} +0 -0
  34. package/dist/LmTable/demos/resize.d.ts +2 -0
  35. package/dist/LmTable/expression.d.ts +2 -1
  36. package/dist/LmTable/hooks/useDndItems.d.ts +13 -0
  37. package/dist/LmTable/hooks/useGroupDataSource.d.ts +1 -2
  38. package/dist/LmTable/hooks/useResizeObserver.d.ts +13 -0
  39. package/dist/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
  40. package/dist/LmTable/testDemos/group.d.ts +2 -0
  41. package/dist/LmTable/util.d.ts +1 -1
  42. package/dist/LmTable/virTual/VirtualRow.d.ts +1 -1
  43. package/dist/index.d.ts +1 -2
  44. package/dist/index.umd.css +367 -0
  45. package/dist/index.umd.js +4362 -52840
  46. package/dist/index.umd.min.css +1 -1
  47. package/dist/index.umd.min.js +23 -47
  48. package/dist/variables.css +129 -6
  49. package/es/CardTable/style/index.css +3 -2
  50. package/es/CardTable/style/variables.css +3 -2
  51. package/es/CustomTableOption/columnsSort.js +41 -19
  52. package/es/CustomTableOption/filterSort.js +14 -6
  53. package/es/CustomTableOption/style/index.css +3 -0
  54. package/es/CustomTableOption/style/variables.css +3 -0
  55. package/es/Dropdown/style/index.css +1 -1
  56. package/es/Dropdown/style/variables.css +1 -1
  57. package/es/Empty/index.js +0 -1
  58. package/es/Form/FormItem/index.d.ts +1 -0
  59. package/es/Form/FormItem/index.js +31 -17
  60. package/es/Form/style/index.css +4 -0
  61. package/es/Form/style/variables.css +4 -0
  62. package/es/InputNumber/index.js +7 -9
  63. package/es/LmEditTable/DndContainer.d.ts +6 -3
  64. package/es/LmEditTable/DndContainer.js +70 -10
  65. package/es/LmEditTable/DragHandle.js +1 -1
  66. package/es/LmEditTable/EditTable.d.ts +16 -5
  67. package/es/LmEditTable/EditTable.js +855 -436
  68. package/es/LmEditTable/components/DraggableContainer.d.ts +10 -0
  69. package/es/LmEditTable/components/DraggableContainer.js +39 -0
  70. package/es/LmEditTable/components/QuickOpetate.d.ts +12 -0
  71. package/es/LmEditTable/components/QuickOpetate.js +82 -0
  72. package/es/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
  73. package/es/LmEditTable/components/bottomOpetateComponent.js +23 -0
  74. package/es/LmEditTable/components/customRenderEmpty.d.ts +2 -0
  75. package/es/LmEditTable/components/customRenderEmpty.js +20 -0
  76. package/es/LmEditTable/components/index.d.ts +17 -0
  77. package/es/LmEditTable/components/index.js +8 -0
  78. package/es/LmEditTable/hooks/useForkRef.d.ts +2 -0
  79. package/es/LmEditTable/hooks/useForkRef.js +22 -0
  80. package/es/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
  81. package/es/LmEditTable/rowSort/DndContainerRow.js +83 -0
  82. package/es/LmEditTable/sortableItem.d.ts +3 -2
  83. package/es/LmEditTable/sortableItem.js +16 -4
  84. package/es/LmEditTable/sortableItemCol.js +40 -10
  85. package/es/LmEditTable/style/index.css +105 -1
  86. package/es/LmEditTable/style/variables.css +105 -1
  87. package/es/LmEditTable/util.d.ts +10 -0
  88. package/es/LmEditTable/util.js +162 -9
  89. package/es/LmEditTable/virtual/VirtualRow.d.ts +7 -0
  90. package/es/LmEditTable/virtual/VirtualRow.js +148 -0
  91. package/es/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
  92. package/es/LmEditTable/virtual/VirtualRow2.js +62 -0
  93. package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
  94. package/es/LmEditTable/virtual/VirtualTable.js +64 -0
  95. package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
  96. package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
  97. package/es/LmEditTable/virtual/context.d.ts +13 -0
  98. package/es/LmEditTable/virtual/context.js +66 -0
  99. package/es/LmEditTable/virtual/index.d.ts +4 -0
  100. package/es/LmEditTable/virtual/index.js +4 -0
  101. package/es/LmTable/Table.js +269 -163
  102. package/es/LmTable/common/index.d.ts +10 -0
  103. package/es/LmTable/common/index.js +38 -0
  104. package/es/LmTable/components/CalcExpression.d.ts +9 -0
  105. package/es/LmTable/components/CalcExpression.js +150 -0
  106. package/es/LmTable/components/Container/Container.css +94 -0
  107. package/es/LmTable/components/Container/Container.d.ts +20 -0
  108. package/es/LmTable/components/Container/Container.js +52 -0
  109. package/es/LmTable/components/Container/index.d.ts +2 -0
  110. package/es/LmTable/components/Container/index.js +1 -0
  111. package/es/LmTable/components/DndContainer.d.ts +37 -5
  112. package/es/LmTable/components/DndContainer.js +704 -24
  113. package/es/LmTable/components/HeaderCol.js +61 -0
  114. package/es/LmTable/components/Item/Item.css +113 -0
  115. package/es/LmTable/components/Item/Item.d.ts +37 -0
  116. package/es/LmTable/components/Item/Item.js +88 -0
  117. package/es/LmTable/components/Item/components/Action/Action.css +41 -0
  118. package/es/LmTable/components/Item/components/Action/Action.d.ts +10 -0
  119. package/es/LmTable/components/Item/components/Action/Action.js +35 -0
  120. package/es/LmTable/components/Item/components/Action/index.d.ts +2 -0
  121. package/es/LmTable/components/Item/components/Action/index.js +1 -0
  122. package/es/LmTable/components/Item/components/Handle/index.d.ts +4 -0
  123. package/es/LmTable/components/Item/components/Handle/index.js +15 -0
  124. package/es/LmTable/components/Item/components/Remove/index.d.ts +2 -0
  125. package/es/LmTable/components/Item/components/Remove/index.js +16 -0
  126. package/es/LmTable/components/Item/components/index.d.ts +3 -0
  127. package/es/LmTable/components/Item/components/index.js +3 -0
  128. package/es/LmTable/components/Item/index.d.ts +2 -0
  129. package/es/LmTable/components/Item/index.js +2 -0
  130. package/es/LmTable/components/{sortableBoxCol.js → SortableBox.js} +0 -0
  131. package/es/LmTable/expression.d.ts +2 -1
  132. package/es/LmTable/expression.js +92 -16
  133. package/es/LmTable/hooks/useDndItems.d.ts +13 -0
  134. package/es/LmTable/hooks/useDndItems.js +234 -0
  135. package/es/LmTable/hooks/useGroupDataSource.js +2 -24
  136. package/es/LmTable/hooks/useResizeObserver.d.ts +13 -0
  137. package/es/LmTable/hooks/useResizeObserver.js +49 -0
  138. package/es/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
  139. package/es/LmTable/multipleContainersKeyboardCoordinates.js +117 -0
  140. package/es/LmTable/style/index.css +13 -2
  141. package/es/LmTable/style/variables.css +13 -2
  142. package/es/LmTable/testDemos/group.js +131 -0
  143. package/es/LmTable/util.js +22 -2
  144. package/es/LmTable/virTual/VirtualRow.d.ts +1 -1
  145. package/es/LmTable/virTual/VirtualRow.js +82 -48
  146. package/es/LmTable/virTual/VirtualTable.js +43 -11
  147. package/es/LmTable/virTual/context.js +14 -2
  148. package/es/LmUpload/fns/index.js +1 -1
  149. package/es/Modal/index.js +10 -3
  150. package/es/Radio/index.js +9 -1
  151. package/es/Switch/index.js +7 -2
  152. package/es/hooks/useEvent/index.js +1 -1
  153. package/es/index.d.ts +1 -2
  154. package/es/locale-provider/index.js +1 -1
  155. package/es/styles/variables.css +129 -6
  156. package/lib/CardTable/style/index.css +3 -2
  157. package/lib/CardTable/style/variables.css +3 -2
  158. package/lib/CustomTableOption/columnsSort.js +48 -23
  159. package/lib/CustomTableOption/filterSort.js +19 -10
  160. package/lib/CustomTableOption/style/index.css +3 -0
  161. package/lib/CustomTableOption/style/variables.css +3 -0
  162. package/lib/Dropdown/style/index.css +1 -1
  163. package/lib/Dropdown/style/variables.css +1 -1
  164. package/lib/Empty/index.js +0 -1
  165. package/lib/Form/FormItem/index.d.ts +1 -0
  166. package/lib/Form/FormItem/index.js +32 -17
  167. package/lib/Form/style/index.css +4 -0
  168. package/lib/Form/style/variables.css +4 -0
  169. package/lib/InputNumber/index.js +9 -9
  170. package/lib/LmEditTable/DndContainer.d.ts +6 -3
  171. package/lib/LmEditTable/DndContainer.js +74 -9
  172. package/lib/LmEditTable/DragHandle.js +1 -1
  173. package/lib/LmEditTable/EditTable.d.ts +16 -5
  174. package/lib/LmEditTable/EditTable.js +853 -433
  175. package/lib/LmEditTable/components/DraggableContainer.d.ts +10 -0
  176. package/lib/LmEditTable/components/DraggableContainer.js +52 -0
  177. package/lib/LmEditTable/components/QuickOpetate.d.ts +12 -0
  178. package/lib/LmEditTable/components/QuickOpetate.js +96 -0
  179. package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
  180. package/lib/LmEditTable/components/bottomOpetateComponent.js +34 -0
  181. package/lib/LmEditTable/components/customRenderEmpty.d.ts +2 -0
  182. package/lib/LmEditTable/components/customRenderEmpty.js +32 -0
  183. package/lib/LmEditTable/components/index.d.ts +17 -0
  184. package/lib/LmEditTable/components/index.js +45 -0
  185. package/lib/LmEditTable/hooks/useForkRef.d.ts +2 -0
  186. package/lib/LmEditTable/hooks/useForkRef.js +29 -0
  187. package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
  188. package/lib/LmEditTable/rowSort/DndContainerRow.js +100 -0
  189. package/lib/LmEditTable/sortableItem.d.ts +3 -2
  190. package/lib/LmEditTable/sortableItem.js +19 -5
  191. package/lib/LmEditTable/sortableItemCol.js +37 -8
  192. package/lib/LmEditTable/style/index.css +105 -1
  193. package/lib/LmEditTable/style/variables.css +105 -1
  194. package/lib/LmEditTable/util.d.ts +10 -0
  195. package/lib/LmEditTable/util.js +171 -8
  196. package/lib/LmEditTable/virtual/VirtualRow.d.ts +7 -0
  197. package/lib/LmEditTable/virtual/VirtualRow.js +164 -0
  198. package/lib/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
  199. package/lib/LmEditTable/virtual/VirtualRow2.js +78 -0
  200. package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
  201. package/lib/LmEditTable/virtual/VirtualTable.js +81 -0
  202. package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
  203. package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
  204. package/lib/LmEditTable/virtual/context.d.ts +13 -0
  205. package/lib/LmEditTable/virtual/context.js +76 -0
  206. package/lib/LmEditTable/virtual/index.d.ts +4 -0
  207. package/lib/LmEditTable/virtual/index.js +31 -0
  208. package/lib/LmTable/Table.js +269 -163
  209. package/lib/LmTable/common/index.d.ts +10 -0
  210. package/lib/LmTable/common/index.js +48 -0
  211. package/lib/LmTable/components/CalcExpression.d.ts +9 -0
  212. package/lib/LmTable/components/CalcExpression.js +166 -0
  213. package/lib/LmTable/components/Container/Container.css +94 -0
  214. package/lib/LmTable/components/Container/Container.d.ts +20 -0
  215. package/lib/LmTable/components/Container/Container.js +66 -0
  216. package/lib/LmTable/components/Container/index.d.ts +2 -0
  217. package/lib/LmTable/components/Container/index.js +13 -0
  218. package/lib/LmTable/components/DndContainer.d.ts +37 -5
  219. package/lib/LmTable/components/DndContainer.js +714 -26
  220. package/lib/LmTable/components/HeaderCol.js +61 -0
  221. package/lib/LmTable/components/Item/Item.css +113 -0
  222. package/lib/LmTable/components/Item/Item.d.ts +37 -0
  223. package/lib/LmTable/components/Item/Item.js +104 -0
  224. package/lib/LmTable/components/Item/components/Action/Action.css +41 -0
  225. package/lib/LmTable/components/Item/components/Action/Action.d.ts +10 -0
  226. package/lib/LmTable/components/Item/components/Action/Action.js +50 -0
  227. package/lib/LmTable/components/Item/components/Action/index.d.ts +2 -0
  228. package/lib/LmTable/components/Item/components/Action/index.js +13 -0
  229. package/lib/LmTable/components/Item/components/Handle/index.d.ts +4 -0
  230. package/lib/LmTable/components/Item/components/Handle/index.js +27 -0
  231. package/lib/LmTable/components/Item/components/Remove/index.d.ts +2 -0
  232. package/lib/LmTable/components/Item/components/Remove/index.js +27 -0
  233. package/lib/LmTable/components/Item/components/index.d.ts +3 -0
  234. package/lib/LmTable/components/Item/components/index.js +31 -0
  235. package/lib/LmTable/components/Item/index.d.ts +2 -0
  236. package/lib/LmTable/components/Item/index.js +33 -0
  237. package/lib/LmTable/components/{sortableBoxCol.js → SortableBox.js} +0 -0
  238. package/lib/LmTable/expression.d.ts +2 -1
  239. package/lib/LmTable/expression.js +96 -17
  240. package/lib/LmTable/hooks/useDndItems.d.ts +13 -0
  241. package/lib/LmTable/hooks/useDndItems.js +247 -0
  242. package/lib/LmTable/hooks/useGroupDataSource.js +2 -24
  243. package/lib/LmTable/hooks/useResizeObserver.d.ts +13 -0
  244. package/lib/LmTable/hooks/useResizeObserver.js +61 -0
  245. package/lib/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
  246. package/lib/LmTable/multipleContainersKeyboardCoordinates.js +126 -0
  247. package/lib/LmTable/style/index.css +13 -2
  248. package/lib/LmTable/style/variables.css +13 -2
  249. package/lib/LmTable/testDemos/group.js +131 -0
  250. package/lib/LmTable/util.js +22 -2
  251. package/lib/LmTable/virTual/VirtualRow.d.ts +1 -1
  252. package/lib/LmTable/virTual/VirtualRow.js +81 -48
  253. package/lib/LmTable/virTual/VirtualTable.js +43 -10
  254. package/lib/LmTable/virTual/context.js +14 -2
  255. package/lib/LmUpload/fns/index.js +1 -1
  256. package/lib/Modal/index.js +10 -3
  257. package/lib/Radio/index.js +9 -1
  258. package/lib/Switch/index.js +9 -2
  259. package/lib/hooks/useEvent/index.js +1 -1
  260. package/lib/index.d.ts +1 -2
  261. package/lib/locale-provider/index.js +1 -1
  262. package/lib/styles/variables.css +129 -6
  263. package/package.json +3 -5
  264. package/dist/LmTable/components/sortableItemCol.d.ts +0 -1
  265. package/es/LmTable/components/sortableItemCol.js +0 -56
  266. package/lib/LmTable/components/sortableItemCol.js +0 -56
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 查找单极树节点
3
+ * @param tree
4
+ * @param func
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare const treeFind: (tree: any[] | Object, func: (node: any) => boolean, options?: any) => any;
9
+ declare const _default: {};
10
+ export default _default;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 查找单极树节点
3
+ * @param tree
4
+ * @param func
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export var treeFind = function treeFind(tree, func) {
9
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
10
+ var _options$children = options.children,
11
+ children = _options$children === void 0 ? 'children' : _options$children;
12
+ var list = [];
13
+
14
+ if (Array.isArray(tree)) {
15
+ list = tree;
16
+ } else if (Object.prototype.toString.call(tree) === '[object Object]') {
17
+ list.push(tree);
18
+ }
19
+
20
+ for (var i = 0; i < list.length; i += 1) {
21
+ var data = list[i];
22
+
23
+ if (func(data)) {
24
+ return data;
25
+ }
26
+
27
+ if (data["".concat(children)]) {
28
+ var res = treeFind(data["".concat(children)], func, options);
29
+
30
+ if (res) {
31
+ return res;
32
+ }
33
+ }
34
+ }
35
+
36
+ return null;
37
+ };
38
+ export default {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface IProps {
3
+ record: Record<string, any>;
4
+ rowKey: string;
5
+ col: any;
6
+ [key: string]: any;
7
+ }
8
+ declare const CalcExpression: React.FC<IProps>;
9
+ export default CalcExpression;
@@ -0,0 +1,150 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+
4
+ for (var p in s) {
5
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6
+ }
7
+
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+
14
+ import React, { useEffect } from 'react';
15
+ import { omit } from 'lodash';
16
+ import calc, { reset } from '../expression';
17
+ import Select from '../../Select';
18
+ var Option = Select.Option;
19
+
20
+ var dfs = function dfs(dataSource, dataIndex, expression) {
21
+ var traverse = function traverse(arr) {
22
+ var history = [];
23
+ arr === null || arr === void 0 ? void 0 : arr.forEach(function (item) {
24
+ if (item === null || item === void 0 ? void 0 : item.children) {
25
+ traverse(item === null || item === void 0 ? void 0 : item.children);
26
+ }
27
+
28
+ calc(item, [[dataIndex, expression]], history);
29
+ });
30
+
31
+ if (history && history.length) {
32
+ var sum = 0;
33
+ history.forEach(function (h) {
34
+ sum += h.sum;
35
+ });
36
+ history.forEach(function (h) {
37
+ if (sum < 0.000001) {
38
+ sum = 0;
39
+ h.item[h.dataIndex] = '0%';
40
+ } else {
41
+ h.item[h.dataIndex] = (h.sum / sum * 100).toFixed(2) + '%';
42
+ }
43
+
44
+ h.item["".concat(h.dataIndex, "_sum")] = sum;
45
+ });
46
+ }
47
+ };
48
+
49
+ traverse(dataSource);
50
+ };
51
+
52
+ var strategy = [{
53
+ value: '',
54
+ label: '不计算'
55
+ }, {
56
+ value: 'percent',
57
+ label: '百分比'
58
+ }, {
59
+ value: 'average',
60
+ label: '平均值'
61
+ }, {
62
+ value: 'max',
63
+ label: '最大值'
64
+ }, {
65
+ value: 'min',
66
+ label: '最小值'
67
+ }, {
68
+ value: 'sum',
69
+ label: '总计值'
70
+ }];
71
+
72
+ var CalcExpression = function CalcExpression(props) {
73
+ var record = props.record,
74
+ col = props.col,
75
+ columns = props.columns,
76
+ children = props.children,
77
+ onChangeRecord = props.onChangeRecord,
78
+ onExpressionChange = props.onExpressionChange,
79
+ rest = __rest(props // 鼠标移进移除不会重新渲染
80
+ , ["record", "col", "columns", "children", "onChangeRecord", "onExpressionChange"]); // 鼠标移进移除不会重新渲染
81
+
82
+
83
+ var restParams = omit(rest, ['onMouseEnter', 'onMouseLeave']); // 列参数
84
+
85
+ var isShowSelect = false; // 下拉框是否展示
86
+
87
+ var currentStrategy = []; // 使用的计算策略
88
+
89
+ if (col === null || col === void 0 ? void 0 : col.expression) {
90
+ if (typeof (col === null || col === void 0 ? void 0 : col.expression) === 'boolean') {
91
+ isShowSelect = true;
92
+ currentStrategy = strategy;
93
+ } else if (Array.isArray(col.expression)) {
94
+ isShowSelect = true;
95
+ currentStrategy = strategy.filter(function (item) {
96
+ return col.expression.includes(item.value);
97
+ });
98
+ }
99
+ }
100
+
101
+ var onChange = function onChange(value) {
102
+ if (!col.dataIndex) {
103
+ throw Error('no parameter dataIndex');
104
+ }
105
+
106
+ if (value) {
107
+ onChangeRecord(dfs, col.dataIndex, value, true);
108
+ } else {
109
+ onChangeRecord(reset, col.dataIndex, value, true);
110
+ }
111
+
112
+ onExpressionChange && onExpressionChange(col, value);
113
+ };
114
+
115
+ useEffect(function () {
116
+ // 使用默认值初始化
117
+ if (col === null || col === void 0 ? void 0 : col.defaultExpression) {
118
+ onChangeRecord(dfs, col.dataIndex, col === null || col === void 0 ? void 0 : col.defaultExpression, false);
119
+ }
120
+ }, [col === null || col === void 0 ? void 0 : col.defaultExpression]);
121
+
122
+ if (record && record._group && isShowSelect && (col === null || col === void 0 ? void 0 : col.dataIndex)) {
123
+ var select = Object.assign({
124
+ placeholder: '不计算',
125
+ allowClear: false,
126
+ size: "small",
127
+ bordered: false
128
+ }, col.expressionSelect ? col.expressionSelect : {});
129
+ return /*#__PURE__*/React.createElement("td", Object.assign({}, restParams), /*#__PURE__*/React.createElement("div", {
130
+ style: {
131
+ display: 'flex',
132
+ alignItems: 'center'
133
+ }
134
+ }, /*#__PURE__*/React.createElement("span", null, record[col.dataIndex]), /*#__PURE__*/React.createElement(Select, Object.assign({
135
+ className: "calc-select",
136
+ value: record["".concat(col.dataIndex, "_exp")],
137
+ onChange: onChange
138
+ }, select), currentStrategy.map(function (item) {
139
+ return /*#__PURE__*/React.createElement(Option, {
140
+ className: "calc-option",
141
+ value: item.value,
142
+ key: item.value
143
+ }, item.label);
144
+ }))));
145
+ }
146
+
147
+ return /*#__PURE__*/React.createElement("td", Object.assign({}, restParams), children);
148
+ };
149
+
150
+ export default CalcExpression;
@@ -0,0 +1,94 @@
1
+ .dnd_container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ grid-auto-rows: max-content;
5
+ overflow: hidden;
6
+ box-sizing: border-box;
7
+ appearance: none;
8
+ outline: none;
9
+ flex: 1;
10
+ border-radius: 5px;
11
+ margin-bottom: 10px;
12
+ margin-right: 10px;
13
+ transition: background-color 350ms ease;
14
+ background-color: #fff;
15
+ border: 1px solid rgba(0, 0, 0, 0.05);
16
+ font-size: 1em;
17
+ }
18
+ .dnd_container:last-child {
19
+ margin-right: 0;
20
+ }
21
+ .dnd_container.isNoneBorder {
22
+ border: 0 !important;
23
+ margin: 0;
24
+ }
25
+ .dnd_container ul {
26
+ display: flex;
27
+ flex-wrap: wrap;
28
+ list-style: none;
29
+ padding: 10px;
30
+ margin: 0;
31
+ min-height: 57px;
32
+ }
33
+ .dnd_container ul.ulClassName {
34
+ padding: 0px;
35
+ }
36
+ .dnd_container.scrollable ul {
37
+ overflow-y: auto;
38
+ }
39
+ .dnd_container.placeholder {
40
+ justify-content: center;
41
+ align-items: center;
42
+ cursor: pointer;
43
+ color: rgba(0, 0, 0, 0.5);
44
+ background-color: transparent;
45
+ border-style: dashed;
46
+ border-color: rgba(0, 0, 0, 0.08);
47
+ }
48
+ .dnd_container.placeholder:hover {
49
+ border-color: rgba(0, 0, 0, 0.15);
50
+ }
51
+ .dnd_container.hover {
52
+ background-color: #ebebeb;
53
+ }
54
+ .dnd_container.unstyled {
55
+ overflow: visible;
56
+ background-color: transparent !important;
57
+ border: none !important;
58
+ }
59
+ .dnd_container.horizontal {
60
+ width: 100%;
61
+ }
62
+ .dnd_container.horizontal ul {
63
+ grid-auto-flow: column;
64
+ }
65
+ .dnd_container.shadow {
66
+ box-shadow: 0 1px 10px 0 rgba(34, 33, 81, 0.1);
67
+ }
68
+ .dnd_container:focus-visible {
69
+ border-color: transparent;
70
+ box-shadow: 0 0 0 2px rgba(255, 255, 255, 0), 0 0px 0px 2px #4c9ffe;
71
+ }
72
+ .dnd_header {
73
+ display: flex;
74
+ padding: 5px 20px;
75
+ padding-right: 8px;
76
+ align-items: center;
77
+ justify-content: space-between;
78
+ background-color: #fff;
79
+ border-top-left-radius: 5px;
80
+ border-top-right-radius: 5px;
81
+ border-bottom: 1px solid rgba(0, 0, 0, 0.08);
82
+ }
83
+ .dnd_header:hover .Actions > * {
84
+ opacity: 1 !important;
85
+ }
86
+ .dnd_actions {
87
+ display: flex;
88
+ }
89
+ .dnd_actions > *:first-child:not(:last-child) {
90
+ opacity: 0;
91
+ }
92
+ .dnd_actions > *:first-child:not(:last-child):focus-visible {
93
+ opacity: 1;
94
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import './Container.less';
3
+ export interface Props {
4
+ children: React.ReactNode;
5
+ columns?: number;
6
+ label?: string;
7
+ style?: React.CSSProperties;
8
+ horizontal?: boolean;
9
+ hover?: boolean;
10
+ handleProps?: React.HTMLAttributes<any>;
11
+ scrollable?: boolean;
12
+ shadow?: boolean;
13
+ placeholder?: boolean;
14
+ unstyled?: boolean;
15
+ onClick?: (e: any) => void;
16
+ onRemove?: (e: any) => void;
17
+ ulClassName?: string;
18
+ isNoneBorder?: boolean;
19
+ }
20
+ export declare const Container: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,52 @@
1
+ var __rest = this && this.__rest || function (s, e) {
2
+ var t = {};
3
+
4
+ for (var p in s) {
5
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6
+ }
7
+
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
9
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+
14
+ import React, { forwardRef } from 'react';
15
+ import classNames from 'classnames'; // import {Handle, Remove} from '../Item';
16
+
17
+ import "./Container.css";
18
+ export var Container = /*#__PURE__*/forwardRef(function (_a, ref) {
19
+ var children = _a.children,
20
+ _a$columns = _a.columns,
21
+ columns = _a$columns === void 0 ? 1 : _a$columns,
22
+ handleProps = _a.handleProps,
23
+ horizontal = _a.horizontal,
24
+ hover = _a.hover,
25
+ onClick = _a.onClick,
26
+ onRemove = _a.onRemove,
27
+ label = _a.label,
28
+ placeholder = _a.placeholder,
29
+ style = _a.style,
30
+ scrollable = _a.scrollable,
31
+ shadow = _a.shadow,
32
+ unstyled = _a.unstyled,
33
+ ulClassName = _a.ulClassName,
34
+ isNoneBorder = _a.isNoneBorder,
35
+ props = __rest(_a, ["children", "columns", "handleProps", "horizontal", "hover", "onClick", "onRemove", "label", "placeholder", "style", "scrollable", "shadow", "unstyled", "ulClassName", "isNoneBorder"]);
36
+
37
+ return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
38
+ ref: ref,
39
+ style: Object.assign(Object.assign({}, style), {
40
+ '--columns': columns
41
+ }),
42
+ className: classNames('dnd_container', unstyled && 'unstyled', horizontal && 'horizontal', hover && 'hover', placeholder && 'placeholder', scrollable && 'scrollable', shadow && 'shadow', isNoneBorder && 'isNoneBorder'),
43
+ onClick: onClick,
44
+ tabIndex: onClick ? 0 : undefined
45
+ }), label ? /*#__PURE__*/React.createElement("div", {
46
+ className: 'dnd_header'
47
+ }, label, /*#__PURE__*/React.createElement("div", {
48
+ className: 'dnd_actions'
49
+ })) : null, placeholder ? children : /*#__PURE__*/React.createElement("ul", {
50
+ className: ulClassName
51
+ }, children));
52
+ });
@@ -0,0 +1,2 @@
1
+ export { Container } from './Container';
2
+ export type { Props as ContainerProps } from './Container';
@@ -0,0 +1 @@
1
+ export { Container } from './Container';
@@ -1,5 +1,37 @@
1
- declare const DndContainer: ({ children, move }: {
2
- children: any;
3
- move: any;
4
- }) => JSX.Element;
5
- export default DndContainer;
1
+ import React from 'react';
2
+ import { CancelDrop, Modifiers, UniqueIdentifier, KeyboardCoordinateGetter } from '@dnd-kit/core';
3
+ declare type Items = Record<UniqueIdentifier, UniqueIdentifier[]>;
4
+ interface Props {
5
+ adjustScale?: boolean;
6
+ cancelDrop?: CancelDrop;
7
+ columns?: number;
8
+ containerStyle?: React.CSSProperties;
9
+ coordinateGetter?: KeyboardCoordinateGetter;
10
+ getItemStyles?(args: {
11
+ value: UniqueIdentifier;
12
+ index: number;
13
+ overIndex: number;
14
+ isDragging: boolean;
15
+ containerId: UniqueIdentifier;
16
+ isSorting: boolean;
17
+ isDragOverlay: boolean;
18
+ }): React.CSSProperties;
19
+ wrapperStyle?(args: {
20
+ index: number;
21
+ }): React.CSSProperties;
22
+ itemCount?: number;
23
+ items?: Items;
24
+ handle?: boolean;
25
+ renderItem?: any;
26
+ modifiers?: Modifiers;
27
+ trashable?: boolean;
28
+ scrollable?: boolean;
29
+ children?: React.ReactNode;
30
+ updateItems?(items: Items, resume?: string): void;
31
+ rowGroupTitle?: string;
32
+ colGroupTitle?: string;
33
+ filterColumns?: any[];
34
+ }
35
+ export declare const TRASH_ID = "void";
36
+ export default function DndContainer({ adjustScale, itemCount, cancelDrop, columns, handle, items: initialItems, containerStyle, coordinateGetter, getItemStyles, wrapperStyle, modifiers, renderItem, trashable, scrollable, children, updateItems, rowGroupTitle, colGroupTitle, filterColumns }: Props): JSX.Element;
37
+ export {};