linkmore-design 1.1.25 → 1.1.27-alpha.0
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 +6 -3
- package/dist/LmEditTable/EditTable.d.ts +10 -5
- package/dist/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/dist/LmEditTable/components/index.d.ts +16 -0
- package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/dist/LmEditTable/sortableItem.d.ts +3 -2
- package/dist/LmEditTable/util.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualRowBack.d.ts +6 -0
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/dist/LmEditTable/virtual/context.d.ts +13 -0
- package/dist/LmEditTable/virtual/index.d.ts +4 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.umd.js +1173 -537
- package/dist/index.umd.min.js +8 -8
- package/dist/variables.css +65 -0
- package/es/Input/index.js +27 -2
- package/es/InputNumber/index.js +7 -9
- package/es/LmEditTable/DndContainer.d.ts +6 -3
- package/es/LmEditTable/DndContainer.js +70 -10
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +10 -5
- package/es/LmEditTable/EditTable.js +352 -360
- package/es/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/es/LmEditTable/components/DraggableContainer.js +39 -0
- package/es/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/es/LmEditTable/components/QuickOpetate.js +82 -0
- package/es/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/es/LmEditTable/components/bottomOpetateComponent.js +23 -0
- package/es/LmEditTable/components/index.d.ts +16 -0
- package/es/LmEditTable/components/index.js +7 -0
- package/es/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/es/LmEditTable/hooks/useForkRef.js +22 -0
- package/es/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/es/LmEditTable/rowSort/DndContainerRow.js +81 -0
- package/es/LmEditTable/sortableItem.d.ts +3 -2
- package/es/LmEditTable/sortableItem.js +16 -4
- package/es/LmEditTable/sortableItemCol.js +40 -10
- package/es/LmEditTable/style/index.css +65 -0
- package/es/LmEditTable/style/variables.css +65 -0
- package/es/LmEditTable/util.d.ts +7 -0
- package/es/LmEditTable/util.js +92 -7
- package/es/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow.js +62 -0
- package/es/LmEditTable/virtual/VirtualRowBack.d.ts +6 -0
- package/es/LmEditTable/virtual/VirtualRowBack.js +100 -0
- package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualTable.js +54 -0
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
- package/es/LmEditTable/virtual/context.d.ts +13 -0
- package/es/LmEditTable/virtual/context.js +54 -0
- package/es/LmEditTable/virtual/index.d.ts +4 -0
- package/es/LmEditTable/virtual/index.js +4 -0
- package/es/LmFilter/filterFns/index.js +7 -2
- package/es/LmTable/virTual/VirtualRow.js +12 -14
- package/es/LmUpload/LmUpload.js +4 -2
- package/es/hooks/useEvent/index.js +1 -1
- package/es/index.d.ts +1 -2
- package/es/styles/variables.css +65 -0
- package/lib/Input/index.js +29 -2
- package/lib/InputNumber/index.js +9 -9
- package/lib/LmEditTable/DndContainer.d.ts +6 -3
- package/lib/LmEditTable/DndContainer.js +74 -9
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +10 -5
- package/lib/LmEditTable/EditTable.js +349 -357
- package/lib/LmEditTable/components/DraggableContainer.d.ts +10 -0
- package/lib/LmEditTable/components/DraggableContainer.js +52 -0
- package/lib/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/lib/LmEditTable/components/QuickOpetate.js +96 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.js +34 -0
- package/lib/LmEditTable/components/index.d.ts +16 -0
- package/lib/LmEditTable/components/index.js +37 -0
- package/lib/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/lib/LmEditTable/hooks/useForkRef.js +29 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.js +99 -0
- package/lib/LmEditTable/sortableItem.d.ts +3 -2
- package/lib/LmEditTable/sortableItem.js +19 -5
- package/lib/LmEditTable/sortableItemCol.js +37 -8
- package/lib/LmEditTable/style/index.css +65 -0
- package/lib/LmEditTable/style/variables.css +65 -0
- package/lib/LmEditTable/util.d.ts +7 -0
- package/lib/LmEditTable/util.js +97 -6
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow.js +78 -0
- package/lib/LmEditTable/virtual/VirtualRowBack.d.ts +6 -0
- package/lib/LmEditTable/virtual/VirtualRowBack.js +113 -0
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualTable.js +71 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
- package/lib/LmEditTable/virtual/context.d.ts +13 -0
- package/lib/LmEditTable/virtual/context.js +64 -0
- package/lib/LmEditTable/virtual/index.d.ts +4 -0
- package/lib/LmEditTable/virtual/index.js +31 -0
- package/lib/LmFilter/filterFns/index.js +7 -2
- package/lib/LmTable/virTual/VirtualRow.js +12 -14
- package/lib/LmUpload/LmUpload.js +7 -2
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/styles/variables.css +65 -0
- package/package.json +11 -9
package/dist/index.umd.js
CHANGED
|
@@ -92885,7 +92885,12 @@
|
|
|
92885
92885
|
fieldType: (item === null || item === void 0 ? void 0 : item.valueType) || 'string',
|
|
92886
92886
|
type: item.type,
|
|
92887
92887
|
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
92888
|
-
|
|
92888
|
+
|
|
92889
|
+
/**
|
|
92890
|
+
* and 等同于逻辑关系contains: 选中的值包含所有值
|
|
92891
|
+
* or 等同于逻辑关系in: 选中的值存在于所有值之中
|
|
92892
|
+
*/
|
|
92893
|
+
operator: obj[cur].mode === 'and' ? 'contains' : 'in'
|
|
92889
92894
|
}]);
|
|
92890
92895
|
}
|
|
92891
92896
|
|
|
@@ -93055,7 +93060,7 @@
|
|
|
93055
93060
|
fieldType: (item === null || item === void 0 ? void 0 : item.valueType) || 'string',
|
|
93056
93061
|
type: item.type,
|
|
93057
93062
|
value: Array.isArray(itemValue) ? itemValue : [itemValue],
|
|
93058
|
-
operator: complexFilter[cur].mode === 'and' ? '
|
|
93063
|
+
operator: complexFilter[cur].mode === 'and' ? 'contains' : 'in'
|
|
93059
93064
|
};
|
|
93060
93065
|
}
|
|
93061
93066
|
|
|
@@ -182591,7 +182596,8 @@
|
|
|
182591
182596
|
_ossConfig = _ref.ossConfig,
|
|
182592
182597
|
resetProps = _objectWithoutProperties$1(_ref, _excluded$1c);
|
|
182593
182598
|
|
|
182594
|
-
var defaultRef = React.useRef(null);
|
|
182599
|
+
var defaultRef = React.useRef(null);
|
|
182600
|
+
var disabled = React__default['default'].useContext(DisabledContext$1); // 仅在初始化触发一次
|
|
182595
182601
|
|
|
182596
182602
|
var initConfig = React.useMemo(function () {
|
|
182597
182603
|
return {
|
|
@@ -182649,7 +182655,7 @@
|
|
|
182649
182655
|
type: ['jpg', 'jpeg', 'png'],
|
|
182650
182656
|
listType: 'card',
|
|
182651
182657
|
readOnly: false,
|
|
182652
|
-
disabled: false,
|
|
182658
|
+
disabled: disabled || false,
|
|
182653
182659
|
showUploadList: true,
|
|
182654
182660
|
fileList: null,
|
|
182655
182661
|
defaultFileList: [],
|
|
@@ -188652,8 +188658,9 @@
|
|
|
188652
188658
|
};
|
|
188653
188659
|
|
|
188654
188660
|
var _excluded$1i = ["className", "size", "disabled", "allowClear"],
|
|
188655
|
-
_excluded2$i = ["allowClear", "className"],
|
|
188656
|
-
_excluded3$5 = ["
|
|
188661
|
+
_excluded2$i = ["allowClear", "className", "size", "disabled"],
|
|
188662
|
+
_excluded3$5 = ["size", "disabled"],
|
|
188663
|
+
_excluded4$1 = ["allowClear", "className"];
|
|
188657
188664
|
var LmInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188658
188665
|
var className = props.className,
|
|
188659
188666
|
customSize = props.size,
|
|
@@ -188681,25 +188688,48 @@
|
|
|
188681
188688
|
var _props$allowClear2 = props.allowClear,
|
|
188682
188689
|
allowClear = _props$allowClear2 === void 0 ? true : _props$allowClear2,
|
|
188683
188690
|
className = props.className,
|
|
188684
|
-
|
|
188691
|
+
customSize = props.size,
|
|
188692
|
+
customDisabled = props.disabled,
|
|
188693
|
+
rest = _objectWithoutProperties$1(props, _excluded2$i); // ===================== Size =====================
|
|
188694
|
+
|
|
188685
188695
|
|
|
188696
|
+
var size = customSize || React__default['default'].useContext(SizeContext$1) || 'middle'; // ===================== Disabled =====================
|
|
188697
|
+
|
|
188698
|
+
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
188699
|
+
var mergedDisabled = customDisabled || disabled;
|
|
188686
188700
|
return /*#__PURE__*/React__default['default'].createElement(Input$3.Search, _objectSpread(_objectSpread({
|
|
188687
188701
|
enterButton: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
188688
188702
|
type: "lmweb-search"
|
|
188689
188703
|
})
|
|
188690
188704
|
}, rest), {}, {
|
|
188691
188705
|
ref: ref,
|
|
188706
|
+
disabled: mergedDisabled || undefined,
|
|
188692
188707
|
allowClear: allowClear,
|
|
188708
|
+
size: size,
|
|
188693
188709
|
className: classnames('lm_input_search', className)
|
|
188694
188710
|
}));
|
|
188695
188711
|
});
|
|
188696
|
-
LmInput.TextArea =
|
|
188712
|
+
LmInput.TextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188713
|
+
var customSize = props.size,
|
|
188714
|
+
customDisabled = props.disabled,
|
|
188715
|
+
rest = _objectWithoutProperties$1(props, _excluded3$5); // ===================== Size =====================
|
|
188716
|
+
|
|
188717
|
+
|
|
188718
|
+
var size = customSize || React__default['default'].useContext(SizeContext$1) || 'middle'; // ===================== Disabled =====================
|
|
188719
|
+
|
|
188720
|
+
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
188721
|
+
var mergedDisabled = customDisabled || disabled;
|
|
188722
|
+
return /*#__PURE__*/React__default['default'].createElement(Input$3.TextArea, _objectSpread({
|
|
188723
|
+
size: size,
|
|
188724
|
+
disabled: mergedDisabled || undefined
|
|
188725
|
+
}, rest));
|
|
188726
|
+
});
|
|
188697
188727
|
|
|
188698
188728
|
LmInput.Password = function (props) {
|
|
188699
188729
|
var _props$allowClear3 = props.allowClear,
|
|
188700
188730
|
allowClear = _props$allowClear3 === void 0 ? true : _props$allowClear3,
|
|
188701
188731
|
className = props.className,
|
|
188702
|
-
rest = _objectWithoutProperties$1(props,
|
|
188732
|
+
rest = _objectWithoutProperties$1(props, _excluded4$1);
|
|
188703
188733
|
|
|
188704
188734
|
return /*#__PURE__*/React__default['default'].createElement(Input$3.Password, _objectSpread(_objectSpread({
|
|
188705
188735
|
className: classnames('lm_input_password', className),
|
|
@@ -188717,8 +188747,7 @@
|
|
|
188717
188747
|
|
|
188718
188748
|
var _excluded$1j = ["children", "className", "disabled", "size"];
|
|
188719
188749
|
var prefixCls$3 = 'lm_input-number';
|
|
188720
|
-
|
|
188721
|
-
var LMInputNumber = function LMInputNumber(props) {
|
|
188750
|
+
var LMInputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188722
188751
|
var children = props.children,
|
|
188723
188752
|
className = props.className,
|
|
188724
188753
|
customDisabled = props.disabled,
|
|
@@ -188732,24 +188761,24 @@
|
|
|
188732
188761
|
var size = React__default['default'].useContext(SizeContext$1);
|
|
188733
188762
|
var mergeSize = customizeSize || size;
|
|
188734
188763
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread(_objectSpread({
|
|
188764
|
+
ref: ref,
|
|
188735
188765
|
className: classnames(className, prefixCls$3),
|
|
188736
188766
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
188737
188767
|
}, rest), {}, {
|
|
188738
188768
|
size: mergeSize,
|
|
188739
188769
|
disabled: mergedDisabled
|
|
188740
188770
|
}));
|
|
188741
|
-
};
|
|
188742
|
-
|
|
188771
|
+
});
|
|
188743
188772
|
var CInputNumber = LMInputNumber;
|
|
188744
|
-
|
|
188745
|
-
CInputNumber.Price = function (props) {
|
|
188773
|
+
CInputNumber.Price = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188746
188774
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread({
|
|
188747
188775
|
prefix: "\uFFE5",
|
|
188776
|
+
ref: ref,
|
|
188748
188777
|
formatter: function formatter(value) {
|
|
188749
188778
|
return "".concat(value).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
188750
188779
|
}
|
|
188751
188780
|
}, props));
|
|
188752
|
-
};
|
|
188781
|
+
});
|
|
188753
188782
|
|
|
188754
188783
|
var getRenderPropValue = function getRenderPropValue(propValue) {
|
|
188755
188784
|
if (!propValue) {
|
|
@@ -233609,6 +233638,14 @@
|
|
|
233609
233638
|
return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);
|
|
233610
233639
|
};
|
|
233611
233640
|
|
|
233641
|
+
const restrictToVerticalAxis = ({
|
|
233642
|
+
transform
|
|
233643
|
+
}) => {
|
|
233644
|
+
return { ...transform,
|
|
233645
|
+
x: 0
|
|
233646
|
+
};
|
|
233647
|
+
};
|
|
233648
|
+
|
|
233612
233649
|
var DndContainer = function DndContainer(_ref) {
|
|
233613
233650
|
var children = _ref.children,
|
|
233614
233651
|
move = _ref.move;
|
|
@@ -285950,12 +285987,16 @@
|
|
|
285950
285987
|
var rowHeight = state.rowHeight,
|
|
285951
285988
|
totalLen = state.totalLen;
|
|
285952
285989
|
var virtualItems = instance.columnVirtual.virtualItems;
|
|
285953
|
-
var trRef = React.useRef(null); //
|
|
285990
|
+
var trRef = React.useRef(null); // 非固定列长度
|
|
285954
285991
|
|
|
285955
285992
|
var columnsLen = React.useMemo(function () {
|
|
285956
|
-
var _children$
|
|
285993
|
+
var _children$filter$leng;
|
|
285957
285994
|
|
|
285958
|
-
return (_children$
|
|
285995
|
+
return (_children$filter$leng = children === null || children === void 0 ? void 0 : children.filter(function (v) {
|
|
285996
|
+
var _v$props, _v$props2;
|
|
285997
|
+
|
|
285998
|
+
return typeof ((_v$props = v.props) === null || _v$props === void 0 ? void 0 : _v$props.fixLeft) !== 'number' && typeof ((_v$props2 = v.props) === null || _v$props2 === void 0 ? void 0 : _v$props2.fixRight) !== 'number';
|
|
285999
|
+
}).length) !== null && _children$filter$leng !== void 0 ? _children$filter$leng : 0; // return children?.length ?? 0
|
|
285959
286000
|
}, [children]);
|
|
285960
286001
|
React.useEffect(function () {
|
|
285961
286002
|
if (state.columnsLen !== columnsLen) {
|
|
@@ -286004,26 +286045,20 @@
|
|
|
286004
286045
|
fixedRight: [],
|
|
286005
286046
|
columns: []
|
|
286006
286047
|
});
|
|
286007
|
-
}, [children]); //
|
|
286008
|
-
|
|
286009
|
-
var resetVirtualItems = React.useMemo(function () {
|
|
286010
|
-
var fixedLeft = fixedColumns.fixedLeft,
|
|
286011
|
-
columns = fixedColumns.columns;
|
|
286012
|
-
return virtualItems.slice(fixedLeft.length, fixedLeft.length + columns.length);
|
|
286013
|
-
}, [fixedColumns, virtualItems]); // 横线单元格合并
|
|
286048
|
+
}, [children]); // 横线单元格合并
|
|
286014
286049
|
|
|
286015
286050
|
var colSpan = React.useMemo(function () {
|
|
286016
|
-
var
|
|
286051
|
+
var _virtualItems$;
|
|
286017
286052
|
|
|
286018
|
-
|
|
286019
|
-
|
|
286020
|
-
|
|
286053
|
+
return (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index;
|
|
286054
|
+
}, [virtualItems]);
|
|
286055
|
+
console.log('virtualItems', virtualItems);
|
|
286021
286056
|
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetProps), {}, {
|
|
286022
286057
|
ref: Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef
|
|
286023
286058
|
}), fixedColumns.fixedLeft, !!colSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
286024
286059
|
colSpan: colSpan
|
|
286025
|
-
}),
|
|
286026
|
-
return
|
|
286060
|
+
}), virtualItems.map(function (virtualCol) {
|
|
286061
|
+
return fixedColumns.columns[virtualCol.index];
|
|
286027
286062
|
}), fixedColumns.fixedRight);
|
|
286028
286063
|
});
|
|
286029
286064
|
|
|
@@ -287635,7 +287670,12 @@
|
|
|
287635
287670
|
|
|
287636
287671
|
return React.useCallback(function () {
|
|
287637
287672
|
var fn = handlerRef.current;
|
|
287638
|
-
|
|
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);
|
|
287639
287679
|
}, []);
|
|
287640
287680
|
}
|
|
287641
287681
|
|
|
@@ -312624,16 +312664,59 @@
|
|
|
312624
312664
|
|
|
312625
312665
|
Form$4.Wrapper = Wrapper;
|
|
312626
312666
|
|
|
312627
|
-
var
|
|
312628
|
-
var
|
|
312629
|
-
|
|
312667
|
+
var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
312668
|
+
var instance = _ref.instance;
|
|
312669
|
+
var isDragging = instance.isDragging,
|
|
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
|
+
|
|
312630
312700
|
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
312631
312701
|
coordinateGetter: sortableKeyboardCoordinates
|
|
312632
|
-
})); //
|
|
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
|
+
|
|
312633
312715
|
|
|
312634
312716
|
var handleDragEnd = function handleDragEnd(event) {
|
|
312635
312717
|
var active = event.active,
|
|
312636
|
-
over = event.over;
|
|
312718
|
+
over = event.over;
|
|
312719
|
+
setActiveId(null); // 未移入时触发
|
|
312637
312720
|
|
|
312638
312721
|
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
312639
312722
|
return;
|
|
@@ -312645,39 +312728,267 @@
|
|
|
312645
312728
|
}
|
|
312646
312729
|
};
|
|
312647
312730
|
|
|
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
|
+
};
|
|
312648
312742
|
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
312649
312743
|
sensors: sensors,
|
|
312650
312744
|
collisionDetection: closestCenter,
|
|
312745
|
+
onDragStart: handleDragStart,
|
|
312651
312746
|
onDragEnd: handleDragEnd,
|
|
312747
|
+
onDragCancel: function onDragCancel() {
|
|
312748
|
+
return setActiveId(null);
|
|
312749
|
+
},
|
|
312652
312750
|
modifiers: [restrictToParentElement]
|
|
312653
|
-
}, children
|
|
312751
|
+
}, children, /*#__PURE__*/React__default['default'].createElement(DragOver, {
|
|
312752
|
+
instance: instance
|
|
312753
|
+
}));
|
|
312654
312754
|
};
|
|
312655
312755
|
|
|
312756
|
+
var DndContainer$2 = /*#__PURE__*/React.memo(DndContainer$1);
|
|
312757
|
+
|
|
312656
312758
|
var SortableBox$1 = function SortableBox(_ref) {
|
|
312657
312759
|
var items = _ref.items,
|
|
312658
312760
|
children = _ref.children;
|
|
312659
312761
|
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
312660
312762
|
items: items,
|
|
312661
|
-
strategy:
|
|
312763
|
+
strategy: horizontalListSortingStrategy
|
|
312662
312764
|
}, children);
|
|
312663
312765
|
};
|
|
312664
312766
|
|
|
312665
|
-
var
|
|
312666
|
-
|
|
312667
|
-
|
|
312668
|
-
|
|
312669
|
-
|
|
312670
|
-
|
|
312671
|
-
|
|
312767
|
+
var TableContext$2 = /*#__PURE__*/React.createContext({
|
|
312768
|
+
state: null,
|
|
312769
|
+
dispatch: null,
|
|
312770
|
+
instance: {}
|
|
312771
|
+
});
|
|
312772
|
+
|
|
312773
|
+
var useStore$1 = function useStore() {
|
|
312774
|
+
return React.useContext(TableContext$2);
|
|
312672
312775
|
};
|
|
312673
312776
|
|
|
312674
|
-
var
|
|
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);
|
|
312816
|
+
};
|
|
312817
|
+
|
|
312818
|
+
var VirtualTable$1 = /*#__PURE__*/React__default['default'].memo(function (tableProps) {
|
|
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"];
|
|
312675
312985
|
|
|
312676
312986
|
var SortableItem$1 = function SortableItem(props) {
|
|
312677
312987
|
var key = props['data-row-key'],
|
|
312678
312988
|
children = props.children,
|
|
312679
312989
|
className = props.className,
|
|
312680
|
-
|
|
312990
|
+
virtual = props.virtual,
|
|
312991
|
+
resetField = _objectWithoutProperties$1(props, _excluded$2R);
|
|
312681
312992
|
|
|
312682
312993
|
var _useSortable = useSortable({
|
|
312683
312994
|
id: key
|
|
@@ -312691,27 +313002,66 @@
|
|
|
312691
313002
|
transform: CSS.Transform.toString(transform),
|
|
312692
313003
|
transition: transition
|
|
312693
313004
|
};
|
|
312694
|
-
|
|
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), {}, {
|
|
312695
313015
|
ref: setNodeRef,
|
|
313016
|
+
pref: setNodeRef,
|
|
312696
313017
|
key: key,
|
|
312697
313018
|
style: style
|
|
312698
313019
|
}, attributes), children);
|
|
312699
313020
|
};
|
|
312700
313021
|
|
|
312701
|
-
var
|
|
312702
|
-
var Item$5 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
312703
|
-
var _children$props;
|
|
313022
|
+
var SortableItem$2 = /*#__PURE__*/React.memo(SortableItem$1);
|
|
312704
313023
|
|
|
313024
|
+
var _excluded$2S = ["children"];
|
|
313025
|
+
// children: React.ReactNode
|
|
313026
|
+
// }
|
|
313027
|
+
// interface ItemInstance {}
|
|
313028
|
+
// @ts-ignore
|
|
313029
|
+
|
|
313030
|
+
var Item$5 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
312705
313031
|
var children = _ref.children,
|
|
312706
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
313032
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2S);
|
|
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>
|
|
312707
313057
|
|
|
312708
|
-
|
|
312709
|
-
ref: ref
|
|
312710
|
-
}), (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.children) || children);
|
|
313058
|
+
);
|
|
312711
313059
|
});
|
|
312712
|
-
function SortableItem$
|
|
313060
|
+
function SortableItem$3(props) {
|
|
313061
|
+
var id = props.id;
|
|
313062
|
+
|
|
312713
313063
|
var _useSortable = useSortable({
|
|
312714
|
-
id:
|
|
313064
|
+
id: id
|
|
312715
313065
|
}),
|
|
312716
313066
|
attributes = _useSortable.attributes,
|
|
312717
313067
|
listeners = _useSortable.listeners,
|
|
@@ -312721,7 +313071,9 @@
|
|
|
312721
313071
|
|
|
312722
313072
|
var style = {
|
|
312723
313073
|
position: 'relative',
|
|
312724
|
-
transform: CSS.Translate.toString(transform),
|
|
313074
|
+
transform: CSS.Translate.toString(transform ? _objectSpread(_objectSpread({}, transform), {}, {
|
|
313075
|
+
y: 0
|
|
313076
|
+
}) : transform),
|
|
312725
313077
|
transition: transition,
|
|
312726
313078
|
touchAction: 'none',
|
|
312727
313079
|
height: '40px',
|
|
@@ -312751,7 +313103,7 @@
|
|
|
312751
313103
|
touchAction: 'none',
|
|
312752
313104
|
cursor: 'move'
|
|
312753
313105
|
},
|
|
312754
|
-
className:
|
|
313106
|
+
className: "icon_drag".concat(isDragging ? 'bing' : '')
|
|
312755
313107
|
}));
|
|
312756
313108
|
};
|
|
312757
313109
|
|
|
@@ -312763,19 +313115,20 @@
|
|
|
312763
313115
|
function deepDataSourcePreKeys(dataSource, rowKey) {
|
|
312764
313116
|
var deepDataSource = [];
|
|
312765
313117
|
|
|
312766
|
-
var eachChildren = function eachChildren(children, preKeys) {
|
|
312767
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
313118
|
+
var eachChildren = function eachChildren(children, preKeys, deepIds) {
|
|
313119
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
312768
313120
|
deepDataSource.push(_objectSpread(_objectSpread({}, item), {}, {
|
|
312769
|
-
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])
|
|
313121
|
+
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]]),
|
|
313122
|
+
_deepIds: [].concat(_toConsumableArray$1(deepIds), [index + 1])
|
|
312770
313123
|
}));
|
|
312771
313124
|
|
|
312772
313125
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
312773
|
-
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]] })
|
|
313126
|
+
eachChildren(item === null || item === void 0 ? void 0 : item.children, [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]]), [].concat(_toConsumableArray$1(deepIds), [index + 1])); // deepDataSource.push({ ...item, preKeys: [...preKeys, item[rowKey]] })
|
|
312774
313127
|
}
|
|
312775
313128
|
});
|
|
312776
313129
|
};
|
|
312777
313130
|
|
|
312778
|
-
eachChildren(dataSource, []);
|
|
313131
|
+
eachChildren(dataSource, [], []);
|
|
312779
313132
|
return lodash.keyBy(deepDataSource, rowKey);
|
|
312780
313133
|
}
|
|
312781
313134
|
function isExpandRow(children) {
|
|
@@ -312807,21 +313160,366 @@
|
|
|
312807
313160
|
|
|
312808
313161
|
return _objectSpread(_objectSpread({}, v), {}, _defineProperty$1({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
|
|
312809
313162
|
});
|
|
312810
|
-
return res;
|
|
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';
|
|
312811
313424
|
}
|
|
312812
313425
|
|
|
312813
|
-
|
|
313426
|
+
Popover$1.defaultProps = {
|
|
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"],
|
|
312814
313511
|
_excluded2$I = ["index"],
|
|
312815
313512
|
_excluded3$b = ["value", "onChange", "record", "rowIndex", "colIndex", "validator"],
|
|
312816
|
-
_excluded4$
|
|
313513
|
+
_excluded4$2 = ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps"],
|
|
312817
313514
|
_excluded5 = ["onMouseEnter", "onMouseLeave"],
|
|
312818
|
-
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"];
|
|
313515
|
+
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "virtual", "sortOpen", "disabled", "colSortOpen", "indexCol", "filterChange", "size", "recordCreatorProps", "shouldUpdate", "loading"];
|
|
312819
313516
|
var UploadBtn$1 = UploadOss.UploadBtn;
|
|
312820
313517
|
var EditableContext$1 = /*#__PURE__*/React__default['default'].createContext(null); // 表格行
|
|
312821
313518
|
|
|
312822
313519
|
var EditableRow$1 = function EditableRow(_ref) {
|
|
312823
313520
|
var index = _ref.index,
|
|
312824
|
-
|
|
313521
|
+
virtual = _ref.virtual,
|
|
313522
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2V);
|
|
312825
313523
|
|
|
312826
313524
|
var _Form$useForm = Form$4.useForm(),
|
|
312827
313525
|
_Form$useForm2 = _slicedToArray$1(_Form$useForm, 1),
|
|
@@ -312832,7 +313530,7 @@
|
|
|
312832
313530
|
component: false
|
|
312833
313531
|
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
312834
313532
|
value: form
|
|
312835
|
-
}, /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
313533
|
+
}, virtual ? /*#__PURE__*/React__default['default'].createElement(VirtualRow$1, _objectSpread({}, props)) : /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
312836
313534
|
};
|
|
312837
313535
|
|
|
312838
313536
|
var EditableSortRow = function EditableSortRow(_ref2) {
|
|
@@ -312845,10 +313543,11 @@
|
|
|
312845
313543
|
|
|
312846
313544
|
return /*#__PURE__*/React__default['default'].createElement(Form$4, {
|
|
312847
313545
|
form: form,
|
|
313546
|
+
disabled: props.disabled || false,
|
|
312848
313547
|
component: false
|
|
312849
313548
|
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
312850
313549
|
value: form
|
|
312851
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
313550
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$2, _objectSpread({}, props))));
|
|
312852
313551
|
};
|
|
312853
313552
|
|
|
312854
313553
|
var UploadSingle$1 = function UploadSingle(props) {
|
|
@@ -312975,88 +313674,7 @@
|
|
|
312975
313674
|
return handleInput(e, 'next');
|
|
312976
313675
|
}
|
|
312977
313676
|
}, editEnum))));
|
|
312978
|
-
};
|
|
312979
|
-
|
|
312980
|
-
|
|
312981
|
-
var Opetate$1 = function Opetate(_ref4) {
|
|
312982
|
-
var record = _ref4.record,
|
|
312983
|
-
rowKey = _ref4.rowKey,
|
|
312984
|
-
handleAdd = _ref4.handleAdd,
|
|
312985
|
-
handleDelete = _ref4.handleDelete,
|
|
312986
|
-
_ref4$options = _ref4.options,
|
|
312987
|
-
options = _ref4$options === void 0 ? ['add', 'delete'] : _ref4$options,
|
|
312988
|
-
getLength = _ref4.getLength,
|
|
312989
|
-
quickOpetateClearAll = _ref4.quickOpetateClearAll;
|
|
312990
|
-
|
|
312991
|
-
var appendChildren = function appendChildren() {
|
|
312992
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
312993
|
-
};
|
|
312994
|
-
|
|
312995
|
-
var appendAdd = function appendAdd() {
|
|
312996
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
312997
|
-
};
|
|
312998
|
-
|
|
312999
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313000
|
-
style: {
|
|
313001
|
-
display: 'flex',
|
|
313002
|
-
alignItems: 'center',
|
|
313003
|
-
justifyContent: 'flex-start',
|
|
313004
|
-
marginLeft: '-4px'
|
|
313005
|
-
}
|
|
313006
|
-
}, options.includes('delete') && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313007
|
-
type: "link",
|
|
313008
|
-
size: "small",
|
|
313009
|
-
disabled: !quickOpetateClearAll && getLength < 2,
|
|
313010
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313011
|
-
type: "lmweb-minus-circle",
|
|
313012
|
-
style: {
|
|
313013
|
-
fontSize: 16
|
|
313014
|
-
}
|
|
313015
|
-
}),
|
|
313016
|
-
onClick: function onClick() {
|
|
313017
|
-
return handleDelete(record[rowKey]);
|
|
313018
|
-
}
|
|
313019
|
-
}), (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, {
|
|
313020
|
-
placement: "bottom",
|
|
313021
|
-
overlayClassName: 'lm_table_append_add_popover',
|
|
313022
|
-
open: open,
|
|
313023
|
-
title: null,
|
|
313024
|
-
content: /*#__PURE__*/React__default['default'].createElement("ul", null, /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313025
|
-
onClick: appendAdd
|
|
313026
|
-
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313027
|
-
onClick: appendChildren
|
|
313028
|
-
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
313029
|
-
trigger: "hover"
|
|
313030
|
-
}, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313031
|
-
type: "link",
|
|
313032
|
-
size: "small",
|
|
313033
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313034
|
-
type: "lmweb-plus-circle-fill",
|
|
313035
|
-
style: {
|
|
313036
|
-
fontSize: 16
|
|
313037
|
-
}
|
|
313038
|
-
})
|
|
313039
|
-
})) : (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, {
|
|
313040
|
-
type: "link",
|
|
313041
|
-
size: "small",
|
|
313042
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313043
|
-
type: "lmweb-plus-circle-fill",
|
|
313044
|
-
style: {
|
|
313045
|
-
fontSize: 16
|
|
313046
|
-
}
|
|
313047
|
-
}),
|
|
313048
|
-
onClick: function onClick() {
|
|
313049
|
-
return handleAdd(record, (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? true : false);
|
|
313050
|
-
}
|
|
313051
|
-
}) : null);
|
|
313052
|
-
}; // const isValidValue = (verifyValue) => {
|
|
313053
|
-
// const toStringValue = JSON.stringify(verifyValue);
|
|
313054
|
-
// if (verifyValue === undefined || verifyValue === null || verifyValue === '' || toStringValue === '[]' || toStringValue === '{}') {
|
|
313055
|
-
// return false;
|
|
313056
|
-
// }
|
|
313057
|
-
// return true;
|
|
313058
|
-
// }
|
|
313059
|
-
|
|
313677
|
+
};
|
|
313060
313678
|
/*
|
|
313061
313679
|
表格单元格
|
|
313062
313680
|
editEnum: 下拉框时的数据数组(非数组时是配置设置)
|
|
@@ -313086,9 +313704,7 @@
|
|
|
313086
313704
|
handleDelete = props.handleDelete,
|
|
313087
313705
|
handleCopy = props.handleCopy,
|
|
313088
313706
|
itemProps = props.itemProps,
|
|
313089
|
-
|
|
313090
|
-
reWriteOriginSource = props.reWriteOriginSource,
|
|
313091
|
-
restProps = _objectWithoutProperties$1(props, _excluded4$1);
|
|
313707
|
+
restProps = _objectWithoutProperties$1(props, _excluded4$2);
|
|
313092
313708
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
313093
313709
|
|
|
313094
313710
|
|
|
@@ -313108,6 +313724,12 @@
|
|
|
313108
313724
|
|
|
313109
313725
|
var inputRef = React.useRef(null);
|
|
313110
313726
|
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
|
+
|
|
313111
313733
|
React.useEffect(function () {
|
|
313112
313734
|
if (editing) {
|
|
313113
313735
|
var _inputRef$current;
|
|
@@ -313118,17 +313740,11 @@
|
|
|
313118
313740
|
|
|
313119
313741
|
var toggleEdit = function toggleEdit() {
|
|
313120
313742
|
setEditing(!editing); // form.setFieldsValue({ [dataIndex]: record[dataIndex] });
|
|
313121
|
-
}; //
|
|
313122
|
-
// const focusCapturedRef = useRef(false);
|
|
313123
|
-
// const curValue = useMemo(() => {
|
|
313124
|
-
// return record?.dataIndex
|
|
313125
|
-
// }, [record])
|
|
313126
|
-
// const curValueIsValid = isValidValue(curValue);
|
|
313127
|
-
// 校验保存
|
|
313743
|
+
}; // 校验保存
|
|
313128
313744
|
|
|
313129
313745
|
|
|
313130
313746
|
var save = /*#__PURE__*/function () {
|
|
313131
|
-
var
|
|
313747
|
+
var _ref4 = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee(row) {
|
|
313132
313748
|
var values, resultComponentProps;
|
|
313133
313749
|
return _regeneratorRuntime$1().wrap(function _callee$(_context) {
|
|
313134
313750
|
while (1) {
|
|
@@ -313176,13 +313792,7 @@
|
|
|
313176
313792
|
case 13:
|
|
313177
313793
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
313178
313794
|
toggleEdit();
|
|
313179
|
-
}
|
|
313180
|
-
// setValid((old) => {
|
|
313181
|
-
// const obj = { ...old }
|
|
313182
|
-
// delete obj[record[rowKey]]
|
|
313183
|
-
// return obj
|
|
313184
|
-
// })
|
|
313185
|
-
|
|
313795
|
+
}
|
|
313186
313796
|
|
|
313187
313797
|
_context.next = 18;
|
|
313188
313798
|
break;
|
|
@@ -313200,7 +313810,7 @@
|
|
|
313200
313810
|
}));
|
|
313201
313811
|
|
|
313202
313812
|
return function save(_x) {
|
|
313203
|
-
return
|
|
313813
|
+
return _ref4.apply(this, arguments);
|
|
313204
313814
|
};
|
|
313205
313815
|
}(); // 触发保存
|
|
313206
313816
|
|
|
@@ -313211,16 +313821,15 @@
|
|
|
313211
313821
|
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
313212
313822
|
|
|
313213
313823
|
|
|
313214
|
-
var copyKey = function copyKey(e) {
|
|
313824
|
+
var copyKey = function copyKey(e, type) {
|
|
313215
313825
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
313216
313826
|
var dataIndex = col.dataIndex;
|
|
313217
|
-
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]);
|
|
313827
|
+
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex], type, props.rowIndex);
|
|
313218
313828
|
};
|
|
313219
313829
|
|
|
313220
313830
|
var Control = function Control(con) {
|
|
313221
313831
|
var _col$newOptions;
|
|
313222
313832
|
|
|
313223
|
-
// const resultComponentProps = isFunction(componentProps) ? componentProps?.(record, col) : componentProps
|
|
313224
313833
|
var resultComponentProps = lodash.isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
313225
313834
|
|
|
313226
313835
|
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)) {
|
|
@@ -313229,7 +313838,7 @@
|
|
|
313229
313838
|
});
|
|
313230
313839
|
}
|
|
313231
313840
|
|
|
313232
|
-
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue']);
|
|
313841
|
+
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue', 'quickcopy']);
|
|
313233
313842
|
|
|
313234
313843
|
switch (con) {
|
|
313235
313844
|
case 'input':
|
|
@@ -313250,19 +313859,12 @@
|
|
|
313250
313859
|
noStyle: true
|
|
313251
313860
|
}, /*#__PURE__*/React__default['default'].cloneElement(resultComponentProps.addonAfter, {
|
|
313252
313861
|
onChange: handleFormItemChange
|
|
313253
|
-
})) : null,
|
|
313254
|
-
suffix: resultComponentProps.quickcopy ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
313255
|
-
className: 'lm_table_quickcopy'
|
|
313256
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313257
|
-
onClick: copyKey,
|
|
313258
|
-
type: 'lmweb-icon_m_brush'
|
|
313259
313862
|
})) : null
|
|
313260
313863
|
}));
|
|
313261
313864
|
|
|
313262
313865
|
case 'inputRange':
|
|
313263
313866
|
return /*#__PURE__*/React__default['default'].createElement(InputRange$1, _objectSpread(_objectSpread({
|
|
313264
|
-
onChange: handleFormItemChange
|
|
313265
|
-
ref: inputRef
|
|
313867
|
+
onChange: handleFormItemChange
|
|
313266
313868
|
}, resultComponentProps), {}, {
|
|
313267
313869
|
record: record,
|
|
313268
313870
|
rowIndex: rowIndex,
|
|
@@ -313338,7 +313940,7 @@
|
|
|
313338
313940
|
|
|
313339
313941
|
case 'switch':
|
|
313340
313942
|
return /*#__PURE__*/React__default['default'].createElement(Switch$2, _objectSpread(_objectSpread({
|
|
313341
|
-
size:
|
|
313943
|
+
size: "small"
|
|
313342
313944
|
}, clearAttrComponentProps), {}, {
|
|
313343
313945
|
onChange: handleFormItemChange
|
|
313344
313946
|
}));
|
|
@@ -313352,10 +313954,9 @@
|
|
|
313352
313954
|
|
|
313353
313955
|
case 'operate':
|
|
313354
313956
|
case 'lm_edit_opetate':
|
|
313355
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
313957
|
+
return /*#__PURE__*/React__default['default'].createElement(QuickOpetate, _objectSpread({
|
|
313356
313958
|
record: record,
|
|
313357
313959
|
rowKey: rowKey,
|
|
313358
|
-
ref: inputRef,
|
|
313359
313960
|
handleAdd: handleTableRowAdd,
|
|
313360
313961
|
handleDelete: handleTableRowDelete,
|
|
313361
313962
|
getLength: getLength,
|
|
@@ -313369,7 +313970,7 @@
|
|
|
313369
313970
|
var fromData = form.getFieldsValue();
|
|
313370
313971
|
return render === null || render === void 0 ? void 0 : render(_objectSpread(_objectSpread({}, !isObjEmpty(fromData) ? _objectSpread(_objectSpread({}, record), {}, _defineProperty$1({}, dataIndex, fromData[dataIndex])) : record), {}, {
|
|
313371
313972
|
onChange: save
|
|
313372
|
-
}));
|
|
313973
|
+
}), rowIndex);
|
|
313373
313974
|
}
|
|
313374
313975
|
|
|
313375
313976
|
default:
|
|
@@ -313404,7 +314005,8 @@
|
|
|
313404
314005
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
313405
314006
|
style: {
|
|
313406
314007
|
margin: 0
|
|
313407
|
-
}
|
|
314008
|
+
},
|
|
314009
|
+
noStyle: formProps ? false : true
|
|
313408
314010
|
}, formProps), {}, {
|
|
313409
314011
|
name: dataIndex
|
|
313410
314012
|
}), Control(editable)));
|
|
@@ -313416,6 +314018,7 @@
|
|
|
313416
314018
|
margin: 0
|
|
313417
314019
|
}
|
|
313418
314020
|
}, formProps), {}, {
|
|
314021
|
+
noStyle: formProps ? false : true,
|
|
313419
314022
|
name: [dataIndex, 'value']
|
|
313420
314023
|
}), Control(editable)));
|
|
313421
314024
|
}
|
|
@@ -313428,31 +314031,68 @@
|
|
|
313428
314031
|
}
|
|
313429
314032
|
|
|
313430
314033
|
return childNode;
|
|
313431
|
-
}, [col, isEdit, editing, getLength]); //
|
|
313432
|
-
// 出现死循环找我
|
|
314034
|
+
}, [col, isEdit, editing, getLength, record]); // 出现死循环找我
|
|
313433
314035
|
|
|
313434
314036
|
React.useEffect(function () {
|
|
313435
314037
|
var editable = col.editable,
|
|
313436
314038
|
dataIndex = col.dataIndex;
|
|
313437
314039
|
|
|
313438
314040
|
if (isEdit && editable) {
|
|
313439
|
-
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date' ? hooks(record[dataIndex]) : record[dataIndex]));
|
|
313440
|
-
}
|
|
313441
|
-
// (isEdit && editable && record[dataIndex]) ||
|
|
313442
|
-
// (isHoverEdit && editable && record[dataIndex])
|
|
313443
|
-
// ) {
|
|
313444
|
-
// form.setFieldsValue({
|
|
313445
|
-
// [dataIndex]: editable === 'date' ? moment(record[dataIndex]) : record[dataIndex],
|
|
313446
|
-
// })
|
|
313447
|
-
// }
|
|
313448
|
-
|
|
314041
|
+
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date' && record[dataIndex] ? hooks(record[dataIndex]) : record[dataIndex]));
|
|
314042
|
+
}
|
|
313449
314043
|
}, [record]);
|
|
314044
|
+
|
|
314045
|
+
var handleTdHover = function handleTdHover() {
|
|
314046
|
+
setHoverStatus(true);
|
|
314047
|
+
};
|
|
314048
|
+
|
|
314049
|
+
var handleTdMouseOut = function handleTdMouseOut() {
|
|
314050
|
+
setHoverStatus(false);
|
|
314051
|
+
};
|
|
314052
|
+
|
|
313450
314053
|
return /*#__PURE__*/React__default['default'].createElement("td", _objectSpread(_objectSpread({}, lodash.omit(clearProps, ['dataIndex'])), {}, {
|
|
313451
314054
|
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,
|
|
313452
314057
|
key: "r".concat(rowIndex, "_c").concat(colIndex)
|
|
313453
|
-
}),
|
|
314058
|
+
}), hoverStatus && props.rowIndex > 0 && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
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
|
+
})));
|
|
313454
314073
|
};
|
|
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))
|
|
313455
314086
|
|
|
314087
|
+
/** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
|
|
314088
|
+
|
|
314089
|
+
|
|
314090
|
+
if (!checkMemoShouldUploadSpecialFun(prev, next)) {
|
|
314091
|
+
return false;
|
|
314092
|
+
}
|
|
314093
|
+
|
|
314094
|
+
return lodash.isEqual(p, n);
|
|
314095
|
+
});
|
|
313456
314096
|
var EditTable$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
313457
314097
|
var _localRowSelectList$s2;
|
|
313458
314098
|
|
|
@@ -313471,16 +314111,21 @@
|
|
|
313471
314111
|
_props$quickOpetateCl = props.quickOpetateClearAll,
|
|
313472
314112
|
quickOpetateClearAll = _props$quickOpetateCl === void 0 ? true : _props$quickOpetateCl,
|
|
313473
314113
|
rowSelection = props.rowSelection,
|
|
314114
|
+
virtual = props.virtual,
|
|
313474
314115
|
sortOpen = props.sortOpen,
|
|
314116
|
+
disabled = props.disabled,
|
|
313475
314117
|
colSortOpen = props.colSortOpen,
|
|
314118
|
+
_props$indexCol = props.indexCol,
|
|
314119
|
+
indexCol = _props$indexCol === void 0 ? false : _props$indexCol,
|
|
313476
314120
|
filterChange = props.filterChange,
|
|
313477
314121
|
_props$size = props.size,
|
|
313478
314122
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
313479
314123
|
recordCreatorProps = props.recordCreatorProps,
|
|
313480
314124
|
_props$shouldUpdate = props.shouldUpdate,
|
|
313481
314125
|
shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
|
|
313482
|
-
|
|
313483
|
-
|
|
314126
|
+
_props$loading = props.loading,
|
|
314127
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
314128
|
+
resetProps = _objectWithoutProperties$1(props, _excluded6);
|
|
313484
314129
|
|
|
313485
314130
|
var _useControllableValue = useControllableValue({
|
|
313486
314131
|
value: checkRowKeyByDataSource(props.value, _rowKey),
|
|
@@ -313488,14 +314133,7 @@
|
|
|
313488
314133
|
}),
|
|
313489
314134
|
_useControllableValue2 = _slicedToArray$1(_useControllableValue, 2),
|
|
313490
314135
|
dataSource = _useControllableValue2[0],
|
|
313491
|
-
setDataSource = _useControllableValue2[1];
|
|
313492
|
-
|
|
313493
|
-
|
|
313494
|
-
var _useState5 = React.useState({}),
|
|
313495
|
-
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
313496
|
-
_valid = _useState6[0],
|
|
313497
|
-
setValid = _useState6[1]; // const [localRowSelectList, setLocalRowSelectList] = useState([])
|
|
313498
|
-
|
|
314136
|
+
setDataSource = _useControllableValue2[1];
|
|
313499
314137
|
|
|
313500
314138
|
var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
|
|
313501
314139
|
var _rowSelection$onChang;
|
|
@@ -313512,43 +314150,28 @@
|
|
|
313512
314150
|
_useControllableValue4 = _slicedToArray$1(_useControllableValue3, 2),
|
|
313513
314151
|
localRowSelectList = _useControllableValue4[0],
|
|
313514
314152
|
setLocalRowSelectList = _useControllableValue4[1];
|
|
314153
|
+
/** TODO: 当前展开的列 */
|
|
314154
|
+
|
|
313515
314155
|
|
|
313516
314156
|
var _useState7 = React.useState([]),
|
|
313517
314157
|
_useState8 = _slicedToArray$1(_useState7, 2),
|
|
313518
|
-
|
|
313519
|
-
|
|
313520
|
-
/** 当前展开的列 */
|
|
314158
|
+
expandedRowKeys = _useState8[0],
|
|
314159
|
+
setExpandedRowKeys = _useState8[1];
|
|
313521
314160
|
|
|
313522
|
-
|
|
313523
|
-
var
|
|
313524
|
-
|
|
313525
|
-
|
|
313526
|
-
|
|
313527
|
-
|
|
313528
|
-
var dataSourceRef = React.useRef([]);
|
|
313529
|
-
var sortDataSorceRef = React.useRef([]);
|
|
313530
|
-
var deepDataSourceRef = React.useRef([]);
|
|
313531
|
-
|
|
313532
|
-
var onSortEnd = function onSortEnd(active, over) {
|
|
313533
|
-
var cloneArr = _toConsumableArray$1(dataSourceRef.current);
|
|
313534
|
-
|
|
313535
|
-
var oldIndex = cloneArr.findIndex(function (v) {
|
|
313536
|
-
return v[_rowKey] === active;
|
|
313537
|
-
});
|
|
313538
|
-
var newIndex = cloneArr.findIndex(function (v) {
|
|
313539
|
-
return v[_rowKey] === over;
|
|
313540
|
-
});
|
|
313541
|
-
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
313542
|
-
};
|
|
314161
|
+
var dataSourceRef = React.useRef(dataSource);
|
|
314162
|
+
var deepDataSourceRef = React.useRef(deepDataSourcePreKeys(dataSource, _rowKey));
|
|
314163
|
+
dataSourceRef.current = dataSource;
|
|
314164
|
+
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
314165
|
+
var tableWarpRef = React.useRef(null);
|
|
313543
314166
|
|
|
313544
314167
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
313545
314168
|
var _arrayMove;
|
|
313546
314169
|
|
|
313547
314170
|
var oldIndex = columns.findIndex(function (item) {
|
|
313548
|
-
return item
|
|
314171
|
+
return item.dataIndex === active;
|
|
313549
314172
|
});
|
|
313550
314173
|
var newIndex = columns.findIndex(function (item) {
|
|
313551
|
-
return item
|
|
314174
|
+
return item.dataIndex === over;
|
|
313552
314175
|
});
|
|
313553
314176
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange((_arrayMove = arrayMove(columns, oldIndex, newIndex)) === null || _arrayMove === void 0 ? void 0 : _arrayMove.map(function (item, index) {
|
|
313554
314177
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -313561,55 +314184,21 @@
|
|
|
313561
314184
|
var handleDelete = function handleDelete(key) {
|
|
313562
314185
|
var nValue = dataSource.filter(function (item) {
|
|
313563
314186
|
return item[_rowKey] !== key;
|
|
313564
|
-
});
|
|
313565
|
-
|
|
314187
|
+
});
|
|
313566
314188
|
setDataSource(nValue);
|
|
313567
314189
|
};
|
|
313568
|
-
/**
|
|
314190
|
+
/** 点击底部添加按钮添加 */
|
|
313569
314191
|
|
|
313570
314192
|
|
|
313571
|
-
var handleAdd = function
|
|
314193
|
+
var handleAdd = lodash.debounce(function (row) {
|
|
313572
314194
|
var _recordCreatorProps$i;
|
|
313573
314195
|
|
|
313574
314196
|
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;
|
|
313575
314197
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313576
314198
|
draft.push(_objectSpread(_defineProperty$1({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
313577
314199
|
});
|
|
313578
|
-
setDataSource(res);
|
|
313579
|
-
};
|
|
313580
|
-
|
|
313581
|
-
React.useEffect(function () {
|
|
313582
|
-
dataSourceRef.current = dataSource;
|
|
313583
|
-
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
313584
|
-
|
|
313585
|
-
if (sortOpen) {
|
|
313586
|
-
var _sortDataSorceRef$cur;
|
|
313587
|
-
|
|
313588
|
-
var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
313589
|
-
return item[_rowKey];
|
|
313590
|
-
}).join(',');
|
|
313591
|
-
var setCallBackFalgKeys = ((_sortDataSorceRef$cur = sortDataSorceRef.current) === null || _sortDataSorceRef$cur === void 0 ? void 0 : _sortDataSorceRef$cur.map(function (item) {
|
|
313592
|
-
return item[_rowKey];
|
|
313593
|
-
}).join(',')) || '';
|
|
313594
|
-
|
|
313595
|
-
if (dataSourceKeys !== setCallBackFalgKeys) {
|
|
313596
|
-
setCallBackFalg(dataSource);
|
|
313597
|
-
sortDataSorceRef.current = dataSource;
|
|
313598
|
-
}
|
|
313599
|
-
}
|
|
313600
|
-
}, [dataSource]); // /** 本地缓存一个选择数据 */
|
|
313601
|
-
// useEffect(() => {
|
|
313602
|
-
// if (rowSelection) {
|
|
313603
|
-
// const { selectedRowKeys } = rowSelection
|
|
313604
|
-
// if (selectedRowKeys) {
|
|
313605
|
-
// setLocalRowSelectList(localRowSelectList || [])
|
|
313606
|
-
// }
|
|
313607
|
-
// }
|
|
313608
|
-
// }, [rowSelection])
|
|
313609
|
-
// const editTableRowChange = (selectRows) => {
|
|
313610
|
-
// setLocalRowSelectList(selectRows);
|
|
313611
|
-
// // (rowSelection?.onChange as any)?.(selectRows)
|
|
313612
|
-
// }
|
|
314200
|
+
setDataSource(res);
|
|
314201
|
+
}, 40);
|
|
313613
314202
|
|
|
313614
314203
|
var handleSave = function handleSave(row, options) {
|
|
313615
314204
|
var _deepDataSourceRef$cu, _deepDataSourceRef$cu2;
|
|
@@ -313682,25 +314271,26 @@
|
|
|
313682
314271
|
}
|
|
313683
314272
|
});
|
|
313684
314273
|
setDataSource(res);
|
|
313685
|
-
};
|
|
313686
|
-
|
|
313687
|
-
|
|
313688
|
-
|
|
313689
|
-
|
|
313690
|
-
|
|
313691
|
-
|
|
313692
|
-
|
|
314274
|
+
}; // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
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
|
|
313693
314285
|
|
|
313694
|
-
|
|
313695
|
-
});
|
|
313696
|
-
});
|
|
313697
|
-
}; // @ts-ignore
|
|
314286
|
+
/** 删除当前行 */
|
|
313698
314287
|
|
|
313699
314288
|
|
|
313700
|
-
var handleTableRowDelete = function
|
|
314289
|
+
var handleTableRowDelete = lodash.debounce(function (key) {
|
|
313701
314290
|
var _deepDataSourceRef$cu3, _deepDataSourceRef$cu4;
|
|
313702
314291
|
|
|
313703
|
-
var
|
|
314292
|
+
var rkey = lodash.isObject(key) ? key[_rowKey] : key;
|
|
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;
|
|
313704
314294
|
|
|
313705
314295
|
if (preKeys.length > 1) {
|
|
313706
314296
|
/** 说明删除的是children中的数据 */
|
|
@@ -313721,7 +314311,7 @@
|
|
|
313721
314311
|
return newData;
|
|
313722
314312
|
};
|
|
313723
314313
|
|
|
313724
|
-
var res = filter(
|
|
314314
|
+
var res = filter(dataSourceRef.current, key);
|
|
313725
314315
|
setDataSource(res);
|
|
313726
314316
|
} else {
|
|
313727
314317
|
var _dataSourceRef$curren;
|
|
@@ -313742,32 +314332,74 @@
|
|
|
313742
314332
|
|
|
313743
314333
|
setDataSource(_res);
|
|
313744
314334
|
}
|
|
313745
|
-
};
|
|
313746
|
-
/** 快捷添加 */
|
|
313747
314335
|
|
|
314336
|
+
return null;
|
|
314337
|
+
}, 40);
|
|
314338
|
+
/** 替换当前行 */
|
|
313748
314339
|
|
|
313749
|
-
var
|
|
314340
|
+
var handleTableRowReplace = lodash.debounce(function (record, defaultRecord) {
|
|
313750
314341
|
var _deepDataSourceRef$cu5, _deepDataSourceRef$cu6;
|
|
313751
314342
|
|
|
313752
|
-
var
|
|
314343
|
+
var rkey = lodash.isObject(record) ? record[_rowKey] : record;
|
|
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;
|
|
313753
314371
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313754
|
-
if (preKeys.length > 1) {
|
|
314372
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
313755
314373
|
var deeps = function deeps(children) {
|
|
313756
314374
|
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
313757
314375
|
if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
|
|
313758
|
-
if (item[_rowKey] ===
|
|
314376
|
+
if (item[_rowKey] === rkey) {
|
|
313759
314377
|
if (isAppendInChindren) {
|
|
313760
314378
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
313761
|
-
|
|
314379
|
+
if (Array.isArray(defaultRecord)) {
|
|
314380
|
+
var _item$children;
|
|
313762
314381
|
|
|
313763
|
-
|
|
314382
|
+
item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.push.apply(_item$children, _toConsumableArray$1(defaultRecord));
|
|
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
|
+
}
|
|
313764
314388
|
} else {
|
|
313765
|
-
|
|
314389
|
+
if (Array.isArray(defaultRecord)) {
|
|
314390
|
+
item.children = _toConsumableArray$1(defaultRecord);
|
|
314391
|
+
} else {
|
|
314392
|
+
item.children = [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314393
|
+
}
|
|
313766
314394
|
}
|
|
313767
314395
|
|
|
313768
314396
|
!expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [item[_rowKey]]));
|
|
313769
314397
|
} else {
|
|
313770
|
-
|
|
314398
|
+
if (Array.isArray(defaultRecord)) {
|
|
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
|
+
}
|
|
313771
314403
|
}
|
|
313772
314404
|
} else if (item.children) {
|
|
313773
314405
|
deeps(item.children);
|
|
@@ -313779,7 +314411,7 @@
|
|
|
313779
314411
|
deeps(draft);
|
|
313780
314412
|
} else {
|
|
313781
314413
|
var index = draft.findIndex(function (item) {
|
|
313782
|
-
return
|
|
314414
|
+
return rkey === item[_rowKey];
|
|
313783
314415
|
});
|
|
313784
314416
|
|
|
313785
314417
|
if (index !== -1) {
|
|
@@ -313787,27 +314419,40 @@
|
|
|
313787
314419
|
var _draft$index$children, _draft$index, _draft$index2;
|
|
313788
314420
|
|
|
313789
314421
|
if ((_draft$index$children = draft[index].children) === null || _draft$index$children === void 0 ? void 0 : _draft$index$children.length) {
|
|
313790
|
-
|
|
314422
|
+
if (Array.isArray(defaultRecord)) {
|
|
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;
|
|
313791
314428
|
|
|
313792
|
-
|
|
314429
|
+
(_draft$index$children3 = draft[index].children) === null || _draft$index$children3 === void 0 ? void 0 : _draft$index$children3.push(defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314430
|
+
}
|
|
313793
314431
|
} else {
|
|
313794
|
-
draft[index].children = [_defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314432
|
+
draft[index].children = Array.isArray(defaultRecord) ? _toConsumableArray$1(defaultRecord) : [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
313795
314433
|
}
|
|
313796
314434
|
|
|
313797
314435
|
!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]]));
|
|
313798
314436
|
} else {
|
|
313799
|
-
|
|
314437
|
+
if (Array.isArray(defaultRecord)) {
|
|
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
|
+
}
|
|
313800
314442
|
}
|
|
313801
314443
|
}
|
|
313802
314444
|
}
|
|
313803
314445
|
});
|
|
313804
314446
|
setDataSource(res);
|
|
313805
|
-
};
|
|
314447
|
+
}, 50);
|
|
314448
|
+
/** 快捷刷子功能 */
|
|
313806
314449
|
|
|
313807
|
-
var handleCopy = function handleCopy(key, value) {
|
|
314450
|
+
var handleCopy = function handleCopy(key, value, type, rowIndex) {
|
|
313808
314451
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313809
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item) {
|
|
313810
|
-
|
|
314452
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
314453
|
+
if (type === 'up' && index < rowIndex || type === 'down' && index > rowIndex) {
|
|
314454
|
+
item[key] = value;
|
|
314455
|
+
}
|
|
313811
314456
|
});
|
|
313812
314457
|
});
|
|
313813
314458
|
setDataSource(res);
|
|
@@ -313816,17 +314461,16 @@
|
|
|
313816
314461
|
|
|
313817
314462
|
|
|
313818
314463
|
var hasDisableOptions = React.useMemo(function () {
|
|
313819
|
-
// const hasOnlyOptionsDatas = columns.filter(item => item?.['componentProps']?.optionOnly)
|
|
313820
314464
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
313821
314465
|
var _item$componentProps;
|
|
313822
314466
|
|
|
313823
314467
|
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;
|
|
313824
314468
|
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
313825
|
-
});
|
|
314469
|
+
}); // const hasOnlyOptionsDatas = columns.filter((item) => item?.componentProps?.optionOnly)
|
|
313826
314470
|
|
|
313827
314471
|
if (hasOnlyOptionsDatas.length) {
|
|
313828
314472
|
return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
|
|
313829
|
-
return item
|
|
314473
|
+
return item.dataIndex;
|
|
313830
314474
|
});
|
|
313831
314475
|
}
|
|
313832
314476
|
|
|
@@ -313838,12 +314482,11 @@
|
|
|
313838
314482
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
313839
314483
|
var _item$componentProps2;
|
|
313840
314484
|
|
|
313841
|
-
var resultComponentProps = lodash.isFunction(item.componentProps) ?
|
|
313842
|
-
|
|
313843
|
-
var _ref8 = resultComponentProps || {},
|
|
313844
|
-
optionOnly = _ref8.optionOnly,
|
|
313845
|
-
options = _ref8.options; // const { optionOnly, options } = item['componentProps'] || {}
|
|
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;
|
|
313846
314486
|
|
|
314487
|
+
var _ref11 = resultComponentProps || {},
|
|
314488
|
+
optionOnly = _ref11.optionOnly,
|
|
314489
|
+
options = _ref11.options;
|
|
313847
314490
|
|
|
313848
314491
|
if (optionOnly && options) {
|
|
313849
314492
|
var dataIndex = item.dataIndex;
|
|
@@ -313863,7 +314506,7 @@
|
|
|
313863
314506
|
}
|
|
313864
314507
|
|
|
313865
314508
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
313866
|
-
componentProps: _objectSpread(_objectSpread({}, item
|
|
314509
|
+
componentProps: _objectSpread(_objectSpread({}, item.componentProps), {}, {
|
|
313867
314510
|
options: newOptions
|
|
313868
314511
|
})
|
|
313869
314512
|
});
|
|
@@ -313879,21 +314522,54 @@
|
|
|
313879
314522
|
/** 组装之后的最终columns */
|
|
313880
314523
|
|
|
313881
314524
|
var resultColumns = React.useMemo(function () {
|
|
313882
|
-
var _localColumns;
|
|
314525
|
+
var _localColumns, _localColumns2, _localColumns3;
|
|
313883
314526
|
|
|
313884
314527
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
313885
314528
|
var localColumns = [sortOpen ? {
|
|
313886
314529
|
title: '排序',
|
|
313887
|
-
dataIndex: '
|
|
314530
|
+
dataIndex: '_sort',
|
|
313888
314531
|
width: 48,
|
|
313889
314532
|
maxWidth: 48,
|
|
313890
314533
|
className: 'drag-visible',
|
|
314534
|
+
fixed: 'left',
|
|
313891
314535
|
render: function render(_, record) {
|
|
313892
314536
|
return /*#__PURE__*/React__default['default'].createElement(Dragger$1, {
|
|
313893
|
-
id: record[_rowKey] || record.id
|
|
314537
|
+
id: (record === null || record === void 0 ? void 0 : record[_rowKey]) || (record === null || record === void 0 ? void 0 : record.id)
|
|
313894
314538
|
});
|
|
313895
314539
|
}
|
|
313896
|
-
} : null
|
|
314540
|
+
} : null, indexCol ? lodash.isBoolean(indexCol) ? {
|
|
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 ? {
|
|
313897
314573
|
title: '操作',
|
|
313898
314574
|
dataIndex: 'lm_edit_opetate',
|
|
313899
314575
|
width: 68,
|
|
@@ -313904,11 +314580,11 @@
|
|
|
313904
314580
|
options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
|
|
313905
314581
|
}
|
|
313906
314582
|
} : null]).filter(function (item) {
|
|
313907
|
-
return item && item.show !== false;
|
|
314583
|
+
return item && (item === null || item === void 0 ? void 0 : item.show) !== false;
|
|
313908
314584
|
});
|
|
313909
|
-
localColumns = localColumns.map(function (item, index) {
|
|
314585
|
+
localColumns = (_localColumns = localColumns) === null || _localColumns === void 0 ? void 0 : _localColumns.map(function (item, index) {
|
|
313910
314586
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
313911
|
-
order: [null, undefined].includes(item
|
|
314587
|
+
order: [null, undefined].includes(item.order) ? index : item.order
|
|
313912
314588
|
});
|
|
313913
314589
|
}).sort(function (a, b) {
|
|
313914
314590
|
return a.order - b.order;
|
|
@@ -313916,7 +314592,7 @@
|
|
|
313916
314592
|
var leftColumns = [];
|
|
313917
314593
|
var mainColumns = [];
|
|
313918
314594
|
var rightColumns = [];
|
|
313919
|
-
(
|
|
314595
|
+
(_localColumns2 = localColumns) === null || _localColumns2 === void 0 ? void 0 : _localColumns2.forEach(function (item) {
|
|
313920
314596
|
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
313921
314597
|
leftColumns.push(item);
|
|
313922
314598
|
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
@@ -313931,29 +314607,22 @@
|
|
|
313931
314607
|
var mapColumns = function mapColumns(col, index) {
|
|
313932
314608
|
var _col$children;
|
|
313933
314609
|
|
|
313934
|
-
if (!col.editable && !((_col$children = col.children) === null || _col$children === void 0 ? void 0 : _col$children.length)) {
|
|
313935
|
-
|
|
313936
|
-
|
|
313937
|
-
|
|
313938
|
-
|
|
313939
|
-
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
313940
|
-
var _col$componentProps2;
|
|
313941
|
-
|
|
313942
|
-
var dataIndex = col.dataIndex,
|
|
313943
|
-
editable = col.editable,
|
|
313944
|
-
relevanceCols = col.relevanceCols,
|
|
313945
|
-
componentProps = col.componentProps;
|
|
314610
|
+
if (!col.editable && !((_col$children = col.children) === null || _col$children === void 0 ? void 0 : _col$children.length) && (col === null || col === void 0 ? void 0 : col.dataIndex) === '_sort') {
|
|
314611
|
+
var fn = col === null || col === void 0 ? void 0 : col.render;
|
|
314612
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
314613
|
+
render: function render(text, record, i) {
|
|
314614
|
+
var _dataSource$i;
|
|
313946
314615
|
|
|
313947
|
-
|
|
313948
|
-
return true;
|
|
314616
|
+
return fn === null || fn === void 0 ? void 0 : fn((_dataSource$i = dataSource[i]) === null || _dataSource$i === void 0 ? void 0 : _dataSource$i[col.dataIndex], dataSource[i], i);
|
|
313949
314617
|
}
|
|
314618
|
+
});
|
|
314619
|
+
}
|
|
313950
314620
|
|
|
313951
|
-
|
|
313952
|
-
|
|
313953
|
-
|
|
314621
|
+
if (isEdit && (col === null || col === void 0 ? void 0 : col.render) && (col === null || col === void 0 ? void 0 : col.editable) === 'render') {
|
|
314622
|
+
delete col.render;
|
|
314623
|
+
}
|
|
313954
314624
|
|
|
313955
|
-
|
|
313956
|
-
},
|
|
314625
|
+
var newCol = _objectSpread(_objectSpread({}, col), {}, {
|
|
313957
314626
|
onCell: function onCell(record, rowIndex) {
|
|
313958
314627
|
return {
|
|
313959
314628
|
getLength: dataSource.length,
|
|
@@ -313968,7 +314637,7 @@
|
|
|
313968
314637
|
editable: col.editable,
|
|
313969
314638
|
dataIndex: col.dataIndex,
|
|
313970
314639
|
itemProps: col.itemProps,
|
|
313971
|
-
|
|
314640
|
+
shouldUpdate: shouldUpdate,
|
|
313972
314641
|
isEdit: isEdit,
|
|
313973
314642
|
isHoverEdit: isHoverEdit,
|
|
313974
314643
|
handleAdd: handleAdd,
|
|
@@ -313976,8 +314645,7 @@
|
|
|
313976
314645
|
handleCopy: handleCopy,
|
|
313977
314646
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
313978
314647
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
313979
|
-
handleSave: handleSave
|
|
313980
|
-
reWriteOriginSource: reWriteOriginSource
|
|
314648
|
+
handleSave: handleSave
|
|
313981
314649
|
};
|
|
313982
314650
|
}
|
|
313983
314651
|
});
|
|
@@ -313991,28 +314659,28 @@
|
|
|
313991
314659
|
return newCol;
|
|
313992
314660
|
};
|
|
313993
314661
|
|
|
313994
|
-
var res = localColumns.map(function (col, index) {
|
|
314662
|
+
var res = (_localColumns3 = localColumns) === null || _localColumns3 === void 0 ? void 0 : _localColumns3.map(function (col, index) {
|
|
313995
314663
|
return mapColumns(col, index);
|
|
313996
314664
|
});
|
|
313997
314665
|
return res;
|
|
313998
|
-
}, [columns, isAdd, sortOpen, useQuickOpetate,
|
|
313999
|
-
var DraggableContainer = React.useCallback(function (_ref9) {
|
|
314000
|
-
var _dataSourceRef$curren2;
|
|
314666
|
+
}, [columns, isAdd, sortOpen, useQuickOpetate, dataSource, _toConsumableArray$1(memoOptions)]);
|
|
314001
314667
|
|
|
314002
|
-
|
|
314668
|
+
var onSortEnd = function onSortEnd(active, over) {
|
|
314669
|
+
var cloneArr = _toConsumableArray$1(dataSourceRef.current);
|
|
314003
314670
|
|
|
314004
|
-
|
|
314005
|
-
|
|
314006
|
-
}
|
|
314007
|
-
|
|
314008
|
-
|
|
314009
|
-
|
|
314010
|
-
|
|
314011
|
-
}
|
|
314012
|
-
|
|
314671
|
+
var oldIndex = cloneArr.findIndex(function (v) {
|
|
314672
|
+
return v[_rowKey] === active;
|
|
314673
|
+
});
|
|
314674
|
+
var newIndex = cloneArr.findIndex(function (v) {
|
|
314675
|
+
return v[_rowKey] === over;
|
|
314676
|
+
});
|
|
314677
|
+
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
314678
|
+
};
|
|
314679
|
+
|
|
314680
|
+
var colDraggableContainer = React.useCallback(function (_ref12) {
|
|
314013
314681
|
var _React$Children;
|
|
314014
314682
|
|
|
314015
|
-
var props = _extends$2({},
|
|
314683
|
+
var props = _extends$2({}, _ref12);
|
|
314016
314684
|
|
|
314017
314685
|
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) {
|
|
314018
314686
|
var _child$props, _child$props$column;
|
|
@@ -314021,45 +314689,23 @@
|
|
|
314021
314689
|
return child;
|
|
314022
314690
|
}
|
|
314023
314691
|
|
|
314024
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
314692
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$3, {
|
|
314025
314693
|
id: child.key
|
|
314026
314694
|
}, child);
|
|
314027
314695
|
}));
|
|
314028
314696
|
}, [columns]);
|
|
314029
|
-
var config = React.useMemo(function () {
|
|
314030
|
-
var component = {
|
|
314031
|
-
body: Object.assign({
|
|
314032
|
-
row: sortOpen ? EditableSortRow : EditableRow$1,
|
|
314033
|
-
cell: EditableCell$1
|
|
314034
|
-
}, sortOpen ? {
|
|
314035
|
-
wrapper: DraggableContainer
|
|
314036
|
-
} : {})
|
|
314037
|
-
};
|
|
314038
|
-
|
|
314039
|
-
if (colSortOpen) {
|
|
314040
|
-
component['header'] = {
|
|
314041
|
-
row: colDraggableContainer
|
|
314042
|
-
};
|
|
314043
|
-
}
|
|
314044
|
-
|
|
314045
|
-
return _objectSpread({
|
|
314046
|
-
pagination: false,
|
|
314047
|
-
tableLayout: 'fixed',
|
|
314048
|
-
scroll: {
|
|
314049
|
-
x: '100%'
|
|
314050
|
-
},
|
|
314051
|
-
rowKey: function rowKey(record) {
|
|
314052
|
-
return record[_rowKey] || record.index || Math.random();
|
|
314053
|
-
},
|
|
314054
|
-
components: component
|
|
314055
|
-
}, resetProps);
|
|
314056
|
-
}, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
|
|
314057
314697
|
React.useImperativeHandle(ref, function () {
|
|
314058
314698
|
return {
|
|
314059
314699
|
setRow: handleSave,
|
|
314060
314700
|
getCheckboxRecords: function getCheckboxRecords() {
|
|
314061
314701
|
return localRowSelectList.selectedRows;
|
|
314062
314702
|
},
|
|
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
|
+
},
|
|
314063
314709
|
clearSelect: function clearSelect() {
|
|
314064
314710
|
setLocalRowSelectList({
|
|
314065
314711
|
selectedRows: []
|
|
@@ -314069,34 +314715,82 @@
|
|
|
314069
314715
|
setLocalRowSelectList({
|
|
314070
314716
|
selectedRows: value
|
|
314071
314717
|
});
|
|
314072
|
-
},
|
|
314073
|
-
valid: function valid() {
|
|
314074
|
-
return _valid;
|
|
314075
314718
|
}
|
|
314076
314719
|
};
|
|
314077
314720
|
});
|
|
314078
314721
|
var isShowAddAction = React.useMemo(function () {
|
|
314079
314722
|
return isEdit && isAdd || isHoverEdit && isAdd;
|
|
314080
314723
|
}, [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));
|
|
314081
314772
|
|
|
314082
314773
|
if (colSortOpen) {
|
|
314083
314774
|
var _localRowSelectList$s;
|
|
314084
314775
|
|
|
314085
314776
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314086
|
-
className: "lm_editTable_warpper"
|
|
314087
|
-
|
|
314777
|
+
className: "lm_editTable_warpper",
|
|
314778
|
+
ref: tableWarpRef
|
|
314779
|
+
}, /*#__PURE__*/React__default['default'].createElement(DndContainer$2, {
|
|
314780
|
+
rowKey: _rowKey,
|
|
314781
|
+
options: resultColumns,
|
|
314088
314782
|
move: onColSortEnd
|
|
314089
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$
|
|
314783
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$1, {
|
|
314090
314784
|
items: columns.reduce(function (acc, item) {
|
|
314091
314785
|
return [].concat(_toConsumableArray$1(acc), [item.dataIndex]);
|
|
314092
314786
|
}, [])
|
|
314093
|
-
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config), {}, {
|
|
314787
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config.current), {}, {
|
|
314788
|
+
loading: loading,
|
|
314094
314789
|
size: size || 'small',
|
|
314095
314790
|
columns: resultColumns,
|
|
314096
314791
|
rowClassName: "editable-row",
|
|
314097
314792
|
bordered: true,
|
|
314098
314793
|
pagination: false,
|
|
314099
|
-
// components={tableComponents}
|
|
314100
314794
|
rowSelection: !rowSelection ? undefined : _objectSpread(_objectSpread({
|
|
314101
314795
|
fixed: true,
|
|
314102
314796
|
type: 'checkbox',
|
|
@@ -314106,36 +314800,39 @@
|
|
|
314106
314800
|
return lodash.isObject(v) ? v[_rowKey] : v;
|
|
314107
314801
|
}),
|
|
314108
314802
|
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
314109
|
-
// editTableRowChange(selectedRowKeys, selectedRows, info)
|
|
314110
314803
|
setLocalRowSelectList(selectedRowKeys, selectedRows, info);
|
|
314111
314804
|
}
|
|
314112
314805
|
}),
|
|
314113
314806
|
dataSource: dataSource
|
|
314114
|
-
})))),
|
|
314115
|
-
|
|
314116
|
-
|
|
314117
|
-
|
|
314118
|
-
|
|
314119
|
-
|
|
314120
|
-
}
|
|
314121
|
-
}, /*#__PURE__*/React__default['default'].createElement(PlusCircleOutlined$2, {
|
|
314122
|
-
className: "lmweb-plus"
|
|
314123
|
-
}), "\u65B0\u589E"));
|
|
314807
|
+
})))), /*#__PURE__*/React__default['default'].createElement(BottomOpetateComponent, {
|
|
314808
|
+
disabled: disabled,
|
|
314809
|
+
isShowAddAction: isShowAddAction,
|
|
314810
|
+
recordCreatorProps: recordCreatorProps,
|
|
314811
|
+
handleAdd: handleAdd
|
|
314812
|
+
}));
|
|
314124
314813
|
} // @ts-ignore
|
|
314125
314814
|
|
|
314126
314815
|
|
|
314127
314816
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314128
|
-
className: "lm_editTable_warpper"
|
|
314129
|
-
|
|
314817
|
+
className: "lm_editTable_warpper",
|
|
314818
|
+
ref: tableWarpRef
|
|
314819
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config.current), {}, {
|
|
314130
314820
|
size: size || 'small',
|
|
314131
314821
|
columns: resultColumns,
|
|
314132
314822
|
rowClassName: "editable-row",
|
|
314133
314823
|
bordered: true,
|
|
314824
|
+
loading: loading,
|
|
314134
314825
|
pagination: false,
|
|
314135
314826
|
// components={tableComponents}
|
|
314136
314827
|
expandable: (resetProps === null || resetProps === void 0 ? void 0 : resetProps.expandable) || {
|
|
314137
314828
|
expandedRowKeys: expandedRowKeys,
|
|
314138
314829
|
fixed: true,
|
|
314830
|
+
// indentSize: 0,
|
|
314831
|
+
expandIconColumnIndex: checkExpandIconColumnIndex({
|
|
314832
|
+
rowSelection: rowSelection,
|
|
314833
|
+
sortOpen: sortOpen,
|
|
314834
|
+
indexCol: indexCol
|
|
314835
|
+
}) || 0,
|
|
314139
314836
|
onExpandedRowsChange: function onExpandedRowsChange(expandedRows) {
|
|
314140
314837
|
return setExpandedRowKeys(expandedRows);
|
|
314141
314838
|
}
|
|
@@ -314153,16 +314850,12 @@
|
|
|
314153
314850
|
}
|
|
314154
314851
|
}),
|
|
314155
314852
|
dataSource: dataSource
|
|
314156
|
-
})),
|
|
314157
|
-
|
|
314158
|
-
|
|
314159
|
-
|
|
314160
|
-
|
|
314161
|
-
|
|
314162
|
-
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
314163
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314164
|
-
type: "lmweb-plus"
|
|
314165
|
-
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增'));
|
|
314853
|
+
})), /*#__PURE__*/React__default['default'].createElement(BottomOpetateComponent, {
|
|
314854
|
+
disabled: disabled,
|
|
314855
|
+
isShowAddAction: isShowAddAction,
|
|
314856
|
+
recordCreatorProps: recordCreatorProps,
|
|
314857
|
+
handleAdd: handleAdd
|
|
314858
|
+
}));
|
|
314166
314859
|
});
|
|
314167
314860
|
var LmEditTable = /*#__PURE__*/React.memo(EditTable$1);
|
|
314168
314861
|
|
|
@@ -314838,7 +315531,7 @@
|
|
|
314838
315531
|
}
|
|
314839
315532
|
}
|
|
314840
315533
|
|
|
314841
|
-
var _excluded$
|
|
315534
|
+
var _excluded$2W = ["prefixCls", "getPopupContainer", "className", "placement", "size", "disabled", "bordered", "placeholder", "status"];
|
|
314842
315535
|
function generateRangePicker$1(generateConfig) {
|
|
314843
315536
|
var RangePicker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
314844
315537
|
var customizePrefixCls = props.prefixCls,
|
|
@@ -314851,7 +315544,7 @@
|
|
|
314851
315544
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
314852
315545
|
placeholder = props.placeholder,
|
|
314853
315546
|
customStatus = props.status,
|
|
314854
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
315547
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2W);
|
|
314855
315548
|
|
|
314856
315549
|
var innerRef = React.useRef(null);
|
|
314857
315550
|
|
|
@@ -314951,7 +315644,7 @@
|
|
|
314951
315644
|
return RangePicker$1;
|
|
314952
315645
|
}
|
|
314953
315646
|
|
|
314954
|
-
var _excluded$
|
|
315647
|
+
var _excluded$2X = ["prefixCls", "getPopupContainer", "className", "size", "bordered", "placement", "placeholder", "disabled", "status"];
|
|
314955
315648
|
function generatePicker$2(generateConfig) {
|
|
314956
315649
|
function getPicker(picker, displayName) {
|
|
314957
315650
|
var Picker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -314965,7 +315658,7 @@
|
|
|
314965
315658
|
placeholder = props.placeholder,
|
|
314966
315659
|
customDisabled = props.disabled,
|
|
314967
315660
|
customStatus = props.status,
|
|
314968
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
315661
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2X);
|
|
314969
315662
|
|
|
314970
315663
|
warning$6(picker !== 'quarter', displayName, "DatePicker.".concat(displayName, " is legacy usage. Please use DatePicker[picker='").concat(picker, "'] directly."));
|
|
314971
315664
|
|
|
@@ -315173,63 +315866,6 @@
|
|
|
315173
315866
|
var DatePicker$1 = generatePicker$3(momentGenerateConfig);
|
|
315174
315867
|
DatePicker$1.AntdDatePicker = DatePicker;
|
|
315175
315868
|
|
|
315176
|
-
var getRenderPropValue$1 = function getRenderPropValue(propValue) {
|
|
315177
|
-
if (!propValue) {
|
|
315178
|
-
return null;
|
|
315179
|
-
}
|
|
315180
|
-
|
|
315181
|
-
var isRenderFunction = typeof propValue === 'function';
|
|
315182
|
-
|
|
315183
|
-
if (isRenderFunction) {
|
|
315184
|
-
return propValue();
|
|
315185
|
-
}
|
|
315186
|
-
|
|
315187
|
-
return propValue;
|
|
315188
|
-
};
|
|
315189
|
-
|
|
315190
|
-
var _excluded$2U = ["prefixCls", "title", "content", "_overlay"];
|
|
315191
|
-
var Popover$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
315192
|
-
var customizePrefixCls = _ref.prefixCls,
|
|
315193
|
-
title = _ref.title,
|
|
315194
|
-
content = _ref.content,
|
|
315195
|
-
_overlay = _ref._overlay,
|
|
315196
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$2U);
|
|
315197
|
-
|
|
315198
|
-
var _React$useContext = React.useContext(ConfigContext),
|
|
315199
|
-
getPrefixCls = _React$useContext.getPrefixCls;
|
|
315200
|
-
|
|
315201
|
-
var getOverlay = function getOverlay(prefixCls) {
|
|
315202
|
-
if (!title && !content) return undefined;
|
|
315203
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement("div", {
|
|
315204
|
-
className: "".concat(prefixCls, "-title")
|
|
315205
|
-
}, getRenderPropValue$1(title)), /*#__PURE__*/React.createElement("div", {
|
|
315206
|
-
className: "".concat(prefixCls, "-inner-content")
|
|
315207
|
-
}, getRenderPropValue$1(content)));
|
|
315208
|
-
};
|
|
315209
|
-
|
|
315210
|
-
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
315211
|
-
var rootPrefixCls = getPrefixCls();
|
|
315212
|
-
return /*#__PURE__*/React.createElement(Tooltip$4, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
315213
|
-
prefixCls: prefixCls,
|
|
315214
|
-
ref: ref,
|
|
315215
|
-
overlay: _overlay || getOverlay(prefixCls),
|
|
315216
|
-
transitionName: getTransitionName$9(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
315217
|
-
}));
|
|
315218
|
-
});
|
|
315219
|
-
|
|
315220
|
-
{
|
|
315221
|
-
Popover$1.displayName = 'Popover';
|
|
315222
|
-
}
|
|
315223
|
-
|
|
315224
|
-
Popover$1.defaultProps = {
|
|
315225
|
-
placement: 'top',
|
|
315226
|
-
trigger: 'hover',
|
|
315227
|
-
mouseEnterDelay: 0.1,
|
|
315228
|
-
mouseLeaveDelay: 0.1,
|
|
315229
|
-
overlayStyle: {}
|
|
315230
|
-
};
|
|
315231
|
-
Popover$1.AntdPopover = Popover;
|
|
315232
|
-
|
|
315233
315869
|
var CheckOutlined_1 = createCommonjsModule(function (module, exports) {
|
|
315234
315870
|
// This icon file is generated automatically.
|
|
315235
315871
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -316042,7 +316678,7 @@
|
|
|
316042
316678
|
|
|
316043
316679
|
var KeyCode$1 = /*@__PURE__*/getDefaultExportFromCjs(KeyCode_1);
|
|
316044
316680
|
|
|
316045
|
-
var _excluded$
|
|
316681
|
+
var _excluded$2Y = ["style", "noStyle", "disabled"];
|
|
316046
316682
|
var inlineStyle$1 = {
|
|
316047
316683
|
border: 0,
|
|
316048
316684
|
background: 'transparent',
|
|
@@ -316071,7 +316707,7 @@
|
|
|
316071
316707
|
var style = props.style,
|
|
316072
316708
|
noStyle = props.noStyle,
|
|
316073
316709
|
disabled = props.disabled,
|
|
316074
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
316710
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2Y);
|
|
316075
316711
|
|
|
316076
316712
|
var mergedStyle = {};
|
|
316077
316713
|
|
|
@@ -316282,7 +316918,7 @@
|
|
|
316282
316918
|
}, conditions);
|
|
316283
316919
|
});
|
|
316284
316920
|
|
|
316285
|
-
var _excluded$
|
|
316921
|
+
var _excluded$2Z = ["prefixCls", "component", "className", "aria-label", "setContentRef", "children"];
|
|
316286
316922
|
|
|
316287
316923
|
var Typography$2 = function Typography(_ref, ref) {
|
|
316288
316924
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -316292,7 +316928,7 @@
|
|
|
316292
316928
|
ariaLabel = _ref['aria-label'],
|
|
316293
316929
|
setContentRef = _ref.setContentRef,
|
|
316294
316930
|
children = _ref.children,
|
|
316295
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
316931
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2Z);
|
|
316296
316932
|
|
|
316297
316933
|
var _React$useContext = React.useContext(ConfigContext),
|
|
316298
316934
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -316535,7 +317171,7 @@
|
|
|
316535
317171
|
EllipsisTooltip$1.displayName = 'EllipsisTooltip';
|
|
316536
317172
|
}
|
|
316537
317173
|
|
|
316538
|
-
var _excluded$
|
|
317174
|
+
var _excluded$2_ = ["prefixCls", "className", "style", "type", "disabled", "children", "ellipsis", "editable", "copyable", "component", "title"];
|
|
316539
317175
|
|
|
316540
317176
|
function wrapperDecorations$1(_ref, content) {
|
|
316541
317177
|
var mark = _ref.mark,
|
|
@@ -316587,7 +317223,7 @@
|
|
|
316587
317223
|
copyable = props.copyable,
|
|
316588
317224
|
component = props.component,
|
|
316589
317225
|
title = props.title,
|
|
316590
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
317226
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2_);
|
|
316591
317227
|
|
|
316592
317228
|
var _React$useContext = React.useContext(ConfigContext),
|
|
316593
317229
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -317005,12 +317641,12 @@
|
|
|
317005
317641
|
});
|
|
317006
317642
|
});
|
|
317007
317643
|
|
|
317008
|
-
var _excluded$
|
|
317644
|
+
var _excluded$2$ = ["ellipsis", "rel"];
|
|
317009
317645
|
|
|
317010
317646
|
var Link$2 = function Link(_ref, ref) {
|
|
317011
317647
|
var ellipsis = _ref.ellipsis,
|
|
317012
317648
|
rel = _ref.rel,
|
|
317013
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317649
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2$);
|
|
317014
317650
|
|
|
317015
317651
|
warning$6(_typeof$1(ellipsis) !== 'object', 'Typography.Link', '`ellipsis` only supports boolean value.');
|
|
317016
317652
|
var baseRef = React.useRef(null);
|
|
@@ -317044,11 +317680,11 @@
|
|
|
317044
317680
|
|
|
317045
317681
|
var Paragraph$7 = /*#__PURE__*/React.forwardRef(Paragraph$6);
|
|
317046
317682
|
|
|
317047
|
-
var _excluded$
|
|
317683
|
+
var _excluded$30 = ["ellipsis"];
|
|
317048
317684
|
|
|
317049
317685
|
var Text$2 = function Text(_ref, ref) {
|
|
317050
317686
|
var ellipsis = _ref.ellipsis,
|
|
317051
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317687
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$30);
|
|
317052
317688
|
|
|
317053
317689
|
var mergedEllipsis = React.useMemo(function () {
|
|
317054
317690
|
if (ellipsis && _typeof$1(ellipsis) === 'object') {
|
|
@@ -317068,13 +317704,13 @@
|
|
|
317068
317704
|
|
|
317069
317705
|
var Text$3 = /*#__PURE__*/React.forwardRef(Text$2);
|
|
317070
317706
|
|
|
317071
|
-
var _excluded$
|
|
317707
|
+
var _excluded$31 = ["level"];
|
|
317072
317708
|
var TITLE_ELE_LIST$1 = tupleNum$1(1, 2, 3, 4, 5);
|
|
317073
317709
|
|
|
317074
317710
|
var Title$4 = function Title(props, ref) {
|
|
317075
317711
|
var _props$level = props.level,
|
|
317076
317712
|
level = _props$level === void 0 ? 1 : _props$level,
|
|
317077
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
317713
|
+
restProps = _objectWithoutProperties$1(props, _excluded$31);
|
|
317078
317714
|
|
|
317079
317715
|
var component;
|
|
317080
317716
|
|
|
@@ -317179,7 +317815,7 @@
|
|
|
317179
317815
|
RefAutoComplete$1.Option = Option;
|
|
317180
317816
|
RefAutoComplete$1.AntdAutoComplete = RefAutoComplete;
|
|
317181
317817
|
|
|
317182
|
-
var _excluded$
|
|
317818
|
+
var _excluded$32 = ["children", "treeData", "value", "defaultLabel", "disabled", "size"];
|
|
317183
317819
|
var CLMTreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
317184
317820
|
var children = props.children,
|
|
317185
317821
|
treeData = props.treeData,
|
|
@@ -317187,7 +317823,7 @@
|
|
|
317187
317823
|
defaultLabel = props.defaultLabel,
|
|
317188
317824
|
customDisabled = props.disabled,
|
|
317189
317825
|
customizeSize = props.size,
|
|
317190
|
-
resetProps = _objectWithoutProperties$1(props, _excluded$
|
|
317826
|
+
resetProps = _objectWithoutProperties$1(props, _excluded$32); // ===================== Disabled =====================
|
|
317191
317827
|
|
|
317192
317828
|
|
|
317193
317829
|
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
@@ -317322,7 +317958,7 @@
|
|
|
317322
317958
|
return ErrorBoundary;
|
|
317323
317959
|
}(React.Component);
|
|
317324
317960
|
|
|
317325
|
-
var _excluded$
|
|
317961
|
+
var _excluded$33 = ["description", "prefixCls", "message", "banner", "className", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "duration"];
|
|
317326
317962
|
var iconMapFilled$1 = {
|
|
317327
317963
|
success: CheckCircleFilled$2,
|
|
317328
317964
|
info: InfoCircleFilled$2,
|
|
@@ -317395,7 +318031,7 @@
|
|
|
317395
318031
|
closeIcon = _ref$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined$2, null) : _ref$closeIcon,
|
|
317396
318032
|
action = _ref.action,
|
|
317397
318033
|
duration = _ref.duration,
|
|
317398
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
318034
|
+
props = _objectWithoutProperties$1(_ref, _excluded$33);
|
|
317399
318035
|
|
|
317400
318036
|
var _React$useState = React.useState(false),
|
|
317401
318037
|
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
@@ -317825,7 +318461,7 @@
|
|
|
317825
318461
|
};
|
|
317826
318462
|
};
|
|
317827
318463
|
|
|
317828
|
-
var _excluded$
|
|
318464
|
+
var _excluded$34 = ["className", "onUrge", "onDeleteComment"];
|
|
317829
318465
|
var prefixCls$b = 'lm_approval';
|
|
317830
318466
|
var colors = ['#36BCF1', '#AE86DC', '#8BD248', '#F5A173'];
|
|
317831
318467
|
var cacheColorMap = new Map();
|
|
@@ -318233,7 +318869,7 @@
|
|
|
318233
318869
|
onUrge = _props$onUrge === void 0 ? function () {} : _props$onUrge,
|
|
318234
318870
|
_props$onDeleteCommen2 = props.onDeleteComment,
|
|
318235
318871
|
onDeleteComment = _props$onDeleteCommen2 === void 0 ? function () {} : _props$onDeleteCommen2,
|
|
318236
|
-
others = _objectWithoutProperties$1(props, _excluded$
|
|
318872
|
+
others = _objectWithoutProperties$1(props, _excluded$34);
|
|
318237
318873
|
|
|
318238
318874
|
var _useState = React.useState(false),
|
|
318239
318875
|
_useState2 = _slicedToArray$1(_useState, 2),
|
|
@@ -320024,7 +320660,7 @@
|
|
|
320024
320660
|
return nodes;
|
|
320025
320661
|
}
|
|
320026
320662
|
|
|
320027
|
-
var _excluded$
|
|
320663
|
+
var _excluded$35 = ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"],
|
|
320028
320664
|
_excluded2$J = ["prefixCls", "className"];
|
|
320029
320665
|
var ConfigContext$7 = ConfigProvider$1.ConfigContext;
|
|
320030
320666
|
|
|
@@ -320049,7 +320685,7 @@
|
|
|
320049
320685
|
var defaultExpandAll = _ref2.defaultExpandAll,
|
|
320050
320686
|
defaultExpandParent = _ref2.defaultExpandParent,
|
|
320051
320687
|
defaultExpandedKeys = _ref2.defaultExpandedKeys,
|
|
320052
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
320688
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$35);
|
|
320053
320689
|
|
|
320054
320690
|
// Shift click usage
|
|
320055
320691
|
var lastSelectedKey = React.useRef();
|
|
@@ -320547,11 +321183,11 @@
|
|
|
320547
321183
|
blockNode: false
|
|
320548
321184
|
};
|
|
320549
321185
|
|
|
320550
|
-
var _excluded$
|
|
321186
|
+
var _excluded$36 = ["className"];
|
|
320551
321187
|
var prefixCls$c = 'lm_tree';
|
|
320552
321188
|
var LmTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
320553
321189
|
var className = props.className,
|
|
320554
|
-
rest = _objectWithoutProperties$1(props, _excluded$
|
|
321190
|
+
rest = _objectWithoutProperties$1(props, _excluded$36);
|
|
320555
321191
|
|
|
320556
321192
|
return /*#__PURE__*/React__default['default'].createElement(Tree$2, _objectSpread(_objectSpread({
|
|
320557
321193
|
ref: ref
|
|
@@ -321610,7 +322246,7 @@
|
|
|
321610
322246
|
}, unitNodes);
|
|
321611
322247
|
}
|
|
321612
322248
|
|
|
321613
|
-
var _excluded$
|
|
322249
|
+
var _excluded$37 = ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"];
|
|
321614
322250
|
|
|
321615
322251
|
var ScrollNumber$1 = function ScrollNumber(_ref) {
|
|
321616
322252
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -321623,7 +322259,7 @@
|
|
|
321623
322259
|
_ref$component = _ref.component,
|
|
321624
322260
|
component = _ref$component === void 0 ? 'sup' : _ref$component,
|
|
321625
322261
|
children = _ref.children,
|
|
321626
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
322262
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$37);
|
|
321627
322263
|
|
|
321628
322264
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
321629
322265
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
@@ -321673,7 +322309,7 @@
|
|
|
321673
322309
|
return /*#__PURE__*/React.createElement(component, newProps, numberNodes);
|
|
321674
322310
|
};
|
|
321675
322311
|
|
|
321676
|
-
var _excluded$
|
|
322312
|
+
var _excluded$38 = ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "showZero"];
|
|
321677
322313
|
|
|
321678
322314
|
var Badge$1 = function Badge(_ref) {
|
|
321679
322315
|
var _classNames, _classNames2;
|
|
@@ -321698,7 +322334,7 @@
|
|
|
321698
322334
|
className = _ref.className,
|
|
321699
322335
|
_ref$showZero = _ref.showZero,
|
|
321700
322336
|
showZero = _ref$showZero === void 0 ? false : _ref$showZero,
|
|
321701
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
322337
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$38);
|
|
321702
322338
|
|
|
321703
322339
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
321704
322340
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -321833,7 +322469,7 @@
|
|
|
321833
322469
|
|
|
321834
322470
|
Badge$1.Ribbon = Ribbon$1;
|
|
321835
322471
|
|
|
321836
|
-
var _excluded$
|
|
322472
|
+
var _excluded$39 = ["prefixCls", "type", "orientation", "orientationMargin", "className", "children", "dashed", "plain"];
|
|
321837
322473
|
|
|
321838
322474
|
var Divider$5 = function Divider(props) {
|
|
321839
322475
|
var _classNames;
|
|
@@ -321852,7 +322488,7 @@
|
|
|
321852
322488
|
children = props.children,
|
|
321853
322489
|
dashed = props.dashed,
|
|
321854
322490
|
plain = props.plain,
|
|
321855
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
322491
|
+
restProps = _objectWithoutProperties$1(props, _excluded$39);
|
|
321856
322492
|
|
|
321857
322493
|
var prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
321858
322494
|
var orientationPrefix = orientation.length > 0 ? "-".concat(orientation) : orientation;
|
|
@@ -322238,7 +322874,7 @@
|
|
|
322238
322874
|
}
|
|
322239
322875
|
}; // 状态管理操作
|
|
322240
322876
|
|
|
322241
|
-
var reducer$
|
|
322877
|
+
var reducer$6 = function reducer(state, action) {
|
|
322242
322878
|
var resize = action.resize,
|
|
322243
322879
|
transform = action.transform,
|
|
322244
322880
|
current = action.current;
|
|
@@ -322266,7 +322902,7 @@
|
|
|
322266
322902
|
}
|
|
322267
322903
|
}; // 仅在初始化时触发一次
|
|
322268
322904
|
|
|
322269
|
-
var initialState$
|
|
322905
|
+
var initialState$4 = function initialState(props) {
|
|
322270
322906
|
var initialIndex = props.initialIndex;
|
|
322271
322907
|
return _objectSpread(_objectSpread({}, defaultState), {}, {
|
|
322272
322908
|
currentIndex: initialIndex
|
|
@@ -322617,10 +323253,10 @@
|
|
|
322617
323253
|
var Root = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
322618
323254
|
var bodyRef = React.useRef(null);
|
|
322619
323255
|
var initialState = React.useMemo(function () {
|
|
322620
|
-
return initialState$
|
|
323256
|
+
return initialState$4(props);
|
|
322621
323257
|
}, []);
|
|
322622
323258
|
|
|
322623
|
-
var _useReducer = React.useReducer(reducer$
|
|
323259
|
+
var _useReducer = React.useReducer(reducer$6, initialState),
|
|
322624
323260
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
322625
323261
|
state = _useReducer2[0],
|
|
322626
323262
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -322686,7 +323322,7 @@
|
|
|
322686
323322
|
|
|
322687
323323
|
}; // 状态管理操作
|
|
322688
323324
|
|
|
322689
|
-
var reducer$
|
|
323325
|
+
var reducer$7 = function reducer(state, action) {
|
|
322690
323326
|
var result = action.result,
|
|
322691
323327
|
init = action.init;
|
|
322692
323328
|
|
|
@@ -322702,7 +323338,7 @@
|
|
|
322702
323338
|
}
|
|
322703
323339
|
}; // 仅在初始化时触发一次
|
|
322704
323340
|
|
|
322705
|
-
var initialState$
|
|
323341
|
+
var initialState$5 = function initialState() {
|
|
322706
323342
|
return _objectSpread({}, defaultState$1);
|
|
322707
323343
|
};
|
|
322708
323344
|
|
|
@@ -324376,14 +325012,14 @@
|
|
|
324376
325012
|
|
|
324377
325013
|
var Body$1 = /*#__PURE__*/React__default['default'].memo(Index$b);
|
|
324378
325014
|
|
|
324379
|
-
var _excluded$
|
|
325015
|
+
var _excluded$3a = ["value", "onChange", "leftIcon", "rightIcon"];
|
|
324380
325016
|
|
|
324381
325017
|
var ResetSlider = function ResetSlider(_ref) {
|
|
324382
325018
|
var value = _ref.value,
|
|
324383
325019
|
_onChange = _ref.onChange,
|
|
324384
325020
|
leftIcon = _ref.leftIcon,
|
|
324385
325021
|
rightIcon = _ref.rightIcon,
|
|
324386
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
325022
|
+
props = _objectWithoutProperties$1(_ref, _excluded$3a);
|
|
324387
325023
|
|
|
324388
325024
|
// 减
|
|
324389
325025
|
var decrement = function decrement() {
|
|
@@ -324537,10 +325173,10 @@
|
|
|
324537
325173
|
|
|
324538
325174
|
var LmBox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
324539
325175
|
var initialState = React.useMemo(function () {
|
|
324540
|
-
return initialState$
|
|
325176
|
+
return initialState$5();
|
|
324541
325177
|
}, []);
|
|
324542
325178
|
|
|
324543
|
-
var _useReducer = React.useReducer(reducer$
|
|
325179
|
+
var _useReducer = React.useReducer(reducer$7, initialState),
|
|
324544
325180
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
324545
325181
|
state = _useReducer2[0],
|
|
324546
325182
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -324603,7 +325239,7 @@
|
|
|
324603
325239
|
|
|
324604
325240
|
}; // 状态管理操作
|
|
324605
325241
|
|
|
324606
|
-
var reducer$
|
|
325242
|
+
var reducer$8 = function reducer(state, action) {
|
|
324607
325243
|
var transform = action.transform,
|
|
324608
325244
|
current = action.current,
|
|
324609
325245
|
visible = action.visible;
|
|
@@ -324636,7 +325272,7 @@
|
|
|
324636
325272
|
}
|
|
324637
325273
|
}; // 仅在初始化时触发一次
|
|
324638
325274
|
|
|
324639
|
-
var initialState$
|
|
325275
|
+
var initialState$6 = function initialState(props) {
|
|
324640
325276
|
var initialIndex = props.initialIndex;
|
|
324641
325277
|
return _objectSpread(_objectSpread({}, defaultState$2), {}, {
|
|
324642
325278
|
currentIndex: initialIndex
|
|
@@ -325026,10 +325662,10 @@
|
|
|
325026
325662
|
var LmImageViewerRoot = function LmImageViewerRoot(props, ref) {
|
|
325027
325663
|
var previewRef = React.useRef(null);
|
|
325028
325664
|
var initialState = React.useMemo(function () {
|
|
325029
|
-
return initialState$
|
|
325665
|
+
return initialState$6(props);
|
|
325030
325666
|
}, []);
|
|
325031
325667
|
|
|
325032
|
-
var _useReducer = React.useReducer(reducer$
|
|
325668
|
+
var _useReducer = React.useReducer(reducer$8, initialState),
|
|
325033
325669
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
325034
325670
|
state = _useReducer2[0],
|
|
325035
325671
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -325084,7 +325720,7 @@
|
|
|
325084
325720
|
|
|
325085
325721
|
var LmImageViewer$1 = /*#__PURE__*/React.forwardRef(LmImageViewer);
|
|
325086
325722
|
|
|
325087
|
-
var SortableItem$
|
|
325723
|
+
var SortableItem$4 = function SortableItem(_ref) {
|
|
325088
325724
|
var index = _ref.index,
|
|
325089
325725
|
item = _ref.item,
|
|
325090
325726
|
instance = _ref.instance;
|
|
@@ -325120,7 +325756,7 @@
|
|
|
325120
325756
|
})));
|
|
325121
325757
|
};
|
|
325122
325758
|
|
|
325123
|
-
var SortableItem$
|
|
325759
|
+
var SortableItem$5 = /*#__PURE__*/React__default['default'].memo(SortableItem$4);
|
|
325124
325760
|
|
|
325125
325761
|
var SortableBox$3 = function SortableBox(_ref) {
|
|
325126
325762
|
var instance = _ref.instance;
|
|
@@ -325131,7 +325767,7 @@
|
|
|
325131
325767
|
items: items,
|
|
325132
325768
|
strategy: rectSortingStrategy
|
|
325133
325769
|
}, options === null || options === void 0 ? void 0 : options.map(function (item, idx) {
|
|
325134
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
325770
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$5, {
|
|
325135
325771
|
instance: instance,
|
|
325136
325772
|
index: idx,
|
|
325137
325773
|
key: item[rowKey] || idx,
|
|
@@ -325142,7 +325778,7 @@
|
|
|
325142
325778
|
|
|
325143
325779
|
var SortableBox$4 = /*#__PURE__*/React__default['default'].memo(SortableBox$3);
|
|
325144
325780
|
|
|
325145
|
-
var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
325781
|
+
var DragOver$1 = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
325146
325782
|
var instance = _ref.instance;
|
|
325147
325783
|
var isDragging = instance.isDragging,
|
|
325148
325784
|
activeId = instance.activeId,
|
|
@@ -325164,7 +325800,7 @@
|
|
|
325164
325800
|
*/
|
|
325165
325801
|
// 可拖拽容器
|
|
325166
325802
|
|
|
325167
|
-
var DndContainer$
|
|
325803
|
+
var DndContainer$5 = function DndContainer(_ref2) {
|
|
325168
325804
|
var options = _ref2.options,
|
|
325169
325805
|
rowKey = _ref2.rowKey,
|
|
325170
325806
|
children = _ref2.children,
|
|
@@ -325251,7 +325887,7 @@
|
|
|
325251
325887
|
collisionDetection: closestCenter
|
|
325252
325888
|
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$4, {
|
|
325253
325889
|
instance: instance
|
|
325254
|
-
}), /*#__PURE__*/React__default['default'].createElement(DragOver, {
|
|
325890
|
+
}), /*#__PURE__*/React__default['default'].createElement(DragOver$1, {
|
|
325255
325891
|
instance: instance
|
|
325256
325892
|
}));
|
|
325257
325893
|
};
|
|
@@ -325261,7 +325897,7 @@
|
|
|
325261
325897
|
React.useImperativeHandle(ref, function () {
|
|
325262
325898
|
return {};
|
|
325263
325899
|
});
|
|
325264
|
-
return /*#__PURE__*/React__default['default'].createElement(DndContainer$
|
|
325900
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$5, _objectSpread({}, props));
|
|
325265
325901
|
};
|
|
325266
325902
|
|
|
325267
325903
|
var Root$2 = /*#__PURE__*/React.forwardRef(Root$1);
|