linkmore-design 1.1.13-alpha.3 → 1.1.13-alpha.5
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/ghost.d.ts +2 -0
- package/dist/Descriptions/Cell.d.ts +1 -0
- package/dist/Descriptions/Item.d.ts +1 -0
- package/dist/Descriptions/index.d.ts +1 -1
- package/dist/LmDrag/LmDrag.d.ts +4 -0
- package/dist/LmDrag/components/DndContainer.d.ts +3 -0
- package/dist/LmDrag/components/sortableBox.d.ts +5 -0
- package/dist/LmDrag/components/sortableItem.d.ts +7 -0
- package/dist/LmDrag/demos/basic.d.ts +2 -0
- package/dist/LmDrag/index.d.ts +10 -0
- package/dist/LmDrag/style/index.d.ts +1 -0
- package/dist/LmDrag/style/variables.d.ts +1 -0
- package/dist/LmDrag/wrapper/Root.d.ts +3 -0
- package/dist/LmEditTable/EditTable.d.ts +15 -3
- package/dist/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/dist/LmUpload/fns/index.d.ts +1 -0
- package/dist/QuickMenu/demos/useInDraw.d.ts +2 -0
- package/dist/QuickMenu/index.d.ts +3 -1
- package/dist/Select/index.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.umd.js +757 -125
- package/dist/index.umd.min.js +9 -9
- package/dist/variables.css +76 -25
- package/es/Button/index.js +4 -3
- package/es/Button/style/index.css +28 -25
- package/es/Button/style/variables.css +28 -25
- package/es/Cascader/index.js +16 -2
- package/es/Descriptions/Cell.d.ts +1 -0
- package/es/Descriptions/Cell.js +5 -2
- package/es/Descriptions/Item.d.ts +1 -0
- package/es/Descriptions/Row.js +6 -1
- package/es/Descriptions/index.d.ts +1 -1
- package/es/Descriptions/index.js +3 -3
- package/es/Descriptions/style/index.css +3 -0
- package/es/Descriptions/style/variables.css +3 -0
- package/es/InputNumber/index.js +18 -13
- package/es/InputNumber/style/index.css +3 -0
- package/es/InputNumber/style/variables.css +3 -0
- package/es/LmDrag/LmDrag.d.ts +4 -0
- package/es/LmDrag/LmDrag.js +30 -0
- package/es/LmDrag/components/DndContainer.d.ts +3 -0
- package/es/LmDrag/components/DndContainer.js +121 -0
- package/es/LmDrag/components/sortableBox.d.ts +5 -0
- package/es/LmDrag/components/sortableBox.js +23 -0
- package/es/LmDrag/components/sortableItem.d.ts +7 -0
- package/es/LmDrag/components/sortableItem.js +41 -0
- package/es/LmDrag/index.d.ts +10 -0
- package/es/LmDrag/index.js +3 -0
- package/es/LmDrag/style/index.css +0 -0
- package/es/LmDrag/style/index.d.ts +1 -0
- package/es/LmDrag/style/index.js +1 -0
- package/es/LmDrag/style/variables.css +0 -0
- package/es/LmDrag/style/variables.d.ts +1 -0
- package/es/LmDrag/style/variables.js +1 -0
- package/es/LmDrag/wrapper/Root.d.ts +3 -0
- package/es/LmDrag/wrapper/Root.js +12 -0
- package/es/LmEditTable/EditTable.d.ts +15 -3
- package/es/LmEditTable/EditTable.js +88 -57
- package/es/LmEditTable/sortableItemCol.js +3 -1
- package/es/LmEditTable/util.js +1 -1
- package/es/LmFilter/components/DropdownFIlter.js +27 -6
- package/es/LmFilter/style/index.css +12 -0
- package/es/LmFilter/style/variables.css +12 -0
- package/es/LmUpload/LmUpload.js +2 -1
- package/es/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/es/LmUpload/UploadList/ItemPictureCard.js +4 -3
- package/es/LmUpload/UploadList/index.js +52 -2
- package/es/LmUpload/fns/index.d.ts +1 -0
- package/es/LmUpload/fns/index.js +19 -3
- package/es/QuickMenu/index.d.ts +3 -1
- package/es/QuickMenu/index.js +22 -19
- package/es/Select/index.d.ts +3 -0
- package/es/Select/index.js +28 -1
- package/es/Select/style/index.css +27 -0
- package/es/Select/style/variables.css +27 -0
- package/es/TreeSelect/index.js +16 -2
- package/es/TreeSelect/style/index.css +3 -0
- package/es/TreeSelect/style/variables.css +3 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -1
- package/es/styles/variables.css +76 -25
- package/lib/Button/index.js +4 -3
- package/lib/Button/style/index.css +28 -25
- package/lib/Button/style/variables.css +28 -25
- package/lib/Cascader/index.js +20 -2
- package/lib/Descriptions/Cell.d.ts +1 -0
- package/lib/Descriptions/Cell.js +5 -2
- package/lib/Descriptions/Item.d.ts +1 -0
- package/lib/Descriptions/Row.js +6 -1
- package/lib/Descriptions/index.d.ts +1 -1
- package/lib/Descriptions/index.js +3 -3
- package/lib/Descriptions/style/index.css +3 -0
- package/lib/Descriptions/style/variables.css +3 -0
- package/lib/InputNumber/index.js +22 -13
- package/lib/InputNumber/style/index.css +3 -0
- package/lib/InputNumber/style/variables.css +3 -0
- package/lib/LmDrag/LmDrag.d.ts +4 -0
- package/lib/LmDrag/LmDrag.js +44 -0
- package/lib/LmDrag/components/DndContainer.d.ts +3 -0
- package/lib/LmDrag/components/DndContainer.js +138 -0
- package/lib/LmDrag/components/sortableBox.d.ts +5 -0
- package/lib/LmDrag/components/sortableBox.js +37 -0
- package/lib/LmDrag/components/sortableItem.d.ts +7 -0
- package/lib/LmDrag/components/sortableItem.js +54 -0
- package/lib/LmDrag/index.d.ts +10 -0
- package/lib/LmDrag/index.js +19 -0
- package/lib/LmDrag/style/index.css +0 -0
- package/lib/LmDrag/style/index.d.ts +1 -0
- package/lib/LmDrag/style/index.js +3 -0
- package/lib/LmDrag/style/variables.css +0 -0
- package/lib/LmDrag/style/variables.d.ts +1 -0
- package/lib/LmDrag/style/variables.js +3 -0
- package/lib/LmDrag/wrapper/Root.d.ts +3 -0
- package/lib/LmDrag/wrapper/Root.js +26 -0
- package/lib/LmEditTable/EditTable.d.ts +15 -3
- package/lib/LmEditTable/EditTable.js +87 -56
- package/lib/LmEditTable/sortableItemCol.js +4 -1
- package/lib/LmEditTable/util.js +1 -1
- package/lib/LmFilter/components/DropdownFIlter.js +27 -6
- package/lib/LmFilter/style/index.css +12 -0
- package/lib/LmFilter/style/variables.css +12 -0
- package/lib/LmUpload/LmUpload.js +2 -1
- package/lib/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/lib/LmUpload/UploadList/ItemPictureCard.js +4 -3
- package/lib/LmUpload/UploadList/index.js +53 -2
- package/lib/LmUpload/fns/index.d.ts +1 -0
- package/lib/LmUpload/fns/index.js +19 -3
- package/lib/QuickMenu/index.d.ts +3 -1
- package/lib/QuickMenu/index.js +21 -18
- package/lib/Select/index.d.ts +3 -0
- package/lib/Select/index.js +29 -1
- package/lib/Select/style/index.css +27 -0
- package/lib/Select/style/variables.css +27 -0
- package/lib/TreeSelect/index.js +20 -2
- package/lib/TreeSelect/style/index.css +3 -0
- package/lib/TreeSelect/style/variables.css +3 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +15 -1
- package/lib/styles/variables.css +76 -25
- package/package.json +1 -1
|
@@ -11,17 +11,23 @@ exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
+
var _linkmoreDesign = require("linkmore-design");
|
|
15
|
+
|
|
14
16
|
var _utils = require("../utils");
|
|
15
17
|
|
|
16
18
|
var _RenderItem = _interopRequireDefault(require("./RenderItem"));
|
|
17
19
|
|
|
18
20
|
var LmUploadList = function LmUploadList(_ref) {
|
|
19
21
|
var instance = _ref.instance;
|
|
20
|
-
var
|
|
22
|
+
var uid = instance.uid,
|
|
23
|
+
getFileHasValue = instance.getFileHasValue,
|
|
21
24
|
getFileList = instance.getFileList,
|
|
22
25
|
itemRender = instance.itemRender,
|
|
23
26
|
listType = instance.listType,
|
|
24
|
-
showUploadList = instance.showUploadList
|
|
27
|
+
showUploadList = instance.showUploadList,
|
|
28
|
+
enableDrag = instance.enableDrag,
|
|
29
|
+
fileNames = instance.fileNames,
|
|
30
|
+
move = instance.move;
|
|
25
31
|
if (!showUploadList) return null;
|
|
26
32
|
var fileList = (0, _react.useMemo)(function () {
|
|
27
33
|
var _a;
|
|
@@ -30,6 +36,51 @@ var LmUploadList = function LmUploadList(_ref) {
|
|
|
30
36
|
return a.seq - b.seq;
|
|
31
37
|
});
|
|
32
38
|
}, [getFileList]);
|
|
39
|
+
|
|
40
|
+
var handleMove = function handleMove(active, over, fileList) {
|
|
41
|
+
try {
|
|
42
|
+
var fileMap = fileList.map(function (v) {
|
|
43
|
+
if (getFileHasValue(v) === getFileHasValue(active)) {
|
|
44
|
+
return Object.assign(Object.assign({}, v), {
|
|
45
|
+
seq: over[fileNames.seq]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (getFileHasValue(v) === getFileHasValue(over)) {
|
|
50
|
+
return Object.assign(Object.assign({}, v), {
|
|
51
|
+
seq: active[fileNames.seq]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return v;
|
|
56
|
+
});
|
|
57
|
+
move(active, over, fileMap);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.log('移动出现了错误', error);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
if (enableDrag) {
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.LmDrag, {
|
|
65
|
+
options: fileList,
|
|
66
|
+
rowKey: uid,
|
|
67
|
+
move: handleMove
|
|
68
|
+
}, function (_ref2) {
|
|
69
|
+
var item = _ref2.item,
|
|
70
|
+
listeners = _ref2.listeners,
|
|
71
|
+
index = _ref2.index;
|
|
72
|
+
return (0, _utils.render)(itemRender || _RenderItem.default, {
|
|
73
|
+
type: listType,
|
|
74
|
+
key: getFileHasValue(item) || index,
|
|
75
|
+
index: index,
|
|
76
|
+
file: item,
|
|
77
|
+
fileList: fileList,
|
|
78
|
+
instance: instance,
|
|
79
|
+
listeners: listeners
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
33
84
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, fileList === null || fileList === void 0 ? void 0 : fileList.map(function (file, idx) {
|
|
34
85
|
return (0, _utils.render)(itemRender || _RenderItem.default, {
|
|
35
86
|
type: listType,
|
|
@@ -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;
|
|
@@ -78,10 +78,11 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
78
78
|
}, [uid]); // 从对象中读取存在的指定属性
|
|
79
79
|
|
|
80
80
|
var getFileHasValue = (0, _react.useCallback)(function (obj) {
|
|
81
|
+
if (!obj) return '';
|
|
81
82
|
var extend = [uid, 'fileName'];
|
|
82
83
|
var val = '';
|
|
83
84
|
extend.forEach(function (v) {
|
|
84
|
-
if (!val) val = obj[v];
|
|
85
|
+
if (!val && obj[v]) val = obj[v];
|
|
85
86
|
});
|
|
86
87
|
return val;
|
|
87
88
|
}, [uid]); // 获取当前的文件列表
|
|
@@ -483,7 +484,21 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
483
484
|
var _a;
|
|
484
485
|
|
|
485
486
|
(_a = props.onDownload) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
486
|
-
}, [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]);
|
|
487
502
|
var CoreMethods = {
|
|
488
503
|
getIsMaxCount: getIsMaxCount,
|
|
489
504
|
getFileHasValue: getFileHasValue,
|
|
@@ -493,7 +508,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
493
508
|
getUploadStatus: getUploadStatus,
|
|
494
509
|
remove: remove,
|
|
495
510
|
preview: preview,
|
|
496
|
-
download: download
|
|
511
|
+
download: download,
|
|
512
|
+
move: move
|
|
497
513
|
};
|
|
498
514
|
var RefMethods = {
|
|
499
515
|
getState: function getState() {
|
package/lib/QuickMenu/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface IMenuData {
|
|
2
|
+
export interface IMenuData {
|
|
3
3
|
menuId: string;
|
|
4
4
|
title: string | React.ReactNode;
|
|
5
|
+
hidden?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export interface IQuickMenuProps {
|
|
7
8
|
className?: string;
|
|
@@ -9,6 +10,7 @@ export interface IQuickMenuProps {
|
|
|
9
10
|
top?: number;
|
|
10
11
|
menuData: IMenuData[];
|
|
11
12
|
warpElement: any;
|
|
13
|
+
root?: IntersectionObserver['root'] | undefined;
|
|
12
14
|
}
|
|
13
15
|
declare const LMQuickMenu: React.FC<IQuickMenuProps>;
|
|
14
16
|
export default LMQuickMenu;
|
package/lib/QuickMenu/index.js
CHANGED
|
@@ -29,7 +29,8 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
29
29
|
top = _props$top === void 0 ? '104px' : _props$top,
|
|
30
30
|
_props$menuData = props.menuData,
|
|
31
31
|
menuData = _props$menuData === void 0 ? [] : _props$menuData,
|
|
32
|
-
warpElement = props.warpElement
|
|
32
|
+
warpElement = props.warpElement,
|
|
33
|
+
root = props.root;
|
|
33
34
|
var idTopInfo = (0, _react.useRef)({});
|
|
34
35
|
|
|
35
36
|
var _useState = (0, _react.useState)(false),
|
|
@@ -48,6 +49,11 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
48
49
|
var scroll = (0, _ahooks.useScroll)((0, _domTarget.getTargetElement)(warpElement || document), function () {
|
|
49
50
|
return scrollOpenStatus;
|
|
50
51
|
});
|
|
52
|
+
var filterMenuData = (0, _react.useMemo)(function () {
|
|
53
|
+
return menuData === null || menuData === void 0 ? void 0 : menuData.filter(function (item) {
|
|
54
|
+
return item.hidden !== true;
|
|
55
|
+
});
|
|
56
|
+
}, [menuData]);
|
|
51
57
|
|
|
52
58
|
function clearActiveToc() {
|
|
53
59
|
[].forEach.call(document.querySelectorAll('.lm_menu_list li a'), function (node) {
|
|
@@ -71,7 +77,7 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
71
77
|
(_a = menuTimeEventRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
72
78
|
}
|
|
73
79
|
|
|
74
|
-
if (!
|
|
80
|
+
if (!filterMenuData.length) {
|
|
75
81
|
return;
|
|
76
82
|
} // eslint-disable-next-line global-require
|
|
77
83
|
|
|
@@ -82,12 +88,13 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
82
88
|
var scrollama = require('scrollama');
|
|
83
89
|
|
|
84
90
|
menuTimeEventRef.current = scrollama();
|
|
91
|
+
console.log((0, _domTarget.getTargetElement)(warpElement || document), '--getTargetElement(warpElement || document)');
|
|
85
92
|
(_c = (_b = menuTimeEventRef.current) === null || _b === void 0 ? void 0 : _b.setup({
|
|
86
|
-
step:
|
|
93
|
+
step: filterMenuData.map(function (item) {
|
|
87
94
|
return document.getElementById("".concat(item.menuId));
|
|
88
|
-
}).filter(Boolean)
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
}).filter(Boolean),
|
|
96
|
+
container: (0, _domTarget.getTargetElement)(warpElement || document),
|
|
97
|
+
root: root ? (0, _domTarget.getTargetElement)(root) : undefined
|
|
91
98
|
})) === null || _c === void 0 ? void 0 : _c.onStepEnter(function (_ref) {
|
|
92
99
|
var element = _ref.element;
|
|
93
100
|
updateActiveToc(element.id);
|
|
@@ -95,7 +102,7 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
95
102
|
};
|
|
96
103
|
|
|
97
104
|
function setKeysDom() {
|
|
98
|
-
|
|
105
|
+
filterMenuData.forEach(function (item) {
|
|
99
106
|
var _a, _b;
|
|
100
107
|
|
|
101
108
|
var warpTop = ((_a = (0, _domTarget.getTargetElement)(warpElement || document)) === null || _a === void 0 ? void 0 : _a.offsetTop) || 0;
|
|
@@ -119,12 +126,6 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
119
126
|
wait: 50
|
|
120
127
|
});
|
|
121
128
|
|
|
122
|
-
var bindDom = function bindDom() {
|
|
123
|
-
if (!Object.keys(idTopInfo.current).length) {
|
|
124
|
-
setKeysDom();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
129
|
var handleScroll = function handleScroll() {
|
|
129
130
|
setScrollOpenStatus(true);
|
|
130
131
|
};
|
|
@@ -139,10 +140,6 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
139
140
|
var _a; // bindScroller();
|
|
140
141
|
|
|
141
142
|
|
|
142
|
-
setTimeout(function () {
|
|
143
|
-
bindDom();
|
|
144
|
-
bindScroller();
|
|
145
|
-
}, 200);
|
|
146
143
|
(_a = (0, _domTarget.getTargetElement)(warpElement || document)) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', handleScroll, {
|
|
147
144
|
once: true
|
|
148
145
|
});
|
|
@@ -152,6 +149,12 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
152
149
|
(_a = (0, _domTarget.getTargetElement)(warpElement || document)) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', handleScroll);
|
|
153
150
|
};
|
|
154
151
|
}, []);
|
|
152
|
+
(0, _react.useEffect)(function () {
|
|
153
|
+
setTimeout(function () {
|
|
154
|
+
setKeysDom();
|
|
155
|
+
bindScroller();
|
|
156
|
+
}, 200);
|
|
157
|
+
}, [filterMenuData]);
|
|
155
158
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
156
159
|
className: (0, _classnames.default)(prefixCls),
|
|
157
160
|
onMouseEnter: function onMouseEnter() {
|
|
@@ -173,7 +176,7 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
173
176
|
})
|
|
174
177
|
}), /*#__PURE__*/_react.default.createElement("ul", {
|
|
175
178
|
className: (0, _classnames.default)('lm_menu_list', hovering && 'show', className)
|
|
176
|
-
},
|
|
179
|
+
}, filterMenuData.map(function (item) {
|
|
177
180
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
178
181
|
key: item.menuId,
|
|
179
182
|
onClick: function onClick() {
|
package/lib/Select/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface ISelectProps extends SelectProps {
|
|
|
6
6
|
Option?: typeof Select.Option;
|
|
7
7
|
OptGroup?: typeof Select.OptGroup;
|
|
8
8
|
defaultLabel?: string;
|
|
9
|
+
suffix?: React.ReactNode;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
iconClick?: () => void;
|
|
9
12
|
}
|
|
10
13
|
declare type SelectType = typeof Select & typeof Select.Option & typeof Select.OptGroup;
|
|
11
14
|
declare const LMSelect: SelectType;
|
package/lib/Select/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var _select = _interopRequireDefault(require("antd/es/select"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
|
19
|
+
|
|
18
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
21
|
|
|
20
22
|
var _SizeContext = _interopRequireDefault(require("../ConfigProvider/SizeContext"));
|
|
@@ -44,8 +46,11 @@ var CLMSelect = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
44
46
|
options = props.options,
|
|
45
47
|
value = props.value,
|
|
46
48
|
defaultLabel = props.defaultLabel,
|
|
49
|
+
suffix = props.suffix,
|
|
50
|
+
icon = props.icon,
|
|
51
|
+
iconClick = props.iconClick,
|
|
47
52
|
rest = __rest(props // ===================== Size =====================
|
|
48
|
-
, ["children", "className", "size", "disabled", "dropdownClassName", "options", "value", "defaultLabel"]); // ===================== Size =====================
|
|
53
|
+
, ["children", "className", "size", "disabled", "dropdownClassName", "options", "value", "defaultLabel", "suffix", "icon", "iconClick"]); // ===================== Size =====================
|
|
49
54
|
|
|
50
55
|
|
|
51
56
|
var size = customizeSize || _react.default.useContext(_SizeContext.default) || 'middle'; // ===================== Disabled =====================
|
|
@@ -84,6 +89,29 @@ var CLMSelect = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
84
89
|
if (value && !hasOption) return defaultLabel !== null && defaultLabel !== void 0 ? defaultLabel : value;
|
|
85
90
|
return value;
|
|
86
91
|
}, [value, defaultLabel, hasOption]);
|
|
92
|
+
|
|
93
|
+
if (icon) {
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
+
className: 'lm_select_has_icon',
|
|
96
|
+
style: props.style
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_select.default, Object.assign({
|
|
98
|
+
className: (0, _classnames.default)(className, prefixCls),
|
|
99
|
+
size: size,
|
|
100
|
+
ref: ref,
|
|
101
|
+
value: resetValue,
|
|
102
|
+
options: options,
|
|
103
|
+
disabled: mergedDisabled || undefined
|
|
104
|
+
}, rest, {
|
|
105
|
+
dropdownClassName: (0, _classnames.default)('lm_select_dropdown', dropdownClassName)
|
|
106
|
+
}), children), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
107
|
+
size: size,
|
|
108
|
+
onClick: iconClick,
|
|
109
|
+
className: 'lm_select_icon_button',
|
|
110
|
+
disabled: mergedDisabled || undefined,
|
|
111
|
+
icon: icon
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
|
|
87
115
|
return /*#__PURE__*/_react.default.createElement(_select.default, Object.assign({
|
|
88
116
|
className: (0, _classnames.default)(className, prefixCls),
|
|
89
117
|
size: size,
|
|
@@ -526,3 +526,30 @@ p {
|
|
|
526
526
|
.lm_select_dropdown .ant-select-item-option-disabled {
|
|
527
527
|
color: var(--disabled-font-color);
|
|
528
528
|
}
|
|
529
|
+
.lm_select_has_icon {
|
|
530
|
+
width: 100%;
|
|
531
|
+
display: flex;
|
|
532
|
+
flex-direction: row;
|
|
533
|
+
align-items: center;
|
|
534
|
+
justify-content: flex-start;
|
|
535
|
+
position: relative;
|
|
536
|
+
}
|
|
537
|
+
.lm_select_has_icon .ant-select {
|
|
538
|
+
border-top-right-radius: 0;
|
|
539
|
+
border-bottom-right-radius: 0;
|
|
540
|
+
z-index: 3;
|
|
541
|
+
}
|
|
542
|
+
.lm_select_has_icon .ant-select .ant-select-selector {
|
|
543
|
+
border-top-right-radius: 0 !important;
|
|
544
|
+
border-bottom-right-radius: 0 !important;
|
|
545
|
+
}
|
|
546
|
+
.lm_select_has_icon .lm_select_icon_button {
|
|
547
|
+
margin-left: -1px;
|
|
548
|
+
border-top-left-radius: 0;
|
|
549
|
+
border-bottom-left-radius: 0;
|
|
550
|
+
z-index: 2;
|
|
551
|
+
}
|
|
552
|
+
.lm_select_has_icon .lm_select_icon_button:hover,
|
|
553
|
+
.lm_select_has_icon .lm_select_icon_button:focus {
|
|
554
|
+
z-index: 5;
|
|
555
|
+
}
|
|
@@ -14,3 +14,30 @@
|
|
|
14
14
|
.lm_select_dropdown .ant-select-item-option-disabled {
|
|
15
15
|
color: var(--disabled-font-color);
|
|
16
16
|
}
|
|
17
|
+
.lm_select_has_icon {
|
|
18
|
+
width: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: flex-start;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
.lm_select_has_icon .ant-select {
|
|
26
|
+
border-top-right-radius: 0;
|
|
27
|
+
border-bottom-right-radius: 0;
|
|
28
|
+
z-index: 3;
|
|
29
|
+
}
|
|
30
|
+
.lm_select_has_icon .ant-select .ant-select-selector {
|
|
31
|
+
border-top-right-radius: 0 !important;
|
|
32
|
+
border-bottom-right-radius: 0 !important;
|
|
33
|
+
}
|
|
34
|
+
.lm_select_has_icon .lm_select_icon_button {
|
|
35
|
+
margin-left: -1px;
|
|
36
|
+
border-top-left-radius: 0;
|
|
37
|
+
border-bottom-left-radius: 0;
|
|
38
|
+
z-index: 2;
|
|
39
|
+
}
|
|
40
|
+
.lm_select_has_icon .lm_select_icon_button:hover,
|
|
41
|
+
.lm_select_has_icon .lm_select_icon_button:focus {
|
|
42
|
+
z-index: 5;
|
|
43
|
+
}
|
package/lib/TreeSelect/index.js
CHANGED
|
@@ -15,6 +15,10 @@ var _treeSelect = _interopRequireDefault(require("antd/es/tree-select"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
+
var _DisabledContext = _interopRequireDefault(require("../ConfigProvider/DisabledContext"));
|
|
19
|
+
|
|
20
|
+
var _SizeContext = _interopRequireDefault(require("../ConfigProvider/SizeContext"));
|
|
21
|
+
|
|
18
22
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
19
23
|
var t = {};
|
|
20
24
|
|
|
@@ -33,8 +37,19 @@ var CLMTreeSelect = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
33
37
|
treeData = props.treeData,
|
|
34
38
|
value = props.value,
|
|
35
39
|
defaultLabel = props.defaultLabel,
|
|
36
|
-
|
|
40
|
+
customDisabled = props.disabled,
|
|
41
|
+
customizeSize = props.size,
|
|
42
|
+
resetProps = __rest(props // ===================== Disabled =====================
|
|
43
|
+
, ["children", "treeData", "value", "defaultLabel", "disabled", "size"]); // ===================== Disabled =====================
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
var disabled = _react.default.useContext(_DisabledContext.default);
|
|
47
|
+
|
|
48
|
+
var mergedDisabled = customDisabled || disabled; // ===================== size =====================
|
|
49
|
+
|
|
50
|
+
var size = _react.default.useContext(_SizeContext.default);
|
|
37
51
|
|
|
52
|
+
var mergeSize = customizeSize || size;
|
|
38
53
|
var deepChildren = (0, _react.useCallback)(function (arr) {
|
|
39
54
|
var flag = false;
|
|
40
55
|
|
|
@@ -83,7 +98,10 @@ var CLMTreeSelect = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
83
98
|
}, [value, hasOption]);
|
|
84
99
|
return /*#__PURE__*/_react.default.createElement(_treeSelect.default, Object.assign({
|
|
85
100
|
ref: ref,
|
|
86
|
-
|
|
101
|
+
className: 'lm_tree_select',
|
|
102
|
+
value: resetValue,
|
|
103
|
+
size: mergeSize,
|
|
104
|
+
disabled: mergedDisabled
|
|
87
105
|
}, resetProps), children);
|
|
88
106
|
});
|
|
89
107
|
var LMTreeSelect = CLMTreeSelect;
|
package/lib/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export type { TooltipProps } from './Tooltip';
|
|
|
51
51
|
export { default as Form } from './Form';
|
|
52
52
|
export { default as Spin } from './Spin';
|
|
53
53
|
export { default as LmEditTable } from './LmEditTable';
|
|
54
|
+
export type { TLmEditTable, CountdownHandle } from './LmEditTable/EditTable';
|
|
54
55
|
export { default as List } from './List';
|
|
55
56
|
export { default as LMQuickMenu } from './QuickMenu';
|
|
56
57
|
export { default as DatePicker } from './DatePicker';
|
|
@@ -125,3 +126,4 @@ export { default as CropImg } from './CropImg';
|
|
|
125
126
|
export type { CropImgProps } from './CropImg';
|
|
126
127
|
export { default as ImageViewer } from './ImageViewer';
|
|
127
128
|
export type { ImageViewerProps } from './ImageViewer';
|
|
129
|
+
export * from './LmDrag';
|
package/lib/index.js
CHANGED
|
@@ -776,4 +776,18 @@ Object.keys(_LmImgList).forEach(function (key) {
|
|
|
776
776
|
|
|
777
777
|
var _CropImg = _interopRequireDefault(require("./CropImg"));
|
|
778
778
|
|
|
779
|
-
var _ImageViewer = _interopRequireDefault(require("./ImageViewer"));
|
|
779
|
+
var _ImageViewer = _interopRequireDefault(require("./ImageViewer"));
|
|
780
|
+
|
|
781
|
+
var _LmDrag = require("./LmDrag");
|
|
782
|
+
|
|
783
|
+
Object.keys(_LmDrag).forEach(function (key) {
|
|
784
|
+
if (key === "default" || key === "__esModule") return;
|
|
785
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
786
|
+
if (key in exports && exports[key] === _LmDrag[key]) return;
|
|
787
|
+
Object.defineProperty(exports, key, {
|
|
788
|
+
enumerable: true,
|
|
789
|
+
get: function get() {
|
|
790
|
+
return _LmDrag[key];
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
});
|
package/lib/styles/variables.css
CHANGED
|
@@ -746,12 +746,13 @@ p {
|
|
|
746
746
|
padding: 0 var(--gap);
|
|
747
747
|
}
|
|
748
748
|
.ant-btn.lm-button {
|
|
749
|
-
border: 0;
|
|
750
749
|
display: inline-flex !important;
|
|
751
750
|
flex-direction: row;
|
|
752
751
|
align-items: center;
|
|
753
752
|
justify-content: center;
|
|
753
|
+
color: var(--font-color);
|
|
754
754
|
vertical-align: middle;
|
|
755
|
+
border: 1px solid var(--stroke-color);
|
|
755
756
|
box-shadow: none;
|
|
756
757
|
}
|
|
757
758
|
.ant-btn.lm-button .anticon {
|
|
@@ -769,12 +770,24 @@ p {
|
|
|
769
770
|
white-space: nowrap;
|
|
770
771
|
}
|
|
771
772
|
.ant-btn.lm-button::before {
|
|
772
|
-
|
|
773
|
+
position: absolute;
|
|
774
|
+
z-index: 1;
|
|
775
|
+
display: none;
|
|
776
|
+
background: #fff;
|
|
777
|
+
border-radius: inherit;
|
|
778
|
+
opacity: 0.35;
|
|
779
|
+
transition: opacity 0.2s;
|
|
780
|
+
content: '';
|
|
781
|
+
pointer-events: none;
|
|
782
|
+
inset: -1px;
|
|
783
|
+
}
|
|
784
|
+
.ant-btn.lm-button.ant-btn-loading::before {
|
|
785
|
+
display: block;
|
|
773
786
|
}
|
|
774
787
|
.ant-btn.lm-button:disabled {
|
|
788
|
+
color: var(--disabled-font-color) !important;
|
|
775
789
|
background: var(--disabled-bg-color) !important;
|
|
776
790
|
border: 1px solid var(--disabled-border-color) !important;
|
|
777
|
-
color: var(--disabled-font-color) !important;
|
|
778
791
|
}
|
|
779
792
|
.ant-btn.lm-button > span:not(.anticon) {
|
|
780
793
|
font-size: 12px;
|
|
@@ -795,57 +808,46 @@ p {
|
|
|
795
808
|
.ant-btn.lm-button-middle .anticon {
|
|
796
809
|
font-size: 16px;
|
|
797
810
|
}
|
|
798
|
-
.ant-btn.lm-button-default {
|
|
799
|
-
border: 1px solid var(--stroke-color);
|
|
800
|
-
color: var(--font-color);
|
|
801
|
-
}
|
|
802
|
-
.ant-btn.lm-button-default-hover,
|
|
803
|
-
.ant-btn.lm-button-default:hover {
|
|
804
|
-
border: 1px solid var(--primary-hover-color);
|
|
805
|
-
color: var(--primary-hover-color);
|
|
806
|
-
}
|
|
807
|
-
.ant-btn.lm-button-default.ant-btn-loading {
|
|
808
|
-
border-color: rgba(0, 0, 0, 0.15);
|
|
809
|
-
color: rgba(0, 0, 0, 0.15);
|
|
810
|
-
}
|
|
811
811
|
.ant-btn.lm-button-primary {
|
|
812
|
-
background: var(--primary-color);
|
|
813
812
|
color: #fff;
|
|
813
|
+
background: var(--primary-color);
|
|
814
|
+
border-color: var(--primary-color);
|
|
814
815
|
}
|
|
815
|
-
.ant-btn.lm-button-primary-hover,
|
|
816
816
|
.ant-btn.lm-button-primary:hover {
|
|
817
817
|
background: var(--primary-hover-color);
|
|
818
818
|
}
|
|
819
|
+
.ant-btn.lm-button-primary:active {
|
|
820
|
+
background-color: var(--primary-click-color);
|
|
821
|
+
}
|
|
819
822
|
.ant-btn.lm-button-primary.ant-btn-loading {
|
|
820
823
|
background: var(--primary-loading-color);
|
|
821
824
|
}
|
|
822
825
|
.ant-btn.lm-button-ghost {
|
|
823
826
|
color: var(--font-color);
|
|
824
|
-
border-color: var(--color-15);
|
|
825
827
|
background: transparent;
|
|
828
|
+
border: 1px solid var(--color-15);
|
|
826
829
|
}
|
|
827
830
|
.ant-btn.lm-button-danger {
|
|
828
|
-
border: 1px solid var(--error-color);
|
|
829
831
|
color: var(--error-color);
|
|
830
832
|
text-shadow: none;
|
|
833
|
+
border: 1px solid var(--error-color);
|
|
831
834
|
box-shadow: none;
|
|
832
835
|
}
|
|
833
|
-
.ant-btn.lm-button-danger-hover,
|
|
834
836
|
.ant-btn.lm-button-danger:hover {
|
|
835
|
-
border-color: var(--error-hover-color);
|
|
836
837
|
color: var(--error-hover-color);
|
|
838
|
+
border-color: var(--error-hover-color);
|
|
837
839
|
}
|
|
838
840
|
.ant-btn.lm-button-danger.ant-btn-loading {
|
|
839
|
-
border-color: var(--error-loading-color);
|
|
840
841
|
color: var(--error-hover-color);
|
|
842
|
+
border-color: var(--error-loading-color);
|
|
841
843
|
}
|
|
842
844
|
.ant-btn.lm-button-dashed {
|
|
843
845
|
border: 1px dashed var(--color-15);
|
|
844
846
|
}
|
|
845
847
|
.ant-btn.lm-button-link {
|
|
846
848
|
color: var(--primary-color);
|
|
849
|
+
border-color: transparent;
|
|
847
850
|
}
|
|
848
|
-
.ant-btn.lm-button-link-hover,
|
|
849
851
|
.ant-btn.lm-button-link:hover {
|
|
850
852
|
color: var(--primary-hover-color);
|
|
851
853
|
}
|
|
@@ -853,11 +855,12 @@ p {
|
|
|
853
855
|
color: var(--primary-loading-color);
|
|
854
856
|
}
|
|
855
857
|
.ant-btn.lm-button-link[disabled] {
|
|
856
|
-
border: 0 !important;
|
|
857
858
|
background: transparent !important;
|
|
859
|
+
border: 0 !important;
|
|
858
860
|
}
|
|
859
861
|
.ant-btn.ant-btn-text {
|
|
860
862
|
background: transparent;
|
|
863
|
+
border-color: transparent;
|
|
861
864
|
}
|
|
862
865
|
.ant-btn.lm-button-icon-only .anticon {
|
|
863
866
|
font-size: 16px;
|
|
@@ -2241,6 +2244,9 @@ p {
|
|
|
2241
2244
|
padding-right: 24px;
|
|
2242
2245
|
padding-bottom: 8px;
|
|
2243
2246
|
}
|
|
2247
|
+
.lm_descriptions .ant-descriptions-item:last-child {
|
|
2248
|
+
padding-right: 0;
|
|
2249
|
+
}
|
|
2244
2250
|
.lm_descriptions .ant-descriptions-item .ant-descriptions-item-container {
|
|
2245
2251
|
color: var(--color-85);
|
|
2246
2252
|
font-size: 12px;
|
|
@@ -9540,6 +9546,9 @@ p {
|
|
|
9540
9546
|
.lm_input-number.ant-input-number-status-warning {
|
|
9541
9547
|
border-color: var(--warning-color) !important;
|
|
9542
9548
|
}
|
|
9549
|
+
.lm_input-number .ant-input-number-input::placeholder {
|
|
9550
|
+
font-size: 12px;
|
|
9551
|
+
}
|
|
9543
9552
|
.lm_grid_tree {
|
|
9544
9553
|
position: relative;
|
|
9545
9554
|
font-size: 12px;
|
|
@@ -9957,6 +9966,18 @@ p {
|
|
|
9957
9966
|
.lm_filter_basic_item .filter_item_icon.addon_before {
|
|
9958
9967
|
color: var(--font-color);
|
|
9959
9968
|
}
|
|
9969
|
+
.lm_filter_basic_item .filter_item_icon .icon_clear {
|
|
9970
|
+
display: none;
|
|
9971
|
+
opacity: 0;
|
|
9972
|
+
}
|
|
9973
|
+
.lm_filter_basic_item .filter_item_icon:hover .icon_down {
|
|
9974
|
+
display: none;
|
|
9975
|
+
opacity: 0;
|
|
9976
|
+
}
|
|
9977
|
+
.lm_filter_basic_item .filter_item_icon:hover .icon_clear {
|
|
9978
|
+
display: inline-block;
|
|
9979
|
+
opacity: 1;
|
|
9980
|
+
}
|
|
9960
9981
|
.lm_filter_basic_item.expand .filter_item_icon.addon_after {
|
|
9961
9982
|
transform: rotateX(180deg);
|
|
9962
9983
|
}
|
|
@@ -12427,6 +12448,33 @@ button.ant-table-row-expand-icon::after {
|
|
|
12427
12448
|
.lm_select_dropdown .ant-select-item-option-disabled {
|
|
12428
12449
|
color: var(--disabled-font-color);
|
|
12429
12450
|
}
|
|
12451
|
+
.lm_select_has_icon {
|
|
12452
|
+
width: 100%;
|
|
12453
|
+
display: flex;
|
|
12454
|
+
flex-direction: row;
|
|
12455
|
+
align-items: center;
|
|
12456
|
+
justify-content: flex-start;
|
|
12457
|
+
position: relative;
|
|
12458
|
+
}
|
|
12459
|
+
.lm_select_has_icon .ant-select {
|
|
12460
|
+
border-top-right-radius: 0;
|
|
12461
|
+
border-bottom-right-radius: 0;
|
|
12462
|
+
z-index: 3;
|
|
12463
|
+
}
|
|
12464
|
+
.lm_select_has_icon .ant-select .ant-select-selector {
|
|
12465
|
+
border-top-right-radius: 0 !important;
|
|
12466
|
+
border-bottom-right-radius: 0 !important;
|
|
12467
|
+
}
|
|
12468
|
+
.lm_select_has_icon .lm_select_icon_button {
|
|
12469
|
+
margin-left: -1px;
|
|
12470
|
+
border-top-left-radius: 0;
|
|
12471
|
+
border-bottom-left-radius: 0;
|
|
12472
|
+
z-index: 2;
|
|
12473
|
+
}
|
|
12474
|
+
.lm_select_has_icon .lm_select_icon_button:hover,
|
|
12475
|
+
.lm_select_has_icon .lm_select_icon_button:focus {
|
|
12476
|
+
z-index: 5;
|
|
12477
|
+
}
|
|
12430
12478
|
.ant-switch.lm-switch {
|
|
12431
12479
|
width: 48px;
|
|
12432
12480
|
height: 24px;
|
|
@@ -12603,6 +12651,9 @@ button.ant-table-row-expand-icon::after {
|
|
|
12603
12651
|
.lm_tree .ant-tree-node-selected > .ant-tree-title {
|
|
12604
12652
|
color: var(--primary-color);
|
|
12605
12653
|
}
|
|
12654
|
+
.lm_tree_select .ant-select-selection-placeholder {
|
|
12655
|
+
font-size: 12px;
|
|
12656
|
+
}
|
|
12606
12657
|
.ant-upload-select-picture-card div {
|
|
12607
12658
|
margin-top: 8px;
|
|
12608
12659
|
}
|