dtable-ui-component 5.3.0-alpha1 → 5.3.1-beta

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 (223) hide show
  1. package/lib/CheckboxEditor/index.css +3 -20
  2. package/lib/CheckboxEditor/index.js +98 -35
  3. package/lib/CheckboxFormatter/index.js +6 -9
  4. package/lib/CollaboratorEditor/index.css +12 -35
  5. package/lib/CollaboratorEditor/index.js +18 -212
  6. package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.js +26 -29
  7. package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +257 -0
  8. package/lib/CollaboratorItem/index.css +1 -1
  9. package/lib/CollaboratorItem/index.js +6 -2
  10. package/lib/DTableFiltersPopover/utils/index.js +1 -7
  11. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
  12. package/lib/DTableSelect/index.js +3 -1
  13. package/lib/DateEditor/index.js +14 -51
  14. package/lib/DateEditor/pc-date-editor-popover.js +145 -12
  15. package/lib/DeleteTip/index.js +50 -0
  16. package/lib/Department-editor/department-single-select.js +1 -1
  17. package/lib/Department-editor/index.js +3 -4
  18. package/lib/DepartmentSingleSelectFormatter/index.js +2 -1
  19. package/lib/DigitalSignEditor/constants.js +7 -0
  20. package/lib/DigitalSignEditor/index.css +69 -0
  21. package/lib/DigitalSignEditor/index.js +182 -0
  22. package/lib/DigitalSignEditor/service.js +38 -0
  23. package/lib/DigitalSignEditor/signature-board/index.css +35 -0
  24. package/lib/DigitalSignEditor/signature-board/index.js +135 -0
  25. package/lib/DigitalSignEditor/signature-board/signature-tool.js +396 -0
  26. package/lib/DigitalSignEditor/utils.js +29 -0
  27. package/lib/DurationEditor/index.js +111 -0
  28. package/lib/EmailEditor/index.js +59 -0
  29. package/lib/FileEditor/addition-previewer/index.css +1 -0
  30. package/lib/FileEditor/addition-previewer/index.js +52 -0
  31. package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
  32. package/lib/FileEditor/addition-previewer/local-file-addition/index.js +252 -0
  33. package/lib/FileEditor/constants.js +7 -0
  34. package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +74 -0
  35. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +5 -0
  36. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +77 -0
  37. package/lib/FileEditor/files-previewer/file-previewer/index.css +88 -0
  38. package/lib/FileEditor/files-previewer/file-previewer/index.js +167 -0
  39. package/lib/FileEditor/files-previewer/index.css +56 -0
  40. package/lib/FileEditor/files-previewer/index.js +277 -0
  41. package/lib/FileEditor/index.css +6 -0
  42. package/lib/FileEditor/index.js +244 -11
  43. package/lib/FileEditor/utils.js +22 -0
  44. package/lib/FileItemFormatter/index.js +19 -20
  45. package/lib/FileUploader/index.css +9 -0
  46. package/lib/FileUploader/index.js +268 -14
  47. package/lib/FormulaFormatter/index.js +2 -1
  48. package/lib/FormulaFormatter/utils.js +0 -31
  49. package/lib/GeolocationEditor/country-editor.js +319 -0
  50. package/lib/GeolocationEditor/index.css +641 -0
  51. package/lib/GeolocationEditor/index.js +241 -0
  52. package/lib/GeolocationEditor/location-editor.js +368 -0
  53. package/lib/GeolocationEditor/map-editor/index.js +456 -0
  54. package/lib/GeolocationEditor/map-editor/large-editor/index.css +137 -0
  55. package/lib/GeolocationEditor/map-editor/large-editor/index.js +461 -0
  56. package/lib/GeolocationEditor/map-editor-utils.js +153 -0
  57. package/lib/GeolocationEditor/map-selection-editor/index.js +455 -0
  58. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +1 -0
  59. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +447 -0
  60. package/lib/GeolocationEditor/parse-geolocation.js +282 -0
  61. package/lib/GeolocationEditor/province-city-editor.js +292 -0
  62. package/lib/GeolocationEditor/province-editor.js +226 -0
  63. package/lib/GeolocationEditor/selector-header-item.js +28 -0
  64. package/lib/GeolocationEditor/selector-list.js +33 -0
  65. package/lib/GeolocationEditor/with-ref.js +27 -0
  66. package/lib/ImageEditor/addition-previewer/image-link/index.css +45 -0
  67. package/lib/ImageEditor/addition-previewer/image-link/index.js +73 -0
  68. package/lib/ImageEditor/addition-previewer/index.css +106 -0
  69. package/lib/ImageEditor/addition-previewer/index.js +63 -0
  70. package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +125 -0
  71. package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +254 -0
  72. package/lib/ImageEditor/constants.js +7 -0
  73. package/lib/ImageEditor/images-previewer/image-preview/index.css +59 -0
  74. package/lib/ImageEditor/images-previewer/image-preview/index.js +155 -0
  75. package/lib/ImageEditor/images-previewer/index.css +18 -0
  76. package/lib/ImageEditor/images-previewer/index.js +140 -0
  77. package/lib/ImageEditor/index.css +24 -0
  78. package/lib/ImageEditor/index.js +194 -0
  79. package/lib/ImageThumbnail/index.css +20 -0
  80. package/lib/ImageThumbnail/index.js +136 -0
  81. package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
  82. package/lib/MultipleSelectEditor/index.js +16 -177
  83. package/lib/NumberEditor/index.js +64 -77
  84. package/lib/RowExpandDialog/body/index.css +21 -0
  85. package/lib/RowExpandDialog/body/index.js +279 -0
  86. package/lib/RowExpandDialog/column-content/index.css +43 -0
  87. package/lib/RowExpandDialog/column-content/index.js +50 -0
  88. package/lib/RowExpandDialog/constants.js +114 -0
  89. package/lib/RowExpandDialog/header/index.css +31 -0
  90. package/lib/RowExpandDialog/header/index.js +33 -0
  91. package/lib/RowExpandDialog/index.css +24 -0
  92. package/lib/RowExpandDialog/index.js +268 -0
  93. package/lib/RowExpandDialog/utils.js +83 -0
  94. package/lib/RowExpandEditor/RowExpandAddBtn/index.css +22 -0
  95. package/lib/RowExpandEditor/RowExpandAddBtn/index.js +24 -0
  96. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +18 -0
  97. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +43 -0
  98. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +5 -0
  99. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +232 -0
  100. package/lib/RowExpandEditor/RowExpandDateEditor/index.js +130 -0
  101. package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +129 -0
  102. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +13 -0
  103. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +208 -0
  104. package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +105 -0
  105. package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
  106. package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +125 -0
  107. package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
  108. package/lib/RowExpandEditor/RowExpandFileEditor/index.js +146 -0
  109. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +17 -0
  110. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +165 -0
  111. package/lib/RowExpandEditor/RowExpandImageEditor/index.css +6 -0
  112. package/lib/RowExpandEditor/RowExpandImageEditor/index.js +170 -0
  113. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +6 -0
  114. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +124 -0
  115. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +44 -0
  116. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +224 -0
  117. package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +105 -0
  118. package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
  119. package/lib/RowExpandEditor/RowExpandRateEditor/index.js +152 -0
  120. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +58 -0
  121. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +192 -0
  122. package/lib/RowExpandEditor/RowExpandTextEditor/index.css +4 -0
  123. package/lib/RowExpandEditor/RowExpandTextEditor/index.js +127 -0
  124. package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +31 -0
  125. package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +130 -0
  126. package/lib/RowExpandEditor/constants.js +44 -0
  127. package/lib/RowExpandEditor/index.css +0 -0
  128. package/lib/RowExpandEditor/index.js +32 -0
  129. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +27 -0
  130. package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.css +1 -1
  131. package/lib/{RowExpandEmailFormatter → RowExpandFormatter/RowExpandEmailFormatter}/index.js +1 -1
  132. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.css +6 -6
  133. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/index.js +3 -1
  134. package/lib/{RowExpandFileFormatter → RowExpandFormatter/RowExpandFileFormatter}/row-expand-file-item-formatter.js +10 -11
  135. package/lib/{RowExpandFormulaFormatter → RowExpandFormatter/RowExpandFormulaFormatter}/index.js +11 -10
  136. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.css +6 -6
  137. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/index.js +1 -1
  138. package/lib/{RowExpandImageFormatter → RowExpandFormatter/RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
  139. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
  140. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.js +5 -5
  141. package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/utils.js +1 -1
  142. package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.css +1 -1
  143. package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +1 -0
  144. package/lib/{RowExpandUrlFormatter → RowExpandFormatter/RowExpandUrlFormatter}/index.js +4 -3
  145. package/lib/RowExpandFormatter/constants.js +60 -0
  146. package/lib/RowExpandFormatter/index.css +26 -0
  147. package/lib/RowExpandFormatter/index.js +84 -100
  148. package/lib/SingleSelectEditor/index.js +16 -156
  149. package/lib/TextEditor/index.js +113 -42
  150. package/lib/UploadProgress/index.js +38 -0
  151. package/lib/UrlEditor/index.js +62 -0
  152. package/lib/common/editor-base.js +53 -0
  153. package/lib/constants/file.js +96 -0
  154. package/lib/constants/index.js +34 -2
  155. package/lib/constants/key-codes.js +109 -0
  156. package/lib/css/cell-editor.css +18 -2
  157. package/lib/hooks/index.js +16 -0
  158. package/lib/index.js +74 -46
  159. package/lib/lang/index.js +16 -14
  160. package/lib/locales/de.json +163 -0
  161. package/lib/locales/en.json +163 -0
  162. package/lib/locales/es.json +163 -0
  163. package/lib/locales/fr.json +163 -0
  164. package/lib/locales/pt.json +163 -0
  165. package/lib/locales/ru.json +163 -0
  166. package/lib/locales/zh-CN.json +163 -0
  167. package/lib/select-editor/index.js +6 -6
  168. package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.js +3 -3
  169. package/lib/select-editor/pc-select-editor/index.css +85 -0
  170. package/lib/select-editor/pc-select-editor/index.js +290 -0
  171. package/lib/utils/cell-comparer.js +35 -0
  172. package/lib/utils/cell.js +55 -0
  173. package/lib/utils/column-utils.js +25 -0
  174. package/lib/utils/editor-utils.js +1 -6
  175. package/lib/utils/get-event-transfer.js +75 -0
  176. package/lib/utils/object-utils.js +61 -0
  177. package/lib/utils/url.js +119 -8
  178. package/lib/utils/utils.js +89 -2
  179. package/package.json +3 -2
  180. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +0 -97
  181. package/lib/FileEditor/pc-files-addition/index.js +0 -1
  182. package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
  183. package/lib/FileEditor/pc-files-preview/index.js +0 -1
  184. package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
  185. package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
  186. package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
  187. package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
  188. package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
  189. package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
  190. package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
  191. package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
  192. package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
  193. package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
  194. package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
  195. package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
  196. package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
  197. package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
  198. package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
  199. package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
  200. package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
  201. package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
  202. package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
  203. package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
  204. package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
  205. package/lib/FileItemFormatter/utils.js +0 -99
  206. package/lib/MultipleSelectEditor/index.css +0 -9
  207. package/lib/RowExpandUrlFormatter/index.css +0 -1
  208. package/lib/SingleSelectEditor/index.css +0 -14
  209. package/lib/locals/de.js +0 -103
  210. package/lib/locals/en.js +0 -104
  211. package/lib/locals/es.js +0 -103
  212. package/lib/locals/fr.js +0 -103
  213. package/lib/locals/pt.js +0 -103
  214. package/lib/locals/ru.js +0 -103
  215. package/lib/locals/zh-CN.js +0 -104
  216. package/lib/select-editor/pc-select-editor-popover/index.css +0 -71
  217. package/lib/select-editor/pc-select-editor-popover/index.js +0 -122
  218. /package/lib/CollaboratorEditor/{mb-collaborator-editor-popover → mb-collaborator-editor}/index.css +0 -0
  219. /package/lib/CollaboratorEditor/{pc-collaborator-editor-popover → pc-collaborator-editor}/index.css +0 -0
  220. /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/index.css +0 -0
  221. /package/lib/{RowExpandLinkFormatter → RowExpandFormatter/RowExpandLinkFormatter}/value-display-utils.js +0 -0
  222. /package/lib/{RowExpandRateFormatter → RowExpandFormatter/RowExpandRateFormatter}/index.js +0 -0
  223. /package/lib/select-editor/{mb-select-editor-popover → mb-select-editor}/index.css +0 -0
@@ -0,0 +1,43 @@
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
+ }
@@ -0,0 +1,50 @@
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;
@@ -0,0 +1,114 @@
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
+ };
@@ -0,0 +1,31 @@
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
+
@@ -0,0 +1,33 @@
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;
@@ -0,0 +1,24 @@
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
+ }
@@ -0,0 +1,268 @@
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 _classnames = _interopRequireDefault(require("classnames"));
11
+ var _reactstrap = require("reactstrap");
12
+ var _dtableUtils = require("dtable-utils");
13
+ var _lang = require("../lang");
14
+ var _header = _interopRequireDefault(require("./header"));
15
+ var _body = _interopRequireDefault(require("./body"));
16
+ var _Loading = _interopRequireDefault(require("../Loading"));
17
+ var _utils = require("../utils/utils");
18
+ var _cellComparer = require("../utils/cell-comparer");
19
+ require("./index.css");
20
+ var _toaster = _interopRequireDefault(require("../toaster"));
21
+ const RowExpandDialog = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
22
+ let {
23
+ saveImmediately = true,
24
+ isInsertingRow,
25
+ zIndex,
26
+ title,
27
+ className,
28
+ placeholder,
29
+ collaborators,
30
+ component,
31
+ eventBus,
32
+ valueKey = 'name',
33
+ // name or key
34
+ departments,
35
+ userDepartmentIdsMap,
36
+ config,
37
+ layout = 'horizontal',
38
+ // horizontal or vertical
39
+ longTextEditorAPI,
40
+ getRow,
41
+ modifyRow,
42
+ getCollaborators,
43
+ queryCollaborators,
44
+ checkEditable = c => c.editable && !_dtableUtils.NOT_SUPPORT_EDIT_COLUMN_TYPE_MAP[c.type],
45
+ onToggle,
46
+ uploadFile
47
+ } = _ref;
48
+ const [isAnimationEnd, setAnimationEnd] = (0, _react.useState)(false);
49
+ const [isLoading, setLoading] = (0, _react.useState)(true);
50
+ const [isSaving, setSaving] = (0, _react.useState)(false);
51
+ const [errorMessage, setErrorMessage] = (0, _react.useState)('');
52
+ const [row, setRow] = (0, _react.useState)({});
53
+ const [columns, setColumns] = (0, _react.useState)([]);
54
+ const modalRef = (0, _react.useRef)(null);
55
+ const isChangedRef = (0, _react.useRef)(false);
56
+ const update = (0, _react.useRef)({});
57
+ const initStyle = (0, _react.useMemo)(() => {
58
+ const defaultMargin = 80; // sequence cell width
59
+ const defaultHeight = 100;
60
+ return {
61
+ width: window.innerWidth - defaultMargin,
62
+ maxWidth: window.innerWidth - defaultMargin,
63
+ marginLeft: defaultMargin,
64
+ height: defaultHeight,
65
+ marginRight: defaultMargin,
66
+ marginTop: '30%',
67
+ transition: 'all .3s'
68
+ };
69
+ }, []);
70
+ const style = (0, _react.useMemo)(() => {
71
+ const width = 800;
72
+ return {
73
+ width,
74
+ maxWidth: width,
75
+ marginLeft: (window.innerWidth - width) / 2,
76
+ height: 'calc(100% - 56px)' // Dialog margin is 3.5rem (56px)
77
+ };
78
+ }, []);
79
+ const _checkEditable = (0, _react.useCallback)((column, row) => {
80
+ if (isSaving) return false;
81
+ if (!column) return false;
82
+ if (!checkEditable) return false;
83
+ if (!checkEditable(column, row)) return false;
84
+ if (column.type === _dtableUtils.CellType.IMAGE || column.type === _dtableUtils.CellType.FILE) return Boolean(uploadFile);
85
+ return true;
86
+ }, [isSaving, checkEditable, uploadFile]);
87
+ const initRowData = (0, _react.useCallback)(() => {
88
+ setLoading(true);
89
+ getRow().then(res => {
90
+ const {
91
+ row,
92
+ columns
93
+ } = res.data;
94
+ setRow(row);
95
+ const validColumns = columns.map(c => ({
96
+ ...c,
97
+ editable: _checkEditable(c, row),
98
+ width: 320
99
+ }));
100
+ isChangedRef.current = isInsertingRow && Object.keys(row).length > 0;
101
+ setColumns(validColumns);
102
+ setLoading(false);
103
+ }).catch(error => {
104
+ const errorMsg = (0, _utils.getErrorMsg)(error);
105
+ setErrorMessage((0, _lang.getLocale)(errorMsg));
106
+ setLoading(false);
107
+ });
108
+ }, [isInsertingRow, getRow, _checkEditable]);
109
+ const toggle = (0, _react.useCallback)(() => {
110
+ if (isSaving) return;
111
+ onToggle();
112
+ }, [isSaving, onToggle]);
113
+ const onSave = (0, _react.useCallback)(function (updated) {
114
+ let {
115
+ successCallback,
116
+ failCallback
117
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
118
+ modifyRow(updated, columns, {
119
+ successCallback,
120
+ failCallback
121
+ });
122
+ }, [columns, modifyRow]);
123
+ const onChange = (0, _react.useCallback)((column, value) => {
124
+ const key = column[valueKey];
125
+ const updated = {
126
+ [key]: value
127
+ };
128
+ const oldValue = row[key];
129
+ if (!(0, _cellComparer.isCellValueChanged)(oldValue, value, column.type)) return;
130
+ if (!saveImmediately || isInsertingRow) {
131
+ isChangedRef.current = true;
132
+ update.current = {
133
+ ...update.current,
134
+ ...updated
135
+ };
136
+ setRow({
137
+ ...row,
138
+ ...updated
139
+ });
140
+ return;
141
+ }
142
+ onSave(updated, {
143
+ successCallback: () => {
144
+ isChangedRef.current = false;
145
+ update.current = {};
146
+ setRow({
147
+ ...row,
148
+ ...updated
149
+ });
150
+ },
151
+ failCallback: () => {
152
+ _toaster.default.danger((0, _lang.getLocale)('Save_failed'));
153
+ }
154
+ });
155
+ }, [saveImmediately, isInsertingRow, row, valueKey, onSave]);
156
+ const onSubmit = (0, _react.useCallback)(() => {
157
+ setSaving(true);
158
+ const successCallback = isInsertingRow ? onToggle : () => {
159
+ isChangedRef.current = false;
160
+ update.current = {};
161
+ setSaving(false);
162
+ };
163
+ const failCallback = () => {
164
+ setSaving(false);
165
+ _toaster.default.danger((0, _lang.getLocale)('Save_failed'));
166
+ };
167
+ const newRow = isInsertingRow ? {
168
+ ...row,
169
+ ...update.current
170
+ } : update.current;
171
+ onSave(newRow, {
172
+ successCallback,
173
+ failCallback
174
+ });
175
+ }, [row, isInsertingRow, onSave, onToggle]);
176
+ (0, _react.useEffect)(() => {
177
+ // use setTimeout to make sure real dom rendered
178
+ setTimeout(() => {
179
+ let dom = modalRef.current.firstChild;
180
+ const {
181
+ width,
182
+ maxWidth,
183
+ marginLeft,
184
+ height
185
+ } = style;
186
+ dom.style.width = "".concat(width, "px");
187
+ dom.style.maxWidth = "".concat(maxWidth, "px");
188
+ dom.style.marginLeft = "".concat(marginLeft, "px");
189
+ dom.style.height = height;
190
+ dom.style.marginRight = 'unset';
191
+ dom.style.marginTop = '28px';
192
+ // after animation, change style and run callback
193
+ setTimeout(() => {
194
+ setAnimationEnd(true);
195
+ dom.style.transition = 'none';
196
+ initRowData();
197
+ }, 280);
198
+ }, 1);
199
+ // eslint-disable-next-line react-hooks/exhaustive-deps
200
+ }, []);
201
+ (0, _react.useImperativeHandle)(ref, () => ({
202
+ getData: () => ({
203
+ row,
204
+ columns
205
+ }),
206
+ setData: function () {
207
+ let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
208
+ Object.keys(data).forEach(key => {
209
+ if (key === 'row') {
210
+ setRow(data[key]);
211
+ }
212
+ if (key === 'columns') {
213
+ setColumns(data[key]);
214
+ }
215
+ });
216
+ }
217
+ }), [row, columns]);
218
+ const renderContent = (0, _react.useCallback)(() => {
219
+ if (!isAnimationEnd) return null;
220
+ if (isLoading) return /*#__PURE__*/_react.default.createElement("div", {
221
+ className: "w-100 -h-100 d-flex align-items-center justify-content-center"
222
+ }, /*#__PURE__*/_react.default.createElement(_Loading.default, null));
223
+ if (errorMessage) return /*#__PURE__*/_react.default.createElement("div", null, errorMessage);
224
+ return /*#__PURE__*/_react.default.createElement("div", {
225
+ className: "dtable-ui-row-expand-details"
226
+ }, /*#__PURE__*/_react.default.createElement(_header.default, {
227
+ onToggle: toggle,
228
+ title: title
229
+ }), /*#__PURE__*/_react.default.createElement(_body.default, {
230
+ isInsertingRow: isInsertingRow,
231
+ row: row,
232
+ columns: columns,
233
+ placeholder: placeholder,
234
+ collaborators: collaborators,
235
+ eventBus: eventBus,
236
+ component: component,
237
+ valueKey: valueKey,
238
+ departments: departments,
239
+ userDepartmentIdsMap: userDepartmentIdsMap,
240
+ config: config,
241
+ onChange: onChange,
242
+ getCollaborators: getCollaborators,
243
+ queryCollaborators: queryCollaborators,
244
+ uploadFile: uploadFile,
245
+ longTextEditorAPI: longTextEditorAPI
246
+ }), (!saveImmediately || isInsertingRow) && /*#__PURE__*/_react.default.createElement(_reactstrap.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
247
+ onClick: toggle,
248
+ color: "secondary"
249
+ }, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
250
+ onClick: onSubmit,
251
+ disabled: isSaving || !isChangedRef.current,
252
+ color: "primary"
253
+ }, (0, _lang.getLocale)('Submit'))));
254
+ }, [isSaving, saveImmediately, isAnimationEnd, isLoading, isInsertingRow, errorMessage, title, row, columns, placeholder, collaborators, component, valueKey, departments, userDepartmentIdsMap, eventBus, onChange, toggle, getCollaborators, queryCollaborators, uploadFile, longTextEditorAPI, config, onSubmit]);
255
+ return /*#__PURE__*/_react.default.createElement(_reactstrap.Modal, {
256
+ isOpen: true,
257
+ toggle: onToggle,
258
+ className: (0, _classnames.default)('dtable-ui-row-expand-dialog', className),
259
+ style: isAnimationEnd ? style : initStyle,
260
+ zIndex: zIndex || 1048,
261
+ contentClassName: "dtable-ui-row-expand-content",
262
+ modalClassName: "dtable-ui-row-expand-modal",
263
+ fade: false,
264
+ innerRef: modalRef,
265
+ keyboard: false
266
+ }, renderContent());
267
+ });
268
+ var _default = exports.default = RowExpandDialog;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTwoDimensionArrayValue = exports.getFormulaArrayValue = exports.downloadFile = void 0;
7
+ exports.isArrayFormalColumn = isArrayFormalColumn;
8
+ exports.isValidCellValue = void 0;
9
+ var _dtableUtils = require("dtable-utils");
10
+ const isValidCellValue = value => {
11
+ if (value === undefined) return false;
12
+ if (value === null) return false;
13
+ if (value === '') return false;
14
+ if (JSON.stringify(value) === '{}') return false;
15
+ if (JSON.stringify(value) === '[]') return false;
16
+ return true;
17
+ };
18
+ exports.isValidCellValue = isValidCellValue;
19
+ function isArrayFormalColumn(columnType) {
20
+ return [_dtableUtils.CellType.IMAGE, _dtableUtils.CellType.FILE, _dtableUtils.CellType.MULTIPLE_SELECT, _dtableUtils.CellType.COLLABORATOR].includes(columnType);
21
+ }
22
+ const getFormulaArrayValue = function (value) {
23
+ let isFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
24
+ if (!Array.isArray(value)) return [];
25
+ if (!isFlat) return getTwoDimensionArrayValue(value);
26
+ return value.map(item => {
27
+ if (Object.prototype.toString.call(item) !== '[object Object]') {
28
+ return item;
29
+ }
30
+ if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
31
+ const {
32
+ display_value
33
+ } = item;
34
+ if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
35
+ return display_value.map(i => {
36
+ if (Object.prototype.toString.call(i) === '[object Object]') {
37
+ if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
38
+ const {
39
+ display_value
40
+ } = i;
41
+ return display_value;
42
+ }
43
+ return i;
44
+ });
45
+ }).flat().filter(item => isValidCellValue(item));
46
+ };
47
+ exports.getFormulaArrayValue = getFormulaArrayValue;
48
+ const getTwoDimensionArrayValue = value => {
49
+ if (!Array.isArray(value)) return [];
50
+ return value.map(item => {
51
+ if (Object.prototype.toString.call(item) !== '[object Object]') {
52
+ return item;
53
+ }
54
+ if (!Object.prototype.hasOwnProperty.call(item, 'display_value')) return item;
55
+ const {
56
+ display_value
57
+ } = item;
58
+ if (!Array.isArray(display_value) || display_value.length === 0) return display_value;
59
+ return display_value.map(i => {
60
+ if (Object.prototype.toString.call(i) === '[object Object]') {
61
+ if (!Object.prototype.hasOwnProperty.call(i, 'display_value')) return i;
62
+ const {
63
+ display_value
64
+ } = i;
65
+ return display_value;
66
+ }
67
+ return i;
68
+ });
69
+ });
70
+ };
71
+ exports.getTwoDimensionArrayValue = getTwoDimensionArrayValue;
72
+ const downloadFile = downloadUrl => {
73
+ const downloadFrame = document.getElementById('download-iframe');
74
+ if (downloadFrame != null) {
75
+ document.body.removeChild(downloadFrame);
76
+ }
77
+ let iframe = document.createElement('iframe');
78
+ iframe.setAttribute('id', 'download-iframe');
79
+ iframe.style.display = 'none';
80
+ iframe.src = downloadUrl;
81
+ document.body.appendChild(iframe);
82
+ };
83
+ exports.downloadFile = downloadFile;
@@ -0,0 +1,22 @@
1
+ .dtable-ui-row-expand-add-btn {
2
+ min-width: 80px;
3
+ max-width: 100%;
4
+ height: 28px;
5
+ line-height: 24px;
6
+ border: 2px solid transparent;
7
+ padding: 0 10px;
8
+ background-color: #f0f0f0;
9
+ border-radius: 3px;
10
+ color: #666666;
11
+ font-size: 14px;
12
+ text-align: center;
13
+ display: inline-flex;
14
+ cursor: pointer;
15
+ width: fit-content;
16
+ }
17
+
18
+ .dtable-ui-row-expand-add-btn:hover {
19
+ background-color: #dbdbdb;
20
+ color: #666666;
21
+ cursor: pointer;
22
+ }
@@ -0,0 +1,24 @@
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 _constants = require("../../constants");
10
+ require("./index.css");
11
+ const RowExpandAddBtn = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
12
+ return /*#__PURE__*/_react.default.createElement("div", {
13
+ ref: ref,
14
+ tabIndex: 0,
15
+ onClick: props.onClick,
16
+ onFocus: props.onFocus,
17
+ role: "button",
18
+ className: "dtable-ui-row-expand-add-btn d-print-none",
19
+ style: props.isFocus ? _constants.ROW_EXPAND_BTN_FOCUS_STYLE : {}
20
+ }, /*#__PURE__*/_react.default.createElement("span", {
21
+ className: "d-print-none"
22
+ }, props.text));
23
+ });
24
+ var _default = exports.default = RowExpandAddBtn;