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,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
|
-
var _HtmlLongTextFormatter = _interopRequireDefault(require("../HtmlLongTextFormatter"));
|
|
10
|
-
var _SimpleLongTextFormatter = _interopRequireDefault(require("../SimpleLongTextFormatter"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import HtmlLongTextFormatter from '../HtmlLongTextFormatter';
|
|
3
|
+
import SimpleLongTextFormatter from '../SimpleLongTextFormatter';
|
|
11
4
|
function LongTextFormatter(props) {
|
|
12
5
|
const {
|
|
13
6
|
isSample,
|
|
@@ -15,12 +8,12 @@ function LongTextFormatter(props) {
|
|
|
15
8
|
containerClassName
|
|
16
9
|
} = props;
|
|
17
10
|
if (isSample) {
|
|
18
|
-
return /*#__PURE__*/
|
|
11
|
+
return /*#__PURE__*/React.createElement(SimpleLongTextFormatter, {
|
|
19
12
|
value: value,
|
|
20
13
|
containerClassName: containerClassName
|
|
21
14
|
});
|
|
22
15
|
}
|
|
23
|
-
return /*#__PURE__*/
|
|
16
|
+
return /*#__PURE__*/React.createElement(HtmlLongTextFormatter, {
|
|
24
17
|
value: value,
|
|
25
18
|
containerClassName: containerClassName
|
|
26
19
|
});
|
|
@@ -28,4 +21,4 @@ function LongTextFormatter(props) {
|
|
|
28
21
|
LongTextFormatter.defaultProps = {
|
|
29
22
|
isSample: true
|
|
30
23
|
};
|
|
31
|
-
|
|
24
|
+
export default LongTextFormatter;
|
|
@@ -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 MBEditorHeader extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
class MBEditorHeader extends React.Component {
|
|
10
3
|
render() {
|
|
11
4
|
let {
|
|
12
5
|
title,
|
|
@@ -16,14 +9,14 @@ class MBEditorHeader extends _react.default.Component {
|
|
|
16
9
|
onLeftClick,
|
|
17
10
|
onRightClick
|
|
18
11
|
} = this.props;
|
|
19
|
-
return /*#__PURE__*/
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
13
|
className: "dtable-ui-mb-editor-header ".concat(titleClass ? titleClass : '')
|
|
21
|
-
}, /*#__PURE__*/
|
|
14
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
22
15
|
className: "editor-header-left-content",
|
|
23
16
|
onClick: onLeftClick
|
|
24
|
-
}, leftContent), /*#__PURE__*/
|
|
17
|
+
}, leftContent), /*#__PURE__*/React.createElement("span", {
|
|
25
18
|
className: "editor-header-title"
|
|
26
|
-
}, title), /*#__PURE__*/
|
|
19
|
+
}, title), /*#__PURE__*/React.createElement("span", {
|
|
27
20
|
className: "editor-header-right-content",
|
|
28
21
|
onClick: onRightClick,
|
|
29
22
|
style: {
|
|
@@ -32,4 +25,4 @@ class MBEditorHeader extends _react.default.Component {
|
|
|
32
25
|
}, rightContent));
|
|
33
26
|
}
|
|
34
27
|
}
|
|
35
|
-
|
|
28
|
+
export default MBEditorHeader;
|
|
@@ -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 MTimeFormatter 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 MTimeFormatter 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 MTimeFormatter 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 @@ MTimeFormatter.defaultProps = {
|
|
|
34
27
|
value: '',
|
|
35
28
|
containerClassName: ''
|
|
36
29
|
};
|
|
37
|
-
|
|
30
|
+
export default MTimeFormatter;
|
package/lib/ModalPortal/index.js
CHANGED
|
@@ -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 _reactDom = _interopRequireDefault(require("react-dom"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
10
3
|
const modalRoot = document.getElementById('modal-wrapper');
|
|
11
|
-
class ModalPortal extends
|
|
4
|
+
class ModalPortal extends React.Component {
|
|
12
5
|
constructor(props) {
|
|
13
6
|
super(props);
|
|
14
7
|
this.el = document.createElement('div');
|
|
@@ -20,7 +13,7 @@ class ModalPortal extends _react.default.Component {
|
|
|
20
13
|
modalRoot.removeChild(this.el);
|
|
21
14
|
}
|
|
22
15
|
render() {
|
|
23
|
-
return
|
|
16
|
+
return ReactDOM.createPortal(this.props.children, this.el);
|
|
24
17
|
}
|
|
25
18
|
}
|
|
26
|
-
|
|
19
|
+
export default ModalPortal;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
11
|
-
var _lang = require("../lang");
|
|
12
|
-
var _EditEditorButton = _interopRequireDefault(require("../EditEditorButton"));
|
|
13
|
-
var _selectEditor = require("../select-editor");
|
|
14
|
-
require("./index.css");
|
|
15
|
-
class MultipleSelectEditor extends _react.default.Component {
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import MediaQuery from 'react-responsive';
|
|
3
|
+
import { getLocale } from '../lang';
|
|
4
|
+
import EditEditorButton from '../EditEditorButton';
|
|
5
|
+
import { SelectEditorOption, PCSelectEditorPopover, MBSelectEditorPopover } from '../select-editor';
|
|
6
|
+
import './index.css';
|
|
7
|
+
class MultipleSelectEditor extends React.Component {
|
|
16
8
|
constructor(props) {
|
|
17
9
|
super(props);
|
|
18
10
|
this.onMouseDown = e => {
|
|
@@ -141,34 +133,34 @@ class MultipleSelectEditor extends _react.default.Component {
|
|
|
141
133
|
} = this.state;
|
|
142
134
|
let options = this.options;
|
|
143
135
|
let selectedOptions = this.getFormattedOptions();
|
|
144
|
-
return /*#__PURE__*/
|
|
136
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
145
137
|
ref: this.setEditorContainerRef,
|
|
146
138
|
className: "cell-editor dtable-ui-multiple-select-editor"
|
|
147
|
-
}, /*#__PURE__*/
|
|
139
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
148
140
|
ref: this.setEditorRef,
|
|
149
141
|
className: "dtable-ui-select-editor-container",
|
|
150
142
|
onClick: this.onAddOptionToggle
|
|
151
|
-
}, selectedOptions.length === 0 && /*#__PURE__*/
|
|
152
|
-
text:
|
|
143
|
+
}, selectedOptions.length === 0 && /*#__PURE__*/React.createElement(EditEditorButton, {
|
|
144
|
+
text: getLocale('Add_an_option')
|
|
153
145
|
}), selectedOptions.length !== 0 && selectedOptions.map(option => {
|
|
154
|
-
return /*#__PURE__*/
|
|
146
|
+
return /*#__PURE__*/React.createElement(SelectEditorOption, {
|
|
155
147
|
key: option.id,
|
|
156
148
|
option: option,
|
|
157
149
|
isShowRemoveIcon: true,
|
|
158
150
|
onDeleteSelectOption: this.onDeleteOption
|
|
159
151
|
});
|
|
160
|
-
})), isPopoverShow && /*#__PURE__*/
|
|
152
|
+
})), isPopoverShow && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MediaQuery, {
|
|
161
153
|
query: "(min-width: 768px)"
|
|
162
|
-
}, /*#__PURE__*/
|
|
154
|
+
}, /*#__PURE__*/React.createElement(PCSelectEditorPopover, {
|
|
163
155
|
popoverPosition: popoverPosition,
|
|
164
156
|
options: options,
|
|
165
157
|
selectedOptions: selectedOptions,
|
|
166
158
|
onOptionItemToggle: this.onOptionItemToggle,
|
|
167
159
|
isSupportNewOption: this.props.isSupportNewOption,
|
|
168
160
|
onAddNewOption: this.onAddNewOption
|
|
169
|
-
})), /*#__PURE__*/
|
|
161
|
+
})), /*#__PURE__*/React.createElement(MediaQuery, {
|
|
170
162
|
query: "(max-width: 767.8px)"
|
|
171
|
-
}, /*#__PURE__*/
|
|
163
|
+
}, /*#__PURE__*/React.createElement(MBSelectEditorPopover, {
|
|
172
164
|
isReadOnly: this.props.isReadOnly,
|
|
173
165
|
value: this.state.newValue,
|
|
174
166
|
column: this.props.column,
|
|
@@ -185,4 +177,4 @@ MultipleSelectEditor.defaultProps = {
|
|
|
185
177
|
isReadOnly: false,
|
|
186
178
|
value: []
|
|
187
179
|
};
|
|
188
|
-
|
|
180
|
+
export default MultipleSelectEditor;
|
|
@@ -1,15 +1,8 @@
|
|
|
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 _SelectItem = _interopRequireDefault(require("../SelectItem"));
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class MultipleSelectFormatter extends _react.default.PureComponent {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import SelectItem from '../SelectItem';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class MultipleSelectFormatter extends React.PureComponent {
|
|
13
6
|
constructor() {
|
|
14
7
|
super(...arguments);
|
|
15
8
|
this.getOptions = () => {
|
|
@@ -21,7 +14,7 @@ class MultipleSelectFormatter extends _react.default.PureComponent {
|
|
|
21
14
|
let selectedOptions = options.filter(option => value.includes(option.id) || value.includes(option.name));
|
|
22
15
|
if (selectedOptions.length === 0) return [];
|
|
23
16
|
return selectedOptions.map(option => {
|
|
24
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/React.createElement(SelectItem, {
|
|
25
18
|
key: "multiple-".concat(option.id),
|
|
26
19
|
option: option
|
|
27
20
|
});
|
|
@@ -33,14 +26,14 @@ class MultipleSelectFormatter extends _react.default.PureComponent {
|
|
|
33
26
|
value,
|
|
34
27
|
containerClassName
|
|
35
28
|
} = this.props;
|
|
36
|
-
let classname = (
|
|
29
|
+
let classname = classnames('dtable-ui cell-formatter-container multiple-select-formatter', containerClassName);
|
|
37
30
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
38
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
32
|
className: classname
|
|
40
33
|
});
|
|
41
34
|
}
|
|
42
35
|
let options = this.getOptions();
|
|
43
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
37
|
className: classname
|
|
45
38
|
}, options);
|
|
46
39
|
}
|
|
@@ -48,4 +41,4 @@ class MultipleSelectFormatter extends _react.default.PureComponent {
|
|
|
48
41
|
MultipleSelectFormatter.defaultProps = {
|
|
49
42
|
options: []
|
|
50
43
|
};
|
|
51
|
-
|
|
44
|
+
export default MultipleSelectFormatter;
|
|
@@ -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 _reactstrap = require("reactstrap");
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class NotificationPopover extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Popover } from 'reactstrap';
|
|
3
|
+
import './index.css';
|
|
4
|
+
export default class NotificationPopover extends React.Component {
|
|
12
5
|
constructor() {
|
|
13
6
|
super(...arguments);
|
|
14
7
|
this.onMouseDown = e => {
|
|
@@ -46,46 +39,45 @@ class NotificationPopover extends _react.default.Component {
|
|
|
46
39
|
bodyText,
|
|
47
40
|
footerText
|
|
48
41
|
} = this.props;
|
|
49
|
-
return /*#__PURE__*/
|
|
42
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
50
43
|
className: "notification-wrapper",
|
|
51
44
|
target: "notification-popover",
|
|
52
45
|
isOpen: true,
|
|
53
46
|
fade: false,
|
|
54
47
|
hideArrow: true,
|
|
55
48
|
placement: "bottom"
|
|
56
|
-
}, /*#__PURE__*/
|
|
49
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
57
50
|
className: "notification-container",
|
|
58
51
|
ref: ref => this.notificationContainerRef = ref
|
|
59
|
-
}, /*#__PURE__*/
|
|
52
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
60
53
|
className: "notification-header"
|
|
61
|
-
}, headerText, /*#__PURE__*/
|
|
54
|
+
}, headerText, /*#__PURE__*/React.createElement("span", {
|
|
62
55
|
className: "dtable-font dtable-icon-x notification-close-icon",
|
|
63
56
|
onClick: this.props.onNotificationListToggle
|
|
64
|
-
})), /*#__PURE__*/
|
|
57
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
65
58
|
className: "notification-body"
|
|
66
|
-
}, this.props.enableWeixin && /*#__PURE__*/
|
|
59
|
+
}, this.props.enableWeixin && /*#__PURE__*/React.createElement("div", {
|
|
67
60
|
className: "show-weixin-qrcode",
|
|
68
61
|
onClick: this.onWeixinQRCodeDialogToggle
|
|
69
|
-
}, /*#__PURE__*/
|
|
62
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
70
63
|
className: "dtable-font dtable-icon-wechat weixin-icon"
|
|
71
|
-
}), /*#__PURE__*/
|
|
64
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
72
65
|
className: "ml-2"
|
|
73
|
-
}, "\u5173\u6CE8\u516C\u4F17\u53F7\u83B7\u53D6\u5B9E\u65F6\u901A\u77E5")), /*#__PURE__*/
|
|
66
|
+
}, "\u5173\u6CE8\u516C\u4F17\u53F7\u83B7\u53D6\u5B9E\u65F6\u901A\u77E5")), /*#__PURE__*/React.createElement("div", {
|
|
74
67
|
className: "mark-notifications",
|
|
75
68
|
onClick: this.props.onMarkAllNotifications
|
|
76
|
-
}, bodyText), /*#__PURE__*/
|
|
69
|
+
}, bodyText), /*#__PURE__*/React.createElement("div", {
|
|
77
70
|
className: "notification-list-container",
|
|
78
71
|
onScroll: this.onHandleScroll,
|
|
79
72
|
ref: ref => this.notificationListRef = ref
|
|
80
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
81
74
|
ref: ref => this.notificationsWrapperRef = ref
|
|
82
|
-
}, this.props.children)), /*#__PURE__*/
|
|
75
|
+
}, this.props.children)), /*#__PURE__*/React.createElement("div", {
|
|
83
76
|
className: "notification-footer",
|
|
84
77
|
onClick: this.onNotificationDialogToggle
|
|
85
78
|
}, footerText))));
|
|
86
79
|
}
|
|
87
80
|
}
|
|
88
|
-
exports.default = NotificationPopover;
|
|
89
81
|
NotificationPopover.defaultProps = {
|
|
90
82
|
headerText: '',
|
|
91
83
|
bodyText: '',
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _isHotkey = _interopRequireDefault(require("is-hotkey"));
|
|
10
|
-
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
var _constants = require("../constants");
|
|
12
|
-
var _utils = require("../utils/utils");
|
|
13
|
-
class NumberEditor extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import isHotkey from 'is-hotkey';
|
|
3
|
+
import { getNumberDisplayString, formatStringToNumber, replaceNumberNotAllowInput } from 'dtable-utils';
|
|
4
|
+
import { NUMBER_TYPES } from '../constants';
|
|
5
|
+
import { isMac } from '../utils/utils';
|
|
6
|
+
class NumberEditor extends React.Component {
|
|
14
7
|
constructor(props) {
|
|
15
8
|
super(props);
|
|
16
9
|
this.onEditorHandle = () => {
|
|
@@ -30,10 +23,10 @@ class NumberEditor extends _react.default.Component {
|
|
|
30
23
|
column
|
|
31
24
|
} = this.props;
|
|
32
25
|
let inputValue = this.state.inputValue ? this.state.inputValue.toString() : '';
|
|
33
|
-
let value = inputValue ?
|
|
26
|
+
let value = inputValue ? formatStringToNumber(inputValue) : ''; // format the number to submit
|
|
34
27
|
updated[column.key] = value;
|
|
35
28
|
this.props.onCommit(updated);
|
|
36
|
-
let newValue =
|
|
29
|
+
let newValue = getNumberDisplayString(value, column.data); // format the number to display
|
|
37
30
|
this.setState({
|
|
38
31
|
isEditorShow: false,
|
|
39
32
|
textValue: newValue
|
|
@@ -50,8 +43,8 @@ class NumberEditor extends _react.default.Component {
|
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
//Prevent the repetition of periods bug in the Chinese input method of the Windows system
|
|
53
|
-
if (!
|
|
54
|
-
value =
|
|
46
|
+
if (!isMac() && value.indexOf('.。') > -1) return;
|
|
47
|
+
value = replaceNumberNotAllowInput(value, this.dataFormat, currency_symbol);
|
|
55
48
|
if (value === this.state.inputValue) return;
|
|
56
49
|
this.setState({
|
|
57
50
|
inputValue: value
|
|
@@ -66,7 +59,7 @@ class NumberEditor extends _react.default.Component {
|
|
|
66
59
|
selectionEnd,
|
|
67
60
|
value
|
|
68
61
|
} = event.currentTarget;
|
|
69
|
-
if ((
|
|
62
|
+
if (isHotkey('enter', event)) {
|
|
70
63
|
event.preventDefault();
|
|
71
64
|
this.onBlur();
|
|
72
65
|
} else if (event.keyCode === 37 && selectionStart === 0 || event.keyCode === 39 && selectionEnd === value.length) {
|
|
@@ -94,8 +87,8 @@ class NumberEditor extends _react.default.Component {
|
|
|
94
87
|
column: _column
|
|
95
88
|
} = this.props;
|
|
96
89
|
let dataFormat = _column.data && _column.data.format;
|
|
97
|
-
this.dataFormat = dataFormat ||
|
|
98
|
-
let initValue =
|
|
90
|
+
this.dataFormat = dataFormat || NUMBER_TYPES.NUMBER;
|
|
91
|
+
let initValue = getNumberDisplayString(_value, _column.data); // format the number to display
|
|
99
92
|
|
|
100
93
|
this.state = {
|
|
101
94
|
inputValue: initValue,
|
|
@@ -105,15 +98,15 @@ class NumberEditor extends _react.default.Component {
|
|
|
105
98
|
}
|
|
106
99
|
render() {
|
|
107
100
|
let style = this.getStyle();
|
|
108
|
-
return /*#__PURE__*/
|
|
101
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
109
102
|
className: "cell-editor number-editor"
|
|
110
|
-
}, /*#__PURE__*/
|
|
103
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
104
|
className: "number-editor-container"
|
|
112
|
-
}, !this.state.isEditorShow && /*#__PURE__*/
|
|
105
|
+
}, !this.state.isEditorShow && /*#__PURE__*/React.createElement("div", {
|
|
113
106
|
className: "form-control",
|
|
114
107
|
style: style,
|
|
115
108
|
onClick: this.onEditorHandle
|
|
116
|
-
}, this.state.textValue), this.state.isEditorShow && /*#__PURE__*/
|
|
109
|
+
}, this.state.textValue), this.state.isEditorShow && /*#__PURE__*/React.createElement("input", {
|
|
117
110
|
ref: this.setInputRef,
|
|
118
111
|
type: "text",
|
|
119
112
|
className: "form-control",
|
|
@@ -131,4 +124,4 @@ NumberEditor.defaultProps = {
|
|
|
131
124
|
isReadOnly: false,
|
|
132
125
|
value: ''
|
|
133
126
|
};
|
|
134
|
-
|
|
127
|
+
export default NumberEditor;
|
|
@@ -1,26 +1,19 @@
|
|
|
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 _dtableUtils = require("dtable-utils");
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class NumberFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { getNumberDisplayString } from 'dtable-utils';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class NumberFormatter extends React.Component {
|
|
13
6
|
render() {
|
|
14
7
|
let {
|
|
15
8
|
value: number,
|
|
16
9
|
data,
|
|
17
10
|
containerClassName
|
|
18
11
|
} = this.props;
|
|
19
|
-
let classname = (
|
|
12
|
+
let classname = classnames('dtable-ui cell-formatter-container number-formatter', containerClassName);
|
|
20
13
|
if (number || number === 0) {
|
|
21
|
-
number =
|
|
14
|
+
number = getNumberDisplayString(number, data);
|
|
22
15
|
}
|
|
23
|
-
return /*#__PURE__*/
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
24
17
|
className: classname
|
|
25
18
|
}, number);
|
|
26
19
|
}
|
|
@@ -29,4 +22,4 @@ NumberFormatter.defaultProps = {
|
|
|
29
22
|
value: '',
|
|
30
23
|
containerClassName: ''
|
|
31
24
|
};
|
|
32
|
-
|
|
25
|
+
export default NumberFormatter;
|
|
@@ -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 _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class RateFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class RateFormatter extends React.Component {
|
|
12
5
|
constructor() {
|
|
13
6
|
super(...arguments);
|
|
14
7
|
this.getRateList = () => {
|
|
@@ -24,7 +17,7 @@ class RateFormatter extends _react.default.Component {
|
|
|
24
17
|
const validValue = Math.min(rate_max_number, value);
|
|
25
18
|
let rateList = [];
|
|
26
19
|
for (let i = 0; i < validValue; i++) {
|
|
27
|
-
rateList.push( /*#__PURE__*/
|
|
20
|
+
rateList.push( /*#__PURE__*/React.createElement("i", {
|
|
28
21
|
key: "dtable-ui-component-rate-".concat(i),
|
|
29
22
|
className: "dtable-font ".concat(rate_style_type),
|
|
30
23
|
style: {
|
|
@@ -40,10 +33,10 @@ class RateFormatter extends _react.default.Component {
|
|
|
40
33
|
value: number,
|
|
41
34
|
containerClassName
|
|
42
35
|
} = this.props;
|
|
43
|
-
const className = (
|
|
36
|
+
const className = classnames('dtable-ui cell-formatter-container rate-formatter', containerClassName);
|
|
44
37
|
if (!number) return null;
|
|
45
38
|
const rateList = this.getRateList();
|
|
46
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
47
40
|
className: className
|
|
48
41
|
}, rateList);
|
|
49
42
|
}
|
|
@@ -52,4 +45,4 @@ RateFormatter.defaultProps = {
|
|
|
52
45
|
value: '',
|
|
53
46
|
containerClassName: ''
|
|
54
47
|
};
|
|
55
|
-
|
|
48
|
+
export default RateFormatter;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
require("./index.css");
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import './index.css';
|
|
13
5
|
const RoleStatusEditor = _ref => {
|
|
14
6
|
let {
|
|
15
7
|
isShowDropdownIcon,
|
|
@@ -18,7 +10,7 @@ const RoleStatusEditor = _ref => {
|
|
|
18
10
|
onChangeOption,
|
|
19
11
|
closeShowDropdownIcon
|
|
20
12
|
} = _ref;
|
|
21
|
-
const [isOpen, setIsOpen] =
|
|
13
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
22
14
|
const handleClickMenuOption = menuOption => {
|
|
23
15
|
const {
|
|
24
16
|
value
|
|
@@ -27,20 +19,20 @@ const RoleStatusEditor = _ref => {
|
|
|
27
19
|
if (value === currentOption.value) return;
|
|
28
20
|
onChangeOption(value);
|
|
29
21
|
};
|
|
30
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
31
23
|
isOpen: isOpen,
|
|
32
24
|
className: "role-status-editor",
|
|
33
25
|
toggle: () => setIsOpen(!isOpen)
|
|
34
|
-
}, /*#__PURE__*/
|
|
26
|
+
}, /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
35
27
|
className: "dropdown-toggle-button d-flex align-items-center",
|
|
36
28
|
tag: "div"
|
|
37
|
-
}, currentOption.label, /*#__PURE__*/
|
|
29
|
+
}, currentOption.label, /*#__PURE__*/React.createElement("div", {
|
|
38
30
|
className: "dropdown-icon-container ml-1"
|
|
39
|
-
}, /*#__PURE__*/
|
|
40
|
-
className: (
|
|
31
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
className: classnames('dtable-font dtable-icon-drop-down', {
|
|
41
33
|
'hide': !isShowDropdownIcon
|
|
42
34
|
})
|
|
43
|
-
}))), /*#__PURE__*/
|
|
35
|
+
}))), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
44
36
|
positionFixed: true,
|
|
45
37
|
modifiers: {
|
|
46
38
|
preventOverflow: {
|
|
@@ -52,12 +44,12 @@ const RoleStatusEditor = _ref => {
|
|
|
52
44
|
value,
|
|
53
45
|
label
|
|
54
46
|
} = option;
|
|
55
|
-
return /*#__PURE__*/
|
|
47
|
+
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
56
48
|
key: "item-".concat(value),
|
|
57
49
|
onClick: () => handleClickMenuOption(option)
|
|
58
|
-
}, label, value === currentOption.value && /*#__PURE__*/
|
|
50
|
+
}, label, value === currentOption.value && /*#__PURE__*/React.createElement("i", {
|
|
59
51
|
className: "dtable-font dtable-icon-check-mark ml-2"
|
|
60
52
|
}));
|
|
61
53
|
})));
|
|
62
54
|
};
|
|
63
|
-
|
|
55
|
+
export default RoleStatusEditor;
|