dtable-ui-component 6.0.3 → 6.0.4

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 (262) 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/DTableColorPicker/index.css +1 -1
  36. package/lib/DTableCustomizeSelect/index.js +2 -2
  37. package/lib/DTableFiltersPopover/utils/index.js +1 -7
  38. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
  39. package/lib/DTableGroupSelect/index.js +3 -3
  40. package/lib/DTableSelect/index.js +3 -1
  41. package/lib/DateEditor/index.js +14 -51
  42. package/lib/DateEditor/pc-date-editor-popover.js +149 -12
  43. package/lib/{common/delete-tip.js → DeleteTip/index.js} +12 -16
  44. package/lib/Department-editor/department-single-select.js +1 -1
  45. package/lib/Department-editor/index.js +3 -4
  46. package/lib/DepartmentSingleSelectFormatter/index.js +3 -2
  47. package/lib/DigitalSignEditor/constants.js +7 -0
  48. package/lib/DigitalSignEditor/index.css +69 -0
  49. package/lib/DigitalSignEditor/index.js +182 -0
  50. package/lib/DigitalSignEditor/service.js +39 -0
  51. package/lib/DigitalSignEditor/signature-board/index.css +35 -0
  52. package/lib/DigitalSignEditor/signature-board/index.js +135 -0
  53. package/lib/DigitalSignEditor/signature-board/signature-tool.js +396 -0
  54. package/lib/DigitalSignEditor/utils.js +29 -0
  55. package/lib/DurationEditor/index.js +110 -0
  56. package/lib/EmailEditor/index.js +58 -0
  57. package/lib/FileEditor/addition-previewer/index.css +1 -0
  58. package/lib/FileEditor/addition-previewer/index.js +52 -0
  59. package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
  60. package/lib/FileEditor/addition-previewer/local-file-addition/index.js +252 -0
  61. package/lib/FileEditor/constants.js +7 -0
  62. package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +74 -0
  63. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +5 -0
  64. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +77 -0
  65. package/lib/FileEditor/files-previewer/file-previewer/index.css +88 -0
  66. package/lib/FileEditor/files-previewer/file-previewer/index.js +167 -0
  67. package/lib/FileEditor/files-previewer/index.css +56 -0
  68. package/lib/FileEditor/files-previewer/index.js +277 -0
  69. package/lib/FileEditor/index.css +6 -0
  70. package/lib/FileEditor/index.js +258 -11
  71. package/lib/FileEditor/utils.js +22 -0
  72. package/lib/FileItemFormatter/index.js +19 -20
  73. package/lib/FileUploader/index.css +9 -0
  74. package/lib/FileUploader/index.js +268 -14
  75. package/lib/FormulaFormatter/cell-value-validator.js +17 -17
  76. package/lib/FormulaFormatter/index.js +2 -1
  77. package/lib/FormulaFormatter/utils.js +0 -31
  78. package/lib/GeolocationEditor/country-editor.js +319 -0
  79. package/lib/GeolocationEditor/index.css +641 -0
  80. package/lib/GeolocationEditor/index.js +240 -0
  81. package/lib/GeolocationEditor/location-editor.js +368 -0
  82. package/lib/GeolocationEditor/map-editor/index.js +456 -0
  83. package/lib/GeolocationEditor/map-editor/large-editor/index.css +137 -0
  84. package/lib/GeolocationEditor/map-editor/large-editor/index.js +461 -0
  85. package/lib/GeolocationEditor/map-editor-utils.js +153 -0
  86. package/lib/GeolocationEditor/map-selection-editor/index.js +455 -0
  87. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +1 -0
  88. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +447 -0
  89. package/lib/GeolocationEditor/parse-geolocation.js +282 -0
  90. package/lib/GeolocationEditor/province-city-editor.js +292 -0
  91. package/lib/GeolocationEditor/province-editor.js +226 -0
  92. package/lib/GeolocationEditor/selector-header-item.js +28 -0
  93. package/lib/GeolocationEditor/selector-list.js +33 -0
  94. package/lib/ImageEditor/addition-previewer/image-link/index.css +45 -0
  95. package/lib/ImageEditor/addition-previewer/image-link/index.js +73 -0
  96. package/lib/ImageEditor/addition-previewer/index.css +106 -0
  97. package/lib/ImageEditor/addition-previewer/index.js +63 -0
  98. package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +125 -0
  99. package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +254 -0
  100. package/lib/ImageEditor/constants.js +7 -0
  101. package/lib/ImageEditor/images-previewer/image-preview/index.css +59 -0
  102. package/lib/ImageEditor/images-previewer/image-preview/index.js +155 -0
  103. package/lib/ImageEditor/images-previewer/index.css +18 -0
  104. package/lib/ImageEditor/images-previewer/index.js +140 -0
  105. package/lib/ImageEditor/index.css +24 -0
  106. package/lib/ImageEditor/index.js +194 -0
  107. package/lib/ImageFormatter/images-lazy-load.js +4 -2
  108. package/lib/ImageFormatter/index.js +8 -3
  109. package/lib/ImageThumbnail/index.css +20 -0
  110. package/lib/ImageThumbnail/index.js +137 -0
  111. package/lib/LinkEditor/index.js +2 -3
  112. package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
  113. package/lib/MultipleSelectEditor/index.js +16 -177
  114. package/lib/NumberEditor/index.js +63 -77
  115. package/lib/RoleStatusEditor/index.css +0 -2
  116. package/lib/RowExpandDialog/body/index.css +21 -0
  117. package/lib/RowExpandDialog/body/index.js +262 -0
  118. package/lib/RowExpandDialog/column-content/index.css +48 -0
  119. package/lib/RowExpandDialog/column-content/index.js +50 -0
  120. package/lib/RowExpandDialog/header/index.css +31 -0
  121. package/lib/RowExpandDialog/header/index.js +55 -0
  122. package/lib/RowExpandDialog/index.css +28 -0
  123. package/lib/RowExpandDialog/index.js +237 -0
  124. package/lib/RowExpandEditor/RowExpandAddBtn/index.css +22 -0
  125. package/lib/RowExpandEditor/RowExpandAddBtn/index.js +24 -0
  126. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +18 -0
  127. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +43 -0
  128. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +5 -0
  129. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +232 -0
  130. package/lib/RowExpandEditor/RowExpandDateEditor/index.js +130 -0
  131. package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +104 -0
  132. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +13 -0
  133. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +208 -0
  134. package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +105 -0
  135. package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
  136. package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +125 -0
  137. package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
  138. package/lib/RowExpandEditor/RowExpandFileEditor/index.js +148 -0
  139. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +17 -0
  140. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +165 -0
  141. package/lib/RowExpandEditor/RowExpandImageEditor/index.css +11 -0
  142. package/lib/RowExpandEditor/RowExpandImageEditor/index.js +170 -0
  143. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +6 -0
  144. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +123 -0
  145. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +44 -0
  146. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +247 -0
  147. package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +105 -0
  148. package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
  149. package/lib/RowExpandEditor/RowExpandRateEditor/index.js +152 -0
  150. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +58 -0
  151. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +206 -0
  152. package/lib/RowExpandEditor/RowExpandTextEditor/index.css +4 -0
  153. package/lib/RowExpandEditor/RowExpandTextEditor/index.js +127 -0
  154. package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +31 -0
  155. package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +130 -0
  156. package/lib/RowExpandEditor/constants.js +44 -0
  157. package/lib/RowExpandEditor/index.css +0 -0
  158. package/lib/RowExpandEditor/index.js +32 -0
  159. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +27 -0
  160. package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.css +1 -1
  161. package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.js +1 -1
  162. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.css +6 -6
  163. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.js +3 -1
  164. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/row-expand-file-item-formatter.js +12 -13
  165. package/lib/{RowExpandFormulaFormatter → RowExpandFormatter/RowExpandFormulaFormatter}/index.js +11 -10
  166. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.css +6 -6
  167. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.js +1 -1
  168. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/row-expand-image-item-formatter.js +5 -5
  169. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
  170. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.css +2 -2
  171. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.js +20 -20
  172. package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.css +1 -1
  173. package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +1 -0
  174. package/lib/{RowExpandUrlFormatter → RowExpandFormatter/RowExpandUrlFormatter}/index.js +4 -3
  175. package/lib/RowExpandFormatter/constants.js +61 -0
  176. package/lib/RowExpandFormatter/index.css +28 -3
  177. package/lib/RowExpandFormatter/index.js +113 -131
  178. package/lib/SimpleLongTextFormatter/widgets/longTextEditor.css +2 -2
  179. package/lib/SingleSelectEditor/index.js +16 -156
  180. package/lib/SvgIcon/index.css +11 -0
  181. package/lib/SvgIcon/index.js +29 -0
  182. package/lib/TextEditor/index.js +112 -42
  183. package/lib/UploadProgress/index.js +38 -0
  184. package/lib/UrlEditor/index.js +61 -0
  185. package/lib/common/editor-base.js +52 -0
  186. package/lib/constants/file.js +96 -0
  187. package/lib/constants/index.js +27 -15
  188. package/lib/constants/key-codes.js +109 -0
  189. package/lib/css/cell-editor.css +18 -2
  190. package/lib/formatterConfig/base-formatter-config.js +23 -23
  191. package/lib/formatterConfig/index.js +3 -3
  192. package/lib/hooks/index.js +16 -0
  193. package/lib/index.js +81 -46
  194. package/lib/lang/index.js +19 -16
  195. package/lib/locales/de.json +167 -0
  196. package/lib/locales/en.json +167 -0
  197. package/lib/locales/es.json +167 -0
  198. package/lib/locales/fr.json +167 -0
  199. package/lib/locales/pt.json +167 -0
  200. package/lib/locales/ru.json +167 -0
  201. package/lib/locales/zh-CN.json +167 -0
  202. package/lib/select-editor/index.js +6 -6
  203. package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.js +3 -3
  204. package/lib/select-editor/pc-select-editor/index.css +85 -0
  205. package/lib/select-editor/pc-select-editor/index.js +295 -0
  206. package/lib/toaster/toast.js +19 -15
  207. package/lib/utils/cell-comparer.js +35 -0
  208. package/lib/utils/cell.js +55 -0
  209. package/lib/utils/column-utils.js +25 -0
  210. package/lib/utils/editor-utils.js +1 -6
  211. package/lib/utils/get-event-transfer.js +75 -0
  212. package/lib/utils/hotkey.js +37 -0
  213. package/lib/utils/object-utils.js +61 -0
  214. package/lib/utils/url.js +127 -8
  215. package/lib/utils/utils.js +119 -2
  216. package/package.json +3 -2
  217. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +0 -97
  218. package/lib/FileEditor/pc-files-addition/index.js +0 -1
  219. package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
  220. package/lib/FileEditor/pc-files-preview/index.js +0 -1
  221. package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
  222. package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
  223. package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
  224. package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
  225. package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
  226. package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
  227. package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
  228. package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
  229. package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
  230. package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
  231. package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
  232. package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
  233. package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
  234. package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
  235. package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
  236. package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
  237. package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
  238. package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
  239. package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
  240. package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
  241. package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
  242. package/lib/FileItemFormatter/utils.js +0 -99
  243. package/lib/MultipleSelectEditor/index.css +0 -9
  244. package/lib/RowExpandLinkFormatter/utils.js +0 -71
  245. package/lib/RowExpandUrlFormatter/index.css +0 -1
  246. package/lib/SingleSelectEditor/index.css +0 -14
  247. package/lib/common/modal-portal.js +0 -26
  248. package/lib/locals/de.js +0 -103
  249. package/lib/locals/en.js +0 -104
  250. package/lib/locals/es.js +0 -103
  251. package/lib/locals/fr.js +0 -103
  252. package/lib/locals/pt.js +0 -103
  253. package/lib/locals/ru.js +0 -103
  254. package/lib/locals/zh-CN.js +0 -104
  255. package/lib/select-editor/pc-select-editor-popover/index.css +0 -71
  256. package/lib/select-editor/pc-select-editor-popover/index.js +0 -122
  257. /package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.css +0 -0
  258. /package/lib/CollaboratorEditor/{pc-collaborator-editor-popover → pc-collaborator-editor}/index.css +0 -0
  259. /package/lib/{common/delete-tip.css → DeleteTip/index.css} +0 -0
  260. /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/value-display-utils.js +0 -0
  261. /package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.js +0 -0
  262. /package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.css +0 -0
@@ -0,0 +1,95 @@
1
+ .dtable-ui-comments .dtable-ui-comments-body .dtable-ui-comments-empty {
2
+ padding: 1em;
3
+ text-align: center;
4
+ list-style: none;
5
+ color: #666;
6
+ }
7
+
8
+
9
+ .dtable-ui-comments .dtable-ui-comment-container {
10
+ padding: 10px 0;
11
+ margin-bottom: 0;
12
+ }
13
+
14
+ .dtable-ui-comment-container .dtable-ui-comment-info {
15
+ padding-bottom: 0.5em;
16
+ width: 100%;
17
+ height: 3em;
18
+ display: flex;
19
+ justify-content: flex-start;
20
+ }
21
+
22
+ .dtable-ui-comment-container .dtable-ui-comment-info .reviewer-info {
23
+ padding-left: 10px;
24
+ flex: 1;
25
+ padding-right: 10px;
26
+ overflow: hidden;
27
+ }
28
+
29
+ .dtable-ui-comment-container .dtable-ui-comment-info .reviewer-name {
30
+ font-size: 14px;
31
+ font-weight: 500;
32
+ overflow: hidden;
33
+ white-space: nowrap;
34
+ text-overflow: ellipsis;
35
+ }
36
+
37
+ .dtable-ui-comment-container .dtable-ui-comment-info .review-time {
38
+ font-size: 12px;
39
+ color: #666;
40
+ }
41
+
42
+ .dtable-ui-comment-container .dtable-ui-comment-info .dtable-ui-comments-dropdown {
43
+ margin-left: auto;
44
+ }
45
+
46
+ .dtable-ui-comment-container .dtable-ui-comment-info .dtable-ui-comments-dropdown button {
47
+ border: none;
48
+ box-shadow: none;
49
+ }
50
+
51
+ .dtable-ui-comment-container .dtable-ui-comment-info .dtable-ui-comments-dropdown button span {
52
+ font-size: 14px;
53
+ }
54
+
55
+ .dtable-ui-comment-container .dtable-ui-comment-info .dtable-ui-comments-dropdown .dtable-ui-comments-dropdown-btn {
56
+ color: #999;
57
+ background-color: transparent;
58
+ }
59
+
60
+ .dtable-ui-comment-container .dtable-ui-comment-info .dtable-ui-comments-dropdown:hover .dtable-ui-comments-dropdown-btn {
61
+ color: #555;
62
+ }
63
+
64
+ .dtable-ui-comment-container .dtable-ui-comment-content {
65
+ margin-left: 42px;
66
+ }
67
+
68
+ .dtable-ui-comment-container .dtable-ui-comment-content .dtable-ui-comment-content-container {
69
+ padding: 5px 10px;
70
+ border-radius: 4px;
71
+ display: inline-block;
72
+ background: #fff;
73
+ max-width: 100%;
74
+ word-wrap: break-word;
75
+ margin: 0;
76
+ font-size: 14px;
77
+ }
78
+
79
+ .dtable-ui-comment-container .dtable-ui-comment-content img {
80
+ cursor: pointer;
81
+ display: block;
82
+ }
83
+
84
+ .dtable-ui-comment-container .dtable-ui-comment-content p {
85
+ margin-bottom: 0;
86
+ letter-spacing: 1px;
87
+ }
88
+
89
+ .dtable-ui-comment-container-resolved .dtable-ui-comment-content .dtable-ui-comment-content-container {
90
+ background-color: #e6ffed;
91
+ }
92
+
93
+ .dtable-ui-comment-dropdown-list {
94
+ min-width: 8rem;
95
+ }
@@ -0,0 +1,32 @@
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 _lang = require("../../lang");
10
+ var _comment = _interopRequireDefault(require("./comment"));
11
+ require("./index.css");
12
+ const Body = _ref => {
13
+ let {
14
+ comments,
15
+ isFirstLoading,
16
+ ...props
17
+ } = _ref;
18
+ if (comments.length === 0) {
19
+ return /*#__PURE__*/_react.default.createElement("div", {
20
+ className: "dtable-ui-comments-empty"
21
+ }, (0, _lang.getLocale)('No_comment_yet'));
22
+ }
23
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, comments.map((comment, index) => {
24
+ return /*#__PURE__*/_react.default.createElement(_comment.default, Object.assign({
25
+ key: comment.id
26
+ }, props, {
27
+ comment: comment,
28
+ isScrollBottom: index === comments.length - 1 && isFirstLoading
29
+ }));
30
+ }));
31
+ };
32
+ var _default = exports.default = Body;
@@ -0,0 +1,40 @@
1
+ .dtable-ui-comment-input-btns {
2
+ padding: 5px;
3
+ border: 1px solid #e6e6dd;
4
+ border-top: none;
5
+ background: #fff;
6
+ border-radius: 0 0 5px 5px;
7
+ }
8
+
9
+ .dtable-ui-comment-input-btns .dtable-ui-comment-input-btns-container {
10
+ border-top: 1px solid #e6e6dd;
11
+ }
12
+
13
+ .dtable-ui-comment-input-btns .dtable-ui-comment-input-btns-container .dtable-ui-comment-input-btns-content {
14
+ display: flex;
15
+ align-items: center;
16
+ padding-left: 10px;
17
+ }
18
+
19
+ .dtable-ui-comment-input-btns .dtable-ui-comment-input-btns-container .dtable-ui-comment-collaborator-tip {
20
+ cursor: pointer;
21
+ position: relative;
22
+ margin-left: 10px;
23
+ color: #666;
24
+ }
25
+
26
+ .dtable-ui-comment-input-btns .dtable-ui-comment-input-btns-container .dtable-ui-comment-image-upload:hover,
27
+ .dtable-ui-comment-input-btns .dtable-ui-comment-input-btns-container .dtable-ui-comment-collaborator-tip:hover {
28
+ color: #FF8000;
29
+ }
30
+
31
+ .dtable-ui-comment-input-btns .dtable-ui-comment-input-btns-container .dtable-ui-comment-image-upload {
32
+ margin-top: 3px;
33
+ font-size: 15px;
34
+ color: #666;
35
+ cursor: pointer;
36
+ }
37
+
38
+ .dtable-ui-comment-input-btns .dtable-ui-comment-input-btns-container .dtable-ui-comment-image-upload .dtable-icon-picture-linear {
39
+ font-size: 15px;
40
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _reactstrap = require("reactstrap");
11
+ var _FileUploader = _interopRequireDefault(require("../../../FileUploader"));
12
+ var _DTablePopover = _interopRequireDefault(require("../../../DTablePopover"));
13
+ var _Loading = _interopRequireDefault(require("../../../Loading"));
14
+ var _lang = require("../../../lang");
15
+ require("./index.css");
16
+ class Btns extends _react.default.Component {
17
+ constructor(props) {
18
+ super(props);
19
+ this.onHideCollaboratorTip = () => {
20
+ this.setState({
21
+ isShowPopover: false
22
+ });
23
+ };
24
+ this.onHandleCollaboratorTip = event => {
25
+ event.nativeEvent.stopImmediatePropagation();
26
+ this.setState({
27
+ isShowPopover: !this.state.isShowPopover
28
+ });
29
+ };
30
+ this.onChangeInputValue = participant => {
31
+ this.props.onInsertElement(participant, 'collaborator');
32
+ this.props.addParticipant(participant.email);
33
+ this.onHideCollaboratorTip();
34
+ };
35
+ this.onSubmit = () => {
36
+ this.props.onSubmit();
37
+ };
38
+ this.onFileUploadSuccess = uploadFileMessage => {
39
+ this.props.onInsertElement(uploadFileMessage.url, 'image');
40
+ };
41
+ this.getCollaboratorContent = () => {
42
+ const {
43
+ collaborators
44
+ } = this.props;
45
+ return /*#__PURE__*/_react.default.createElement("div", {
46
+ className: "comment-popover-list"
47
+ }, collaborators.map(participant => {
48
+ return /*#__PURE__*/_react.default.createElement("div", {
49
+ key: participant.email,
50
+ className: "comment-participant-item",
51
+ onClick: this.onChangeInputValue.bind(this, participant)
52
+ }, /*#__PURE__*/_react.default.createElement("div", {
53
+ className: "comment-participant-container"
54
+ }, /*#__PURE__*/_react.default.createElement("div", {
55
+ className: "comment-participant text-truncate"
56
+ }, /*#__PURE__*/_react.default.createElement("img", {
57
+ className: "comment-dtable-ui-participant-avatar ml-2",
58
+ alt: participant.name,
59
+ src: participant.avatar_url
60
+ }), /*#__PURE__*/_react.default.createElement("span", {
61
+ className: "comment-participant-name text-truncate"
62
+ }, participant.name))));
63
+ }));
64
+ };
65
+ this.state = {
66
+ isShowPopover: false
67
+ };
68
+ }
69
+ shouldComponentUpdate(nextProps, nextState) {
70
+ return nextProps.isAdding !== this.props.isAdding || nextState.isShowPopover !== this.state.isShowPopover;
71
+ }
72
+ render() {
73
+ const {
74
+ isAdding,
75
+ canUpdateParticipants
76
+ } = this.props;
77
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
78
+ className: "dtable-ui-comment-input-btns"
79
+ }, /*#__PURE__*/_react.default.createElement("div", {
80
+ className: "d-flex justify-content-between dtable-ui-comment-input-btns-container"
81
+ }, /*#__PURE__*/_react.default.createElement("div", {
82
+ className: "dtable-ui-comment-input-btns-content",
83
+ ref: ref => this.toolRef = ref
84
+ }, /*#__PURE__*/_react.default.createElement(_FileUploader.default, {
85
+ uploadType: "image",
86
+ className: "dtable-ui-comment-image-upload",
87
+ onFileUploadSuccess: this.onFileUploadSuccess,
88
+ uploadFile: this.props.uploadFile
89
+ }, /*#__PURE__*/_react.default.createElement("span", {
90
+ "aria-hidden": "true",
91
+ className: "dtable-font dtable-icon-picture-linear"
92
+ })), canUpdateParticipants && /*#__PURE__*/_react.default.createElement("span", {
93
+ className: "dtable-ui-comment-collaborator-tip",
94
+ onClick: this.onHandleCollaboratorTip
95
+ }, "@")), isAdding ? /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
96
+ className: "dtable-ui-comment-submit",
97
+ color: "primary",
98
+ size: "sm",
99
+ disabled: true
100
+ }, /*#__PURE__*/_react.default.createElement(_Loading.default, null)) : /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
101
+ className: "dtable-ui-comment-submit",
102
+ color: "primary",
103
+ size: "sm",
104
+ onClick: this.onSubmit,
105
+ tabIndex: -1
106
+ }, (0, _lang.getLocale)('Submit')))), this.state.isShowPopover && /*#__PURE__*/_react.default.createElement(_DTablePopover.default, {
107
+ target: this.toolRef,
108
+ hideDTablePopover: this.onHideCollaboratorTip,
109
+ hideDTablePopoverWithEsc: this.onHideCollaboratorTip
110
+ }, this.getCollaboratorContent()));
111
+ }
112
+ }
113
+ var _default = exports.default = Btns;
@@ -0,0 +1,157 @@
1
+ .dtable-ui-comments .dtable-ui-comments-footer {
2
+ padding: 5px 10px;
3
+ border-top: 1px solid #e5e5e5;
4
+ display: flex;
5
+ flex-direction: column;
6
+ min-height: 185px;
7
+ border-bottom-right-radius: 3px;
8
+ }
9
+
10
+
11
+
12
+
13
+ .dtable-ui-comments .dtable-ui-comment-input:focus {
14
+ outline: none;
15
+ }
16
+
17
+ .dtable-ui-comments textarea:focus {
18
+ outline: none;
19
+ }
20
+
21
+ .dtable-ui-comments-title {
22
+ border-bottom: 1px solid #e5e5e5;
23
+ min-height: 3em;
24
+ line-height: 3em;
25
+ padding: 0 1em;
26
+ display: flex;
27
+ background-color: #fafaf9;
28
+ }
29
+
30
+ .dtable-ui-comments-title .dtable-ui-comments-title-text {
31
+ width: 100%;
32
+ text-align: center;
33
+ font-weight: 700;
34
+ }
35
+
36
+ .dtable-ui-comments-title .dtable-ui-comments-title-close {
37
+ color: #b9b9b9;
38
+ }
39
+
40
+ .dtable-ui-comments-title .dtable-ui-comments-title-close:hover {
41
+ color: #888;
42
+ }
43
+
44
+ .dtable-ui-comments-toggle-resolved {
45
+ margin-top: 45px;
46
+ border-bottom: 1px solid #e5e5e5;
47
+ padding: 5px 10px;
48
+ display: flex;
49
+ position: absolute;
50
+ background-color: #fff;
51
+ justify-content: space-between;
52
+ width: 29%;
53
+ }
54
+
55
+
56
+ @media (max-width: 768px) {
57
+ .dtable-ui-comments-toggle-resolved {
58
+ width: 100%;
59
+ }
60
+ }
61
+
62
+
63
+
64
+
65
+ .completion-dtable-ui-participant-avatar img {
66
+ border-radius: 50%;
67
+ }
68
+
69
+
70
+
71
+
72
+
73
+ .dtable-ui-comments-footer .dtable-ui-comment-submit {
74
+ margin-top: 5px;
75
+ min-width: 60px;
76
+ width: auto;
77
+ height: 28px;
78
+ }
79
+
80
+
81
+
82
+
83
+
84
+ .comment-header .comment-header-title {
85
+ display: flex;
86
+ justify-content: space-between;
87
+ height: 48px;
88
+ align-items: center;
89
+ font-size: 16px;
90
+ font-weight: 600;
91
+ }
92
+
93
+ .comment-header .comment-header-tool {
94
+ display: flex;
95
+ }
96
+
97
+ .comment-header .comment-header-tool .comment-tool-item {
98
+ padding: 5px 5px 5px 0;
99
+ color: #666;
100
+ cursor: default;
101
+ }
102
+
103
+ .comment-header .comment-header-tool .comment-item-active {
104
+ color: #212529;
105
+ }
106
+
107
+ .comment-header .comment-close {
108
+ width: 24px;
109
+ height: 24px;
110
+ color: #999999;
111
+ font-weight: 700;
112
+ cursor: pointer;
113
+ margin-left: 5px;
114
+ }
115
+
116
+ .comment-header .comment-close:hover {
117
+ color: #555555;
118
+ }
119
+
120
+ .comment-header .comment-close .dtable-icon-x {
121
+ padding: 4px;
122
+ }
123
+
124
+ .comment-popover-list {
125
+ padding: 10px 0;
126
+ max-height: 200px;
127
+ overflow: auto;
128
+ min-width: 150px;
129
+ max-width: 200px;
130
+ }
131
+
132
+ .comment-popover-list .comment-participant-item {
133
+ padding: 5px 0;
134
+ }
135
+
136
+ .comment-popover-list .comment-participant-item:hover {
137
+ background: #f5f5f5;
138
+ cursor: pointer;
139
+ }
140
+
141
+ /* comment @ function*/
142
+
143
+
144
+
145
+ .comment-participant-item .comment-dtable-ui-participant-avatar {
146
+ width: 16px;
147
+ height: 16px;
148
+ line-height: 16px;
149
+ transform: translateY(-1px);
150
+ border-radius: 50%;
151
+ vertical-align: middle;
152
+ }
153
+
154
+ .comment-participant-item .comment-participant-name {
155
+ margin-left: 4px;
156
+ font-size: 14px;
157
+ }
@@ -0,0 +1,169 @@
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 _toaster = _interopRequireDefault(require("../../toaster"));
10
+ var _utils = require("../../utils/utils");
11
+ var _participants = _interopRequireDefault(require("./participants"));
12
+ var _input = _interopRequireDefault(require("./input"));
13
+ var _btns = _interopRequireDefault(require("./btns"));
14
+ require("./index.css");
15
+ class Footer extends _react.default.Component {
16
+ constructor(_props) {
17
+ super(_props);
18
+ this.initParticipants = props => {
19
+ const {
20
+ row,
21
+ collaborators
22
+ } = props;
23
+ if (row._participants && Array.isArray(row._participants)) {
24
+ let rowParticipants = row._participants.filter(Boolean);
25
+ rowParticipants = rowParticipants.filter(participant => {
26
+ const email = typeof participant === 'string' ? participant : participant.email;
27
+ return !!collaborators.find(collaborator => collaborator.email === email);
28
+ });
29
+ this.setState({
30
+ participants: rowParticipants
31
+ });
32
+ return;
33
+ }
34
+ this.setState({
35
+ participants: []
36
+ });
37
+ };
38
+ this.updateParticipants = participantList => {
39
+ this.setState({
40
+ participants: participantList
41
+ }, () => {
42
+ this.props.onChangeParticipants && this.props.onChangeParticipants(participantList);
43
+ });
44
+ };
45
+ this.addParticipant = email => {
46
+ if (!email) return;
47
+ const {
48
+ participants
49
+ } = this.state;
50
+ const {
51
+ collaborators
52
+ } = this.props;
53
+ const isExist = participants.some(participant => participant.email === email);
54
+ if (isExist) return;
55
+ let newParticipantList = participants.slice(0);
56
+ let newParticipant = collaborators.find(collaborator => collaborator.email === email);
57
+ newParticipantList.push(newParticipant);
58
+ this.updateParticipants(newParticipantList);
59
+ };
60
+ this.convertComment = value => {
61
+ let regex = /<[a-zA-Z]+.*?>([\s\S]*?)<\/[a-zA-Z]*?>/g;
62
+ let match;
63
+ let start = 0;
64
+ let newValue = '';
65
+ while ((match = regex.exec(value)) !== null) {
66
+ let notificationName = "".concat(match[1]);
67
+ let substr = value.substring(start, match.index);
68
+ start = regex.lastIndex;
69
+ newValue += substr + notificationName;
70
+ }
71
+ if (start < value.length) {
72
+ newValue += value.slice(start);
73
+ }
74
+ return newValue;
75
+ };
76
+ this.updateAddState = isAdding => {
77
+ this.setState({
78
+ isAdding
79
+ });
80
+ };
81
+ this.handleError = error => {
82
+ let errMsg = (0, _utils.getErrorMsg)(error, true);
83
+ if (!error.response || error.response.status !== 403) {
84
+ _toaster.default.danger(this.props.t(errMsg));
85
+ }
86
+ };
87
+ this.addComment = comment => {
88
+ this.setState({
89
+ isAdding: true
90
+ }, () => {
91
+ this.props.addComment(comment, {
92
+ successCallback: () => {
93
+ this.commentInputRef.setCommentInputValue();
94
+ this.updateAddState(false);
95
+ },
96
+ failCallback: error => {
97
+ this.handleError(error);
98
+ this.updateAddState(false);
99
+ }
100
+ });
101
+ });
102
+ };
103
+ this.onSubmit = () => {
104
+ const commentValue = this.commentInputRef.getCommentInputValue();
105
+ const comment = this.convertComment(commentValue);
106
+ if (!comment.trim()) return;
107
+ this.addComment(comment);
108
+ const {
109
+ username
110
+ } = window.dtable;
111
+ this.addParticipant(username);
112
+ };
113
+ this.onInsertElement = (content, nodeType) => {
114
+ this.commentInputRef.onInsertElement(content, nodeType);
115
+ };
116
+ this.state = {
117
+ isAdding: false,
118
+ participants: []
119
+ };
120
+ this.commentInputRef = null;
121
+ }
122
+ componentDidMount() {
123
+ this.initParticipants(this.props);
124
+ }
125
+ UNSAFE_componentWillReceiveProps(nextProps) {
126
+ var _this$props$row, _nextProps$row;
127
+ if (((_this$props$row = this.props.row) === null || _this$props$row === void 0 ? void 0 : _this$props$row._id) !== ((_nextProps$row = nextProps.row) === null || _nextProps$row === void 0 ? void 0 : _nextProps$row._id)) {
128
+ this.initParticipants(nextProps);
129
+ }
130
+ }
131
+ render() {
132
+ const {
133
+ isAdding,
134
+ participants
135
+ } = this.state;
136
+ const {
137
+ collaborators
138
+ } = this.props;
139
+ const canUpdateParticipants = Boolean(this.props.onChangeParticipants);
140
+ return /*#__PURE__*/_react.default.createElement("div", {
141
+ className: "dtable-ui-comments-footer"
142
+ }, /*#__PURE__*/_react.default.createElement(_participants.default, {
143
+ canUpdate: canUpdateParticipants,
144
+ participants: participants,
145
+ collaborators: collaborators,
146
+ showIconTip: true,
147
+ onChange: this.updateParticipants
148
+ }), /*#__PURE__*/_react.default.createElement(_input.default, {
149
+ ref: ref => this.commentInputRef = ref,
150
+ collaborators: collaborators,
151
+ onSubmit: this.onSubmit,
152
+ uploadFile: this.props.uploadFile,
153
+ addParticipant: this.addParticipant,
154
+ onInputFocus: this.props.onInputFocus,
155
+ onInputBlur: this.props.onInputBlur,
156
+ autoFocusInput: this.props.autoFocusInput,
157
+ canUpdateParticipants: canUpdateParticipants
158
+ }), /*#__PURE__*/_react.default.createElement(_btns.default, {
159
+ isAdding: isAdding,
160
+ canUpdateParticipants: canUpdateParticipants,
161
+ collaborators: collaborators,
162
+ uploadFile: this.props.uploadFile,
163
+ onInsertElement: this.onInsertElement,
164
+ onSubmit: this.onSubmit,
165
+ addParticipant: this.addParticipant
166
+ }));
167
+ }
168
+ }
169
+ var _default = exports.default = Footer;
@@ -0,0 +1,52 @@
1
+ .dtable-ui-comments-footer .dtable-ui-comment-input {
2
+ background-color: #fff;
3
+ height: 90px;
4
+ overflow: auto;
5
+ margin: 0px;
6
+ padding: 9px;
7
+ min-height: 90px;
8
+ border: 1px solid #e6e6dd;
9
+ border-bottom: none;
10
+ border-radius: 5px 5px 0px 0px;
11
+ white-space: pre-wrap;
12
+ overflow-wrap: break-word;
13
+ font-size: 14px;
14
+ }
15
+
16
+ .dtable-ui-comments-footer .dtable-ui-comment-input.dtable-ui-comment-input-archive {
17
+ height: 130px;
18
+ }
19
+
20
+ .dtable-ui-comments-footer .dtable-ui-comment-input:empty::before {
21
+ content: attr(placeholder);
22
+ color: #868E96;
23
+ }
24
+
25
+ .dtable-ui-comments-footer .dtable-ui-comment-input .image-container {
26
+ display: inline-block;
27
+ cursor: pointer;
28
+ }
29
+
30
+ .dtable-ui-comments-footer .dtable-ui-comment-caret-list {
31
+ background: #fff;
32
+ position: absolute;
33
+ padding: 10px 0;
34
+ max-height: 200px;
35
+ overflow: auto;
36
+ min-width: 150px;
37
+ /* higher than row expand */
38
+ z-index: 1049;
39
+ border-radius: 5px;
40
+ border: 1px solid #ededed;
41
+ max-width: 200px;
42
+ }
43
+
44
+ .dtable-ui-comments-footer .dtable-ui-comment-caret-list .comment-participant-item {
45
+ padding: 5px 0;
46
+ }
47
+
48
+ .dtable-ui-comments-footer .dtable-ui-comment-caret-list .comment-participant-item.active,
49
+ .dtable-ui-comments-footer .dtable-ui-comment-caret-list .comment-participant-item:hover {
50
+ background: #f5f5f5;
51
+ cursor: pointer;
52
+ }