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
|
@@ -12,10 +12,11 @@ require("./index.css");
|
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
class GeolocationFormatter extends _react.default.Component {
|
|
14
14
|
render() {
|
|
15
|
-
let
|
|
16
|
-
value
|
|
17
|
-
data
|
|
18
|
-
containerClassName
|
|
15
|
+
let {
|
|
16
|
+
value,
|
|
17
|
+
data,
|
|
18
|
+
containerClassName
|
|
19
|
+
} = this.props;
|
|
19
20
|
let className = (0, _classnames.default)('dtable-ui cell-formatter-container geolocation-formatter', containerClassName);
|
|
20
21
|
if (typeof value !== 'object') {
|
|
21
22
|
return null;
|
|
@@ -15,7 +15,9 @@ class HtmlLongTextFormatter extends _react.Component {
|
|
|
15
15
|
constructor(_props) {
|
|
16
16
|
super(_props);
|
|
17
17
|
this.translateValue = props => {
|
|
18
|
-
const
|
|
18
|
+
const {
|
|
19
|
+
value
|
|
20
|
+
} = props;
|
|
19
21
|
if (!value) {
|
|
20
22
|
this.setState({
|
|
21
23
|
innerHtml: null
|
|
@@ -49,18 +51,24 @@ class HtmlLongTextFormatter extends _react.Component {
|
|
|
49
51
|
this.translateValue(this.props);
|
|
50
52
|
}
|
|
51
53
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
52
|
-
const
|
|
54
|
+
const {
|
|
55
|
+
value
|
|
56
|
+
} = this.props;
|
|
53
57
|
if (nextProps.value !== value) {
|
|
54
58
|
this.translateValue(nextProps);
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
render() {
|
|
58
|
-
const
|
|
59
|
-
|
|
62
|
+
const {
|
|
63
|
+
innerHtml
|
|
64
|
+
} = this.state;
|
|
65
|
+
const {
|
|
66
|
+
containerClassName
|
|
67
|
+
} = this.props;
|
|
60
68
|
const className = (0, _classnames.default)('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
61
69
|
if (!innerHtml) return null;
|
|
62
70
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
63
|
-
className:
|
|
71
|
+
className: `${className} article`,
|
|
64
72
|
dangerouslySetInnerHTML: {
|
|
65
73
|
__html: innerHtml
|
|
66
74
|
}
|
package/lib/Icon/index.js
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
10
|
var React = _interopRequireWildcard(require("react"));
|
|
13
11
|
var _loadSprite = _interopRequireDefault(require("./load-sprite"));
|
|
14
12
|
require("./index.css");
|
|
15
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["type", "className", "size"];
|
|
17
14
|
class Icon extends React.Component {
|
|
18
15
|
componentDidMount() {
|
|
19
16
|
(0, _loadSprite.default)();
|
|
20
17
|
}
|
|
21
18
|
render() {
|
|
22
|
-
const
|
|
23
|
-
type
|
|
24
|
-
className
|
|
25
|
-
size
|
|
26
|
-
restProps
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
const {
|
|
20
|
+
type,
|
|
21
|
+
className,
|
|
22
|
+
size,
|
|
23
|
+
...restProps
|
|
24
|
+
} = this.props;
|
|
25
|
+
const cls = (0, _classnames.default)(className, 'am-icon', `am-icon-${type}`, `am-icon-${size}`);
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
27
|
+
className: cls,
|
|
28
|
+
...restProps,
|
|
31
29
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("use", {
|
|
32
|
-
xlinkHref:
|
|
30
|
+
xlinkHref: `#${type}`
|
|
33
31
|
})
|
|
34
|
-
})
|
|
32
|
+
});
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
exports.default = Icon;
|
package/lib/Icon/load-sprite.js
CHANGED
|
@@ -7,7 +7,18 @@ exports.default = void 0;
|
|
|
7
7
|
/* tslint:disable:max-line-length */
|
|
8
8
|
// inspried by https://github.com/kisenka/svg-sprite-loader/blob/master/runtime/browser-sprite.js
|
|
9
9
|
// Much simplified, do make sure run this after document ready
|
|
10
|
-
const svgSprite = contents =>
|
|
10
|
+
const svgSprite = contents => `
|
|
11
|
+
<svg
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
14
|
+
id="__ANTD_MOBILE_SVG_SPRITE_NODE__"
|
|
15
|
+
style="display:none;overflow:hidden;width:0;height:0"
|
|
16
|
+
>
|
|
17
|
+
<defs>
|
|
18
|
+
${contents}
|
|
19
|
+
</defs>
|
|
20
|
+
</svg>
|
|
21
|
+
`;
|
|
11
22
|
|
|
12
23
|
// both minified by https://github.com/svg/svgo
|
|
13
24
|
const icons = {
|
|
@@ -39,7 +50,7 @@ const icons = {
|
|
|
39
50
|
const renderSvgSprite = () => {
|
|
40
51
|
const symbols = Object.keys(icons).map(iconName => {
|
|
41
52
|
const svgContent = icons[iconName].split('svg')[1];
|
|
42
|
-
return
|
|
53
|
+
return `<symbol id=${iconName}${svgContent}symbol>`;
|
|
43
54
|
}).join('');
|
|
44
55
|
return svgSprite(symbols);
|
|
45
56
|
};
|
package/lib/IconButton/index.js
CHANGED
|
@@ -5,28 +5,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
10
|
require("./index.css");
|
|
13
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
const _excluded = ["disabled", "className", "icon", "children"];
|
|
15
12
|
const IconButton = _ref => {
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
let {
|
|
14
|
+
disabled,
|
|
15
|
+
className,
|
|
16
|
+
icon,
|
|
17
|
+
children,
|
|
18
|
+
...otherProperties
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
22
21
|
className: (0, _classnames.default)('seatable-icon-btn icon-button', className, {
|
|
23
22
|
'disabled': disabled
|
|
24
|
-
})
|
|
25
|
-
|
|
23
|
+
}),
|
|
24
|
+
...otherProperties,
|
|
26
25
|
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
27
|
-
className: (0, _classnames.default)('seatable-icon dtable-font',
|
|
26
|
+
className: (0, _classnames.default)('seatable-icon dtable-font', `dtable-icon-${icon}`),
|
|
28
27
|
"aria-hidden": "true"
|
|
29
28
|
}), children]
|
|
30
|
-
})
|
|
29
|
+
});
|
|
31
30
|
};
|
|
32
31
|
var _default = exports.default = IconButton;
|
|
@@ -19,11 +19,15 @@ class ImagePreviewer extends _react.default.Component {
|
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
21
21
|
this.showLargeImage = () => {
|
|
22
|
-
let
|
|
22
|
+
let {
|
|
23
|
+
imageItemUrl
|
|
24
|
+
} = this.props;
|
|
23
25
|
this.props.showLargeImage(imageItemUrl);
|
|
24
26
|
};
|
|
25
27
|
this.showImageToolbar = () => {
|
|
26
|
-
let
|
|
28
|
+
let {
|
|
29
|
+
itemIndex
|
|
30
|
+
} = this.props;
|
|
27
31
|
this.props.setImageItemIndex(itemIndex);
|
|
28
32
|
};
|
|
29
33
|
this.hideImageToolbar = () => {
|
|
@@ -35,7 +39,9 @@ class ImagePreviewer extends _react.default.Component {
|
|
|
35
39
|
};
|
|
36
40
|
this.deleteImage = e => {
|
|
37
41
|
e.stopPropagation();
|
|
38
|
-
let
|
|
42
|
+
let {
|
|
43
|
+
itemIndex
|
|
44
|
+
} = this.props;
|
|
39
45
|
this.props.deleteImage(itemIndex, _constants.FILE_EDITOR_STATUS.PREVIEWER);
|
|
40
46
|
};
|
|
41
47
|
this.onClickDelete = e => {
|
|
@@ -85,15 +91,17 @@ class ImagePreviewer extends _react.default.Component {
|
|
|
85
91
|
const offsetWidth = document.body.offsetWidth;
|
|
86
92
|
this.containerSize = offsetWidth < 768 ? (offsetWidth - 55) / 2 + 'px' : (offsetWidth - 80) / 3 + 'px';
|
|
87
93
|
this.position = {};
|
|
88
|
-
const
|
|
89
|
-
mediaUrl
|
|
90
|
-
|
|
94
|
+
const {
|
|
95
|
+
mediaUrl
|
|
96
|
+
} = props.config || {};
|
|
97
|
+
this.imageLoadingFailedUrl = `${mediaUrl}img/image-loading-failed.png`;
|
|
91
98
|
this.ref = null;
|
|
92
99
|
}
|
|
93
100
|
componentDidMount() {
|
|
94
|
-
let
|
|
95
|
-
imageItemUrl
|
|
96
|
-
config
|
|
101
|
+
let {
|
|
102
|
+
imageItemUrl,
|
|
103
|
+
config
|
|
104
|
+
} = this.props;
|
|
97
105
|
if ((0, _url.checkSVGImage)(imageItemUrl)) {
|
|
98
106
|
this.setState({
|
|
99
107
|
imageThumbnailUrl: imageItemUrl
|
|
@@ -112,10 +120,11 @@ class ImagePreviewer extends _react.default.Component {
|
|
|
112
120
|
});
|
|
113
121
|
}
|
|
114
122
|
render() {
|
|
115
|
-
const
|
|
116
|
-
enterImageItemIndex
|
|
117
|
-
itemIndex
|
|
118
|
-
imageItemUrl
|
|
123
|
+
const {
|
|
124
|
+
enterImageItemIndex,
|
|
125
|
+
itemIndex,
|
|
126
|
+
imageItemUrl
|
|
127
|
+
} = this.props;
|
|
119
128
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
120
129
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
121
130
|
style: _constants.isMobile ? {
|
|
@@ -26,7 +26,9 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
this.showLargeImage = itemUrl => {
|
|
29
|
-
let
|
|
29
|
+
let {
|
|
30
|
+
value
|
|
31
|
+
} = this.props;
|
|
30
32
|
this.setState({
|
|
31
33
|
isShowLargeImage: true,
|
|
32
34
|
largeImageIndex: value.indexOf(itemUrl)
|
|
@@ -56,7 +58,9 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
56
58
|
};
|
|
57
59
|
this.deleteImage = (index, type) => {
|
|
58
60
|
this.props.deleteImage(index, type);
|
|
59
|
-
const
|
|
61
|
+
const {
|
|
62
|
+
value
|
|
63
|
+
} = this.props;
|
|
60
64
|
if (index > value.length - 2) {
|
|
61
65
|
if (value.length - 2 < 0) {
|
|
62
66
|
this.hideLargeImage();
|
|
@@ -99,7 +103,9 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
render() {
|
|
102
|
-
let
|
|
106
|
+
let {
|
|
107
|
+
value
|
|
108
|
+
} = this.props;
|
|
103
109
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
104
110
|
className: (0, _classnames.default)('dtable-ui-image-previewer-container', {
|
|
105
111
|
'mt-0': value.length === 0 && _constants.isMobile
|
package/lib/ImageEditor/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 ImageEditor = /*#__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 MBImageEditor = _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
|
-
uploadLocalImages = _useState6[0],
|
|
40
|
-
setUploadLocalImages = _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 [uploadLocalImages, setUploadLocalImages] = (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 resetAdditionImage = (0, _react.useCallback)(() => {
|
|
50
42
|
setUploadLocalImages([]);
|
|
51
43
|
}, []);
|
|
@@ -14,7 +14,9 @@ class ImageLink extends _react.default.Component {
|
|
|
14
14
|
constructor(props) {
|
|
15
15
|
super(props);
|
|
16
16
|
this.saveImageLink = () => {
|
|
17
|
-
let
|
|
17
|
+
let {
|
|
18
|
+
imageLink
|
|
19
|
+
} = this.state;
|
|
18
20
|
let _this = this;
|
|
19
21
|
let image = new Image();
|
|
20
22
|
image.onload = function () {
|
|
@@ -48,7 +50,9 @@ class ImageLink extends _react.default.Component {
|
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
render() {
|
|
51
|
-
const
|
|
53
|
+
const {
|
|
54
|
+
isShowErrorMessage
|
|
55
|
+
} = this.state;
|
|
52
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
53
57
|
className: "dtable-ui-image-link",
|
|
54
58
|
onKeyDown: this.onKeyDown,
|
|
@@ -32,7 +32,9 @@ class AdditionPreviewer extends _react.default.Component {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
const
|
|
35
|
+
const {
|
|
36
|
+
activeTab
|
|
37
|
+
} = this.state;
|
|
36
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
37
39
|
className: "dtable-ui-image-addition-container",
|
|
38
40
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -40,11 +42,11 @@ class AdditionPreviewer extends _react.default.Component {
|
|
|
40
42
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
41
43
|
className: "dtable-ui-image-addition-nav",
|
|
42
44
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
43
|
-
className:
|
|
45
|
+
className: `dtable-ui-addition-item ${activeTab === 'localPicture' ? 'dtable-ui-addition-item-selected' : ''}`,
|
|
44
46
|
onClick: this.toggle.bind(this, 'localPicture'),
|
|
45
47
|
children: (0, _lang.getLocale)('Local_Images')
|
|
46
48
|
}), this.props.saveImageLink && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
|
-
className:
|
|
49
|
+
className: `dtable-ui-addition-item ${activeTab === 'imageLink' ? 'dtable-ui-addition-item-selected' : ''}`,
|
|
48
50
|
onClick: this.toggle.bind(this, 'imageLink'),
|
|
49
51
|
children: (0, _lang.getLocale)('Image_Link')
|
|
50
52
|
})]
|
|
@@ -41,7 +41,9 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
41
41
|
};
|
|
42
42
|
this.onFileUploadSuccess = fileMessage => {
|
|
43
43
|
this.hideDeleteIcon();
|
|
44
|
-
let
|
|
44
|
+
let {
|
|
45
|
+
thumbnailSrcList
|
|
46
|
+
} = this.state;
|
|
45
47
|
const findUploadFileIndex = this.findUploadFileIndex(fileMessage);
|
|
46
48
|
thumbnailSrcList.splice(findUploadFileIndex, 1, fileMessage);
|
|
47
49
|
if (thumbnailSrcList.every(fileItem => !fileItem.isUploading)) {
|
|
@@ -52,7 +54,9 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
52
54
|
this.props.fileUploadCompleted(fileMessage);
|
|
53
55
|
};
|
|
54
56
|
this.onFileUploadFailed = uploadedFileInfo => {
|
|
55
|
-
let
|
|
57
|
+
let {
|
|
58
|
+
thumbnailSrcList
|
|
59
|
+
} = this.state;
|
|
56
60
|
const findUploadFileIndex = this.findUploadFileIndex(uploadedFileInfo);
|
|
57
61
|
thumbnailSrcList.splice(findUploadFileIndex, 1, uploadedFileInfo);
|
|
58
62
|
this.setState({
|
|
@@ -60,7 +64,9 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
60
64
|
});
|
|
61
65
|
};
|
|
62
66
|
this.findUploadFileIndex = fileMessage => {
|
|
63
|
-
let
|
|
67
|
+
let {
|
|
68
|
+
thumbnailSrcList
|
|
69
|
+
} = this.state;
|
|
64
70
|
let uploadFileIndex = thumbnailSrcList.findIndex(item => item.name === fileMessage.file.name);
|
|
65
71
|
return uploadFileIndex;
|
|
66
72
|
};
|
|
@@ -71,7 +77,9 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
71
77
|
});
|
|
72
78
|
return;
|
|
73
79
|
}
|
|
74
|
-
let
|
|
80
|
+
let {
|
|
81
|
+
uploadMessageList
|
|
82
|
+
} = this.state;
|
|
75
83
|
let newUploadMessageList = uploadMessageList.slice(0);
|
|
76
84
|
let uploadFile = uploadMessageList.find(item => item.uploadName === uploadMessage.uploadName);
|
|
77
85
|
if (uploadFile) {
|
|
@@ -105,7 +113,9 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
105
113
|
});
|
|
106
114
|
};
|
|
107
115
|
this.renderMultipleFilesArr = () => {
|
|
108
|
-
let
|
|
116
|
+
let {
|
|
117
|
+
thumbnailSrcList
|
|
118
|
+
} = this.state;
|
|
109
119
|
let imageArr = [];
|
|
110
120
|
if (Array.isArray(this.props.uploadLocalImageValue)) {
|
|
111
121
|
let uploadedFileList = this.renderUploadedFile();
|
|
@@ -123,7 +133,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
123
133
|
src: fileThumbnailItem.fileIconUrl,
|
|
124
134
|
style: {
|
|
125
135
|
position: 'absolute',
|
|
126
|
-
zIndex:
|
|
136
|
+
zIndex: `${fileThumbnailItem.percent === 100 ? 3 : 1}`,
|
|
127
137
|
maxHeight: '100%'
|
|
128
138
|
},
|
|
129
139
|
alt: ""
|
|
@@ -152,7 +162,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
152
162
|
})]
|
|
153
163
|
})
|
|
154
164
|
})
|
|
155
|
-
},
|
|
165
|
+
}, `dtable-ui-image-wrapper-circle${index}`);
|
|
156
166
|
});
|
|
157
167
|
imageArr.push(...thumbnailList);
|
|
158
168
|
}
|
|
@@ -160,7 +170,9 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
160
170
|
return imageArr;
|
|
161
171
|
};
|
|
162
172
|
this.renderUploadedFile = () => {
|
|
163
|
-
const
|
|
173
|
+
const {
|
|
174
|
+
uploadLocalImageValue
|
|
175
|
+
} = this.props;
|
|
164
176
|
let uploadedFileList = [];
|
|
165
177
|
uploadedFileList = uploadLocalImageValue.length > 0 && uploadLocalImageValue.map((imgSrc, index) => {
|
|
166
178
|
let imageThumbnailUrl = (0, _dtableUtils.getImageThumbnailUrl)(imgSrc);
|
|
@@ -190,13 +202,15 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
190
202
|
return uploadedFileList;
|
|
191
203
|
};
|
|
192
204
|
this.renderUploadFileWrapper = imageArr => {
|
|
193
|
-
let
|
|
205
|
+
let {
|
|
206
|
+
isImageTipShow
|
|
207
|
+
} = this.state;
|
|
194
208
|
let editorContent;
|
|
195
|
-
let className = imageArr.length === 0 ?
|
|
209
|
+
let className = imageArr.length === 0 ? `dtable-ui-image-upload-container ${isImageTipShow ? 'dtable-ui-image-upload-container-active' : ''}` : 'dtable-ui-image-wrapper';
|
|
196
210
|
if (imageArr.length === 0) {
|
|
197
211
|
editorContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
198
212
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
199
|
-
className:
|
|
213
|
+
className: `dtable-ui-image-tip-addition ${isImageTipShow ? 'dtable-ui-image-drop-active' : ''}`,
|
|
200
214
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
201
215
|
className: "dtable-ui-dtable-ui-image-add-icon",
|
|
202
216
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
@@ -219,7 +233,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
219
233
|
editorContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
220
234
|
className: "dtable-ui-image-add-box",
|
|
221
235
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
222
|
-
className:
|
|
236
|
+
className: `dtable-ui-image-add-button ${isImageTipShow ? 'dtable-ui-image-wrapper-drop-active' : ''}`,
|
|
223
237
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
224
238
|
"aria-hidden": "true",
|
|
225
239
|
className: "dtable-font dtable-icon-add-table"
|
|
@@ -25,7 +25,9 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
this.showLargeImage = itemUrl => {
|
|
28
|
-
let
|
|
28
|
+
let {
|
|
29
|
+
value
|
|
30
|
+
} = this.props;
|
|
29
31
|
this.setState({
|
|
30
32
|
isShowLargeImage: true,
|
|
31
33
|
largeImageIndex: value.indexOf(itemUrl)
|
|
@@ -55,7 +57,9 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
55
57
|
};
|
|
56
58
|
this.deleteImage = (index, type) => {
|
|
57
59
|
this.props.deleteImage(index, type);
|
|
58
|
-
const
|
|
60
|
+
const {
|
|
61
|
+
value
|
|
62
|
+
} = this.props;
|
|
59
63
|
if (index > value.length - 2) {
|
|
60
64
|
if (value.length - 2 < 0) {
|
|
61
65
|
this.hideLargeImage();
|
|
@@ -98,11 +102,13 @@ class ImagesPreviewer extends _react.default.Component {
|
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
render() {
|
|
101
|
-
let
|
|
105
|
+
let {
|
|
106
|
+
value
|
|
107
|
+
} = this.props;
|
|
102
108
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
103
109
|
className: "dtable-ui-image-previewer-container",
|
|
104
110
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
105
|
-
className:
|
|
111
|
+
className: `dtable-ui-image-previewer-wrapper ${value.length === 0 && _constants.isMobile ? 'd-none' : ''}`,
|
|
106
112
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
107
113
|
className: "dtable-ui-image-previewer-content",
|
|
108
114
|
children: value.length > 0 && value.map((imageItemUrl, index) => {
|
|
@@ -24,9 +24,10 @@ class PCImageEditor extends _react.default.Component {
|
|
|
24
24
|
return this.state.value;
|
|
25
25
|
};
|
|
26
26
|
this.getEditorView = () => {
|
|
27
|
-
const
|
|
28
|
-
isInModal
|
|
29
|
-
value
|
|
27
|
+
const {
|
|
28
|
+
isInModal,
|
|
29
|
+
value
|
|
30
|
+
} = this.props;
|
|
30
31
|
return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
|
|
31
32
|
};
|
|
32
33
|
this.deleteImage = function (index) {
|
|
@@ -56,9 +57,10 @@ class PCImageEditor extends _react.default.Component {
|
|
|
56
57
|
e.stopPropagation();
|
|
57
58
|
if (this.state.isOpen && this.state.isUpdated) {
|
|
58
59
|
if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
|
|
59
|
-
let
|
|
60
|
-
value
|
|
61
|
-
uploadLocalImageValue
|
|
60
|
+
let {
|
|
61
|
+
value,
|
|
62
|
+
uploadLocalImageValue
|
|
63
|
+
} = this.state;
|
|
62
64
|
let newValue = value.concat(uploadLocalImageValue);
|
|
63
65
|
this.setState({
|
|
64
66
|
value: newValue
|
|
@@ -112,7 +114,9 @@ class PCImageEditor extends _react.default.Component {
|
|
|
112
114
|
});
|
|
113
115
|
};
|
|
114
116
|
this.renderHeader = () => {
|
|
115
|
-
let
|
|
117
|
+
let {
|
|
118
|
+
editorView
|
|
119
|
+
} = this.state;
|
|
116
120
|
if (this.props.isInModal) {
|
|
117
121
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
118
122
|
children: (0, _lang.getLocale)('Add_images')
|
|
@@ -134,10 +138,11 @@ class PCImageEditor extends _react.default.Component {
|
|
|
134
138
|
});
|
|
135
139
|
};
|
|
136
140
|
this.showImageListPreviewer = () => {
|
|
137
|
-
let
|
|
138
|
-
value
|
|
139
|
-
uploadLocalImageValue
|
|
140
|
-
imageLinkValue
|
|
141
|
+
let {
|
|
142
|
+
value,
|
|
143
|
+
uploadLocalImageValue,
|
|
144
|
+
imageLinkValue
|
|
145
|
+
} = this.state;
|
|
141
146
|
let newValue = value.concat(uploadLocalImageValue, imageLinkValue);
|
|
142
147
|
this.setState({
|
|
143
148
|
value: newValue
|