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
|
@@ -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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _reactstrap = require("reactstrap");
|
|
12
11
|
var _DTableCustomFooter = _interopRequireDefault(require("../../DTableCustomFooter"));
|
|
@@ -24,12 +23,14 @@ class PCDigitalSignEditor extends _react.Component {
|
|
|
24
23
|
super(props);
|
|
25
24
|
this.setPosition = () => {
|
|
26
25
|
if (!this.editor) return;
|
|
27
|
-
const
|
|
28
|
-
offsetLeft
|
|
29
|
-
offsetTop
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
const {
|
|
27
|
+
offsetLeft,
|
|
28
|
+
offsetTop
|
|
29
|
+
} = this.editor.parentNode;
|
|
30
|
+
const {
|
|
31
|
+
offsetWidth: editorWidth,
|
|
32
|
+
offsetHeight: editorHeight
|
|
33
|
+
} = this.editor;
|
|
33
34
|
let editorLeft = offsetLeft - editorWidth;
|
|
34
35
|
let editorTop = offsetTop;
|
|
35
36
|
if (this.props.isInModal) {
|
|
@@ -111,11 +112,14 @@ class PCDigitalSignEditor extends _react.Component {
|
|
|
111
112
|
editorPosition: {},
|
|
112
113
|
saving: false
|
|
113
114
|
};
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const {
|
|
116
|
+
uploadFile,
|
|
117
|
+
config,
|
|
118
|
+
value
|
|
119
|
+
} = props;
|
|
120
|
+
const {
|
|
121
|
+
username
|
|
122
|
+
} = config || {};
|
|
119
123
|
this.value = value || {};
|
|
120
124
|
this.digitalService = new _service.default({
|
|
121
125
|
uploadFile,
|
|
@@ -126,21 +130,25 @@ class PCDigitalSignEditor extends _react.Component {
|
|
|
126
130
|
this.setPosition();
|
|
127
131
|
}
|
|
128
132
|
render() {
|
|
129
|
-
const
|
|
130
|
-
value
|
|
131
|
-
config
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
const {
|
|
134
|
+
value,
|
|
135
|
+
config
|
|
136
|
+
} = this.props;
|
|
137
|
+
const {
|
|
138
|
+
editorPosition,
|
|
139
|
+
saving
|
|
140
|
+
} = this.state;
|
|
141
|
+
const signImageUrl = (0, _url.generateCurrentBaseImageUrl)({
|
|
142
|
+
...config,
|
|
136
143
|
partUrl: _utils.default.getSignImageUrl(value)
|
|
137
|
-
})
|
|
144
|
+
});
|
|
138
145
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
139
146
|
className: "dtable-ui-digital-sign-editor-container",
|
|
140
147
|
ref: ref => this.editor = ref,
|
|
141
|
-
style:
|
|
148
|
+
style: {
|
|
149
|
+
...editorPosition,
|
|
142
150
|
zIndex: 1000
|
|
143
|
-
}
|
|
151
|
+
},
|
|
144
152
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
145
153
|
className: "dtable-ui-digital-sign-editor-header",
|
|
146
154
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -16,10 +16,12 @@ class DigitalService {
|
|
|
16
16
|
this.username = props.username;
|
|
17
17
|
}
|
|
18
18
|
uploadSignImage(signBlob, _ref) {
|
|
19
|
-
let
|
|
20
|
-
|
|
19
|
+
let {
|
|
20
|
+
successCallback,
|
|
21
|
+
failedCallback
|
|
22
|
+
} = _ref;
|
|
21
23
|
if (!this.uploadFile) return;
|
|
22
|
-
const name =
|
|
24
|
+
const name = `${this.username}-${Date.now().toString()}.png`;
|
|
23
25
|
const file = new File([signBlob], name, {
|
|
24
26
|
type: 'image/png'
|
|
25
27
|
});
|
|
@@ -18,8 +18,8 @@ class SignatureBoard extends _react.Component {
|
|
|
18
18
|
this.initSignTool = () => {
|
|
19
19
|
let signatureBoardCanvas = document.querySelector('#signature_board_canvas');
|
|
20
20
|
if (!this.signatureBoard || !signatureBoardCanvas) return;
|
|
21
|
-
signatureBoardCanvas.style.width =
|
|
22
|
-
signatureBoardCanvas.style.height =
|
|
21
|
+
signatureBoardCanvas.style.width = `${this.signatureBoard.offsetWidth}px`;
|
|
22
|
+
signatureBoardCanvas.style.height = `${this.signatureBoard.offsetHeight}px`;
|
|
23
23
|
this.signatureTool = new _signatureTool.default(signatureBoardCanvas, {
|
|
24
24
|
minLineWidth: 2,
|
|
25
25
|
maxLineWidth: 4,
|
|
@@ -72,7 +72,9 @@ class SignatureBoard extends _react.Component {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
this.renderTips = () => {
|
|
75
|
-
const
|
|
75
|
+
const {
|
|
76
|
+
isEmpty
|
|
77
|
+
} = this.state;
|
|
76
78
|
if (!isEmpty) return null;
|
|
77
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
80
|
className: "signature-board-tips",
|
|
@@ -80,10 +82,11 @@ class SignatureBoard extends _react.Component {
|
|
|
80
82
|
});
|
|
81
83
|
};
|
|
82
84
|
this.renderSignImage = () => {
|
|
83
|
-
const
|
|
84
|
-
isEmpty
|
|
85
|
-
signImageUrl
|
|
86
|
-
loadingSignImage
|
|
85
|
+
const {
|
|
86
|
+
isEmpty,
|
|
87
|
+
signImageUrl,
|
|
88
|
+
loadingSignImage
|
|
89
|
+
} = this.state;
|
|
87
90
|
if (isEmpty || !signImageUrl) return null;
|
|
88
91
|
let img = new Image();
|
|
89
92
|
img.src = signImageUrl;
|
|
@@ -14,8 +14,10 @@ class DigitalSignUtils {
|
|
|
14
14
|
return (0, _dtableUtils.getDigitalSignImageUrl)(sign);
|
|
15
15
|
}
|
|
16
16
|
static getUpdatedSign(_ref) {
|
|
17
|
-
let
|
|
18
|
-
|
|
17
|
+
let {
|
|
18
|
+
username,
|
|
19
|
+
sign_image_url
|
|
20
|
+
} = _ref;
|
|
19
21
|
const time = (0, _dayjs.default)().utc().format('YYYY-MM-DDTHH:mm:ss.SSSZ');
|
|
20
22
|
return {
|
|
21
23
|
username,
|
|
@@ -18,9 +18,10 @@ class DigitalSignFormatter extends _react.Component {
|
|
|
18
18
|
constructor(props) {
|
|
19
19
|
super(props);
|
|
20
20
|
this.getSignImages = () => {
|
|
21
|
-
const
|
|
22
|
-
value
|
|
23
|
-
config
|
|
21
|
+
const {
|
|
22
|
+
value,
|
|
23
|
+
config
|
|
24
|
+
} = this.props;
|
|
24
25
|
return [(0, _utils.getDigitalSignImageUrl)(value, config)].filter(Boolean);
|
|
25
26
|
};
|
|
26
27
|
this.onClickSignImage = index => {
|
|
@@ -56,18 +57,20 @@ class DigitalSignFormatter extends _react.Component {
|
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
59
|
render() {
|
|
59
|
-
const
|
|
60
|
-
containerClassName
|
|
61
|
-
readOnly
|
|
62
|
-
config
|
|
63
|
-
isSample
|
|
64
|
-
renderItem
|
|
60
|
+
const {
|
|
61
|
+
containerClassName,
|
|
62
|
+
readOnly,
|
|
63
|
+
config,
|
|
64
|
+
isSample,
|
|
65
|
+
renderItem
|
|
66
|
+
} = this.props;
|
|
65
67
|
const className = (0, _classnames.default)('dtable-ui cell-formatter-container digital-sign-formatter', containerClassName);
|
|
66
68
|
const signImages = this.getSignImages();
|
|
67
69
|
if (signImages.length === 0) return null;
|
|
68
|
-
const
|
|
69
|
-
isPreviewSignImage
|
|
70
|
-
largeSignImageIndex
|
|
70
|
+
const {
|
|
71
|
+
isPreviewSignImage,
|
|
72
|
+
largeSignImageIndex
|
|
73
|
+
} = this.state;
|
|
71
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
72
75
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
73
76
|
className: className,
|
|
@@ -9,12 +9,13 @@ const getDigitalSignImageUrl = (cellValue, config) => {
|
|
|
9
9
|
const url = cellValue && cellValue.sign_image_url || '';
|
|
10
10
|
if (!url) return '';
|
|
11
11
|
if (!config) return url;
|
|
12
|
-
const
|
|
13
|
-
server
|
|
14
|
-
workspaceID
|
|
15
|
-
dtableUuid
|
|
12
|
+
const {
|
|
13
|
+
server,
|
|
14
|
+
workspaceID,
|
|
15
|
+
dtableUuid
|
|
16
|
+
} = config || {};
|
|
16
17
|
if (server && (workspaceID || workspaceID === 0) && dtableUuid) {
|
|
17
|
-
return
|
|
18
|
+
return `${server}/workspace/${workspaceID}/asset/${dtableUuid}${url}`;
|
|
18
19
|
}
|
|
19
20
|
return url;
|
|
20
21
|
};
|
package/lib/Drawer/index.js
CHANGED
|
@@ -6,14 +6,15 @@ 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
9
|
var _rmcDrawer = _interopRequireDefault(require("rmc-drawer"));
|
|
11
10
|
var React = _interopRequireWildcard(require("react"));
|
|
12
11
|
require("./index.css");
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
13
|
class Drawer extends React.Component {
|
|
15
14
|
render() {
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcDrawer.default,
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcDrawer.default, {
|
|
16
|
+
...this.props
|
|
17
|
+
});
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
exports.default = Drawer;
|
|
@@ -23,10 +23,11 @@ class DurationEditor extends _react.default.Component {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
this.onKeyDown = event => {
|
|
26
|
-
let
|
|
27
|
-
selectionStart
|
|
28
|
-
selectionEnd
|
|
29
|
-
value
|
|
26
|
+
let {
|
|
27
|
+
selectionStart,
|
|
28
|
+
selectionEnd,
|
|
29
|
+
value
|
|
30
|
+
} = event.currentTarget;
|
|
30
31
|
if (event.keyCode === _constants.KeyCodes.Enter) {
|
|
31
32
|
event.preventDefault();
|
|
32
33
|
this.onBlur();
|
|
@@ -36,7 +37,9 @@ class DurationEditor extends _react.default.Component {
|
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
39
|
this.getValue = () => {
|
|
39
|
-
const
|
|
40
|
+
const {
|
|
41
|
+
column
|
|
42
|
+
} = this.props;
|
|
40
43
|
const newDuration = (0, _dtableUtils.formatDurationToNumber)(this.getInputNode().value, column.data);
|
|
41
44
|
return newDuration;
|
|
42
45
|
};
|
|
@@ -48,10 +51,11 @@ class DurationEditor extends _react.default.Component {
|
|
|
48
51
|
return this.input.querySelector('input:not([type=hidden])');
|
|
49
52
|
};
|
|
50
53
|
this.onBlur = () => {
|
|
51
|
-
const
|
|
52
|
-
isInModal
|
|
53
|
-
onBlur
|
|
54
|
-
onCommit
|
|
54
|
+
const {
|
|
55
|
+
isInModal,
|
|
56
|
+
onBlur,
|
|
57
|
+
onCommit
|
|
58
|
+
} = this.props;
|
|
55
59
|
isInModal ? onCommit(this.getValue()) : onBlur();
|
|
56
60
|
};
|
|
57
61
|
this.setInputRef = input => {
|
|
@@ -64,30 +68,36 @@ class DurationEditor extends _react.default.Component {
|
|
|
64
68
|
this.onCut = e => {
|
|
65
69
|
e.stopPropagation();
|
|
66
70
|
};
|
|
67
|
-
let
|
|
68
|
-
|
|
71
|
+
let {
|
|
72
|
+
value: _value,
|
|
73
|
+
column: _column
|
|
74
|
+
} = props;
|
|
69
75
|
this.initValue = _value || _value === 0 ? (0, _dtableUtils.getDurationDisplayString)(_value, _column.data) : '';
|
|
70
76
|
this.state = {
|
|
71
77
|
value: this.initValue
|
|
72
78
|
};
|
|
73
79
|
}
|
|
74
80
|
componentDidMount() {
|
|
75
|
-
const
|
|
76
|
-
isInModal
|
|
77
|
-
autoFocus
|
|
78
|
-
readOnly
|
|
81
|
+
const {
|
|
82
|
+
isInModal,
|
|
83
|
+
autoFocus,
|
|
84
|
+
readOnly
|
|
85
|
+
} = this.props;
|
|
79
86
|
if (isInModal && autoFocus && !readOnly) {
|
|
80
87
|
this.input.focus();
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
render() {
|
|
84
|
-
const
|
|
85
|
-
column
|
|
86
|
-
isInModal
|
|
87
|
-
className
|
|
88
|
-
readOnly
|
|
91
|
+
const {
|
|
92
|
+
column,
|
|
93
|
+
isInModal,
|
|
94
|
+
className,
|
|
95
|
+
readOnly
|
|
96
|
+
} = this.props;
|
|
89
97
|
const data = column.data || {};
|
|
90
|
-
const
|
|
98
|
+
const {
|
|
99
|
+
duration_format
|
|
100
|
+
} = data;
|
|
91
101
|
const style = isInModal ? {
|
|
92
102
|
textAlign: 'left',
|
|
93
103
|
width: '320px'
|
|
@@ -12,10 +12,11 @@ require("./index.css");
|
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
class DurationFormatter extends _react.default.Component {
|
|
14
14
|
render() {
|
|
15
|
-
let
|
|
16
|
-
value
|
|
17
|
-
containerClassName
|
|
18
|
-
format
|
|
15
|
+
let {
|
|
16
|
+
value,
|
|
17
|
+
containerClassName,
|
|
18
|
+
format
|
|
19
|
+
} = this.props;
|
|
19
20
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container duration-formatter', containerClassName);
|
|
20
21
|
const durationDisplayString = (0, _dtableUtils.getDurationDisplayString)(value, {
|
|
21
22
|
duration_format: format
|
|
@@ -10,7 +10,9 @@ require("./index.css");
|
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
class EditEditorButton extends _react.default.Component {
|
|
12
12
|
render() {
|
|
13
|
-
const
|
|
13
|
+
const {
|
|
14
|
+
text
|
|
15
|
+
} = this.props;
|
|
14
16
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
15
17
|
className: "dtable-ui-editor-button",
|
|
16
18
|
onClick: this.props.onClick,
|
|
@@ -11,9 +11,10 @@ require("./index.css");
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
class EmailFormatter extends _react.default.Component {
|
|
13
13
|
render() {
|
|
14
|
-
const
|
|
15
|
-
containerClassName
|
|
16
|
-
value
|
|
14
|
+
const {
|
|
15
|
+
containerClassName,
|
|
16
|
+
value
|
|
17
|
+
} = this.props;
|
|
17
18
|
let classname = (0, _classnames.default)('dtable-ui cell-formatter-container email-formatter', containerClassName);
|
|
18
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
20
|
title: value,
|
|
@@ -1,27 +1,25 @@
|
|
|
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 _DTableSwitch = _interopRequireDefault(require("../DTableSwitch"));
|
|
12
11
|
var _DTableColumnIcon = _interopRequireDefault(require("../DTableColumnIcon"));
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
13
|
function FieldItem(_ref) {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
let {
|
|
15
|
+
field,
|
|
16
|
+
isCollapsed,
|
|
17
|
+
onClickField,
|
|
18
|
+
onMoveField
|
|
19
|
+
} = _ref;
|
|
19
20
|
let enteredCounter = 0;
|
|
20
21
|
const fieldItemRef = (0, _react.useRef)(null);
|
|
21
|
-
const
|
|
22
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
23
|
-
isItemDropTipShow = _useState2[0],
|
|
24
|
-
setDropTipShow = _useState2[1];
|
|
22
|
+
const [isItemDropTipShow, setDropTipShow] = (0, _react.useState)(false);
|
|
25
23
|
const handleClickField = e => {
|
|
26
24
|
e.nativeEvent.stopImmediatePropagation();
|
|
27
25
|
const value = e.target.checked;
|
|
@@ -65,8 +63,10 @@ function FieldItem(_ref) {
|
|
|
65
63
|
onMoveField(droppedColumnKey, field.key);
|
|
66
64
|
};
|
|
67
65
|
const placeholder = () => {
|
|
68
|
-
const
|
|
69
|
-
|
|
66
|
+
const {
|
|
67
|
+
type,
|
|
68
|
+
data
|
|
69
|
+
} = field;
|
|
70
70
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
71
71
|
className: "field-switch",
|
|
72
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableColumnIcon.default, {
|
|
@@ -81,7 +81,7 @@ function FieldItem(_ref) {
|
|
|
81
81
|
};
|
|
82
82
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
83
83
|
ref: fieldItemRef,
|
|
84
|
-
className:
|
|
84
|
+
className: `field-item-container ${isCollapsed ? 'd-none' : ''}`,
|
|
85
85
|
onDrop: onDrop,
|
|
86
86
|
onDragEnter: onTableDragEnter,
|
|
87
87
|
onDragOver: onDragOver,
|
|
@@ -1,13 +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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
11
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _reactstrap = require("reactstrap");
|
|
13
11
|
var _reactTransitionGroup = require("react-transition-group");
|
|
@@ -18,32 +16,31 @@ const FIELD_ITEM_HEIGHT = 30;
|
|
|
18
16
|
const BANNER_HEIGHT = 24;
|
|
19
17
|
const DURATION = 300;
|
|
20
18
|
function FieldDisplaySetting(_ref) {
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
let {
|
|
20
|
+
fields,
|
|
21
|
+
textProperties,
|
|
22
|
+
fieldAllShown,
|
|
23
|
+
onClickField,
|
|
24
|
+
onMoveField,
|
|
25
|
+
onToggleFieldsVisibility
|
|
26
|
+
} = _ref;
|
|
27
27
|
const nodeRef = (0, _react.useRef)(null);
|
|
28
|
-
const
|
|
29
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
|
-
isCollapsed = _useState2[0],
|
|
31
|
-
setCollapsed = _useState2[1];
|
|
28
|
+
const [isCollapsed, setCollapsed] = (0, _react.useState)(true);
|
|
32
29
|
const expandAllFields = () => {
|
|
33
30
|
setCollapsed(!isCollapsed);
|
|
34
31
|
};
|
|
35
32
|
const defaultStyle = {
|
|
36
|
-
transition:
|
|
33
|
+
transition: `all ${DURATION}ms cubic-bezier(.645,.045,.355,1)`,
|
|
37
34
|
opacity: 0
|
|
38
35
|
};
|
|
39
36
|
const transitionStyles = {
|
|
40
37
|
entering: {
|
|
41
38
|
opacity: 1,
|
|
42
|
-
height:
|
|
39
|
+
height: `${fields.length * FIELD_ITEM_HEIGHT + BANNER_HEIGHT}px`
|
|
43
40
|
},
|
|
44
41
|
entered: {
|
|
45
42
|
opacity: 1,
|
|
46
|
-
height:
|
|
43
|
+
height: `${fields.length * FIELD_ITEM_HEIGHT + BANNER_HEIGHT}px`
|
|
47
44
|
},
|
|
48
45
|
exiting: {
|
|
49
46
|
opacity: 0,
|
|
@@ -63,7 +60,7 @@ function FieldDisplaySetting(_ref) {
|
|
|
63
60
|
className: "mb-0",
|
|
64
61
|
children: textProperties.titleValue
|
|
65
62
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
66
|
-
className:
|
|
63
|
+
className: `seatable-icon-btn dtable-font dtable-icon-right expand-button ${isCollapsed ? '' : 'revolving'}`
|
|
67
64
|
})]
|
|
68
65
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.Transition, {
|
|
69
66
|
nodeRef: nodeRef,
|
|
@@ -72,9 +69,12 @@ function FieldDisplaySetting(_ref) {
|
|
|
72
69
|
children: state => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
73
70
|
className: "field-setting-wrapper",
|
|
74
71
|
ref: nodeRef,
|
|
75
|
-
style:
|
|
72
|
+
style: {
|
|
73
|
+
...defaultStyle,
|
|
74
|
+
...transitionStyles[state]
|
|
75
|
+
},
|
|
76
76
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
77
|
-
className:
|
|
77
|
+
className: `field-setting-banner ${isCollapsed ? 'd-none' : 'd-flex'} align-items-center justify-content-between h-5 mt-2 mb-2`,
|
|
78
78
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Label, {
|
|
79
79
|
className: "mb-0",
|
|
80
80
|
children: textProperties.bannerValue
|
|
@@ -91,7 +91,7 @@ function FieldDisplaySetting(_ref) {
|
|
|
91
91
|
isCollapsed: isCollapsed,
|
|
92
92
|
onClickField: onClickField,
|
|
93
93
|
onMoveField: onMoveField
|
|
94
|
-
},
|
|
94
|
+
}, `${field.key}-${index}`);
|
|
95
95
|
})
|
|
96
96
|
})]
|
|
97
97
|
})
|
|
@@ -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 _pcPreviewer = _interopRequireDefault(require("./pc-previewer"));
|
|
14
12
|
var _mbPreviewer = _interopRequireDefault(require("./mb-previewer"));
|
|
15
13
|
require("./index.css");
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["isMobile"];
|
|
18
15
|
const FilesPreviewer = /*#__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)(_pcPreviewer.default, {
|
|
21
|
+
...props,
|
|
22
22
|
ref: ref
|
|
23
|
-
})
|
|
24
|
-
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbPreviewer.default,
|
|
23
|
+
});
|
|
24
|
+
if (isMobile === true) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbPreviewer.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)(_pcPreviewer.default,
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pcPreviewer.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)(_mbPreviewer.default,
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mbPreviewer.default, {
|
|
38
|
+
...props,
|
|
36
39
|
ref: ref
|
|
37
|
-
})
|
|
40
|
+
})
|
|
38
41
|
})]
|
|
39
42
|
});
|
|
40
43
|
});
|
|
@@ -19,7 +19,9 @@ class FilePreviewer extends _react.default.Component {
|
|
|
19
19
|
this.props.downloadFile(downloadUrl);
|
|
20
20
|
};
|
|
21
21
|
this.deleteFile = () => {
|
|
22
|
-
const
|
|
22
|
+
const {
|
|
23
|
+
fileItem
|
|
24
|
+
} = this.props;
|
|
23
25
|
this.props.deleteFile(fileItem);
|
|
24
26
|
};
|
|
25
27
|
this.closeRenameFile = () => {
|
|
@@ -61,9 +63,11 @@ class FilePreviewer extends _react.default.Component {
|
|
|
61
63
|
showOperationSheet: false
|
|
62
64
|
};
|
|
63
65
|
this.operations = [];
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
const {
|
|
67
|
+
renameFile,
|
|
68
|
+
downloadFile,
|
|
69
|
+
deleteFile
|
|
70
|
+
} = props;
|
|
67
71
|
if (renameFile) {
|
|
68
72
|
this.operations.push(_MobileOperationSheet.OPERATION_TYPE.RENAME);
|
|
69
73
|
}
|
|
@@ -75,12 +79,16 @@ class FilePreviewer extends _react.default.Component {
|
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
render() {
|
|
78
|
-
const
|
|
79
|
-
fileItem
|
|
80
|
-
config
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const {
|
|
83
|
+
fileItem,
|
|
84
|
+
config
|
|
85
|
+
} = this.props;
|
|
86
|
+
const {
|
|
87
|
+
showOperationSheet
|
|
88
|
+
} = this.state;
|
|
89
|
+
const {
|
|
90
|
+
fileIconUrl
|
|
91
|
+
} = (0, _url.getFileThumbnailInfo)(fileItem, config);
|
|
84
92
|
const uploadTime = (0, _utils.getFileUploadTime)(fileItem);
|
|
85
93
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
86
94
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -96,7 +104,7 @@ class FilePreviewer extends _react.default.Component {
|
|
|
96
104
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
97
105
|
className: "dtable-ui-file-editor-previewer-info",
|
|
98
106
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
99
|
-
className:
|
|
107
|
+
className: `dtable-ui-file-editor-previewer-item-name ${fileItem.type === 'dir' ? 'dtable-ui-file-editor-previewer-item-name-height' : ''}`,
|
|
100
108
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
101
109
|
children: fileItem.name
|
|
102
110
|
})
|
|
@@ -104,7 +112,7 @@ class FilePreviewer extends _react.default.Component {
|
|
|
104
112
|
className: "dtable-ui-file-editor-preview-item-detail d-flex",
|
|
105
113
|
children: [uploadTime && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
106
114
|
className: "file-upload-time",
|
|
107
|
-
children:
|
|
115
|
+
children: `${uploadTime}, `
|
|
108
116
|
}), fileItem.size > -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
109
117
|
children: (0, _utils.bytesToSize)(fileItem.size)
|
|
110
118
|
})]
|