linkmore-design 1.0.53 → 1.0.56

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 (257) hide show
  1. package/dist/{Notification → Affix}/demos/basic.d.ts +0 -0
  2. package/dist/Affix/index.d.ts +54 -0
  3. package/dist/{Notification → Affix}/style/index.d.ts +0 -0
  4. package/dist/Affix/utils.d.ts +15 -0
  5. package/dist/Alert/ErrorBoundary.d.ts +22 -0
  6. package/dist/{Notification/demos/button.d.ts → Alert/demos/basic.d.ts} +0 -0
  7. package/dist/{Notification/demos/icon.d.ts → Alert/demos/visible.d.ts} +0 -0
  8. package/dist/Alert/index.d.ts +41 -0
  9. package/dist/Alert/style/index.d.ts +1 -0
  10. package/dist/CardTable/card/PictureTextRowOperate.d.ts +7 -0
  11. package/dist/CardTable/fns/index.d.ts +3 -3
  12. package/dist/CardTable/{toolbar → pager}/TablePagination.d.ts +0 -0
  13. package/dist/CardTable/pager/index.d.ts +3 -0
  14. package/dist/IconFont/index.d.ts +1 -1
  15. package/dist/LmFilter/Controls/CheckboxTags.d.ts +6 -0
  16. package/dist/LmFilter/Controls/index.d.ts +2 -0
  17. package/dist/LmFilter/LmFilter.d.ts +6 -0
  18. package/dist/LmFilter/baseFilter/fuzzySearch.d.ts +4 -0
  19. package/dist/LmFilter/baseFilter/index.d.ts +3 -0
  20. package/dist/LmFilter/clearFilter/index.d.ts +3 -0
  21. package/dist/LmFilter/complexFilter/drawer.d.ts +4 -0
  22. package/dist/LmFilter/complexFilter/index.d.ts +4 -0
  23. package/dist/LmFilter/complexFilter/valueDrawer.d.ts +4 -0
  24. package/dist/LmFilter/components/CascaderFilter.d.ts +5 -0
  25. package/dist/LmFilter/components/CheckboxFilter.d.ts +5 -0
  26. package/dist/LmFilter/components/DateFilter.d.ts +5 -0
  27. package/dist/LmFilter/components/DropdownFIlter.d.ts +3 -0
  28. package/dist/LmFilter/components/EmptyFilter.d.ts +2 -0
  29. package/dist/LmFilter/components/InputFilter.d.ts +4 -0
  30. package/dist/LmFilter/components/InputSearchClose.d.ts +3 -0
  31. package/dist/LmFilter/components/SelectFilter.d.ts +5 -0
  32. package/dist/LmFilter/components/index.d.ts +3 -0
  33. package/dist/LmFilter/customFilter/index.d.ts +2 -0
  34. package/dist/LmFilter/demos/basic.d.ts +2 -0
  35. package/dist/LmFilter/filterFns/index.d.ts +12 -0
  36. package/dist/LmFilter/hooks/index.d.ts +1 -0
  37. package/dist/LmFilter/hooks/useDelayedFn.d.ts +2 -0
  38. package/dist/LmFilter/index.d.ts +2 -0
  39. package/dist/LmFilter/localization.d.ts +8 -0
  40. package/dist/LmFilter/style/index.d.ts +1 -0
  41. package/dist/LmFilter/utils.d.ts +9 -0
  42. package/dist/LmFilter/wrapper/Filter.d.ts +3 -0
  43. package/dist/LmFilter/wrapper/FilterContainer.d.ts +3 -0
  44. package/dist/LmFilter/wrapper/FilterRoot.d.ts +3 -0
  45. package/dist/LmFilter/wrapper/FilterWrapper.d.ts +3 -0
  46. package/dist/QuickMenu/demos/basic.d.ts +2 -0
  47. package/dist/QuickMenu/index.d.ts +14 -0
  48. package/dist/QuickMenu/style/index.d.ts +1 -0
  49. package/dist/Switch/demos/table.d.ts +2 -0
  50. package/dist/Switch/index.d.ts +2 -1
  51. package/dist/Tag/demos/ExigencyTag.d.ts +2 -0
  52. package/dist/Tag/index.d.ts +4 -0
  53. package/dist/Upload/demos/picture-little.d.ts +3 -0
  54. package/dist/Upload/index.d.ts +5 -1
  55. package/dist/_util/domTarget.d.ts +7 -0
  56. package/dist/_util/getDataOrAriaProps.d.ts +1 -0
  57. package/dist/_util/reactNode.d.ts +7 -0
  58. package/dist/_util/throttleByAnimationFrame.d.ts +8 -0
  59. package/dist/index.d.ts +2 -1
  60. package/dist/index.umd.js +4245 -3326
  61. package/dist/index.umd.min.js +5 -5
  62. package/dist/notification/demos/basic.d.ts +2 -0
  63. package/dist/notification/demos/button.d.ts +2 -0
  64. package/dist/notification/demos/icon.d.ts +2 -0
  65. package/dist/notification/hooks/useNotification.d.ts +7 -0
  66. package/dist/notification/index.d.ts +54 -0
  67. package/dist/notification/style/index.d.ts +1 -0
  68. package/es/Affix/index.d.ts +54 -0
  69. package/es/Affix/index.js +326 -0
  70. package/es/{Notification → Affix}/style/index.css +0 -3
  71. package/es/{Notification → Affix}/style/index.d.ts +0 -0
  72. package/es/{Notification → Affix}/style/index.js +0 -0
  73. package/es/Affix/utils.d.ts +15 -0
  74. package/es/Affix/utils.js +83 -0
  75. package/es/Alert/ErrorBoundary.d.ts +22 -0
  76. package/es/Alert/ErrorBoundary.js +65 -0
  77. package/es/Alert/index.d.ts +41 -0
  78. package/es/Alert/index.js +192 -0
  79. package/es/Alert/style/index.css +531 -0
  80. package/{lib/Notification → es/Alert}/style/index.d.ts +0 -0
  81. package/es/Alert/style/index.js +1 -0
  82. package/es/CardTable/body/TableBodyCell.js +3 -0
  83. package/es/CardTable/card/PictureTextColumn.js +8 -6
  84. package/es/CardTable/card/PictureTextRow.js +14 -51
  85. package/es/CardTable/card/PictureTextRowOperate.js +130 -0
  86. package/es/CardTable/fns/index.js +38 -8
  87. package/es/CardTable/{toolbar → pager}/TablePagination.js +0 -0
  88. package/es/CardTable/pager/index.js +48 -0
  89. package/es/CardTable/style/index.css +160 -12
  90. package/es/CardTable/table/TableRoot.js +20 -18
  91. package/es/CardTable/table/TableWrapper.js +4 -0
  92. package/es/CardTable/toolbar/ToolBarBottom.js +8 -27
  93. package/es/Descriptions/style/index.css +10 -8
  94. package/es/IconFont/index.js +3 -2
  95. package/es/LmFilter/Controls/CheckboxTags.js +53 -0
  96. package/es/LmFilter/Controls/index.js +47 -0
  97. package/es/LmFilter/LmFilter.js +39 -0
  98. package/es/LmFilter/baseFilter/fuzzySearch.js +53 -0
  99. package/es/LmFilter/baseFilter/index.js +34 -0
  100. package/es/LmFilter/clearFilter/index.js +35 -0
  101. package/es/LmFilter/complexFilter/drawer.js +376 -0
  102. package/es/LmFilter/complexFilter/index.js +64 -0
  103. package/es/LmFilter/complexFilter/valueDrawer.js +238 -0
  104. package/es/LmFilter/components/CascaderFilter.js +159 -0
  105. package/es/LmFilter/components/CheckboxFilter.js +197 -0
  106. package/es/LmFilter/components/DateFilter.js +139 -0
  107. package/es/LmFilter/components/DropdownFIlter.js +229 -0
  108. package/es/LmFilter/components/EmptyFilter.js +27 -0
  109. package/es/LmFilter/components/InputFilter.js +52 -0
  110. package/es/LmFilter/components/InputSearchClose.js +74 -0
  111. package/es/LmFilter/components/SelectFilter.js +113 -0
  112. package/es/LmFilter/components/index.js +140 -0
  113. package/es/LmFilter/customFilter/index.js +17 -0
  114. package/es/LmFilter/filterFns/index.js +73 -0
  115. package/es/LmFilter/hooks/index.js +18 -0
  116. package/es/LmFilter/hooks/useDelayedFn.js +29 -0
  117. package/es/LmFilter/icon_placeholder.png +0 -0
  118. package/es/LmFilter/index.js +16 -0
  119. package/es/LmFilter/localization.d.ts +8 -0
  120. package/es/LmFilter/localization.js +12 -0
  121. package/es/LmFilter/style/index.js +3 -0
  122. package/es/LmFilter/style/style.css +212 -0
  123. package/es/LmFilter/utils.js +71 -0
  124. package/es/LmFilter/wrapper/Filter.js +33 -0
  125. package/es/LmFilter/wrapper/FilterContainer.js +29 -0
  126. package/es/LmFilter/wrapper/FilterRoot.js +170 -0
  127. package/es/LmFilter/wrapper/FilterWrapper.js +25 -0
  128. package/es/QuickMenu/index.d.ts +14 -0
  129. package/es/QuickMenu/index.js +169 -0
  130. package/es/QuickMenu/style/index.css +560 -0
  131. package/es/QuickMenu/style/index.d.ts +1 -0
  132. package/es/QuickMenu/style/index.js +1 -0
  133. package/es/Switch/index.d.ts +2 -1
  134. package/es/Switch/index.js +33 -1
  135. package/es/Switch/style/index.css +41 -0
  136. package/es/Tag/index.d.ts +4 -0
  137. package/es/Tag/index.js +48 -2
  138. package/es/Tag/style/index.css +4 -1
  139. package/es/Upload/index.d.ts +5 -1
  140. package/es/Upload/index.js +7 -2
  141. package/es/Upload/style/index.css +35 -0
  142. package/es/_util/domTarget.d.ts +7 -0
  143. package/es/_util/domTarget.js +20 -0
  144. package/es/_util/getDataOrAriaProps.d.ts +1 -0
  145. package/es/_util/getDataOrAriaProps.js +9 -0
  146. package/es/_util/reactNode.d.ts +7 -0
  147. package/es/_util/reactNode.js +10 -0
  148. package/es/_util/throttleByAnimationFrame.d.ts +8 -0
  149. package/es/_util/throttleByAnimationFrame.js +58 -0
  150. package/es/index.d.ts +2 -1
  151. package/es/index.js +3 -2
  152. package/es/message/style/index.css +1 -0
  153. package/es/notification/hooks/useNotification.d.ts +7 -0
  154. package/es/notification/hooks/useNotification.js +54 -0
  155. package/es/notification/index.d.ts +54 -0
  156. package/es/notification/index.js +342 -0
  157. package/es/notification/style/index.css +546 -0
  158. package/es/notification/style/index.d.ts +1 -0
  159. package/es/notification/style/index.js +1 -0
  160. package/lib/Affix/index.d.ts +54 -0
  161. package/lib/Affix/index.js +349 -0
  162. package/lib/{Notification → Affix}/style/index.css +0 -3
  163. package/lib/Affix/style/index.d.ts +1 -0
  164. package/lib/{Notification → Affix}/style/index.js +0 -0
  165. package/lib/Affix/utils.d.ts +15 -0
  166. package/lib/Affix/utils.js +104 -0
  167. package/lib/Alert/ErrorBoundary.d.ts +22 -0
  168. package/lib/Alert/ErrorBoundary.js +79 -0
  169. package/lib/Alert/index.d.ts +41 -0
  170. package/lib/Alert/index.js +215 -0
  171. package/lib/Alert/style/index.css +531 -0
  172. package/lib/Alert/style/index.d.ts +1 -0
  173. package/lib/Alert/style/index.js +3 -0
  174. package/lib/CardTable/body/TableBodyCell.js +3 -0
  175. package/lib/CardTable/card/PictureTextColumn.js +8 -6
  176. package/lib/CardTable/card/PictureTextRow.js +14 -51
  177. package/lib/CardTable/card/PictureTextRowOperate.js +130 -0
  178. package/lib/CardTable/fns/index.js +38 -8
  179. package/lib/CardTable/{toolbar → pager}/TablePagination.js +0 -0
  180. package/lib/CardTable/pager/index.js +48 -0
  181. package/lib/CardTable/style/index.css +160 -12
  182. package/lib/CardTable/table/TableRoot.js +20 -18
  183. package/lib/CardTable/table/TableWrapper.js +4 -0
  184. package/lib/CardTable/toolbar/ToolBarBottom.js +8 -27
  185. package/lib/Descriptions/style/index.css +10 -8
  186. package/lib/IconFont/index.js +3 -2
  187. package/lib/LmFilter/Controls/CheckboxTags.js +53 -0
  188. package/lib/LmFilter/Controls/index.js +47 -0
  189. package/lib/LmFilter/LmFilter.js +39 -0
  190. package/lib/LmFilter/baseFilter/fuzzySearch.js +53 -0
  191. package/lib/LmFilter/baseFilter/index.js +34 -0
  192. package/lib/LmFilter/clearFilter/index.js +35 -0
  193. package/lib/LmFilter/complexFilter/drawer.js +376 -0
  194. package/lib/LmFilter/complexFilter/index.js +64 -0
  195. package/lib/LmFilter/complexFilter/valueDrawer.js +238 -0
  196. package/lib/LmFilter/components/CascaderFilter.js +159 -0
  197. package/lib/LmFilter/components/CheckboxFilter.js +197 -0
  198. package/lib/LmFilter/components/DateFilter.js +139 -0
  199. package/lib/LmFilter/components/DropdownFIlter.js +229 -0
  200. package/lib/LmFilter/components/EmptyFilter.js +27 -0
  201. package/lib/LmFilter/components/InputFilter.js +52 -0
  202. package/lib/LmFilter/components/InputSearchClose.js +74 -0
  203. package/lib/LmFilter/components/SelectFilter.js +113 -0
  204. package/lib/LmFilter/components/index.js +140 -0
  205. package/lib/LmFilter/customFilter/index.js +17 -0
  206. package/lib/LmFilter/filterFns/index.js +73 -0
  207. package/lib/LmFilter/hooks/index.js +18 -0
  208. package/lib/LmFilter/hooks/useDelayedFn.js +29 -0
  209. package/lib/LmFilter/icon_placeholder.png +0 -0
  210. package/lib/LmFilter/index.js +16 -0
  211. package/lib/LmFilter/localization.d.ts +8 -0
  212. package/lib/LmFilter/localization.js +19 -0
  213. package/lib/LmFilter/style/index.js +3 -0
  214. package/lib/LmFilter/style/style.css +212 -0
  215. package/lib/LmFilter/utils.js +71 -0
  216. package/lib/LmFilter/wrapper/Filter.js +33 -0
  217. package/lib/LmFilter/wrapper/FilterContainer.js +29 -0
  218. package/lib/LmFilter/wrapper/FilterRoot.js +170 -0
  219. package/lib/LmFilter/wrapper/FilterWrapper.js +25 -0
  220. package/lib/QuickMenu/index.d.ts +14 -0
  221. package/lib/QuickMenu/index.js +187 -0
  222. package/lib/QuickMenu/style/index.css +560 -0
  223. package/lib/QuickMenu/style/index.d.ts +1 -0
  224. package/lib/QuickMenu/style/index.js +3 -0
  225. package/lib/Switch/index.d.ts +2 -1
  226. package/lib/Switch/index.js +34 -1
  227. package/lib/Switch/style/index.css +41 -0
  228. package/lib/Tag/index.d.ts +4 -0
  229. package/lib/Tag/index.js +48 -1
  230. package/lib/Tag/style/index.css +4 -1
  231. package/lib/Upload/index.d.ts +5 -1
  232. package/lib/Upload/index.js +8 -2
  233. package/lib/Upload/style/index.css +35 -0
  234. package/lib/_util/domTarget.d.ts +7 -0
  235. package/lib/_util/domTarget.js +31 -0
  236. package/lib/_util/getDataOrAriaProps.d.ts +1 -0
  237. package/lib/_util/getDataOrAriaProps.js +16 -0
  238. package/lib/_util/reactNode.d.ts +7 -0
  239. package/lib/_util/reactNode.js +24 -0
  240. package/lib/_util/throttleByAnimationFrame.d.ts +8 -0
  241. package/lib/_util/throttleByAnimationFrame.js +72 -0
  242. package/lib/index.d.ts +2 -1
  243. package/lib/index.js +11 -3
  244. package/lib/message/style/index.css +1 -0
  245. package/lib/notification/hooks/useNotification.d.ts +7 -0
  246. package/lib/notification/hooks/useNotification.js +69 -0
  247. package/lib/notification/index.d.ts +54 -0
  248. package/lib/notification/index.js +365 -0
  249. package/lib/notification/style/index.css +546 -0
  250. package/lib/notification/style/index.d.ts +1 -0
  251. package/lib/notification/style/index.js +3 -0
  252. package/package.json +5 -2
  253. package/dist/Notification/index.d.ts +0 -7
  254. package/es/Notification/index.d.ts +0 -7
  255. package/es/Notification/index.js +0 -10
  256. package/lib/Notification/index.d.ts +0 -7
  257. package/lib/Notification/index.js +0 -23
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ require("antd/es/message/style");
11
+
12
+ var _message2 = _interopRequireDefault(require("antd/es/message"));
13
+
14
+ require("antd/es/image/style");
15
+
16
+ var _image = _interopRequireDefault(require("antd/es/image"));
17
+
18
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
19
+
20
+ require("antd/es/typography/style");
21
+
22
+ var _typography = _interopRequireDefault(require("antd/es/typography"));
23
+
24
+ var _react = _interopRequireDefault(require("react"));
25
+
26
+ var _classnames = _interopRequireDefault(require("classnames"));
27
+
28
+ var _linkmoreDesign = require("linkmore-design");
29
+
30
+ var Paragraph = _typography.default.Paragraph; // 左图右文
31
+
32
+ var PictureTextRowOperate = function PictureTextRowOperate(_ref) {
33
+ var index = _ref.index,
34
+ cell = _ref.cell,
35
+ table = _ref.table,
36
+ checked = _ref.checked;
37
+ var cellKey = table.cellKey,
38
+ state = table.state,
39
+ defaultConfig = table.defaultConfig,
40
+ cellClick = table.cellClick,
41
+ cellDoubleClick = table.cellDoubleClick,
42
+ toggleCheckboxKey = table.toggleCheckboxKey,
43
+ checkboxChange = table.checkboxChange;
44
+ var trigger = state.checkboxConfig.trigger;
45
+ var resetDefaultConfig = (0, _objectSpread2.default)({
46
+ checkbox: true,
47
+ imgurl: 'imgurl',
48
+ title: function title() {
49
+ return '物料名称';
50
+ },
51
+ code: 'code',
52
+ desc: 'desc',
53
+ operate: null,
54
+ extend: null,
55
+ columns: null
56
+ }, defaultConfig); // 复选框改变事件, 将复选数据保存到缓存中
57
+
58
+ var onSelctChange = function onSelctChange(val) {
59
+ toggleCheckboxKey(cell[cellKey]);
60
+ checkboxChange === null || checkboxChange === void 0 ? void 0 : checkboxChange(val, cell, index);
61
+ }; // 单元格单击事件
62
+
63
+
64
+ var onClick = function onClick() {
65
+ cellClick === null || cellClick === void 0 ? void 0 : cellClick(cell, index);
66
+
67
+ if (trigger === 'cell') {
68
+ onSelctChange === null || onSelctChange === void 0 ? void 0 : onSelctChange(!checked);
69
+ }
70
+ }; // 单元格双击事件: 双击时避免单击事件触发自己实现
71
+
72
+
73
+ var onDoubleClick = function onDoubleClick() {
74
+ cellDoubleClick === null || cellDoubleClick === void 0 ? void 0 : cellDoubleClick(cell, index);
75
+ };
76
+
77
+ return /*#__PURE__*/_react.default.createElement("div", {
78
+ className: "card_PTRO"
79
+ }, /*#__PURE__*/_react.default.createElement("div", {
80
+ className: (0, _classnames.default)('card_PTRO_container', checked && 'checked')
81
+ }, /*#__PURE__*/_react.default.createElement("div", {
82
+ className: "card_PTRO_body",
83
+ onClick: onClick,
84
+ onDoubleClick: onDoubleClick
85
+ }, resetDefaultConfig.checkbox && /*#__PURE__*/_react.default.createElement("div", {
86
+ className: "card_checkbox",
87
+ onClick: function onClick(e) {
88
+ return e.stopPropagation();
89
+ }
90
+ }, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Checkbox, {
91
+ checked: checked,
92
+ onChange: function onChange(e) {
93
+ return onSelctChange(e.target.checked);
94
+ }
95
+ })), /*#__PURE__*/_react.default.createElement("div", {
96
+ className: "card_PTRO_left"
97
+ }, typeof resetDefaultConfig.imgurl === 'function' ? resetDefaultConfig.imgurl(cell, table) : /*#__PURE__*/_react.default.createElement(_image.default, {
98
+ src: cell[resetDefaultConfig.imgurl],
99
+ fallback: ""
100
+ })), /*#__PURE__*/_react.default.createElement("div", {
101
+ className: "card_PTRO_right"
102
+ }, resetDefaultConfig.title ? /*#__PURE__*/_react.default.createElement("div", {
103
+ className: "card_title lm-font-middle-bold"
104
+ }, typeof resetDefaultConfig.title === 'function' ? resetDefaultConfig.title(cell, table) : cell[resetDefaultConfig.title]) : null, resetDefaultConfig.code ? /*#__PURE__*/_react.default.createElement("div", {
105
+ className: "card_copy_text"
106
+ }, typeof resetDefaultConfig.code === 'function' ? resetDefaultConfig.code(cell, table) : /*#__PURE__*/_react.default.createElement(Paragraph, {
107
+ copyable: {
108
+ tooltips: false,
109
+ onCopy: function onCopy() {
110
+ return _message2.default.success('复制成功!', 1.5);
111
+ }
112
+ },
113
+ ellipsis: true
114
+ }, cell[resetDefaultConfig.code])) : null, resetDefaultConfig.columns ? /*#__PURE__*/_react.default.createElement("div", {
115
+ className: "PTRO_column"
116
+ }, resetDefaultConfig.columns.map(function (v, idx) {
117
+ return /*#__PURE__*/_react.default.createElement("span", {
118
+ key: (v === null || v === void 0 ? void 0 : v.dataIndex) || idx
119
+ }, v.title, ": ", cell[v.dataIndex]);
120
+ })) : null, resetDefaultConfig.extend ? /*#__PURE__*/_react.default.createElement("div", {
121
+ className: "PTRO_extend"
122
+ }, resetDefaultConfig.extend(cell, table)) : null, resetDefaultConfig.desc ? /*#__PURE__*/_react.default.createElement("div", {
123
+ className: "PTRO_desc"
124
+ }, typeof resetDefaultConfig.desc === 'function' ? resetDefaultConfig.desc(cell, table) : cell[resetDefaultConfig.desc]) : null)), /*#__PURE__*/_react.default.createElement("div", {
125
+ className: "card_PTRO_footer"
126
+ }, resetDefaultConfig.operate ? resetDefaultConfig.operate(cell, table) : null)));
127
+ };
128
+
129
+ var _default = PictureTextRowOperate;
130
+ exports.default = _default;
@@ -10,15 +10,17 @@ exports.default = void 0;
10
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
11
 
12
12
  // 操作方法集合
13
- var setOptions = function setOptions(_ref) {
13
+ var CoreOptions = function CoreOptions(_ref) {
14
14
  var state = _ref.state,
15
15
  dispatch = _ref.dispatch,
16
16
  props = _ref.props;
17
17
  var checkboxConfig = state.checkboxConfig;
18
18
  var dataSource = props.dataSource,
19
- cellKey = props.cellKey;
19
+ cellKey = props.cellKey,
20
+ checkboxChange = props.checkboxChange;
20
21
  var checkKeys = checkboxConfig.checkKeys,
21
- checkValues = checkboxConfig.checkValues; // 设置选中的值: 第一个参数是数据的键,第二个参数是选中与否, 第三个参数控制是否重置
22
+ checkValues = checkboxConfig.checkValues,
23
+ checkMethod = checkboxConfig.checkMethod; // 设置选中的值: 第一个参数是数据的键,第二个参数是选中与否, 第三个参数控制是否重置
22
24
  // 未做key是否属于数据源校验,用于分页时保存之前的选中状态
23
25
 
24
26
  var setCheckboxKeys = function setCheckboxKeys(keys, checked, reset) {
@@ -65,15 +67,43 @@ var setOptions = function setOptions(_ref) {
65
67
 
66
68
 
67
69
  var toggleCheckboxKey = function toggleCheckboxKey(k) {
70
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
71
+ var _options$trigger = options.trigger,
72
+ trigger = _options$trigger === void 0 ? 'default' : _options$trigger,
73
+ cell = options.cell,
74
+ cellIndex = options.cellIndex;
68
75
  var nKeys = [k],
69
- isChecked = true,
76
+ isCheck = true,
70
77
  reset = false; // 单个切换
71
78
 
72
79
  if (!Array.isArray(k)) {
73
- isChecked = !(checkKeys === null || checkKeys === void 0 ? void 0 : checkKeys.some(function (v) {
80
+ var isCanCheck = checkMethod; // 是否可选中
81
+
82
+ isCheck = !(checkKeys === null || checkKeys === void 0 ? void 0 : checkKeys.some(function (v) {
74
83
  return v === k;
75
84
  }));
76
- } // 多个切换
85
+ var record = cell || ''; // 检测选中前置阻挡事件
86
+
87
+ if (typeof checkMethod === 'function') {
88
+ record = record || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.find(function (v) {
89
+ return v[cellKey] === k;
90
+ }));
91
+ isCanCheck = checkMethod(record, state, trigger);
92
+ }
93
+
94
+ if (!isCanCheck) return; // 触发复选框改变事件: 仅手动触发有效
95
+
96
+ if (typeof checkboxChange === 'function') {
97
+ record = record || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.find(function (v) {
98
+ return v[cellKey] === k;
99
+ }));
100
+ checkboxChange === null || checkboxChange === void 0 ? void 0 : checkboxChange({
101
+ checked: isCheck,
102
+ cell: record,
103
+ cellIndex: cellIndex
104
+ });
105
+ }
106
+ } // 多个切换 通过重置去除选中项保留切换项
77
107
 
78
108
 
79
109
  if (Array.isArray(k)) {
@@ -93,7 +123,7 @@ var setOptions = function setOptions(_ref) {
93
123
  reset = true;
94
124
  }
95
125
 
96
- setCheckboxKeys(nKeys, isChecked, reset);
126
+ setCheckboxKeys(nKeys, isCheck, reset);
97
127
  };
98
128
 
99
129
  return {
@@ -102,5 +132,5 @@ var setOptions = function setOptions(_ref) {
102
132
  };
103
133
  };
104
134
 
105
- var _default = setOptions;
135
+ var _default = CoreOptions;
106
136
  exports.default = _default;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _TablePagination = _interopRequireDefault(require("./TablePagination"));
13
+
14
+ var CardTablePager = /*#__PURE__*/_react.default.memo(function (_ref) {
15
+ var table = _ref.table;
16
+ var pagination = table.pagination,
17
+ pagerConfig = table.pagerConfig; // left || right:插槽
18
+
19
+ var left = pagerConfig.left,
20
+ right = pagerConfig.right; // 底部工具栏左侧插槽: 默认空 div 标签占位
21
+
22
+ var LeftSlot = function LeftSlot() {
23
+ if (!left) {
24
+ return /*#__PURE__*/_react.default.createElement("div", null);
25
+ }
26
+
27
+ ;
28
+ return typeof left === 'function' ? left(table) : left;
29
+ }; // 底部工具栏右侧插槽
30
+
31
+
32
+ var RighSlot = function RighSlot() {
33
+ if (!right) {
34
+ return pagination ? /*#__PURE__*/_react.default.createElement(_TablePagination.default, {
35
+ table: table
36
+ }) : null;
37
+ }
38
+
39
+ return typeof right === 'function' ? right(table, _TablePagination.default) : right;
40
+ };
41
+
42
+ return /*#__PURE__*/_react.default.createElement("div", {
43
+ className: "lm_card_table_pager"
44
+ }, /*#__PURE__*/_react.default.createElement(LeftSlot, null), /*#__PURE__*/_react.default.createElement(RighSlot, null));
45
+ });
46
+
47
+ var _default = CardTablePager;
48
+ exports.default = _default;
@@ -24,12 +24,12 @@
24
24
  .lm_card_table_wrapper .lm_card_table_container .lm_card_table .lm_card_table_body .lm_card_table_body_row .lm_card_table_body_cell.cell_checked {
25
25
  border-color: var(--primary-color);
26
26
  }
27
- .lm_card_table_wrapper .lm_card_table_toolbar_bottom {
27
+ .lm_card_table_wrapper .lm_card_table_pager {
28
28
  display: flex;
29
29
  align-items: center;
30
30
  justify-content: space-between;
31
31
  }
32
- .lm_card_table_wrapper .lm_card_table_toolbar_bottom .lm_card_table_pagination {
32
+ .lm_card_table_wrapper .lm_card_table_pager .lm_card_table_pagination {
33
33
  display: flex;
34
34
  align-items: center;
35
35
  height: 48px;
@@ -182,7 +182,7 @@
182
182
  top: 0;
183
183
  }
184
184
  .card_PTR .card_PTR_container .card_PTR_body .card_PTR_left {
185
- width: 40%;
185
+ width: 35%;
186
186
  min-width: 126px;
187
187
  border-radius: 2px;
188
188
  background: var(--color-15);
@@ -211,6 +211,8 @@
211
211
  font-size: 12px;
212
212
  color: var(--color-45);
213
213
  margin-top: 4px;
214
+ padding-bottom: 6px;
215
+ border-bottom: 1px solid var(--line-color);
214
216
  }
215
217
  .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .card_copy_text .ant-typography {
216
218
  margin: 0;
@@ -222,18 +224,20 @@
222
224
  .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .card_copy_text .ant-typography .ant-typography-copy.ant-typography-copy-success {
223
225
  color: var(--success-color);
224
226
  }
225
- .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_extend {
227
+ .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column {
226
228
  flex: 1 1 0;
227
- display: flex;
228
- flex-wrap: wrap;
229
- gap: 8px;
230
- row-gap: 126px;
229
+ }
230
+ .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box {
231
+ font-size: 12px;
232
+ display: grid;
233
+ grid-template-columns: repeat(2, 1fr);
234
+ color: var(--color-65);
231
235
  margin-top: 8px;
232
- overflow: hidden;
233
236
  }
234
- .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_extend button {
235
- border: none;
236
- background-color: var(--background-color);
237
+ .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_column .PTR_column_box span {
238
+ display: inline-flex;
239
+ align-items: center;
240
+ min-height: 20px;
237
241
  }
238
242
  .card_PTR .card_PTR_container .card_PTR_body .card_PTR_right .PTR_desc {
239
243
  font-size: 12px;
@@ -280,6 +284,150 @@
280
284
  .card_PTR .card_PTR_container:hover .card_PTR_body .card_checkbox {
281
285
  opacity: 1;
282
286
  }
287
+ .card_PTRO {
288
+ height: 100%;
289
+ }
290
+ .card_PTRO .card_PTRO_container {
291
+ height: 100%;
292
+ display: flex;
293
+ flex-flow: column;
294
+ border-radius: 2px;
295
+ background-color: var(--background-color);
296
+ transition: 0.3s;
297
+ }
298
+ .card_PTRO .card_PTRO_container .card_PTRO_body {
299
+ position: relative;
300
+ display: flex;
301
+ flex: 1;
302
+ gap: var(--gap);
303
+ padding: calc(var(--gap) * 2);
304
+ overflow: hidden;
305
+ }
306
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_checkbox {
307
+ position: absolute;
308
+ top: 8px;
309
+ left: 8px;
310
+ z-index: 1;
311
+ opacity: 0;
312
+ transition: 0.3s;
313
+ }
314
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_checkbox .lm-checkbox {
315
+ font-size: 0;
316
+ border: 8px solid rgba(255, 255, 255, 0.625);
317
+ border-radius: 2px;
318
+ line-height: 1;
319
+ }
320
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_checkbox .ant-checkbox {
321
+ margin: 0;
322
+ top: 0;
323
+ }
324
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_left {
325
+ width: 40%;
326
+ min-width: 126px;
327
+ border-radius: 2px;
328
+ background: var(--color-15);
329
+ overflow: hidden;
330
+ }
331
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_left .ant-image {
332
+ width: 100%;
333
+ height: 100%;
334
+ }
335
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_left .ant-image .ant-image-img {
336
+ width: 100%;
337
+ height: 100%;
338
+ object-fit: cover;
339
+ }
340
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right {
341
+ flex: 1;
342
+ display: flex;
343
+ flex-flow: column;
344
+ }
345
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .card_title {
346
+ overflow: hidden;
347
+ text-overflow: ellipsis;
348
+ white-space: nowrap;
349
+ }
350
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .card_copy_text {
351
+ font-size: 12px;
352
+ color: var(--color-45);
353
+ margin-top: 4px;
354
+ }
355
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .card_copy_text .ant-typography {
356
+ margin: 0;
357
+ color: inherit;
358
+ }
359
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .card_copy_text .ant-typography .ant-typography-copy {
360
+ color: inherit;
361
+ }
362
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .card_copy_text .ant-typography .ant-typography-copy.ant-typography-copy-success {
363
+ color: var(--success-color);
364
+ }
365
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .PTRO_column {
366
+ display: grid;
367
+ grid-template-columns: repeat(2, 1fr);
368
+ font-size: 12px;
369
+ color: var(--color-65);
370
+ }
371
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .PTRO_extend {
372
+ font-size: 12px;
373
+ flex: 1 1 0;
374
+ display: flex;
375
+ flex-wrap: wrap;
376
+ gap: 8px;
377
+ row-gap: 126px;
378
+ margin-top: 8px;
379
+ overflow: hidden;
380
+ color: var(--color-65);
381
+ }
382
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .PTRO_extend button {
383
+ border: none;
384
+ background-color: var(--background-color);
385
+ }
386
+ .card_PTRO .card_PTRO_container .card_PTRO_body .card_PTRO_right .PTRO_desc {
387
+ font-size: 12px;
388
+ color: var(--color-65);
389
+ overflow: hidden;
390
+ text-overflow: ellipsis;
391
+ display: -webkit-box;
392
+ -webkit-box-orient: vertical;
393
+ -webkit-line-clamp: 2;
394
+ }
395
+ .card_PTRO .card_PTRO_container .card_PTRO_footer {
396
+ position: relative;
397
+ display: flex;
398
+ align-items: center;
399
+ background-color: var(--background-color);
400
+ }
401
+ .card_PTRO .card_PTRO_container .card_PTRO_footer > * {
402
+ flex: 1;
403
+ display: inline-flex;
404
+ align-items: center;
405
+ justify-content: center;
406
+ max-width: initial;
407
+ height: 40px;
408
+ border: none;
409
+ background-color: var(--background-color);
410
+ }
411
+ .card_PTRO .card_PTRO_container .card_PTRO_footer > *::after {
412
+ content: '';
413
+ position: absolute;
414
+ right: 0;
415
+ top: 50%;
416
+ -webkit-transform: translateY(-50%);
417
+ transform: translateY(-50%);
418
+ height: 18px;
419
+ width: 1px;
420
+ background-color: var(--color-15);
421
+ }
422
+ .card_PTRO .card_PTRO_container .card_PTRO_footer > *:last-child::after {
423
+ display: none;
424
+ }
425
+ .card_PTRO .card_PTRO_container:hover {
426
+ background-color: var(--color-6);
427
+ }
428
+ .card_PTRO .card_PTRO_container:hover .card_PTRO_body .card_checkbox {
429
+ opacity: 1;
430
+ }
283
431
  .hasChecked .card_PTC .card_PTC_container .card_checkbox,
284
432
  .hasChecked .card_PTR .card_PTR_container .card_PTR_body .card_checkbox {
285
433
  opacity: 1;
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.default = void 0;
11
11
 
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
13
 
14
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
+
16
16
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
17
17
 
18
18
  var _react = _interopRequireWildcard(require("react"));
@@ -21,7 +21,8 @@ var _TableWrapper = _interopRequireDefault(require("./TableWrapper"));
21
21
 
22
22
  var _fns = _interopRequireDefault(require("../fns"));
23
23
 
24
- var _excluded = ["rowConfig", "cellConfig", "defaultConfig", "checkboxConfig"];
24
+ var _excluded = ["checkKeys", "trigger", "checkMethod"],
25
+ _excluded2 = ["rowConfig", "cellConfig", "defaultConfig", "checkboxConfig", "pagerConfig", "toolbarConfig"];
25
26
 
26
27
  var reducer = function reducer(state, action) {
27
28
  var page = action.page,
@@ -70,6 +71,9 @@ var getInitialState = function getInitialState(props) {
70
71
  checkKeys = _props$checkboxConfig2 === void 0 ? [] : _props$checkboxConfig2,
71
72
  _props$checkboxConfig3 = _props$checkboxConfig.trigger,
72
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),
73
77
  _props$dataSource = props.dataSource,
74
78
  dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
75
79
  cellKey = props.cellKey;
@@ -78,11 +82,12 @@ var getInitialState = function getInitialState(props) {
78
82
  }) || [];
79
83
  return {
80
84
  // 复选框的配置
81
- checkboxConfig: {
85
+ checkboxConfig: (0, _objectSpread2.default)({
82
86
  checkKeys: checkKeys,
83
87
  checkValues: checkValues,
84
- trigger: trigger
85
- },
88
+ trigger: trigger,
89
+ checkMethod: checkMethod
90
+ }, resetCheckCOnfig),
86
91
  // 分页的配置
87
92
  page: {
88
93
  pageIndex: 1,
@@ -114,18 +119,17 @@ var LmCardTableRoot = function LmCardTableRoot(props, ref) {
114
119
  var _useState = (0, _react.useState)(false),
115
120
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
116
121
  isFullScreen = _useState2[0],
117
- setIsFullScreen = _useState2[1];
122
+ setIsFullScreen = _useState2[1]; // 配置对象收集
118
123
 
119
- var _state$checkboxConfig = state.checkboxConfig,
120
- checkKeys = _state$checkboxConfig.checkKeys,
121
- checkValues = _state$checkboxConfig.checkValues; // 配置对象收集
122
124
 
123
125
  var configProps = (0, _react.useMemo)(function () {
124
126
  var rowConfig = props.rowConfig,
125
127
  cellConfig = props.cellConfig,
126
128
  defaultConfig = props.defaultConfig,
127
129
  checkboxConfig = props.checkboxConfig,
128
- resetProps = (0, _objectWithoutProperties2.default)(props, _excluded);
130
+ pagerConfig = props.pagerConfig,
131
+ toolbarConfig = props.toolbarConfig,
132
+ resetProps = (0, _objectWithoutProperties2.default)(props, _excluded2);
129
133
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, resetProps), {}, {
130
134
  rowConfig: (0, _objectSpread2.default)({
131
135
  // 行配置
@@ -137,22 +141,20 @@ var LmCardTableRoot = function LmCardTableRoot(props, ref) {
137
141
  height: 282
138
142
  }, cellConfig),
139
143
  checkboxConfig: (0, _objectSpread2.default)({}, checkboxConfig),
140
- toolbarConfig: {
141
- pager: {},
142
- toolbarBottom: {}
143
- },
144
+ pagerConfig: (0, _objectSpread2.default)({}, pagerConfig),
145
+ toolbarConfig: (0, _objectSpread2.default)({}, toolbarConfig),
144
146
  defaultConfig: defaultConfig
145
147
  });
146
148
  }, [props]); // 方法收集
147
149
 
148
- var EventProps = (0, _react.useMemo)(function () {
150
+ var eventProps = (0, _react.useMemo)(function () {
149
151
  return (0, _fns.default)({
150
152
  state: state,
151
153
  dispatch: dispatch,
152
154
  props: props
153
155
  });
154
156
  }, [state, dispatch, props]);
155
- var table = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, configProps), EventProps), {}, {
157
+ var table = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, configProps), eventProps), {}, {
156
158
  state: state,
157
159
  dispatch: dispatch
158
160
  }); // 向外暴露出的方法
@@ -162,7 +164,7 @@ var LmCardTableRoot = function LmCardTableRoot(props, ref) {
162
164
  getCheckboxRecords: function getCheckboxRecords() {
163
165
  return state.checkboxConfig.checkValues;
164
166
  }
165
- }, EventProps);
167
+ }, eventProps);
166
168
  });
167
169
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isFullScreen && /*#__PURE__*/_react.default.createElement(_TableWrapper.default, {
168
170
  table: table
@@ -13,6 +13,8 @@ var _react = _interopRequireDefault(require("react"));
13
13
 
14
14
  var _TableContainer = _interopRequireDefault(require("./TableContainer"));
15
15
 
16
+ var _pager = _interopRequireDefault(require("../pager"));
17
+
16
18
  var _ToolBarBottom = _interopRequireDefault(require("../toolbar/ToolBarBottom"));
17
19
 
18
20
  // 包裹表格外围区域: 工具栏操作区域/主体区域/工具栏底部区域
@@ -27,6 +29,8 @@ var LmCardTableWrapper = /*#__PURE__*/_react.default.memo(function (_ref) {
27
29
  }, style)
28
30
  }, /*#__PURE__*/_react.default.createElement(_TableContainer.default, {
29
31
  table: table
32
+ }), /*#__PURE__*/_react.default.createElement(_pager.default, {
33
+ table: table
30
34
  }), /*#__PURE__*/_react.default.createElement(_ToolBarBottom.default, {
31
35
  table: table
32
36
  }));
@@ -9,38 +9,19 @@ exports.default = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _TablePagination = _interopRequireDefault(require("./TablePagination"));
13
-
14
12
  var CardToolBarBottom = /*#__PURE__*/_react.default.memo(function (_ref) {
15
13
  var table = _ref.table;
16
14
  var pagination = table.pagination,
17
- _table$toolbarConfig = table.toolbarConfig,
18
- toolbarBottom = _table$toolbarConfig.toolbarBottom,
19
- pager = _table$toolbarConfig.pager; // toolbarBottom与pager一致: 用于插槽
20
-
21
- var _ref2 = toolbarBottom || pager,
22
- left = _ref2.left,
23
- right = _ref2.right;
24
-
25
- var LeftSlot = function LeftSlot() {
26
- return left;
27
- };
28
-
29
- var RighSlot = function RighSlot() {
30
- if (!right) {
31
- return pagination && /*#__PURE__*/_react.default.createElement(_TablePagination.default, {
32
- table: table
33
- });
34
- }
15
+ toolbarBottom = table.toolbarConfig.toolbarBottom;
35
16
 
36
- if (right) {
37
- typeof right === 'function' ? right(_TablePagination.default) : right;
38
- }
39
- };
17
+ if (!toolbarBottom) {
18
+ return null;
19
+ }
40
20
 
41
- return /*#__PURE__*/_react.default.createElement("div", {
42
- className: "lm_card_table_toolbar_bottom"
43
- }, /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement(RighSlot, null));
21
+ return typeof toolbarBottom === 'function' ? toolbarBottom(table) : toolbarBottom // <div className='lm_card_table_toolbar_bottom'>
22
+ // <ToolbarBottomSlot />
23
+ // </div>
24
+ ;
44
25
  });
45
26
 
46
27
  var _default = CardToolBarBottom;