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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
.ant-btn.lm-button {
|
|
2
|
-
border: 0;
|
|
3
2
|
display: inline-flex !important;
|
|
4
3
|
flex-direction: row;
|
|
5
4
|
align-items: center;
|
|
6
5
|
justify-content: center;
|
|
6
|
+
color: var(--font-color);
|
|
7
7
|
vertical-align: middle;
|
|
8
|
+
border: 1px solid var(--stroke-color);
|
|
8
9
|
box-shadow: none;
|
|
9
10
|
}
|
|
10
11
|
.ant-btn.lm-button .anticon {
|
|
@@ -22,12 +23,24 @@
|
|
|
22
23
|
white-space: nowrap;
|
|
23
24
|
}
|
|
24
25
|
.ant-btn.lm-button::before {
|
|
25
|
-
|
|
26
|
+
position: absolute;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
display: none;
|
|
29
|
+
background: #fff;
|
|
30
|
+
border-radius: inherit;
|
|
31
|
+
opacity: 0.35;
|
|
32
|
+
transition: opacity 0.2s;
|
|
33
|
+
content: '';
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
inset: -1px;
|
|
36
|
+
}
|
|
37
|
+
.ant-btn.lm-button.ant-btn-loading::before {
|
|
38
|
+
display: block;
|
|
26
39
|
}
|
|
27
40
|
.ant-btn.lm-button:disabled {
|
|
41
|
+
color: var(--disabled-font-color) !important;
|
|
28
42
|
background: var(--disabled-bg-color) !important;
|
|
29
43
|
border: 1px solid var(--disabled-border-color) !important;
|
|
30
|
-
color: var(--disabled-font-color) !important;
|
|
31
44
|
}
|
|
32
45
|
.ant-btn.lm-button > span:not(.anticon) {
|
|
33
46
|
font-size: 12px;
|
|
@@ -48,57 +61,46 @@
|
|
|
48
61
|
.ant-btn.lm-button-middle .anticon {
|
|
49
62
|
font-size: 16px;
|
|
50
63
|
}
|
|
51
|
-
.ant-btn.lm-button-default {
|
|
52
|
-
border: 1px solid var(--stroke-color);
|
|
53
|
-
color: var(--font-color);
|
|
54
|
-
}
|
|
55
|
-
.ant-btn.lm-button-default-hover,
|
|
56
|
-
.ant-btn.lm-button-default:hover {
|
|
57
|
-
border: 1px solid var(--primary-hover-color);
|
|
58
|
-
color: var(--primary-hover-color);
|
|
59
|
-
}
|
|
60
|
-
.ant-btn.lm-button-default.ant-btn-loading {
|
|
61
|
-
border-color: rgba(0, 0, 0, 0.15);
|
|
62
|
-
color: rgba(0, 0, 0, 0.15);
|
|
63
|
-
}
|
|
64
64
|
.ant-btn.lm-button-primary {
|
|
65
|
-
background: var(--primary-color);
|
|
66
65
|
color: #fff;
|
|
66
|
+
background: var(--primary-color);
|
|
67
|
+
border-color: var(--primary-color);
|
|
67
68
|
}
|
|
68
|
-
.ant-btn.lm-button-primary-hover,
|
|
69
69
|
.ant-btn.lm-button-primary:hover {
|
|
70
70
|
background: var(--primary-hover-color);
|
|
71
71
|
}
|
|
72
|
+
.ant-btn.lm-button-primary:active {
|
|
73
|
+
background-color: var(--primary-click-color);
|
|
74
|
+
}
|
|
72
75
|
.ant-btn.lm-button-primary.ant-btn-loading {
|
|
73
76
|
background: var(--primary-loading-color);
|
|
74
77
|
}
|
|
75
78
|
.ant-btn.lm-button-ghost {
|
|
76
79
|
color: var(--font-color);
|
|
77
|
-
border-color: var(--color-15);
|
|
78
80
|
background: transparent;
|
|
81
|
+
border: 1px solid var(--color-15);
|
|
79
82
|
}
|
|
80
83
|
.ant-btn.lm-button-danger {
|
|
81
|
-
border: 1px solid var(--error-color);
|
|
82
84
|
color: var(--error-color);
|
|
83
85
|
text-shadow: none;
|
|
86
|
+
border: 1px solid var(--error-color);
|
|
84
87
|
box-shadow: none;
|
|
85
88
|
}
|
|
86
|
-
.ant-btn.lm-button-danger-hover,
|
|
87
89
|
.ant-btn.lm-button-danger:hover {
|
|
88
|
-
border-color: var(--error-hover-color);
|
|
89
90
|
color: var(--error-hover-color);
|
|
91
|
+
border-color: var(--error-hover-color);
|
|
90
92
|
}
|
|
91
93
|
.ant-btn.lm-button-danger.ant-btn-loading {
|
|
92
|
-
border-color: var(--error-loading-color);
|
|
93
94
|
color: var(--error-hover-color);
|
|
95
|
+
border-color: var(--error-loading-color);
|
|
94
96
|
}
|
|
95
97
|
.ant-btn.lm-button-dashed {
|
|
96
98
|
border: 1px dashed var(--color-15);
|
|
97
99
|
}
|
|
98
100
|
.ant-btn.lm-button-link {
|
|
99
101
|
color: var(--primary-color);
|
|
102
|
+
border-color: transparent;
|
|
100
103
|
}
|
|
101
|
-
.ant-btn.lm-button-link-hover,
|
|
102
104
|
.ant-btn.lm-button-link:hover {
|
|
103
105
|
color: var(--primary-hover-color);
|
|
104
106
|
}
|
|
@@ -106,11 +108,12 @@
|
|
|
106
108
|
color: var(--primary-loading-color);
|
|
107
109
|
}
|
|
108
110
|
.ant-btn.lm-button-link[disabled] {
|
|
109
|
-
border: 0 !important;
|
|
110
111
|
background: transparent !important;
|
|
112
|
+
border: 0 !important;
|
|
111
113
|
}
|
|
112
114
|
.ant-btn.ant-btn-text {
|
|
113
115
|
background: transparent;
|
|
116
|
+
border-color: transparent;
|
|
114
117
|
}
|
|
115
118
|
.ant-btn.lm-button-icon-only .anticon {
|
|
116
119
|
font-size: 16px;
|
package/lib/Cascader/index.js
CHANGED
|
@@ -15,6 +15,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
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
|
|
|
@@ -38,7 +42,18 @@ var LMCascader = function LMCascader(props) {
|
|
|
38
42
|
_props$placeholder = props.placeholder,
|
|
39
43
|
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
|
40
44
|
defaultLabel = props.defaultLabel,
|
|
41
|
-
|
|
45
|
+
customDisabled = props.disabled,
|
|
46
|
+
customizeSize = props.size,
|
|
47
|
+
others = __rest(props // ===================== Disabled =====================
|
|
48
|
+
, ["children", "className", "dropdownClassName", "placeholder", "defaultLabel", "disabled", "size"]); // ===================== Disabled =====================
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var disabled = _react.default.useContext(_DisabledContext.default);
|
|
52
|
+
|
|
53
|
+
var size = _react.default.useContext(_SizeContext.default);
|
|
54
|
+
|
|
55
|
+
var mergeSize = customizeSize || size;
|
|
56
|
+
var mergedDisabled = customDisabled || disabled;
|
|
42
57
|
|
|
43
58
|
var displayRender = function displayRender(label, selectedOptions) {
|
|
44
59
|
var hasUndefined = selectedOptions.some(function (v) {
|
|
@@ -57,7 +72,10 @@ var LMCascader = function LMCascader(props) {
|
|
|
57
72
|
className: (0, _classnames.default)(prefixCls, className),
|
|
58
73
|
dropdownClassName: (0, _classnames.default)(prefixDropdownCls, dropdownClassName),
|
|
59
74
|
displayRender: displayRender
|
|
60
|
-
}, others
|
|
75
|
+
}, others, {
|
|
76
|
+
size: mergeSize,
|
|
77
|
+
disabled: mergedDisabled
|
|
78
|
+
}));
|
|
61
79
|
};
|
|
62
80
|
|
|
63
81
|
var _default = LMCascader;
|
package/lib/Descriptions/Cell.js
CHANGED
|
@@ -23,6 +23,7 @@ var Cell = function Cell(_ref) {
|
|
|
23
23
|
var itemPrefixCls = _ref.itemPrefixCls,
|
|
24
24
|
component = _ref.component,
|
|
25
25
|
span = _ref.span,
|
|
26
|
+
rowSpan = _ref.rowSpan,
|
|
26
27
|
className = _ref.className,
|
|
27
28
|
style = _ref.style,
|
|
28
29
|
labelStyle = _ref.labelStyle,
|
|
@@ -39,7 +40,8 @@ var Cell = function Cell(_ref) {
|
|
|
39
40
|
return /*#__PURE__*/React.createElement(Component, {
|
|
40
41
|
className: (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(itemPrefixCls, "-item-label"), notEmpty(label)), (0, _defineProperty2.default)(_classNames, "".concat(itemPrefixCls, "-item-content"), notEmpty(content)), _classNames), className),
|
|
41
42
|
style: style,
|
|
42
|
-
colSpan: span
|
|
43
|
+
colSpan: span,
|
|
44
|
+
rowSpan: rowSpan
|
|
43
45
|
}, notEmpty(label) && /*#__PURE__*/React.createElement("span", {
|
|
44
46
|
style: labelStyle
|
|
45
47
|
}, label), notEmpty(content) && /*#__PURE__*/React.createElement("span", {
|
|
@@ -50,7 +52,8 @@ var Cell = function Cell(_ref) {
|
|
|
50
52
|
return /*#__PURE__*/React.createElement(Component, {
|
|
51
53
|
className: (0, _classnames.default)("".concat(itemPrefixCls, "-item"), className),
|
|
52
54
|
style: style,
|
|
53
|
-
colSpan: span
|
|
55
|
+
colSpan: span,
|
|
56
|
+
rowSpan: rowSpan
|
|
54
57
|
}, /*#__PURE__*/React.createElement("div", {
|
|
55
58
|
className: "".concat(itemPrefixCls, "-item-container")
|
|
56
59
|
}, (label || label === 0) && /*#__PURE__*/React.createElement("span", {
|
package/lib/Descriptions/Row.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var _ = require("
|
|
14
|
+
var _ = require(".");
|
|
15
15
|
|
|
16
16
|
var _Cell = _interopRequireDefault(require("./Cell"));
|
|
17
17
|
|
|
@@ -37,6 +37,8 @@ function renderCells(items, _ref, _ref2) {
|
|
|
37
37
|
contentStyle = _ref3$props.contentStyle,
|
|
38
38
|
_ref3$props$span = _ref3$props.span,
|
|
39
39
|
span = _ref3$props$span === void 0 ? 1 : _ref3$props$span,
|
|
40
|
+
_ref3$props$rowSpan = _ref3$props.rowSpan,
|
|
41
|
+
rowSpan = _ref3$props$rowSpan === void 0 ? 1 : _ref3$props$rowSpan,
|
|
40
42
|
key = _ref3.key;
|
|
41
43
|
|
|
42
44
|
if (typeof component === 'string') {
|
|
@@ -47,6 +49,7 @@ function renderCells(items, _ref, _ref2) {
|
|
|
47
49
|
labelStyle: Object.assign(Object.assign({}, rootLabelStyle), labelStyle),
|
|
48
50
|
contentStyle: Object.assign(Object.assign({}, rootContentStyle), contentStyle),
|
|
49
51
|
span: span,
|
|
52
|
+
rowSpan: rowSpan,
|
|
50
53
|
colon: colon,
|
|
51
54
|
component: component,
|
|
52
55
|
itemPrefixCls: itemPrefixCls,
|
|
@@ -61,6 +64,7 @@ function renderCells(items, _ref, _ref2) {
|
|
|
61
64
|
className: className,
|
|
62
65
|
style: Object.assign(Object.assign(Object.assign({}, rootLabelStyle), style), labelStyle),
|
|
63
66
|
span: 1,
|
|
67
|
+
rowSpan: rowSpan,
|
|
64
68
|
colon: colon,
|
|
65
69
|
component: component[0],
|
|
66
70
|
itemPrefixCls: itemPrefixCls,
|
|
@@ -71,6 +75,7 @@ function renderCells(items, _ref, _ref2) {
|
|
|
71
75
|
className: className,
|
|
72
76
|
style: Object.assign(Object.assign(Object.assign({}, rootContentStyle), style), contentStyle),
|
|
73
77
|
span: span * 2 - 1,
|
|
78
|
+
rowSpan: rowSpan,
|
|
74
79
|
component: component[1],
|
|
75
80
|
itemPrefixCls: itemPrefixCls,
|
|
76
81
|
bordered: bordered,
|
|
@@ -21,7 +21,7 @@ export interface DescriptionsProps {
|
|
|
21
21
|
contentStyle?: React.CSSProperties;
|
|
22
22
|
containerType?: 'default' | 'drawer' | 'modal';
|
|
23
23
|
}
|
|
24
|
-
declare function Descriptions({ prefixCls: customizePrefixCls, title, extra, column, colon, bordered, layout, children, className, style, size, labelStyle, contentStyle, containerType }: DescriptionsProps): JSX.Element;
|
|
24
|
+
declare function Descriptions({ prefixCls: customizePrefixCls, title, extra, column, colon, bordered, layout, children, className, style, size, labelStyle, contentStyle, containerType, }: DescriptionsProps): JSX.Element;
|
|
25
25
|
declare namespace Descriptions {
|
|
26
26
|
var Item: React.FC<import("./Item").DescriptionsItemProps>;
|
|
27
27
|
}
|
|
@@ -167,9 +167,9 @@ function Descriptions(_ref) {
|
|
|
167
167
|
value: contextValue
|
|
168
168
|
}, /*#__PURE__*/React.createElement("div", {
|
|
169
169
|
className: (0, _classnames.default)(prefixCls, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-").concat(size), size && size !== 'default'), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-bordered"), !!bordered), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames), className, 'lm_descriptions', {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
lm_descriptions_default: containerType === 'default',
|
|
171
|
+
lm_descriptions_drawer: containerType === 'drawer',
|
|
172
|
+
lm_descriptions_modal: containerType === 'modal'
|
|
173
173
|
}),
|
|
174
174
|
style: style
|
|
175
175
|
}, (title || extra) && /*#__PURE__*/React.createElement("div", {
|
|
@@ -665,6 +665,9 @@ p {
|
|
|
665
665
|
padding-right: 24px;
|
|
666
666
|
padding-bottom: 8px;
|
|
667
667
|
}
|
|
668
|
+
.lm_descriptions .ant-descriptions-item:last-child {
|
|
669
|
+
padding-right: 0;
|
|
670
|
+
}
|
|
668
671
|
.lm_descriptions .ant-descriptions-item .ant-descriptions-item-container {
|
|
669
672
|
color: var(--color-85);
|
|
670
673
|
font-size: 12px;
|
|
@@ -153,6 +153,9 @@
|
|
|
153
153
|
padding-right: 24px;
|
|
154
154
|
padding-bottom: 8px;
|
|
155
155
|
}
|
|
156
|
+
.lm_descriptions .ant-descriptions-item:last-child {
|
|
157
|
+
padding-right: 0;
|
|
158
|
+
}
|
|
156
159
|
.lm_descriptions .ant-descriptions-item .ant-descriptions-item-container {
|
|
157
160
|
color: var(--color-85);
|
|
158
161
|
font-size: 12px;
|
package/lib/InputNumber/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -13,10 +15,12 @@ var _inputNumber = _interopRequireDefault(require("antd/es/input-number"));
|
|
|
13
15
|
|
|
14
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
17
|
|
|
16
|
-
var _react =
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
19
|
|
|
18
20
|
var _DisabledContext = _interopRequireDefault(require("../ConfigProvider/DisabledContext"));
|
|
19
21
|
|
|
22
|
+
var _SizeContext = _interopRequireDefault(require("../ConfigProvider/SizeContext"));
|
|
23
|
+
|
|
20
24
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
21
25
|
var t = {};
|
|
22
26
|
|
|
@@ -31,35 +35,40 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
var prefixCls = 'lm_input-number';
|
|
34
|
-
|
|
35
|
-
var LMInputNumber = function LMInputNumber(props) {
|
|
38
|
+
var LMInputNumber = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
36
39
|
var children = props.children,
|
|
37
40
|
className = props.className,
|
|
38
41
|
customDisabled = props.disabled,
|
|
42
|
+
customizeSize = props.size,
|
|
39
43
|
rest = __rest(props // ===================== Disabled =====================
|
|
40
|
-
, ["children", "className", "disabled"]); // ===================== Disabled =====================
|
|
44
|
+
, ["children", "className", "disabled", "size"]); // ===================== Disabled =====================
|
|
41
45
|
|
|
42
46
|
|
|
43
47
|
var disabled = _react.default.useContext(_DisabledContext.default);
|
|
44
48
|
|
|
45
|
-
var mergedDisabled = customDisabled || disabled;
|
|
49
|
+
var mergedDisabled = customDisabled || disabled; // ===================== size =====================
|
|
50
|
+
|
|
51
|
+
var size = _react.default.useContext(_SizeContext.default);
|
|
52
|
+
|
|
53
|
+
var mergeSize = customizeSize || size;
|
|
46
54
|
return /*#__PURE__*/_react.default.createElement(_inputNumber.default, Object.assign({
|
|
55
|
+
ref: ref,
|
|
47
56
|
className: (0, _classnames.default)(className, prefixCls),
|
|
48
|
-
disabled: mergedDisabled,
|
|
49
57
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
50
|
-
}, rest
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
}, rest, {
|
|
59
|
+
size: mergeSize,
|
|
60
|
+
disabled: mergedDisabled
|
|
61
|
+
}));
|
|
62
|
+
});
|
|
53
63
|
var CInputNumber = LMInputNumber;
|
|
54
|
-
|
|
55
|
-
CInputNumber.Price = function (props) {
|
|
64
|
+
CInputNumber.Price = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
56
65
|
return /*#__PURE__*/_react.default.createElement(_inputNumber.default, Object.assign({
|
|
57
66
|
prefix: "\uFFE5",
|
|
67
|
+
ref: ref,
|
|
58
68
|
formatter: function formatter(value) {
|
|
59
69
|
return "".concat(value).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
60
70
|
}
|
|
61
71
|
}, props));
|
|
62
|
-
};
|
|
63
|
-
|
|
72
|
+
});
|
|
64
73
|
var _default = CInputNumber;
|
|
65
74
|
exports.default = _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _Root = _interopRequireDefault(require("./wrapper/Root"));
|
|
15
|
+
|
|
16
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
|
|
19
|
+
for (var p in s) {
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
24
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var LmDrag = function LmDrag(_a, ref) {
|
|
30
|
+
var resetProps = __rest(_a, []);
|
|
31
|
+
|
|
32
|
+
var defaultRef = (0, _react.useRef)(null);
|
|
33
|
+
var defaultProps = Object.assign({
|
|
34
|
+
options: [],
|
|
35
|
+
rowKey: 'id'
|
|
36
|
+
}, resetProps);
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_Root.default, Object.assign({
|
|
38
|
+
ref: ref || defaultRef
|
|
39
|
+
}, defaultProps));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _default = /*#__PURE__*/(0, _react.forwardRef)(LmDrag);
|
|
43
|
+
|
|
44
|
+
exports.default = _default;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _core = require("@dnd-kit/core");
|
|
15
|
+
|
|
16
|
+
var _modifiers = require("@dnd-kit/modifiers");
|
|
17
|
+
|
|
18
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
19
|
+
|
|
20
|
+
var _sortableBox = _interopRequireDefault(require("./sortableBox"));
|
|
21
|
+
|
|
22
|
+
var DragOver = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
23
|
+
var instance = _ref.instance;
|
|
24
|
+
var isDragging = instance.isDragging,
|
|
25
|
+
activeId = instance.activeId,
|
|
26
|
+
rowKey = instance.rowKey,
|
|
27
|
+
children = instance.children,
|
|
28
|
+
options = instance.options;
|
|
29
|
+
var item = activeId && options.find(function (v) {
|
|
30
|
+
return v[rowKey] === activeId;
|
|
31
|
+
});
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_core.DragOverlay, {
|
|
33
|
+
adjustScale: false
|
|
34
|
+
}, isDragging ? children({
|
|
35
|
+
item: item,
|
|
36
|
+
listeners: {}
|
|
37
|
+
}) : null);
|
|
38
|
+
});
|
|
39
|
+
/*
|
|
40
|
+
* restrictToParentElement 拖拽限制在父元素内
|
|
41
|
+
*/
|
|
42
|
+
// 可拖拽容器
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var DndContainer = function DndContainer(_ref2) {
|
|
46
|
+
var options = _ref2.options,
|
|
47
|
+
rowKey = _ref2.rowKey,
|
|
48
|
+
children = _ref2.children,
|
|
49
|
+
move = _ref2.move;
|
|
50
|
+
|
|
51
|
+
var _React$useState = _react.default.useState(false),
|
|
52
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
53
|
+
isDragging = _React$useState2[0],
|
|
54
|
+
setIsDragging = _React$useState2[1]; // 是否拖拽中
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
var _React$useState3 = _react.default.useState(null),
|
|
58
|
+
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
59
|
+
activeId = _React$useState4[0],
|
|
60
|
+
setActiveId = _React$useState4[1]; // 是否拖拽中
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
var sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor), (0, _core.useSensor)(_core.KeyboardSensor, {
|
|
64
|
+
coordinateGetter: _sortable.sortableKeyboardCoordinates
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
var handleMove = function handleMove(activeItem, overItem) {
|
|
68
|
+
var fileMap = options.map(function (v) {
|
|
69
|
+
if (v[rowKey] === activeItem[rowKey]) {
|
|
70
|
+
return Object.assign({}, overItem);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (v[rowKey] === overItem[rowKey]) {
|
|
74
|
+
return Object.assign({}, activeItem);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return v;
|
|
78
|
+
});
|
|
79
|
+
move === null || move === void 0 ? void 0 : move(activeItem, overItem, fileMap);
|
|
80
|
+
}; // 开始拖拽
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
var handleDragStart = function handleDragStart(_ref3) {
|
|
84
|
+
var active = _ref3.active;
|
|
85
|
+
setIsDragging(true);
|
|
86
|
+
|
|
87
|
+
if (!active) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
setActiveId(active.id);
|
|
92
|
+
}; // 拖拽结束
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
var handleDragEnd = function handleDragEnd(event) {
|
|
96
|
+
var active = event.active,
|
|
97
|
+
over = event.over;
|
|
98
|
+
setActiveId(null); // 未移入时触发
|
|
99
|
+
|
|
100
|
+
if (!(over === null || over === void 0 ? void 0 : over.id)) {
|
|
101
|
+
return;
|
|
102
|
+
} // 移入时触发更新数据
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
if (active.id !== over.id) {
|
|
106
|
+
handleMove(active.data.current.item, over.data.current.item);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
var instance = {
|
|
111
|
+
isDragging: isDragging,
|
|
112
|
+
activeId: activeId,
|
|
113
|
+
options: options,
|
|
114
|
+
rowKey: rowKey,
|
|
115
|
+
children: children,
|
|
116
|
+
move: move,
|
|
117
|
+
items: options === null || options === void 0 ? void 0 : options.map(function (v) {
|
|
118
|
+
return v[rowKey];
|
|
119
|
+
})
|
|
120
|
+
};
|
|
121
|
+
return /*#__PURE__*/_react.default.createElement(_core.DndContext, {
|
|
122
|
+
sensors: sensors,
|
|
123
|
+
onDragStart: handleDragStart,
|
|
124
|
+
onDragEnd: handleDragEnd,
|
|
125
|
+
onDragCancel: function onDragCancel() {
|
|
126
|
+
return setActiveId(null);
|
|
127
|
+
},
|
|
128
|
+
modifiers: [_modifiers.restrictToParentElement],
|
|
129
|
+
collisionDetection: _core.closestCenter
|
|
130
|
+
}, /*#__PURE__*/_react.default.createElement(_sortableBox.default, {
|
|
131
|
+
instance: instance
|
|
132
|
+
}), /*#__PURE__*/_react.default.createElement(DragOver, {
|
|
133
|
+
instance: instance
|
|
134
|
+
}));
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
var _default = DndContainer;
|
|
138
|
+
exports.default = _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
13
|
+
|
|
14
|
+
var _sortableItem = _interopRequireDefault(require("./sortableItem"));
|
|
15
|
+
|
|
16
|
+
// rectSortingStrategy 可交换策略
|
|
17
|
+
var SortableBox = function SortableBox(_ref) {
|
|
18
|
+
var instance = _ref.instance;
|
|
19
|
+
var items = instance.items,
|
|
20
|
+
rowKey = instance.rowKey,
|
|
21
|
+
options = instance.options;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_sortable.SortableContext, {
|
|
23
|
+
items: items,
|
|
24
|
+
strategy: _sortable.rectSortingStrategy
|
|
25
|
+
}, options === null || options === void 0 ? void 0 : options.map(function (item, idx) {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_sortableItem.default, {
|
|
27
|
+
instance: instance,
|
|
28
|
+
index: idx,
|
|
29
|
+
key: item[rowKey] || idx,
|
|
30
|
+
item: item
|
|
31
|
+
});
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var _default = /*#__PURE__*/_react.default.memo(SortableBox);
|
|
36
|
+
|
|
37
|
+
exports.default = _default;
|