@zhenliang/sheet 0.1.72-beta.7 → 0.1.74

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 (68) hide show
  1. package/dist/core/editor/dateEditor/index.js +6 -6
  2. package/dist/core/editor/numberEditor/index.d.ts +1 -1
  3. package/dist/core/editor/numberEditor/index.js +7 -7
  4. package/dist/core/editor/selectEditor/index.js +6 -6
  5. package/dist/core/reducers/index.d.ts +2 -2
  6. package/dist/core/reducers/keyboardReducer.js +8 -7
  7. package/dist/core/reducers/mouseReducer.js +10 -9
  8. package/dist/core/reducers/sideEffectReducer.d.ts +1 -1
  9. package/dist/core/reducers/sideEffectReducer.js +17 -17
  10. package/dist/core/reducers/stateReducer.js +10 -10
  11. package/dist/core/sheet/Cell.js +2 -2
  12. package/dist/core/sheet/DataEditor.js +1 -1
  13. package/dist/core/sheet/DefaultCell.d.ts +3 -3
  14. package/dist/core/sheet/DefaultCell.js +5 -5
  15. package/dist/core/sheet/DefaultRowMapper.js +5 -5
  16. package/dist/core/sheet/Remark.d.ts +9 -0
  17. package/dist/core/sheet/Remark.js +32 -0
  18. package/dist/core/sheet/index.js +67 -19
  19. package/dist/core/sheet/index.less +36 -0
  20. package/dist/core/sheet/searchInput.js +1 -1
  21. package/dist/core/sheet/useContextMenu.d.ts +1 -1
  22. package/dist/core/sheet/useContextMenu.js +11 -11
  23. package/dist/core/sheet/useKeyBoardEvent.js +1 -1
  24. package/dist/core/sheet/useMouseEvent.js +11 -12
  25. package/dist/core/sheet/useRemarkContainer.d.ts +14 -0
  26. package/dist/core/sheet/useRemarkContainer.js +144 -0
  27. package/dist/core/sheet/useSearchInput.js +8 -8
  28. package/dist/core/sheet/useSelectVisible.js +3 -3
  29. package/dist/core/sheet/useVirtualList.js +3 -3
  30. package/dist/core/shell/draggableShell/index.d.ts +1 -1
  31. package/dist/core/shell/draggableShell/index.js +15 -10
  32. package/dist/core/shell/tableShell.d.ts +2 -2
  33. package/dist/core/shell/tableShell.js +11 -155
  34. package/dist/core/table/addButton.d.ts +0 -1
  35. package/dist/core/table/addButton.js +2 -3
  36. package/dist/core/table/events.js +7 -7
  37. package/dist/core/table/index.d.ts +1 -0
  38. package/dist/core/table/index.js +167 -17
  39. package/dist/core/table/index.less +19 -0
  40. package/dist/core/table/remarkEvent.d.ts +5 -0
  41. package/dist/core/table/remarkEvent.js +9 -0
  42. package/dist/core/table/useGroupConfig.d.ts +1 -1
  43. package/dist/core/table/useGroupConfig.js +16 -14
  44. package/dist/core/table/useRowSelection.d.ts +3 -25
  45. package/dist/core/table/useRowSelection.js +7 -4
  46. package/dist/core/util.js +14 -14
  47. package/dist/core/viewer/editViewer/index.js +1 -2
  48. package/dist/core/viewer/groupViewer/index.js +4 -8
  49. package/dist/example/antComponent.js +9 -9
  50. package/dist/example/basic.js +6 -6
  51. package/dist/example/group.js +1 -2
  52. package/dist/example/selection.js +6 -6
  53. package/dist/example/sheet.js +16 -21
  54. package/dist/example/valuationAnalyze.d.ts +1 -0
  55. package/dist/example/valuationAnalyze.js +356 -14
  56. package/dist/hooks/useEventBus.js +1 -1
  57. package/dist/hooks/useKeyboard.d.ts +2 -2
  58. package/dist/hooks/useMiddlewareReducer.d.ts +5 -5
  59. package/dist/hooks/useMiddlewareReducer.js +2 -2
  60. package/dist/hooks/useMouse.d.ts +1 -1
  61. package/dist/hooks/useMouse.js +6 -6
  62. package/dist/hooks/useSetState.js +6 -6
  63. package/dist/standardUtils/index.d.ts +1 -1
  64. package/dist/standardUtils/index.js +1 -1
  65. package/dist/type/sheet.d.ts +40 -32
  66. package/dist/type/sheetTable.d.ts +24 -11
  67. package/package.json +8 -3
  68. package/changes.md +0 -45
@@ -1,16 +1,28 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
12
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
13
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
14
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
15
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
16
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+ /* eslint-disable react-hooks/rules-of-hooks */
7
18
  import { getNumberEditor, getSelectEditor, Table } from "./..";
8
- import { Button } from 'antd';
9
- import { isNil } from 'lodash';
10
- import { useCallback, useState } from 'react';
19
+ import { Button, Input, Select } from 'antd';
20
+ import { isNil, uniq } from 'lodash';
21
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
11
22
  import { SwitchViewer } from "../core/viewer";
12
23
  import { SheetType } from "../type";
13
24
  import { jsx as _jsx } from "react/jsx-runtime";
25
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
26
  var RateValueInput = getNumberEditor({
15
27
  addonAfter: '%',
16
28
  min: 0,
@@ -26,6 +38,64 @@ var RateViewer = function RateViewer(props) {
26
38
  children: value ? value + '%' : '-'
27
39
  });
28
40
  };
41
+ var RemarkRender = function RemarkRender(handleRemark, remarks) {
42
+ var render = function render(value) {
43
+ var _remarks$find;
44
+ var _useState = useState((remarks === null || remarks === void 0 || (_remarks$find = remarks.find(function (r) {
45
+ return r.id === value.id;
46
+ })) === null || _remarks$find === void 0 ? void 0 : _remarks$find.remarks) || []),
47
+ _useState2 = _slicedToArray(_useState, 2),
48
+ rm = _useState2[0],
49
+ setRm = _useState2[1];
50
+ var inputRef = useRef();
51
+ return /*#__PURE__*/_jsxs("div", {
52
+ style: {
53
+ background: 'white'
54
+ },
55
+ children: [/*#__PURE__*/_jsx("div", {
56
+ style: {
57
+ height: 350
58
+ }
59
+ }), /*#__PURE__*/_jsxs("p", {
60
+ children: [" columns:", value.columnKey]
61
+ }), /*#__PURE__*/_jsxs("p", {
62
+ children: [" id:", value.id]
63
+ }), /*#__PURE__*/_jsx("p", {
64
+ children: " bugs --"
65
+ }), /*#__PURE__*/_jsx(Select, {
66
+ onMouseDown: function onMouseDown(e) {
67
+ return e.stopPropagation();
68
+ },
69
+ options: [{
70
+ label: '2',
71
+ value: 3
72
+ }, {
73
+ label: '1',
74
+ value: 2
75
+ }]
76
+ }), rm === null || rm === void 0 ? void 0 : rm.map(function (r) {
77
+ return /*#__PURE__*/_jsx("p", {
78
+ children: r
79
+ }, r);
80
+ }), /*#__PURE__*/_jsx(Input, {
81
+ ref: inputRef,
82
+ autoFocus: true,
83
+ onPressEnter: function onPressEnter(e) {
84
+ setRm(function (s) {
85
+ return uniq([].concat(_toConsumableArray(s), [e.target.value]));
86
+ });
87
+ handleRemark([{
88
+ id: value.id,
89
+ remarks: [value.columnKey]
90
+ }]);
91
+ e.target.value = '';
92
+ inputRef.current.input.value = '';
93
+ }
94
+ })]
95
+ });
96
+ };
97
+ return render;
98
+ };
29
99
  var data = [{
30
100
  id: 2443,
31
101
  draftId: '101601',
@@ -38,7 +108,8 @@ var data = [{
38
108
  gfaUnitPrice: 107350.31545913525,
39
109
  nlaUnitPrice: 90130.38038659678,
40
110
  totalValuation: 1622707368.4802885,
41
- isEnabled: true
111
+ isEnabled: true,
112
+ remarks: ['valuationType', 'vacancyDiscountRate']
42
113
  }, {
43
114
  id: 2444,
44
115
  draftId: '101601',
@@ -51,8 +122,165 @@ var data = [{
51
122
  gfaUnitPrice: 89327.04427210477,
52
123
  nlaUnitPrice: 89327.04427210477,
53
124
  totalValuation: 1429232708.3536763,
125
+ remarks: ['termDiscountRate', 'vacancyDiscountRate'],
54
126
  isEnabled: false
55
- }];
127
+ }, {
128
+ id: 2445,
129
+ draftId: '101601',
130
+ valuationType: 5,
131
+ termDiscountRate: 4.5,
132
+ reversionDiscountRate: 5.5,
133
+ vacancyDiscountRate: 5.5,
134
+ discountRate: null,
135
+ exitCapRate: null,
136
+ gfaUnitPrice: 89327.04427210477,
137
+ nlaUnitPrice: 89327.04427210477,
138
+ totalValuation: 1429232708.3536763,
139
+ remarks: ['reversionDiscountRate', 'vacancyDiscountRate'],
140
+ isEnabled: false
141
+ }, {
142
+ id: 2446,
143
+ draftId: '101601',
144
+ valuationType: 5,
145
+ termDiscountRate: 4.5,
146
+ reversionDiscountRate: 5.5,
147
+ vacancyDiscountRate: 5.5,
148
+ discountRate: null,
149
+ exitCapRate: null,
150
+ gfaUnitPrice: 89327.04427210477,
151
+ nlaUnitPrice: 89327.04427210477,
152
+ totalValuation: 1429232708.3536763,
153
+ remarks: ['vacancyDiscountRate'],
154
+ isEnabled: false
155
+ }, {
156
+ id: 2447,
157
+ draftId: '101601',
158
+ valuationType: 5,
159
+ termDiscountRate: 4.5,
160
+ reversionDiscountRate: 5.5,
161
+ vacancyDiscountRate: 5.5,
162
+ discountRate: null,
163
+ exitCapRate: null,
164
+ gfaUnitPrice: 89327.04427210477,
165
+ nlaUnitPrice: 89327.04427210477,
166
+ totalValuation: 1429232708.3536763,
167
+ remarks: ['discountRate', 'vacancyDiscountRate'],
168
+ isEnabled: false
169
+ }, {
170
+ id: 2448,
171
+ draftId: '101601',
172
+ valuationType: 5,
173
+ termDiscountRate: 4.5,
174
+ reversionDiscountRate: 5.5,
175
+ vacancyDiscountRate: 5.5,
176
+ discountRate: null,
177
+ exitCapRate: null,
178
+ gfaUnitPrice: 89327.04427210477,
179
+ nlaUnitPrice: 89327.04427210477,
180
+ totalValuation: 1429232708.3536763,
181
+ remarks: ['exitCapRate', 'vacancyDiscountRate'],
182
+ isEnabled: false
183
+ }, {
184
+ id: 2449,
185
+ draftId: '101601',
186
+ valuationType: 5,
187
+ termDiscountRate: 4.5,
188
+ reversionDiscountRate: 5.5,
189
+ vacancyDiscountRate: 5.5,
190
+ discountRate: null,
191
+ exitCapRate: null,
192
+ gfaUnitPrice: 89327.04427210477,
193
+ nlaUnitPrice: 89327.04427210477,
194
+ totalValuation: 1429232708.3536763,
195
+ remarks: ['gfaUnitPrice', 'vacancyDiscountRate'],
196
+ isEnabled: false
197
+ }, {
198
+ id: 2450,
199
+ draftId: '101601',
200
+ valuationType: 5,
201
+ termDiscountRate: 4.5,
202
+ reversionDiscountRate: 5.5,
203
+ vacancyDiscountRate: 5.5,
204
+ discountRate: null,
205
+ exitCapRate: null,
206
+ gfaUnitPrice: 89327.04427210477,
207
+ nlaUnitPrice: 89327.04427210477,
208
+ totalValuation: 1429232708.3536763,
209
+ remarks: ['nlaUnitPrice', 'vacancyDiscountRate'],
210
+ isEnabled: false
211
+ }, {
212
+ id: 2451,
213
+ draftId: '101601',
214
+ valuationType: 5,
215
+ termDiscountRate: 4.5,
216
+ reversionDiscountRate: 5.5,
217
+ vacancyDiscountRate: 5.5,
218
+ discountRate: null,
219
+ exitCapRate: null,
220
+ gfaUnitPrice: 89327.04427210477,
221
+ nlaUnitPrice: 89327.04427210477,
222
+ totalValuation: 1429232708.3536763,
223
+ remarks: ['totalValuation', 'vacancyDiscountRate'],
224
+ isEnabled: false
225
+ }, {
226
+ id: 2452,
227
+ draftId: '101601',
228
+ valuationType: 5,
229
+ termDiscountRate: 4.5,
230
+ reversionDiscountRate: 5.5,
231
+ vacancyDiscountRate: 5.5,
232
+ discountRate: null,
233
+ exitCapRate: null,
234
+ gfaUnitPrice: 89327.04427210477,
235
+ nlaUnitPrice: 89327.04427210477,
236
+ totalValuation: 1429232708.3536763,
237
+ remarks: ['termDiscountRate', 'vacancyDiscountRate'],
238
+ isEnabled: false
239
+ }, {
240
+ id: 2453,
241
+ draftId: '101601',
242
+ valuationType: 5,
243
+ termDiscountRate: 4.5,
244
+ reversionDiscountRate: 5.5,
245
+ vacancyDiscountRate: 5.5,
246
+ discountRate: null,
247
+ exitCapRate: null,
248
+ gfaUnitPrice: 89327.04427210477,
249
+ nlaUnitPrice: 89327.04427210477,
250
+ totalValuation: 1429232708.3536763,
251
+ remarks: ['termDiscountRate', 'vacancyDiscountRate'],
252
+ isEnabled: false
253
+ }, {
254
+ id: 2454,
255
+ draftId: '101601',
256
+ valuationType: 5,
257
+ termDiscountRate: 4.5,
258
+ reversionDiscountRate: 5.5,
259
+ vacancyDiscountRate: 5.5,
260
+ discountRate: null,
261
+ exitCapRate: null,
262
+ gfaUnitPrice: 89327.04427210477,
263
+ nlaUnitPrice: 89327.04427210477,
264
+ totalValuation: 1429232708.3536763,
265
+ remarks: ['termDiscountRate', 'vacancyDiscountRate'],
266
+ isEnabled: false
267
+ }].concat(_toConsumableArray(Array(100).fill(0).map(function (item, i) {
268
+ return {
269
+ id: 2455 + i,
270
+ draftId: '101601',
271
+ valuationType: 5,
272
+ termDiscountRate: 4.5,
273
+ reversionDiscountRate: 5.5,
274
+ vacancyDiscountRate: 5.5,
275
+ discountRate: null,
276
+ exitCapRate: null,
277
+ gfaUnitPrice: 89327.04427210477,
278
+ nlaUnitPrice: 89327.04427210477,
279
+ totalValuation: 1429232708.3536763,
280
+ remarks: ['termDiscountRate', 'vacancyDiscountRate'],
281
+ isEnabled: false
282
+ };
283
+ })));
56
284
  var evaluateMethods = [{
57
285
  label: 'DCF',
58
286
  value: 2
@@ -62,9 +290,9 @@ var evaluateMethods = [{
62
290
  }];
63
291
  var EvaSelect = getSelectEditor(evaluateMethods);
64
292
  export default (function () {
65
- var _useState = useState(data),
66
- _useState2 = _slicedToArray(_useState, 1),
67
- state = _useState2[0];
293
+ var _useState3 = useState(data),
294
+ _useState4 = _slicedToArray(_useState3, 1),
295
+ state = _useState4[0];
68
296
  var columns = [{
69
297
  title: '默认使用',
70
298
  dataIndex: 'isEnabled',
@@ -168,6 +396,36 @@ export default (function () {
168
396
  width: 134,
169
397
  editor: ValueInput,
170
398
  readonly: true
399
+ }, {
400
+ title: 'id-1',
401
+ dataIndex: 'id-1',
402
+ width: 134,
403
+ editor: ValueInput,
404
+ readonly: true
405
+ }, {
406
+ title: 'id-2',
407
+ dataIndex: 'id-2',
408
+ width: 134,
409
+ editor: ValueInput,
410
+ readonly: true
411
+ }, {
412
+ title: 'id-3',
413
+ dataIndex: 'id-3',
414
+ width: 134,
415
+ editor: ValueInput,
416
+ readonly: true
417
+ }, {
418
+ title: 'id-4',
419
+ dataIndex: 'id-4',
420
+ width: 134,
421
+ editor: ValueInput,
422
+ readonly: true
423
+ }, {
424
+ title: 'id-5',
425
+ dataIndex: 'id-5',
426
+ width: 134,
427
+ editor: ValueInput,
428
+ readonly: true
171
429
  }, {
172
430
  title: '操作',
173
431
  width: 62,
@@ -217,11 +475,95 @@ export default (function () {
217
475
  // return <div className="value-viewer number-value-viewer" />;
218
476
  // },
219
477
  }];
220
-
478
+ var sheetInstance = useRef(null);
221
479
  var handleChange = useCallback(function () {}, [state]);
222
- return /*#__PURE__*/_jsx(Table, {
223
- columns: columns,
224
- dataSource: state,
225
- onChange: handleChange
480
+ useEffect(function () {
481
+ setTimeout(function () {
482
+ var _sheetInstance$curren, _sheetInstance$curren2;
483
+ (_sheetInstance$curren = sheetInstance.current) === null || _sheetInstance$curren === void 0 || _sheetInstance$curren.zoomTo(1);
484
+ (_sheetInstance$curren2 = sheetInstance.current) === null || _sheetInstance$curren2 === void 0 || _sheetInstance$curren2.select({
485
+ start: {
486
+ row: 1,
487
+ col: 3
488
+ },
489
+ end: {
490
+ row: 1,
491
+ col: 3
492
+ }
493
+ });
494
+ }, 3);
495
+ }, []);
496
+ var _useState5 = useState([]),
497
+ _useState6 = _slicedToArray(_useState5, 2),
498
+ currentRemark = _useState6[0],
499
+ setCurrentRemark = _useState6[1];
500
+ var RenderRemarkSimple = useMemo(function () {
501
+ return RemarkRender(setCurrentRemark, currentRemark);
502
+ }, [currentRemark]);
503
+ var wrapData = useMemo(function () {
504
+ return state.map(function (d) {
505
+ var _currentRemark$find;
506
+ var remarks = currentRemark === null || currentRemark === void 0 || (_currentRemark$find = currentRemark.find(function (r) {
507
+ return r.id === d.id;
508
+ })) === null || _currentRemark$find === void 0 ? void 0 : _currentRemark$find.remarks;
509
+ if (remarks) {
510
+ return _objectSpread(_objectSpread({}, d), {}, {
511
+ remarks: remarks
512
+ });
513
+ }
514
+ return d;
515
+ });
516
+ }, [state, currentRemark]);
517
+ return /*#__PURE__*/_jsxs("div", {
518
+ style: {
519
+ height: '100vh',
520
+ padding: '29vh 0',
521
+ overflow: 'auto',
522
+ background: 'rgba(255,255,0,.2)'
523
+ },
524
+ children: [/*#__PURE__*/_jsx(Table, {
525
+ virtualized: true,
526
+ freeze: true,
527
+ draggable: true,
528
+ sheetInstance: sheetInstance,
529
+ columns: columns,
530
+ showRemark: true,
531
+ remarkRender: RenderRemarkSimple
532
+ // handleAddRemark={handleAddRemark}
533
+ ,
534
+ dataSource: wrapData,
535
+ onChange: handleChange,
536
+ onContextMenu: function onContextMenu() {},
537
+ menuRenderer: function menuRenderer(props) {
538
+ var handleMenu = props.onContextMenu,
539
+ cell = props.cell,
540
+ position = props.position,
541
+ children = props.children;
542
+ if (!cell || !handleMenu || cell.col < 1 || !position) {
543
+ return null;
544
+ }
545
+ return /*#__PURE__*/_jsxs("div", {
546
+ className: "harvest-menu",
547
+ style: _objectSpread(_objectSpread({}, position), {}, {
548
+ background: 'white'
549
+ }),
550
+ children: [children, /*#__PURE__*/_jsx("div", {
551
+ className: "harvest-menu-item",
552
+ children: "\u5411\u4E0B\u586B\u5145"
553
+ }), /*#__PURE__*/_jsx("div", {
554
+ className: "harvest-menu-item",
555
+ children: "\u5411\u53F3\u586B\u5145"
556
+ }), /*#__PURE__*/_jsx("div", {
557
+ className: "harvest-menu-item",
558
+ children: "\u5168\u90E8\u586B\u5145"
559
+ })]
560
+ });
561
+ }
562
+ }), /*#__PURE__*/_jsx("div", {
563
+ style: {
564
+ height: '100vh'
565
+ },
566
+ children: " empty"
567
+ })]
226
568
  });
227
569
  });
@@ -5,7 +5,7 @@ var useEventBus = function useEventBus() {
5
5
  useEffect(function () {
6
6
  return function () {
7
7
  var _eventBus$current;
8
- (_eventBus$current = eventBus.current) === null || _eventBus$current === void 0 ? void 0 : _eventBus$current.removeAllListeners();
8
+ (_eventBus$current = eventBus.current) === null || _eventBus$current === void 0 || _eventBus$current.removeAllListeners();
9
9
  eventBus.current = null;
10
10
  };
11
11
  }, []);
@@ -1,5 +1,5 @@
1
- declare type KeyOrClipBoardEvent = (event: KeyboardEvent | ClipboardEvent, value?: any) => void;
2
- declare type KeyboardHandler = {
1
+ type KeyOrClipBoardEvent = (event: KeyboardEvent | ClipboardEvent, value?: any) => void;
2
+ type KeyboardHandler = {
3
3
  move: KeyOrClipBoardEvent;
4
4
  escape: KeyOrClipBoardEvent;
5
5
  selectAll: KeyOrClipBoardEvent;
@@ -1,12 +1,12 @@
1
- export declare type NormalAction = {
1
+ export type NormalAction = {
2
2
  type: string;
3
3
  payload?: any;
4
4
  };
5
- export declare type FunctionAction = (dispatch: any, getState?: () => any) => any;
6
- export declare type Dispatch = (action: any) => any;
7
- export declare type MiddlewareAPI<A> = {
5
+ export type FunctionAction = (dispatch: any, getState?: () => any) => any;
6
+ export type Dispatch = (action: any) => any;
7
+ export type MiddlewareAPI<A> = {
8
8
  getState: () => A;
9
9
  dispatch: Dispatch;
10
10
  };
11
- export declare type Middleware<A> = (api: MiddlewareAPI<A>) => (next: Dispatch) => Dispatch;
11
+ export type Middleware<A> = (api: MiddlewareAPI<A>) => (next: Dispatch) => Dispatch;
12
12
  export declare const useMiddlewareReducer: <A, B>(reducer: (state: A, action: B) => A, initialState: A, middleware?: Middleware<A>[]) => [A, Dispatch];
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import * as React from 'react';
8
8
  export var useMiddlewareReducer = function useMiddlewareReducer(reducer, initialState) {
@@ -21,7 +21,7 @@ export var useMiddlewareReducer = function useMiddlewareReducer(reducer, initial
21
21
  return stateRef.current;
22
22
  },
23
23
  dispatch: function (_dispatch) {
24
- function dispatch(_x2) {
24
+ function dispatch(_x) {
25
25
  return _dispatch.apply(this, arguments);
26
26
  }
27
27
  dispatch.toString = function () {
@@ -1,4 +1,4 @@
1
- declare type MouseHandler = {
1
+ type MouseHandler = {
2
2
  mouseUp: (value: MouseEvent) => void;
3
3
  mouseDown: (value: MouseEvent) => void;
4
4
  mouseOver: (value: MouseEvent) => void;
@@ -32,9 +32,9 @@ export var useMouse = function useMouse(handler, listenElement) {
32
32
  document.removeEventListener('mouseup', listenerMouseUp);
33
33
  document.removeEventListener('mousedown', listenerMouseDown);
34
34
  document.removeEventListener('dblclick', listenerDoubleClick);
35
- listenElement === null || listenElement === void 0 ? void 0 : listenElement.removeEventListener('mouseover', listenerMouseOver);
36
- listenElement === null || listenElement === void 0 ? void 0 : listenElement.removeEventListener('mouseleave', listenerMouseLeave);
37
- listenElement === null || listenElement === void 0 ? void 0 : listenElement.removeEventListener('mouseenter', listenerMouseEnter);
35
+ listenElement === null || listenElement === void 0 || listenElement.removeEventListener('mouseover', listenerMouseOver);
36
+ listenElement === null || listenElement === void 0 || listenElement.removeEventListener('mouseleave', listenerMouseLeave);
37
+ listenElement === null || listenElement === void 0 || listenElement.removeEventListener('mouseenter', listenerMouseEnter);
38
38
  };
39
39
  }, []);
40
40
  useEffect(function () {
@@ -61,8 +61,8 @@ export var useMouse = function useMouse(handler, listenElement) {
61
61
  document.addEventListener('mouseup', wrappedMouseUp);
62
62
  document.addEventListener('mousedown', wrappedMouseDown);
63
63
  document.addEventListener('dblclick', wrappedMouseDoubleClick);
64
- listenElement === null || listenElement === void 0 ? void 0 : listenElement.addEventListener('mouseover', debounceOver);
65
- listenElement === null || listenElement === void 0 ? void 0 : listenElement.addEventListener('mouseleave', mouseLeave);
66
- listenElement === null || listenElement === void 0 ? void 0 : listenElement.addEventListener('mouseenter', mouseEnter);
64
+ listenElement === null || listenElement === void 0 || listenElement.addEventListener('mouseover', debounceOver);
65
+ listenElement === null || listenElement === void 0 || listenElement.addEventListener('mouseleave', mouseLeave);
66
+ listenElement === null || listenElement === void 0 || listenElement.addEventListener('mouseenter', mouseEnter);
67
67
  }, [listenElement]);
68
68
  };
@@ -1,14 +1,14 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
8
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
9
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { useCallback, useState } from 'react';
14
14
  var useSetState = function useSetState() {
@@ -1,4 +1,4 @@
1
- declare type ValueParams = string | number | null | undefined;
1
+ type ValueParams = string | number | null | undefined;
2
2
  export declare const formatPrecision: (value: ValueParams, precision?: number) => string;
3
3
  /**
4
4
  * 千位分隔符
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  export var formatPrecision = function formatPrecision(value) {
8
8
  var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;