dtable-ui-component 5.3.1-beta1 → 6.0.0

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 (226) hide show
  1. package/lib/CheckboxEditor/index.css +20 -3
  2. package/lib/CheckboxEditor/index.js +35 -98
  3. package/lib/CheckboxFormatter/index.js +9 -6
  4. package/lib/CollaboratorEditor/index.css +35 -12
  5. package/lib/CollaboratorEditor/index.js +212 -18
  6. package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.js +29 -26
  7. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +97 -0
  8. package/lib/CollaboratorItem/index.css +1 -1
  9. package/lib/CollaboratorItem/index.js +2 -6
  10. package/lib/DTableFiltersPopover/utils/index.js +7 -1
  11. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
  12. package/lib/DTableSelect/index.js +1 -3
  13. package/lib/DateEditor/index.js +51 -14
  14. package/lib/DateEditor/pc-date-editor-popover.js +12 -145
  15. package/lib/Department-editor/department-single-select.js +1 -1
  16. package/lib/Department-editor/index.js +4 -3
  17. package/lib/DepartmentSingleSelectFormatter/index.js +1 -2
  18. package/lib/FileEditor/index.js +11 -244
  19. package/lib/FileEditor/pc-files-addition/index.js +1 -0
  20. package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +1 -0
  21. package/lib/FileEditor/pc-files-preview/index.js +1 -0
  22. package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +1 -0
  23. package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
  24. package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
  25. package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
  26. package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
  27. package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
  28. package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
  29. package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
  30. package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
  31. package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
  32. package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
  33. package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
  34. package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
  35. package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
  36. package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
  37. package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
  38. package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
  39. package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
  40. package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
  41. package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
  42. package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
  43. package/lib/FileItemFormatter/index.js +20 -19
  44. package/lib/FileItemFormatter/utils.js +99 -0
  45. package/lib/FileUploader/index.js +14 -268
  46. package/lib/FormulaFormatter/index.js +1 -2
  47. package/lib/FormulaFormatter/utils.js +31 -0
  48. package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
  49. package/lib/LongTextFormatter/index.js +4 -7
  50. package/lib/MultipleSelectEditor/index.css +9 -0
  51. package/lib/MultipleSelectEditor/index.js +177 -16
  52. package/lib/NumberEditor/index.js +77 -64
  53. package/lib/RoleStatusEditor/index.js +5 -4
  54. package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.css +1 -1
  55. package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.js +1 -1
  56. package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.css +6 -6
  57. package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.js +1 -3
  58. package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +11 -10
  59. package/lib/RowExpandFormatter/index.css +0 -26
  60. package/lib/RowExpandFormatter/index.js +100 -84
  61. package/lib/{RowExpandFormatter/RowExpandFormulaFormatter → RowExpandFormulaFormatter}/index.js +10 -11
  62. package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.css +6 -6
  63. package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.js +1 -1
  64. package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
  65. package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
  66. package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.js +5 -5
  67. package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/utils.js +1 -1
  68. package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.css +1 -1
  69. package/lib/RowExpandUrlFormatter/index.css +1 -0
  70. package/lib/{RowExpandFormatter/RowExpandUrlFormatter → RowExpandUrlFormatter}/index.js +3 -4
  71. package/lib/SingleSelectEditor/index.css +14 -0
  72. package/lib/SingleSelectEditor/index.js +156 -16
  73. package/lib/TextEditor/index.js +42 -113
  74. package/lib/constants/index.js +2 -34
  75. package/lib/css/cell-editor.css +2 -18
  76. package/lib/index.js +46 -74
  77. package/lib/lang/index.js +14 -16
  78. package/lib/locals/de.js +103 -0
  79. package/lib/locals/en.js +104 -0
  80. package/lib/locals/es.js +103 -0
  81. package/lib/locals/fr.js +103 -0
  82. package/lib/locals/pt.js +103 -0
  83. package/lib/locals/ru.js +103 -0
  84. package/lib/locals/zh-CN.js +104 -0
  85. package/lib/select-editor/index.js +6 -6
  86. package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.js +3 -3
  87. package/lib/select-editor/pc-select-editor-popover/index.css +71 -0
  88. package/lib/select-editor/pc-select-editor-popover/index.js +122 -0
  89. package/lib/toaster/toaster.js +4 -3
  90. package/lib/utils/editor-utils.js +6 -1
  91. package/lib/utils/url.js +8 -119
  92. package/lib/utils/utils.js +2 -89
  93. package/package.json +13 -14
  94. package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +0 -257
  95. package/lib/DeleteTip/index.js +0 -50
  96. package/lib/DigitalSignEditor/constants.js +0 -7
  97. package/lib/DigitalSignEditor/index.css +0 -69
  98. package/lib/DigitalSignEditor/index.js +0 -182
  99. package/lib/DigitalSignEditor/service.js +0 -38
  100. package/lib/DigitalSignEditor/signature-board/index.css +0 -35
  101. package/lib/DigitalSignEditor/signature-board/index.js +0 -135
  102. package/lib/DigitalSignEditor/signature-board/signature-tool.js +0 -396
  103. package/lib/DigitalSignEditor/utils.js +0 -29
  104. package/lib/DurationEditor/index.js +0 -111
  105. package/lib/EmailEditor/index.js +0 -59
  106. package/lib/FileEditor/addition-previewer/index.css +0 -1
  107. package/lib/FileEditor/addition-previewer/index.js +0 -52
  108. package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
  109. package/lib/FileEditor/addition-previewer/local-file-addition/index.js +0 -252
  110. package/lib/FileEditor/constants.js +0 -7
  111. package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +0 -74
  112. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +0 -5
  113. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +0 -77
  114. package/lib/FileEditor/files-previewer/file-previewer/index.css +0 -88
  115. package/lib/FileEditor/files-previewer/file-previewer/index.js +0 -167
  116. package/lib/FileEditor/files-previewer/index.css +0 -56
  117. package/lib/FileEditor/files-previewer/index.js +0 -277
  118. package/lib/FileEditor/index.css +0 -6
  119. package/lib/FileEditor/utils.js +0 -22
  120. package/lib/FileUploader/index.css +0 -9
  121. package/lib/GeolocationEditor/country-editor.js +0 -319
  122. package/lib/GeolocationEditor/index.css +0 -641
  123. package/lib/GeolocationEditor/index.js +0 -241
  124. package/lib/GeolocationEditor/location-editor.js +0 -368
  125. package/lib/GeolocationEditor/map-editor/index.js +0 -456
  126. package/lib/GeolocationEditor/map-editor/large-editor/index.css +0 -137
  127. package/lib/GeolocationEditor/map-editor/large-editor/index.js +0 -461
  128. package/lib/GeolocationEditor/map-editor-utils.js +0 -153
  129. package/lib/GeolocationEditor/map-selection-editor/index.js +0 -455
  130. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +0 -1
  131. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +0 -447
  132. package/lib/GeolocationEditor/parse-geolocation.js +0 -282
  133. package/lib/GeolocationEditor/province-city-editor.js +0 -292
  134. package/lib/GeolocationEditor/province-editor.js +0 -226
  135. package/lib/GeolocationEditor/selector-header-item.js +0 -28
  136. package/lib/GeolocationEditor/selector-list.js +0 -33
  137. package/lib/GeolocationEditor/with-ref.js +0 -27
  138. package/lib/ImageEditor/addition-previewer/image-link/index.css +0 -45
  139. package/lib/ImageEditor/addition-previewer/image-link/index.js +0 -73
  140. package/lib/ImageEditor/addition-previewer/index.css +0 -106
  141. package/lib/ImageEditor/addition-previewer/index.js +0 -63
  142. package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +0 -125
  143. package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +0 -254
  144. package/lib/ImageEditor/constants.js +0 -7
  145. package/lib/ImageEditor/images-previewer/image-preview/index.css +0 -59
  146. package/lib/ImageEditor/images-previewer/image-preview/index.js +0 -155
  147. package/lib/ImageEditor/images-previewer/index.css +0 -18
  148. package/lib/ImageEditor/images-previewer/index.js +0 -140
  149. package/lib/ImageEditor/index.css +0 -24
  150. package/lib/ImageEditor/index.js +0 -194
  151. package/lib/ImageThumbnail/index.css +0 -20
  152. package/lib/ImageThumbnail/index.js +0 -136
  153. package/lib/RowExpandDialog/body/index.css +0 -21
  154. package/lib/RowExpandDialog/body/index.js +0 -279
  155. package/lib/RowExpandDialog/column-content/index.css +0 -43
  156. package/lib/RowExpandDialog/column-content/index.js +0 -50
  157. package/lib/RowExpandDialog/constants.js +0 -114
  158. package/lib/RowExpandDialog/header/index.css +0 -31
  159. package/lib/RowExpandDialog/header/index.js +0 -33
  160. package/lib/RowExpandDialog/index.css +0 -24
  161. package/lib/RowExpandDialog/index.js +0 -272
  162. package/lib/RowExpandDialog/utils.js +0 -83
  163. package/lib/RowExpandEditor/RowExpandAddBtn/index.css +0 -22
  164. package/lib/RowExpandEditor/RowExpandAddBtn/index.js +0 -24
  165. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +0 -18
  166. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +0 -43
  167. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +0 -5
  168. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +0 -232
  169. package/lib/RowExpandEditor/RowExpandDateEditor/index.js +0 -130
  170. package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +0 -129
  171. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +0 -13
  172. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +0 -208
  173. package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +0 -105
  174. package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
  175. package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +0 -125
  176. package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
  177. package/lib/RowExpandEditor/RowExpandFileEditor/index.js +0 -146
  178. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +0 -17
  179. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +0 -165
  180. package/lib/RowExpandEditor/RowExpandImageEditor/index.css +0 -6
  181. package/lib/RowExpandEditor/RowExpandImageEditor/index.js +0 -170
  182. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +0 -6
  183. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +0 -124
  184. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +0 -44
  185. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +0 -224
  186. package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +0 -105
  187. package/lib/RowExpandEditor/RowExpandRateEditor/index.css +0 -13
  188. package/lib/RowExpandEditor/RowExpandRateEditor/index.js +0 -152
  189. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +0 -58
  190. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +0 -192
  191. package/lib/RowExpandEditor/RowExpandTextEditor/index.css +0 -4
  192. package/lib/RowExpandEditor/RowExpandTextEditor/index.js +0 -127
  193. package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +0 -31
  194. package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +0 -130
  195. package/lib/RowExpandEditor/constants.js +0 -44
  196. package/lib/RowExpandEditor/index.css +0 -0
  197. package/lib/RowExpandEditor/index.js +0 -32
  198. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +0 -27
  199. package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +0 -1
  200. package/lib/RowExpandFormatter/constants.js +0 -60
  201. package/lib/UploadProgress/index.js +0 -38
  202. package/lib/UrlEditor/index.js +0 -62
  203. package/lib/common/editor-base.js +0 -53
  204. package/lib/constants/file.js +0 -96
  205. package/lib/constants/key-codes.js +0 -109
  206. package/lib/hooks/index.js +0 -16
  207. package/lib/locales/de.json +0 -163
  208. package/lib/locales/en.json +0 -163
  209. package/lib/locales/es.json +0 -163
  210. package/lib/locales/fr.json +0 -163
  211. package/lib/locales/pt.json +0 -163
  212. package/lib/locales/ru.json +0 -163
  213. package/lib/locales/zh-CN.json +0 -163
  214. package/lib/select-editor/pc-select-editor/index.css +0 -85
  215. package/lib/select-editor/pc-select-editor/index.js +0 -290
  216. package/lib/utils/cell-comparer.js +0 -35
  217. package/lib/utils/cell.js +0 -55
  218. package/lib/utils/column-utils.js +0 -25
  219. package/lib/utils/get-event-transfer.js +0 -75
  220. package/lib/utils/object-utils.js +0 -61
  221. /package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.css +0 -0
  222. /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-collaborator-editor-popover}/index.css +0 -0
  223. /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.css +0 -0
  224. /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
  225. /package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.js +0 -0
  226. /package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.css +0 -0
@@ -1,279 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _reactstrap = require("reactstrap");
10
- var _classnames = _interopRequireDefault(require("classnames"));
11
- var _dtableUtils = require("dtable-utils");
12
- var _constants = require("../constants");
13
- var _utils = require("../utils");
14
- var _columnContent = _interopRequireDefault(require("../column-content"));
15
- var _RowExpandEditor = _interopRequireDefault(require("../../RowExpandEditor"));
16
- var _RowExpandFormatter = _interopRequireDefault(require("../../RowExpandFormatter"));
17
- require("./index.css");
18
- class Body extends _react.default.Component {
19
- constructor(props) {
20
- super(props);
21
- this.setEditorRef = columnIndex => editor => {
22
- this.editors[columnIndex] = editor;
23
- };
24
- this.onPressUpKey = () => {
25
- const currentTop = this.getScrollTop();
26
- if (currentTop === 0) return;
27
- this.setScrollTop(currentTop - 20);
28
- };
29
- this.onPressDownKey = () => {
30
- this.setScrollTop(this.getScrollTop() + 20);
31
- };
32
- this.scrollToFocus = () => {
33
- if (!this.focusDom || !this.focusDom.current) {
34
- return;
35
- }
36
- const content_scroll_top = this.getScrollTop();
37
- const focus_offset_top = this.focusDom.current.offsetTop;
38
- const focus_offset_height = this.focusDom.current.clientHeight;
39
- if (focus_offset_top < content_scroll_top) {
40
- this.setScrollTop(focus_offset_top - focus_offset_height);
41
- return;
42
- }
43
- if (focus_offset_top > content_scroll_top + this.contentRef.clientHeight) {
44
- this.setScrollTop(focus_offset_top - this.contentRef.clientHeight / 2);
45
- return;
46
- }
47
- };
48
- this.setScrollTop = scrollTop => {
49
- if (this.contentRef) {
50
- this.contentRef.scrollTop = scrollTop;
51
- }
52
- };
53
- this.getScrollTop = () => {
54
- return this.contentRef ? this.contentRef.scrollTop : 0;
55
- };
56
- this.onEditorOpen = () => {
57
- this.fieldEditorOpen = true;
58
- };
59
- this.onEditorClose = () => {
60
- this.fieldEditorOpen = false;
61
- };
62
- this.onHotKey = event => {
63
- const {
64
- columns
65
- } = this.props;
66
- const readonly = Array.isArray(columns) && columns.length > 0 ? !columns.some(c => c.editable) : true;
67
- const keyCode = event.keyCode;
68
- // When opening field editor, all shortcuts in row expand dialog do not work
69
- if (this.fieldEditorOpen === true) {
70
- return;
71
- }
72
- if (keyCode === _constants.keyCodes.Esc) {
73
- this.props.onRowExpandCancel();
74
- return;
75
- }
76
- if (keyCode === _constants.keyCodes.UpArrow) {
77
- this.onPressUpKey();
78
- return;
79
- }
80
- if (keyCode === _constants.keyCodes.DownArrow) {
81
- this.onPressDownKey();
82
- return;
83
- }
84
- if (keyCode === _constants.keyCodes.Tab && !readonly) {
85
- this.onPressTab(event);
86
- }
87
- };
88
- this.onPressTab = event => {
89
- event.stopPropagation();
90
- event.preventDefault();
91
- const {
92
- columns
93
- } = this.props;
94
- let tabIndex = this.state.tabIndex;
95
- // Press tab, highlight next column;
96
- if (event.shiftKey) {
97
- tabIndex = tabIndex - 1;
98
- while (columns[tabIndex] && !columns[tabIndex].editable) {
99
- tabIndex--;
100
- }
101
- } else {
102
- // Press shift + tab, highlight preview column
103
- tabIndex = tabIndex + 1;
104
- while (columns[tabIndex] && !columns[tabIndex].editable) {
105
- tabIndex++;
106
- }
107
- }
108
- this.updateTabIndex(tabIndex);
109
- };
110
- this.updateTabIndex = tabIndex => {
111
- if (tabIndex >= this.props.columns.length) {
112
- tabIndex = 0;
113
- }
114
- if (tabIndex !== this.state.tabIndex) {
115
- this.setState({
116
- tabIndex
117
- });
118
- }
119
- };
120
- this.downloadImage = imageItemUrl => {
121
- let rotateIndex = imageItemUrl.indexOf('?a=');
122
- if (rotateIndex > -1) {
123
- imageItemUrl = imageItemUrl.slice(0, rotateIndex);
124
- }
125
- let imageUrlSuffix = imageItemUrl.indexOf('?dl=1');
126
- let downloadUrl = imageUrlSuffix !== -1 ? imageItemUrl : imageItemUrl + '?dl=1';
127
- (0, _utils.downloadFile)(downloadUrl);
128
- };
129
- this.getCellValue = _ref => {
130
- let {
131
- row,
132
- column
133
- } = _ref;
134
- if (!row || !column) return null;
135
- const {
136
- valueKey
137
- } = this.props;
138
- return row[column[valueKey]];
139
- };
140
- this.renderColumnValue = (row, column, columnIndex, isEditorFocus) => {
141
- const {
142
- eventBus,
143
- departments,
144
- userDepartmentIdsMap,
145
- columns,
146
- component,
147
- valueKey,
148
- collaborators,
149
- getCollaborators,
150
- queryCollaborators,
151
- onChange,
152
- uploadFile,
153
- longTextEditorAPI,
154
- config,
155
- lang,
156
- seafileEditorI18n
157
- } = this.props;
158
- const {
159
- editable
160
- } = column;
161
- const {
162
- editor,
163
- formatter
164
- } = component || {};
165
- if (editable) {
166
- return /*#__PURE__*/_react.default.createElement(_RowExpandEditor.default, {
167
- column: column,
168
- row: row,
169
- columns: columns,
170
- eventBus: eventBus,
171
- departments: departments,
172
- userDepartmentIdsMap: userDepartmentIdsMap,
173
- component: editor,
174
- isEditorFocus: isEditorFocus,
175
- columnIndex: columnIndex,
176
- valueKey: valueKey,
177
- isInModal: true,
178
- lang: lang,
179
- collaborators: collaborators,
180
- config: config,
181
- getCollaborators: getCollaborators,
182
- queryCollaborators: queryCollaborators,
183
- updateTabIndex: this.updateTabIndex,
184
- onCommit: value => onChange(column, value),
185
- onEditorOpen: this.onEditorOpen,
186
- onEditorClose: this.onEditorClose,
187
- uploadFile: uploadFile,
188
- longTextEditorI18n: seafileEditorI18n,
189
- longTextEditorAPI: longTextEditorAPI
190
- });
191
- }
192
- return /*#__PURE__*/_react.default.createElement(_RowExpandFormatter.default, {
193
- column: column,
194
- row: row,
195
- collaborators: collaborators,
196
- config: config,
197
- eventBus: eventBus,
198
- departments: departments,
199
- component: formatter,
200
- valueKey: valueKey,
201
- downloadImage: this.downloadImage,
202
- getCollaborators: getCollaborators,
203
- queryCollaborators: queryCollaborators
204
- });
205
- };
206
- this.renderColumnContent = (row, column, columnIndex) => {
207
- const isEditorFocus = columnIndex === this.state.tabIndex && column.editable;
208
- return /*#__PURE__*/_react.default.createElement("div", {
209
- ref: isEditorFocus ? this.focusDom : null
210
- }, /*#__PURE__*/_react.default.createElement(_columnContent.default, {
211
- column: column
212
- }, this.renderColumnValue(row, column, columnIndex, isEditorFocus)));
213
- };
214
- this.state = {
215
- tabIndex: 0
216
- };
217
- this.fieldEditorOpen = false;
218
- this.focusDom = /*#__PURE__*/_react.default.createRef();
219
- this.editors = [];
220
- this.commentInputFocus = false;
221
- this.contentRef = null;
222
- }
223
- componentDidMount() {
224
- window.addEventListener('keydown', this.onHotKey);
225
- }
226
- componentDidUpdate(prevProps, prevState) {
227
- if (prevState.tabIndex !== this.state.tabIndex) {
228
- this.scrollToFocus();
229
- }
230
- if (prevState.isShowComment !== this.state.isShowComment) {
231
- this.commentInputFocus = false;
232
- }
233
- }
234
- componentWillUnmount() {
235
- window.removeEventListener('keydown', this.onHotKey);
236
- }
237
- render() {
238
- const {
239
- isInsertingRow,
240
- columns,
241
- row,
242
- placeholder
243
- } = this.props;
244
- return /*#__PURE__*/_react.default.createElement(_reactstrap.ModalBody, {
245
- className: "dtable-ui-row-expand-body"
246
- }, /*#__PURE__*/_react.default.createElement("div", {
247
- className: "dtable-ui-row-expand-body-content",
248
- ref: ref => this.contentRef = ref
249
- }, columns.length === 0 && placeholder && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, placeholder), columns.map((column, index) => {
250
- // Do not display creator, last_modifier, ctime, mtime when inserting row
251
- if (isInsertingRow && !column.editable) return null;
252
- const {
253
- type,
254
- data
255
- } = column;
256
- let isHasMore = false;
257
- if (type === _dtableUtils.CellType.LINK_FORMULA) {
258
- let {
259
- array_type
260
- } = data || {};
261
- const value = this.getCellValue({
262
- row,
263
- column
264
- });
265
- const cellValue = (0, _utils.getFormulaArrayValue)(value, !(0, _utils.isArrayFormalColumn)(array_type));
266
- if (cellValue.length >= 10) {
267
- isHasMore = true;
268
- }
269
- }
270
- return /*#__PURE__*/_react.default.createElement("div", {
271
- className: (0, _classnames.default)('dtable-ui-row-expand-item', {
272
- 'is-has-more': isHasMore
273
- }),
274
- key: column.key
275
- }, this.renderColumnContent(row, column, index));
276
- })));
277
- }
278
- }
279
- var _default = exports.default = Body;
@@ -1,43 +0,0 @@
1
- .dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info {
2
- padding-top: 9px;
3
- height: fit-content;
4
- }
5
-
6
- .dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-header-icon {
7
- display: inline-block;
8
- padding: 0 0.3125rem;
9
- margin-left: -0.3125rem;
10
- }
11
-
12
- .dtable-ui-header-icon .dtable-font {
13
- font-size: 14px;
14
- color: #aaa;
15
- cursor: default;
16
- }
17
-
18
- .dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-header-icon .dtable-font {
19
- color: #212529a6;
20
- }
21
-
22
- .dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-row-expand-column-name {
23
- color: #212529b3;
24
- }
25
-
26
- .dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .cell-is-required {
27
- color: #ff1920;
28
- padding-left: 0.3125rem;
29
- display: inline-block;
30
- height: 21px;
31
- }
32
-
33
- .dtable-ui-row-expand-column-content .dtable-ui-row-expand-column-content-info .dtable-ui-column-tip-icon {
34
- color: #bdbdbd;
35
- position: relative;
36
- font-size: 14px;
37
- cursor: pointer;
38
- }
39
-
40
- .dtable-ui-column-description-tip {
41
- max-height: 300px;
42
- overflow: auto;
43
- }
@@ -1,50 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _reactstrap = require("reactstrap");
10
- var _dtableUtils = require("dtable-utils");
11
- require("./index.css");
12
- const RowContent = _ref => {
13
- let {
14
- column,
15
- children
16
- } = _ref;
17
- const descriptionRef = (0, _react.useRef)(null);
18
- const {
19
- name,
20
- type,
21
- key,
22
- description
23
- } = column;
24
- return /*#__PURE__*/_react.default.createElement(_reactstrap.Row, {
25
- className: "dtable-ui-row-expand-column-content pb-4"
26
- }, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, {
27
- md: 3,
28
- className: "dtable-ui-row-expand-column-content-info d-flex"
29
- }, /*#__PURE__*/_react.default.createElement("span", {
30
- className: "dtable-ui-header-icon",
31
- id: "header-icon-".concat(key)
32
- }, /*#__PURE__*/_react.default.createElement("i", {
33
- className: _dtableUtils.COLUMNS_ICON_CONFIG[type]
34
- })), /*#__PURE__*/_react.default.createElement("span", {
35
- className: "dtable-ui-row-expand-column-name"
36
- }, name || ''), description && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
37
- className: "dtable-font dtable-icon-description dtable-ui-column-tip-icon ml-2",
38
- ref: descriptionRef
39
- }), descriptionRef.current && /*#__PURE__*/_react.default.createElement(_reactstrap.UncontrolledTooltip, {
40
- innerClassName: "dtable-ui-column-description-tip",
41
- popperClassName: "dtable-ui-row-expand-column-tip",
42
- target: descriptionRef.current,
43
- placement: "bottom",
44
- fade: false
45
- }, description))), /*#__PURE__*/_react.default.createElement(_reactstrap.Col, {
46
- md: 9,
47
- className: "d-flex align-items-center dtable-ui-row-expand-column-content-value"
48
- }, children));
49
- };
50
- var _default = exports.default = RowContent;
@@ -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,31 +0,0 @@
1
- .dtable-ui-row-expand-header .dtable-ui-row-expand-header-close-list {
2
- display: flex;
3
- }
4
-
5
- .dtable-ui-row-expand-header .dtable-ui-row-expand-header-close-list .header-close-list-btn {
6
- height: 24px;
7
- width: 24px;
8
- padding: 0 5px;
9
- margin: 0 2px;
10
- color: #000;
11
- opacity: 0.5;
12
- font-weight: 700;
13
- }
14
-
15
- .dtable-ui-row-expand-header .dtable-ui-row-expand-header-close-list .header-close-list-btn:hover {
16
- opacity: 0.75;
17
- cursor: pointer;
18
- }
19
-
20
- .dtable-ui-row-expand-header .dtable-ui-row-expand-header-left-btns {
21
- height: 24px;
22
- display: flex;
23
- align-items: center;
24
- justify-content: space-between;
25
- }
26
-
27
- .dtable-ui-row-expand-header .dtable-ui-row-expand-header-left-btns .dtable-ui-row-expand-header-title {
28
- max-width: 400px;
29
- font-weight: normal;
30
- }
31
-
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _reactstrap = require("reactstrap");
10
- var _lang = require("../../lang");
11
- require("./index.css");
12
- const Header = _ref => {
13
- let {
14
- onToggle,
15
- title
16
- } = _ref;
17
- return /*#__PURE__*/_react.default.createElement(_reactstrap.ModalHeader, {
18
- className: "d-print-none dtable-ui-row-expand-header",
19
- close: /*#__PURE__*/_react.default.createElement("div", {
20
- className: "dtable-ui-row-expand-header-close-list"
21
- }, /*#__PURE__*/_react.default.createElement("span", {
22
- role: "button",
23
- "aria-label": (0, _lang.getLocale)('Close_expanded_record'),
24
- className: "dtable-font dtable-icon-x header-close-list-btn",
25
- onClick: onToggle
26
- }))
27
- }, /*#__PURE__*/_react.default.createElement("div", {
28
- className: "dtable-ui-row-expand-header-left-btns"
29
- }, /*#__PURE__*/_react.default.createElement("div", {
30
- className: "dtable-ui-row-expand-header-title text-truncate"
31
- }, title)));
32
- };
33
- var _default = exports.default = Header;
@@ -1,24 +0,0 @@
1
- .dtable-ui-row-expand-dialog {
2
- margin: 28px 0 0 0;
3
- transform: translate(0, 0) !important;
4
- }
5
-
6
- .dtable-ui-row-expand-dialog .modal-header {
7
- padding: 6px 14px 6px 20px;
8
- }
9
-
10
- .dtable-ui-row-expand-dialog .modal-content {
11
- height: 100%;
12
- }
13
-
14
- .dtable-ui-row-expand-dialog .dtable-ui-row-expand-content {
15
- display: flex;
16
- flex-direction: row;
17
- }
18
-
19
- .dtable-ui-row-expand-dialog .dtable-ui-row-expand-details {
20
- width: 100%;
21
- height: 100%;
22
- display: flex;
23
- flex-direction: column;
24
- }