@zohodesk/dot 1.9.12 → 1.9.14
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/README.md +19 -6
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +7 -7
- package/assets/Appearance/dark/themes/blue/blue_DotCTA_DarkModifyCategory.module.css +13 -0
- package/assets/Appearance/dark/themes/green/green_DotCTA_DarkModifyCategory.module.css +13 -0
- package/assets/Appearance/dark/themes/orange/orange_DotCTA_DarkModifyCategory.module.css +13 -0
- package/assets/Appearance/dark/themes/red/red_DotCTA_DarkModifyCategory.module.css +13 -0
- package/assets/Appearance/dark/themes/yellow/yellow_DotCTA_DarkModifyCategory.module.css +13 -0
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +13 -13
- package/assets/Appearance/light/themes/blue/blue_DotCTA_LightModifyCategory.module.css +13 -0
- package/assets/Appearance/light/themes/green/green_DotCTA_LightModifyCategory.module.css +13 -0
- package/assets/Appearance/light/themes/orange/orange_DotCTA_LightModifyCategory.module.css +13 -0
- package/assets/Appearance/light/themes/red/red_DotCTA_LightModifyCategory.module.css +13 -0
- package/assets/Appearance/light/themes/yellow/yellow_DotCTA_LightModifyCategory.module.css +13 -0
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +5 -5
- package/assets/Appearance/pureDark/themes/blue/blue_DotCTA_PureDarkModifyCategory.module.css +13 -0
- package/assets/Appearance/pureDark/themes/green/green_DotCTA_PureDarkModifyCategory.module.css +13 -0
- package/assets/Appearance/pureDark/themes/orange/orange_DotCTA_PureDarkModifyCategory.module.css +13 -0
- package/assets/Appearance/pureDark/themes/red/red_DotCTA_PureDarkModifyCategory.module.css +13 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_DotCTA_PureDarkModifyCategory.module.css +13 -0
- package/cbt.config.js +12 -3
- package/es/ActionButton/__tests__/ActionButton.spec.js +4 -5
- package/es/AttachmentViewer/AttachmentImage.js +3 -1
- package/es/AttachmentViewer/AttachmentViewer.js +340 -273
- package/es/AttachmentViewer/AttachmentViewer.module.css +8 -15
- package/es/AttachmentViewer/__tests__/AttachmentViewer.spec.js +104 -100
- package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +778 -1
- package/es/AttachmentViewer/props/defaultProps.js +4 -2
- package/es/AttachmentViewer/props/propTypes.js +9 -2
- package/es/AttachmentViewer/utils.js +6 -7
- package/es/AudioPlayer/utils/utils.js +2 -5
- package/es/DotProvider/hooks/useDotProvider.js +14 -15
- package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +12 -13
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +2 -1
- package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +1 -0
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_Dark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_Light_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/blue/Blue_PureDark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_Dark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_Light_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/green/Green_PureDark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_Dark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_Light_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/orange/Orange_PureDark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_Dark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_Light_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/red/Red_PureDark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Dark_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Light_Variables.js +1 -2
- package/es/DotProvider/libraryChunks/themes/variables/yellow/Yellow_PureDark_Variables.js +1 -2
- package/es/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +3 -4
- package/es/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +4 -5
- package/es/DotProvider/utils/errorValidation.js +5 -6
- package/es/DotProvider/utils/getAssetsImportPromises.js +4 -5
- package/es/Drawer/Drawer.js +6 -8
- package/es/FreezeLayer/css/cssJSLogic.js +4 -5
- package/es/Hooks/Dragger/useDragger.js +5 -6
- package/es/Hooks/Dragger/utils/DraggerUtil.js +7 -8
- package/es/Hooks/useFreezeLayer.js +4 -5
- package/es/Link/Link.js +4 -3
- package/es/Link/props/propTypes.js +1 -0
- package/es/Onboarding/CarouselDots/CarouselDots.js +29 -32
- package/es/Onboarding/Onboarding.js +23 -24
- package/es/Onboarding/hooks/useOnboarding.js +4 -5
- package/es/Onboarding/hooks/useOnboardingSlider.js +5 -6
- package/es/deprecated/SelectDropdown/SelectDropdown.js +43 -47
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +214 -225
- package/es/errorstate/Inconvenience/Inconvenience.js +32 -36
- package/es/errorstate/NoRequestFound/NoRequestFound.js +32 -36
- package/es/errorstate/PermissionPlay/PermissionPlay.js +31 -35
- package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +32 -36
- package/es/errorstate/UnableToProcess/UnableToProcess.js +32 -36
- package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +32 -36
- package/es/errorstate/WillBack/WillBack.js +30 -34
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +81 -85
- package/es/list/status/StatusDropdown/StatusDropdown.js +109 -113
- package/es/list/status/StatusDropdown/__tests__/StatusDropdown.spec.js +3 -4
- package/es/lookup/header/Search/Search.js +4 -5
- package/es/lookup/header/Search/__tests__/Search.spec.js +3 -4
- package/es/lookup/header/ViewDropDown/ViewDropDown.js +67 -75
- package/es/utils/General.js +2 -7
- package/es/utils/editorUtils.js +1 -5
- package/es/version2/lookup/AlertHeader/css/cssJSLogic.js +4 -5
- package/es/version2/notification/DesktopNotification/DesktopNotification.js +59 -63
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +40 -44
- package/lib/AttachmentViewer/AttachmentImage.js +3 -1
- package/lib/AttachmentViewer/AttachmentViewer.js +158 -82
- package/lib/AttachmentViewer/AttachmentViewer.module.css +8 -15
- package/lib/AttachmentViewer/__tests__/AttachmentViewer.spec.js +100 -100
- package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +778 -1
- package/lib/AttachmentViewer/props/defaultProps.js +6 -2
- package/lib/AttachmentViewer/props/propTypes.js +9 -2
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Dark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_Light_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_Dark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_Light_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/green/Green_PureDark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Dark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_Light_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_Dark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_Light_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/red/Red_PureDark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +3 -1
- package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/green/Green_Dark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/green/Green_Light_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/red/Red_Dark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/red/Red_Light_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +2 -0
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_Dark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_Light_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/blue/Blue_PureDark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_Dark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_Light_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/green/Green_PureDark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_Dark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_Light_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/orange/Orange_PureDark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_Dark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_Light_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/red/Red_PureDark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Dark_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_Light_Variables.js +1 -3
- package/lib/DotProvider/libraryChunks/themes/variables/yellow/Yellow_PureDark_Variables.js +1 -3
- package/lib/Link/Link.js +4 -3
- package/lib/Link/props/propTypes.js +1 -0
- package/package.json +12 -11
|
@@ -25,10 +25,9 @@ export default class DesktopNotificationHeader extends Component {
|
|
|
25
25
|
responsiveId
|
|
26
26
|
} = this.props;
|
|
27
27
|
|
|
28
|
-
function responsiveFunc(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
28
|
+
function responsiveFunc({
|
|
29
|
+
mediaQueryOR
|
|
30
|
+
}) {
|
|
32
31
|
return {
|
|
33
32
|
uptoTablet: mediaQueryOR([{
|
|
34
33
|
maxWidth: 760
|
|
@@ -45,46 +44,43 @@ export default class DesktopNotificationHeader extends Component {
|
|
|
45
44
|
}, /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
46
45
|
query: responsiveFunc,
|
|
47
46
|
responsiveId: responsiveId
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
type: "light"
|
|
86
|
-
})) : null);
|
|
87
|
-
}));
|
|
47
|
+
}, ({
|
|
48
|
+
uptoTablet
|
|
49
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, needIcon ? /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: style.iconContainer
|
|
51
|
+
}, /*#__PURE__*/React.createElement(AlertIcons, {
|
|
52
|
+
type: type
|
|
53
|
+
})) : null, /*#__PURE__*/React.createElement(Box, {
|
|
54
|
+
flexible: true
|
|
55
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
56
|
+
alignBox: "row",
|
|
57
|
+
align: "center"
|
|
58
|
+
}, variant === 'primary' ? /*#__PURE__*/React.createElement(Box, {
|
|
59
|
+
shrink: true
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
61
|
+
$i18n_dataTitle: title,
|
|
62
|
+
$ui_className: style.title,
|
|
63
|
+
$ui_tagName: "h1",
|
|
64
|
+
$ui_size: uptoTablet ? '16' : '18',
|
|
65
|
+
$ui_lineHeight: "1.2",
|
|
66
|
+
$ui_weight: "bold",
|
|
67
|
+
$flag_reset: true,
|
|
68
|
+
$ui_wordBreak: "breakWord"
|
|
69
|
+
}, title)) : /*#__PURE__*/React.createElement(Box, {
|
|
70
|
+
className: `${style.infoText}`
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
72
|
+
$i18n_dataTitle: title,
|
|
73
|
+
$ui_className: style.title,
|
|
74
|
+
$ui_size: "14",
|
|
75
|
+
$ui_wordBreak: "breakWord"
|
|
76
|
+
}, title)))), needClose ? /*#__PURE__*/React.createElement(Box, {
|
|
77
|
+
className: style.close
|
|
78
|
+
}, /*#__PURE__*/React.createElement(AlertClose, {
|
|
79
|
+
onClose: onClose,
|
|
80
|
+
dataTitle: closeTitle,
|
|
81
|
+
dataId: dataId,
|
|
82
|
+
type: "light"
|
|
83
|
+
})) : null)));
|
|
88
84
|
}
|
|
89
85
|
|
|
90
86
|
}
|
|
@@ -92,7 +92,8 @@ var AttachmentImage = /*#__PURE__*/function (_Component) {
|
|
|
92
92
|
isCover = _this$props.isCover,
|
|
93
93
|
customClass = _this$props.customClass,
|
|
94
94
|
onLoad = _this$props.onLoad,
|
|
95
|
-
onError = _this$props.onError
|
|
95
|
+
onError = _this$props.onError,
|
|
96
|
+
imageRef = _this$props.imageRef;
|
|
96
97
|
var isImageValid = this.state.isImageValid;
|
|
97
98
|
var _customClass$customIm = customClass.customImageClass,
|
|
98
99
|
customImageClass = _customClass$customIm === void 0 ? '' : _customClass$customIm;
|
|
@@ -104,6 +105,7 @@ var AttachmentImage = /*#__PURE__*/function (_Component) {
|
|
|
104
105
|
className: customImageClass,
|
|
105
106
|
alt: alt,
|
|
106
107
|
isCover: isCover,
|
|
108
|
+
eleRef: imageRef,
|
|
107
109
|
onLoad: onLoad,
|
|
108
110
|
onError: onError
|
|
109
111
|
});
|
|
@@ -35,11 +35,13 @@ var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
|
|
|
35
35
|
|
|
36
36
|
var _FreezeLayer = _interopRequireDefault(require("../FreezeLayer/FreezeLayer"));
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _utils = require("@zohodesk/utils");
|
|
39
39
|
|
|
40
40
|
var _General = require("../utils/General");
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _Attachment = require("./Attachment");
|
|
43
|
+
|
|
44
|
+
var _utils2 = require("./utils");
|
|
43
45
|
|
|
44
46
|
var _AttachmentViewerModule = _interopRequireDefault(require("./AttachmentViewer.module.css"));
|
|
45
47
|
|
|
@@ -119,8 +121,11 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
119
121
|
_this.getUpdateDataList = _this.getUpdateDataList.bind(_assertThisInitialized(_this));
|
|
120
122
|
_this.zoomMaintain = _this.zoomMaintain.bind(_assertThisInitialized(_this));
|
|
121
123
|
_this.handleMenuValidation = _this.handleMenuValidation.bind(_assertThisInitialized(_this));
|
|
124
|
+
_this.notifySelectedAttachmentChange = _this.notifySelectedAttachmentChange.bind(_assertThisInitialized(_this));
|
|
122
125
|
_this.getPreviewIconData = _this.getPreviewIconData.bind(_assertThisInitialized(_this));
|
|
123
126
|
_this.renderIframe = _this.renderIframe.bind(_assertThisInitialized(_this));
|
|
127
|
+
_this.getRenderImageFrameCustomClass = _this.getRenderImageFrameCustomClass.bind(_assertThisInitialized(_this));
|
|
128
|
+
_this.renderImageFrame = _this.renderImageFrame.bind(_assertThisInitialized(_this));
|
|
124
129
|
return _this;
|
|
125
130
|
}
|
|
126
131
|
|
|
@@ -129,7 +134,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
129
134
|
value: function isImageFileType(fileName) {
|
|
130
135
|
var extension = ((0, _Attachment.getExtensionFromFileName)(fileName) || '').toLowerCase();
|
|
131
136
|
if (!extension) return false;
|
|
132
|
-
return
|
|
137
|
+
return _utils2.FILE_EXTENSIONS.image.map(function (ext) {
|
|
133
138
|
return ext.toLowerCase();
|
|
134
139
|
}).includes(extension);
|
|
135
140
|
}
|
|
@@ -138,7 +143,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
138
143
|
value: function isVideoFileType(fileName) {
|
|
139
144
|
var extension = ((0, _Attachment.getExtensionFromFileName)(fileName) || '').toLowerCase();
|
|
140
145
|
if (!extension) return false;
|
|
141
|
-
return
|
|
146
|
+
return _utils2.FILE_EXTENSIONS.video.map(function (ext) {
|
|
142
147
|
return ext.toLowerCase();
|
|
143
148
|
}).includes(extension);
|
|
144
149
|
}
|
|
@@ -147,25 +152,45 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
147
152
|
value: function isAudioFileType(fileName) {
|
|
148
153
|
var extension = ((0, _Attachment.getExtensionFromFileName)(fileName) || '').toLowerCase();
|
|
149
154
|
if (!extension) return false;
|
|
150
|
-
return
|
|
155
|
+
return _utils2.FILE_EXTENSIONS.audio.map(function (ext) {
|
|
151
156
|
return ext.toLowerCase();
|
|
152
157
|
}).includes(extension);
|
|
153
158
|
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "notifySelectedAttachmentChange",
|
|
161
|
+
value: function notifySelectedAttachmentChange() {
|
|
162
|
+
var onSelectedAttachmentChange = this.props.onSelectedAttachmentChange;
|
|
163
|
+
var _this$state = this.state,
|
|
164
|
+
selectedIndex = _this$state.selectedIndex,
|
|
165
|
+
data = _this$state.data;
|
|
166
|
+
onSelectedAttachmentChange && onSelectedAttachmentChange({
|
|
167
|
+
data: data[selectedIndex] || _General.DUMMY_OBJECT,
|
|
168
|
+
index: selectedIndex
|
|
169
|
+
});
|
|
170
|
+
}
|
|
154
171
|
}, {
|
|
155
172
|
key: "componentDidMount",
|
|
156
173
|
value: function componentDidMount() {
|
|
157
174
|
this.handleMenuValidation();
|
|
175
|
+
this.notifySelectedAttachmentChange();
|
|
158
176
|
}
|
|
159
177
|
}, {
|
|
160
178
|
key: "componentDidUpdate",
|
|
161
179
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
162
180
|
var previewObj = this.props.previewObj;
|
|
163
|
-
var
|
|
181
|
+
var _this$state2 = this.state,
|
|
182
|
+
selectedIndex = _this$state2.selectedIndex,
|
|
183
|
+
data = _this$state2.data;
|
|
164
184
|
var indexChanged = previewObj.selectedIndex != prevProps.previewObj.selectedIndex;
|
|
185
|
+
var attachmentPreviewUrlChanged = previewObj.previewData.some(function (value, index) {
|
|
186
|
+
var _prevState$data$index;
|
|
187
|
+
|
|
188
|
+
return (value === null || value === void 0 ? void 0 : value.viewUrl) !== ((_prevState$data$index = prevState.data[index]) === null || _prevState$data$index === void 0 ? void 0 : _prevState$data$index.viewUrl);
|
|
189
|
+
}); // Triggers an update if any previewed attachment is edited by the Attachment Annotator.
|
|
165
190
|
|
|
166
|
-
if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged) {
|
|
191
|
+
if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged || attachmentPreviewUrlChanged) {
|
|
167
192
|
var objChanged = previewObj.previewData.some(function (value, index) {
|
|
168
|
-
return (0, _General.shallowDiff)(value, prevProps.previewObj[index]);
|
|
193
|
+
return (0, _General.shallowDiff)(value, prevProps.previewObj.previewData[index]);
|
|
169
194
|
});
|
|
170
195
|
|
|
171
196
|
if (objChanged || indexChanged) {
|
|
@@ -182,7 +207,8 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
182
207
|
}
|
|
183
208
|
}
|
|
184
209
|
|
|
185
|
-
if (prevState.selectedIndex != selectedIndex) {
|
|
210
|
+
if (prevState.selectedIndex != selectedIndex || attachmentPreviewUrlChanged) {
|
|
211
|
+
this.notifySelectedAttachmentChange();
|
|
186
212
|
this.handleMenuValidation();
|
|
187
213
|
}
|
|
188
214
|
}
|
|
@@ -191,16 +217,16 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
191
217
|
value: function handleMenuValidation() {
|
|
192
218
|
var _this2 = this;
|
|
193
219
|
|
|
194
|
-
var _this$
|
|
195
|
-
data = _this$
|
|
196
|
-
selectedIndex = _this$
|
|
220
|
+
var _this$state3 = this.state,
|
|
221
|
+
data = _this$state3.data,
|
|
222
|
+
selectedIndex = _this$state3.selectedIndex;
|
|
197
223
|
var allowedPreviewExtensionsData = this.props.allowedPreviewExtensionsData;
|
|
198
|
-
var selectedAttachment = data[selectedIndex] ||
|
|
224
|
+
var selectedAttachment = data[selectedIndex] || _General.DUMMY_OBJECT;
|
|
199
225
|
var selectedAttachmentViewUrl = selectedAttachment.viewUrl; // const selectedAttachmentDownloadUrl = selectedAttachment.downloadUrl;
|
|
200
226
|
|
|
201
227
|
var selectedAttachmentName = selectedAttachment.name;
|
|
202
228
|
var selectedAttachmentPreviewUrl = selectedAttachment.previewurl;
|
|
203
|
-
(0,
|
|
229
|
+
(0, _utils2.checkFileSourcesValidation)({
|
|
204
230
|
fileName: selectedAttachmentName,
|
|
205
231
|
viewURL: selectedAttachmentViewUrl,
|
|
206
232
|
previewUrl: selectedAttachmentPreviewUrl,
|
|
@@ -322,9 +348,9 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
322
348
|
value: function changeSelectedIndex(index) {
|
|
323
349
|
var _this4 = this;
|
|
324
350
|
|
|
325
|
-
var _this$
|
|
326
|
-
data = _this$
|
|
327
|
-
selectedIndex = _this$
|
|
351
|
+
var _this$state4 = this.state,
|
|
352
|
+
data = _this$state4.data,
|
|
353
|
+
selectedIndex = _this$state4.selectedIndex;
|
|
328
354
|
var maintainZoom = this.props.maintainZoom;
|
|
329
355
|
maintainZoom ? this.zoomMaintain(index) : this.zoomOut(selectedIndex);
|
|
330
356
|
|
|
@@ -396,19 +422,83 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
396
422
|
className: _AttachmentViewerModule["default"].previewFrame
|
|
397
423
|
}, this.props.customProps.iframeProps));
|
|
398
424
|
}
|
|
425
|
+
}, {
|
|
426
|
+
key: "getRenderImageFrameCustomClass",
|
|
427
|
+
value: function getRenderImageFrameCustomClass() {
|
|
428
|
+
var _this$state5 = this.state,
|
|
429
|
+
selectedIndex = _this$state5.selectedIndex,
|
|
430
|
+
isZoomed = _this$state5.isZoomed,
|
|
431
|
+
canZoom = _this$state5.canZoom,
|
|
432
|
+
data = _this$state5.data;
|
|
433
|
+
var maintainZoom = this.props.maintainZoom;
|
|
434
|
+
var selectedData = data[selectedIndex] || _General.DUMMY_OBJECT;
|
|
435
|
+
var _selectedData$customC = selectedData.customClass,
|
|
436
|
+
customClass = _selectedData$customC === void 0 ? _General.DUMMY_OBJECT : _selectedData$customC;
|
|
437
|
+
var _customClass$customIm = customClass.customImageClass,
|
|
438
|
+
customImageClass = _customClass$customIm === void 0 ? '' : _customClass$customIm,
|
|
439
|
+
_customClass$customCh = customClass.customChildrenClass,
|
|
440
|
+
customChildrenClass = _customClass$customCh === void 0 ? '' : _customClass$customCh;
|
|
441
|
+
var retainZoom = canZoom && maintainZoom;
|
|
442
|
+
return {
|
|
443
|
+
customImageClass: "".concat(_AttachmentViewerModule["default"].img, " ").concat(_AttachmentViewerModule["default"].altText, " ").concat(canZoom || retainZoom ? isZoomed ? "".concat(_AttachmentViewerModule["default"].zoomedImg, " ").concat(_AttachmentViewerModule["default"].zoomOutCursor) : "".concat(_AttachmentViewerModule["default"].normalImg, " ").concat(_AttachmentViewerModule["default"].zoomInCursor) : '', " ").concat(customImageClass),
|
|
444
|
+
customChildrenClass: customChildrenClass
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
}, {
|
|
448
|
+
key: "renderImageFrame",
|
|
449
|
+
value: function renderImageFrame() {
|
|
450
|
+
var _this5 = this;
|
|
451
|
+
|
|
452
|
+
var _this$state6 = this.state,
|
|
453
|
+
selectedIndex = _this$state6.selectedIndex,
|
|
454
|
+
isZoomed = _this$state6.isZoomed,
|
|
455
|
+
isPreviewAttachmentValid = _this$state6.isPreviewAttachmentValid;
|
|
456
|
+
var renderCustomImagePreviewElement = this.props.renderCustomImagePreviewElement;
|
|
457
|
+
var data = this.state.data[selectedIndex] || _General.DUMMY_OBJECT;
|
|
458
|
+
var viewUrl = data.viewUrl,
|
|
459
|
+
name = data.name,
|
|
460
|
+
children = data.children,
|
|
461
|
+
_data$dataId = data.dataId,
|
|
462
|
+
dataId = _data$dataId === void 0 ? 'attachViewer' : _data$dataId,
|
|
463
|
+
_data$customProps = data.customProps,
|
|
464
|
+
customProps = _data$customProps === void 0 ? _General.DUMMY_OBJECT : _data$customProps,
|
|
465
|
+
imageRef = data.imageRef;
|
|
466
|
+
var _customProps$imagePro = customProps.imageProps,
|
|
467
|
+
imageProps = _customProps$imagePro === void 0 ? _General.DUMMY_OBJECT : _customProps$imagePro;
|
|
468
|
+
var resolvedImageRef = imageRef;
|
|
469
|
+
var handleZoomOut = isPreviewAttachmentValid && isZoomed ? this.zoomOut.bind(this, selectedIndex) : undefined;
|
|
470
|
+
var handleZoomIn = isPreviewAttachmentValid && !isZoomed ? function (e) {
|
|
471
|
+
return _this5.zoomIn(e, selectedIndex, true);
|
|
472
|
+
} : undefined;
|
|
473
|
+
var handleImageClick = isPreviewAttachmentValid ? isZoomed ? handleZoomOut : handleZoomIn : undefined;
|
|
474
|
+
var imageFrameCustomClass = this.getRenderImageFrameCustomClass();
|
|
475
|
+
|
|
476
|
+
var img = /*#__PURE__*/_react["default"].createElement(_AttachmentImage["default"], _extends({
|
|
477
|
+
customClass: imageFrameCustomClass,
|
|
478
|
+
src: viewUrl,
|
|
479
|
+
onClick: handleImageClick,
|
|
480
|
+
alt: name,
|
|
481
|
+
dataId: dataId,
|
|
482
|
+
id: "img".concat(selectedIndex),
|
|
483
|
+
isCover: false,
|
|
484
|
+
imageRef: resolvedImageRef
|
|
485
|
+
}, imageProps), children);
|
|
486
|
+
|
|
487
|
+
return typeof renderCustomImagePreviewElement === 'function' ? renderCustomImagePreviewElement({
|
|
488
|
+
defaultView: img,
|
|
489
|
+
data: data,
|
|
490
|
+
index: selectedIndex
|
|
491
|
+
}) : img;
|
|
492
|
+
}
|
|
399
493
|
}, {
|
|
400
494
|
key: "imgPreviewView",
|
|
401
495
|
value: function imgPreviewView(downloadUrl) {
|
|
402
|
-
var
|
|
496
|
+
var _this6 = this;
|
|
403
497
|
|
|
404
|
-
var _this$
|
|
405
|
-
dataList = _this$
|
|
406
|
-
selectedIndex = _this$
|
|
407
|
-
isZoomed = _this$state3.isZoomed,
|
|
408
|
-
canZoom = _this$state3.canZoom,
|
|
409
|
-
isPreviewAttachmentValid = _this$state3.isPreviewAttachmentValid;
|
|
498
|
+
var _this$state7 = this.state,
|
|
499
|
+
dataList = _this$state7.dataList,
|
|
500
|
+
selectedIndex = _this$state7.selectedIndex;
|
|
410
501
|
var _this$props = this.props,
|
|
411
|
-
maintainZoom = _this$props.maintainZoom,
|
|
412
502
|
dataId = _this$props.dataId,
|
|
413
503
|
i18nKeys = _this$props.i18nKeys,
|
|
414
504
|
renderUnSupportedElement = _this$props.renderUnSupportedElement;
|
|
@@ -444,25 +534,16 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
444
534
|
var viewUrl = data.viewUrl,
|
|
445
535
|
name = data.name,
|
|
446
536
|
children = data.children,
|
|
447
|
-
_data$
|
|
448
|
-
dataId = _data$
|
|
449
|
-
_data$
|
|
450
|
-
|
|
451
|
-
_data$customProps = data.customProps,
|
|
452
|
-
customProps = _data$customProps === void 0 ? {} : _data$customProps,
|
|
537
|
+
_data$dataId2 = data.dataId,
|
|
538
|
+
dataId = _data$dataId2 === void 0 ? 'attachViewer' : _data$dataId2,
|
|
539
|
+
_data$customProps2 = data.customProps,
|
|
540
|
+
customProps = _data$customProps2 === void 0 ? {} : _data$customProps2,
|
|
453
541
|
previewurl = data.previewurl,
|
|
454
542
|
type = data.type;
|
|
455
543
|
var _customProps$audioPro = customProps.audioProps,
|
|
456
544
|
audioProps = _customProps$audioPro === void 0 ? {} : _customProps$audioPro,
|
|
457
|
-
_customProps$imagePro = customProps.imageProps,
|
|
458
|
-
imageProps = _customProps$imagePro === void 0 ? {} : _customProps$imagePro,
|
|
459
545
|
_customProps$videoPro = customProps.videoProps,
|
|
460
546
|
videoProps = _customProps$videoPro === void 0 ? {} : _customProps$videoPro;
|
|
461
|
-
var _customClass$customIm = customClass.customImageClass,
|
|
462
|
-
customImageClass = _customClass$customIm === void 0 ? '' : _customClass$customIm,
|
|
463
|
-
_customClass$customCh = customClass.customChildrenClass,
|
|
464
|
-
customChildrenClass = _customClass$customCh === void 0 ? '' : _customClass$customCh;
|
|
465
|
-
var retainZoom = canZoom && selectedIndex == i && maintainZoom;
|
|
466
547
|
var extension = (0, _Attachment.getExtensionFromFileName)(name);
|
|
467
548
|
var _i18nKeys$previewUnsu = i18nKeys.previewUnsupportedText,
|
|
468
549
|
previewUnsupportedText = _i18nKeys$previewUnsu === void 0 ? "Preview not available for the selected file type." : _i18nKeys$previewUnsu,
|
|
@@ -478,7 +559,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
478
559
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
479
560
|
className: _AttachmentViewerModule["default"].imgRef,
|
|
480
561
|
id: "imgPreviewRef".concat(i)
|
|
481
|
-
}, selectedIndex == i && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null,
|
|
562
|
+
}, selectedIndex == i && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _this6.isAudioFileType(name) ? /*#__PURE__*/_react["default"].createElement("audio", _extends({
|
|
482
563
|
controls: true,
|
|
483
564
|
className: _AttachmentViewerModule["default"].zoomIn,
|
|
484
565
|
"data-id": "".concat(dataId, "_audioPreview"),
|
|
@@ -486,7 +567,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
486
567
|
}, audioProps), /*#__PURE__*/_react["default"].createElement("source", {
|
|
487
568
|
src: previewurl || viewUrl,
|
|
488
569
|
type: "audio/".concat(extension)
|
|
489
|
-
})) :
|
|
570
|
+
})) : _this6.isVideoFileType(name) ? /*#__PURE__*/_react["default"].createElement("video", _extends({
|
|
490
571
|
controls: true,
|
|
491
572
|
className: _AttachmentViewerModule["default"].zoomIn,
|
|
492
573
|
"data-id": "".concat(dataId, "_videoPreview"),
|
|
@@ -494,31 +575,19 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
494
575
|
}, videoProps), /*#__PURE__*/_react["default"].createElement("source", {
|
|
495
576
|
src: viewUrl,
|
|
496
577
|
type: "video/".concat(extension)
|
|
497
|
-
})) :
|
|
498
|
-
customClass: {
|
|
499
|
-
customImageClass: "".concat(_AttachmentViewerModule["default"].img, " ").concat(_AttachmentViewerModule["default"].altText, " ").concat(canZoom || retainZoom ? isZoomed ? "".concat(_AttachmentViewerModule["default"].zoomedImg, " ").concat(_AttachmentViewerModule["default"].zoomOutCursor) : "".concat(_AttachmentViewerModule["default"].normalImg, " ").concat(_AttachmentViewerModule["default"].zoomInCursor) : '', " ").concat(customImageClass),
|
|
500
|
-
customChildrenClass: customChildrenClass
|
|
501
|
-
},
|
|
502
|
-
src: viewUrl,
|
|
503
|
-
onClick: isPreviewAttachmentValid ? isZoomed ? _this5.zoomOut.bind(_this5, i) : function (e) {
|
|
504
|
-
return _this5.zoomIn(e, i, true);
|
|
505
|
-
} : undefined,
|
|
506
|
-
alt: name,
|
|
507
|
-
dataId: dataId,
|
|
508
|
-
id: "img".concat(i),
|
|
509
|
-
isCover: false
|
|
510
|
-
}, imageProps), children) : type === "document" && previewurl != null ? _this5.renderIframe(previewurl) : typeof renderUnSupportedElement === 'function' ? renderUnSupportedElement(data) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
578
|
+
})) : _this6.isImageFileType(name) || children ? _this6.renderImageFrame() : type === "document" && previewurl != null ? _this6.renderIframe(previewurl) : typeof renderUnSupportedElement === 'function' ? renderUnSupportedElement(data) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
511
579
|
className: _AttachmentViewerModule["default"].previewNone
|
|
512
580
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
513
581
|
className: _AttachmentViewerModule["default"].fileTypeImg
|
|
514
|
-
},
|
|
582
|
+
}, _this6.getPreviewIconData(name, '70')), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
515
583
|
$ui_size: "20",
|
|
516
584
|
$ui_weight: "semibold"
|
|
517
585
|
}, previewUnsupportedText), downloadUrl ? /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
518
586
|
href: downloadUrl,
|
|
587
|
+
download: true,
|
|
588
|
+
downloadName: name,
|
|
519
589
|
className: _AttachmentViewerModule["default"].downloadLink,
|
|
520
|
-
hasReload: true
|
|
521
|
-
download: true
|
|
590
|
+
hasReload: true
|
|
522
591
|
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
523
592
|
palette: "primaryFilled",
|
|
524
593
|
text: downloadText
|
|
@@ -528,22 +597,24 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
528
597
|
}, {
|
|
529
598
|
key: "render",
|
|
530
599
|
value: function render() {
|
|
531
|
-
var
|
|
532
|
-
|
|
533
|
-
var _this$
|
|
534
|
-
isPViewListOpen = _this$
|
|
535
|
-
selectedIndex = _this$
|
|
536
|
-
data = _this$
|
|
537
|
-
isZoomed = _this$
|
|
538
|
-
canZoom = _this$
|
|
539
|
-
canOpenInNewTab = _this$
|
|
600
|
+
var _this7 = this;
|
|
601
|
+
|
|
602
|
+
var _this$state8 = this.state,
|
|
603
|
+
isPViewListOpen = _this$state8.isPViewListOpen,
|
|
604
|
+
selectedIndex = _this$state8.selectedIndex,
|
|
605
|
+
data = _this$state8.data,
|
|
606
|
+
isZoomed = _this$state8.isZoomed,
|
|
607
|
+
canZoom = _this$state8.canZoom,
|
|
608
|
+
canOpenInNewTab = _this$state8.canOpenInNewTab;
|
|
540
609
|
var _this$props2 = this.props,
|
|
541
610
|
responsiveId = _this$props2.responsiveId,
|
|
542
611
|
needDownload = _this$props2.needDownload,
|
|
543
612
|
i18nKeys = _this$props2.i18nKeys,
|
|
544
613
|
isActive = _this$props2.isActive,
|
|
545
614
|
dataId = _this$props2.dataId,
|
|
546
|
-
customProps = _this$props2.customProps
|
|
615
|
+
customProps = _this$props2.customProps,
|
|
616
|
+
hasCount = _this$props2.hasCount,
|
|
617
|
+
renderCustomIcons = _this$props2.renderCustomIcons;
|
|
547
618
|
var _customProps$avatarPr = customProps.avatarProps,
|
|
548
619
|
avatarProps = _customProps$avatarPr === void 0 ? {} : _customProps$avatarPr;
|
|
549
620
|
var totalLen = data.length;
|
|
@@ -585,7 +656,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
585
656
|
"data-title": selectedAttachment.name,
|
|
586
657
|
dataId: "attachName",
|
|
587
658
|
id: ariaId
|
|
588
|
-
}, selectedAttachment.name), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
659
|
+
}, selectedAttachment.name), hasCount && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
589
660
|
flexible: true,
|
|
590
661
|
className: _AttachmentViewerModule["default"].count,
|
|
591
662
|
dataId: "attachCountContainer"
|
|
@@ -597,9 +668,13 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
597
668
|
align: uptoTablet ? 'bottom' : 'center',
|
|
598
669
|
wrap: "wrap",
|
|
599
670
|
isCover: false
|
|
600
|
-
},
|
|
671
|
+
}, (0, _utils.renderNode)(renderCustomIcons, {
|
|
672
|
+
selectedAttachment: selectedAttachment,
|
|
673
|
+
selectedIndex: selectedIndex,
|
|
674
|
+
totalLen: totalLen
|
|
675
|
+
}), canZoom ? isZoomed ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
601
676
|
className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu,
|
|
602
|
-
onClick:
|
|
677
|
+
onClick: _this7.zoomOut.bind(_this7, selectedIndex),
|
|
603
678
|
"data-id": "zoomOut",
|
|
604
679
|
"data-test-id": "zoomOut",
|
|
605
680
|
"data-title": i18nKeys.zoomOutText
|
|
@@ -614,7 +689,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
614
689
|
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
615
690
|
className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu,
|
|
616
691
|
onClick: function onClick(e) {
|
|
617
|
-
return
|
|
692
|
+
return _this7.zoomIn(e, selectedIndex);
|
|
618
693
|
},
|
|
619
694
|
"data-id": "zoomIn",
|
|
620
695
|
"data-test-id": "zoomIn",
|
|
@@ -647,6 +722,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
647
722
|
className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu
|
|
648
723
|
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
649
724
|
href: downloadUrl,
|
|
725
|
+
downloadName: selectedAttachment.name,
|
|
650
726
|
target: "_parent",
|
|
651
727
|
hasReload: true,
|
|
652
728
|
download: true,
|
|
@@ -663,7 +739,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
663
739
|
}
|
|
664
740
|
}))) : null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
665
741
|
className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu,
|
|
666
|
-
onClick:
|
|
742
|
+
onClick: _this7.closeAttachmentViewer,
|
|
667
743
|
"data-id": "closeAttach",
|
|
668
744
|
"data-test-id": "closeAttach",
|
|
669
745
|
"data-title": i18nKeys.closeText
|
|
@@ -684,7 +760,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
684
760
|
alignBox: "row"
|
|
685
761
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
686
762
|
className: "".concat(_AttachmentViewerModule["default"].arrowBox, " ").concat(uptoTablet ? _AttachmentViewerModule["default"].mbleArrowBox : _AttachmentViewerModule["default"].nrmlArrowBox, " ").concat(selectedIndex === 0 ? _AttachmentViewerModule["default"].hidden : ''),
|
|
687
|
-
onClick:
|
|
763
|
+
onClick: _this7.changeSelectedIndex.bind(_this7, selectedIndex - 1),
|
|
688
764
|
"data-title": i18nKeys.previousText,
|
|
689
765
|
"data-title-position": "left"
|
|
690
766
|
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
@@ -700,12 +776,12 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
700
776
|
tabindex: "0",
|
|
701
777
|
"aria-describedby": ariaId,
|
|
702
778
|
isShrink: false,
|
|
703
|
-
eleRef:
|
|
779
|
+
eleRef: _this7.setImgBoxRef,
|
|
704
780
|
scroll: "both",
|
|
705
781
|
flexible: true
|
|
706
|
-
},
|
|
782
|
+
}, _this7.imgPreviewView(downloadUrl)), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
707
783
|
className: "".concat(_AttachmentViewerModule["default"].arrowBox, " ").concat(uptoTablet ? _AttachmentViewerModule["default"].mbleArrowBox : _AttachmentViewerModule["default"].nrmlArrowBox, " ").concat(totalLen === selectedIndex + 1 ? _AttachmentViewerModule["default"].hidden : ''),
|
|
708
|
-
onClick:
|
|
784
|
+
onClick: _this7.changeSelectedIndex.bind(_this7, selectedIndex + 1),
|
|
709
785
|
"data-title": i18nKeys.nextText,
|
|
710
786
|
"data-title-position": "right"
|
|
711
787
|
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
@@ -745,7 +821,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
745
821
|
alignBox: "row",
|
|
746
822
|
scroll: "horizontal",
|
|
747
823
|
eleRef: function eleRef(el) {
|
|
748
|
-
return
|
|
824
|
+
return _this7.imgListCont = el;
|
|
749
825
|
},
|
|
750
826
|
className: _AttachmentViewerModule["default"].listContainer
|
|
751
827
|
}, data.map(function (item, index) {
|
|
@@ -759,7 +835,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
759
835
|
_item$customProps = item.customProps,
|
|
760
836
|
customProps = _item$customProps === void 0 ? {} : _item$customProps;
|
|
761
837
|
var thumbnail = item.thumbnail;
|
|
762
|
-
var isImageFileType =
|
|
838
|
+
var isImageFileType = _this7.isImageFileType(name) || thumbnail;
|
|
763
839
|
var _customClass$customIm2 = customClass.customImageClass,
|
|
764
840
|
customImageClass = _customClass$customIm2 === void 0 ? '' : _customClass$customIm2,
|
|
765
841
|
_customClass$customCh2 = customClass.customChildrenClass,
|
|
@@ -767,9 +843,9 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
767
843
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
768
844
|
className: "".concat(_AttachmentViewerModule["default"].imgItem, " ").concat(index === selectedIndex ? _AttachmentViewerModule["default"].selected : '', " ").concat(isImageFileType ? '' : _AttachmentViewerModule["default"].previewIconDiv),
|
|
769
845
|
key: index,
|
|
770
|
-
onClick:
|
|
846
|
+
onClick: _this7.changeSelectedIndex.bind(_this7, index),
|
|
771
847
|
eleRef: function eleRef(el) {
|
|
772
|
-
return
|
|
848
|
+
return _this7["img_".concat(index)] = el;
|
|
773
849
|
},
|
|
774
850
|
dataId: "attachPreviewList",
|
|
775
851
|
"data-title": name
|
|
@@ -782,10 +858,10 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
|
|
|
782
858
|
customChildrenClass: "".concat(_AttachmentViewerModule["default"].crsrPointer, " ").concat(customChildrenClass)
|
|
783
859
|
},
|
|
784
860
|
dataId: dataId
|
|
785
|
-
}, customProps), children) :
|
|
861
|
+
}, customProps), children) : _this7.getPreviewIconData(name, '40'));
|
|
786
862
|
}))))), totalLen !== 1 && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
787
863
|
dataId: "attachToggle",
|
|
788
|
-
onClick:
|
|
864
|
+
onClick: _this7.togglePViewList,
|
|
789
865
|
iconName: "ZD-GN-hideTab",
|
|
790
866
|
iconSize: "14",
|
|
791
867
|
hoverType: "border",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.header {
|
|
2
|
-
height: var(--
|
|
2
|
+
height: var(--zd_size48) ;
|
|
3
3
|
position: relative;
|
|
4
4
|
z-index: 1;
|
|
5
|
-
padding-block:0 ;
|
|
5
|
+
padding-block: 0 ;
|
|
6
6
|
padding-inline: var(--zd_size15) ;
|
|
7
7
|
composes: alignVertical from '~@zohodesk/components/es/common/common.module.css';
|
|
8
8
|
background-color: var(--zdt_attachmentviewer_header_bg);
|
|
@@ -10,20 +10,13 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.title {
|
|
13
|
+
padding-inline-end: var(--zd_size15) ;
|
|
13
14
|
max-width: 50% ;
|
|
14
15
|
composes: dotted from '~@zohodesk/components/es/common/common.module.css';
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
[dir=ltr] .title {
|
|
18
|
-
padding-right: var(--zd_size15) ;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[dir=rtl] .title {
|
|
22
|
-
padding-left: var(--zd_size15) ;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
18
|
.count {
|
|
26
|
-
padding-block:0 ;
|
|
19
|
+
padding-block: 0 ;
|
|
27
20
|
padding-inline: var(--zd_size10) ;
|
|
28
21
|
position: absolute;
|
|
29
22
|
composes: xMiddle from '~@zohodesk/components/es/common/common.module.css';
|
|
@@ -80,7 +73,7 @@
|
|
|
80
73
|
|
|
81
74
|
.preview {
|
|
82
75
|
margin-block: var(--zd_size20) ;
|
|
83
|
-
margin-inline:0 ;
|
|
76
|
+
margin-inline: 0 ;
|
|
84
77
|
composes: posrel from '~@zohodesk/components/es/common/common.module.css';
|
|
85
78
|
text-align: center;
|
|
86
79
|
}
|
|
@@ -136,7 +129,7 @@
|
|
|
136
129
|
}
|
|
137
130
|
|
|
138
131
|
.listContainer {
|
|
139
|
-
padding-block:0 ;
|
|
132
|
+
padding-block: 0 ;
|
|
140
133
|
padding-inline: var(--zd_size18) ;
|
|
141
134
|
}
|
|
142
135
|
|
|
@@ -324,7 +317,7 @@
|
|
|
324
317
|
}
|
|
325
318
|
|
|
326
319
|
.authorName {
|
|
327
|
-
margin-block:0 ;
|
|
320
|
+
margin-block: 0 ;
|
|
328
321
|
margin-inline: var(--zd_size10) ;
|
|
329
322
|
font-size: var(--zd_font_size15) ;
|
|
330
323
|
color: var(--zdt_attachmentviewer_title_text);
|
|
@@ -364,4 +357,4 @@
|
|
|
364
357
|
color: var(--zdt_attachmentviewer_title_text);
|
|
365
358
|
padding: var(--zd_size2) ;
|
|
366
359
|
margin: auto ;
|
|
367
|
-
}
|
|
360
|
+
}
|