dtable-ui-component 7.0.13 → 7.0.15
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/ActionSheet/index.js +58 -49
- package/lib/ActivityIndicator/index.js +17 -16
- package/lib/AsyncUserSelect/index.js +20 -46
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +27 -29
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +16 -13
- package/lib/CheckboxEditor/mb-editor.js +20 -9
- package/lib/CheckboxEditor/pc-editor.js +24 -12
- package/lib/CheckboxFormatter/index.js +5 -4
- package/lib/CollaboratorEditor/index.js +17 -14
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +8 -10
- package/lib/Comment/body/comment.js +19 -11
- package/lib/Comment/body/index.js +8 -8
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +21 -10
- package/lib/Comment/footer/input/index.js +55 -34
- package/lib/Comment/footer/input/participant/index.js +6 -5
- package/lib/Comment/footer/participants/index.js +5 -4
- package/lib/Comment/footer/participants/participant/index.js +3 -1
- package/lib/Comment/footer/participants/participant-select/index.js +26 -10
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +22 -16
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
- package/lib/DTableColorPicker/index.js +53 -67
- package/lib/DTableColorPicker/utils.js +7 -5
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +10 -8
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeSearchInput/index.js +41 -26
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +28 -24
- package/lib/DTableDropdownMenu/index.js +17 -14
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +42 -27
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +114 -64
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
- package/lib/DTableFiltersPopover/widgets/filter-group.js +57 -36
- package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
- package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
- package/lib/DTableIcon/index.js +11 -10
- package/lib/DTableIcon/svg-icon.js +11 -9
- package/lib/DTableModalHeader/index.js +7 -7
- package/lib/DTablePopover/index.js +16 -12
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +20 -11
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +6 -7
- package/lib/DTableSelect/index.js +26 -25
- package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
- package/lib/DTableSelect/utils.js +83 -47
- package/lib/DTableSubDropdownMenu/index.js +16 -12
- package/lib/DTableSubDropdownToggle/index.js +16 -17
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +12 -11
- package/lib/DateEditor/index.js +28 -30
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +46 -27
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +7 -5
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
- package/lib/DepartmentSelectFilter/index.js +13 -8
- package/lib/DepartmentSingleSelectEditor/index.js +16 -13
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +16 -13
- package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
- package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
- package/lib/DigitalSignEditor/service.js +5 -3
- package/lib/DigitalSignEditor/signature-board/index.js +10 -7
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +6 -5
- package/lib/Drawer/index.js +3 -2
- package/lib/DurationEditor/index.js +31 -21
- package/lib/DurationFormatter/index.js +5 -4
- package/lib/EditEditorButton/index.js +3 -1
- package/lib/EmailFormatter/index.js +4 -3
- package/lib/FieldDisplaySetting/field-item.js +13 -13
- package/lib/FieldDisplaySetting/index.js +20 -20
- package/lib/FileEditor/files-previewer/index.js +16 -13
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +24 -17
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +16 -13
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
- package/lib/FileEditor/pc-editor/index.js +30 -22
- package/lib/FileFormatter/index.js +20 -27
- package/lib/FileItemFormatter/index.js +10 -7
- package/lib/FileUploader/index.js +46 -29
- package/lib/FormulaFormatter/index.js +44 -24
- package/lib/GeolocationEditor/index.js +32 -27
- package/lib/GeolocationEditor/map-editor-utils.js +23 -21
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +28 -22
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
- package/lib/GeolocationEditor/pc-editor/country-editor.js +25 -12
- package/lib/GeolocationEditor/pc-editor/index.js +41 -27
- package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
- package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +13 -5
- package/lib/Icon/index.js +13 -15
- package/lib/Icon/load-sprite.js +13 -2
- package/lib/IconButton/index.js +12 -13
- package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +16 -13
- package/lib/ImageEditor/mb-editor/index.js +20 -28
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +5 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +14 -12
- package/lib/ImagePreviewerLightbox/index.js +15 -19
- package/lib/ImageThumbnail/index.js +15 -12
- package/lib/InputItem/custom-input.js +55 -35
- package/lib/InputItem/custom-keyboard.js +42 -42
- package/lib/InputItem/index.js +82 -63
- package/lib/InputItem/input.js +9 -11
- package/lib/LastModifierFormatter/index.js +8 -6
- package/lib/LinkEditor/index.js +53 -33
- package/lib/LinkEditor/link-editor-option.js +4 -3
- package/lib/LinkEditor/mb-popover/index.js +22 -9
- package/lib/LinkEditor/pc-popover/index.js +13 -7
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +17 -19
- package/lib/List/list-item.js +59 -55
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +9 -8
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +6 -4
- package/lib/MobileFullScreenPage/header/index.js +10 -8
- package/lib/MobileFullScreenPage/index.js +12 -14
- package/lib/MobileModal/index.js +7 -8
- package/lib/MobileOperationSheet/index.js +8 -7
- package/lib/MobileSelector/empty/index.js +3 -1
- package/lib/MobileSelector/index.js +7 -5
- package/lib/MobileSelector/option/index.js +5 -3
- package/lib/MobileSelector/options/index.css +0 -4
- package/lib/MobileSelector/options/index.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/alert.js +2 -2
- package/lib/Modal/modal.js +28 -30
- package/lib/Modal/prompt.js +14 -14
- package/lib/MultipleSelectEditor/index.js +7 -7
- package/lib/MultipleSelectFormatter/index.js +9 -7
- package/lib/NotificationPopover/index.js +5 -4
- package/lib/NumberEditor/index.js +21 -12
- package/lib/NumberFormatter/index.js +5 -4
- package/lib/PhoneNumberLink/index.js +5 -3
- package/lib/Picker/AbstractPicker.js +35 -33
- package/lib/Popover/index.js +9 -11
- package/lib/Popover/item.js +22 -24
- package/lib/Progress/index.js +18 -17
- package/lib/Radio/Radio.js +17 -15
- package/lib/Radio/RadioItem.js +23 -19
- package/lib/RateFormatter/index.js +15 -15
- package/lib/RoleStatusEditor/index.js +18 -19
- package/lib/RowExpand/index.js +7 -6
- package/lib/RowExpandDialog/body/index.js +57 -40
- package/lib/RowExpandDialog/column-content/index.js +10 -6
- package/lib/RowExpandDialog/header/index.js +12 -9
- package/lib/RowExpandDialog/index.js +59 -63
- package/lib/RowExpandEditor/add-btn/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
- package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- package/lib/RowExpandEditor/date-editor/index.js +7 -6
- package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
- package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
- package/lib/RowExpandEditor/department-editor/index.js +7 -6
- package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
- package/lib/RowExpandEditor/duration-editor/index.js +7 -6
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
- package/lib/RowExpandEditor/email-editor/index.js +7 -6
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
- package/lib/RowExpandEditor/file-editor/index.js +7 -6
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/index.js +7 -6
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
- package/lib/RowExpandEditor/index.js +16 -11
- package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
- package/lib/RowExpandEditor/number-editor/index.js +7 -6
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
- package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
- package/lib/RowExpandEditor/rate-editor/index.js +7 -6
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
- package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
- package/lib/RowExpandEditor/text-editor/index.js +7 -6
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
- package/lib/RowExpandEditor/url-editor/index.js +7 -6
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
- package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
- package/lib/RowExpandFormatter/email-formatter/index.js +8 -5
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
- package/lib/RowExpandFormatter/index.js +52 -34
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
- package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
- package/lib/RowExpandView/body/index.js +43 -32
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +52 -53
- package/lib/SelectItem/index.js +7 -5
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +12 -10
- package/lib/SimpleLongTextFormatter/index.js +18 -12
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
- package/lib/SingleSelectEditor/index.js +7 -7
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +26 -24
- package/lib/TabBar/index.js +28 -24
- package/lib/Tabs/index.js +13 -10
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +53 -48
- package/lib/Toast/index.js +9 -8
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/formatterConfig/index.js +3 -3
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +16 -13
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +47 -32
- package/lib/toaster/alert.js +8 -7
- package/lib/toaster/toast.js +4 -3
- package/lib/toaster/toastManager.js +13 -13
- package/lib/toaster/toaster.js +12 -9
- package/lib/utils/cell.js +11 -8
- package/lib/utils/class.js +3 -3
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +6 -5
- package/lib/utils/getLocale.js +11 -5
- package/lib/utils/object-utils.js +5 -4
- package/lib/utils/url.js +29 -22
- package/lib/utils/utils.js +6 -2
- package/package.json +2 -2
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _utils = require("../../../utils/utils");
|
|
@@ -18,12 +17,13 @@ class MBFilesPreviewer extends _react.default.Component {
|
|
|
18
17
|
constructor() {
|
|
19
18
|
super(...arguments);
|
|
20
19
|
this.downloadImage = imageItemUrl => {
|
|
21
|
-
const
|
|
20
|
+
const {
|
|
21
|
+
value
|
|
22
|
+
} = this.props;
|
|
22
23
|
const file = value.find(v => v.url === imageItemUrl);
|
|
23
24
|
if (!file) return;
|
|
24
25
|
this.props.getDownLoadFiles([file], _ref => {
|
|
25
|
-
let
|
|
26
|
-
dFile = _ref2[0];
|
|
26
|
+
let [dFile] = _ref;
|
|
27
27
|
dFile && (0, _utils.downloadFile)(dFile);
|
|
28
28
|
});
|
|
29
29
|
};
|
|
@@ -33,9 +33,10 @@ class MBFilesPreviewer extends _react.default.Component {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
const
|
|
37
|
-
value
|
|
38
|
-
getDownLoadFiles
|
|
36
|
+
const {
|
|
37
|
+
value,
|
|
38
|
+
getDownLoadFiles
|
|
39
|
+
} = this.props;
|
|
39
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
40
41
|
className: (0, _classnames.default)('dtable-ui-file-editor-previewer dtable-ui-mobile-file-editor-previewer', {
|
|
41
42
|
'mt-0': value.length === 0
|
|
@@ -42,9 +42,10 @@ class FileDropdownMenu extends _react.default.Component {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
const
|
|
46
|
-
onRenameFile
|
|
47
|
-
onDeleteFile
|
|
45
|
+
const {
|
|
46
|
+
onRenameFile,
|
|
47
|
+
onDeleteFile
|
|
48
|
+
} = this.props;
|
|
48
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Dropdown, {
|
|
49
50
|
isOpen: this.state.isItemMenuShow,
|
|
50
51
|
toggle: this.onDropdownToggleClick,
|
package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js
CHANGED
|
@@ -31,11 +31,12 @@ class FileNameEditor extends _react.Component {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
this.onSave = () => {
|
|
34
|
-
const
|
|
35
|
-
renameFile
|
|
36
|
-
name
|
|
37
|
-
closeRenameFile
|
|
38
|
-
itemIndex
|
|
34
|
+
const {
|
|
35
|
+
renameFile,
|
|
36
|
+
name,
|
|
37
|
+
closeRenameFile,
|
|
38
|
+
itemIndex
|
|
39
|
+
} = this.props;
|
|
39
40
|
let newName = this.state.fileName.trim();
|
|
40
41
|
if (newName === name || newName === '') {
|
|
41
42
|
closeRenameFile();
|
|
@@ -33,7 +33,9 @@ class FilePreviewer extends _react.default.Component {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
this.handleFileClick = () => {
|
|
36
|
-
let
|
|
36
|
+
let {
|
|
37
|
+
fileItem
|
|
38
|
+
} = this.props;
|
|
37
39
|
let openFileUrl = fileItem.url;
|
|
38
40
|
let assetFileIndex = openFileUrl.indexOf('/asset');
|
|
39
41
|
if (assetFileIndex > -1 && (0, _url.imageCheck)(fileItem.name)) {
|
|
@@ -47,7 +49,9 @@ class FilePreviewer extends _react.default.Component {
|
|
|
47
49
|
this.props.downloadFile(downloadUrl);
|
|
48
50
|
};
|
|
49
51
|
this.onSelectFile = () => {
|
|
50
|
-
const
|
|
52
|
+
const {
|
|
53
|
+
fileItem
|
|
54
|
+
} = this.props;
|
|
51
55
|
this.props.onSelectFiles(fileItem.name);
|
|
52
56
|
};
|
|
53
57
|
this.closeRenameFile = () => {
|
|
@@ -77,22 +81,25 @@ class FilePreviewer extends _react.default.Component {
|
|
|
77
81
|
};
|
|
78
82
|
}
|
|
79
83
|
render() {
|
|
80
|
-
const
|
|
81
|
-
fileItem
|
|
82
|
-
isItemFreezed
|
|
83
|
-
isSelectMultipleFiles
|
|
84
|
-
isSelected
|
|
85
|
-
config
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
const {
|
|
85
|
+
fileItem,
|
|
86
|
+
isItemFreezed,
|
|
87
|
+
isSelectMultipleFiles,
|
|
88
|
+
isSelected,
|
|
89
|
+
config
|
|
90
|
+
} = this.props;
|
|
91
|
+
const {
|
|
92
|
+
isShowRename,
|
|
93
|
+
isShowOperation,
|
|
94
|
+
highlight
|
|
95
|
+
} = this.state;
|
|
96
|
+
const {
|
|
97
|
+
fileIconUrl
|
|
98
|
+
} = (0, _url.getFileThumbnailInfo)(fileItem, config);
|
|
92
99
|
const errorMessage = '';
|
|
93
100
|
const uploadTime = (0, _utils.getFileUploadTime)(fileItem);
|
|
94
101
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
95
|
-
className:
|
|
102
|
+
className: `dtable-ui-file-editor-previewer-box ${highlight ? 'dtable-ui-file-editor-previewer-box-highlight' : ''}`,
|
|
96
103
|
onMouseEnter: this.fileItemMouseEnter,
|
|
97
104
|
onMouseLeave: this.fileItemMouseLeave,
|
|
98
105
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -116,7 +123,7 @@ class FilePreviewer extends _react.default.Component {
|
|
|
116
123
|
renameFile: this.props.renameFile,
|
|
117
124
|
closeRenameFile: this.closeRenameFile
|
|
118
125
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
119
|
-
className:
|
|
126
|
+
className: `dtable-ui-file-editor-previewer-item-name ${fileItem.type === 'dir' ? 'dtable-ui-file-editor-previewer-item-name-height' : ''}`,
|
|
120
127
|
ref: ref => this.renameRef = ref,
|
|
121
128
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
122
129
|
onClick: this.props.renameFile ? this.handleFileClick : () => {},
|
|
@@ -126,7 +133,7 @@ class FilePreviewer extends _react.default.Component {
|
|
|
126
133
|
className: "dtable-ui-file-editor-preview-item-detail d-flex",
|
|
127
134
|
children: [uploadTime && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
128
135
|
className: "file-upload-time",
|
|
129
|
-
children:
|
|
136
|
+
children: `${uploadTime}, `
|
|
130
137
|
}), fileItem.size > -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
131
138
|
children: (0, _utils.bytesToSize)(fileItem.size)
|
|
132
139
|
})]
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _url = require("../../../utils/url");
|
|
11
10
|
var _utils = require("../../../utils/utils");
|
|
@@ -24,20 +23,26 @@ class PCFilesPreviewer extends _react.default.Component {
|
|
|
24
23
|
});
|
|
25
24
|
};
|
|
26
25
|
this.showLargeImage = itemUrl => {
|
|
27
|
-
let
|
|
26
|
+
let {
|
|
27
|
+
fileImageUrlList
|
|
28
|
+
} = this.state;
|
|
28
29
|
this.setState({
|
|
29
30
|
isShowLargeImage: true,
|
|
30
31
|
largeImageIndex: fileImageUrlList.indexOf(itemUrl)
|
|
31
32
|
});
|
|
32
33
|
};
|
|
33
34
|
this.moveNext = () => {
|
|
34
|
-
let
|
|
35
|
+
let {
|
|
36
|
+
fileImageUrlList
|
|
37
|
+
} = this.state;
|
|
35
38
|
this.setState(prevState => ({
|
|
36
39
|
largeImageIndex: (prevState.largeImageIndex + 1) % fileImageUrlList.length
|
|
37
40
|
}));
|
|
38
41
|
};
|
|
39
42
|
this.movePrev = () => {
|
|
40
|
-
let
|
|
43
|
+
let {
|
|
44
|
+
fileImageUrlList
|
|
45
|
+
} = this.state;
|
|
41
46
|
this.setState(prevState => ({
|
|
42
47
|
largeImageIndex: (prevState.largeImageIndex + fileImageUrlList.length - 1) % fileImageUrlList.length
|
|
43
48
|
}));
|
|
@@ -49,23 +54,30 @@ class PCFilesPreviewer extends _react.default.Component {
|
|
|
49
54
|
});
|
|
50
55
|
};
|
|
51
56
|
this.downloadImage = imageItemUrl => {
|
|
52
|
-
const
|
|
57
|
+
const {
|
|
58
|
+
value
|
|
59
|
+
} = this.props;
|
|
53
60
|
const file = value.find(v => v.url === imageItemUrl);
|
|
54
61
|
if (!file) return;
|
|
55
62
|
this.props.getDownLoadFiles([file], _ref => {
|
|
56
|
-
let
|
|
57
|
-
dFile = _ref2[0];
|
|
63
|
+
let [dFile] = _ref;
|
|
58
64
|
dFile && (0, _utils.downloadFile)(dFile);
|
|
59
65
|
});
|
|
60
66
|
};
|
|
61
67
|
this.onRotateImage = (imageIndex, degree) => {
|
|
62
|
-
let
|
|
68
|
+
let {
|
|
69
|
+
fileImageUrlList
|
|
70
|
+
} = this.state;
|
|
63
71
|
const imageUrl = fileImageUrlList[imageIndex];
|
|
64
72
|
this.props.onRotateImage && this.props.onRotateImage(imageUrl, degree);
|
|
65
73
|
};
|
|
66
74
|
this.deleteImage = (index, type) => {
|
|
67
|
-
const
|
|
68
|
-
|
|
75
|
+
const {
|
|
76
|
+
value
|
|
77
|
+
} = this.props;
|
|
78
|
+
let {
|
|
79
|
+
fileImageUrlList
|
|
80
|
+
} = this.state;
|
|
69
81
|
const imageUrl = fileImageUrlList[index];
|
|
70
82
|
let fileItemIndex = value.findIndex(fileItem => fileItem.url === imageUrl);
|
|
71
83
|
this.props.deleteFile(fileItemIndex, type);
|
|
@@ -94,7 +106,9 @@ class PCFilesPreviewer extends _react.default.Component {
|
|
|
94
106
|
});
|
|
95
107
|
};
|
|
96
108
|
this.onSelectFiles = name => {
|
|
97
|
-
const
|
|
109
|
+
const {
|
|
110
|
+
selectedFilesList
|
|
111
|
+
} = this.state;
|
|
98
112
|
let filesList = selectedFilesList.slice(0);
|
|
99
113
|
const selectedFileIndex = selectedFilesList.indexOf(name);
|
|
100
114
|
if (selectedFileIndex > -1) {
|
|
@@ -107,8 +121,12 @@ class PCFilesPreviewer extends _react.default.Component {
|
|
|
107
121
|
});
|
|
108
122
|
};
|
|
109
123
|
this.onSelectAllFiles = () => {
|
|
110
|
-
const
|
|
111
|
-
|
|
124
|
+
const {
|
|
125
|
+
value
|
|
126
|
+
} = this.props;
|
|
127
|
+
const {
|
|
128
|
+
selectedFilesList
|
|
129
|
+
} = this.state;
|
|
112
130
|
if (value.length === 0) return;
|
|
113
131
|
let allFilesList = selectedFilesList.slice(0);
|
|
114
132
|
value.map(item => {
|
|
@@ -128,8 +146,12 @@ class PCFilesPreviewer extends _react.default.Component {
|
|
|
128
146
|
});
|
|
129
147
|
};
|
|
130
148
|
this.onDownloadAllSelectedFiles = () => {
|
|
131
|
-
const
|
|
132
|
-
|
|
149
|
+
const {
|
|
150
|
+
config
|
|
151
|
+
} = this.props;
|
|
152
|
+
const {
|
|
153
|
+
selectedFilesList
|
|
154
|
+
} = this.state;
|
|
133
155
|
if (selectedFilesList.length === 0) return;
|
|
134
156
|
this.props.getDownLoadFiles(selectedFilesList, downloadFilesUrlList => {
|
|
135
157
|
if (downloadFilesUrlList.length > 0) {
|
|
@@ -139,18 +161,22 @@ class PCFilesPreviewer extends _react.default.Component {
|
|
|
139
161
|
});
|
|
140
162
|
};
|
|
141
163
|
this.onDeleteAllSelectedFiles = () => {
|
|
142
|
-
const
|
|
164
|
+
const {
|
|
165
|
+
selectedFilesList
|
|
166
|
+
} = this.state;
|
|
143
167
|
this.props.deleteFiles(selectedFilesList);
|
|
144
168
|
this.onChangeSelectMultipleFiles(false);
|
|
145
169
|
};
|
|
146
170
|
this.renderFilesOperation = () => {
|
|
147
|
-
const
|
|
148
|
-
value
|
|
149
|
-
deleteFiles
|
|
150
|
-
getDownLoadFiles
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
171
|
+
const {
|
|
172
|
+
value,
|
|
173
|
+
deleteFiles,
|
|
174
|
+
getDownLoadFiles
|
|
175
|
+
} = this.props;
|
|
176
|
+
const {
|
|
177
|
+
isSelectMultipleFiles,
|
|
178
|
+
selectedFilesList
|
|
179
|
+
} = this.state;
|
|
154
180
|
if (value.length === 0) return null;
|
|
155
181
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
156
182
|
className: "dtable-ui-file-editor-operation-content",
|
|
@@ -199,12 +225,14 @@ class PCFilesPreviewer extends _react.default.Component {
|
|
|
199
225
|
}
|
|
200
226
|
}
|
|
201
227
|
render() {
|
|
202
|
-
let
|
|
203
|
-
value
|
|
204
|
-
getDownLoadFiles
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
228
|
+
let {
|
|
229
|
+
value,
|
|
230
|
+
getDownLoadFiles
|
|
231
|
+
} = this.props;
|
|
232
|
+
const {
|
|
233
|
+
isSelectMultipleFiles,
|
|
234
|
+
selectedFilesList
|
|
235
|
+
} = this.state;
|
|
208
236
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
209
237
|
className: "dtable-ui-file-editor-previewer",
|
|
210
238
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
package/lib/FileEditor/index.js
CHANGED
|
@@ -6,35 +6,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactResponsive = _interopRequireDefault(require("react-responsive"));
|
|
13
11
|
var _pcEditor = _interopRequireDefault(require("./pc-editor"));
|
|
14
12
|
var _mbEditor = _interopRequireDefault(require("./mb-editor"));
|
|
15
13
|
require("./index.css");
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["isMobile"];
|
|
18
15
|
const FileEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
let {
|
|
17
|
+
isMobile,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
20
|
+
if (isMobile === false) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
21
|
+
...props,
|
|
22
22
|
ref: ref
|
|
23
|
-
})
|
|
24
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
23
|
+
});
|
|
24
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
25
|
+
...props,
|
|
25
26
|
ref: ref
|
|
26
|
-
})
|
|
27
|
+
});
|
|
27
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
28
29
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
29
30
|
query: "(min-width: 768px)",
|
|
30
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default,
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcEditor.default, {
|
|
32
|
+
...props,
|
|
31
33
|
ref: ref
|
|
32
|
-
})
|
|
34
|
+
})
|
|
33
35
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactResponsive.default, {
|
|
34
36
|
query: "(max-width: 768px)",
|
|
35
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default,
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbEditor.default, {
|
|
38
|
+
...props,
|
|
36
39
|
ref: ref
|
|
37
|
-
})
|
|
40
|
+
})
|
|
38
41
|
})]
|
|
39
42
|
});
|
|
40
43
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _ActivityIndicator = _interopRequireDefault(require("../../ActivityIndicator"));
|
|
12
11
|
var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
|
|
@@ -17,35 +16,28 @@ var _utils = require("../../utils/utils");
|
|
|
17
16
|
var _lang = require("../../lang");
|
|
18
17
|
require("./index.css");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
const {
|
|
20
|
+
Header,
|
|
21
|
+
Body
|
|
22
|
+
} = _MobileFullScreenPage.default;
|
|
22
23
|
const MBFileEditor = _ref => {
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
isShowEditor = _useState4[0],
|
|
36
|
-
setShowEditor = _useState4[1];
|
|
37
|
-
const _useState5 = (0, _react.useState)([]),
|
|
38
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
39
|
-
uploadLocalFiles = _useState6[0],
|
|
40
|
-
setUploadLocalFiles = _useState6[1];
|
|
41
|
-
const _useState7 = (0, _react.useState)(false),
|
|
42
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
43
|
-
isUploading = _useState8[0],
|
|
44
|
-
setUploading = _useState8[1];
|
|
24
|
+
let {
|
|
25
|
+
value: oldValue,
|
|
26
|
+
column,
|
|
27
|
+
config,
|
|
28
|
+
onToggle,
|
|
29
|
+
onCommit,
|
|
30
|
+
uploadFile
|
|
31
|
+
} = _ref;
|
|
32
|
+
const [value, setValue] = (0, _react.useState)(oldValue || []);
|
|
33
|
+
const [isShowEditor, setShowEditor] = (0, _react.useState)(false);
|
|
34
|
+
const [uploadLocalFiles, setUploadLocalFiles] = (0, _react.useState)([]);
|
|
35
|
+
const [isUploading, setUploading] = (0, _react.useState)(false);
|
|
45
36
|
const uploadingFilesCount = (0, _react.useRef)(0);
|
|
46
37
|
const uploadedFilesCount = (0, _react.useRef)(0);
|
|
47
|
-
const
|
|
48
|
-
mediaUrl
|
|
38
|
+
const {
|
|
39
|
+
mediaUrl
|
|
40
|
+
} = config || {};
|
|
49
41
|
const resetFileValue = (0, _react.useCallback)(() => {
|
|
50
42
|
setUploadLocalFiles([]);
|
|
51
43
|
}, []);
|
|
@@ -25,7 +25,9 @@ class AdditionPreviewer extends _react.default.Component {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
let
|
|
28
|
+
let {
|
|
29
|
+
activeTab
|
|
30
|
+
} = this.state;
|
|
29
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
30
32
|
className: "dtable-ui-image-addition-container",
|
|
31
33
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -33,7 +35,7 @@ class AdditionPreviewer extends _react.default.Component {
|
|
|
33
35
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
34
36
|
className: "dtable-ui-image-addition-nav",
|
|
35
37
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
36
|
-
className:
|
|
38
|
+
className: `dtable-ui-addition-item ${activeTab === 'localFiles' ? 'dtable-ui-addition-item-selected' : ''}`,
|
|
37
39
|
onClick: this.toggle.bind(this, 'localFiles'),
|
|
38
40
|
children: (0, _lang.getLocale)('Local_Files')
|
|
39
41
|
})
|
|
@@ -36,7 +36,9 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
36
36
|
};
|
|
37
37
|
this.onFileUploadSuccess = fileMessage => {
|
|
38
38
|
this.hideDeleteIcon();
|
|
39
|
-
let
|
|
39
|
+
let {
|
|
40
|
+
thumbnailSrcList
|
|
41
|
+
} = this.state;
|
|
40
42
|
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
41
43
|
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
42
44
|
if (thumbnailSrcList.every(fileItem => !fileItem.isUploading)) {
|
|
@@ -47,7 +49,9 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
47
49
|
this.props.fileUploadCompleted(fileMessage);
|
|
48
50
|
};
|
|
49
51
|
this.onFileUploadProgress = fileMessage => {
|
|
50
|
-
let
|
|
52
|
+
let {
|
|
53
|
+
thumbnailSrcList
|
|
54
|
+
} = this.state;
|
|
51
55
|
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
52
56
|
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
53
57
|
this.setState({
|
|
@@ -55,7 +59,9 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
55
59
|
});
|
|
56
60
|
};
|
|
57
61
|
this.onFileUploadFailed = fileMessage => {
|
|
58
|
-
let
|
|
62
|
+
let {
|
|
63
|
+
thumbnailSrcList
|
|
64
|
+
} = this.state;
|
|
59
65
|
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
60
66
|
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
61
67
|
this.setState({
|
|
@@ -63,7 +69,9 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
63
69
|
});
|
|
64
70
|
};
|
|
65
71
|
this.findUploadFileIndex = uploadFileMessage => {
|
|
66
|
-
let
|
|
72
|
+
let {
|
|
73
|
+
thumbnailSrcList
|
|
74
|
+
} = this.state;
|
|
67
75
|
let uploadFileIndex = thumbnailSrcList.findIndex(item => item.name === uploadFileMessage.file.name);
|
|
68
76
|
return uploadFileIndex;
|
|
69
77
|
};
|
|
@@ -97,7 +105,9 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
97
105
|
});
|
|
98
106
|
};
|
|
99
107
|
this.renderMultipleFilesArr = () => {
|
|
100
|
-
let
|
|
108
|
+
let {
|
|
109
|
+
thumbnailSrcList
|
|
110
|
+
} = this.state;
|
|
101
111
|
let fileArr = [];
|
|
102
112
|
if (Array.isArray(this.props.uploadLocalFileValue)) {
|
|
103
113
|
let uploadedFileList = this.renderUploadedFile();
|
|
@@ -116,7 +126,7 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
116
126
|
src: fileThumbnailItem.fileIconUrl,
|
|
117
127
|
style: {
|
|
118
128
|
position: 'absolute',
|
|
119
|
-
zIndex:
|
|
129
|
+
zIndex: `${uploadFile ? 3 : 1}`,
|
|
120
130
|
maxHeight: '100%'
|
|
121
131
|
},
|
|
122
132
|
alt: ""
|
|
@@ -145,7 +155,7 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
145
155
|
})]
|
|
146
156
|
})
|
|
147
157
|
})
|
|
148
|
-
},
|
|
158
|
+
}, `dtable-ui-image-wrapper-circle${index}`);
|
|
149
159
|
});
|
|
150
160
|
fileArr.push(...thumbnailList);
|
|
151
161
|
}
|
|
@@ -153,16 +163,18 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
153
163
|
return fileArr;
|
|
154
164
|
};
|
|
155
165
|
this.renderUploadedFile = () => {
|
|
156
|
-
const
|
|
157
|
-
config
|
|
158
|
-
uploadLocalFileValue
|
|
166
|
+
const {
|
|
167
|
+
config,
|
|
168
|
+
uploadLocalFileValue
|
|
169
|
+
} = this.props;
|
|
159
170
|
let uploadedFileList = [];
|
|
160
171
|
uploadedFileList = uploadLocalFileValue.length > 0 && uploadLocalFileValue.map((fileItem, index) => {
|
|
161
|
-
let
|
|
162
|
-
fileIconUrl
|
|
172
|
+
let {
|
|
173
|
+
fileIconUrl
|
|
174
|
+
} = (0, _url.getFileThumbnailInfo)(fileItem, config);
|
|
163
175
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
164
176
|
className: "dtable-ui-image-wrapper",
|
|
165
|
-
id:
|
|
177
|
+
id: `file-content-tip-${index}`,
|
|
166
178
|
onMouseEnter: event => this.showDeleteIcon(event, index),
|
|
167
179
|
onMouseLeave: this.hideDeleteIcon,
|
|
168
180
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -182,7 +194,7 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
182
194
|
children: "x"
|
|
183
195
|
})
|
|
184
196
|
}), this.state.isShowDeleteIcon && this.state.enterFileIndex === index && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableToolTip.default, {
|
|
185
|
-
target:
|
|
197
|
+
target: `file-content-tip-${index}`,
|
|
186
198
|
placement: "bottom",
|
|
187
199
|
children: fileItem.name
|
|
188
200
|
})]
|
|
@@ -191,10 +203,12 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
191
203
|
return uploadedFileList;
|
|
192
204
|
};
|
|
193
205
|
this.renderUploadFileWrapper = fileArr => {
|
|
194
|
-
let
|
|
206
|
+
let {
|
|
207
|
+
isFileTipShow
|
|
208
|
+
} = this.state;
|
|
195
209
|
let editorContent = fileArr.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
196
210
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
197
|
-
className:
|
|
211
|
+
className: `dtable-ui-image-tip-addition ${isFileTipShow ? 'dtable-ui-image-drop-active' : ''}`,
|
|
198
212
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
199
213
|
className: "dtable-ui-dtable-ui-image-add-icon",
|
|
200
214
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
@@ -212,7 +226,7 @@ class LocalFileAddition extends _react.default.Component {
|
|
|
212
226
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
213
227
|
className: "dtable-ui-image-add-box",
|
|
214
228
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
215
|
-
className:
|
|
229
|
+
className: `dtable-ui-image-add-button ${isFileTipShow ? 'dtable-ui-image-wrapper-drop-active' : ''}`,
|
|
216
230
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
217
231
|
"aria-hidden": "true",
|
|
218
232
|
className: "dtable-font dtable-icon-add-table"
|