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,183 +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
|
-
var _mbEditorHeader = _interopRequireDefault(require("../common/mobile/mb-editor-header"));
|
|
21
|
-
|
|
22
|
-
var propTypes = {
|
|
23
|
-
isReadOnly: _propTypes.default.bool.isRequired,
|
|
24
|
-
value: _propTypes.default.array.isRequired,
|
|
25
|
-
column: _propTypes.default.object.isRequired,
|
|
26
|
-
collaborators: _propTypes.default.array.isRequired,
|
|
27
|
-
onCollaboratorItemToggle: _propTypes.default.func.isRequired,
|
|
28
|
-
onClosePopover: _propTypes.default.func
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var MBCollaboratorEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
32
|
-
(0, _inheritsLoose2.default)(MBCollaboratorEditorPopover, _React$Component);
|
|
33
|
-
|
|
34
|
-
function MBCollaboratorEditorPopover(props) {
|
|
35
|
-
var _this;
|
|
36
|
-
|
|
37
|
-
_this = _React$Component.call(this, props) || this;
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleHistaryBack", function (e) {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
|
|
41
|
-
_this.props.onClosePopover();
|
|
42
|
-
});
|
|
43
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onContainerClick", function (event) {
|
|
44
|
-
if (_this.editorPopover && _this.editorPopover.contains(event.target)) {
|
|
45
|
-
event.stopPropagation();
|
|
46
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onChangeSearch", function (event) {
|
|
51
|
-
var searchVal = _this.state.searchVal;
|
|
52
|
-
|
|
53
|
-
if (searchVal === event.target.value) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
searchVal = event.target.value;
|
|
58
|
-
|
|
59
|
-
_this.setState({
|
|
60
|
-
searchVal: searchVal
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSelectedCollaborators", function () {
|
|
64
|
-
var _this$props = _this.props,
|
|
65
|
-
value = _this$props.value,
|
|
66
|
-
collaborators = _this$props.collaborators;
|
|
67
|
-
|
|
68
|
-
if (!Array.isArray(value)) {
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return collaborators.filter(function (collaborator) {
|
|
73
|
-
return value.indexOf(collaborator.email) > -1;
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFilteredCollaborators", function () {
|
|
77
|
-
var collaborators = _this.props.collaborators;
|
|
78
|
-
var searchVal = _this.state.searchVal;
|
|
79
|
-
return searchVal ? collaborators.filter(function (item) {
|
|
80
|
-
return item.name.indexOf(searchVal) > -1;
|
|
81
|
-
}) : collaborators;
|
|
82
|
-
});
|
|
83
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSelectCollaborator", function (collaborator) {
|
|
84
|
-
_this.props.onCollaboratorItemToggle(collaborator);
|
|
85
|
-
});
|
|
86
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRemoveCollaborator", function (collaborator) {
|
|
87
|
-
_this.props.onCollaboratorItemToggle(collaborator);
|
|
88
|
-
});
|
|
89
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderFilteredCollaborators", function (collaborators) {
|
|
90
|
-
var value = _this.props.value;
|
|
91
|
-
return collaborators.map(function (collaborator, index) {
|
|
92
|
-
var isSelect = value.some(function (item) {
|
|
93
|
-
return item === collaborator.email;
|
|
94
|
-
});
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: "mb-collaborator-option-item",
|
|
97
|
-
key: index,
|
|
98
|
-
onMouseDown: _this.onSelectCollaborator.bind((0, _assertThisInitialized2.default)(_this), collaborator)
|
|
99
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
100
|
-
className: "mb-collaborator-info"
|
|
101
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
102
|
-
className: "collaborator-avatar"
|
|
103
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
104
|
-
src: collaborator.avatar_url,
|
|
105
|
-
width: "24",
|
|
106
|
-
height: "24",
|
|
107
|
-
alt: "avatar"
|
|
108
|
-
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
109
|
-
className: "collaborator-name"
|
|
110
|
-
}, collaborator.name)), isSelect && /*#__PURE__*/_react.default.createElement("i", {
|
|
111
|
-
className: "mb-collaborator-checked dtable-font dtable-icon-check-mark"
|
|
112
|
-
}));
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setEditorPopover", function (editorPopover) {
|
|
116
|
-
_this.editorPopover = editorPopover;
|
|
117
|
-
});
|
|
118
|
-
_this.state = {
|
|
119
|
-
searchVal: ''
|
|
120
|
-
};
|
|
121
|
-
return _this;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
var _proto = MBCollaboratorEditorPopover.prototype;
|
|
125
|
-
|
|
126
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
127
|
-
history.pushState(null, null, '#'); // eslint-disable-line
|
|
128
|
-
|
|
129
|
-
window.addEventListener('popstate', this.handleHistaryBack, false);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
133
|
-
window.removeEventListener('popstate', this.handleHistaryBack, false);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
_proto.render = function render() {
|
|
137
|
-
var column = this.props.column;
|
|
138
|
-
var searchVal = this.state.searchVal;
|
|
139
|
-
var filteredCollaborators = this.getFilteredCollaborators();
|
|
140
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
141
|
-
ref: this.setEditorPopover,
|
|
142
|
-
className: "dtable-ui-mb-editor-popover mb-collaborator-editor-popover",
|
|
143
|
-
onClick: this.onContainerClick
|
|
144
|
-
}, /*#__PURE__*/_react.default.createElement(_mbEditorHeader.default, {
|
|
145
|
-
title: column.name,
|
|
146
|
-
leftContent: /*#__PURE__*/_react.default.createElement("i", {
|
|
147
|
-
className: "dtable-font dtable-icon-return"
|
|
148
|
-
}),
|
|
149
|
-
rightContent: /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Done')),
|
|
150
|
-
onLeftClick: this.props.onClosePopover,
|
|
151
|
-
onRightClick: this.props.onClosePopover
|
|
152
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
153
|
-
className: "dtable-ui-mb-editor-body dtable-ui-mb-collaborator-editor-body"
|
|
154
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
155
|
-
className: "mb-search-collaborator-items"
|
|
156
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
157
|
-
className: "form-control",
|
|
158
|
-
type: "text",
|
|
159
|
-
placeholder: (0, _lang.getLocale)('Find_a_collaborator'),
|
|
160
|
-
value: searchVal,
|
|
161
|
-
onChange: this.onChangeSearch,
|
|
162
|
-
onClick: this.onInputClick
|
|
163
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
-
className: "mb-collaborators-container"
|
|
165
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
-
className: "title"
|
|
167
|
-
}, (0, _lang.getLocale)('Choose_a_collaborator')), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
-
className: "content"
|
|
169
|
-
}, filteredCollaborators.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
-
className: "search-result-none"
|
|
171
|
-
}, (0, _lang.getLocale)('No_collaborators_avaliable')), filteredCollaborators.length > 0 && this.renderFilteredCollaborators(filteredCollaborators)))));
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
return MBCollaboratorEditorPopover;
|
|
175
|
-
}(_react.default.Component);
|
|
176
|
-
|
|
177
|
-
(0, _defineProperty2.default)(MBCollaboratorEditorPopover, "defaultProps", {
|
|
178
|
-
isReadOnly: false,
|
|
179
|
-
value: []
|
|
180
|
-
});
|
|
181
|
-
MBCollaboratorEditorPopover.propTypes = propTypes;
|
|
182
|
-
var _default = MBCollaboratorEditorPopover;
|
|
183
|
-
exports.default = _default;
|
|
@@ -1,262 +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 _antdMobile = require("antd-mobile");
|
|
19
|
-
|
|
20
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
21
|
-
|
|
22
|
-
var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar"));
|
|
23
|
-
|
|
24
|
-
var SeaDatePicker = _interopRequireWildcard(require("@seafile/seafile-calendar/lib/Picker"));
|
|
25
|
-
|
|
26
|
-
var _lang = require("../../lang");
|
|
27
|
-
|
|
28
|
-
var _editorUtils = require("../../utils/editor-utils");
|
|
29
|
-
|
|
30
|
-
var _mbEditorHeader = _interopRequireDefault(require("../common/mobile/mb-editor-header"));
|
|
31
|
-
|
|
32
|
-
require("@seafile/seafile-calendar/assets/index.css");
|
|
33
|
-
|
|
34
|
-
require("../../css/custom-rc-calendar.css");
|
|
35
|
-
|
|
36
|
-
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); }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
var propTypes = {
|
|
41
|
-
isReadOnly: _propTypes.default.bool,
|
|
42
|
-
lang: _propTypes.default.string.isRequired,
|
|
43
|
-
value: _propTypes.default.string,
|
|
44
|
-
dateFormat: _propTypes.default.string.isRequired,
|
|
45
|
-
showHourAndMinute: _propTypes.default.bool.isRequired,
|
|
46
|
-
column: _propTypes.default.object.isRequired,
|
|
47
|
-
onValueChanged: _propTypes.default.func.isRequired
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
51
|
-
(0, _inheritsLoose2.default)(DateEidtorPopover, _React$PureComponent);
|
|
52
|
-
|
|
53
|
-
function DateEidtorPopover(props) {
|
|
54
|
-
var _this;
|
|
55
|
-
|
|
56
|
-
_this = _React$PureComponent.call(this, props) || this;
|
|
57
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleHistaryBack", function (e) {
|
|
58
|
-
e.preventDefault();
|
|
59
|
-
|
|
60
|
-
_this.closePopover();
|
|
61
|
-
});
|
|
62
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDateChange", function (date) {
|
|
63
|
-
var _this$props = _this.props,
|
|
64
|
-
dateFormat = _this$props.dateFormat,
|
|
65
|
-
showHourAndMinute = _this$props.showHourAndMinute;
|
|
66
|
-
var newValue = (0, _moment.default)(date);
|
|
67
|
-
|
|
68
|
-
if (showHourAndMinute) {
|
|
69
|
-
var datePickerValue = _this.state.datePickerValue;
|
|
70
|
-
var HM = datePickerValue.format('HH:mm');
|
|
71
|
-
var format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
72
|
-
|
|
73
|
-
var newDate = (0, _moment.default)(date).format(format) + ' ' + HM;
|
|
74
|
-
newValue = (0, _moment.default)(newDate);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
_this.setState({
|
|
78
|
-
datePickerValue: (0, _moment.default)(date)
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
_this.props.onValueChanged(newValue.format(dateFormat));
|
|
82
|
-
});
|
|
83
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTimeChange", function (time) {
|
|
84
|
-
var datePickerValue = _this.state.datePickerValue;
|
|
85
|
-
var dateFormat = _this.props.dateFormat;
|
|
86
|
-
var format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
87
|
-
|
|
88
|
-
var YMD = datePickerValue.format(format);
|
|
89
|
-
var newDate = YMD + ' ' + (0, _moment.default)(time).format('HH:mm');
|
|
90
|
-
var newValue = (0, _moment.default)(newDate);
|
|
91
|
-
|
|
92
|
-
_this.setState({
|
|
93
|
-
datePickerValue: newValue
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
_this.props.onValueChanged(datePickerValue.format(dateFormat));
|
|
97
|
-
});
|
|
98
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "closePopover", function () {
|
|
99
|
-
_this.props.onClosePopover();
|
|
100
|
-
});
|
|
101
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deleteDate", function () {
|
|
102
|
-
_this.props.onValueChanged('');
|
|
103
|
-
|
|
104
|
-
_this.closePopover();
|
|
105
|
-
});
|
|
106
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onChange", function (value) {
|
|
107
|
-
if (!value) return;
|
|
108
|
-
var dateFormat = _this.props.dateFormat;
|
|
109
|
-
|
|
110
|
-
_this.setState({
|
|
111
|
-
datePickerValue: value
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
_this.props.onValueChanged(value.format(dateFormat));
|
|
115
|
-
});
|
|
116
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onContainerClick", function (event) {
|
|
117
|
-
if (_this.editorPopover && _this.editorPopover.contains(event.target)) {
|
|
118
|
-
event.stopPropagation();
|
|
119
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setEditorPopover", function (editorPopover) {
|
|
124
|
-
_this.editorPopover = editorPopover;
|
|
125
|
-
});
|
|
126
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCalendarContainer", function () {
|
|
127
|
-
return _this.calendarContainerRef.current;
|
|
128
|
-
});
|
|
129
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCalender", function () {
|
|
130
|
-
var _this$props2 = _this.props,
|
|
131
|
-
dateFormat = _this$props2.dateFormat,
|
|
132
|
-
lang = _this$props2.lang;
|
|
133
|
-
var defaultValue = (0, _moment.default)().clone();
|
|
134
|
-
return /*#__PURE__*/_react.default.createElement(_seafileCalendar.default, {
|
|
135
|
-
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
136
|
-
format: dateFormat,
|
|
137
|
-
defaultValue: defaultValue,
|
|
138
|
-
dateInputPlaceholder: (0, _lang.getLocale)('Please_input'),
|
|
139
|
-
showDateInput: false,
|
|
140
|
-
focusablePanel: false,
|
|
141
|
-
showToday: false,
|
|
142
|
-
showTime: false,
|
|
143
|
-
style: {
|
|
144
|
-
width: '100%',
|
|
145
|
-
fontSize: '14px'
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderDataPicker", function () {
|
|
150
|
-
var dateFormat = _this.props.dateFormat;
|
|
151
|
-
var datePickerValue = _this.state.datePickerValue;
|
|
152
|
-
|
|
153
|
-
var calendar = _this.getCalender();
|
|
154
|
-
|
|
155
|
-
return /*#__PURE__*/_react.default.createElement(SeaDatePicker, {
|
|
156
|
-
open: true,
|
|
157
|
-
style: {
|
|
158
|
-
width: '100%'
|
|
159
|
-
},
|
|
160
|
-
calendar: calendar,
|
|
161
|
-
value: datePickerValue,
|
|
162
|
-
getCalendarContainer: _this.getCalendarContainer,
|
|
163
|
-
onChange: _this.onChange
|
|
164
|
-
}, function (_ref) {
|
|
165
|
-
var value = _ref.value;
|
|
166
|
-
value = value && value.format(dateFormat);
|
|
167
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
168
|
-
tabIndex: "0",
|
|
169
|
-
onFocus: _this.onReadOnlyFocus
|
|
170
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
171
|
-
placeholder: (0, _lang.getLocale)('Please_select'),
|
|
172
|
-
readOnly: true,
|
|
173
|
-
tabIndex: "-1",
|
|
174
|
-
className: "form-control",
|
|
175
|
-
value: value || ''
|
|
176
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
-
ref: _this.calendarContainerRef,
|
|
178
|
-
style: {
|
|
179
|
-
height: '22rem'
|
|
180
|
-
}
|
|
181
|
-
}));
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
_this.state = {
|
|
185
|
-
open: true,
|
|
186
|
-
datePickerValue: props.value ? (0, _moment.default)(props.value) : (0, _moment.default)().clone()
|
|
187
|
-
};
|
|
188
|
-
_this.calendarContainerRef = /*#__PURE__*/_react.default.createRef();
|
|
189
|
-
return _this;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
var _proto = DateEidtorPopover.prototype;
|
|
193
|
-
|
|
194
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
195
|
-
history.pushState(null, null, '#'); // eslint-disable-line
|
|
196
|
-
|
|
197
|
-
window.addEventListener('popstate', this.handleHistaryBack, false);
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
201
|
-
window.removeEventListener('popstate', this.handleHistaryBack, false);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
_proto.render = function render() {
|
|
205
|
-
var _this$props3 = this.props,
|
|
206
|
-
lang = _this$props3.lang,
|
|
207
|
-
column = _this$props3.column,
|
|
208
|
-
dateFormat = _this$props3.dateFormat,
|
|
209
|
-
showHourAndMinute = _this$props3.showHourAndMinute;
|
|
210
|
-
var leftFormat = dateFormat.split(' ')[0];
|
|
211
|
-
var rightFormat = dateFormat.split(' ')[1];
|
|
212
|
-
var datePickerValue = this.state.datePickerValue;
|
|
213
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
214
|
-
ref: this.setEditorPopover,
|
|
215
|
-
className: "dtable-ui-mb-editor-popover mb-date-editor-popover",
|
|
216
|
-
onClick: this.onContainerClick
|
|
217
|
-
}, /*#__PURE__*/_react.default.createElement(_mbEditorHeader.default, {
|
|
218
|
-
title: column.name,
|
|
219
|
-
leftContent: /*#__PURE__*/_react.default.createElement("i", {
|
|
220
|
-
className: "dtable-font dtable-icon-return"
|
|
221
|
-
}),
|
|
222
|
-
rightContent: /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Done')),
|
|
223
|
-
onLeftClick: this.props.onClosePopover,
|
|
224
|
-
onRightClick: this.props.onClosePopover
|
|
225
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
-
className: "dtable-ui-mb-editor-body dtable-ui-mb-date-editor-body"
|
|
227
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
228
|
-
className: "mb-date-editor-input"
|
|
229
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
230
|
-
className: "date-input"
|
|
231
|
-
}, /*#__PURE__*/_react.default.createElement(_antdMobile.DatePicker, {
|
|
232
|
-
mode: "date",
|
|
233
|
-
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
234
|
-
value: this.state.value,
|
|
235
|
-
onChange: this.handleDateChange
|
|
236
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
237
|
-
className: "date-input-day"
|
|
238
|
-
}, datePickerValue && datePickerValue.format(leftFormat)))), showHourAndMinute && /*#__PURE__*/_react.default.createElement("div", {
|
|
239
|
-
className: "date-input"
|
|
240
|
-
}, /*#__PURE__*/_react.default.createElement(_antdMobile.DatePicker, {
|
|
241
|
-
mode: "time",
|
|
242
|
-
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
243
|
-
value: this.state.value,
|
|
244
|
-
onChange: this.handleTimeChange
|
|
245
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
246
|
-
className: "date-input-day"
|
|
247
|
-
}, datePickerValue && datePickerValue.format(rightFormat))))), /*#__PURE__*/_react.default.createElement("div", {
|
|
248
|
-
className: "dtable-ui mb-date-editor-picker"
|
|
249
|
-
}, this.renderDataPicker()), /*#__PURE__*/_react.default.createElement("div", {
|
|
250
|
-
className: "mb-date-editor-clear"
|
|
251
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
252
|
-
onClick: this.deleteDate,
|
|
253
|
-
className: "clear-date"
|
|
254
|
-
}, (0, _lang.getLocale)('Clear')))));
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
return DateEidtorPopover;
|
|
258
|
-
}(_react.default.PureComponent);
|
|
259
|
-
|
|
260
|
-
DateEidtorPopover.propTypes = propTypes;
|
|
261
|
-
var _default = DateEidtorPopover;
|
|
262
|
-
exports.default = _default;
|
|
@@ -1,176 +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
|
-
var _mbEditorHeader = _interopRequireDefault(require("../common/mobile/mb-editor-header"));
|
|
21
|
-
|
|
22
|
-
var propTypes = {
|
|
23
|
-
isReadOnly: _propTypes.default.bool.isRequired,
|
|
24
|
-
value: _propTypes.default.array.isRequired,
|
|
25
|
-
column: _propTypes.default.object.isRequired,
|
|
26
|
-
options: _propTypes.default.array.isRequired,
|
|
27
|
-
onOptionItemToggle: _propTypes.default.func.isRequired,
|
|
28
|
-
onClosePopover: _propTypes.default.func
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var MBLinkEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
32
|
-
(0, _inheritsLoose2.default)(MBLinkEditorPopover, _React$Component);
|
|
33
|
-
|
|
34
|
-
function MBLinkEditorPopover(props) {
|
|
35
|
-
var _this;
|
|
36
|
-
|
|
37
|
-
_this = _React$Component.call(this, props) || this;
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleHistaryBack", function (e) {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
|
|
41
|
-
_this.props.onClosePopover();
|
|
42
|
-
});
|
|
43
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onContainerClick", function (event) {
|
|
44
|
-
if (_this.editorPopover && _this.editorPopover.contains(event.target)) {
|
|
45
|
-
event.stopPropagation();
|
|
46
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onChangeSearch", function (event) {
|
|
51
|
-
var searchVal = _this.state.searchVal;
|
|
52
|
-
|
|
53
|
-
if (searchVal === event.target.value) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
searchVal = event.target.value;
|
|
58
|
-
|
|
59
|
-
_this.setState({
|
|
60
|
-
searchVal: searchVal
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSelectedOptions", function () {
|
|
64
|
-
var _this$props = _this.props,
|
|
65
|
-
value = _this$props.value,
|
|
66
|
-
options = _this$props.options;
|
|
67
|
-
|
|
68
|
-
if (!Array.isArray(value)) {
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return options.filter(function (option) {
|
|
73
|
-
return value.indexOf(option.email) > -1;
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFilterOptions", function () {
|
|
77
|
-
var options = _this.props.options;
|
|
78
|
-
var searchVal = _this.state.searchVal;
|
|
79
|
-
return searchVal ? options.filter(function (item) {
|
|
80
|
-
return item.name.indexOf(searchVal) > -1;
|
|
81
|
-
}) : options;
|
|
82
|
-
});
|
|
83
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSelectOption", function (option) {
|
|
84
|
-
_this.props.onOptionItemToggle(option);
|
|
85
|
-
});
|
|
86
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRemoveOption", function (option) {
|
|
87
|
-
_this.props.onOptionItemToggle(option);
|
|
88
|
-
});
|
|
89
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderFilteredOptions", function (options) {
|
|
90
|
-
var value = _this.props.value;
|
|
91
|
-
return options.map(function (option, index) {
|
|
92
|
-
var isSelect = value.some(function (item) {
|
|
93
|
-
return item === option.id;
|
|
94
|
-
});
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: "mb-link-option-item",
|
|
97
|
-
key: index,
|
|
98
|
-
onMouseDown: _this.onSelectOption.bind((0, _assertThisInitialized2.default)(_this), option)
|
|
99
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
100
|
-
className: "mb-option-info"
|
|
101
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
102
|
-
className: "option-name"
|
|
103
|
-
}, option.name)), isSelect && /*#__PURE__*/_react.default.createElement("i", {
|
|
104
|
-
className: "mb-option-checked dtable-font dtable-icon-check-mark"
|
|
105
|
-
}));
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setEditorPopover", function (editorPopover) {
|
|
109
|
-
_this.editorPopover = editorPopover;
|
|
110
|
-
});
|
|
111
|
-
_this.state = {
|
|
112
|
-
searchVal: ''
|
|
113
|
-
};
|
|
114
|
-
return _this;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
var _proto = MBLinkEditorPopover.prototype;
|
|
118
|
-
|
|
119
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
120
|
-
history.pushState(null, null, '#'); // eslint-disable-line
|
|
121
|
-
|
|
122
|
-
window.addEventListener('popstate', this.handleHistaryBack, false);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
126
|
-
window.removeEventListener('popstate', this.handleHistaryBack, false);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
_proto.render = function render() {
|
|
130
|
-
var column = this.props.column;
|
|
131
|
-
var searchVal = this.state.searchVal;
|
|
132
|
-
var filterOptions = this.getFilterOptions();
|
|
133
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
-
ref: this.setEditorPopover,
|
|
135
|
-
className: "dtable-ui-mb-editor-popover mb-link-editor-popover",
|
|
136
|
-
onClick: this.onContainerClick
|
|
137
|
-
}, /*#__PURE__*/_react.default.createElement(_mbEditorHeader.default, {
|
|
138
|
-
title: column.name,
|
|
139
|
-
leftContent: /*#__PURE__*/_react.default.createElement("i", {
|
|
140
|
-
className: "dtable-font dtable-icon-return"
|
|
141
|
-
}),
|
|
142
|
-
rightContent: /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Done')),
|
|
143
|
-
onLeftClick: this.props.onClosePopover,
|
|
144
|
-
onRightClick: this.props.onClosePopover
|
|
145
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
146
|
-
className: "dtable-ui-mb-editor-body dtable-ui-mb-link-editor-body"
|
|
147
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
-
className: "mb-search-link-items"
|
|
149
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
150
|
-
className: "form-control",
|
|
151
|
-
type: "text",
|
|
152
|
-
placeholder: (0, _lang.getLocale)('Find_an_option'),
|
|
153
|
-
value: searchVal,
|
|
154
|
-
onChange: this.onChangeSearch,
|
|
155
|
-
onClick: this.onInputClick
|
|
156
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
-
className: "mb-link-container"
|
|
158
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
159
|
-
className: "title"
|
|
160
|
-
}, (0, _lang.getLocale)('Choose_an_option')), /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
-
className: "content"
|
|
162
|
-
}, filterOptions.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
163
|
-
className: "search-result-none"
|
|
164
|
-
}, (0, _lang.getLocale)('No_options_available')), filterOptions.length > 0 && this.renderFilteredOptions(filterOptions)))));
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
return MBLinkEditorPopover;
|
|
168
|
-
}(_react.default.Component);
|
|
169
|
-
|
|
170
|
-
(0, _defineProperty2.default)(MBLinkEditorPopover, "defaultProps", {
|
|
171
|
-
isReadOnly: false,
|
|
172
|
-
value: []
|
|
173
|
-
});
|
|
174
|
-
MBLinkEditorPopover.propTypes = propTypes;
|
|
175
|
-
var _default = MBLinkEditorPopover;
|
|
176
|
-
exports.default = _default;
|