linkmore-design 1.0.35 → 1.0.36
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/CardTable/utils.d.ts +1 -1
- package/dist/Input/demos/after.d.ts +1 -1
- package/dist/Input/demos/base.d.ts +1 -1
- package/dist/Input/demos/basic.d.ts +1 -1
- package/dist/Input/demos/color.d.ts +1 -1
- package/dist/Input/demos/combination.d.ts +1 -1
- package/dist/Input/demos/import.d.ts +1 -1
- package/dist/Input/demos/line.d.ts +1 -1
- package/dist/Input/demos/password.d.ts +1 -1
- package/dist/Input/demos/size.d.ts +1 -1
- package/dist/Input/index.d.ts +10 -2
- package/dist/LmTable/demos/getData.d.ts +2 -0
- package/dist/index.umd.js +147 -43
- package/dist/index.umd.min.js +7 -7
- package/es/CustomTableOption/columnsSort.js +42 -11
- package/es/CustomTableOption/filterSort.js +34 -4
- package/es/CustomTableOption/index.js +25 -8
- package/es/CustomTableOption/style/index.css +29 -0
- package/es/EditTable/EditTable.js +25 -3
- package/es/Input/index.d.ts +11 -0
- package/es/Input/index.js +31 -37
- package/es/LmTable/Table.js +14 -12
- package/es/Radio/index.js +3 -2
- package/es/Radio/style/style.css +4 -0
- package/lib/CustomTableOption/columnsSort.js +42 -10
- package/lib/CustomTableOption/filterSort.js +33 -3
- package/lib/CustomTableOption/index.js +24 -7
- package/lib/CustomTableOption/style/index.css +29 -0
- package/lib/EditTable/EditTable.js +25 -3
- package/lib/Input/index.d.ts +11 -0
- package/lib/Input/index.js +24 -15
- package/lib/LmTable/Table.js +14 -12
- package/lib/Radio/index.js +3 -2
- package/lib/Radio/style/style.css +4 -0
- package/package.json +1 -1
|
@@ -2,10 +2,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import React, { useState, useMemo, useEffect, useImperativeHandle, forwardRef } from 'react';
|
|
3
3
|
import { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
|
|
4
4
|
import { arrayMove, useSortable, SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
5
|
-
import { IconFont, Checkbox } from 'linkmore-design';
|
|
5
|
+
import { IconFont, Checkbox, Input } from 'linkmore-design';
|
|
6
6
|
import { HolderOutlined } from '@ant-design/icons';
|
|
7
7
|
import { CSS } from '@dnd-kit/utilities';
|
|
8
8
|
import { cloneDeep } from 'lodash';
|
|
9
|
+
var Search = Input.Search;
|
|
9
10
|
|
|
10
11
|
var SortItem = function SortItem(props) {
|
|
11
12
|
var _a, _b, _c, _d;
|
|
@@ -82,20 +83,36 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
82
83
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
83
84
|
colStateValue = _useState4[0],
|
|
84
85
|
setColStateValue = _useState4[1];
|
|
86
|
+
/** 正在输入的查询条件 */
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
var _useState5 = useState(''),
|
|
90
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
91
|
+
searchIngValue = _useState6[0],
|
|
92
|
+
setSearchIngValue = _useState6[1];
|
|
93
|
+
|
|
94
|
+
var _useState7 = useState(''),
|
|
95
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
96
|
+
searchValue = _useState8[0],
|
|
97
|
+
setSearchValue = _useState8[1];
|
|
85
98
|
|
|
86
99
|
var sortMenu = useMemo(function () {
|
|
87
|
-
var
|
|
88
|
-
cloneCol.forEach(function (item, index) {
|
|
89
|
-
var _a, _b;
|
|
100
|
+
var _a;
|
|
90
101
|
|
|
91
|
-
|
|
92
|
-
var
|
|
102
|
+
var cloneCol = (_a = cloneDeep(localColumns)) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
|
|
103
|
+
var _a;
|
|
93
104
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
return ((_a = item.title) === null || _a === void 0 ? void 0 : _a.indexOf(searchValue)) > -1;
|
|
106
|
+
});
|
|
107
|
+
cloneCol.forEach(function (item, index) {
|
|
108
|
+
var _a, _b, _c;
|
|
97
109
|
|
|
98
|
-
|
|
110
|
+
if (ColumnsStateValue === null || ColumnsStateValue === void 0 ? void 0 : ColumnsStateValue.hasOwnProperty(item.dataIndex)) {
|
|
111
|
+
var order = (_a = ColumnsStateValue[item.dataIndex]) === null || _a === void 0 ? void 0 : _a.order;
|
|
112
|
+
item.fixed = ((_b = ColumnsStateValue[item.dataIndex]) === null || _b === void 0 ? void 0 : _b.fixed) || undefined;
|
|
113
|
+
item.order = [undefined, null].includes(order) ? index : order;
|
|
114
|
+
item.show = ((_c = ColumnsStateValue[item.dataIndex]) === null || _c === void 0 ? void 0 : _c.show) === false ? false : true;
|
|
115
|
+
}
|
|
99
116
|
});
|
|
100
117
|
var leftSortItem = [];
|
|
101
118
|
var rigthSortItem = [];
|
|
@@ -114,7 +131,7 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
114
131
|
rigthSortItem: rigthSortItem,
|
|
115
132
|
items: items
|
|
116
133
|
};
|
|
117
|
-
}, [localColumns, colStateValue]);
|
|
134
|
+
}, [localColumns, colStateValue, searchValue]);
|
|
118
135
|
var isCheckAll = useMemo(function () {
|
|
119
136
|
var showLength = localColumns.filter(function (item) {
|
|
120
137
|
return item.show !== false;
|
|
@@ -124,6 +141,12 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
124
141
|
checkAll: showLength.length === localColumns.length
|
|
125
142
|
};
|
|
126
143
|
}, [localColumns]);
|
|
144
|
+
/** 将当前输入的值,进行最后赋值,作自动计算使用 */
|
|
145
|
+
|
|
146
|
+
var handleSearch = function handleSearch() {
|
|
147
|
+
setSearchValue(searchIngValue);
|
|
148
|
+
};
|
|
149
|
+
|
|
127
150
|
useEffect(function () {
|
|
128
151
|
setLocalColumns(columns);
|
|
129
152
|
setColStateValue(ColumnsStateValue);
|
|
@@ -246,6 +269,14 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
246
269
|
return /*#__PURE__*/React.createElement("div", {
|
|
247
270
|
className: 'lm_custom_option_columns'
|
|
248
271
|
}, /*#__PURE__*/React.createElement("div", {
|
|
272
|
+
className: 'global_search'
|
|
273
|
+
}, /*#__PURE__*/React.createElement(Search, {
|
|
274
|
+
value: searchIngValue,
|
|
275
|
+
onChange: function onChange(e) {
|
|
276
|
+
return setSearchIngValue(e.target.value);
|
|
277
|
+
},
|
|
278
|
+
onSearch: handleSearch
|
|
279
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
249
280
|
className: 'global_setting'
|
|
250
281
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
251
282
|
indeterminate: isCheckAll.indeterminate,
|
|
@@ -2,11 +2,12 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import React, { useState, useMemo, useEffect, useImperativeHandle, forwardRef } from 'react';
|
|
3
3
|
import { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
|
|
4
4
|
import { arrayMove, useSortable, SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
5
|
-
import { Checkbox } from 'linkmore-design';
|
|
5
|
+
import { Checkbox, Input } from 'linkmore-design';
|
|
6
6
|
import { HolderOutlined } from '@ant-design/icons';
|
|
7
7
|
import { CSS } from '@dnd-kit/utilities';
|
|
8
8
|
import { cloneDeep } from 'lodash';
|
|
9
9
|
var UNLLVALUE = [null, undefined];
|
|
10
|
+
var Search = Input.Search;
|
|
10
11
|
|
|
11
12
|
var SortItem = function SortItem(props) {
|
|
12
13
|
var _a, _b;
|
|
@@ -56,6 +57,18 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
56
57
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
58
|
colStateValue = _useState4[0],
|
|
58
59
|
setColStateValue = _useState4[1];
|
|
60
|
+
/** 正在输入的查询条件 */
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
var _useState5 = useState(''),
|
|
64
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
65
|
+
searchIngValue = _useState6[0],
|
|
66
|
+
setSearchIngValue = _useState6[1];
|
|
67
|
+
|
|
68
|
+
var _useState7 = useState(''),
|
|
69
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
70
|
+
searchValue = _useState8[0],
|
|
71
|
+
setSearchValue = _useState8[1];
|
|
59
72
|
|
|
60
73
|
var sortMenu = useMemo(function () {
|
|
61
74
|
var cloneCol = cloneDeep(localFilter);
|
|
@@ -66,8 +79,12 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
66
79
|
item.order = order !== undefined && order !== null ? order : UNLLVALUE.includes(item.order) ? index : item.order;
|
|
67
80
|
item.show = ((_b = filterStateValue[item.field]) === null || _b === void 0 ? void 0 : _b.show) === false ? false : UNLLVALUE.includes(item.show) ? true : !!item.show;
|
|
68
81
|
});
|
|
69
|
-
return cloneCol
|
|
70
|
-
|
|
82
|
+
return cloneCol.filter(function (item) {
|
|
83
|
+
var _a;
|
|
84
|
+
|
|
85
|
+
return ((_a = item.title) === null || _a === void 0 ? void 0 : _a.indexOf(searchValue)) > -1;
|
|
86
|
+
});
|
|
87
|
+
}, [localFilter, colStateValue, searchValue]);
|
|
71
88
|
var isCheckAll = useMemo(function () {
|
|
72
89
|
var showLength = localFilter.filter(function (item) {
|
|
73
90
|
return item.show !== false;
|
|
@@ -77,6 +94,12 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
77
94
|
checkAll: showLength.length === localFilter.length
|
|
78
95
|
};
|
|
79
96
|
}, [localFilter]);
|
|
97
|
+
/** 将当前输入的值,进行最后赋值,作自动计算使用 */
|
|
98
|
+
|
|
99
|
+
var handleSearch = function handleSearch() {
|
|
100
|
+
setSearchValue(searchIngValue);
|
|
101
|
+
};
|
|
102
|
+
|
|
80
103
|
useEffect(function () {
|
|
81
104
|
console.log(localFilter, 'localFilter');
|
|
82
105
|
}, [localFilter]);
|
|
@@ -101,7 +124,6 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
101
124
|
var newIndex = items.findIndex(function (s) {
|
|
102
125
|
return s.field === over.id;
|
|
103
126
|
});
|
|
104
|
-
console.log(arrayMove(items, oldIndex, newIndex), 77);
|
|
105
127
|
return arrayMove(items, oldIndex, newIndex).map(function (item, index) {
|
|
106
128
|
return Object.assign(Object.assign({}, item), {
|
|
107
129
|
order: index
|
|
@@ -163,6 +185,14 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
163
185
|
return /*#__PURE__*/React.createElement("div", {
|
|
164
186
|
className: 'lm_custom_option_columns'
|
|
165
187
|
}, /*#__PURE__*/React.createElement("div", {
|
|
188
|
+
className: 'global_search'
|
|
189
|
+
}, /*#__PURE__*/React.createElement(Search, {
|
|
190
|
+
value: searchIngValue,
|
|
191
|
+
onChange: function onChange(e) {
|
|
192
|
+
return setSearchIngValue(e.target.value);
|
|
193
|
+
},
|
|
194
|
+
onSearch: handleSearch
|
|
195
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
166
196
|
className: 'global_setting'
|
|
167
197
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
168
198
|
indeterminate: isCheckAll.indeterminate,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import React, { forwardRef, useState, useEffect, useRef } from 'react';
|
|
3
|
-
import { Drawer, Tabs, Radio, IconFont, Space, Button } from 'linkmore-design';
|
|
3
|
+
import { Drawer, Tabs, Radio, IconFont, Space, Button, Switch } from 'linkmore-design';
|
|
4
4
|
import ColumnsSort from './columnsSort';
|
|
5
5
|
import FilterSort from './filterSort';
|
|
6
6
|
import classNames from 'classnames';
|
|
@@ -35,15 +35,22 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
35
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
36
|
visible = _useState2[0],
|
|
37
37
|
setVisible = _useState2[1];
|
|
38
|
+
/** 是否记住页面使用状态 */
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
|
|
41
|
+
var _useState3 = useState(false),
|
|
42
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
43
|
+
saveSetting = _useState4[0],
|
|
44
|
+
setSaveSetting = _useState4[1];
|
|
45
|
+
|
|
46
|
+
var _useState5 = useState({
|
|
40
47
|
filter: [],
|
|
41
48
|
columns: [],
|
|
42
49
|
size: 'small'
|
|
43
50
|
}),
|
|
44
|
-
|
|
45
|
-
lmOptions =
|
|
46
|
-
setLmOptions =
|
|
51
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
52
|
+
lmOptions = _useState6[0],
|
|
53
|
+
setLmOptions = _useState6[1];
|
|
47
54
|
|
|
48
55
|
var openSetting = function openSetting() {
|
|
49
56
|
setVisible(true);
|
|
@@ -55,7 +62,7 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
55
62
|
columns: props.columns,
|
|
56
63
|
size: props.size || 'small'
|
|
57
64
|
});
|
|
58
|
-
}, []);
|
|
65
|
+
}, [props.filter, props.columns, props.size]);
|
|
59
66
|
/** 提交按钮 */
|
|
60
67
|
|
|
61
68
|
var onOk = function onOk() {
|
|
@@ -75,7 +82,8 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
75
82
|
ColStateValue: ColStateValue,
|
|
76
83
|
filterData: filterData,
|
|
77
84
|
filterStateValue: filterStateValue,
|
|
78
|
-
size: lmOptions.size
|
|
85
|
+
size: lmOptions.size,
|
|
86
|
+
saveSetting: saveSetting
|
|
79
87
|
});
|
|
80
88
|
setVisible(false);
|
|
81
89
|
};
|
|
@@ -130,7 +138,6 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
130
138
|
size: e.target.value
|
|
131
139
|
}));
|
|
132
140
|
},
|
|
133
|
-
direction: 'row',
|
|
134
141
|
className: 'lm_size_radio_group',
|
|
135
142
|
value: lmOptions.size
|
|
136
143
|
}, optionsWithDisabled.map(function (item) {
|
|
@@ -138,10 +145,20 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
138
145
|
className: 'lm_custom_size_warp',
|
|
139
146
|
key: item.value
|
|
140
147
|
}, /*#__PURE__*/React.createElement("img", {
|
|
148
|
+
onClick: function onClick() {
|
|
149
|
+
return setLmOptions(Object.assign(Object.assign({}, lmOptions), {
|
|
150
|
+
size: item.value
|
|
151
|
+
}));
|
|
152
|
+
},
|
|
141
153
|
src: item.imgUrl
|
|
142
154
|
}), /*#__PURE__*/React.createElement(Radio, {
|
|
143
155
|
value: item.value
|
|
144
156
|
}, item.label));
|
|
157
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: 'save_setting'
|
|
159
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u662F\u5426\u8BB0\u4F4F\u9875\u9762\u4F7F\u7528\u72B6\u6001"), /*#__PURE__*/React.createElement(Switch, {
|
|
160
|
+
checked: saveSetting,
|
|
161
|
+
onChange: setSaveSetting
|
|
145
162
|
}))))));
|
|
146
163
|
});
|
|
147
164
|
export default LMCustomTableOption;
|
|
@@ -503,6 +503,15 @@ html {
|
|
|
503
503
|
.card_cell_content:hover .card_cell_body .card_cell_checkbox {
|
|
504
504
|
opacity: 1;
|
|
505
505
|
}
|
|
506
|
+
.lm_custom-table-option.lm_drawer .ant-drawer-body {
|
|
507
|
+
padding: 0 0 24px 0;
|
|
508
|
+
}
|
|
509
|
+
.lm_custom-table-option.lm_drawer .ant-drawer-body .ant-tabs-nav-wrap {
|
|
510
|
+
padding: 0 24px;
|
|
511
|
+
}
|
|
512
|
+
.lm_custom-table-option.lm_drawer .ant-drawer-body .ant-tabs-content-holder {
|
|
513
|
+
padding: 0 24px;
|
|
514
|
+
}
|
|
506
515
|
.lm_custom_option_columns .global_setting {
|
|
507
516
|
height: 44px;
|
|
508
517
|
background-color: var(--color-4);
|
|
@@ -516,6 +525,10 @@ html {
|
|
|
516
525
|
.lm_custom_option_columns .global_setting .lm-checkbox > span {
|
|
517
526
|
font-size: 12px;
|
|
518
527
|
}
|
|
528
|
+
.lm_custom_option_columns .global_setting > span {
|
|
529
|
+
color: var(--primary-color);
|
|
530
|
+
cursor: pointer;
|
|
531
|
+
}
|
|
519
532
|
.lm_custom_option_columns .fixed_title {
|
|
520
533
|
color: var(--color-45);
|
|
521
534
|
font-size: 12px;
|
|
@@ -549,6 +562,9 @@ html {
|
|
|
549
562
|
.lm_custom_size_warp {
|
|
550
563
|
display: flex;
|
|
551
564
|
flex-direction: column;
|
|
565
|
+
align-items: center;
|
|
566
|
+
justify-content: center;
|
|
567
|
+
cursor: pointer;
|
|
552
568
|
}
|
|
553
569
|
.lm_custom_size_warp > img {
|
|
554
570
|
width: 100px;
|
|
@@ -562,3 +578,16 @@ html {
|
|
|
562
578
|
align-items: center;
|
|
563
579
|
justify-content: space-between;
|
|
564
580
|
}
|
|
581
|
+
.save_setting {
|
|
582
|
+
height: 68px;
|
|
583
|
+
margin-top: 24px;
|
|
584
|
+
border-top: 1px solid var(--color-6);
|
|
585
|
+
border-bottom: 1px solid var(--color-6);
|
|
586
|
+
display: flex;
|
|
587
|
+
align-items: center;
|
|
588
|
+
justify-content: space-between;
|
|
589
|
+
font-size: 12px;
|
|
590
|
+
}
|
|
591
|
+
.global_search {
|
|
592
|
+
margin-bottom: 16px;
|
|
593
|
+
}
|
|
@@ -211,6 +211,16 @@ var EditableRow = function EditableRow(_ref3) {
|
|
|
211
211
|
value: form
|
|
212
212
|
}, /*#__PURE__*/_react.default.createElement("tr", props)));
|
|
213
213
|
};
|
|
214
|
+
|
|
215
|
+
var isValidValue = function isValidValue(verifyValue) {
|
|
216
|
+
var toStringValue = JSON.stringify(verifyValue);
|
|
217
|
+
|
|
218
|
+
if (verifyValue === undefined || verifyValue === null || verifyValue === '' || toStringValue === '[]' || toStringValue === '{}') {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return true;
|
|
223
|
+
};
|
|
214
224
|
/*
|
|
215
225
|
表格单元格
|
|
216
226
|
editEnum: 下拉框时的数据数组(非数组时是配置设置)
|
|
@@ -243,6 +253,8 @@ var EditableCell = function EditableCell(props) {
|
|
|
243
253
|
setEditing = _useState2[1];
|
|
244
254
|
|
|
245
255
|
var focusCapturedRef = (0, _react.useRef)(false);
|
|
256
|
+
var curValue = (0, _lodash.get)(record, dataIndex);
|
|
257
|
+
var curValueIsValid = isValidValue(curValue);
|
|
246
258
|
|
|
247
259
|
var getDefaultChildNode = function getDefaultChildNode() {
|
|
248
260
|
var focusCaptured = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -260,8 +272,18 @@ var EditableCell = function EditableCell(props) {
|
|
|
260
272
|
}
|
|
261
273
|
}
|
|
262
274
|
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
275
|
+
if (isHoverEdit && editable) {
|
|
276
|
+
if (focusCaptured) {
|
|
277
|
+
childNode = /*#__PURE__*/_react.default.createElement(_form.default.Item, (0, _extends2.default)({
|
|
278
|
+
style: {
|
|
279
|
+
margin: 0
|
|
280
|
+
}
|
|
281
|
+
}, itemProps, {
|
|
282
|
+
name: dataIndex
|
|
283
|
+
}), Control(editable));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (!curValueIsValid) {
|
|
265
287
|
childNode = /*#__PURE__*/_react.default.createElement(_form.default.Item, (0, _extends2.default)({
|
|
266
288
|
style: {
|
|
267
289
|
margin: 0
|
|
@@ -474,7 +496,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
474
496
|
var isOpenEdit = isEdit && focusCapturedRef.current || isHoverEdit && focusCapturedRef.current;
|
|
475
497
|
var classNames = (0, _classnames.default)({
|
|
476
498
|
'lm_base_editTable_cell': true,
|
|
477
|
-
'lm_base_editTable_cell_edit': isOpenEdit
|
|
499
|
+
'lm_base_editTable_cell_edit': isOpenEdit || isHoverEdit && !curValueIsValid
|
|
478
500
|
});
|
|
479
501
|
var extensionConfig = {};
|
|
480
502
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Input } from 'antd';
|
|
2
|
+
import type { InputProps, InputRef } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
interface ILmInput extends React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>> {
|
|
5
|
+
Group: typeof Input.Group;
|
|
6
|
+
Search: typeof Input.Search;
|
|
7
|
+
TextArea: typeof Input.TextArea;
|
|
8
|
+
Password: typeof Input.Password;
|
|
9
|
+
}
|
|
10
|
+
declare const LmInput: ILmInput;
|
|
11
|
+
export default LmInput;
|
package/es/Input/index.js
CHANGED
|
@@ -1,47 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
5
|
+
var t = {};
|
|
4
6
|
|
|
5
|
-
var
|
|
7
|
+
for (var p in s) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
9
|
+
}
|
|
6
10
|
|
|
7
|
-
Object.
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
require("antd/es/input/style");
|
|
13
|
-
|
|
14
|
-
var _input = _interopRequireDefault(require("antd/es/input"));
|
|
15
|
-
|
|
16
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
17
|
-
|
|
18
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _IconFont = _interopRequireDefault(require("../IconFont"));
|
|
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
|
+
};
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var LmInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
17
|
+
import React, { forwardRef } from 'react';
|
|
18
|
+
import IconFont from '../IconFont';
|
|
19
|
+
var LmInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
28
20
|
var _props$allowClear = props.allowClear,
|
|
29
21
|
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
30
|
-
rest = (
|
|
31
|
-
|
|
22
|
+
rest = __rest(props, ["allowClear"]);
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement(_Input, Object.assign({
|
|
32
25
|
ref: ref,
|
|
33
26
|
className: "lm_input"
|
|
34
27
|
}, rest, {
|
|
35
28
|
allowClear: true
|
|
36
29
|
}));
|
|
37
30
|
});
|
|
38
|
-
LmInput.Group =
|
|
39
|
-
LmInput.Search = /*#__PURE__*/
|
|
31
|
+
LmInput.Group = _Input.Group;
|
|
32
|
+
LmInput.Search = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
40
33
|
var _props$allowClear2 = props.allowClear,
|
|
41
34
|
allowClear = _props$allowClear2 === void 0 ? true : _props$allowClear2,
|
|
42
|
-
rest = (
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
rest = __rest(props, ["allowClear"]);
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React.createElement(_Input.Search, Object.assign({
|
|
38
|
+
enterButton: /*#__PURE__*/React.createElement(IconFont, {
|
|
45
39
|
type: "lmweb-search"
|
|
46
40
|
})
|
|
47
41
|
}, rest, {
|
|
@@ -50,18 +44,19 @@ LmInput.Search = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
50
44
|
className: "lm_input_search"
|
|
51
45
|
}));
|
|
52
46
|
});
|
|
53
|
-
LmInput.TextArea =
|
|
47
|
+
LmInput.TextArea = _Input.TextArea;
|
|
54
48
|
|
|
55
49
|
LmInput.Password = function (props) {
|
|
56
50
|
var _props$allowClear3 = props.allowClear,
|
|
57
51
|
allowClear = _props$allowClear3 === void 0 ? true : _props$allowClear3,
|
|
58
|
-
rest = (
|
|
59
|
-
|
|
52
|
+
rest = __rest(props, ["allowClear"]);
|
|
53
|
+
|
|
54
|
+
return /*#__PURE__*/React.createElement(_Input.Password, Object.assign({
|
|
60
55
|
className: "lm_input_password",
|
|
61
56
|
iconRender: function iconRender(visible) {
|
|
62
|
-
return visible ? /*#__PURE__*/
|
|
57
|
+
return visible ? /*#__PURE__*/React.createElement(IconFont, {
|
|
63
58
|
type: "lmweb-eye"
|
|
64
|
-
}) : /*#__PURE__*/
|
|
59
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
65
60
|
type: "lmweb-eye-close"
|
|
66
61
|
});
|
|
67
62
|
}
|
|
@@ -70,5 +65,4 @@ LmInput.Password = function (props) {
|
|
|
70
65
|
}));
|
|
71
66
|
};
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
exports.default = _default;
|
|
68
|
+
export default LmInput;
|
package/es/LmTable/Table.js
CHANGED
|
@@ -291,7 +291,8 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
291
291
|
selectedRows: value
|
|
292
292
|
});
|
|
293
293
|
rowClick === null || rowClick === void 0 ? void 0 : rowClick(value);
|
|
294
|
-
}
|
|
294
|
+
},
|
|
295
|
+
checkboxRecords: useSelectedRows.selectedRows
|
|
295
296
|
};
|
|
296
297
|
}); // loading触发清空选中状态
|
|
297
298
|
|
|
@@ -337,6 +338,18 @@ var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
337
338
|
var _props$autoSizer = props.autoSizer,
|
|
338
339
|
autoSizer = _props$autoSizer === void 0 ? false : _props$autoSizer;
|
|
339
340
|
|
|
341
|
+
var _useState9 = (0, _react.useState)({
|
|
342
|
+
width: '100%',
|
|
343
|
+
height: '100%'
|
|
344
|
+
}),
|
|
345
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
346
|
+
tableSize = _useState10[0],
|
|
347
|
+
setTableSize = _useState10[1];
|
|
348
|
+
|
|
349
|
+
var defaultRef = ref || (0, _react.useRef)(null);
|
|
350
|
+
var tableWarpRef = (0, _react.useRef)(null);
|
|
351
|
+
var resizeRef = (0, _react.useRef)(null);
|
|
352
|
+
|
|
340
353
|
if (!autoSizer) {
|
|
341
354
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
342
355
|
ref: tableWarpRef,
|
|
@@ -355,17 +368,6 @@ var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
355
368
|
})));
|
|
356
369
|
}
|
|
357
370
|
|
|
358
|
-
var _useState9 = (0, _react.useState)({
|
|
359
|
-
width: '100%',
|
|
360
|
-
height: '100%'
|
|
361
|
-
}),
|
|
362
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
363
|
-
tableSize = _useState10[0],
|
|
364
|
-
setTableSize = _useState10[1];
|
|
365
|
-
|
|
366
|
-
var defaultRef = ref || (0, _react.useRef)(null);
|
|
367
|
-
var tableWarpRef = (0, _react.useRef)(null);
|
|
368
|
-
var resizeRef = (0, _react.useRef)(null);
|
|
369
371
|
var resetHeight = (0, _react.useMemo)(function () {
|
|
370
372
|
var height = tableSize.height;
|
|
371
373
|
var h = height - 32;
|
package/es/Radio/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
20
20
|
var _react = _interopRequireDefault(require("react"));
|
|
21
21
|
|
|
22
22
|
var _excluded = ["children"],
|
|
23
|
-
_excluded2 = ["children", "size", "buttonStyle", "direction"];
|
|
23
|
+
_excluded2 = ["children", "size", "buttonStyle", "direction", "className"];
|
|
24
24
|
|
|
25
25
|
var LMRadio = function LMRadio(props) {
|
|
26
26
|
var children = props.children,
|
|
@@ -37,10 +37,11 @@ LMRadio.Group = function (props) {
|
|
|
37
37
|
buttonStyle = props.buttonStyle,
|
|
38
38
|
_props$direction = props.direction,
|
|
39
39
|
direction = _props$direction === void 0 ? 'row' : _props$direction,
|
|
40
|
+
className = props.className,
|
|
40
41
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded2);
|
|
41
42
|
console.log(children, 'rrr');
|
|
42
43
|
return /*#__PURE__*/_react.default.createElement(_radio.default.Group, (0, _extends2.default)({
|
|
43
|
-
className: (0, _classnames.default)('lm-radio-group', "lm-radio-group-".concat(direction)),
|
|
44
|
+
className: (0, _classnames.default)(className, 'lm-radio-group', "lm-radio-group-".concat(direction)),
|
|
44
45
|
size: size
|
|
45
46
|
}, restProps), children);
|
|
46
47
|
};
|
package/es/Radio/style/style.css
CHANGED
|
@@ -119,6 +119,10 @@
|
|
|
119
119
|
.lm-radio-group .ant-radio-button-wrapper-disabled:hover {
|
|
120
120
|
color: var(--disabled-font-color);
|
|
121
121
|
}
|
|
122
|
+
.lm-radio-group.lm-radio-group-row {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: row;
|
|
125
|
+
}
|
|
122
126
|
.lm-radio-group.lm-radio-group-column {
|
|
123
127
|
display: flex;
|
|
124
128
|
flex-direction: column;
|
|
@@ -25,6 +25,8 @@ var _utilities = require("@dnd-kit/utilities");
|
|
|
25
25
|
|
|
26
26
|
var _lodash = require("lodash");
|
|
27
27
|
|
|
28
|
+
var Search = _linkmoreDesign.Input.Search;
|
|
29
|
+
|
|
28
30
|
var SortItem = function SortItem(props) {
|
|
29
31
|
var _a, _b, _c, _d;
|
|
30
32
|
|
|
@@ -100,20 +102,36 @@ var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
100
102
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
101
103
|
colStateValue = _useState4[0],
|
|
102
104
|
setColStateValue = _useState4[1];
|
|
105
|
+
/** 正在输入的查询条件 */
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
var _useState5 = (0, _react.useState)(''),
|
|
109
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
110
|
+
searchIngValue = _useState6[0],
|
|
111
|
+
setSearchIngValue = _useState6[1];
|
|
112
|
+
|
|
113
|
+
var _useState7 = (0, _react.useState)(''),
|
|
114
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
115
|
+
searchValue = _useState8[0],
|
|
116
|
+
setSearchValue = _useState8[1];
|
|
103
117
|
|
|
104
118
|
var sortMenu = (0, _react.useMemo)(function () {
|
|
105
|
-
var
|
|
106
|
-
cloneCol.forEach(function (item, index) {
|
|
107
|
-
var _a, _b;
|
|
119
|
+
var _a;
|
|
108
120
|
|
|
109
|
-
|
|
110
|
-
var
|
|
121
|
+
var cloneCol = (_a = (0, _lodash.cloneDeep)(localColumns)) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
|
|
122
|
+
var _a;
|
|
111
123
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
return ((_a = item.title) === null || _a === void 0 ? void 0 : _a.indexOf(searchValue)) > -1;
|
|
125
|
+
});
|
|
126
|
+
cloneCol.forEach(function (item, index) {
|
|
127
|
+
var _a, _b, _c;
|
|
115
128
|
|
|
116
|
-
|
|
129
|
+
if (ColumnsStateValue === null || ColumnsStateValue === void 0 ? void 0 : ColumnsStateValue.hasOwnProperty(item.dataIndex)) {
|
|
130
|
+
var order = (_a = ColumnsStateValue[item.dataIndex]) === null || _a === void 0 ? void 0 : _a.order;
|
|
131
|
+
item.fixed = ((_b = ColumnsStateValue[item.dataIndex]) === null || _b === void 0 ? void 0 : _b.fixed) || undefined;
|
|
132
|
+
item.order = [undefined, null].includes(order) ? index : order;
|
|
133
|
+
item.show = ((_c = ColumnsStateValue[item.dataIndex]) === null || _c === void 0 ? void 0 : _c.show) === false ? false : true;
|
|
134
|
+
}
|
|
117
135
|
});
|
|
118
136
|
var leftSortItem = [];
|
|
119
137
|
var rigthSortItem = [];
|
|
@@ -132,7 +150,7 @@ var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
132
150
|
rigthSortItem: rigthSortItem,
|
|
133
151
|
items: items
|
|
134
152
|
};
|
|
135
|
-
}, [localColumns, colStateValue]);
|
|
153
|
+
}, [localColumns, colStateValue, searchValue]);
|
|
136
154
|
var isCheckAll = (0, _react.useMemo)(function () {
|
|
137
155
|
var showLength = localColumns.filter(function (item) {
|
|
138
156
|
return item.show !== false;
|
|
@@ -142,6 +160,12 @@ var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
142
160
|
checkAll: showLength.length === localColumns.length
|
|
143
161
|
};
|
|
144
162
|
}, [localColumns]);
|
|
163
|
+
/** 将当前输入的值,进行最后赋值,作自动计算使用 */
|
|
164
|
+
|
|
165
|
+
var handleSearch = function handleSearch() {
|
|
166
|
+
setSearchValue(searchIngValue);
|
|
167
|
+
};
|
|
168
|
+
|
|
145
169
|
(0, _react.useEffect)(function () {
|
|
146
170
|
setLocalColumns(columns);
|
|
147
171
|
setColStateValue(ColumnsStateValue);
|
|
@@ -264,6 +288,14 @@ var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
264
288
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
265
289
|
className: 'lm_custom_option_columns'
|
|
266
290
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
291
|
+
className: 'global_search'
|
|
292
|
+
}, /*#__PURE__*/_react.default.createElement(Search, {
|
|
293
|
+
value: searchIngValue,
|
|
294
|
+
onChange: function onChange(e) {
|
|
295
|
+
return setSearchIngValue(e.target.value);
|
|
296
|
+
},
|
|
297
|
+
onSearch: handleSearch
|
|
298
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
267
299
|
className: 'global_setting'
|
|
268
300
|
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Checkbox, {
|
|
269
301
|
indeterminate: isCheckAll.indeterminate,
|