dtable-ui-component 0.1.75-beta2 → 0.1.75-beta3

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/es/AutoNumberFormatter/index.css +1 -0
  2. package/es/AutoNumberFormatter/index.js +36 -0
  3. package/es/ButtonFormatter/index.css +13 -0
  4. package/es/ButtonFormatter/index.js +56 -0
  5. package/es/CTimeFormatter/index.css +1 -0
  6. package/es/CTimeFormatter/index.js +58 -0
  7. package/es/CheckboxFormatter/index.css +1 -0
  8. package/es/CheckboxFormatter/index.js +45 -0
  9. package/es/CollaboratorFormatter/index.css +1 -0
  10. package/es/CollaboratorFormatter/index.js +91 -0
  11. package/es/CollaboratorItem/index.css +49 -0
  12. package/es/CollaboratorItem/index.js +64 -0
  13. package/es/CreatorFormatter/index.css +1 -0
  14. package/es/CreatorFormatter/index.js +87 -0
  15. package/es/DateFormatter/index.css +1 -0
  16. package/es/DateFormatter/index.js +60 -0
  17. package/es/DurationFormatter/index.css +1 -0
  18. package/es/DurationFormatter/index.js +38 -0
  19. package/es/EmailFormatter/index.css +5 -0
  20. package/es/EmailFormatter/index.js +36 -0
  21. package/es/FileFormatter/index.css +29 -0
  22. package/es/FileFormatter/index.js +64 -0
  23. package/es/FileItemFormatter/index.js +50 -0
  24. package/es/FileUploader/index.js +53 -0
  25. package/es/FormulaFormatter/index.css +19 -0
  26. package/es/FormulaFormatter/index.js +164 -0
  27. package/es/GeolocationFormatter/index.css +1 -0
  28. package/es/GeolocationFormatter/index.js +53 -0
  29. package/es/ImageFormatter/images-lazy-load.js +150 -0
  30. package/es/ImageFormatter/index.css +34 -0
  31. package/es/ImageFormatter/index.js +154 -0
  32. package/es/ImagePreviewerLightbox/index.css +87 -0
  33. package/es/ImagePreviewerLightbox/index.js +119 -0
  34. package/es/LastModifierFormatter/index.css +1 -0
  35. package/es/LastModifierFormatter/index.js +87 -0
  36. package/es/LinkFormatter/index.css +27 -0
  37. package/es/LinkFormatter/index.js +144 -0
  38. package/es/Loading/index.css +54 -0
  39. package/es/Loading/index.js +7 -0
  40. package/es/LongTextFormatter/html-long-text-formatter.js +96 -0
  41. package/es/LongTextFormatter/index.css +63 -0
  42. package/es/LongTextFormatter/index.js +29 -0
  43. package/es/LongTextFormatter/simple-long-text-formatter.js +104 -0
  44. package/es/MTimeFormatter/index.css +1 -0
  45. package/es/MTimeFormatter/index.js +58 -0
  46. package/es/ModalPortal/index.js +44 -0
  47. package/es/MultipleSelectFormatter/index.css +1 -0
  48. package/es/MultipleSelectFormatter/index.js +70 -0
  49. package/es/NumberFormatter/index.css +1 -0
  50. package/es/NumberFormatter/index.js +47 -0
  51. package/es/RateFormatter/index.css +1 -0
  52. package/es/RateFormatter/index.js +80 -0
  53. package/es/SelectItem/index.js +58 -0
  54. package/es/SingleSelectFormatter/index.css +1 -0
  55. package/es/SingleSelectFormatter/index.js +70 -0
  56. package/es/TextFormatter/index.css +1 -0
  57. package/es/TextFormatter/index.js +56 -0
  58. package/es/UrlFormatter/index.css +5 -0
  59. package/es/UrlFormatter/index.js +36 -0
  60. package/es/app.css +20 -0
  61. package/es/app.js +91 -0
  62. package/es/assets/images/avatar/default_avatar.png +0 -0
  63. package/es/assets/images/file/192/excel.png +0 -0
  64. package/es/assets/images/file/192/file.png +0 -0
  65. package/es/assets/images/file/192/music.png +0 -0
  66. package/es/assets/images/file/192/pdf.png +0 -0
  67. package/es/assets/images/file/192/pic.png +0 -0
  68. package/es/assets/images/file/192/ppt.png +0 -0
  69. package/es/assets/images/file/192/txt.png +0 -0
  70. package/es/assets/images/file/192/video.png +0 -0
  71. package/es/assets/images/file/192/word.png +0 -0
  72. package/es/assets/images/file/24/excel.png +0 -0
  73. package/es/assets/images/file/24/file.png +0 -0
  74. package/es/assets/images/file/24/music.png +0 -0
  75. package/es/assets/images/file/24/pdf.png +0 -0
  76. package/es/assets/images/file/24/pic.png +0 -0
  77. package/es/assets/images/file/24/ppt.png +0 -0
  78. package/es/assets/images/file/24/txt.png +0 -0
  79. package/es/assets/images/file/24/video.png +0 -0
  80. package/es/assets/images/file/24/word.png +0 -0
  81. package/es/assets/images/folder/folder-192.png +0 -0
  82. package/es/assets/images/folder/folder-24.png +0 -0
  83. package/es/cellFormatterFactory/index.js +25 -0
  84. package/es/components/cell-editor/checkbox-editor.js +104 -0
  85. package/es/components/cell-editor/collaborator-editor.js +236 -0
  86. package/es/components/cell-editor/date-editor.js +151 -0
  87. package/es/components/cell-editor/index.js +9 -0
  88. package/es/components/cell-editor/link-editor.js +303 -0
  89. package/es/components/cell-editor/multiple-select-editor.js +237 -0
  90. package/es/components/cell-editor/number-editor.js +154 -0
  91. package/es/components/cell-editor/single-select-editor.js +202 -0
  92. package/es/components/cell-editor/text-editor.js +122 -0
  93. package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +46 -0
  94. package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
  95. package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
  96. package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
  97. package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
  98. package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +177 -0
  99. package/es/components/cell-editor-popover/mb-date-editor-popover.js +245 -0
  100. package/es/components/cell-editor-popover/mb-link-editor-popover.js +170 -0
  101. package/es/components/cell-editor-popover/mb-select-editor-popover.js +230 -0
  102. package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +109 -0
  103. package/es/components/cell-editor-popover/pc-date-editor-popover.js +142 -0
  104. package/es/components/cell-editor-popover/pc-link-editor-popover.js +114 -0
  105. package/es/components/cell-editor-popover/pc-select-editor-popover.js +143 -0
  106. package/es/components/common/collaborator-item.js +63 -0
  107. package/es/components/common/edit-editor-button.js +56 -0
  108. package/es/components/common/link-editor-option.js +113 -0
  109. package/es/components/common/mobile/mb-editor-header.js +48 -0
  110. package/es/components/common/select-editor-option.js +106 -0
  111. package/es/constants/cell-types.js +25 -0
  112. package/es/constants/index.js +49 -0
  113. package/es/css/cell-editor.css +614 -0
  114. package/es/css/cell-formatter.css +4 -0
  115. package/es/css/custom-rc-calendar.css +118 -0
  116. package/es/formatterConfig/index.js +31 -0
  117. package/es/index.js +31 -0
  118. package/es/lang/index.js +50 -0
  119. package/es/locals/de.js +2 -0
  120. package/es/locals/en.js +17 -0
  121. package/es/locals/fr.js +2 -0
  122. package/es/locals/zh-CN.js +17 -0
  123. package/{lib/toast → es/toaster}/alert.js +0 -0
  124. package/{lib/toast → es/toaster}/index.js +0 -0
  125. package/{lib/toast → es/toaster}/toast.js +0 -0
  126. package/{lib/toast → es/toaster}/toastManager.js +0 -0
  127. package/{lib/toast → es/toaster}/toaster.js +0 -0
  128. package/es/utils/cell-value-validator.js +31 -0
  129. package/es/utils/column-utils.js +7 -0
  130. package/es/utils/editor-utils.js +71 -0
  131. package/es/utils/markdown2html.js +62 -0
  132. package/es/utils/normalize-long-text-value.js +69 -0
  133. package/es/utils/number-precision.js +164 -0
  134. package/es/utils/unified/index.js +470 -0
  135. package/es/utils/utils.js +116 -0
  136. package/es/utils/value-format-utils.js +497 -0
  137. package/es/utils/vfile/core.js +172 -0
  138. package/es/utils/vfile/index.js +48 -0
  139. package/lib/AutoNumberFormatter/index.js +38 -27
  140. package/lib/ButtonFormatter/index.js +59 -47
  141. package/lib/CTimeFormatter/index.js +53 -39
  142. package/lib/CheckboxFormatter/index.js +48 -35
  143. package/lib/CollaboratorFormatter/index.js +64 -42
  144. package/lib/CollaboratorItem/index.js +61 -44
  145. package/lib/CreatorFormatter/index.js +62 -42
  146. package/lib/DateFormatter/index.js +55 -40
  147. package/lib/DurationFormatter/index.js +42 -29
  148. package/lib/EmailFormatter/index.js +38 -27
  149. package/lib/FileFormatter/index.js +65 -50
  150. package/lib/FileItemFormatter/index.js +44 -31
  151. package/lib/FileUploader/index.js +44 -34
  152. package/lib/FormulaFormatter/index.js +102 -81
  153. package/lib/GeolocationFormatter/index.js +50 -35
  154. package/lib/ImageFormatter/images-lazy-load.js +81 -73
  155. package/lib/ImageFormatter/index.js +109 -90
  156. package/lib/ImagePreviewerLightbox/index.js +60 -27
  157. package/lib/LastModifierFormatter/index.js +62 -42
  158. package/lib/LinkFormatter/index.js +80 -59
  159. package/lib/Loading/index.js +13 -4
  160. package/lib/LongTextFormatter/html-long-text-formatter.js +60 -49
  161. package/lib/LongTextFormatter/index.js +28 -9
  162. package/lib/LongTextFormatter/simple-long-text-formatter.js +58 -52
  163. package/lib/MTimeFormatter/index.js +53 -39
  164. package/lib/ModalPortal/index.js +37 -30
  165. package/lib/MultipleSelectFormatter/index.js +55 -39
  166. package/lib/NumberFormatter/index.js +50 -35
  167. package/lib/RateFormatter/index.js +52 -37
  168. package/lib/SelectItem/index.js +46 -31
  169. package/lib/SingleSelectFormatter/index.js +54 -38
  170. package/lib/TextFormatter/index.js +44 -31
  171. package/lib/UrlFormatter/index.js +38 -27
  172. package/lib/app.js +80 -75
  173. package/lib/cellFormatterFactory/index.js +20 -17
  174. package/lib/components/cell-editor/checkbox-editor.js +66 -59
  175. package/lib/components/cell-editor/collaborator-editor.js +126 -113
  176. package/lib/components/cell-editor/date-editor.js +119 -99
  177. package/lib/components/cell-editor/index.js +40 -9
  178. package/lib/components/cell-editor/link-editor.js +140 -122
  179. package/lib/components/cell-editor/multiple-select-editor.js +127 -114
  180. package/lib/components/cell-editor/number-editor.js +86 -78
  181. package/lib/components/cell-editor/single-select-editor.js +120 -106
  182. package/lib/components/cell-editor/text-editor.js +72 -65
  183. package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +51 -31
  184. package/lib/components/cell-editor-dialog/pc-files-addition/index.js +1 -0
  185. package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +1 -0
  186. package/lib/components/cell-editor-dialog/pc-files-preview/index.js +1 -0
  187. package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +1 -0
  188. package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +111 -105
  189. package/lib/components/cell-editor-popover/mb-date-editor-popover.js +157 -140
  190. package/lib/components/cell-editor-popover/mb-link-editor-popover.js +109 -103
  191. package/lib/components/cell-editor-popover/mb-select-editor-popover.js +155 -142
  192. package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +89 -74
  193. package/lib/components/cell-editor-popover/pc-date-editor-popover.js +102 -88
  194. package/lib/components/cell-editor-popover/pc-link-editor-popover.js +91 -77
  195. package/lib/components/cell-editor-popover/pc-select-editor-popover.js +105 -91
  196. package/lib/components/common/collaborator-item.js +59 -43
  197. package/lib/components/common/edit-editor-button.js +39 -28
  198. package/lib/components/common/link-editor-option.js +71 -63
  199. package/lib/components/common/mobile/mb-editor-header.js +52 -39
  200. package/lib/components/common/select-editor-option.js +74 -58
  201. package/lib/constants/cell-types.js +54 -25
  202. package/lib/constants/index.js +28 -5
  203. package/lib/formatterConfig/index.js +59 -28
  204. package/lib/index.js +139 -31
  205. package/lib/lang/index.js +27 -11
  206. package/lib/locals/de.js +6 -1
  207. package/lib/locals/en.js +6 -1
  208. package/lib/locals/fr.js +6 -1
  209. package/lib/locals/zh-CN.js +6 -1
  210. package/lib/toaster/alert.js +164 -0
  211. package/lib/toaster/index.js +12 -0
  212. package/lib/toaster/toast.js +223 -0
  213. package/lib/toaster/toastManager.js +189 -0
  214. package/lib/toaster/toaster.js +92 -0
  215. package/lib/utils/cell-value-validator.js +9 -5
  216. package/lib/utils/column-utils.js +13 -5
  217. package/lib/utils/editor-utils.js +13 -3
  218. package/lib/utils/markdown2html.js +7 -1
  219. package/lib/utils/normalize-long-text-value.js +6 -1
  220. package/lib/utils/number-precision.js +32 -13
  221. package/lib/utils/utils.js +33 -8
  222. package/lib/utils/value-format-utils.js +110 -58
  223. package/package.json +5 -5
@@ -1,36 +1,47 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React from 'react';
6
- import cn from 'astro-classname';
7
- import './index.css';
1
+ "use strict";
8
2
 
9
- var EmailFormatter = /*#__PURE__*/function (_React$Component) {
10
- _inherits(EmailFormatter, _React$Component);
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
11
4
 
12
- var _super = _createSuper(EmailFormatter);
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
13
7
 
14
- function EmailFormatter() {
15
- _classCallCheck(this, EmailFormatter);
8
+ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _astroClassname = _interopRequireDefault(require("astro-classname"));
15
+
16
+ require("./index.css");
16
17
 
17
- return _super.apply(this, arguments);
18
+ var propTypes = {
19
+ value: _propTypes.default.string,
20
+ containerClassName: _propTypes.default.string
21
+ };
22
+
23
+ var EmailFormatter = /*#__PURE__*/function (_React$Component) {
24
+ (0, _inheritsLoose2.default)(EmailFormatter, _React$Component);
25
+
26
+ function EmailFormatter() {
27
+ return _React$Component.apply(this, arguments) || this;
18
28
  }
19
29
 
20
- _createClass(EmailFormatter, [{
21
- key: "render",
22
- value: function render() {
23
- var _this$props = this.props,
24
- containerClassName = _this$props.containerClassName,
25
- value = _this$props.value;
26
- var classname = cn('dtable-ui cell-formatter-container email-formatter', containerClassName);
27
- return /*#__PURE__*/React.createElement("div", {
28
- className: classname
29
- }, value);
30
- }
31
- }]);
30
+ var _proto = EmailFormatter.prototype;
31
+
32
+ _proto.render = function render() {
33
+ var _this$props = this.props,
34
+ containerClassName = _this$props.containerClassName,
35
+ value = _this$props.value;
36
+ var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container email-formatter', containerClassName);
37
+ return /*#__PURE__*/_react.default.createElement("div", {
38
+ className: classname
39
+ }, value);
40
+ };
32
41
 
33
42
  return EmailFormatter;
34
- }(React.Component);
43
+ }(_react.default.Component);
35
44
 
36
- export default EmailFormatter;
45
+ EmailFormatter.propTypes = propTypes;
46
+ var _default = EmailFormatter;
47
+ exports.default = _default;
@@ -1,64 +1,79 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React from 'react';
6
- import cn from 'astro-classname';
7
- import FileItemFormatter from '../FileItemFormatter';
8
- import './index.css';
1
+ "use strict";
9
2
 
10
- var FileFormatter = /*#__PURE__*/function (_React$PureComponent) {
11
- _inherits(FileFormatter, _React$PureComponent);
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
12
4
 
13
- var _super = _createSuper(FileFormatter);
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
14
7
 
15
- function FileFormatter() {
16
- _classCallCheck(this, FileFormatter);
8
+ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _propTypes = _interopRequireDefault(require("prop-types"));
15
+
16
+ var _astroClassname = _interopRequireDefault(require("astro-classname"));
17
+
18
+ var _FileItemFormatter = _interopRequireDefault(require("../FileItemFormatter"));
19
+
20
+ require("./index.css");
21
+
22
+ var propTypes = {
23
+ isSample: _propTypes.default.bool,
24
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]),
25
+ containerClassName: _propTypes.default.string
26
+ };
17
27
 
18
- return _super.apply(this, arguments);
28
+ var FileFormatter = /*#__PURE__*/function (_React$PureComponent) {
29
+ (0, _inheritsLoose2.default)(FileFormatter, _React$PureComponent);
30
+
31
+ function FileFormatter() {
32
+ return _React$PureComponent.apply(this, arguments) || this;
19
33
  }
20
34
 
21
- _createClass(FileFormatter, [{
22
- key: "render",
23
- value: function render() {
24
- var _this$props = this.props,
25
- isSample = _this$props.isSample,
26
- value = _this$props.value,
27
- containerClassName = _this$props.containerClassName;
28
- var className = cn('dtable-ui cell-formatter-container file-formatter', containerClassName);
29
-
30
- if (!Array.isArray(value) || value.length === 0) {
31
- return null;
32
- }
33
-
34
- if (isSample) {
35
- var item = value[0];
36
- return /*#__PURE__*/React.createElement("div", {
37
- className: className
38
- }, /*#__PURE__*/React.createElement(FileItemFormatter, {
39
- file: item
40
- }), value.length !== 1 && /*#__PURE__*/React.createElement("span", {
41
- className: "file-item-count"
42
- }, "+".concat(value.length)));
43
- }
44
-
45
- return /*#__PURE__*/React.createElement("div", {
35
+ var _proto = FileFormatter.prototype;
36
+
37
+ _proto.render = function render() {
38
+ var _this$props = this.props,
39
+ isSample = _this$props.isSample,
40
+ value = _this$props.value,
41
+ containerClassName = _this$props.containerClassName;
42
+ var className = (0, _astroClassname.default)('dtable-ui cell-formatter-container file-formatter', containerClassName);
43
+
44
+ if (!Array.isArray(value) || value.length === 0) {
45
+ return null;
46
+ }
47
+
48
+ if (isSample) {
49
+ var item = value[0];
50
+ return /*#__PURE__*/_react.default.createElement("div", {
46
51
  className: className
47
- }, value.map(function (item, index) {
48
- return /*#__PURE__*/React.createElement(FileItemFormatter, {
49
- file: item,
50
- key: index
51
- });
52
- }));
52
+ }, /*#__PURE__*/_react.default.createElement(_FileItemFormatter.default, {
53
+ file: item
54
+ }), value.length !== 1 && /*#__PURE__*/_react.default.createElement("span", {
55
+ className: "file-item-count"
56
+ }, "+" + value.length));
53
57
  }
54
- }]);
58
+
59
+ return /*#__PURE__*/_react.default.createElement("div", {
60
+ className: className
61
+ }, value.map(function (item, index) {
62
+ return /*#__PURE__*/_react.default.createElement(_FileItemFormatter.default, {
63
+ file: item,
64
+ key: index
65
+ });
66
+ }));
67
+ };
55
68
 
56
69
  return FileFormatter;
57
- }(React.PureComponent);
70
+ }(_react.default.PureComponent);
58
71
 
59
- FileFormatter.defaultProps = {
72
+ (0, _defineProperty2.default)(FileFormatter, "defaultProps", {
60
73
  isSample: false,
61
74
  value: [],
62
75
  containerClassName: ''
63
- };
64
- export default FileFormatter;
76
+ });
77
+ FileFormatter.propTypes = propTypes;
78
+ var _default = FileFormatter;
79
+ exports.default = _default;
@@ -1,50 +1,63 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React, { Component } from 'react';
6
- import { getFileIconUrl } from '../utils/utils';
1
+ "use strict";
7
2
 
8
- var FileItemFormatter = /*#__PURE__*/function (_Component) {
9
- _inherits(FileItemFormatter, _Component);
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+
8
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
9
+
10
+ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
14
+ var _react = _interopRequireWildcard(require("react"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ var _utils = require("../utils/utils");
10
19
 
11
- var _super = _createSuper(FileItemFormatter);
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ var FileItemFormatter = /*#__PURE__*/function (_Component) {
25
+ (0, _inheritsLoose2.default)(FileItemFormatter, _Component);
12
26
 
13
27
  function FileItemFormatter() {
14
28
  var _this;
15
29
 
16
- _classCallCheck(this, FileItemFormatter);
17
-
18
30
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
19
31
  args[_key] = arguments[_key];
20
32
  }
21
33
 
22
- _this = _super.call.apply(_super, [this].concat(args));
34
+ _this = _Component.call.apply(_Component, [this].concat(args)) || this;
35
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFileIconData", function (item) {
36
+ var fileIconUrl = (0, _utils.getFileIconUrl)(item.name, item.type);
23
37
 
24
- _this.getFileIconData = function (item) {
25
- var fileIconUrl = getFileIconUrl(item.name, item.type);
26
-
27
- var fileIconData = require(fileIconUrl);
38
+ var fileIconData = require('' + fileIconUrl);
28
39
 
29
40
  return fileIconData;
30
- };
31
-
41
+ });
32
42
  return _this;
33
43
  }
34
44
 
35
- _createClass(FileItemFormatter, [{
36
- key: "render",
37
- value: function render() {
38
- var file = this.props.file;
39
- return /*#__PURE__*/React.createElement("img", {
40
- className: "file-item-icon",
41
- src: this.getFileIconData(file),
42
- alt: file.name
43
- });
44
- }
45
- }]);
45
+ var _proto = FileItemFormatter.prototype;
46
+
47
+ _proto.render = function render() {
48
+ var file = this.props.file;
49
+ return /*#__PURE__*/_react.default.createElement("img", {
50
+ className: "file-item-icon",
51
+ src: this.getFileIconData(file),
52
+ alt: file.name
53
+ });
54
+ };
46
55
 
47
56
  return FileItemFormatter;
48
- }(Component);
57
+ }(_react.Component);
49
58
 
50
- export default FileItemFormatter;
59
+ FileItemFormatter.propTypes = {
60
+ file: _propTypes.default.string.isRequired
61
+ };
62
+ var _default = FileItemFormatter;
63
+ exports.default = _default;
@@ -1,53 +1,63 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React from 'react';
1
+ "use strict";
6
2
 
7
- var FileUploader = /*#__PURE__*/function (_React$Component) {
8
- _inherits(FileUploader, _React$Component);
9
-
10
- var _super = _createSuper(FileUploader);
11
-
12
- function FileUploader(props) {
13
- var _this;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
14
4
 
15
- _classCallCheck(this, FileUploader);
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
16
7
 
17
- _this = _super.call(this, props);
8
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
18
9
 
19
- _this.onFilesChanged = function () {};
10
+ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
20
11
 
21
- _this.uploadFiles = function (fileList) {
22
- var isMultiple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
23
- };
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
24
13
 
25
- _this.checkRepeat = function () {};
14
+ var _react = _interopRequireDefault(require("react"));
26
15
 
27
- _this.cancelUploadFile = function () {};
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
28
17
 
29
- _this.onFileUploadProgress = function () {};
18
+ var propTypes = {
19
+ isCheckRepeat: _propTypes.default.bool,
20
+ onFileUploadProgress: _propTypes.default.func,
21
+ onFileUploadSuccss: _propTypes.default.func,
22
+ onFileUploadFailed: _propTypes.default.func,
23
+ dtableWebAPI: _propTypes.default.object.isRequired
24
+ };
30
25
 
31
- _this.onFileUploadSuccss = function () {};
26
+ var FileUploader = /*#__PURE__*/function (_React$Component) {
27
+ (0, _inheritsLoose2.default)(FileUploader, _React$Component);
32
28
 
33
- _this.onFileUploadFailed = function () {};
29
+ function FileUploader(props) {
30
+ var _this;
34
31
 
32
+ _this = _React$Component.call(this, props) || this;
33
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFilesChanged", function () {});
34
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "uploadFiles", function (fileList, isMultiple) {
35
+ if (isMultiple === void 0) {
36
+ isMultiple = false;
37
+ }
38
+ });
39
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "checkRepeat", function () {});
40
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cancelUploadFile", function () {});
41
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFileUploadProgress", function () {});
42
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFileUploadSuccss", function () {});
43
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFileUploadFailed", function () {});
35
44
  _this.state = {};
36
45
  _this.uploadFiles = [];
37
46
  return _this;
38
47
  }
39
48
 
40
- _createClass(FileUploader, [{
41
- key: "render",
42
- value: function render() {
43
- return /*#__PURE__*/React.createElement("input", {
44
- type: "file",
45
- onChange: this.onFilesChanged
46
- });
47
- }
48
- }]);
49
+ var _proto = FileUploader.prototype;
50
+
51
+ _proto.render = function render() {
52
+ return /*#__PURE__*/_react.default.createElement("input", {
53
+ type: "file",
54
+ onChange: this.onFilesChanged
55
+ });
56
+ };
49
57
 
50
58
  return FileUploader;
51
- }(React.Component);
59
+ }(_react.default.Component);
52
60
 
53
- export default FileUploader;
61
+ FileUploader.propTypes = propTypes;
62
+ var _default = FileUploader;
63
+ exports.default = _default;
@@ -1,37 +1,61 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
- import React from 'react';
7
- import { FORMULA_RESULT_TYPE, CellType } from '../constants';
8
- import cellFormatterFactory from '../cellFormatterFactory';
9
- import { isFunction } from '../utils/utils';
10
- import TextFormatter from '../TextFormatter';
11
- import { isArrayFormalColumn, isSimpleCellFormatter } from '../utils/column-utils';
12
- import cellValueValidator from '../utils/cell-value-validator';
13
- import { getFormulaDisplayString } from '../utils/value-format-utils';
14
- import './index.css';
1
+ "use strict";
15
2
 
16
- var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
17
- _inherits(FormulaFormatter, _React$Component);
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+
8
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
9
+
10
+ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
14
+ var _react = _interopRequireDefault(require("react"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ var _constants = require("../constants");
19
+
20
+ var _cellFormatterFactory = _interopRequireDefault(require("../cellFormatterFactory"));
21
+
22
+ var _utils = require("../utils/utils");
23
+
24
+ var _TextFormatter = _interopRequireDefault(require("../TextFormatter"));
25
+
26
+ var _columnUtils = require("../utils/column-utils");
27
+
28
+ var _cellValueValidator = _interopRequireDefault(require("../utils/cell-value-validator"));
29
+
30
+ var _valueFormatUtils = require("../utils/value-format-utils");
31
+
32
+ require("./index.css");
33
+
34
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
18
35
 
19
- var _super = _createSuper(FormulaFormatter);
36
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
37
+
38
+ var propTypes = {
39
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.object, _propTypes.default.bool]),
40
+ column: _propTypes.default.Object,
41
+ containerClassName: _propTypes.default.string,
42
+ collaborators: _propTypes.default.array
43
+ };
44
+
45
+ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
46
+ (0, _inheritsLoose2.default)(FormulaFormatter, _React$Component);
20
47
 
21
48
  function FormulaFormatter() {
22
49
  var _this;
23
50
 
24
- _classCallCheck(this, FormulaFormatter);
25
-
26
51
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
52
  args[_key] = arguments[_key];
28
53
  }
29
54
 
30
- _this = _super.call.apply(_super, [this].concat(args));
31
-
32
- _this.getGridCellClassName = function (resultType) {
55
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
56
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getGridCellClassName", function (resultType) {
33
57
  switch (resultType) {
34
- case FORMULA_RESULT_TYPE.NUMBER:
58
+ case _constants.FORMULA_RESULT_TYPE.NUMBER:
35
59
  {
36
60
  return 'text-right';
37
61
  }
@@ -41,9 +65,8 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
41
65
  return '';
42
66
  }
43
67
  }
44
- };
45
-
46
- _this.renderOtherColumnFormatter = function () {
68
+ });
69
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderOtherColumnFormatter", function () {
47
70
  var _this$props = _this.props,
48
71
  value = _this$props.value,
49
72
  column = _this$props.column,
@@ -52,42 +75,41 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
52
75
  var array_type = columnData.array_type,
53
76
  array_data = columnData.array_data;
54
77
 
55
- if (!array_type || array_type === CellType.LINK) {
78
+ if (!array_type || array_type === _constants.CellType.LINK) {
56
79
  return null;
57
80
  }
58
81
 
59
- var Formatter = cellFormatterFactory.createFormatter(array_type);
82
+ var Formatter = _cellFormatterFactory.default.createFormatter(array_type);
60
83
 
61
84
  var formatterProps = _this.getFormatterProps(array_type, array_data, collaborators);
62
85
 
63
- if (isArrayFormalColumn(array_type)) {
86
+ if ((0, _columnUtils.isArrayFormalColumn)(array_type)) {
64
87
  formatterProps.value = value;
65
88
  return _this.createColumnFormatter(Formatter, formatterProps);
66
89
  }
67
90
 
68
- var _isSimpleCellFormatterColumn = isSimpleCellFormatter(array_type);
91
+ var _isSimpleCellFormatterColumn = (0, _columnUtils.isSimpleCellFormatter)(array_type);
69
92
 
70
93
  var cellValue = value;
71
94
 
72
95
  if (!Array.isArray(value)) {
73
- cellValue = cellValueValidator(value, array_type) ? [value] : [];
96
+ cellValue = (0, _cellValueValidator.default)(value, array_type) ? [value] : [];
74
97
  }
75
98
 
76
- var contentItemClassName = "formula-formatter-content-item ".concat(_isSimpleCellFormatterColumn ? 'simple-cell-formatter' : '');
77
- return /*#__PURE__*/React.createElement("div", {
99
+ var contentItemClassName = "formula-formatter-content-item " + (_isSimpleCellFormatterColumn ? 'simple-cell-formatter' : '');
100
+ return /*#__PURE__*/_react.default.createElement("div", {
78
101
  className: "dtable-ui formula-formatter multiple"
79
102
  }, cellValue.map(function (v, index) {
80
103
  formatterProps.value = v;
81
- return /*#__PURE__*/React.createElement("div", {
104
+ return /*#__PURE__*/_react.default.createElement("div", {
82
105
  className: contentItemClassName,
83
- key: "formula-formatter-content-item-".concat(index)
106
+ key: "formula-formatter-content-item-" + index
84
107
  }, _this.createColumnFormatter(Formatter, formatterProps));
85
108
  }));
86
- };
87
-
88
- _this.getFormatterProps = function (array_type, array_data, collaborators) {
109
+ });
110
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFormatterProps", function (array_type, array_data, collaborators) {
89
111
  switch (array_type) {
90
- case CellType.DURATION:
112
+ case _constants.CellType.DURATION:
91
113
  {
92
114
  var duration_format = array_data.duration_format;
93
115
  return {
@@ -95,9 +117,9 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
95
117
  };
96
118
  }
97
119
 
98
- case CellType.NUMBER:
99
- case CellType.RATE:
100
- case CellType.GEOLOCATION:
120
+ case _constants.CellType.NUMBER:
121
+ case _constants.CellType.RATE:
122
+ case _constants.CellType.GEOLOCATION:
101
123
  {
102
124
  return {
103
125
  data: array_data
@@ -111,54 +133,53 @@ var FormulaFormatter = /*#__PURE__*/function (_React$Component) {
111
133
  });
112
134
  }
113
135
  }
114
- };
115
-
136
+ });
116
137
  return _this;
117
138
  }
118
139
 
119
- _createClass(FormulaFormatter, [{
120
- key: "createColumnFormatter",
121
- value: function createColumnFormatter(Formatter, formatterProps) {
122
- if (React.isValidElement(Formatter)) {
123
- return React.cloneElement(Formatter, _objectSpread({}, formatterProps));
124
- } else if (isFunction(Formatter)) {
125
- return /*#__PURE__*/React.createElement(Formatter, formatterProps);
126
- }
140
+ var _proto = FormulaFormatter.prototype;
127
141
 
128
- return /*#__PURE__*/React.createElement(TextFormatter, formatterProps);
142
+ _proto.createColumnFormatter = function createColumnFormatter(Formatter, formatterProps) {
143
+ if ( /*#__PURE__*/_react.default.isValidElement(Formatter)) {
144
+ return /*#__PURE__*/_react.default.cloneElement(Formatter, _objectSpread({}, formatterProps));
145
+ } else if ((0, _utils.isFunction)(Formatter)) {
146
+ return /*#__PURE__*/_react.default.createElement(Formatter, formatterProps);
129
147
  }
130
- }, {
131
- key: "render",
132
- value: function render() {
133
- var _this$props2 = this.props,
134
- value = _this$props2.value,
135
- containerClassName = _this$props2.containerClassName,
136
- column = _this$props2.column,
137
- collaborators = _this$props2.collaborators;
138
- var columnData = column.data;
139
- var resultType = columnData.result_type;
140
148
 
141
- if (resultType === FORMULA_RESULT_TYPE.ARRAY) {
142
- return this.renderOtherColumnFormatter();
143
- }
149
+ return /*#__PURE__*/_react.default.createElement(_TextFormatter.default, formatterProps);
150
+ };
144
151
 
145
- if (typeof value === 'object') {
146
- return null;
147
- }
152
+ _proto.render = function render() {
153
+ var _this$props2 = this.props,
154
+ value = _this$props2.value,
155
+ containerClassName = _this$props2.containerClassName,
156
+ column = _this$props2.column,
157
+ collaborators = _this$props2.collaborators;
158
+ var columnData = column.data;
159
+ var resultType = columnData.result_type;
160
+
161
+ if (resultType === _constants.FORMULA_RESULT_TYPE.ARRAY) {
162
+ return this.renderOtherColumnFormatter();
163
+ }
148
164
 
149
- var gridCellClassName = this.getGridCellClassName(resultType);
150
- var formattedValue = getFormulaDisplayString(value, columnData, {
151
- collaborators: collaborators
152
- });
153
- return /*#__PURE__*/React.createElement("div", {
154
- className: "dtable-ui cell-formatter-container formula-formatter ".concat(containerClassName, " ").concat(gridCellClassName),
155
- title: formattedValue,
156
- "aria-label": formattedValue
157
- }, formattedValue);
165
+ if (typeof value === 'object') {
166
+ return null;
158
167
  }
159
- }]);
168
+
169
+ var gridCellClassName = this.getGridCellClassName(resultType);
170
+ var formattedValue = (0, _valueFormatUtils.getFormulaDisplayString)(value, columnData, {
171
+ collaborators: collaborators
172
+ });
173
+ return /*#__PURE__*/_react.default.createElement("div", {
174
+ className: "dtable-ui cell-formatter-container formula-formatter " + containerClassName + " " + gridCellClassName,
175
+ title: formattedValue,
176
+ "aria-label": formattedValue
177
+ }, formattedValue);
178
+ };
160
179
 
161
180
  return FormulaFormatter;
162
- }(React.Component);
181
+ }(_react.default.Component);
163
182
 
164
- export default FormulaFormatter;
183
+ FormulaFormatter.propTypes = propTypes;
184
+ var _default = FormulaFormatter;
185
+ exports.default = _default;