dtable-ui-component 0.1.75-beta2 → 0.1.75-beta3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AutoNumberFormatter/index.css +1 -0
- package/es/AutoNumberFormatter/index.js +36 -0
- package/es/ButtonFormatter/index.css +13 -0
- package/es/ButtonFormatter/index.js +56 -0
- package/es/CTimeFormatter/index.css +1 -0
- package/es/CTimeFormatter/index.js +58 -0
- package/es/CheckboxFormatter/index.css +1 -0
- package/es/CheckboxFormatter/index.js +45 -0
- package/es/CollaboratorFormatter/index.css +1 -0
- package/es/CollaboratorFormatter/index.js +91 -0
- package/es/CollaboratorItem/index.css +49 -0
- package/es/CollaboratorItem/index.js +64 -0
- package/es/CreatorFormatter/index.css +1 -0
- package/es/CreatorFormatter/index.js +87 -0
- package/es/DateFormatter/index.css +1 -0
- package/es/DateFormatter/index.js +60 -0
- package/es/DurationFormatter/index.css +1 -0
- package/es/DurationFormatter/index.js +38 -0
- package/es/EmailFormatter/index.css +5 -0
- package/es/EmailFormatter/index.js +36 -0
- package/es/FileFormatter/index.css +29 -0
- package/es/FileFormatter/index.js +64 -0
- package/es/FileItemFormatter/index.js +50 -0
- package/es/FileUploader/index.js +53 -0
- package/es/FormulaFormatter/index.css +19 -0
- package/es/FormulaFormatter/index.js +164 -0
- package/es/GeolocationFormatter/index.css +1 -0
- package/es/GeolocationFormatter/index.js +53 -0
- package/es/ImageFormatter/images-lazy-load.js +150 -0
- package/es/ImageFormatter/index.css +34 -0
- package/es/ImageFormatter/index.js +154 -0
- package/es/ImagePreviewerLightbox/index.css +87 -0
- package/es/ImagePreviewerLightbox/index.js +119 -0
- package/es/LastModifierFormatter/index.css +1 -0
- package/es/LastModifierFormatter/index.js +87 -0
- package/es/LinkFormatter/index.css +27 -0
- package/es/LinkFormatter/index.js +144 -0
- package/es/Loading/index.css +54 -0
- package/es/Loading/index.js +7 -0
- package/es/LongTextFormatter/html-long-text-formatter.js +96 -0
- package/es/LongTextFormatter/index.css +63 -0
- package/es/LongTextFormatter/index.js +29 -0
- package/es/LongTextFormatter/simple-long-text-formatter.js +104 -0
- package/es/MTimeFormatter/index.css +1 -0
- package/es/MTimeFormatter/index.js +58 -0
- package/es/ModalPortal/index.js +44 -0
- package/es/MultipleSelectFormatter/index.css +1 -0
- package/es/MultipleSelectFormatter/index.js +70 -0
- package/es/NumberFormatter/index.css +1 -0
- package/es/NumberFormatter/index.js +47 -0
- package/es/RateFormatter/index.css +1 -0
- package/es/RateFormatter/index.js +80 -0
- package/es/SelectItem/index.js +58 -0
- package/es/SingleSelectFormatter/index.css +1 -0
- package/es/SingleSelectFormatter/index.js +70 -0
- package/es/TextFormatter/index.css +1 -0
- package/es/TextFormatter/index.js +56 -0
- package/es/UrlFormatter/index.css +5 -0
- package/es/UrlFormatter/index.js +36 -0
- package/es/app.css +20 -0
- package/es/app.js +91 -0
- package/es/assets/images/avatar/default_avatar.png +0 -0
- package/es/assets/images/file/192/excel.png +0 -0
- package/es/assets/images/file/192/file.png +0 -0
- package/es/assets/images/file/192/music.png +0 -0
- package/es/assets/images/file/192/pdf.png +0 -0
- package/es/assets/images/file/192/pic.png +0 -0
- package/es/assets/images/file/192/ppt.png +0 -0
- package/es/assets/images/file/192/txt.png +0 -0
- package/es/assets/images/file/192/video.png +0 -0
- package/es/assets/images/file/192/word.png +0 -0
- package/es/assets/images/file/24/excel.png +0 -0
- package/es/assets/images/file/24/file.png +0 -0
- package/es/assets/images/file/24/music.png +0 -0
- package/es/assets/images/file/24/pdf.png +0 -0
- package/es/assets/images/file/24/pic.png +0 -0
- package/es/assets/images/file/24/ppt.png +0 -0
- package/es/assets/images/file/24/txt.png +0 -0
- package/es/assets/images/file/24/video.png +0 -0
- package/es/assets/images/file/24/word.png +0 -0
- package/es/assets/images/folder/folder-192.png +0 -0
- package/es/assets/images/folder/folder-24.png +0 -0
- package/es/cellFormatterFactory/index.js +25 -0
- package/es/components/cell-editor/checkbox-editor.js +104 -0
- package/es/components/cell-editor/collaborator-editor.js +236 -0
- package/es/components/cell-editor/date-editor.js +151 -0
- package/es/components/cell-editor/index.js +9 -0
- package/es/components/cell-editor/link-editor.js +303 -0
- package/es/components/cell-editor/multiple-select-editor.js +237 -0
- package/es/components/cell-editor/number-editor.js +154 -0
- package/es/components/cell-editor/single-select-editor.js +202 -0
- package/es/components/cell-editor/text-editor.js +122 -0
- package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +46 -0
- package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
- package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +177 -0
- package/es/components/cell-editor-popover/mb-date-editor-popover.js +245 -0
- package/es/components/cell-editor-popover/mb-link-editor-popover.js +170 -0
- package/es/components/cell-editor-popover/mb-select-editor-popover.js +230 -0
- package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +109 -0
- package/es/components/cell-editor-popover/pc-date-editor-popover.js +142 -0
- package/es/components/cell-editor-popover/pc-link-editor-popover.js +114 -0
- package/es/components/cell-editor-popover/pc-select-editor-popover.js +143 -0
- package/es/components/common/collaborator-item.js +63 -0
- package/es/components/common/edit-editor-button.js +56 -0
- package/es/components/common/link-editor-option.js +113 -0
- package/es/components/common/mobile/mb-editor-header.js +48 -0
- package/es/components/common/select-editor-option.js +106 -0
- package/es/constants/cell-types.js +25 -0
- package/es/constants/index.js +49 -0
- package/es/css/cell-editor.css +614 -0
- package/es/css/cell-formatter.css +4 -0
- package/es/css/custom-rc-calendar.css +118 -0
- package/es/formatterConfig/index.js +31 -0
- package/es/index.js +31 -0
- package/es/lang/index.js +50 -0
- package/es/locals/de.js +2 -0
- package/es/locals/en.js +17 -0
- package/es/locals/fr.js +2 -0
- package/es/locals/zh-CN.js +17 -0
- package/{lib/toast → es/toaster}/alert.js +0 -0
- package/{lib/toast → es/toaster}/index.js +0 -0
- package/{lib/toast → es/toaster}/toast.js +0 -0
- package/{lib/toast → es/toaster}/toastManager.js +0 -0
- package/{lib/toast → es/toaster}/toaster.js +0 -0
- package/es/utils/cell-value-validator.js +31 -0
- package/es/utils/column-utils.js +7 -0
- package/es/utils/editor-utils.js +71 -0
- package/es/utils/markdown2html.js +62 -0
- package/es/utils/normalize-long-text-value.js +69 -0
- package/es/utils/number-precision.js +164 -0
- package/es/utils/unified/index.js +470 -0
- package/es/utils/utils.js +116 -0
- package/es/utils/value-format-utils.js +497 -0
- package/es/utils/vfile/core.js +172 -0
- package/es/utils/vfile/index.js +48 -0
- package/lib/AutoNumberFormatter/index.js +38 -27
- package/lib/ButtonFormatter/index.js +59 -47
- package/lib/CTimeFormatter/index.js +53 -39
- package/lib/CheckboxFormatter/index.js +48 -35
- package/lib/CollaboratorFormatter/index.js +64 -42
- package/lib/CollaboratorItem/index.js +61 -44
- package/lib/CreatorFormatter/index.js +62 -42
- package/lib/DateFormatter/index.js +55 -40
- package/lib/DurationFormatter/index.js +42 -29
- package/lib/EmailFormatter/index.js +38 -27
- package/lib/FileFormatter/index.js +65 -50
- package/lib/FileItemFormatter/index.js +44 -31
- package/lib/FileUploader/index.js +44 -34
- package/lib/FormulaFormatter/index.js +102 -81
- package/lib/GeolocationFormatter/index.js +50 -35
- package/lib/ImageFormatter/images-lazy-load.js +81 -73
- package/lib/ImageFormatter/index.js +109 -90
- package/lib/ImagePreviewerLightbox/index.js +60 -27
- package/lib/LastModifierFormatter/index.js +62 -42
- package/lib/LinkFormatter/index.js +80 -59
- package/lib/Loading/index.js +13 -4
- package/lib/LongTextFormatter/html-long-text-formatter.js +60 -49
- package/lib/LongTextFormatter/index.js +28 -9
- package/lib/LongTextFormatter/simple-long-text-formatter.js +58 -52
- package/lib/MTimeFormatter/index.js +53 -39
- package/lib/ModalPortal/index.js +37 -30
- package/lib/MultipleSelectFormatter/index.js +55 -39
- package/lib/NumberFormatter/index.js +50 -35
- package/lib/RateFormatter/index.js +52 -37
- package/lib/SelectItem/index.js +46 -31
- package/lib/SingleSelectFormatter/index.js +54 -38
- package/lib/TextFormatter/index.js +44 -31
- package/lib/UrlFormatter/index.js +38 -27
- package/lib/app.js +80 -75
- package/lib/cellFormatterFactory/index.js +20 -17
- package/lib/components/cell-editor/checkbox-editor.js +66 -59
- package/lib/components/cell-editor/collaborator-editor.js +126 -113
- package/lib/components/cell-editor/date-editor.js +119 -99
- package/lib/components/cell-editor/index.js +40 -9
- package/lib/components/cell-editor/link-editor.js +140 -122
- package/lib/components/cell-editor/multiple-select-editor.js +127 -114
- package/lib/components/cell-editor/number-editor.js +86 -78
- package/lib/components/cell-editor/single-select-editor.js +120 -106
- package/lib/components/cell-editor/text-editor.js +72 -65
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +51 -31
- package/lib/components/cell-editor-dialog/pc-files-addition/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +111 -105
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +157 -140
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +109 -103
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +155 -142
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +89 -74
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +102 -88
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +91 -77
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +105 -91
- package/lib/components/common/collaborator-item.js +59 -43
- package/lib/components/common/edit-editor-button.js +39 -28
- package/lib/components/common/link-editor-option.js +71 -63
- package/lib/components/common/mobile/mb-editor-header.js +52 -39
- package/lib/components/common/select-editor-option.js +74 -58
- package/lib/constants/cell-types.js +54 -25
- package/lib/constants/index.js +28 -5
- package/lib/formatterConfig/index.js +59 -28
- package/lib/index.js +139 -31
- package/lib/lang/index.js +27 -11
- package/lib/locals/de.js +6 -1
- package/lib/locals/en.js +6 -1
- package/lib/locals/fr.js +6 -1
- package/lib/locals/zh-CN.js +6 -1
- package/lib/toaster/alert.js +164 -0
- package/lib/toaster/index.js +12 -0
- package/lib/toaster/toast.js +223 -0
- package/lib/toaster/toastManager.js +189 -0
- package/lib/toaster/toaster.js +92 -0
- package/lib/utils/cell-value-validator.js +9 -5
- package/lib/utils/column-utils.js +13 -5
- package/lib/utils/editor-utils.js +13 -3
- package/lib/utils/markdown2html.js +7 -1
- package/lib/utils/normalize-long-text-value.js +6 -1
- package/lib/utils/number-precision.js +32 -13
- package/lib/utils/utils.js +33 -8
- package/lib/utils/value-format-utils.js +110 -58
- package/package.json +5 -5
|
@@ -1,85 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { DatePicker } from 'antd-mobile';
|
|
7
|
-
import moment from 'moment';
|
|
8
|
-
import Calendar from '@seafile/seafile-calendar';
|
|
9
|
-
import * as SeaDatePicker from '@seafile/seafile-calendar/lib/Picker';
|
|
10
|
-
import { getLocale } from '../../lang';
|
|
11
|
-
import { initDateEditorLanguage } from '../../utils/editor-utils';
|
|
12
|
-
import MBEditorHeader from '../common/mobile/mb-editor-header';
|
|
13
|
-
import '@seafile/seafile-calendar/assets/index.css';
|
|
14
|
-
import '../../css/custom-rc-calendar.css';
|
|
1
|
+
"use strict";
|
|
15
2
|
|
|
16
|
-
var
|
|
17
|
-
_inherits(DateEidtorPopover, _React$PureComponent);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
4
|
|
|
19
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
20
7
|
|
|
21
|
-
|
|
22
|
-
|
|
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"));
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
var _lang = require("../../lang");
|
|
25
27
|
|
|
26
|
-
|
|
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;
|
|
27
55
|
|
|
28
|
-
_this
|
|
56
|
+
_this = _React$PureComponent.call(this, props) || this;
|
|
57
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleHistaryBack", function (e) {
|
|
29
58
|
e.preventDefault();
|
|
30
59
|
|
|
31
60
|
_this.closePopover();
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
_this.handleDateChange = function (date) {
|
|
61
|
+
});
|
|
62
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDateChange", function (date) {
|
|
35
63
|
var _this$props = _this.props,
|
|
36
64
|
dateFormat = _this$props.dateFormat,
|
|
37
65
|
showHourAndMinute = _this$props.showHourAndMinute;
|
|
38
|
-
var newValue =
|
|
66
|
+
var newValue = (0, _moment.default)(date);
|
|
39
67
|
|
|
40
68
|
if (showHourAndMinute) {
|
|
41
69
|
var datePickerValue = _this.state.datePickerValue;
|
|
42
70
|
var HM = datePickerValue.format('HH:mm');
|
|
43
71
|
var format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
44
72
|
|
|
45
|
-
var newDate =
|
|
46
|
-
newValue =
|
|
73
|
+
var newDate = (0, _moment.default)(date).format(format) + ' ' + HM;
|
|
74
|
+
newValue = (0, _moment.default)(newDate);
|
|
47
75
|
}
|
|
48
76
|
|
|
49
77
|
_this.setState({
|
|
50
|
-
datePickerValue:
|
|
78
|
+
datePickerValue: (0, _moment.default)(date)
|
|
51
79
|
});
|
|
52
80
|
|
|
53
81
|
_this.props.onValueChanged(newValue.format(dateFormat));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
_this.handleTimeChange = function (time) {
|
|
82
|
+
});
|
|
83
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTimeChange", function (time) {
|
|
57
84
|
var datePickerValue = _this.state.datePickerValue;
|
|
58
85
|
var dateFormat = _this.props.dateFormat;
|
|
59
86
|
var format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
60
87
|
|
|
61
88
|
var YMD = datePickerValue.format(format);
|
|
62
|
-
var newDate = YMD + ' ' +
|
|
63
|
-
var newValue =
|
|
89
|
+
var newDate = YMD + ' ' + (0, _moment.default)(time).format('HH:mm');
|
|
90
|
+
var newValue = (0, _moment.default)(newDate);
|
|
64
91
|
|
|
65
92
|
_this.setState({
|
|
66
93
|
datePickerValue: newValue
|
|
67
94
|
});
|
|
68
95
|
|
|
69
96
|
_this.props.onValueChanged(datePickerValue.format(dateFormat));
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
_this.closePopover = function () {
|
|
97
|
+
});
|
|
98
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "closePopover", function () {
|
|
73
99
|
_this.props.onClosePopover();
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
_this.deleteDate = function () {
|
|
100
|
+
});
|
|
101
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deleteDate", function () {
|
|
77
102
|
_this.props.onValueChanged('');
|
|
78
103
|
|
|
79
104
|
_this.closePopover();
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
_this.onChange = function (value) {
|
|
105
|
+
});
|
|
106
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onChange", function (value) {
|
|
83
107
|
if (!value) return;
|
|
84
108
|
var dateFormat = _this.props.dateFormat;
|
|
85
109
|
|
|
@@ -88,34 +112,30 @@ var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
88
112
|
});
|
|
89
113
|
|
|
90
114
|
_this.props.onValueChanged(value.format(dateFormat));
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
_this.onContainerClick = function (event) {
|
|
115
|
+
});
|
|
116
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onContainerClick", function (event) {
|
|
94
117
|
if (_this.editorPopover && _this.editorPopover.contains(event.target)) {
|
|
95
118
|
event.stopPropagation();
|
|
96
119
|
event.nativeEvent.stopImmediatePropagation();
|
|
97
120
|
return false;
|
|
98
121
|
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
_this.setEditorPopover = function (editorPopover) {
|
|
122
|
+
});
|
|
123
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setEditorPopover", function (editorPopover) {
|
|
102
124
|
_this.editorPopover = editorPopover;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
_this.getCalendarContainer = function () {
|
|
125
|
+
});
|
|
126
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCalendarContainer", function () {
|
|
106
127
|
return _this.calendarContainerRef.current;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
_this.getCalender = function () {
|
|
128
|
+
});
|
|
129
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCalender", function () {
|
|
110
130
|
var _this$props2 = _this.props,
|
|
111
131
|
dateFormat = _this$props2.dateFormat,
|
|
112
132
|
lang = _this$props2.lang;
|
|
113
|
-
var defaultValue =
|
|
114
|
-
return /*#__PURE__*/
|
|
115
|
-
locale: initDateEditorLanguage(lang),
|
|
133
|
+
var defaultValue = (0, _moment.default)().clone();
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_seafileCalendar.default, {
|
|
135
|
+
locale: (0, _editorUtils.initDateEditorLanguage)(lang),
|
|
116
136
|
format: dateFormat,
|
|
117
137
|
defaultValue: defaultValue,
|
|
118
|
-
dateInputPlaceholder: getLocale('Please_input'),
|
|
138
|
+
dateInputPlaceholder: (0, _lang.getLocale)('Please_input'),
|
|
119
139
|
showDateInput: false,
|
|
120
140
|
focusablePanel: false,
|
|
121
141
|
showToday: false,
|
|
@@ -125,15 +145,14 @@ var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
125
145
|
fontSize: '14px'
|
|
126
146
|
}
|
|
127
147
|
});
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
_this.renderDataPicker = function () {
|
|
148
|
+
});
|
|
149
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderDataPicker", function () {
|
|
131
150
|
var dateFormat = _this.props.dateFormat;
|
|
132
151
|
var datePickerValue = _this.state.datePickerValue;
|
|
133
152
|
|
|
134
153
|
var calendar = _this.getCalender();
|
|
135
154
|
|
|
136
|
-
return /*#__PURE__*/
|
|
155
|
+
return /*#__PURE__*/_react.default.createElement(SeaDatePicker, {
|
|
137
156
|
open: true,
|
|
138
157
|
style: {
|
|
139
158
|
width: '100%'
|
|
@@ -145,101 +164,99 @@ var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
145
164
|
}, function (_ref) {
|
|
146
165
|
var value = _ref.value;
|
|
147
166
|
value = value && value.format(dateFormat);
|
|
148
|
-
return /*#__PURE__*/
|
|
167
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
149
168
|
tabIndex: "0",
|
|
150
169
|
onFocus: _this.onReadOnlyFocus
|
|
151
|
-
}, /*#__PURE__*/
|
|
152
|
-
placeholder: getLocale('Please_select'),
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
171
|
+
placeholder: (0, _lang.getLocale)('Please_select'),
|
|
153
172
|
readOnly: true,
|
|
154
173
|
tabIndex: "-1",
|
|
155
174
|
className: "form-control",
|
|
156
175
|
value: value || ''
|
|
157
|
-
}), /*#__PURE__*/
|
|
176
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
158
177
|
ref: _this.calendarContainerRef,
|
|
159
178
|
style: {
|
|
160
179
|
height: '22rem'
|
|
161
180
|
}
|
|
162
181
|
}));
|
|
163
182
|
});
|
|
164
|
-
};
|
|
165
|
-
|
|
183
|
+
});
|
|
166
184
|
_this.state = {
|
|
167
185
|
open: true,
|
|
168
|
-
datePickerValue: props.value ?
|
|
186
|
+
datePickerValue: props.value ? (0, _moment.default)(props.value) : (0, _moment.default)().clone()
|
|
169
187
|
};
|
|
170
|
-
_this.calendarContainerRef =
|
|
188
|
+
_this.calendarContainerRef = /*#__PURE__*/_react.default.createRef();
|
|
171
189
|
return _this;
|
|
172
190
|
}
|
|
173
191
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}, getLocale('Clear')))));
|
|
239
|
-
}
|
|
240
|
-
}]);
|
|
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
|
+
};
|
|
241
256
|
|
|
242
257
|
return DateEidtorPopover;
|
|
243
|
-
}(
|
|
258
|
+
}(_react.default.PureComponent);
|
|
244
259
|
|
|
245
|
-
|
|
260
|
+
DateEidtorPopover.propTypes = propTypes;
|
|
261
|
+
var _default = DateEidtorPopover;
|
|
262
|
+
exports.default = _default;
|