dtable-ui-component 0.1.75-beta1 → 0.1.75-beta2
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/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/lib/CheckboxFormatter/index.css +1 -0
- package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
- 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/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/lib/EmailFormatter/index.css +5 -0
- package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
- package/lib/FileFormatter/index.css +29 -0
- package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
- package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +2 -2
- package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
- package/lib/FormulaFormatter/index.css +19 -0
- package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +8 -8
- package/lib/GeolocationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
- 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/{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/LastModifierFormatter/index.css +1 -0
- package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
- 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/widgets/long-text-formatter → lib/LongTextFormatter}/html-long-text-formatter.js +1 -1
- package/lib/LongTextFormatter/index.css +63 -0
- package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +3 -2
- package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/simple-long-text-formatter.js +1 -1
- 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/MultipleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
- 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/SingleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
- 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/lib/app.js +75 -80
- package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
- package/lib/components/cell-editor/checkbox-editor.js +59 -66
- package/lib/components/cell-editor/collaborator-editor.js +113 -126
- package/lib/components/cell-editor/date-editor.js +99 -119
- package/lib/components/cell-editor/index.js +9 -40
- package/lib/components/cell-editor/link-editor.js +122 -140
- package/lib/components/cell-editor/multiple-select-editor.js +114 -127
- package/lib/components/cell-editor/number-editor.js +78 -86
- package/lib/components/cell-editor/single-select-editor.js +106 -120
- package/lib/components/cell-editor/text-editor.js +65 -72
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +31 -51
- 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 +105 -111
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +140 -157
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +103 -109
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +142 -155
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +74 -89
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +88 -102
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +77 -91
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +91 -105
- package/lib/components/common/collaborator-item.js +43 -59
- package/lib/components/common/edit-editor-button.js +28 -39
- package/lib/components/common/link-editor-option.js +63 -71
- package/lib/components/common/mobile/mb-editor-header.js +39 -52
- package/lib/components/common/select-editor-option.js +58 -74
- package/lib/constants/cell-types.js +25 -54
- package/lib/constants/index.js +5 -26
- package/lib/css/cell-formatter.css +0 -243
- package/lib/formatterConfig/index.js +31 -0
- package/lib/index.js +31 -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/{es/components → lib}/toast/alert.js +0 -0
- package/{es/components → lib}/toast/index.js +0 -0
- package/{es/components → lib}/toast/toast.js +0 -0
- package/{es/components → lib}/toast/toastManager.js +0 -0
- package/{es/components → lib}/toast/toaster.js +0 -0
- package/lib/utils/cell-value-validator.js +4 -14
- package/lib/utils/column-utils.js +5 -13
- package/lib/utils/editor-utils.js +3 -13
- package/lib/utils/markdown2html.js +1 -7
- package/lib/utils/normalize-long-text-value.js +1 -6
- package/lib/utils/number-precision.js +13 -31
- package/lib/utils/utils.js +8 -33
- package/lib/utils/value-format-utils.js +58 -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/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/components/cell-editor/checkbox-editor.js +0 -104
- package/es/components/cell-editor/collaborator-editor.js +0 -236
- package/es/components/cell-editor/date-editor.js +0 -151
- package/es/components/cell-editor/index.js +0 -9
- package/es/components/cell-editor/link-editor.js +0 -303
- package/es/components/cell-editor/multiple-select-editor.js +0 -237
- package/es/components/cell-editor/number-editor.js +0 -154
- package/es/components/cell-editor/single-select-editor.js +0 -202
- package/es/components/cell-editor/text-editor.js +0 -122
- package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -46
- 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 +0 -177
- package/es/components/cell-editor-popover/mb-date-editor-popover.js +0 -245
- package/es/components/cell-editor-popover/mb-link-editor-popover.js +0 -170
- package/es/components/cell-editor-popover/mb-select-editor-popover.js +0 -230
- package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -109
- package/es/components/cell-editor-popover/pc-date-editor-popover.js +0 -142
- package/es/components/cell-editor-popover/pc-link-editor-popover.js +0 -114
- package/es/components/cell-editor-popover/pc-select-editor-popover.js +0 -143
- package/es/components/cell-formatter/formatter-config.js +0 -31
- package/es/components/cell-formatter/index.js +0 -27
- package/es/components/common/edit-editor-button.js +0 -56
- package/es/components/common/link-editor-option.js +0 -113
- package/es/components/common/mobile/mb-editor-header.js +0 -48
- package/es/components/common/select-editor-option.js +0 -106
- 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/css/custom-rc-calendar.css +0 -118
- 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/cell-value-validator.js +0 -32
- package/es/utils/column-utils.js +0 -7
- package/es/utils/editor-utils.js +0 -71
- package/es/utils/markdown2html.js +0 -62
- package/es/utils/normalize-long-text-value.js +0 -69
- package/es/utils/number-precision.js +0 -163
- package/es/utils/unified/index.js +0 -470
- package/es/utils/utils.js +0 -116
- package/es/utils/value-format-utils.js +0 -495
- package/es/utils/vfile/core.js +0 -172
- package/es/utils/vfile/index.js +0 -48
- 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/images-lazy-load.js +0 -158
- package/lib/components/common/modal-portal.js +0 -51
- 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/image-previewer-ligntbox.css +0 -87
- package/lib/css/loading.css +0 -54
|
@@ -1,109 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
};
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { 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';
|
|
49
15
|
|
|
50
16
|
var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
51
|
-
(
|
|
17
|
+
_inherits(DateEidtorPopover, _React$PureComponent);
|
|
18
|
+
|
|
19
|
+
var _super = _createSuper(DateEidtorPopover);
|
|
52
20
|
|
|
53
21
|
function DateEidtorPopover(props) {
|
|
54
22
|
var _this;
|
|
55
23
|
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
_classCallCheck(this, DateEidtorPopover);
|
|
25
|
+
|
|
26
|
+
_this = _super.call(this, props);
|
|
27
|
+
|
|
28
|
+
_this.handleHistaryBack = function (e) {
|
|
58
29
|
e.preventDefault();
|
|
59
30
|
|
|
60
31
|
_this.closePopover();
|
|
61
|
-
}
|
|
62
|
-
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
_this.handleDateChange = function (date) {
|
|
63
35
|
var _this$props = _this.props,
|
|
64
36
|
dateFormat = _this$props.dateFormat,
|
|
65
37
|
showHourAndMinute = _this$props.showHourAndMinute;
|
|
66
|
-
var newValue = (
|
|
38
|
+
var newValue = moment(date);
|
|
67
39
|
|
|
68
40
|
if (showHourAndMinute) {
|
|
69
41
|
var datePickerValue = _this.state.datePickerValue;
|
|
70
42
|
var HM = datePickerValue.format('HH:mm');
|
|
71
43
|
var format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
72
44
|
|
|
73
|
-
var newDate = (
|
|
74
|
-
newValue = (
|
|
45
|
+
var newDate = moment(date).format(format) + ' ' + HM;
|
|
46
|
+
newValue = moment(newDate);
|
|
75
47
|
}
|
|
76
48
|
|
|
77
49
|
_this.setState({
|
|
78
|
-
datePickerValue: (
|
|
50
|
+
datePickerValue: moment(date)
|
|
79
51
|
});
|
|
80
52
|
|
|
81
53
|
_this.props.onValueChanged(newValue.format(dateFormat));
|
|
82
|
-
}
|
|
83
|
-
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
_this.handleTimeChange = function (time) {
|
|
84
57
|
var datePickerValue = _this.state.datePickerValue;
|
|
85
58
|
var dateFormat = _this.props.dateFormat;
|
|
86
59
|
var format = dateFormat.split(' ')[0]; // 'YYYY-MM-DD HH:mm'
|
|
87
60
|
|
|
88
61
|
var YMD = datePickerValue.format(format);
|
|
89
|
-
var newDate = YMD + ' ' + (
|
|
90
|
-
var newValue = (
|
|
62
|
+
var newDate = YMD + ' ' + moment(time).format('HH:mm');
|
|
63
|
+
var newValue = moment(newDate);
|
|
91
64
|
|
|
92
65
|
_this.setState({
|
|
93
66
|
datePickerValue: newValue
|
|
94
67
|
});
|
|
95
68
|
|
|
96
69
|
_this.props.onValueChanged(datePickerValue.format(dateFormat));
|
|
97
|
-
}
|
|
98
|
-
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
_this.closePopover = function () {
|
|
99
73
|
_this.props.onClosePopover();
|
|
100
|
-
}
|
|
101
|
-
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
_this.deleteDate = function () {
|
|
102
77
|
_this.props.onValueChanged('');
|
|
103
78
|
|
|
104
79
|
_this.closePopover();
|
|
105
|
-
}
|
|
106
|
-
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
_this.onChange = function (value) {
|
|
107
83
|
if (!value) return;
|
|
108
84
|
var dateFormat = _this.props.dateFormat;
|
|
109
85
|
|
|
@@ -112,30 +88,34 @@ var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
112
88
|
});
|
|
113
89
|
|
|
114
90
|
_this.props.onValueChanged(value.format(dateFormat));
|
|
115
|
-
}
|
|
116
|
-
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
_this.onContainerClick = function (event) {
|
|
117
94
|
if (_this.editorPopover && _this.editorPopover.contains(event.target)) {
|
|
118
95
|
event.stopPropagation();
|
|
119
96
|
event.nativeEvent.stopImmediatePropagation();
|
|
120
97
|
return false;
|
|
121
98
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
_this.setEditorPopover = function (editorPopover) {
|
|
124
102
|
_this.editorPopover = editorPopover;
|
|
125
|
-
}
|
|
126
|
-
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
_this.getCalendarContainer = function () {
|
|
127
106
|
return _this.calendarContainerRef.current;
|
|
128
|
-
}
|
|
129
|
-
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
_this.getCalender = function () {
|
|
130
110
|
var _this$props2 = _this.props,
|
|
131
111
|
dateFormat = _this$props2.dateFormat,
|
|
132
112
|
lang = _this$props2.lang;
|
|
133
|
-
var defaultValue = (
|
|
134
|
-
return /*#__PURE__*/
|
|
135
|
-
locale:
|
|
113
|
+
var defaultValue = moment().clone();
|
|
114
|
+
return /*#__PURE__*/React.createElement(Calendar, {
|
|
115
|
+
locale: initDateEditorLanguage(lang),
|
|
136
116
|
format: dateFormat,
|
|
137
117
|
defaultValue: defaultValue,
|
|
138
|
-
dateInputPlaceholder:
|
|
118
|
+
dateInputPlaceholder: getLocale('Please_input'),
|
|
139
119
|
showDateInput: false,
|
|
140
120
|
focusablePanel: false,
|
|
141
121
|
showToday: false,
|
|
@@ -145,14 +125,15 @@ var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
145
125
|
fontSize: '14px'
|
|
146
126
|
}
|
|
147
127
|
});
|
|
148
|
-
}
|
|
149
|
-
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
_this.renderDataPicker = function () {
|
|
150
131
|
var dateFormat = _this.props.dateFormat;
|
|
151
132
|
var datePickerValue = _this.state.datePickerValue;
|
|
152
133
|
|
|
153
134
|
var calendar = _this.getCalender();
|
|
154
135
|
|
|
155
|
-
return /*#__PURE__*/
|
|
136
|
+
return /*#__PURE__*/React.createElement(SeaDatePicker, {
|
|
156
137
|
open: true,
|
|
157
138
|
style: {
|
|
158
139
|
width: '100%'
|
|
@@ -164,99 +145,101 @@ var DateEidtorPopover = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
164
145
|
}, function (_ref) {
|
|
165
146
|
var value = _ref.value;
|
|
166
147
|
value = value && value.format(dateFormat);
|
|
167
|
-
return /*#__PURE__*/
|
|
148
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
168
149
|
tabIndex: "0",
|
|
169
150
|
onFocus: _this.onReadOnlyFocus
|
|
170
|
-
}, /*#__PURE__*/
|
|
171
|
-
placeholder:
|
|
151
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
152
|
+
placeholder: getLocale('Please_select'),
|
|
172
153
|
readOnly: true,
|
|
173
154
|
tabIndex: "-1",
|
|
174
155
|
className: "form-control",
|
|
175
156
|
value: value || ''
|
|
176
|
-
}), /*#__PURE__*/
|
|
157
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
177
158
|
ref: _this.calendarContainerRef,
|
|
178
159
|
style: {
|
|
179
160
|
height: '22rem'
|
|
180
161
|
}
|
|
181
162
|
}));
|
|
182
163
|
});
|
|
183
|
-
}
|
|
164
|
+
};
|
|
165
|
+
|
|
184
166
|
_this.state = {
|
|
185
167
|
open: true,
|
|
186
|
-
datePickerValue: props.value ? (
|
|
168
|
+
datePickerValue: props.value ? moment(props.value) : moment().clone()
|
|
187
169
|
};
|
|
188
|
-
_this.calendarContainerRef =
|
|
170
|
+
_this.calendarContainerRef = React.createRef();
|
|
189
171
|
return _this;
|
|
190
172
|
}
|
|
191
173
|
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
174
|
+
_createClass(DateEidtorPopover, [{
|
|
175
|
+
key: "componentDidMount",
|
|
176
|
+
value: function componentDidMount() {
|
|
177
|
+
history.pushState(null, null, '#'); // eslint-disable-line
|
|
178
|
+
|
|
179
|
+
window.addEventListener('popstate', this.handleHistaryBack, false);
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "componentWillUnmount",
|
|
183
|
+
value: function componentWillUnmount() {
|
|
184
|
+
window.removeEventListener('popstate', this.handleHistaryBack, false);
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
key: "render",
|
|
188
|
+
value: function render() {
|
|
189
|
+
var _this$props3 = this.props,
|
|
190
|
+
lang = _this$props3.lang,
|
|
191
|
+
column = _this$props3.column,
|
|
192
|
+
dateFormat = _this$props3.dateFormat,
|
|
193
|
+
showHourAndMinute = _this$props3.showHourAndMinute;
|
|
194
|
+
var leftFormat = dateFormat.split(' ')[0];
|
|
195
|
+
var rightFormat = dateFormat.split(' ')[1];
|
|
196
|
+
var datePickerValue = this.state.datePickerValue;
|
|
197
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
198
|
+
ref: this.setEditorPopover,
|
|
199
|
+
className: "dtable-ui-mb-editor-popover mb-date-editor-popover",
|
|
200
|
+
onClick: this.onContainerClick
|
|
201
|
+
}, /*#__PURE__*/React.createElement(MBEditorHeader, {
|
|
202
|
+
title: column.name,
|
|
203
|
+
leftContent: /*#__PURE__*/React.createElement("i", {
|
|
204
|
+
className: "dtable-font dtable-icon-return"
|
|
205
|
+
}),
|
|
206
|
+
rightContent: /*#__PURE__*/React.createElement("span", null, getLocale('Done')),
|
|
207
|
+
onLeftClick: this.props.onClosePopover,
|
|
208
|
+
onRightClick: this.props.onClosePopover
|
|
209
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
210
|
+
className: "dtable-ui-mb-editor-body dtable-ui-mb-date-editor-body"
|
|
211
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
212
|
+
className: "mb-date-editor-input"
|
|
213
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
214
|
+
className: "date-input"
|
|
215
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
216
|
+
mode: "date",
|
|
217
|
+
locale: initDateEditorLanguage(lang),
|
|
218
|
+
value: this.state.value,
|
|
219
|
+
onChange: this.handleDateChange
|
|
220
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
221
|
+
className: "date-input-day"
|
|
222
|
+
}, datePickerValue && datePickerValue.format(leftFormat)))), showHourAndMinute && /*#__PURE__*/React.createElement("div", {
|
|
223
|
+
className: "date-input"
|
|
224
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
225
|
+
mode: "time",
|
|
226
|
+
locale: initDateEditorLanguage(lang),
|
|
227
|
+
value: this.state.value,
|
|
228
|
+
onChange: this.handleTimeChange
|
|
229
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
230
|
+
className: "date-input-day"
|
|
231
|
+
}, datePickerValue && datePickerValue.format(rightFormat))))), /*#__PURE__*/React.createElement("div", {
|
|
232
|
+
className: "dtable-ui mb-date-editor-picker"
|
|
233
|
+
}, this.renderDataPicker()), /*#__PURE__*/React.createElement("div", {
|
|
234
|
+
className: "mb-date-editor-clear"
|
|
235
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
236
|
+
onClick: this.deleteDate,
|
|
237
|
+
className: "clear-date"
|
|
238
|
+
}, getLocale('Clear')))));
|
|
239
|
+
}
|
|
240
|
+
}]);
|
|
256
241
|
|
|
257
242
|
return DateEidtorPopover;
|
|
258
|
-
}(
|
|
243
|
+
}(React.PureComponent);
|
|
259
244
|
|
|
260
|
-
|
|
261
|
-
var _default = DateEidtorPopover;
|
|
262
|
-
exports.default = _default;
|
|
245
|
+
export default DateEidtorPopover;
|