dtable-ui-component 5.3.6 → 5.3.8

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 (256) hide show
  1. package/lib/ButtonFormatter/index.js +8 -2
  2. package/lib/CheckboxEditor/index.css +8 -20
  3. package/lib/CheckboxEditor/index.js +98 -35
  4. package/lib/CheckboxFormatter/index.css +5 -0
  5. package/lib/CheckboxFormatter/index.js +9 -15
  6. package/lib/CollaboratorEditor/index.css +12 -35
  7. package/lib/CollaboratorEditor/index.js +18 -212
  8. package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.js +27 -30
  9. package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +257 -0
  10. package/lib/CollaboratorItem/index.css +7 -1
  11. package/lib/CollaboratorItem/index.js +6 -2
  12. package/lib/Comment/body/comment.js +190 -0
  13. package/lib/Comment/body/index.css +95 -0
  14. package/lib/Comment/body/index.js +32 -0
  15. package/lib/Comment/footer/btns/index.css +40 -0
  16. package/lib/Comment/footer/btns/index.js +113 -0
  17. package/lib/Comment/footer/index.css +157 -0
  18. package/lib/Comment/footer/index.js +169 -0
  19. package/lib/Comment/footer/input/index.css +52 -0
  20. package/lib/Comment/footer/input/index.js +448 -0
  21. package/lib/Comment/footer/input/participant/index.css +0 -0
  22. package/lib/Comment/footer/input/participant/index.js +53 -0
  23. package/lib/Comment/footer/participants/index.css +22 -0
  24. package/lib/Comment/footer/participants/index.js +68 -0
  25. package/lib/Comment/footer/participants/participant/index.css +5 -0
  26. package/lib/Comment/footer/participants/participant/index.js +32 -0
  27. package/lib/Comment/footer/participants/participant-select/index.css +104 -0
  28. package/lib/Comment/footer/participants/participant-select/index.js +182 -0
  29. package/lib/Comment/index.css +19 -0
  30. package/lib/Comment/index.js +304 -0
  31. package/lib/Comment/model.js +25 -0
  32. package/lib/Comment/utils/common.js +62 -0
  33. package/lib/Comment/utils/index.js +27 -0
  34. package/lib/Comment/utils/utilities.js +176 -0
  35. package/lib/DTableCustomizeSelect/index.js +2 -2
  36. package/lib/DTableFiltersPopover/utils/index.js +1 -7
  37. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
  38. package/lib/DTableGroupSelect/index.js +3 -3
  39. package/lib/DTableSelect/index.js +3 -1
  40. package/lib/DateEditor/index.js +14 -51
  41. package/lib/DateEditor/pc-date-editor-popover.js +149 -12
  42. package/lib/{common/delete-tip.js → DeleteTip/index.js} +12 -16
  43. package/lib/Department-editor/department-single-select.js +1 -1
  44. package/lib/Department-editor/index.js +3 -4
  45. package/lib/DepartmentSingleSelectFormatter/index.js +3 -2
  46. package/lib/DigitalSignEditor/constants.js +7 -0
  47. package/lib/DigitalSignEditor/index.css +69 -0
  48. package/lib/DigitalSignEditor/index.js +182 -0
  49. package/lib/DigitalSignEditor/service.js +39 -0
  50. package/lib/DigitalSignEditor/signature-board/index.css +35 -0
  51. package/lib/DigitalSignEditor/signature-board/index.js +135 -0
  52. package/lib/DigitalSignEditor/signature-board/signature-tool.js +396 -0
  53. package/lib/DigitalSignEditor/utils.js +29 -0
  54. package/lib/DurationEditor/index.js +110 -0
  55. package/lib/EmailEditor/index.js +58 -0
  56. package/lib/FileEditor/addition-previewer/index.css +1 -0
  57. package/lib/FileEditor/addition-previewer/index.js +52 -0
  58. package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
  59. package/lib/FileEditor/addition-previewer/local-file-addition/index.js +252 -0
  60. package/lib/FileEditor/constants.js +7 -0
  61. package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +74 -0
  62. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +5 -0
  63. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +77 -0
  64. package/lib/FileEditor/files-previewer/file-previewer/index.css +88 -0
  65. package/lib/FileEditor/files-previewer/file-previewer/index.js +167 -0
  66. package/lib/FileEditor/files-previewer/index.css +56 -0
  67. package/lib/FileEditor/files-previewer/index.js +277 -0
  68. package/lib/FileEditor/index.css +6 -0
  69. package/lib/FileEditor/index.js +258 -11
  70. package/lib/FileEditor/utils.js +22 -0
  71. package/lib/FileItemFormatter/index.js +19 -20
  72. package/lib/FileUploader/index.css +9 -0
  73. package/lib/FileUploader/index.js +268 -14
  74. package/lib/FormulaFormatter/cell-value-validator.js +17 -17
  75. package/lib/FormulaFormatter/index.js +2 -1
  76. package/lib/FormulaFormatter/utils.js +0 -31
  77. package/lib/GeolocationEditor/country-editor.js +319 -0
  78. package/lib/GeolocationEditor/index.css +641 -0
  79. package/lib/GeolocationEditor/index.js +240 -0
  80. package/lib/GeolocationEditor/location-editor.js +368 -0
  81. package/lib/GeolocationEditor/map-editor/index.js +456 -0
  82. package/lib/GeolocationEditor/map-editor/large-editor/index.css +137 -0
  83. package/lib/GeolocationEditor/map-editor/large-editor/index.js +461 -0
  84. package/lib/GeolocationEditor/map-editor-utils.js +153 -0
  85. package/lib/GeolocationEditor/map-selection-editor/index.js +455 -0
  86. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +1 -0
  87. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +447 -0
  88. package/lib/GeolocationEditor/parse-geolocation.js +282 -0
  89. package/lib/GeolocationEditor/province-city-editor.js +292 -0
  90. package/lib/GeolocationEditor/province-editor.js +226 -0
  91. package/lib/GeolocationEditor/selector-header-item.js +28 -0
  92. package/lib/GeolocationEditor/selector-list.js +33 -0
  93. package/lib/ImageEditor/addition-previewer/image-link/index.css +45 -0
  94. package/lib/ImageEditor/addition-previewer/image-link/index.js +73 -0
  95. package/lib/ImageEditor/addition-previewer/index.css +106 -0
  96. package/lib/ImageEditor/addition-previewer/index.js +63 -0
  97. package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +125 -0
  98. package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +254 -0
  99. package/lib/ImageEditor/constants.js +7 -0
  100. package/lib/ImageEditor/images-previewer/image-preview/index.css +59 -0
  101. package/lib/ImageEditor/images-previewer/image-preview/index.js +155 -0
  102. package/lib/ImageEditor/images-previewer/index.css +18 -0
  103. package/lib/ImageEditor/images-previewer/index.js +140 -0
  104. package/lib/ImageEditor/index.css +24 -0
  105. package/lib/ImageEditor/index.js +194 -0
  106. package/lib/ImageThumbnail/index.css +20 -0
  107. package/lib/ImageThumbnail/index.js +136 -0
  108. package/lib/LinkEditor/index.js +2 -3
  109. package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
  110. package/lib/MultipleSelectEditor/index.js +16 -177
  111. package/lib/NumberEditor/index.js +63 -77
  112. package/lib/RowExpandDialog/body/index.css +21 -0
  113. package/lib/RowExpandDialog/body/index.js +262 -0
  114. package/lib/RowExpandDialog/column-content/index.css +48 -0
  115. package/lib/RowExpandDialog/column-content/index.js +50 -0
  116. package/lib/RowExpandDialog/header/index.css +31 -0
  117. package/lib/RowExpandDialog/header/index.js +55 -0
  118. package/lib/RowExpandDialog/index.css +28 -0
  119. package/lib/RowExpandDialog/index.js +237 -0
  120. package/lib/RowExpandEditor/RowExpandAddBtn/index.css +22 -0
  121. package/lib/RowExpandEditor/RowExpandAddBtn/index.js +24 -0
  122. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +18 -0
  123. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +43 -0
  124. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +5 -0
  125. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +232 -0
  126. package/lib/RowExpandEditor/RowExpandDateEditor/index.js +130 -0
  127. package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +106 -0
  128. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +13 -0
  129. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +208 -0
  130. package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +105 -0
  131. package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
  132. package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +125 -0
  133. package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
  134. package/lib/RowExpandEditor/RowExpandFileEditor/index.js +147 -0
  135. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +17 -0
  136. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +165 -0
  137. package/lib/RowExpandEditor/RowExpandImageEditor/index.css +6 -0
  138. package/lib/RowExpandEditor/RowExpandImageEditor/index.js +170 -0
  139. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +6 -0
  140. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +123 -0
  141. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +44 -0
  142. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +224 -0
  143. package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +105 -0
  144. package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
  145. package/lib/RowExpandEditor/RowExpandRateEditor/index.js +152 -0
  146. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +58 -0
  147. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +193 -0
  148. package/lib/RowExpandEditor/RowExpandTextEditor/index.css +4 -0
  149. package/lib/RowExpandEditor/RowExpandTextEditor/index.js +127 -0
  150. package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +31 -0
  151. package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +130 -0
  152. package/lib/RowExpandEditor/constants.js +44 -0
  153. package/lib/RowExpandEditor/index.css +0 -0
  154. package/lib/RowExpandEditor/index.js +32 -0
  155. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +27 -0
  156. package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.css +1 -1
  157. package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.js +1 -1
  158. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.css +6 -6
  159. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.js +3 -1
  160. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/row-expand-file-item-formatter.js +12 -13
  161. package/lib/{RowExpandFormulaFormatter → RowExpandFormatter/RowExpandFormulaFormatter}/index.js +11 -10
  162. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.css +6 -6
  163. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.js +1 -1
  164. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/row-expand-image-item-formatter.js +5 -5
  165. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
  166. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.css +2 -2
  167. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.js +20 -20
  168. package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.css +1 -1
  169. package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +1 -0
  170. package/lib/{RowExpandUrlFormatter → RowExpandFormatter/RowExpandUrlFormatter}/index.js +4 -3
  171. package/lib/RowExpandFormatter/constants.js +61 -0
  172. package/lib/RowExpandFormatter/index.css +28 -3
  173. package/lib/RowExpandFormatter/index.js +113 -131
  174. package/lib/SingleSelectEditor/index.js +16 -156
  175. package/lib/SvgIcon/index.css +11 -0
  176. package/lib/SvgIcon/index.js +29 -0
  177. package/lib/TextEditor/index.js +112 -42
  178. package/lib/UploadProgress/index.js +38 -0
  179. package/lib/UrlEditor/index.js +61 -0
  180. package/lib/common/editor-base.js +52 -0
  181. package/lib/constants/file.js +96 -0
  182. package/lib/constants/index.js +27 -15
  183. package/lib/constants/key-codes.js +109 -0
  184. package/lib/css/cell-editor.css +18 -2
  185. package/lib/formatterConfig/base-formatter-config.js +23 -23
  186. package/lib/formatterConfig/index.js +3 -3
  187. package/lib/hooks/index.js +16 -0
  188. package/lib/index.js +81 -46
  189. package/lib/lang/index.js +19 -16
  190. package/lib/locales/de.json +167 -0
  191. package/lib/locales/en.json +167 -0
  192. package/lib/locales/es.json +167 -0
  193. package/lib/locales/fr.json +167 -0
  194. package/lib/locales/pt.json +167 -0
  195. package/lib/locales/ru.json +167 -0
  196. package/lib/locales/zh-CN.json +167 -0
  197. package/lib/select-editor/index.js +6 -6
  198. package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.js +3 -3
  199. package/lib/select-editor/pc-select-editor/index.css +85 -0
  200. package/lib/select-editor/pc-select-editor/index.js +290 -0
  201. package/lib/utils/cell-comparer.js +35 -0
  202. package/lib/utils/cell.js +55 -0
  203. package/lib/utils/column-utils.js +25 -0
  204. package/lib/utils/editor-utils.js +1 -6
  205. package/lib/utils/get-event-transfer.js +75 -0
  206. package/lib/utils/hotkey.js +37 -0
  207. package/lib/utils/object-utils.js +61 -0
  208. package/lib/utils/url.js +121 -8
  209. package/lib/utils/utils.js +119 -2
  210. package/package.json +3 -2
  211. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +0 -97
  212. package/lib/FileEditor/pc-files-addition/index.js +0 -1
  213. package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
  214. package/lib/FileEditor/pc-files-preview/index.js +0 -1
  215. package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
  216. package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
  217. package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
  218. package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
  219. package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
  220. package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
  221. package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
  222. package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
  223. package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
  224. package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
  225. package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
  226. package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
  227. package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
  228. package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
  229. package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
  230. package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
  231. package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
  232. package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
  233. package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
  234. package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
  235. package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
  236. package/lib/FileItemFormatter/utils.js +0 -99
  237. package/lib/MultipleSelectEditor/index.css +0 -9
  238. package/lib/RowExpandLinkFormatter/utils.js +0 -71
  239. package/lib/RowExpandUrlFormatter/index.css +0 -1
  240. package/lib/SingleSelectEditor/index.css +0 -14
  241. package/lib/common/modal-portal.js +0 -26
  242. package/lib/locals/de.js +0 -103
  243. package/lib/locals/en.js +0 -104
  244. package/lib/locals/es.js +0 -103
  245. package/lib/locals/fr.js +0 -103
  246. package/lib/locals/pt.js +0 -103
  247. package/lib/locals/ru.js +0 -103
  248. package/lib/locals/zh-CN.js +0 -104
  249. package/lib/select-editor/pc-select-editor-popover/index.css +0 -71
  250. package/lib/select-editor/pc-select-editor-popover/index.js +0 -122
  251. /package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.css +0 -0
  252. /package/lib/CollaboratorEditor/{pc-collaborator-editor-popover → pc-collaborator-editor}/index.css +0 -0
  253. /package/lib/{common/delete-tip.css → DeleteTip/index.css} +0 -0
  254. /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/value-display-utils.js +0 -0
  255. /package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.js +0 -0
  256. /package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.css +0 -0
@@ -7,76 +7,46 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
- var _TextFormatter = _interopRequireDefault(require("../TextFormatter"));
11
- var _NumberFormatter = _interopRequireDefault(require("../NumberFormatter"));
12
- var _CheckboxFormatter = _interopRequireDefault(require("../CheckboxFormatter"));
13
- var _DateFormatter = _interopRequireDefault(require("../DateFormatter"));
14
- var _SingleSelectFormatter = _interopRequireDefault(require("../SingleSelectFormatter"));
15
- var _MultipleSelectFormatter = _interopRequireDefault(require("../MultipleSelectFormatter"));
16
- var _CollaboratorFormatter = _interopRequireDefault(require("../CollaboratorFormatter"));
17
- var _LongTextFormatter = _interopRequireDefault(require("../LongTextFormatter"));
18
- var _GeolocationFormatter = _interopRequireDefault(require("../GeolocationFormatter"));
19
- var _CTimeFormatter = _interopRequireDefault(require("../CTimeFormatter"));
20
- var _CreatorFormatter = _interopRequireDefault(require("../CreatorFormatter"));
21
- var _LastModifierFormatter = _interopRequireDefault(require("../LastModifierFormatter"));
22
- var _MTimeFormatter = _interopRequireDefault(require("../MTimeFormatter"));
23
- var _AutoNumberFormatter = _interopRequireDefault(require("../AutoNumberFormatter"));
24
- var _DurationFormatter = _interopRequireDefault(require("../DurationFormatter"));
25
- var _ButtonFormatter = _interopRequireDefault(require("../ButtonFormatter"));
26
- var _RowExpandUrlFormatter = _interopRequireDefault(require("../RowExpandUrlFormatter"));
27
- var _RowExpandEmailFormatter = _interopRequireDefault(require("../RowExpandEmailFormatter"));
28
- var _RowExpandRateFormatter = _interopRequireDefault(require("../RowExpandRateFormatter"));
29
- var _RowExpandImageFormatter = _interopRequireDefault(require("../RowExpandImageFormatter"));
30
- var _RowExpandFileFormatter = _interopRequireDefault(require("../RowExpandFileFormatter"));
31
- var _RowExpandLinkFormatter = _interopRequireDefault(require("../RowExpandLinkFormatter"));
32
- var _RowExpandFormulaFormatter = _interopRequireDefault(require("../RowExpandFormulaFormatter"));
33
- var _DigitalSignFormatter = _interopRequireDefault(require("../DigitalSignFormatter"));
34
- var _DepartmentSingleSelectFormatter = _interopRequireDefault(require("../DepartmentSingleSelectFormatter"));
35
- var _constants = require("../constants");
10
+ var _dtableUtils = require("dtable-utils");
11
+ var _constants = require("./constants");
36
12
  require("./index.css");
37
- class EditorFormatter extends _react.default.Component {
13
+ class RowExpandFormatter extends _react.default.Component {
38
14
  constructor(_props) {
39
15
  super(_props);
40
16
  this.updateCollaborators = () => {
17
+ const {
18
+ column
19
+ } = this.props;
20
+ if (![_dtableUtils.CellType.CREATOR, _dtableUtils.CellType.LAST_MODIFIER, _dtableUtils.CellType.COLLABORATOR].includes(column.type)) return;
21
+ const collaborators = this.getCollaborators();
41
22
  this.setState({
42
- collaborators: this.getCollaborator()
23
+ collaborators
43
24
  });
44
25
  };
45
26
  this.calculateCollaboratorData = props => {
46
27
  const {
47
28
  row,
48
- column
29
+ column,
30
+ queryCollaborators
49
31
  } = props;
50
- if (column.type === _constants.CellType.CREATOR || column.type === _constants.CellType.LAST_MODIFIER) {
32
+ if (column.type === _dtableUtils.CellType.CREATOR || column.type === _dtableUtils.CellType.LAST_MODIFIER) {
51
33
  const email = row[column.name];
52
- this.loadCollaborator(email);
53
- } else if (column.type === _constants.CellType.COLLABORATOR) {
34
+ queryCollaborators && queryCollaborators(email);
35
+ } else if (column.type === _dtableUtils.CellType.COLLABORATOR) {
54
36
  const emails = row[column.name];
55
37
  if (Array.isArray(emails)) {
56
- emails.forEach(email => {
57
- this.loadCollaborator(email);
58
- });
38
+ queryCollaborators && queryCollaborators(emails);
59
39
  }
60
40
  }
61
41
  };
62
- this.getCollaborator = () => {
42
+ this.getCollaborators = () => {
63
43
  const {
64
- context,
44
+ getCollaborators,
65
45
  collaborators
66
46
  } = this.props;
67
- if (context && context.getCollaboratorsFromCache) {
68
- return context.getCollaboratorsFromCache();
69
- }
47
+ if (getCollaborators) return getCollaborators();
70
48
  return collaborators || [];
71
49
  };
72
- this.loadCollaborator = email => {
73
- const {
74
- context
75
- } = this.props;
76
- if (context && context.loadCollaborator) {
77
- context.loadCollaborator(email);
78
- }
79
- };
80
50
  this.renderEmpty = () => {
81
51
  return /*#__PURE__*/_react.default.createElement("div", {
82
52
  className: "d-flex align-items-center form-control disabled h-auto"
@@ -86,7 +56,7 @@ class EditorFormatter extends _react.default.Component {
86
56
  let {
87
57
  column,
88
58
  row,
89
- className
59
+ valueKey
90
60
  } = this.props;
91
61
  let {
92
62
  type: columnType
@@ -94,178 +64,180 @@ class EditorFormatter extends _react.default.Component {
94
64
  const {
95
65
  collaborators
96
66
  } = this.state;
97
- const containerClassName = "dtable-".concat(columnType, "-formatter ").concat(className || '');
98
- let cellValue = row[column.key] !== null && row[column.key] !== undefined ? row[column.key] : row[column.name];
67
+ const containerClassName = "dtable-ui-row-expand-".concat(columnType, "-formatter");
68
+ let cellValue = row[column[valueKey]];
69
+ const Formatter = this.component[columnType];
70
+ if (!Formatter) return null;
99
71
  switch (columnType) {
100
- case _constants.CellType.TEXT:
72
+ case _dtableUtils.CellType.TEXT:
101
73
  {
102
74
  return /*#__PURE__*/_react.default.createElement("div", {
103
75
  className: "form-control d-flex align-items-center w-100"
104
- }, /*#__PURE__*/_react.default.createElement(_TextFormatter.default, {
76
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
105
77
  value: cellValue,
106
78
  containerClassName: containerClassName
107
79
  }));
108
80
  }
109
- case _constants.CellType.COLLABORATOR:
81
+ case _dtableUtils.CellType.COLLABORATOR:
110
82
  {
111
83
  return /*#__PURE__*/_react.default.createElement("div", {
112
84
  className: "form-control d-flex align-items-center w-100 h-auto"
113
- }, /*#__PURE__*/_react.default.createElement(_CollaboratorFormatter.default, {
85
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
114
86
  value: cellValue,
115
87
  collaborators: collaborators,
116
88
  containerClassName: containerClassName
117
89
  }));
118
90
  }
119
- case _constants.CellType.LONG_TEXT:
91
+ case _dtableUtils.CellType.LONG_TEXT:
120
92
  {
121
- if (!cellValue) return null;
93
+ if (!cellValue) return /*#__PURE__*/_react.default.createElement("div", {
94
+ className: "form-control d-flex align-items-center w-100"
95
+ });
122
96
  return /*#__PURE__*/_react.default.createElement("div", {
123
97
  className: "longtext-formatter-container"
124
- }, /*#__PURE__*/_react.default.createElement(_LongTextFormatter.default, {
98
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
125
99
  value: cellValue,
126
100
  containerClassName: containerClassName,
127
101
  isSample: false
128
102
  }));
129
103
  }
130
- case _constants.CellType.GEOLOCATION:
104
+ case _dtableUtils.CellType.GEOLOCATION:
131
105
  {
106
+ if (!cellValue) return null;
132
107
  if (typeof cellValue !== 'object') return null;
133
108
  return /*#__PURE__*/_react.default.createElement("div", {
134
- className: "geolocation-formatter-container"
135
- }, /*#__PURE__*/_react.default.createElement(_GeolocationFormatter.default, {
109
+ className: "dtable-ui-geolocation-formatter-container"
110
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
136
111
  value: cellValue,
137
112
  data: column.data,
138
113
  containerClassName: containerClassName
139
114
  }));
140
115
  }
141
- case _constants.CellType.NUMBER:
116
+ case _dtableUtils.CellType.NUMBER:
142
117
  {
143
118
  return /*#__PURE__*/_react.default.createElement("div", {
144
119
  className: "form-control d-flex align-items-center",
145
120
  style: {
146
121
  width: 320
147
122
  }
148
- }, /*#__PURE__*/_react.default.createElement(_NumberFormatter.default, {
123
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
149
124
  value: cellValue,
150
125
  data: column.data,
151
126
  containerClassName: containerClassName
152
127
  }));
153
128
  }
154
- case _constants.CellType.DATE:
129
+ case _dtableUtils.CellType.DATE:
155
130
  {
156
131
  return /*#__PURE__*/_react.default.createElement("div", {
157
132
  className: "form-control d-flex align-items-center",
158
133
  style: {
159
134
  width: 320
160
135
  }
161
- }, /*#__PURE__*/_react.default.createElement(_DateFormatter.default, {
136
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
162
137
  value: cellValue,
163
138
  format: column.data.format,
164
139
  containerClassName: containerClassName
165
140
  }));
166
141
  }
167
- case _constants.CellType.CTIME:
142
+ case _dtableUtils.CellType.CTIME:
168
143
  {
169
144
  return /*#__PURE__*/_react.default.createElement("div", {
170
145
  className: "form-control d-flex align-items-center ctime-formatter-container",
171
146
  style: {
172
147
  width: 320
173
148
  }
174
- }, /*#__PURE__*/_react.default.createElement(_CTimeFormatter.default, {
175
- value: row._ctime,
149
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
150
+ value: cellValue,
176
151
  containerClassName: containerClassName
177
152
  }));
178
153
  }
179
- case _constants.CellType.MTIME:
154
+ case _dtableUtils.CellType.MTIME:
180
155
  {
181
156
  return /*#__PURE__*/_react.default.createElement("div", {
182
157
  className: "form-control d-flex align-items-center mtime-formatter-container",
183
158
  style: {
184
159
  width: 320
185
160
  }
186
- }, /*#__PURE__*/_react.default.createElement(_MTimeFormatter.default, {
187
- value: row._mtime,
161
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
162
+ value: cellValue,
188
163
  containerClassName: containerClassName
189
164
  }));
190
165
  }
191
- case _constants.CellType.MULTIPLE_SELECT:
166
+ case _dtableUtils.CellType.MULTIPLE_SELECT:
192
167
  {
193
- const options = column.data ? column.data.options : [];
168
+ var _column, _column$data;
169
+ const options = ((_column = column) === null || _column === void 0 ? void 0 : (_column$data = _column.data) === null || _column$data === void 0 ? void 0 : _column$data.options) || [];
194
170
  return /*#__PURE__*/_react.default.createElement("div", {
195
171
  className: "form-control d-flex align-items-center w-100 h-auto"
196
- }, /*#__PURE__*/_react.default.createElement(_MultipleSelectFormatter.default, {
172
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
197
173
  value: cellValue,
198
174
  options: options,
199
175
  containerClassName: containerClassName
200
176
  }));
201
177
  }
202
- case _constants.CellType.SINGLE_SELECT:
178
+ case _dtableUtils.CellType.SINGLE_SELECT:
203
179
  {
204
- const options = column.data ? column.data.options : [];
180
+ var _column2, _column2$data;
181
+ const options = ((_column2 = column) === null || _column2 === void 0 ? void 0 : (_column2$data = _column2.data) === null || _column2$data === void 0 ? void 0 : _column2$data.options) || [];
205
182
  return /*#__PURE__*/_react.default.createElement("div", {
206
183
  className: "form-control d-flex align-items-center w-100"
207
- }, /*#__PURE__*/_react.default.createElement(_SingleSelectFormatter.default, {
184
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
208
185
  value: cellValue,
209
186
  options: options,
210
187
  containerClassName: containerClassName
211
188
  }));
212
189
  }
213
- case _constants.CellType.FILE:
190
+ case _dtableUtils.CellType.FILE:
214
191
  {
215
- return /*#__PURE__*/_react.default.createElement(_RowExpandFileFormatter.default, {
192
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
216
193
  value: cellValue,
217
194
  column: column,
218
195
  downloadFile: this.props.downloadFile,
219
- deleteFile: this.props.deleteFile
196
+ deleteFile: this.props.deleteFile,
197
+ config: this.props.config
220
198
  });
221
199
  }
222
- case _constants.CellType.IMAGE:
200
+ case _dtableUtils.CellType.IMAGE:
223
201
  {
224
- return /*#__PURE__*/_react.default.createElement(_RowExpandImageFormatter.default, {
202
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
225
203
  value: cellValue,
226
204
  column: column,
227
205
  downloadImage: this.props.downloadImage,
228
206
  deleteFile: this.props.deleteFile,
229
- onRotateImage: this.props.onRotateImage
207
+ onRotateImage: this.props.onRotateImage,
208
+ config: this.props.config
230
209
  });
231
210
  }
232
- case _constants.CellType.CHECKBOX:
211
+ case _dtableUtils.CellType.CHECKBOX:
233
212
  {
234
- var _column$data;
213
+ var _column$data2;
235
214
  return /*#__PURE__*/_react.default.createElement("div", {
236
215
  className: "checkbox-formatter-container"
237
- }, /*#__PURE__*/_react.default.createElement(_CheckboxFormatter.default, {
216
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
238
217
  value: cellValue,
239
- checkboxStyle: ((_column$data = column.data) === null || _column$data === void 0 ? void 0 : _column$data.checkbox_style) || {}
218
+ checkboxStyle: ((_column$data2 = column.data) === null || _column$data2 === void 0 ? void 0 : _column$data2.checkbox_style) || {}
240
219
  }));
241
220
  }
242
- case _constants.CellType.CREATOR:
243
- {
244
- return /*#__PURE__*/_react.default.createElement(_CreatorFormatter.default, {
245
- collaborators: collaborators,
246
- value: cellValue,
247
- containerClassName: containerClassName
248
- });
249
- }
250
- case _constants.CellType.LAST_MODIFIER:
221
+ case _dtableUtils.CellType.CREATOR:
222
+ case _dtableUtils.CellType.LAST_MODIFIER:
251
223
  {
252
- return /*#__PURE__*/_react.default.createElement(_LastModifierFormatter.default, {
224
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
253
225
  collaborators: collaborators,
254
226
  value: cellValue,
255
227
  containerClassName: containerClassName
256
228
  });
257
229
  }
258
- case _constants.CellType.FORMULA:
259
- case _constants.CellType.LINK_FORMULA:
230
+ case _dtableUtils.CellType.FORMULA:
231
+ case _dtableUtils.CellType.LINK_FORMULA:
260
232
  {
261
- return /*#__PURE__*/_react.default.createElement(_RowExpandFormulaFormatter.default, {
233
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
262
234
  value: cellValue,
263
235
  column: column,
264
236
  collaborators: collaborators,
265
237
  containerClassName: containerClassName
266
238
  });
267
239
  }
268
- case _constants.CellType.LINK:
240
+ case _dtableUtils.CellType.LINK:
269
241
  {
270
242
  // handle link column do not have column.data.display_column
271
243
  const {
@@ -283,106 +255,117 @@ class EditorFormatter extends _react.default.Component {
283
255
  ...data,
284
256
  display_column: {
285
257
  key: display_column_key || '0000',
286
- type: array_type || _constants.CellType.TEXT,
258
+ type: array_type || _dtableUtils.CellType.TEXT,
287
259
  data: array_data || null
288
260
  }
289
261
  }
290
262
  };
291
263
  }
292
- return /*#__PURE__*/_react.default.createElement(_RowExpandLinkFormatter.default, {
264
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
293
265
  value: cellValue,
294
266
  column: column,
295
267
  collaborators: collaborators,
296
268
  containerClassName: containerClassName,
297
- renderEmpty: this.renderEmpty
269
+ renderEmpty: () => null
298
270
  });
299
271
  }
300
- case _constants.CellType.AUTO_NUMBER:
272
+ case _dtableUtils.CellType.AUTO_NUMBER:
301
273
  {
302
- return /*#__PURE__*/_react.default.createElement(_AutoNumberFormatter.default, {
274
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
303
275
  value: cellValue,
304
276
  containerClassName: containerClassName
305
277
  });
306
278
  }
307
- case _constants.CellType.URL:
279
+ case _dtableUtils.CellType.URL:
308
280
  {
309
281
  return /*#__PURE__*/_react.default.createElement("div", {
310
282
  className: "form-control d-flex align-items-center w-100"
311
- }, /*#__PURE__*/_react.default.createElement(_RowExpandUrlFormatter.default, {
283
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
312
284
  value: cellValue,
313
285
  containerClassName: containerClassName
314
286
  }));
315
287
  }
316
- case _constants.CellType.EMAIL:
288
+ case _dtableUtils.CellType.EMAIL:
317
289
  {
318
290
  return /*#__PURE__*/_react.default.createElement("div", {
319
291
  className: "form-control d-flex align-items-center w-100"
320
- }, /*#__PURE__*/_react.default.createElement(_RowExpandEmailFormatter.default, {
292
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
321
293
  value: cellValue,
322
294
  containerClassName: containerClassName
323
295
  }));
324
296
  }
325
- case _constants.CellType.DURATION:
297
+ case _dtableUtils.CellType.DURATION:
326
298
  {
327
299
  return /*#__PURE__*/_react.default.createElement("div", {
328
300
  className: "form-control d-flex align-items-center",
329
301
  style: {
330
302
  width: 320
331
303
  }
332
- }, /*#__PURE__*/_react.default.createElement(_DurationFormatter.default, {
304
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
333
305
  value: cellValue,
334
306
  format: column.data.duration_format,
335
307
  containerClassName: containerClassName
336
308
  }));
337
309
  }
338
- case _constants.CellType.RATE:
310
+ case _dtableUtils.CellType.RATE:
339
311
  {
340
312
  return /*#__PURE__*/_react.default.createElement("div", {
341
313
  className: "form-control d-flex align-items-center",
342
314
  style: {
343
315
  width: 320
344
316
  }
345
- }, /*#__PURE__*/_react.default.createElement(_RowExpandRateFormatter.default, {
317
+ }, /*#__PURE__*/_react.default.createElement(Formatter, {
346
318
  value: cellValue,
347
319
  data: column.data,
348
320
  containerClassName: containerClassName
349
321
  }));
350
322
  }
351
- case _constants.CellType.BUTTON:
323
+ case _dtableUtils.CellType.BUTTON:
352
324
  {
353
- return /*#__PURE__*/_react.default.createElement(_ButtonFormatter.default, {
325
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
354
326
  data: column.data,
355
327
  containerClassName: containerClassName,
356
328
  onClickButton: this.props.onClickButton
357
329
  });
358
330
  }
359
- case _constants.CellType.DIGITAL_SIGN:
331
+ case _dtableUtils.CellType.DIGITAL_SIGN:
360
332
  {
361
- return /*#__PURE__*/_react.default.createElement(_DigitalSignFormatter.default, {
333
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
362
334
  value: cellValue,
363
335
  containerClassName: containerClassName,
364
336
  config: this.props.config
365
337
  });
366
338
  }
367
- case _constants.CellType.DEPARTMENT_SINGLE_SELECT:
339
+ case _dtableUtils.CellType.DEPARTMENT_SINGLE_SELECT:
368
340
  {
369
- return /*#__PURE__*/_react.default.createElement(_DepartmentSingleSelectFormatter.default, {
341
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
370
342
  value: cellValue,
371
343
  departments: this.props.departments
372
344
  });
373
345
  }
374
346
  default:
375
- return null;
347
+ {
348
+ return /*#__PURE__*/_react.default.createElement(Formatter, {
349
+ value: cellValue,
350
+ containerClassName: containerClassName,
351
+ config: this.props.config
352
+ });
353
+ }
376
354
  }
377
355
  };
378
356
  this.state = {
379
- collaborators: this.getCollaborator()
357
+ collaborators: this.getCollaborators()
358
+ };
359
+ this.component = {
360
+ ..._constants.DEFAULT_FORMATTER,
361
+ ...this.props.component
380
362
  };
381
363
  }
382
364
  componentDidMount() {
383
365
  this.calculateCollaboratorData(this.props);
384
- if (this.props.eventBus) {
385
- this.unsubscribeCollaboratorsUpdated = this.props.eventBus.subscribe('collaborators-updated', this.updateCollaborators);
366
+ const eventBus = this.props.eventBus;
367
+ if (eventBus) {
368
+ this.unsubscribeCollaboratorsUpdated = eventBus.subscribe('collaborators-updated', this.updateCollaborators);
386
369
  }
387
370
  }
388
371
  UNSAFE_componentWillReceiveProps(nextProps) {
@@ -398,13 +381,12 @@ class EditorFormatter extends _react.default.Component {
398
381
  className
399
382
  } = this.props;
400
383
  return /*#__PURE__*/_react.default.createElement("div", {
401
- className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter', {
402
- [className]: className
403
- })
384
+ className: (0, _classnames.default)('dtable-ui dtable-row-expand-formatter', className)
404
385
  }, this.renderFormatter());
405
386
  }
406
387
  }
407
- exports.default = EditorFormatter;
408
- EditorFormatter.defaultProps = {
409
- className: ''
410
- };
388
+ RowExpandFormatter.defaultProps = {
389
+ className: '',
390
+ valueKey: 'name'
391
+ };
392
+ var _default = exports.default = RowExpandFormatter;