dtable-ui-component 0.1.75-beta3 → 0.1.75-beta7
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.js +27 -38
- package/lib/ButtonFormatter/index.js +47 -59
- package/lib/CTimeFormatter/index.js +39 -53
- package/lib/CheckboxFormatter/index.js +35 -48
- package/lib/CollaboratorFormatter/index.js +42 -64
- package/lib/CollaboratorItem/index.js +44 -61
- package/lib/CreatorFormatter/index.js +42 -62
- package/lib/DateFormatter/index.js +40 -55
- package/lib/DurationFormatter/index.js +29 -42
- package/lib/EmailFormatter/index.js +27 -38
- package/lib/FileFormatter/index.js +50 -65
- package/lib/FileItemFormatter/index.js +31 -44
- package/lib/FileUploader/index.js +34 -44
- package/lib/FormulaFormatter/index.js +81 -102
- package/lib/GeolocationFormatter/index.js +35 -50
- package/lib/ImageFormatter/images-lazy-load.js +73 -81
- package/lib/ImageFormatter/index.js +90 -109
- package/lib/ImagePreviewerLightbox/index.js +27 -60
- package/lib/LastModifierFormatter/index.js +42 -62
- package/lib/LinkFormatter/index.js +59 -80
- package/lib/Loading/index.js +4 -13
- package/lib/LongTextFormatter/html-long-text-formatter.js +49 -60
- package/lib/LongTextFormatter/index.js +9 -28
- package/lib/LongTextFormatter/simple-long-text-formatter.js +52 -58
- package/lib/MTimeFormatter/index.js +39 -53
- package/lib/ModalPortal/index.js +30 -37
- package/lib/MultipleSelectFormatter/index.js +39 -55
- package/lib/NumberFormatter/index.js +35 -50
- package/lib/RateFormatter/index.js +37 -52
- package/lib/SelectItem/index.js +31 -46
- package/lib/SingleSelectFormatter/index.js +38 -54
- package/lib/TextFormatter/index.js +31 -44
- package/lib/UrlFormatter/index.js +27 -38
- package/lib/app.js +75 -80
- package/lib/cellFormatterFactory/index.js +17 -20
- 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 -28
- package/lib/formatterConfig/index.js +28 -59
- package/lib/index.js +31 -139
- 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/toaster/alert.js +92 -106
- package/lib/toaster/index.js +3 -12
- package/lib/toaster/toast.js +103 -147
- package/lib/toaster/toastManager.js +78 -97
- package/lib/toaster/toaster.js +36 -52
- package/lib/utils/cell-value-validator.js +5 -9
- 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 +3 -8
- 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/AutoNumberFormatter/index.css +0 -1
- package/es/AutoNumberFormatter/index.js +0 -36
- package/es/ButtonFormatter/index.css +0 -13
- package/es/ButtonFormatter/index.js +0 -56
- package/es/CTimeFormatter/index.css +0 -1
- package/es/CTimeFormatter/index.js +0 -58
- package/es/CheckboxFormatter/index.css +0 -1
- package/es/CheckboxFormatter/index.js +0 -45
- package/es/CollaboratorFormatter/index.css +0 -1
- package/es/CollaboratorFormatter/index.js +0 -91
- package/es/CollaboratorItem/index.css +0 -49
- package/es/CollaboratorItem/index.js +0 -64
- package/es/CreatorFormatter/index.css +0 -1
- package/es/CreatorFormatter/index.js +0 -87
- package/es/DateFormatter/index.css +0 -1
- package/es/DateFormatter/index.js +0 -60
- package/es/DurationFormatter/index.css +0 -1
- package/es/DurationFormatter/index.js +0 -38
- package/es/EmailFormatter/index.css +0 -5
- package/es/EmailFormatter/index.js +0 -36
- package/es/FileFormatter/index.css +0 -29
- package/es/FileFormatter/index.js +0 -64
- package/es/FileItemFormatter/index.js +0 -50
- package/es/FileUploader/index.js +0 -53
- package/es/FormulaFormatter/index.css +0 -19
- package/es/FormulaFormatter/index.js +0 -164
- package/es/GeolocationFormatter/index.css +0 -1
- package/es/GeolocationFormatter/index.js +0 -53
- package/es/ImageFormatter/images-lazy-load.js +0 -150
- package/es/ImageFormatter/index.css +0 -34
- package/es/ImageFormatter/index.js +0 -154
- package/es/ImagePreviewerLightbox/index.css +0 -87
- package/es/ImagePreviewerLightbox/index.js +0 -119
- package/es/LastModifierFormatter/index.css +0 -1
- package/es/LastModifierFormatter/index.js +0 -87
- package/es/LinkFormatter/index.css +0 -27
- package/es/LinkFormatter/index.js +0 -144
- package/es/Loading/index.css +0 -54
- package/es/Loading/index.js +0 -7
- package/es/LongTextFormatter/html-long-text-formatter.js +0 -96
- package/es/LongTextFormatter/index.css +0 -63
- package/es/LongTextFormatter/index.js +0 -29
- package/es/LongTextFormatter/simple-long-text-formatter.js +0 -104
- package/es/MTimeFormatter/index.css +0 -1
- package/es/MTimeFormatter/index.js +0 -58
- package/es/ModalPortal/index.js +0 -44
- package/es/MultipleSelectFormatter/index.css +0 -1
- package/es/MultipleSelectFormatter/index.js +0 -70
- package/es/NumberFormatter/index.css +0 -1
- package/es/NumberFormatter/index.js +0 -47
- package/es/RateFormatter/index.css +0 -1
- package/es/RateFormatter/index.js +0 -80
- package/es/SelectItem/index.js +0 -58
- package/es/SingleSelectFormatter/index.css +0 -1
- package/es/SingleSelectFormatter/index.js +0 -70
- package/es/TextFormatter/index.css +0 -1
- package/es/TextFormatter/index.js +0 -56
- package/es/UrlFormatter/index.css +0 -5
- package/es/UrlFormatter/index.js +0 -36
- 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/cellFormatterFactory/index.js +0 -25
- 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/common/collaborator-item.js +0 -63
- 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 -49
- package/es/css/cell-editor.css +0 -614
- package/es/css/cell-formatter.css +0 -4
- package/es/css/custom-rc-calendar.css +0 -118
- package/es/formatterConfig/index.js +0 -31
- package/es/index.js +0 -31
- 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/toaster/alert.js +0 -150
- package/es/toaster/index.js +0 -3
- package/es/toaster/toast.js +0 -179
- package/es/toaster/toastManager.js +0 -170
- package/es/toaster/toaster.js +0 -76
- package/es/utils/cell-value-validator.js +0 -31
- 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 -164
- package/es/utils/unified/index.js +0 -470
- package/es/utils/utils.js +0 -116
- package/es/utils/value-format-utils.js +0 -497
- package/es/utils/vfile/core.js +0 -172
- package/es/utils/vfile/index.js +0 -48
|
@@ -1,57 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 _collaboratorItem = _interopRequireDefault(require("../common/collaborator-item"));
|
|
21
|
-
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
-
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
|
-
|
|
26
|
-
var propTypes = {
|
|
27
|
-
popoverPosition: _propTypes.default.object.isRequired,
|
|
28
|
-
selectedCollaborators: _propTypes.default.array.isRequired,
|
|
29
|
-
collaborators: _propTypes.default.array.isRequired,
|
|
30
|
-
onCollaboratorItemToggle: _propTypes.default.func.isRequired
|
|
31
|
-
};
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { getLocale } from '../../lang';
|
|
8
|
+
import CollaboratorItem from '../common/collaborator-item';
|
|
32
9
|
|
|
33
10
|
var PCCollaboratorEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
34
|
-
(
|
|
11
|
+
_inherits(PCCollaboratorEditorPopover, _React$Component);
|
|
12
|
+
|
|
13
|
+
var _super = _createSuper(PCCollaboratorEditorPopover);
|
|
35
14
|
|
|
36
15
|
function PCCollaboratorEditorPopover(props) {
|
|
37
16
|
var _this;
|
|
38
17
|
|
|
39
|
-
|
|
40
|
-
|
|
18
|
+
_classCallCheck(this, PCCollaboratorEditorPopover);
|
|
19
|
+
|
|
20
|
+
_this = _super.call(this, props);
|
|
21
|
+
|
|
22
|
+
_this.onValueChanged = function (event) {
|
|
41
23
|
var value = event.target.value;
|
|
42
24
|
|
|
43
25
|
_this.setState({
|
|
44
26
|
searchValue: value
|
|
45
27
|
});
|
|
46
|
-
}
|
|
47
|
-
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
_this.onInputClick = function (event) {
|
|
48
31
|
event.nativeEvent.stopImmediatePropagation();
|
|
49
32
|
event.stopPropagation();
|
|
50
|
-
}
|
|
51
|
-
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
_this.onCollaboratorItemToggle = function (item) {
|
|
52
36
|
_this.props.onCollaboratorItemToggle(item);
|
|
53
|
-
}
|
|
54
|
-
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
_this.getFilterCollaborator = function () {
|
|
55
40
|
var collaborators = _this.props.collaborators;
|
|
56
41
|
|
|
57
42
|
var filter = _this.state.searchValue.toLowerCase();
|
|
@@ -63,62 +48,62 @@ var PCCollaboratorEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
63
48
|
return collaborators.filter(function (collaborator) {
|
|
64
49
|
return collaborator.name.toString().toLowerCase().indexOf(filter) > -1;
|
|
65
50
|
});
|
|
66
|
-
}
|
|
51
|
+
};
|
|
52
|
+
|
|
67
53
|
_this.state = {
|
|
68
54
|
searchValue: ''
|
|
69
55
|
};
|
|
70
56
|
return _this;
|
|
71
57
|
}
|
|
72
58
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
87
|
-
className: "dtable-ui-editor-popover dtable-ui-collaborator-editor-popover",
|
|
88
|
-
style: popoverStyle
|
|
89
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
className: "collaborator-search-container"
|
|
91
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
92
|
-
className: "form-control",
|
|
93
|
-
value: searchValue,
|
|
94
|
-
onChange: this.onValueChanged,
|
|
95
|
-
onClick: this.onInputClick,
|
|
96
|
-
placeholder: (0, _lang.getLocale)('Find_a_collaborator')
|
|
97
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
-
className: "collaborator-list-container"
|
|
99
|
-
}, collaborators.length > 0 && collaborators.map(function (collaborator, index) {
|
|
100
|
-
var isSelect = selectedCollaborators.some(function (selectedCollaborator) {
|
|
101
|
-
return selectedCollaborator.email === collaborator.email;
|
|
59
|
+
_createClass(PCCollaboratorEditorPopover, [{
|
|
60
|
+
key: "render",
|
|
61
|
+
value: function render() {
|
|
62
|
+
var _this2 = this;
|
|
63
|
+
|
|
64
|
+
var searchValue = this.state.searchValue;
|
|
65
|
+
var _this$props = this.props,
|
|
66
|
+
selectedCollaborators = _this$props.selectedCollaborators,
|
|
67
|
+
popoverPosition = _this$props.popoverPosition;
|
|
68
|
+
var collaborators = this.getFilterCollaborator();
|
|
69
|
+
var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
|
|
70
|
+
position: 'absolute'
|
|
102
71
|
});
|
|
103
|
-
return /*#__PURE__*/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
72
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: "dtable-ui-editor-popover dtable-ui-collaborator-editor-popover",
|
|
74
|
+
style: popoverStyle
|
|
75
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: "collaborator-search-container"
|
|
77
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
78
|
+
className: "form-control",
|
|
79
|
+
value: searchValue,
|
|
80
|
+
onChange: this.onValueChanged,
|
|
81
|
+
onClick: this.onInputClick,
|
|
82
|
+
placeholder: getLocale('Find_a_collaborator')
|
|
83
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
className: "collaborator-list-container"
|
|
85
|
+
}, collaborators.length > 0 && collaborators.map(function (collaborator, index) {
|
|
86
|
+
var isSelect = selectedCollaborators.some(function (selectedCollaborator) {
|
|
87
|
+
return selectedCollaborator.email === collaborator.email;
|
|
88
|
+
});
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
key: index,
|
|
91
|
+
className: "collaborator-item-container",
|
|
92
|
+
onClick: _this2.onCollaboratorItemToggle.bind(_this2, collaborator)
|
|
93
|
+
}, /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
94
|
+
collaborator: collaborator
|
|
95
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
className: "collaborator-checked"
|
|
97
|
+
}, isSelect && /*#__PURE__*/React.createElement("i", {
|
|
98
|
+
className: "dtable-font dtable-icon-check-mark"
|
|
99
|
+
})));
|
|
100
|
+
}), collaborators.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: "search-option-null"
|
|
102
|
+
}, getLocale('No_collaborators_available'))));
|
|
103
|
+
}
|
|
104
|
+
}]);
|
|
118
105
|
|
|
119
106
|
return PCCollaboratorEditorPopover;
|
|
120
|
-
}(
|
|
107
|
+
}(React.Component);
|
|
121
108
|
|
|
122
|
-
|
|
123
|
-
var _default = PCCollaboratorEditorPopover;
|
|
124
|
-
exports.default = _default;
|
|
109
|
+
export default PCCollaboratorEditorPopover;
|
|
@@ -1,48 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 _moment = _interopRequireDefault(require("moment"));
|
|
19
|
-
|
|
20
|
-
var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Picker"));
|
|
21
|
-
|
|
22
|
-
var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar"));
|
|
23
|
-
|
|
24
|
-
var _editorUtils = require("../../utils/editor-utils");
|
|
25
|
-
|
|
26
|
-
require("@seafile/seafile-calendar/assets/index.css");
|
|
27
|
-
|
|
28
|
-
var _lang = require("../../lang");
|
|
29
|
-
|
|
30
|
-
var propTypes = {
|
|
31
|
-
lang: _propTypes.default.string.isRequired,
|
|
32
|
-
value: _propTypes.default.string,
|
|
33
|
-
dateFormat: _propTypes.default.string.isRequired,
|
|
34
|
-
showHourAndMinute: _propTypes.default.bool.isRequired,
|
|
35
|
-
onValueChanged: _propTypes.default.func.isRequired
|
|
36
|
-
};
|
|
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 moment from 'moment';
|
|
7
|
+
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
|
8
|
+
import Calendar from '@seafile/seafile-calendar';
|
|
9
|
+
import { initDateEditorLanguage } from '../../utils/editor-utils';
|
|
10
|
+
import '@seafile/seafile-calendar/assets/index.css';
|
|
11
|
+
import { getLocale } from '../../lang';
|
|
37
12
|
|
|
38
13
|
var PCDateEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
39
|
-
(
|
|
14
|
+
_inherits(PCDateEditorPopover, _React$Component);
|
|
15
|
+
|
|
16
|
+
var _super = _createSuper(PCDateEditorPopover);
|
|
40
17
|
|
|
41
18
|
function PCDateEditorPopover(props) {
|
|
42
19
|
var _this;
|
|
43
20
|
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
_classCallCheck(this, PCDateEditorPopover);
|
|
22
|
+
|
|
23
|
+
_this = _super.call(this, props);
|
|
24
|
+
|
|
25
|
+
_this.onChange = function (value) {
|
|
46
26
|
if (!value) return;
|
|
47
27
|
var dateFormat = _this.props.dateFormat;
|
|
48
28
|
|
|
@@ -53,104 +33,110 @@ var PCDateEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
53
33
|
});
|
|
54
34
|
|
|
55
35
|
_this.props.onValueChanged(value.format(dateFormat));
|
|
56
|
-
}
|
|
57
|
-
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
_this.onOpenChange = function (open) {
|
|
58
39
|
_this.setState({
|
|
59
40
|
open: open
|
|
60
41
|
});
|
|
61
42
|
|
|
62
43
|
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
_this.onClear = function () {
|
|
65
47
|
_this.setState({
|
|
66
48
|
datePickerValue: null
|
|
67
49
|
});
|
|
68
|
-
}
|
|
69
|
-
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
_this.onFocusDatePicker = function () {
|
|
70
53
|
_this.setState({
|
|
71
54
|
open: true
|
|
72
55
|
});
|
|
73
|
-
}
|
|
74
|
-
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
_this.handleMouseDown = function (event) {
|
|
75
59
|
event.preventDefault();
|
|
76
60
|
event.stopPropagation();
|
|
77
|
-
}
|
|
78
|
-
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_this.getCalendarContainer = function () {
|
|
79
64
|
return _this.calendarContainerRef.current;
|
|
80
|
-
}
|
|
81
|
-
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
_this.getCalender = function () {
|
|
82
68
|
var _this$props = _this.props,
|
|
83
69
|
dateFormat = _this$props.dateFormat,
|
|
84
70
|
showHourAndMinute = _this$props.showHourAndMinute,
|
|
85
71
|
lang = _this$props.lang;
|
|
86
|
-
var defaultValue = (
|
|
87
|
-
return /*#__PURE__*/
|
|
88
|
-
locale:
|
|
72
|
+
var defaultValue = moment().clone();
|
|
73
|
+
return /*#__PURE__*/React.createElement(Calendar, {
|
|
74
|
+
locale: initDateEditorLanguage(lang),
|
|
89
75
|
style: {
|
|
90
76
|
zIndex: 1001
|
|
91
77
|
},
|
|
92
78
|
format: dateFormat,
|
|
93
79
|
defaultValue: defaultValue,
|
|
94
80
|
showHourAndMinute: showHourAndMinute,
|
|
95
|
-
dateInputPlaceholder:
|
|
81
|
+
dateInputPlaceholder: getLocale('Please_input'),
|
|
96
82
|
showDateInput: true,
|
|
97
83
|
focusablePanel: false,
|
|
98
84
|
onClear: _this.onClear
|
|
99
85
|
});
|
|
100
|
-
}
|
|
86
|
+
};
|
|
87
|
+
|
|
101
88
|
_this.state = {
|
|
102
89
|
open: true,
|
|
103
|
-
datePickerValue: props.value ? (
|
|
90
|
+
datePickerValue: props.value ? moment(props.value) : null
|
|
104
91
|
};
|
|
105
|
-
_this.calendarContainerRef =
|
|
92
|
+
_this.calendarContainerRef = React.createRef();
|
|
106
93
|
return _this;
|
|
107
94
|
} // event trigger sequence: onOpenChange --> onChange
|
|
108
95
|
|
|
109
96
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
97
|
+
_createClass(PCDateEditorPopover, [{
|
|
98
|
+
key: "render",
|
|
99
|
+
value: function render() {
|
|
100
|
+
var _this2 = this;
|
|
101
|
+
|
|
102
|
+
var dateFormat = this.props.dateFormat;
|
|
103
|
+
var _this$state = this.state,
|
|
104
|
+
open = _this$state.open,
|
|
105
|
+
datePickerValue = _this$state.datePickerValue;
|
|
106
|
+
var calendar = this.getCalender();
|
|
107
|
+
return /*#__PURE__*/React.createElement(DatePicker, {
|
|
108
|
+
open: open,
|
|
109
|
+
value: datePickerValue,
|
|
110
|
+
animation: "slide-up",
|
|
111
|
+
style: {
|
|
112
|
+
zIndex: 1001
|
|
113
|
+
},
|
|
114
|
+
calendar: calendar,
|
|
115
|
+
getCalendarContainer: this.getCalendarContainer,
|
|
116
|
+
onChange: this.onChange,
|
|
117
|
+
onOpenChange: this.onOpenChange
|
|
118
|
+
}, function (_ref) {
|
|
119
|
+
var value = _ref.value;
|
|
120
|
+
value = value && value.format(dateFormat);
|
|
121
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
122
|
+
className: "dtable-ui-date-editor-container",
|
|
123
|
+
tabIndex: "0",
|
|
124
|
+
onFocus: _this2.onFocusDatePicker
|
|
125
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
126
|
+
readOnly: true,
|
|
127
|
+
tabIndex: "-1",
|
|
128
|
+
className: "form-control",
|
|
129
|
+
placeholder: getLocale('Please_select'),
|
|
130
|
+
value: value || '',
|
|
131
|
+
onMouseDown: _this2.handleMouseDown
|
|
132
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
ref: _this2.calendarContainerRef
|
|
134
|
+
}));
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}]);
|
|
150
138
|
|
|
151
139
|
return PCDateEditorPopover;
|
|
152
|
-
}(
|
|
140
|
+
}(React.Component);
|
|
153
141
|
|
|
154
|
-
|
|
155
|
-
var _default = PCDateEditorPopover;
|
|
156
|
-
exports.default = _default;
|
|
142
|
+
export default PCDateEditorPopover;
|
|
@@ -1,55 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
-
|
|
10
|
-
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
var _lang = require("../../lang");
|
|
19
|
-
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
|
-
|
|
24
|
-
var propTypes = {
|
|
25
|
-
popoverPosition: _propTypes.default.object.isRequired,
|
|
26
|
-
options: _propTypes.default.array.isRequired,
|
|
27
|
-
selectedOptions: _propTypes.default.array.isRequired,
|
|
28
|
-
onOptionItemToggle: _propTypes.default.func.isRequired
|
|
29
|
-
};
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { getLocale } from '../../lang';
|
|
30
8
|
|
|
31
9
|
var PCLinkEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
32
|
-
(
|
|
10
|
+
_inherits(PCLinkEditorPopover, _React$Component);
|
|
11
|
+
|
|
12
|
+
var _super = _createSuper(PCLinkEditorPopover);
|
|
33
13
|
|
|
34
14
|
function PCLinkEditorPopover(props) {
|
|
35
15
|
var _this;
|
|
36
16
|
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
_classCallCheck(this, PCLinkEditorPopover);
|
|
18
|
+
|
|
19
|
+
_this = _super.call(this, props);
|
|
20
|
+
|
|
21
|
+
_this.onValueChanged = function (event) {
|
|
39
22
|
var value = event.target.value;
|
|
40
23
|
|
|
41
24
|
_this.setState({
|
|
42
25
|
searchValue: value
|
|
43
26
|
});
|
|
44
|
-
}
|
|
45
|
-
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
_this.onInputClick = function (event) {
|
|
46
30
|
event.nativeEvent.stopImmediatePropagation();
|
|
47
31
|
event.stopPropagation();
|
|
48
|
-
}
|
|
49
|
-
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
_this.onOptionItemToggle = function (item) {
|
|
50
35
|
_this.props.onOptionItemToggle(item);
|
|
51
|
-
}
|
|
52
|
-
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
_this.getFilterOptions = function () {
|
|
53
39
|
var options = _this.props.options;
|
|
54
40
|
|
|
55
41
|
var filter = _this.state.searchValue.toLowerCase();
|
|
@@ -61,68 +47,68 @@ var PCLinkEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
61
47
|
return options.filter(function (option) {
|
|
62
48
|
return option.name.toString().toLowerCase().indexOf(filter) > -1;
|
|
63
49
|
});
|
|
64
|
-
}
|
|
50
|
+
};
|
|
51
|
+
|
|
65
52
|
_this.state = {
|
|
66
53
|
searchValue: ''
|
|
67
54
|
};
|
|
68
55
|
return _this;
|
|
69
56
|
}
|
|
70
57
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
});
|
|
84
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
-
className: "dtable-ui-editor-popover dtable-ui-link-editor-popover",
|
|
86
|
-
style: popoverStyle
|
|
87
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
-
className: "link-options-search"
|
|
89
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
90
|
-
className: "form-control",
|
|
91
|
-
value: searchValue,
|
|
92
|
-
onChange: this.onValueChanged,
|
|
93
|
-
onClick: this.onInputClick,
|
|
94
|
-
placeholder: (0, _lang.getLocale)('Find_an_option')
|
|
95
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: "link-options-container"
|
|
97
|
-
}, options.length > 0 && options.map(function (option, index) {
|
|
98
|
-
var isSelect = selectedOptions.some(function (selectedOption) {
|
|
99
|
-
return selectedOption.id === option.id;
|
|
58
|
+
_createClass(PCLinkEditorPopover, [{
|
|
59
|
+
key: "render",
|
|
60
|
+
value: function render() {
|
|
61
|
+
var _this2 = this;
|
|
62
|
+
|
|
63
|
+
var options = this.getFilterOptions();
|
|
64
|
+
var _this$props = this.props,
|
|
65
|
+
popoverPosition = _this$props.popoverPosition,
|
|
66
|
+
selectedOptions = _this$props.selectedOptions;
|
|
67
|
+
var searchValue = this.state.searchValue;
|
|
68
|
+
var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
|
|
69
|
+
position: 'absolute'
|
|
100
70
|
});
|
|
101
|
-
return /*#__PURE__*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: "dtable-ui-editor-popover dtable-ui-link-editor-popover",
|
|
73
|
+
style: popoverStyle
|
|
74
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: "link-options-search"
|
|
76
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
77
|
+
className: "form-control",
|
|
78
|
+
value: searchValue,
|
|
79
|
+
onChange: this.onValueChanged,
|
|
80
|
+
onClick: this.onInputClick,
|
|
81
|
+
placeholder: getLocale('Find_an_option')
|
|
82
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: "link-options-container"
|
|
84
|
+
}, options.length > 0 && options.map(function (option, index) {
|
|
85
|
+
var isSelect = selectedOptions.some(function (selectedOption) {
|
|
86
|
+
return selectedOption.id === option.id;
|
|
87
|
+
});
|
|
88
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
key: index,
|
|
90
|
+
className: "link-option-item",
|
|
91
|
+
onClick: _this2.onOptionItemToggle.bind(_this2, option)
|
|
92
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: "option-info"
|
|
94
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "option-name"
|
|
96
|
+
}, option.name)), /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: "option-checked"
|
|
98
|
+
}, isSelect && /*#__PURE__*/React.createElement("i", {
|
|
99
|
+
className: "dtable-font dtable-icon-check-mark"
|
|
100
|
+
})));
|
|
101
|
+
}), options.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: "link-option-null"
|
|
103
|
+
}, getLocale('No_options_available'))));
|
|
104
|
+
}
|
|
105
|
+
}]);
|
|
118
106
|
|
|
119
107
|
return PCLinkEditorPopover;
|
|
120
|
-
}(
|
|
108
|
+
}(React.Component);
|
|
121
109
|
|
|
122
|
-
|
|
110
|
+
PCLinkEditorPopover.defaultProps = {
|
|
123
111
|
popoverPosition: {},
|
|
124
112
|
options: []
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
var _default = PCLinkEditorPopover;
|
|
128
|
-
exports.default = _default;
|
|
113
|
+
};
|
|
114
|
+
export default PCLinkEditorPopover;
|