oa-componentbook 1.0.1-stage.424 → 1.0.1-stage.425
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.
|
@@ -114,6 +114,7 @@ function DocumentUpload(_ref) {
|
|
|
114
114
|
const [selectedFile, setSelectedFile] = (0, _react.useState)(null);
|
|
115
115
|
const [selectedDocumentData, setSelectedDocumentData] = (0, _react.useState)({});
|
|
116
116
|
const [isError, setIsError] = (0, _react.useState)(false);
|
|
117
|
+
const uploadRef = _react.default.useRef(null);
|
|
117
118
|
(0, _react.useEffect)(() => {
|
|
118
119
|
setFileList(uploadedDocuments);
|
|
119
120
|
}, [uploadedDocuments === null || uploadedDocuments === void 0 ? void 0 : uploadedDocuments.length]);
|
|
@@ -241,6 +242,17 @@ function DocumentUpload(_ref) {
|
|
|
241
242
|
return /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null);
|
|
242
243
|
};
|
|
243
244
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.MainStyleSec, null, /*#__PURE__*/_react.default.createElement(_styles.StyledSection, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
245
|
+
onClick: listType === "picture" ? () => {
|
|
246
|
+
var _inst$upload, _inst$nativeElement, _inst$nativeElement$q, _inst$querySelector, _input$click;
|
|
247
|
+
if ((fileList === null || fileList === void 0 ? void 0 : fileList.length) >= noOfUpload) return;
|
|
248
|
+
const inst = uploadRef.current;
|
|
249
|
+
if (inst !== null && inst !== void 0 && inst.onClick) {
|
|
250
|
+
inst.onClick();
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const input = (inst === null || inst === void 0 || (_inst$upload = inst.upload) === null || _inst$upload === void 0 ? void 0 : _inst$upload.input) || (inst === null || inst === void 0 ? void 0 : inst.fileInput) || (inst === null || inst === void 0 || (_inst$nativeElement = inst.nativeElement) === null || _inst$nativeElement === void 0 || (_inst$nativeElement$q = _inst$nativeElement.querySelector) === null || _inst$nativeElement$q === void 0 ? void 0 : _inst$nativeElement$q.call(_inst$nativeElement, 'input[type="file"]')) || (inst === null || inst === void 0 || (_inst$querySelector = inst.querySelector) === null || _inst$querySelector === void 0 ? void 0 : _inst$querySelector.call(inst, 'input[type="file"]'));
|
|
254
|
+
input === null || input === void 0 || (_input$click = input.click) === null || _input$click === void 0 || _input$click.call(input);
|
|
255
|
+
} : null,
|
|
244
256
|
className: listType === "picture" ? "uploadSecPad ".concat(isError && "errorBorder") : "uploadDiv"
|
|
245
257
|
}, multipleDoc > 0 && /*#__PURE__*/_react.default.createElement("em", null, multipleDoc), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
246
258
|
theme: {
|
|
@@ -268,6 +280,8 @@ function DocumentUpload(_ref) {
|
|
|
268
280
|
}
|
|
269
281
|
}]
|
|
270
282
|
}, /*#__PURE__*/_react.default.createElement(_antd.Upload, _extends({
|
|
283
|
+
onClick: e => e.stopPropagation(),
|
|
284
|
+
ref: uploadRef,
|
|
271
285
|
listType: listType ? listType : "picture-card",
|
|
272
286
|
fileList: fileList,
|
|
273
287
|
onPreview: notShowPreviewButton ? undefined : handlePreview,
|