oa-componentbook 1.0.1-stage.416 → 1.0.1-stage.418

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.
@@ -282,14 +282,15 @@ function CustomSelect(_ref) {
282
282
  }
283
283
  } else if (value === allText) {
284
284
  newlySelectedOptions.length = 0; // Emptying the array.
285
- // If fixedValue has values, push them to newlySelectedOptions
286
- if ((fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.length) > 0) {
287
- fixedValue.forEach(val => safePush(newlySelectedOptions, val));
288
- }
289
285
  } else {
290
286
  var _newlySelectedOptions2;
291
287
  newlySelectedOptions.splice((_newlySelectedOptions2 = newlySelectedOptions.indexOf) === null || _newlySelectedOptions2 === void 0 ? void 0 : _newlySelectedOptions2.call(newlySelectedOptions, value), 1);
292
288
  }
289
+
290
+ // If fixedValue has values, push them to newlySelectedOptions
291
+ if ((fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.length) > 0) {
292
+ fixedValue.forEach(val => safePush(newlySelectedOptions, val));
293
+ }
293
294
  const optionsWithoutAllText = newlySelectedOptions.filter(option => option !== allText);
294
295
 
295
296
  // Passing the data to parent, using a callback.
@@ -250,7 +250,7 @@ function CustomTableV1(_ref2) {
250
250
  onClick: () => customTableChange(record, config)
251
251
  }) : (option === null || option === void 0 ? void 0 : option.type) === "tag" ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
252
252
  label: getByPath(record, option === null || option === void 0 ? void 0 : option.key) || "",
253
- type: (option === null || option === void 0 ? void 0 : option.tagType) || "primary",
253
+ type: getByPath(record, option === null || option === void 0 ? void 0 : option.tagType) || (option === null || option === void 0 ? void 0 : option.tagType) || "primary",
254
254
  visible: true
255
255
  }) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
256
256
  typography: (option === null || option === void 0 ? void 0 : option.typography) || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$option$styleK = record[option === null || option === void 0 ? void 0 : option.styleKey]) === null || _record$option$styleK === void 0 ? void 0 : _record$option$styleK.typography) || "type-b2-400",
@@ -260,6 +260,7 @@ function CustomTableV1(_ref2) {
260
260
  case "tag":
261
261
  const tagType = typeof subType === "function" ? subType(_, record) : subType;
262
262
  const tagLabel = label || _;
263
+ console.log("tagLabel", tagLabel);
263
264
  return tagLabel ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
264
265
  key: index,
265
266
  label: tagLabel,
@@ -109,6 +109,7 @@ function DocumentUpload(_ref) {
109
109
  const [deleteConfirmation, setDeleteConfirmation] = (0, _react.useState)(false);
110
110
  const [selectedFile, setSelectedFile] = (0, _react.useState)(null);
111
111
  const [selectedDocumentData, setSelectedDocumentData] = (0, _react.useState)({});
112
+ const [isError, setIsError] = (0, _react.useState)(false);
112
113
  (0, _react.useEffect)(() => {
113
114
  setFileList(uploadedDocuments);
114
115
  }, [uploadedDocuments === null || uploadedDocuments === void 0 ? void 0 : uploadedDocuments.length]);
@@ -135,12 +136,11 @@ function DocumentUpload(_ref) {
135
136
  file
136
137
  } = _ref2;
137
138
  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) {
139
+ const isError = newFileList.some(f => (f === null || f === void 0 ? void 0 : f.status) === "error");
140
+ if (isError) {
143
141
  setFileList([]);
142
+ setIsError(true);
143
+ setLoading(false);
144
144
  return;
145
145
  }
146
146
  setFileList(newFileList);
@@ -228,13 +228,13 @@ function DocumentUpload(_ref) {
228
228
  }
229
229
  // Show delete icon after upload is done or if upload failed
230
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);
231
+ return /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null);
232
232
  }
233
233
  // Default to delete icon
234
- return /*#__PURE__*/_react.default.createElement(_icons.DeleteFilled, null);
234
+ return /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null);
235
235
  };
236
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", {
237
- className: "uploadDiv"
237
+ className: listType === "picture" ? "uploadSecPad ".concat(isError && "errorBorder") : "uploadDiv"
238
238
  }, multipleDoc > 0 && /*#__PURE__*/_react.default.createElement("em", null, multipleDoc), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
239
239
  theme: {
240
240
  token: {
@@ -9,5 +9,5 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
  var _templateObject, _templateObject2;
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
- const MainStyleSec = exports.MainStyleSec = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-upload-list{\n display: flex !important;\n gap: 16px !important;\n flex-wrap: wrap !important;\n}\n.ant-upload-wrapper .ant-upload-list::before {\n display: none;\n}\n.ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload.ant-upload-select,.ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-container{\n width: 96px;\n height: 96px;\n margin-block: 0;\n margin-inline: 0;\n}\n.ant-upload-select button > span.UploadImg{\n width: 24px !important;\n height: 24px;\n}\n.ant-upload-select button > span.UploadImg > img{\n width: 100% !important;\n}\n.ant-upload-list-item-container:last-child{\n margin: 0 !important;\n}\n.ant-form-item{\n margin-bottom: 0;\n}\n.ant-upload button{\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n} \n\n.uploadSecPad div{\n padding: 0 0 8px;\n}\n.anticon-upload{\n font-size: 24px;\n}\n.ant-upload-disabled .button{\n cursor: not-allowed;\n}\n.uploadSecPad{\n width: 100%;\n}\n.uploadSecPad div:last-child{\n padding: 0;\n}\n display: flex;\n flex-direction: column;\n gap: 24px;\n .ant-upload-list-item-done,.ant-upload-list-item-A{\n border: 1px solid var(--color-divider) !important;\n }\n \n .ant-upload-list-item-actions{\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n }\n \n.ant-upload-list-item-actions button{\n background: #212121;\n border-radius: 50px;\n height: 24px !important;\n display: flex;\n align-items: center;\n}\n.ant-btn-text:not(:disabled):not(.ant-btn-disabled):hover{\n background: #212121;\n}\n .ant-upload-list-item-actions a{\n background: #212121;\n border-radius: 50px;\n height: 24px;\n display: flex;\n }\n \n .ant-upload-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item{\n opacity: 1 !important;\n }\n \n @media only screen and (max-width: 600px) {\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-container,.ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload.ant-upload-select{\n width: 64px;\n height: 64px;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item::before,.ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions,.ant-upload-wrapper .ant-upload-list .ant-upload-list-item .ant-upload-list-item-actions .ant-upload-list-item-action {\n opacity: 1;\n }\n .ant-upload-list-item-actions a {\n height: 16px;\n align-items: center;\n justify-content: center;\n width: 16px !important;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye, .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete {\n font-size: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0px !important;\n padding: 0px !important;\n color: #fff;\n}\n }\n"])));
13
- const StyledSection = exports.StyledSection = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: space-between;\n h2{\n margin: 0;\n }\n \n @media only screen and (max-width: 600px) {\n \n .ant-upload-list-item-actions button {\n height: 16px!important;\n width: 16px !important;\n justify-content: center;\n }\n .ant-upload-list-item-actions a {\n height: 16px;\n width: 16px !important;\n align-items: center;\n justify-content: center;\n}\n .ant-upload-list-item-actions {\n gap: 8px;\n }\n .ant-upload button span + div{\n display: none;\n }\n }\n"])));
12
+ const MainStyleSec = exports.MainStyleSec = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-upload-list {\n display: flex !important;\n gap: 16px !important;\n flex-wrap: wrap !important;\n }\n .ant-upload-wrapper .ant-upload-list::before {\n display: none;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload.ant-upload-select,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-container {\n width: 96px;\n height: 96px;\n margin-block: 0;\n margin-inline: 0;\n }\n .ant-upload-select button > span.UploadImg {\n width: 24px !important;\n height: 24px;\n }\n .ant-upload-select button > span.UploadImg > img {\n width: 100% !important;\n }\n .ant-upload-list-item-container:last-child {\n margin: 0 !important;\n }\n .ant-form-item {\n margin-bottom: 0;\n }\n .ant-upload button {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n }\n\n .uploadSecPad div {\n padding: 0 0 8px;\n }\n .anticon-upload {\n font-size: 24px;\n }\n .ant-upload-disabled .button {\n cursor: not-allowed;\n }\n .uploadSecPad {\n width: 100%;\n }\n .uploadSecPad div:last-child {\n padding: 0;\n }\n display: flex;\n flex-direction: column;\n gap: 24px;\n .ant-upload-list-item-done,\n .ant-upload-list-item-A {\n border: 1px solid var(--color-divider) !important;\n }\n\n .ant-upload-list-item-actions {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n }\n\n .ant-upload-list-item-actions button {\n background: #212121;\n border-radius: 50px;\n height: 24px !important;\n display: flex;\n align-items: center;\n }\n .ant-btn-text:not(:disabled):not(.ant-btn-disabled):hover {\n background: #212121;\n }\n .ant-upload-list-item-actions a {\n background: #212121;\n border-radius: 50px;\n height: 24px;\n display: flex;\n }\n\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item {\n opacity: 1 !important;\n }\n\n @media only screen and (max-width: 600px) {\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-container,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload.ant-upload-select {\n width: 64px;\n height: 64px;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item::before,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-actions,\n .ant-upload-wrapper\n .ant-upload-list\n .ant-upload-list-item\n .ant-upload-list-item-actions\n .ant-upload-list-item-action {\n opacity: 1;\n }\n .ant-upload-list-item-actions a {\n height: 16px;\n align-items: center;\n justify-content: center;\n width: 16px !important;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-actions\n .anticon-eye,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-actions\n .anticon-delete {\n font-size: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0px !important;\n padding: 0px !important;\n color: #fff;\n }\n }\n"])));
13
+ const StyledSection = exports.StyledSection = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .errorBorder {\n border: 1px dashed #de350b !important;\n }\n\n .uploadSecPad .ant-upload-list-picture {\n padding: 0 !important;\n gap: 0 !important;\n }\n\n .uploadSecPad\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture\n .ant-upload-list-item\n .ant-upload-list-item-progress {\n bottom: -2px;\n width: calc(100% - 24px);\n margin-top: 0;\n padding-inline-start: 34px;\n }\n\n .uploadSecPad .ant-upload-list-item-thumbnail {\n line-height: normal !important;\n width: 24px !important;\n height: 24px !important;\n padding: 0;\n }\n\n .uploadSecPad .ant-upload-list-item-thumbnail .anticon-file,\n .uploadSecPad .ant-upload-list-item-thumbnail .anticon-loading {\n font-size: 24px !important;\n color: #014fc5 !important;\n }\n\n .uploadSecPad .ant-upload-list-picture .ant-upload-list-item-done {\n border: none !important;\n margin: 0;\n padding: 0;\n height: auto;\n }\n\n .uploadSecPad .ant-upload-list-item-actions button,\n .uploadSecPad .ant-upload-list-item-actions button:hover {\n background: transparent !important;\n }\n\n .uploadSecPad .ant-upload-list-item-actions button .anticon-delete svg {\n color: #de350b;\n font-size: 18px;\n }\n\n .uploadSecPad\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture\n .ant-upload-list-item-uploading\n .ant-upload-list-item-name {\n color: #014fc5;\n }\n .uploadSecPad {\n width: 100%;\n border-radius: 4px;\n border: 1px dashed #014fc5;\n background: #f6f6f6;\n padding: 24px 16px;\n cursor: pointer;\n }\n\n .uploadSecPad .ant-upload-list-item-container {\n width: 100%;\n }\n\n .uploadSecPad button {\n display: flex;\n flex-direction: row;\n gap: 8px;\n padding: 0;\n margin: 0;\n color: #014fc5;\n cursor: pointer;\n }\n .uploadSecPad .ant-form-item-control-input {\n min-height: auto;\n }\n .uploadSecPad .ant-upload-select {\n padding: 0px;\n }\n display: flex;\n gap: 16px;\n justify-content: space-between;\n h2 {\n margin: 0;\n }\n\n .uploadSecPad\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture\n .ant-upload-list-item {\n height: auto;\n padding: 0;\n border: none;\n border-radius: 0;\n border-style: none !important;\n margin: 0;\n }\n\n @media only screen and (max-width: 600px) {\n .ant-upload-list-item-actions button {\n height: 16px !important;\n width: 16px !important;\n justify-content: center;\n }\n .ant-upload-list-item-actions a {\n height: 16px;\n width: 16px !important;\n align-items: center;\n justify-content: center;\n }\n .ant-upload-list-item-actions {\n gap: 8px;\n }\n .ant-upload button span + div {\n display: none;\n }\n }\n"])));
@@ -838,7 +838,7 @@ function GenricLayOut(_ref) {
838
838
  } else {
839
839
  if ((data === null || data === void 0 ? void 0 : data.call) === "parent") {
840
840
  handleTableColumnClickParent({
841
- data
841
+ record
842
842
  });
843
843
  } else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.type) === "openNestedDrawer") {
844
844
  var _config$nestedDrawer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-componentbook",
3
- "version": "1.0.1-stage.416",
3
+ "version": "1.0.1-stage.418",
4
4
  "private": false,
5
5
  "description": "Reusable components",
6
6
  "main": "build/index.js",