linkmore-design 1.0.57 → 1.0.60
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/LmCardTable.d.ts +1 -0
- package/dist/CardTable/fns/index.d.ts +1 -0
- package/dist/Empty/demos/custom.d.ts +2 -0
- package/dist/Empty/empty.d.ts +2 -0
- package/dist/Empty/index.d.ts +18 -3
- package/dist/Empty/simple.d.ts +2 -0
- package/dist/Form/container.d.ts +8 -0
- package/dist/Form/demos/error-tip.d.ts +2 -0
- package/dist/Form/demos/responsive.d.ts +2 -0
- package/dist/Form/index.d.ts +10 -2
- package/dist/LmEditTable/demos/sinleEdit.d.ts +2 -0
- package/dist/LmFilter/customFilter/index.d.ts +3 -1
- package/dist/LmFilter/filterFns/index.d.ts +4 -1
- package/dist/LmFilter/utils.d.ts +1 -1
- package/dist/index.umd.js +498 -208
- package/dist/index.umd.min.js +6 -6
- package/es/CardTable/LmCardTable.js +4 -1
- package/es/CardTable/body/TableBodyCell.js +10 -5
- package/es/CardTable/card/PictureTextRow.js +8 -3
- package/es/CardTable/fns/index.js +29 -2
- package/es/CardTable/style/index.css +8 -1
- package/es/CardTable/table/TableRoot.js +46 -13
- package/es/CustomTableOption/cardSort.js +0 -3
- package/es/CustomTableOption/columnsSort.js +2 -4
- package/es/CustomTableOption/filterSort.js +0 -3
- package/es/CustomTableOption/index.js +2 -2
- package/es/Dropdown/index.js +2 -2
- package/es/Dropdown/style/index.css +19 -1
- package/es/Empty/empty.d.ts +2 -0
- package/es/Empty/empty.js +55 -0
- package/es/Empty/index.d.ts +18 -3
- package/es/Empty/index.js +100 -1
- package/es/Empty/simple.d.ts +2 -0
- package/es/Empty/simple.js +36 -0
- package/es/Empty/style/index.css +44 -0
- package/es/Form/container.d.ts +8 -0
- package/es/Form/container.js +97 -0
- package/es/Form/index.d.ts +10 -2
- package/es/Form/index.js +30 -2
- package/es/Form/style/index.css +116 -0
- package/es/IconFont/index.js +1 -1
- package/es/LmEditTable/EditTable.js +47 -17
- package/es/LmFilter/Controls/index.js +32 -2
- package/es/LmFilter/LmFilter.js +1 -1
- package/es/LmFilter/baseFilter/index.js +2 -1
- package/es/LmFilter/complexFilter/drawer.js +33 -32
- package/es/LmFilter/components/CascaderFilter.js +35 -35
- package/es/LmFilter/components/CheckboxFilter.js +13 -21
- package/es/LmFilter/components/DateFilter.js +53 -29
- package/es/LmFilter/components/DropdownFIlter.js +51 -22
- package/es/LmFilter/components/SelectFilter.js +2 -3
- package/es/LmFilter/components/index.js +5 -61
- package/es/LmFilter/customFilter/index.js +3 -2
- package/es/LmFilter/filterFns/index.js +65 -25
- package/es/LmFilter/style/style.css +2 -1
- package/es/LmFilter/utils.js +63 -14
- package/es/LmFilter/wrapper/Filter.js +6 -3
- package/es/LmFilter/wrapper/FilterRoot.js +29 -22
- package/es/LmTable/Table.js +8 -6
- package/lib/CardTable/LmCardTable.js +4 -1
- package/lib/CardTable/body/TableBodyCell.js +10 -5
- package/lib/CardTable/card/PictureTextRow.js +8 -3
- package/lib/CardTable/fns/index.js +29 -2
- package/lib/CardTable/style/index.css +8 -1
- package/lib/CardTable/table/TableRoot.js +46 -13
- package/lib/CustomTableOption/cardSort.js +0 -3
- package/lib/CustomTableOption/columnsSort.js +2 -4
- package/lib/CustomTableOption/filterSort.js +0 -3
- package/lib/CustomTableOption/index.js +2 -2
- package/lib/Dropdown/index.js +2 -2
- package/lib/Dropdown/style/index.css +19 -1
- package/lib/Empty/empty.d.ts +2 -0
- package/lib/Empty/empty.js +66 -0
- package/lib/Empty/index.d.ts +18 -3
- package/lib/Empty/index.js +107 -1
- package/lib/Empty/simple.d.ts +2 -0
- package/lib/Empty/simple.js +47 -0
- package/lib/Empty/style/index.css +44 -0
- package/lib/Form/container.d.ts +8 -0
- package/lib/Form/container.js +112 -0
- package/lib/Form/index.d.ts +10 -2
- package/lib/Form/index.js +30 -2
- package/lib/Form/style/index.css +116 -0
- package/lib/IconFont/index.js +1 -1
- package/lib/LmEditTable/EditTable.js +47 -17
- package/lib/LmFilter/Controls/index.js +32 -2
- package/lib/LmFilter/LmFilter.js +1 -1
- package/lib/LmFilter/baseFilter/index.js +2 -1
- package/lib/LmFilter/complexFilter/drawer.js +33 -32
- package/lib/LmFilter/components/CascaderFilter.js +35 -35
- package/lib/LmFilter/components/CheckboxFilter.js +13 -21
- package/lib/LmFilter/components/DateFilter.js +53 -29
- package/lib/LmFilter/components/DropdownFIlter.js +51 -22
- package/lib/LmFilter/components/SelectFilter.js +2 -3
- package/lib/LmFilter/components/index.js +5 -61
- package/lib/LmFilter/customFilter/index.js +3 -2
- package/lib/LmFilter/filterFns/index.js +65 -25
- package/lib/LmFilter/style/style.css +2 -1
- package/lib/LmFilter/utils.js +63 -14
- package/lib/LmFilter/wrapper/Filter.js +6 -3
- package/lib/LmFilter/wrapper/FilterRoot.js +29 -22
- package/lib/LmTable/Table.js +8 -6
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _TableRoot = _interopRequireDefault(require("./table/TableRoot"));
|
|
19
19
|
|
|
20
|
-
var _excluded = ["cellKey", "type", "height", "virtual", "components", "dataSource", "cellConfig", "checkboxConfig"];
|
|
20
|
+
var _excluded = ["cellKey", "type", "height", "virtual", "ellipsis", "components", "dataSource", "cellConfig", "checkboxConfig"];
|
|
21
21
|
|
|
22
22
|
// export type LmCardTableProps<TData extends Record<string, any> = {}> {
|
|
23
23
|
// rows: LM_Row<TData>[];
|
|
@@ -32,6 +32,8 @@ var LmCardTable = function LmCardTable(_ref, ref) {
|
|
|
32
32
|
height = _ref$height === void 0 ? '100%' : _ref$height,
|
|
33
33
|
_ref$virtual = _ref.virtual,
|
|
34
34
|
virtual = _ref$virtual === void 0 ? true : _ref$virtual,
|
|
35
|
+
_ref$ellipsis = _ref.ellipsis,
|
|
36
|
+
ellipsis = _ref$ellipsis === void 0 ? true : _ref$ellipsis,
|
|
35
37
|
_ref$components = _ref.components,
|
|
36
38
|
components = _ref$components === void 0 ? {} : _ref$components,
|
|
37
39
|
_ref$dataSource = _ref.dataSource,
|
|
@@ -47,6 +49,7 @@ var LmCardTable = function LmCardTable(_ref, ref) {
|
|
|
47
49
|
type: type,
|
|
48
50
|
height: height,
|
|
49
51
|
virtual: virtual,
|
|
52
|
+
ellipsis: ellipsis,
|
|
50
53
|
components: components,
|
|
51
54
|
dataSource: dataSource,
|
|
52
55
|
cellConfig: cellConfig,
|
|
@@ -26,11 +26,11 @@ var LmCardTableBodyCell = function LmCardTableBodyCell(_ref) {
|
|
|
26
26
|
cell = _ref.cell,
|
|
27
27
|
table = _ref.table;
|
|
28
28
|
var state = table.state,
|
|
29
|
-
cellConfig = table.cellConfig,
|
|
30
29
|
type = table.type,
|
|
31
30
|
components = table.components,
|
|
32
31
|
cellKey = table.cellKey;
|
|
33
|
-
var checkKeys = state.checkboxConfig.checkKeys
|
|
32
|
+
var checkKeys = state.checkboxConfig.checkKeys,
|
|
33
|
+
radioConfig = state.radioConfig; // 渲染的单元格
|
|
34
34
|
|
|
35
35
|
var RenderCell = (0, _react.useMemo)(function () {
|
|
36
36
|
var types = {
|
|
@@ -43,16 +43,21 @@ var LmCardTableBodyCell = function LmCardTableBodyCell(_ref) {
|
|
|
43
43
|
return components.Cell || types[type] || _PictureTextColumn.default;
|
|
44
44
|
}, [components.Cell, type]); // 是否选中
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var isCheckboxChecked = (0, _react.useMemo)(function () {
|
|
47
47
|
return checkKeys.some(function (v) {
|
|
48
48
|
return v === cell[cellKey];
|
|
49
49
|
});
|
|
50
50
|
}, [checkKeys, cellKey]);
|
|
51
|
+
var isRadioChecked = (0, _react.useMemo)(function () {
|
|
52
|
+
return radioConfig.checkKey === cell[cellKey];
|
|
53
|
+
}, [cellKey, radioConfig.checkKey]);
|
|
51
54
|
var stateConfig = {
|
|
52
|
-
checked:
|
|
55
|
+
checked: isCheckboxChecked
|
|
53
56
|
};
|
|
54
57
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
-
className: (0, _classnames.default)('lm_card_table_body_cell',
|
|
58
|
+
className: (0, _classnames.default)('lm_card_table_body_cell', {
|
|
59
|
+
'cell_checked': isCheckboxChecked || isRadioChecked
|
|
60
|
+
})
|
|
56
61
|
}, /*#__PURE__*/_react.default.createElement(RenderCell, (0, _extends2.default)({
|
|
57
62
|
index: index,
|
|
58
63
|
cell: cell,
|
|
@@ -40,7 +40,8 @@ var PictureTextRow = function PictureTextRow(_ref) {
|
|
|
40
40
|
cellClick = table.cellClick,
|
|
41
41
|
cellDoubleClick = table.cellDoubleClick,
|
|
42
42
|
toggleCheckboxKey = table.toggleCheckboxKey,
|
|
43
|
-
checkboxChange = table.checkboxChange
|
|
43
|
+
checkboxChange = table.checkboxChange,
|
|
44
|
+
ellipsis = table.ellipsis;
|
|
44
45
|
var trigger = state.checkboxConfig.trigger;
|
|
45
46
|
var resetDefaultConfig = (0, _objectSpread2.default)({
|
|
46
47
|
checkbox: true,
|
|
@@ -116,9 +117,13 @@ var PictureTextRow = function PictureTextRow(_ref) {
|
|
|
116
117
|
className: "PTR_column_box"
|
|
117
118
|
}, resetDefaultConfig.columns.map(function (v, idx) {
|
|
118
119
|
var isVisible = v.show || typeof v.show !== 'boolean';
|
|
119
|
-
return isVisible ? /*#__PURE__*/_react.default.createElement("
|
|
120
|
+
return isVisible ? /*#__PURE__*/_react.default.createElement("div", {
|
|
120
121
|
key: (v === null || v === void 0 ? void 0 : v.dataIndex) || idx
|
|
121
|
-
}, v.title, "
|
|
122
|
+
}, v.title, "\uFF1A", /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
+
className: (0, _classnames.default)({
|
|
124
|
+
ellipsis: ellipsis
|
|
125
|
+
})
|
|
126
|
+
}, typeof v.render === 'function' ? v.render(cell[v.dataIndex], cell, table) : cell[v.dataIndex])) : null;
|
|
122
127
|
}))) : null, resetDefaultConfig.extend ? /*#__PURE__*/_react.default.createElement("div", {
|
|
123
128
|
className: "PTR_extend"
|
|
124
129
|
}, resetDefaultConfig.extend(cell, table)) : null, resetDefaultConfig.desc ? /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -17,7 +17,8 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
17
17
|
var checkboxConfig = state.checkboxConfig;
|
|
18
18
|
var dataSource = props.dataSource,
|
|
19
19
|
cellKey = props.cellKey,
|
|
20
|
-
checkboxChange = props.checkboxChange
|
|
20
|
+
checkboxChange = props.checkboxChange,
|
|
21
|
+
selectionConfig = props.selectionConfig;
|
|
21
22
|
var checkKeys = checkboxConfig.checkKeys,
|
|
22
23
|
checkValues = checkboxConfig.checkValues,
|
|
23
24
|
checkMethod = checkboxConfig.checkMethod; // 设置选中的值: 第一个参数是数据的键,第二个参数是选中与否, 第三个参数控制是否重置
|
|
@@ -63,6 +64,13 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
63
64
|
checkValues: nValues
|
|
64
65
|
}
|
|
65
66
|
});
|
|
67
|
+
dispatch({
|
|
68
|
+
type: 'changeRadioConfig',
|
|
69
|
+
radioConfig: {
|
|
70
|
+
checkKey: '',
|
|
71
|
+
checkValue: ''
|
|
72
|
+
}
|
|
73
|
+
});
|
|
66
74
|
}; // 切换选中状态: 单个切换/批量切换
|
|
67
75
|
|
|
68
76
|
|
|
@@ -126,9 +134,28 @@ var CoreOptions = function CoreOptions(_ref) {
|
|
|
126
134
|
setCheckboxKeys(nKeys, isCheck, reset);
|
|
127
135
|
};
|
|
128
136
|
|
|
137
|
+
var cellClick = function cellClick(cell, index) {
|
|
138
|
+
var _props$cellClick;
|
|
139
|
+
|
|
140
|
+
if (!checkKeys.length) {
|
|
141
|
+
// 校验是否存在单选
|
|
142
|
+
var isRadio = Array.isArray(selectionConfig.type) ? selectionConfig.type.includes('radio') : selectionConfig.type === 'radio';
|
|
143
|
+
isRadio && dispatch({
|
|
144
|
+
type: 'changeRadioConfig',
|
|
145
|
+
radioConfig: {
|
|
146
|
+
checkKey: cell[cellKey],
|
|
147
|
+
checkValue: cell
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
(_props$cellClick = props.cellClick) === null || _props$cellClick === void 0 ? void 0 : _props$cellClick.call(props, cell, index);
|
|
153
|
+
};
|
|
154
|
+
|
|
129
155
|
return {
|
|
130
156
|
setCheckboxKeys: setCheckboxKeys,
|
|
131
|
-
toggleCheckboxKey: toggleCheckboxKey
|
|
157
|
+
toggleCheckboxKey: toggleCheckboxKey,
|
|
158
|
+
cellClick: cellClick
|
|
132
159
|
};
|
|
133
160
|
};
|
|
134
161
|
|
|
@@ -231,14 +231,21 @@
|
|
|
231
231
|
font-size: 12px;
|
|
232
232
|
display: grid;
|
|
233
233
|
grid-template-columns: repeat(2, 1fr);
|
|
234
|
+
column-gap: 8px;
|
|
234
235
|
color: var(--color-65);
|
|
235
236
|
margin-top: 8px;
|
|
236
237
|
}
|
|
237
|
-
.card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box
|
|
238
|
+
.card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box > div {
|
|
238
239
|
display: inline-flex;
|
|
239
240
|
align-items: center;
|
|
240
241
|
min-height: 20px;
|
|
241
242
|
}
|
|
243
|
+
.card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box .ellipsis {
|
|
244
|
+
flex: 1 1 0;
|
|
245
|
+
text-overflow: ellipsis;
|
|
246
|
+
white-space: nowrap;
|
|
247
|
+
overflow: hidden;
|
|
248
|
+
}
|
|
242
249
|
.card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_desc {
|
|
243
250
|
font-size: 12px;
|
|
244
251
|
color: var(--color-65);
|
|
@@ -22,14 +22,16 @@ var _TableWrapper = _interopRequireDefault(require("./TableWrapper"));
|
|
|
22
22
|
var _fns = _interopRequireDefault(require("../fns"));
|
|
23
23
|
|
|
24
24
|
var _excluded = ["checkKeys", "trigger", "checkMethod"],
|
|
25
|
-
_excluded2 = ["
|
|
25
|
+
_excluded2 = ["checkKey", "trigger"],
|
|
26
|
+
_excluded3 = ["rowConfig", "cellConfig", "defaultConfig", "checkboxConfig", "radioConfig", "selectionConfig", "pagerConfig", "toolbarConfig"];
|
|
26
27
|
|
|
27
28
|
var reducer = function reducer(state, action) {
|
|
28
29
|
var page = action.page,
|
|
29
30
|
resize = action.resize,
|
|
30
31
|
columnCount = action.columnCount,
|
|
31
32
|
rows = action.rows,
|
|
32
|
-
checkboxConfig = action.checkboxConfig
|
|
33
|
+
checkboxConfig = action.checkboxConfig,
|
|
34
|
+
radioConfig = action.radioConfig;
|
|
33
35
|
|
|
34
36
|
switch (action.type) {
|
|
35
37
|
case 'changePage':
|
|
@@ -59,6 +61,12 @@ var reducer = function reducer(state, action) {
|
|
|
59
61
|
checkboxConfig: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.checkboxConfig), checkboxConfig)
|
|
60
62
|
});
|
|
61
63
|
|
|
64
|
+
case 'changeRadioConfig':
|
|
65
|
+
// 单选中的Key
|
|
66
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
|
|
67
|
+
radioConfig: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.radioConfig), radioConfig)
|
|
68
|
+
});
|
|
69
|
+
|
|
62
70
|
default:
|
|
63
71
|
throw new Error();
|
|
64
72
|
}
|
|
@@ -67,27 +75,43 @@ var reducer = function reducer(state, action) {
|
|
|
67
75
|
|
|
68
76
|
var getInitialState = function getInitialState(props) {
|
|
69
77
|
var _props$checkboxConfig = props.checkboxConfig,
|
|
70
|
-
_props$
|
|
71
|
-
|
|
72
|
-
_props$
|
|
73
|
-
trigger = _props$checkboxConfig3 === void 0 ? 'default' : _props$checkboxConfig3,
|
|
74
|
-
_props$checkboxConfig4 = _props$checkboxConfig.checkMethod,
|
|
75
|
-
checkMethod = _props$checkboxConfig4 === void 0 ? true : _props$checkboxConfig4,
|
|
76
|
-
resetCheckCOnfig = (0, _objectWithoutProperties2.default)(_props$checkboxConfig, _excluded),
|
|
78
|
+
checkboxConfig = _props$checkboxConfig === void 0 ? {} : _props$checkboxConfig,
|
|
79
|
+
_props$radioConfig = props.radioConfig,
|
|
80
|
+
radioConfig = _props$radioConfig === void 0 ? {} : _props$radioConfig,
|
|
77
81
|
_props$dataSource = props.dataSource,
|
|
78
82
|
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
79
83
|
cellKey = props.cellKey;
|
|
84
|
+
var _checkboxConfig$check = checkboxConfig.checkKeys,
|
|
85
|
+
checkKeys = _checkboxConfig$check === void 0 ? [] : _checkboxConfig$check,
|
|
86
|
+
_checkboxConfig$trigg = checkboxConfig.trigger,
|
|
87
|
+
checkboxTrigger = _checkboxConfig$trigg === void 0 ? 'default' : _checkboxConfig$trigg,
|
|
88
|
+
_checkboxConfig$check2 = checkboxConfig.checkMethod,
|
|
89
|
+
checkMethod = _checkboxConfig$check2 === void 0 ? true : _checkboxConfig$check2,
|
|
90
|
+
resetCheckCOnfig = (0, _objectWithoutProperties2.default)(checkboxConfig, _excluded);
|
|
91
|
+
var _radioConfig$checkKey = radioConfig.checkKey,
|
|
92
|
+
checkKey = _radioConfig$checkKey === void 0 ? '' : _radioConfig$checkKey,
|
|
93
|
+
_radioConfig$trigger = radioConfig.trigger,
|
|
94
|
+
radioTrigger = _radioConfig$trigger === void 0 ? 'default' : _radioConfig$trigger,
|
|
95
|
+
resetRadioConfig = (0, _objectWithoutProperties2.default)(radioConfig, _excluded2);
|
|
80
96
|
var checkValues = dataSource.filter(function (v) {
|
|
81
97
|
return checkKeys.includes(v[cellKey]);
|
|
82
98
|
}) || [];
|
|
99
|
+
var checkValue = dataSource.find(function (v) {
|
|
100
|
+
return checkKey === v[cellKey];
|
|
101
|
+
});
|
|
83
102
|
return {
|
|
84
103
|
// 复选框的配置
|
|
85
104
|
checkboxConfig: (0, _objectSpread2.default)({
|
|
86
105
|
checkKeys: checkKeys,
|
|
87
106
|
checkValues: checkValues,
|
|
88
|
-
trigger:
|
|
107
|
+
trigger: checkboxTrigger,
|
|
89
108
|
checkMethod: checkMethod
|
|
90
109
|
}, resetCheckCOnfig),
|
|
110
|
+
radioConfig: (0, _objectSpread2.default)({
|
|
111
|
+
checkKey: checkKey,
|
|
112
|
+
checkValue: checkValue,
|
|
113
|
+
trigger: radioTrigger
|
|
114
|
+
}, resetRadioConfig),
|
|
91
115
|
// 分页的配置
|
|
92
116
|
page: {
|
|
93
117
|
pageIndex: 1,
|
|
@@ -127,9 +151,11 @@ var LmCardTableRoot = function LmCardTableRoot(props, ref) {
|
|
|
127
151
|
cellConfig = props.cellConfig,
|
|
128
152
|
defaultConfig = props.defaultConfig,
|
|
129
153
|
checkboxConfig = props.checkboxConfig,
|
|
154
|
+
radioConfig = props.radioConfig,
|
|
155
|
+
selectionConfig = props.selectionConfig,
|
|
130
156
|
pagerConfig = props.pagerConfig,
|
|
131
157
|
toolbarConfig = props.toolbarConfig,
|
|
132
|
-
resetProps = (0, _objectWithoutProperties2.default)(props,
|
|
158
|
+
resetProps = (0, _objectWithoutProperties2.default)(props, _excluded3);
|
|
133
159
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, resetProps), {}, {
|
|
134
160
|
rowConfig: (0, _objectSpread2.default)({
|
|
135
161
|
// 行配置
|
|
@@ -140,6 +166,10 @@ var LmCardTableRoot = function LmCardTableRoot(props, ref) {
|
|
|
140
166
|
width: 192,
|
|
141
167
|
height: 282
|
|
142
168
|
}, cellConfig),
|
|
169
|
+
selectionConfig: (0, _objectSpread2.default)({
|
|
170
|
+
type: ['checkbox', 'radio']
|
|
171
|
+
}, selectionConfig),
|
|
172
|
+
radioConfig: (0, _objectSpread2.default)({}, radioConfig),
|
|
143
173
|
checkboxConfig: (0, _objectSpread2.default)({}, checkboxConfig),
|
|
144
174
|
pagerConfig: (0, _objectSpread2.default)({}, pagerConfig),
|
|
145
175
|
toolbarConfig: (0, _objectSpread2.default)({}, toolbarConfig),
|
|
@@ -151,9 +181,9 @@ var LmCardTableRoot = function LmCardTableRoot(props, ref) {
|
|
|
151
181
|
return (0, _fns.default)({
|
|
152
182
|
state: state,
|
|
153
183
|
dispatch: dispatch,
|
|
154
|
-
props:
|
|
184
|
+
props: configProps
|
|
155
185
|
});
|
|
156
|
-
}, [state, dispatch,
|
|
186
|
+
}, [state, dispatch, configProps]);
|
|
157
187
|
var table = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, configProps), eventProps), {}, {
|
|
158
188
|
state: state,
|
|
159
189
|
dispatch: dispatch
|
|
@@ -163,6 +193,9 @@ var LmCardTableRoot = function LmCardTableRoot(props, ref) {
|
|
|
163
193
|
return (0, _objectSpread2.default)({
|
|
164
194
|
getCheckboxRecords: function getCheckboxRecords() {
|
|
165
195
|
return state.checkboxConfig.checkValues;
|
|
196
|
+
},
|
|
197
|
+
getRadioRecord: function getRadioRecord() {
|
|
198
|
+
return state.radioConfig.checkValue;
|
|
166
199
|
}
|
|
167
200
|
}, eventProps);
|
|
168
201
|
});
|
|
@@ -100,9 +100,6 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
100
100
|
setSearchValue(searchIngValue);
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
useEffect(function () {
|
|
104
|
-
console.log(localCard, 'localFilter');
|
|
105
|
-
}, [localCard]);
|
|
106
103
|
useEffect(function () {
|
|
107
104
|
setLocalCard(card);
|
|
108
105
|
setColStateValue(cardStateValue);
|
|
@@ -45,7 +45,6 @@ var SortItem = function SortItem(props) {
|
|
|
45
45
|
type: "lmweb-vertical-align-top",
|
|
46
46
|
className: "lm_custom_icon hover_show icon_top",
|
|
47
47
|
onClick: function onClick(e) {
|
|
48
|
-
console.log(e, 'eee');
|
|
49
48
|
e.stopPropagation();
|
|
50
49
|
props.addFiexd(props.id, 'left');
|
|
51
50
|
}
|
|
@@ -67,8 +66,7 @@ var SortItem = function SortItem(props) {
|
|
|
67
66
|
|
|
68
67
|
|
|
69
68
|
var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
70
|
-
var
|
|
71
|
-
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
69
|
+
var columns = _ref.columns,
|
|
72
70
|
_ref$ColumnsStateValu = _ref.ColumnsStateValue,
|
|
73
71
|
ColumnsStateValue = _ref$ColumnsStateValu === void 0 ? {} : _ref$ColumnsStateValu;
|
|
74
72
|
|
|
@@ -148,7 +146,7 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
148
146
|
};
|
|
149
147
|
|
|
150
148
|
useEffect(function () {
|
|
151
|
-
setLocalColumns(columns);
|
|
149
|
+
setLocalColumns(columns || []);
|
|
152
150
|
setColStateValue(ColumnsStateValue);
|
|
153
151
|
}, [columns]);
|
|
154
152
|
var leftSensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
@@ -100,9 +100,6 @@ var FilterSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
100
100
|
setSearchValue(searchIngValue);
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
useEffect(function () {
|
|
104
|
-
console.log(localFilter, 'localFilter');
|
|
105
|
-
}, [localFilter]);
|
|
106
103
|
useEffect(function () {
|
|
107
104
|
setLocalFilter(filter);
|
|
108
105
|
setColStateValue(filterStateValue);
|
|
@@ -70,8 +70,8 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
70
70
|
|
|
71
71
|
useEffect(function () {
|
|
72
72
|
setLmOptions({
|
|
73
|
-
filter: props.filter,
|
|
74
|
-
columns: props.columns,
|
|
73
|
+
filter: props.filter || [],
|
|
74
|
+
columns: props.columns || [],
|
|
75
75
|
size: props.size || 'default',
|
|
76
76
|
card: props.card || []
|
|
77
77
|
});
|
package/es/Dropdown/index.js
CHANGED
|
@@ -108,7 +108,7 @@ LMDropdown.Button = function (props) {
|
|
|
108
108
|
type: 'lmweb-down'
|
|
109
109
|
}),
|
|
110
110
|
overlayClassName: classNames(props.overlayClassName, 'lm_dropdown_overlay'),
|
|
111
|
-
className: classNames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '')
|
|
111
|
+
className: classNames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '', props.type)
|
|
112
112
|
}));
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -124,7 +124,7 @@ LMDropdown.Button = function (props) {
|
|
|
124
124
|
overlayStyle: minwidth ? Object.assign({
|
|
125
125
|
minWidth: minwidth
|
|
126
126
|
}, props.overlayStyle) : Object.assign({}, props.overlayStyle),
|
|
127
|
-
className: classNames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '')
|
|
127
|
+
className: classNames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '', props.type)
|
|
128
128
|
})));
|
|
129
129
|
};
|
|
130
130
|
|
|
@@ -528,10 +528,13 @@ html {
|
|
|
528
528
|
background-color: var(--disabled-bg-color);
|
|
529
529
|
}
|
|
530
530
|
.lm_dropdown_button {
|
|
531
|
-
border-radius:
|
|
531
|
+
border-radius: 4px;
|
|
532
532
|
border: 1px solid var(--color-15);
|
|
533
533
|
box-sizing: content-box;
|
|
534
534
|
}
|
|
535
|
+
.lm_dropdown_button.primary {
|
|
536
|
+
border: 1px solid var(--primary-color);
|
|
537
|
+
}
|
|
535
538
|
.lm_dropdown_button .ant-btn {
|
|
536
539
|
height: 30px;
|
|
537
540
|
border-top: 0px;
|
|
@@ -557,13 +560,28 @@ html {
|
|
|
557
560
|
.lm_dropdown_button .ant-btn .lm_default_icon {
|
|
558
561
|
color: var(--text-color);
|
|
559
562
|
}
|
|
563
|
+
.lm_dropdown_button .ant-btn-primary .anticon {
|
|
564
|
+
color: var(--color-contrast);
|
|
565
|
+
}
|
|
560
566
|
.lm_dropdown_button:hover {
|
|
561
567
|
color: var(--primary-hover-color) !important;
|
|
562
568
|
border: 1px solid var(--primary-hover-color);
|
|
569
|
+
border-radius: 4px;
|
|
563
570
|
}
|
|
564
571
|
.lm_dropdown_button:hover .ant-btn {
|
|
565
572
|
color: var(--primary-hover-color) !important;
|
|
566
573
|
}
|
|
574
|
+
.lm_dropdown_button:hover .anticon {
|
|
575
|
+
color: var(--primary-hover-color);
|
|
576
|
+
}
|
|
577
|
+
.lm_dropdown_button:hover .ant-btn-primary {
|
|
578
|
+
background-color: var(--primary-hover-color);
|
|
579
|
+
color: var(--color-contrast) !important;
|
|
580
|
+
position: relative;
|
|
581
|
+
}
|
|
582
|
+
.lm_dropdown_button:hover .ant-btn-primary .anticon {
|
|
583
|
+
color: var(--color-contrast);
|
|
584
|
+
}
|
|
567
585
|
.lm_dropdown_button.disabled {
|
|
568
586
|
color: var(--disabled-font-color) !important;
|
|
569
587
|
border: 1px solid var(--disabled-border-color);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ConfigContext } from 'antd/es/config-provider';
|
|
3
|
+
|
|
4
|
+
var Empty = function Empty() {
|
|
5
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
6
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
7
|
+
|
|
8
|
+
var prefixCls = getPrefixCls('empty-img-default');
|
|
9
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
10
|
+
className: prefixCls,
|
|
11
|
+
width: "184",
|
|
12
|
+
height: "152",
|
|
13
|
+
viewBox: "0 0 184 152",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
fill: "none",
|
|
17
|
+
fillRule: "evenodd"
|
|
18
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
19
|
+
transform: "translate(24 31.67)"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("ellipse", {
|
|
21
|
+
className: "".concat(prefixCls, "-ellipse"),
|
|
22
|
+
cx: "67.797",
|
|
23
|
+
cy: "106.89",
|
|
24
|
+
rx: "67.797",
|
|
25
|
+
ry: "12.668"
|
|
26
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
className: "".concat(prefixCls, "-path-1"),
|
|
28
|
+
d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"
|
|
29
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
30
|
+
className: "".concat(prefixCls, "-path-2"),
|
|
31
|
+
d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
|
|
32
|
+
transform: "translate(13.56)"
|
|
33
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
34
|
+
className: "".concat(prefixCls, "-path-3"),
|
|
35
|
+
d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"
|
|
36
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
37
|
+
className: "".concat(prefixCls, "-path-4"),
|
|
38
|
+
d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"
|
|
39
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
40
|
+
className: "".concat(prefixCls, "-path-5"),
|
|
41
|
+
d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"
|
|
42
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
43
|
+
className: "".concat(prefixCls, "-g"),
|
|
44
|
+
transform: "translate(149.65 15.383)"
|
|
45
|
+
}, /*#__PURE__*/React.createElement("ellipse", {
|
|
46
|
+
cx: "20.654",
|
|
47
|
+
cy: "3.167",
|
|
48
|
+
rx: "2.849",
|
|
49
|
+
ry: "2.815"
|
|
50
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
51
|
+
d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
|
|
52
|
+
}))));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default Empty;
|
package/es/Empty/index.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface TransferLocale {
|
|
3
|
+
description: string;
|
|
4
|
+
}
|
|
5
|
+
export interface EmptyProps {
|
|
6
|
+
prefixCls?: string;
|
|
4
7
|
className?: string;
|
|
5
8
|
style?: React.CSSProperties;
|
|
9
|
+
/** @since 3.16.0 */
|
|
10
|
+
imageStyle?: React.CSSProperties;
|
|
11
|
+
image?: React.ReactNode;
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
title: string | React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface EmptyType extends React.FC<EmptyProps> {
|
|
17
|
+
PRESENTED_IMAGE_DEFAULT: React.ReactNode;
|
|
18
|
+
PRESENTED_IMAGE_SIMPLE: React.ReactNode;
|
|
19
|
+
AntdEmpty: React.ReactNode;
|
|
6
20
|
}
|
|
21
|
+
declare const Empty: EmptyType;
|
|
7
22
|
export default Empty;
|
package/es/Empty/index.js
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
1
|
import "antd/es/empty/style";
|
|
2
2
|
import _Empty from "antd/es/empty";
|
|
3
|
-
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
|
|
5
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
6
|
+
var t = {};
|
|
7
|
+
|
|
8
|
+
for (var p in s) {
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
13
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
import classNames from 'classnames';
|
|
19
|
+
import * as React from 'react';
|
|
20
|
+
import { useMemo } from 'react';
|
|
21
|
+
import { ConfigContext } from 'antd/es/config-provider';
|
|
22
|
+
import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
|
|
23
|
+
import DefaultEmptyImg from './empty';
|
|
24
|
+
import SimpleEmptyImg from './simple';
|
|
25
|
+
var defaultEmptyImg = /*#__PURE__*/React.createElement(DefaultEmptyImg, null);
|
|
26
|
+
var simpleEmptyImg = /*#__PURE__*/React.createElement(SimpleEmptyImg, null);
|
|
27
|
+
var TitleMap = {
|
|
28
|
+
notfound: '抱歉,404页面',
|
|
29
|
+
nopermissions: '抱歉,您的权限不足',
|
|
30
|
+
loaderror: '数据加载中,请您再试一次',
|
|
31
|
+
networkerror: '抱歉,服务器出错误',
|
|
32
|
+
nodata: '抱歉,暂无数据'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var Empty = function Empty(_a) {
|
|
36
|
+
var className = _a.className,
|
|
37
|
+
customizePrefixCls = _a.prefixCls,
|
|
38
|
+
_a$image = _a.image,
|
|
39
|
+
image = _a$image === void 0 ? defaultEmptyImg : _a$image,
|
|
40
|
+
title = _a.title,
|
|
41
|
+
description = _a.description,
|
|
42
|
+
children = _a.children,
|
|
43
|
+
imageStyle = _a.imageStyle,
|
|
44
|
+
restProps = __rest(_a, ["className", "prefixCls", "image", "title", "description", "children", "imageStyle"]);
|
|
45
|
+
|
|
46
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
47
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
48
|
+
direction = _React$useContext.direction;
|
|
49
|
+
|
|
50
|
+
var isCustomEmpty = useMemo(function () {
|
|
51
|
+
if (typeof image === 'string' && ['notfound', 'nopermissions', 'loaderror', 'networkerror', 'nodata'].includes(image)) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return false;
|
|
56
|
+
}, [image]);
|
|
57
|
+
return (
|
|
58
|
+
/*#__PURE__*/
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
React.createElement(LocaleReceiver, {
|
|
61
|
+
componentName: "Empty"
|
|
62
|
+
}, function (locale) {
|
|
63
|
+
var _classNames;
|
|
64
|
+
|
|
65
|
+
var prefixCls = getPrefixCls('empty', customizePrefixCls);
|
|
66
|
+
var des = typeof description !== 'undefined' ? description : locale.description;
|
|
67
|
+
var alt = typeof des === 'string' ? des : 'empty';
|
|
68
|
+
var imageNode = null;
|
|
69
|
+
|
|
70
|
+
if (isCustomEmpty) {
|
|
71
|
+
imageNode = /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: classNames('lm_custom_empty_img', "".concat(image))
|
|
73
|
+
});
|
|
74
|
+
} else if (typeof image === 'string') {
|
|
75
|
+
imageNode = /*#__PURE__*/React.createElement("img", {
|
|
76
|
+
alt: alt,
|
|
77
|
+
src: image
|
|
78
|
+
});
|
|
79
|
+
} else {
|
|
80
|
+
imageNode = image;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
84
|
+
className: classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-normal"), image === simpleEmptyImg), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames), className, 'lm_empty')
|
|
85
|
+
}, restProps), /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: classNames("".concat(prefixCls, "-image"), isCustomEmpty && 'lm_custom_empty'),
|
|
87
|
+
style: imageStyle
|
|
88
|
+
}, imageNode), (title || isCustomEmpty) && /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
className: "".concat(prefixCls, "-title")
|
|
90
|
+
}, title || TitleMap["".concat(image)]), des && /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: "".concat(prefixCls, "-description")
|
|
92
|
+
}, des), children && /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: "".concat(prefixCls, "-footer")
|
|
94
|
+
}, children));
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
|
|
100
|
+
Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
|
|
101
|
+
Empty.AntdEmpty = _Empty;
|
|
102
|
+
export default Empty;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ConfigContext } from 'antd/es/config-provider';
|
|
3
|
+
|
|
4
|
+
var Simple = function Simple() {
|
|
5
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
6
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
7
|
+
|
|
8
|
+
var prefixCls = getPrefixCls('empty-img-simple');
|
|
9
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
10
|
+
className: prefixCls,
|
|
11
|
+
width: "64",
|
|
12
|
+
height: "41",
|
|
13
|
+
viewBox: "0 0 64 41",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
16
|
+
transform: "translate(0 1)",
|
|
17
|
+
fill: "none",
|
|
18
|
+
fillRule: "evenodd"
|
|
19
|
+
}, /*#__PURE__*/React.createElement("ellipse", {
|
|
20
|
+
className: "".concat(prefixCls, "-ellipse"),
|
|
21
|
+
cx: "32",
|
|
22
|
+
cy: "33",
|
|
23
|
+
rx: "32",
|
|
24
|
+
ry: "7"
|
|
25
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
26
|
+
className: "".concat(prefixCls, "-g"),
|
|
27
|
+
fillRule: "nonzero"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
29
|
+
d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
31
|
+
d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
|
|
32
|
+
className: "".concat(prefixCls, "-path")
|
|
33
|
+
}))));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default Simple;
|