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.
Files changed (103) hide show
  1. package/dist/CardTable/LmCardTable.d.ts +1 -0
  2. package/dist/CardTable/fns/index.d.ts +1 -0
  3. package/dist/Empty/demos/custom.d.ts +2 -0
  4. package/dist/Empty/empty.d.ts +2 -0
  5. package/dist/Empty/index.d.ts +18 -3
  6. package/dist/Empty/simple.d.ts +2 -0
  7. package/dist/Form/container.d.ts +8 -0
  8. package/dist/Form/demos/error-tip.d.ts +2 -0
  9. package/dist/Form/demos/responsive.d.ts +2 -0
  10. package/dist/Form/index.d.ts +10 -2
  11. package/dist/LmEditTable/demos/sinleEdit.d.ts +2 -0
  12. package/dist/LmFilter/customFilter/index.d.ts +3 -1
  13. package/dist/LmFilter/filterFns/index.d.ts +4 -1
  14. package/dist/LmFilter/utils.d.ts +1 -1
  15. package/dist/index.umd.js +498 -208
  16. package/dist/index.umd.min.js +6 -6
  17. package/es/CardTable/LmCardTable.js +4 -1
  18. package/es/CardTable/body/TableBodyCell.js +10 -5
  19. package/es/CardTable/card/PictureTextRow.js +8 -3
  20. package/es/CardTable/fns/index.js +29 -2
  21. package/es/CardTable/style/index.css +8 -1
  22. package/es/CardTable/table/TableRoot.js +46 -13
  23. package/es/CustomTableOption/cardSort.js +0 -3
  24. package/es/CustomTableOption/columnsSort.js +2 -4
  25. package/es/CustomTableOption/filterSort.js +0 -3
  26. package/es/CustomTableOption/index.js +2 -2
  27. package/es/Dropdown/index.js +2 -2
  28. package/es/Dropdown/style/index.css +19 -1
  29. package/es/Empty/empty.d.ts +2 -0
  30. package/es/Empty/empty.js +55 -0
  31. package/es/Empty/index.d.ts +18 -3
  32. package/es/Empty/index.js +100 -1
  33. package/es/Empty/simple.d.ts +2 -0
  34. package/es/Empty/simple.js +36 -0
  35. package/es/Empty/style/index.css +44 -0
  36. package/es/Form/container.d.ts +8 -0
  37. package/es/Form/container.js +97 -0
  38. package/es/Form/index.d.ts +10 -2
  39. package/es/Form/index.js +30 -2
  40. package/es/Form/style/index.css +116 -0
  41. package/es/IconFont/index.js +1 -1
  42. package/es/LmEditTable/EditTable.js +47 -17
  43. package/es/LmFilter/Controls/index.js +32 -2
  44. package/es/LmFilter/LmFilter.js +1 -1
  45. package/es/LmFilter/baseFilter/index.js +2 -1
  46. package/es/LmFilter/complexFilter/drawer.js +33 -32
  47. package/es/LmFilter/components/CascaderFilter.js +35 -35
  48. package/es/LmFilter/components/CheckboxFilter.js +13 -21
  49. package/es/LmFilter/components/DateFilter.js +53 -29
  50. package/es/LmFilter/components/DropdownFIlter.js +51 -22
  51. package/es/LmFilter/components/SelectFilter.js +2 -3
  52. package/es/LmFilter/components/index.js +5 -61
  53. package/es/LmFilter/customFilter/index.js +3 -2
  54. package/es/LmFilter/filterFns/index.js +65 -25
  55. package/es/LmFilter/style/style.css +2 -1
  56. package/es/LmFilter/utils.js +63 -14
  57. package/es/LmFilter/wrapper/Filter.js +6 -3
  58. package/es/LmFilter/wrapper/FilterRoot.js +29 -22
  59. package/es/LmTable/Table.js +8 -6
  60. package/lib/CardTable/LmCardTable.js +4 -1
  61. package/lib/CardTable/body/TableBodyCell.js +10 -5
  62. package/lib/CardTable/card/PictureTextRow.js +8 -3
  63. package/lib/CardTable/fns/index.js +29 -2
  64. package/lib/CardTable/style/index.css +8 -1
  65. package/lib/CardTable/table/TableRoot.js +46 -13
  66. package/lib/CustomTableOption/cardSort.js +0 -3
  67. package/lib/CustomTableOption/columnsSort.js +2 -4
  68. package/lib/CustomTableOption/filterSort.js +0 -3
  69. package/lib/CustomTableOption/index.js +2 -2
  70. package/lib/Dropdown/index.js +2 -2
  71. package/lib/Dropdown/style/index.css +19 -1
  72. package/lib/Empty/empty.d.ts +2 -0
  73. package/lib/Empty/empty.js +66 -0
  74. package/lib/Empty/index.d.ts +18 -3
  75. package/lib/Empty/index.js +107 -1
  76. package/lib/Empty/simple.d.ts +2 -0
  77. package/lib/Empty/simple.js +47 -0
  78. package/lib/Empty/style/index.css +44 -0
  79. package/lib/Form/container.d.ts +8 -0
  80. package/lib/Form/container.js +112 -0
  81. package/lib/Form/index.d.ts +10 -2
  82. package/lib/Form/index.js +30 -2
  83. package/lib/Form/style/index.css +116 -0
  84. package/lib/IconFont/index.js +1 -1
  85. package/lib/LmEditTable/EditTable.js +47 -17
  86. package/lib/LmFilter/Controls/index.js +32 -2
  87. package/lib/LmFilter/LmFilter.js +1 -1
  88. package/lib/LmFilter/baseFilter/index.js +2 -1
  89. package/lib/LmFilter/complexFilter/drawer.js +33 -32
  90. package/lib/LmFilter/components/CascaderFilter.js +35 -35
  91. package/lib/LmFilter/components/CheckboxFilter.js +13 -21
  92. package/lib/LmFilter/components/DateFilter.js +53 -29
  93. package/lib/LmFilter/components/DropdownFIlter.js +51 -22
  94. package/lib/LmFilter/components/SelectFilter.js +2 -3
  95. package/lib/LmFilter/components/index.js +5 -61
  96. package/lib/LmFilter/customFilter/index.js +3 -2
  97. package/lib/LmFilter/filterFns/index.js +65 -25
  98. package/lib/LmFilter/style/style.css +2 -1
  99. package/lib/LmFilter/utils.js +63 -14
  100. package/lib/LmFilter/wrapper/Filter.js +6 -3
  101. package/lib/LmFilter/wrapper/FilterRoot.js +29 -22
  102. package/lib/LmTable/Table.js +8 -6
  103. package/package.json +1 -1
@@ -21,6 +21,8 @@ var _FilterWrapper = _interopRequireDefault(require("./FilterWrapper"));
21
21
 
22
22
  var _filterFns = _interopRequireDefault(require("../filterFns"));
23
23
 
24
+ var _utils = require("../utils");
25
+
24
26
  // 根文件 => 参数聚合
25
27
  var reducer = function reducer(state, action) {
26
28
  var basicFilter = action.basicFilter,
@@ -66,38 +68,43 @@ var reducer = function reducer(state, action) {
66
68
  case 'reset':
67
69
  // 一键清空
68
70
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
69
- basicFilter: {}
71
+ basicFilter: {},
72
+ complexFilter: {}
70
73
  });
71
74
 
72
75
  default:
73
76
  throw new Error();
74
77
  }
75
- }; // const getRows = ({ fieldName, value }, arr) => {
76
- // const findItem = arr.find(item => {
77
- // return item.field === fieldName;
78
- // })
79
- // switch (findItem.type) {
80
- // case 'input':
81
- // return value;
82
- // case 'select':
83
- // return findItem.data.find(v => v.value === value);
84
- // case 'checkbox':
85
- // return findItem.data.find(v => [value].includes(v.value));
86
- // default:
87
- // break;
88
- // }
89
- // };
90
- // 仅在初始化时触发一次
78
+ }; // 仅在初始化时触发一次
91
79
 
92
80
 
93
81
  var getInitialState = function getInitialState(_ref) {
94
- var localization = _ref.localization;
82
+ var localization = _ref.localization,
83
+ dataSource = _ref.dataSource;
95
84
  var globalQuery = localization.globalQuery,
96
85
  filterQuery = localization.filterQuery;
97
- var basicFilter = {};
98
- filterQuery.filter.forEach(function (item) {
99
- basicFilter[item.fieldName] = item.value;
100
- });
86
+ var basicFilter = {}; // 初始化基础查询缓存
87
+
88
+ if (filterQuery === null || filterQuery === void 0 ? void 0 : filterQuery.filter) {
89
+ basicFilter = filterQuery === null || filterQuery === void 0 ? void 0 : filterQuery.filter.reduce(function (pre, cur) {
90
+ // 查找改数据是否展示
91
+ var someData = dataSource.some(function (v) {
92
+ if (cur.fieldName === v.field) {
93
+ var isHidden = !v.show && typeof v.show === 'boolean';
94
+ return !isHidden;
95
+ }
96
+
97
+ return false;
98
+ });
99
+
100
+ if ((0, _utils.getIsHas)(cur.value) && someData) {
101
+ pre[cur.fieldName] = cur.value;
102
+ }
103
+
104
+ return pre;
105
+ }, {});
106
+ }
107
+
101
108
  return {
102
109
  basicFilter: basicFilter,
103
110
  complexFilter: {},
@@ -23,14 +23,14 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm
23
23
 
24
24
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
25
25
 
26
- var _icons = require("@ant-design/icons");
27
-
28
26
  var _proTable = _interopRequireDefault(require("@ant-design/pro-table"));
29
27
 
30
28
  var _sortable = require("@dnd-kit/sortable");
31
29
 
32
30
  var _classnames = _interopRequireDefault(require("classnames"));
33
31
 
32
+ var _linkmoreDesign = require("linkmore-design");
33
+
34
34
  var _lodash = require("lodash");
35
35
 
36
36
  var _react = _interopRequireWildcard(require("react"));
@@ -39,13 +39,11 @@ var _reactResizable = require("react-resizable");
39
39
 
40
40
  var _reactSortableHoc = require("react-sortable-hoc");
41
41
 
42
- var _linkmoreDesign = require("linkmore-design");
43
-
44
42
  var _empty = _interopRequireDefault(require("./assets/empty.png"));
45
43
 
46
44
  var _resetConfig = _interopRequireDefault(require("./resetConfig"));
47
45
 
48
- var _excluded = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "virtual", "sortOpen", "resizeable", "customCheck", "components", "rowSelection", "columnsState", "onChange", "filterChange", "tableRowType", "size"],
46
+ var _excluded = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "virtual", "sortOpen", "resizeable", "customCheck", "components", "rowSelection", "columnsState", "onChange", "filterChange", "tableRowType", "size", "emptyProps"],
49
47
  _excluded2 = ["className", "style"],
50
48
  _excluded3 = ["onResize", "width", "onResizeStop"];
51
49
  var Summary = _proTable.default.Summary; // const DragHandle = SortableHandle(() => <MenuOutlined style={{ cursor: 'grab', color: '#999' }} />);
@@ -97,7 +95,9 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
97
95
  tableRowType = _props$tableRowType === void 0 ? 'default' : _props$tableRowType,
98
96
  _props$size = props.size,
99
97
  size = _props$size === void 0 ? 'default' : _props$size,
98
+ emptyProps = props.emptyProps,
100
99
  resetProps = (0, _objectWithoutProperties2.default)(props, _excluded);
100
+ console.log(emptyProps, '--emptyProps');
101
101
  var _resetProps$rowKey = resetProps.rowKey,
102
102
  rowKey = _resetProps$rowKey === void 0 ? 'id' : _resetProps$rowKey;
103
103
 
@@ -513,7 +513,9 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
513
513
  width: '100%'
514
514
  }
515
515
  }, /*#__PURE__*/_react.default.createElement(_configProvider.default, {
516
- renderEmpty: customizeRenderEmpty
516
+ renderEmpty: emptyProps ? function () {
517
+ return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Empty, emptyProps, (emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.footer) || null);
518
+ } : customizeRenderEmpty
517
519
  }, /*#__PURE__*/_react.default.createElement(_proTable.default, (0, _extends2.default)({}, config, {
518
520
  loading: loading,
519
521
  dataSource: dataSource,
@@ -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 isChecked = (0, _react.useMemo)(function () {
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: isChecked
55
+ checked: isCheckboxChecked
53
56
  };
54
57
  return /*#__PURE__*/_react.default.createElement("div", {
55
- className: (0, _classnames.default)('lm_card_table_body_cell', isChecked && 'cell_checked')
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("span", {
120
+ return isVisible ? /*#__PURE__*/_react.default.createElement("div", {
120
121
  key: (v === null || v === void 0 ? void 0 : v.dataIndex) || idx
121
- }, v.title, ": ", cell[v.dataIndex]) : null;
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 span {
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 = ["rowConfig", "cellConfig", "defaultConfig", "checkboxConfig", "pagerConfig", "toolbarConfig"];
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$checkboxConfig2 = _props$checkboxConfig.checkKeys,
71
- checkKeys = _props$checkboxConfig2 === void 0 ? [] : _props$checkboxConfig2,
72
- _props$checkboxConfig3 = _props$checkboxConfig.trigger,
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: 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, _excluded2);
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: props
184
+ props: configProps
155
185
  });
156
- }, [state, dispatch, props]);
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
  });
@@ -119,9 +119,6 @@ var FilterSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
119
119
  setSearchValue(searchIngValue);
120
120
  };
121
121
 
122
- (0, _react.useEffect)(function () {
123
- console.log(localCard, 'localFilter');
124
- }, [localCard]);
125
122
  (0, _react.useEffect)(function () {
126
123
  setLocalCard(card);
127
124
  setColStateValue(cardStateValue);
@@ -64,7 +64,6 @@ var SortItem = function SortItem(props) {
64
64
  type: "lmweb-vertical-align-top",
65
65
  className: "lm_custom_icon hover_show icon_top",
66
66
  onClick: function onClick(e) {
67
- console.log(e, 'eee');
68
67
  e.stopPropagation();
69
68
  props.addFiexd(props.id, 'left');
70
69
  }
@@ -86,8 +85,7 @@ var SortItem = function SortItem(props) {
86
85
 
87
86
 
88
87
  var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
89
- var _ref$columns = _ref.columns,
90
- columns = _ref$columns === void 0 ? [] : _ref$columns,
88
+ var columns = _ref.columns,
91
89
  _ref$ColumnsStateValu = _ref.ColumnsStateValue,
92
90
  ColumnsStateValue = _ref$ColumnsStateValu === void 0 ? {} : _ref$ColumnsStateValu;
93
91
 
@@ -167,7 +165,7 @@ var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
167
165
  };
168
166
 
169
167
  (0, _react.useEffect)(function () {
170
- setLocalColumns(columns);
168
+ setLocalColumns(columns || []);
171
169
  setColStateValue(ColumnsStateValue);
172
170
  }, [columns]);
173
171
  var leftSensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor), (0, _core.useSensor)(_core.KeyboardSensor, {
@@ -119,9 +119,6 @@ var FilterSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
119
119
  setSearchValue(searchIngValue);
120
120
  };
121
121
 
122
- (0, _react.useEffect)(function () {
123
- console.log(localFilter, 'localFilter');
124
- }, [localFilter]);
125
122
  (0, _react.useEffect)(function () {
126
123
  setLocalFilter(filter);
127
124
  setColStateValue(filterStateValue);
@@ -89,8 +89,8 @@ var LMCustomTableOption = /*#__PURE__*/(0, _react.forwardRef)(function (props, r
89
89
 
90
90
  (0, _react.useEffect)(function () {
91
91
  setLmOptions({
92
- filter: props.filter,
93
- columns: props.columns,
92
+ filter: props.filter || [],
93
+ columns: props.columns || [],
94
94
  size: props.size || 'default',
95
95
  card: props.card || []
96
96
  });
@@ -124,7 +124,7 @@ LMDropdown.Button = function (props) {
124
124
  type: 'lmweb-down'
125
125
  }),
126
126
  overlayClassName: (0, _classnames.default)(props.overlayClassName, 'lm_dropdown_overlay'),
127
- className: (0, _classnames.default)(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '')
127
+ className: (0, _classnames.default)(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '', props.type)
128
128
  }));
129
129
  }
130
130
 
@@ -140,7 +140,7 @@ LMDropdown.Button = function (props) {
140
140
  overlayStyle: minwidth ? Object.assign({
141
141
  minWidth: minwidth
142
142
  }, props.overlayStyle) : Object.assign({}, props.overlayStyle),
143
- className: (0, _classnames.default)(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '')
143
+ className: (0, _classnames.default)(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '', props.type)
144
144
  })));
145
145
  };
146
146
 
@@ -528,10 +528,13 @@ html {
528
528
  background-color: var(--disabled-bg-color);
529
529
  }
530
530
  .lm_dropdown_button {
531
- border-radius: 2px;
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,2 @@
1
+ declare const Empty: () => JSX.Element;
2
+ export default Empty;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var React = _interopRequireWildcard(require("react"));
11
+
12
+ var _configProvider = require("antd/es/config-provider");
13
+
14
+ var Empty = function Empty() {
15
+ var _React$useContext = React.useContext(_configProvider.ConfigContext),
16
+ getPrefixCls = _React$useContext.getPrefixCls;
17
+
18
+ var prefixCls = getPrefixCls('empty-img-default');
19
+ return /*#__PURE__*/React.createElement("svg", {
20
+ className: prefixCls,
21
+ width: "184",
22
+ height: "152",
23
+ viewBox: "0 0 184 152",
24
+ xmlns: "http://www.w3.org/2000/svg"
25
+ }, /*#__PURE__*/React.createElement("g", {
26
+ fill: "none",
27
+ fillRule: "evenodd"
28
+ }, /*#__PURE__*/React.createElement("g", {
29
+ transform: "translate(24 31.67)"
30
+ }, /*#__PURE__*/React.createElement("ellipse", {
31
+ className: "".concat(prefixCls, "-ellipse"),
32
+ cx: "67.797",
33
+ cy: "106.89",
34
+ rx: "67.797",
35
+ ry: "12.668"
36
+ }), /*#__PURE__*/React.createElement("path", {
37
+ className: "".concat(prefixCls, "-path-1"),
38
+ 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"
39
+ }), /*#__PURE__*/React.createElement("path", {
40
+ className: "".concat(prefixCls, "-path-2"),
41
+ 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",
42
+ transform: "translate(13.56)"
43
+ }), /*#__PURE__*/React.createElement("path", {
44
+ className: "".concat(prefixCls, "-path-3"),
45
+ 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"
46
+ }), /*#__PURE__*/React.createElement("path", {
47
+ className: "".concat(prefixCls, "-path-4"),
48
+ 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"
49
+ })), /*#__PURE__*/React.createElement("path", {
50
+ className: "".concat(prefixCls, "-path-5"),
51
+ 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"
52
+ }), /*#__PURE__*/React.createElement("g", {
53
+ className: "".concat(prefixCls, "-g"),
54
+ transform: "translate(149.65 15.383)"
55
+ }, /*#__PURE__*/React.createElement("ellipse", {
56
+ cx: "20.654",
57
+ cy: "3.167",
58
+ rx: "2.849",
59
+ ry: "2.815"
60
+ }), /*#__PURE__*/React.createElement("path", {
61
+ d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
62
+ }))));
63
+ };
64
+
65
+ var _default = Empty;
66
+ exports.default = _default;
@@ -1,7 +1,22 @@
1
- import React from 'react';
2
- import { Empty } from 'antd';
3
- export interface IEmptyProps {
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;