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.
- package/dist/Form/FormItem/index.d.ts +1 -0
- package/dist/LmEditTable/DndContainer.d.ts +6 -3
- package/dist/LmEditTable/EditTable.d.ts +16 -5
- package/dist/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/dist/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/dist/LmEditTable/components/index.d.ts +17 -0
- package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/dist/LmEditTable/sortableItem.d.ts +3 -2
- package/dist/LmEditTable/util.d.ts +10 -0
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/dist/LmEditTable/virtual/context.d.ts +13 -0
- package/dist/LmEditTable/virtual/index.d.ts +4 -0
- package/dist/LmTable/common/index.d.ts +10 -0
- package/dist/LmTable/components/CalcExpression.d.ts +9 -0
- package/dist/LmTable/components/Container/Container.d.ts +20 -0
- package/dist/LmTable/components/Container/index.d.ts +2 -0
- package/dist/LmTable/components/DndContainer.d.ts +37 -5
- package/dist/LmTable/components/HeaderCol.d.ts +1 -0
- package/dist/LmTable/components/Item/Item.d.ts +37 -0
- package/dist/LmTable/components/Item/components/Action/Action.d.ts +10 -0
- package/dist/LmTable/components/Item/components/Action/index.d.ts +2 -0
- package/dist/LmTable/components/Item/components/Handle/index.d.ts +4 -0
- package/dist/LmTable/components/Item/components/Remove/index.d.ts +2 -0
- package/dist/LmTable/components/Item/components/index.d.ts +3 -0
- package/dist/LmTable/components/Item/index.d.ts +2 -0
- package/dist/LmTable/components/{sortableBoxCol.d.ts → SortableBox.d.ts} +0 -0
- package/dist/LmTable/demos/{excelGroup.d.ts → draggable.d.ts} +0 -0
- package/dist/LmTable/demos/resize.d.ts +2 -0
- package/dist/LmTable/expression.d.ts +2 -1
- package/dist/LmTable/hooks/useDndItems.d.ts +13 -0
- package/dist/LmTable/hooks/useGroupDataSource.d.ts +1 -2
- package/dist/LmTable/hooks/useResizeObserver.d.ts +13 -0
- package/dist/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
- package/dist/LmTable/testDemos/group.d.ts +2 -0
- package/dist/LmTable/util.d.ts +1 -1
- package/dist/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.umd.css +367 -0
- package/dist/index.umd.js +4362 -52840
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +23 -47
- package/dist/variables.css +129 -6
- package/es/CardTable/style/index.css +3 -2
- package/es/CardTable/style/variables.css +3 -2
- package/es/CustomTableOption/columnsSort.js +41 -19
- package/es/CustomTableOption/filterSort.js +14 -6
- package/es/CustomTableOption/style/index.css +3 -0
- package/es/CustomTableOption/style/variables.css +3 -0
- package/es/Dropdown/style/index.css +1 -1
- package/es/Dropdown/style/variables.css +1 -1
- package/es/Empty/index.js +0 -1
- package/es/Form/FormItem/index.d.ts +1 -0
- package/es/Form/FormItem/index.js +31 -17
- package/es/Form/style/index.css +4 -0
- package/es/Form/style/variables.css +4 -0
- package/es/InputNumber/index.js +7 -9
- package/es/LmEditTable/DndContainer.d.ts +6 -3
- package/es/LmEditTable/DndContainer.js +70 -10
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +16 -5
- package/es/LmEditTable/EditTable.js +855 -436
- package/es/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/es/LmEditTable/components/DraggableContainer.js +39 -0
- package/es/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/es/LmEditTable/components/QuickOpetate.js +82 -0
- package/es/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/es/LmEditTable/components/bottomOpetateComponent.js +23 -0
- package/es/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/es/LmEditTable/components/customRenderEmpty.js +20 -0
- package/es/LmEditTable/components/index.d.ts +17 -0
- package/es/LmEditTable/components/index.js +8 -0
- package/es/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/es/LmEditTable/hooks/useForkRef.js +22 -0
- package/es/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/es/LmEditTable/rowSort/DndContainerRow.js +83 -0
- package/es/LmEditTable/sortableItem.d.ts +3 -2
- package/es/LmEditTable/sortableItem.js +16 -4
- package/es/LmEditTable/sortableItemCol.js +40 -10
- package/es/LmEditTable/style/index.css +105 -1
- package/es/LmEditTable/style/variables.css +105 -1
- package/es/LmEditTable/util.d.ts +10 -0
- package/es/LmEditTable/util.js +162 -9
- package/es/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow.js +148 -0
- package/es/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow2.js +62 -0
- package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualTable.js +64 -0
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
- package/es/LmEditTable/virtual/context.d.ts +13 -0
- package/es/LmEditTable/virtual/context.js +66 -0
- package/es/LmEditTable/virtual/index.d.ts +4 -0
- package/es/LmEditTable/virtual/index.js +4 -0
- package/es/LmTable/Table.js +269 -163
- package/es/LmTable/common/index.d.ts +10 -0
- package/es/LmTable/common/index.js +38 -0
- package/es/LmTable/components/CalcExpression.d.ts +9 -0
- package/es/LmTable/components/CalcExpression.js +150 -0
- package/es/LmTable/components/Container/Container.css +94 -0
- package/es/LmTable/components/Container/Container.d.ts +20 -0
- package/es/LmTable/components/Container/Container.js +52 -0
- package/es/LmTable/components/Container/index.d.ts +2 -0
- package/es/LmTable/components/Container/index.js +1 -0
- package/es/LmTable/components/DndContainer.d.ts +37 -5
- package/es/LmTable/components/DndContainer.js +704 -24
- package/es/LmTable/components/HeaderCol.js +61 -0
- package/es/LmTable/components/Item/Item.css +113 -0
- package/es/LmTable/components/Item/Item.d.ts +37 -0
- package/es/LmTable/components/Item/Item.js +88 -0
- package/es/LmTable/components/Item/components/Action/Action.css +41 -0
- package/es/LmTable/components/Item/components/Action/Action.d.ts +10 -0
- package/es/LmTable/components/Item/components/Action/Action.js +35 -0
- package/es/LmTable/components/Item/components/Action/index.d.ts +2 -0
- package/es/LmTable/components/Item/components/Action/index.js +1 -0
- package/es/LmTable/components/Item/components/Handle/index.d.ts +4 -0
- package/es/LmTable/components/Item/components/Handle/index.js +15 -0
- package/es/LmTable/components/Item/components/Remove/index.d.ts +2 -0
- package/es/LmTable/components/Item/components/Remove/index.js +16 -0
- package/es/LmTable/components/Item/components/index.d.ts +3 -0
- package/es/LmTable/components/Item/components/index.js +3 -0
- package/es/LmTable/components/Item/index.d.ts +2 -0
- package/es/LmTable/components/Item/index.js +2 -0
- package/es/LmTable/components/{sortableBoxCol.js → SortableBox.js} +0 -0
- package/es/LmTable/expression.d.ts +2 -1
- package/es/LmTable/expression.js +92 -16
- package/es/LmTable/hooks/useDndItems.d.ts +13 -0
- package/es/LmTable/hooks/useDndItems.js +234 -0
- package/es/LmTable/hooks/useGroupDataSource.js +2 -24
- package/es/LmTable/hooks/useResizeObserver.d.ts +13 -0
- package/es/LmTable/hooks/useResizeObserver.js +49 -0
- package/es/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
- package/es/LmTable/multipleContainersKeyboardCoordinates.js +117 -0
- package/es/LmTable/style/index.css +13 -2
- package/es/LmTable/style/variables.css +13 -2
- package/es/LmTable/testDemos/group.js +131 -0
- package/es/LmTable/util.js +22 -2
- package/es/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/es/LmTable/virTual/VirtualRow.js +82 -48
- package/es/LmTable/virTual/VirtualTable.js +43 -11
- package/es/LmTable/virTual/context.js +14 -2
- package/es/LmUpload/fns/index.js +1 -1
- package/es/Modal/index.js +10 -3
- package/es/Radio/index.js +9 -1
- package/es/Switch/index.js +7 -2
- package/es/hooks/useEvent/index.js +1 -1
- package/es/index.d.ts +1 -2
- package/es/locale-provider/index.js +1 -1
- package/es/styles/variables.css +129 -6
- package/lib/CardTable/style/index.css +3 -2
- package/lib/CardTable/style/variables.css +3 -2
- package/lib/CustomTableOption/columnsSort.js +48 -23
- package/lib/CustomTableOption/filterSort.js +19 -10
- package/lib/CustomTableOption/style/index.css +3 -0
- package/lib/CustomTableOption/style/variables.css +3 -0
- package/lib/Dropdown/style/index.css +1 -1
- package/lib/Dropdown/style/variables.css +1 -1
- package/lib/Empty/index.js +0 -1
- package/lib/Form/FormItem/index.d.ts +1 -0
- package/lib/Form/FormItem/index.js +32 -17
- package/lib/Form/style/index.css +4 -0
- package/lib/Form/style/variables.css +4 -0
- package/lib/InputNumber/index.js +9 -9
- package/lib/LmEditTable/DndContainer.d.ts +6 -3
- package/lib/LmEditTable/DndContainer.js +74 -9
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +16 -5
- package/lib/LmEditTable/EditTable.js +853 -433
- package/lib/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/lib/LmEditTable/components/DraggableContainer.js +52 -0
- package/lib/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/lib/LmEditTable/components/QuickOpetate.js +96 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.js +34 -0
- package/lib/LmEditTable/components/customRenderEmpty.d.ts +2 -0
- package/lib/LmEditTable/components/customRenderEmpty.js +32 -0
- package/lib/LmEditTable/components/index.d.ts +17 -0
- package/lib/LmEditTable/components/index.js +45 -0
- package/lib/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/lib/LmEditTable/hooks/useForkRef.js +29 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.js +100 -0
- package/lib/LmEditTable/sortableItem.d.ts +3 -2
- package/lib/LmEditTable/sortableItem.js +19 -5
- package/lib/LmEditTable/sortableItemCol.js +37 -8
- package/lib/LmEditTable/style/index.css +105 -1
- package/lib/LmEditTable/style/variables.css +105 -1
- package/lib/LmEditTable/util.d.ts +10 -0
- package/lib/LmEditTable/util.js +171 -8
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow.js +164 -0
- package/lib/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow2.js +78 -0
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualTable.js +81 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
- package/lib/LmEditTable/virtual/context.d.ts +13 -0
- package/lib/LmEditTable/virtual/context.js +76 -0
- package/lib/LmEditTable/virtual/index.d.ts +4 -0
- package/lib/LmEditTable/virtual/index.js +31 -0
- package/lib/LmTable/Table.js +269 -163
- package/lib/LmTable/common/index.d.ts +10 -0
- package/lib/LmTable/common/index.js +48 -0
- package/lib/LmTable/components/CalcExpression.d.ts +9 -0
- package/lib/LmTable/components/CalcExpression.js +166 -0
- package/lib/LmTable/components/Container/Container.css +94 -0
- package/lib/LmTable/components/Container/Container.d.ts +20 -0
- package/lib/LmTable/components/Container/Container.js +66 -0
- package/lib/LmTable/components/Container/index.d.ts +2 -0
- package/lib/LmTable/components/Container/index.js +13 -0
- package/lib/LmTable/components/DndContainer.d.ts +37 -5
- package/lib/LmTable/components/DndContainer.js +714 -26
- package/lib/LmTable/components/HeaderCol.js +61 -0
- package/lib/LmTable/components/Item/Item.css +113 -0
- package/lib/LmTable/components/Item/Item.d.ts +37 -0
- package/lib/LmTable/components/Item/Item.js +104 -0
- package/lib/LmTable/components/Item/components/Action/Action.css +41 -0
- package/lib/LmTable/components/Item/components/Action/Action.d.ts +10 -0
- package/lib/LmTable/components/Item/components/Action/Action.js +50 -0
- package/lib/LmTable/components/Item/components/Action/index.d.ts +2 -0
- package/lib/LmTable/components/Item/components/Action/index.js +13 -0
- package/lib/LmTable/components/Item/components/Handle/index.d.ts +4 -0
- package/lib/LmTable/components/Item/components/Handle/index.js +27 -0
- package/lib/LmTable/components/Item/components/Remove/index.d.ts +2 -0
- package/lib/LmTable/components/Item/components/Remove/index.js +27 -0
- package/lib/LmTable/components/Item/components/index.d.ts +3 -0
- package/lib/LmTable/components/Item/components/index.js +31 -0
- package/lib/LmTable/components/Item/index.d.ts +2 -0
- package/lib/LmTable/components/Item/index.js +33 -0
- package/lib/LmTable/components/{sortableBoxCol.js → SortableBox.js} +0 -0
- package/lib/LmTable/expression.d.ts +2 -1
- package/lib/LmTable/expression.js +96 -17
- package/lib/LmTable/hooks/useDndItems.d.ts +13 -0
- package/lib/LmTable/hooks/useDndItems.js +247 -0
- package/lib/LmTable/hooks/useGroupDataSource.js +2 -24
- package/lib/LmTable/hooks/useResizeObserver.d.ts +13 -0
- package/lib/LmTable/hooks/useResizeObserver.js +61 -0
- package/lib/LmTable/multipleContainersKeyboardCoordinates.d.ts +3 -0
- package/lib/LmTable/multipleContainersKeyboardCoordinates.js +126 -0
- package/lib/LmTable/style/index.css +13 -2
- package/lib/LmTable/style/variables.css +13 -2
- package/lib/LmTable/testDemos/group.js +131 -0
- package/lib/LmTable/util.js +22 -2
- package/lib/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/lib/LmTable/virTual/VirtualRow.js +81 -48
- package/lib/LmTable/virTual/VirtualTable.js +43 -10
- package/lib/LmTable/virTual/context.js +14 -2
- package/lib/LmUpload/fns/index.js +1 -1
- package/lib/Modal/index.js +10 -3
- package/lib/Radio/index.js +9 -1
- package/lib/Switch/index.js +9 -2
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/locale-provider/index.js +1 -1
- package/lib/styles/variables.css +129 -6
- package/package.json +3 -5
- package/dist/LmTable/components/sortableItemCol.d.ts +0 -1
- package/es/LmTable/components/sortableItemCol.js +0 -56
- package/lib/LmTable/components/sortableItemCol.js +0 -56
|
@@ -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,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 @@
|
|
|
1
|
+
export { Container } from './Container';
|
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {};
|