linkmore-design 1.1.26 → 1.1.27-alpha.1
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/customRenderEmpty.d.ts +2 -0
- package/dist/LmEditTable/components/index.d.ts +17 -0
- package/dist/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/dist/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/dist/LmEditTable/sortableItem.d.ts +3 -2
- package/dist/LmEditTable/util.d.ts +8 -0
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/dist/LmEditTable/virtual/context.d.ts +13 -0
- package/dist/LmEditTable/virtual/index.d.ts +4 -0
- package/dist/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.umd.js +1380 -576
- package/dist/index.umd.min.js +21 -21
- package/dist/variables.css +92 -0
- package/es/InputNumber/index.js +7 -9
- package/es/LmEditTable/DndContainer.d.ts +6 -3
- package/es/LmEditTable/DndContainer.js +70 -10
- package/es/LmEditTable/DragHandle.js +1 -1
- package/es/LmEditTable/EditTable.d.ts +10 -5
- package/es/LmEditTable/EditTable.js +364 -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/customRenderEmpty.d.ts +2 -0
- package/es/LmEditTable/components/customRenderEmpty.js +20 -0
- package/es/LmEditTable/components/index.d.ts +17 -0
- package/es/LmEditTable/components/index.js +8 -0
- package/es/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/es/LmEditTable/hooks/useForkRef.js +22 -0
- package/es/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/es/LmEditTable/rowSort/DndContainerRow.js +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 +92 -0
- package/es/LmEditTable/style/variables.css +92 -0
- package/es/LmEditTable/util.d.ts +8 -0
- package/es/LmEditTable/util.js +103 -7
- package/es/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow.js +140 -0
- package/es/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/es/LmEditTable/virtual/VirtualRow2.js +62 -0
- package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualTable.js +62 -0
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
- package/es/LmEditTable/virtual/context.d.ts +13 -0
- package/es/LmEditTable/virtual/context.js +66 -0
- package/es/LmEditTable/virtual/index.d.ts +4 -0
- package/es/LmEditTable/virtual/index.js +4 -0
- package/es/LmFilter/filterFns/index.js +7 -2
- package/es/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/es/LmTable/virTual/VirtualRow.js +82 -48
- package/es/LmTable/virTual/VirtualTable.js +17 -9
- package/es/LmTable/virTual/context.js +14 -2
- package/es/hooks/useEvent/index.js +1 -1
- package/es/index.d.ts +1 -2
- package/es/styles/variables.css +92 -0
- package/lib/InputNumber/index.js +9 -9
- package/lib/LmEditTable/DndContainer.d.ts +6 -3
- package/lib/LmEditTable/DndContainer.js +74 -9
- package/lib/LmEditTable/DragHandle.js +1 -1
- package/lib/LmEditTable/EditTable.d.ts +10 -5
- package/lib/LmEditTable/EditTable.js +362 -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/customRenderEmpty.d.ts +2 -0
- package/lib/LmEditTable/components/customRenderEmpty.js +32 -0
- package/lib/LmEditTable/components/index.d.ts +17 -0
- package/lib/LmEditTable/components/index.js +45 -0
- package/lib/LmEditTable/hooks/useForkRef.d.ts +2 -0
- package/lib/LmEditTable/hooks/useForkRef.js +29 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.d.ts +10 -0
- package/lib/LmEditTable/rowSort/DndContainerRow.js +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 +92 -0
- package/lib/LmEditTable/style/variables.css +92 -0
- package/lib/LmEditTable/util.d.ts +8 -0
- package/lib/LmEditTable/util.js +110 -6
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow.js +155 -0
- package/lib/LmEditTable/virtual/VirtualRow2.d.ts +7 -0
- package/lib/LmEditTable/virtual/VirtualRow2.js +78 -0
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualTable.js +79 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
- package/lib/LmEditTable/virtual/context.d.ts +13 -0
- package/lib/LmEditTable/virtual/context.js +76 -0
- package/lib/LmEditTable/virtual/index.d.ts +4 -0
- package/lib/LmEditTable/virtual/index.js +31 -0
- package/lib/LmFilter/filterFns/index.js +7 -2
- package/lib/LmTable/virTual/VirtualRow.d.ts +1 -1
- package/lib/LmTable/virTual/VirtualRow.js +81 -48
- package/lib/LmTable/virTual/VirtualTable.js +16 -8
- package/lib/LmTable/virTual/context.js +14 -2
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/styles/variables.css +92 -0
- package/package.json +7 -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
|
|
|
@@ -188742,8 +188747,7 @@
|
|
|
188742
188747
|
|
|
188743
188748
|
var _excluded$1j = ["children", "className", "disabled", "size"];
|
|
188744
188749
|
var prefixCls$3 = 'lm_input-number';
|
|
188745
|
-
|
|
188746
|
-
var LMInputNumber = function LMInputNumber(props) {
|
|
188750
|
+
var LMInputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188747
188751
|
var children = props.children,
|
|
188748
188752
|
className = props.className,
|
|
188749
188753
|
customDisabled = props.disabled,
|
|
@@ -188757,24 +188761,24 @@
|
|
|
188757
188761
|
var size = React__default['default'].useContext(SizeContext$1);
|
|
188758
188762
|
var mergeSize = customizeSize || size;
|
|
188759
188763
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread(_objectSpread({
|
|
188764
|
+
ref: ref,
|
|
188760
188765
|
className: classnames(className, prefixCls$3),
|
|
188761
188766
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
188762
188767
|
}, rest), {}, {
|
|
188763
188768
|
size: mergeSize,
|
|
188764
188769
|
disabled: mergedDisabled
|
|
188765
188770
|
}));
|
|
188766
|
-
};
|
|
188767
|
-
|
|
188771
|
+
});
|
|
188768
188772
|
var CInputNumber = LMInputNumber;
|
|
188769
|
-
|
|
188770
|
-
CInputNumber.Price = function (props) {
|
|
188773
|
+
CInputNumber.Price = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
188771
188774
|
return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread({
|
|
188772
188775
|
prefix: "\uFFE5",
|
|
188776
|
+
ref: ref,
|
|
188773
188777
|
formatter: function formatter(value) {
|
|
188774
188778
|
return "".concat(value).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
188775
188779
|
}
|
|
188776
188780
|
}, props));
|
|
188777
|
-
};
|
|
188781
|
+
});
|
|
188778
188782
|
|
|
188779
188783
|
var getRenderPropValue = function getRenderPropValue(propValue) {
|
|
188780
188784
|
if (!propValue) {
|
|
@@ -233634,6 +233638,14 @@
|
|
|
233634
233638
|
return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);
|
|
233635
233639
|
};
|
|
233636
233640
|
|
|
233641
|
+
const restrictToVerticalAxis = ({
|
|
233642
|
+
transform
|
|
233643
|
+
}) => {
|
|
233644
|
+
return { ...transform,
|
|
233645
|
+
x: 0
|
|
233646
|
+
};
|
|
233647
|
+
};
|
|
233648
|
+
|
|
233637
233649
|
var DndContainer = function DndContainer(_ref) {
|
|
233638
233650
|
var children = _ref.children,
|
|
233639
233651
|
move = _ref.move;
|
|
@@ -285830,13 +285842,20 @@
|
|
|
285830
285842
|
rowHeight: 0,
|
|
285831
285843
|
columnsLen: 0,
|
|
285832
285844
|
// 总行数
|
|
285833
|
-
totalLen: 0
|
|
285845
|
+
totalLen: 0,
|
|
285846
|
+
// 分割后的列数组
|
|
285847
|
+
sliceColumns: {
|
|
285848
|
+
leftColumns: [],
|
|
285849
|
+
centerColumns: [],
|
|
285850
|
+
rightColumns: []
|
|
285851
|
+
}
|
|
285834
285852
|
};
|
|
285835
285853
|
|
|
285836
285854
|
var reducer$4 = function reducer(state, action) {
|
|
285837
285855
|
var totalLen = action.totalLen,
|
|
285838
285856
|
columnsLen = action.columnsLen,
|
|
285839
|
-
rowHeight = action.rowHeight
|
|
285857
|
+
rowHeight = action.rowHeight,
|
|
285858
|
+
sliceColumns = action.sliceColumns;
|
|
285840
285859
|
|
|
285841
285860
|
switch (action.type) {
|
|
285842
285861
|
// 数据数量
|
|
@@ -285857,6 +285876,11 @@
|
|
|
285857
285876
|
rowHeight: rowHeight
|
|
285858
285877
|
});
|
|
285859
285878
|
|
|
285879
|
+
case 'changeSliceColumns':
|
|
285880
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
285881
|
+
sliceColumns: sliceColumns
|
|
285882
|
+
});
|
|
285883
|
+
|
|
285860
285884
|
default:
|
|
285861
285885
|
throw new Error();
|
|
285862
285886
|
}
|
|
@@ -285867,14 +285891,14 @@
|
|
|
285867
285891
|
};
|
|
285868
285892
|
|
|
285869
285893
|
var VirtualTable = /*#__PURE__*/React__default['default'].memo(function (tableProps) {
|
|
285870
|
-
var _bodyRef$current,
|
|
285894
|
+
var _bodyRef$current, _tableProps$children$3, _tableProps$children$4, _bodyRef$current2;
|
|
285871
285895
|
|
|
285872
285896
|
var bodyRef = React.useRef(null);
|
|
285873
285897
|
|
|
285874
285898
|
var _useRealive = useRealive(),
|
|
285875
285899
|
_useRealive2 = _slicedToArray$1(_useRealive, 2),
|
|
285876
285900
|
state = _useRealive2[0],
|
|
285877
|
-
dispatch = _useRealive2[1]; // { totalSize, virtualItems }
|
|
285901
|
+
dispatch = _useRealive2[1]; // 行虚拟化 { totalSize, virtualItems }
|
|
285878
285902
|
|
|
285879
285903
|
|
|
285880
285904
|
var rowVirtual = useVirtual({
|
|
@@ -285887,18 +285911,26 @@
|
|
|
285887
285911
|
return state.rowHeight;
|
|
285888
285912
|
}, [state.rowHeight]),
|
|
285889
285913
|
overscan: 5
|
|
285890
|
-
});
|
|
285914
|
+
}); // 列动态宽度
|
|
285915
|
+
|
|
285916
|
+
var columnEstimateSize = React.useCallback(function (i) {
|
|
285917
|
+
var _tableProps$children$, _tableProps$children$2;
|
|
285918
|
+
|
|
285919
|
+
var colWidths = 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;
|
|
285920
|
+
var leftColumnsLen = state.sliceColumns.leftColumns.length;
|
|
285921
|
+
var centerColumnsLen = state.sliceColumns.centerColumns.length; // 获取非固定列
|
|
285922
|
+
|
|
285923
|
+
var virList = colWidths.slice(leftColumnsLen, leftColumnsLen + centerColumnsLen);
|
|
285924
|
+
return virList[i] || 0;
|
|
285925
|
+
}, [(_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, state.sliceColumns.leftColumns.length, state.sliceColumns.centerColumns.length]); // 列虚拟化
|
|
285926
|
+
|
|
285891
285927
|
var columnVirtual = useVirtual({
|
|
285892
285928
|
horizontal: true,
|
|
285893
285929
|
size: state.columnsLen,
|
|
285894
285930
|
parentRef: {
|
|
285895
285931
|
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current2 = bodyRef.current) === null || _bodyRef$current2 === void 0 ? void 0 : _bodyRef$current2.parentNode
|
|
285896
285932
|
},
|
|
285897
|
-
estimateSize:
|
|
285898
|
-
var _tableProps$children$, _tableProps$children$2;
|
|
285899
|
-
|
|
285900
|
-
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];
|
|
285901
|
-
}, [(_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]),
|
|
285933
|
+
estimateSize: columnEstimateSize,
|
|
285902
285934
|
overscan: 5
|
|
285903
285935
|
});
|
|
285904
285936
|
var instance = {
|
|
@@ -285963,33 +285995,63 @@
|
|
|
285963
285995
|
});
|
|
285964
285996
|
|
|
285965
285997
|
var _excluded$28 = ["children"];
|
|
285966
|
-
|
|
285998
|
+
|
|
285999
|
+
var useOptions$2 = function useOptions(_ref) {
|
|
285967
286000
|
var children = _ref.children,
|
|
285968
|
-
|
|
286001
|
+
ref = _ref.ref,
|
|
286002
|
+
trRef = _ref.trRef;
|
|
285969
286003
|
|
|
285970
286004
|
var _useStore = useStore(),
|
|
285971
286005
|
state = _useStore.state,
|
|
285972
286006
|
dispatch = _useStore.dispatch,
|
|
285973
286007
|
instance = _useStore.instance;
|
|
285974
286008
|
|
|
286009
|
+
var virtualItems = instance.columnVirtual.virtualItems;
|
|
285975
286010
|
var rowHeight = state.rowHeight,
|
|
285976
286011
|
totalLen = state.totalLen;
|
|
285977
|
-
var
|
|
285978
|
-
|
|
286012
|
+
var sliceColumns = React.useMemo(function () {
|
|
286013
|
+
return children === null || children === void 0 ? void 0 : children.reduce(function (pre, cur) {
|
|
286014
|
+
var _cur$props, _cur$props2;
|
|
285979
286015
|
|
|
285980
|
-
|
|
285981
|
-
|
|
286016
|
+
if (typeof ((_cur$props = cur.props) === null || _cur$props === void 0 ? void 0 : _cur$props.fixLeft) === 'number') {
|
|
286017
|
+
pre.leftColumns.push(cur);
|
|
286018
|
+
return pre;
|
|
286019
|
+
}
|
|
285982
286020
|
|
|
285983
|
-
|
|
286021
|
+
if (typeof ((_cur$props2 = cur.props) === null || _cur$props2 === void 0 ? void 0 : _cur$props2.fixRight) === 'number') {
|
|
286022
|
+
pre.rightColumns.push(cur);
|
|
286023
|
+
return pre;
|
|
286024
|
+
}
|
|
286025
|
+
|
|
286026
|
+
pre.centerColumns.push(cur);
|
|
286027
|
+
return pre;
|
|
286028
|
+
}, {
|
|
286029
|
+
leftColumns: [],
|
|
286030
|
+
rightColumns: [],
|
|
286031
|
+
centerColumns: []
|
|
286032
|
+
});
|
|
285984
286033
|
}, [children]);
|
|
285985
286034
|
React.useEffect(function () {
|
|
285986
|
-
|
|
286035
|
+
dispatch({
|
|
286036
|
+
type: 'changeSliceColumns',
|
|
286037
|
+
sliceColumns: sliceColumns
|
|
286038
|
+
});
|
|
286039
|
+
}, [sliceColumns]); // 非固定列长度
|
|
286040
|
+
|
|
286041
|
+
var centerColumnsLen = React.useMemo(function () {
|
|
286042
|
+
var _sliceColumns$centerC;
|
|
286043
|
+
|
|
286044
|
+
return (_sliceColumns$centerC = sliceColumns.centerColumns.length) !== null && _sliceColumns$centerC !== void 0 ? _sliceColumns$centerC : 0;
|
|
286045
|
+
}, [sliceColumns]);
|
|
286046
|
+
React.useEffect(function () {
|
|
286047
|
+
if (state.columnsLen !== centerColumnsLen) {
|
|
285987
286048
|
dispatch({
|
|
285988
286049
|
type: 'changeColumnsLen',
|
|
285989
|
-
columnsLen:
|
|
286050
|
+
columnsLen: centerColumnsLen !== null && centerColumnsLen !== void 0 ? centerColumnsLen : 0
|
|
285990
286051
|
});
|
|
285991
286052
|
}
|
|
285992
|
-
}, [
|
|
286053
|
+
}, [centerColumnsLen, dispatch, state.columnsLen]); // 获取行的高度
|
|
286054
|
+
|
|
285993
286055
|
React.useEffect(function () {
|
|
285994
286056
|
var initHeight = function initHeight(tempRef) {
|
|
285995
286057
|
var _tempRef$current;
|
|
@@ -286000,56 +286062,60 @@
|
|
|
286000
286062
|
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;
|
|
286001
286063
|
dispatch({
|
|
286002
286064
|
type: 'initHeight',
|
|
286003
|
-
rowHeight: tempRowHeight
|
|
286065
|
+
rowHeight: tempRowHeight + 1
|
|
286004
286066
|
});
|
|
286005
286067
|
}
|
|
286006
286068
|
};
|
|
286007
286069
|
|
|
286008
286070
|
initHeight(Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef);
|
|
286009
|
-
}, [trRef, dispatch, rowHeight, totalLen, ref]); //
|
|
286010
|
-
|
|
286011
|
-
var
|
|
286012
|
-
|
|
286013
|
-
|
|
286014
|
-
|
|
286015
|
-
|
|
286016
|
-
|
|
286017
|
-
|
|
286018
|
-
|
|
286019
|
-
|
|
286020
|
-
|
|
286021
|
-
|
|
286022
|
-
|
|
286023
|
-
|
|
286071
|
+
}, [trRef, dispatch, rowHeight, totalLen, ref]); // 横向单元格合并
|
|
286072
|
+
|
|
286073
|
+
var leftColSpan = React.useMemo(function () {
|
|
286074
|
+
var _virtualItems$;
|
|
286075
|
+
|
|
286076
|
+
return (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index;
|
|
286077
|
+
}, [virtualItems]); // 右侧隐藏数量
|
|
286078
|
+
|
|
286079
|
+
var rightColSpan = React.useMemo(function () {
|
|
286080
|
+
return sliceColumns.centerColumns.length - virtualItems.length - leftColSpan || 0;
|
|
286081
|
+
}, [sliceColumns.centerColumns.length, virtualItems.length, leftColSpan]);
|
|
286082
|
+
return _objectSpread(_objectSpread({
|
|
286083
|
+
virtualItems: virtualItems
|
|
286084
|
+
}, sliceColumns), {}, {
|
|
286085
|
+
leftColSpan: leftColSpan,
|
|
286086
|
+
rightColSpan: rightColSpan
|
|
286087
|
+
});
|
|
286088
|
+
};
|
|
286024
286089
|
|
|
286025
|
-
|
|
286026
|
-
|
|
286027
|
-
|
|
286028
|
-
fixedLeft: [],
|
|
286029
|
-
fixedRight: [],
|
|
286030
|
-
columns: []
|
|
286031
|
-
});
|
|
286032
|
-
}, [children]); // 截取非固定列
|
|
286090
|
+
var VirtualRow = /*#__PURE__*/React__default['default'].memo(function (_ref2, ref) {
|
|
286091
|
+
var children = _ref2.children,
|
|
286092
|
+
resetProps = _objectWithoutProperties$1(_ref2, _excluded$28);
|
|
286033
286093
|
|
|
286034
|
-
var
|
|
286035
|
-
var fixedLeft = fixedColumns.fixedLeft,
|
|
286036
|
-
columns = fixedColumns.columns;
|
|
286037
|
-
return virtualItems.slice(fixedLeft.length, fixedLeft.length + columns.length);
|
|
286038
|
-
}, [fixedColumns, virtualItems]); // 横线单元格合并
|
|
286094
|
+
var trRef = React.useRef(null);
|
|
286039
286095
|
|
|
286040
|
-
var
|
|
286041
|
-
|
|
286096
|
+
var _useOptions = useOptions$2({
|
|
286097
|
+
children: children,
|
|
286098
|
+
ref: ref,
|
|
286099
|
+
trRef: trRef
|
|
286100
|
+
}),
|
|
286101
|
+
virtualItems = _useOptions.virtualItems,
|
|
286102
|
+
leftColumns = _useOptions.leftColumns,
|
|
286103
|
+
centerColumns = _useOptions.centerColumns,
|
|
286104
|
+
rightColumns = _useOptions.rightColumns,
|
|
286105
|
+
leftColSpan = _useOptions.leftColSpan,
|
|
286106
|
+
rightColSpan = _useOptions.rightColSpan;
|
|
286042
286107
|
|
|
286043
|
-
var startIndex = (resetVirtualItems === null || resetVirtualItems === void 0 ? void 0 : (_resetVirtualItems$ = resetVirtualItems[0]) === null || _resetVirtualItems$ === void 0 ? void 0 : _resetVirtualItems$.index) || 0;
|
|
286044
|
-
return startIndex ? startIndex - fixedColumns.fixedLeft.length : startIndex;
|
|
286045
|
-
}, [fixedColumns, resetVirtualItems]);
|
|
286046
286108
|
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetProps), {}, {
|
|
286047
286109
|
ref: Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef
|
|
286048
|
-
}),
|
|
286049
|
-
|
|
286050
|
-
|
|
286051
|
-
|
|
286052
|
-
|
|
286110
|
+
}), leftColumns, !!leftColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
286111
|
+
key: "leftColSpan",
|
|
286112
|
+
colSpan: leftColSpan
|
|
286113
|
+
}), virtualItems.map(function (virtualCol) {
|
|
286114
|
+
return centerColumns[virtualCol.index];
|
|
286115
|
+
}), !!rightColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
286116
|
+
key: "rightColSpan",
|
|
286117
|
+
colSpan: rightColSpan
|
|
286118
|
+
}), rightColumns);
|
|
286053
286119
|
});
|
|
286054
286120
|
|
|
286055
286121
|
// 分组求和计算
|
|
@@ -287660,7 +287726,12 @@
|
|
|
287660
287726
|
|
|
287661
287727
|
return React.useCallback(function () {
|
|
287662
287728
|
var fn = handlerRef.current;
|
|
287663
|
-
|
|
287729
|
+
|
|
287730
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
287731
|
+
args[_key] = arguments[_key];
|
|
287732
|
+
}
|
|
287733
|
+
|
|
287734
|
+
return fn === null || fn === void 0 ? void 0 : fn.apply(void 0, args);
|
|
287664
287735
|
}, []);
|
|
287665
287736
|
}
|
|
287666
287737
|
|
|
@@ -312649,16 +312720,59 @@
|
|
|
312649
312720
|
|
|
312650
312721
|
Form$4.Wrapper = Wrapper;
|
|
312651
312722
|
|
|
312652
|
-
var
|
|
312653
|
-
var
|
|
312654
|
-
|
|
312723
|
+
var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
312724
|
+
var instance = _ref.instance;
|
|
312725
|
+
var isDragging = instance.isDragging,
|
|
312726
|
+
activeId = instance.activeId,
|
|
312727
|
+
options = instance.options;
|
|
312728
|
+
var item = activeId && options.find(function (v) {
|
|
312729
|
+
return v.dataIndex === activeId;
|
|
312730
|
+
});
|
|
312731
|
+
return /*#__PURE__*/React__default['default'].createElement(DragOverlay, {
|
|
312732
|
+
adjustScale: false
|
|
312733
|
+
}, isDragging ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
312734
|
+
className: "lm_editable_col_drag"
|
|
312735
|
+
}, item === null || item === void 0 ? void 0 : item.title) : null);
|
|
312736
|
+
}); // 可拖拽容器
|
|
312737
|
+
|
|
312738
|
+
var DndContainer$1 = function DndContainer(_ref2) {
|
|
312739
|
+
var children = _ref2.children,
|
|
312740
|
+
move = _ref2.move,
|
|
312741
|
+
options = _ref2.options,
|
|
312742
|
+
rowKey = _ref2.rowKey;
|
|
312743
|
+
|
|
312744
|
+
var _React$useState = React__default['default'].useState(false),
|
|
312745
|
+
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
312746
|
+
isDragging = _React$useState2[0],
|
|
312747
|
+
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
312748
|
+
|
|
312749
|
+
|
|
312750
|
+
var _React$useState3 = React__default['default'].useState(null),
|
|
312751
|
+
_React$useState4 = _slicedToArray$1(_React$useState3, 2),
|
|
312752
|
+
activeId = _React$useState4[0],
|
|
312753
|
+
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
312754
|
+
|
|
312755
|
+
|
|
312655
312756
|
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
312656
312757
|
coordinateGetter: sortableKeyboardCoordinates
|
|
312657
|
-
})); //
|
|
312758
|
+
})); // 开始拖拽
|
|
312759
|
+
|
|
312760
|
+
var handleDragStart = function handleDragStart(_ref3) {
|
|
312761
|
+
var active = _ref3.active;
|
|
312762
|
+
setIsDragging(true);
|
|
312763
|
+
|
|
312764
|
+
if (!active) {
|
|
312765
|
+
return;
|
|
312766
|
+
}
|
|
312767
|
+
|
|
312768
|
+
setActiveId(active.id);
|
|
312769
|
+
}; // 拖拽结束
|
|
312770
|
+
|
|
312658
312771
|
|
|
312659
312772
|
var handleDragEnd = function handleDragEnd(event) {
|
|
312660
312773
|
var active = event.active,
|
|
312661
|
-
over = event.over;
|
|
312774
|
+
over = event.over;
|
|
312775
|
+
setActiveId(null); // 未移入时触发
|
|
312662
312776
|
|
|
312663
312777
|
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
312664
312778
|
return;
|
|
@@ -312670,39 +312784,365 @@
|
|
|
312670
312784
|
}
|
|
312671
312785
|
};
|
|
312672
312786
|
|
|
312787
|
+
var instance = {
|
|
312788
|
+
isDragging: isDragging,
|
|
312789
|
+
activeId: activeId,
|
|
312790
|
+
options: options,
|
|
312791
|
+
rowKey: rowKey,
|
|
312792
|
+
children: children,
|
|
312793
|
+
move: move,
|
|
312794
|
+
items: options === null || options === void 0 ? void 0 : options.map(function (v) {
|
|
312795
|
+
return v[rowKey];
|
|
312796
|
+
})
|
|
312797
|
+
};
|
|
312673
312798
|
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
312674
312799
|
sensors: sensors,
|
|
312675
312800
|
collisionDetection: closestCenter,
|
|
312801
|
+
onDragStart: handleDragStart,
|
|
312676
312802
|
onDragEnd: handleDragEnd,
|
|
312803
|
+
onDragCancel: function onDragCancel() {
|
|
312804
|
+
return setActiveId(null);
|
|
312805
|
+
},
|
|
312677
312806
|
modifiers: [restrictToParentElement]
|
|
312678
|
-
}, children
|
|
312807
|
+
}, children, /*#__PURE__*/React__default['default'].createElement(DragOver, {
|
|
312808
|
+
instance: instance
|
|
312809
|
+
}));
|
|
312679
312810
|
};
|
|
312680
312811
|
|
|
312812
|
+
var DndContainer$2 = /*#__PURE__*/React.memo(DndContainer$1);
|
|
312813
|
+
|
|
312681
312814
|
var SortableBox$1 = function SortableBox(_ref) {
|
|
312682
312815
|
var items = _ref.items,
|
|
312683
312816
|
children = _ref.children;
|
|
312684
312817
|
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
312685
312818
|
items: items,
|
|
312686
|
-
strategy:
|
|
312819
|
+
strategy: horizontalListSortingStrategy
|
|
312687
312820
|
}, children);
|
|
312688
312821
|
};
|
|
312689
312822
|
|
|
312690
|
-
var
|
|
312691
|
-
|
|
312692
|
-
|
|
312693
|
-
|
|
312694
|
-
|
|
312695
|
-
|
|
312696
|
-
|
|
312823
|
+
var TableContext$2 = /*#__PURE__*/React.createContext({
|
|
312824
|
+
state: null,
|
|
312825
|
+
dispatch: null,
|
|
312826
|
+
instance: {}
|
|
312827
|
+
});
|
|
312828
|
+
|
|
312829
|
+
var useStore$1 = function useStore() {
|
|
312830
|
+
return React.useContext(TableContext$2);
|
|
312831
|
+
};
|
|
312832
|
+
|
|
312833
|
+
var initialState$3 = {
|
|
312834
|
+
// 行高度
|
|
312835
|
+
rowHeight: 0,
|
|
312836
|
+
columnsLen: 0,
|
|
312837
|
+
// 总行数
|
|
312838
|
+
totalLen: 0,
|
|
312839
|
+
// 分割后的列数组
|
|
312840
|
+
sliceColumns: {
|
|
312841
|
+
leftColumns: [],
|
|
312842
|
+
centerColumns: [],
|
|
312843
|
+
rightColumns: []
|
|
312844
|
+
}
|
|
312845
|
+
};
|
|
312846
|
+
|
|
312847
|
+
var reducer$5 = function reducer(state, action) {
|
|
312848
|
+
var totalLen = action.totalLen,
|
|
312849
|
+
columnsLen = action.columnsLen,
|
|
312850
|
+
rowHeight = action.rowHeight,
|
|
312851
|
+
sliceColumns = action.sliceColumns;
|
|
312852
|
+
|
|
312853
|
+
switch (action.type) {
|
|
312854
|
+
// 数据数量
|
|
312855
|
+
case 'changeTotalLen':
|
|
312856
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312857
|
+
totalLen: totalLen
|
|
312858
|
+
});
|
|
312859
|
+
// 列数量
|
|
312860
|
+
|
|
312861
|
+
case 'changeColumnsLen':
|
|
312862
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312863
|
+
columnsLen: columnsLen
|
|
312864
|
+
});
|
|
312865
|
+
// 初始化行高度
|
|
312866
|
+
|
|
312867
|
+
case 'initHeight':
|
|
312868
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312869
|
+
rowHeight: rowHeight
|
|
312870
|
+
});
|
|
312871
|
+
|
|
312872
|
+
case 'changeSliceColumns':
|
|
312873
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
312874
|
+
sliceColumns: sliceColumns
|
|
312875
|
+
});
|
|
312876
|
+
|
|
312877
|
+
default:
|
|
312878
|
+
throw new Error();
|
|
312879
|
+
}
|
|
312880
|
+
};
|
|
312881
|
+
|
|
312882
|
+
var useRealive$1 = function useRealive() {
|
|
312883
|
+
return React.useReducer(reducer$5, initialState$3);
|
|
312884
|
+
};
|
|
312885
|
+
|
|
312886
|
+
var VirtualTable$1 = /*#__PURE__*/React__default['default'].memo(function (tableProps) {
|
|
312887
|
+
var _bodyRef$current, _tableProps$children$3, _tableProps$children$4, _bodyRef$current2;
|
|
312888
|
+
|
|
312889
|
+
var bodyRef = React.useRef(null);
|
|
312890
|
+
|
|
312891
|
+
var _useRealive = useRealive$1(),
|
|
312892
|
+
_useRealive2 = _slicedToArray$1(_useRealive, 2),
|
|
312893
|
+
state = _useRealive2[0],
|
|
312894
|
+
dispatch = _useRealive2[1]; // 行虚拟化 { totalSize, virtualItems }
|
|
312895
|
+
|
|
312896
|
+
|
|
312897
|
+
var rowVirtual = useVirtual({
|
|
312898
|
+
size: state.totalLen,
|
|
312899
|
+
// 绑定父节点
|
|
312900
|
+
parentRef: {
|
|
312901
|
+
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current = bodyRef.current) === null || _bodyRef$current === void 0 ? void 0 : _bodyRef$current.parentNode
|
|
312902
|
+
},
|
|
312903
|
+
estimateSize: React__default['default'].useCallback(function () {
|
|
312904
|
+
return state.rowHeight;
|
|
312905
|
+
}, [state.rowHeight]),
|
|
312906
|
+
overscan: 5
|
|
312907
|
+
}); // 列动态宽度
|
|
312908
|
+
|
|
312909
|
+
var columnEstimateSize = React.useCallback(function (i) {
|
|
312910
|
+
var _tableProps$children$, _tableProps$children$2;
|
|
312911
|
+
|
|
312912
|
+
var colWidths = 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;
|
|
312913
|
+
var leftColumnsLen = state.sliceColumns.leftColumns.length;
|
|
312914
|
+
var centerColumnsLen = state.sliceColumns.centerColumns.length; // 获取非固定列
|
|
312915
|
+
|
|
312916
|
+
var virList = colWidths.slice(leftColumnsLen, leftColumnsLen + centerColumnsLen);
|
|
312917
|
+
return virList[i] || 0;
|
|
312918
|
+
}, [(_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, state.sliceColumns.leftColumns.length, state.sliceColumns.centerColumns.length]); // 列虚拟化
|
|
312919
|
+
|
|
312920
|
+
var columnVirtual = useVirtual({
|
|
312921
|
+
horizontal: true,
|
|
312922
|
+
size: state.columnsLen,
|
|
312923
|
+
parentRef: {
|
|
312924
|
+
current: bodyRef === null || bodyRef === void 0 ? void 0 : (_bodyRef$current2 = bodyRef.current) === null || _bodyRef$current2 === void 0 ? void 0 : _bodyRef$current2.parentNode
|
|
312925
|
+
},
|
|
312926
|
+
estimateSize: columnEstimateSize,
|
|
312927
|
+
overscan: 5
|
|
312928
|
+
});
|
|
312929
|
+
var instance = {
|
|
312930
|
+
rowVirtual: rowVirtual,
|
|
312931
|
+
columnVirtual: columnVirtual
|
|
312932
|
+
};
|
|
312933
|
+
return /*#__PURE__*/React__default['default'].createElement(TableContext$2.Provider, {
|
|
312934
|
+
value: {
|
|
312935
|
+
state: state,
|
|
312936
|
+
dispatch: dispatch,
|
|
312937
|
+
instance: instance
|
|
312938
|
+
}
|
|
312939
|
+
}, /*#__PURE__*/React__default['default'].createElement("table", _objectSpread({
|
|
312940
|
+
ref: bodyRef
|
|
312941
|
+
}, tableProps)));
|
|
312942
|
+
});
|
|
312943
|
+
|
|
312944
|
+
var _excluded$2P = ["children"];
|
|
312945
|
+
var VirtualWrapper$1 = /*#__PURE__*/React__default['default'].memo(function (wrapperProps) {
|
|
312946
|
+
var _virtualItems$, _virtualItems;
|
|
312947
|
+
|
|
312948
|
+
var children = wrapperProps.children,
|
|
312949
|
+
resetProps = _objectWithoutProperties$1(wrapperProps, _excluded$2P);
|
|
312950
|
+
|
|
312951
|
+
var _useStore = useStore$1(),
|
|
312952
|
+
state = _useStore.state,
|
|
312953
|
+
dispatch = _useStore.dispatch,
|
|
312954
|
+
instance = _useStore.instance;
|
|
312955
|
+
|
|
312956
|
+
var _instance$rowVirtual = instance.rowVirtual,
|
|
312957
|
+
virtualItems = _instance$rowVirtual.virtualItems,
|
|
312958
|
+
totalSize = _instance$rowVirtual.totalSize;
|
|
312959
|
+
var contents = React.useMemo(function () {
|
|
312960
|
+
return children[1];
|
|
312961
|
+
}, [children]);
|
|
312962
|
+
var contentsLen = React.useMemo(function () {
|
|
312963
|
+
var _contents$length;
|
|
312964
|
+
|
|
312965
|
+
return (_contents$length = contents === null || contents === void 0 ? void 0 : contents.length) !== null && _contents$length !== void 0 ? _contents$length : 0;
|
|
312966
|
+
}, [contents]);
|
|
312967
|
+
React.useEffect(function () {
|
|
312968
|
+
if (state.totalLen !== contentsLen) {
|
|
312969
|
+
dispatch({
|
|
312970
|
+
type: 'changeTotalLen',
|
|
312971
|
+
totalLen: contentsLen !== null && contentsLen !== void 0 ? contentsLen : 0
|
|
312972
|
+
});
|
|
312973
|
+
}
|
|
312974
|
+
}, [contentsLen, dispatch, state.totalLen]);
|
|
312975
|
+
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;
|
|
312976
|
+
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;
|
|
312977
|
+
return /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, resetProps), paddingTop > 0 && /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
312978
|
+
style: {
|
|
312979
|
+
height: "".concat(paddingTop, "px")
|
|
312980
|
+
}
|
|
312981
|
+
})), children[0], virtualItems.map(function (virtualRow) {
|
|
312982
|
+
return contents[virtualRow.index];
|
|
312983
|
+
}), paddingBottom > 0 && /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("td", {
|
|
312984
|
+
style: {
|
|
312985
|
+
height: "".concat(paddingBottom, "px")
|
|
312986
|
+
}
|
|
312987
|
+
})));
|
|
312988
|
+
});
|
|
312989
|
+
|
|
312990
|
+
function setRef(ref, value) {
|
|
312991
|
+
if (typeof ref === 'function') {
|
|
312992
|
+
ref(value);
|
|
312993
|
+
} else if (ref) {
|
|
312994
|
+
ref.current = value;
|
|
312995
|
+
}
|
|
312996
|
+
}
|
|
312997
|
+
|
|
312998
|
+
function useForkRef(refA, refB) {
|
|
312999
|
+
return React.useMemo(function () {
|
|
313000
|
+
if (refA == null && refB == null) {
|
|
313001
|
+
return null;
|
|
313002
|
+
}
|
|
313003
|
+
|
|
313004
|
+
return function (refValue) {
|
|
313005
|
+
setRef(refA, refValue);
|
|
313006
|
+
setRef(refB, refValue);
|
|
313007
|
+
};
|
|
313008
|
+
}, [refA, refB]);
|
|
313009
|
+
}
|
|
313010
|
+
|
|
313011
|
+
var _excluded$2Q = ["children", "pref"];
|
|
313012
|
+
|
|
313013
|
+
var useOptions$3 = function useOptions(_ref) {
|
|
313014
|
+
var children = _ref.children,
|
|
313015
|
+
ref = _ref.ref,
|
|
313016
|
+
trRef = _ref.trRef;
|
|
313017
|
+
|
|
313018
|
+
var _useStore = useStore$1(),
|
|
313019
|
+
state = _useStore.state,
|
|
313020
|
+
dispatch = _useStore.dispatch,
|
|
313021
|
+
instance = _useStore.instance;
|
|
313022
|
+
|
|
313023
|
+
var virtualItems = instance.columnVirtual.virtualItems;
|
|
313024
|
+
var rowHeight = state.rowHeight,
|
|
313025
|
+
totalLen = state.totalLen;
|
|
313026
|
+
var sliceColumns = React.useMemo(function () {
|
|
313027
|
+
return children === null || children === void 0 ? void 0 : children.reduce(function (pre, cur) {
|
|
313028
|
+
var _cur$props, _cur$props2;
|
|
313029
|
+
|
|
313030
|
+
if (typeof ((_cur$props = cur.props) === null || _cur$props === void 0 ? void 0 : _cur$props.fixLeft) === 'number') {
|
|
313031
|
+
pre.leftColumns.push(cur);
|
|
313032
|
+
return pre;
|
|
313033
|
+
}
|
|
313034
|
+
|
|
313035
|
+
if (typeof ((_cur$props2 = cur.props) === null || _cur$props2 === void 0 ? void 0 : _cur$props2.fixRight) === 'number') {
|
|
313036
|
+
pre.rightColumns.push(cur);
|
|
313037
|
+
return pre;
|
|
313038
|
+
}
|
|
313039
|
+
|
|
313040
|
+
pre.centerColumns.push(cur);
|
|
313041
|
+
return pre;
|
|
313042
|
+
}, {
|
|
313043
|
+
leftColumns: [],
|
|
313044
|
+
rightColumns: [],
|
|
313045
|
+
centerColumns: []
|
|
313046
|
+
});
|
|
313047
|
+
}, [children]);
|
|
313048
|
+
React.useEffect(function () {
|
|
313049
|
+
dispatch({
|
|
313050
|
+
type: 'changeSliceColumns',
|
|
313051
|
+
sliceColumns: sliceColumns
|
|
313052
|
+
});
|
|
313053
|
+
}, [sliceColumns]); // 非固定列长度
|
|
313054
|
+
|
|
313055
|
+
var centerColumnsLen = React.useMemo(function () {
|
|
313056
|
+
var _sliceColumns$centerC;
|
|
313057
|
+
|
|
313058
|
+
return (_sliceColumns$centerC = sliceColumns.centerColumns.length) !== null && _sliceColumns$centerC !== void 0 ? _sliceColumns$centerC : 0;
|
|
313059
|
+
}, [sliceColumns]);
|
|
313060
|
+
React.useEffect(function () {
|
|
313061
|
+
if (state.columnsLen !== centerColumnsLen) {
|
|
313062
|
+
dispatch({
|
|
313063
|
+
type: 'changeColumnsLen',
|
|
313064
|
+
columnsLen: centerColumnsLen !== null && centerColumnsLen !== void 0 ? centerColumnsLen : 0
|
|
313065
|
+
});
|
|
313066
|
+
}
|
|
313067
|
+
}, [centerColumnsLen, dispatch, state.columnsLen]); // 获取行的高度
|
|
313068
|
+
|
|
313069
|
+
React.useEffect(function () {
|
|
313070
|
+
var initHeight = function initHeight(tempRef) {
|
|
313071
|
+
var _tempRef$current;
|
|
313072
|
+
|
|
313073
|
+
if ((tempRef === null || tempRef === void 0 ? void 0 : (_tempRef$current = tempRef.current) === null || _tempRef$current === void 0 ? void 0 : _tempRef$current.offsetHeight) && !rowHeight && totalLen) {
|
|
313074
|
+
var _tempRef$current$offs, _tempRef$current2;
|
|
313075
|
+
|
|
313076
|
+
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;
|
|
313077
|
+
dispatch({
|
|
313078
|
+
type: 'initHeight',
|
|
313079
|
+
rowHeight: tempRowHeight + 1
|
|
313080
|
+
});
|
|
313081
|
+
}
|
|
313082
|
+
};
|
|
313083
|
+
|
|
313084
|
+
initHeight(Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef);
|
|
313085
|
+
}, [trRef, dispatch, rowHeight, totalLen, ref]); // 横向单元格合并
|
|
313086
|
+
|
|
313087
|
+
var leftColSpan = React.useMemo(function () {
|
|
313088
|
+
var _virtualItems$;
|
|
313089
|
+
|
|
313090
|
+
return (_virtualItems$ = virtualItems[0]) === null || _virtualItems$ === void 0 ? void 0 : _virtualItems$.index;
|
|
313091
|
+
}, [virtualItems]); // 右侧隐藏数量
|
|
313092
|
+
|
|
313093
|
+
var rightColSpan = React.useMemo(function () {
|
|
313094
|
+
return sliceColumns.centerColumns.length - virtualItems.length - leftColSpan || 0;
|
|
313095
|
+
}, [sliceColumns.centerColumns.length, virtualItems.length, leftColSpan]);
|
|
313096
|
+
return _objectSpread(_objectSpread({
|
|
313097
|
+
virtualItems: virtualItems
|
|
313098
|
+
}, sliceColumns), {}, {
|
|
313099
|
+
leftColSpan: leftColSpan,
|
|
313100
|
+
rightColSpan: rightColSpan
|
|
313101
|
+
});
|
|
312697
313102
|
};
|
|
312698
313103
|
|
|
312699
|
-
var
|
|
313104
|
+
var VirtualRow$1 = /*#__PURE__*/React__default['default'].memo(function (_ref2, ref) {
|
|
313105
|
+
var children = _ref2.children,
|
|
313106
|
+
pref = _ref2.pref,
|
|
313107
|
+
resetProps = _objectWithoutProperties$1(_ref2, _excluded$2Q);
|
|
313108
|
+
|
|
313109
|
+
var trRef = React.useRef(null);
|
|
313110
|
+
|
|
313111
|
+
var _useOptions = useOptions$3({
|
|
313112
|
+
children: children,
|
|
313113
|
+
ref: ref,
|
|
313114
|
+
trRef: trRef
|
|
313115
|
+
}),
|
|
313116
|
+
virtualItems = _useOptions.virtualItems,
|
|
313117
|
+
leftColumns = _useOptions.leftColumns,
|
|
313118
|
+
centerColumns = _useOptions.centerColumns,
|
|
313119
|
+
rightColumns = _useOptions.rightColumns,
|
|
313120
|
+
leftColSpan = _useOptions.leftColSpan,
|
|
313121
|
+
rightColSpan = _useOptions.rightColSpan;
|
|
313122
|
+
|
|
313123
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetProps), {}, {
|
|
313124
|
+
ref: useForkRef(pref, trRef)
|
|
313125
|
+
}), leftColumns, !!leftColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
313126
|
+
key: "leftColSpan",
|
|
313127
|
+
colSpan: leftColSpan
|
|
313128
|
+
}), virtualItems.map(function (virtualCol) {
|
|
313129
|
+
return /*#__PURE__*/React__default['default'].cloneElement(centerColumns[virtualCol.index], {
|
|
313130
|
+
ref: virtualCol.measureRef
|
|
313131
|
+
});
|
|
313132
|
+
}), !!rightColSpan && /*#__PURE__*/React__default['default'].createElement("td", {
|
|
313133
|
+
key: "rightColSpan",
|
|
313134
|
+
colSpan: rightColSpan
|
|
313135
|
+
}), rightColumns);
|
|
313136
|
+
});
|
|
313137
|
+
|
|
313138
|
+
var _excluded$2R = ["data-row-key", "children", "className", "virtual"];
|
|
312700
313139
|
|
|
312701
313140
|
var SortableItem$1 = function SortableItem(props) {
|
|
312702
313141
|
var key = props['data-row-key'],
|
|
312703
313142
|
children = props.children,
|
|
312704
313143
|
className = props.className,
|
|
312705
|
-
|
|
313144
|
+
virtual = props.virtual,
|
|
313145
|
+
resetField = _objectWithoutProperties$1(props, _excluded$2R);
|
|
312706
313146
|
|
|
312707
313147
|
var _useSortable = useSortable({
|
|
312708
313148
|
id: key
|
|
@@ -312716,27 +313156,66 @@
|
|
|
312716
313156
|
transform: CSS.Transform.toString(transform),
|
|
312717
313157
|
transition: transition
|
|
312718
313158
|
};
|
|
312719
|
-
|
|
313159
|
+
|
|
313160
|
+
if (!virtual) {
|
|
313161
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread(_objectSpread({}, resetField), {}, {
|
|
313162
|
+
ref: setNodeRef,
|
|
313163
|
+
key: key,
|
|
313164
|
+
style: style
|
|
313165
|
+
}, attributes), children);
|
|
313166
|
+
}
|
|
313167
|
+
|
|
313168
|
+
return /*#__PURE__*/React__default['default'].createElement(VirtualRow$1, _objectSpread(_objectSpread({}, resetField), {}, {
|
|
312720
313169
|
ref: setNodeRef,
|
|
313170
|
+
pref: setNodeRef,
|
|
312721
313171
|
key: key,
|
|
312722
313172
|
style: style
|
|
312723
313173
|
}, attributes), children);
|
|
312724
313174
|
};
|
|
312725
313175
|
|
|
312726
|
-
var
|
|
312727
|
-
|
|
312728
|
-
|
|
313176
|
+
var SortableItem$2 = /*#__PURE__*/React.memo(SortableItem$1);
|
|
313177
|
+
|
|
313178
|
+
var _excluded$2S = ["children"];
|
|
313179
|
+
// children: React.ReactNode
|
|
313180
|
+
// }
|
|
313181
|
+
// interface ItemInstance {}
|
|
313182
|
+
// @ts-ignore
|
|
312729
313183
|
|
|
313184
|
+
var Item$5 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
312730
313185
|
var children = _ref.children,
|
|
312731
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
313186
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2S);
|
|
313187
|
+
|
|
313188
|
+
// const rProps = omit({ ...props, ...children.props }, [
|
|
313189
|
+
// 'isSticky',
|
|
313190
|
+
// 'colStart',
|
|
313191
|
+
// 'colEnd',
|
|
313192
|
+
// 'prefixCls',
|
|
313193
|
+
// 'fixLeft',
|
|
313194
|
+
// 'fixRight',
|
|
313195
|
+
// 'lastFixLeft',
|
|
313196
|
+
// 'firstFixRight',
|
|
313197
|
+
// 'lastFixRight',
|
|
313198
|
+
// 'firstFixLeft',
|
|
313199
|
+
// 'isSticky',
|
|
313200
|
+
// 'additionalProps',
|
|
313201
|
+
// 'rowType',
|
|
313202
|
+
// ])
|
|
313203
|
+
return (
|
|
313204
|
+
/*#__PURE__*/
|
|
313205
|
+
// <th {...rProps} ref={ref as any} />
|
|
313206
|
+
React__default['default'].createElement("th", _objectSpread(_objectSpread(_objectSpread({}, props), children.props), {}, {
|
|
313207
|
+
ref: ref
|
|
313208
|
+
})) // <th {...props} ref={ref as any}>
|
|
313209
|
+
// {(children as any)?.props?.children || children}
|
|
313210
|
+
// </th>
|
|
312732
313211
|
|
|
312733
|
-
|
|
312734
|
-
ref: ref
|
|
312735
|
-
}), (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.children) || children);
|
|
313212
|
+
);
|
|
312736
313213
|
});
|
|
312737
|
-
function SortableItem$
|
|
313214
|
+
function SortableItem$3(props) {
|
|
313215
|
+
var id = props.id;
|
|
313216
|
+
|
|
312738
313217
|
var _useSortable = useSortable({
|
|
312739
|
-
id:
|
|
313218
|
+
id: id
|
|
312740
313219
|
}),
|
|
312741
313220
|
attributes = _useSortable.attributes,
|
|
312742
313221
|
listeners = _useSortable.listeners,
|
|
@@ -312746,7 +313225,9 @@
|
|
|
312746
313225
|
|
|
312747
313226
|
var style = {
|
|
312748
313227
|
position: 'relative',
|
|
312749
|
-
transform: CSS.Translate.toString(transform),
|
|
313228
|
+
transform: CSS.Translate.toString(transform ? _objectSpread(_objectSpread({}, transform), {}, {
|
|
313229
|
+
y: 0
|
|
313230
|
+
}) : transform),
|
|
312750
313231
|
transition: transition,
|
|
312751
313232
|
touchAction: 'none',
|
|
312752
313233
|
height: '40px',
|
|
@@ -312776,7 +313257,7 @@
|
|
|
312776
313257
|
touchAction: 'none',
|
|
312777
313258
|
cursor: 'move'
|
|
312778
313259
|
},
|
|
312779
|
-
className:
|
|
313260
|
+
className: "icon_drag".concat(isDragging ? 'bing' : '')
|
|
312780
313261
|
}));
|
|
312781
313262
|
};
|
|
312782
313263
|
|
|
@@ -312788,19 +313269,20 @@
|
|
|
312788
313269
|
function deepDataSourcePreKeys(dataSource, rowKey) {
|
|
312789
313270
|
var deepDataSource = [];
|
|
312790
313271
|
|
|
312791
|
-
var eachChildren = function eachChildren(children, preKeys) {
|
|
312792
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
313272
|
+
var eachChildren = function eachChildren(children, preKeys, deepIds) {
|
|
313273
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
312793
313274
|
deepDataSource.push(_objectSpread(_objectSpread({}, item), {}, {
|
|
312794
|
-
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]])
|
|
313275
|
+
preKeys: [].concat(_toConsumableArray$1(preKeys), [item === null || item === void 0 ? void 0 : item[rowKey]]),
|
|
313276
|
+
_deepIds: [].concat(_toConsumableArray$1(deepIds), [index + 1])
|
|
312795
313277
|
}));
|
|
312796
313278
|
|
|
312797
313279
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
312798
|
-
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]] })
|
|
313280
|
+
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]] })
|
|
312799
313281
|
}
|
|
312800
313282
|
});
|
|
312801
313283
|
};
|
|
312802
313284
|
|
|
312803
|
-
eachChildren(dataSource, []);
|
|
313285
|
+
eachChildren(dataSource, [], []);
|
|
312804
313286
|
return lodash.keyBy(deepDataSource, rowKey);
|
|
312805
313287
|
}
|
|
312806
313288
|
function isExpandRow(children) {
|
|
@@ -312832,21 +313314,394 @@
|
|
|
312832
313314
|
|
|
312833
313315
|
return _objectSpread(_objectSpread({}, v), {}, _defineProperty$1({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
|
|
312834
313316
|
});
|
|
312835
|
-
return res;
|
|
313317
|
+
return res || [];
|
|
313318
|
+
}
|
|
313319
|
+
function getExpandStatus(children) {
|
|
313320
|
+
var _children$2, _children$2$props, _children$2$props$chi, _children$2$props$chi2, _children$2$props$chi3;
|
|
313321
|
+
|
|
313322
|
+
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'] : '';
|
|
313323
|
+
}
|
|
313324
|
+
function checkMemoShouldUploadSpecialFun(prev, next) {
|
|
313325
|
+
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;
|
|
313326
|
+
|
|
313327
|
+
var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
|
|
313328
|
+
|
|
313329
|
+
if (!checkExpandStatus) {
|
|
313330
|
+
return false;
|
|
313331
|
+
}
|
|
313332
|
+
|
|
313333
|
+
var prevCol = prev === null || prev === void 0 ? void 0 : prev.col;
|
|
313334
|
+
var nextCol = next === null || next === void 0 ? void 0 : next.col;
|
|
313335
|
+
/** TODO: 使用了自定义render, 是否要判断rowIndex? 这样排序之后,渲染的性能就会变差 */
|
|
313336
|
+
|
|
313337
|
+
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']))) {
|
|
313338
|
+
return false;
|
|
313339
|
+
}
|
|
313340
|
+
|
|
313341
|
+
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') {
|
|
313342
|
+
return false;
|
|
313343
|
+
}
|
|
313344
|
+
|
|
313345
|
+
if (prev.isEdit !== next.isEdit) {
|
|
313346
|
+
return false;
|
|
313347
|
+
} // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
|
|
313348
|
+
|
|
313349
|
+
|
|
313350
|
+
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'])))) {
|
|
313351
|
+
return false;
|
|
313352
|
+
}
|
|
313353
|
+
|
|
313354
|
+
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)) {
|
|
313355
|
+
return false;
|
|
313356
|
+
}
|
|
313357
|
+
|
|
313358
|
+
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)) {
|
|
313359
|
+
return false;
|
|
313360
|
+
}
|
|
313361
|
+
|
|
313362
|
+
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)) {
|
|
313363
|
+
return false;
|
|
313364
|
+
}
|
|
313365
|
+
|
|
313366
|
+
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)) {
|
|
313367
|
+
return false;
|
|
313368
|
+
}
|
|
313369
|
+
|
|
313370
|
+
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)) {
|
|
313371
|
+
// return isEqual(prevCol?.order, nextCol?.fixed)
|
|
313372
|
+
return false;
|
|
313373
|
+
}
|
|
313374
|
+
|
|
313375
|
+
if (next.className.indexOf('drag-visible') > -1) {
|
|
313376
|
+
return lodash.isEqual(prev.style, next.style);
|
|
313377
|
+
}
|
|
313378
|
+
|
|
313379
|
+
if (next.className.indexOf('ant-table-selection-column') > -1) {
|
|
313380
|
+
var _prev$children, _prev$children$, _next$children, _next$children$;
|
|
313381
|
+
|
|
313382
|
+
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);
|
|
313383
|
+
}
|
|
313384
|
+
/** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
|
|
313385
|
+
|
|
313386
|
+
|
|
313387
|
+
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)) {
|
|
313388
|
+
var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
|
|
313389
|
+
var p = lodash.pick(prev, pickProps);
|
|
313390
|
+
var n = lodash.pick(next, pickProps);
|
|
313391
|
+
return lodash.isEqual(p, n);
|
|
313392
|
+
}
|
|
313393
|
+
|
|
313394
|
+
return true;
|
|
312836
313395
|
}
|
|
313396
|
+
function checkExpandIconColumnIndex(_ref) {
|
|
313397
|
+
var rowSelection = _ref.rowSelection,
|
|
313398
|
+
sortOpen = _ref.sortOpen,
|
|
313399
|
+
indexCol = _ref.indexCol;
|
|
313400
|
+
var arr = [rowSelection, sortOpen, indexCol].filter(function (item) {
|
|
313401
|
+
return !!item;
|
|
313402
|
+
});
|
|
313403
|
+
return arr.length;
|
|
313404
|
+
}
|
|
313405
|
+
function checkDataSourceIsEmpty(config, dataSource) {
|
|
313406
|
+
if (dataSource.length) {
|
|
313407
|
+
return config;
|
|
313408
|
+
}
|
|
313409
|
+
|
|
313410
|
+
return _objectSpread(_objectSpread({}, config), {}, {
|
|
313411
|
+
components: _objectSpread(_objectSpread({}, config.components), {}, {
|
|
313412
|
+
body: {}
|
|
313413
|
+
})
|
|
313414
|
+
});
|
|
313415
|
+
}
|
|
313416
|
+
|
|
313417
|
+
var DndContainer$3 = function DndContainer(_ref) {
|
|
313418
|
+
var children = _ref.children,
|
|
313419
|
+
options = _ref.options,
|
|
313420
|
+
move = _ref.move,
|
|
313421
|
+
rowKey = _ref.rowKey,
|
|
313422
|
+
items = _ref.items,
|
|
313423
|
+
tableWidth = _ref.tableWidth;
|
|
313424
|
+
|
|
313425
|
+
var _React$useState = React__default['default'].useState(false),
|
|
313426
|
+
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
313427
|
+
isDragging = _React$useState2[0],
|
|
313428
|
+
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
313429
|
+
|
|
313430
|
+
|
|
313431
|
+
var _React$useState3 = React__default['default'].useState(null),
|
|
313432
|
+
_React$useState4 = _slicedToArray$1(_React$useState3, 2),
|
|
313433
|
+
activeId = _React$useState4[0],
|
|
313434
|
+
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
313435
|
+
|
|
313436
|
+
|
|
313437
|
+
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
313438
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
313439
|
+
})); // 开始拖拽
|
|
313440
|
+
|
|
313441
|
+
var handleDragStart = function handleDragStart(_ref2) {
|
|
313442
|
+
var active = _ref2.active;
|
|
313443
|
+
setIsDragging(true);
|
|
313444
|
+
|
|
313445
|
+
if (!active) {
|
|
313446
|
+
return;
|
|
313447
|
+
}
|
|
313448
|
+
|
|
313449
|
+
setActiveId(active.id);
|
|
313450
|
+
}; // 拖拽结束
|
|
313451
|
+
|
|
313452
|
+
|
|
313453
|
+
var handleDragEnd = function handleDragEnd(event) {
|
|
313454
|
+
var active = event.active,
|
|
313455
|
+
over = event.over;
|
|
313456
|
+
setActiveId(null); // 未移入时触发
|
|
313457
|
+
|
|
313458
|
+
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
313459
|
+
return;
|
|
313460
|
+
} // 移入时触发更新数据
|
|
313461
|
+
|
|
313462
|
+
|
|
313463
|
+
if (active.id !== over.id) {
|
|
313464
|
+
move(active.id, over.id);
|
|
313465
|
+
}
|
|
313466
|
+
};
|
|
312837
313467
|
|
|
312838
|
-
|
|
313468
|
+
var instance = {
|
|
313469
|
+
isDragging: isDragging,
|
|
313470
|
+
activeId: activeId,
|
|
313471
|
+
options: options,
|
|
313472
|
+
rowKey: rowKey,
|
|
313473
|
+
children: children,
|
|
313474
|
+
move: move,
|
|
313475
|
+
items: items,
|
|
313476
|
+
tableWidth: tableWidth
|
|
313477
|
+
};
|
|
313478
|
+
console.log('instance', instance);
|
|
313479
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContext, {
|
|
313480
|
+
sensors: sensors,
|
|
313481
|
+
onDragStart: handleDragStart,
|
|
313482
|
+
onDragCancel: function onDragCancel() {
|
|
313483
|
+
return setActiveId(null);
|
|
313484
|
+
},
|
|
313485
|
+
collisionDetection: closestCenter,
|
|
313486
|
+
onDragEnd: handleDragEnd,
|
|
313487
|
+
modifiers: [restrictToParentElement, restrictToVerticalAxis]
|
|
313488
|
+
}, children);
|
|
313489
|
+
};
|
|
313490
|
+
|
|
313491
|
+
var DndContainer$4 = /*#__PURE__*/React.memo(DndContainer$3);
|
|
313492
|
+
|
|
313493
|
+
var SortableBox$2 = function SortableBox(_ref) {
|
|
313494
|
+
var items = _ref.items,
|
|
313495
|
+
children = _ref.children;
|
|
313496
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
|
|
313497
|
+
items: items,
|
|
313498
|
+
strategy: verticalListSortingStrategy
|
|
313499
|
+
}, children);
|
|
313500
|
+
};
|
|
313501
|
+
|
|
313502
|
+
var _excluded$2T = ["keys", "onSortEnd", "virtual", "rowKey", "options", "tableWidth"];
|
|
313503
|
+
|
|
313504
|
+
var DraggableContainer = function DraggableContainer(_ref) {
|
|
313505
|
+
var keys = _ref.keys,
|
|
313506
|
+
onSortEnd = _ref.onSortEnd,
|
|
313507
|
+
virtual = _ref.virtual,
|
|
313508
|
+
rowKey = _ref.rowKey,
|
|
313509
|
+
options = _ref.options,
|
|
313510
|
+
tableWidth = _ref.tableWidth,
|
|
313511
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2T);
|
|
313512
|
+
|
|
313513
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$4, {
|
|
313514
|
+
move: onSortEnd,
|
|
313515
|
+
items: keys,
|
|
313516
|
+
rowKey: rowKey,
|
|
313517
|
+
options: options,
|
|
313518
|
+
tableWidth: tableWidth
|
|
313519
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$2, {
|
|
313520
|
+
items: keys
|
|
313521
|
+
}, virtual ? /*#__PURE__*/React__default['default'].createElement(VirtualWrapper$1, _objectSpread({}, props)) : /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, props))));
|
|
313522
|
+
};
|
|
313523
|
+
|
|
313524
|
+
var BottomOpetateComponent = function BottomOpetateComponent(props) {
|
|
313525
|
+
var isShowAddAction = props.isShowAddAction,
|
|
313526
|
+
recordCreatorProps = props.recordCreatorProps,
|
|
313527
|
+
handleAdd = props.handleAdd,
|
|
313528
|
+
_props$disabled = props.disabled,
|
|
313529
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
313530
|
+
return isShowAddAction ? /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313531
|
+
className: "lm_editTable_add_bar",
|
|
313532
|
+
type: "dashed",
|
|
313533
|
+
disabled: disabled,
|
|
313534
|
+
onClick: (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.customAddClick) || handleAdd,
|
|
313535
|
+
style: _objectSpread({
|
|
313536
|
+
marginTop: 8
|
|
313537
|
+
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
313538
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313539
|
+
type: "lmweb-plus"
|
|
313540
|
+
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增') : null;
|
|
313541
|
+
};
|
|
313542
|
+
|
|
313543
|
+
var getRenderPropValue$1 = function getRenderPropValue(propValue) {
|
|
313544
|
+
if (!propValue) {
|
|
313545
|
+
return null;
|
|
313546
|
+
}
|
|
313547
|
+
|
|
313548
|
+
var isRenderFunction = typeof propValue === 'function';
|
|
313549
|
+
|
|
313550
|
+
if (isRenderFunction) {
|
|
313551
|
+
return propValue();
|
|
313552
|
+
}
|
|
313553
|
+
|
|
313554
|
+
return propValue;
|
|
313555
|
+
};
|
|
313556
|
+
|
|
313557
|
+
var _excluded$2U = ["prefixCls", "title", "content", "_overlay"];
|
|
313558
|
+
var Popover$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
313559
|
+
var customizePrefixCls = _ref.prefixCls,
|
|
313560
|
+
title = _ref.title,
|
|
313561
|
+
content = _ref.content,
|
|
313562
|
+
_overlay = _ref._overlay,
|
|
313563
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$2U);
|
|
313564
|
+
|
|
313565
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
313566
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
313567
|
+
|
|
313568
|
+
var getOverlay = function getOverlay(prefixCls) {
|
|
313569
|
+
if (!title && !content) return undefined;
|
|
313570
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement("div", {
|
|
313571
|
+
className: "".concat(prefixCls, "-title")
|
|
313572
|
+
}, getRenderPropValue$1(title)), /*#__PURE__*/React.createElement("div", {
|
|
313573
|
+
className: "".concat(prefixCls, "-inner-content")
|
|
313574
|
+
}, getRenderPropValue$1(content)));
|
|
313575
|
+
};
|
|
313576
|
+
|
|
313577
|
+
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
313578
|
+
var rootPrefixCls = getPrefixCls();
|
|
313579
|
+
return /*#__PURE__*/React.createElement(Tooltip$4, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
313580
|
+
prefixCls: prefixCls,
|
|
313581
|
+
ref: ref,
|
|
313582
|
+
overlay: _overlay || getOverlay(prefixCls),
|
|
313583
|
+
transitionName: getTransitionName$9(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
313584
|
+
}));
|
|
313585
|
+
});
|
|
313586
|
+
|
|
313587
|
+
{
|
|
313588
|
+
Popover$1.displayName = 'Popover';
|
|
313589
|
+
}
|
|
313590
|
+
|
|
313591
|
+
Popover$1.defaultProps = {
|
|
313592
|
+
placement: 'top',
|
|
313593
|
+
trigger: 'hover',
|
|
313594
|
+
mouseEnterDelay: 0.1,
|
|
313595
|
+
mouseLeaveDelay: 0.1,
|
|
313596
|
+
overlayStyle: {}
|
|
313597
|
+
};
|
|
313598
|
+
Popover$1.AntdPopover = Popover;
|
|
313599
|
+
|
|
313600
|
+
var QuickOpetate = function QuickOpetate(_ref) {
|
|
313601
|
+
var record = _ref.record,
|
|
313602
|
+
rowKey = _ref.rowKey,
|
|
313603
|
+
handleAdd = _ref.handleAdd,
|
|
313604
|
+
handleDelete = _ref.handleDelete,
|
|
313605
|
+
_ref$options = _ref.options,
|
|
313606
|
+
options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
|
|
313607
|
+
getLength = _ref.getLength,
|
|
313608
|
+
quickOpetateClearAll = _ref.quickOpetateClearAll;
|
|
313609
|
+
var disabled = React__default['default'].useContext(DisabledContext$1) || false;
|
|
313610
|
+
|
|
313611
|
+
var appendChildren = function appendChildren() {
|
|
313612
|
+
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
313613
|
+
};
|
|
313614
|
+
|
|
313615
|
+
var appendAdd = function appendAdd() {
|
|
313616
|
+
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
313617
|
+
};
|
|
313618
|
+
|
|
313619
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313620
|
+
style: {
|
|
313621
|
+
display: 'flex',
|
|
313622
|
+
alignItems: 'center',
|
|
313623
|
+
justifyContent: 'flex-start',
|
|
313624
|
+
marginLeft: '-4px'
|
|
313625
|
+
}
|
|
313626
|
+
}, options.includes('delete') && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313627
|
+
type: "link",
|
|
313628
|
+
size: "small",
|
|
313629
|
+
disabled: !quickOpetateClearAll && getLength < 2 || disabled,
|
|
313630
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313631
|
+
type: "lmweb-minus-circle",
|
|
313632
|
+
style: {
|
|
313633
|
+
fontSize: 16
|
|
313634
|
+
}
|
|
313635
|
+
}),
|
|
313636
|
+
onClick: function onClick() {
|
|
313637
|
+
return handleDelete(record[rowKey]);
|
|
313638
|
+
}
|
|
313639
|
+
}), (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, {
|
|
313640
|
+
placement: "bottom",
|
|
313641
|
+
overlayClassName: "lm_table_append_add_popover",
|
|
313642
|
+
open: open,
|
|
313643
|
+
title: null,
|
|
313644
|
+
content: /*#__PURE__*/React__default['default'].createElement("ul", null, /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313645
|
+
onClick: appendAdd
|
|
313646
|
+
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313647
|
+
onClick: appendChildren
|
|
313648
|
+
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
313649
|
+
trigger: "hover"
|
|
313650
|
+
}, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313651
|
+
type: "link",
|
|
313652
|
+
size: "small",
|
|
313653
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313654
|
+
type: "lmweb-plus-circle-fill",
|
|
313655
|
+
style: {
|
|
313656
|
+
fontSize: 16
|
|
313657
|
+
}
|
|
313658
|
+
})
|
|
313659
|
+
})) : (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, {
|
|
313660
|
+
type: "link",
|
|
313661
|
+
size: "small",
|
|
313662
|
+
disabled: disabled,
|
|
313663
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313664
|
+
type: "lmweb-plus-circle-fill",
|
|
313665
|
+
style: {
|
|
313666
|
+
fontSize: 16
|
|
313667
|
+
}
|
|
313668
|
+
}),
|
|
313669
|
+
onClick: function onClick() {
|
|
313670
|
+
return handleAdd(record, !!(options === null || options === void 0 ? void 0 : options.includes('addInChildren')));
|
|
313671
|
+
}
|
|
313672
|
+
}) : null);
|
|
313673
|
+
};
|
|
313674
|
+
|
|
313675
|
+
var ConfigContext$7 = ConfigProvider$1.ConfigContext;
|
|
313676
|
+
|
|
313677
|
+
var CustomizeRenderEmpty$1 = function CustomizeRenderEmpty() {
|
|
313678
|
+
var _React$useContext = React__default['default'].useContext(ConfigContext$7),
|
|
313679
|
+
locale = _React$useContext.locale;
|
|
313680
|
+
|
|
313681
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313682
|
+
className: "lm_table_empty"
|
|
313683
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313684
|
+
className: "empty_img",
|
|
313685
|
+
style: {
|
|
313686
|
+
width: '130px',
|
|
313687
|
+
height: '80px'
|
|
313688
|
+
}
|
|
313689
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", null, (locale === null || locale === void 0 ? void 0 : locale.locale) === 'en' ? 'no Data' : '暂无数据'));
|
|
313690
|
+
};
|
|
313691
|
+
|
|
313692
|
+
var _excluded$2V = ["index", "virtual"],
|
|
312839
313693
|
_excluded2$I = ["index"],
|
|
312840
313694
|
_excluded3$b = ["value", "onChange", "record", "rowIndex", "colIndex", "validator"],
|
|
312841
|
-
_excluded4$2 = ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps"
|
|
313695
|
+
_excluded4$2 = ["record", "rowKey", "isEdit", "col", "rowIndex", "colIndex", "handleTableRowDelete", "handleTableRowAdd", "quickOpetateClearAll", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps"],
|
|
312842
313696
|
_excluded5 = ["onMouseEnter", "onMouseLeave"],
|
|
312843
|
-
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"];
|
|
313697
|
+
_excluded6 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "virtual", "sortOpen", "disabled", "colSortOpen", "indexCol", "filterChange", "size", "recordCreatorProps", "shouldUpdate", "loading"];
|
|
312844
313698
|
var UploadBtn$1 = UploadOss.UploadBtn;
|
|
312845
313699
|
var EditableContext$1 = /*#__PURE__*/React__default['default'].createContext(null); // 表格行
|
|
312846
313700
|
|
|
312847
313701
|
var EditableRow$1 = function EditableRow(_ref) {
|
|
312848
313702
|
var index = _ref.index,
|
|
312849
|
-
|
|
313703
|
+
virtual = _ref.virtual,
|
|
313704
|
+
props = _objectWithoutProperties$1(_ref, _excluded$2V);
|
|
312850
313705
|
|
|
312851
313706
|
var _Form$useForm = Form$4.useForm(),
|
|
312852
313707
|
_Form$useForm2 = _slicedToArray$1(_Form$useForm, 1),
|
|
@@ -312857,7 +313712,7 @@
|
|
|
312857
313712
|
component: false
|
|
312858
313713
|
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
312859
313714
|
value: form
|
|
312860
|
-
}, /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
313715
|
+
}, virtual ? /*#__PURE__*/React__default['default'].createElement(VirtualRow$1, _objectSpread({}, props)) : /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread({}, props))));
|
|
312861
313716
|
};
|
|
312862
313717
|
|
|
312863
313718
|
var EditableSortRow = function EditableSortRow(_ref2) {
|
|
@@ -312870,10 +313725,11 @@
|
|
|
312870
313725
|
|
|
312871
313726
|
return /*#__PURE__*/React__default['default'].createElement(Form$4, {
|
|
312872
313727
|
form: form,
|
|
313728
|
+
disabled: props.disabled || false,
|
|
312873
313729
|
component: false
|
|
312874
313730
|
}, /*#__PURE__*/React__default['default'].createElement(EditableContext$1.Provider, {
|
|
312875
313731
|
value: form
|
|
312876
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
313732
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableItem$2, _objectSpread({}, props))));
|
|
312877
313733
|
};
|
|
312878
313734
|
|
|
312879
313735
|
var UploadSingle$1 = function UploadSingle(props) {
|
|
@@ -313000,88 +313856,7 @@
|
|
|
313000
313856
|
return handleInput(e, 'next');
|
|
313001
313857
|
}
|
|
313002
313858
|
}, editEnum))));
|
|
313003
|
-
};
|
|
313004
|
-
|
|
313005
|
-
|
|
313006
|
-
var Opetate$1 = function Opetate(_ref4) {
|
|
313007
|
-
var record = _ref4.record,
|
|
313008
|
-
rowKey = _ref4.rowKey,
|
|
313009
|
-
handleAdd = _ref4.handleAdd,
|
|
313010
|
-
handleDelete = _ref4.handleDelete,
|
|
313011
|
-
_ref4$options = _ref4.options,
|
|
313012
|
-
options = _ref4$options === void 0 ? ['add', 'delete'] : _ref4$options,
|
|
313013
|
-
getLength = _ref4.getLength,
|
|
313014
|
-
quickOpetateClearAll = _ref4.quickOpetateClearAll;
|
|
313015
|
-
|
|
313016
|
-
var appendChildren = function appendChildren() {
|
|
313017
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
|
|
313018
|
-
};
|
|
313019
|
-
|
|
313020
|
-
var appendAdd = function appendAdd() {
|
|
313021
|
-
handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
|
|
313022
|
-
};
|
|
313023
|
-
|
|
313024
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
313025
|
-
style: {
|
|
313026
|
-
display: 'flex',
|
|
313027
|
-
alignItems: 'center',
|
|
313028
|
-
justifyContent: 'flex-start',
|
|
313029
|
-
marginLeft: '-4px'
|
|
313030
|
-
}
|
|
313031
|
-
}, options.includes('delete') && /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313032
|
-
type: "link",
|
|
313033
|
-
size: "small",
|
|
313034
|
-
disabled: !quickOpetateClearAll && getLength < 2,
|
|
313035
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313036
|
-
type: "lmweb-minus-circle",
|
|
313037
|
-
style: {
|
|
313038
|
-
fontSize: 16
|
|
313039
|
-
}
|
|
313040
|
-
}),
|
|
313041
|
-
onClick: function onClick() {
|
|
313042
|
-
return handleDelete(record[rowKey]);
|
|
313043
|
-
}
|
|
313044
|
-
}), (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, {
|
|
313045
|
-
placement: "bottom",
|
|
313046
|
-
overlayClassName: 'lm_table_append_add_popover',
|
|
313047
|
-
open: open,
|
|
313048
|
-
title: null,
|
|
313049
|
-
content: /*#__PURE__*/React__default['default'].createElement("ul", null, /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313050
|
-
onClick: appendAdd
|
|
313051
|
-
}, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/React__default['default'].createElement("li", {
|
|
313052
|
-
onClick: appendChildren
|
|
313053
|
-
}, "\u6DFB\u52A0\u5B50\u7EA7")),
|
|
313054
|
-
trigger: "hover"
|
|
313055
|
-
}, /*#__PURE__*/React__default['default'].createElement(LMButton, {
|
|
313056
|
-
type: "link",
|
|
313057
|
-
size: "small",
|
|
313058
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313059
|
-
type: "lmweb-plus-circle-fill",
|
|
313060
|
-
style: {
|
|
313061
|
-
fontSize: 16
|
|
313062
|
-
}
|
|
313063
|
-
})
|
|
313064
|
-
})) : (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, {
|
|
313065
|
-
type: "link",
|
|
313066
|
-
size: "small",
|
|
313067
|
-
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313068
|
-
type: "lmweb-plus-circle-fill",
|
|
313069
|
-
style: {
|
|
313070
|
-
fontSize: 16
|
|
313071
|
-
}
|
|
313072
|
-
}),
|
|
313073
|
-
onClick: function onClick() {
|
|
313074
|
-
return handleAdd(record, (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? true : false);
|
|
313075
|
-
}
|
|
313076
|
-
}) : null);
|
|
313077
|
-
}; // const isValidValue = (verifyValue) => {
|
|
313078
|
-
// const toStringValue = JSON.stringify(verifyValue);
|
|
313079
|
-
// if (verifyValue === undefined || verifyValue === null || verifyValue === '' || toStringValue === '[]' || toStringValue === '{}') {
|
|
313080
|
-
// return false;
|
|
313081
|
-
// }
|
|
313082
|
-
// return true;
|
|
313083
|
-
// }
|
|
313084
|
-
|
|
313859
|
+
};
|
|
313085
313860
|
/*
|
|
313086
313861
|
表格单元格
|
|
313087
313862
|
editEnum: 下拉框时的数据数组(非数组时是配置设置)
|
|
@@ -313111,8 +313886,6 @@
|
|
|
313111
313886
|
handleDelete = props.handleDelete,
|
|
313112
313887
|
handleCopy = props.handleCopy,
|
|
313113
313888
|
itemProps = props.itemProps,
|
|
313114
|
-
setValid = props.setValid,
|
|
313115
|
-
reWriteOriginSource = props.reWriteOriginSource,
|
|
313116
313889
|
restProps = _objectWithoutProperties$1(props, _excluded4$2);
|
|
313117
313890
|
/** 去除移入移出功能,保留最纯粹的功能,优化性能 */
|
|
313118
313891
|
|
|
@@ -313133,6 +313906,12 @@
|
|
|
313133
313906
|
|
|
313134
313907
|
var inputRef = React.useRef(null);
|
|
313135
313908
|
var form = React.useContext(EditableContext$1);
|
|
313909
|
+
|
|
313910
|
+
var _useState5 = React.useState(false),
|
|
313911
|
+
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
313912
|
+
hoverStatus = _useState6[0],
|
|
313913
|
+
setHoverStatus = _useState6[1];
|
|
313914
|
+
|
|
313136
313915
|
React.useEffect(function () {
|
|
313137
313916
|
if (editing) {
|
|
313138
313917
|
var _inputRef$current;
|
|
@@ -313143,17 +313922,11 @@
|
|
|
313143
313922
|
|
|
313144
313923
|
var toggleEdit = function toggleEdit() {
|
|
313145
313924
|
setEditing(!editing); // form.setFieldsValue({ [dataIndex]: record[dataIndex] });
|
|
313146
|
-
}; //
|
|
313147
|
-
// const focusCapturedRef = useRef(false);
|
|
313148
|
-
// const curValue = useMemo(() => {
|
|
313149
|
-
// return record?.dataIndex
|
|
313150
|
-
// }, [record])
|
|
313151
|
-
// const curValueIsValid = isValidValue(curValue);
|
|
313152
|
-
// 校验保存
|
|
313925
|
+
}; // 校验保存
|
|
313153
313926
|
|
|
313154
313927
|
|
|
313155
313928
|
var save = /*#__PURE__*/function () {
|
|
313156
|
-
var
|
|
313929
|
+
var _ref4 = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee(row) {
|
|
313157
313930
|
var values, resultComponentProps;
|
|
313158
313931
|
return _regeneratorRuntime$1().wrap(function _callee$(_context) {
|
|
313159
313932
|
while (1) {
|
|
@@ -313201,13 +313974,7 @@
|
|
|
313201
313974
|
case 13:
|
|
313202
313975
|
if (col === null || col === void 0 ? void 0 : col.hoverEdit) {
|
|
313203
313976
|
toggleEdit();
|
|
313204
|
-
}
|
|
313205
|
-
// setValid((old) => {
|
|
313206
|
-
// const obj = { ...old }
|
|
313207
|
-
// delete obj[record[rowKey]]
|
|
313208
|
-
// return obj
|
|
313209
|
-
// })
|
|
313210
|
-
|
|
313977
|
+
}
|
|
313211
313978
|
|
|
313212
313979
|
_context.next = 18;
|
|
313213
313980
|
break;
|
|
@@ -313225,7 +313992,7 @@
|
|
|
313225
313992
|
}));
|
|
313226
313993
|
|
|
313227
313994
|
return function save(_x) {
|
|
313228
|
-
return
|
|
313995
|
+
return _ref4.apply(this, arguments);
|
|
313229
313996
|
};
|
|
313230
313997
|
}(); // 触发保存
|
|
313231
313998
|
|
|
@@ -313236,16 +314003,15 @@
|
|
|
313236
314003
|
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
313237
314004
|
|
|
313238
314005
|
|
|
313239
|
-
var copyKey = function copyKey(e) {
|
|
314006
|
+
var copyKey = function copyKey(e, type) {
|
|
313240
314007
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
313241
314008
|
var dataIndex = col.dataIndex;
|
|
313242
|
-
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]);
|
|
314009
|
+
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex], type, props.rowIndex);
|
|
313243
314010
|
};
|
|
313244
314011
|
|
|
313245
314012
|
var Control = function Control(con) {
|
|
313246
314013
|
var _col$newOptions;
|
|
313247
314014
|
|
|
313248
|
-
// const resultComponentProps = isFunction(componentProps) ? componentProps?.(record, col) : componentProps
|
|
313249
314015
|
var resultComponentProps = lodash.isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
313250
314016
|
|
|
313251
314017
|
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)) {
|
|
@@ -313254,7 +314020,7 @@
|
|
|
313254
314020
|
});
|
|
313255
314021
|
}
|
|
313256
314022
|
|
|
313257
|
-
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue']);
|
|
314023
|
+
var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue', 'quickcopy']);
|
|
313258
314024
|
|
|
313259
314025
|
switch (con) {
|
|
313260
314026
|
case 'input':
|
|
@@ -313275,19 +314041,12 @@
|
|
|
313275
314041
|
noStyle: true
|
|
313276
314042
|
}, /*#__PURE__*/React__default['default'].cloneElement(resultComponentProps.addonAfter, {
|
|
313277
314043
|
onChange: handleFormItemChange
|
|
313278
|
-
})) : null,
|
|
313279
|
-
suffix: resultComponentProps.quickcopy ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
313280
|
-
className: 'lm_table_quickcopy'
|
|
313281
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
313282
|
-
onClick: copyKey,
|
|
313283
|
-
type: 'lmweb-icon_m_brush'
|
|
313284
314044
|
})) : null
|
|
313285
314045
|
}));
|
|
313286
314046
|
|
|
313287
314047
|
case 'inputRange':
|
|
313288
314048
|
return /*#__PURE__*/React__default['default'].createElement(InputRange$1, _objectSpread(_objectSpread({
|
|
313289
|
-
onChange: handleFormItemChange
|
|
313290
|
-
ref: inputRef
|
|
314049
|
+
onChange: handleFormItemChange
|
|
313291
314050
|
}, resultComponentProps), {}, {
|
|
313292
314051
|
record: record,
|
|
313293
314052
|
rowIndex: rowIndex,
|
|
@@ -313363,7 +314122,7 @@
|
|
|
313363
314122
|
|
|
313364
314123
|
case 'switch':
|
|
313365
314124
|
return /*#__PURE__*/React__default['default'].createElement(Switch$2, _objectSpread(_objectSpread({
|
|
313366
|
-
size:
|
|
314125
|
+
size: "small"
|
|
313367
314126
|
}, clearAttrComponentProps), {}, {
|
|
313368
314127
|
onChange: handleFormItemChange
|
|
313369
314128
|
}));
|
|
@@ -313377,10 +314136,9 @@
|
|
|
313377
314136
|
|
|
313378
314137
|
case 'operate':
|
|
313379
314138
|
case 'lm_edit_opetate':
|
|
313380
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
314139
|
+
return /*#__PURE__*/React__default['default'].createElement(QuickOpetate, _objectSpread({
|
|
313381
314140
|
record: record,
|
|
313382
314141
|
rowKey: rowKey,
|
|
313383
|
-
ref: inputRef,
|
|
313384
314142
|
handleAdd: handleTableRowAdd,
|
|
313385
314143
|
handleDelete: handleTableRowDelete,
|
|
313386
314144
|
getLength: getLength,
|
|
@@ -313394,7 +314152,7 @@
|
|
|
313394
314152
|
var fromData = form.getFieldsValue();
|
|
313395
314153
|
return render === null || render === void 0 ? void 0 : render(_objectSpread(_objectSpread({}, !isObjEmpty(fromData) ? _objectSpread(_objectSpread({}, record), {}, _defineProperty$1({}, dataIndex, fromData[dataIndex])) : record), {}, {
|
|
313396
314154
|
onChange: save
|
|
313397
|
-
}));
|
|
314155
|
+
}), rowIndex);
|
|
313398
314156
|
}
|
|
313399
314157
|
|
|
313400
314158
|
default:
|
|
@@ -313429,7 +314187,8 @@
|
|
|
313429
314187
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
313430
314188
|
style: {
|
|
313431
314189
|
margin: 0
|
|
313432
|
-
}
|
|
314190
|
+
},
|
|
314191
|
+
noStyle: formProps ? false : true
|
|
313433
314192
|
}, formProps), {}, {
|
|
313434
314193
|
name: dataIndex
|
|
313435
314194
|
}), Control(editable)));
|
|
@@ -313441,6 +314200,7 @@
|
|
|
313441
314200
|
margin: 0
|
|
313442
314201
|
}
|
|
313443
314202
|
}, formProps), {}, {
|
|
314203
|
+
noStyle: formProps ? false : true,
|
|
313444
314204
|
name: [dataIndex, 'value']
|
|
313445
314205
|
}), Control(editable)));
|
|
313446
314206
|
}
|
|
@@ -313453,31 +314213,68 @@
|
|
|
313453
314213
|
}
|
|
313454
314214
|
|
|
313455
314215
|
return childNode;
|
|
313456
|
-
}, [col, isEdit, editing, getLength]); //
|
|
313457
|
-
// 出现死循环找我
|
|
314216
|
+
}, [col, isEdit, editing, getLength, record]); // 出现死循环找我
|
|
313458
314217
|
|
|
313459
314218
|
React.useEffect(function () {
|
|
313460
314219
|
var editable = col.editable,
|
|
313461
314220
|
dataIndex = col.dataIndex;
|
|
313462
314221
|
|
|
313463
314222
|
if (isEdit && editable) {
|
|
313464
|
-
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date' ? hooks(record[dataIndex]) : record[dataIndex]));
|
|
313465
|
-
}
|
|
313466
|
-
// (isEdit && editable && record[dataIndex]) ||
|
|
313467
|
-
// (isHoverEdit && editable && record[dataIndex])
|
|
313468
|
-
// ) {
|
|
313469
|
-
// form.setFieldsValue({
|
|
313470
|
-
// [dataIndex]: editable === 'date' ? moment(record[dataIndex]) : record[dataIndex],
|
|
313471
|
-
// })
|
|
313472
|
-
// }
|
|
313473
|
-
|
|
314223
|
+
form.setFieldsValue(_defineProperty$1({}, dataIndex, editable === 'date' && record[dataIndex] ? hooks(record[dataIndex]) : record[dataIndex]));
|
|
314224
|
+
}
|
|
313474
314225
|
}, [record]);
|
|
314226
|
+
|
|
314227
|
+
var handleTdHover = function handleTdHover() {
|
|
314228
|
+
setHoverStatus(true);
|
|
314229
|
+
};
|
|
314230
|
+
|
|
314231
|
+
var handleTdMouseOut = function handleTdMouseOut() {
|
|
314232
|
+
setHoverStatus(false);
|
|
314233
|
+
};
|
|
314234
|
+
|
|
313475
314235
|
return /*#__PURE__*/React__default['default'].createElement("td", _objectSpread(_objectSpread({}, lodash.omit(clearProps, ['dataIndex'])), {}, {
|
|
313476
314236
|
className: classnames(clearProps === null || clearProps === void 0 ? void 0 : clearProps.className, 'lm_custom_cell_td'),
|
|
314237
|
+
onMouseEnter: componentProps.quickcopy ? handleTdHover : undefined,
|
|
314238
|
+
onMouseLeave: componentProps.quickcopy ? handleTdMouseOut : undefined,
|
|
313477
314239
|
key: "r".concat(rowIndex, "_c").concat(colIndex)
|
|
313478
|
-
}),
|
|
314240
|
+
}), hoverStatus && props.rowIndex > 0 && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
314241
|
+
className: 'quick_copy_warp quick_copy_up',
|
|
314242
|
+
onClick: function onClick(e) {
|
|
314243
|
+
return copyKey(e, 'up');
|
|
314244
|
+
}
|
|
314245
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314246
|
+
type: 'lmweb-icon_up'
|
|
314247
|
+
})), getMemoChildNode, hoverStatus && props.rowIndex < props.getLength - 1 && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
314248
|
+
className: 'quick_copy_warp quick_copy_down',
|
|
314249
|
+
onClick: function onClick(e) {
|
|
314250
|
+
return copyKey(e, 'down');
|
|
314251
|
+
}
|
|
314252
|
+
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314253
|
+
type: 'lmweb-icon_down'
|
|
314254
|
+
})));
|
|
313479
314255
|
};
|
|
314256
|
+
/** true 不刷新, false 刷新 */
|
|
314257
|
+
|
|
314258
|
+
|
|
314259
|
+
var MemoEditableCell = /*#__PURE__*/React.memo(EditableCell$1, function (prev, next) {
|
|
314260
|
+
var pickProps = ['record', 'colIndex'];
|
|
314261
|
+
var p = lodash.pick(prev, pickProps);
|
|
314262
|
+
var n = lodash.pick(next, pickProps);
|
|
314263
|
+
|
|
314264
|
+
if (next === null || next === void 0 ? void 0 : next.shouldUpdate) {
|
|
314265
|
+
return false;
|
|
314266
|
+
} // console.log(!checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n), '22', prev.record, next.record)
|
|
314267
|
+
// console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
|
|
313480
314268
|
|
|
314269
|
+
/** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
|
|
314270
|
+
|
|
314271
|
+
|
|
314272
|
+
if (!checkMemoShouldUploadSpecialFun(prev, next)) {
|
|
314273
|
+
return false;
|
|
314274
|
+
}
|
|
314275
|
+
|
|
314276
|
+
return lodash.isEqual(p, n);
|
|
314277
|
+
});
|
|
313481
314278
|
var EditTable$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
313482
314279
|
var _localRowSelectList$s2;
|
|
313483
314280
|
|
|
@@ -313496,16 +314293,21 @@
|
|
|
313496
314293
|
_props$quickOpetateCl = props.quickOpetateClearAll,
|
|
313497
314294
|
quickOpetateClearAll = _props$quickOpetateCl === void 0 ? true : _props$quickOpetateCl,
|
|
313498
314295
|
rowSelection = props.rowSelection,
|
|
314296
|
+
virtual = props.virtual,
|
|
313499
314297
|
sortOpen = props.sortOpen,
|
|
314298
|
+
disabled = props.disabled,
|
|
313500
314299
|
colSortOpen = props.colSortOpen,
|
|
314300
|
+
_props$indexCol = props.indexCol,
|
|
314301
|
+
indexCol = _props$indexCol === void 0 ? false : _props$indexCol,
|
|
313501
314302
|
filterChange = props.filterChange,
|
|
313502
314303
|
_props$size = props.size,
|
|
313503
314304
|
size = _props$size === void 0 ? 'small' : _props$size,
|
|
313504
314305
|
recordCreatorProps = props.recordCreatorProps,
|
|
313505
314306
|
_props$shouldUpdate = props.shouldUpdate,
|
|
313506
314307
|
shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
|
|
313507
|
-
|
|
313508
|
-
|
|
314308
|
+
_props$loading = props.loading,
|
|
314309
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
314310
|
+
resetProps = _objectWithoutProperties$1(props, _excluded6);
|
|
313509
314311
|
|
|
313510
314312
|
var _useControllableValue = useControllableValue({
|
|
313511
314313
|
value: checkRowKeyByDataSource(props.value, _rowKey),
|
|
@@ -313513,14 +314315,7 @@
|
|
|
313513
314315
|
}),
|
|
313514
314316
|
_useControllableValue2 = _slicedToArray$1(_useControllableValue, 2),
|
|
313515
314317
|
dataSource = _useControllableValue2[0],
|
|
313516
|
-
setDataSource = _useControllableValue2[1];
|
|
313517
|
-
|
|
313518
|
-
|
|
313519
|
-
var _useState5 = React.useState({}),
|
|
313520
|
-
_useState6 = _slicedToArray$1(_useState5, 2),
|
|
313521
|
-
_valid = _useState6[0],
|
|
313522
|
-
setValid = _useState6[1]; // const [localRowSelectList, setLocalRowSelectList] = useState([])
|
|
313523
|
-
|
|
314318
|
+
setDataSource = _useControllableValue2[1];
|
|
313524
314319
|
|
|
313525
314320
|
var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
|
|
313526
314321
|
var _rowSelection$onChang;
|
|
@@ -313537,43 +314332,28 @@
|
|
|
313537
314332
|
_useControllableValue4 = _slicedToArray$1(_useControllableValue3, 2),
|
|
313538
314333
|
localRowSelectList = _useControllableValue4[0],
|
|
313539
314334
|
setLocalRowSelectList = _useControllableValue4[1];
|
|
314335
|
+
/** TODO: 当前展开的列 */
|
|
314336
|
+
|
|
313540
314337
|
|
|
313541
314338
|
var _useState7 = React.useState([]),
|
|
313542
314339
|
_useState8 = _slicedToArray$1(_useState7, 2),
|
|
313543
|
-
|
|
313544
|
-
|
|
313545
|
-
/** 当前展开的列 */
|
|
313546
|
-
|
|
313547
|
-
|
|
313548
|
-
var _useState9 = React.useState([]),
|
|
313549
|
-
_useState10 = _slicedToArray$1(_useState9, 2),
|
|
313550
|
-
expandedRowKeys = _useState10[0],
|
|
313551
|
-
setExpandedRowKeys = _useState10[1];
|
|
314340
|
+
expandedRowKeys = _useState8[0],
|
|
314341
|
+
setExpandedRowKeys = _useState8[1];
|
|
313552
314342
|
|
|
313553
|
-
var dataSourceRef = React.useRef(
|
|
313554
|
-
var
|
|
313555
|
-
|
|
313556
|
-
|
|
313557
|
-
var
|
|
313558
|
-
var cloneArr = _toConsumableArray$1(dataSourceRef.current);
|
|
313559
|
-
|
|
313560
|
-
var oldIndex = cloneArr.findIndex(function (v) {
|
|
313561
|
-
return v[_rowKey] === active;
|
|
313562
|
-
});
|
|
313563
|
-
var newIndex = cloneArr.findIndex(function (v) {
|
|
313564
|
-
return v[_rowKey] === over;
|
|
313565
|
-
});
|
|
313566
|
-
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
313567
|
-
};
|
|
314343
|
+
var dataSourceRef = React.useRef(dataSource);
|
|
314344
|
+
var deepDataSourceRef = React.useRef(deepDataSourcePreKeys(dataSource, _rowKey));
|
|
314345
|
+
dataSourceRef.current = dataSource;
|
|
314346
|
+
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
314347
|
+
var tableWarpRef = React.useRef(null);
|
|
313568
314348
|
|
|
313569
314349
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
313570
314350
|
var _arrayMove;
|
|
313571
314351
|
|
|
313572
314352
|
var oldIndex = columns.findIndex(function (item) {
|
|
313573
|
-
return item
|
|
314353
|
+
return item.dataIndex === active;
|
|
313574
314354
|
});
|
|
313575
314355
|
var newIndex = columns.findIndex(function (item) {
|
|
313576
|
-
return item
|
|
314356
|
+
return item.dataIndex === over;
|
|
313577
314357
|
});
|
|
313578
314358
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange((_arrayMove = arrayMove(columns, oldIndex, newIndex)) === null || _arrayMove === void 0 ? void 0 : _arrayMove.map(function (item, index) {
|
|
313579
314359
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -313586,55 +314366,21 @@
|
|
|
313586
314366
|
var handleDelete = function handleDelete(key) {
|
|
313587
314367
|
var nValue = dataSource.filter(function (item) {
|
|
313588
314368
|
return item[_rowKey] !== key;
|
|
313589
|
-
});
|
|
313590
|
-
|
|
314369
|
+
});
|
|
313591
314370
|
setDataSource(nValue);
|
|
313592
314371
|
};
|
|
313593
|
-
/**
|
|
314372
|
+
/** 点击底部添加按钮添加 */
|
|
313594
314373
|
|
|
313595
314374
|
|
|
313596
|
-
var handleAdd = function
|
|
314375
|
+
var handleAdd = lodash.debounce(function (row) {
|
|
313597
314376
|
var _recordCreatorProps$i;
|
|
313598
314377
|
|
|
313599
314378
|
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;
|
|
313600
314379
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313601
314380
|
draft.push(_objectSpread(_defineProperty$1({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
313602
314381
|
});
|
|
313603
|
-
setDataSource(res);
|
|
313604
|
-
};
|
|
313605
|
-
|
|
313606
|
-
React.useEffect(function () {
|
|
313607
|
-
dataSourceRef.current = dataSource;
|
|
313608
|
-
deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
|
|
313609
|
-
|
|
313610
|
-
if (sortOpen) {
|
|
313611
|
-
var _sortDataSorceRef$cur;
|
|
313612
|
-
|
|
313613
|
-
var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
313614
|
-
return item[_rowKey];
|
|
313615
|
-
}).join(',');
|
|
313616
|
-
var setCallBackFalgKeys = ((_sortDataSorceRef$cur = sortDataSorceRef.current) === null || _sortDataSorceRef$cur === void 0 ? void 0 : _sortDataSorceRef$cur.map(function (item) {
|
|
313617
|
-
return item[_rowKey];
|
|
313618
|
-
}).join(',')) || '';
|
|
313619
|
-
|
|
313620
|
-
if (dataSourceKeys !== setCallBackFalgKeys) {
|
|
313621
|
-
setCallBackFalg(dataSource);
|
|
313622
|
-
sortDataSorceRef.current = dataSource;
|
|
313623
|
-
}
|
|
313624
|
-
}
|
|
313625
|
-
}, [dataSource]); // /** 本地缓存一个选择数据 */
|
|
313626
|
-
// useEffect(() => {
|
|
313627
|
-
// if (rowSelection) {
|
|
313628
|
-
// const { selectedRowKeys } = rowSelection
|
|
313629
|
-
// if (selectedRowKeys) {
|
|
313630
|
-
// setLocalRowSelectList(localRowSelectList || [])
|
|
313631
|
-
// }
|
|
313632
|
-
// }
|
|
313633
|
-
// }, [rowSelection])
|
|
313634
|
-
// const editTableRowChange = (selectRows) => {
|
|
313635
|
-
// setLocalRowSelectList(selectRows);
|
|
313636
|
-
// // (rowSelection?.onChange as any)?.(selectRows)
|
|
313637
|
-
// }
|
|
314382
|
+
setDataSource(res);
|
|
314383
|
+
}, 40);
|
|
313638
314384
|
|
|
313639
314385
|
var handleSave = function handleSave(row, options) {
|
|
313640
314386
|
var _deepDataSourceRef$cu, _deepDataSourceRef$cu2;
|
|
@@ -313707,25 +314453,26 @@
|
|
|
313707
314453
|
}
|
|
313708
314454
|
});
|
|
313709
314455
|
setDataSource(res);
|
|
313710
|
-
};
|
|
313711
|
-
|
|
313712
|
-
|
|
313713
|
-
|
|
313714
|
-
|
|
313715
|
-
|
|
313716
|
-
|
|
313717
|
-
|
|
314456
|
+
}; // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
314457
|
+
// setDataSource((prevDataSource) => {
|
|
314458
|
+
// return prevDataSource?.map((item) => {
|
|
314459
|
+
// if (get(item, rowKey) === rowValue) {
|
|
314460
|
+
// set(item, dataIndex, nextValue)
|
|
314461
|
+
// }
|
|
314462
|
+
// return item
|
|
314463
|
+
// })
|
|
314464
|
+
// })
|
|
314465
|
+
// }
|
|
314466
|
+
// @ts-ignore
|
|
313718
314467
|
|
|
313719
|
-
|
|
313720
|
-
});
|
|
313721
|
-
});
|
|
313722
|
-
}; // @ts-ignore
|
|
314468
|
+
/** 删除当前行 */
|
|
313723
314469
|
|
|
313724
314470
|
|
|
313725
|
-
var handleTableRowDelete = function
|
|
314471
|
+
var handleTableRowDelete = lodash.debounce(function (key) {
|
|
313726
314472
|
var _deepDataSourceRef$cu3, _deepDataSourceRef$cu4;
|
|
313727
314473
|
|
|
313728
|
-
var
|
|
314474
|
+
var rkey = lodash.isObject(key) ? key[_rowKey] : key;
|
|
314475
|
+
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;
|
|
313729
314476
|
|
|
313730
314477
|
if (preKeys.length > 1) {
|
|
313731
314478
|
/** 说明删除的是children中的数据 */
|
|
@@ -313746,7 +314493,7 @@
|
|
|
313746
314493
|
return newData;
|
|
313747
314494
|
};
|
|
313748
314495
|
|
|
313749
|
-
var res = filter(
|
|
314496
|
+
var res = filter(dataSourceRef.current, key);
|
|
313750
314497
|
setDataSource(res);
|
|
313751
314498
|
} else {
|
|
313752
314499
|
var _dataSourceRef$curren;
|
|
@@ -313767,32 +314514,74 @@
|
|
|
313767
314514
|
|
|
313768
314515
|
setDataSource(_res);
|
|
313769
314516
|
}
|
|
313770
|
-
};
|
|
313771
|
-
/** 快捷添加 */
|
|
313772
314517
|
|
|
314518
|
+
return null;
|
|
314519
|
+
}, 40);
|
|
314520
|
+
/** 替换当前行 */
|
|
313773
314521
|
|
|
313774
|
-
var
|
|
314522
|
+
var handleTableRowReplace = lodash.debounce(function (record, defaultRecord) {
|
|
313775
314523
|
var _deepDataSourceRef$cu5, _deepDataSourceRef$cu6;
|
|
313776
314524
|
|
|
313777
|
-
var
|
|
314525
|
+
var rkey = lodash.isObject(record) ? record[_rowKey] : record;
|
|
314526
|
+
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)
|
|
314527
|
+
|
|
314528
|
+
var deep = function deep(children) {
|
|
314529
|
+
return children.map(function (item) {
|
|
314530
|
+
if (item[_rowKey] === rkey) {
|
|
314531
|
+
return defaultRecord;
|
|
314532
|
+
} else if (preKeys.includes(item[_rowKey]) && item.children) {
|
|
314533
|
+
var child = deep(item.children);
|
|
314534
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
314535
|
+
children: child
|
|
314536
|
+
});
|
|
314537
|
+
} else {
|
|
314538
|
+
return item;
|
|
314539
|
+
}
|
|
314540
|
+
});
|
|
314541
|
+
};
|
|
314542
|
+
|
|
314543
|
+
var res = deep(dataSourceRef.current);
|
|
314544
|
+
setDataSource(res);
|
|
314545
|
+
}, 40);
|
|
314546
|
+
/** 快捷添加 */
|
|
314547
|
+
|
|
314548
|
+
var handleTableRowAdd = lodash.debounce(function (record, isAppendInChindren, defaultRecord) {
|
|
314549
|
+
var _deepDataSourceRef$cu7, _deepDataSourceRef$cu8;
|
|
314550
|
+
|
|
314551
|
+
var rkey = lodash.isObject(record) ? record[_rowKey] : record;
|
|
314552
|
+
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;
|
|
313778
314553
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313779
|
-
if (preKeys.length > 1) {
|
|
314554
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
313780
314555
|
var deeps = function deeps(children) {
|
|
313781
314556
|
children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
|
|
313782
314557
|
if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
|
|
313783
|
-
if (item[_rowKey] ===
|
|
314558
|
+
if (item[_rowKey] === rkey) {
|
|
313784
314559
|
if (isAppendInChindren) {
|
|
313785
314560
|
if (item === null || item === void 0 ? void 0 : item.children) {
|
|
313786
|
-
|
|
314561
|
+
if (Array.isArray(defaultRecord)) {
|
|
314562
|
+
var _item$children;
|
|
314563
|
+
|
|
314564
|
+
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));
|
|
314565
|
+
} else {
|
|
314566
|
+
var _item$children2;
|
|
313787
314567
|
|
|
313788
|
-
|
|
314568
|
+
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())));
|
|
314569
|
+
}
|
|
313789
314570
|
} else {
|
|
313790
|
-
|
|
314571
|
+
if (Array.isArray(defaultRecord)) {
|
|
314572
|
+
item.children = _toConsumableArray$1(defaultRecord);
|
|
314573
|
+
} else {
|
|
314574
|
+
item.children = [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314575
|
+
}
|
|
313791
314576
|
}
|
|
313792
314577
|
|
|
313793
314578
|
!expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [item[_rowKey]]));
|
|
313794
314579
|
} else {
|
|
313795
|
-
|
|
314580
|
+
if (Array.isArray(defaultRecord)) {
|
|
314581
|
+
children.splice.apply(children, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
|
|
314582
|
+
} else {
|
|
314583
|
+
children.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314584
|
+
}
|
|
313796
314585
|
}
|
|
313797
314586
|
} else if (item.children) {
|
|
313798
314587
|
deeps(item.children);
|
|
@@ -313804,7 +314593,7 @@
|
|
|
313804
314593
|
deeps(draft);
|
|
313805
314594
|
} else {
|
|
313806
314595
|
var index = draft.findIndex(function (item) {
|
|
313807
|
-
return
|
|
314596
|
+
return rkey === item[_rowKey];
|
|
313808
314597
|
});
|
|
313809
314598
|
|
|
313810
314599
|
if (index !== -1) {
|
|
@@ -313812,27 +314601,40 @@
|
|
|
313812
314601
|
var _draft$index$children, _draft$index, _draft$index2;
|
|
313813
314602
|
|
|
313814
314603
|
if ((_draft$index$children = draft[index].children) === null || _draft$index$children === void 0 ? void 0 : _draft$index$children.length) {
|
|
313815
|
-
|
|
314604
|
+
if (Array.isArray(defaultRecord)) {
|
|
314605
|
+
var _draft$index$children2;
|
|
314606
|
+
|
|
314607
|
+
(_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));
|
|
314608
|
+
} else {
|
|
314609
|
+
var _draft$index$children3;
|
|
313816
314610
|
|
|
313817
|
-
|
|
314611
|
+
(_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())));
|
|
314612
|
+
}
|
|
313818
314613
|
} else {
|
|
313819
|
-
draft[index].children = [_defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
314614
|
+
draft[index].children = Array.isArray(defaultRecord) ? _toConsumableArray$1(defaultRecord) : [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
|
|
313820
314615
|
}
|
|
313821
314616
|
|
|
313822
314617
|
!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]]));
|
|
313823
314618
|
} else {
|
|
313824
|
-
|
|
314619
|
+
if (Array.isArray(defaultRecord)) {
|
|
314620
|
+
draft.splice.apply(draft, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
|
|
314621
|
+
} else {
|
|
314622
|
+
draft.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
|
|
314623
|
+
}
|
|
313825
314624
|
}
|
|
313826
314625
|
}
|
|
313827
314626
|
}
|
|
313828
314627
|
});
|
|
313829
314628
|
setDataSource(res);
|
|
313830
|
-
};
|
|
314629
|
+
}, 50);
|
|
314630
|
+
/** 快捷刷子功能 */
|
|
313831
314631
|
|
|
313832
|
-
var handleCopy = function handleCopy(key, value) {
|
|
314632
|
+
var handleCopy = function handleCopy(key, value, type, rowIndex) {
|
|
313833
314633
|
var res = fn(dataSourceRef.current, function (draft) {
|
|
313834
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item) {
|
|
313835
|
-
|
|
314634
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
314635
|
+
if (type === 'up' && index < rowIndex || type === 'down' && index > rowIndex) {
|
|
314636
|
+
item[key] = value;
|
|
314637
|
+
}
|
|
313836
314638
|
});
|
|
313837
314639
|
});
|
|
313838
314640
|
setDataSource(res);
|
|
@@ -313841,17 +314643,16 @@
|
|
|
313841
314643
|
|
|
313842
314644
|
|
|
313843
314645
|
var hasDisableOptions = React.useMemo(function () {
|
|
313844
|
-
// const hasOnlyOptionsDatas = columns.filter(item => item?.['componentProps']?.optionOnly)
|
|
313845
314646
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
313846
314647
|
var _item$componentProps;
|
|
313847
314648
|
|
|
313848
314649
|
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;
|
|
313849
314650
|
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
313850
|
-
});
|
|
314651
|
+
}); // const hasOnlyOptionsDatas = columns.filter((item) => item?.componentProps?.optionOnly)
|
|
313851
314652
|
|
|
313852
314653
|
if (hasOnlyOptionsDatas.length) {
|
|
313853
314654
|
return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
|
|
313854
|
-
return item
|
|
314655
|
+
return item.dataIndex;
|
|
313855
314656
|
});
|
|
313856
314657
|
}
|
|
313857
314658
|
|
|
@@ -313863,12 +314664,11 @@
|
|
|
313863
314664
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
313864
314665
|
var _item$componentProps2;
|
|
313865
314666
|
|
|
313866
|
-
var resultComponentProps = lodash.isFunction(item.componentProps) ?
|
|
313867
|
-
|
|
313868
|
-
var _ref8 = resultComponentProps || {},
|
|
313869
|
-
optionOnly = _ref8.optionOnly,
|
|
313870
|
-
options = _ref8.options; // const { optionOnly, options } = item['componentProps'] || {}
|
|
314667
|
+
var resultComponentProps = lodash.isFunction(item.componentProps) ? (_item$componentProps2 = item.componentProps) === null || _item$componentProps2 === void 0 ? void 0 : _item$componentProps2.call(item, {}, item) : item.componentProps;
|
|
313871
314668
|
|
|
314669
|
+
var _ref11 = resultComponentProps || {},
|
|
314670
|
+
optionOnly = _ref11.optionOnly,
|
|
314671
|
+
options = _ref11.options;
|
|
313872
314672
|
|
|
313873
314673
|
if (optionOnly && options) {
|
|
313874
314674
|
var dataIndex = item.dataIndex;
|
|
@@ -313888,7 +314688,7 @@
|
|
|
313888
314688
|
}
|
|
313889
314689
|
|
|
313890
314690
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
313891
|
-
componentProps: _objectSpread(_objectSpread({}, item
|
|
314691
|
+
componentProps: _objectSpread(_objectSpread({}, item.componentProps), {}, {
|
|
313892
314692
|
options: newOptions
|
|
313893
314693
|
})
|
|
313894
314694
|
});
|
|
@@ -313904,21 +314704,54 @@
|
|
|
313904
314704
|
/** 组装之后的最终columns */
|
|
313905
314705
|
|
|
313906
314706
|
var resultColumns = React.useMemo(function () {
|
|
313907
|
-
var _localColumns;
|
|
314707
|
+
var _localColumns, _localColumns2, _localColumns3;
|
|
313908
314708
|
|
|
313909
314709
|
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
313910
314710
|
var localColumns = [sortOpen ? {
|
|
313911
314711
|
title: '排序',
|
|
313912
|
-
dataIndex: '
|
|
314712
|
+
dataIndex: '_sort',
|
|
313913
314713
|
width: 48,
|
|
313914
314714
|
maxWidth: 48,
|
|
313915
314715
|
className: 'drag-visible',
|
|
314716
|
+
fixed: 'left',
|
|
313916
314717
|
render: function render(_, record) {
|
|
313917
314718
|
return /*#__PURE__*/React__default['default'].createElement(Dragger$1, {
|
|
313918
|
-
id: record[_rowKey] || record.id
|
|
314719
|
+
id: (record === null || record === void 0 ? void 0 : record[_rowKey]) || (record === null || record === void 0 ? void 0 : record.id)
|
|
313919
314720
|
});
|
|
313920
314721
|
}
|
|
313921
|
-
} : null
|
|
314722
|
+
} : null, indexCol ? lodash.isBoolean(indexCol) ? {
|
|
314723
|
+
title: '',
|
|
314724
|
+
dataIndex: '_index',
|
|
314725
|
+
width: 48,
|
|
314726
|
+
maxWidth: 48,
|
|
314727
|
+
ellipsis: true,
|
|
314728
|
+
fixed: 'left',
|
|
314729
|
+
render: function render(_, record, index) {
|
|
314730
|
+
var _deepDataSourceRef$cu9, _deepDataSourceRef$cu10, _deepDataSourceRef$cu11;
|
|
314731
|
+
|
|
314732
|
+
console.log(deepDataSourceRef.current, '--deepDataSourceRef.current', _rowKey);
|
|
314733
|
+
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);
|
|
314734
|
+
}
|
|
314735
|
+
} : _objectSpread(_objectSpread({
|
|
314736
|
+
title: '',
|
|
314737
|
+
dataIndex: '_index',
|
|
314738
|
+
width: 48,
|
|
314739
|
+
ellipsis: true,
|
|
314740
|
+
maxWidth: 48,
|
|
314741
|
+
fixed: 'left'
|
|
314742
|
+
}, indexCol || {}), {}, {
|
|
314743
|
+
render: function render(_, record, index) {
|
|
314744
|
+
var _deepDataSourceRef$cu14, _deepDataSourceRef$cu15, _deepDataSourceRef$cu16;
|
|
314745
|
+
|
|
314746
|
+
if (lodash.isFunction(indexCol === null || indexCol === void 0 ? void 0 : indexCol.render)) {
|
|
314747
|
+
var _indexCol$render, _deepDataSourceRef$cu12, _deepDataSourceRef$cu13;
|
|
314748
|
+
|
|
314749
|
+
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']);
|
|
314750
|
+
}
|
|
314751
|
+
|
|
314752
|
+
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);
|
|
314753
|
+
}
|
|
314754
|
+
}) : null].concat(_toConsumableArray$1(rColumns), [useQuickOpetate ? {
|
|
313922
314755
|
title: '操作',
|
|
313923
314756
|
dataIndex: 'lm_edit_opetate',
|
|
313924
314757
|
width: 68,
|
|
@@ -313929,11 +314762,11 @@
|
|
|
313929
314762
|
options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
|
|
313930
314763
|
}
|
|
313931
314764
|
} : null]).filter(function (item) {
|
|
313932
|
-
return item && item.show !== false;
|
|
314765
|
+
return item && (item === null || item === void 0 ? void 0 : item.show) !== false;
|
|
313933
314766
|
});
|
|
313934
|
-
localColumns = localColumns.map(function (item, index) {
|
|
314767
|
+
localColumns = (_localColumns = localColumns) === null || _localColumns === void 0 ? void 0 : _localColumns.map(function (item, index) {
|
|
313935
314768
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
313936
|
-
order: [null, undefined].includes(item
|
|
314769
|
+
order: [null, undefined].includes(item.order) ? index : item.order
|
|
313937
314770
|
});
|
|
313938
314771
|
}).sort(function (a, b) {
|
|
313939
314772
|
return a.order - b.order;
|
|
@@ -313941,7 +314774,7 @@
|
|
|
313941
314774
|
var leftColumns = [];
|
|
313942
314775
|
var mainColumns = [];
|
|
313943
314776
|
var rightColumns = [];
|
|
313944
|
-
(
|
|
314777
|
+
(_localColumns2 = localColumns) === null || _localColumns2 === void 0 ? void 0 : _localColumns2.forEach(function (item) {
|
|
313945
314778
|
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
313946
314779
|
leftColumns.push(item);
|
|
313947
314780
|
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
@@ -313956,29 +314789,22 @@
|
|
|
313956
314789
|
var mapColumns = function mapColumns(col, index) {
|
|
313957
314790
|
var _col$children;
|
|
313958
314791
|
|
|
313959
|
-
if (!col.editable && !((_col$children = col.children) === null || _col$children === void 0 ? void 0 : _col$children.length)) {
|
|
313960
|
-
|
|
313961
|
-
|
|
313962
|
-
|
|
313963
|
-
|
|
313964
|
-
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
313965
|
-
var _col$componentProps2;
|
|
313966
|
-
|
|
313967
|
-
var dataIndex = col.dataIndex,
|
|
313968
|
-
editable = col.editable,
|
|
313969
|
-
relevanceCols = col.relevanceCols,
|
|
313970
|
-
componentProps = col.componentProps;
|
|
314792
|
+
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') {
|
|
314793
|
+
var fn = col === null || col === void 0 ? void 0 : col.render;
|
|
314794
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
314795
|
+
render: function render(text, record, i) {
|
|
314796
|
+
var _dataSource$i;
|
|
313971
314797
|
|
|
313972
|
-
|
|
313973
|
-
return true;
|
|
314798
|
+
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);
|
|
313974
314799
|
}
|
|
314800
|
+
});
|
|
314801
|
+
}
|
|
313975
314802
|
|
|
313976
|
-
|
|
313977
|
-
|
|
313978
|
-
|
|
314803
|
+
if (isEdit && (col === null || col === void 0 ? void 0 : col.render) && (col === null || col === void 0 ? void 0 : col.editable) === 'render') {
|
|
314804
|
+
delete col.render;
|
|
314805
|
+
}
|
|
313979
314806
|
|
|
313980
|
-
|
|
313981
|
-
},
|
|
314807
|
+
var newCol = _objectSpread(_objectSpread({}, col), {}, {
|
|
313982
314808
|
onCell: function onCell(record, rowIndex) {
|
|
313983
314809
|
return {
|
|
313984
314810
|
getLength: dataSource.length,
|
|
@@ -313993,7 +314819,7 @@
|
|
|
313993
314819
|
editable: col.editable,
|
|
313994
314820
|
dataIndex: col.dataIndex,
|
|
313995
314821
|
itemProps: col.itemProps,
|
|
313996
|
-
|
|
314822
|
+
shouldUpdate: shouldUpdate,
|
|
313997
314823
|
isEdit: isEdit,
|
|
313998
314824
|
isHoverEdit: isHoverEdit,
|
|
313999
314825
|
handleAdd: handleAdd,
|
|
@@ -314001,8 +314827,7 @@
|
|
|
314001
314827
|
handleCopy: handleCopy,
|
|
314002
314828
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
314003
314829
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
314004
|
-
handleSave: handleSave
|
|
314005
|
-
reWriteOriginSource: reWriteOriginSource
|
|
314830
|
+
handleSave: handleSave
|
|
314006
314831
|
};
|
|
314007
314832
|
}
|
|
314008
314833
|
});
|
|
@@ -314016,28 +314841,28 @@
|
|
|
314016
314841
|
return newCol;
|
|
314017
314842
|
};
|
|
314018
314843
|
|
|
314019
|
-
var res = localColumns.map(function (col, index) {
|
|
314844
|
+
var res = (_localColumns3 = localColumns) === null || _localColumns3 === void 0 ? void 0 : _localColumns3.map(function (col, index) {
|
|
314020
314845
|
return mapColumns(col, index);
|
|
314021
314846
|
});
|
|
314022
314847
|
return res;
|
|
314023
|
-
}, [columns, isAdd, sortOpen, useQuickOpetate,
|
|
314024
|
-
var DraggableContainer = React.useCallback(function (_ref9) {
|
|
314025
|
-
var _dataSourceRef$curren2;
|
|
314848
|
+
}, [columns, isAdd, sortOpen, useQuickOpetate, dataSource, _toConsumableArray$1(memoOptions)]);
|
|
314026
314849
|
|
|
314027
|
-
|
|
314850
|
+
var onSortEnd = function onSortEnd(active, over) {
|
|
314851
|
+
var cloneArr = _toConsumableArray$1(dataSourceRef.current);
|
|
314028
314852
|
|
|
314029
|
-
|
|
314030
|
-
|
|
314031
|
-
}
|
|
314032
|
-
|
|
314033
|
-
|
|
314034
|
-
|
|
314035
|
-
|
|
314036
|
-
}
|
|
314037
|
-
|
|
314853
|
+
var oldIndex = cloneArr.findIndex(function (v) {
|
|
314854
|
+
return v[_rowKey] === active;
|
|
314855
|
+
});
|
|
314856
|
+
var newIndex = cloneArr.findIndex(function (v) {
|
|
314857
|
+
return v[_rowKey] === over;
|
|
314858
|
+
});
|
|
314859
|
+
setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
|
|
314860
|
+
};
|
|
314861
|
+
|
|
314862
|
+
var colDraggableContainer = React.useCallback(function (_ref12) {
|
|
314038
314863
|
var _React$Children;
|
|
314039
314864
|
|
|
314040
|
-
var props = _extends$2({},
|
|
314865
|
+
var props = _extends$2({}, _ref12);
|
|
314041
314866
|
|
|
314042
314867
|
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) {
|
|
314043
314868
|
var _child$props, _child$props$column;
|
|
@@ -314046,45 +314871,23 @@
|
|
|
314046
314871
|
return child;
|
|
314047
314872
|
}
|
|
314048
314873
|
|
|
314049
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
314874
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$3, {
|
|
314050
314875
|
id: child.key
|
|
314051
314876
|
}, child);
|
|
314052
314877
|
}));
|
|
314053
314878
|
}, [columns]);
|
|
314054
|
-
var config = React.useMemo(function () {
|
|
314055
|
-
var component = {
|
|
314056
|
-
body: Object.assign({
|
|
314057
|
-
row: sortOpen ? EditableSortRow : EditableRow$1,
|
|
314058
|
-
cell: EditableCell$1
|
|
314059
|
-
}, sortOpen ? {
|
|
314060
|
-
wrapper: DraggableContainer
|
|
314061
|
-
} : {})
|
|
314062
|
-
};
|
|
314063
|
-
|
|
314064
|
-
if (colSortOpen) {
|
|
314065
|
-
component['header'] = {
|
|
314066
|
-
row: colDraggableContainer
|
|
314067
|
-
};
|
|
314068
|
-
}
|
|
314069
|
-
|
|
314070
|
-
return _objectSpread({
|
|
314071
|
-
pagination: false,
|
|
314072
|
-
tableLayout: 'fixed',
|
|
314073
|
-
scroll: {
|
|
314074
|
-
x: '100%'
|
|
314075
|
-
},
|
|
314076
|
-
rowKey: function rowKey(record) {
|
|
314077
|
-
return record[_rowKey] || record.index || Math.random();
|
|
314078
|
-
},
|
|
314079
|
-
components: component
|
|
314080
|
-
}, resetProps);
|
|
314081
|
-
}, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
|
|
314082
314879
|
React.useImperativeHandle(ref, function () {
|
|
314083
314880
|
return {
|
|
314084
314881
|
setRow: handleSave,
|
|
314085
314882
|
getCheckboxRecords: function getCheckboxRecords() {
|
|
314086
314883
|
return localRowSelectList.selectedRows;
|
|
314087
314884
|
},
|
|
314885
|
+
deleteRowData: function deleteRowData(data) {
|
|
314886
|
+
return handleTableRowDelete(data);
|
|
314887
|
+
},
|
|
314888
|
+
addRowData: function addRowData(data, defaultValue, addInChild) {
|
|
314889
|
+
return addInChild === 'replace' ? handleTableRowReplace(data, defaultValue) : handleTableRowAdd(data, addInChild, defaultValue);
|
|
314890
|
+
},
|
|
314088
314891
|
clearSelect: function clearSelect() {
|
|
314089
314892
|
setLocalRowSelectList({
|
|
314090
314893
|
selectedRows: []
|
|
@@ -314095,33 +314898,88 @@
|
|
|
314095
314898
|
selectedRows: value
|
|
314096
314899
|
});
|
|
314097
314900
|
},
|
|
314098
|
-
|
|
314099
|
-
return
|
|
314100
|
-
}
|
|
314901
|
+
columns: columns.map(function (item) {
|
|
314902
|
+
return lodash.omit(item, ['render', 'sorter', 'onFilter', 'filters', 'componentProps', 'formProps', 'editable']);
|
|
314903
|
+
})
|
|
314101
314904
|
};
|
|
314102
314905
|
});
|
|
314103
314906
|
var isShowAddAction = React.useMemo(function () {
|
|
314104
314907
|
return isEdit && isAdd || isHoverEdit && isAdd;
|
|
314105
314908
|
}, [isEdit, isAdd, isHoverEdit]);
|
|
314909
|
+
var config = React.useRef(_objectSpread({
|
|
314910
|
+
pagination: false,
|
|
314911
|
+
tableLayout: 'fixed',
|
|
314912
|
+
scroll: {
|
|
314913
|
+
x: '100%'
|
|
314914
|
+
},
|
|
314915
|
+
rowKey: function rowKey(record) {
|
|
314916
|
+
return record[_rowKey] || record.index || Math.random();
|
|
314917
|
+
},
|
|
314918
|
+
components: {
|
|
314919
|
+
table: virtual ? VirtualTable$1 : null,
|
|
314920
|
+
body: Object.assign({
|
|
314921
|
+
row: function row(rowProps) {
|
|
314922
|
+
return sortOpen ? EditableSortRow(_objectSpread(_objectSpread({}, rowProps), {}, {
|
|
314923
|
+
virtual: virtual
|
|
314924
|
+
})) : EditableRow$1(_objectSpread(_objectSpread({}, rowProps), {}, {
|
|
314925
|
+
virtual: virtual
|
|
314926
|
+
}));
|
|
314927
|
+
},
|
|
314928
|
+
cell: MemoEditableCell
|
|
314929
|
+
}, sortOpen ? {
|
|
314930
|
+
wrapper: function wrapper(wrapperProps) {
|
|
314931
|
+
var _dataSourceRef$curren2, _tableWarpRef$current, _tableWarpRef$current2;
|
|
314932
|
+
|
|
314933
|
+
return DraggableContainer(_objectSpread(_objectSpread({}, wrapperProps), {}, {
|
|
314934
|
+
virtual: virtual,
|
|
314935
|
+
keys: (_dataSourceRef$curren2 = dataSourceRef.current) === null || _dataSourceRef$curren2 === void 0 ? void 0 : _dataSourceRef$curren2.map(function (item) {
|
|
314936
|
+
return item[_rowKey];
|
|
314937
|
+
}),
|
|
314938
|
+
options: dataSourceRef.current,
|
|
314939
|
+
rowKey: _rowKey,
|
|
314940
|
+
onSortEnd: onSortEnd,
|
|
314941
|
+
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
|
|
314942
|
+
}));
|
|
314943
|
+
}
|
|
314944
|
+
} : virtual ? {
|
|
314945
|
+
wrapper: VirtualWrapper$1
|
|
314946
|
+
} : {}),
|
|
314947
|
+
header: {
|
|
314948
|
+
row: colSortOpen ? colDraggableContainer : null
|
|
314949
|
+
}
|
|
314950
|
+
},
|
|
314951
|
+
onRow: function onRow(record, index) {
|
|
314952
|
+
return {
|
|
314953
|
+
disabled: disabled
|
|
314954
|
+
};
|
|
314955
|
+
}
|
|
314956
|
+
}, resetProps));
|
|
314106
314957
|
|
|
314107
314958
|
if (colSortOpen) {
|
|
314108
314959
|
var _localRowSelectList$s;
|
|
314109
314960
|
|
|
314110
314961
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314111
|
-
className: "lm_editTable_warpper"
|
|
314112
|
-
|
|
314962
|
+
className: "lm_editTable_warpper",
|
|
314963
|
+
ref: tableWarpRef
|
|
314964
|
+
}, /*#__PURE__*/React__default['default'].createElement(ConfigProvider$1, {
|
|
314965
|
+
renderEmpty: loading ? function () {
|
|
314966
|
+
return null;
|
|
314967
|
+
} : CustomizeRenderEmpty$1
|
|
314968
|
+
}, /*#__PURE__*/React__default['default'].createElement(DndContainer$2, {
|
|
314969
|
+
rowKey: _rowKey,
|
|
314970
|
+
options: resultColumns,
|
|
314113
314971
|
move: onColSortEnd
|
|
314114
|
-
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$
|
|
314972
|
+
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$1, {
|
|
314115
314973
|
items: columns.reduce(function (acc, item) {
|
|
314116
314974
|
return [].concat(_toConsumableArray$1(acc), [item.dataIndex]);
|
|
314117
314975
|
}, [])
|
|
314118
|
-
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, config), {}, {
|
|
314976
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, checkDataSourceIsEmpty(config.current, dataSourceRef.current)), {}, {
|
|
314977
|
+
loading: loading,
|
|
314119
314978
|
size: size || 'small',
|
|
314120
314979
|
columns: resultColumns,
|
|
314121
314980
|
rowClassName: "editable-row",
|
|
314122
314981
|
bordered: true,
|
|
314123
314982
|
pagination: false,
|
|
314124
|
-
// components={tableComponents}
|
|
314125
314983
|
rowSelection: !rowSelection ? undefined : _objectSpread(_objectSpread({
|
|
314126
314984
|
fixed: true,
|
|
314127
314985
|
type: 'checkbox',
|
|
@@ -314131,36 +314989,43 @@
|
|
|
314131
314989
|
return lodash.isObject(v) ? v[_rowKey] : v;
|
|
314132
314990
|
}),
|
|
314133
314991
|
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
314134
|
-
// editTableRowChange(selectedRowKeys, selectedRows, info)
|
|
314135
314992
|
setLocalRowSelectList(selectedRowKeys, selectedRows, info);
|
|
314136
314993
|
}
|
|
314137
314994
|
}),
|
|
314138
314995
|
dataSource: dataSource
|
|
314139
|
-
})))),
|
|
314140
|
-
|
|
314141
|
-
|
|
314142
|
-
|
|
314143
|
-
|
|
314144
|
-
|
|
314145
|
-
}
|
|
314146
|
-
}, /*#__PURE__*/React__default['default'].createElement(PlusCircleOutlined$2, {
|
|
314147
|
-
className: "lmweb-plus"
|
|
314148
|
-
}), "\u65B0\u589E"));
|
|
314996
|
+
}))))), /*#__PURE__*/React__default['default'].createElement(BottomOpetateComponent, {
|
|
314997
|
+
disabled: disabled,
|
|
314998
|
+
isShowAddAction: isShowAddAction,
|
|
314999
|
+
recordCreatorProps: recordCreatorProps,
|
|
315000
|
+
handleAdd: handleAdd
|
|
315001
|
+
}));
|
|
314149
315002
|
} // @ts-ignore
|
|
314150
315003
|
|
|
314151
315004
|
|
|
314152
315005
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
314153
|
-
className: "lm_editTable_warpper"
|
|
314154
|
-
|
|
315006
|
+
className: "lm_editTable_warpper",
|
|
315007
|
+
ref: tableWarpRef
|
|
315008
|
+
}, /*#__PURE__*/React__default['default'].createElement(ConfigProvider$1, {
|
|
315009
|
+
renderEmpty: loading ? function () {
|
|
315010
|
+
return null;
|
|
315011
|
+
} : CustomizeRenderEmpty$1
|
|
315012
|
+
}, /*#__PURE__*/React__default['default'].createElement(Table$1, _objectSpread(_objectSpread({}, checkDataSourceIsEmpty(config.current, dataSourceRef.current)), {}, {
|
|
314155
315013
|
size: size || 'small',
|
|
314156
315014
|
columns: resultColumns,
|
|
314157
315015
|
rowClassName: "editable-row",
|
|
314158
315016
|
bordered: true,
|
|
315017
|
+
loading: loading,
|
|
314159
315018
|
pagination: false,
|
|
314160
315019
|
// components={tableComponents}
|
|
314161
315020
|
expandable: (resetProps === null || resetProps === void 0 ? void 0 : resetProps.expandable) || {
|
|
314162
315021
|
expandedRowKeys: expandedRowKeys,
|
|
314163
315022
|
fixed: true,
|
|
315023
|
+
// indentSize: 0,
|
|
315024
|
+
expandIconColumnIndex: checkExpandIconColumnIndex({
|
|
315025
|
+
rowSelection: rowSelection,
|
|
315026
|
+
sortOpen: sortOpen,
|
|
315027
|
+
indexCol: indexCol
|
|
315028
|
+
}) || 0,
|
|
314164
315029
|
onExpandedRowsChange: function onExpandedRowsChange(expandedRows) {
|
|
314165
315030
|
return setExpandedRowKeys(expandedRows);
|
|
314166
315031
|
}
|
|
@@ -314178,16 +315043,12 @@
|
|
|
314178
315043
|
}
|
|
314179
315044
|
}),
|
|
314180
315045
|
dataSource: dataSource
|
|
314181
|
-
})),
|
|
314182
|
-
|
|
314183
|
-
|
|
314184
|
-
|
|
314185
|
-
|
|
314186
|
-
|
|
314187
|
-
}, (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.style) || {})
|
|
314188
|
-
}, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
314189
|
-
type: "lmweb-plus"
|
|
314190
|
-
}), (recordCreatorProps === null || recordCreatorProps === void 0 ? void 0 : recordCreatorProps.creatorButtonText) || '新增'));
|
|
315046
|
+
}))), /*#__PURE__*/React__default['default'].createElement(BottomOpetateComponent, {
|
|
315047
|
+
disabled: disabled,
|
|
315048
|
+
isShowAddAction: isShowAddAction,
|
|
315049
|
+
recordCreatorProps: recordCreatorProps,
|
|
315050
|
+
handleAdd: handleAdd
|
|
315051
|
+
}));
|
|
314191
315052
|
});
|
|
314192
315053
|
var LmEditTable = /*#__PURE__*/React.memo(EditTable$1);
|
|
314193
315054
|
|
|
@@ -314863,7 +315724,7 @@
|
|
|
314863
315724
|
}
|
|
314864
315725
|
}
|
|
314865
315726
|
|
|
314866
|
-
var _excluded$
|
|
315727
|
+
var _excluded$2W = ["prefixCls", "getPopupContainer", "className", "placement", "size", "disabled", "bordered", "placeholder", "status"];
|
|
314867
315728
|
function generateRangePicker$1(generateConfig) {
|
|
314868
315729
|
var RangePicker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
314869
315730
|
var customizePrefixCls = props.prefixCls,
|
|
@@ -314876,7 +315737,7 @@
|
|
|
314876
315737
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
314877
315738
|
placeholder = props.placeholder,
|
|
314878
315739
|
customStatus = props.status,
|
|
314879
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
315740
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2W);
|
|
314880
315741
|
|
|
314881
315742
|
var innerRef = React.useRef(null);
|
|
314882
315743
|
|
|
@@ -314976,7 +315837,7 @@
|
|
|
314976
315837
|
return RangePicker$1;
|
|
314977
315838
|
}
|
|
314978
315839
|
|
|
314979
|
-
var _excluded$
|
|
315840
|
+
var _excluded$2X = ["prefixCls", "getPopupContainer", "className", "size", "bordered", "placement", "placeholder", "disabled", "status"];
|
|
314980
315841
|
function generatePicker$2(generateConfig) {
|
|
314981
315842
|
function getPicker(picker, displayName) {
|
|
314982
315843
|
var Picker$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -314990,7 +315851,7 @@
|
|
|
314990
315851
|
placeholder = props.placeholder,
|
|
314991
315852
|
customDisabled = props.disabled,
|
|
314992
315853
|
customStatus = props.status,
|
|
314993
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
315854
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2X);
|
|
314994
315855
|
|
|
314995
315856
|
warning$6(picker !== 'quarter', displayName, "DatePicker.".concat(displayName, " is legacy usage. Please use DatePicker[picker='").concat(picker, "'] directly."));
|
|
314996
315857
|
|
|
@@ -315198,63 +316059,6 @@
|
|
|
315198
316059
|
var DatePicker$1 = generatePicker$3(momentGenerateConfig);
|
|
315199
316060
|
DatePicker$1.AntdDatePicker = DatePicker;
|
|
315200
316061
|
|
|
315201
|
-
var getRenderPropValue$1 = function getRenderPropValue(propValue) {
|
|
315202
|
-
if (!propValue) {
|
|
315203
|
-
return null;
|
|
315204
|
-
}
|
|
315205
|
-
|
|
315206
|
-
var isRenderFunction = typeof propValue === 'function';
|
|
315207
|
-
|
|
315208
|
-
if (isRenderFunction) {
|
|
315209
|
-
return propValue();
|
|
315210
|
-
}
|
|
315211
|
-
|
|
315212
|
-
return propValue;
|
|
315213
|
-
};
|
|
315214
|
-
|
|
315215
|
-
var _excluded$2U = ["prefixCls", "title", "content", "_overlay"];
|
|
315216
|
-
var Popover$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
315217
|
-
var customizePrefixCls = _ref.prefixCls,
|
|
315218
|
-
title = _ref.title,
|
|
315219
|
-
content = _ref.content,
|
|
315220
|
-
_overlay = _ref._overlay,
|
|
315221
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$2U);
|
|
315222
|
-
|
|
315223
|
-
var _React$useContext = React.useContext(ConfigContext),
|
|
315224
|
-
getPrefixCls = _React$useContext.getPrefixCls;
|
|
315225
|
-
|
|
315226
|
-
var getOverlay = function getOverlay(prefixCls) {
|
|
315227
|
-
if (!title && !content) return undefined;
|
|
315228
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement("div", {
|
|
315229
|
-
className: "".concat(prefixCls, "-title")
|
|
315230
|
-
}, getRenderPropValue$1(title)), /*#__PURE__*/React.createElement("div", {
|
|
315231
|
-
className: "".concat(prefixCls, "-inner-content")
|
|
315232
|
-
}, getRenderPropValue$1(content)));
|
|
315233
|
-
};
|
|
315234
|
-
|
|
315235
|
-
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
315236
|
-
var rootPrefixCls = getPrefixCls();
|
|
315237
|
-
return /*#__PURE__*/React.createElement(Tooltip$4, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
315238
|
-
prefixCls: prefixCls,
|
|
315239
|
-
ref: ref,
|
|
315240
|
-
overlay: _overlay || getOverlay(prefixCls),
|
|
315241
|
-
transitionName: getTransitionName$9(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
315242
|
-
}));
|
|
315243
|
-
});
|
|
315244
|
-
|
|
315245
|
-
{
|
|
315246
|
-
Popover$1.displayName = 'Popover';
|
|
315247
|
-
}
|
|
315248
|
-
|
|
315249
|
-
Popover$1.defaultProps = {
|
|
315250
|
-
placement: 'top',
|
|
315251
|
-
trigger: 'hover',
|
|
315252
|
-
mouseEnterDelay: 0.1,
|
|
315253
|
-
mouseLeaveDelay: 0.1,
|
|
315254
|
-
overlayStyle: {}
|
|
315255
|
-
};
|
|
315256
|
-
Popover$1.AntdPopover = Popover;
|
|
315257
|
-
|
|
315258
316062
|
var CheckOutlined_1 = createCommonjsModule(function (module, exports) {
|
|
315259
316063
|
// This icon file is generated automatically.
|
|
315260
316064
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -316067,7 +316871,7 @@
|
|
|
316067
316871
|
|
|
316068
316872
|
var KeyCode$1 = /*@__PURE__*/getDefaultExportFromCjs(KeyCode_1);
|
|
316069
316873
|
|
|
316070
|
-
var _excluded$
|
|
316874
|
+
var _excluded$2Y = ["style", "noStyle", "disabled"];
|
|
316071
316875
|
var inlineStyle$1 = {
|
|
316072
316876
|
border: 0,
|
|
316073
316877
|
background: 'transparent',
|
|
@@ -316096,7 +316900,7 @@
|
|
|
316096
316900
|
var style = props.style,
|
|
316097
316901
|
noStyle = props.noStyle,
|
|
316098
316902
|
disabled = props.disabled,
|
|
316099
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
316903
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2Y);
|
|
316100
316904
|
|
|
316101
316905
|
var mergedStyle = {};
|
|
316102
316906
|
|
|
@@ -316307,7 +317111,7 @@
|
|
|
316307
317111
|
}, conditions);
|
|
316308
317112
|
});
|
|
316309
317113
|
|
|
316310
|
-
var _excluded$
|
|
317114
|
+
var _excluded$2Z = ["prefixCls", "component", "className", "aria-label", "setContentRef", "children"];
|
|
316311
317115
|
|
|
316312
317116
|
var Typography$2 = function Typography(_ref, ref) {
|
|
316313
317117
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -316317,7 +317121,7 @@
|
|
|
316317
317121
|
ariaLabel = _ref['aria-label'],
|
|
316318
317122
|
setContentRef = _ref.setContentRef,
|
|
316319
317123
|
children = _ref.children,
|
|
316320
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317124
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2Z);
|
|
316321
317125
|
|
|
316322
317126
|
var _React$useContext = React.useContext(ConfigContext),
|
|
316323
317127
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -316560,7 +317364,7 @@
|
|
|
316560
317364
|
EllipsisTooltip$1.displayName = 'EllipsisTooltip';
|
|
316561
317365
|
}
|
|
316562
317366
|
|
|
316563
|
-
var _excluded$
|
|
317367
|
+
var _excluded$2_ = ["prefixCls", "className", "style", "type", "disabled", "children", "ellipsis", "editable", "copyable", "component", "title"];
|
|
316564
317368
|
|
|
316565
317369
|
function wrapperDecorations$1(_ref, content) {
|
|
316566
317370
|
var mark = _ref.mark,
|
|
@@ -316612,7 +317416,7 @@
|
|
|
316612
317416
|
copyable = props.copyable,
|
|
316613
317417
|
component = props.component,
|
|
316614
317418
|
title = props.title,
|
|
316615
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
317419
|
+
restProps = _objectWithoutProperties$1(props, _excluded$2_);
|
|
316616
317420
|
|
|
316617
317421
|
var _React$useContext = React.useContext(ConfigContext),
|
|
316618
317422
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -317030,12 +317834,12 @@
|
|
|
317030
317834
|
});
|
|
317031
317835
|
});
|
|
317032
317836
|
|
|
317033
|
-
var _excluded$
|
|
317837
|
+
var _excluded$2$ = ["ellipsis", "rel"];
|
|
317034
317838
|
|
|
317035
317839
|
var Link$2 = function Link(_ref, ref) {
|
|
317036
317840
|
var ellipsis = _ref.ellipsis,
|
|
317037
317841
|
rel = _ref.rel,
|
|
317038
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317842
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$2$);
|
|
317039
317843
|
|
|
317040
317844
|
warning$6(_typeof$1(ellipsis) !== 'object', 'Typography.Link', '`ellipsis` only supports boolean value.');
|
|
317041
317845
|
var baseRef = React.useRef(null);
|
|
@@ -317069,11 +317873,11 @@
|
|
|
317069
317873
|
|
|
317070
317874
|
var Paragraph$7 = /*#__PURE__*/React.forwardRef(Paragraph$6);
|
|
317071
317875
|
|
|
317072
|
-
var _excluded$
|
|
317876
|
+
var _excluded$30 = ["ellipsis"];
|
|
317073
317877
|
|
|
317074
317878
|
var Text$2 = function Text(_ref, ref) {
|
|
317075
317879
|
var ellipsis = _ref.ellipsis,
|
|
317076
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
317880
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$30);
|
|
317077
317881
|
|
|
317078
317882
|
var mergedEllipsis = React.useMemo(function () {
|
|
317079
317883
|
if (ellipsis && _typeof$1(ellipsis) === 'object') {
|
|
@@ -317093,13 +317897,13 @@
|
|
|
317093
317897
|
|
|
317094
317898
|
var Text$3 = /*#__PURE__*/React.forwardRef(Text$2);
|
|
317095
317899
|
|
|
317096
|
-
var _excluded$
|
|
317900
|
+
var _excluded$31 = ["level"];
|
|
317097
317901
|
var TITLE_ELE_LIST$1 = tupleNum$1(1, 2, 3, 4, 5);
|
|
317098
317902
|
|
|
317099
317903
|
var Title$4 = function Title(props, ref) {
|
|
317100
317904
|
var _props$level = props.level,
|
|
317101
317905
|
level = _props$level === void 0 ? 1 : _props$level,
|
|
317102
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
317906
|
+
restProps = _objectWithoutProperties$1(props, _excluded$31);
|
|
317103
317907
|
|
|
317104
317908
|
var component;
|
|
317105
317909
|
|
|
@@ -317204,7 +318008,7 @@
|
|
|
317204
318008
|
RefAutoComplete$1.Option = Option;
|
|
317205
318009
|
RefAutoComplete$1.AntdAutoComplete = RefAutoComplete;
|
|
317206
318010
|
|
|
317207
|
-
var _excluded$
|
|
318011
|
+
var _excluded$32 = ["children", "treeData", "value", "defaultLabel", "disabled", "size"];
|
|
317208
318012
|
var CLMTreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
317209
318013
|
var children = props.children,
|
|
317210
318014
|
treeData = props.treeData,
|
|
@@ -317212,7 +318016,7 @@
|
|
|
317212
318016
|
defaultLabel = props.defaultLabel,
|
|
317213
318017
|
customDisabled = props.disabled,
|
|
317214
318018
|
customizeSize = props.size,
|
|
317215
|
-
resetProps = _objectWithoutProperties$1(props, _excluded$
|
|
318019
|
+
resetProps = _objectWithoutProperties$1(props, _excluded$32); // ===================== Disabled =====================
|
|
317216
318020
|
|
|
317217
318021
|
|
|
317218
318022
|
var disabled = React__default['default'].useContext(DisabledContext$1);
|
|
@@ -317347,7 +318151,7 @@
|
|
|
317347
318151
|
return ErrorBoundary;
|
|
317348
318152
|
}(React.Component);
|
|
317349
318153
|
|
|
317350
|
-
var _excluded$
|
|
318154
|
+
var _excluded$33 = ["description", "prefixCls", "message", "banner", "className", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "duration"];
|
|
317351
318155
|
var iconMapFilled$1 = {
|
|
317352
318156
|
success: CheckCircleFilled$2,
|
|
317353
318157
|
info: InfoCircleFilled$2,
|
|
@@ -317420,7 +318224,7 @@
|
|
|
317420
318224
|
closeIcon = _ref$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined$2, null) : _ref$closeIcon,
|
|
317421
318225
|
action = _ref.action,
|
|
317422
318226
|
duration = _ref.duration,
|
|
317423
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
318227
|
+
props = _objectWithoutProperties$1(_ref, _excluded$33);
|
|
317424
318228
|
|
|
317425
318229
|
var _React$useState = React.useState(false),
|
|
317426
318230
|
_React$useState2 = _slicedToArray$1(_React$useState, 2),
|
|
@@ -317850,7 +318654,7 @@
|
|
|
317850
318654
|
};
|
|
317851
318655
|
};
|
|
317852
318656
|
|
|
317853
|
-
var _excluded$
|
|
318657
|
+
var _excluded$34 = ["className", "onUrge", "onDeleteComment"];
|
|
317854
318658
|
var prefixCls$b = 'lm_approval';
|
|
317855
318659
|
var colors = ['#36BCF1', '#AE86DC', '#8BD248', '#F5A173'];
|
|
317856
318660
|
var cacheColorMap = new Map();
|
|
@@ -318258,7 +319062,7 @@
|
|
|
318258
319062
|
onUrge = _props$onUrge === void 0 ? function () {} : _props$onUrge,
|
|
318259
319063
|
_props$onDeleteCommen2 = props.onDeleteComment,
|
|
318260
319064
|
onDeleteComment = _props$onDeleteCommen2 === void 0 ? function () {} : _props$onDeleteCommen2,
|
|
318261
|
-
others = _objectWithoutProperties$1(props, _excluded$
|
|
319065
|
+
others = _objectWithoutProperties$1(props, _excluded$34);
|
|
318262
319066
|
|
|
318263
319067
|
var _useState = React.useState(false),
|
|
318264
319068
|
_useState2 = _slicedToArray$1(_useState, 2),
|
|
@@ -320049,9 +320853,9 @@
|
|
|
320049
320853
|
return nodes;
|
|
320050
320854
|
}
|
|
320051
320855
|
|
|
320052
|
-
var _excluded$
|
|
320856
|
+
var _excluded$35 = ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"],
|
|
320053
320857
|
_excluded2$J = ["prefixCls", "className"];
|
|
320054
|
-
var ConfigContext$
|
|
320858
|
+
var ConfigContext$8 = ConfigProvider$1.ConfigContext;
|
|
320055
320859
|
|
|
320056
320860
|
function getIcon$1(props) {
|
|
320057
320861
|
var isLeaf = props.isLeaf,
|
|
@@ -320074,7 +320878,7 @@
|
|
|
320074
320878
|
var defaultExpandAll = _ref2.defaultExpandAll,
|
|
320075
320879
|
defaultExpandParent = _ref2.defaultExpandParent,
|
|
320076
320880
|
defaultExpandedKeys = _ref2.defaultExpandedKeys,
|
|
320077
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
320881
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$35);
|
|
320078
320882
|
|
|
320079
320883
|
// Shift click usage
|
|
320080
320884
|
var lastSelectedKey = React.useRef();
|
|
@@ -320185,7 +320989,7 @@
|
|
|
320185
320989
|
}
|
|
320186
320990
|
};
|
|
320187
320991
|
|
|
320188
|
-
var _React$useContext = React.useContext(ConfigContext$
|
|
320992
|
+
var _React$useContext = React.useContext(ConfigContext$8),
|
|
320189
320993
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
320190
320994
|
direction = _React$useContext.direction;
|
|
320191
320995
|
|
|
@@ -320492,11 +321296,11 @@
|
|
|
320492
321296
|
});
|
|
320493
321297
|
}
|
|
320494
321298
|
|
|
320495
|
-
var ConfigContext$
|
|
321299
|
+
var ConfigContext$9 = ConfigProvider$1.ConfigContext;
|
|
320496
321300
|
var Tree$2 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
320497
321301
|
var _classNames;
|
|
320498
321302
|
|
|
320499
|
-
var _React$useContext = React.useContext(ConfigContext$
|
|
321303
|
+
var _React$useContext = React.useContext(ConfigContext$9),
|
|
320500
321304
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
320501
321305
|
direction = _React$useContext.direction,
|
|
320502
321306
|
virtual = _React$useContext.virtual;
|
|
@@ -320572,11 +321376,11 @@
|
|
|
320572
321376
|
blockNode: false
|
|
320573
321377
|
};
|
|
320574
321378
|
|
|
320575
|
-
var _excluded$
|
|
321379
|
+
var _excluded$36 = ["className"];
|
|
320576
321380
|
var prefixCls$c = 'lm_tree';
|
|
320577
321381
|
var LmTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
320578
321382
|
var className = props.className,
|
|
320579
|
-
rest = _objectWithoutProperties$1(props, _excluded$
|
|
321383
|
+
rest = _objectWithoutProperties$1(props, _excluded$36);
|
|
320580
321384
|
|
|
320581
321385
|
return /*#__PURE__*/React__default['default'].createElement(Tree$2, _objectSpread(_objectSpread({
|
|
320582
321386
|
ref: ref
|
|
@@ -321635,7 +322439,7 @@
|
|
|
321635
322439
|
}, unitNodes);
|
|
321636
322440
|
}
|
|
321637
322441
|
|
|
321638
|
-
var _excluded$
|
|
322442
|
+
var _excluded$37 = ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"];
|
|
321639
322443
|
|
|
321640
322444
|
var ScrollNumber$1 = function ScrollNumber(_ref) {
|
|
321641
322445
|
var customizePrefixCls = _ref.prefixCls,
|
|
@@ -321648,7 +322452,7 @@
|
|
|
321648
322452
|
_ref$component = _ref.component,
|
|
321649
322453
|
component = _ref$component === void 0 ? 'sup' : _ref$component,
|
|
321650
322454
|
children = _ref.children,
|
|
321651
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
322455
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$37);
|
|
321652
322456
|
|
|
321653
322457
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
321654
322458
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
@@ -321698,7 +322502,7 @@
|
|
|
321698
322502
|
return /*#__PURE__*/React.createElement(component, newProps, numberNodes);
|
|
321699
322503
|
};
|
|
321700
322504
|
|
|
321701
|
-
var _excluded$
|
|
322505
|
+
var _excluded$38 = ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "showZero"];
|
|
321702
322506
|
|
|
321703
322507
|
var Badge$1 = function Badge(_ref) {
|
|
321704
322508
|
var _classNames, _classNames2;
|
|
@@ -321723,7 +322527,7 @@
|
|
|
321723
322527
|
className = _ref.className,
|
|
321724
322528
|
_ref$showZero = _ref.showZero,
|
|
321725
322529
|
showZero = _ref$showZero === void 0 ? false : _ref$showZero,
|
|
321726
|
-
restProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
322530
|
+
restProps = _objectWithoutProperties$1(_ref, _excluded$38);
|
|
321727
322531
|
|
|
321728
322532
|
var _React$useContext = React.useContext(ConfigContext$1),
|
|
321729
322533
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -321858,7 +322662,7 @@
|
|
|
321858
322662
|
|
|
321859
322663
|
Badge$1.Ribbon = Ribbon$1;
|
|
321860
322664
|
|
|
321861
|
-
var _excluded$
|
|
322665
|
+
var _excluded$39 = ["prefixCls", "type", "orientation", "orientationMargin", "className", "children", "dashed", "plain"];
|
|
321862
322666
|
|
|
321863
322667
|
var Divider$5 = function Divider(props) {
|
|
321864
322668
|
var _classNames;
|
|
@@ -321877,7 +322681,7 @@
|
|
|
321877
322681
|
children = props.children,
|
|
321878
322682
|
dashed = props.dashed,
|
|
321879
322683
|
plain = props.plain,
|
|
321880
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
322684
|
+
restProps = _objectWithoutProperties$1(props, _excluded$39);
|
|
321881
322685
|
|
|
321882
322686
|
var prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
321883
322687
|
var orientationPrefix = orientation.length > 0 ? "-".concat(orientation) : orientation;
|
|
@@ -322263,7 +323067,7 @@
|
|
|
322263
323067
|
}
|
|
322264
323068
|
}; // 状态管理操作
|
|
322265
323069
|
|
|
322266
|
-
var reducer$
|
|
323070
|
+
var reducer$6 = function reducer(state, action) {
|
|
322267
323071
|
var resize = action.resize,
|
|
322268
323072
|
transform = action.transform,
|
|
322269
323073
|
current = action.current;
|
|
@@ -322291,7 +323095,7 @@
|
|
|
322291
323095
|
}
|
|
322292
323096
|
}; // 仅在初始化时触发一次
|
|
322293
323097
|
|
|
322294
|
-
var initialState$
|
|
323098
|
+
var initialState$4 = function initialState(props) {
|
|
322295
323099
|
var initialIndex = props.initialIndex;
|
|
322296
323100
|
return _objectSpread(_objectSpread({}, defaultState), {}, {
|
|
322297
323101
|
currentIndex: initialIndex
|
|
@@ -322642,10 +323446,10 @@
|
|
|
322642
323446
|
var Root = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
322643
323447
|
var bodyRef = React.useRef(null);
|
|
322644
323448
|
var initialState = React.useMemo(function () {
|
|
322645
|
-
return initialState$
|
|
323449
|
+
return initialState$4(props);
|
|
322646
323450
|
}, []);
|
|
322647
323451
|
|
|
322648
|
-
var _useReducer = React.useReducer(reducer$
|
|
323452
|
+
var _useReducer = React.useReducer(reducer$6, initialState),
|
|
322649
323453
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
322650
323454
|
state = _useReducer2[0],
|
|
322651
323455
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -322711,7 +323515,7 @@
|
|
|
322711
323515
|
|
|
322712
323516
|
}; // 状态管理操作
|
|
322713
323517
|
|
|
322714
|
-
var reducer$
|
|
323518
|
+
var reducer$7 = function reducer(state, action) {
|
|
322715
323519
|
var result = action.result,
|
|
322716
323520
|
init = action.init;
|
|
322717
323521
|
|
|
@@ -322727,7 +323531,7 @@
|
|
|
322727
323531
|
}
|
|
322728
323532
|
}; // 仅在初始化时触发一次
|
|
322729
323533
|
|
|
322730
|
-
var initialState$
|
|
323534
|
+
var initialState$5 = function initialState() {
|
|
322731
323535
|
return _objectSpread({}, defaultState$1);
|
|
322732
323536
|
};
|
|
322733
323537
|
|
|
@@ -324401,14 +325205,14 @@
|
|
|
324401
325205
|
|
|
324402
325206
|
var Body$1 = /*#__PURE__*/React__default['default'].memo(Index$b);
|
|
324403
325207
|
|
|
324404
|
-
var _excluded$
|
|
325208
|
+
var _excluded$3a = ["value", "onChange", "leftIcon", "rightIcon"];
|
|
324405
325209
|
|
|
324406
325210
|
var ResetSlider = function ResetSlider(_ref) {
|
|
324407
325211
|
var value = _ref.value,
|
|
324408
325212
|
_onChange = _ref.onChange,
|
|
324409
325213
|
leftIcon = _ref.leftIcon,
|
|
324410
325214
|
rightIcon = _ref.rightIcon,
|
|
324411
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
325215
|
+
props = _objectWithoutProperties$1(_ref, _excluded$3a);
|
|
324412
325216
|
|
|
324413
325217
|
// 减
|
|
324414
325218
|
var decrement = function decrement() {
|
|
@@ -324562,10 +325366,10 @@
|
|
|
324562
325366
|
|
|
324563
325367
|
var LmBox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
324564
325368
|
var initialState = React.useMemo(function () {
|
|
324565
|
-
return initialState$
|
|
325369
|
+
return initialState$5();
|
|
324566
325370
|
}, []);
|
|
324567
325371
|
|
|
324568
|
-
var _useReducer = React.useReducer(reducer$
|
|
325372
|
+
var _useReducer = React.useReducer(reducer$7, initialState),
|
|
324569
325373
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
324570
325374
|
state = _useReducer2[0],
|
|
324571
325375
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -324628,7 +325432,7 @@
|
|
|
324628
325432
|
|
|
324629
325433
|
}; // 状态管理操作
|
|
324630
325434
|
|
|
324631
|
-
var reducer$
|
|
325435
|
+
var reducer$8 = function reducer(state, action) {
|
|
324632
325436
|
var transform = action.transform,
|
|
324633
325437
|
current = action.current,
|
|
324634
325438
|
visible = action.visible;
|
|
@@ -324661,7 +325465,7 @@
|
|
|
324661
325465
|
}
|
|
324662
325466
|
}; // 仅在初始化时触发一次
|
|
324663
325467
|
|
|
324664
|
-
var initialState$
|
|
325468
|
+
var initialState$6 = function initialState(props) {
|
|
324665
325469
|
var initialIndex = props.initialIndex;
|
|
324666
325470
|
return _objectSpread(_objectSpread({}, defaultState$2), {}, {
|
|
324667
325471
|
currentIndex: initialIndex
|
|
@@ -325051,10 +325855,10 @@
|
|
|
325051
325855
|
var LmImageViewerRoot = function LmImageViewerRoot(props, ref) {
|
|
325052
325856
|
var previewRef = React.useRef(null);
|
|
325053
325857
|
var initialState = React.useMemo(function () {
|
|
325054
|
-
return initialState$
|
|
325858
|
+
return initialState$6(props);
|
|
325055
325859
|
}, []);
|
|
325056
325860
|
|
|
325057
|
-
var _useReducer = React.useReducer(reducer$
|
|
325861
|
+
var _useReducer = React.useReducer(reducer$8, initialState),
|
|
325058
325862
|
_useReducer2 = _slicedToArray$1(_useReducer, 2),
|
|
325059
325863
|
state = _useReducer2[0],
|
|
325060
325864
|
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
@@ -325109,7 +325913,7 @@
|
|
|
325109
325913
|
|
|
325110
325914
|
var LmImageViewer$1 = /*#__PURE__*/React.forwardRef(LmImageViewer);
|
|
325111
325915
|
|
|
325112
|
-
var SortableItem$
|
|
325916
|
+
var SortableItem$4 = function SortableItem(_ref) {
|
|
325113
325917
|
var index = _ref.index,
|
|
325114
325918
|
item = _ref.item,
|
|
325115
325919
|
instance = _ref.instance;
|
|
@@ -325145,7 +325949,7 @@
|
|
|
325145
325949
|
})));
|
|
325146
325950
|
};
|
|
325147
325951
|
|
|
325148
|
-
var SortableItem$
|
|
325952
|
+
var SortableItem$5 = /*#__PURE__*/React__default['default'].memo(SortableItem$4);
|
|
325149
325953
|
|
|
325150
325954
|
var SortableBox$3 = function SortableBox(_ref) {
|
|
325151
325955
|
var instance = _ref.instance;
|
|
@@ -325156,7 +325960,7 @@
|
|
|
325156
325960
|
items: items,
|
|
325157
325961
|
strategy: rectSortingStrategy
|
|
325158
325962
|
}, options === null || options === void 0 ? void 0 : options.map(function (item, idx) {
|
|
325159
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
325963
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$5, {
|
|
325160
325964
|
instance: instance,
|
|
325161
325965
|
index: idx,
|
|
325162
325966
|
key: item[rowKey] || idx,
|
|
@@ -325167,7 +325971,7 @@
|
|
|
325167
325971
|
|
|
325168
325972
|
var SortableBox$4 = /*#__PURE__*/React__default['default'].memo(SortableBox$3);
|
|
325169
325973
|
|
|
325170
|
-
var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
325974
|
+
var DragOver$1 = /*#__PURE__*/React__default['default'].memo(function (_ref) {
|
|
325171
325975
|
var instance = _ref.instance;
|
|
325172
325976
|
var isDragging = instance.isDragging,
|
|
325173
325977
|
activeId = instance.activeId,
|
|
@@ -325189,7 +325993,7 @@
|
|
|
325189
325993
|
*/
|
|
325190
325994
|
// 可拖拽容器
|
|
325191
325995
|
|
|
325192
|
-
var DndContainer$
|
|
325996
|
+
var DndContainer$5 = function DndContainer(_ref2) {
|
|
325193
325997
|
var options = _ref2.options,
|
|
325194
325998
|
rowKey = _ref2.rowKey,
|
|
325195
325999
|
children = _ref2.children,
|
|
@@ -325276,7 +326080,7 @@
|
|
|
325276
326080
|
collisionDetection: closestCenter
|
|
325277
326081
|
}, /*#__PURE__*/React__default['default'].createElement(SortableBox$4, {
|
|
325278
326082
|
instance: instance
|
|
325279
|
-
}), /*#__PURE__*/React__default['default'].createElement(DragOver, {
|
|
326083
|
+
}), /*#__PURE__*/React__default['default'].createElement(DragOver$1, {
|
|
325280
326084
|
instance: instance
|
|
325281
326085
|
}));
|
|
325282
326086
|
};
|
|
@@ -325286,7 +326090,7 @@
|
|
|
325286
326090
|
React.useImperativeHandle(ref, function () {
|
|
325287
326091
|
return {};
|
|
325288
326092
|
});
|
|
325289
|
-
return /*#__PURE__*/React__default['default'].createElement(DndContainer$
|
|
326093
|
+
return /*#__PURE__*/React__default['default'].createElement(DndContainer$5, _objectSpread({}, props));
|
|
325290
326094
|
};
|
|
325291
326095
|
|
|
325292
326096
|
var Root$2 = /*#__PURE__*/React.forwardRef(Root$1);
|