linkmore-design 1.1.22 → 1.1.24
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/CHANGELOG.md +73 -0
- package/dist/LmUpload/fns/index.d.ts +1 -0
- package/dist/QuickMenu/index.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.umd.js +76 -33
- package/dist/index.umd.min.js +3 -3
- package/dist/variables.css +6 -9
- package/es/LmEditTable/EditTable.js +29 -4
- package/es/LmFilter/style/index.css +6 -9
- package/es/LmFilter/style/variables.css +6 -9
- package/es/LmTable/Table.js +14 -8
- package/es/LmUpload/UploadList/index.js +3 -6
- package/es/LmUpload/fns/index.d.ts +1 -0
- package/es/LmUpload/fns/index.js +17 -2
- package/es/QuickMenu/index.d.ts +2 -1
- package/es/QuickMenu/index.js +11 -12
- package/es/TreeSelect/index.js +2 -1
- package/es/index.d.ts +1 -0
- package/es/styles/variables.css +6 -9
- package/lib/LmEditTable/EditTable.js +29 -4
- package/lib/LmFilter/style/index.css +6 -9
- package/lib/LmFilter/style/variables.css +6 -9
- package/lib/LmTable/Table.js +14 -8
- package/lib/LmUpload/UploadList/index.js +3 -6
- package/lib/LmUpload/fns/index.d.ts +1 -0
- package/lib/LmUpload/fns/index.js +17 -2
- package/lib/QuickMenu/index.d.ts +2 -1
- package/lib/QuickMenu/index.js +11 -12
- package/lib/TreeSelect/index.js +2 -1
- package/lib/index.d.ts +1 -0
- package/lib/styles/variables.css +6 -9
- package/package.json +1 -1
package/dist/variables.css
CHANGED
|
@@ -9939,15 +9939,6 @@ p {
|
|
|
9939
9939
|
}
|
|
9940
9940
|
.lm_filter_basic_item .filter_item_icon .icon_clear {
|
|
9941
9941
|
display: none;
|
|
9942
|
-
opacity: 0;
|
|
9943
|
-
}
|
|
9944
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_down {
|
|
9945
|
-
display: none;
|
|
9946
|
-
opacity: 0;
|
|
9947
|
-
}
|
|
9948
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_clear {
|
|
9949
|
-
display: inline-block;
|
|
9950
|
-
opacity: 1;
|
|
9951
9942
|
}
|
|
9952
9943
|
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
9953
9944
|
transform: rotateX(180deg);
|
|
@@ -9962,6 +9953,12 @@ p {
|
|
|
9962
9953
|
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_label {
|
|
9963
9954
|
color: var(--primary-color);
|
|
9964
9955
|
}
|
|
9956
|
+
.lm_filter_basic_item.active:hover .icon_down {
|
|
9957
|
+
display: none;
|
|
9958
|
+
}
|
|
9959
|
+
.lm_filter_basic_item.active:hover .icon_clear {
|
|
9960
|
+
display: inline-block;
|
|
9961
|
+
}
|
|
9965
9962
|
.ant-dropdown.filter_dropdown_container_cascader > div {
|
|
9966
9963
|
transform: translateY(-4px);
|
|
9967
9964
|
}
|
|
@@ -465,7 +465,17 @@ var EditableCell = function EditableCell(props) {
|
|
|
465
465
|
};
|
|
466
466
|
|
|
467
467
|
var Control = function Control(con) {
|
|
468
|
+
var _a; // const resultComponentProps = isFunction(componentProps) ? componentProps?.(record, col) : componentProps
|
|
469
|
+
|
|
470
|
+
|
|
468
471
|
var resultComponentProps = isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
472
|
+
|
|
473
|
+
if (isFunction(componentProps) && ((_a = col === null || col === void 0 ? void 0 : col.newOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
474
|
+
resultComponentProps = Object.assign(Object.assign({}, resultComponentProps), {
|
|
475
|
+
options: col === null || col === void 0 ? void 0 : col.newOptions
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
|
|
469
479
|
var clearAttrComponentProps = omit(resultComponentProps, ['optionOnly', 'isOnlyValue']);
|
|
470
480
|
|
|
471
481
|
switch (con) {
|
|
@@ -601,7 +611,8 @@ var EditableCell = function EditableCell(props) {
|
|
|
601
611
|
|
|
602
612
|
case 'render':
|
|
603
613
|
{
|
|
604
|
-
var
|
|
614
|
+
var _resultComponentProps = resultComponentProps,
|
|
615
|
+
render = _resultComponentProps.render;
|
|
605
616
|
var fromData = form.getFieldsValue();
|
|
606
617
|
return render === null || render === void 0 ? void 0 : render(Object.assign(Object.assign({}, !isObjEmpty(fromData) ? Object.assign(Object.assign({}, record), _defineProperty({}, dataIndex, fromData[dataIndex])) : record), {
|
|
607
618
|
onChange: save
|
|
@@ -1049,10 +1060,12 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1049
1060
|
|
|
1050
1061
|
|
|
1051
1062
|
var hasDisableOptions = useMemo(function () {
|
|
1063
|
+
// const hasOnlyOptionsDatas = columns.filter(item => item?.['componentProps']?.optionOnly)
|
|
1052
1064
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
1053
1065
|
var _a;
|
|
1054
1066
|
|
|
1055
|
-
|
|
1067
|
+
var resultComponentProps = isFunction(item === null || item === void 0 ? void 0 : item.componentProps) ? (_a = item === null || item === void 0 ? void 0 : item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
1068
|
+
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
1056
1069
|
});
|
|
1057
1070
|
|
|
1058
1071
|
if (hasOnlyOptionsDatas.length) {
|
|
@@ -1067,9 +1080,14 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1067
1080
|
|
|
1068
1081
|
var DisableOptions = useMemo(function () {
|
|
1069
1082
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
1070
|
-
var
|
|
1083
|
+
var _a;
|
|
1084
|
+
|
|
1085
|
+
var resultComponentProps = isFunction(item.componentProps) ? (_a = item === null || item === void 0 ? void 0 : item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
1086
|
+
|
|
1087
|
+
var _ref5 = resultComponentProps || {},
|
|
1071
1088
|
optionOnly = _ref5.optionOnly,
|
|
1072
|
-
options = _ref5.options;
|
|
1089
|
+
options = _ref5.options; // const { optionOnly, options } = item['componentProps'] || {}
|
|
1090
|
+
|
|
1073
1091
|
|
|
1074
1092
|
if (optionOnly && options) {
|
|
1075
1093
|
var dataIndex = item.dataIndex;
|
|
@@ -1081,6 +1099,13 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1081
1099
|
disabled: !!dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
|
|
1082
1100
|
});
|
|
1083
1101
|
});
|
|
1102
|
+
|
|
1103
|
+
if (isFunction(item.componentProps)) {
|
|
1104
|
+
return Object.assign(Object.assign({}, item), {
|
|
1105
|
+
newOptions: newOptions
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1084
1109
|
return Object.assign(Object.assign({}, item), {
|
|
1085
1110
|
componentProps: Object.assign(Object.assign({}, item['componentProps']), {
|
|
1086
1111
|
options: newOptions
|
|
@@ -110,15 +110,6 @@
|
|
|
110
110
|
}
|
|
111
111
|
.lm_filter_basic_item .filter_item_icon .icon_clear {
|
|
112
112
|
display: none;
|
|
113
|
-
opacity: 0;
|
|
114
|
-
}
|
|
115
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_down {
|
|
116
|
-
display: none;
|
|
117
|
-
opacity: 0;
|
|
118
|
-
}
|
|
119
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_clear {
|
|
120
|
-
display: inline-block;
|
|
121
|
-
opacity: 1;
|
|
122
113
|
}
|
|
123
114
|
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
124
115
|
transform: rotateX(180deg);
|
|
@@ -133,6 +124,12 @@
|
|
|
133
124
|
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_label {
|
|
134
125
|
color: var(--primary-color);
|
|
135
126
|
}
|
|
127
|
+
.lm_filter_basic_item.active:hover .icon_down {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
.lm_filter_basic_item.active:hover .icon_clear {
|
|
131
|
+
display: inline-block;
|
|
132
|
+
}
|
|
136
133
|
.ant-dropdown.filter_dropdown_container_cascader > div {
|
|
137
134
|
transform: translateY(-4px);
|
|
138
135
|
}
|
|
@@ -110,15 +110,6 @@
|
|
|
110
110
|
}
|
|
111
111
|
.lm_filter_basic_item .filter_item_icon .icon_clear {
|
|
112
112
|
display: none;
|
|
113
|
-
opacity: 0;
|
|
114
|
-
}
|
|
115
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_down {
|
|
116
|
-
display: none;
|
|
117
|
-
opacity: 0;
|
|
118
|
-
}
|
|
119
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_clear {
|
|
120
|
-
display: inline-block;
|
|
121
|
-
opacity: 1;
|
|
122
113
|
}
|
|
123
114
|
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
124
115
|
transform: rotateX(180deg);
|
|
@@ -133,6 +124,12 @@
|
|
|
133
124
|
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_label {
|
|
134
125
|
color: var(--primary-color);
|
|
135
126
|
}
|
|
127
|
+
.lm_filter_basic_item.active:hover .icon_down {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
.lm_filter_basic_item.active:hover .icon_clear {
|
|
131
|
+
display: inline-block;
|
|
132
|
+
}
|
|
136
133
|
.ant-dropdown.filter_dropdown_container_cascader > div {
|
|
137
134
|
transform: translateY(-4px);
|
|
138
135
|
}
|
package/es/LmTable/Table.js
CHANGED
|
@@ -1086,13 +1086,19 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1086
1086
|
var selectedRows = useSelectedRows.selectedRows;
|
|
1087
1087
|
|
|
1088
1088
|
if (tableRowType === 'select' || tableRowType === 'default' && selectedRows.length) {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
selectedRows
|
|
1095
|
-
|
|
1089
|
+
if ((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) === 'radio') {
|
|
1090
|
+
setSelectedRows({
|
|
1091
|
+
selectedRows: [(0, _lodash.isObject)(selectedRows[0]) || !selectedRows.length ? record : record[rowKey]]
|
|
1092
|
+
});
|
|
1093
|
+
} else {
|
|
1094
|
+
var selectIndex = selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.findIndex(function (v) {
|
|
1095
|
+
return (0, _lodash.isObject)(v) ? v[rowKey] === record[rowKey] : v === record[rowKey];
|
|
1096
|
+
});
|
|
1097
|
+
selectIndex >= 0 ? selectedRows.splice(selectIndex, 1) : selectedRows.push((0, _lodash.isObject)(selectedRows[0]) || !selectedRows.length ? record : record[rowKey]);
|
|
1098
|
+
setSelectedRows({
|
|
1099
|
+
selectedRows: (0, _lodash.cloneDeep)(selectedRows)
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1096
1102
|
}
|
|
1097
1103
|
} else {
|
|
1098
1104
|
rowClick === null || rowClick === void 0 ? void 0 : rowClick(record);
|
|
@@ -1176,7 +1182,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1176
1182
|
}); // rowClick?.(reulstSelect)
|
|
1177
1183
|
} : undefined,
|
|
1178
1184
|
onSelect: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) ? function (record, selected) {
|
|
1179
|
-
var reulstSelect = selected ? (0, _lodash.uniqBy)([].concat((0, _toConsumableArray2.default)(rowSelection.selectedRows), [record]), rowKey) : rowSelection.selectedRows.filter(function (item) {
|
|
1185
|
+
var reulstSelect = rowSelection.type === 'radio' ? [record] : selected ? (0, _lodash.uniqBy)([].concat((0, _toConsumableArray2.default)(rowSelection.selectedRows), [record]), rowKey) : rowSelection.selectedRows.filter(function (item) {
|
|
1180
1186
|
return item[rowKey] !== record[rowKey];
|
|
1181
1187
|
});
|
|
1182
1188
|
setSelectedRows({
|
|
@@ -6,14 +6,14 @@ import RenderItem from './RenderItem';
|
|
|
6
6
|
var LmUploadList = function LmUploadList(_ref) {
|
|
7
7
|
var instance = _ref.instance;
|
|
8
8
|
var uid = instance.uid,
|
|
9
|
-
dispatch = instance.dispatch,
|
|
10
9
|
getFileHasValue = instance.getFileHasValue,
|
|
11
10
|
getFileList = instance.getFileList,
|
|
12
11
|
itemRender = instance.itemRender,
|
|
13
12
|
listType = instance.listType,
|
|
14
13
|
showUploadList = instance.showUploadList,
|
|
15
14
|
enableDrag = instance.enableDrag,
|
|
16
|
-
fileNames = instance.fileNames
|
|
15
|
+
fileNames = instance.fileNames,
|
|
16
|
+
move = instance.move;
|
|
17
17
|
if (!showUploadList) return null;
|
|
18
18
|
var fileList = useMemo(function () {
|
|
19
19
|
var _a;
|
|
@@ -40,10 +40,7 @@ var LmUploadList = function LmUploadList(_ref) {
|
|
|
40
40
|
|
|
41
41
|
return v;
|
|
42
42
|
});
|
|
43
|
-
|
|
44
|
-
type: 'changeFileList',
|
|
45
|
-
fileList: fileMap
|
|
46
|
-
});
|
|
43
|
+
move(active, over, fileMap);
|
|
47
44
|
} catch (error) {
|
|
48
45
|
console.log('移动出现了错误', error);
|
|
49
46
|
}
|
|
@@ -15,6 +15,7 @@ declare const useCoreOptions: ({ state, dispatch, props }: {
|
|
|
15
15
|
remove: (file: any) => Promise<void>;
|
|
16
16
|
preview: (file: any) => void;
|
|
17
17
|
download: (file: any) => void;
|
|
18
|
+
move: (active: any, over: any, fileList: any) => void;
|
|
18
19
|
};
|
|
19
20
|
RefMethods: {
|
|
20
21
|
getState: () => any;
|
package/es/LmUpload/fns/index.js
CHANGED
|
@@ -471,7 +471,21 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
471
471
|
var _a;
|
|
472
472
|
|
|
473
473
|
(_a = props.onDownload) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
474
|
-
}, [props.onDownload]);
|
|
474
|
+
}, [props.onDownload]); // 拖拽移动事件
|
|
475
|
+
|
|
476
|
+
var move = useCallback(function (active, over, fileList) {
|
|
477
|
+
var _a;
|
|
478
|
+
|
|
479
|
+
(_a = props.onMove) === null || _a === void 0 ? void 0 : _a.call(props, active, over, fileList);
|
|
480
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
481
|
+
file: active,
|
|
482
|
+
fileList: fileList
|
|
483
|
+
});
|
|
484
|
+
dispatch({
|
|
485
|
+
type: 'changeFileList',
|
|
486
|
+
fileList: fileList
|
|
487
|
+
});
|
|
488
|
+
}, [props.onMove, onChange, dispatch]);
|
|
475
489
|
var CoreMethods = {
|
|
476
490
|
getIsMaxCount: getIsMaxCount,
|
|
477
491
|
getFileHasValue: getFileHasValue,
|
|
@@ -481,7 +495,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
481
495
|
getUploadStatus: getUploadStatus,
|
|
482
496
|
remove: remove,
|
|
483
497
|
preview: preview,
|
|
484
|
-
download: download
|
|
498
|
+
download: download,
|
|
499
|
+
move: move
|
|
485
500
|
};
|
|
486
501
|
var RefMethods = {
|
|
487
502
|
getState: function getState() {
|
package/es/QuickMenu/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface IMenuData {
|
|
2
|
+
export interface IMenuData {
|
|
3
3
|
menuId: string;
|
|
4
4
|
title: string | React.ReactNode;
|
|
5
5
|
hidden?: boolean;
|
|
@@ -10,6 +10,7 @@ export interface IQuickMenuProps {
|
|
|
10
10
|
top?: number;
|
|
11
11
|
menuData: IMenuData[];
|
|
12
12
|
warpElement: any;
|
|
13
|
+
root?: IntersectionObserver['root'] | undefined;
|
|
13
14
|
}
|
|
14
15
|
declare const LMQuickMenu: React.FC<IQuickMenuProps>;
|
|
15
16
|
export default LMQuickMenu;
|
package/es/QuickMenu/index.js
CHANGED
|
@@ -12,7 +12,8 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
12
12
|
top = _props$top === void 0 ? '104px' : _props$top,
|
|
13
13
|
_props$menuData = props.menuData,
|
|
14
14
|
menuData = _props$menuData === void 0 ? [] : _props$menuData,
|
|
15
|
-
warpElement = props.warpElement
|
|
15
|
+
warpElement = props.warpElement,
|
|
16
|
+
root = props.root;
|
|
16
17
|
var idTopInfo = useRef({});
|
|
17
18
|
|
|
18
19
|
var _useState = useState(false),
|
|
@@ -70,11 +71,13 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
70
71
|
var scrollama = require('scrollama');
|
|
71
72
|
|
|
72
73
|
menuTimeEventRef.current = scrollama();
|
|
74
|
+
console.log(getTargetElement(warpElement || document), '--getTargetElement(warpElement || document)');
|
|
73
75
|
(_c = (_b = menuTimeEventRef.current) === null || _b === void 0 ? void 0 : _b.setup({
|
|
74
76
|
step: filterMenuData.map(function (item) {
|
|
75
77
|
return document.getElementById("".concat(item.menuId));
|
|
76
78
|
}).filter(Boolean),
|
|
77
|
-
container: getTargetElement(warpElement || document)
|
|
79
|
+
container: getTargetElement(warpElement || document),
|
|
80
|
+
root: root ? getTargetElement(root) : undefined
|
|
78
81
|
})) === null || _c === void 0 ? void 0 : _c.onStepEnter(function (_ref) {
|
|
79
82
|
var element = _ref.element;
|
|
80
83
|
updateActiveToc(element.id);
|
|
@@ -106,12 +109,6 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
106
109
|
wait: 50
|
|
107
110
|
});
|
|
108
111
|
|
|
109
|
-
var bindDom = function bindDom() {
|
|
110
|
-
if (!Object.keys(idTopInfo.current).length) {
|
|
111
|
-
setKeysDom();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
112
|
var handleScroll = function handleScroll() {
|
|
116
113
|
setScrollOpenStatus(true);
|
|
117
114
|
};
|
|
@@ -126,10 +123,6 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
126
123
|
var _a; // bindScroller();
|
|
127
124
|
|
|
128
125
|
|
|
129
|
-
setTimeout(function () {
|
|
130
|
-
bindDom();
|
|
131
|
-
bindScroller();
|
|
132
|
-
}, 200);
|
|
133
126
|
(_a = getTargetElement(warpElement || document)) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', handleScroll, {
|
|
134
127
|
once: true
|
|
135
128
|
});
|
|
@@ -139,6 +132,12 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
139
132
|
(_a = getTargetElement(warpElement || document)) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', handleScroll);
|
|
140
133
|
};
|
|
141
134
|
}, []);
|
|
135
|
+
useEffect(function () {
|
|
136
|
+
setTimeout(function () {
|
|
137
|
+
setKeysDom();
|
|
138
|
+
bindScroller();
|
|
139
|
+
}, 200);
|
|
140
|
+
}, [filterMenuData]);
|
|
142
141
|
return /*#__PURE__*/React.createElement("div", {
|
|
143
142
|
className: classNames(prefixCls),
|
|
144
143
|
onMouseEnter: function onMouseEnter() {
|
package/es/TreeSelect/index.js
CHANGED
|
@@ -82,7 +82,8 @@ var CLMTreeSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
82
82
|
className: 'lm_tree_select',
|
|
83
83
|
value: resetValue,
|
|
84
84
|
size: mergeSize,
|
|
85
|
-
disabled: mergedDisabled
|
|
85
|
+
disabled: mergedDisabled,
|
|
86
|
+
treeData: treeData
|
|
86
87
|
}, resetProps), children);
|
|
87
88
|
});
|
|
88
89
|
var LMTreeSelect = CLMTreeSelect;
|
package/es/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export { default as LmEditTable } from './LmEditTable';
|
|
|
54
54
|
export type { CountdownHandle, TLmEditTable } from './LmEditTable/EditTable';
|
|
55
55
|
export { default as List } from './List';
|
|
56
56
|
export { default as LMQuickMenu } from './QuickMenu';
|
|
57
|
+
export type { IMenuData, IQuickMenuProps } from './QuickMenu';
|
|
57
58
|
export { default as DatePicker } from './DatePicker';
|
|
58
59
|
export type { DatePickerProps, MonthPickerProps, WeekPickerProps, RangePickerProps } from './DatePicker';
|
|
59
60
|
export { default as Popover } from './Popover';
|
package/es/styles/variables.css
CHANGED
|
@@ -9939,15 +9939,6 @@ p {
|
|
|
9939
9939
|
}
|
|
9940
9940
|
.lm_filter_basic_item .filter_item_icon .icon_clear {
|
|
9941
9941
|
display: none;
|
|
9942
|
-
opacity: 0;
|
|
9943
|
-
}
|
|
9944
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_down {
|
|
9945
|
-
display: none;
|
|
9946
|
-
opacity: 0;
|
|
9947
|
-
}
|
|
9948
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_clear {
|
|
9949
|
-
display: inline-block;
|
|
9950
|
-
opacity: 1;
|
|
9951
9942
|
}
|
|
9952
9943
|
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
9953
9944
|
transform: rotateX(180deg);
|
|
@@ -9962,6 +9953,12 @@ p {
|
|
|
9962
9953
|
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_label {
|
|
9963
9954
|
color: var(--primary-color);
|
|
9964
9955
|
}
|
|
9956
|
+
.lm_filter_basic_item.active:hover .icon_down {
|
|
9957
|
+
display: none;
|
|
9958
|
+
}
|
|
9959
|
+
.lm_filter_basic_item.active:hover .icon_clear {
|
|
9960
|
+
display: inline-block;
|
|
9961
|
+
}
|
|
9965
9962
|
.ant-dropdown.filter_dropdown_container_cascader > div {
|
|
9966
9963
|
transform: translateY(-4px);
|
|
9967
9964
|
}
|
|
@@ -498,7 +498,17 @@ var EditableCell = function EditableCell(props) {
|
|
|
498
498
|
};
|
|
499
499
|
|
|
500
500
|
var Control = function Control(con) {
|
|
501
|
+
var _a; // const resultComponentProps = isFunction(componentProps) ? componentProps?.(record, col) : componentProps
|
|
502
|
+
|
|
503
|
+
|
|
501
504
|
var resultComponentProps = (0, _lodash.isFunction)(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
|
|
505
|
+
|
|
506
|
+
if ((0, _lodash.isFunction)(componentProps) && ((_a = col === null || col === void 0 ? void 0 : col.newOptions) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
507
|
+
resultComponentProps = Object.assign(Object.assign({}, resultComponentProps), {
|
|
508
|
+
options: col === null || col === void 0 ? void 0 : col.newOptions
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
|
|
502
512
|
var clearAttrComponentProps = (0, _lodash.omit)(resultComponentProps, ['optionOnly', 'isOnlyValue']);
|
|
503
513
|
|
|
504
514
|
switch (con) {
|
|
@@ -634,7 +644,8 @@ var EditableCell = function EditableCell(props) {
|
|
|
634
644
|
|
|
635
645
|
case 'render':
|
|
636
646
|
{
|
|
637
|
-
var
|
|
647
|
+
var _resultComponentProps = resultComponentProps,
|
|
648
|
+
render = _resultComponentProps.render;
|
|
638
649
|
var fromData = form.getFieldsValue();
|
|
639
650
|
return render === null || render === void 0 ? void 0 : render(Object.assign(Object.assign({}, !(0, _util.isObjEmpty)(fromData) ? Object.assign(Object.assign({}, record), (0, _defineProperty2.default)({}, dataIndex, fromData[dataIndex])) : record), {
|
|
640
651
|
onChange: save
|
|
@@ -1081,10 +1092,12 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1081
1092
|
|
|
1082
1093
|
|
|
1083
1094
|
var hasDisableOptions = (0, _react.useMemo)(function () {
|
|
1095
|
+
// const hasOnlyOptionsDatas = columns.filter(item => item?.['componentProps']?.optionOnly)
|
|
1084
1096
|
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
1085
1097
|
var _a;
|
|
1086
1098
|
|
|
1087
|
-
|
|
1099
|
+
var resultComponentProps = (0, _lodash.isFunction)(item === null || item === void 0 ? void 0 : item.componentProps) ? (_a = item === null || item === void 0 ? void 0 : item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
1100
|
+
return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
|
|
1088
1101
|
});
|
|
1089
1102
|
|
|
1090
1103
|
if (hasOnlyOptionsDatas.length) {
|
|
@@ -1099,9 +1112,14 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1099
1112
|
|
|
1100
1113
|
var DisableOptions = (0, _react.useMemo)(function () {
|
|
1101
1114
|
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
1102
|
-
var
|
|
1115
|
+
var _a;
|
|
1116
|
+
|
|
1117
|
+
var resultComponentProps = (0, _lodash.isFunction)(item.componentProps) ? (_a = item === null || item === void 0 ? void 0 : item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
|
|
1118
|
+
|
|
1119
|
+
var _ref5 = resultComponentProps || {},
|
|
1103
1120
|
optionOnly = _ref5.optionOnly,
|
|
1104
|
-
options = _ref5.options;
|
|
1121
|
+
options = _ref5.options; // const { optionOnly, options } = item['componentProps'] || {}
|
|
1122
|
+
|
|
1105
1123
|
|
|
1106
1124
|
if (optionOnly && options) {
|
|
1107
1125
|
var dataIndex = item.dataIndex;
|
|
@@ -1113,6 +1131,13 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1113
1131
|
disabled: !!dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
|
|
1114
1132
|
});
|
|
1115
1133
|
});
|
|
1134
|
+
|
|
1135
|
+
if ((0, _lodash.isFunction)(item.componentProps)) {
|
|
1136
|
+
return Object.assign(Object.assign({}, item), {
|
|
1137
|
+
newOptions: newOptions
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1116
1141
|
return Object.assign(Object.assign({}, item), {
|
|
1117
1142
|
componentProps: Object.assign(Object.assign({}, item['componentProps']), {
|
|
1118
1143
|
options: newOptions
|
|
@@ -110,15 +110,6 @@
|
|
|
110
110
|
}
|
|
111
111
|
.lm_filter_basic_item .filter_item_icon .icon_clear {
|
|
112
112
|
display: none;
|
|
113
|
-
opacity: 0;
|
|
114
|
-
}
|
|
115
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_down {
|
|
116
|
-
display: none;
|
|
117
|
-
opacity: 0;
|
|
118
|
-
}
|
|
119
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_clear {
|
|
120
|
-
display: inline-block;
|
|
121
|
-
opacity: 1;
|
|
122
113
|
}
|
|
123
114
|
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
124
115
|
transform: rotateX(180deg);
|
|
@@ -133,6 +124,12 @@
|
|
|
133
124
|
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_label {
|
|
134
125
|
color: var(--primary-color);
|
|
135
126
|
}
|
|
127
|
+
.lm_filter_basic_item.active:hover .icon_down {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
.lm_filter_basic_item.active:hover .icon_clear {
|
|
131
|
+
display: inline-block;
|
|
132
|
+
}
|
|
136
133
|
.ant-dropdown.filter_dropdown_container_cascader > div {
|
|
137
134
|
transform: translateY(-4px);
|
|
138
135
|
}
|
|
@@ -110,15 +110,6 @@
|
|
|
110
110
|
}
|
|
111
111
|
.lm_filter_basic_item .filter_item_icon .icon_clear {
|
|
112
112
|
display: none;
|
|
113
|
-
opacity: 0;
|
|
114
|
-
}
|
|
115
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_down {
|
|
116
|
-
display: none;
|
|
117
|
-
opacity: 0;
|
|
118
|
-
}
|
|
119
|
-
.lm_filter_basic_item .filter_item_icon:hover .icon_clear {
|
|
120
|
-
display: inline-block;
|
|
121
|
-
opacity: 1;
|
|
122
113
|
}
|
|
123
114
|
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
124
115
|
transform: rotateX(180deg);
|
|
@@ -133,6 +124,12 @@
|
|
|
133
124
|
.lm_filter_basic_item.active.lm_filter_complex_item .filter_item_label {
|
|
134
125
|
color: var(--primary-color);
|
|
135
126
|
}
|
|
127
|
+
.lm_filter_basic_item.active:hover .icon_down {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
.lm_filter_basic_item.active:hover .icon_clear {
|
|
131
|
+
display: inline-block;
|
|
132
|
+
}
|
|
136
133
|
.ant-dropdown.filter_dropdown_container_cascader > div {
|
|
137
134
|
transform: translateY(-4px);
|
|
138
135
|
}
|
package/lib/LmTable/Table.js
CHANGED
|
@@ -1086,13 +1086,19 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1086
1086
|
var selectedRows = useSelectedRows.selectedRows;
|
|
1087
1087
|
|
|
1088
1088
|
if (tableRowType === 'select' || tableRowType === 'default' && selectedRows.length) {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
selectedRows
|
|
1095
|
-
|
|
1089
|
+
if ((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.type) === 'radio') {
|
|
1090
|
+
setSelectedRows({
|
|
1091
|
+
selectedRows: [(0, _lodash.isObject)(selectedRows[0]) || !selectedRows.length ? record : record[rowKey]]
|
|
1092
|
+
});
|
|
1093
|
+
} else {
|
|
1094
|
+
var selectIndex = selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.findIndex(function (v) {
|
|
1095
|
+
return (0, _lodash.isObject)(v) ? v[rowKey] === record[rowKey] : v === record[rowKey];
|
|
1096
|
+
});
|
|
1097
|
+
selectIndex >= 0 ? selectedRows.splice(selectIndex, 1) : selectedRows.push((0, _lodash.isObject)(selectedRows[0]) || !selectedRows.length ? record : record[rowKey]);
|
|
1098
|
+
setSelectedRows({
|
|
1099
|
+
selectedRows: (0, _lodash.cloneDeep)(selectedRows)
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1096
1102
|
}
|
|
1097
1103
|
} else {
|
|
1098
1104
|
rowClick === null || rowClick === void 0 ? void 0 : rowClick(record);
|
|
@@ -1176,7 +1182,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1176
1182
|
}); // rowClick?.(reulstSelect)
|
|
1177
1183
|
} : undefined,
|
|
1178
1184
|
onSelect: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) ? function (record, selected) {
|
|
1179
|
-
var reulstSelect = selected ? (0, _lodash.uniqBy)([].concat((0, _toConsumableArray2.default)(rowSelection.selectedRows), [record]), rowKey) : rowSelection.selectedRows.filter(function (item) {
|
|
1185
|
+
var reulstSelect = rowSelection.type === 'radio' ? [record] : selected ? (0, _lodash.uniqBy)([].concat((0, _toConsumableArray2.default)(rowSelection.selectedRows), [record]), rowKey) : rowSelection.selectedRows.filter(function (item) {
|
|
1180
1186
|
return item[rowKey] !== record[rowKey];
|
|
1181
1187
|
});
|
|
1182
1188
|
setSelectedRows({
|
|
@@ -20,14 +20,14 @@ var _RenderItem = _interopRequireDefault(require("./RenderItem"));
|
|
|
20
20
|
var LmUploadList = function LmUploadList(_ref) {
|
|
21
21
|
var instance = _ref.instance;
|
|
22
22
|
var uid = instance.uid,
|
|
23
|
-
dispatch = instance.dispatch,
|
|
24
23
|
getFileHasValue = instance.getFileHasValue,
|
|
25
24
|
getFileList = instance.getFileList,
|
|
26
25
|
itemRender = instance.itemRender,
|
|
27
26
|
listType = instance.listType,
|
|
28
27
|
showUploadList = instance.showUploadList,
|
|
29
28
|
enableDrag = instance.enableDrag,
|
|
30
|
-
fileNames = instance.fileNames
|
|
29
|
+
fileNames = instance.fileNames,
|
|
30
|
+
move = instance.move;
|
|
31
31
|
if (!showUploadList) return null;
|
|
32
32
|
var fileList = (0, _react.useMemo)(function () {
|
|
33
33
|
var _a;
|
|
@@ -54,10 +54,7 @@ var LmUploadList = function LmUploadList(_ref) {
|
|
|
54
54
|
|
|
55
55
|
return v;
|
|
56
56
|
});
|
|
57
|
-
|
|
58
|
-
type: 'changeFileList',
|
|
59
|
-
fileList: fileMap
|
|
60
|
-
});
|
|
57
|
+
move(active, over, fileMap);
|
|
61
58
|
} catch (error) {
|
|
62
59
|
console.log('移动出现了错误', error);
|
|
63
60
|
}
|
|
@@ -15,6 +15,7 @@ declare const useCoreOptions: ({ state, dispatch, props }: {
|
|
|
15
15
|
remove: (file: any) => Promise<void>;
|
|
16
16
|
preview: (file: any) => void;
|
|
17
17
|
download: (file: any) => void;
|
|
18
|
+
move: (active: any, over: any, fileList: any) => void;
|
|
18
19
|
};
|
|
19
20
|
RefMethods: {
|
|
20
21
|
getState: () => any;
|
|
@@ -484,7 +484,21 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
484
484
|
var _a;
|
|
485
485
|
|
|
486
486
|
(_a = props.onDownload) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
487
|
-
}, [props.onDownload]);
|
|
487
|
+
}, [props.onDownload]); // 拖拽移动事件
|
|
488
|
+
|
|
489
|
+
var move = (0, _react.useCallback)(function (active, over, fileList) {
|
|
490
|
+
var _a;
|
|
491
|
+
|
|
492
|
+
(_a = props.onMove) === null || _a === void 0 ? void 0 : _a.call(props, active, over, fileList);
|
|
493
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
494
|
+
file: active,
|
|
495
|
+
fileList: fileList
|
|
496
|
+
});
|
|
497
|
+
dispatch({
|
|
498
|
+
type: 'changeFileList',
|
|
499
|
+
fileList: fileList
|
|
500
|
+
});
|
|
501
|
+
}, [props.onMove, onChange, dispatch]);
|
|
488
502
|
var CoreMethods = {
|
|
489
503
|
getIsMaxCount: getIsMaxCount,
|
|
490
504
|
getFileHasValue: getFileHasValue,
|
|
@@ -494,7 +508,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
494
508
|
getUploadStatus: getUploadStatus,
|
|
495
509
|
remove: remove,
|
|
496
510
|
preview: preview,
|
|
497
|
-
download: download
|
|
511
|
+
download: download,
|
|
512
|
+
move: move
|
|
498
513
|
};
|
|
499
514
|
var RefMethods = {
|
|
500
515
|
getState: function getState() {
|
package/lib/QuickMenu/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface IMenuData {
|
|
2
|
+
export interface IMenuData {
|
|
3
3
|
menuId: string;
|
|
4
4
|
title: string | React.ReactNode;
|
|
5
5
|
hidden?: boolean;
|
|
@@ -10,6 +10,7 @@ export interface IQuickMenuProps {
|
|
|
10
10
|
top?: number;
|
|
11
11
|
menuData: IMenuData[];
|
|
12
12
|
warpElement: any;
|
|
13
|
+
root?: IntersectionObserver['root'] | undefined;
|
|
13
14
|
}
|
|
14
15
|
declare const LMQuickMenu: React.FC<IQuickMenuProps>;
|
|
15
16
|
export default LMQuickMenu;
|