oa-componentbook 1.0.1-stage.423 → 1.0.1-stage.424
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.
|
@@ -105,7 +105,10 @@ function CustomModal(_ref) {
|
|
|
105
105
|
open: open,
|
|
106
106
|
title: (title || imgSrc) && /*#__PURE__*/_react.default.createElement(_styles.TitleContainer, null, imgSrc && /*#__PURE__*/_react.default.createElement("img", {
|
|
107
107
|
src: imgSrc,
|
|
108
|
-
alt: ""
|
|
108
|
+
alt: "",
|
|
109
|
+
onError: e => {
|
|
110
|
+
e.target.style.display = "none";
|
|
111
|
+
}
|
|
109
112
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
110
113
|
typography: typographies.title
|
|
111
114
|
}, title)),
|
|
@@ -28,7 +28,7 @@ var _CustomModal = _interopRequireDefault(require("../oa-component-modal/CustomM
|
|
|
28
28
|
var _handIcon = _interopRequireDefault(require("../../images/hand-icon.svg"));
|
|
29
29
|
var _PdfSampleImage = _interopRequireDefault(require("../../images/PdfSampleImage.png"));
|
|
30
30
|
var _CustomNotification = _interopRequireDefault(require("../../components/oa-component-notification/CustomNotification"));
|
|
31
|
-
const _excluded = ["uploadedDocuments", "onChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "formRules", "allowLocalDelete", "deleteHandler", "s3ResponseReturn", "form", "beforeUploadFileValidations", "allowedMediaType", "maxAllowedSize", "generateS3Url", "uploadOnS3", "label"];
|
|
31
|
+
const _excluded = ["uploadedDocuments", "onChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "formRules", "allowLocalDelete", "deleteHandler", "s3ResponseReturn", "form", "beforeUploadFileValidations", "allowedMediaType", "maxAllowedSize", "generateS3Url", "uploadOnS3", "label", "showPreviewIcon", "showDownloadIcon"];
|
|
32
32
|
/* eslint-disable */
|
|
33
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
34
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -110,7 +110,9 @@ function DocumentUpload(_ref) {
|
|
|
110
110
|
maxAllowedSize,
|
|
111
111
|
generateS3Url,
|
|
112
112
|
uploadOnS3,
|
|
113
|
-
label
|
|
113
|
+
label,
|
|
114
|
+
showPreviewIcon,
|
|
115
|
+
showDownloadIcon
|
|
114
116
|
} = _ref,
|
|
115
117
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
116
118
|
const [previewOpen, setPreviewOpen] = (0, _react.useState)(false);
|
|
@@ -268,8 +270,9 @@ function DocumentUpload(_ref) {
|
|
|
268
270
|
onChange: handleChange,
|
|
269
271
|
onRemove: handleRemove,
|
|
270
272
|
showUploadList: {
|
|
271
|
-
showDownloadIcon:
|
|
273
|
+
showDownloadIcon: showDownloadIcon,
|
|
272
274
|
showRemoveIcon: showDelete,
|
|
275
|
+
showPreviewIcon: showPreviewIcon,
|
|
273
276
|
removeIcon: /*#__PURE__*/_react.default.createElement(_icons.DeleteFilled, null),
|
|
274
277
|
previewIcon: /*#__PURE__*/_react.default.createElement(_icons.EyeFilled, null)
|
|
275
278
|
}
|
|
@@ -279,7 +282,8 @@ function DocumentUpload(_ref) {
|
|
|
279
282
|
title: previewTitle,
|
|
280
283
|
onCancel: () => setPreviewOpen(false),
|
|
281
284
|
downloadCallback: downloadCallback,
|
|
282
|
-
selectedDocumentData: selectedDocumentData
|
|
285
|
+
selectedDocumentData: selectedDocumentData,
|
|
286
|
+
showDownloadIcon: showDownloadIcon
|
|
283
287
|
}), deleteConfirmation && /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
284
288
|
buttonConfig: [{
|
|
285
289
|
callback: () => DeleteFile(previewImage),
|
|
@@ -311,7 +315,9 @@ DocumentUpload.propTypes = {
|
|
|
311
315
|
formRules: _propTypes.default.array,
|
|
312
316
|
beforeUploadFileValidations: _propTypes.default.bool,
|
|
313
317
|
allowedMediaType: _propTypes.default.array,
|
|
314
|
-
maxAllowedSize: _propTypes.default.string
|
|
318
|
+
maxAllowedSize: _propTypes.default.string,
|
|
319
|
+
showPreviewIcon: _propTypes.default.bool,
|
|
320
|
+
showDownloadIcon: _propTypes.default.bool
|
|
315
321
|
};
|
|
316
322
|
DocumentUpload.defaultProps = {
|
|
317
323
|
uploadedDocuments: [],
|
|
@@ -327,6 +333,7 @@ DocumentUpload.defaultProps = {
|
|
|
327
333
|
allowLocalDelete: true,
|
|
328
334
|
beforeUploadFileValidations: false,
|
|
329
335
|
allowedMediaType: [],
|
|
330
|
-
maxAllowedSize: ""
|
|
336
|
+
maxAllowedSize: "",
|
|
337
|
+
showPreviewIcon: true
|
|
331
338
|
};
|
|
332
339
|
var _default = exports.default = DocumentUpload;
|
|
@@ -26,7 +26,7 @@ var _common = _interopRequireDefault(require("../../utils/common"));
|
|
|
26
26
|
var _styles = require("./styles");
|
|
27
27
|
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
28
28
|
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
29
|
-
const _excluded = ["downloadCallback", "title", "selectedDocumentData", "previewFile", "fileName"],
|
|
29
|
+
const _excluded = ["downloadCallback", "title", "selectedDocumentData", "previewFile", "fileName", "showDownloadIcon"],
|
|
30
30
|
_excluded2 = ["zoomIn", "zoomOut"];
|
|
31
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -181,7 +181,8 @@ function CustomViewer(_ref2) {
|
|
|
181
181
|
title,
|
|
182
182
|
selectedDocumentData,
|
|
183
183
|
previewFile,
|
|
184
|
-
fileName = 'download'
|
|
184
|
+
fileName = 'download',
|
|
185
|
+
showDownloadIcon = true
|
|
185
186
|
} = _ref2,
|
|
186
187
|
antDesignProps = _objectWithoutProperties(_ref2, _excluded);
|
|
187
188
|
console.log(downloadCallback, title, selectedDocumentData, previewFile, fileName, antDesignProps, 'antDesignProps');
|
|
@@ -226,15 +227,16 @@ function CustomViewer(_ref2) {
|
|
|
226
227
|
return 'UNSUPPORTED';
|
|
227
228
|
}, [previewFile, title]);
|
|
228
229
|
console.log(getUrl, 'getUrl');
|
|
230
|
+
const buttonConfig = showDownloadIcon ? [{
|
|
231
|
+
callback: () => {
|
|
232
|
+
downloadCallback(selectedDocumentData);
|
|
233
|
+
},
|
|
234
|
+
label: 'Download'
|
|
235
|
+
}] : [];
|
|
229
236
|
return /*#__PURE__*/_react.default.createElement(_CustomModal.default, _extends({
|
|
230
237
|
width: 860,
|
|
231
238
|
className: "imageZoom",
|
|
232
|
-
buttonConfig:
|
|
233
|
-
callback: () => {
|
|
234
|
-
downloadCallback(selectedDocumentData);
|
|
235
|
-
},
|
|
236
|
-
label: 'Download'
|
|
237
|
-
}]
|
|
239
|
+
buttonConfig: buttonConfig
|
|
238
240
|
}, antDesignProps), /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, null, _ref4 => {
|
|
239
241
|
let {
|
|
240
242
|
zoomIn,
|
|
@@ -262,12 +264,14 @@ CustomViewer.propTypes = {
|
|
|
262
264
|
fileName: _propTypes.default.string,
|
|
263
265
|
antDesignProps: _propTypes.default.object,
|
|
264
266
|
downloadCallback: _propTypes.default.func,
|
|
265
|
-
selectedDocumentData: _propTypes.default.object
|
|
267
|
+
selectedDocumentData: _propTypes.default.object,
|
|
268
|
+
showDownloadIcon: _propTypes.default.bool
|
|
266
269
|
};
|
|
267
270
|
CustomViewer.defaultProps = {
|
|
268
271
|
fileName: 'download',
|
|
269
272
|
antDesignProps: {},
|
|
270
273
|
downloadCallback: () => {},
|
|
271
|
-
selectedDocumentData: {}
|
|
274
|
+
selectedDocumentData: {},
|
|
275
|
+
showDownloadIcon: true
|
|
272
276
|
};
|
|
273
277
|
var _default = exports.default = CustomViewer;
|