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,47 +1,62 @@
|
|
|
1
|
-
|
|
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';
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
var
|
|
10
|
-
_inherits(PCSelectEditorPopover, _React$Component);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
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"));
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
var _lang = require("../../lang");
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23
|
+
|
|
24
|
+
var propTypes = {
|
|
25
|
+
popoverPosition: _propTypes.default.object.isRequired,
|
|
26
|
+
options: _propTypes.default.array.isRequired,
|
|
27
|
+
selectedOptions: _propTypes.default.array.isRequired,
|
|
28
|
+
onOptionItemToggle: _propTypes.default.func.isRequired,
|
|
29
|
+
isSupportNewOption: _propTypes.default.bool,
|
|
30
|
+
onAddNewOption: _propTypes.default.func
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var PCSelectEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
34
|
+
(0, _inheritsLoose2.default)(PCSelectEditorPopover, _React$Component);
|
|
35
|
+
|
|
36
|
+
function PCSelectEditorPopover(props) {
|
|
37
|
+
var _this;
|
|
20
38
|
|
|
21
|
-
_this
|
|
39
|
+
_this = _React$Component.call(this, props) || this;
|
|
40
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onValueChanged", function (event) {
|
|
22
41
|
var value = event.target.value;
|
|
23
42
|
|
|
24
43
|
_this.setState({
|
|
25
44
|
searchValue: value
|
|
26
45
|
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
_this.onInputClick = function (event) {
|
|
46
|
+
});
|
|
47
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onInputClick", function (event) {
|
|
30
48
|
event.nativeEvent.stopImmediatePropagation();
|
|
31
49
|
event.stopPropagation();
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
_this.onAddNewOption = function () {
|
|
50
|
+
});
|
|
51
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onAddNewOption", function () {
|
|
35
52
|
var name = _this.state.searchValue.trim();
|
|
36
53
|
|
|
37
54
|
_this.props.onAddNewOption(name);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
_this.onOptionItemToggle = function (item) {
|
|
55
|
+
});
|
|
56
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOptionItemToggle", function (item) {
|
|
41
57
|
_this.props.onOptionItemToggle(item);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
_this.getFilterOptions = function () {
|
|
58
|
+
});
|
|
59
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFilterOptions", function () {
|
|
45
60
|
var options = _this.props.options;
|
|
46
61
|
|
|
47
62
|
var filter = _this.state.searchValue.toLowerCase();
|
|
@@ -53,9 +68,8 @@ var PCSelectEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
53
68
|
return options.filter(function (option) {
|
|
54
69
|
return option.name.toString().toLowerCase().indexOf(filter) > -1;
|
|
55
70
|
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
_this.getOptionStyle = function (option) {
|
|
71
|
+
});
|
|
72
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOptionStyle", function (option) {
|
|
59
73
|
var textColor = option.textColor || null;
|
|
60
74
|
return {
|
|
61
75
|
display: 'inline-block',
|
|
@@ -67,77 +81,77 @@ var PCSelectEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
67
81
|
backgroundColor: option.color,
|
|
68
82
|
color: textColor
|
|
69
83
|
};
|
|
70
|
-
};
|
|
71
|
-
|
|
84
|
+
});
|
|
72
85
|
_this.state = {
|
|
73
86
|
searchValue: ''
|
|
74
87
|
};
|
|
75
88
|
return _this;
|
|
76
89
|
}
|
|
77
90
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
var _proto = PCSelectEditorPopover.prototype;
|
|
92
|
+
|
|
93
|
+
_proto.render = function render() {
|
|
94
|
+
var _this2 = this;
|
|
95
|
+
|
|
96
|
+
var options = this.getFilterOptions();
|
|
97
|
+
var _this$props = this.props,
|
|
98
|
+
popoverPosition = _this$props.popoverPosition,
|
|
99
|
+
selectedOptions = _this$props.selectedOptions,
|
|
100
|
+
isSupportNewOption = _this$props.isSupportNewOption;
|
|
101
|
+
var searchValue = this.state.searchValue;
|
|
102
|
+
var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
|
|
103
|
+
position: 'absolute'
|
|
104
|
+
});
|
|
105
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
+
className: "dtable-ui-editor-popover dtable-ui-select-editor-popover",
|
|
107
|
+
style: popoverStyle
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
+
className: "select-options-search"
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
111
|
+
className: "form-control",
|
|
112
|
+
onChange: this.onValueChanged,
|
|
113
|
+
onClick: this.onInputClick,
|
|
114
|
+
placeholder: (0, _lang.getLocale)('Find_an_option')
|
|
115
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
+
className: "select-options-container"
|
|
117
|
+
}, options.length > 0 && options.map(function (option, index) {
|
|
118
|
+
var optionStyle = _this2.getOptionStyle(option);
|
|
119
|
+
|
|
120
|
+
var isSelect = selectedOptions.some(function (selectedOption) {
|
|
121
|
+
return selectedOption.id === option.id;
|
|
91
122
|
});
|
|
92
|
-
return /*#__PURE__*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
className: "option-info"
|
|
116
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className: "option-name",
|
|
118
|
-
style: optionStyle
|
|
119
|
-
}, option.name)), /*#__PURE__*/React.createElement("div", {
|
|
120
|
-
className: "option-checked"
|
|
121
|
-
}, isSelect && /*#__PURE__*/React.createElement("i", {
|
|
122
|
-
className: "dtable-font dtable-icon-check-mark"
|
|
123
|
-
})));
|
|
124
|
-
}), options.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
125
|
-
className: "search-option-null"
|
|
126
|
-
}, getLocale('No_options_available'))), isSupportNewOption && !!searchValue && /*#__PURE__*/React.createElement("div", {
|
|
127
|
-
className: "select-options-add",
|
|
128
|
-
onClick: this.onAddNewOption
|
|
129
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
130
|
-
className: "dtable-font dtable-icon-add-table"
|
|
131
|
-
}), /*#__PURE__*/React.createElement("span", null, getLocale('Add_an_option'), ' ', searchValue)));
|
|
132
|
-
}
|
|
133
|
-
}]);
|
|
123
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
key: index,
|
|
125
|
+
className: "select-option-item",
|
|
126
|
+
onClick: _this2.onOptionItemToggle.bind(_this2, option)
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
128
|
+
className: "option-info"
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
+
className: "option-name",
|
|
131
|
+
style: optionStyle
|
|
132
|
+
}, option.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
className: "option-checked"
|
|
134
|
+
}, isSelect && /*#__PURE__*/_react.default.createElement("i", {
|
|
135
|
+
className: "dtable-font dtable-icon-check-mark"
|
|
136
|
+
})));
|
|
137
|
+
}), options.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
+
className: "search-option-null"
|
|
139
|
+
}, (0, _lang.getLocale)('No_options_available'))), isSupportNewOption && !!searchValue && /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
+
className: "select-options-add",
|
|
141
|
+
onClick: this.onAddNewOption
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
143
|
+
className: "dtable-font dtable-icon-add-table"
|
|
144
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Add_an_option'), ' ', searchValue)));
|
|
145
|
+
};
|
|
134
146
|
|
|
135
147
|
return PCSelectEditorPopover;
|
|
136
|
-
}(
|
|
148
|
+
}(_react.default.Component);
|
|
137
149
|
|
|
138
|
-
PCSelectEditorPopover
|
|
150
|
+
(0, _defineProperty2.default)(PCSelectEditorPopover, "defaultProps", {
|
|
139
151
|
popoverPosition: {},
|
|
140
152
|
options: [],
|
|
141
153
|
isShowAddBtn: false
|
|
142
|
-
};
|
|
143
|
-
|
|
154
|
+
});
|
|
155
|
+
PCSelectEditorPopover.propTypes = propTypes;
|
|
156
|
+
var _default = PCSelectEditorPopover;
|
|
157
|
+
exports.default = _default;
|
|
@@ -1,63 +1,79 @@
|
|
|
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';
|
|
1
|
+
"use strict";
|
|
6
2
|
|
|
7
|
-
var
|
|
8
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
+
|
|
10
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var propTypes = {
|
|
19
|
+
collaborator: _propTypes.default.shape({
|
|
20
|
+
name: _propTypes.default.string.isRequired,
|
|
21
|
+
avatar_url: _propTypes.default.string.isRequired,
|
|
22
|
+
email: _propTypes.default.string
|
|
23
|
+
}),
|
|
24
|
+
enableDeleteCollaborator: _propTypes.default.bool,
|
|
25
|
+
onDeleteCollaborator: _propTypes.default.func
|
|
26
|
+
};
|
|
9
27
|
|
|
10
|
-
|
|
28
|
+
var CollaboratorItem = /*#__PURE__*/function (_React$Component) {
|
|
29
|
+
(0, _inheritsLoose2.default)(CollaboratorItem, _React$Component);
|
|
11
30
|
|
|
12
31
|
function CollaboratorItem() {
|
|
13
32
|
var _this;
|
|
14
33
|
|
|
15
|
-
_classCallCheck(this, CollaboratorItem);
|
|
16
|
-
|
|
17
34
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
35
|
args[_key] = arguments[_key];
|
|
19
36
|
}
|
|
20
37
|
|
|
21
|
-
_this =
|
|
22
|
-
|
|
23
|
-
_this.onDeleteCollaborator = function () {
|
|
38
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
39
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onDeleteCollaborator", function () {
|
|
24
40
|
var collaborator = _this.props.collaborator;
|
|
25
41
|
|
|
26
42
|
_this.props.onDeleteCollaborator(collaborator);
|
|
27
|
-
};
|
|
28
|
-
|
|
43
|
+
});
|
|
29
44
|
return _this;
|
|
30
45
|
}
|
|
31
46
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}]);
|
|
47
|
+
var _proto = CollaboratorItem.prototype;
|
|
48
|
+
|
|
49
|
+
_proto.render = function render() {
|
|
50
|
+
var _this$props = this.props,
|
|
51
|
+
collaborator = _this$props.collaborator,
|
|
52
|
+
enableDeleteCollaborator = _this$props.enableDeleteCollaborator;
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
+
className: "dtable-ui collaborator-item"
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
56
|
+
className: "collaborator-avatar"
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
58
|
+
className: "collaborator-avatar-icon",
|
|
59
|
+
alt: collaborator.name,
|
|
60
|
+
src: collaborator.avatar_url
|
|
61
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
+
className: "collaborator-name"
|
|
63
|
+
}, collaborator.name), enableDeleteCollaborator && /*#__PURE__*/_react.default.createElement("span", {
|
|
64
|
+
className: "collaborator-remove",
|
|
65
|
+
onClick: this.onDeleteCollaborator
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
67
|
+
className: "dtable-font dtable-icon-fork-number"
|
|
68
|
+
})));
|
|
69
|
+
};
|
|
56
70
|
|
|
57
71
|
return CollaboratorItem;
|
|
58
|
-
}(
|
|
72
|
+
}(_react.default.Component);
|
|
59
73
|
|
|
60
|
-
CollaboratorItem
|
|
74
|
+
(0, _defineProperty2.default)(CollaboratorItem, "defaultProps", {
|
|
61
75
|
enableDelete: false
|
|
62
|
-
};
|
|
63
|
-
|
|
76
|
+
});
|
|
77
|
+
CollaboratorItem.propTypes = propTypes;
|
|
78
|
+
var _default = CollaboratorItem;
|
|
79
|
+
exports.default = _default;
|
|
@@ -1,26 +1,37 @@
|
|
|
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';
|
|
1
|
+
"use strict";
|
|
6
2
|
|
|
7
|
-
var
|
|
8
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
+
|
|
10
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
17
|
|
|
10
|
-
|
|
18
|
+
var propTypes = {
|
|
19
|
+
text: _propTypes.default.string.isRequired,
|
|
20
|
+
onClick: _propTypes.default.func
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var EditEditorButton = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
(0, _inheritsLoose2.default)(EditEditorButton, _React$Component);
|
|
11
25
|
|
|
12
26
|
function EditEditorButton() {
|
|
13
27
|
var _this;
|
|
14
28
|
|
|
15
|
-
_classCallCheck(this, EditEditorButton);
|
|
16
|
-
|
|
17
29
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
30
|
args[_key] = arguments[_key];
|
|
19
31
|
}
|
|
20
32
|
|
|
21
|
-
_this =
|
|
22
|
-
|
|
23
|
-
_this.getStyle = function () {
|
|
33
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
34
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getStyle", function () {
|
|
24
35
|
return {
|
|
25
36
|
display: 'inline-block',
|
|
26
37
|
padding: '0 12px',
|
|
@@ -33,24 +44,24 @@ var EditEditorButton = /*#__PURE__*/function (_React$Component) {
|
|
|
33
44
|
cursor: 'pointer',
|
|
34
45
|
userSelect: 'none'
|
|
35
46
|
};
|
|
36
|
-
};
|
|
37
|
-
|
|
47
|
+
});
|
|
38
48
|
return _this;
|
|
39
49
|
}
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}]);
|
|
51
|
+
var _proto = EditEditorButton.prototype;
|
|
52
|
+
|
|
53
|
+
_proto.render = function render() {
|
|
54
|
+
var text = this.props.text;
|
|
55
|
+
var style = this.getStyle();
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
57
|
+
style: style,
|
|
58
|
+
onClick: this.props.onClick
|
|
59
|
+
}, text);
|
|
60
|
+
};
|
|
52
61
|
|
|
53
62
|
return EditEditorButton;
|
|
54
|
-
}(
|
|
63
|
+
}(_react.default.Component);
|
|
55
64
|
|
|
56
|
-
|
|
65
|
+
EditEditorButton.propTypes = propTypes;
|
|
66
|
+
var _default = EditEditorButton;
|
|
67
|
+
exports.default = _default;
|
|
@@ -1,33 +1,44 @@
|
|
|
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';
|
|
1
|
+
"use strict";
|
|
6
2
|
|
|
7
|
-
var
|
|
8
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
+
|
|
10
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var propTypes = {
|
|
19
|
+
option: _propTypes.default.object.isRequired,
|
|
20
|
+
isShowRemoveIcon: _propTypes.default.bool,
|
|
21
|
+
onDeleteLinkOption: _propTypes.default.func
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var LinkEditorOption = /*#__PURE__*/function (_React$Component) {
|
|
25
|
+
(0, _inheritsLoose2.default)(LinkEditorOption, _React$Component);
|
|
11
26
|
|
|
12
27
|
function LinkEditorOption() {
|
|
13
28
|
var _this;
|
|
14
29
|
|
|
15
|
-
_classCallCheck(this, LinkEditorOption);
|
|
16
|
-
|
|
17
30
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
31
|
args[_key] = arguments[_key];
|
|
19
32
|
}
|
|
20
33
|
|
|
21
|
-
_this =
|
|
22
|
-
|
|
23
|
-
_this.onDeleteOption = function (event) {
|
|
34
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
35
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onDeleteOption", function (event) {
|
|
24
36
|
event.nativeEvent.stopImmediatePropagation();
|
|
25
37
|
event.stopPropagation();
|
|
26
38
|
|
|
27
39
|
_this.props.onDeleteLinkOption(_this.props.option);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
_this.getContainerStyle = function () {
|
|
40
|
+
});
|
|
41
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getContainerStyle", function () {
|
|
31
42
|
return {
|
|
32
43
|
display: 'inline-flex',
|
|
33
44
|
marginRight: '10px',
|
|
@@ -38,27 +49,24 @@ var LinkEditorOption = /*#__PURE__*/function (_React$Component) {
|
|
|
38
49
|
background: '#eceff4',
|
|
39
50
|
cursor: 'pointer'
|
|
40
51
|
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
_this.getOptionStyle = function () {
|
|
52
|
+
});
|
|
53
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOptionStyle", function () {
|
|
44
54
|
return {
|
|
45
55
|
flex: 1,
|
|
46
56
|
display: 'flex',
|
|
47
57
|
alignContent: 'center',
|
|
48
58
|
margin: '0 4px 0 2px'
|
|
49
59
|
};
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
_this.getOptionNameStyle = function () {
|
|
60
|
+
});
|
|
61
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOptionNameStyle", function () {
|
|
53
62
|
return {
|
|
54
63
|
maxWidth: '230px',
|
|
55
64
|
overflow: 'hidden',
|
|
56
65
|
whiteSpace: 'nowrap',
|
|
57
66
|
textOverflow: 'ellipsis'
|
|
58
67
|
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
_this.getOperationStyle = function () {
|
|
68
|
+
});
|
|
69
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOperationStyle", function () {
|
|
62
70
|
return {
|
|
63
71
|
height: '20px',
|
|
64
72
|
width: '16px',
|
|
@@ -66,48 +74,48 @@ var LinkEditorOption = /*#__PURE__*/function (_React$Component) {
|
|
|
66
74
|
color: '#909090',
|
|
67
75
|
transform: 'scale(.8)'
|
|
68
76
|
};
|
|
69
|
-
};
|
|
70
|
-
|
|
77
|
+
});
|
|
71
78
|
return _this;
|
|
72
79
|
}
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}]);
|
|
81
|
+
var _proto = LinkEditorOption.prototype;
|
|
82
|
+
|
|
83
|
+
_proto.render = function render() {
|
|
84
|
+
var _this$props = this.props,
|
|
85
|
+
option = _this$props.option,
|
|
86
|
+
isShowRemoveIcon = _this$props.isShowRemoveIcon;
|
|
87
|
+
var containerStyle = this.getContainerStyle();
|
|
88
|
+
var optionStyle = this.getOptionStyle();
|
|
89
|
+
var optionNameStyle = this.getOptionNameStyle();
|
|
90
|
+
var operationStyle = this.getOperationStyle();
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: "dtable-ui link-option-item",
|
|
93
|
+
style: containerStyle
|
|
94
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
+
className: "option-info",
|
|
96
|
+
style: optionStyle
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
+
className: "option-name",
|
|
99
|
+
style: optionNameStyle
|
|
100
|
+
}, option.name)), isShowRemoveIcon && /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
+
className: "option-remove",
|
|
102
|
+
style: operationStyle,
|
|
103
|
+
onClick: this.onDeleteOption
|
|
104
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
105
|
+
className: "dtable-font dtable-icon-fork-number",
|
|
106
|
+
style: {
|
|
107
|
+
fontSize: '12px',
|
|
108
|
+
lineHeight: '20px'
|
|
109
|
+
}
|
|
110
|
+
})));
|
|
111
|
+
};
|
|
106
112
|
|
|
107
113
|
return LinkEditorOption;
|
|
108
|
-
}(
|
|
114
|
+
}(_react.default.Component);
|
|
109
115
|
|
|
110
|
-
LinkEditorOption
|
|
116
|
+
(0, _defineProperty2.default)(LinkEditorOption, "defaultProps", {
|
|
111
117
|
isShowRemoveIcon: false
|
|
112
|
-
};
|
|
113
|
-
|
|
118
|
+
});
|
|
119
|
+
LinkEditorOption.propTypes = propTypes;
|
|
120
|
+
var _default = LinkEditorOption;
|
|
121
|
+
exports.default = _default;
|