linkmore-design 1.1.11 → 1.1.13-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/Cascader/demos/formItem.d.ts +2 -0
- package/dist/LmEditTable/DndContainer.d.ts +4 -3
- package/dist/LmEditTable/EditTable.d.ts +2 -0
- package/dist/LmEditTable/components/DraggableContainer.d.ts +7 -0
- package/dist/LmEditTable/components/index.d.ts +11 -0
- package/dist/LmEditTable/sortableItem.d.ts +3 -2
- package/dist/LmEditTable/util.d.ts +2 -0
- package/dist/LmEditTable/virtual/VirtualRow.d.ts +6 -0
- package/dist/LmEditTable/virtual/VirtualRowBack.d.ts +6 -0
- package/dist/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/dist/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/dist/LmEditTable/virtual/context.d.ts +13 -0
- package/dist/LmEditTable/virtual/index.d.ts +4 -0
- package/dist/Select/demos/formItem.d.ts +2 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/TreeSelect/demos/formItem.d.ts +2 -0
- package/dist/TreeSelect/index.d.ts +8 -3
- package/dist/index.umd.js +629 -226
- package/dist/index.umd.min.js +5 -5
- package/dist/variables.css +47 -0
- package/es/IconFont/index.js +1 -1
- package/es/LmEditTable/DndContainer.d.ts +4 -3
- package/es/LmEditTable/DndContainer.js +2 -2
- package/es/LmEditTable/EditTable.d.ts +2 -0
- package/es/LmEditTable/EditTable.js +200 -158
- package/es/LmEditTable/components/DraggableContainer.d.ts +7 -0
- package/es/LmEditTable/components/DraggableContainer.js +32 -0
- package/es/LmEditTable/components/index.d.ts +11 -0
- package/es/LmEditTable/components/index.js +5 -0
- package/es/LmEditTable/sortableItem.d.ts +3 -2
- package/es/LmEditTable/sortableItem.js +15 -4
- package/es/LmEditTable/style/index.css +47 -0
- package/es/LmEditTable/style/variables.css +47 -0
- package/es/LmEditTable/util.d.ts +2 -0
- package/es/LmEditTable/util.js +37 -1
- package/es/LmEditTable/virtual/VirtualRow.d.ts +6 -0
- package/es/LmEditTable/virtual/VirtualRow.js +60 -0
- package/es/LmEditTable/virtual/VirtualRowBack.d.ts +6 -0
- package/es/LmEditTable/virtual/VirtualRowBack.js +102 -0
- package/es/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualTable.js +54 -0
- package/es/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/es/LmEditTable/virtual/VirtualWrapper.js +60 -0
- package/es/LmEditTable/virtual/context.d.ts +13 -0
- package/es/LmEditTable/virtual/context.js +54 -0
- package/es/LmEditTable/virtual/index.d.ts +4 -0
- package/es/LmEditTable/virtual/index.js +4 -0
- package/es/Select/index.d.ts +1 -0
- package/es/Select/index.js +38 -4
- package/es/TreeSelect/index.d.ts +8 -3
- package/es/TreeSelect/index.js +74 -1
- package/es/hooks/useEvent/index.js +1 -1
- package/es/styles/variables.css +47 -0
- package/lib/IconFont/index.js +1 -1
- package/lib/LmEditTable/DndContainer.d.ts +4 -3
- package/lib/LmEditTable/DndContainer.js +4 -3
- package/lib/LmEditTable/EditTable.d.ts +2 -0
- package/lib/LmEditTable/EditTable.js +195 -153
- package/lib/LmEditTable/components/DraggableContainer.d.ts +7 -0
- package/lib/LmEditTable/components/DraggableContainer.js +45 -0
- package/lib/LmEditTable/components/index.d.ts +11 -0
- package/lib/LmEditTable/components/index.js +21 -0
- package/lib/LmEditTable/sortableItem.d.ts +3 -2
- package/lib/LmEditTable/sortableItem.js +18 -5
- package/lib/LmEditTable/style/index.css +47 -0
- package/lib/LmEditTable/style/variables.css +47 -0
- package/lib/LmEditTable/util.d.ts +2 -0
- package/lib/LmEditTable/util.js +40 -0
- package/lib/LmEditTable/virtual/VirtualRow.d.ts +6 -0
- package/lib/LmEditTable/virtual/VirtualRow.js +73 -0
- package/lib/LmEditTable/virtual/VirtualRowBack.d.ts +6 -0
- package/lib/LmEditTable/virtual/VirtualRowBack.js +115 -0
- package/lib/LmEditTable/virtual/VirtualTable.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualTable.js +71 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.d.ts +3 -0
- package/lib/LmEditTable/virtual/VirtualWrapper.js +73 -0
- package/lib/LmEditTable/virtual/context.d.ts +13 -0
- package/lib/LmEditTable/virtual/context.js +64 -0
- package/lib/LmEditTable/virtual/index.d.ts +4 -0
- package/lib/LmEditTable/virtual/index.js +31 -0
- package/lib/Select/index.d.ts +1 -0
- package/lib/Select/index.js +37 -3
- package/lib/TreeSelect/index.d.ts +8 -3
- package/lib/TreeSelect/index.js +78 -1
- package/lib/hooks/useEvent/index.js +1 -1
- package/lib/styles/variables.css +47 -0
- package/package.json +1 -1
package/es/Select/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
14
14
|
return t;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
import React, { forwardRef } from 'react';
|
|
17
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import SizeContext from '../ConfigProvider/SizeContext';
|
|
20
20
|
var prefixCls = 'lm_select';
|
|
@@ -23,13 +23,47 @@ var CLMSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
23
|
className = props.className,
|
|
24
24
|
customizeSize = props.size,
|
|
25
25
|
dropdownClassName = props.dropdownClassName,
|
|
26
|
-
|
|
26
|
+
options = props.options,
|
|
27
|
+
value = props.value,
|
|
28
|
+
defaultLabel = props.defaultLabel,
|
|
29
|
+
others = __rest(props, ["children", "className", "size", "dropdownClassName", "options", "value", "defaultLabel"]);
|
|
27
30
|
|
|
28
|
-
var size = customizeSize || React.useContext(SizeContext) || 'middle';
|
|
31
|
+
var size = customizeSize || React.useContext(SizeContext) || 'middle'; // 当前值是否存于选项中
|
|
32
|
+
|
|
33
|
+
var hasOption = useMemo(function () {
|
|
34
|
+
var flag = false;
|
|
35
|
+
|
|
36
|
+
if (children) {
|
|
37
|
+
React.Children.forEach(children, function (child) {
|
|
38
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
39
|
+
var childValue = child.props.value;
|
|
40
|
+
|
|
41
|
+
if (!flag) {
|
|
42
|
+
flag = childValue === value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (options) {
|
|
49
|
+
flag = !!options.some(function (v) {
|
|
50
|
+
return v.value === value;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return flag;
|
|
55
|
+
}, [children, value, options]); // 重组value: 传入value但找不到options项时,展示默认label
|
|
56
|
+
|
|
57
|
+
var resetValue = useMemo(function () {
|
|
58
|
+
if (value && !hasOption) return defaultLabel !== null && defaultLabel !== void 0 ? defaultLabel : value;
|
|
59
|
+
return value;
|
|
60
|
+
}, [value, hasOption]);
|
|
29
61
|
return /*#__PURE__*/React.createElement(_Select, Object.assign({
|
|
30
62
|
className: classNames(className, prefixCls),
|
|
31
63
|
size: size,
|
|
32
|
-
ref: ref
|
|
64
|
+
ref: ref,
|
|
65
|
+
value: resetValue,
|
|
66
|
+
options: options
|
|
33
67
|
}, others, {
|
|
34
68
|
dropdownClassName: classNames('lm_select_dropdown', dropdownClassName)
|
|
35
69
|
}), children);
|
package/es/TreeSelect/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import { TreeSelect } from 'antd';
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import { TreeSelect, TreeSelectProps as OriginTreeSelectProps } from 'antd';
|
|
2
|
+
export interface TreeSelectProps extends OriginTreeSelectProps {
|
|
3
|
+
defaultLabel?: string;
|
|
4
|
+
children?: any;
|
|
5
|
+
}
|
|
6
|
+
declare type TreeSelectType = typeof TreeSelect & typeof TreeSelect.TreeNode;
|
|
7
|
+
declare const LMTreeSelect: TreeSelectType;
|
|
8
|
+
export default LMTreeSelect;
|
package/es/TreeSelect/index.js
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
1
|
import "antd/es/tree-select/style";
|
|
2
2
|
import _TreeSelect from "antd/es/tree-select";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
5
|
+
var t = {};
|
|
6
|
+
|
|
7
|
+
for (var p in s) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
12
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
13
|
+
}
|
|
14
|
+
return t;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
18
|
+
var CLMTreeSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
19
|
+
var children = props.children,
|
|
20
|
+
treeData = props.treeData,
|
|
21
|
+
value = props.value,
|
|
22
|
+
defaultLabel = props.defaultLabel,
|
|
23
|
+
resetProps = __rest(props, ["children", "treeData", "value", "defaultLabel"]);
|
|
24
|
+
|
|
25
|
+
var deepChildren = useCallback(function (arr) {
|
|
26
|
+
var flag = false;
|
|
27
|
+
React.Children.forEach(arr, function (child) {
|
|
28
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
29
|
+
var _child$props = child.props,
|
|
30
|
+
childValue = _child$props.value,
|
|
31
|
+
childChildren = _child$props.children;
|
|
32
|
+
|
|
33
|
+
if (!flag) {
|
|
34
|
+
if (childValue === value) {
|
|
35
|
+
flag = true;
|
|
36
|
+
} else if (childChildren) {
|
|
37
|
+
flag = deepChildren(childChildren);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return flag;
|
|
43
|
+
}, [value]);
|
|
44
|
+
var hasOption = useMemo(function () {
|
|
45
|
+
var flag = false;
|
|
46
|
+
|
|
47
|
+
if (children) {
|
|
48
|
+
flag = deepChildren(children);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (treeData) {
|
|
52
|
+
var deepFind = function deepFind(arr) {
|
|
53
|
+
return arr.some(function (v) {
|
|
54
|
+
if (v.value === value) return true;
|
|
55
|
+
return v.children && deepFind(v.children);
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
flag = deepFind(treeData);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return flag;
|
|
63
|
+
}, [children, value, deepChildren]); // 重组value: 传入value但找不到options项时,展示默认label
|
|
64
|
+
|
|
65
|
+
var resetValue = useMemo(function () {
|
|
66
|
+
if (value && !hasOption) return defaultLabel !== null && defaultLabel !== void 0 ? defaultLabel : value;
|
|
67
|
+
return value;
|
|
68
|
+
}, [value, hasOption]);
|
|
69
|
+
return /*#__PURE__*/React.createElement(_TreeSelect, Object.assign({
|
|
70
|
+
ref: ref,
|
|
71
|
+
value: resetValue
|
|
72
|
+
}, resetProps), children);
|
|
73
|
+
});
|
|
74
|
+
var LMTreeSelect = CLMTreeSelect;
|
|
75
|
+
LMTreeSelect.TreeNode = _TreeSelect.TreeNode;
|
|
76
|
+
export default LMTreeSelect;
|
package/es/styles/variables.css
CHANGED
|
@@ -9742,6 +9742,9 @@ p {
|
|
|
9742
9742
|
letter-spacing: 0px;
|
|
9743
9743
|
color: var(--color-85);
|
|
9744
9744
|
}
|
|
9745
|
+
.lm_editTable_warpper .lm_custom_cell_td {
|
|
9746
|
+
position: relative;
|
|
9747
|
+
}
|
|
9745
9748
|
.lm_editTable_warpper .lm_custom_cell_td .ant-form-item-control-input-content {
|
|
9746
9749
|
display: flex;
|
|
9747
9750
|
flex-direction: row;
|
|
@@ -9753,6 +9756,32 @@ p {
|
|
|
9753
9756
|
.lm_editTable_warpper .lm_custom_cell_td .ant-table-row-expand-icon {
|
|
9754
9757
|
margin-top: 6px;
|
|
9755
9758
|
}
|
|
9759
|
+
.lm_editTable_warpper .lm_custom_cell_td .quick_copy_warp {
|
|
9760
|
+
font-size: 8px;
|
|
9761
|
+
position: absolute;
|
|
9762
|
+
left: calc(50% - 10px);
|
|
9763
|
+
z-index: 100;
|
|
9764
|
+
width: 20px;
|
|
9765
|
+
height: 10px;
|
|
9766
|
+
background-color: var(--color-6);
|
|
9767
|
+
display: flex;
|
|
9768
|
+
align-items: center;
|
|
9769
|
+
justify-content: center;
|
|
9770
|
+
color: #D8D8D8;
|
|
9771
|
+
}
|
|
9772
|
+
.lm_editTable_warpper .lm_custom_cell_td .quick_copy_warp:hover {
|
|
9773
|
+
cursor: pointer;
|
|
9774
|
+
background-color: var(--primary-color);
|
|
9775
|
+
color: #fff;
|
|
9776
|
+
}
|
|
9777
|
+
.lm_editTable_warpper .lm_custom_cell_td .quick_copy_up {
|
|
9778
|
+
top: -4px;
|
|
9779
|
+
left: calc(50% - 10px);
|
|
9780
|
+
}
|
|
9781
|
+
.lm_editTable_warpper .lm_custom_cell_td .quick_copy_down {
|
|
9782
|
+
bottom: -6px;
|
|
9783
|
+
left: calc(50% - 10px);
|
|
9784
|
+
}
|
|
9756
9785
|
.lm_editTable_warpper .lm_editTable_cell_edit {
|
|
9757
9786
|
height: 40px;
|
|
9758
9787
|
padding: 8px 8px !important;
|
|
@@ -9802,6 +9831,24 @@ p {
|
|
|
9802
9831
|
color: var(--color-85);
|
|
9803
9832
|
margin-left: 0 !important;
|
|
9804
9833
|
}
|
|
9834
|
+
.lm_table_append_add_popover .ant-popover-inner-content {
|
|
9835
|
+
padding: 0px;
|
|
9836
|
+
}
|
|
9837
|
+
.lm_table_append_add_popover .ant-popover-inner-content ul {
|
|
9838
|
+
margin: 0;
|
|
9839
|
+
}
|
|
9840
|
+
.lm_table_append_add_popover .ant-popover-inner-content ul li {
|
|
9841
|
+
font-size: 12px;
|
|
9842
|
+
padding: 4px 8px;
|
|
9843
|
+
height: 24px;
|
|
9844
|
+
display: flex;
|
|
9845
|
+
align-items: center;
|
|
9846
|
+
justify-content: center;
|
|
9847
|
+
cursor: pointer;
|
|
9848
|
+
}
|
|
9849
|
+
.lm_table_append_add_popover .ant-popover-inner-content ul li:hover {
|
|
9850
|
+
background-color: var(--color-15);
|
|
9851
|
+
}
|
|
9805
9852
|
.lm_filter_wrapper .lm_filter_container .lm_filter {
|
|
9806
9853
|
display: flex;
|
|
9807
9854
|
flex-wrap: wrap;
|
package/lib/IconFont/index.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _icons = require("@ant-design/icons");
|
|
9
9
|
|
|
10
10
|
var IconFont = (0, _icons.createFromIconfontCN)({
|
|
11
|
-
scriptUrl: '//at.alicdn.com/t/c/
|
|
11
|
+
scriptUrl: '//at.alicdn.com/t/c/font_2966019_neaxovtw4w.js' // 在 iconfont.cn 上生成
|
|
12
12
|
// scriptUrl: require('./font/iconfont.js'),
|
|
13
13
|
|
|
14
14
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: React.MemoExoticComponent<({ children, move }: {
|
|
2
3
|
children: any;
|
|
3
4
|
move: any;
|
|
4
|
-
}) => JSX.Element
|
|
5
|
-
export default
|
|
5
|
+
}) => JSX.Element>;
|
|
6
|
+
export default _default;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
12
|
var _core = require("@dnd-kit/core");
|
|
13
13
|
|
|
@@ -45,5 +45,6 @@ var DndContainer = function DndContainer(_ref) {
|
|
|
45
45
|
}, children);
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
var _default = DndContainer;
|
|
48
|
+
var _default = /*#__PURE__*/(0, _react.memo)(DndContainer);
|
|
49
|
+
|
|
49
50
|
exports.default = _default;
|
|
@@ -36,9 +36,11 @@ interface ILmColumns extends TableColumnType<any> {
|
|
|
36
36
|
export declare type TLmEditTable = {
|
|
37
37
|
onChange?: (data: any[]) => void;
|
|
38
38
|
columns: ILmColumns[];
|
|
39
|
+
virtual: boolean;
|
|
39
40
|
} & ILmEditTable;
|
|
40
41
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
41
42
|
onChange?: (data: any[]) => void;
|
|
42
43
|
columns: ILmColumns[];
|
|
44
|
+
virtual: boolean;
|
|
43
45
|
} & ILmEditTable & React.RefAttributes<unknown>>>;
|
|
44
46
|
export default _default;
|