oa-componentbook 1.0.1-stage.415 → 1.0.1-stage.417

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.
@@ -22,7 +22,7 @@ var _Typography = _interopRequireDefault(require("../oa-component-typography/Typ
22
22
  var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
23
23
  require("antd/dist/reset.css");
24
24
  var _Elevation = require("../../global-css/Elevation");
25
- const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder", "maxSelectForMultiSelect", "onCustomSelect"],
25
+ const _excluded = ["allText", "children", "defaultValue", "data-test", "mode", "onSelectionChange", "options", "placeholder", "maxSelectForMultiSelect", "onCustomSelect", "fixedValue"],
26
26
  _excluded2 = ["label", "disabled", "value"];
27
27
  var _templateObject;
28
28
  /* eslint-disable */
@@ -82,7 +82,8 @@ function CustomSelect(_ref) {
82
82
  options,
83
83
  placeholder,
84
84
  maxSelectForMultiSelect,
85
- onCustomSelect
85
+ onCustomSelect,
86
+ fixedValue
86
87
  } = _ref,
87
88
  props = _objectWithoutProperties(_ref, _excluded);
88
89
  // If allText is present in default values, we select all the options manually.
@@ -281,6 +282,10 @@ function CustomSelect(_ref) {
281
282
  }
282
283
  } else if (value === allText) {
283
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
+ }
284
289
  } else {
285
290
  var _newlySelectedOptions2;
286
291
  newlySelectedOptions.splice((_newlySelectedOptions2 = newlySelectedOptions.indexOf) === null || _newlySelectedOptions2 === void 0 ? void 0 : _newlySelectedOptions2.call(newlySelectedOptions, value), 1);
@@ -416,7 +421,8 @@ CustomSelect.propTypes = {
416
421
  })),
417
422
  size: _propTypes.default.oneOf(["small", "middle"]),
418
423
  placeholder: _propTypes.default.string,
419
- maxSelectForMultiSelect: _propTypes.default.number
424
+ maxSelectForMultiSelect: _propTypes.default.number,
425
+ fixedValue: _propTypes.default.arrayOf(_propTypes.default.string)
420
426
  };
421
427
  CustomSelect.defaultProps = {
422
428
  allText: null,
@@ -428,5 +434,6 @@ CustomSelect.defaultProps = {
428
434
  options: [],
429
435
  size: "middle",
430
436
  placeholder: "",
431
- maxSelectForMultiSelect: null
437
+ maxSelectForMultiSelect: null,
438
+ fixedValue: []
432
439
  };
@@ -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.415",
3
+ "version": "1.0.1-stage.417",
4
4
  "private": false,
5
5
  "description": "Reusable components",
6
6
  "main": "build/index.js",