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.
- package/es/AutoNumberFormatter/index.css +1 -0
- package/es/AutoNumberFormatter/index.js +36 -0
- package/es/ButtonFormatter/index.css +13 -0
- package/es/ButtonFormatter/index.js +56 -0
- package/es/CTimeFormatter/index.css +1 -0
- package/es/CTimeFormatter/index.js +58 -0
- package/es/CheckboxFormatter/index.css +1 -0
- package/es/CheckboxFormatter/index.js +45 -0
- package/es/CollaboratorFormatter/index.css +1 -0
- package/es/CollaboratorFormatter/index.js +91 -0
- package/es/CollaboratorItem/index.css +49 -0
- package/es/CollaboratorItem/index.js +64 -0
- package/es/CreatorFormatter/index.css +1 -0
- package/es/CreatorFormatter/index.js +87 -0
- package/es/DateFormatter/index.css +1 -0
- package/es/DateFormatter/index.js +60 -0
- package/es/DurationFormatter/index.css +1 -0
- package/es/DurationFormatter/index.js +38 -0
- package/es/EmailFormatter/index.css +5 -0
- package/es/EmailFormatter/index.js +36 -0
- package/es/FileFormatter/index.css +29 -0
- package/es/FileFormatter/index.js +64 -0
- package/es/FileItemFormatter/index.js +50 -0
- package/es/FileUploader/index.js +53 -0
- package/es/FormulaFormatter/index.css +19 -0
- package/es/FormulaFormatter/index.js +164 -0
- package/es/GeolocationFormatter/index.css +1 -0
- package/es/GeolocationFormatter/index.js +53 -0
- package/es/ImageFormatter/images-lazy-load.js +150 -0
- package/es/ImageFormatter/index.css +34 -0
- package/es/ImageFormatter/index.js +154 -0
- package/es/ImagePreviewerLightbox/index.css +87 -0
- package/es/ImagePreviewerLightbox/index.js +119 -0
- package/es/LastModifierFormatter/index.css +1 -0
- package/es/LastModifierFormatter/index.js +87 -0
- package/es/LinkFormatter/index.css +27 -0
- package/es/LinkFormatter/index.js +144 -0
- package/es/Loading/index.css +54 -0
- package/es/Loading/index.js +7 -0
- package/es/LongTextFormatter/html-long-text-formatter.js +96 -0
- package/es/LongTextFormatter/index.css +63 -0
- package/es/LongTextFormatter/index.js +29 -0
- package/es/LongTextFormatter/simple-long-text-formatter.js +104 -0
- package/es/MTimeFormatter/index.css +1 -0
- package/es/MTimeFormatter/index.js +58 -0
- package/es/ModalPortal/index.js +44 -0
- package/es/MultipleSelectFormatter/index.css +1 -0
- package/es/MultipleSelectFormatter/index.js +70 -0
- package/es/NumberFormatter/index.css +1 -0
- package/es/NumberFormatter/index.js +47 -0
- package/es/RateFormatter/index.css +1 -0
- package/es/RateFormatter/index.js +80 -0
- package/es/SelectItem/index.js +58 -0
- package/es/SingleSelectFormatter/index.css +1 -0
- package/es/SingleSelectFormatter/index.js +70 -0
- package/es/TextFormatter/index.css +1 -0
- package/es/TextFormatter/index.js +56 -0
- package/es/UrlFormatter/index.css +5 -0
- package/es/UrlFormatter/index.js +36 -0
- package/es/app.css +20 -0
- package/es/app.js +91 -0
- package/es/assets/images/avatar/default_avatar.png +0 -0
- package/es/assets/images/file/192/excel.png +0 -0
- package/es/assets/images/file/192/file.png +0 -0
- package/es/assets/images/file/192/music.png +0 -0
- package/es/assets/images/file/192/pdf.png +0 -0
- package/es/assets/images/file/192/pic.png +0 -0
- package/es/assets/images/file/192/ppt.png +0 -0
- package/es/assets/images/file/192/txt.png +0 -0
- package/es/assets/images/file/192/video.png +0 -0
- package/es/assets/images/file/192/word.png +0 -0
- package/es/assets/images/file/24/excel.png +0 -0
- package/es/assets/images/file/24/file.png +0 -0
- package/es/assets/images/file/24/music.png +0 -0
- package/es/assets/images/file/24/pdf.png +0 -0
- package/es/assets/images/file/24/pic.png +0 -0
- package/es/assets/images/file/24/ppt.png +0 -0
- package/es/assets/images/file/24/txt.png +0 -0
- package/es/assets/images/file/24/video.png +0 -0
- package/es/assets/images/file/24/word.png +0 -0
- package/es/assets/images/folder/folder-192.png +0 -0
- package/es/assets/images/folder/folder-24.png +0 -0
- package/es/cellFormatterFactory/index.js +25 -0
- package/es/components/cell-editor/checkbox-editor.js +104 -0
- package/es/components/cell-editor/collaborator-editor.js +236 -0
- package/es/components/cell-editor/date-editor.js +151 -0
- package/es/components/cell-editor/index.js +9 -0
- package/es/components/cell-editor/link-editor.js +303 -0
- package/es/components/cell-editor/multiple-select-editor.js +237 -0
- package/es/components/cell-editor/number-editor.js +154 -0
- package/es/components/cell-editor/single-select-editor.js +202 -0
- package/es/components/cell-editor/text-editor.js +122 -0
- package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +46 -0
- package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
- package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +177 -0
- package/es/components/cell-editor-popover/mb-date-editor-popover.js +245 -0
- package/es/components/cell-editor-popover/mb-link-editor-popover.js +170 -0
- package/es/components/cell-editor-popover/mb-select-editor-popover.js +230 -0
- package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +109 -0
- package/es/components/cell-editor-popover/pc-date-editor-popover.js +142 -0
- package/es/components/cell-editor-popover/pc-link-editor-popover.js +114 -0
- package/es/components/cell-editor-popover/pc-select-editor-popover.js +143 -0
- package/es/components/common/collaborator-item.js +63 -0
- package/es/components/common/edit-editor-button.js +56 -0
- package/es/components/common/link-editor-option.js +113 -0
- package/es/components/common/mobile/mb-editor-header.js +48 -0
- package/es/components/common/select-editor-option.js +106 -0
- package/es/constants/cell-types.js +25 -0
- package/es/constants/index.js +49 -0
- package/es/css/cell-editor.css +614 -0
- package/es/css/cell-formatter.css +4 -0
- package/es/css/custom-rc-calendar.css +118 -0
- package/es/formatterConfig/index.js +31 -0
- package/es/index.js +31 -0
- package/es/lang/index.js +50 -0
- package/es/locals/de.js +2 -0
- package/es/locals/en.js +17 -0
- package/es/locals/fr.js +2 -0
- package/es/locals/zh-CN.js +17 -0
- package/{lib/toast → es/toaster}/alert.js +0 -0
- package/{lib/toast → es/toaster}/index.js +0 -0
- package/{lib/toast → es/toaster}/toast.js +0 -0
- package/{lib/toast → es/toaster}/toastManager.js +0 -0
- package/{lib/toast → es/toaster}/toaster.js +0 -0
- package/es/utils/cell-value-validator.js +31 -0
- package/es/utils/column-utils.js +7 -0
- package/es/utils/editor-utils.js +71 -0
- package/es/utils/markdown2html.js +62 -0
- package/es/utils/normalize-long-text-value.js +69 -0
- package/es/utils/number-precision.js +164 -0
- package/es/utils/unified/index.js +470 -0
- package/es/utils/utils.js +116 -0
- package/es/utils/value-format-utils.js +497 -0
- package/es/utils/vfile/core.js +172 -0
- package/es/utils/vfile/index.js +48 -0
- package/lib/AutoNumberFormatter/index.js +38 -27
- package/lib/ButtonFormatter/index.js +59 -47
- package/lib/CTimeFormatter/index.js +53 -39
- package/lib/CheckboxFormatter/index.js +48 -35
- package/lib/CollaboratorFormatter/index.js +64 -42
- package/lib/CollaboratorItem/index.js +61 -44
- package/lib/CreatorFormatter/index.js +62 -42
- package/lib/DateFormatter/index.js +55 -40
- package/lib/DurationFormatter/index.js +42 -29
- package/lib/EmailFormatter/index.js +38 -27
- package/lib/FileFormatter/index.js +65 -50
- package/lib/FileItemFormatter/index.js +44 -31
- package/lib/FileUploader/index.js +44 -34
- package/lib/FormulaFormatter/index.js +102 -81
- package/lib/GeolocationFormatter/index.js +50 -35
- package/lib/ImageFormatter/images-lazy-load.js +81 -73
- package/lib/ImageFormatter/index.js +109 -90
- package/lib/ImagePreviewerLightbox/index.js +60 -27
- package/lib/LastModifierFormatter/index.js +62 -42
- package/lib/LinkFormatter/index.js +80 -59
- package/lib/Loading/index.js +13 -4
- package/lib/LongTextFormatter/html-long-text-formatter.js +60 -49
- package/lib/LongTextFormatter/index.js +28 -9
- package/lib/LongTextFormatter/simple-long-text-formatter.js +58 -52
- package/lib/MTimeFormatter/index.js +53 -39
- package/lib/ModalPortal/index.js +37 -30
- package/lib/MultipleSelectFormatter/index.js +55 -39
- package/lib/NumberFormatter/index.js +50 -35
- package/lib/RateFormatter/index.js +52 -37
- package/lib/SelectItem/index.js +46 -31
- package/lib/SingleSelectFormatter/index.js +54 -38
- package/lib/TextFormatter/index.js +44 -31
- package/lib/UrlFormatter/index.js +38 -27
- package/lib/app.js +80 -75
- package/lib/cellFormatterFactory/index.js +20 -17
- package/lib/components/cell-editor/checkbox-editor.js +66 -59
- package/lib/components/cell-editor/collaborator-editor.js +126 -113
- package/lib/components/cell-editor/date-editor.js +119 -99
- package/lib/components/cell-editor/index.js +40 -9
- package/lib/components/cell-editor/link-editor.js +140 -122
- package/lib/components/cell-editor/multiple-select-editor.js +127 -114
- package/lib/components/cell-editor/number-editor.js +86 -78
- package/lib/components/cell-editor/single-select-editor.js +120 -106
- package/lib/components/cell-editor/text-editor.js +72 -65
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +51 -31
- package/lib/components/cell-editor-dialog/pc-files-addition/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +111 -105
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +157 -140
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +109 -103
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +155 -142
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +89 -74
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +102 -88
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +91 -77
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +105 -91
- package/lib/components/common/collaborator-item.js +59 -43
- package/lib/components/common/edit-editor-button.js +39 -28
- package/lib/components/common/link-editor-option.js +71 -63
- package/lib/components/common/mobile/mb-editor-header.js +52 -39
- package/lib/components/common/select-editor-option.js +74 -58
- package/lib/constants/cell-types.js +54 -25
- package/lib/constants/index.js +28 -5
- package/lib/formatterConfig/index.js +59 -28
- package/lib/index.js +139 -31
- package/lib/lang/index.js +27 -11
- package/lib/locals/de.js +6 -1
- package/lib/locals/en.js +6 -1
- package/lib/locals/fr.js +6 -1
- package/lib/locals/zh-CN.js +6 -1
- package/lib/toaster/alert.js +164 -0
- package/lib/toaster/index.js +12 -0
- package/lib/toaster/toast.js +223 -0
- package/lib/toaster/toastManager.js +189 -0
- package/lib/toaster/toaster.js +92 -0
- package/lib/utils/cell-value-validator.js +9 -5
- package/lib/utils/column-utils.js +13 -5
- package/lib/utils/editor-utils.js +13 -3
- package/lib/utils/markdown2html.js +7 -1
- package/lib/utils/normalize-long-text-value.js +6 -1
- package/lib/utils/number-precision.js +32 -13
- package/lib/utils/utils.js +33 -8
- package/lib/utils/value-format-utils.js +110 -58
- package/package.json +5 -5
|
@@ -1,35 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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 _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
+
|
|
20
|
+
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
21
|
+
|
|
22
|
+
var _default_avatar = _interopRequireDefault(require("../assets/images/avatar/default_avatar.png"));
|
|
23
|
+
|
|
24
|
+
require("./index.css");
|
|
25
|
+
|
|
26
|
+
var propTypes = {
|
|
27
|
+
containerClassName: _propTypes.default.string,
|
|
28
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]).isRequired,
|
|
29
|
+
collaborators: _propTypes.default.arrayOf(_propTypes.default.exact({
|
|
30
|
+
email: _propTypes.default.string.isRequired,
|
|
31
|
+
name: _propTypes.default.string.isRequired,
|
|
32
|
+
contact_email: _propTypes.default.string.isRequired,
|
|
33
|
+
avatar_url: _propTypes.default.string.isRequired
|
|
34
|
+
})),
|
|
35
|
+
enableDeleteCollaborator: _propTypes.default.bool,
|
|
36
|
+
onDeleteCollaborator: _propTypes.default.func
|
|
37
|
+
}; // there will be there conditions
|
|
12
38
|
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
13
39
|
// 2 value is exist, but can't find in collaborators
|
|
14
40
|
// 3 value is exist, typeof value is a string
|
|
15
41
|
// 4 value is exist, typeof value is array
|
|
16
|
-
var CollaboratorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
17
|
-
_inherits(CollaboratorFormatter, _React$PureComponent);
|
|
18
42
|
|
|
19
|
-
|
|
43
|
+
var CollaboratorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
44
|
+
(0, _inheritsLoose2.default)(CollaboratorFormatter, _React$PureComponent);
|
|
20
45
|
|
|
21
46
|
function CollaboratorFormatter() {
|
|
22
47
|
var _this;
|
|
23
48
|
|
|
24
|
-
_classCallCheck(this, CollaboratorFormatter);
|
|
25
|
-
|
|
26
49
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
50
|
args[_key] = arguments[_key];
|
|
28
51
|
}
|
|
29
52
|
|
|
30
|
-
_this =
|
|
31
|
-
|
|
32
|
-
_this.getCollaborators = function () {
|
|
53
|
+
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
54
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCollaborators", function () {
|
|
33
55
|
var _this$props = _this.props,
|
|
34
56
|
value = _this$props.value,
|
|
35
57
|
collaborators = _this$props.collaborators,
|
|
@@ -48,44 +70,44 @@ var CollaboratorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
48
70
|
if (!collaborator) {
|
|
49
71
|
collaborator = {
|
|
50
72
|
name: item,
|
|
51
|
-
avatar_url:
|
|
73
|
+
avatar_url: _default_avatar.default
|
|
52
74
|
};
|
|
53
75
|
}
|
|
54
76
|
|
|
55
|
-
return /*#__PURE__*/
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_CollaboratorItem.default, {
|
|
56
78
|
key: index,
|
|
57
79
|
collaborator: collaborator,
|
|
58
80
|
enableDeleteCollaborator: enableDeleteCollaborator,
|
|
59
81
|
onDeleteCollaborator: onDeleteCollaborator
|
|
60
82
|
});
|
|
61
83
|
});
|
|
62
|
-
};
|
|
63
|
-
|
|
84
|
+
});
|
|
64
85
|
return _this;
|
|
65
86
|
}
|
|
66
87
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
76
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
-
className: classname
|
|
78
|
-
});
|
|
79
|
-
}
|
|
88
|
+
var _proto = CollaboratorFormatter.prototype;
|
|
89
|
+
|
|
90
|
+
_proto.render = function render() {
|
|
91
|
+
var _this$props2 = this.props,
|
|
92
|
+
containerClassName = _this$props2.containerClassName,
|
|
93
|
+
value = _this$props2.value;
|
|
94
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container collaborator-formatter', containerClassName);
|
|
80
95
|
|
|
81
|
-
|
|
82
|
-
return /*#__PURE__*/
|
|
96
|
+
if (!value || Array.isArray(value) && value.length === 0) {
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
83
98
|
className: classname
|
|
84
|
-
}
|
|
99
|
+
});
|
|
85
100
|
}
|
|
86
|
-
|
|
101
|
+
|
|
102
|
+
var collaborators = this.getCollaborators();
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
104
|
+
className: classname
|
|
105
|
+
}, collaborators);
|
|
106
|
+
};
|
|
87
107
|
|
|
88
108
|
return CollaboratorFormatter;
|
|
89
|
-
}(
|
|
109
|
+
}(_react.default.PureComponent);
|
|
90
110
|
|
|
91
|
-
|
|
111
|
+
CollaboratorFormatter.propTypes = propTypes;
|
|
112
|
+
var _default = CollaboratorFormatter;
|
|
113
|
+
exports.default = _default;
|
|
@@ -1,64 +1,81 @@
|
|
|
1
|
-
|
|
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 './index.css';
|
|
1
|
+
"use strict";
|
|
7
2
|
|
|
8
|
-
var
|
|
9
|
-
|
|
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"));
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
var propTypes = {
|
|
21
|
+
collaborator: _propTypes.default.shape({
|
|
22
|
+
name: _propTypes.default.string.isRequired,
|
|
23
|
+
avatar_url: _propTypes.default.string.isRequired,
|
|
24
|
+
email: _propTypes.default.string
|
|
25
|
+
}),
|
|
26
|
+
enableDeleteCollaborator: _propTypes.default.bool,
|
|
27
|
+
onDeleteCollaborator: _propTypes.default.func
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var CollaboratorItem = /*#__PURE__*/function (_React$Component) {
|
|
31
|
+
(0, _inheritsLoose2.default)(CollaboratorItem, _React$Component);
|
|
12
32
|
|
|
13
33
|
function CollaboratorItem() {
|
|
14
34
|
var _this;
|
|
15
35
|
|
|
16
|
-
_classCallCheck(this, CollaboratorItem);
|
|
17
|
-
|
|
18
36
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
37
|
args[_key] = arguments[_key];
|
|
20
38
|
}
|
|
21
39
|
|
|
22
|
-
_this =
|
|
23
|
-
|
|
24
|
-
_this.onDeleteCollaborator = function () {
|
|
40
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
41
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onDeleteCollaborator", function () {
|
|
25
42
|
var collaborator = _this.props.collaborator;
|
|
26
43
|
|
|
27
44
|
_this.props.onDeleteCollaborator(collaborator);
|
|
28
|
-
};
|
|
29
|
-
|
|
45
|
+
});
|
|
30
46
|
return _this;
|
|
31
47
|
}
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}]);
|
|
49
|
+
var _proto = CollaboratorItem.prototype;
|
|
50
|
+
|
|
51
|
+
_proto.render = function render() {
|
|
52
|
+
var _this$props = this.props,
|
|
53
|
+
collaborator = _this$props.collaborator,
|
|
54
|
+
enableDeleteCollaborator = _this$props.enableDeleteCollaborator;
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: "dtable-ui collaborator-item"
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
58
|
+
className: "collaborator-avatar"
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
60
|
+
className: "collaborator-avatar-icon",
|
|
61
|
+
alt: collaborator.name,
|
|
62
|
+
src: collaborator.avatar_url
|
|
63
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
64
|
+
className: "collaborator-name"
|
|
65
|
+
}, collaborator.name), enableDeleteCollaborator && /*#__PURE__*/_react.default.createElement("span", {
|
|
66
|
+
className: "collaborator-remove",
|
|
67
|
+
onClick: this.onDeleteCollaborator
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
69
|
+
className: "dtable-font dtable-icon-fork-number"
|
|
70
|
+
})));
|
|
71
|
+
};
|
|
57
72
|
|
|
58
73
|
return CollaboratorItem;
|
|
59
|
-
}(
|
|
74
|
+
}(_react.default.Component);
|
|
60
75
|
|
|
61
|
-
CollaboratorItem
|
|
76
|
+
(0, _defineProperty2.default)(CollaboratorItem, "defaultProps", {
|
|
62
77
|
enableDelete: false
|
|
63
|
-
};
|
|
64
|
-
|
|
78
|
+
});
|
|
79
|
+
CollaboratorItem.propTypes = propTypes;
|
|
80
|
+
var _default = CollaboratorItem;
|
|
81
|
+
exports.default = _default;
|
|
@@ -1,35 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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 _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
+
|
|
20
|
+
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
21
|
+
|
|
22
|
+
var _default_avatar = _interopRequireDefault(require("../assets/images/avatar/default_avatar.png"));
|
|
23
|
+
|
|
24
|
+
require("./index.css");
|
|
25
|
+
|
|
26
|
+
var propTypes = {
|
|
27
|
+
containerClassName: _propTypes.default.string,
|
|
28
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]).isRequired,
|
|
29
|
+
collaborators: _propTypes.default.arrayOf(_propTypes.default.exact({
|
|
30
|
+
email: _propTypes.default.string.isRequired,
|
|
31
|
+
name: _propTypes.default.string.isRequired,
|
|
32
|
+
contact_email: _propTypes.default.string.isRequired,
|
|
33
|
+
avatar_url: _propTypes.default.string.isRequired
|
|
34
|
+
}))
|
|
35
|
+
}; // there will be there conditions
|
|
12
36
|
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
13
37
|
// 2 value is exist, but can't find in collaborators
|
|
14
38
|
// 3 value is exist, typeof value is a string
|
|
15
39
|
// 4 value is exist, typeof value is array
|
|
16
|
-
var CreatorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
17
|
-
_inherits(CreatorFormatter, _React$PureComponent);
|
|
18
40
|
|
|
19
|
-
|
|
41
|
+
var CreatorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
42
|
+
(0, _inheritsLoose2.default)(CreatorFormatter, _React$PureComponent);
|
|
20
43
|
|
|
21
44
|
function CreatorFormatter() {
|
|
22
45
|
var _this;
|
|
23
46
|
|
|
24
|
-
_classCallCheck(this, CreatorFormatter);
|
|
25
|
-
|
|
26
47
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
48
|
args[_key] = arguments[_key];
|
|
28
49
|
}
|
|
29
50
|
|
|
30
|
-
_this =
|
|
31
|
-
|
|
32
|
-
_this.getCollaborators = function () {
|
|
51
|
+
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
52
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCollaborators", function () {
|
|
33
53
|
var _this$props = _this.props,
|
|
34
54
|
value = _this$props.value,
|
|
35
55
|
collaborators = _this$props.collaborators;
|
|
@@ -46,42 +66,42 @@ var CreatorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
46
66
|
if (!collaborator) {
|
|
47
67
|
collaborator = {
|
|
48
68
|
name: item,
|
|
49
|
-
avatar_url:
|
|
69
|
+
avatar_url: _default_avatar.default
|
|
50
70
|
};
|
|
51
71
|
}
|
|
52
72
|
|
|
53
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(_CollaboratorItem.default, {
|
|
54
74
|
key: index,
|
|
55
75
|
collaborator: collaborator
|
|
56
76
|
});
|
|
57
77
|
});
|
|
58
|
-
};
|
|
59
|
-
|
|
78
|
+
});
|
|
60
79
|
return _this;
|
|
61
80
|
}
|
|
62
81
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
72
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className: classname
|
|
74
|
-
});
|
|
75
|
-
}
|
|
82
|
+
var _proto = CreatorFormatter.prototype;
|
|
83
|
+
|
|
84
|
+
_proto.render = function render() {
|
|
85
|
+
var _this$props2 = this.props,
|
|
86
|
+
containerClassName = _this$props2.containerClassName,
|
|
87
|
+
value = _this$props2.value;
|
|
88
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container creator-formatter', containerClassName);
|
|
76
89
|
|
|
77
|
-
|
|
78
|
-
return /*#__PURE__*/
|
|
90
|
+
if (!value || Array.isArray(value) && value.length === 0) {
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
92
|
className: classname
|
|
80
|
-
}
|
|
93
|
+
});
|
|
81
94
|
}
|
|
82
|
-
|
|
95
|
+
|
|
96
|
+
var collaborators = this.getCollaborators();
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
+
className: classname
|
|
99
|
+
}, collaborators);
|
|
100
|
+
};
|
|
83
101
|
|
|
84
102
|
return CreatorFormatter;
|
|
85
|
-
}(
|
|
103
|
+
}(_react.default.PureComponent);
|
|
86
104
|
|
|
87
|
-
|
|
105
|
+
CreatorFormatter.propTypes = propTypes;
|
|
106
|
+
var _default = CreatorFormatter;
|
|
107
|
+
exports.default = _default;
|
|
@@ -1,60 +1,75 @@
|
|
|
1
|
-
|
|
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 { getDateDisplayString } from '../utils/value-format-utils';
|
|
8
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
var
|
|
11
|
-
|
|
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 _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
+
|
|
20
|
+
var _valueFormatUtils = require("../utils/value-format-utils");
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
var propTypes = {
|
|
25
|
+
value: _propTypes.default.string,
|
|
26
|
+
format: _propTypes.default.string,
|
|
27
|
+
containerClassName: _propTypes.default.string
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var DateFormatter = /*#__PURE__*/function (_React$Component) {
|
|
31
|
+
(0, _inheritsLoose2.default)(DateFormatter, _React$Component);
|
|
14
32
|
|
|
15
33
|
function DateFormatter() {
|
|
16
34
|
var _this;
|
|
17
35
|
|
|
18
|
-
_classCallCheck(this, DateFormatter);
|
|
19
|
-
|
|
20
36
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
37
|
args[_key] = arguments[_key];
|
|
22
38
|
}
|
|
23
39
|
|
|
24
|
-
_this =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
|
|
40
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
41
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatDate", function (date, format) {
|
|
42
|
+
return (0, _valueFormatUtils.getDateDisplayString)(date, format);
|
|
43
|
+
});
|
|
30
44
|
return _this;
|
|
31
45
|
}
|
|
32
46
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: classname
|
|
48
|
-
}, date);
|
|
47
|
+
var _proto = DateFormatter.prototype;
|
|
48
|
+
|
|
49
|
+
_proto.render = function render() {
|
|
50
|
+
var _this$props = this.props,
|
|
51
|
+
date = _this$props.value,
|
|
52
|
+
format = _this$props.format,
|
|
53
|
+
containerClassName = _this$props.containerClassName;
|
|
54
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container date-formatter', containerClassName);
|
|
55
|
+
|
|
56
|
+
if (date !== '') {
|
|
57
|
+
date = this.formatDate(date, format);
|
|
49
58
|
}
|
|
50
|
-
|
|
59
|
+
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: classname
|
|
62
|
+
}, date);
|
|
63
|
+
};
|
|
51
64
|
|
|
52
65
|
return DateFormatter;
|
|
53
|
-
}(
|
|
66
|
+
}(_react.default.Component);
|
|
54
67
|
|
|
55
|
-
DateFormatter
|
|
68
|
+
(0, _defineProperty2.default)(DateFormatter, "defaultProps", {
|
|
56
69
|
value: '',
|
|
57
70
|
format: 'YYYY-MM-DD',
|
|
58
71
|
containerClassName: ''
|
|
59
|
-
};
|
|
60
|
-
|
|
72
|
+
});
|
|
73
|
+
DateFormatter.propTypes = propTypes;
|
|
74
|
+
var _default = DateFormatter;
|
|
75
|
+
exports.default = _default;
|
|
@@ -1,38 +1,51 @@
|
|
|
1
|
-
|
|
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 { getDurationDisplayString } from '../utils/value-format-utils';
|
|
8
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
var
|
|
11
|
-
_inherits(DurationFormatter, _React$Component);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
12
4
|
|
|
13
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
var _valueFormatUtils = require("../utils/value-format-utils");
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
var propTypes = {
|
|
21
|
+
value: _propTypes.default.number,
|
|
22
|
+
format: _propTypes.default.string,
|
|
23
|
+
containerClassName: _propTypes.default.string
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var DurationFormatter = /*#__PURE__*/function (_React$Component) {
|
|
27
|
+
(0, _inheritsLoose2.default)(DurationFormatter, _React$Component);
|
|
28
|
+
|
|
29
|
+
function DurationFormatter() {
|
|
30
|
+
return _React$Component.apply(this, arguments) || this;
|
|
19
31
|
}
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}]);
|
|
33
|
+
var _proto = DurationFormatter.prototype;
|
|
34
|
+
|
|
35
|
+
_proto.render = function render() {
|
|
36
|
+
var _this$props = this.props,
|
|
37
|
+
value = _this$props.value,
|
|
38
|
+
containerClassName = _this$props.containerClassName,
|
|
39
|
+
format = _this$props.format;
|
|
40
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container duration-formatter', containerClassName);
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
+
className: classname
|
|
43
|
+
}, (0, _valueFormatUtils.getDurationDisplayString)(value, format));
|
|
44
|
+
};
|
|
34
45
|
|
|
35
46
|
return DurationFormatter;
|
|
36
|
-
}(
|
|
47
|
+
}(_react.default.Component);
|
|
37
48
|
|
|
38
|
-
|
|
49
|
+
DurationFormatter.propTypes = propTypes;
|
|
50
|
+
var _default = DurationFormatter;
|
|
51
|
+
exports.default = _default;
|