dtable-ui-component 5.3.1-beta → 5.3.1-beta2

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 (48) hide show
  1. package/lib/Comment/body/comment.js +190 -0
  2. package/lib/Comment/body/index.css +95 -0
  3. package/lib/Comment/body/index.js +32 -0
  4. package/lib/Comment/footer/btns/index.css +40 -0
  5. package/lib/Comment/footer/btns/index.js +113 -0
  6. package/lib/Comment/footer/index.css +157 -0
  7. package/lib/Comment/footer/index.js +170 -0
  8. package/lib/Comment/footer/input/index.css +52 -0
  9. package/lib/Comment/footer/input/index.js +448 -0
  10. package/lib/Comment/footer/input/participant/index.css +0 -0
  11. package/lib/Comment/footer/input/participant/index.js +53 -0
  12. package/lib/Comment/footer/participants/index.css +22 -0
  13. package/lib/Comment/footer/participants/index.js +68 -0
  14. package/lib/Comment/footer/participants/participant/index.css +5 -0
  15. package/lib/Comment/footer/participants/participant/index.js +32 -0
  16. package/lib/Comment/footer/participants/participant-select/index.css +104 -0
  17. package/lib/Comment/footer/participants/participant-select/index.js +182 -0
  18. package/lib/Comment/index.css +19 -0
  19. package/lib/Comment/index.js +305 -0
  20. package/lib/Comment/model.js +25 -0
  21. package/lib/Comment/utils/common.js +62 -0
  22. package/lib/Comment/utils/index.js +27 -0
  23. package/lib/Comment/utils/utilities.js +176 -0
  24. package/lib/DigitalSignEditor/index.js +1 -1
  25. package/lib/FileEditor/index.js +16 -2
  26. package/lib/RowExpandDialog/body/index.js +43 -60
  27. package/lib/RowExpandDialog/column-content/index.css +1 -0
  28. package/lib/RowExpandDialog/header/index.css +3 -3
  29. package/lib/RowExpandDialog/header/index.js +33 -11
  30. package/lib/RowExpandDialog/index.js +35 -51
  31. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +1 -2
  32. package/lib/RowExpandFormatter/RowExpandLinkFormatter/index.js +1 -1
  33. package/lib/RowExpandFormatter/index.css +1 -1
  34. package/lib/RowExpandFormatter/index.js +3 -4
  35. package/lib/lang/index.js +3 -2
  36. package/lib/locales/de.json +5 -1
  37. package/lib/locales/en.json +5 -1
  38. package/lib/locales/es.json +5 -1
  39. package/lib/locales/fr.json +5 -1
  40. package/lib/locales/pt.json +5 -1
  41. package/lib/locales/ru.json +5 -1
  42. package/lib/locales/zh-CN.json +5 -1
  43. package/lib/utils/hotkey.js +37 -0
  44. package/lib/utils/utils.js +58 -2
  45. package/package.json +1 -1
  46. package/lib/RowExpandDialog/constants.js +0 -114
  47. package/lib/RowExpandDialog/utils.js +0 -83
  48. package/lib/RowExpandFormatter/RowExpandLinkFormatter/utils.js +0 -71
@@ -3,7 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.throttle = exports.openUrlLink = exports.isValidUrl = exports.isValidCellValue = exports.isMobile = exports.isMac = exports.isFunction = exports.getTrimmedString = exports.getEventClassName = exports.getErrorMsg = exports.downloadFiles = exports.downloadFile = exports.debounce = void 0;
6
+ exports.getTwoDimensionArrayValue = exports.getTrimmedString = exports.getFormulaArrayValue = exports.getEventClassName = exports.getErrorMsg = exports.downloadFiles = exports.downloadFile = exports.debounce = void 0;
7
+ exports.isArrayFormatColumn = isArrayFormatColumn;
8
+ exports.throttle = exports.openUrlLink = exports.isValidUrl = exports.isValidCellValue = exports.isMobile = exports.isMac = exports.isFunction = void 0;
9
+ var _constants = require("../constants");
7
10
  var _url = require("./url");
8
11
  const debounce = (fn, wait) => {
9
12
  let timeout = null;
@@ -140,4 +143,57 @@ const getErrorMsg = error => {
140
143
  }
141
144
  return errorMsg;
142
145
  };
143
- exports.getErrorMsg = getErrorMsg;
146
+ exports.getErrorMsg = getErrorMsg;
147
+ function isArrayFormatColumn(columnType) {
148
+ return _constants.ARRAY_FORMAT_COLUMNS.includes(columnType);
149
+ }
150
+ const getFormulaArrayValue = function (value) {
151
+ let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
152
+ if (!Array.isArray(value)) return [];
153
+ if (!isFlat) return getTwoDimensionArrayValue(value);
154
+ return value.map(item => {
155
+ if (Object.prototype.toString.call(item) !== '[object Object]') {
156
+ return item;
157
+ }
158
+ if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
159
+ const {
160
+ display_value
161
+ } = item;
162
+ if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
163
+ return display_value.map(i => {
164
+ if (Object.prototype.toString.call(i) === '[object Object]') {
165
+ if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
166
+ const {
167
+ display_value
168
+ } = i;
169
+ return display_value;
170
+ }
171
+ return i;
172
+ });
173
+ }).flat().filter(item => isValidCellValue(item));
174
+ };
175
+ exports.getFormulaArrayValue = getFormulaArrayValue;
176
+ const getTwoDimensionArrayValue = value => {
177
+ if (!Array.isArray(value)) return [];
178
+ return value.map(item => {
179
+ if (Object.prototype.toString.call(item) !== '[object Object]') {
180
+ return item;
181
+ }
182
+ if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
183
+ const {
184
+ display_value
185
+ } = item;
186
+ if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
187
+ return display_value.map(i => {
188
+ if (Object.prototype.toString.call(i) === '[object Object]') {
189
+ if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
190
+ const {
191
+ display_value
192
+ } = i;
193
+ return display_value;
194
+ }
195
+ return i;
196
+ });
197
+ });
198
+ };
199
+ exports.getTwoDimensionArrayValue = getTwoDimensionArrayValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "5.3.1beta",
3
+ "version": "5.3.1beta2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "3.0.1",
@@ -1,114 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.keyCodes = exports.ROW_EXPAND_FOCUS_STYLE = exports.ROW_EXPAND_BTN_FOCUS_STYLE = void 0;
7
- const keyCodes = exports.keyCodes = {
8
- Backspace: 8,
9
- Tab: 9,
10
- Enter: 13,
11
- Shift: 16,
12
- Ctrl: 17,
13
- Alt: 18,
14
- PauseBreak: 19,
15
- CapsLock: 20,
16
- Escape: 27,
17
- Esc: 27,
18
- Space: 32,
19
- PageUp: 33,
20
- PageDown: 34,
21
- End: 35,
22
- Home: 36,
23
- LeftArrow: 37,
24
- UpArrow: 38,
25
- RightArrow: 39,
26
- DownArrow: 40,
27
- Insert: 45,
28
- Delete: 46,
29
- 0: 48,
30
- 1: 49,
31
- 2: 50,
32
- 3: 51,
33
- 4: 52,
34
- 5: 53,
35
- 6: 54,
36
- 7: 55,
37
- 8: 56,
38
- 9: 57,
39
- a: 65,
40
- b: 66,
41
- c: 67,
42
- d: 68,
43
- e: 69,
44
- f: 70,
45
- g: 71,
46
- h: 72,
47
- i: 73,
48
- j: 74,
49
- k: 75,
50
- l: 76,
51
- m: 77,
52
- n: 78,
53
- o: 79,
54
- p: 80,
55
- q: 81,
56
- r: 82,
57
- s: 83,
58
- t: 84,
59
- u: 85,
60
- v: 86,
61
- w: 87,
62
- x: 88,
63
- y: 89,
64
- z: 90,
65
- LeftWindowKey: 91,
66
- RightWindowKey: 92,
67
- SelectKey: 93,
68
- NumPad0: 96,
69
- NumPad1: 97,
70
- NumPad2: 98,
71
- NumPad3: 99,
72
- NumPad4: 100,
73
- NumPad5: 101,
74
- NumPad6: 102,
75
- NumPad7: 103,
76
- NumPad8: 104,
77
- NumPad9: 105,
78
- Multiply: 106,
79
- Add: 107,
80
- Subtract: 109,
81
- DecimalPoint: 110,
82
- Divide: 111,
83
- F1: 112,
84
- F2: 113,
85
- F3: 114,
86
- F4: 115,
87
- F5: 116,
88
- F6: 117,
89
- F7: 118,
90
- F8: 119,
91
- F9: 120,
92
- F10: 121,
93
- F12: 123,
94
- NumLock: 144,
95
- ScrollLock: 145,
96
- SemiColon: 186,
97
- EqualSign: 187,
98
- Comma: 188,
99
- Dash: 189,
100
- Period: 190,
101
- ForwardSlash: 191,
102
- GraveAccent: 192,
103
- OpenBracket: 219,
104
- BackSlash: 220,
105
- CloseBracket: 221,
106
- SingleQuote: 222,
107
- ChineseInputMethod: 229
108
- };
109
- const ROW_EXPAND_FOCUS_STYLE = exports.ROW_EXPAND_FOCUS_STYLE = {
110
- border: '2px solid #3B88FD'
111
- };
112
- const ROW_EXPAND_BTN_FOCUS_STYLE = exports.ROW_EXPAND_BTN_FOCUS_STYLE = {
113
- border: '2px solid #3B88FD'
114
- };
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTwoDimensionArrayValue = exports.getFormulaArrayValue = exports.downloadFile = void 0;
7
- exports.isArrayFormalColumn = isArrayFormalColumn;
8
- exports.isValidCellValue = void 0;
9
- var _dtableUtils = require("dtable-utils");
10
- const isValidCellValue = value => {
11
- if (value === undefined) return false;
12
- if (value === null) return false;
13
- if (value === '') return false;
14
- if (JSON.stringify(value) === '{}') return false;
15
- if (JSON.stringify(value) === '[]') return false;
16
- return true;
17
- };
18
- exports.isValidCellValue = isValidCellValue;
19
- function isArrayFormalColumn(columnType) {
20
- return [_dtableUtils.CellType.IMAGE, _dtableUtils.CellType.FILE, _dtableUtils.CellType.MULTIPLE_SELECT, _dtableUtils.CellType.COLLABORATOR].includes(columnType);
21
- }
22
- const getFormulaArrayValue = function (value) {
23
- let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
24
- if (!Array.isArray(value)) return [];
25
- if (!isFlat) return getTwoDimensionArrayValue(value);
26
- return value.map(item => {
27
- if (Object.prototype.toString.call(item) !== '[object Object]') {
28
- return item;
29
- }
30
- if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
31
- const {
32
- display_value
33
- } = item;
34
- if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
35
- return display_value.map(i => {
36
- if (Object.prototype.toString.call(i) === '[object Object]') {
37
- if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
38
- const {
39
- display_value
40
- } = i;
41
- return display_value;
42
- }
43
- return i;
44
- });
45
- }).flat().filter(item => isValidCellValue(item));
46
- };
47
- exports.getFormulaArrayValue = getFormulaArrayValue;
48
- const getTwoDimensionArrayValue = value => {
49
- if (!Array.isArray(value)) return [];
50
- return value.map(item => {
51
- if (Object.prototype.toString.call(item) !== '[object Object]') {
52
- return item;
53
- }
54
- if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
55
- const {
56
- display_value
57
- } = item;
58
- if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
59
- return display_value.map(i => {
60
- if (Object.prototype.toString.call(i) === '[object Object]') {
61
- if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
62
- const {
63
- display_value
64
- } = i;
65
- return display_value;
66
- }
67
- return i;
68
- });
69
- });
70
- };
71
- exports.getTwoDimensionArrayValue = getTwoDimensionArrayValue;
72
- const downloadFile = downloadUrl => {
73
- const downloadFrame = document.getElementById('download-iframe');
74
- if (downloadFrame != null) {
75
- document.body.removeChild(downloadFrame);
76
- }
77
- let iframe = document.createElement('iframe');
78
- iframe.setAttribute('id', 'download-iframe');
79
- iframe.style.display = 'none';
80
- iframe.src = downloadUrl;
81
- document.body.appendChild(iframe);
82
- };
83
- exports.downloadFile = downloadFile;
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTwoDimensionArrayValue = exports.getFormulaArrayValue = void 0;
7
- exports.isArrayFormatColumn = isArrayFormatColumn;
8
- exports.isValidCellValue = void 0;
9
- var _constants = require("../../constants");
10
- const isValidCellValue = value => {
11
- if (value === undefined) return false;
12
- if (value === null) return false;
13
- if (value === '') return false;
14
- if (JSON.stringify(value) === '{}') return false;
15
- if (JSON.stringify(value) === '[]') return false;
16
- return true;
17
- };
18
- exports.isValidCellValue = isValidCellValue;
19
- const getFormulaArrayValue = function (value) {
20
- let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
21
- if (!Array.isArray(value)) return [];
22
- if (!isFlat) return getTwoDimensionArrayValue(value);
23
- return value.map(item => {
24
- if (Object.prototype.toString.call(item) !== '[object Object]') {
25
- return item;
26
- }
27
- if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
28
- const {
29
- display_value
30
- } = item;
31
- if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
32
- return display_value.map(i => {
33
- if (Object.prototype.toString.call(i) === '[object Object]') {
34
- if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
35
- const {
36
- display_value
37
- } = i;
38
- return display_value;
39
- }
40
- return i;
41
- });
42
- }).flat().filter(item => isValidCellValue(item));
43
- };
44
- exports.getFormulaArrayValue = getFormulaArrayValue;
45
- const getTwoDimensionArrayValue = value => {
46
- if (!Array.isArray(value)) return [];
47
- return value.map(item => {
48
- if (Object.prototype.toString.call(item) !== '[object Object]') {
49
- return item;
50
- }
51
- if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
52
- const {
53
- display_value
54
- } = item;
55
- if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
56
- return display_value.map(i => {
57
- if (Object.prototype.toString.call(i) === '[object Object]') {
58
- if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
59
- const {
60
- display_value
61
- } = i;
62
- return display_value;
63
- }
64
- return i;
65
- });
66
- });
67
- };
68
- exports.getTwoDimensionArrayValue = getTwoDimensionArrayValue;
69
- function isArrayFormatColumn(columnType) {
70
- return [_constants.CellType.IMAGE, _constants.CellType.FILE, _constants.CellType.MULTIPLE_SELECT, _constants.CellType.COLLABORATOR].includes(columnType);
71
- }