linkmore-design 1.0.98 → 1.0.99

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.
@@ -89,7 +89,7 @@ var SheelTabelCell = function SheelTabelCell(props) {
89
89
  if (e.button === 2) {
90
90
  console.log('点击了右键');
91
91
  } else if (!(col === null || col === void 0 ? void 0 : col.disableEvents)) {
92
- console.log((_a = endCellRef === null || endCellRef === void 0 ? void 0 : endCellRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target), '点击了快速选择键');
92
+ console.log((_a = endCellRef === null || endCellRef === void 0 ? void 0 : endCellRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target), '点击了快速选择键', record, col, rowKey);
93
93
  onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(rowIndex, colIndex, e, !!((_b = endCellRef === null || endCellRef === void 0 ? void 0 : endCellRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target)));
94
94
  }
95
95
  };
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.checkIsSelectd = checkIsSelectd;
9
9
  exports.checkStatus = checkStatus;
10
+ exports.getSelectionColText = getSelectionColText;
11
+ exports.getSelectionRowText = getSelectionRowText;
12
+ exports.getSkipList = getSkipList;
13
+ exports.range = void 0;
10
14
  exports.transformWithColGroup = transformWithColGroup;
11
15
  exports.transformWithRowGroup = transformWithRowGroup;
12
16
 
@@ -16,12 +20,32 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
16
20
 
17
21
  var _lodash = _interopRequireDefault(require("lodash"));
18
22
 
23
+ /**
24
+ * 生成 start 到 end 数字组成的数组
25
+ * @param {number} start
26
+ * @param {number} end
27
+ * @returns {Array<number>}
28
+ */
29
+ var range = function range(start, end) {
30
+ var array = [];
31
+ var inc = end - start > 0;
32
+
33
+ for (var i = start; inc ? i <= end : i >= end; inc ? i += 1 : i -= 1) {
34
+ inc ? array.push(i) : array.unshift(i);
35
+ }
36
+
37
+ return array;
38
+ };
19
39
  /**
20
40
  * 对数据进行分组
21
41
  * @param {Array} data
22
42
  * @param {string} key
23
43
  * @return {Object}
24
44
  */
45
+
46
+
47
+ exports.range = range;
48
+
25
49
  function dataGroup(data, key) {
26
50
  var result = {};
27
51
  data.forEach(function (item) {
@@ -208,4 +232,81 @@ function checkStatus(i, j, commiting) {
208
232
  /** 是否有效拉伸 */
209
233
  isVaildCommit: mini <= i && maxi >= i || minj <= j && maxj >= j
210
234
  };
235
+ }
236
+ /**
237
+ * 获取空行列表值数组
238
+ * @param {Array} dataSourceWithGroup
239
+ * @returns {Array}
240
+ */
241
+
242
+
243
+ function getSkipList(dataSourceWithGroup) {
244
+ var skipList = dataSourceWithGroup.reduce(function (prev, cur) {
245
+ if (!prev.length) {
246
+ return cur.group ? [1] : [0];
247
+ }
248
+
249
+ if (cur.group) {
250
+ return [].concat((0, _toConsumableArray2.default)(prev), [prev[prev.length - 1] + 1]);
251
+ }
252
+
253
+ return [].concat((0, _toConsumableArray2.default)(prev), [prev[prev.length - 1]]);
254
+ }, []);
255
+ return skipList;
256
+ }
257
+ /**
258
+ * 获取选中行文本
259
+ * @param {Object}
260
+ * {
261
+ * selection: {start: {i, j}, end: {i, j}},
262
+ * columnsKeysList: Array,
263
+ * dataSource: Array
264
+ * }
265
+ * @returns {Array}
266
+ */
267
+
268
+
269
+ function getSelectionRowText(_ref) {
270
+ var selection = _ref.selection,
271
+ columnsKeysList = _ref.columnsKeysList,
272
+ dataSource = _ref.dataSource;
273
+ var rowtext = range(selection === null || selection === void 0 ? void 0 : selection.start.i, selection === null || selection === void 0 ? void 0 : selection.end.i).map(function (i) {
274
+ return columnsKeysList.map(function (j) {
275
+ var columnKey = j;
276
+ var dataItem = dataSource[i];
277
+ var cell = dataItem === null || dataItem === void 0 ? void 0 : dataItem[columnKey];
278
+ return cell;
279
+ });
280
+ });
281
+ return rowtext;
282
+ }
283
+ /**
284
+ * 获取选中列文本
285
+ * @param {Object}
286
+ * @returns {Array}
287
+ */
288
+
289
+
290
+ function getSelectionColText(_ref2) {
291
+ var selection = _ref2.selection,
292
+ columns = _ref2.columns,
293
+ dataSource = _ref2.dataSource;
294
+ var coltext = range(selection === null || selection === void 0 ? void 0 : selection.start.i, selection === null || selection === void 0 ? void 0 : selection.end.i).map(function (i) {
295
+ return range(selection === null || selection === void 0 ? void 0 : selection.start.j, selection === null || selection === void 0 ? void 0 : selection.end.j).map(function (j) {
296
+ var _columns$j, _columns$j2;
297
+
298
+ var columnKey = (_columns$j = columns[j]) === null || _columns$j === void 0 ? void 0 : _columns$j.dataIndex;
299
+ var dataItem = dataSource[i];
300
+ var cell = dataItem === null || dataItem === void 0 ? void 0 : dataItem[columnKey];
301
+
302
+ if ((_columns$j2 = columns[j]) === null || _columns$j2 === void 0 ? void 0 : _columns$j2.render) {
303
+ var _columns$j3, _columns$j3$render;
304
+
305
+ return (_columns$j3 = columns[j]) === null || _columns$j3 === void 0 ? void 0 : (_columns$j3$render = _columns$j3.render) === null || _columns$j3$render === void 0 ? void 0 : _columns$j3$render.call(_columns$j3, cell, dataItem, i);
306
+ }
307
+
308
+ return cell;
309
+ });
310
+ });
311
+ return coltext;
211
312
  }
@@ -1,4 +1,3 @@
1
- import type { BuildInPlacements } from 'rc-trigger';
2
1
  export interface AdjustOverflow {
3
2
  adjustX?: 0 | 1;
4
3
  adjustY?: 0 | 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkmore-design",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "author": {
5
5
  "name": "nowthen",
6
6
  "email": "rnlvwyx@gmail.com"
@@ -51,12 +51,10 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@ant-design/charts": "^1.4.2",
54
- "@ant-design/compatible": "^1.0.8",
54
+ "@ant-design/compatible": "1.0.8",
55
55
  "@ant-design/icons": "^4.3.0",
56
56
  "@ant-design/plots": "^1.2.2",
57
- "@ant-design/pro-components": "^2.3.12",
58
- "@ant-design/pro-provider": "^2.0.3",
59
- "@ant-design/pro-table": "3.0.10",
57
+ "@ant-design/pro-table": "2.77.0",
60
58
  "@babel/runtime": "^7.17.9",
61
59
  "@dnd-kit/core": "^5.0.3",
62
60
  "@dnd-kit/modifiers": "^5.0.0",
@@ -65,7 +63,7 @@
65
63
  "@typescript-eslint/parser": "^5.28.0",
66
64
  "ahooks": "^3.6.2",
67
65
  "ali-oss": "^6.17.1",
68
- "antd": "4.23.2",
66
+ "antd": "4.22.8",
69
67
  "axios": "^0.21.0",
70
68
  "classnames": "^2.3.1",
71
69
  "dayjs": "^1.9.7",
package/CHANGELOG.md DELETED
@@ -1,12 +0,0 @@
1
- #
2
- ## V2.0.0
3
- `2020-12-12`
4
-
5
- * 升级项目中全部依赖库版本,主要包括:react17、antd4、webpack5...
6
- * 增加 commitlint 规范git提交;
7
- * 增加 husky + lint-staged + Prettier 规范代码提交校验
8
- * 优化 eslint + prettier 规范项目代码风格
9
-
10
-
11
- ## V1.0.0
12
- 第一版