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,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class AutoNumberFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class AutoNumberFormatter extends React.Component {
|
|
12
5
|
render() {
|
|
13
6
|
const {
|
|
14
7
|
containerClassName,
|
|
15
8
|
value
|
|
16
9
|
} = this.props;
|
|
17
|
-
let classname = (
|
|
18
|
-
return /*#__PURE__*/
|
|
10
|
+
let classname = classnames('dtable-ui cell-formatter-container auto-number-formatter', containerClassName);
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
12
|
className: classname
|
|
20
13
|
}, value);
|
|
21
14
|
}
|
|
@@ -23,4 +16,4 @@ class AutoNumberFormatter extends _react.default.Component {
|
|
|
23
16
|
AutoNumberFormatter.defaultProps = {
|
|
24
17
|
value: ''
|
|
25
18
|
};
|
|
26
|
-
|
|
19
|
+
export default AutoNumberFormatter;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
require("./index.css");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { SELECT_OPTION_COLORS } from 'dtable-utils';
|
|
4
|
+
import './index.css';
|
|
12
5
|
const WHITE = '#FFFFFF';
|
|
13
|
-
class ButtonFormatter extends
|
|
6
|
+
class ButtonFormatter extends React.Component {
|
|
14
7
|
constructor() {
|
|
15
8
|
super(...arguments);
|
|
16
9
|
this.handleClick = () => {
|
|
@@ -28,17 +21,17 @@ class ButtonFormatter extends _react.default.Component {
|
|
|
28
21
|
button_color,
|
|
29
22
|
button_name
|
|
30
23
|
} = data || {};
|
|
31
|
-
const colorObj =
|
|
24
|
+
const colorObj = SELECT_OPTION_COLORS.find(item => item.COLOR === button_color) || SELECT_OPTION_COLORS[0];
|
|
32
25
|
const btnStyle = {
|
|
33
26
|
backgroundColor: colorObj.COLOR,
|
|
34
27
|
borderColor: colorObj.BORDER_COLOR,
|
|
35
28
|
color: colorObj.TEXT_COLOR === WHITE ? WHITE : '#666666'
|
|
36
29
|
};
|
|
37
|
-
return /*#__PURE__*/
|
|
38
|
-
className: (
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
31
|
+
className: classnames('dtable-ui cell-formatter-container button-formatter', containerClassName),
|
|
39
32
|
style: btnStyle,
|
|
40
33
|
onClick: this.handleClick
|
|
41
34
|
}, button_name));
|
|
42
35
|
}
|
|
43
36
|
}
|
|
44
|
-
|
|
37
|
+
export default ButtonFormatter;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class CTimeFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class CTimeFormatter extends React.Component {
|
|
13
6
|
constructor() {
|
|
14
7
|
super(...arguments);
|
|
15
8
|
this.formatDate = date => {
|
|
16
|
-
return (
|
|
9
|
+
return dayjs(date).format('YYYY-MM-DD HH:mm:ss');
|
|
17
10
|
};
|
|
18
11
|
}
|
|
19
12
|
render() {
|
|
@@ -21,11 +14,11 @@ class CTimeFormatter extends _react.default.Component {
|
|
|
21
14
|
value: date,
|
|
22
15
|
containerClassName
|
|
23
16
|
} = this.props;
|
|
24
|
-
let classname = (
|
|
17
|
+
let classname = classnames('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
25
18
|
if (date) {
|
|
26
19
|
date = this.formatDate(date);
|
|
27
20
|
}
|
|
28
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
22
|
className: classname
|
|
30
23
|
}, date);
|
|
31
24
|
}
|
|
@@ -34,4 +27,4 @@ CTimeFormatter.defaultProps = {
|
|
|
34
27
|
value: '',
|
|
35
28
|
containerClassName: ''
|
|
36
29
|
};
|
|
37
|
-
|
|
30
|
+
export default CTimeFormatter;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
require("./index.css");
|
|
10
|
-
class CheckboxEditor extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
class CheckboxEditor extends React.Component {
|
|
11
4
|
constructor(props) {
|
|
12
5
|
super(props);
|
|
13
6
|
this.onCommit = () => {
|
|
@@ -42,17 +35,17 @@ class CheckboxEditor extends _react.default.Component {
|
|
|
42
35
|
let style = {
|
|
43
36
|
cursor: isReadOnly ? 'default' : 'pointer'
|
|
44
37
|
};
|
|
45
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
39
|
className: "dtable-ui-checkbox-editor",
|
|
47
40
|
style: style
|
|
48
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
49
42
|
type: "checkbox",
|
|
50
43
|
className: "raw-checkbox",
|
|
51
44
|
checked: value,
|
|
52
45
|
onChange: this.onChange
|
|
53
|
-
}), /*#__PURE__*/
|
|
46
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
54
47
|
className: "shown-checkbox"
|
|
55
|
-
}, value && /*#__PURE__*/
|
|
48
|
+
}, value && /*#__PURE__*/React.createElement("span", {
|
|
56
49
|
className: "dtable-font dtable-icon-check-mark"
|
|
57
50
|
})));
|
|
58
51
|
}
|
|
@@ -61,4 +54,4 @@ CheckboxEditor.defaultProps = {
|
|
|
61
54
|
isReadOnly: false,
|
|
62
55
|
value: false
|
|
63
56
|
};
|
|
64
|
-
|
|
57
|
+
export default CheckboxEditor;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class CheckboxFormatter extends _react.default.PureComponent {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class CheckboxFormatter extends React.PureComponent {
|
|
12
5
|
render() {
|
|
13
6
|
let {
|
|
14
7
|
value,
|
|
15
8
|
containerClassName
|
|
16
9
|
} = this.props;
|
|
17
10
|
value = value === true ? true : false;
|
|
18
|
-
let classname = (
|
|
11
|
+
let classname = classnames('dtable-ui cell-formatter-container checkbox-formatter d-flex align-items-center justify-content-center', containerClassName);
|
|
19
12
|
if (value) {
|
|
20
|
-
return /*#__PURE__*/
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
14
|
className: classname
|
|
22
|
-
}, /*#__PURE__*/
|
|
15
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
23
16
|
className: "dtable-font dtable-icon-check-mark checkbox-checked-mark"
|
|
24
17
|
}));
|
|
25
18
|
}
|
|
@@ -29,4 +22,4 @@ class CheckboxFormatter extends _react.default.PureComponent {
|
|
|
29
22
|
CheckboxFormatter.defaultProps = {
|
|
30
23
|
value: false
|
|
31
24
|
};
|
|
32
|
-
|
|
25
|
+
export default CheckboxFormatter;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _lang = require("../lang");
|
|
12
|
-
var _modalPortal = _interopRequireDefault(require("../common/modal-portal"));
|
|
13
|
-
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
14
|
-
var _EditEditorButton = _interopRequireDefault(require("../EditEditorButton"));
|
|
15
|
-
var _pcCollaboratorEditorPopover = _interopRequireDefault(require("./pc-collaborator-editor-popover"));
|
|
16
|
-
var _mbCollaboratorEditorPopover = _interopRequireDefault(require("./mb-collaborator-editor-popover"));
|
|
17
|
-
require("./index.css");
|
|
18
|
-
class CollaboratorEditor extends _react.default.Component {
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import MediaQuery from 'react-responsive';
|
|
3
|
+
import { getLocale } from '../lang';
|
|
4
|
+
import ModalPortal from '../common/modal-portal';
|
|
5
|
+
import CollaboratorItem from '../CollaboratorItem';
|
|
6
|
+
import EditEditorButton from '../EditEditorButton';
|
|
7
|
+
import PCCollaboratorEditorPopover from './pc-collaborator-editor-popover';
|
|
8
|
+
import MBCollaboratorEditorPopover from './mb-collaborator-editor-popover';
|
|
9
|
+
import './index.css';
|
|
10
|
+
class CollaboratorEditor extends React.Component {
|
|
19
11
|
constructor(props) {
|
|
20
12
|
super(props);
|
|
21
13
|
this.onMouseDown = e => {
|
|
@@ -174,37 +166,37 @@ class CollaboratorEditor extends _react.default.Component {
|
|
|
174
166
|
} = this.state;
|
|
175
167
|
let selectedCollaborators = this.getFormattedCollaborators();
|
|
176
168
|
let enableDeleteCollaborator = !isReadOnly;
|
|
177
|
-
return /*#__PURE__*/
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
178
170
|
ref: this.setEditorContainerRef,
|
|
179
171
|
className: "dtable-ui-collaborator-editor"
|
|
180
|
-
}, /*#__PURE__*/
|
|
172
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
181
173
|
ref: this.setEditorRef,
|
|
182
174
|
className: "dtable-ui-collaborator-editor-container ".concat(isShowEditButton ? '' : 'dtable-ui-collaborator-editor-container-no-btn'),
|
|
183
175
|
onClick: this.onClickContainer
|
|
184
|
-
}, isShowEditButton && /*#__PURE__*/
|
|
185
|
-
text:
|
|
176
|
+
}, isShowEditButton && /*#__PURE__*/React.createElement(EditEditorButton, {
|
|
177
|
+
text: getLocale('Add_a_collaborator'),
|
|
186
178
|
onClick: this.togglePopover
|
|
187
|
-
}), selectedCollaborators.length > 0 && /*#__PURE__*/
|
|
179
|
+
}), selectedCollaborators.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
188
180
|
className: "collaborators-container ".concat(isShowEditButton ? 'mt-2' : '')
|
|
189
181
|
}, selectedCollaborators.map(collaborator => {
|
|
190
|
-
return /*#__PURE__*/
|
|
182
|
+
return /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
191
183
|
key: collaborator.email,
|
|
192
184
|
collaborator: collaborator,
|
|
193
185
|
enableDeleteCollaborator: enableDeleteCollaborator,
|
|
194
186
|
onDeleteCollaborator: this.onDeleteCollaborator
|
|
195
187
|
});
|
|
196
|
-
}))), isPopoverShow && /*#__PURE__*/
|
|
188
|
+
}))), isPopoverShow && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MediaQuery, {
|
|
197
189
|
query: '(min-width: 768px)'
|
|
198
|
-
}, /*#__PURE__*/
|
|
190
|
+
}, /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement(PCCollaboratorEditorPopover, {
|
|
199
191
|
popoverPosition: popoverPosition,
|
|
200
192
|
isReadOnly: this.props.isReadOnly,
|
|
201
193
|
selectedCollaborators: selectedCollaborators,
|
|
202
194
|
collaborators: collaborators,
|
|
203
195
|
onCollaboratorItemToggle: this.onCollaboratorItemToggle,
|
|
204
196
|
setPopoverRef: this.setPopoverRef
|
|
205
|
-
}))), /*#__PURE__*/
|
|
197
|
+
}))), /*#__PURE__*/React.createElement(MediaQuery, {
|
|
206
198
|
query: '(max-width: 767.8px)'
|
|
207
|
-
}, /*#__PURE__*/
|
|
199
|
+
}, /*#__PURE__*/React.createElement(MBCollaboratorEditorPopover, {
|
|
208
200
|
isReadOnly: this.props.isReadOnly,
|
|
209
201
|
value: this.state.newValue,
|
|
210
202
|
column: this.props.column,
|
|
@@ -220,4 +212,4 @@ CollaboratorEditor.defaultProps = {
|
|
|
220
212
|
value: [],
|
|
221
213
|
isInModel: false
|
|
222
214
|
};
|
|
223
|
-
|
|
215
|
+
export default CollaboratorEditor;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lang = require("../../lang");
|
|
10
|
-
var _MBEditorHeader = _interopRequireDefault(require("../../MBEditorHeader"));
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class MBCollaboratorEditorPopover extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getLocale } from '../../lang';
|
|
3
|
+
import MBEditorHeader from '../../MBEditorHeader';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class MBCollaboratorEditorPopover extends React.Component {
|
|
13
6
|
constructor(props) {
|
|
14
7
|
super(props);
|
|
15
8
|
this.handleHistaryBack = e => {
|
|
@@ -68,22 +61,22 @@ class MBCollaboratorEditorPopover extends _react.default.Component {
|
|
|
68
61
|
} = this.props;
|
|
69
62
|
return collaborators.map((collaborator, index) => {
|
|
70
63
|
let isSelect = value.some(item => item === collaborator.email);
|
|
71
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
65
|
className: "mb-collaborator-option-item",
|
|
73
66
|
key: index,
|
|
74
67
|
onMouseDown: this.onSelectCollaborator.bind(this, collaborator)
|
|
75
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
76
69
|
className: "mb-collaborator-info"
|
|
77
|
-
}, /*#__PURE__*/
|
|
70
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
78
71
|
className: "collaborator-avatar"
|
|
79
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
80
73
|
src: collaborator.avatar_url,
|
|
81
74
|
width: "24",
|
|
82
75
|
height: "24",
|
|
83
76
|
alt: "avatar"
|
|
84
|
-
})), /*#__PURE__*/
|
|
77
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
85
78
|
className: "collaborator-name"
|
|
86
|
-
}, collaborator.name)), isSelect && /*#__PURE__*/
|
|
79
|
+
}, collaborator.name)), isSelect && /*#__PURE__*/React.createElement("i", {
|
|
87
80
|
className: "mb-collaborator-checked dtable-font dtable-icon-check-mark"
|
|
88
81
|
}));
|
|
89
82
|
});
|
|
@@ -110,42 +103,42 @@ class MBCollaboratorEditorPopover extends _react.default.Component {
|
|
|
110
103
|
searchVal
|
|
111
104
|
} = this.state;
|
|
112
105
|
let filteredCollaborators = this.getFilteredCollaborators();
|
|
113
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
114
107
|
ref: this.setEditorPopover,
|
|
115
108
|
className: "dtable-ui-mb-editor-popover mb-collaborator-editor-popover",
|
|
116
109
|
onClick: this.onContainerClick
|
|
117
|
-
}, /*#__PURE__*/
|
|
110
|
+
}, /*#__PURE__*/React.createElement(MBEditorHeader, {
|
|
118
111
|
title: column.name,
|
|
119
|
-
leftContent: /*#__PURE__*/
|
|
112
|
+
leftContent: /*#__PURE__*/React.createElement("i", {
|
|
120
113
|
className: "dtable-font dtable-icon-return"
|
|
121
114
|
}),
|
|
122
|
-
rightContent: /*#__PURE__*/
|
|
115
|
+
rightContent: /*#__PURE__*/React.createElement("span", null, getLocale('Done')),
|
|
123
116
|
onLeftClick: this.props.onClosePopover,
|
|
124
117
|
onRightClick: this.props.onClosePopover
|
|
125
|
-
}), /*#__PURE__*/
|
|
118
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
126
119
|
className: "dtable-ui-mb-editor-body dtable-ui-mb-collaborator-editor-body"
|
|
127
|
-
}, /*#__PURE__*/
|
|
120
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
128
121
|
className: "mb-search-collaborator-items"
|
|
129
|
-
}, /*#__PURE__*/
|
|
122
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
130
123
|
className: "form-control",
|
|
131
124
|
type: "text",
|
|
132
|
-
placeholder:
|
|
125
|
+
placeholder: getLocale('Find_a_collaborator'),
|
|
133
126
|
value: searchVal,
|
|
134
127
|
onChange: this.onChangeSearch,
|
|
135
128
|
onClick: this.onInputClick
|
|
136
|
-
})), /*#__PURE__*/
|
|
129
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
137
130
|
className: "mb-collaborators-container"
|
|
138
|
-
}, /*#__PURE__*/
|
|
131
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
139
132
|
className: "title"
|
|
140
|
-
},
|
|
133
|
+
}, getLocale('Choose_a_collaborator')), /*#__PURE__*/React.createElement("div", {
|
|
141
134
|
className: "content"
|
|
142
|
-
}, filteredCollaborators.length === 0 && /*#__PURE__*/
|
|
135
|
+
}, filteredCollaborators.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
143
136
|
className: "search-result-none"
|
|
144
|
-
},
|
|
137
|
+
}, getLocale('No_collaborators_avaliable')), filteredCollaborators.length > 0 && this.renderFilteredCollaborators(filteredCollaborators)))));
|
|
145
138
|
}
|
|
146
139
|
}
|
|
147
140
|
MBCollaboratorEditorPopover.defaultProps = {
|
|
148
141
|
isReadOnly: false,
|
|
149
142
|
value: []
|
|
150
143
|
};
|
|
151
|
-
|
|
144
|
+
export default MBCollaboratorEditorPopover;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lang = require("../../lang");
|
|
10
|
-
var _CollaboratorItem = _interopRequireDefault(require("../../CollaboratorItem"));
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class PCCollaboratorEditorPopover extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getLocale } from '../../lang';
|
|
3
|
+
import CollaboratorItem from '../../CollaboratorItem';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class PCCollaboratorEditorPopover extends React.Component {
|
|
13
6
|
constructor(props) {
|
|
14
7
|
super(props);
|
|
15
8
|
this.onValueChanged = event => {
|
|
@@ -40,7 +33,7 @@ class PCCollaboratorEditorPopover extends _react.default.Component {
|
|
|
40
33
|
this.state = {
|
|
41
34
|
searchValue: ''
|
|
42
35
|
};
|
|
43
|
-
this.editorInputRef =
|
|
36
|
+
this.editorInputRef = React.createRef();
|
|
44
37
|
}
|
|
45
38
|
componentDidMount() {
|
|
46
39
|
this.editorInputRef.current.focus();
|
|
@@ -59,39 +52,39 @@ class PCCollaboratorEditorPopover extends _react.default.Component {
|
|
|
59
52
|
}, {
|
|
60
53
|
position: 'absolute'
|
|
61
54
|
});
|
|
62
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
56
|
className: "dtable-ui-editor-popover dtable-ui-collaborator-editor-popover",
|
|
64
57
|
style: popoverStyle,
|
|
65
58
|
ref: this.props.setPopoverRef
|
|
66
|
-
}, /*#__PURE__*/
|
|
59
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
60
|
className: "collaborator-search-container"
|
|
68
|
-
}, /*#__PURE__*/
|
|
61
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
69
62
|
className: "form-control",
|
|
70
63
|
value: searchValue,
|
|
71
64
|
onChange: this.onValueChanged,
|
|
72
65
|
onClick: this.onInputClick,
|
|
73
|
-
placeholder:
|
|
66
|
+
placeholder: getLocale('Find_a_collaborator'),
|
|
74
67
|
ref: this.editorInputRef
|
|
75
|
-
})), /*#__PURE__*/
|
|
68
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
76
69
|
className: "collaborator-list-container"
|
|
77
70
|
}, collaborators.length > 0 && collaborators.map((collaborator, index) => {
|
|
78
71
|
const isSelect = selectedCollaborators.some(selectedCollaborator => {
|
|
79
72
|
return selectedCollaborator.email === collaborator.email;
|
|
80
73
|
});
|
|
81
|
-
return /*#__PURE__*/
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
82
75
|
key: index,
|
|
83
76
|
className: "collaborator-item-container",
|
|
84
77
|
onClick: this.onCollaboratorItemToggle.bind(this, collaborator)
|
|
85
|
-
}, /*#__PURE__*/
|
|
78
|
+
}, /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
86
79
|
collaborator: collaborator
|
|
87
|
-
}), /*#__PURE__*/
|
|
80
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
88
81
|
className: "collaborator-checked"
|
|
89
|
-
}, isSelect && /*#__PURE__*/
|
|
82
|
+
}, isSelect && /*#__PURE__*/React.createElement("i", {
|
|
90
83
|
className: "dtable-font dtable-icon-check-mark"
|
|
91
84
|
})));
|
|
92
|
-
}), collaborators.length === 0 && /*#__PURE__*/
|
|
85
|
+
}), collaborators.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
93
86
|
className: "search-option-null"
|
|
94
|
-
},
|
|
87
|
+
}, getLocale('No_collaborators_available'))));
|
|
95
88
|
}
|
|
96
89
|
}
|
|
97
|
-
|
|
90
|
+
export default PCCollaboratorEditorPopover;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
11
|
-
var _default_avatar = _interopRequireDefault(require("../assets/images/avatar/default_avatar.png"));
|
|
12
|
-
require("./index.css");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import CollaboratorItem from '../CollaboratorItem';
|
|
4
|
+
import DefaultAvatar from '../assets/images/avatar/default_avatar.png';
|
|
5
|
+
import './index.css';
|
|
13
6
|
// there will be there conditions
|
|
14
7
|
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
15
8
|
// 2 value is exist, but can't find in collaborators
|
|
16
9
|
// 3 value is exist, typeof value is a string
|
|
17
10
|
// 4 value is exist, typeof value is array
|
|
18
|
-
class CollaboratorFormatter extends
|
|
11
|
+
class CollaboratorFormatter extends React.PureComponent {
|
|
19
12
|
constructor() {
|
|
20
13
|
super(...arguments);
|
|
21
14
|
this.getCollaborators = () => {
|
|
@@ -33,10 +26,10 @@ class CollaboratorFormatter extends _react.default.PureComponent {
|
|
|
33
26
|
if (!collaborator) {
|
|
34
27
|
collaborator = {
|
|
35
28
|
name: item,
|
|
36
|
-
avatar_url:
|
|
29
|
+
avatar_url: DefaultAvatar
|
|
37
30
|
};
|
|
38
31
|
}
|
|
39
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
40
33
|
key: index,
|
|
41
34
|
collaborator: collaborator,
|
|
42
35
|
enableDeleteCollaborator: enableDeleteCollaborator,
|
|
@@ -50,14 +43,14 @@ class CollaboratorFormatter extends _react.default.PureComponent {
|
|
|
50
43
|
containerClassName,
|
|
51
44
|
value
|
|
52
45
|
} = this.props;
|
|
53
|
-
const classname = (
|
|
46
|
+
const classname = classnames('dtable-ui cell-formatter-container collaborator-formatter', containerClassName);
|
|
54
47
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
55
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
49
|
className: classname
|
|
57
50
|
});
|
|
58
51
|
}
|
|
59
52
|
const collaborators = this.getCollaborators();
|
|
60
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
54
|
className: classname
|
|
62
55
|
}, collaborators);
|
|
63
56
|
}
|
|
@@ -65,4 +58,4 @@ class CollaboratorFormatter extends _react.default.PureComponent {
|
|
|
65
58
|
CollaboratorFormatter.defaultProps = {
|
|
66
59
|
value: []
|
|
67
60
|
};
|
|
68
|
-
|
|
61
|
+
export default CollaboratorFormatter;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
require("./index.css");
|
|
10
|
-
class CollaboratorItem extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
class CollaboratorItem extends React.Component {
|
|
11
4
|
constructor() {
|
|
12
5
|
super(...arguments);
|
|
13
6
|
this.onDeleteCollaborator = () => {
|
|
@@ -22,20 +15,20 @@ class CollaboratorItem extends _react.default.Component {
|
|
|
22
15
|
collaborator,
|
|
23
16
|
enableDeleteCollaborator
|
|
24
17
|
} = this.props;
|
|
25
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
19
|
className: "dtable-ui collaborator-item"
|
|
27
|
-
}, /*#__PURE__*/
|
|
20
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
28
21
|
className: "collaborator-avatar"
|
|
29
|
-
}, /*#__PURE__*/
|
|
22
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
30
23
|
className: "collaborator-avatar-icon",
|
|
31
24
|
alt: collaborator.name,
|
|
32
25
|
src: collaborator.avatar_url
|
|
33
|
-
})), /*#__PURE__*/
|
|
26
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
34
27
|
className: "collaborator-name"
|
|
35
|
-
}, collaborator.name), enableDeleteCollaborator && /*#__PURE__*/
|
|
28
|
+
}, collaborator.name), enableDeleteCollaborator && /*#__PURE__*/React.createElement("span", {
|
|
36
29
|
className: "collaborator-remove",
|
|
37
30
|
onClick: this.onDeleteCollaborator
|
|
38
|
-
}, /*#__PURE__*/
|
|
31
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
39
32
|
className: "dtable-font dtable-icon-fork-number"
|
|
40
33
|
})));
|
|
41
34
|
}
|
|
@@ -43,4 +36,4 @@ class CollaboratorItem extends _react.default.Component {
|
|
|
43
36
|
CollaboratorItem.defaultProps = {
|
|
44
37
|
enableDelete: false
|
|
45
38
|
};
|
|
46
|
-
|
|
39
|
+
export default CollaboratorItem;
|