dtable-ui-component 5.3.1-beta6 → 5.3.2
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/CheckboxEditor/index.css +20 -3
- package/lib/CheckboxEditor/index.js +35 -98
- package/lib/CheckboxFormatter/index.js +9 -6
- package/lib/CollaboratorEditor/index.css +35 -12
- package/lib/CollaboratorEditor/index.js +212 -18
- package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.js +29 -26
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +97 -0
- package/lib/CollaboratorItem/index.css +1 -1
- package/lib/CollaboratorItem/index.js +2 -6
- package/lib/DTableFiltersPopover/utils/index.js +7 -1
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
- package/lib/DTableGroupSelect/select-option-group.css +17 -17
- package/lib/DTableGroupSelect/select-option-group.js +1 -1
- package/lib/DTableSelect/index.js +1 -3
- package/lib/DateEditor/index.js +51 -14
- package/lib/DateEditor/pc-date-editor-popover.js +12 -145
- package/lib/Department-editor/department-single-select.js +1 -1
- package/lib/Department-editor/index.js +4 -3
- package/lib/DepartmentSingleSelectFormatter/index.js +1 -2
- package/lib/FileEditor/index.js +11 -258
- package/lib/FileEditor/pc-files-addition/index.js +1 -0
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/FileEditor/pc-files-preview/index.js +1 -0
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
- package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
- package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
- package/lib/FileItemFormatter/index.js +20 -19
- package/lib/FileItemFormatter/utils.js +99 -0
- package/lib/FileUploader/index.js +14 -268
- package/lib/FormulaFormatter/index.js +1 -2
- package/lib/FormulaFormatter/utils.js +31 -0
- package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
- package/lib/MultipleSelectEditor/index.css +9 -0
- package/lib/MultipleSelectEditor/index.js +177 -16
- package/lib/NumberEditor/index.js +77 -64
- package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.css +1 -1
- package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.css +6 -6
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.js +1 -3
- package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +11 -10
- package/lib/RowExpandFormatter/index.css +1 -27
- package/lib/RowExpandFormatter/index.js +100 -83
- package/lib/{RowExpandFormatter/RowExpandFormulaFormatter → RowExpandFormulaFormatter}/index.js +10 -11
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.css +6 -6
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
- package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
- package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.js +6 -6
- package/lib/RowExpandLinkFormatter/utils.js +71 -0
- package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.css +1 -1
- package/lib/RowExpandUrlFormatter/index.css +1 -0
- package/lib/{RowExpandFormatter/RowExpandUrlFormatter → RowExpandUrlFormatter}/index.js +3 -4
- package/lib/SingleSelectEditor/index.css +14 -0
- package/lib/SingleSelectEditor/index.js +156 -16
- package/lib/TextEditor/index.js +42 -113
- package/lib/constants/index.js +2 -34
- package/lib/css/cell-editor.css +2 -18
- package/lib/index.js +46 -74
- package/lib/lang/index.js +16 -19
- package/lib/locals/de.js +103 -0
- package/lib/locals/en.js +104 -0
- package/lib/locals/es.js +103 -0
- package/lib/locals/fr.js +103 -0
- package/lib/locals/pt.js +103 -0
- package/lib/locals/ru.js +103 -0
- package/lib/locals/zh-CN.js +104 -0
- package/lib/select-editor/index.js +6 -6
- package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.js +3 -3
- package/lib/select-editor/pc-select-editor-popover/index.css +71 -0
- package/lib/select-editor/pc-select-editor-popover/index.js +122 -0
- package/lib/utils/editor-utils.js +6 -1
- package/lib/utils/url.js +8 -121
- package/lib/utils/utils.js +2 -145
- package/package.json +2 -3
- package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +0 -257
- package/lib/Comment/body/comment.js +0 -190
- package/lib/Comment/body/index.css +0 -95
- package/lib/Comment/body/index.js +0 -32
- package/lib/Comment/footer/btns/index.css +0 -40
- package/lib/Comment/footer/btns/index.js +0 -113
- package/lib/Comment/footer/index.css +0 -157
- package/lib/Comment/footer/index.js +0 -170
- package/lib/Comment/footer/input/index.css +0 -52
- package/lib/Comment/footer/input/index.js +0 -448
- package/lib/Comment/footer/input/participant/index.css +0 -0
- package/lib/Comment/footer/input/participant/index.js +0 -53
- package/lib/Comment/footer/participants/index.css +0 -22
- package/lib/Comment/footer/participants/index.js +0 -68
- package/lib/Comment/footer/participants/participant/index.css +0 -5
- package/lib/Comment/footer/participants/participant/index.js +0 -32
- package/lib/Comment/footer/participants/participant-select/index.css +0 -104
- package/lib/Comment/footer/participants/participant-select/index.js +0 -182
- package/lib/Comment/index.css +0 -19
- package/lib/Comment/index.js +0 -305
- package/lib/Comment/model.js +0 -25
- package/lib/Comment/utils/common.js +0 -62
- package/lib/Comment/utils/index.js +0 -27
- package/lib/Comment/utils/utilities.js +0 -176
- package/lib/DeleteTip/index.js +0 -50
- package/lib/DigitalSignEditor/constants.js +0 -7
- package/lib/DigitalSignEditor/index.css +0 -69
- package/lib/DigitalSignEditor/index.js +0 -182
- package/lib/DigitalSignEditor/service.js +0 -38
- package/lib/DigitalSignEditor/signature-board/index.css +0 -35
- package/lib/DigitalSignEditor/signature-board/index.js +0 -135
- package/lib/DigitalSignEditor/signature-board/signature-tool.js +0 -396
- package/lib/DigitalSignEditor/utils.js +0 -29
- package/lib/DurationEditor/index.js +0 -111
- package/lib/EmailEditor/index.js +0 -59
- package/lib/FileEditor/addition-previewer/index.css +0 -1
- package/lib/FileEditor/addition-previewer/index.js +0 -52
- package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
- package/lib/FileEditor/addition-previewer/local-file-addition/index.js +0 -252
- package/lib/FileEditor/constants.js +0 -7
- package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +0 -74
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +0 -5
- package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +0 -77
- package/lib/FileEditor/files-previewer/file-previewer/index.css +0 -88
- package/lib/FileEditor/files-previewer/file-previewer/index.js +0 -167
- package/lib/FileEditor/files-previewer/index.css +0 -56
- package/lib/FileEditor/files-previewer/index.js +0 -277
- package/lib/FileEditor/index.css +0 -6
- package/lib/FileEditor/utils.js +0 -22
- package/lib/FileUploader/index.css +0 -9
- package/lib/GeolocationEditor/country-editor.js +0 -319
- package/lib/GeolocationEditor/index.css +0 -641
- package/lib/GeolocationEditor/index.js +0 -241
- package/lib/GeolocationEditor/location-editor.js +0 -368
- package/lib/GeolocationEditor/map-editor/index.js +0 -456
- package/lib/GeolocationEditor/map-editor/large-editor/index.css +0 -137
- package/lib/GeolocationEditor/map-editor/large-editor/index.js +0 -461
- package/lib/GeolocationEditor/map-editor-utils.js +0 -153
- package/lib/GeolocationEditor/map-selection-editor/index.js +0 -455
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +0 -1
- package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +0 -447
- package/lib/GeolocationEditor/parse-geolocation.js +0 -282
- package/lib/GeolocationEditor/province-city-editor.js +0 -292
- package/lib/GeolocationEditor/province-editor.js +0 -226
- package/lib/GeolocationEditor/selector-header-item.js +0 -28
- package/lib/GeolocationEditor/selector-list.js +0 -33
- package/lib/GeolocationEditor/with-ref.js +0 -27
- package/lib/ImageEditor/addition-previewer/image-link/index.css +0 -45
- package/lib/ImageEditor/addition-previewer/image-link/index.js +0 -73
- package/lib/ImageEditor/addition-previewer/index.css +0 -106
- package/lib/ImageEditor/addition-previewer/index.js +0 -63
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +0 -125
- package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +0 -254
- package/lib/ImageEditor/constants.js +0 -7
- package/lib/ImageEditor/images-previewer/image-preview/index.css +0 -59
- package/lib/ImageEditor/images-previewer/image-preview/index.js +0 -155
- package/lib/ImageEditor/images-previewer/index.css +0 -18
- package/lib/ImageEditor/images-previewer/index.js +0 -140
- package/lib/ImageEditor/index.css +0 -24
- package/lib/ImageEditor/index.js +0 -194
- package/lib/ImageThumbnail/index.css +0 -20
- package/lib/ImageThumbnail/index.js +0 -136
- package/lib/RowExpandDialog/body/index.css +0 -21
- package/lib/RowExpandDialog/body/index.js +0 -262
- package/lib/RowExpandDialog/column-content/index.css +0 -44
- package/lib/RowExpandDialog/column-content/index.js +0 -50
- package/lib/RowExpandDialog/header/index.css +0 -31
- package/lib/RowExpandDialog/header/index.js +0 -55
- package/lib/RowExpandDialog/index.css +0 -24
- package/lib/RowExpandDialog/index.js +0 -252
- package/lib/RowExpandEditor/RowExpandAddBtn/index.css +0 -22
- package/lib/RowExpandEditor/RowExpandAddBtn/index.js +0 -24
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +0 -18
- package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +0 -43
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +0 -5
- package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +0 -232
- package/lib/RowExpandEditor/RowExpandDateEditor/index.js +0 -130
- package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +0 -129
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +0 -13
- package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +0 -208
- package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +0 -105
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
- package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +0 -125
- package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
- package/lib/RowExpandEditor/RowExpandFileEditor/index.js +0 -146
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +0 -17
- package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +0 -165
- package/lib/RowExpandEditor/RowExpandImageEditor/index.css +0 -6
- package/lib/RowExpandEditor/RowExpandImageEditor/index.js +0 -170
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +0 -6
- package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +0 -123
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +0 -44
- package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +0 -224
- package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +0 -105
- package/lib/RowExpandEditor/RowExpandRateEditor/index.css +0 -13
- package/lib/RowExpandEditor/RowExpandRateEditor/index.js +0 -152
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +0 -58
- package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +0 -192
- package/lib/RowExpandEditor/RowExpandTextEditor/index.css +0 -4
- package/lib/RowExpandEditor/RowExpandTextEditor/index.js +0 -127
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +0 -31
- package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +0 -130
- package/lib/RowExpandEditor/constants.js +0 -44
- package/lib/RowExpandEditor/index.css +0 -0
- package/lib/RowExpandEditor/index.js +0 -32
- package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +0 -27
- package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +0 -1
- package/lib/RowExpandFormatter/constants.js +0 -60
- package/lib/UploadProgress/index.js +0 -38
- package/lib/UrlEditor/index.js +0 -62
- package/lib/common/editor-base.js +0 -53
- package/lib/constants/file.js +0 -96
- package/lib/constants/key-codes.js +0 -109
- package/lib/hooks/index.js +0 -16
- package/lib/locales/de.json +0 -167
- package/lib/locales/en.json +0 -167
- package/lib/locales/es.json +0 -167
- package/lib/locales/fr.json +0 -167
- package/lib/locales/pt.json +0 -167
- package/lib/locales/ru.json +0 -167
- package/lib/locales/zh-CN.json +0 -167
- package/lib/select-editor/pc-select-editor/index.css +0 -85
- package/lib/select-editor/pc-select-editor/index.js +0 -290
- package/lib/utils/cell-comparer.js +0 -35
- package/lib/utils/cell.js +0 -55
- package/lib/utils/column-utils.js +0 -25
- package/lib/utils/get-event-transfer.js +0 -75
- package/lib/utils/hotkey.js +0 -37
- package/lib/utils/object-utils.js +0 -61
- /package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.css +0 -0
- /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-collaborator-editor-popover}/index.css +0 -0
- /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.css +0 -0
- /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
- /package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.js +0 -0
- /package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.css +0 -0
|
@@ -6,116 +6,129 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _isHotkey = _interopRequireDefault(require("is-hotkey"));
|
|
10
10
|
var _dtableUtils = require("dtable-utils");
|
|
11
11
|
var _constants = require("../constants");
|
|
12
12
|
var _utils = require("../utils/utils");
|
|
13
13
|
class NumberEditor extends _react.default.Component {
|
|
14
14
|
constructor(props) {
|
|
15
15
|
super(props);
|
|
16
|
+
this.onEditorHandle = () => {
|
|
17
|
+
if (this.props.isReadOnly) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
this.setState({
|
|
21
|
+
isEditorShow: true,
|
|
22
|
+
inputValue: this.state.textValue
|
|
23
|
+
}, () => {
|
|
24
|
+
this.input.focus();
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
this.onCommit = () => {
|
|
28
|
+
let updated = {};
|
|
29
|
+
let {
|
|
30
|
+
column
|
|
31
|
+
} = this.props;
|
|
32
|
+
let inputValue = this.state.inputValue ? this.state.inputValue.toString() : '';
|
|
33
|
+
let value = inputValue ? (0, _dtableUtils.formatStringToNumber)(inputValue) : ''; // format the number to submit
|
|
34
|
+
updated[column.key] = value;
|
|
35
|
+
this.props.onCommit(updated);
|
|
36
|
+
let newValue = (0, _dtableUtils.getNumberDisplayString)(value, column.data); // format the number to display
|
|
37
|
+
this.setState({
|
|
38
|
+
isEditorShow: false,
|
|
39
|
+
textValue: newValue
|
|
40
|
+
});
|
|
41
|
+
};
|
|
16
42
|
this.onChange = event => {
|
|
17
43
|
const {
|
|
18
44
|
data
|
|
19
45
|
} = this.props.column; // data maybe 'null'
|
|
20
|
-
|
|
46
|
+
let value = event.target.value.trim();
|
|
21
47
|
let currency_symbol = null;
|
|
22
48
|
if (data && data.format === 'custom_currency') {
|
|
23
49
|
currency_symbol = data['currency_symbol'];
|
|
24
50
|
}
|
|
25
|
-
const initValue = event.target.value.trim();
|
|
26
51
|
|
|
27
52
|
// Prevent the repetition of periods bug in the Chinese input method of the Windows system
|
|
28
|
-
if (!(0, _utils.isMac)() &&
|
|
29
|
-
|
|
30
|
-
if (value === this.state.
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
53
|
+
if (!(0, _utils.isMac)() && value.indexOf('.。') > -1) return;
|
|
54
|
+
value = (0, _dtableUtils.replaceNumberNotAllowInput)(value, this.dataFormat, currency_symbol);
|
|
55
|
+
if (value === this.state.inputValue) return;
|
|
33
56
|
this.setState({
|
|
34
|
-
value
|
|
57
|
+
inputValue: value
|
|
35
58
|
});
|
|
36
59
|
};
|
|
60
|
+
this.onBlur = () => {
|
|
61
|
+
this.onCommit();
|
|
62
|
+
};
|
|
37
63
|
this.onKeyDown = event => {
|
|
38
64
|
let {
|
|
39
65
|
selectionStart,
|
|
40
66
|
selectionEnd,
|
|
41
67
|
value
|
|
42
68
|
} = event.currentTarget;
|
|
43
|
-
if (
|
|
69
|
+
if ((0, _isHotkey.default)('enter', event)) {
|
|
44
70
|
event.preventDefault();
|
|
45
71
|
this.onBlur();
|
|
46
|
-
|
|
47
|
-
} else if (event.keyCode === _constants.KeyCodes.LeftArrow && selectionStart === 0 || event.keyCode === _constants.KeyCodes.RightArrow && selectionEnd === value.length) {
|
|
72
|
+
} else if (event.keyCode === 37 && selectionStart === 0 || event.keyCode === 39 && selectionEnd === value.length) {
|
|
48
73
|
event.stopPropagation();
|
|
49
74
|
}
|
|
50
75
|
};
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
const {
|
|
54
|
-
column
|
|
55
|
-
} = this.props;
|
|
56
|
-
return (0, _dtableUtils.formatStringToNumber)(value, column.data);
|
|
76
|
+
this.onPaste = e => {
|
|
77
|
+
e.stopPropagation();
|
|
57
78
|
};
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
if (domNode.tagName === 'INPUT') {
|
|
61
|
-
return domNode;
|
|
62
|
-
}
|
|
63
|
-
return domNode.querySelector('input:not([type=hidden])');
|
|
79
|
+
this.onCut = e => {
|
|
80
|
+
e.stopPropagation();
|
|
64
81
|
};
|
|
65
|
-
this.
|
|
66
|
-
|
|
82
|
+
this.getStyle = () => {
|
|
83
|
+
return {
|
|
84
|
+
width: '320px',
|
|
85
|
+
textAlign: 'left'
|
|
86
|
+
};
|
|
67
87
|
};
|
|
68
88
|
this.setInputRef = input => {
|
|
69
89
|
this.input = input;
|
|
70
90
|
return this.input;
|
|
71
91
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
let {
|
|
93
|
+
value: _value,
|
|
94
|
+
column: _column
|
|
95
|
+
} = this.props;
|
|
96
|
+
let dataFormat = _column.data && _column.data.format;
|
|
97
|
+
this.dataFormat = dataFormat || _constants.NUMBER_TYPES.NUMBER;
|
|
98
|
+
let initValue = (0, _dtableUtils.getNumberDisplayString)(_value, _column.data); // format the number to display
|
|
99
|
+
|
|
78
100
|
this.state = {
|
|
79
|
-
|
|
101
|
+
inputValue: initValue,
|
|
102
|
+
textValue: initValue,
|
|
103
|
+
isEditorShow: false
|
|
80
104
|
};
|
|
81
105
|
}
|
|
82
|
-
componentDidMount() {
|
|
83
|
-
if (this.props.isInModal) {
|
|
84
|
-
this.input.focus();
|
|
85
|
-
}
|
|
86
|
-
const {
|
|
87
|
-
data = {}
|
|
88
|
-
} = this.props.column;
|
|
89
|
-
let {
|
|
90
|
-
value
|
|
91
|
-
} = this.state;
|
|
92
|
-
value = (0, _dtableUtils.getNumberDisplayString)(value, data) || '';
|
|
93
|
-
this.setState({
|
|
94
|
-
value
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
106
|
render() {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
let style = this.getStyle();
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
+
className: "cell-editor number-editor"
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
+
className: "number-editor-container"
|
|
112
|
+
}, !this.state.isEditorShow && /*#__PURE__*/_react.default.createElement("div", {
|
|
113
|
+
className: "form-control",
|
|
114
|
+
style: style,
|
|
115
|
+
onClick: this.onEditorHandle
|
|
116
|
+
}, this.state.textValue), this.state.isEditorShow && /*#__PURE__*/_react.default.createElement("input", {
|
|
108
117
|
ref: this.setInputRef,
|
|
109
118
|
type: "text",
|
|
110
119
|
className: "form-control",
|
|
111
|
-
|
|
120
|
+
style: style,
|
|
121
|
+
value: this.state.inputValue,
|
|
122
|
+
onChange: this.onChange,
|
|
112
123
|
onBlur: this.onBlur,
|
|
113
|
-
onPaste: this.onPaste,
|
|
114
124
|
onCut: this.onCut,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
125
|
+
onPaste: this.onPaste,
|
|
126
|
+
onKeyDown: this.onKeyDown
|
|
127
|
+
})));
|
|
119
128
|
}
|
|
120
129
|
}
|
|
130
|
+
NumberEditor.defaultProps = {
|
|
131
|
+
isReadOnly: false,
|
|
132
|
+
value: ''
|
|
133
|
+
};
|
|
121
134
|
var _default = exports.default = NumberEditor;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _editorUtils = require("
|
|
10
|
+
var _editorUtils = require("../utils/editor-utils");
|
|
11
11
|
require("./index.css");
|
|
12
12
|
class RowExpandEmailFormatter extends _react.default.Component {
|
|
13
13
|
constructor() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import url('
|
|
1
|
+
@import url('../css/cell-formatter.css');
|
|
2
2
|
|
|
3
3
|
.dtable-ui.row-expand-file-formatter {
|
|
4
4
|
display: flex;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
border-color: #c9c9c9;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-
|
|
31
|
+
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-file-icons-choice {
|
|
32
32
|
height: 20px;
|
|
33
33
|
width: 100%;
|
|
34
34
|
top: 0;
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
align-items: center;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.dtable-ui.row-expand-file-formatter .row-expand-item-file:hover .dtable-
|
|
43
|
+
.dtable-ui.row-expand-file-formatter .row-expand-item-file:hover .dtable-file-icons-choice {
|
|
44
44
|
display: flex;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-
|
|
47
|
+
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-file-icons-choice .file-icon {
|
|
48
48
|
height: 16px;
|
|
49
49
|
width: 16px;
|
|
50
50
|
border-radius: 50%;
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
align-items: center;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-
|
|
59
|
+
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-file-icons-choice .file-icon:nth-child(2) {
|
|
60
60
|
margin-left: 5px;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-
|
|
63
|
+
.dtable-ui.row-expand-file-formatter .row-expand-item-file .dtable-file-icons-choice .file-icon .dtable-font {
|
|
64
64
|
font-size: 12px;
|
|
65
65
|
transform: scale(.7);
|
|
66
66
|
}
|
|
@@ -17,8 +17,7 @@ class RowExpandFileFormatter extends _react.default.PureComponent {
|
|
|
17
17
|
column,
|
|
18
18
|
downloadFile,
|
|
19
19
|
deleteFile,
|
|
20
|
-
readOnly
|
|
21
|
-
config
|
|
20
|
+
readOnly
|
|
22
21
|
} = this.props;
|
|
23
22
|
if (!Array.isArray(value) || value.length === 0) {
|
|
24
23
|
return null;
|
|
@@ -31,7 +30,6 @@ class RowExpandFileFormatter extends _react.default.PureComponent {
|
|
|
31
30
|
key: index,
|
|
32
31
|
index: index,
|
|
33
32
|
column: column,
|
|
34
|
-
config: config,
|
|
35
33
|
downloadFile: downloadFile,
|
|
36
34
|
deleteFile: deleteFile,
|
|
37
35
|
readOnly: readOnly
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _lang = require("
|
|
12
|
-
var
|
|
13
|
-
var _deleteTip = _interopRequireDefault(require("
|
|
11
|
+
var _lang = require("../lang");
|
|
12
|
+
var _utils = require("../FileItemFormatter/utils");
|
|
13
|
+
var _deleteTip = _interopRequireDefault(require("../common/delete-tip"));
|
|
14
14
|
class RowExpandFileItemFormatter extends _react.Component {
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
@@ -39,6 +39,10 @@ class RowExpandFileItemFormatter extends _react.Component {
|
|
|
39
39
|
this.closeDeleteTip();
|
|
40
40
|
this.props.deleteFile(this.props.index);
|
|
41
41
|
};
|
|
42
|
+
this.getFileIconData = item => {
|
|
43
|
+
let fileIconUrl = (0, _utils.getFileIconUrl)(item.name, item.type);
|
|
44
|
+
return require('../FileItemFormatter/' + fileIconUrl);
|
|
45
|
+
};
|
|
42
46
|
this.state = {
|
|
43
47
|
isTooltipOpen: false,
|
|
44
48
|
isDeleteTipOpen: false
|
|
@@ -51,23 +55,20 @@ class RowExpandFileItemFormatter extends _react.Component {
|
|
|
51
55
|
index,
|
|
52
56
|
readOnly,
|
|
53
57
|
downloadFile,
|
|
54
|
-
deleteFile
|
|
55
|
-
config
|
|
58
|
+
deleteFile
|
|
56
59
|
} = this.props;
|
|
57
60
|
const id = 'file-list-preview-item' + column.key + index;
|
|
58
|
-
const
|
|
59
|
-
fileIconUrl
|
|
60
|
-
} = (0, _url.getFileThumbnailInfo)(file, config);
|
|
61
|
+
const url = this.getFileIconData(file);
|
|
61
62
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
62
63
|
key: "file-".concat(index),
|
|
63
64
|
className: "row-expand-item-file",
|
|
64
65
|
id: id
|
|
65
66
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
66
|
-
src:
|
|
67
|
+
src: url,
|
|
67
68
|
id: "item-file-".concat(index),
|
|
68
69
|
alt: file.name
|
|
69
70
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
className: "dtable-
|
|
71
|
+
className: "dtable-file-icons-choice"
|
|
71
72
|
}, downloadFile && /*#__PURE__*/_react.default.createElement("span", {
|
|
72
73
|
className: "file-icon",
|
|
73
74
|
onClick: e => this.props.downloadFile(file, e)
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
background-color: #fff;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
.dtable-ui.dtable-row-expand-formatter .
|
|
103
|
+
.dtable-ui.dtable-row-expand-formatter .geolocation-formatter-container {
|
|
104
104
|
margin-top: 0.5rem;
|
|
105
105
|
display: flex;
|
|
106
106
|
align-items: center;
|
|
@@ -109,29 +109,3 @@
|
|
|
109
109
|
.dtable-ui.dtable-row-expand-formatter .dtable-link-formatter {
|
|
110
110
|
padding-top: 8px;
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
.dtable-ui-row-expand-select-formatter.custom-select {
|
|
114
|
-
display: flex;
|
|
115
|
-
padding: 0 10px;
|
|
116
|
-
border-radius: 3px;
|
|
117
|
-
align-items: center;
|
|
118
|
-
justify-content: space-between;
|
|
119
|
-
-webkit-user-select: none;
|
|
120
|
-
user-select: none;
|
|
121
|
-
text-align: left;
|
|
122
|
-
position: relative;
|
|
123
|
-
cursor: pointer;
|
|
124
|
-
height: fit-content;
|
|
125
|
-
min-height: 2.375rem;
|
|
126
|
-
background-color: #f8f9fa !important;
|
|
127
|
-
cursor: default;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.dtable-ui-row-expand-select-formatter .dtable-ui-row-expand-select-formatter-inner {
|
|
131
|
-
display: flex;
|
|
132
|
-
flex: 1 1;
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
flex-wrap: nowrap;
|
|
135
|
-
align-items: center;
|
|
136
|
-
justify-content: space-between;
|
|
137
|
-
}
|