dtable-ui-component 4.4.3-2 → 4.4.3-alpha1
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 +7 -14
- package/lib/ButtonFormatter/index.js +9 -16
- package/lib/CTimeFormatter/index.js +9 -16
- package/lib/CheckboxEditor/index.js +8 -15
- package/lib/CheckboxFormatter/index.js +8 -15
- package/lib/CollaboratorEditor/index.js +21 -29
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +25 -32
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +18 -25
- package/lib/CollaboratorFormatter/index.js +12 -19
- package/lib/CollaboratorItem/index.js +10 -17
- package/lib/CreatorFormatter/index.js +12 -19
- package/lib/DTableCommonAddTool/index.js +6 -13
- package/lib/DTableCustomizeCollaboratorSelect/index.js +18 -26
- package/lib/DTableCustomizeSelect/index.js +15 -23
- package/lib/DTableFiltersPopover/constants/index.js +33 -38
- package/lib/DTableFiltersPopover/index.js +31 -38
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +46 -53
- package/lib/DTableFiltersPopover/utils/index.js +99 -128
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +26 -34
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +25 -33
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-item.js +120 -128
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +18 -26
- package/lib/DTableFiltersPopover/widgets/rate-item.js +8 -15
- package/lib/DTablePopover/index.js +8 -15
- package/lib/DTablePopover/utils.js +2 -9
- package/lib/DTableRadio/index.js +10 -17
- package/lib/DTableSearchInput/index.js +13 -21
- package/lib/DTableSearchInput/utils.js +2 -9
- package/lib/DTableSelect/dtable-select-label.js +6 -13
- package/lib/DTableSelect/index.js +10 -18
- package/lib/DTableSelect/utils.js +10 -20
- package/lib/DTableSwitch/index.js +7 -14
- package/lib/DateEditor/index.js +22 -30
- package/lib/DateEditor/mb-date-editor-popover/index.js +47 -55
- package/lib/DateEditor/pc-date-editor-popover.js +20 -27
- package/lib/DateFormatter/index.js +9 -16
- package/lib/Department-editor/constants.js +1 -7
- package/lib/Department-editor/department-multiple-select/index.js +24 -32
- package/lib/Department-editor/department-single-select.js +33 -41
- package/lib/Department-editor/index.js +14 -22
- package/lib/Department-editor/selected-departments/index.js +25 -32
- package/lib/Department-editor/utils.js +3 -11
- package/lib/DepartmentSingleSelectFormatter/index.js +9 -16
- package/lib/DigitalSignFormatter/index.js +15 -23
- package/lib/DigitalSignFormatter/utils.js +3 -11
- package/lib/DurationFormatter/index.js +9 -16
- package/lib/EditEditorButton/index.js +5 -12
- package/lib/EmailFormatter/index.js +7 -14
- package/lib/FieldDisplaySetting/field-item.js +14 -21
- package/lib/FieldDisplaySetting/index.js +19 -27
- package/lib/FileEditor/index.js +8 -15
- package/lib/FileEditor/pc-files-addition/index.js +0 -1
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/FileEditor/pc-files-preview/index.js +0 -1
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
- package/lib/FileFormatter/index.js +11 -19
- package/lib/FileItemFormatter/index.js +6 -14
- package/lib/FileItemFormatter/utils.js +2 -9
- package/lib/FileUploader/index.js +4 -11
- package/lib/FormulaFormatter/cell-value-validator.js +18 -24
- package/lib/FormulaFormatter/index.js +32 -39
- package/lib/FormulaFormatter/utils.js +13 -29
- package/lib/GeolocationFormatter/index.js +9 -16
- package/lib/HtmlLongTextFormatter/index.js +9 -17
- package/lib/HtmlLongTextFormatter/markdown2html.js +47 -0
- package/lib/HtmlLongTextFormatter/unified/index.js +400 -0
- package/lib/HtmlLongTextFormatter/vfile/core.js +155 -0
- package/lib/HtmlLongTextFormatter/vfile/index.js +40 -0
- package/lib/ImageFormatter/images-lazy-load.js +9 -16
- package/lib/ImageFormatter/index.js +16 -24
- package/lib/ImageFormatter/utils.js +2 -9
- package/lib/ImagePreviewerLightbox/index.js +12 -19
- package/lib/ImagePreviewerLightbox/utils.js +3 -11
- package/lib/LastModifierFormatter/index.js +12 -19
- package/lib/LinkEditor/index.js +25 -33
- package/lib/LinkEditor/link-editor-option.js +8 -15
- package/lib/LinkEditor/mb-link-editor-popover/index.js +23 -30
- package/lib/LinkEditor/pc-link-editor-popover/index.js +17 -24
- package/lib/LinkFormatter/index.js +13 -20
- package/lib/Loading/index.js +4 -11
- package/lib/LongTextFormatter/index.js +6 -13
- package/lib/MBEditorHeader/index.js +7 -14
- package/lib/MTimeFormatter/index.js +9 -16
- package/lib/ModalPortal/index.js +5 -12
- package/lib/MultipleSelectEditor/index.js +17 -25
- package/lib/MultipleSelectFormatter/index.js +10 -17
- package/lib/NotificationPopover/index.js +16 -24
- package/lib/NumberEditor/index.js +18 -25
- package/lib/NumberFormatter/index.js +9 -16
- package/lib/RateFormatter/index.js +8 -15
- package/lib/RoleStatusEditor/index.js +14 -22
- package/lib/RowExpandEmailFormatter/index.js +10 -17
- package/lib/RowExpandFileFormatter/index.js +8 -16
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +18 -27
- package/lib/RowExpandFormatter/index.js +78 -86
- package/lib/RowExpandFormulaFormatter/index.js +34 -42
- package/lib/RowExpandImageFormatter/index.js +10 -19
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +18 -27
- package/lib/RowExpandImageFormatter/utils.js +2 -9
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +7 -16
- package/lib/RowExpandLinkFormatter/index.js +37 -46
- package/lib/RowExpandLinkFormatter/utils.js +6 -17
- package/lib/RowExpandLinkFormatter/value-display-utils.js +5 -12
- package/lib/RowExpandRateFormatter/index.js +8 -15
- package/lib/RowExpandUrlFormatter/index.js +14 -21
- package/lib/SelectItem/index.js +4 -12
- package/lib/SelectOptionGroup/KeyCodes.js +1 -7
- package/lib/SelectOptionGroup/index.js +33 -32
- package/lib/SelectOptionGroup/option.js +4 -19
- package/lib/SimpleLongTextFormatter/index.js +20 -27
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +1 -7
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +8 -15
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +7 -14
- package/lib/SingleSelectEditor/index.js +18 -26
- package/lib/SingleSelectFormatter/index.js +9 -16
- package/lib/TextEditor/index.js +7 -14
- package/lib/TextFormatter/index.js +7 -14
- package/lib/UrlFormatter/index.js +7 -14
- package/lib/cellFormatterFactory/index.js +4 -11
- package/lib/common/ClickOutside.js +4 -12
- package/lib/common/delete-tip.js +12 -20
- package/lib/common/modal-portal.js +5 -13
- package/lib/constants/index.js +9 -28
- package/lib/data/dtable-value.js +6 -11
- package/lib/formatterConfig/base-formatter-config.js +46 -53
- package/lib/formatterConfig/index.js +9 -16
- package/lib/hooks/common-hooks.js +4 -11
- package/lib/index.js +75 -432
- package/lib/lang/index.js +13 -24
- package/lib/locals/de.js +1 -7
- package/lib/locals/en.js +1 -7
- package/lib/locals/fr.js +1 -7
- package/lib/locals/zh-CN.js +1 -7
- package/lib/select-editor/index.js +4 -27
- package/lib/select-editor/mb-select-editor-popover/index.js +33 -41
- package/lib/select-editor/pc-select-editor-popover/index.js +19 -26
- package/lib/select-editor/select-editor-option.js +8 -15
- package/lib/toaster/alert.js +11 -18
- package/lib/toaster/index.js +3 -10
- package/lib/toaster/toast.js +8 -16
- package/lib/toaster/toastManager.js +5 -13
- package/lib/toaster/toaster.js +7 -15
- package/lib/utils/dayjs.js +4 -11
- package/lib/utils/editor-utils.js +5 -15
- package/lib/utils/event-bus.js +1 -7
- package/lib/utils/utils.js +6 -17
- package/package.json +77 -63
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _lang = require("../../lang");
|
|
11
|
-
var _selectEditorOption = _interopRequireDefault(require("../select-editor-option"));
|
|
12
|
-
var _MBEditorHeader = _interopRequireDefault(require("../../MBEditorHeader"));
|
|
13
|
-
require("./index.css");
|
|
14
|
-
class MBSelectEditorPopover extends _react.default.Component {
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import { getLocale } from '../../lang';
|
|
3
|
+
import SelectEditorOption from '../select-editor-option';
|
|
4
|
+
import MBEditorHeader from '../../MBEditorHeader';
|
|
5
|
+
import './index.css';
|
|
6
|
+
class MBSelectEditorPopover extends React.Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.handleHistaryBack = e => {
|
|
@@ -83,19 +75,19 @@ class MBSelectEditorPopover extends _react.default.Component {
|
|
|
83
75
|
backgroundColor: option.color,
|
|
84
76
|
color: option.textColor || null
|
|
85
77
|
};
|
|
86
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
87
79
|
className: "mb-select-option-item",
|
|
88
80
|
key: index,
|
|
89
81
|
onMouseDown: this.onSelectOption.bind(this, option)
|
|
90
|
-
}, /*#__PURE__*/
|
|
82
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
91
83
|
className: "mb-select-item"
|
|
92
|
-
}, /*#__PURE__*/
|
|
84
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
93
85
|
className: "item-name",
|
|
94
86
|
style: style,
|
|
95
87
|
title: option.name
|
|
96
|
-
}, option.name)), /*#__PURE__*/
|
|
88
|
+
}, option.name)), /*#__PURE__*/React.createElement("span", {
|
|
97
89
|
className: "mb-item-checked"
|
|
98
|
-
}, isSelect && /*#__PURE__*/
|
|
90
|
+
}, isSelect && /*#__PURE__*/React.createElement("i", {
|
|
99
91
|
className: "dtable-font dtable-icon-check-mark"
|
|
100
92
|
})));
|
|
101
93
|
});
|
|
@@ -131,61 +123,61 @@ class MBSelectEditorPopover extends _react.default.Component {
|
|
|
131
123
|
if (isShowCreateBtn) {
|
|
132
124
|
isShowCreateBtn = filteredOptions.length === 0;
|
|
133
125
|
}
|
|
134
|
-
return /*#__PURE__*/
|
|
126
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
135
127
|
ref: this.setEditorPopover,
|
|
136
128
|
className: "dtable-ui-mb-editor-popover mb-select-editor-popover",
|
|
137
129
|
style: {
|
|
138
130
|
zIndex: 99
|
|
139
131
|
},
|
|
140
132
|
onClick: this.onContainerClick
|
|
141
|
-
}, /*#__PURE__*/
|
|
133
|
+
}, /*#__PURE__*/React.createElement(MBEditorHeader, {
|
|
142
134
|
title: column.name,
|
|
143
|
-
leftContent: /*#__PURE__*/
|
|
135
|
+
leftContent: /*#__PURE__*/React.createElement("i", {
|
|
144
136
|
className: "dtable-font dtable-icon-return"
|
|
145
137
|
}),
|
|
146
138
|
onLeftClick: this.props.onClosePopover
|
|
147
|
-
}), /*#__PURE__*/
|
|
139
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
148
140
|
className: "dtable-ui-mb-editor-body dtable-ui-mb-select-editor-body"
|
|
149
|
-
}, /*#__PURE__*/
|
|
141
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
150
142
|
className: "mb-selected-item"
|
|
151
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
152
144
|
className: "title"
|
|
153
|
-
},
|
|
145
|
+
}, getLocale('Current_option')), /*#__PURE__*/React.createElement("div", {
|
|
154
146
|
className: "content"
|
|
155
|
-
}, selectedOptions.length === 0 && /*#__PURE__*/
|
|
147
|
+
}, selectedOptions.length === 0 && /*#__PURE__*/React.createElement("span", {
|
|
156
148
|
className: "empty-placeholder"
|
|
157
|
-
},
|
|
158
|
-
return /*#__PURE__*/
|
|
149
|
+
}, getLocale('No_option')), selectedOptions.length > 0 && selectedOptions.map(selectedOption => {
|
|
150
|
+
return /*#__PURE__*/React.createElement(SelectEditorOption, {
|
|
159
151
|
key: selectedOption.id,
|
|
160
152
|
option: selectedOption,
|
|
161
153
|
isShowRemoveIcon: isShowRemoveBtn,
|
|
162
154
|
onDeleteSelectOption: this.onRemoveOption
|
|
163
155
|
});
|
|
164
|
-
}))), /*#__PURE__*/
|
|
156
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
165
157
|
className: "mb-search-select-items"
|
|
166
|
-
}, /*#__PURE__*/
|
|
158
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
167
159
|
className: "form-control",
|
|
168
160
|
type: "text",
|
|
169
|
-
placeholder:
|
|
161
|
+
placeholder: getLocale('Find_an_option'),
|
|
170
162
|
value: searchVal,
|
|
171
163
|
onChange: this.onChangeSearch,
|
|
172
164
|
onClick: this.onInputClick
|
|
173
|
-
})), /*#__PURE__*/
|
|
165
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
174
166
|
className: "mb-select-options-container"
|
|
175
|
-
}, /*#__PURE__*/
|
|
167
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
176
168
|
className: "title"
|
|
177
|
-
}, /*#__PURE__*/
|
|
169
|
+
}, /*#__PURE__*/React.createElement("span", null, getLocale('Choose_an_option'))), /*#__PURE__*/React.createElement("div", {
|
|
178
170
|
className: "content"
|
|
179
|
-
}, /*#__PURE__*/
|
|
171
|
+
}, /*#__PURE__*/React.createElement(Fragment, null, filteredOptions.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
180
172
|
className: "search-result-none"
|
|
181
|
-
},
|
|
173
|
+
}, getLocale('No_options_available')), filteredOptions.length > 0 && this.renderSelectOptions(filteredOptions)))), isShowCreateBtn && /*#__PURE__*/React.createElement("div", {
|
|
182
174
|
className: "mb-create-select-item",
|
|
183
175
|
onClick: this.onAddNewOption
|
|
184
|
-
}, /*#__PURE__*/
|
|
176
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
185
177
|
className: "dtable-font dtable-icon-add-table"
|
|
186
|
-
}), /*#__PURE__*/
|
|
178
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
187
179
|
className: "dtable-ui-add-new-option"
|
|
188
|
-
}, "".concat(
|
|
180
|
+
}, "".concat(getLocale('Add_an_option'), " ").concat(searchVal)))));
|
|
189
181
|
}
|
|
190
182
|
}
|
|
191
183
|
MBSelectEditorPopover.defaultProps = {
|
|
@@ -194,4 +186,4 @@ MBSelectEditorPopover.defaultProps = {
|
|
|
194
186
|
isSupportNewOption: false,
|
|
195
187
|
value: []
|
|
196
188
|
};
|
|
197
|
-
|
|
189
|
+
export default MBSelectEditorPopover;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lang = require("../../lang");
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class PCSelectEditorPopover extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getLocale } from '../../lang';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class PCSelectEditorPopover extends React.Component {
|
|
12
5
|
constructor(props) {
|
|
13
6
|
super(props);
|
|
14
7
|
this.onValueChanged = event => {
|
|
@@ -72,46 +65,46 @@ class PCSelectEditorPopover extends _react.default.Component {
|
|
|
72
65
|
}, {
|
|
73
66
|
position: 'absolute'
|
|
74
67
|
});
|
|
75
|
-
return /*#__PURE__*/
|
|
68
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
76
69
|
className: "dtable-ui-editor-popover dtable-ui-select-editor-popover",
|
|
77
70
|
style: popoverStyle
|
|
78
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
79
72
|
className: "select-options-search"
|
|
80
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
81
74
|
className: "form-control",
|
|
82
75
|
onChange: this.onValueChanged,
|
|
83
76
|
onClick: this.onInputClick,
|
|
84
|
-
placeholder:
|
|
85
|
-
})), /*#__PURE__*/
|
|
77
|
+
placeholder: getLocale('Find_an_option')
|
|
78
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
86
79
|
className: "select-options-container"
|
|
87
80
|
}, options.length > 0 && options.map((option, index) => {
|
|
88
81
|
let optionStyle = this.getOptionStyle(option);
|
|
89
82
|
let isSelect = selectedOptions.some(selectedOption => {
|
|
90
83
|
return selectedOption.id === option.id;
|
|
91
84
|
});
|
|
92
|
-
return /*#__PURE__*/
|
|
85
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
93
86
|
key: index,
|
|
94
87
|
className: "select-option-item",
|
|
95
88
|
onClick: this.onOptionItemToggle.bind(this, option)
|
|
96
|
-
}, /*#__PURE__*/
|
|
89
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
97
90
|
className: "option-info"
|
|
98
|
-
}, /*#__PURE__*/
|
|
91
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
99
92
|
className: "option-name",
|
|
100
93
|
style: optionStyle,
|
|
101
94
|
title: option.name
|
|
102
|
-
}, option.name)), /*#__PURE__*/
|
|
95
|
+
}, option.name)), /*#__PURE__*/React.createElement("div", {
|
|
103
96
|
className: "option-checked"
|
|
104
|
-
}, isSelect && /*#__PURE__*/
|
|
97
|
+
}, isSelect && /*#__PURE__*/React.createElement("i", {
|
|
105
98
|
className: "dtable-font dtable-icon-check-mark"
|
|
106
99
|
})));
|
|
107
|
-
}), options.length === 0 && /*#__PURE__*/
|
|
100
|
+
}), options.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
108
101
|
className: "search-option-null"
|
|
109
|
-
},
|
|
102
|
+
}, getLocale('No_options_available'))), isSupportNewOption && !!searchValue && /*#__PURE__*/React.createElement("div", {
|
|
110
103
|
className: "select-options-add",
|
|
111
104
|
onClick: this.onAddNewOption
|
|
112
|
-
}, /*#__PURE__*/
|
|
105
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
113
106
|
className: "dtable-font dtable-icon-add-table"
|
|
114
|
-
}), /*#__PURE__*/
|
|
107
|
+
}), /*#__PURE__*/React.createElement("span", null, getLocale('Add_an_option'), ' ', searchValue)));
|
|
115
108
|
}
|
|
116
109
|
}
|
|
117
110
|
PCSelectEditorPopover.defaultProps = {
|
|
@@ -119,4 +112,4 @@ PCSelectEditorPopover.defaultProps = {
|
|
|
119
112
|
options: [],
|
|
120
113
|
isShowAddBtn: false
|
|
121
114
|
};
|
|
122
|
-
|
|
115
|
+
export default PCSelectEditorPopover;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
class SelectEditorOption extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
class SelectEditorOption extends React.Component {
|
|
10
3
|
constructor() {
|
|
11
4
|
super(...arguments);
|
|
12
5
|
this.onDeleteOption = event => {
|
|
@@ -56,20 +49,20 @@ class SelectEditorOption extends _react.default.Component {
|
|
|
56
49
|
let containerStyle = this.getContainerStyle();
|
|
57
50
|
let optionStyle = this.getOptionStyle(option);
|
|
58
51
|
let operationStyle = this.getOperationStyle(option);
|
|
59
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
60
53
|
className: "dtable-ui select-option-item",
|
|
61
54
|
style: containerStyle
|
|
62
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
56
|
className: "option-info",
|
|
64
57
|
style: optionStyle
|
|
65
|
-
}, /*#__PURE__*/
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
66
59
|
className: "option-name",
|
|
67
60
|
title: option.name
|
|
68
|
-
}, option.name)), isShowRemoveIcon && /*#__PURE__*/
|
|
61
|
+
}, option.name)), isShowRemoveIcon && /*#__PURE__*/React.createElement("div", {
|
|
69
62
|
className: "option-remove",
|
|
70
63
|
style: operationStyle,
|
|
71
64
|
onClick: this.onDeleteOption
|
|
72
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
73
66
|
className: "dtable-font dtable-icon-fork-number",
|
|
74
67
|
style: {
|
|
75
68
|
fontSize: '12px',
|
|
@@ -81,4 +74,4 @@ class SelectEditorOption extends _react.default.Component {
|
|
|
81
74
|
SelectEditorOption.defaultProps = {
|
|
82
75
|
isShowRemoveIcon: false
|
|
83
76
|
};
|
|
84
|
-
|
|
77
|
+
export default SelectEditorOption;
|
package/lib/toaster/alert.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
class Alert extends _react.default.PureComponent {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
class Alert extends React.PureComponent {
|
|
10
3
|
getIconClass(intent) {
|
|
11
4
|
switch (intent) {
|
|
12
5
|
case 'success':
|
|
@@ -30,22 +23,22 @@ class Alert extends _react.default.PureComponent {
|
|
|
30
23
|
onRemove
|
|
31
24
|
} = this.props;
|
|
32
25
|
const iconClass = this.getIconClass(intent);
|
|
33
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
27
|
className: "dtable-toast-alert-container ".concat(intent || 'success')
|
|
35
|
-
}, /*#__PURE__*/
|
|
28
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36
29
|
className: "toast-alert-icon"
|
|
37
|
-
}, /*#__PURE__*/
|
|
30
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
38
31
|
className: iconClass
|
|
39
|
-
})), /*#__PURE__*/
|
|
32
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
40
33
|
className: "toast-text-container"
|
|
41
|
-
}, /*#__PURE__*/
|
|
34
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
42
35
|
className: "toast-text-title"
|
|
43
|
-
}, title), children ? /*#__PURE__*/
|
|
36
|
+
}, title), children ? /*#__PURE__*/React.createElement("p", {
|
|
44
37
|
className: "toast-text-child"
|
|
45
|
-
}, children) : null), isRemovable && /*#__PURE__*/
|
|
38
|
+
}, children) : null), isRemovable && /*#__PURE__*/React.createElement("div", {
|
|
46
39
|
onClick: onRemove,
|
|
47
40
|
className: "toast-close"
|
|
48
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement("span", null, "\xD7")));
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
|
-
|
|
44
|
+
export default Alert;
|
package/lib/toaster/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _toaster = _interopRequireDefault(require("./toaster"));
|
|
9
|
-
const toaster = new _toaster.default();
|
|
10
|
-
var _default = exports.default = toaster;
|
|
1
|
+
import Toaster from './toaster';
|
|
2
|
+
const toaster = new Toaster();
|
|
3
|
+
export default toaster;
|
package/lib/toaster/toast.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _Transition = _interopRequireDefault(require("react-transition-group/Transition"));
|
|
10
|
-
var _alert = _interopRequireDefault(require("./alert"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Transition from 'react-transition-group/Transition';
|
|
3
|
+
import Alert from './alert';
|
|
11
4
|
const ANIMATION_DURATION = 240;
|
|
12
|
-
class Toast extends
|
|
5
|
+
export default class Toast extends React.PureComponent {
|
|
13
6
|
constructor() {
|
|
14
7
|
super(...arguments);
|
|
15
8
|
this.state = {
|
|
@@ -70,13 +63,13 @@ class Toast extends _react.default.PureComponent {
|
|
|
70
63
|
this.clearCloseTimer();
|
|
71
64
|
}
|
|
72
65
|
render() {
|
|
73
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React.createElement(Transition, {
|
|
74
67
|
appear: true,
|
|
75
68
|
unmountOnExit: true,
|
|
76
69
|
timeout: ANIMATION_DURATION,
|
|
77
70
|
in: this.state.isShown,
|
|
78
71
|
onExited: this.props.onRemove
|
|
79
|
-
}, state => /*#__PURE__*/
|
|
72
|
+
}, state => /*#__PURE__*/React.createElement("div", {
|
|
80
73
|
"data-state": state,
|
|
81
74
|
className: "dtable-toast-container ".concat(state),
|
|
82
75
|
onMouseEnter: this.handleMouseEnter,
|
|
@@ -86,12 +79,12 @@ class Toast extends _react.default.PureComponent {
|
|
|
86
79
|
zIndex: this.props.zIndex,
|
|
87
80
|
marginBottom: this.state.isShown ? 0 : -this.state.height
|
|
88
81
|
}
|
|
89
|
-
}, /*#__PURE__*/
|
|
82
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
90
83
|
ref: this.onRef,
|
|
91
84
|
style: {
|
|
92
85
|
padding: 8
|
|
93
86
|
}
|
|
94
|
-
}, /*#__PURE__*/
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Alert, {
|
|
95
88
|
intent: this.props.intent,
|
|
96
89
|
title: this.props.title,
|
|
97
90
|
children: this.props.children || '',
|
|
@@ -100,7 +93,6 @@ class Toast extends _react.default.PureComponent {
|
|
|
100
93
|
}))));
|
|
101
94
|
}
|
|
102
95
|
}
|
|
103
|
-
exports.default = Toast;
|
|
104
96
|
Toast.defaultProps = {
|
|
105
97
|
intent: 'none'
|
|
106
98
|
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _toast = _interopRequireDefault(require("./toast"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Toast from './toast';
|
|
10
3
|
const hasCustomId = settings => Object.hasOwnProperty.call(settings, 'id');
|
|
11
|
-
class ToastManager extends
|
|
4
|
+
export default class ToastManager extends React.PureComponent {
|
|
12
5
|
constructor(props, context) {
|
|
13
6
|
super(props, context);
|
|
14
7
|
this.getToasts = () => {
|
|
@@ -90,7 +83,7 @@ class ToastManager extends _react.default.PureComponent {
|
|
|
90
83
|
};
|
|
91
84
|
}
|
|
92
85
|
render() {
|
|
93
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
94
87
|
className: "dtable-toast-manager"
|
|
95
88
|
}, this.state.toasts.map(_ref => {
|
|
96
89
|
let {
|
|
@@ -98,12 +91,11 @@ class ToastManager extends _react.default.PureComponent {
|
|
|
98
91
|
description,
|
|
99
92
|
...props
|
|
100
93
|
} = _ref;
|
|
101
|
-
return /*#__PURE__*/
|
|
94
|
+
return /*#__PURE__*/React.createElement(Toast, Object.assign({
|
|
102
95
|
key: id,
|
|
103
96
|
onRemove: () => this.removeToast(id)
|
|
104
97
|
}, props), description);
|
|
105
98
|
}));
|
|
106
99
|
}
|
|
107
100
|
}
|
|
108
|
-
exports.default = ToastManager;
|
|
109
101
|
ToastManager.idCounter = 0;
|
package/lib/toaster/toaster.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
|
-
var _toastManager = _interopRequireDefault(require("./toastManager"));
|
|
11
|
-
require("./index.css");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import ToastManager from './toastManager';
|
|
4
|
+
import './index.css';
|
|
12
5
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
13
6
|
|
|
14
7
|
/**
|
|
15
8
|
* The Toaster manages the interactionsb between
|
|
16
9
|
* the ToasterManger and the toast API.
|
|
17
10
|
*/
|
|
18
|
-
class Toaster {
|
|
11
|
+
export default class Toaster {
|
|
19
12
|
constructor() {
|
|
20
13
|
var _this = this;
|
|
21
14
|
this._bindNotify = handler => {
|
|
@@ -65,11 +58,10 @@ class Toaster {
|
|
|
65
58
|
const container = document.createElement('div');
|
|
66
59
|
container.setAttribute('data-evergreen-toaster-container', '');
|
|
67
60
|
document.body.appendChild(container);
|
|
68
|
-
|
|
61
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(ToastManager, {
|
|
69
62
|
bindNotify: this._bindNotify,
|
|
70
63
|
bindGetToasts: this._bindGetToasts,
|
|
71
64
|
bindCloseAll: this._bindCloseAll
|
|
72
65
|
}), container);
|
|
73
66
|
}
|
|
74
|
-
}
|
|
75
|
-
exports.default = Toaster;
|
|
67
|
+
}
|
package/lib/utils/dayjs.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
-
var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat"));
|
|
10
|
-
_dayjs.default.extend(_customParseFormat.default);
|
|
11
|
-
var _default = exports.default = _dayjs.default;
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
3
|
+
dayjs.extend(customParseFormat);
|
|
4
|
+
export default dayjs;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isValidUrl = exports.initDateEditorLanguage = exports.getTrimmedString = exports.getSelectOptionItem = void 0;
|
|
7
1
|
const zhCN = require('@seafile/seafile-calendar/lib/locale/zh_CN');
|
|
8
2
|
const zhTW = require('@seafile/seafile-calendar/lib/locale/zh_TW');
|
|
9
3
|
const enUS = require('@seafile/seafile-calendar/lib/locale/en_US');
|
|
@@ -14,7 +8,7 @@ const plPL = require('@seafile/seafile-calendar/lib/locale/pl_PL');
|
|
|
14
8
|
const ptBR = require('@seafile/seafile-calendar/lib/locale/pt_BR');
|
|
15
9
|
const csCZ = require('@seafile/seafile-calendar/lib/locale/cs_CZ');
|
|
16
10
|
const ruRU = require('@seafile/seafile-calendar/lib/locale/ru_RU');
|
|
17
|
-
const initDateEditorLanguage = lang => {
|
|
11
|
+
export const initDateEditorLanguage = lang => {
|
|
18
12
|
let language;
|
|
19
13
|
switch (lang) {
|
|
20
14
|
case 'zh-cn':
|
|
@@ -58,17 +52,13 @@ const initDateEditorLanguage = lang => {
|
|
|
58
52
|
}
|
|
59
53
|
return language;
|
|
60
54
|
};
|
|
61
|
-
|
|
62
|
-
const getSelectOptionItem = (options, optionId) => {
|
|
55
|
+
export const getSelectOptionItem = (options, optionId) => {
|
|
63
56
|
return options.find(option => option.id === optionId);
|
|
64
57
|
};
|
|
65
|
-
|
|
66
|
-
const isValidUrl = url => {
|
|
58
|
+
export const isValidUrl = url => {
|
|
67
59
|
const reg = /^(([-a-zA-Z0-9+.]+):\/\/)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
|
68
60
|
return reg.test(url);
|
|
69
61
|
};
|
|
70
|
-
|
|
71
|
-
const getTrimmedString = value => {
|
|
62
|
+
export const getTrimmedString = value => {
|
|
72
63
|
return typeof value === 'string' ? value.trim() : '';
|
|
73
|
-
};
|
|
74
|
-
exports.getTrimmedString = getTrimmedString;
|
|
64
|
+
};
|
package/lib/utils/event-bus.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
class EventBus {
|
|
8
2
|
constructor() {
|
|
9
3
|
this.subscribers = {};
|
|
@@ -31,4 +25,4 @@ class EventBus {
|
|
|
31
25
|
}
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
|
-
|
|
28
|
+
export default new EventBus();
|
package/lib/utils/utils.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.throttle = exports.isMac = exports.getEventClassName = exports.downloadFile = exports.debounce = void 0;
|
|
7
|
-
const debounce = (fn, wait) => {
|
|
1
|
+
export const debounce = (fn, wait) => {
|
|
8
2
|
let timeout = null;
|
|
9
3
|
return function () {
|
|
10
4
|
if (timeout !== null) clearTimeout(timeout);
|
|
11
5
|
timeout = setTimeout(fn, wait);
|
|
12
6
|
};
|
|
13
7
|
};
|
|
14
|
-
|
|
15
|
-
const throttle = (func, delay) => {
|
|
8
|
+
export const throttle = (func, delay) => {
|
|
16
9
|
let timer = null;
|
|
17
10
|
let startTime = Date.now();
|
|
18
11
|
return function () {
|
|
@@ -29,14 +22,12 @@ const throttle = (func, delay) => {
|
|
|
29
22
|
}
|
|
30
23
|
};
|
|
31
24
|
};
|
|
32
|
-
|
|
33
|
-
const isMac = () => {
|
|
25
|
+
export const isMac = () => {
|
|
34
26
|
const platform = navigator.platform;
|
|
35
27
|
// eslint-disable-next-line eqeqeq
|
|
36
28
|
return platform == 'Mac68K' || platform == 'MacPPC' || platform == 'Macintosh' || platform == 'MacIntel';
|
|
37
29
|
};
|
|
38
|
-
|
|
39
|
-
const downloadFile = downloadUrl => {
|
|
30
|
+
export const downloadFile = downloadUrl => {
|
|
40
31
|
const downloadFrame = document.getElementById('dtableUiComponentDownloadFrame');
|
|
41
32
|
if (downloadFrame != null) {
|
|
42
33
|
document.body.removeChild(downloadFrame);
|
|
@@ -47,10 +38,8 @@ const downloadFile = downloadUrl => {
|
|
|
47
38
|
iframe.src = downloadUrl;
|
|
48
39
|
document.body.appendChild(iframe);
|
|
49
40
|
};
|
|
50
|
-
|
|
51
|
-
const getEventClassName = e => {
|
|
41
|
+
export const getEventClassName = e => {
|
|
52
42
|
// svg mouseEvent event.target.className is an object
|
|
53
43
|
if (!e || !e.target) return '';
|
|
54
44
|
return e.target.getAttribute('class') || '';
|
|
55
|
-
};
|
|
56
|
-
exports.getEventClassName = getEventClassName;
|
|
45
|
+
};
|