dtable-ui-component 0.1.75-beta1 → 0.1.75-beta10
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/README.md +15 -2
- package/lib/AutoNumberFormatter/index.css +1 -0
- package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
- package/lib/ButtonFormatter/index.css +13 -0
- package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
- package/lib/CTimeFormatter/index.css +1 -0
- package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
- package/{es/components/cell-editor/checkbox-editor.js → lib/CheckboxEditor/index.js} +0 -0
- package/lib/CheckboxFormatter/index.css +1 -0
- package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
- package/lib/CollaboratorEditor/index.css +48 -0
- package/{es/components/cell-editor/collaborator-editor.js → lib/CollaboratorEditor/index.js} +6 -5
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.css +86 -0
- package/{es/components/cell-editor-popover/mb-collaborator-editor-popover.js → lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js} +2 -1
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.css +1 -0
- package/{es/components/cell-editor-popover/pc-collaborator-editor-popover.js → lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js} +2 -1
- package/lib/CollaboratorFormatter/index.css +1 -0
- package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
- package/lib/CollaboratorItem/index.css +49 -0
- package/{es/components/common/collaborator-item.js → lib/CollaboratorItem/index.js} +1 -0
- package/lib/CreatorFormatter/index.css +1 -0
- package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
- package/lib/DateEditor/index.css +4 -0
- package/{es/components/cell-editor/date-editor.js → lib/DateEditor/index.js} +5 -4
- package/{es/css → lib/DateEditor/mb-date-editor-popover}/custom-rc-calendar.css +0 -0
- package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
- package/{es/components/cell-editor-popover/mb-date-editor-popover.js → lib/DateEditor/mb-date-editor-popover/index.js} +10 -10
- package/{es/components/cell-editor-popover → lib/DateEditor}/pc-date-editor-popover.js +2 -2
- package/lib/DateFormatter/index.css +1 -0
- package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
- package/lib/DurationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
- package/{es/components/common/edit-editor-button.js → lib/EditEditorButton/index.js} +0 -0
- package/lib/EmailFormatter/index.css +5 -0
- package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
- package/{es/components/cell-editor-dialog/pc-file-editor-dialog.js → lib/FileEditor/index.js} +10 -10
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-addition/index.js +0 -0
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-addition/pc-file-uploaded-item.js +0 -0
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-preview/index.js +0 -0
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-preview/pc-file-item-preview.js +0 -0
- package/lib/FileFormatter/index.css +29 -0
- package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/excel.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/file.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/music.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pdf.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pic.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/ppt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/txt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/video.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/word.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/excel.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/file.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/music.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pdf.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pic.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/ppt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/txt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/video.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/word.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-192.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-24.png +0 -0
- package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +2 -2
- package/lib/FileItemFormatter/utils.js +72 -0
- package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
- package/{es/utils → lib/FormulaFormatter}/cell-value-validator.js +1 -2
- package/lib/FormulaFormatter/index.css +19 -0
- package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +7 -8
- package/{es/utils/column-utils.js → lib/FormulaFormatter/utils.js} +5 -1
- package/lib/GeolocationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
- package/lib/HtmlLongTextFormatter/index.css +63 -0
- package/{es/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js → lib/HtmlLongTextFormatter/index.js} +2 -1
- package/{es/utils → lib/HtmlLongTextFormatter}/markdown2html.js +0 -0
- package/{es/utils → lib/HtmlLongTextFormatter}/unified/index.js +1 -0
- package/{es/utils → lib/HtmlLongTextFormatter}/vfile/core.js +1 -0
- package/{es/utils → lib/HtmlLongTextFormatter}/vfile/index.js +0 -0
- package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
- package/lib/ImageFormatter/index.css +34 -0
- package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
- package/lib/ImageFormatter/utils.js +7 -0
- package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
- package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
- package/lib/ImagePreviewerLightbox/utils.js +8 -0
- package/lib/LastModifierFormatter/index.css +1 -0
- package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
- package/lib/LinkEditor/index.css +9 -0
- package/{es/components/cell-editor/link-editor.js → lib/LinkEditor/index.js} +10 -9
- package/{es/components/common → lib/LinkEditor}/link-editor-option.js +0 -0
- package/lib/LinkEditor/mb-link-editor-popover/index.css +85 -0
- package/{es/components/cell-editor-popover/mb-link-editor-popover.js → lib/LinkEditor/mb-link-editor-popover/index.js} +2 -1
- package/lib/LinkEditor/pc-link-editor-popover/index.css +63 -0
- package/{es/components/cell-editor-popover/pc-link-editor-popover.js → lib/LinkEditor/pc-link-editor-popover/index.js} +1 -0
- package/lib/LinkFormatter/index.css +27 -0
- package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
- package/{es/css/loading.css → lib/Loading/index.css} +0 -0
- package/{es/components/loading.js → lib/Loading/index.js} +1 -1
- package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +2 -2
- package/{es/components/common/mobile/mb-editor-header.js → lib/MBEditorHeader/index.js} +0 -0
- package/lib/MTimeFormatter/index.css +1 -0
- package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
- package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
- package/lib/MultipleSelectEditor/index.css +9 -0
- package/{es/components/cell-editor/multiple-select-editor.js → lib/MultipleSelectEditor/index.js} +5 -6
- package/lib/MultipleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
- package/{es/components/cell-editor/number-editor.js → lib/NumberEditor/index.js} +2 -2
- package/lib/NumberFormatter/index.css +1 -0
- package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
- package/lib/RateFormatter/index.css +1 -0
- package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
- package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
- package/lib/SimpleLongTextFormatter/index.css +63 -0
- package/{es/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js → lib/SimpleLongTextFormatter/index.js} +2 -1
- package/{es/utils → lib/SimpleLongTextFormatter}/normalize-long-text-value.js +3 -3
- package/lib/SingleSelectEditor/index.css +9 -0
- package/{es/components/cell-editor/single-select-editor.js → lib/SingleSelectEditor/index.js} +5 -6
- package/lib/SingleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
- package/{es/components/cell-editor/text-editor.js → lib/TextEditor/index.js} +2 -2
- package/lib/TextFormatter/index.css +1 -0
- package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
- package/lib/UrlFormatter/index.css +5 -0
- package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
- package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
- package/lib/constants/cell-types.js +25 -54
- package/lib/constants/index.js +5 -26
- package/lib/css/cell-editor.css +0 -608
- package/lib/css/cell-formatter.css +0 -243
- package/lib/css/mb-cell-editor.css +55 -0
- package/lib/formatterConfig/index.js +31 -0
- package/lib/index.js +45 -64
- package/lib/lang/index.js +11 -27
- package/lib/locals/de.js +1 -6
- package/lib/locals/en.js +1 -6
- package/lib/locals/fr.js +1 -6
- package/lib/locals/zh-CN.js +1 -6
- package/lib/select-editor/index.js +4 -0
- package/lib/select-editor/mb-select-editor-popover/index.css +127 -0
- package/{es/components/cell-editor-popover/mb-select-editor-popover.js → lib/select-editor/mb-select-editor-popover/index.js} +12 -11
- package/lib/select-editor/pc-select-editor-popover/index.css +72 -0
- package/{es/components/cell-editor-popover/pc-select-editor-popover.js → lib/select-editor/pc-select-editor-popover/index.js} +1 -0
- package/{es/components/common → lib/select-editor}/select-editor-option.js +0 -0
- package/{es/components/toast → lib/toaster}/alert.js +0 -0
- package/{es/components/toast → lib/toaster}/index.js +0 -0
- package/{es/components/toast → lib/toaster}/toast.js +0 -0
- package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
- package/{es/components/toast → lib/toaster}/toaster.js +0 -0
- package/lib/utils/editor-utils.js +3 -13
- package/lib/utils/number-precision.js +14 -31
- package/lib/utils/utils.js +3 -119
- package/lib/utils/value-format-utils.js +59 -108
- package/package.json +5 -5
- package/es/app.css +0 -20
- package/es/app.js +0 -91
- package/es/assets/images/avatar/default_avatar.png +0 -0
- package/es/components/cell-editor/index.js +0 -9
- package/es/components/cell-formatter/formatter-config.js +0 -31
- package/es/components/cell-formatter/index.js +0 -27
- package/es/constants/cell-types.js +0 -25
- package/es/constants/index.js +0 -48
- package/es/css/cell-editor.css +0 -614
- package/es/css/cell-formatter.css +0 -247
- package/es/index.js +0 -6
- package/es/lang/index.js +0 -50
- package/es/locals/de.js +0 -2
- package/es/locals/en.js +0 -17
- package/es/locals/fr.js +0 -2
- package/es/locals/zh-CN.js +0 -17
- package/es/utils/editor-utils.js +0 -71
- package/es/utils/number-precision.js +0 -163
- package/es/utils/utils.js +0 -116
- package/es/utils/value-format-utils.js +0 -495
- package/lib/app.css +0 -20
- package/lib/app.js +0 -96
- package/lib/assets/images/file/192/excel.png +0 -0
- package/lib/assets/images/file/192/file.png +0 -0
- package/lib/assets/images/file/192/music.png +0 -0
- package/lib/assets/images/file/192/pdf.png +0 -0
- package/lib/assets/images/file/192/pic.png +0 -0
- package/lib/assets/images/file/192/ppt.png +0 -0
- package/lib/assets/images/file/192/txt.png +0 -0
- package/lib/assets/images/file/192/video.png +0 -0
- package/lib/assets/images/file/192/word.png +0 -0
- package/lib/assets/images/file/24/excel.png +0 -0
- package/lib/assets/images/file/24/file.png +0 -0
- package/lib/assets/images/file/24/music.png +0 -0
- package/lib/assets/images/file/24/pdf.png +0 -0
- package/lib/assets/images/file/24/pic.png +0 -0
- package/lib/assets/images/file/24/ppt.png +0 -0
- package/lib/assets/images/file/24/txt.png +0 -0
- package/lib/assets/images/file/24/video.png +0 -0
- package/lib/assets/images/file/24/word.png +0 -0
- package/lib/assets/images/folder/folder-192.png +0 -0
- package/lib/assets/images/folder/folder-24.png +0 -0
- package/lib/components/cell-editor/checkbox-editor.js +0 -111
- package/lib/components/cell-editor/collaborator-editor.js +0 -249
- package/lib/components/cell-editor/date-editor.js +0 -171
- package/lib/components/cell-editor/index.js +0 -40
- package/lib/components/cell-editor/link-editor.js +0 -321
- package/lib/components/cell-editor/multiple-select-editor.js +0 -250
- package/lib/components/cell-editor/number-editor.js +0 -162
- package/lib/components/cell-editor/single-select-editor.js +0 -216
- package/lib/components/cell-editor/text-editor.js +0 -129
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -66
- package/lib/components/cell-editor-dialog/pc-files-addition/index.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-preview/index.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -1
- package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -183
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +0 -262
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +0 -176
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +0 -243
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -124
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +0 -156
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +0 -128
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +0 -157
- package/lib/components/cell-factory/cell-formatter-factory.js +0 -28
- package/lib/components/cell-formatter/auto-number-formatter.js +0 -45
- package/lib/components/cell-formatter/button-formatter.js +0 -66
- package/lib/components/cell-formatter/checkbox-formatter.js +0 -56
- package/lib/components/cell-formatter/collaborator-formatter.js +0 -111
- package/lib/components/cell-formatter/creator-formatter.js +0 -105
- package/lib/components/cell-formatter/ctime-formatter.js +0 -70
- package/lib/components/cell-formatter/date-formatter.js +0 -73
- package/lib/components/cell-formatter/duration-formatter.js +0 -49
- package/lib/components/cell-formatter/email-formatter.js +0 -45
- package/lib/components/cell-formatter/file-formatter.js +0 -77
- package/lib/components/cell-formatter/formatter-config.js +0 -66
- package/lib/components/cell-formatter/formula-formatter.js +0 -189
- package/lib/components/cell-formatter/geolocation-formatter.js +0 -66
- package/lib/components/cell-formatter/image-formatter.js +0 -171
- package/lib/components/cell-formatter/index.js +0 -112
- package/lib/components/cell-formatter/last-modifier-formatter.js +0 -105
- package/lib/components/cell-formatter/link-formatter.js +0 -165
- package/lib/components/cell-formatter/long-text-formatter.js +0 -46
- package/lib/components/cell-formatter/mtime-formatter.js +0 -70
- package/lib/components/cell-formatter/multiple-select-formatter.js +0 -84
- package/lib/components/cell-formatter/number-formatter.js +0 -60
- package/lib/components/cell-formatter/rate-formatter.js +0 -93
- package/lib/components/cell-formatter/single-select-formatter.js +0 -84
- package/lib/components/cell-formatter/text-formatter.js +0 -67
- package/lib/components/cell-formatter/url-formatter.js +0 -45
- package/lib/components/cell-formatter/widgets/file-item-formatter.js +0 -63
- package/lib/components/cell-formatter/widgets/image-previewer-lightbox.js +0 -152
- package/lib/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js +0 -107
- package/lib/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js +0 -110
- package/lib/components/common/collaborator-item.js +0 -79
- package/lib/components/common/edit-editor-button.js +0 -67
- package/lib/components/common/images-lazy-load.js +0 -158
- package/lib/components/common/link-editor-option.js +0 -121
- package/lib/components/common/mobile/mb-editor-header.js +0 -61
- package/lib/components/common/modal-portal.js +0 -51
- package/lib/components/common/select-editor-option.js +0 -122
- package/lib/components/common/select-item.js +0 -73
- package/lib/components/file-uploader/index.js +0 -63
- package/lib/components/loading.js +0 -16
- package/lib/components/toast/alert.js +0 -164
- package/lib/components/toast/index.js +0 -12
- package/lib/components/toast/toast.js +0 -223
- package/lib/components/toast/toastManager.js +0 -189
- package/lib/components/toast/toaster.js +0 -92
- package/lib/css/custom-rc-calendar.css +0 -118
- package/lib/css/image-previewer-ligntbox.css +0 -87
- package/lib/css/loading.css +0 -54
- package/lib/utils/cell-value-validator.js +0 -41
- package/lib/utils/column-utils.js +0 -15
- package/lib/utils/markdown2html.js +0 -68
- package/lib/utils/normalize-long-text-value.js +0 -74
- package/lib/utils/unified/index.js +0 -470
- package/lib/utils/vfile/core.js +0 -172
- package/lib/utils/vfile/index.js +0 -48
|
@@ -1,157 +0,0 @@
|
|
|
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 _lang = require("../../lang");
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
var propTypes = {
|
|
25
|
-
popoverPosition: _propTypes.default.object.isRequired,
|
|
26
|
-
options: _propTypes.default.array.isRequired,
|
|
27
|
-
selectedOptions: _propTypes.default.array.isRequired,
|
|
28
|
-
onOptionItemToggle: _propTypes.default.func.isRequired,
|
|
29
|
-
isSupportNewOption: _propTypes.default.bool,
|
|
30
|
-
onAddNewOption: _propTypes.default.func
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var PCSelectEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
34
|
-
(0, _inheritsLoose2.default)(PCSelectEditorPopover, _React$Component);
|
|
35
|
-
|
|
36
|
-
function PCSelectEditorPopover(props) {
|
|
37
|
-
var _this;
|
|
38
|
-
|
|
39
|
-
_this = _React$Component.call(this, props) || this;
|
|
40
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onValueChanged", function (event) {
|
|
41
|
-
var value = event.target.value;
|
|
42
|
-
|
|
43
|
-
_this.setState({
|
|
44
|
-
searchValue: value
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onInputClick", function (event) {
|
|
48
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
49
|
-
event.stopPropagation();
|
|
50
|
-
});
|
|
51
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onAddNewOption", function () {
|
|
52
|
-
var name = _this.state.searchValue.trim();
|
|
53
|
-
|
|
54
|
-
_this.props.onAddNewOption(name);
|
|
55
|
-
});
|
|
56
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOptionItemToggle", function (item) {
|
|
57
|
-
_this.props.onOptionItemToggle(item);
|
|
58
|
-
});
|
|
59
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFilterOptions", function () {
|
|
60
|
-
var options = _this.props.options;
|
|
61
|
-
|
|
62
|
-
var filter = _this.state.searchValue.toLowerCase();
|
|
63
|
-
|
|
64
|
-
if (!filter) {
|
|
65
|
-
return options;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return options.filter(function (option) {
|
|
69
|
-
return option.name.toString().toLowerCase().indexOf(filter) > -1;
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOptionStyle", function (option) {
|
|
73
|
-
var textColor = option.textColor || null;
|
|
74
|
-
return {
|
|
75
|
-
display: 'inline-block',
|
|
76
|
-
padding: '0px 10px',
|
|
77
|
-
height: '20px',
|
|
78
|
-
lineHeight: '20px',
|
|
79
|
-
borderRadius: '10px',
|
|
80
|
-
fontSize: '13px',
|
|
81
|
-
backgroundColor: option.color,
|
|
82
|
-
color: textColor
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
_this.state = {
|
|
86
|
-
searchValue: ''
|
|
87
|
-
};
|
|
88
|
-
return _this;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var _proto = PCSelectEditorPopover.prototype;
|
|
92
|
-
|
|
93
|
-
_proto.render = function render() {
|
|
94
|
-
var _this2 = this;
|
|
95
|
-
|
|
96
|
-
var options = this.getFilterOptions();
|
|
97
|
-
var _this$props = this.props,
|
|
98
|
-
popoverPosition = _this$props.popoverPosition,
|
|
99
|
-
selectedOptions = _this$props.selectedOptions,
|
|
100
|
-
isSupportNewOption = _this$props.isSupportNewOption;
|
|
101
|
-
var searchValue = this.state.searchValue;
|
|
102
|
-
var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
|
|
103
|
-
position: 'absolute'
|
|
104
|
-
});
|
|
105
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
-
className: "dtable-ui-editor-popover dtable-ui-select-editor-popover",
|
|
107
|
-
style: popoverStyle
|
|
108
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
-
className: "select-options-search"
|
|
110
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
111
|
-
className: "form-control",
|
|
112
|
-
onChange: this.onValueChanged,
|
|
113
|
-
onClick: this.onInputClick,
|
|
114
|
-
placeholder: (0, _lang.getLocale)('Find_an_option')
|
|
115
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
-
className: "select-options-container"
|
|
117
|
-
}, options.length > 0 && options.map(function (option, index) {
|
|
118
|
-
var optionStyle = _this2.getOptionStyle(option);
|
|
119
|
-
|
|
120
|
-
var isSelect = selectedOptions.some(function (selectedOption) {
|
|
121
|
-
return selectedOption.id === option.id;
|
|
122
|
-
});
|
|
123
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
-
key: index,
|
|
125
|
-
className: "select-option-item",
|
|
126
|
-
onClick: _this2.onOptionItemToggle.bind(_this2, option)
|
|
127
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
128
|
-
className: "option-info"
|
|
129
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
-
className: "option-name",
|
|
131
|
-
style: optionStyle
|
|
132
|
-
}, option.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
-
className: "option-checked"
|
|
134
|
-
}, isSelect && /*#__PURE__*/_react.default.createElement("i", {
|
|
135
|
-
className: "dtable-font dtable-icon-check-mark"
|
|
136
|
-
})));
|
|
137
|
-
}), options.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
-
className: "search-option-null"
|
|
139
|
-
}, (0, _lang.getLocale)('No_options_available'))), isSupportNewOption && !!searchValue && /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
-
className: "select-options-add",
|
|
141
|
-
onClick: this.onAddNewOption
|
|
142
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
143
|
-
className: "dtable-font dtable-icon-add-table"
|
|
144
|
-
}), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Add_an_option'), ' ', searchValue)));
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
return PCSelectEditorPopover;
|
|
148
|
-
}(_react.default.Component);
|
|
149
|
-
|
|
150
|
-
(0, _defineProperty2.default)(PCSelectEditorPopover, "defaultProps", {
|
|
151
|
-
popoverPosition: {},
|
|
152
|
-
options: [],
|
|
153
|
-
isShowAddBtn: false
|
|
154
|
-
});
|
|
155
|
-
PCSelectEditorPopover.propTypes = propTypes;
|
|
156
|
-
var _default = PCSelectEditorPopover;
|
|
157
|
-
exports.default = _default;
|
|
@@ -1,28 +0,0 @@
|
|
|
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 _formatterConfig = _interopRequireDefault(require("../cell-formatter/formatter-config"));
|
|
9
|
-
|
|
10
|
-
var CellFormatterFactory = /*#__PURE__*/function () {
|
|
11
|
-
function CellFormatterFactory() {}
|
|
12
|
-
|
|
13
|
-
var _proto = CellFormatterFactory.prototype;
|
|
14
|
-
|
|
15
|
-
_proto.createFormatter = function createFormatter(formatterType) {
|
|
16
|
-
if (_formatterConfig.default[formatterType]) {
|
|
17
|
-
return _formatterConfig.default[formatterType];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return null;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return CellFormatterFactory;
|
|
24
|
-
}();
|
|
25
|
-
|
|
26
|
-
var cellFormatterFactory = new CellFormatterFactory();
|
|
27
|
-
var _default = cellFormatterFactory;
|
|
28
|
-
exports.default = _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
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 _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 propTypes = {
|
|
17
|
-
value: _propTypes.default.string.isRequired,
|
|
18
|
-
containerClassName: _propTypes.default.string
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
var AutoNumberFormatter = /*#__PURE__*/function (_React$Component) {
|
|
22
|
-
(0, _inheritsLoose2.default)(AutoNumberFormatter, _React$Component);
|
|
23
|
-
|
|
24
|
-
function AutoNumberFormatter() {
|
|
25
|
-
return _React$Component.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var _proto = AutoNumberFormatter.prototype;
|
|
29
|
-
|
|
30
|
-
_proto.render = function render() {
|
|
31
|
-
var _this$props = this.props,
|
|
32
|
-
containerClassName = _this$props.containerClassName,
|
|
33
|
-
value = _this$props.value;
|
|
34
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container auto-number-formatter', containerClassName);
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
-
className: classname
|
|
37
|
-
}, value);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return AutoNumberFormatter;
|
|
41
|
-
}(_react.default.Component);
|
|
42
|
-
|
|
43
|
-
AutoNumberFormatter.propTypes = propTypes;
|
|
44
|
-
var _default = AutoNumberFormatter;
|
|
45
|
-
exports.default = _default;
|
|
@@ -1,66 +0,0 @@
|
|
|
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 _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 propTypes = {
|
|
17
|
-
data: _propTypes.default.object,
|
|
18
|
-
containerClassName: _propTypes.default.string,
|
|
19
|
-
optionColors: _propTypes.default.array
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
|
|
23
|
-
(0, _inheritsLoose2.default)(ButtonFormatter, _React$Component);
|
|
24
|
-
|
|
25
|
-
function ButtonFormatter() {
|
|
26
|
-
return _React$Component.apply(this, arguments) || this;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var _proto = ButtonFormatter.prototype;
|
|
30
|
-
|
|
31
|
-
_proto.render = function render() {
|
|
32
|
-
var _this$props = this.props,
|
|
33
|
-
data = _this$props.data,
|
|
34
|
-
containerClassName = _this$props.containerClassName,
|
|
35
|
-
optionColors = _this$props.optionColors;
|
|
36
|
-
|
|
37
|
-
var _ref = data || {},
|
|
38
|
-
button_color = _ref.button_color,
|
|
39
|
-
button_type = _ref.button_type,
|
|
40
|
-
button_name = _ref.button_name;
|
|
41
|
-
|
|
42
|
-
if (!button_type) return null;
|
|
43
|
-
var colorOption = Array.isArray(optionColors) ? optionColors.find(function (item) {
|
|
44
|
-
return item.COLOR === button_color;
|
|
45
|
-
}) || optionColors[0] : {
|
|
46
|
-
COLOR: '#FFFCB5',
|
|
47
|
-
BORDER_COLOR: '#E8E79D',
|
|
48
|
-
TEXT_COLOR: '#202428'
|
|
49
|
-
};
|
|
50
|
-
var btnStyle = {
|
|
51
|
-
backgroundColor: colorOption.COLOR,
|
|
52
|
-
borderColor: colorOption.BORDER_COLOR,
|
|
53
|
-
color: colorOption.TEXT_COLOR
|
|
54
|
-
};
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
-
className: (0, _astroClassname.default)('dtable-ui cell-formatter-container button-formatter', containerClassName),
|
|
57
|
-
style: btnStyle
|
|
58
|
-
}, button_name);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return ButtonFormatter;
|
|
62
|
-
}(_react.default.Component);
|
|
63
|
-
|
|
64
|
-
ButtonFormatter.propTypes = propTypes;
|
|
65
|
-
var _default = ButtonFormatter;
|
|
66
|
-
exports.default = _default;
|
|
@@ -1,56 +0,0 @@
|
|
|
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 _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 propTypes = {
|
|
19
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool]),
|
|
20
|
-
containerClassName: _propTypes.default.string
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var CheckboxFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
24
|
-
(0, _inheritsLoose2.default)(CheckboxFormatter, _React$PureComponent);
|
|
25
|
-
|
|
26
|
-
function CheckboxFormatter() {
|
|
27
|
-
return _React$PureComponent.apply(this, arguments) || this;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var _proto = CheckboxFormatter.prototype;
|
|
31
|
-
|
|
32
|
-
_proto.render = function render() {
|
|
33
|
-
var _this$props = this.props,
|
|
34
|
-
value = _this$props.value,
|
|
35
|
-
containerClassName = _this$props.containerClassName;
|
|
36
|
-
value = value === true ? true : false;
|
|
37
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container checkbox-formatter', containerClassName);
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
-
className: classname
|
|
40
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
41
|
-
className: "checkbox",
|
|
42
|
-
type: "checkbox",
|
|
43
|
-
readOnly: true,
|
|
44
|
-
checked: value
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
return CheckboxFormatter;
|
|
49
|
-
}(_react.default.PureComponent);
|
|
50
|
-
|
|
51
|
-
(0, _defineProperty2.default)(CheckboxFormatter, "defaultProps", {
|
|
52
|
-
value: false
|
|
53
|
-
});
|
|
54
|
-
CheckboxFormatter.propTypes = propTypes;
|
|
55
|
-
var _default = CheckboxFormatter;
|
|
56
|
-
exports.default = _default;
|
|
@@ -1,111 +0,0 @@
|
|
|
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("../common/collaborator-item"));
|
|
21
|
-
|
|
22
|
-
var _default_avatar = _interopRequireDefault(require("../../assets/images/avatar/default_avatar.png"));
|
|
23
|
-
|
|
24
|
-
var propTypes = {
|
|
25
|
-
containerClassName: _propTypes.default.string,
|
|
26
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]).isRequired,
|
|
27
|
-
collaborators: _propTypes.default.arrayOf(_propTypes.default.exact({
|
|
28
|
-
email: _propTypes.default.string.isRequired,
|
|
29
|
-
name: _propTypes.default.string.isRequired,
|
|
30
|
-
contact_email: _propTypes.default.string.isRequired,
|
|
31
|
-
avatar_url: _propTypes.default.string.isRequired
|
|
32
|
-
})),
|
|
33
|
-
enableDeleteCollaborator: _propTypes.default.bool,
|
|
34
|
-
onDeleteCollaborator: _propTypes.default.func
|
|
35
|
-
}; // there will be there conditions
|
|
36
|
-
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
37
|
-
// 2 value is exist, but can't find in collaborators
|
|
38
|
-
// 3 value is exist, typeof value is a string
|
|
39
|
-
// 4 value is exist, typeof value is array
|
|
40
|
-
|
|
41
|
-
var CollaboratorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
42
|
-
(0, _inheritsLoose2.default)(CollaboratorFormatter, _React$PureComponent);
|
|
43
|
-
|
|
44
|
-
function CollaboratorFormatter() {
|
|
45
|
-
var _this;
|
|
46
|
-
|
|
47
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
|
-
args[_key] = arguments[_key];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
52
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCollaborators", function () {
|
|
53
|
-
var _this$props = _this.props,
|
|
54
|
-
value = _this$props.value,
|
|
55
|
-
collaborators = _this$props.collaborators,
|
|
56
|
-
enableDeleteCollaborator = _this$props.enableDeleteCollaborator,
|
|
57
|
-
onDeleteCollaborator = _this$props.onDeleteCollaborator;
|
|
58
|
-
|
|
59
|
-
if (!Array.isArray(value)) {
|
|
60
|
-
value = [value];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return value.map(function (item, index) {
|
|
64
|
-
var collaborator = collaborators.find(function (collaborator) {
|
|
65
|
-
return collaborator.email === item;
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
if (!collaborator) {
|
|
69
|
-
collaborator = {
|
|
70
|
-
name: item,
|
|
71
|
-
avatar_url: _default_avatar.default
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return /*#__PURE__*/_react.default.createElement(_collaboratorItem.default, {
|
|
76
|
-
key: index,
|
|
77
|
-
collaborator: collaborator,
|
|
78
|
-
enableDeleteCollaborator: enableDeleteCollaborator,
|
|
79
|
-
onDeleteCollaborator: onDeleteCollaborator
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
return _this;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
var _proto = CollaboratorFormatter.prototype;
|
|
87
|
-
|
|
88
|
-
_proto.render = function render() {
|
|
89
|
-
var _this$props2 = this.props,
|
|
90
|
-
containerClassName = _this$props2.containerClassName,
|
|
91
|
-
value = _this$props2.value;
|
|
92
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container collaborator-formatter', containerClassName);
|
|
93
|
-
|
|
94
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: classname
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
var collaborators = this.getCollaborators();
|
|
101
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
-
className: classname
|
|
103
|
-
}, collaborators);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
return CollaboratorFormatter;
|
|
107
|
-
}(_react.default.PureComponent);
|
|
108
|
-
|
|
109
|
-
CollaboratorFormatter.propTypes = propTypes;
|
|
110
|
-
var _default = CollaboratorFormatter;
|
|
111
|
-
exports.default = _default;
|
|
@@ -1,105 +0,0 @@
|
|
|
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("../common/collaborator-item"));
|
|
21
|
-
|
|
22
|
-
var _default_avatar = _interopRequireDefault(require("../../assets/images/avatar/default_avatar.png"));
|
|
23
|
-
|
|
24
|
-
var propTypes = {
|
|
25
|
-
containerClassName: _propTypes.default.string,
|
|
26
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]).isRequired,
|
|
27
|
-
collaborators: _propTypes.default.arrayOf(_propTypes.default.exact({
|
|
28
|
-
email: _propTypes.default.string.isRequired,
|
|
29
|
-
name: _propTypes.default.string.isRequired,
|
|
30
|
-
contact_email: _propTypes.default.string.isRequired,
|
|
31
|
-
avatar_url: _propTypes.default.string.isRequired
|
|
32
|
-
}))
|
|
33
|
-
}; // there will be there conditions
|
|
34
|
-
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
35
|
-
// 2 value is exist, but can't find in collaborators
|
|
36
|
-
// 3 value is exist, typeof value is a string
|
|
37
|
-
// 4 value is exist, typeof value is array
|
|
38
|
-
|
|
39
|
-
var CreatorFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
40
|
-
(0, _inheritsLoose2.default)(CreatorFormatter, _React$PureComponent);
|
|
41
|
-
|
|
42
|
-
function CreatorFormatter() {
|
|
43
|
-
var _this;
|
|
44
|
-
|
|
45
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
46
|
-
args[_key] = arguments[_key];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
50
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCollaborators", function () {
|
|
51
|
-
var _this$props = _this.props,
|
|
52
|
-
value = _this$props.value,
|
|
53
|
-
collaborators = _this$props.collaborators;
|
|
54
|
-
|
|
55
|
-
if (!Array.isArray(value)) {
|
|
56
|
-
value = [value];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return value.map(function (item, index) {
|
|
60
|
-
var collaborator = collaborators.find(function (collaborator) {
|
|
61
|
-
return collaborator.email === item;
|
|
62
|
-
}); // the collaborator can be not exist, because the row created by third app
|
|
63
|
-
|
|
64
|
-
if (!collaborator) {
|
|
65
|
-
collaborator = {
|
|
66
|
-
name: item,
|
|
67
|
-
avatar_url: _default_avatar.default
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return /*#__PURE__*/_react.default.createElement(_collaboratorItem.default, {
|
|
72
|
-
key: index,
|
|
73
|
-
collaborator: collaborator
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
return _this;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
var _proto = CreatorFormatter.prototype;
|
|
81
|
-
|
|
82
|
-
_proto.render = function render() {
|
|
83
|
-
var _this$props2 = this.props,
|
|
84
|
-
containerClassName = _this$props2.containerClassName,
|
|
85
|
-
value = _this$props2.value;
|
|
86
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container creator-formatter', containerClassName);
|
|
87
|
-
|
|
88
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
className: classname
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
var collaborators = this.getCollaborators();
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: classname
|
|
97
|
-
}, collaborators);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
return CreatorFormatter;
|
|
101
|
-
}(_react.default.PureComponent);
|
|
102
|
-
|
|
103
|
-
CreatorFormatter.propTypes = propTypes;
|
|
104
|
-
var _default = CreatorFormatter;
|
|
105
|
-
exports.default = _default;
|
|
@@ -1,70 +0,0 @@
|
|
|
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 _moment = _interopRequireDefault(require("moment"));
|
|
21
|
-
|
|
22
|
-
var propTypes = {
|
|
23
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
24
|
-
containerClassName: _propTypes.default.string
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var CTimeFormatter = /*#__PURE__*/function (_React$Component) {
|
|
28
|
-
(0, _inheritsLoose2.default)(CTimeFormatter, _React$Component);
|
|
29
|
-
|
|
30
|
-
function CTimeFormatter() {
|
|
31
|
-
var _this;
|
|
32
|
-
|
|
33
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
|
-
args[_key] = arguments[_key];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatDate", function (date) {
|
|
39
|
-
return (0, _moment.default)(date).format('YYYY-MM-DD HH:mm:ss');
|
|
40
|
-
});
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var _proto = CTimeFormatter.prototype;
|
|
45
|
-
|
|
46
|
-
_proto.render = function render() {
|
|
47
|
-
var _this$props = this.props,
|
|
48
|
-
date = _this$props.value,
|
|
49
|
-
containerClassName = _this$props.containerClassName;
|
|
50
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
51
|
-
|
|
52
|
-
if (date !== '') {
|
|
53
|
-
date = this.formatDate(date);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
-
className: classname
|
|
58
|
-
}, date);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return CTimeFormatter;
|
|
62
|
-
}(_react.default.Component);
|
|
63
|
-
|
|
64
|
-
(0, _defineProperty2.default)(CTimeFormatter, "defaultProps", {
|
|
65
|
-
value: '',
|
|
66
|
-
containerClassName: ''
|
|
67
|
-
});
|
|
68
|
-
CTimeFormatter.propTypes = propTypes;
|
|
69
|
-
var _default = CTimeFormatter;
|
|
70
|
-
exports.default = _default;
|