linkmore-design 1.1.27-alpha.0 → 1.1.27
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/LmEditTable/DndContainer.d.ts +3 -6
- package/dist/LmEditTable/EditTable.d.ts +5 -10
- package/dist/LmEditTable/sortableItem.d.ts +2 -3
- package/dist/LmEditTable/util.d.ts +0 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.umd.js +527 -1133
- package/dist/index.umd.min.js +8 -8
- package/dist/variables.css +0 -65
- package/es/InputNumber/index.js +9 -7
- package/es/LmEditTable/DndContainer.d.ts +3 -6
- package/es/LmEditTable/DndContainer.js +10 -70
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +5 -10
- package/es/LmEditTable/EditTable.js +360 -352
- package/es/LmEditTable/sortableItem.d.ts +2 -3
- package/es/LmEditTable/sortableItem.js +4 -16
- package/es/LmEditTable/sortableItemCol.js +10 -40
- package/es/LmEditTable/style/index.css +0 -65
- package/es/LmEditTable/style/variables.css +0 -65
- package/es/LmEditTable/util.d.ts +0 -7
- package/es/LmEditTable/util.js +7 -92
- package/es/LmTable/virTual/VirtualRow.js +14 -12
- package/es/hooks/useEvent/index.js +1 -1
- package/es/index.d.ts +2 -1
- package/es/styles/variables.css +0 -65
- package/lib/InputNumber/index.js +9 -9
- package/lib/LmEditTable/DndContainer.d.ts +3 -6
- package/lib/LmEditTable/DndContainer.js +9 -74
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +5 -10
- package/lib/LmEditTable/EditTable.js +357 -349
- package/lib/LmEditTable/sortableItem.d.ts +2 -3
- package/lib/LmEditTable/sortableItem.js +5 -19
- package/lib/LmEditTable/sortableItemCol.js +8 -37
- package/lib/LmEditTable/style/index.css +0 -65
- package/lib/LmEditTable/style/variables.css +0 -65
- package/lib/LmEditTable/util.d.ts +0 -7
- package/lib/LmEditTable/util.js +6 -97
- package/lib/LmTable/virTual/VirtualRow.js +14 -12
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/styles/variables.css +0 -65
- package/package.json +9 -7
- package/dist/LmEditTable/components/DraggableContainer.d.ts +0 -10
- package/dist/LmEditTable/components/QuickOpetate.d.ts +0 -12
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +0 -13
- package/dist/LmEditTable/components/index.d.ts +0 -16
- package/dist/LmEditTable/hooks/useForkRef.d.ts +0 -2
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +0 -10
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +0 -7
- package/dist/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +0 -3
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
- package/dist/LmEditTable/virtual/context.d.ts +0 -13
- package/dist/LmEditTable/virtual/index.d.ts +0 -4
- package/es/LmEditTable/components/DraggableContainer.d.ts +0 -10
- package/es/LmEditTable/components/DraggableContainer.js +0 -39
- package/es/LmEditTable/components/QuickOpetate.d.ts +0 -12
- package/es/LmEditTable/components/QuickOpetate.js +0 -82
- package/es/LmEditTable/components/bottomOpetateComponent.d.ts +0 -13
- package/es/LmEditTable/components/bottomOpetateComponent.js +0 -23
- package/es/LmEditTable/components/index.d.ts +0 -16
- package/es/LmEditTable/components/index.js +0 -7
- package/es/LmEditTable/hooks/useForkRef.d.ts +0 -2
- package/es/LmEditTable/hooks/useForkRef.js +0 -22
- package/es/LmEditTable/rowSort/DndContainerRow.d.ts +0 -10
- package/es/LmEditTable/rowSort/DndContainerRow.js +0 -81
- package/es/LmEditTable/virtual/VirtualRow.d.ts +0 -7
- package/es/LmEditTable/virtual/VirtualRow.js +0 -62
- package/es/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/es/LmEditTable/virtual/VirtualRowBack.js +0 -100
- package/es/LmEditTable/virtual/VirtualTable.d.ts +0 -3
- package/es/LmEditTable/virtual/VirtualTable.js +0 -54
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
- package/es/LmEditTable/virtual/VirtualWrapper.js +0 -60
- package/es/LmEditTable/virtual/context.d.ts +0 -13
- package/es/LmEditTable/virtual/context.js +0 -54
- package/es/LmEditTable/virtual/index.d.ts +0 -4
- package/es/LmEditTable/virtual/index.js +0 -4
- package/lib/LmEditTable/components/DraggableContainer.d.ts +0 -10
- package/lib/LmEditTable/components/DraggableContainer.js +0 -52
- package/lib/LmEditTable/components/QuickOpetate.d.ts +0 -12
- package/lib/LmEditTable/components/QuickOpetate.js +0 -96
- package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +0 -13
- package/lib/LmEditTable/components/bottomOpetateComponent.js +0 -34
- package/lib/LmEditTable/components/index.d.ts +0 -16
- package/lib/LmEditTable/components/index.js +0 -37
- package/lib/LmEditTable/hooks/useForkRef.d.ts +0 -2
- package/lib/LmEditTable/hooks/useForkRef.js +0 -29
- package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +0 -10
- package/lib/LmEditTable/rowSort/DndContainerRow.js +0 -99
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +0 -7
- package/lib/LmEditTable/virtual/VirtualRow.js +0 -78
- package/lib/LmEditTable/virtual/VirtualRowBack.d.ts +0 -6
- package/lib/LmEditTable/virtual/VirtualRowBack.js +0 -113
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +0 -3
- package/lib/LmEditTable/virtual/VirtualTable.js +0 -71
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +0 -3
- package/lib/LmEditTable/virtual/VirtualWrapper.js +0 -73
- package/lib/LmEditTable/virtual/context.d.ts +0 -13
- package/lib/LmEditTable/virtual/context.js +0 -64
- package/lib/LmEditTable/virtual/index.d.ts +0 -4
- package/lib/LmEditTable/virtual/index.js +0 -31
package/dist/index.umd.js
CHANGED
|
@@ -188747,7 +188747,8 @@
|
|
|
188747
188747
|
|
|
188748
188748
|
var _excluded$1j = ["children", "className", "disabled", "size"];
|
|
188749
188749
|
var prefixCls$3 = 'lm_input-number';
|
|
188750
|
-
|
|
188750
|
+
|
|
188751
|
+
var LMInputNumber = function LMInputNumber(props) {
|
|
188751
188752
|
var children = props.children,
|
|
188752
188753
|
className = props.className,
|
|
188753
188754
|
customDisabled = props.disabled,
|
|
@@ -188761,24 +188762,24 @@
|
|
|
188761
188762
|
var size = React__default['default'].useContext(SizeContext$1);
|
|
188762
188763
|
var mergeSize = customizeSize || size;
|
|
188763
188764
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread(_objectSpread({
|
|
188764
|
-
ref: ref,
|
|
188765
188765
|
className: classnames(className, prefixCls$3),
|
|
188766
188766
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
188767
188767
|
}, rest), {}, {
|
|
188768
188768
|
size: mergeSize,
|
|
188769
188769
|
disabled: mergedDisabled
|
|
188770
188770
|
}));
|
|
188771
|
-
}
|
|
188771
|
+
};
|
|
188772
|
+
|
|
188772
188773
|
var CInputNumber = LMInputNumber;
|
|
188773
|
-
|
|
188774
|
+
|
|
188775
|
+
CInputNumber.Price = function (props) {
|
|
188774
188776
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread({
|
|
188775
188777
|
prefix: "\uFFE5",
|
|
188776
|
-
ref: ref,
|
|
188777
188778
|
formatter: function formatter(value) {
|
|
188778
188779
|
return "".concat(value).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
188779
188780
|
}
|
|
188780
188781
|
}, props));
|
|
188781
|
-
}
|
|
188782
|
+
};
|
|
188782
188783
|
|
|
188783
188784
|
var getRenderPropValue = function getRenderPropValue(propValue) {
|
|
188784
188785
|
if (!propValue) {
|
|
@@ -233638,14 +233639,6 @@
|
|
|
233638
233639
|
return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);
|
|
233639
233640
|
};
|
|
233640
233641
|
|
|
233641
|
-
const restrictToVerticalAxis = ({
|
|
233642
|
-
transform
|
|
233643
|
-
}) => {
|
|
233644
|
-
return { ...transform,
|
|
233645
|
-
x: 0
|
|
233646
|
-
};
|
|
233647
|
-
};
|
|
233648
|
-
|
|
233649
233642
|
var DndContainer = function DndContainer(_ref) {
|
|
233650
233643
|
var children = _ref.children,
|
|
233651
233644
|
move = _ref.move;
|
|
@@ -285987,16 +285980,12 @@
|
|
|
285987
285980
|
var rowHeight = state.rowHeight,
|
|
285988
285981
|
totalLen = state.totalLen;
|
|
285989
285982
|
var virtualItems = instance.columnVirtual.virtualItems;
|
|
285990
|
-
var trRef = React.useRef(null); //
|
|
285983
|
+
var trRef = React.useRef(null); // 列长度
|
|
285991
285984
|
|
|
285992
285985
|
var columnsLen = React.useMemo(function () {
|
|
285993
|
-
var _children$
|
|
285994
|
-
|
|
285995
|
-
return (_children$filter$leng = children === null || children === void 0 ? void 0 : children.filter(function (v) {
|
|
285996
|
-
var _v$props, _v$props2;
|
|
285986
|
+
var _children$length;
|
|
285997
285987
|
|
|
285998
|
-
|
|
285999
|
-
}).length) !== null && _children$filter$leng !== void 0 ? _children$filter$leng : 0; // return children?.length ?? 0
|
|
285988
|
+
return (_children$length = children === null || children === void 0 ? void 0 : children.length) !== null && _children$length !== void 0 ? _children$length : 0;
|
|
286000
285989
|
}, [children]);
|
|
286001
285990
|
React.useEffect(function () {
|
|
286002
285991
|
if (state.columnsLen !== columnsLen) {
|
|
@@ -286045,20 +286034,26 @@
|
|
|
286045
286034
|
fixedRight: [],
|
|
286046
286035
|
columns: []
|
|
286047
286036
|
});
|
|
286048
|
-
}, [children]); //
|
|
286037
|
+
}, [children]); // 截取非固定列
|
|
286038
|
+
|
|
286039
|
+
var resetVirtualItems = React.useMemo(function () {
|
|
286040
|
+
var fixedLeft = fixedColumns.fixedLeft,
|
|
286041
|
+
columns = fixedColumns.columns;
|
|
286042
|
+
return virtualItems.slice(fixedLeft.length, fixedLeft.length + columns.length);
|
|
286043
|
+
}, [fixedColumns, virtualItems]); // 横线单元格合并
|
|
286049
286044
|
|
|
286050
286045
|
var colSpan = React.useMemo(function () {
|
|
286051
|
-
var
|
|
286046
|
+
var _resetVirtualItems$;
|
|
286052
286047
|
|
|
286053
|
-
|
|
286054
|
-
|
|
286055
|
-
|
|
286048
|
+
var startIndex = (resetVirtualItems === null || resetVirtualItems === void 0 ? void 0 : (_resetVirtualItems$ = resetVirtualItems[0]) === null || _resetVirtualItems$ === void 0 ? void 0 : _resetVirtualItems$.index) || 0;
|
|
286049
|
+
return startIndex ? startIndex - fixedColumns.fixedLeft.length : startIndex;
|
|
286050
|
+
}, [fixedColumns, resetVirtualItems]);
|
|
286056
286051
|
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetProps), {}, {
|
|
286057
286052
|
ref: Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef
|
|
286058
286053
|
}), fixedColumns.fixedLeft, !!colSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
286059
286054
|
colSpan: colSpan
|
|
286060
|
-
}),
|
|
286061
|
-
return
|
|
286055
|
+
}), resetVirtualItems.map(function (virtualCol) {
|
|
286056
|
+
return children[virtualCol.index];
|
|
286062
286057
|
}), fixedColumns.fixedRight);
|
|
286063
286058
|
});
|
|
286064
286059
|
|
|
@@ -287670,12 +287665,7 @@
|
|
|
287670
287665
|
|
|
287671
287666
|
return React.useCallback(function () {
|
|
287672
287667
|
var fn = handlerRef.current;
|
|
287673
|
-
|
|
287674
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
287675
|
-
args[_key] = arguments[_key];
|
|
287676
|
-
}
|
|
287677
|
-
|
|
287678
|
-
return fn === null || fn === void 0 ? void 0 : fn.apply(void 0, args);
|
|
287668
|
+
return fn.apply(void 0, arguments);
|
|
287679
287669
|
}, []);
|
|
287680
287670
|
}
|
|
287681
287671
|
|
|
@@ -312664,59 +312654,16 @@
|
|
|
312664
312654
|
|
|
312665
312655
|
Form$4.Wrapper = Wrapper;
|
|
312666
312656
|
|
|
312667
|
-
var
|
|
312668
|
-
var
|
|
312669
|
-
|
|
312670
|
-
activeId = instance.activeId,
|
|
312671
|
-
options = instance.options;
|
|
312672
|
-
var item = activeId && options.find(function (v) {
|
|
312673
|
-
return v.dataIndex === activeId;
|
|
312674
|
-
});
|
|
312675
|
-
return /*#__PURE__*/React__default['default'].createElement(DragOverlay, {
|
|
312676
|
-
adjustScale: false
|
|
312677
|
-
}, isDragging ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
312678
|
-
className: "lm_editable_col_drag"
|
|
312679
|
-
}, item === null || item === void 0 ? void 0 : item.title) : null);
|
|
312680
|
-
}); // 可拖拽容器
|
|
312681
|
-
|
|
312682
|
-
var DndContainer$1 = function DndContainer(_ref2) {
|
|
312683
|
-
var children = _ref2.children,
|
|
312684
|
-
move = _ref2.move,
|
|
312685
|
-
options = _ref2.options,
|
|
312686
|
-
rowKey = _ref2.rowKey;
|
|
312687
|
-
|
|
312688
|
-
var _React$useState = React__default['default'].useState(false),
|
|
312689
|
-
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
312690
|
-
isDragging = _React$useState2[0],
|
|
312691
|
-
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
312692
|
-
|
|
312693
|
-
|
|
312694
|
-
var _React$useState3 = React__default['default'].useState(null),
|
|
312695
|
-
_React$useState4 = _slicedToArray$1(_React$useState3, 2),
|
|
312696
|
-
activeId = _React$useState4[0],
|
|
312697
|
-
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
312698
|
-
|
|
312699
|
-
|
|
312657
|
+
var DndContainer$1 = function DndContainer(_ref) {
|
|
312658
|
+
var children = _ref.children,
|
|
312659
|
+
move = _ref.move;
|
|
312700
312660
|
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
312701
312661
|
coordinateGetter: sortableKeyboardCoordinates
|
|
312702
|
-
})); //
|
|
312703
|
-
|
|
312704
|
-
var handleDragStart = function handleDragStart(_ref3) {
|
|
312705
|
-
var active = _ref3.active;
|
|
312706
|
-
setIsDragging(true);
|
|
312707
|
-
|
|
312708
|
-
if (!active) {
|
|
312709
|
-
return;
|
|
312710
|
-
}
|
|
312711
|
-
|
|
312712
|
-
setActiveId(active.id);
|
|
312713
|
-
}; // 拖拽结束
|
|
312714
|
-
|
|
312662
|
+
})); // 拖拽结束
|
|
312715
312663
|
|
|
312716
312664
|
var handleDragEnd = function handleDragEnd(event) {
|
|
312717
312665
|
var active = event.active,
|
|
312718
|
-
over = event.over;
|
|
312719
|
-
setActiveId(null); // 未移入时触发
|
|
312666
|
+
over = event.over; // 未移入时触发
|
|
312720
312667
|
|
|
312721
312668
|
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
312722
312669
|
return;
|
|
@@ -312728,267 +312675,39 @@
|
|
|
312728
312675
|
}
|
|
312729
312676
|
};
|
|
312730
312677
|
|
|
312731
|
-
var instance = {
|
|
312732
|
-
isDragging: isDragging,
|
|
312733
|
-
activeId: activeId,
|
|
312734
|
-
options: options,
|
|
312735
|
-
rowKey: rowKey,
|
|
312736
|
-
children: children,
|
|
312737
|
-
move: move,
|
|
312738
|
-
items: options === null || options === void 0 ? void 0 : options.map(function (v) {
|
|
312739
|
-
return v[rowKey];
|
|
312740
|
-
})
|
|
312741
|
-
};
|
|
312742
312678
|
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
312743
312679
|
sensors: sensors,
|
|
312744
312680
|
collisionDetection: closestCenter,
|
|
312745
|
-
onDragStart: handleDragStart,
|
|
312746
312681
|
onDragEnd: handleDragEnd,
|
|
312747
|
-
onDragCancel: function onDragCancel() {
|
|
312748
|
-
return setActiveId(null);
|
|
312749
|
-
},
|
|
312750
312682
|
modifiers: [restrictToParentElement]
|
|
312751
|
-
}, children
|
|
312752
|
-
instance: instance
|
|
312753
|
-
}));
|
|
312683
|
+
}, children);
|
|
312754
312684
|
};
|
|
312755
312685
|
|
|
312756
|
-
var DndContainer$2 = /*#__PURE__*/React.memo(DndContainer$1);
|
|
312757
|
-
|
|
312758
312686
|
var SortableBox$1 = function SortableBox(_ref) {
|
|
312759
312687
|
var items = _ref.items,
|
|
312760
312688
|
children = _ref.children;
|
|
312761
312689
|
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
312762
312690
|
items: items,
|
|
312763
|
-
strategy:
|
|
312691
|
+
strategy: verticalListSortingStrategy
|
|
312764
312692
|
}, children);
|
|
312765
312693
|
};
|
|
312766
312694
|
|
|
312767
|
-
var
|
|
312768
|
-
|
|
312769
|
-
|
|
312770
|
-
|
|
312771
|
-
|
|
312772
|
-
|
|
312773
|
-
|
|
312774
|
-
return React.useContext(TableContext$2);
|
|
312775
|
-
};
|
|
312776
|
-
|
|
312777
|
-
var initialState$3 = {
|
|
312778
|
-
// 行高度
|
|
312779
|
-
rowHeight: 0,
|
|
312780
|
-
columnsLen: 0,
|
|
312781
|
-
// 总行数
|
|
312782
|
-
totalLen: 0
|
|
312783
|
-
};
|
|
312784
|
-
|
|
312785
|
-
var reducer$5 = function reducer(state, action) {
|
|
312786
|
-
var totalLen = action.totalLen,
|
|
312787
|
-
columnsLen = action.columnsLen,
|
|
312788
|
-
rowHeight = action.rowHeight;
|
|
312789
|
-
|
|
312790
|
-
switch (action.type) {
|
|
312791
|
-
// 数据数量
|
|
312792
|
-
case 'changeTotalLen':
|
|
312793
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312794
|
-
totalLen: totalLen
|
|
312795
|
-
});
|
|
312796
|
-
// 列数量
|
|
312797
|
-
|
|
312798
|
-
case 'changeColumnsLen':
|
|
312799
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312800
|
-
columnsLen: columnsLen
|
|
312801
|
-
});
|
|
312802
|
-
// 初始化行高度
|
|
312803
|
-
|
|
312804
|
-
case 'initHeight':
|
|
312805
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312806
|
-
rowHeight: rowHeight
|
|
312807
|
-
});
|
|
312808
|
-
|
|
312809
|
-
default:
|
|
312810
|
-
throw new Error();
|
|
312811
|
-
}
|
|
312812
|
-
};
|
|
312813
|
-
|
|
312814
|
-
var useRealive$1 = function useRealive() {
|
|
312815
|
-
return React.useReducer(reducer$5, initialState$3);
|
|
312695
|
+
var SortableBox$2 = function SortableBox(_ref) {
|
|
312696
|
+
var items = _ref.items,
|
|
312697
|
+
children = _ref.children;
|
|
312698
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
312699
|
+
items: items,
|
|
312700
|
+
strategy: horizontalListSortingStrategy
|
|
312701
|
+
}, children);
|
|
312816
312702
|
};
|
|
312817
312703
|
|
|
312818
|
-
var
|
|
312819
|
-
var _bodyRef$current, _bodyRef$current2, _tableProps$children$3, _tableProps$children$4;
|
|
312820
|
-
|
|
312821
|
-
var bodyRef = React.useRef(null);
|
|
312822
|
-
|
|
312823
|
-
var _useRealive = useRealive$1(),
|
|
312824
|
-
_useRealive2 = _slicedToArray$1(_useRealive, 2),
|
|
312825
|
-
state = _useRealive2[0],
|
|
312826
|
-
dispatch = _useRealive2[1]; // { totalSize, virtualItems }
|
|
312827
|
-
|
|
312828
|
-
|
|
312829
|
-
var rowVirtual = useVirtual({
|
|
312830
|
-
size: state.totalLen,
|
|
312831
|
-
// 绑定父节点
|
|
312832
|
-
parentRef: {
|
|
312833
|
-
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current = bodyRef.current) === null || _bodyRef$current === void 0 ? void 0 : _bodyRef$current.parentNode
|
|
312834
|
-
},
|
|
312835
|
-
estimateSize: React__default['default'].useCallback(function () {
|
|
312836
|
-
return state.rowHeight;
|
|
312837
|
-
}, [state.rowHeight]),
|
|
312838
|
-
overscan: 5
|
|
312839
|
-
});
|
|
312840
|
-
var columnVirtual = useVirtual({
|
|
312841
|
-
horizontal: true,
|
|
312842
|
-
size: state.columnsLen,
|
|
312843
|
-
parentRef: {
|
|
312844
|
-
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current2 = bodyRef.current) === null || _bodyRef$current2 === void 0 ? void 0 : _bodyRef$current2.parentNode
|
|
312845
|
-
},
|
|
312846
|
-
estimateSize: React__default['default'].useCallback(function (i) {
|
|
312847
|
-
var _tableProps$children$, _tableProps$children$2;
|
|
312848
|
-
|
|
312849
|
-
return tableProps === null || tableProps === void 0 ? void 0 : (_tableProps$children$ = tableProps.children[0]) === null || _tableProps$children$ === void 0 ? void 0 : (_tableProps$children$2 = _tableProps$children$.props) === null || _tableProps$children$2 === void 0 ? void 0 : _tableProps$children$2.colWidths[i];
|
|
312850
|
-
}, [(_tableProps$children$3 = tableProps.children[0]) === null || _tableProps$children$3 === void 0 ? void 0 : (_tableProps$children$4 = _tableProps$children$3.props) === null || _tableProps$children$4 === void 0 ? void 0 : _tableProps$children$4.colWidths]),
|
|
312851
|
-
overscan: 5
|
|
312852
|
-
});
|
|
312853
|
-
var instance = {
|
|
312854
|
-
rowVirtual: rowVirtual,
|
|
312855
|
-
columnVirtual: columnVirtual
|
|
312856
|
-
};
|
|
312857
|
-
return /*#__PURE__*/React__default['default'].createElement(TableContext$2.Provider, {
|
|
312858
|
-
value: {
|
|
312859
|
-
state: state,
|
|
312860
|
-
dispatch: dispatch,
|
|
312861
|
-
instance: instance
|
|
312862
|
-
}
|
|
312863
|
-
}, /*#__PURE__*/React__default['default'].createElement("table", _objectSpread({
|
|
312864
|
-
ref: bodyRef
|
|
312865
|
-
}, tableProps)));
|
|
312866
|
-
});
|
|
312867
|
-
|
|
312868
|
-
var _excluded$2P = ["children"];
|
|
312869
|
-
var VirtualWrapper$1 = /*#__PURE__*/React__default['default'].memo(function (wrapperProps) {
|
|
312870
|
-
var _virtualItems$, _virtualItems;
|
|
312871
|
-
|
|
312872
|
-
var children = wrapperProps.children,
|
|
312873
|
-
resetProps = _objectWithoutProperties$1(wrapperProps, _excluded$2P);
|
|
312874
|
-
|
|
312875
|
-
var _useStore = useStore$1(),
|
|
312876
|
-
state = _useStore.state,
|
|
312877
|
-
dispatch = _useStore.dispatch,
|
|
312878
|
-
instance = _useStore.instance;
|
|
312879
|
-
|
|
312880
|
-
var _instance$rowVirtual = instance.rowVirtual,
|
|
312881
|
-
virtualItems = _instance$rowVirtual.virtualItems,
|
|
312882
|
-
totalSize = _instance$rowVirtual.totalSize;
|
|
312883
|
-
var contents = React.useMemo(function () {
|
|
312884
|
-
return children[1];
|
|
312885
|
-
}, [children]);
|
|
312886
|
-
var contentsLen = React.useMemo(function () {
|
|
312887
|
-
var _contents$length;
|
|
312888
|
-
|
|
312889
|
-
return (_contents$length = contents === null || contents === void 0 ? void 0 : contents.length) !== null && _contents$length !== void 0 ? _contents$length : 0;
|
|
312890
|
-
}, [contents]);
|
|
312891
|
-
React.useEffect(function () {
|
|
312892
|
-
if (state.totalLen !== contentsLen) {
|
|
312893
|
-
dispatch({
|
|
312894
|
-
type: 'changeTotalLen',
|
|
312895
|
-
totalLen: contentsLen !== null && contentsLen !== void 0 ? contentsLen : 0
|
|
312896
|
-
});
|
|
312897
|
-
}
|
|
312898
|
-
}, [contentsLen, dispatch, state.totalLen]);
|
|
312899
|
-
var paddingTop = virtualItems.length > 0 ? (virtualItems === null || virtualItems === void 0 ? void 0 : (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.start) || 0 : 0;
|
|
312900
|
-
var paddingBottom = virtualItems.length > 0 ? totalSize - ((virtualItems === null || virtualItems === void 0 ? void 0 : (_virtualItems = virtualItems[virtualItems.length - 1]) === null || _virtualItems === void 0 ? void 0 : _virtualItems.end) || 0) : 0;
|
|
312901
|
-
return /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, resetProps), paddingTop > 0 && /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
312902
|
-
style: {
|
|
312903
|
-
height: "".concat(paddingTop, "px")
|
|
312904
|
-
}
|
|
312905
|
-
})), children[0], virtualItems.map(function (virtualRow) {
|
|
312906
|
-
return contents[virtualRow.index];
|
|
312907
|
-
}), paddingBottom > 0 && /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
312908
|
-
style: {
|
|
312909
|
-
height: "".concat(paddingBottom, "px")
|
|
312910
|
-
}
|
|
312911
|
-
})));
|
|
312912
|
-
});
|
|
312913
|
-
|
|
312914
|
-
function setRef(ref, value) {
|
|
312915
|
-
if (typeof ref === 'function') {
|
|
312916
|
-
ref(value);
|
|
312917
|
-
} else if (ref) {
|
|
312918
|
-
ref.current = value;
|
|
312919
|
-
}
|
|
312920
|
-
}
|
|
312921
|
-
|
|
312922
|
-
function useForkRef(refA, refB) {
|
|
312923
|
-
return React.useMemo(function () {
|
|
312924
|
-
if (refA == null && refB == null) {
|
|
312925
|
-
return null;
|
|
312926
|
-
}
|
|
312927
|
-
|
|
312928
|
-
return function (refValue) {
|
|
312929
|
-
setRef(refA, refValue);
|
|
312930
|
-
setRef(refB, refValue);
|
|
312931
|
-
};
|
|
312932
|
-
}, [refA, refB]);
|
|
312933
|
-
}
|
|
312934
|
-
|
|
312935
|
-
var _excluded$2Q = ["children", "pref"];
|
|
312936
|
-
var VirtualRow$1 = /*#__PURE__*/React__default['default'].memo(function (_ref, ref) {
|
|
312937
|
-
var children = _ref.children,
|
|
312938
|
-
pref = _ref.pref,
|
|
312939
|
-
resetProps = _objectWithoutProperties$1(_ref, _excluded$2Q);
|
|
312940
|
-
|
|
312941
|
-
var _useStore = useStore$1(),
|
|
312942
|
-
state = _useStore.state,
|
|
312943
|
-
dispatch = _useStore.dispatch;
|
|
312944
|
-
|
|
312945
|
-
var rowHeight = state.rowHeight,
|
|
312946
|
-
totalLen = state.totalLen;
|
|
312947
|
-
var trRef = React.useRef(null); // 列长度
|
|
312948
|
-
|
|
312949
|
-
var columnsLen = React.useMemo(function () {
|
|
312950
|
-
var _children$length;
|
|
312951
|
-
|
|
312952
|
-
return (_children$length = children === null || children === void 0 ? void 0 : children.length) !== null && _children$length !== void 0 ? _children$length : 0;
|
|
312953
|
-
}, [children]);
|
|
312954
|
-
React.useEffect(function () {
|
|
312955
|
-
if (state.columnsLen !== columnsLen) {
|
|
312956
|
-
dispatch({
|
|
312957
|
-
type: 'changeColumnsLen',
|
|
312958
|
-
columnsLen: columnsLen !== null && columnsLen !== void 0 ? columnsLen : 0
|
|
312959
|
-
});
|
|
312960
|
-
}
|
|
312961
|
-
}, [columnsLen, dispatch, state.columnsLen]);
|
|
312962
|
-
React.useEffect(function () {
|
|
312963
|
-
var initHeight = function initHeight(tempRef) {
|
|
312964
|
-
var _tempRef$current;
|
|
312965
|
-
|
|
312966
|
-
if ((tempRef === null || tempRef === void 0 ? void 0 : (_tempRef$current = tempRef.current) === null || _tempRef$current === void 0 ? void 0 : _tempRef$current.offsetHeight) && !rowHeight && totalLen) {
|
|
312967
|
-
var _tempRef$current$offs, _tempRef$current2;
|
|
312968
|
-
|
|
312969
|
-
var tempRowHeight = (_tempRef$current$offs = tempRef === null || tempRef === void 0 ? void 0 : (_tempRef$current2 = tempRef.current) === null || _tempRef$current2 === void 0 ? void 0 : _tempRef$current2.offsetHeight) !== null && _tempRef$current$offs !== void 0 ? _tempRef$current$offs : 0;
|
|
312970
|
-
dispatch({
|
|
312971
|
-
type: 'initHeight',
|
|
312972
|
-
rowHeight: tempRowHeight
|
|
312973
|
-
});
|
|
312974
|
-
}
|
|
312975
|
-
};
|
|
312976
|
-
|
|
312977
|
-
initHeight(trRef);
|
|
312978
|
-
}, [trRef, dispatch, rowHeight, totalLen, ref]);
|
|
312979
|
-
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetProps), {}, {
|
|
312980
|
-
ref: useForkRef(pref, trRef)
|
|
312981
|
-
}), children);
|
|
312982
|
-
});
|
|
312983
|
-
|
|
312984
|
-
var _excluded$2R = ["data-row-key", "children", "className", "virtual"];
|
|
312704
|
+
var _excluded$2P = ["data-row-key", "children", "className"];
|
|
312985
312705
|
|
|
312986
312706
|
var SortableItem$1 = function SortableItem(props) {
|
|
312987
312707
|
var key = props['data-row-key'],
|
|
312988
312708
|
children = props.children,
|
|
312989
312709
|
className = props.className,
|
|
312990
|
-
|
|
312991
|
-
resetField = _objectWithoutProperties$1(props, _excluded$2R);
|
|
312710
|
+
resetField = _objectWithoutProperties$1(props, _excluded$2P);
|
|
312992
312711
|
|
|
312993
312712
|
var _useSortable = useSortable({
|
|
312994
312713
|
id: key
|
|
@@ -313002,66 +312721,27 @@
|
|
|
313002
312721
|
transform: CSS.Transform.toString(transform),
|
|
313003
312722
|
transition: transition
|
|
313004
312723
|
};
|
|
313005
|
-
|
|
313006
|
-
if (!virtual) {
|
|
313007
|
-
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetField), {}, {
|
|
313008
|
-
ref: setNodeRef,
|
|
313009
|
-
key: key,
|
|
313010
|
-
style: style
|
|
313011
|
-
}, attributes), children);
|
|
313012
|
-
}
|
|
313013
|
-
|
|
313014
|
-
return /*#__PURE__*/React__default['default'].createElement(VirtualRow$1, _objectSpread(_objectSpread({}, resetField), {}, {
|
|
312724
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetField), {}, {
|
|
313015
312725
|
ref: setNodeRef,
|
|
313016
|
-
pref: setNodeRef,
|
|
313017
312726
|
key: key,
|
|
313018
312727
|
style: style
|
|
313019
312728
|
}, attributes), children);
|
|
313020
312729
|
};
|
|
313021
312730
|
|
|
313022
|
-
var
|
|
313023
|
-
|
|
313024
|
-
var _excluded$2S = ["children"];
|
|
313025
|
-
// children: React.ReactNode
|
|
313026
|
-
// }
|
|
313027
|
-
// interface ItemInstance {}
|
|
313028
|
-
// @ts-ignore
|
|
313029
|
-
|
|
312731
|
+
var _excluded$2Q = ["children"];
|
|
313030
312732
|
var Item$5 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
312733
|
+
var _children$props;
|
|
312734
|
+
|
|
313031
312735
|
var children = _ref.children,
|
|
313032
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
313033
|
-
|
|
313034
|
-
// const rProps = omit({ ...props, ...children.props }, [
|
|
313035
|
-
// 'isSticky',
|
|
313036
|
-
// 'colStart',
|
|
313037
|
-
// 'colEnd',
|
|
313038
|
-
// 'prefixCls',
|
|
313039
|
-
// 'fixLeft',
|
|
313040
|
-
// 'fixRight',
|
|
313041
|
-
// 'lastFixLeft',
|
|
313042
|
-
// 'firstFixRight',
|
|
313043
|
-
// 'lastFixRight',
|
|
313044
|
-
// 'firstFixLeft',
|
|
313045
|
-
// 'isSticky',
|
|
313046
|
-
// 'additionalProps',
|
|
313047
|
-
// 'rowType',
|
|
313048
|
-
// ])
|
|
313049
|
-
return (
|
|
313050
|
-
/*#__PURE__*/
|
|
313051
|
-
// <th {...rProps} ref={ref as any} />
|
|
313052
|
-
React__default['default'].createElement("th", _objectSpread(_objectSpread(_objectSpread({}, props), children.props), {}, {
|
|
313053
|
-
ref: ref
|
|
313054
|
-
})) // <th {...props} ref={ref as any}>
|
|
313055
|
-
// {(children as any)?.props?.children || children}
|
|
313056
|
-
// </th>
|
|
312736
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2Q);
|
|
313057
312737
|
|
|
313058
|
-
)
|
|
312738
|
+
return /*#__PURE__*/React__default['default'].createElement("th", _objectSpread(_objectSpread({}, props), {}, {
|
|
312739
|
+
ref: ref
|
|
312740
|
+
}), (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.children) || children);
|
|
313059
312741
|
});
|
|
313060
|
-
function SortableItem$
|
|
313061
|
-
var id = props.id;
|
|
313062
|
-
|
|
312742
|
+
function SortableItem$2(props) {
|
|
313063
312743
|
var _useSortable = useSortable({
|
|
313064
|
-
id: id
|
|
312744
|
+
id: props.id
|
|
313065
312745
|
}),
|
|
313066
312746
|
attributes = _useSortable.attributes,
|
|
313067
312747
|
listeners = _useSortable.listeners,
|
|
@@ -313071,9 +312751,7 @@
|
|
|
313071
312751
|
|
|
313072
312752
|
var style = {
|
|
313073
312753
|
position: 'relative',
|
|
313074
|
-
transform: CSS.Translate.toString(transform
|
|
313075
|
-
y: 0
|
|
313076
|
-
}) : transform),
|
|
312754
|
+
transform: CSS.Translate.toString(transform),
|
|
313077
312755
|
transition: transition,
|
|
313078
312756
|
touchAction: 'none',
|
|
313079
312757
|
height: '40px',
|
|
@@ -313103,7 +312781,7 @@
|
|
|
313103
312781
|
touchAction: 'none',
|
|
313104
312782
|
cursor: 'move'
|
|
313105
312783
|
},
|
|
313106
|
-
className:
|
|
312784
|
+
className: 'icon_drag' + (isDragging ? 'bing' : '')
|
|
313107
312785
|
}));
|
|
313108
312786
|
};
|
|
313109
312787
|
|
|
@@ -313115,20 +312793,19 @@
|
|
|
313115
312793
|
function deepDataSourcePreKeys(dataSource, rowKey) {
|
|
313116
312794
|
var deepDataSource = [];
|
|
313117
312795
|
|
|
313118
|
-
var eachChildren = function eachChildren(children, preKeys
|
|
313119
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item
|
|
312796
|
+
var eachChildren = function eachChildren(children, preKeys) {
|
|
312797
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
313120
312798
|
deepDataSource.push(_objectSpread(_objectSpread({}, item), {}, {
|
|
313121
|
-
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])
|
|
313122
|
-
_deepIds: [].concat(_toConsumableArray$1(deepIds), [index + 1])
|
|
312799
|
+
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])
|
|
313123
312800
|
}));
|
|
313124
312801
|
|
|
313125
312802
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
313126
|
-
eachChildren(item === null || item === void 0 ? void 0 : item.children, [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])
|
|
312803
|
+
eachChildren(item === null || item === void 0 ? void 0 : item.children, [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])); // deepDataSource.push({ ...item, preKeys: [...preKeys, item[rowKey]] })
|
|
313127
312804
|
}
|
|
313128
312805
|
});
|
|
313129
312806
|
};
|
|
313130
312807
|
|
|
313131
|
-
eachChildren(dataSource, []
|
|
312808
|
+
eachChildren(dataSource, []);
|
|
313132
312809
|
return lodash.keyBy(deepDataSource, rowKey);
|
|
313133
312810
|
}
|
|
313134
312811
|
function isExpandRow(children) {
|
|
@@ -313160,366 +312837,21 @@
|
|
|
313160
312837
|
|
|
313161
312838
|
return _objectSpread(_objectSpread({}, v), {}, _defineProperty$1({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
|
|
313162
312839
|
});
|
|
313163
|
-
return res
|
|
313164
|
-
}
|
|
313165
|
-
function getExpandStatus(children) {
|
|
313166
|
-
var _children$2, _children$2$props, _children$2$props$chi, _children$2$props$chi2, _children$2$props$chi3;
|
|
313167
|
-
|
|
313168
|
-
return isExpandRow(children) ? children === null || children === void 0 ? void 0 : (_children$2 = children[0]) === null || _children$2 === void 0 ? void 0 : (_children$2$props = _children$2.props) === null || _children$2$props === void 0 ? void 0 : (_children$2$props$chi = _children$2$props.children) === null || _children$2$props$chi === void 0 ? void 0 : (_children$2$props$chi2 = _children$2$props$chi[1]) === null || _children$2$props$chi2 === void 0 ? void 0 : (_children$2$props$chi3 = _children$2$props$chi2.props) === null || _children$2$props$chi3 === void 0 ? void 0 : _children$2$props$chi3['aria-label'] : '';
|
|
313169
|
-
}
|
|
313170
|
-
function checkMemoShouldUploadSpecialFun(prev, next) {
|
|
313171
|
-
var _prevCol$componentPro, _nextCol$componentPro, _prevCol$componentPro2, _nextCol$componentPro2, _prevCol$componentPro3, _nextCol$componentPro3, _prevCol$componentPro4, _nextCol$componentPro4, _prevCol$componentPro5, _nextCol$componentPro5, _prevCol$componentPro6, _nextCol$componentPro6;
|
|
313172
|
-
|
|
313173
|
-
var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
|
|
313174
|
-
|
|
313175
|
-
if (!checkExpandStatus) {
|
|
313176
|
-
return false;
|
|
313177
|
-
}
|
|
313178
|
-
|
|
313179
|
-
var prevCol = prev === null || prev === void 0 ? void 0 : prev.col;
|
|
313180
|
-
var nextCol = next === null || next === void 0 ? void 0 : next.col;
|
|
313181
|
-
/** TODO: 使用了自定义render, 是否要判断rowIndex? 这样排序之后,渲染的性能就会变差 */
|
|
313182
|
-
|
|
313183
|
-
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.render) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.render)) && !lodash.isEqual(lodash.pick(prev, ['colIndex', 'record', 'children']), lodash.pick(next, ['colIndex', 'record', 'children']))) {
|
|
313184
|
-
return false;
|
|
313185
|
-
}
|
|
313186
|
-
|
|
313187
|
-
if (!(next === null || next === void 0 ? void 0 : next.quickOpetateClearAll) && ((next === null || next === void 0 ? void 0 : next.getLength) < 2 || (prev === null || prev === void 0 ? void 0 : prev.getLength) === 1) && (next === null || next === void 0 ? void 0 : next.dataIndex) === 'lm_edit_opetate') {
|
|
313188
|
-
return false;
|
|
313189
|
-
}
|
|
313190
|
-
|
|
313191
|
-
if (prev.isEdit !== next.isEdit) {
|
|
313192
|
-
return false;
|
|
313193
|
-
} // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
|
|
313194
|
-
|
|
313195
|
-
|
|
313196
|
-
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && ((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro = prevCol.componentProps) === null || _prevCol$componentPro === void 0 ? void 0 : _prevCol$componentPro.render) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro = nextCol.componentProps) === null || _nextCol$componentPro === void 0 ? void 0 : _nextCol$componentPro.render)) && (!lodash.isEqual(lodash.omit(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, ['render']), lodash.omit(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps, ['render'])) || !lodash.isEqual(lodash.pick(prev, ['colIndex', 'record', 'rowIndex']), lodash.pick(next, ['colIndex', 'record', 'rowIndex'])))) {
|
|
313197
|
-
return false;
|
|
313198
|
-
}
|
|
313199
|
-
|
|
313200
|
-
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.fixed) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.fixed)) && !lodash.isEqual(prev === null || prev === void 0 ? void 0 : prev.style, next === null || next === void 0 ? void 0 : next.style)) {
|
|
313201
|
-
return false;
|
|
313202
|
-
}
|
|
313203
|
-
|
|
313204
|
-
if (((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro2 = prevCol.componentProps) === null || _prevCol$componentPro2 === void 0 ? void 0 : _prevCol$componentPro2.optionOnly) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro2 = nextCol.componentProps) === null || _nextCol$componentPro2 === void 0 ? void 0 : _nextCol$componentPro2.optionOnly)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro3 = prevCol.componentProps) === null || _prevCol$componentPro3 === void 0 ? void 0 : _prevCol$componentPro3.options, nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro3 = nextCol.componentProps) === null || _nextCol$componentPro3 === void 0 ? void 0 : _nextCol$componentPro3.options)) {
|
|
313205
|
-
return false;
|
|
313206
|
-
}
|
|
313207
|
-
|
|
313208
|
-
if (((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro4 = prevCol.componentProps) === null || _prevCol$componentPro4 === void 0 ? void 0 : _prevCol$componentPro4.options) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro4 = nextCol.componentProps) === null || _nextCol$componentPro4 === void 0 ? void 0 : _nextCol$componentPro4.options)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro5 = prevCol.componentProps) === null || _prevCol$componentPro5 === void 0 ? void 0 : _prevCol$componentPro5.options, nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro5 = nextCol.componentProps) === null || _nextCol$componentPro5 === void 0 ? void 0 : _nextCol$componentPro5.options)) {
|
|
313209
|
-
return false;
|
|
313210
|
-
}
|
|
313211
|
-
|
|
313212
|
-
if ((lodash.isFunction(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) || lodash.isFunction(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) && !lodash.isEqual(prevCol.newOptions, nextCol.newOptions) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) {
|
|
313213
|
-
return false;
|
|
313214
|
-
}
|
|
313215
|
-
|
|
313216
|
-
if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.order) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.order)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.order, nextCol === null || nextCol === void 0 ? void 0 : nextCol.order)) {
|
|
313217
|
-
// return isEqual(prevCol?.order, nextCol?.fixed)
|
|
313218
|
-
return false;
|
|
313219
|
-
}
|
|
313220
|
-
|
|
313221
|
-
if (next.className.indexOf('drag-visible') > -1) {
|
|
313222
|
-
return lodash.isEqual(prev.style, next.style);
|
|
313223
|
-
}
|
|
313224
|
-
|
|
313225
|
-
if (next.className.indexOf('ant-table-selection-column') > -1) {
|
|
313226
|
-
var _prev$children, _prev$children$, _next$children, _next$children$;
|
|
313227
|
-
|
|
313228
|
-
return lodash.isEqual((_prev$children = prev.children) === null || _prev$children === void 0 ? void 0 : (_prev$children$ = _prev$children[1]) === null || _prev$children$ === void 0 ? void 0 : _prev$children$.props, (_next$children = next.children) === null || _next$children === void 0 ? void 0 : (_next$children$ = _next$children[1]) === null || _next$children$ === void 0 ? void 0 : _next$children$.props);
|
|
313229
|
-
}
|
|
313230
|
-
/** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
|
|
313231
|
-
|
|
313232
|
-
|
|
313233
|
-
if ((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro6 = prevCol.componentProps) === null || _prevCol$componentPro6 === void 0 ? void 0 : _prevCol$componentPro6.quickcopy) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro6 = nextCol.componentProps) === null || _nextCol$componentPro6 === void 0 ? void 0 : _nextCol$componentPro6.quickcopy)) {
|
|
313234
|
-
var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
|
|
313235
|
-
var p = lodash.pick(prev, pickProps);
|
|
313236
|
-
var n = lodash.pick(next, pickProps);
|
|
313237
|
-
return lodash.isEqual(p, n);
|
|
313238
|
-
}
|
|
313239
|
-
|
|
313240
|
-
return true;
|
|
313241
|
-
}
|
|
313242
|
-
function checkExpandIconColumnIndex(_ref) {
|
|
313243
|
-
var rowSelection = _ref.rowSelection,
|
|
313244
|
-
sortOpen = _ref.sortOpen,
|
|
313245
|
-
indexCol = _ref.indexCol;
|
|
313246
|
-
var arr = [rowSelection, sortOpen, indexCol].filter(function (item) {
|
|
313247
|
-
return !!item;
|
|
313248
|
-
});
|
|
313249
|
-
return arr.length;
|
|
313250
|
-
}
|
|
313251
|
-
|
|
313252
|
-
var DndContainer$3 = function DndContainer(_ref) {
|
|
313253
|
-
var children = _ref.children,
|
|
313254
|
-
options = _ref.options,
|
|
313255
|
-
move = _ref.move,
|
|
313256
|
-
rowKey = _ref.rowKey,
|
|
313257
|
-
items = _ref.items,
|
|
313258
|
-
tableWidth = _ref.tableWidth;
|
|
313259
|
-
|
|
313260
|
-
var _React$useState = React__default['default'].useState(false),
|
|
313261
|
-
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
313262
|
-
isDragging = _React$useState2[0],
|
|
313263
|
-
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
313264
|
-
|
|
313265
|
-
|
|
313266
|
-
var _React$useState3 = React__default['default'].useState(null),
|
|
313267
|
-
_React$useState4 = _slicedToArray$1(_React$useState3, 2),
|
|
313268
|
-
activeId = _React$useState4[0],
|
|
313269
|
-
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
313270
|
-
|
|
313271
|
-
|
|
313272
|
-
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
313273
|
-
coordinateGetter: sortableKeyboardCoordinates
|
|
313274
|
-
})); // 开始拖拽
|
|
313275
|
-
|
|
313276
|
-
var handleDragStart = function handleDragStart(_ref2) {
|
|
313277
|
-
var active = _ref2.active;
|
|
313278
|
-
setIsDragging(true);
|
|
313279
|
-
|
|
313280
|
-
if (!active) {
|
|
313281
|
-
return;
|
|
313282
|
-
}
|
|
313283
|
-
|
|
313284
|
-
setActiveId(active.id);
|
|
313285
|
-
}; // 拖拽结束
|
|
313286
|
-
|
|
313287
|
-
|
|
313288
|
-
var handleDragEnd = function handleDragEnd(event) {
|
|
313289
|
-
var active = event.active,
|
|
313290
|
-
over = event.over;
|
|
313291
|
-
setActiveId(null); // 未移入时触发
|
|
313292
|
-
|
|
313293
|
-
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
313294
|
-
return;
|
|
313295
|
-
} // 移入时触发更新数据
|
|
313296
|
-
|
|
313297
|
-
|
|
313298
|
-
if (active.id !== over.id) {
|
|
313299
|
-
move(active.id, over.id);
|
|
313300
|
-
}
|
|
313301
|
-
};
|
|
313302
|
-
|
|
313303
|
-
var instance = {
|
|
313304
|
-
isDragging: isDragging,
|
|
313305
|
-
activeId: activeId,
|
|
313306
|
-
options: options,
|
|
313307
|
-
rowKey: rowKey,
|
|
313308
|
-
children: children,
|
|
313309
|
-
move: move,
|
|
313310
|
-
items: items,
|
|
313311
|
-
tableWidth: tableWidth
|
|
313312
|
-
};
|
|
313313
|
-
console.log('instance', instance);
|
|
313314
|
-
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
313315
|
-
sensors: sensors,
|
|
313316
|
-
onDragStart: handleDragStart,
|
|
313317
|
-
onDragCancel: function onDragCancel() {
|
|
313318
|
-
return setActiveId(null);
|
|
313319
|
-
},
|
|
313320
|
-
collisionDetection: closestCenter,
|
|
313321
|
-
onDragEnd: handleDragEnd,
|
|
313322
|
-
modifiers: [restrictToParentElement, restrictToVerticalAxis]
|
|
313323
|
-
}, children);
|
|
313324
|
-
};
|
|
313325
|
-
|
|
313326
|
-
var DndContainer$4 = /*#__PURE__*/React.memo(DndContainer$3);
|
|
313327
|
-
|
|
313328
|
-
var SortableBox$2 = function SortableBox(_ref) {
|
|
313329
|
-
var items = _ref.items,
|
|
313330
|
-
children = _ref.children;
|
|
313331
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
313332
|
-
items: items,
|
|
313333
|
-
strategy: verticalListSortingStrategy
|
|
313334
|
-
}, children);
|
|
313335
|
-
};
|
|
313336
|
-
|
|
313337
|
-
var _excluded$2T = ["keys", "onSortEnd", "virtual", "rowKey", "options", "tableWidth"];
|
|
313338
|
-
|
|
313339
|
-
var DraggableContainer = function DraggableContainer(_ref) {
|
|
313340
|
-
var keys = _ref.keys,
|
|
313341
|
-
onSortEnd = _ref.onSortEnd,
|
|
313342
|
-
virtual = _ref.virtual,
|
|
313343
|
-
rowKey = _ref.rowKey,
|
|
313344
|
-
options = _ref.options,
|
|
313345
|
-
tableWidth = _ref.tableWidth,
|
|
313346
|
-
props = _objectWithoutProperties$1(_ref, _excluded$2T);
|
|
313347
|
-
|
|
313348
|
-
return /*#__PURE__*/React__default['default'].createElement(DndContainer$4, {
|
|
313349
|
-
move: onSortEnd,
|
|
313350
|
-
items: keys,
|
|
313351
|
-
rowKey: rowKey,
|
|
313352
|
-
options: options,
|
|
313353
|
-
tableWidth: tableWidth
|
|
313354
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$2, {
|
|
313355
|
-
items: keys
|
|
313356
|
-
}, virtual ? /*#__PURE__*/React__default['default'].createElement(VirtualWrapper$1, _objectSpread({}, props)) : /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, props))));
|
|
313357
|
-
};
|
|
313358
|
-
|
|
313359
|
-
var BottomOpetateComponent = function BottomOpetateComponent(props) {
|
|
313360
|
-
var isShowAddAction = props.isShowAddAction,
|
|
313361
|
-
recordCreatorProps = props.recordCreatorProps,
|
|
313362
|
-
handleAdd = props.handleAdd,
|
|
313363
|
-
_props$disabled = props.disabled,
|
|
313364
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
313365
|
-
return isShowAddAction ? /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313366
|
-
className: "lm_editTable_add_bar",
|
|
313367
|
-
type: "dashed",
|
|
313368
|
-
disabled: disabled,
|
|
313369
|
-
onClick: (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.customAddClick) || handleAdd,
|
|
313370
|
-
style: _objectSpread({
|
|
313371
|
-
marginTop: 8
|
|
313372
|
-
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
313373
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313374
|
-
type: "lmweb-plus"
|
|
313375
|
-
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增') : null;
|
|
313376
|
-
};
|
|
313377
|
-
|
|
313378
|
-
var getRenderPropValue$1 = function getRenderPropValue(propValue) {
|
|
313379
|
-
if (!propValue) {
|
|
313380
|
-
return null;
|
|
313381
|
-
}
|
|
313382
|
-
|
|
313383
|
-
var isRenderFunction = typeof propValue === 'function';
|
|
313384
|
-
|
|
313385
|
-
if (isRenderFunction) {
|
|
313386
|
-
return propValue();
|
|
313387
|
-
}
|
|
313388
|
-
|
|
313389
|
-
return propValue;
|
|
313390
|
-
};
|
|
313391
|
-
|
|
313392
|
-
var _excluded$2U = ["prefixCls", "title", "content", "_overlay"];
|
|
313393
|
-
var Popover$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
313394
|
-
var customizePrefixCls = _ref.prefixCls,
|
|
313395
|
-
title = _ref.title,
|
|
313396
|
-
content = _ref.content,
|
|
313397
|
-
_overlay = _ref._overlay,
|
|
313398
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$2U);
|
|
313399
|
-
|
|
313400
|
-
var _React$useContext = React.useContext(ConfigContext),
|
|
313401
|
-
getPrefixCls = _React$useContext.getPrefixCls;
|
|
313402
|
-
|
|
313403
|
-
var getOverlay = function getOverlay(prefixCls) {
|
|
313404
|
-
if (!title && !content) return undefined;
|
|
313405
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement("div", {
|
|
313406
|
-
className: "".concat(prefixCls, "-title")
|
|
313407
|
-
}, getRenderPropValue$1(title)), /*#__PURE__*/React.createElement("div", {
|
|
313408
|
-
className: "".concat(prefixCls, "-inner-content")
|
|
313409
|
-
}, getRenderPropValue$1(content)));
|
|
313410
|
-
};
|
|
313411
|
-
|
|
313412
|
-
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
313413
|
-
var rootPrefixCls = getPrefixCls();
|
|
313414
|
-
return /*#__PURE__*/React.createElement(Tooltip$4, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
313415
|
-
prefixCls: prefixCls,
|
|
313416
|
-
ref: ref,
|
|
313417
|
-
overlay: _overlay || getOverlay(prefixCls),
|
|
313418
|
-
transitionName: getTransitionName$9(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
313419
|
-
}));
|
|
313420
|
-
});
|
|
313421
|
-
|
|
313422
|
-
{
|
|
313423
|
-
Popover$1.displayName = 'Popover';
|
|
312840
|
+
return res;
|
|
313424
312841
|
}
|
|
313425
312842
|
|
|
313426
|
-
|
|
313427
|
-
placement: 'top',
|
|
313428
|
-
trigger: 'hover',
|
|
313429
|
-
mouseEnterDelay: 0.1,
|
|
313430
|
-
mouseLeaveDelay: 0.1,
|
|
313431
|
-
overlayStyle: {}
|
|
313432
|
-
};
|
|
313433
|
-
Popover$1.AntdPopover = Popover;
|
|
313434
|
-
|
|
313435
|
-
var QuickOpetate = function QuickOpetate(_ref) {
|
|
313436
|
-
var record = _ref.record,
|
|
313437
|
-
rowKey = _ref.rowKey,
|
|
313438
|
-
handleAdd = _ref.handleAdd,
|
|
313439
|
-
handleDelete = _ref.handleDelete,
|
|
313440
|
-
_ref$options = _ref.options,
|
|
313441
|
-
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
313442
|
-
getLength = _ref.getLength,
|
|
313443
|
-
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
313444
|
-
var disabled = React__default['default'].useContext(DisabledContext$1) || false;
|
|
313445
|
-
|
|
313446
|
-
var appendChildren = function appendChildren() {
|
|
313447
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
313448
|
-
};
|
|
313449
|
-
|
|
313450
|
-
var appendAdd = function appendAdd() {
|
|
313451
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
313452
|
-
};
|
|
313453
|
-
|
|
313454
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313455
|
-
style: {
|
|
313456
|
-
display: 'flex',
|
|
313457
|
-
alignItems: 'center',
|
|
313458
|
-
justifyContent: 'flex-start',
|
|
313459
|
-
marginLeft: '-4px'
|
|
313460
|
-
}
|
|
313461
|
-
}, options.includes('delete') && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313462
|
-
type: "link",
|
|
313463
|
-
size: "small",
|
|
313464
|
-
disabled: !quickOpetateClearAll && getLength < 2 || disabled,
|
|
313465
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313466
|
-
type: "lmweb-minus-circle",
|
|
313467
|
-
style: {
|
|
313468
|
-
fontSize: 16
|
|
313469
|
-
}
|
|
313470
|
-
}),
|
|
313471
|
-
onClick: function onClick() {
|
|
313472
|
-
return handleDelete(record[rowKey]);
|
|
313473
|
-
}
|
|
313474
|
-
}), (options === null || options === void 0 ? void 0 : options.includes('add')) && (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React__default['default'].createElement(Popover$1, {
|
|
313475
|
-
placement: "bottom",
|
|
313476
|
-
overlayClassName: "lm_table_append_add_popover",
|
|
313477
|
-
open: open,
|
|
313478
|
-
title: null,
|
|
313479
|
-
content: /*#__PURE__*/React__default['default'].createElement("ul", null, /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313480
|
-
onClick: appendAdd
|
|
313481
|
-
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313482
|
-
onClick: appendChildren
|
|
313483
|
-
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
313484
|
-
trigger: "hover"
|
|
313485
|
-
}, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313486
|
-
type: "link",
|
|
313487
|
-
size: "small",
|
|
313488
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313489
|
-
type: "lmweb-plus-circle-fill",
|
|
313490
|
-
style: {
|
|
313491
|
-
fontSize: 16
|
|
313492
|
-
}
|
|
313493
|
-
})
|
|
313494
|
-
})) : (options === null || options === void 0 ? void 0 : options.includes('add')) || (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313495
|
-
type: "link",
|
|
313496
|
-
size: "small",
|
|
313497
|
-
disabled: disabled,
|
|
313498
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313499
|
-
type: "lmweb-plus-circle-fill",
|
|
313500
|
-
style: {
|
|
313501
|
-
fontSize: 16
|
|
313502
|
-
}
|
|
313503
|
-
}),
|
|
313504
|
-
onClick: function onClick() {
|
|
313505
|
-
return handleAdd(record, !!(options === null || options === void 0 ? void 0 : options.includes('addInChildren')));
|
|
313506
|
-
}
|
|
313507
|
-
}) : null);
|
|
313508
|
-
};
|
|
313509
|
-
|
|
313510
|
-
var _excluded$2V = ["index", "virtual"],
|
|
312843
|
+
var _excluded$2R = ["index"],
|
|
313511
312844
|
_excluded2$I = ["index"],
|
|
313512
312845
|
_excluded3$b = ["value", "onChange", "record", "rowIndex", "colIndex", "validator"],
|
|
313513
|
-
_excluded4$2 = ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps"],
|
|
312846
|
+
_excluded4$2 = ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"],
|
|
313514
312847
|
_excluded5 = ["onMouseEnter", "onMouseLeave"],
|
|
313515
|
-
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "
|
|
312848
|
+
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"];
|
|
313516
312849
|
var UploadBtn$1 = UploadOss.UploadBtn;
|
|
313517
312850
|
var EditableContext$1 = /*#__PURE__*/React__default['default'].createContext(null); // 表格行
|
|
313518
312851
|
|
|
313519
312852
|
var EditableRow$1 = function EditableRow(_ref) {
|
|
313520
312853
|
var index = _ref.index,
|
|
313521
|
-
|
|
313522
|
-
props = _objectWithoutProperties$1(_ref, _excluded$2V);
|
|
312854
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2R);
|
|
313523
312855
|
|
|
313524
312856
|
var _Form$useForm = Form$4.useForm(),
|
|
313525
312857
|
_Form$useForm2 = _slicedToArray$1(_Form$useForm, 1),
|
|
@@ -313530,7 +312862,7 @@
|
|
|
313530
312862
|
component: false
|
|
313531
312863
|
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
313532
312864
|
value: form
|
|
313533
|
-
},
|
|
312865
|
+
}, /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
313534
312866
|
};
|
|
313535
312867
|
|
|
313536
312868
|
var EditableSortRow = function EditableSortRow(_ref2) {
|
|
@@ -313543,11 +312875,10 @@
|
|
|
313543
312875
|
|
|
313544
312876
|
return /*#__PURE__*/React__default['default'].createElement(Form$4, {
|
|
313545
312877
|
form: form,
|
|
313546
|
-
disabled: props.disabled || false,
|
|
313547
312878
|
component: false
|
|
313548
312879
|
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
313549
312880
|
value: form
|
|
313550
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
312881
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$1, _objectSpread({}, props))));
|
|
313551
312882
|
};
|
|
313552
312883
|
|
|
313553
312884
|
var UploadSingle$1 = function UploadSingle(props) {
|
|
@@ -313674,7 +313005,88 @@
|
|
|
313674
313005
|
return handleInput(e, 'next');
|
|
313675
313006
|
}
|
|
313676
313007
|
}, editEnum))));
|
|
313677
|
-
};
|
|
313008
|
+
}; // 操作列
|
|
313009
|
+
|
|
313010
|
+
|
|
313011
|
+
var Opetate$1 = function Opetate(_ref4) {
|
|
313012
|
+
var record = _ref4.record,
|
|
313013
|
+
rowKey = _ref4.rowKey,
|
|
313014
|
+
handleAdd = _ref4.handleAdd,
|
|
313015
|
+
handleDelete = _ref4.handleDelete,
|
|
313016
|
+
_ref4$options = _ref4.options,
|
|
313017
|
+
options = _ref4$options === void 0 ? ['add', 'delete'] : _ref4$options,
|
|
313018
|
+
getLength = _ref4.getLength,
|
|
313019
|
+
quickOpetateClearAll = _ref4.quickOpetateClearAll;
|
|
313020
|
+
|
|
313021
|
+
var appendChildren = function appendChildren() {
|
|
313022
|
+
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
313023
|
+
};
|
|
313024
|
+
|
|
313025
|
+
var appendAdd = function appendAdd() {
|
|
313026
|
+
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
313027
|
+
};
|
|
313028
|
+
|
|
313029
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313030
|
+
style: {
|
|
313031
|
+
display: 'flex',
|
|
313032
|
+
alignItems: 'center',
|
|
313033
|
+
justifyContent: 'flex-start',
|
|
313034
|
+
marginLeft: '-4px'
|
|
313035
|
+
}
|
|
313036
|
+
}, options.includes('delete') && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313037
|
+
type: "link",
|
|
313038
|
+
size: "small",
|
|
313039
|
+
disabled: !quickOpetateClearAll && getLength < 2,
|
|
313040
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313041
|
+
type: "lmweb-minus-circle",
|
|
313042
|
+
style: {
|
|
313043
|
+
fontSize: 16
|
|
313044
|
+
}
|
|
313045
|
+
}),
|
|
313046
|
+
onClick: function onClick() {
|
|
313047
|
+
return handleDelete(record[rowKey]);
|
|
313048
|
+
}
|
|
313049
|
+
}), (options === null || options === void 0 ? void 0 : options.includes('add')) && (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React__default['default'].createElement(Popover$1, {
|
|
313050
|
+
placement: "bottom",
|
|
313051
|
+
overlayClassName: 'lm_table_append_add_popover',
|
|
313052
|
+
open: open,
|
|
313053
|
+
title: null,
|
|
313054
|
+
content: /*#__PURE__*/React__default['default'].createElement("ul", null, /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313055
|
+
onClick: appendAdd
|
|
313056
|
+
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313057
|
+
onClick: appendChildren
|
|
313058
|
+
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
313059
|
+
trigger: "hover"
|
|
313060
|
+
}, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313061
|
+
type: "link",
|
|
313062
|
+
size: "small",
|
|
313063
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313064
|
+
type: "lmweb-plus-circle-fill",
|
|
313065
|
+
style: {
|
|
313066
|
+
fontSize: 16
|
|
313067
|
+
}
|
|
313068
|
+
})
|
|
313069
|
+
})) : (options === null || options === void 0 ? void 0 : options.includes('add')) || (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313070
|
+
type: "link",
|
|
313071
|
+
size: "small",
|
|
313072
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313073
|
+
type: "lmweb-plus-circle-fill",
|
|
313074
|
+
style: {
|
|
313075
|
+
fontSize: 16
|
|
313076
|
+
}
|
|
313077
|
+
}),
|
|
313078
|
+
onClick: function onClick() {
|
|
313079
|
+
return handleAdd(record, (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? true : false);
|
|
313080
|
+
}
|
|
313081
|
+
}) : null);
|
|
313082
|
+
}; // const isValidValue = (verifyValue) => {
|
|
313083
|
+
// const toStringValue = JSON.stringify(verifyValue);
|
|
313084
|
+
// if (verifyValue === undefined || verifyValue === null || verifyValue === '' || toStringValue === '[]' || toStringValue === '{}') {
|
|
313085
|
+
// return false;
|
|
313086
|
+
// }
|
|
313087
|
+
// return true;
|
|
313088
|
+
// }
|
|
313089
|
+
|
|
313678
313090
|
/*
|
|
313679
313091
|
表格单元格
|
|
313680
313092
|
editEnum: 下拉框时的数据数组(非数组时是配置设置)
|
|
@@ -313704,6 +313116,8 @@
|
|
|
313704
313116
|
handleDelete = props.handleDelete,
|
|
313705
313117
|
handleCopy = props.handleCopy,
|
|
313706
313118
|
itemProps = props.itemProps,
|
|
313119
|
+
setValid = props.setValid,
|
|
313120
|
+
reWriteOriginSource = props.reWriteOriginSource,
|
|
313707
313121
|
restProps = _objectWithoutProperties$1(props, _excluded4$2);
|
|
313708
313122
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
313709
313123
|
|
|
@@ -313724,12 +313138,6 @@
|
|
|
313724
313138
|
|
|
313725
313139
|
var inputRef = React.useRef(null);
|
|
313726
313140
|
var form = React.useContext(EditableContext$1);
|
|
313727
|
-
|
|
313728
|
-
var _useState5 = React.useState(false),
|
|
313729
|
-
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
313730
|
-
hoverStatus = _useState6[0],
|
|
313731
|
-
setHoverStatus = _useState6[1];
|
|
313732
|
-
|
|
313733
313141
|
React.useEffect(function () {
|
|
313734
313142
|
if (editing) {
|
|
313735
313143
|
var _inputRef$current;
|
|
@@ -313740,11 +313148,17 @@
|
|
|
313740
313148
|
|
|
313741
313149
|
var toggleEdit = function toggleEdit() {
|
|
313742
313150
|
setEditing(!editing); // form.setFieldsValue({ [dataIndex]: record[dataIndex] });
|
|
313743
|
-
}; //
|
|
313151
|
+
}; // const checkCellRef = useRef(null)
|
|
313152
|
+
// const focusCapturedRef = useRef(false);
|
|
313153
|
+
// const curValue = useMemo(() => {
|
|
313154
|
+
// return record?.dataIndex
|
|
313155
|
+
// }, [record])
|
|
313156
|
+
// const curValueIsValid = isValidValue(curValue);
|
|
313157
|
+
// 校验保存
|
|
313744
313158
|
|
|
313745
313159
|
|
|
313746
313160
|
var save = /*#__PURE__*/function () {
|
|
313747
|
-
var
|
|
313161
|
+
var _ref5 = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee(row) {
|
|
313748
313162
|
var values, resultComponentProps;
|
|
313749
313163
|
return _regeneratorRuntime$1().wrap(function _callee$(_context) {
|
|
313750
313164
|
while (1) {
|
|
@@ -313792,7 +313206,13 @@
|
|
|
313792
313206
|
case 13:
|
|
313793
313207
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
313794
313208
|
toggleEdit();
|
|
313795
|
-
}
|
|
313209
|
+
} // // 清空异常校验
|
|
313210
|
+
// setValid((old) => {
|
|
313211
|
+
// const obj = { ...old }
|
|
313212
|
+
// delete obj[record[rowKey]]
|
|
313213
|
+
// return obj
|
|
313214
|
+
// })
|
|
313215
|
+
|
|
313796
313216
|
|
|
313797
313217
|
_context.next = 18;
|
|
313798
313218
|
break;
|
|
@@ -313810,7 +313230,7 @@
|
|
|
313810
313230
|
}));
|
|
313811
313231
|
|
|
313812
313232
|
return function save(_x) {
|
|
313813
|
-
return
|
|
313233
|
+
return _ref5.apply(this, arguments);
|
|
313814
313234
|
};
|
|
313815
313235
|
}(); // 触发保存
|
|
313816
313236
|
|
|
@@ -313821,15 +313241,16 @@
|
|
|
313821
313241
|
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
313822
313242
|
|
|
313823
313243
|
|
|
313824
|
-
var copyKey = function copyKey(e
|
|
313244
|
+
var copyKey = function copyKey(e) {
|
|
313825
313245
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
313826
313246
|
var dataIndex = col.dataIndex;
|
|
313827
|
-
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]
|
|
313247
|
+
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]);
|
|
313828
313248
|
};
|
|
313829
313249
|
|
|
313830
313250
|
var Control = function Control(con) {
|
|
313831
313251
|
var _col$newOptions;
|
|
313832
313252
|
|
|
313253
|
+
// const resultComponentProps = isFunction(componentProps) ? componentProps?.(record, col) : componentProps
|
|
313833
313254
|
var resultComponentProps = lodash.isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
313834
313255
|
|
|
313835
313256
|
if (lodash.isFunction(componentProps) && (col === null || col === void 0 ? void 0 : (_col$newOptions = col.newOptions) === null || _col$newOptions === void 0 ? void 0 : _col$newOptions.length)) {
|
|
@@ -313838,7 +313259,7 @@
|
|
|
313838
313259
|
});
|
|
313839
313260
|
}
|
|
313840
313261
|
|
|
313841
|
-
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue'
|
|
313262
|
+
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue']);
|
|
313842
313263
|
|
|
313843
313264
|
switch (con) {
|
|
313844
313265
|
case 'input':
|
|
@@ -313859,12 +313280,19 @@
|
|
|
313859
313280
|
noStyle: true
|
|
313860
313281
|
}, /*#__PURE__*/React__default['default'].cloneElement(resultComponentProps.addonAfter, {
|
|
313861
313282
|
onChange: handleFormItemChange
|
|
313283
|
+
})) : null,
|
|
313284
|
+
suffix: resultComponentProps.quickcopy ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
313285
|
+
className: 'lm_table_quickcopy'
|
|
313286
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313287
|
+
onClick: copyKey,
|
|
313288
|
+
type: 'lmweb-icon_m_brush'
|
|
313862
313289
|
})) : null
|
|
313863
313290
|
}));
|
|
313864
313291
|
|
|
313865
313292
|
case 'inputRange':
|
|
313866
313293
|
return /*#__PURE__*/React__default['default'].createElement(InputRange$1, _objectSpread(_objectSpread({
|
|
313867
|
-
onChange: handleFormItemChange
|
|
313294
|
+
onChange: handleFormItemChange,
|
|
313295
|
+
ref: inputRef
|
|
313868
313296
|
}, resultComponentProps), {}, {
|
|
313869
313297
|
record: record,
|
|
313870
313298
|
rowIndex: rowIndex,
|
|
@@ -313940,7 +313368,7 @@
|
|
|
313940
313368
|
|
|
313941
313369
|
case 'switch':
|
|
313942
313370
|
return /*#__PURE__*/React__default['default'].createElement(Switch$2, _objectSpread(_objectSpread({
|
|
313943
|
-
size:
|
|
313371
|
+
size: 'small'
|
|
313944
313372
|
}, clearAttrComponentProps), {}, {
|
|
313945
313373
|
onChange: handleFormItemChange
|
|
313946
313374
|
}));
|
|
@@ -313954,9 +313382,10 @@
|
|
|
313954
313382
|
|
|
313955
313383
|
case 'operate':
|
|
313956
313384
|
case 'lm_edit_opetate':
|
|
313957
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
313385
|
+
return /*#__PURE__*/React__default['default'].createElement(Opetate$1, _objectSpread({
|
|
313958
313386
|
record: record,
|
|
313959
313387
|
rowKey: rowKey,
|
|
313388
|
+
ref: inputRef,
|
|
313960
313389
|
handleAdd: handleTableRowAdd,
|
|
313961
313390
|
handleDelete: handleTableRowDelete,
|
|
313962
313391
|
getLength: getLength,
|
|
@@ -313970,7 +313399,7 @@
|
|
|
313970
313399
|
var fromData = form.getFieldsValue();
|
|
313971
313400
|
return render === null || render === void 0 ? void 0 : render(_objectSpread(_objectSpread({}, !isObjEmpty(fromData) ? _objectSpread(_objectSpread({}, record), {}, _defineProperty$1({}, dataIndex, fromData[dataIndex])) : record), {}, {
|
|
313972
313401
|
onChange: save
|
|
313973
|
-
})
|
|
313402
|
+
}));
|
|
313974
313403
|
}
|
|
313975
313404
|
|
|
313976
313405
|
default:
|
|
@@ -314005,8 +313434,7 @@
|
|
|
314005
313434
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
314006
313435
|
style: {
|
|
314007
313436
|
margin: 0
|
|
314008
|
-
}
|
|
314009
|
-
noStyle: formProps ? false : true
|
|
313437
|
+
}
|
|
314010
313438
|
}, formProps), {}, {
|
|
314011
313439
|
name: dataIndex
|
|
314012
313440
|
}), Control(editable)));
|
|
@@ -314018,7 +313446,6 @@
|
|
|
314018
313446
|
margin: 0
|
|
314019
313447
|
}
|
|
314020
313448
|
}, formProps), {}, {
|
|
314021
|
-
noStyle: formProps ? false : true,
|
|
314022
313449
|
name: [dataIndex, 'value']
|
|
314023
313450
|
}), Control(editable)));
|
|
314024
313451
|
}
|
|
@@ -314031,68 +313458,31 @@
|
|
|
314031
313458
|
}
|
|
314032
313459
|
|
|
314033
313460
|
return childNode;
|
|
314034
|
-
}, [col, isEdit, editing, getLength
|
|
313461
|
+
}, [col, isEdit, editing, getLength]); // const [childNode, setChildNode] = useState(getMemoChildNode);
|
|
313462
|
+
// 出现死循环找我
|
|
314035
313463
|
|
|
314036
313464
|
React.useEffect(function () {
|
|
314037
313465
|
var editable = col.editable,
|
|
314038
313466
|
dataIndex = col.dataIndex;
|
|
314039
313467
|
|
|
314040
313468
|
if (isEdit && editable) {
|
|
314041
|
-
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date'
|
|
314042
|
-
}
|
|
314043
|
-
|
|
314044
|
-
|
|
314045
|
-
|
|
314046
|
-
|
|
314047
|
-
|
|
314048
|
-
|
|
314049
|
-
|
|
314050
|
-
setHoverStatus(false);
|
|
314051
|
-
};
|
|
313469
|
+
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date' ? hooks(record[dataIndex]) : record[dataIndex]));
|
|
313470
|
+
} // if (
|
|
313471
|
+
// (isEdit && editable && record[dataIndex]) ||
|
|
313472
|
+
// (isHoverEdit && editable && record[dataIndex])
|
|
313473
|
+
// ) {
|
|
313474
|
+
// form.setFieldsValue({
|
|
313475
|
+
// [dataIndex]: editable === 'date' ? moment(record[dataIndex]) : record[dataIndex],
|
|
313476
|
+
// })
|
|
313477
|
+
// }
|
|
314052
313478
|
|
|
313479
|
+
}, [record]);
|
|
314053
313480
|
return /*#__PURE__*/React__default['default'].createElement("td", _objectSpread(_objectSpread({}, lodash.omit(clearProps, ['dataIndex'])), {}, {
|
|
314054
313481
|
className: classnames(clearProps === null || clearProps === void 0 ? void 0 : clearProps.className, 'lm_custom_cell_td'),
|
|
314055
|
-
onMouseEnter: componentProps.quickcopy ? handleTdHover : undefined,
|
|
314056
|
-
onMouseLeave: componentProps.quickcopy ? handleTdMouseOut : undefined,
|
|
314057
313482
|
key: "r".concat(rowIndex, "_c").concat(colIndex)
|
|
314058
|
-
}),
|
|
314059
|
-
className: 'quick_copy_warp quick_copy_up',
|
|
314060
|
-
onClick: function onClick(e) {
|
|
314061
|
-
return copyKey(e, 'up');
|
|
314062
|
-
}
|
|
314063
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314064
|
-
type: 'lmweb-icon_up'
|
|
314065
|
-
})), getMemoChildNode, hoverStatus && props.rowIndex < props.getLength - 1 && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
314066
|
-
className: 'quick_copy_warp quick_copy_down',
|
|
314067
|
-
onClick: function onClick(e) {
|
|
314068
|
-
return copyKey(e, 'down');
|
|
314069
|
-
}
|
|
314070
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314071
|
-
type: 'lmweb-icon_down'
|
|
314072
|
-
})));
|
|
313483
|
+
}), getMemoChildNode);
|
|
314073
313484
|
};
|
|
314074
|
-
/** true 不刷新, false 刷新 */
|
|
314075
|
-
|
|
314076
|
-
|
|
314077
|
-
var MemoEditableCell = /*#__PURE__*/React.memo(EditableCell$1, function (prev, next) {
|
|
314078
|
-
var pickProps = ['record', 'colIndex'];
|
|
314079
|
-
var p = lodash.pick(prev, pickProps);
|
|
314080
|
-
var n = lodash.pick(next, pickProps);
|
|
314081
|
-
|
|
314082
|
-
if (next === null || next === void 0 ? void 0 : next.shouldUpdate) {
|
|
314083
|
-
return false;
|
|
314084
|
-
} // console.log(!checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n), '22', prev.record, next.record)
|
|
314085
|
-
// console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
|
|
314086
313485
|
|
|
314087
|
-
/** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
|
|
314088
|
-
|
|
314089
|
-
|
|
314090
|
-
if (!checkMemoShouldUploadSpecialFun(prev, next)) {
|
|
314091
|
-
return false;
|
|
314092
|
-
}
|
|
314093
|
-
|
|
314094
|
-
return lodash.isEqual(p, n);
|
|
314095
|
-
});
|
|
314096
313486
|
var EditTable$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
314097
313487
|
var _localRowSelectList$s2;
|
|
314098
313488
|
|
|
@@ -314111,21 +313501,16 @@
|
|
|
314111
313501
|
_props$quickOpetateCl = props.quickOpetateClearAll,
|
|
314112
313502
|
quickOpetateClearAll = _props$quickOpetateCl === void 0 ? true : _props$quickOpetateCl,
|
|
314113
313503
|
rowSelection = props.rowSelection,
|
|
314114
|
-
virtual = props.virtual,
|
|
314115
313504
|
sortOpen = props.sortOpen,
|
|
314116
|
-
disabled = props.disabled,
|
|
314117
313505
|
colSortOpen = props.colSortOpen,
|
|
314118
|
-
_props$indexCol = props.indexCol,
|
|
314119
|
-
indexCol = _props$indexCol === void 0 ? false : _props$indexCol,
|
|
314120
313506
|
filterChange = props.filterChange,
|
|
314121
313507
|
_props$size = props.size,
|
|
314122
313508
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
314123
313509
|
recordCreatorProps = props.recordCreatorProps,
|
|
314124
313510
|
_props$shouldUpdate = props.shouldUpdate,
|
|
314125
313511
|
shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
|
|
314126
|
-
|
|
314127
|
-
|
|
314128
|
-
resetProps = _objectWithoutProperties$1(props, _excluded6);
|
|
313512
|
+
resetProps = _objectWithoutProperties$1(props, _excluded6); // const [dataSource, setDataSource] = useState([]);
|
|
313513
|
+
|
|
314129
313514
|
|
|
314130
313515
|
var _useControllableValue = useControllableValue({
|
|
314131
313516
|
value: checkRowKeyByDataSource(props.value, _rowKey),
|
|
@@ -314133,7 +313518,14 @@
|
|
|
314133
313518
|
}),
|
|
314134
313519
|
_useControllableValue2 = _slicedToArray$1(_useControllableValue, 2),
|
|
314135
313520
|
dataSource = _useControllableValue2[0],
|
|
314136
|
-
setDataSource = _useControllableValue2[1];
|
|
313521
|
+
setDataSource = _useControllableValue2[1]; // const [count, setCount] = useState(0);
|
|
313522
|
+
|
|
313523
|
+
|
|
313524
|
+
var _useState5 = React.useState({}),
|
|
313525
|
+
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
313526
|
+
_valid = _useState6[0],
|
|
313527
|
+
setValid = _useState6[1]; // const [localRowSelectList, setLocalRowSelectList] = useState([])
|
|
313528
|
+
|
|
314137
313529
|
|
|
314138
313530
|
var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
|
|
314139
313531
|
var _rowSelection$onChang;
|
|
@@ -314150,28 +313542,43 @@
|
|
|
314150
313542
|
_useControllableValue4 = _slicedToArray$1(_useControllableValue3, 2),
|
|
314151
313543
|
localRowSelectList = _useControllableValue4[0],
|
|
314152
313544
|
setLocalRowSelectList = _useControllableValue4[1];
|
|
314153
|
-
/** TODO: 当前展开的列 */
|
|
314154
|
-
|
|
314155
313545
|
|
|
314156
313546
|
var _useState7 = React.useState([]),
|
|
314157
313547
|
_useState8 = _slicedToArray$1(_useState7, 2),
|
|
314158
|
-
|
|
314159
|
-
|
|
313548
|
+
sortEditTable = _useState8[0],
|
|
313549
|
+
setCallBackFalg = _useState8[1];
|
|
313550
|
+
/** 当前展开的列 */
|
|
314160
313551
|
|
|
314161
|
-
|
|
314162
|
-
var
|
|
314163
|
-
|
|
314164
|
-
|
|
314165
|
-
|
|
313552
|
+
|
|
313553
|
+
var _useState9 = React.useState([]),
|
|
313554
|
+
_useState10 = _slicedToArray$1(_useState9, 2),
|
|
313555
|
+
expandedRowKeys = _useState10[0],
|
|
313556
|
+
setExpandedRowKeys = _useState10[1];
|
|
313557
|
+
|
|
313558
|
+
var dataSourceRef = React.useRef([]);
|
|
313559
|
+
var sortDataSorceRef = React.useRef([]);
|
|
313560
|
+
var deepDataSourceRef = React.useRef([]);
|
|
313561
|
+
|
|
313562
|
+
var onSortEnd = function onSortEnd(active, over) {
|
|
313563
|
+
var cloneArr = _toConsumableArray$1(dataSourceRef.current);
|
|
313564
|
+
|
|
313565
|
+
var oldIndex = cloneArr.findIndex(function (v) {
|
|
313566
|
+
return v[_rowKey] === active;
|
|
313567
|
+
});
|
|
313568
|
+
var newIndex = cloneArr.findIndex(function (v) {
|
|
313569
|
+
return v[_rowKey] === over;
|
|
313570
|
+
});
|
|
313571
|
+
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
313572
|
+
};
|
|
314166
313573
|
|
|
314167
313574
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
314168
313575
|
var _arrayMove;
|
|
314169
313576
|
|
|
314170
313577
|
var oldIndex = columns.findIndex(function (item) {
|
|
314171
|
-
return item
|
|
313578
|
+
return item['dataIndex'] === active;
|
|
314172
313579
|
});
|
|
314173
313580
|
var newIndex = columns.findIndex(function (item) {
|
|
314174
|
-
return item
|
|
313581
|
+
return item['dataIndex'] === over;
|
|
314175
313582
|
});
|
|
314176
313583
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange((_arrayMove = arrayMove(columns, oldIndex, newIndex)) === null || _arrayMove === void 0 ? void 0 : _arrayMove.map(function (item, index) {
|
|
314177
313584
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -314184,21 +313591,55 @@
|
|
|
314184
313591
|
var handleDelete = function handleDelete(key) {
|
|
314185
313592
|
var nValue = dataSource.filter(function (item) {
|
|
314186
313593
|
return item[_rowKey] !== key;
|
|
314187
|
-
});
|
|
313594
|
+
}); // onChange?.(nValue)
|
|
313595
|
+
|
|
314188
313596
|
setDataSource(nValue);
|
|
314189
313597
|
};
|
|
314190
|
-
/**
|
|
313598
|
+
/** 点击添加按钮添加 */
|
|
314191
313599
|
|
|
314192
313600
|
|
|
314193
|
-
var handleAdd =
|
|
313601
|
+
var handleAdd = function handleAdd(row) {
|
|
314194
313602
|
var _recordCreatorProps$i;
|
|
314195
313603
|
|
|
314196
313604
|
var addDataInfo = lodash.isFunction(recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData) ? recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : (_recordCreatorProps$i = recordCreatorProps.initData) === null || _recordCreatorProps$i === void 0 ? void 0 : _recordCreatorProps$i.call(recordCreatorProps) : recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.initData;
|
|
314197
313605
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
314198
313606
|
draft.push(_objectSpread(_defineProperty$1({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
314199
313607
|
});
|
|
314200
|
-
setDataSource(res);
|
|
314201
|
-
}
|
|
313608
|
+
setDataSource(res); // onChange?.(res)
|
|
313609
|
+
};
|
|
313610
|
+
|
|
313611
|
+
React.useEffect(function () {
|
|
313612
|
+
dataSourceRef.current = dataSource;
|
|
313613
|
+
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
313614
|
+
|
|
313615
|
+
if (sortOpen) {
|
|
313616
|
+
var _sortDataSorceRef$cur;
|
|
313617
|
+
|
|
313618
|
+
var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
313619
|
+
return item[_rowKey];
|
|
313620
|
+
}).join(',');
|
|
313621
|
+
var setCallBackFalgKeys = ((_sortDataSorceRef$cur = sortDataSorceRef.current) === null || _sortDataSorceRef$cur === void 0 ? void 0 : _sortDataSorceRef$cur.map(function (item) {
|
|
313622
|
+
return item[_rowKey];
|
|
313623
|
+
}).join(',')) || '';
|
|
313624
|
+
|
|
313625
|
+
if (dataSourceKeys !== setCallBackFalgKeys) {
|
|
313626
|
+
setCallBackFalg(dataSource);
|
|
313627
|
+
sortDataSorceRef.current = dataSource;
|
|
313628
|
+
}
|
|
313629
|
+
}
|
|
313630
|
+
}, [dataSource]); // /** 本地缓存一个选择数据 */
|
|
313631
|
+
// useEffect(() => {
|
|
313632
|
+
// if (rowSelection) {
|
|
313633
|
+
// const { selectedRowKeys } = rowSelection
|
|
313634
|
+
// if (selectedRowKeys) {
|
|
313635
|
+
// setLocalRowSelectList(localRowSelectList || [])
|
|
313636
|
+
// }
|
|
313637
|
+
// }
|
|
313638
|
+
// }, [rowSelection])
|
|
313639
|
+
// const editTableRowChange = (selectRows) => {
|
|
313640
|
+
// setLocalRowSelectList(selectRows);
|
|
313641
|
+
// // (rowSelection?.onChange as any)?.(selectRows)
|
|
313642
|
+
// }
|
|
314202
313643
|
|
|
314203
313644
|
var handleSave = function handleSave(row, options) {
|
|
314204
313645
|
var _deepDataSourceRef$cu, _deepDataSourceRef$cu2;
|
|
@@ -314271,26 +313712,25 @@
|
|
|
314271
313712
|
}
|
|
314272
313713
|
});
|
|
314273
313714
|
setDataSource(res);
|
|
314274
|
-
};
|
|
314275
|
-
// setDataSource((prevDataSource) => {
|
|
314276
|
-
// return prevDataSource?.map((item) => {
|
|
314277
|
-
// if (get(item, rowKey) === rowValue) {
|
|
314278
|
-
// set(item, dataIndex, nextValue)
|
|
314279
|
-
// }
|
|
314280
|
-
// return item
|
|
314281
|
-
// })
|
|
314282
|
-
// })
|
|
314283
|
-
// }
|
|
314284
|
-
// @ts-ignore
|
|
313715
|
+
};
|
|
314285
313716
|
|
|
314286
|
-
|
|
313717
|
+
var reWriteOriginSource = function reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue) {
|
|
313718
|
+
setDataSource(function (prevDataSource) {
|
|
313719
|
+
return prevDataSource === null || prevDataSource === void 0 ? void 0 : prevDataSource.map(function (item) {
|
|
313720
|
+
if (lodash.get(item, rowKey) === rowValue) {
|
|
313721
|
+
lodash.set(item, dataIndex, nextValue);
|
|
313722
|
+
}
|
|
313723
|
+
|
|
313724
|
+
return item;
|
|
313725
|
+
});
|
|
313726
|
+
});
|
|
313727
|
+
}; // @ts-ignore
|
|
314287
313728
|
|
|
314288
313729
|
|
|
314289
|
-
var handleTableRowDelete =
|
|
313730
|
+
var handleTableRowDelete = function handleTableRowDelete(key) {
|
|
314290
313731
|
var _deepDataSourceRef$cu3, _deepDataSourceRef$cu4;
|
|
314291
313732
|
|
|
314292
|
-
var
|
|
314293
|
-
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu3 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu3 === void 0 ? void 0 : (_deepDataSourceRef$cu4 = _deepDataSourceRef$cu3[rkey]) === null || _deepDataSourceRef$cu4 === void 0 ? void 0 : _deepDataSourceRef$cu4.preKeys;
|
|
313733
|
+
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu3 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu3 === void 0 ? void 0 : (_deepDataSourceRef$cu4 = _deepDataSourceRef$cu3[key]) === null || _deepDataSourceRef$cu4 === void 0 ? void 0 : _deepDataSourceRef$cu4.preKeys;
|
|
314294
313734
|
|
|
314295
313735
|
if (preKeys.length > 1) {
|
|
314296
313736
|
/** 说明删除的是children中的数据 */
|
|
@@ -314311,7 +313751,7 @@
|
|
|
314311
313751
|
return newData;
|
|
314312
313752
|
};
|
|
314313
313753
|
|
|
314314
|
-
var res = filter(
|
|
313754
|
+
var res = filter(dataSource, key);
|
|
314315
313755
|
setDataSource(res);
|
|
314316
313756
|
} else {
|
|
314317
313757
|
var _dataSourceRef$curren;
|
|
@@ -314332,74 +313772,32 @@
|
|
|
314332
313772
|
|
|
314333
313773
|
setDataSource(_res);
|
|
314334
313774
|
}
|
|
313775
|
+
};
|
|
313776
|
+
/** 快捷添加 */
|
|
314335
313777
|
|
|
314336
|
-
return null;
|
|
314337
|
-
}, 40);
|
|
314338
|
-
/** 替换当前行 */
|
|
314339
313778
|
|
|
314340
|
-
var
|
|
313779
|
+
var handleTableRowAdd = function handleTableRowAdd(record, isAppendInChindren) {
|
|
314341
313780
|
var _deepDataSourceRef$cu5, _deepDataSourceRef$cu6;
|
|
314342
313781
|
|
|
314343
|
-
var
|
|
314344
|
-
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu5 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu5 === void 0 ? void 0 : (_deepDataSourceRef$cu6 = _deepDataSourceRef$cu5[rkey]) === null || _deepDataSourceRef$cu6 === void 0 ? void 0 : _deepDataSourceRef$cu6.preKeys; // const res = cloneDeep(dataSourceRef.current)
|
|
314345
|
-
|
|
314346
|
-
var deep = function deep(children) {
|
|
314347
|
-
return children.map(function (item) {
|
|
314348
|
-
if (item[_rowKey] === rkey) {
|
|
314349
|
-
return defaultRecord;
|
|
314350
|
-
} else if (preKeys.includes(item[_rowKey]) && item.children) {
|
|
314351
|
-
var child = deep(item.children);
|
|
314352
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
314353
|
-
children: child
|
|
314354
|
-
});
|
|
314355
|
-
} else {
|
|
314356
|
-
return item;
|
|
314357
|
-
}
|
|
314358
|
-
});
|
|
314359
|
-
};
|
|
314360
|
-
|
|
314361
|
-
var res = deep(dataSourceRef.current);
|
|
314362
|
-
setDataSource(res);
|
|
314363
|
-
}, 40);
|
|
314364
|
-
/** 快捷添加 */
|
|
314365
|
-
|
|
314366
|
-
var handleTableRowAdd = lodash.debounce(function (record, isAppendInChindren, defaultRecord) {
|
|
314367
|
-
var _deepDataSourceRef$cu7, _deepDataSourceRef$cu8;
|
|
314368
|
-
|
|
314369
|
-
var rkey = lodash.isObject(record) ? record[_rowKey] : record;
|
|
314370
|
-
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu7 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu7 === void 0 ? void 0 : (_deepDataSourceRef$cu8 = _deepDataSourceRef$cu7[rkey]) === null || _deepDataSourceRef$cu8 === void 0 ? void 0 : _deepDataSourceRef$cu8.preKeys;
|
|
313782
|
+
var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu5 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu5 === void 0 ? void 0 : (_deepDataSourceRef$cu6 = _deepDataSourceRef$cu5[record[_rowKey]]) === null || _deepDataSourceRef$cu6 === void 0 ? void 0 : _deepDataSourceRef$cu6.preKeys;
|
|
314371
313783
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
314372
|
-
if (
|
|
313784
|
+
if (preKeys.length > 1) {
|
|
314373
313785
|
var deeps = function deeps(children) {
|
|
314374
313786
|
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
314375
313787
|
if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
|
|
314376
|
-
if (item[_rowKey] ===
|
|
313788
|
+
if (item[_rowKey] === record[_rowKey]) {
|
|
314377
313789
|
if (isAppendInChindren) {
|
|
314378
313790
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
314379
|
-
|
|
314380
|
-
var _item$children;
|
|
313791
|
+
var _item$children;
|
|
314381
313792
|
|
|
314382
|
-
|
|
314383
|
-
} else {
|
|
314384
|
-
var _item$children2;
|
|
314385
|
-
|
|
314386
|
-
item === null || item === void 0 ? void 0 : (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.push(defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314387
|
-
}
|
|
313793
|
+
item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.push(_defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314388
313794
|
} else {
|
|
314389
|
-
|
|
314390
|
-
item.children = _toConsumableArray$1(defaultRecord);
|
|
314391
|
-
} else {
|
|
314392
|
-
item.children = [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314393
|
-
}
|
|
313795
|
+
item.children = [_defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314394
313796
|
}
|
|
314395
313797
|
|
|
314396
313798
|
!expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [item[_rowKey]]));
|
|
314397
313799
|
} else {
|
|
314398
|
-
|
|
314399
|
-
children.splice.apply(children, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
|
|
314400
|
-
} else {
|
|
314401
|
-
children.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314402
|
-
}
|
|
313800
|
+
children.splice(index + 1, 0, _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314403
313801
|
}
|
|
314404
313802
|
} else if (item.children) {
|
|
314405
313803
|
deeps(item.children);
|
|
@@ -314411,7 +313809,7 @@
|
|
|
314411
313809
|
deeps(draft);
|
|
314412
313810
|
} else {
|
|
314413
313811
|
var index = draft.findIndex(function (item) {
|
|
314414
|
-
return
|
|
313812
|
+
return record[_rowKey] === item[_rowKey];
|
|
314415
313813
|
});
|
|
314416
313814
|
|
|
314417
313815
|
if (index !== -1) {
|
|
@@ -314419,40 +313817,27 @@
|
|
|
314419
313817
|
var _draft$index$children, _draft$index, _draft$index2;
|
|
314420
313818
|
|
|
314421
313819
|
if ((_draft$index$children = draft[index].children) === null || _draft$index$children === void 0 ? void 0 : _draft$index$children.length) {
|
|
314422
|
-
|
|
314423
|
-
var _draft$index$children2;
|
|
314424
|
-
|
|
314425
|
-
(_draft$index$children2 = draft[index].children) === null || _draft$index$children2 === void 0 ? void 0 : _draft$index$children2.push.apply(_draft$index$children2, _toConsumableArray$1(defaultRecord));
|
|
314426
|
-
} else {
|
|
314427
|
-
var _draft$index$children3;
|
|
313820
|
+
var _draft$index$children2;
|
|
314428
313821
|
|
|
314429
|
-
|
|
314430
|
-
}
|
|
313822
|
+
(_draft$index$children2 = draft[index].children) === null || _draft$index$children2 === void 0 ? void 0 : _draft$index$children2.push(_defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314431
313823
|
} else {
|
|
314432
|
-
draft[index].children =
|
|
313824
|
+
draft[index].children = [_defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314433
313825
|
}
|
|
314434
313826
|
|
|
314435
313827
|
!expandedRowKeys.includes((_draft$index = draft[index]) === null || _draft$index === void 0 ? void 0 : _draft$index[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [(_draft$index2 = draft[index]) === null || _draft$index2 === void 0 ? void 0 : _draft$index2[_rowKey]]));
|
|
314436
313828
|
} else {
|
|
314437
|
-
|
|
314438
|
-
draft.splice.apply(draft, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
|
|
314439
|
-
} else {
|
|
314440
|
-
draft.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314441
|
-
}
|
|
313829
|
+
draft.splice(index + 1, 0, _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314442
313830
|
}
|
|
314443
313831
|
}
|
|
314444
313832
|
}
|
|
314445
313833
|
});
|
|
314446
313834
|
setDataSource(res);
|
|
314447
|
-
}
|
|
314448
|
-
/** 快捷刷子功能 */
|
|
313835
|
+
};
|
|
314449
313836
|
|
|
314450
|
-
var handleCopy = function handleCopy(key, value
|
|
313837
|
+
var handleCopy = function handleCopy(key, value) {
|
|
314451
313838
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
314452
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item
|
|
314453
|
-
|
|
314454
|
-
item[key] = value;
|
|
314455
|
-
}
|
|
313839
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item) {
|
|
313840
|
+
return item[key] = value;
|
|
314456
313841
|
});
|
|
314457
313842
|
});
|
|
314458
313843
|
setDataSource(res);
|
|
@@ -314461,16 +313846,17 @@
|
|
|
314461
313846
|
|
|
314462
313847
|
|
|
314463
313848
|
var hasDisableOptions = React.useMemo(function () {
|
|
313849
|
+
// const hasOnlyOptionsDatas = columns.filter(item => item?.['componentProps']?.optionOnly)
|
|
314464
313850
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
314465
313851
|
var _item$componentProps;
|
|
314466
313852
|
|
|
314467
313853
|
var resultComponentProps = lodash.isFunction(item === null || item === void 0 ? void 0 : item.componentProps) ? item === null || item === void 0 ? void 0 : (_item$componentProps = item.componentProps) === null || _item$componentProps === void 0 ? void 0 : _item$componentProps.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
314468
313854
|
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
314469
|
-
});
|
|
313855
|
+
});
|
|
314470
313856
|
|
|
314471
313857
|
if (hasOnlyOptionsDatas.length) {
|
|
314472
313858
|
return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
|
|
314473
|
-
return item
|
|
313859
|
+
return item['dataIndex'];
|
|
314474
313860
|
});
|
|
314475
313861
|
}
|
|
314476
313862
|
|
|
@@ -314482,11 +313868,12 @@
|
|
|
314482
313868
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
314483
313869
|
var _item$componentProps2;
|
|
314484
313870
|
|
|
314485
|
-
var resultComponentProps = lodash.isFunction(item.componentProps) ? (_item$componentProps2 = item.componentProps) === null || _item$componentProps2 === void 0 ? void 0 : _item$componentProps2.call(item, {}, item) : item.componentProps;
|
|
313871
|
+
var resultComponentProps = lodash.isFunction(item.componentProps) ? item === null || item === void 0 ? void 0 : (_item$componentProps2 = item.componentProps) === null || _item$componentProps2 === void 0 ? void 0 : _item$componentProps2.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
313872
|
+
|
|
313873
|
+
var _ref8 = resultComponentProps || {},
|
|
313874
|
+
optionOnly = _ref8.optionOnly,
|
|
313875
|
+
options = _ref8.options; // const { optionOnly, options } = item['componentProps'] || {}
|
|
314486
313876
|
|
|
314487
|
-
var _ref11 = resultComponentProps || {},
|
|
314488
|
-
optionOnly = _ref11.optionOnly,
|
|
314489
|
-
options = _ref11.options;
|
|
314490
313877
|
|
|
314491
313878
|
if (optionOnly && options) {
|
|
314492
313879
|
var dataIndex = item.dataIndex;
|
|
@@ -314506,7 +313893,7 @@
|
|
|
314506
313893
|
}
|
|
314507
313894
|
|
|
314508
313895
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
314509
|
-
componentProps: _objectSpread(_objectSpread({}, item
|
|
313896
|
+
componentProps: _objectSpread(_objectSpread({}, item['componentProps']), {}, {
|
|
314510
313897
|
options: newOptions
|
|
314511
313898
|
})
|
|
314512
313899
|
});
|
|
@@ -314522,54 +313909,21 @@
|
|
|
314522
313909
|
/** 组装之后的最终columns */
|
|
314523
313910
|
|
|
314524
313911
|
var resultColumns = React.useMemo(function () {
|
|
314525
|
-
var _localColumns
|
|
313912
|
+
var _localColumns;
|
|
314526
313913
|
|
|
314527
313914
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
314528
313915
|
var localColumns = [sortOpen ? {
|
|
314529
313916
|
title: '排序',
|
|
314530
|
-
dataIndex: '
|
|
313917
|
+
dataIndex: 'sort',
|
|
314531
313918
|
width: 48,
|
|
314532
313919
|
maxWidth: 48,
|
|
314533
313920
|
className: 'drag-visible',
|
|
314534
|
-
fixed: 'left',
|
|
314535
313921
|
render: function render(_, record) {
|
|
314536
313922
|
return /*#__PURE__*/React__default['default'].createElement(Dragger$1, {
|
|
314537
|
-
id:
|
|
313923
|
+
id: record[_rowKey] || record.id
|
|
314538
313924
|
});
|
|
314539
313925
|
}
|
|
314540
|
-
} : null
|
|
314541
|
-
title: '',
|
|
314542
|
-
dataIndex: '_index',
|
|
314543
|
-
width: 48,
|
|
314544
|
-
maxWidth: 48,
|
|
314545
|
-
ellipsis: true,
|
|
314546
|
-
fixed: 'left',
|
|
314547
|
-
render: function render(_, record, index) {
|
|
314548
|
-
var _deepDataSourceRef$cu9, _deepDataSourceRef$cu10, _deepDataSourceRef$cu11;
|
|
314549
|
-
|
|
314550
|
-
console.log(deepDataSourceRef.current, '--deepDataSourceRef.current', _rowKey);
|
|
314551
|
-
return ((_deepDataSourceRef$cu9 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu9 === void 0 ? void 0 : (_deepDataSourceRef$cu10 = _deepDataSourceRef$cu9[record[_rowKey]]) === null || _deepDataSourceRef$cu10 === void 0 ? void 0 : (_deepDataSourceRef$cu11 = _deepDataSourceRef$cu10['_deepIds']) === null || _deepDataSourceRef$cu11 === void 0 ? void 0 : _deepDataSourceRef$cu11.join('-')) || "".concat(index + 1);
|
|
314552
|
-
}
|
|
314553
|
-
} : _objectSpread(_objectSpread({
|
|
314554
|
-
title: '',
|
|
314555
|
-
dataIndex: '_index',
|
|
314556
|
-
width: 48,
|
|
314557
|
-
ellipsis: true,
|
|
314558
|
-
maxWidth: 48,
|
|
314559
|
-
fixed: 'left'
|
|
314560
|
-
}, indexCol || {}), {}, {
|
|
314561
|
-
render: function render(_, record, index) {
|
|
314562
|
-
var _deepDataSourceRef$cu14, _deepDataSourceRef$cu15, _deepDataSourceRef$cu16;
|
|
314563
|
-
|
|
314564
|
-
if (lodash.isFunction(indexCol === null || indexCol === void 0 ? void 0 : indexCol.render)) {
|
|
314565
|
-
var _indexCol$render, _deepDataSourceRef$cu12, _deepDataSourceRef$cu13;
|
|
314566
|
-
|
|
314567
|
-
return indexCol === null || indexCol === void 0 ? void 0 : (_indexCol$render = indexCol.render) === null || _indexCol$render === void 0 ? void 0 : _indexCol$render.call(indexCol, record, (_deepDataSourceRef$cu12 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu12 === void 0 ? void 0 : (_deepDataSourceRef$cu13 = _deepDataSourceRef$cu12[record[_rowKey]]) === null || _deepDataSourceRef$cu13 === void 0 ? void 0 : _deepDataSourceRef$cu13['_deepIds']);
|
|
314568
|
-
}
|
|
314569
|
-
|
|
314570
|
-
return ((_deepDataSourceRef$cu14 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu14 === void 0 ? void 0 : (_deepDataSourceRef$cu15 = _deepDataSourceRef$cu14[record[_rowKey]]) === null || _deepDataSourceRef$cu15 === void 0 ? void 0 : (_deepDataSourceRef$cu16 = _deepDataSourceRef$cu15['_deepIds']) === null || _deepDataSourceRef$cu16 === void 0 ? void 0 : _deepDataSourceRef$cu16.join('-')) || "".concat(index + 1);
|
|
314571
|
-
}
|
|
314572
|
-
}) : null].concat(_toConsumableArray$1(rColumns), [useQuickOpetate ? {
|
|
313926
|
+
} : null].concat(_toConsumableArray$1(rColumns), [useQuickOpetate ? {
|
|
314573
313927
|
title: '操作',
|
|
314574
313928
|
dataIndex: 'lm_edit_opetate',
|
|
314575
313929
|
width: 68,
|
|
@@ -314580,11 +313934,11 @@
|
|
|
314580
313934
|
options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
|
|
314581
313935
|
}
|
|
314582
313936
|
} : null]).filter(function (item) {
|
|
314583
|
-
return item &&
|
|
313937
|
+
return item && item.show !== false;
|
|
314584
313938
|
});
|
|
314585
|
-
localColumns =
|
|
313939
|
+
localColumns = localColumns.map(function (item, index) {
|
|
314586
313940
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
314587
|
-
order: [null, undefined].includes(item
|
|
313941
|
+
order: [null, undefined].includes(item['order']) ? index : item['order']
|
|
314588
313942
|
});
|
|
314589
313943
|
}).sort(function (a, b) {
|
|
314590
313944
|
return a.order - b.order;
|
|
@@ -314592,7 +313946,7 @@
|
|
|
314592
313946
|
var leftColumns = [];
|
|
314593
313947
|
var mainColumns = [];
|
|
314594
313948
|
var rightColumns = [];
|
|
314595
|
-
(
|
|
313949
|
+
(_localColumns = localColumns) === null || _localColumns === void 0 ? void 0 : _localColumns.forEach(function (item) {
|
|
314596
313950
|
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
314597
313951
|
leftColumns.push(item);
|
|
314598
313952
|
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
@@ -314607,22 +313961,29 @@
|
|
|
314607
313961
|
var mapColumns = function mapColumns(col, index) {
|
|
314608
313962
|
var _col$children;
|
|
314609
313963
|
|
|
314610
|
-
if (!col.editable && !((_col$children = col.children) === null || _col$children === void 0 ? void 0 : _col$children.length)
|
|
314611
|
-
|
|
314612
|
-
|
|
314613
|
-
render: function render(text, record, i) {
|
|
314614
|
-
var _dataSource$i;
|
|
313964
|
+
if (!col.editable && !((_col$children = col.children) === null || _col$children === void 0 ? void 0 : _col$children.length)) {
|
|
313965
|
+
return col;
|
|
313966
|
+
}
|
|
314615
313967
|
|
|
314616
|
-
|
|
313968
|
+
var newCol = _objectSpread(_objectSpread({}, col), {}, {
|
|
313969
|
+
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
313970
|
+
var _col$componentProps2;
|
|
313971
|
+
|
|
313972
|
+
var dataIndex = col.dataIndex,
|
|
313973
|
+
editable = col.editable,
|
|
313974
|
+
relevanceCols = col.relevanceCols,
|
|
313975
|
+
componentProps = col.componentProps;
|
|
313976
|
+
|
|
313977
|
+
if (componentProps && lodash.isFunction(componentProps)) {
|
|
313978
|
+
return true;
|
|
314617
313979
|
}
|
|
314618
|
-
});
|
|
314619
|
-
}
|
|
314620
313980
|
|
|
314621
|
-
|
|
314622
|
-
|
|
314623
|
-
|
|
313981
|
+
if ((col === null || col === void 0 ? void 0 : col.fixed) || hasDisableOptions && hasDisableOptions.includes(dataIndex) || ((_col$componentProps2 = col.componentProps) === null || _col$componentProps2 === void 0 ? void 0 : _col$componentProps2.options) || editable === 'render' || !!relevanceCols || !!shouldUpdate || !!record.children) {
|
|
313982
|
+
return true;
|
|
313983
|
+
}
|
|
314624
313984
|
|
|
314625
|
-
|
|
313985
|
+
return record[dataIndex] !== prevRecord[dataIndex];
|
|
313986
|
+
},
|
|
314626
313987
|
onCell: function onCell(record, rowIndex) {
|
|
314627
313988
|
return {
|
|
314628
313989
|
getLength: dataSource.length,
|
|
@@ -314637,7 +313998,7 @@
|
|
|
314637
313998
|
editable: col.editable,
|
|
314638
313999
|
dataIndex: col.dataIndex,
|
|
314639
314000
|
itemProps: col.itemProps,
|
|
314640
|
-
|
|
314001
|
+
setValid: setValid,
|
|
314641
314002
|
isEdit: isEdit,
|
|
314642
314003
|
isHoverEdit: isHoverEdit,
|
|
314643
314004
|
handleAdd: handleAdd,
|
|
@@ -314645,7 +314006,8 @@
|
|
|
314645
314006
|
handleCopy: handleCopy,
|
|
314646
314007
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
314647
314008
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
314648
|
-
handleSave: handleSave
|
|
314009
|
+
handleSave: handleSave,
|
|
314010
|
+
reWriteOriginSource: reWriteOriginSource
|
|
314649
314011
|
};
|
|
314650
314012
|
}
|
|
314651
314013
|
});
|
|
@@ -314659,28 +314021,28 @@
|
|
|
314659
314021
|
return newCol;
|
|
314660
314022
|
};
|
|
314661
314023
|
|
|
314662
|
-
var res =
|
|
314024
|
+
var res = localColumns.map(function (col, index) {
|
|
314663
314025
|
return mapColumns(col, index);
|
|
314664
314026
|
});
|
|
314665
314027
|
return res;
|
|
314666
|
-
}, [columns, isAdd, sortOpen, useQuickOpetate, dataSource, _toConsumableArray$1(memoOptions)]);
|
|
314028
|
+
}, [columns, isAdd, sortOpen, useQuickOpetate, sortEditTable, dataSource, _toConsumableArray$1(memoOptions)]);
|
|
314029
|
+
var DraggableContainer = React.useCallback(function (_ref9) {
|
|
314030
|
+
var _dataSourceRef$curren2;
|
|
314667
314031
|
|
|
314668
|
-
|
|
314669
|
-
var cloneArr = _toConsumableArray$1(dataSourceRef.current);
|
|
314032
|
+
var props = _extends$2({}, _ref9);
|
|
314670
314033
|
|
|
314671
|
-
|
|
314672
|
-
|
|
314673
|
-
}
|
|
314674
|
-
|
|
314675
|
-
|
|
314676
|
-
|
|
314677
|
-
|
|
314678
|
-
};
|
|
314679
|
-
|
|
314680
|
-
var colDraggableContainer = React.useCallback(function (_ref12) {
|
|
314034
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$1, {
|
|
314035
|
+
move: onSortEnd
|
|
314036
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$1, {
|
|
314037
|
+
items: (_dataSourceRef$curren2 = dataSourceRef.current) === null || _dataSourceRef$curren2 === void 0 ? void 0 : _dataSourceRef$curren2.map(function (item) {
|
|
314038
|
+
return item[_rowKey];
|
|
314039
|
+
})
|
|
314040
|
+
}, /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, props))));
|
|
314041
|
+
}, [sortEditTable]);
|
|
314042
|
+
var colDraggableContainer = React.useCallback(function (_ref10) {
|
|
314681
314043
|
var _React$Children;
|
|
314682
314044
|
|
|
314683
|
-
var props = _extends$2({},
|
|
314045
|
+
var props = _extends$2({}, _ref10);
|
|
314684
314046
|
|
|
314685
314047
|
return /*#__PURE__*/React__default['default'].createElement("tr", null, (_React$Children = React__default['default'].Children) === null || _React$Children === void 0 ? void 0 : _React$Children.map(props.children, function (child) {
|
|
314686
314048
|
var _child$props, _child$props$column;
|
|
@@ -314689,23 +314051,45 @@
|
|
|
314689
314051
|
return child;
|
|
314690
314052
|
}
|
|
314691
314053
|
|
|
314692
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
314054
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$2, {
|
|
314693
314055
|
id: child.key
|
|
314694
314056
|
}, child);
|
|
314695
314057
|
}));
|
|
314696
314058
|
}, [columns]);
|
|
314059
|
+
var config = React.useMemo(function () {
|
|
314060
|
+
var component = {
|
|
314061
|
+
body: Object.assign({
|
|
314062
|
+
row: sortOpen ? EditableSortRow : EditableRow$1,
|
|
314063
|
+
cell: EditableCell$1
|
|
314064
|
+
}, sortOpen ? {
|
|
314065
|
+
wrapper: DraggableContainer
|
|
314066
|
+
} : {})
|
|
314067
|
+
};
|
|
314068
|
+
|
|
314069
|
+
if (colSortOpen) {
|
|
314070
|
+
component['header'] = {
|
|
314071
|
+
row: colDraggableContainer
|
|
314072
|
+
};
|
|
314073
|
+
}
|
|
314074
|
+
|
|
314075
|
+
return _objectSpread({
|
|
314076
|
+
pagination: false,
|
|
314077
|
+
tableLayout: 'fixed',
|
|
314078
|
+
scroll: {
|
|
314079
|
+
x: '100%'
|
|
314080
|
+
},
|
|
314081
|
+
rowKey: function rowKey(record) {
|
|
314082
|
+
return record[_rowKey] || record.index || Math.random();
|
|
314083
|
+
},
|
|
314084
|
+
components: component
|
|
314085
|
+
}, resetProps);
|
|
314086
|
+
}, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
|
|
314697
314087
|
React.useImperativeHandle(ref, function () {
|
|
314698
314088
|
return {
|
|
314699
314089
|
setRow: handleSave,
|
|
314700
314090
|
getCheckboxRecords: function getCheckboxRecords() {
|
|
314701
314091
|
return localRowSelectList.selectedRows;
|
|
314702
314092
|
},
|
|
314703
|
-
deleteRowData: function deleteRowData(data) {
|
|
314704
|
-
return handleTableRowDelete(data);
|
|
314705
|
-
},
|
|
314706
|
-
addRowData: function addRowData(data, defaultValue, addInChild) {
|
|
314707
|
-
return addInChild === 'replace' ? handleTableRowReplace(data, defaultValue) : handleTableRowAdd(data, addInChild, defaultValue);
|
|
314708
|
-
},
|
|
314709
314093
|
clearSelect: function clearSelect() {
|
|
314710
314094
|
setLocalRowSelectList({
|
|
314711
314095
|
selectedRows: []
|
|
@@ -314715,82 +314099,34 @@
|
|
|
314715
314099
|
setLocalRowSelectList({
|
|
314716
314100
|
selectedRows: value
|
|
314717
314101
|
});
|
|
314102
|
+
},
|
|
314103
|
+
valid: function valid() {
|
|
314104
|
+
return _valid;
|
|
314718
314105
|
}
|
|
314719
314106
|
};
|
|
314720
314107
|
});
|
|
314721
314108
|
var isShowAddAction = React.useMemo(function () {
|
|
314722
314109
|
return isEdit && isAdd || isHoverEdit && isAdd;
|
|
314723
314110
|
}, [isEdit, isAdd, isHoverEdit]);
|
|
314724
|
-
var config = React.useRef(_objectSpread({
|
|
314725
|
-
pagination: false,
|
|
314726
|
-
tableLayout: 'fixed',
|
|
314727
|
-
scroll: {
|
|
314728
|
-
x: '100%'
|
|
314729
|
-
},
|
|
314730
|
-
rowKey: function rowKey(record) {
|
|
314731
|
-
return record[_rowKey] || record.index || Math.random();
|
|
314732
|
-
},
|
|
314733
|
-
components: {
|
|
314734
|
-
table: virtual ? VirtualTable$1 : null,
|
|
314735
|
-
body: Object.assign({
|
|
314736
|
-
row: function row(rowProps) {
|
|
314737
|
-
return sortOpen ? EditableSortRow(_objectSpread(_objectSpread({}, rowProps), {}, {
|
|
314738
|
-
virtual: virtual
|
|
314739
|
-
})) : EditableRow$1(_objectSpread(_objectSpread({}, rowProps), {}, {
|
|
314740
|
-
virtual: virtual
|
|
314741
|
-
}));
|
|
314742
|
-
},
|
|
314743
|
-
cell: MemoEditableCell
|
|
314744
|
-
}, sortOpen ? {
|
|
314745
|
-
wrapper: function wrapper(wrapperProps) {
|
|
314746
|
-
var _dataSourceRef$curren2, _tableWarpRef$current, _tableWarpRef$current2;
|
|
314747
|
-
|
|
314748
|
-
return DraggableContainer(_objectSpread(_objectSpread({}, wrapperProps), {}, {
|
|
314749
|
-
virtual: virtual,
|
|
314750
|
-
keys: (_dataSourceRef$curren2 = dataSourceRef.current) === null || _dataSourceRef$curren2 === void 0 ? void 0 : _dataSourceRef$curren2.map(function (item) {
|
|
314751
|
-
return item[_rowKey];
|
|
314752
|
-
}),
|
|
314753
|
-
options: dataSourceRef.current,
|
|
314754
|
-
rowKey: _rowKey,
|
|
314755
|
-
onSortEnd: onSortEnd,
|
|
314756
|
-
tableWidth: tableWarpRef === null || tableWarpRef === void 0 ? void 0 : (_tableWarpRef$current = tableWarpRef.current) === null || _tableWarpRef$current === void 0 ? void 0 : (_tableWarpRef$current2 = _tableWarpRef$current.getBoundingClientRect()) === null || _tableWarpRef$current2 === void 0 ? void 0 : _tableWarpRef$current2.width
|
|
314757
|
-
}));
|
|
314758
|
-
}
|
|
314759
|
-
} : virtual ? {
|
|
314760
|
-
wrapper: VirtualWrapper$1
|
|
314761
|
-
} : {}),
|
|
314762
|
-
header: {
|
|
314763
|
-
row: colSortOpen ? colDraggableContainer : null
|
|
314764
|
-
}
|
|
314765
|
-
},
|
|
314766
|
-
onRow: function onRow(record, index) {
|
|
314767
|
-
return {
|
|
314768
|
-
disabled: disabled
|
|
314769
|
-
};
|
|
314770
|
-
}
|
|
314771
|
-
}, resetProps));
|
|
314772
314111
|
|
|
314773
314112
|
if (colSortOpen) {
|
|
314774
314113
|
var _localRowSelectList$s;
|
|
314775
314114
|
|
|
314776
314115
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314777
|
-
className: "lm_editTable_warpper"
|
|
314778
|
-
|
|
314779
|
-
}, /*#__PURE__*/React__default['default'].createElement(DndContainer$2, {
|
|
314780
|
-
rowKey: _rowKey,
|
|
314781
|
-
options: resultColumns,
|
|
314116
|
+
className: "lm_editTable_warpper"
|
|
314117
|
+
}, /*#__PURE__*/React__default['default'].createElement(DndContainer$1, {
|
|
314782
314118
|
move: onColSortEnd
|
|
314783
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$
|
|
314119
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$2, {
|
|
314784
314120
|
items: columns.reduce(function (acc, item) {
|
|
314785
314121
|
return [].concat(_toConsumableArray$1(acc), [item.dataIndex]);
|
|
314786
314122
|
}, [])
|
|
314787
|
-
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config
|
|
314788
|
-
loading: loading,
|
|
314123
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config), {}, {
|
|
314789
314124
|
size: size || 'small',
|
|
314790
314125
|
columns: resultColumns,
|
|
314791
314126
|
rowClassName: "editable-row",
|
|
314792
314127
|
bordered: true,
|
|
314793
314128
|
pagination: false,
|
|
314129
|
+
// components={tableComponents}
|
|
314794
314130
|
rowSelection: !rowSelection ? undefined : _objectSpread(_objectSpread({
|
|
314795
314131
|
fixed: true,
|
|
314796
314132
|
type: 'checkbox',
|
|
@@ -314800,39 +314136,36 @@
|
|
|
314800
314136
|
return lodash.isObject(v) ? v[_rowKey] : v;
|
|
314801
314137
|
}),
|
|
314802
314138
|
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
314139
|
+
// editTableRowChange(selectedRowKeys, selectedRows, info)
|
|
314803
314140
|
setLocalRowSelectList(selectedRowKeys, selectedRows, info);
|
|
314804
314141
|
}
|
|
314805
314142
|
}),
|
|
314806
314143
|
dataSource: dataSource
|
|
314807
|
-
})))), /*#__PURE__*/React__default['default'].createElement(
|
|
314808
|
-
|
|
314809
|
-
|
|
314810
|
-
|
|
314811
|
-
|
|
314812
|
-
|
|
314144
|
+
})))), isShowAddAction && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
314145
|
+
className: "lm_editTable_add_bar",
|
|
314146
|
+
type: "dashed",
|
|
314147
|
+
onClick: handleAdd,
|
|
314148
|
+
style: {
|
|
314149
|
+
marginTop: 8
|
|
314150
|
+
}
|
|
314151
|
+
}, /*#__PURE__*/React__default['default'].createElement(PlusCircleOutlined$2, {
|
|
314152
|
+
className: "lmweb-plus"
|
|
314153
|
+
}), "\u65B0\u589E"));
|
|
314813
314154
|
} // @ts-ignore
|
|
314814
314155
|
|
|
314815
314156
|
|
|
314816
314157
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314817
|
-
className: "lm_editTable_warpper"
|
|
314818
|
-
|
|
314819
|
-
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config.current), {}, {
|
|
314158
|
+
className: "lm_editTable_warpper"
|
|
314159
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config), {}, {
|
|
314820
314160
|
size: size || 'small',
|
|
314821
314161
|
columns: resultColumns,
|
|
314822
314162
|
rowClassName: "editable-row",
|
|
314823
314163
|
bordered: true,
|
|
314824
|
-
loading: loading,
|
|
314825
314164
|
pagination: false,
|
|
314826
314165
|
// components={tableComponents}
|
|
314827
314166
|
expandable: (resetProps === null || resetProps === void 0 ? void 0 : resetProps.expandable) || {
|
|
314828
314167
|
expandedRowKeys: expandedRowKeys,
|
|
314829
314168
|
fixed: true,
|
|
314830
|
-
// indentSize: 0,
|
|
314831
|
-
expandIconColumnIndex: checkExpandIconColumnIndex({
|
|
314832
|
-
rowSelection: rowSelection,
|
|
314833
|
-
sortOpen: sortOpen,
|
|
314834
|
-
indexCol: indexCol
|
|
314835
|
-
}) || 0,
|
|
314836
314169
|
onExpandedRowsChange: function onExpandedRowsChange(expandedRows) {
|
|
314837
314170
|
return setExpandedRowKeys(expandedRows);
|
|
314838
314171
|
}
|
|
@@ -314850,12 +314183,16 @@
|
|
|
314850
314183
|
}
|
|
314851
314184
|
}),
|
|
314852
314185
|
dataSource: dataSource
|
|
314853
|
-
})), /*#__PURE__*/React__default['default'].createElement(
|
|
314854
|
-
|
|
314855
|
-
|
|
314856
|
-
recordCreatorProps: recordCreatorProps,
|
|
314857
|
-
|
|
314858
|
-
|
|
314186
|
+
})), isShowAddAction && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
314187
|
+
className: "lm_editTable_add_bar",
|
|
314188
|
+
type: "dashed",
|
|
314189
|
+
onClick: (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.customAddClick) || handleAdd,
|
|
314190
|
+
style: _objectSpread({
|
|
314191
|
+
marginTop: 8
|
|
314192
|
+
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
314193
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314194
|
+
type: "lmweb-plus"
|
|
314195
|
+
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增'));
|
|
314859
314196
|
});
|
|
314860
314197
|
var LmEditTable = /*#__PURE__*/React.memo(EditTable$1);
|
|
314861
314198
|
|
|
@@ -315531,7 +314868,7 @@
|
|
|
315531
314868
|
}
|
|
315532
314869
|
}
|
|
315533
314870
|
|
|
315534
|
-
var _excluded$
|
|
314871
|
+
var _excluded$2S = ["prefixCls", "getPopupContainer", "className", "placement", "size", "disabled", "bordered", "placeholder", "status"];
|
|
315535
314872
|
function generateRangePicker$1(generateConfig) {
|
|
315536
314873
|
var RangePicker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
315537
314874
|
var customizePrefixCls = props.prefixCls,
|
|
@@ -315544,7 +314881,7 @@
|
|
|
315544
314881
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
315545
314882
|
placeholder = props.placeholder,
|
|
315546
314883
|
customStatus = props.status,
|
|
315547
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
314884
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2S);
|
|
315548
314885
|
|
|
315549
314886
|
var innerRef = React.useRef(null);
|
|
315550
314887
|
|
|
@@ -315644,7 +314981,7 @@
|
|
|
315644
314981
|
return RangePicker$1;
|
|
315645
314982
|
}
|
|
315646
314983
|
|
|
315647
|
-
var _excluded$
|
|
314984
|
+
var _excluded$2T = ["prefixCls", "getPopupContainer", "className", "size", "bordered", "placement", "placeholder", "disabled", "status"];
|
|
315648
314985
|
function generatePicker$2(generateConfig) {
|
|
315649
314986
|
function getPicker(picker, displayName) {
|
|
315650
314987
|
var Picker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -315658,7 +314995,7 @@
|
|
|
315658
314995
|
placeholder = props.placeholder,
|
|
315659
314996
|
customDisabled = props.disabled,
|
|
315660
314997
|
customStatus = props.status,
|
|
315661
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
314998
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2T);
|
|
315662
314999
|
|
|
315663
315000
|
warning$6(picker !== 'quarter', displayName, "DatePicker.".concat(displayName, " is legacy usage. Please use DatePicker[picker='").concat(picker, "'] directly."));
|
|
315664
315001
|
|
|
@@ -315866,6 +315203,63 @@
|
|
|
315866
315203
|
var DatePicker$1 = generatePicker$3(momentGenerateConfig);
|
|
315867
315204
|
DatePicker$1.AntdDatePicker = DatePicker;
|
|
315868
315205
|
|
|
315206
|
+
var getRenderPropValue$1 = function getRenderPropValue(propValue) {
|
|
315207
|
+
if (!propValue) {
|
|
315208
|
+
return null;
|
|
315209
|
+
}
|
|
315210
|
+
|
|
315211
|
+
var isRenderFunction = typeof propValue === 'function';
|
|
315212
|
+
|
|
315213
|
+
if (isRenderFunction) {
|
|
315214
|
+
return propValue();
|
|
315215
|
+
}
|
|
315216
|
+
|
|
315217
|
+
return propValue;
|
|
315218
|
+
};
|
|
315219
|
+
|
|
315220
|
+
var _excluded$2U = ["prefixCls", "title", "content", "_overlay"];
|
|
315221
|
+
var Popover$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
315222
|
+
var customizePrefixCls = _ref.prefixCls,
|
|
315223
|
+
title = _ref.title,
|
|
315224
|
+
content = _ref.content,
|
|
315225
|
+
_overlay = _ref._overlay,
|
|
315226
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$2U);
|
|
315227
|
+
|
|
315228
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
315229
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
315230
|
+
|
|
315231
|
+
var getOverlay = function getOverlay(prefixCls) {
|
|
315232
|
+
if (!title && !content) return undefined;
|
|
315233
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement("div", {
|
|
315234
|
+
className: "".concat(prefixCls, "-title")
|
|
315235
|
+
}, getRenderPropValue$1(title)), /*#__PURE__*/React.createElement("div", {
|
|
315236
|
+
className: "".concat(prefixCls, "-inner-content")
|
|
315237
|
+
}, getRenderPropValue$1(content)));
|
|
315238
|
+
};
|
|
315239
|
+
|
|
315240
|
+
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
315241
|
+
var rootPrefixCls = getPrefixCls();
|
|
315242
|
+
return /*#__PURE__*/React.createElement(Tooltip$4, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
315243
|
+
prefixCls: prefixCls,
|
|
315244
|
+
ref: ref,
|
|
315245
|
+
overlay: _overlay || getOverlay(prefixCls),
|
|
315246
|
+
transitionName: getTransitionName$9(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
315247
|
+
}));
|
|
315248
|
+
});
|
|
315249
|
+
|
|
315250
|
+
{
|
|
315251
|
+
Popover$1.displayName = 'Popover';
|
|
315252
|
+
}
|
|
315253
|
+
|
|
315254
|
+
Popover$1.defaultProps = {
|
|
315255
|
+
placement: 'top',
|
|
315256
|
+
trigger: 'hover',
|
|
315257
|
+
mouseEnterDelay: 0.1,
|
|
315258
|
+
mouseLeaveDelay: 0.1,
|
|
315259
|
+
overlayStyle: {}
|
|
315260
|
+
};
|
|
315261
|
+
Popover$1.AntdPopover = Popover;
|
|
315262
|
+
|
|
315869
315263
|
var CheckOutlined_1 = createCommonjsModule(function (module, exports) {
|
|
315870
315264
|
// This icon file is generated automatically.
|
|
315871
315265
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -316678,7 +316072,7 @@
|
|
|
316678
316072
|
|
|
316679
316073
|
var KeyCode$1 = /*@__PURE__*/getDefaultExportFromCjs(KeyCode_1);
|
|
316680
316074
|
|
|
316681
|
-
var _excluded$
|
|
316075
|
+
var _excluded$2V = ["style", "noStyle", "disabled"];
|
|
316682
316076
|
var inlineStyle$1 = {
|
|
316683
316077
|
border: 0,
|
|
316684
316078
|
background: 'transparent',
|
|
@@ -316707,7 +316101,7 @@
|
|
|
316707
316101
|
var style = props.style,
|
|
316708
316102
|
noStyle = props.noStyle,
|
|
316709
316103
|
disabled = props.disabled,
|
|
316710
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
316104
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2V);
|
|
316711
316105
|
|
|
316712
316106
|
var mergedStyle = {};
|
|
316713
316107
|
|
|
@@ -316918,7 +316312,7 @@
|
|
|
316918
316312
|
}, conditions);
|
|
316919
316313
|
});
|
|
316920
316314
|
|
|
316921
|
-
var _excluded$
|
|
316315
|
+
var _excluded$2W = ["prefixCls", "component", "className", "aria-label", "setContentRef", "children"];
|
|
316922
316316
|
|
|
316923
316317
|
var Typography$2 = function Typography(_ref, ref) {
|
|
316924
316318
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -316928,7 +316322,7 @@
|
|
|
316928
316322
|
ariaLabel = _ref['aria-label'],
|
|
316929
316323
|
setContentRef = _ref.setContentRef,
|
|
316930
316324
|
children = _ref.children,
|
|
316931
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
316325
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2W);
|
|
316932
316326
|
|
|
316933
316327
|
var _React$useContext = React.useContext(ConfigContext),
|
|
316934
316328
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -317171,7 +316565,7 @@
|
|
|
317171
316565
|
EllipsisTooltip$1.displayName = 'EllipsisTooltip';
|
|
317172
316566
|
}
|
|
317173
316567
|
|
|
317174
|
-
var _excluded$
|
|
316568
|
+
var _excluded$2X = ["prefixCls", "className", "style", "type", "disabled", "children", "ellipsis", "editable", "copyable", "component", "title"];
|
|
317175
316569
|
|
|
317176
316570
|
function wrapperDecorations$1(_ref, content) {
|
|
317177
316571
|
var mark = _ref.mark,
|
|
@@ -317223,7 +316617,7 @@
|
|
|
317223
316617
|
copyable = props.copyable,
|
|
317224
316618
|
component = props.component,
|
|
317225
316619
|
title = props.title,
|
|
317226
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
316620
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2X);
|
|
317227
316621
|
|
|
317228
316622
|
var _React$useContext = React.useContext(ConfigContext),
|
|
317229
316623
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -317641,12 +317035,12 @@
|
|
|
317641
317035
|
});
|
|
317642
317036
|
});
|
|
317643
317037
|
|
|
317644
|
-
var _excluded$
|
|
317038
|
+
var _excluded$2Y = ["ellipsis", "rel"];
|
|
317645
317039
|
|
|
317646
317040
|
var Link$2 = function Link(_ref, ref) {
|
|
317647
317041
|
var ellipsis = _ref.ellipsis,
|
|
317648
317042
|
rel = _ref.rel,
|
|
317649
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317043
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2Y);
|
|
317650
317044
|
|
|
317651
317045
|
warning$6(_typeof$1(ellipsis) !== 'object', 'Typography.Link', '`ellipsis` only supports boolean value.');
|
|
317652
317046
|
var baseRef = React.useRef(null);
|
|
@@ -317680,11 +317074,11 @@
|
|
|
317680
317074
|
|
|
317681
317075
|
var Paragraph$7 = /*#__PURE__*/React.forwardRef(Paragraph$6);
|
|
317682
317076
|
|
|
317683
|
-
var _excluded$
|
|
317077
|
+
var _excluded$2Z = ["ellipsis"];
|
|
317684
317078
|
|
|
317685
317079
|
var Text$2 = function Text(_ref, ref) {
|
|
317686
317080
|
var ellipsis = _ref.ellipsis,
|
|
317687
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317081
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2Z);
|
|
317688
317082
|
|
|
317689
317083
|
var mergedEllipsis = React.useMemo(function () {
|
|
317690
317084
|
if (ellipsis && _typeof$1(ellipsis) === 'object') {
|
|
@@ -317704,13 +317098,13 @@
|
|
|
317704
317098
|
|
|
317705
317099
|
var Text$3 = /*#__PURE__*/React.forwardRef(Text$2);
|
|
317706
317100
|
|
|
317707
|
-
var _excluded$
|
|
317101
|
+
var _excluded$2_ = ["level"];
|
|
317708
317102
|
var TITLE_ELE_LIST$1 = tupleNum$1(1, 2, 3, 4, 5);
|
|
317709
317103
|
|
|
317710
317104
|
var Title$4 = function Title(props, ref) {
|
|
317711
317105
|
var _props$level = props.level,
|
|
317712
317106
|
level = _props$level === void 0 ? 1 : _props$level,
|
|
317713
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
317107
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2_);
|
|
317714
317108
|
|
|
317715
317109
|
var component;
|
|
317716
317110
|
|
|
@@ -317815,7 +317209,7 @@
|
|
|
317815
317209
|
RefAutoComplete$1.Option = Option;
|
|
317816
317210
|
RefAutoComplete$1.AntdAutoComplete = RefAutoComplete;
|
|
317817
317211
|
|
|
317818
|
-
var _excluded$
|
|
317212
|
+
var _excluded$2$ = ["children", "treeData", "value", "defaultLabel", "disabled", "size"];
|
|
317819
317213
|
var CLMTreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
317820
317214
|
var children = props.children,
|
|
317821
317215
|
treeData = props.treeData,
|
|
@@ -317823,7 +317217,7 @@
|
|
|
317823
317217
|
defaultLabel = props.defaultLabel,
|
|
317824
317218
|
customDisabled = props.disabled,
|
|
317825
317219
|
customizeSize = props.size,
|
|
317826
|
-
resetProps = _objectWithoutProperties$1(props, _excluded$
|
|
317220
|
+
resetProps = _objectWithoutProperties$1(props, _excluded$2$); // ===================== Disabled =====================
|
|
317827
317221
|
|
|
317828
317222
|
|
|
317829
317223
|
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
@@ -317958,7 +317352,7 @@
|
|
|
317958
317352
|
return ErrorBoundary;
|
|
317959
317353
|
}(React.Component);
|
|
317960
317354
|
|
|
317961
|
-
var _excluded$
|
|
317355
|
+
var _excluded$30 = ["description", "prefixCls", "message", "banner", "className", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "duration"];
|
|
317962
317356
|
var iconMapFilled$1 = {
|
|
317963
317357
|
success: CheckCircleFilled$2,
|
|
317964
317358
|
info: InfoCircleFilled$2,
|
|
@@ -318031,7 +317425,7 @@
|
|
|
318031
317425
|
closeIcon = _ref$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined$2, null) : _ref$closeIcon,
|
|
318032
317426
|
action = _ref.action,
|
|
318033
317427
|
duration = _ref.duration,
|
|
318034
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
317428
|
+
props = _objectWithoutProperties$1(_ref, _excluded$30);
|
|
318035
317429
|
|
|
318036
317430
|
var _React$useState = React.useState(false),
|
|
318037
317431
|
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
@@ -318461,7 +317855,7 @@
|
|
|
318461
317855
|
};
|
|
318462
317856
|
};
|
|
318463
317857
|
|
|
318464
|
-
var _excluded$
|
|
317858
|
+
var _excluded$31 = ["className", "onUrge", "onDeleteComment"];
|
|
318465
317859
|
var prefixCls$b = 'lm_approval';
|
|
318466
317860
|
var colors = ['#36BCF1', '#AE86DC', '#8BD248', '#F5A173'];
|
|
318467
317861
|
var cacheColorMap = new Map();
|
|
@@ -318869,7 +318263,7 @@
|
|
|
318869
318263
|
onUrge = _props$onUrge === void 0 ? function () {} : _props$onUrge,
|
|
318870
318264
|
_props$onDeleteCommen2 = props.onDeleteComment,
|
|
318871
318265
|
onDeleteComment = _props$onDeleteCommen2 === void 0 ? function () {} : _props$onDeleteCommen2,
|
|
318872
|
-
others = _objectWithoutProperties$1(props, _excluded$
|
|
318266
|
+
others = _objectWithoutProperties$1(props, _excluded$31);
|
|
318873
318267
|
|
|
318874
318268
|
var _useState = React.useState(false),
|
|
318875
318269
|
_useState2 = _slicedToArray$1(_useState, 2),
|
|
@@ -320660,7 +320054,7 @@
|
|
|
320660
320054
|
return nodes;
|
|
320661
320055
|
}
|
|
320662
320056
|
|
|
320663
|
-
var _excluded$
|
|
320057
|
+
var _excluded$32 = ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"],
|
|
320664
320058
|
_excluded2$J = ["prefixCls", "className"];
|
|
320665
320059
|
var ConfigContext$7 = ConfigProvider$1.ConfigContext;
|
|
320666
320060
|
|
|
@@ -320685,7 +320079,7 @@
|
|
|
320685
320079
|
var defaultExpandAll = _ref2.defaultExpandAll,
|
|
320686
320080
|
defaultExpandParent = _ref2.defaultExpandParent,
|
|
320687
320081
|
defaultExpandedKeys = _ref2.defaultExpandedKeys,
|
|
320688
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
320082
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$32);
|
|
320689
320083
|
|
|
320690
320084
|
// Shift click usage
|
|
320691
320085
|
var lastSelectedKey = React.useRef();
|
|
@@ -321183,11 +320577,11 @@
|
|
|
321183
320577
|
blockNode: false
|
|
321184
320578
|
};
|
|
321185
320579
|
|
|
321186
|
-
var _excluded$
|
|
320580
|
+
var _excluded$33 = ["className"];
|
|
321187
320581
|
var prefixCls$c = 'lm_tree';
|
|
321188
320582
|
var LmTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
321189
320583
|
var className = props.className,
|
|
321190
|
-
rest = _objectWithoutProperties$1(props, _excluded$
|
|
320584
|
+
rest = _objectWithoutProperties$1(props, _excluded$33);
|
|
321191
320585
|
|
|
321192
320586
|
return /*#__PURE__*/React__default['default'].createElement(Tree$2, _objectSpread(_objectSpread({
|
|
321193
320587
|
ref: ref
|
|
@@ -322246,7 +321640,7 @@
|
|
|
322246
321640
|
}, unitNodes);
|
|
322247
321641
|
}
|
|
322248
321642
|
|
|
322249
|
-
var _excluded$
|
|
321643
|
+
var _excluded$34 = ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"];
|
|
322250
321644
|
|
|
322251
321645
|
var ScrollNumber$1 = function ScrollNumber(_ref) {
|
|
322252
321646
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -322259,7 +321653,7 @@
|
|
|
322259
321653
|
_ref$component = _ref.component,
|
|
322260
321654
|
component = _ref$component === void 0 ? 'sup' : _ref$component,
|
|
322261
321655
|
children = _ref.children,
|
|
322262
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
321656
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$34);
|
|
322263
321657
|
|
|
322264
321658
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
322265
321659
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
@@ -322309,7 +321703,7 @@
|
|
|
322309
321703
|
return /*#__PURE__*/React.createElement(component, newProps, numberNodes);
|
|
322310
321704
|
};
|
|
322311
321705
|
|
|
322312
|
-
var _excluded$
|
|
321706
|
+
var _excluded$35 = ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "showZero"];
|
|
322313
321707
|
|
|
322314
321708
|
var Badge$1 = function Badge(_ref) {
|
|
322315
321709
|
var _classNames, _classNames2;
|
|
@@ -322334,7 +321728,7 @@
|
|
|
322334
321728
|
className = _ref.className,
|
|
322335
321729
|
_ref$showZero = _ref.showZero,
|
|
322336
321730
|
showZero = _ref$showZero === void 0 ? false : _ref$showZero,
|
|
322337
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
321731
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$35);
|
|
322338
321732
|
|
|
322339
321733
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
322340
321734
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -322469,7 +321863,7 @@
|
|
|
322469
321863
|
|
|
322470
321864
|
Badge$1.Ribbon = Ribbon$1;
|
|
322471
321865
|
|
|
322472
|
-
var _excluded$
|
|
321866
|
+
var _excluded$36 = ["prefixCls", "type", "orientation", "orientationMargin", "className", "children", "dashed", "plain"];
|
|
322473
321867
|
|
|
322474
321868
|
var Divider$5 = function Divider(props) {
|
|
322475
321869
|
var _classNames;
|
|
@@ -322488,7 +321882,7 @@
|
|
|
322488
321882
|
children = props.children,
|
|
322489
321883
|
dashed = props.dashed,
|
|
322490
321884
|
plain = props.plain,
|
|
322491
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
321885
|
+
restProps = _objectWithoutProperties$1(props, _excluded$36);
|
|
322492
321886
|
|
|
322493
321887
|
var prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
322494
321888
|
var orientationPrefix = orientation.length > 0 ? "-".concat(orientation) : orientation;
|
|
@@ -322874,7 +322268,7 @@
|
|
|
322874
322268
|
}
|
|
322875
322269
|
}; // 状态管理操作
|
|
322876
322270
|
|
|
322877
|
-
var reducer$
|
|
322271
|
+
var reducer$5 = function reducer(state, action) {
|
|
322878
322272
|
var resize = action.resize,
|
|
322879
322273
|
transform = action.transform,
|
|
322880
322274
|
current = action.current;
|
|
@@ -322902,7 +322296,7 @@
|
|
|
322902
322296
|
}
|
|
322903
322297
|
}; // 仅在初始化时触发一次
|
|
322904
322298
|
|
|
322905
|
-
var initialState$
|
|
322299
|
+
var initialState$3 = function initialState(props) {
|
|
322906
322300
|
var initialIndex = props.initialIndex;
|
|
322907
322301
|
return _objectSpread(_objectSpread({}, defaultState), {}, {
|
|
322908
322302
|
currentIndex: initialIndex
|
|
@@ -323253,10 +322647,10 @@
|
|
|
323253
322647
|
var Root = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
323254
322648
|
var bodyRef = React.useRef(null);
|
|
323255
322649
|
var initialState = React.useMemo(function () {
|
|
323256
|
-
return initialState$
|
|
322650
|
+
return initialState$3(props);
|
|
323257
322651
|
}, []);
|
|
323258
322652
|
|
|
323259
|
-
var _useReducer = React.useReducer(reducer$
|
|
322653
|
+
var _useReducer = React.useReducer(reducer$5, initialState),
|
|
323260
322654
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
323261
322655
|
state = _useReducer2[0],
|
|
323262
322656
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -323322,7 +322716,7 @@
|
|
|
323322
322716
|
|
|
323323
322717
|
}; // 状态管理操作
|
|
323324
322718
|
|
|
323325
|
-
var reducer$
|
|
322719
|
+
var reducer$6 = function reducer(state, action) {
|
|
323326
322720
|
var result = action.result,
|
|
323327
322721
|
init = action.init;
|
|
323328
322722
|
|
|
@@ -323338,7 +322732,7 @@
|
|
|
323338
322732
|
}
|
|
323339
322733
|
}; // 仅在初始化时触发一次
|
|
323340
322734
|
|
|
323341
|
-
var initialState$
|
|
322735
|
+
var initialState$4 = function initialState() {
|
|
323342
322736
|
return _objectSpread({}, defaultState$1);
|
|
323343
322737
|
};
|
|
323344
322738
|
|
|
@@ -325012,14 +324406,14 @@
|
|
|
325012
324406
|
|
|
325013
324407
|
var Body$1 = /*#__PURE__*/React__default['default'].memo(Index$b);
|
|
325014
324408
|
|
|
325015
|
-
var _excluded$
|
|
324409
|
+
var _excluded$37 = ["value", "onChange", "leftIcon", "rightIcon"];
|
|
325016
324410
|
|
|
325017
324411
|
var ResetSlider = function ResetSlider(_ref) {
|
|
325018
324412
|
var value = _ref.value,
|
|
325019
324413
|
_onChange = _ref.onChange,
|
|
325020
324414
|
leftIcon = _ref.leftIcon,
|
|
325021
324415
|
rightIcon = _ref.rightIcon,
|
|
325022
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
324416
|
+
props = _objectWithoutProperties$1(_ref, _excluded$37);
|
|
325023
324417
|
|
|
325024
324418
|
// 减
|
|
325025
324419
|
var decrement = function decrement() {
|
|
@@ -325173,10 +324567,10 @@
|
|
|
325173
324567
|
|
|
325174
324568
|
var LmBox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
325175
324569
|
var initialState = React.useMemo(function () {
|
|
325176
|
-
return initialState$
|
|
324570
|
+
return initialState$4();
|
|
325177
324571
|
}, []);
|
|
325178
324572
|
|
|
325179
|
-
var _useReducer = React.useReducer(reducer$
|
|
324573
|
+
var _useReducer = React.useReducer(reducer$6, initialState),
|
|
325180
324574
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
325181
324575
|
state = _useReducer2[0],
|
|
325182
324576
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -325239,7 +324633,7 @@
|
|
|
325239
324633
|
|
|
325240
324634
|
}; // 状态管理操作
|
|
325241
324635
|
|
|
325242
|
-
var reducer$
|
|
324636
|
+
var reducer$7 = function reducer(state, action) {
|
|
325243
324637
|
var transform = action.transform,
|
|
325244
324638
|
current = action.current,
|
|
325245
324639
|
visible = action.visible;
|
|
@@ -325272,7 +324666,7 @@
|
|
|
325272
324666
|
}
|
|
325273
324667
|
}; // 仅在初始化时触发一次
|
|
325274
324668
|
|
|
325275
|
-
var initialState$
|
|
324669
|
+
var initialState$5 = function initialState(props) {
|
|
325276
324670
|
var initialIndex = props.initialIndex;
|
|
325277
324671
|
return _objectSpread(_objectSpread({}, defaultState$2), {}, {
|
|
325278
324672
|
currentIndex: initialIndex
|
|
@@ -325662,10 +325056,10 @@
|
|
|
325662
325056
|
var LmImageViewerRoot = function LmImageViewerRoot(props, ref) {
|
|
325663
325057
|
var previewRef = React.useRef(null);
|
|
325664
325058
|
var initialState = React.useMemo(function () {
|
|
325665
|
-
return initialState$
|
|
325059
|
+
return initialState$5(props);
|
|
325666
325060
|
}, []);
|
|
325667
325061
|
|
|
325668
|
-
var _useReducer = React.useReducer(reducer$
|
|
325062
|
+
var _useReducer = React.useReducer(reducer$7, initialState),
|
|
325669
325063
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
325670
325064
|
state = _useReducer2[0],
|
|
325671
325065
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -325720,7 +325114,7 @@
|
|
|
325720
325114
|
|
|
325721
325115
|
var LmImageViewer$1 = /*#__PURE__*/React.forwardRef(LmImageViewer);
|
|
325722
325116
|
|
|
325723
|
-
var SortableItem$
|
|
325117
|
+
var SortableItem$3 = function SortableItem(_ref) {
|
|
325724
325118
|
var index = _ref.index,
|
|
325725
325119
|
item = _ref.item,
|
|
325726
325120
|
instance = _ref.instance;
|
|
@@ -325756,7 +325150,7 @@
|
|
|
325756
325150
|
})));
|
|
325757
325151
|
};
|
|
325758
325152
|
|
|
325759
|
-
var SortableItem$
|
|
325153
|
+
var SortableItem$4 = /*#__PURE__*/React__default['default'].memo(SortableItem$3);
|
|
325760
325154
|
|
|
325761
325155
|
var SortableBox$3 = function SortableBox(_ref) {
|
|
325762
325156
|
var instance = _ref.instance;
|
|
@@ -325767,7 +325161,7 @@
|
|
|
325767
325161
|
items: items,
|
|
325768
325162
|
strategy: rectSortingStrategy
|
|
325769
325163
|
}, options === null || options === void 0 ? void 0 : options.map(function (item, idx) {
|
|
325770
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
325164
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$4, {
|
|
325771
325165
|
instance: instance,
|
|
325772
325166
|
index: idx,
|
|
325773
325167
|
key: item[rowKey] || idx,
|
|
@@ -325778,7 +325172,7 @@
|
|
|
325778
325172
|
|
|
325779
325173
|
var SortableBox$4 = /*#__PURE__*/React__default['default'].memo(SortableBox$3);
|
|
325780
325174
|
|
|
325781
|
-
var DragOver
|
|
325175
|
+
var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
325782
325176
|
var instance = _ref.instance;
|
|
325783
325177
|
var isDragging = instance.isDragging,
|
|
325784
325178
|
activeId = instance.activeId,
|
|
@@ -325800,7 +325194,7 @@
|
|
|
325800
325194
|
*/
|
|
325801
325195
|
// 可拖拽容器
|
|
325802
325196
|
|
|
325803
|
-
var DndContainer$
|
|
325197
|
+
var DndContainer$2 = function DndContainer(_ref2) {
|
|
325804
325198
|
var options = _ref2.options,
|
|
325805
325199
|
rowKey = _ref2.rowKey,
|
|
325806
325200
|
children = _ref2.children,
|
|
@@ -325887,7 +325281,7 @@
|
|
|
325887
325281
|
collisionDetection: closestCenter
|
|
325888
325282
|
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$4, {
|
|
325889
325283
|
instance: instance
|
|
325890
|
-
}), /*#__PURE__*/React__default['default'].createElement(DragOver
|
|
325284
|
+
}), /*#__PURE__*/React__default['default'].createElement(DragOver, {
|
|
325891
325285
|
instance: instance
|
|
325892
325286
|
}));
|
|
325893
325287
|
};
|
|
@@ -325897,7 +325291,7 @@
|
|
|
325897
325291
|
React.useImperativeHandle(ref, function () {
|
|
325898
325292
|
return {};
|
|
325899
325293
|
});
|
|
325900
|
-
return /*#__PURE__*/React__default['default'].createElement(DndContainer$
|
|
325294
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$2, _objectSpread({}, props));
|
|
325901
325295
|
};
|
|
325902
325296
|
|
|
325903
325297
|
var Root$2 = /*#__PURE__*/React.forwardRef(Root$1);
|