oa-componentbook 1.0.1-stage.412 → 1.0.1-stage.414
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/build/components/oa-component-accordion/Accordion.js +4 -2
- package/build/components/oa-component-modal/CustomModal.js +6 -3
- package/build/dev/oa-component-upload/CustomUpload.js +107 -45
- package/build/layout/GenricLayOut/GenricLayOut.js +7 -2
- package/build/layout/GenricLayOut/components/Modal.js +3 -2
- package/build/widgets/oa-widget-sidebar/styles.js +1 -1
- package/package.json +1 -1
|
@@ -92,7 +92,8 @@ function Accordion(_ref2) {
|
|
|
92
92
|
componentConfig,
|
|
93
93
|
subtext,
|
|
94
94
|
customBody,
|
|
95
|
-
onActionClick
|
|
95
|
+
onActionClick,
|
|
96
|
+
collapsibleActiveKey
|
|
96
97
|
} = _ref2;
|
|
97
98
|
const themeConfig = {
|
|
98
99
|
components: {
|
|
@@ -108,7 +109,8 @@ function Accordion(_ref2) {
|
|
|
108
109
|
expandIcon: CollapseIcon,
|
|
109
110
|
expandIconPosition: "end",
|
|
110
111
|
defaultActiveKey: disabled ? "-1" : defaultActiveKey,
|
|
111
|
-
onChange: onChange
|
|
112
|
+
onChange: onChange,
|
|
113
|
+
activeKey: collapsibleActiveKey
|
|
112
114
|
}, /*#__PURE__*/_react.default.createElement(_antd.Collapse.Panel, {
|
|
113
115
|
"data-test": dataTest ? "".concat(dataTest, "--complete") : undefined,
|
|
114
116
|
collapsible: disabled ? "disabled" : undefined,
|
|
@@ -14,7 +14,7 @@ var _Typography = _interopRequireDefault(require("../oa-component-typography/Typ
|
|
|
14
14
|
var _typographyOptions = require("../../global-css/typography-options");
|
|
15
15
|
var _utils = require("../../utils");
|
|
16
16
|
var _styles = require("./styles");
|
|
17
|
-
const _excluded = ["buttonConfig", "children", "data-test", "imgSrc", "onCancel", "open", "title", "typographies", "width", "bgColor", "showCloseIcon"];
|
|
17
|
+
const _excluded = ["buttonConfig", "children", "data-test", "imgSrc", "onCancel", "open", "title", "typographies", "width", "bgColor", "showCloseIcon", "maskClosable"];
|
|
18
18
|
/* eslint-disable */
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -63,7 +63,9 @@ function CustomModal(_ref) {
|
|
|
63
63
|
typographies,
|
|
64
64
|
width,
|
|
65
65
|
bgColor,
|
|
66
|
-
showCloseIcon = true
|
|
66
|
+
showCloseIcon = true,
|
|
67
|
+
// Add this prop with default value
|
|
68
|
+
maskClosable = true // Control whether clicking mask closes modal
|
|
67
69
|
} = _ref,
|
|
68
70
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
69
71
|
/*
|
|
@@ -107,7 +109,8 @@ function CustomModal(_ref) {
|
|
|
107
109
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
108
110
|
typography: typographies.title
|
|
109
111
|
}, title)),
|
|
110
|
-
width: width
|
|
112
|
+
width: width,
|
|
113
|
+
maskClosable: maskClosable
|
|
111
114
|
}, props), children && /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null,
|
|
112
115
|
// The label is a string or a number
|
|
113
116
|
((0, _utils.isString)(children) || (0, _utils.isNumber)(children)) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -18,7 +18,7 @@ var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorV
|
|
|
18
18
|
var _handIcon = _interopRequireDefault(require("../../images/hand-icon.svg"));
|
|
19
19
|
var _PdfSampleImage = _interopRequireDefault(require("../../images/PdfSampleImage.png"));
|
|
20
20
|
var _styles = require("./styles");
|
|
21
|
-
const _excluded = ["uploadedDocuments", "handleCustomOnChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "showDownloadButton", "showDeleteButton", "deleteHandler", "showRoateButton", "showZoomInButton", "showZoomOutButton"];
|
|
21
|
+
const _excluded = ["uploadedDocuments", "handleCustomOnChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "showDownloadButton", "showDeleteButton", "deleteHandler", "showRoateButton", "showZoomInButton", "showZoomOutButton", "uploadButtonConfig", "notShowPreviewButton", "listType", "deleteModalConfig"];
|
|
22
22
|
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); }
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -44,18 +44,18 @@ const getBase64 = file => new Promise((resolve, reject) => {
|
|
|
44
44
|
* @returns {undefined}
|
|
45
45
|
*/
|
|
46
46
|
const downloadFile = (base64String, fileName) => {
|
|
47
|
-
const link = document.createElement(
|
|
47
|
+
const link = document.createElement("a");
|
|
48
48
|
link.href = base64String;
|
|
49
|
-
link.download = fileName ||
|
|
49
|
+
link.download = fileName || "download";
|
|
50
50
|
link.click();
|
|
51
51
|
};
|
|
52
52
|
function isImageFile(fileName) {
|
|
53
53
|
var _fileName$split;
|
|
54
54
|
// Extract the file extension from the file name
|
|
55
|
-
const fileExtension = fileName === null || fileName === void 0 || (_fileName$split = fileName.split(
|
|
55
|
+
const fileExtension = fileName === null || fileName === void 0 || (_fileName$split = fileName.split(".")) === null || _fileName$split === void 0 || (_fileName$split = _fileName$split.pop()) === null || _fileName$split === void 0 ? void 0 : _fileName$split.toLowerCase();
|
|
56
56
|
|
|
57
57
|
// Define an array of image file extensions
|
|
58
|
-
const imageFileExtensions = [
|
|
58
|
+
const imageFileExtensions = ["jpg", "jpeg", "png"];
|
|
59
59
|
|
|
60
60
|
// Check if the file extension is in the array of image file extensions
|
|
61
61
|
if (imageFileExtensions.indexOf(fileExtension) !== -1) {
|
|
@@ -94,12 +94,16 @@ function DocumentUpload(_ref) {
|
|
|
94
94
|
deleteHandler,
|
|
95
95
|
showRoateButton,
|
|
96
96
|
showZoomInButton,
|
|
97
|
-
showZoomOutButton
|
|
97
|
+
showZoomOutButton,
|
|
98
|
+
uploadButtonConfig,
|
|
99
|
+
notShowPreviewButton,
|
|
100
|
+
listType,
|
|
101
|
+
deleteModalConfig
|
|
98
102
|
} = _ref,
|
|
99
103
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
100
104
|
const [previewOpen, setPreviewOpen] = (0, _react.useState)(false);
|
|
101
105
|
const [previewImage, setPreviewImage] = (0, _react.useState)(null);
|
|
102
|
-
const [previewTitle, setPreviewTitle] = (0, _react.useState)(
|
|
106
|
+
const [previewTitle, setPreviewTitle] = (0, _react.useState)("");
|
|
103
107
|
const [loading, setLoading] = (0, _react.useState)(false);
|
|
104
108
|
const [fileList, setFileList] = (0, _react.useState)(uploadedDocuments);
|
|
105
109
|
const [deleteConfirmation, setDeleteConfirmation] = (0, _react.useState)(false);
|
|
@@ -109,9 +113,13 @@ function DocumentUpload(_ref) {
|
|
|
109
113
|
setFileList(uploadedDocuments);
|
|
110
114
|
}, [uploadedDocuments === null || uploadedDocuments === void 0 ? void 0 : uploadedDocuments.length]);
|
|
111
115
|
const handlePreview = async file => {
|
|
116
|
+
// Don't show preview if notShowPreviewButton is true
|
|
117
|
+
if (notShowPreviewButton) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
112
120
|
if (file !== null && file !== void 0 && file.originFileObj) {
|
|
113
121
|
setPreviewImage(file);
|
|
114
|
-
} else if ((file === null || file === void 0 ? void 0 : file.fileType) ===
|
|
122
|
+
} else if ((file === null || file === void 0 ? void 0 : file.fileType) === "thumbnail") {
|
|
115
123
|
const url = await getPreview();
|
|
116
124
|
setPreviewImage(url);
|
|
117
125
|
} else {
|
|
@@ -126,16 +134,31 @@ function DocumentUpload(_ref) {
|
|
|
126
134
|
fileList: newFileList,
|
|
127
135
|
file
|
|
128
136
|
} = _ref2;
|
|
137
|
+
if (antDesignProps !== null && antDesignProps !== void 0 && antDesignProps.customRequest) {
|
|
138
|
+
const isMaxFileSize = newFileList.some(f => {
|
|
139
|
+
var _f$error;
|
|
140
|
+
return (f === null || f === void 0 || (_f$error = f.error) === null || _f$error === void 0 ? void 0 : _f$error.status) !== "MAX_FILE_SIZE";
|
|
141
|
+
});
|
|
142
|
+
if (isMaxFileSize) {
|
|
143
|
+
setFileList([]);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
setFileList(newFileList);
|
|
147
|
+
const isUploading = newFileList.some(f => f.status === "uploading");
|
|
148
|
+
setLoading(isUploading);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Default behavior for non-custom uploads
|
|
129
153
|
const modifiedList = await Promise.all(newFileList.map(async files => {
|
|
130
154
|
let modifiedFile = files;
|
|
131
155
|
setLoading(true);
|
|
132
156
|
try {
|
|
133
157
|
if ((file === null || file === void 0 ? void 0 : file.uid) === (files === null || files === void 0 ? void 0 : files.uid)) {
|
|
134
158
|
await handleCustomOnChange(files);
|
|
135
|
-
modifiedFile.status =
|
|
159
|
+
modifiedFile.status = "done";
|
|
136
160
|
if (!isImageFile(file === null || file === void 0 ? void 0 : file.name)) {
|
|
137
161
|
modifiedFile.url = _PdfSampleImage.default;
|
|
138
|
-
// delete modifiedFile?.type;
|
|
139
162
|
}
|
|
140
163
|
}
|
|
141
164
|
} catch (error) {
|
|
@@ -147,48 +170,81 @@ function DocumentUpload(_ref) {
|
|
|
147
170
|
const tempList = modifiedList === null || modifiedList === void 0 ? void 0 : modifiedList.filter(Boolean);
|
|
148
171
|
setFileList(tempList);
|
|
149
172
|
};
|
|
173
|
+
const getUploadButtonIcon = () => {
|
|
174
|
+
if ((uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.icon) === "PlusOutlined") {
|
|
175
|
+
return /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null);
|
|
176
|
+
}
|
|
177
|
+
return /*#__PURE__*/_react.default.createElement(_icons.UploadOutlined, null);
|
|
178
|
+
};
|
|
150
179
|
const uploadButton = /*#__PURE__*/_react.default.createElement("button", {
|
|
151
180
|
style: {
|
|
152
181
|
border: 0,
|
|
153
|
-
background:
|
|
182
|
+
background: "none"
|
|
154
183
|
},
|
|
155
184
|
type: "button"
|
|
156
|
-
}, loading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) :
|
|
157
|
-
/*#__PURE__*/
|
|
158
|
-
// <CustomIcon
|
|
159
|
-
// className="UploadImg"
|
|
160
|
-
// alt="phone img"
|
|
161
|
-
// src={offerImg}
|
|
162
|
-
// />
|
|
163
|
-
_react.default.createElement(_icons.UploadOutlined, null), /*#__PURE__*/_react.default.createElement("div", null, "Upload"));
|
|
185
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) : getUploadButtonIcon(), /*#__PURE__*/_react.default.createElement("div", null, uploadButtonConfig !== null && uploadButtonConfig !== void 0 && uploadButtonConfig.text ? uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.text : "Upload"));
|
|
164
186
|
const DeleteFile = async () => {
|
|
165
|
-
await deleteHandler(selectedFile
|
|
187
|
+
await deleteHandler(selectedFile, isEmptyFileList => {
|
|
188
|
+
if (isEmptyFileList) {
|
|
189
|
+
setFileList([]);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
166
192
|
setDeleteConfirmation(false);
|
|
167
193
|
if (showDeleteButton) {
|
|
168
194
|
setPreviewOpen(false);
|
|
169
195
|
}
|
|
170
196
|
};
|
|
171
197
|
const handleRemove = file => new Promise((resolve, reject) => {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
198
|
+
// If file is uploading, cancel immediately without confirmation
|
|
199
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === "uploading") {
|
|
200
|
+
// Remove file from list immediately to cancel upload
|
|
201
|
+
const newFileList = fileList.filter(f => f.uid !== file.uid);
|
|
202
|
+
setFileList(newFileList);
|
|
203
|
+
resolve(true); // Allow removal
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// If file is done or error, show confirmation modal
|
|
208
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === "done" || (file === null || file === void 0 ? void 0 : file.status) === "error") {
|
|
209
|
+
setSelectedFile(file);
|
|
210
|
+
setDeleteConfirmation(true);
|
|
211
|
+
resolve(false); // Prevent removal until confirmed
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Default: allow removal
|
|
216
|
+
resolve(true);
|
|
175
217
|
});
|
|
176
218
|
const handleModalDeleteButton = file => {
|
|
177
219
|
setSelectedFile(file);
|
|
178
220
|
setDeleteConfirmation(true);
|
|
179
221
|
};
|
|
222
|
+
|
|
223
|
+
// Get the appropriate remove icon based on file status
|
|
224
|
+
const getRemoveIcon = file => {
|
|
225
|
+
// Show cross icon during upload (to cancel)
|
|
226
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === "uploading") {
|
|
227
|
+
return /*#__PURE__*/_react.default.createElement(_icons.CloseOutlined, null);
|
|
228
|
+
}
|
|
229
|
+
// Show delete icon after upload is done or if upload failed
|
|
230
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === "done" || (file === null || file === void 0 ? void 0 : file.status) === "error") {
|
|
231
|
+
return /*#__PURE__*/_react.default.createElement(_icons.DeleteFilled, null);
|
|
232
|
+
}
|
|
233
|
+
// Default to delete icon
|
|
234
|
+
return /*#__PURE__*/_react.default.createElement(_icons.DeleteFilled, null);
|
|
235
|
+
};
|
|
180
236
|
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", {
|
|
181
237
|
className: "uploadDiv"
|
|
182
238
|
}, multipleDoc > 0 && /*#__PURE__*/_react.default.createElement("em", null, multipleDoc), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
183
239
|
theme: {
|
|
184
240
|
token: {
|
|
185
|
-
colorBorder: _ColorVariablesMap.default[
|
|
241
|
+
colorBorder: _ColorVariablesMap.default["--color-divider"],
|
|
186
242
|
borderRadiusLG: 4,
|
|
187
|
-
colorPrimaryHover: _ColorVariablesMap.default[
|
|
188
|
-
colorPrimaryBorder: _ColorVariablesMap.default[
|
|
189
|
-
colorFillAlter: _ColorVariablesMap.default[
|
|
190
|
-
colorError: _ColorVariablesMap.default[
|
|
191
|
-
colorText: _ColorVariablesMap.default[
|
|
243
|
+
colorPrimaryHover: _ColorVariablesMap.default["--color-primary"],
|
|
244
|
+
colorPrimaryBorder: _ColorVariablesMap.default["--color-divider"],
|
|
245
|
+
colorFillAlter: _ColorVariablesMap.default["--color-secondary-background"],
|
|
246
|
+
colorError: _ColorVariablesMap.default["--color-negative"],
|
|
247
|
+
colorText: _ColorVariablesMap.default["--color-secondary-content"]
|
|
192
248
|
}
|
|
193
249
|
}
|
|
194
250
|
}, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
@@ -196,27 +252,28 @@ function DocumentUpload(_ref) {
|
|
|
196
252
|
rules: [{
|
|
197
253
|
validator: (rule, value) => {
|
|
198
254
|
if (isMandatory && !(value !== null && value !== void 0 && value.length)) {
|
|
199
|
-
if (typeof value ===
|
|
255
|
+
if (typeof value === "object" && Object.keys(value).length > 0) {
|
|
200
256
|
return Promise.resolve();
|
|
201
257
|
}
|
|
202
|
-
return Promise.reject(new Error(
|
|
258
|
+
return Promise.reject(new Error("Please upload the document."));
|
|
203
259
|
}
|
|
204
260
|
return Promise.resolve();
|
|
205
261
|
}
|
|
206
262
|
}]
|
|
207
263
|
}, /*#__PURE__*/_react.default.createElement(_antd.Upload, _extends({
|
|
208
|
-
|
|
209
|
-
listType: "picture-card",
|
|
264
|
+
listType: listType ? listType : "picture-card",
|
|
210
265
|
fileList: fileList,
|
|
211
|
-
onPreview: handlePreview,
|
|
266
|
+
onPreview: notShowPreviewButton ? undefined : handlePreview,
|
|
212
267
|
onChange: handleChange,
|
|
213
268
|
onRemove: handleRemove,
|
|
214
269
|
showUploadList: {
|
|
215
270
|
showDownloadIcon: false,
|
|
216
|
-
showRemoveIcon: showDelete,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
271
|
+
showRemoveIcon: showDelete !== undefined ? showDelete : true,
|
|
272
|
+
showPreviewIcon: !notShowPreviewButton,
|
|
273
|
+
removeIcon: file => getRemoveIcon(file),
|
|
274
|
+
previewIcon: notShowPreviewButton ? false : /*#__PURE__*/_react.default.createElement(_icons.EyeFilled, null)
|
|
275
|
+
},
|
|
276
|
+
maxCount: noOfUpload
|
|
220
277
|
}, antDesignProps), (fileList === null || fileList === void 0 ? void 0 : fileList.length) >= noOfUpload ? null : uploadButton)))))), previewOpen && /*#__PURE__*/_react.default.createElement(_CustomViewer.default, {
|
|
221
278
|
open: previewOpen,
|
|
222
279
|
previewFile: previewImage,
|
|
@@ -233,15 +290,15 @@ function DocumentUpload(_ref) {
|
|
|
233
290
|
}), deleteConfirmation && /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
234
291
|
buttonConfig: [{
|
|
235
292
|
callback: () => DeleteFile(),
|
|
236
|
-
label:
|
|
237
|
-
type:
|
|
293
|
+
label: "Yes, Delete",
|
|
294
|
+
type: "danger-primary"
|
|
238
295
|
}],
|
|
239
296
|
imgSrc: _handIcon.default,
|
|
240
297
|
open: deleteConfirmation,
|
|
241
298
|
onCancel: () => setDeleteConfirmation(false),
|
|
242
|
-
title: "Delete Item?",
|
|
299
|
+
title: deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.title ? deleteModalConfig.title : "Delete Item?",
|
|
243
300
|
className: "delete-modal-confirmation"
|
|
244
|
-
}, "This action will permanently delete the selected item"));
|
|
301
|
+
}, deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.body ? deleteModalConfig.body : "This action will permanently delete the selected item"));
|
|
245
302
|
}
|
|
246
303
|
DocumentUpload.propTypes = {
|
|
247
304
|
uploadedDocuments: _propTypes.default.array,
|
|
@@ -262,12 +319,15 @@ DocumentUpload.propTypes = {
|
|
|
262
319
|
showDeleteButton: _propTypes.default.bool,
|
|
263
320
|
showRoateButton: _propTypes.default.bool,
|
|
264
321
|
showZoomInButton: _propTypes.default.bool,
|
|
265
|
-
showZoomOutButton: _propTypes.default.bool
|
|
322
|
+
showZoomOutButton: _propTypes.default.bool,
|
|
323
|
+
uploadButtonConfig: _propTypes.default.object,
|
|
324
|
+
// Config for upload button text
|
|
325
|
+
notShowPreviewButton: _propTypes.default.bool // Hide preview button
|
|
266
326
|
};
|
|
267
327
|
DocumentUpload.defaultProps = {
|
|
268
328
|
uploadedDocuments: [],
|
|
269
329
|
handleCustomOnChange: () => {},
|
|
270
|
-
formName:
|
|
330
|
+
formName: "",
|
|
271
331
|
multipleDoc: 0,
|
|
272
332
|
showDelete: true,
|
|
273
333
|
getPreview: () => {},
|
|
@@ -280,6 +340,8 @@ DocumentUpload.defaultProps = {
|
|
|
280
340
|
showDownloadButton: true,
|
|
281
341
|
showRoateButton: true,
|
|
282
342
|
showZoomInButton: true,
|
|
283
|
-
showZoomOutButton: true
|
|
343
|
+
showZoomOutButton: true,
|
|
344
|
+
uploadButtonConfig: null,
|
|
345
|
+
notShowPreviewButton: false
|
|
284
346
|
};
|
|
285
347
|
var _default = exports.default = DocumentUpload;
|
|
@@ -81,7 +81,8 @@ function GenricLayOut(_ref) {
|
|
|
81
81
|
handleCollapsibleKeyData,
|
|
82
82
|
handleProfileReroute,
|
|
83
83
|
handleTableFooterApi,
|
|
84
|
-
handleSwitchSelectItem
|
|
84
|
+
handleSwitchSelectItem,
|
|
85
|
+
handleTableColumnClickParent
|
|
85
86
|
} = {}
|
|
86
87
|
} = _ref;
|
|
87
88
|
const [state, dispatch] = (0, _react.useReducer)(_layoutReducer.genericLayoutReducer, config !== null && config !== void 0 ? config : _layoutReducer.initialState);
|
|
@@ -835,7 +836,11 @@ function GenricLayOut(_ref) {
|
|
|
835
836
|
if (error) {
|
|
836
837
|
showErrorNotification(error);
|
|
837
838
|
} else {
|
|
838
|
-
if ((
|
|
839
|
+
if ((data === null || data === void 0 ? void 0 : data.call) === "parent") {
|
|
840
|
+
handleTableColumnClickParent({
|
|
841
|
+
data
|
|
842
|
+
});
|
|
843
|
+
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.type) === "openNestedDrawer") {
|
|
839
844
|
var _config$nestedDrawer;
|
|
840
845
|
const record = config === null || config === void 0 || (_config$nestedDrawer = config.nestedDrawer) === null || _config$nestedDrawer === void 0 || (_config$nestedDrawer = _config$nestedDrawer.data) === null || _config$nestedDrawer === void 0 ? void 0 : _config$nestedDrawer.cancelOrder;
|
|
841
846
|
const dynamicConfig = (0, _staticConfigResolver.default)(record, data !== null && data !== void 0 ? data : {});
|
|
@@ -22,7 +22,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
22
22
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
23
23
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable */
|
|
24
24
|
function LayoutModal(_ref) {
|
|
25
|
-
var _modal$jsxConfig;
|
|
25
|
+
var _modal$jsxConfig, _modal$modalContent14;
|
|
26
26
|
let {
|
|
27
27
|
modal,
|
|
28
28
|
onCancel,
|
|
@@ -84,7 +84,8 @@ function LayoutModal(_ref) {
|
|
|
84
84
|
imgSrc: modal === null || modal === void 0 ? void 0 : modal.imgSrc,
|
|
85
85
|
buttonConfig: getModalButtonConfig(modal === null || modal === void 0 || (_modal$jsxConfig = modal.jsxConfig) === null || _modal$jsxConfig === void 0 ? void 0 : _modal$jsxConfig.buttonConfig),
|
|
86
86
|
bgColor: modal === null || modal === void 0 ? void 0 : modal.bgColor,
|
|
87
|
-
showCloseIcon: modal === null || modal === void 0 ? void 0 : modal.showCloseIcon
|
|
87
|
+
showCloseIcon: modal === null || modal === void 0 ? void 0 : modal.showCloseIcon,
|
|
88
|
+
maskClosable: (modal === null || modal === void 0 || (_modal$modalContent14 = modal.modalContent) === null || _modal$modalContent14 === void 0 ? void 0 : _modal$modalContent14.backClickDisable) === true ? false : (modal === null || modal === void 0 ? void 0 : modal.maskClosable) !== undefined ? modal === null || modal === void 0 ? void 0 : modal.maskClosable : true
|
|
88
89
|
}, render());
|
|
89
90
|
}
|
|
90
91
|
LayoutModal.propTypes = {
|
|
@@ -8,6 +8,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2; // styles.js
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const OalayoutStyle = _styledComponents.default.aside(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .oaLeftLayouts {\n padding: 24px 8px;\n background: #f6f6f6;\n height:
|
|
11
|
+
const OalayoutStyle = _styledComponents.default.aside(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .oaLeftLayouts {\n padding: 24px 8px;\n background: #f6f6f6;\n height: auto;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .logoContainer {\n padding: 12px;\n display: flex;\n justify-content: space-between;\n height: 110px;\n width: 220px;\n align-items: center;\n margin: 0 0 16px 0;\n }\n\n .logoutDiv {\n display: flex;\n flex-direction: row;\n margin: 48px 0 0 16px;\n gap: 8px;\n cursor: pointer;\n }\n\n .leftLogoSec {\n display: flex;\n flex-direction: row;\n gap: 8px;\n }\n\n .logo-mobile-height {\n height: auto;\n }\n\n // .logoContainer em {\n // width: 1px;\n // background: #e0e0e0;\n // }\n // .logoContainer img {\n // height: 32px;\n // }\n .ant-layout-sider-light,\n .ant-menu-light {\n background: transparent;\n }\n\n /* Regular menu items */\n .ant-menu-item {\n padding: 16px;\n border-radius: 50px;\n margin: 0 0 8px;\n height: auto;\n line-height: normal;\n border-radius: 999px;\n border: 1px solid #e0e0e0;\n background: #fff;\n }\n\n /* SubMenu title styling - this is the parent item - same size as regular items */\n .ant-menu-submenu-title {\n padding: 24px;\n border-radius: 50px;\n margin: 0 0 8px;\n height: auto;\n line-height: normal;\n border-radius: 999px;\n border: 1px solid #e0e0e0;\n background: #fff;\n display: flex;\n align-items: center;\n }\n\n /* SubMenu items - these are the children - should be plain text */\n .ant-menu-submenu .ant-menu-item {\n margin: 8px 0;\n padding: 8px 24px;\n border-radius: 0;\n background: transparent;\n border: none;\n margin-left: 16px;\n color: #666;\n font-size: 14px;\n height: auto;\n line-height: 1.4;\n }\n\n /* Add extra spacing for last nested item */\n .ant-menu-submenu .ant-menu-item:last-child {\n margin-bottom: 12px;\n }\n\n /* REMOVED: Open SubMenu styling - this was making ALL open submenus blue */\n /* .ant-menu-submenu-open > .ant-menu-submenu-title {\n background: #014fc5;\n color: #fff;\n padding: 24px; \n } */\n\n /* NEW: Only make parent blue when it contains a selected child */\n .ant-menu-submenu-open:has(.ant-menu-item-selected)\n > .ant-menu-submenu-title {\n background: #014fc5;\n color: #fff;\n padding: 24px;\n }\n\n /* Fallback for browsers that don't support :has() */\n .ant-menu-submenu-open > .ant-menu-submenu-title {\n background: #fff;\n color: #000;\n padding: 24px;\n }\n\n /* SubMenu title content */\n .ant-menu-item .ant-menu-title-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n\n .ant-menu-submenu-title .ant-menu-title-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n\n /* Add styling to span elements inside SubMenu title content */\n .ant-menu-submenu-title .ant-menu-title-content span {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n\n /* Selected states */\n .ant-menu-item-active {\n background: #014fc5;\n color: #fff;\n }\n .ant-menu-item-selected {\n background: #014fc5;\n color: #fff;\n }\n\n /* SubMenu selected item - should be bold black when selected */\n .ant-menu-submenu .ant-menu-item-selected {\n background: transparent;\n color: #000;\n font-weight: bold;\n border-radius: 0;\n }\n\n /* Hover effects */\n .ant-menu-light:not(.ant-menu-horizontal)\n .ant-menu-item:not(.ant-menu-item-selected):hover,\n :where(.css-dev-only-do-not-override-zcfrx9).ant-menu-light\n > .ant-menu:not(.ant-menu-horizontal)\n .ant-menu-item:not(.ant-menu-item-selected):hover {\n background: #014fc5;\n color: #fff;\n }\n\n /* SubMenu title hover - should be blue on hover */\n .ant-menu-submenu-title:hover {\n background: #014fc5 !important;\n color: #fff !important;\n padding: 24px !important;\n }\n\n /* Nested items hover - should be bold black when hovered */\n .ant-menu-submenu .ant-menu-item:hover {\n background: transparent !important;\n color: #000 !important;\n font-weight: bold !important;\n border-radius: 0;\n }\n\n /* Make Orders parent blue when hovering over submenu items */\n .ant-menu-submenu:hover .ant-menu-submenu-title {\n background: #014fc5 !important;\n color: #fff !important;\n padding: 24px !important;\n }\n\n .ant-menu-light.ant-menu-root.ant-menu-inline {\n border: none;\n }\n\n /* SubMenu arrow styling */\n .ant-menu-submenu-arrow {\n color: inherit;\n }\n\n /* SubMenu content area */\n .ant-menu-sub {\n background: transparent !important;\n padding: 8px 0;\n }\n\n /* Remove default SubMenu styling */\n .ant-menu-submenu .ant-menu-sub {\n background: transparent !important;\n box-shadow: none !important;\n }\n\n .notShowInDesktop {\n display: none;\n }\n\n .footerLogoSection {\n margin-top: auto;\n margin-bottom: 40px;\n padding: 0 16px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n width: 172px;\n height: 75px;\n }\n\n .footerLogoContainer {\n display: flex;\n align-items: center;\n }\n\n .footerLogo {\n width: 172px;\n height: 43px;\n }\n\n @media only screen and (max-width: 600px) {\n .oaLeftLayouts {\n background: #fff;\n padding: 0 16px;\n height: auto;\n display: block;\n }\n .logoContainer {\n padding: 0;\n align-items: center;\n width: 100%;\n height: 80px;\n }\n\n .logo-mobile-height {\n height: 56px;\n }\n\n .notShowInMobile {\n display: none;\n }\n .notShowInDesktop {\n display: flex;\n }\n\n .oaLeftLayouts .ant-layout-sider {\n max-width: none !important;\n width: 100% !important;\n }\n p.ant-dropdown-trigger {\n margin-bottom: 0;\n }\n .layoutHeadingPage * {\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"])));
|
|
12
12
|
const ProfileIcon = exports.ProfileIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--color-primary);\n\n &:hover {\n transform: scale(1.05);\n }\n"])));
|
|
13
13
|
var _default = exports.default = OalayoutStyle;
|