linkmore-design 1.1.10 → 1.1.11
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/Button/demos/type.d.ts +2 -0
- package/dist/CustomTableOption/index.d.ts +1 -0
- package/dist/CustomTableOption/locale/en_US.d.ts +19 -0
- package/dist/CustomTableOption/locale/zh_CN.d.ts +19 -0
- package/dist/LmEditTable/demos/priceTable.d.ts +2 -0
- package/dist/LmEditTable/util.d.ts +1 -0
- package/dist/LmFilter/demos/filterControl.d.ts +2 -0
- package/dist/Locale/default.d.ts +4 -1
- package/dist/Locale/zh_CN.d.ts +4 -1
- package/dist/Modal/demos/locale.d.ts +2 -0
- package/dist/Modal/locale.d.ts +7 -0
- package/dist/base.css +1 -0
- package/dist/index.umd.js +212 -173
- package/dist/index.umd.min.js +6 -6
- package/dist/variables.css +27 -12
- package/es/Affix/style/index.css +1 -0
- package/es/Alert/style/index.css +1 -0
- package/es/Approval/style/index.css +1 -0
- package/es/AutoComplete/style/index.css +1 -0
- package/es/Avatar/style/index.css +1 -0
- package/es/Badge/style/index.css +1 -0
- package/es/Breadcrumb/style/index.css +1 -0
- package/es/Button/style/index.css +4 -1
- package/es/Button/style/variables.css +4 -1
- package/es/ButtonTags/style/index.css +1 -0
- package/es/Calendar/style/index.css +1 -0
- package/es/Card/style/index.css +1 -0
- package/es/CardTable/style/index.css +7 -9
- package/es/CardTable/style/variables.css +7 -9
- package/es/Carousel/style/index.css +1 -0
- package/es/Cascader/style/index.css +1 -0
- package/es/Col/style/index.css +1 -0
- package/es/Collapse/style/index.css +1 -0
- package/es/Comment/style/index.css +1 -0
- package/es/CustomTableOption/cardSort.js +21 -16
- package/es/CustomTableOption/columnsSort.js +16 -16
- package/es/CustomTableOption/filterSort.js +11 -11
- package/es/CustomTableOption/index.d.ts +1 -0
- package/es/CustomTableOption/index.js +45 -17
- package/es/CustomTableOption/locale/en_US.d.ts +19 -0
- package/es/CustomTableOption/locale/en_US.js +19 -0
- package/es/CustomTableOption/locale/zh_CN.d.ts +19 -0
- package/es/CustomTableOption/locale/zh_CN.js +19 -0
- package/es/CustomTableOption/style/index.css +5 -0
- package/es/CustomTableOption/style/variables.css +4 -0
- package/es/CustomerService/style/index.css +1 -0
- package/es/DatePicker/style/index.css +1 -0
- package/es/Descriptions/style/index.css +1 -0
- package/es/Divider/style/index.css +1 -0
- package/es/Drawer/style/index.css +1 -0
- package/es/Dropdown/style/index.css +3 -2
- package/es/Dropdown/style/variables.css +2 -2
- package/es/EditTable/style/index.css +1 -0
- package/es/Empty/style/index.css +1 -0
- package/es/Filter/style/index.css +1 -0
- package/es/Form/style/index.css +1 -0
- package/es/FullScreen/style/index.css +1 -0
- package/es/Grid/style/index.css +1 -0
- package/es/Icon/style/index.css +1 -0
- package/es/Image/style/index.css +1 -0
- package/es/Input/style/index.css +1 -0
- package/es/InputNumber/style/index.css +1 -0
- package/es/Layout/style/index.css +1 -0
- package/es/LeftTable/index.js +3 -1
- package/es/LeftTable/style/index.css +1 -0
- package/es/List/style/index.css +1 -0
- package/es/LmEditTable/EditTable.js +39 -88
- package/es/LmEditTable/style/index.css +5 -0
- package/es/LmEditTable/style/variables.css +4 -0
- package/es/LmEditTable/util.d.ts +1 -0
- package/es/LmEditTable/util.js +27 -0
- package/es/LmSelect/style/index.css +1 -0
- package/es/LmTable/style/index.css +1 -0
- package/es/Locale/default.d.ts +4 -1
- package/es/Locale/default.js +3 -1
- package/es/Locale/zh_CN.d.ts +4 -1
- package/es/Locale/zh_CN.js +3 -1
- package/es/Mentions/style/index.css +1 -0
- package/es/Menu/style/index.css +1 -0
- package/es/Modal/index.js +18 -14
- package/es/Modal/locale.d.ts +7 -0
- package/es/Modal/locale.js +12 -0
- package/es/Modal/style/index.css +1 -0
- package/es/PageHeader/style/index.css +1 -0
- package/es/Pagination/style/index.css +1 -0
- package/es/Popconfirm/style/index.css +1 -0
- package/es/Popover/style/index.css +1 -0
- package/es/Progress/style/index.css +1 -0
- package/es/QuickMenu/style/index.css +6 -0
- package/es/QuickMenu/style/variables.css +5 -0
- package/es/Rate/style/index.css +1 -0
- package/es/Result/style/index.css +1 -0
- package/es/Row/style/index.css +1 -0
- package/es/Segmented/style/index.css +1 -0
- package/es/Select/style/index.css +1 -0
- package/es/Skeleton/style/index.css +1 -0
- package/es/Slider/style/index.css +1 -0
- package/es/Space/style/index.css +1 -0
- package/es/Spin/style/index.css +1 -0
- package/es/Statistic/style/index.css +1 -0
- package/es/Steps/style/index.css +1 -0
- package/es/Switch/style/index.css +1 -0
- package/es/Table/style/index.css +1 -0
- package/es/Tabs/style/index.css +1 -0
- package/es/Tag/style/index.css +1 -0
- package/es/TimePicker/style/index.css +1 -0
- package/es/Timeline/style/index.css +1 -0
- package/es/Tooltip/style/index.css +1 -0
- package/es/Transfer/style/index.css +1 -0
- package/es/Tree/style/index.css +1 -0
- package/es/TreeSelect/style/index.css +1 -0
- package/es/Typography/style/index.css +1 -0
- package/es/Upload/style/index.css +1 -0
- package/es/locale-provider/style/index.css +1 -0
- package/es/message/style/index.css +1 -0
- package/es/notification/style/index.css +1 -0
- package/es/styles/main.css +1 -0
- package/es/styles/variables.css +27 -12
- package/lib/Affix/style/index.css +1 -0
- package/lib/Alert/style/index.css +1 -0
- package/lib/Approval/style/index.css +1 -0
- package/lib/AutoComplete/style/index.css +1 -0
- package/lib/Avatar/style/index.css +1 -0
- package/lib/Badge/style/index.css +1 -0
- package/lib/Breadcrumb/style/index.css +1 -0
- package/lib/Button/style/index.css +4 -1
- package/lib/Button/style/variables.css +4 -1
- package/lib/ButtonTags/style/index.css +1 -0
- package/lib/Calendar/style/index.css +1 -0
- package/lib/Card/style/index.css +1 -0
- package/lib/CardTable/style/index.css +7 -9
- package/lib/CardTable/style/variables.css +7 -9
- package/lib/Carousel/style/index.css +1 -0
- package/lib/Cascader/style/index.css +1 -0
- package/lib/Col/style/index.css +1 -0
- package/lib/Collapse/style/index.css +1 -0
- package/lib/Comment/style/index.css +1 -0
- package/lib/CustomTableOption/cardSort.js +20 -15
- package/lib/CustomTableOption/columnsSort.js +16 -16
- package/lib/CustomTableOption/filterSort.js +11 -11
- package/lib/CustomTableOption/index.d.ts +1 -0
- package/lib/CustomTableOption/index.js +45 -16
- package/lib/CustomTableOption/locale/en_US.d.ts +19 -0
- package/lib/CustomTableOption/locale/en_US.js +26 -0
- package/lib/CustomTableOption/locale/zh_CN.d.ts +19 -0
- package/lib/CustomTableOption/locale/zh_CN.js +26 -0
- package/lib/CustomTableOption/style/index.css +5 -0
- package/lib/CustomTableOption/style/variables.css +4 -0
- package/lib/CustomerService/style/index.css +1 -0
- package/lib/DatePicker/style/index.css +1 -0
- package/lib/Descriptions/style/index.css +1 -0
- package/lib/Divider/style/index.css +1 -0
- package/lib/Drawer/style/index.css +1 -0
- package/lib/Dropdown/style/index.css +3 -2
- package/lib/Dropdown/style/variables.css +2 -2
- package/lib/EditTable/style/index.css +1 -0
- package/lib/Empty/style/index.css +1 -0
- package/lib/Filter/style/index.css +1 -0
- package/lib/Form/style/index.css +1 -0
- package/lib/FullScreen/style/index.css +1 -0
- package/lib/Grid/style/index.css +1 -0
- package/lib/Icon/style/index.css +1 -0
- package/lib/Image/style/index.css +1 -0
- package/lib/Input/style/index.css +1 -0
- package/lib/InputNumber/style/index.css +1 -0
- package/lib/Layout/style/index.css +1 -0
- package/lib/LeftTable/index.js +3 -1
- package/lib/LeftTable/style/index.css +1 -0
- package/lib/List/style/index.css +1 -0
- package/lib/LmEditTable/EditTable.js +39 -87
- package/lib/LmEditTable/style/index.css +5 -0
- package/lib/LmEditTable/style/variables.css +4 -0
- package/lib/LmEditTable/util.d.ts +1 -0
- package/lib/LmEditTable/util.js +30 -0
- package/lib/LmSelect/style/index.css +1 -0
- package/lib/LmTable/style/index.css +1 -0
- package/lib/Locale/default.d.ts +4 -1
- package/lib/Locale/default.js +4 -1
- package/lib/Locale/zh_CN.d.ts +4 -1
- package/lib/Locale/zh_CN.js +4 -1
- package/lib/Mentions/style/index.css +1 -0
- package/lib/Menu/style/index.css +1 -0
- package/lib/Modal/index.js +22 -14
- package/lib/Modal/locale.d.ts +7 -0
- package/lib/Modal/locale.js +25 -0
- package/lib/Modal/style/index.css +1 -0
- package/lib/PageHeader/style/index.css +1 -0
- package/lib/Pagination/style/index.css +1 -0
- package/lib/Popconfirm/style/index.css +1 -0
- package/lib/Popover/style/index.css +1 -0
- package/lib/Progress/style/index.css +1 -0
- package/lib/QuickMenu/style/index.css +6 -0
- package/lib/QuickMenu/style/variables.css +5 -0
- package/lib/Rate/style/index.css +1 -0
- package/lib/Result/style/index.css +1 -0
- package/lib/Row/style/index.css +1 -0
- package/lib/Segmented/style/index.css +1 -0
- package/lib/Select/style/index.css +1 -0
- package/lib/Skeleton/style/index.css +1 -0
- package/lib/Slider/style/index.css +1 -0
- package/lib/Space/style/index.css +1 -0
- package/lib/Spin/style/index.css +1 -0
- package/lib/Statistic/style/index.css +1 -0
- package/lib/Steps/style/index.css +1 -0
- package/lib/Switch/style/index.css +1 -0
- package/lib/Table/style/index.css +1 -0
- package/lib/Tabs/style/index.css +1 -0
- package/lib/Tag/style/index.css +1 -0
- package/lib/TimePicker/style/index.css +1 -0
- package/lib/Timeline/style/index.css +1 -0
- package/lib/Tooltip/style/index.css +1 -0
- package/lib/Transfer/style/index.css +1 -0
- package/lib/Tree/style/index.css +1 -0
- package/lib/TreeSelect/style/index.css +1 -0
- package/lib/Typography/style/index.css +1 -0
- package/lib/Upload/style/index.css +1 -0
- package/lib/locale-provider/style/index.css +1 -0
- package/lib/message/style/index.css +1 -0
- package/lib/notification/style/index.css +1 -0
- package/lib/styles/main.css +1 -0
- package/lib/styles/variables.css +27 -12
- package/package.json +1 -1
package/lib/Grid/style/index.css
CHANGED
package/lib/Icon/style/index.css
CHANGED
package/lib/LeftTable/index.js
CHANGED
|
@@ -160,7 +160,9 @@ var LeftSide = function LeftSide(props) {
|
|
|
160
160
|
className: useToggle ? "lm_grid_tree ".concat(modeTypeCls) : "lm_grid_tree grid_toggle ".concat(modeTypeCls)
|
|
161
161
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
162
162
|
className: "grid_tree_title",
|
|
163
|
-
onClick:
|
|
163
|
+
onClick: function onClick(e) {
|
|
164
|
+
onHeaderClick && onHeaderClick(e);
|
|
165
|
+
}
|
|
164
166
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
165
167
|
className: "grid_tree_title_left"
|
|
166
168
|
}, /*#__PURE__*/_react.default.createElement("span", null, useTree.title)), treeType && /*#__PURE__*/_react.default.createElement(_Popover.default, {
|
package/lib/List/style/index.css
CHANGED
|
@@ -29,6 +29,8 @@ var _lodash = require("lodash");
|
|
|
29
29
|
|
|
30
30
|
var _react = _interopRequireWildcard(require("react"));
|
|
31
31
|
|
|
32
|
+
var _ahooks = require("ahooks");
|
|
33
|
+
|
|
32
34
|
var _immer = require("immer");
|
|
33
35
|
|
|
34
36
|
var _DndContainer = _interopRequireDefault(require("./DndContainer"));
|
|
@@ -273,7 +275,8 @@ var Opetate = function Opetate(_ref) {
|
|
|
273
275
|
style: {
|
|
274
276
|
display: 'flex',
|
|
275
277
|
alignItems: 'center',
|
|
276
|
-
justifyContent: '
|
|
278
|
+
justifyContent: 'flex-start',
|
|
279
|
+
marginLeft: '-4px'
|
|
277
280
|
}
|
|
278
281
|
}, options.includes('delete') && /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
279
282
|
type: "link",
|
|
@@ -715,35 +718,39 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
715
718
|
recordCreatorProps = props.recordCreatorProps,
|
|
716
719
|
_props$shouldUpdate = props.shouldUpdate,
|
|
717
720
|
shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
|
|
718
|
-
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"]);
|
|
721
|
+
resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"]); // const [dataSource, setDataSource] = useState([]);
|
|
719
722
|
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
723
|
+
|
|
724
|
+
var _useControllableValue = (0, _ahooks.useControllableValue)({
|
|
725
|
+
value: (0, _util.checkRowKeyByDataSource)(props.value, _rowKey),
|
|
726
|
+
onChange: props.onChange
|
|
727
|
+
}),
|
|
728
|
+
_useControllableValue2 = (0, _slicedToArray2.default)(_useControllableValue, 2),
|
|
729
|
+
dataSource = _useControllableValue2[0],
|
|
730
|
+
setDataSource = _useControllableValue2[1]; // const [count, setCount] = useState(0);
|
|
724
731
|
|
|
725
732
|
|
|
726
|
-
var
|
|
733
|
+
var _useState5 = (0, _react.useState)({}),
|
|
734
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
735
|
+
_valid = _useState6[0],
|
|
736
|
+
setValid = _useState6[1];
|
|
737
|
+
|
|
738
|
+
var _useState7 = (0, _react.useState)([]),
|
|
727
739
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
728
|
-
|
|
729
|
-
|
|
740
|
+
localRowSelectList = _useState8[0],
|
|
741
|
+
setLocalRowSelectList = _useState8[1];
|
|
730
742
|
|
|
731
743
|
var _useState9 = (0, _react.useState)([]),
|
|
732
744
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
var _useState11 = (0, _react.useState)([]),
|
|
737
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
738
|
-
sortEditTable = _useState12[0],
|
|
739
|
-
setCallBackFalg = _useState12[1];
|
|
745
|
+
sortEditTable = _useState10[0],
|
|
746
|
+
setCallBackFalg = _useState10[1];
|
|
740
747
|
/** 当前展开的列 */
|
|
741
748
|
|
|
742
749
|
|
|
743
|
-
var
|
|
744
|
-
|
|
745
|
-
expandedRowKeys =
|
|
746
|
-
setExpandedRowKeys =
|
|
750
|
+
var _useState11 = (0, _react.useState)([]),
|
|
751
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
752
|
+
expandedRowKeys = _useState12[0],
|
|
753
|
+
setExpandedRowKeys = _useState12[1];
|
|
747
754
|
|
|
748
755
|
var dataSourceRef = (0, _react.useRef)([]);
|
|
749
756
|
var sortDataSorceRef = (0, _react.useRef)([]);
|
|
@@ -757,12 +764,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
757
764
|
var newIndex = cloneArr.findIndex(function (v) {
|
|
758
765
|
return v[_rowKey] === over;
|
|
759
766
|
});
|
|
760
|
-
|
|
761
|
-
if (onChange) {
|
|
762
|
-
onChange === null || onChange === void 0 ? void 0 : onChange((0, _sortable.arrayMove)(cloneArr, oldIndex, newIndex));
|
|
763
|
-
} else {
|
|
764
|
-
setDataSource((0, _sortable.arrayMove)(cloneArr, oldIndex, newIndex));
|
|
765
|
-
}
|
|
767
|
+
setDataSource((0, _sortable.arrayMove)(cloneArr, oldIndex, newIndex));
|
|
766
768
|
};
|
|
767
769
|
|
|
768
770
|
var onColSortEnd = function onColSortEnd(active, over) {
|
|
@@ -785,8 +787,9 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
785
787
|
var handleDelete = function handleDelete(key) {
|
|
786
788
|
var nValue = dataSource.filter(function (item) {
|
|
787
789
|
return item[_rowKey] !== key;
|
|
788
|
-
});
|
|
789
|
-
|
|
790
|
+
}); // onChange?.(nValue)
|
|
791
|
+
|
|
792
|
+
setDataSource(nValue);
|
|
790
793
|
};
|
|
791
794
|
/** 点击添加按钮添加 */
|
|
792
795
|
|
|
@@ -798,14 +801,14 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
798
801
|
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
799
802
|
draft.push(Object.assign((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
800
803
|
});
|
|
801
|
-
setDataSource(res);
|
|
802
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
804
|
+
setDataSource(res); // onChange?.(res)
|
|
803
805
|
};
|
|
804
806
|
|
|
805
807
|
(0, _react.useEffect)(function () {
|
|
806
808
|
var _a;
|
|
807
809
|
|
|
808
810
|
dataSourceRef.current = dataSource;
|
|
811
|
+
deepDataSourceRef.current = (0, _util.deepDataSourcePreKeys)(dataSource, _rowKey);
|
|
809
812
|
|
|
810
813
|
if (sortOpen) {
|
|
811
814
|
var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
@@ -910,12 +913,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
910
913
|
}
|
|
911
914
|
}
|
|
912
915
|
});
|
|
913
|
-
|
|
914
|
-
if (onChange) {
|
|
915
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
916
|
-
} else {
|
|
917
|
-
setDataSource(res);
|
|
918
|
-
}
|
|
916
|
+
setDataSource(res);
|
|
919
917
|
};
|
|
920
918
|
|
|
921
919
|
var reWriteOriginSource = function reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue) {
|
|
@@ -956,12 +954,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
956
954
|
};
|
|
957
955
|
|
|
958
956
|
var res = filter(dataSource, key);
|
|
959
|
-
|
|
960
|
-
if (onChange) {
|
|
961
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
962
|
-
} else {
|
|
963
|
-
setDataSource(res);
|
|
964
|
-
}
|
|
957
|
+
setDataSource(res);
|
|
965
958
|
} else {
|
|
966
959
|
if (((_c = dataSourceRef.current) === null || _c === void 0 ? void 0 : _c.length) === 1 && !quickOpetateClearAll) {
|
|
967
960
|
return false;
|
|
@@ -977,11 +970,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
977
970
|
}
|
|
978
971
|
});
|
|
979
972
|
|
|
980
|
-
|
|
981
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_res);
|
|
982
|
-
} else {
|
|
983
|
-
setDataSource(_res);
|
|
984
|
-
}
|
|
973
|
+
setDataSource(_res);
|
|
985
974
|
}
|
|
986
975
|
};
|
|
987
976
|
/** 快捷添加 */
|
|
@@ -1016,12 +1005,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1016
1005
|
}
|
|
1017
1006
|
}
|
|
1018
1007
|
});
|
|
1019
|
-
|
|
1020
|
-
if (onChange) {
|
|
1021
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
1022
|
-
} else {
|
|
1023
|
-
setDataSource(res);
|
|
1024
|
-
}
|
|
1008
|
+
setDataSource(res);
|
|
1025
1009
|
};
|
|
1026
1010
|
|
|
1027
1011
|
var handleCopy = function handleCopy(key, value) {
|
|
@@ -1030,12 +1014,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1030
1014
|
return item[key] = value;
|
|
1031
1015
|
});
|
|
1032
1016
|
});
|
|
1033
|
-
|
|
1034
|
-
if (onChange) {
|
|
1035
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
1036
|
-
} else {
|
|
1037
|
-
setDataSource(res);
|
|
1038
|
-
}
|
|
1017
|
+
setDataSource(res);
|
|
1039
1018
|
};
|
|
1040
1019
|
/** 判断columne中有没有带optionOnly参数 */
|
|
1041
1020
|
|
|
@@ -1108,6 +1087,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1108
1087
|
width: 68,
|
|
1109
1088
|
fixed: 'right',
|
|
1110
1089
|
editable: 'lm_edit_opetate',
|
|
1090
|
+
className: 'lm_edit_opetate',
|
|
1111
1091
|
componentProps: {
|
|
1112
1092
|
options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
|
|
1113
1093
|
}
|
|
@@ -1255,34 +1235,6 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1255
1235
|
components: component
|
|
1256
1236
|
}, resetProps);
|
|
1257
1237
|
}, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
|
|
1258
|
-
(0, _react.useEffect)(function () {
|
|
1259
|
-
// setDataSource(defaultData?.map((v, idx) => ({ ...v, [rowKey]: v[rowKey] || `v${idx + 1}` })))
|
|
1260
|
-
var addRowKey = function addRowKey(children, pkey) {
|
|
1261
|
-
return children === null || children === void 0 ? void 0 : children.map(function (item, index) {
|
|
1262
|
-
if (item.children) {
|
|
1263
|
-
var _Object$assign5;
|
|
1264
|
-
|
|
1265
|
-
var rchildren = addRowKey(item.children, "".concat(pkey, "_").concat(index + 1));
|
|
1266
|
-
return Object.assign(Object.assign({}, item), (_Object$assign5 = {}, (0, _defineProperty2.default)(_Object$assign5, _rowKey, item[_rowKey] || "".concat(pkey, "_").concat(index + 1)), (0, _defineProperty2.default)(_Object$assign5, "children", rchildren), _Object$assign5));
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
return Object.assign(Object.assign({}, item), (0, _defineProperty2.default)({}, _rowKey, item[_rowKey] || "".concat(pkey, "_").concat(index + 1)));
|
|
1270
|
-
});
|
|
1271
|
-
};
|
|
1272
|
-
|
|
1273
|
-
var res = defaultData === null || defaultData === void 0 ? void 0 : defaultData.map(function (v, idx) {
|
|
1274
|
-
if (v.children) {
|
|
1275
|
-
var _Object$assign7;
|
|
1276
|
-
|
|
1277
|
-
var rchildren = addRowKey(v.children, v[_rowKey] || "v".concat(idx + 1));
|
|
1278
|
-
return Object.assign(Object.assign({}, v), (_Object$assign7 = {}, (0, _defineProperty2.default)(_Object$assign7, _rowKey, v[_rowKey] || "v".concat(idx + 1)), (0, _defineProperty2.default)(_Object$assign7, "children", rchildren), _Object$assign7));
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
return Object.assign(Object.assign({}, v), (0, _defineProperty2.default)({}, _rowKey, v[_rowKey] || "v".concat(idx + 1)));
|
|
1282
|
-
});
|
|
1283
|
-
deepDataSourceRef.current = (0, _util.deepDataSourcePreKeys)(res, _rowKey);
|
|
1284
|
-
setDataSource(res);
|
|
1285
|
-
}, [defaultData]);
|
|
1286
1238
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
1287
1239
|
return {
|
|
1288
1240
|
setRow: handleSave,
|
|
@@ -198,6 +198,7 @@
|
|
|
198
198
|
--font-size-base: 14px;
|
|
199
199
|
--font-size-lg: calc(var(--font-size-base) + 2px);
|
|
200
200
|
--font-size-sm: 12px;
|
|
201
|
+
--border-radius: 2px;
|
|
201
202
|
--color-contrast: #fff;
|
|
202
203
|
--color-100: #000;
|
|
203
204
|
--color-85: #262626;
|
|
@@ -579,6 +580,10 @@ p {
|
|
|
579
580
|
.lm_editTable_warpper .ant-table .ant-table-tbody > .ant-table-measure-row > td {
|
|
580
581
|
padding: 0 !important;
|
|
581
582
|
}
|
|
583
|
+
.lm_editTable_warpper .lm_edit_opetate {
|
|
584
|
+
padding-left: 8px;
|
|
585
|
+
padding-right: 8px;
|
|
586
|
+
}
|
|
582
587
|
.lm_editTable_warpper .ant-picker {
|
|
583
588
|
height: 24px !important;
|
|
584
589
|
padding: 2px 8px;
|
|
@@ -68,6 +68,10 @@
|
|
|
68
68
|
.lm_editTable_warpper .ant-table .ant-table-tbody > .ant-table-measure-row > td {
|
|
69
69
|
padding: 0 !important;
|
|
70
70
|
}
|
|
71
|
+
.lm_editTable_warpper .lm_edit_opetate {
|
|
72
|
+
padding-left: 8px;
|
|
73
|
+
padding-right: 8px;
|
|
74
|
+
}
|
|
71
75
|
.lm_editTable_warpper .ant-picker {
|
|
72
76
|
height: 24px !important;
|
|
73
77
|
padding: 2px 8px;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function isObjEmpty(obj: Record<string, any>): boolean;
|
|
2
2
|
export declare function deepDataSourcePreKeys(dataSource: any[], rowKey: string): any;
|
|
3
3
|
export declare function isExpandRow(children: any): boolean;
|
|
4
|
+
export declare function checkRowKeyByDataSource(dataSource: any, rowKey: any): any;
|
|
4
5
|
declare const _default: {
|
|
5
6
|
isObjEmpty: typeof isObjEmpty;
|
|
6
7
|
};
|
package/lib/LmEditTable/util.js
CHANGED
|
@@ -5,11 +5,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.checkRowKeyByDataSource = checkRowKeyByDataSource;
|
|
8
9
|
exports.deepDataSourcePreKeys = deepDataSourcePreKeys;
|
|
9
10
|
exports.default = void 0;
|
|
10
11
|
exports.isExpandRow = isExpandRow;
|
|
11
12
|
exports.isObjEmpty = isObjEmpty;
|
|
12
13
|
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
13
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
14
17
|
|
|
15
18
|
var _lodash = require("lodash");
|
|
@@ -45,6 +48,33 @@ function isExpandRow(children) {
|
|
|
45
48
|
return ['Collapse row', 'Expand row'].includes((_e = (_d = (_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[0]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c[1]) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e['aria-label']);
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
function checkRowKeyByDataSource(dataSource, rowKey) {
|
|
52
|
+
var addRowKey = function addRowKey(children, pkey) {
|
|
53
|
+
return children === null || children === void 0 ? void 0 : children.map(function (item, index) {
|
|
54
|
+
if (item.children) {
|
|
55
|
+
var _Object$assign;
|
|
56
|
+
|
|
57
|
+
var rchildren = addRowKey(item.children, "".concat(pkey, "_").concat(index + 1));
|
|
58
|
+
return Object.assign(Object.assign({}, item), (_Object$assign = {}, (0, _defineProperty2.default)(_Object$assign, rowKey, item[rowKey] || "".concat(pkey, "_").concat(index + 1)), (0, _defineProperty2.default)(_Object$assign, "children", rchildren), _Object$assign));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return Object.assign(Object.assign({}, item), (0, _defineProperty2.default)({}, rowKey, item[rowKey] || "".concat(pkey, "_").concat(index + 1)));
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var res = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (v, idx) {
|
|
66
|
+
if (v.children) {
|
|
67
|
+
var _Object$assign3;
|
|
68
|
+
|
|
69
|
+
var rchildren = addRowKey(v.children, v[rowKey] || "v".concat(idx + 1));
|
|
70
|
+
return Object.assign(Object.assign({}, v), (_Object$assign3 = {}, (0, _defineProperty2.default)(_Object$assign3, rowKey, v[rowKey] || "v".concat(idx + 1)), (0, _defineProperty2.default)(_Object$assign3, "children", rchildren), _Object$assign3));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return Object.assign(Object.assign({}, v), (0, _defineProperty2.default)({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
|
|
74
|
+
});
|
|
75
|
+
return res;
|
|
76
|
+
}
|
|
77
|
+
|
|
48
78
|
var _default = {
|
|
49
79
|
isObjEmpty: isObjEmpty
|
|
50
80
|
};
|
package/lib/Locale/default.d.ts
CHANGED
package/lib/Locale/default.js
CHANGED
|
@@ -15,6 +15,8 @@ var _en_US3 = _interopRequireDefault(require("antd/es/date-picker/locale/en_US")
|
|
|
15
15
|
|
|
16
16
|
var _en_US4 = _interopRequireDefault(require("antd/es/time-picker/locale/en_US"));
|
|
17
17
|
|
|
18
|
+
var _en_US5 = _interopRequireDefault(require("../CustomTableOption/locale/en_US"));
|
|
19
|
+
|
|
18
20
|
/* eslint-disable no-template-curly-in-string */
|
|
19
21
|
var typeTemplate = '${label} is not a valid ${type}';
|
|
20
22
|
var localeValues = {
|
|
@@ -140,7 +142,8 @@ var localeValues = {
|
|
|
140
142
|
},
|
|
141
143
|
Image: {
|
|
142
144
|
preview: 'Preview'
|
|
143
|
-
}
|
|
145
|
+
},
|
|
146
|
+
CustomTableOption: _en_US5.default
|
|
144
147
|
};
|
|
145
148
|
var _default = localeValues;
|
|
146
149
|
exports.default = _default;
|
package/lib/Locale/zh_CN.d.ts
CHANGED
package/lib/Locale/zh_CN.js
CHANGED
|
@@ -15,6 +15,8 @@ var _zh_CN3 = _interopRequireDefault(require("antd/es/date-picker/locale/zh_CN")
|
|
|
15
15
|
|
|
16
16
|
var _zh_CN4 = _interopRequireDefault(require("antd/es/time-picker/locale/zh_CN"));
|
|
17
17
|
|
|
18
|
+
var _zh_CN5 = _interopRequireDefault(require("../CustomTableOption/locale/zh_CN"));
|
|
19
|
+
|
|
18
20
|
/* eslint-disable no-template-curly-in-string */
|
|
19
21
|
var typeTemplate = '${label}不是一个有效的${type}';
|
|
20
22
|
var localeValues = {
|
|
@@ -139,7 +141,8 @@ var localeValues = {
|
|
|
139
141
|
},
|
|
140
142
|
Image: {
|
|
141
143
|
preview: '预览'
|
|
142
|
-
}
|
|
144
|
+
},
|
|
145
|
+
CustomTableOption: _zh_CN5.default
|
|
143
146
|
};
|
|
144
147
|
var _default = localeValues;
|
|
145
148
|
exports.default = _default;
|
package/lib/Menu/style/index.css
CHANGED
package/lib/Modal/index.js
CHANGED
|
@@ -19,6 +19,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
19
19
|
|
|
20
20
|
var _SizeContext = _interopRequireDefault(require("../ConfigProvider/SizeContext"));
|
|
21
21
|
|
|
22
|
+
var _LocaleReceiver = _interopRequireDefault(require("../locale-provider/LocaleReceiver"));
|
|
23
|
+
|
|
24
|
+
var _locale = require("./locale");
|
|
25
|
+
|
|
22
26
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
23
27
|
var t = {};
|
|
24
28
|
|
|
@@ -40,34 +44,38 @@ var CLMModal = function CLMModal(props) {
|
|
|
40
44
|
size = _props$size === void 0 ? 'default' : _props$size,
|
|
41
45
|
onOk = props.onOk,
|
|
42
46
|
onCancel = props.onCancel,
|
|
43
|
-
_props$okText = props.okText,
|
|
44
|
-
okText = _props$okText === void 0 ? '确定' : _props$okText,
|
|
45
|
-
_props$cancelText = props.cancelText,
|
|
46
|
-
cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
|
|
47
47
|
visible = props.visible,
|
|
48
48
|
open = props.open,
|
|
49
|
-
other = __rest(props, ["wrapClassName", "size", "onOk", "onCancel", "
|
|
49
|
+
other = __rest(props, ["wrapClassName", "size", "onOk", "onCancel", "visible", "open"]);
|
|
50
50
|
|
|
51
51
|
var defaultFooterSize = _react.default.useContext(_SizeContext.default) || 'middle';
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
|
|
53
|
+
var defaultFooter = /*#__PURE__*/_react.default.createElement(_LocaleReceiver.default, {
|
|
54
|
+
componentName: "Modal",
|
|
55
|
+
defaultLocale: (0, _locale.getConfirmLocale)()
|
|
56
|
+
}, function (contextLocale) {
|
|
57
|
+
var okText = props.okText,
|
|
58
|
+
cancelText = props.cancelText;
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, Object.assign({
|
|
56
60
|
onClick: onCancel,
|
|
57
61
|
key: 'canncel_button',
|
|
58
62
|
size: defaultFooterSize
|
|
59
|
-
}, cancelText), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
63
|
+
}, props.cancelButtonProps), cancelText || contextLocale.cancelText), /*#__PURE__*/_react.default.createElement(_Button.default, Object.assign({
|
|
60
64
|
type: "primary",
|
|
61
65
|
onClick: onOk,
|
|
62
66
|
key: 'ok_button',
|
|
63
67
|
size: defaultFooterSize
|
|
64
|
-
}, okText)
|
|
68
|
+
}, props.okButtonProps), okText !== null && okText !== void 0 ? okText : contextLocale.okText));
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_modal.default, Object.assign({
|
|
72
|
+
wrapClassName: (0, _classnames.default)(wrapClassName, prefixCls),
|
|
73
|
+
width: size === 'default' ? 552 : 416,
|
|
74
|
+
footer: defaultFooter
|
|
65
75
|
}, other, {
|
|
66
76
|
onOk: onOk,
|
|
67
77
|
onCancel: onCancel,
|
|
68
|
-
|
|
69
|
-
visible: visible || open,
|
|
70
|
-
cancelText: cancelText
|
|
78
|
+
visible: visible || open
|
|
71
79
|
}));
|
|
72
80
|
};
|
|
73
81
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.changeConfirmLocale = changeConfirmLocale;
|
|
9
|
+
exports.getConfirmLocale = getConfirmLocale;
|
|
10
|
+
|
|
11
|
+
var _default = _interopRequireDefault(require("../Locale/default"));
|
|
12
|
+
|
|
13
|
+
var runtimeLocale = Object.assign({}, _default.default.Modal);
|
|
14
|
+
|
|
15
|
+
function changeConfirmLocale(newLocale) {
|
|
16
|
+
if (newLocale) {
|
|
17
|
+
runtimeLocale = Object.assign(Object.assign({}, runtimeLocale), newLocale);
|
|
18
|
+
} else {
|
|
19
|
+
runtimeLocale = Object.assign({}, _default.default.Modal);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getConfirmLocale() {
|
|
24
|
+
return runtimeLocale;
|
|
25
|
+
}
|