oa-componentbook 1.0.1-stage.439 → 1.0.1-stage.440

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.
@@ -18,6 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
18
18
  * @param {number} totalStep - The total number of steps in the progress.
19
19
  * @param {string} headingColor - The color used for the step text heading.
20
20
  * @param {string} barColor - The color used for the progress bar.
21
+ * @param {boolean} showStepText - Whether to display the step text (Step X out of Y).
21
22
  *
22
23
  * @returns {React.ReactElement} A component displaying the current progress.
23
24
  */
@@ -26,9 +27,10 @@ function ProgressBar(_ref) {
26
27
  currentStep,
27
28
  totalStep,
28
29
  headingColor,
29
- barColor
30
+ barColor,
31
+ showStepText
30
32
  } = _ref;
31
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
33
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showStepText && /*#__PURE__*/_react.default.createElement("div", {
32
34
  className: "margin-bottom-8"
33
35
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
34
36
  color: headingColor,
@@ -57,12 +59,14 @@ ProgressBar.propTypes = {
57
59
  currentStep: _propTypes.default.number,
58
60
  totalStep: _propTypes.default.number,
59
61
  headingColor: _propTypes.default.string,
60
- barColor: _propTypes.default.string
62
+ barColor: _propTypes.default.string,
63
+ showStepText: _propTypes.default.bool
61
64
  };
62
65
  ProgressBar.defaultProps = {
63
66
  currentStep: 1,
64
67
  totalStep: 1,
65
68
  headingColor: 'positive',
66
- barColor: 'positive'
69
+ barColor: 'positive',
70
+ showStepText: true
67
71
  };
68
72
  var _default = exports.default = ProgressBar;
@@ -41,7 +41,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
41
41
  const {
42
42
  Option
43
43
  } = _antd.Select;
44
- const StyledSelect = (0, _styledComponents.default)(_antd.Select)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* Hiding the last tag in case of All being selected. */\n .ant-select-selection-overflow-item.ant-select-selection-overflow-item-rest {\n display: ", ";\n }\n .ant-select-selection-item-content {\n max-width: 70px;\n }\n \n /* Fix clear icon position */\n .ant-select-clear {\n display: flex;\n align-items: center;\n justify-content: center;\n right: 32px;\n margin-top: 0;\n transform: translateY(-50%);\n top: 50%;\n }\n \n /* Ensure suffix icon (dropdown arrow) stays in correct position */\n .ant-select-arrow {\n right: 12px;\n }\n"])), props => props.maxTagCount === 1 ? "none" : undefined);
44
+ const StyledSelect = (0, _styledComponents.default)(_antd.Select)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* Hiding the last tag in case of All being selected. */\n .ant-select-selection-overflow-item.ant-select-selection-overflow-item-rest {\n display: ", ";\n }\n .ant-select-selection-item-content {\n max-width: 70px;\n }\n"])), props => props.maxTagCount === 1 ? "none" : undefined);
45
45
 
46
46
  /**
47
47
  * Takes an array of values and an object mapping values to labels and returns an
@@ -1,16 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.assign.js");
4
+ require("core-js/modules/es.weak-map.js");
5
+ require("core-js/modules/web.dom-collections.iterator.js");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.default = void 0;
10
+ require("core-js/modules/es.string.trim.js");
8
11
  var _react = _interopRequireDefault(require("react"));
9
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
13
  var _antd = require("antd");
11
- var _styles = _interopRequireDefault(require("./styles"));
14
+ var _SendRounded = _interopRequireDefault(require("@material-ui/icons/SendRounded"));
15
+ var _styles = _interopRequireWildcard(require("./styles"));
12
16
  var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
13
- const _excluded = ["rows", "placeholder", "maxLength", "className"];
17
+ var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
18
+ var _constants = require("./constants");
19
+ const _excluded = ["rows", "placeholder", "maxLength", "className", "variant"],
20
+ _excluded2 = ["minRows", "maxRows", "sendIconConfig", "onSend", "value", "onChange", "disabled"];
21
+ 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); }
22
+ 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; }
14
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
24
  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); }
16
25
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -19,19 +28,25 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
19
28
  * A custom text area component.
20
29
  *
21
30
  * The component includes the following properties:
22
- * - `rows`: The number of rows for the text area.
31
+ * - `rows`: The number of rows for the text area (used for default variant).
23
32
  * - `placeholder`: The placeholder text for the text area.
24
33
  * - `maxLength`: The maximum length of the input value.
25
34
  * - `className`: Additional CSS class to apply to the text area.
35
+ * - `variant`: 'default' or 'gradient' - determines the styling variant.
36
+ * - `minRows`: Initial line height for gradient variant (default: 1).
37
+ * - `maxRows`: Maximum rows before scrolling starts for gradient variant (default: null for unlimited).
38
+ * - `sendIconConfig`: Object with `show` (boolean, default: false) and `disabled` (boolean, default: false) for gradient variant only.
39
+ * - `onSend`: Callback function called when send icon is clicked (gradient variant only).
26
40
  * - `antDesignProps`: Any other props to pass to the antd Input.TextArea component.
27
41
  *
28
42
  * The component will apply the following styles:
29
43
  * - A dark grey background when the component is disabled.
30
44
  * - A dark grey text color when the component is disabled.
31
45
  * - A custom style class of `custom-textarea` to the outer element.
46
+ * - Gradient border and auto-growing height for gradient variant.
32
47
  *
33
48
  * The component will also apply the following props to the antd Input.TextArea component:
34
- * - `rows`
49
+ * - `rows` (for default variant) or `minRows`/`maxRows` (for gradient variant)
35
50
  * - `placeholder`
36
51
  * - `maxLength`
37
52
  * - `className` (appended to the outer element)
@@ -42,9 +57,79 @@ function CustomTextArea(_ref) {
42
57
  rows,
43
58
  placeholder,
44
59
  maxLength,
45
- className
60
+ className,
61
+ variant = 'default'
46
62
  } = _ref,
47
63
  antDesignProps = _objectWithoutProperties(_ref, _excluded);
64
+ // Render gradient variant
65
+ if (variant === 'gradient') {
66
+ // Extract gradient-specific props from antDesignProps
67
+ const _ref2 = antDesignProps || {},
68
+ {
69
+ minRows = _constants.DEFAULT_MIN_ROWS,
70
+ maxRows = _constants.DEFAULT_MAX_ROWS,
71
+ sendIconConfig = _constants.DEFAULT_SEND_ICON_CONFIG,
72
+ onSend,
73
+ value,
74
+ onChange,
75
+ disabled
76
+ } = _ref2,
77
+ restAntDesignProps = _objectWithoutProperties(_ref2, _excluded2);
78
+
79
+ // Handle send icon click - gradient variant only
80
+ // Use value prop directly - no internal state management
81
+ const handleSendClick = () => {
82
+ const currentValue = value || '';
83
+ // Only allow click if textarea is enabled, icon config is not disabled, and has content
84
+ if (onSend && !disabled && !sendIconConfig.disabled && currentValue.trim()) {
85
+ onSend(currentValue);
86
+ }
87
+ };
88
+
89
+ // Determine if send icon should be enabled - gradient variant only
90
+ // Icon is enabled if: textarea is enabled AND config says it's not disabled AND there's content
91
+ // Use value prop directly - no internal state
92
+ const currentValue = value || '';
93
+ const isSendEnabled = !disabled && !sendIconConfig.disabled && currentValue.trim().length > 0;
94
+
95
+ // Determine if icon should be shown - only for gradient variant
96
+ // Hidden by default, only show when explicitly requested via sendIconConfig.show
97
+ const shouldShowIcon = sendIconConfig.show;
98
+ return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
99
+ theme: {
100
+ token: {
101
+ colorBgContainerDisabled: _ColorVariablesMap.default['--color-divider'],
102
+ colorTextDisabled: _ColorVariablesMap.default['--color-secondary-content']
103
+ }
104
+ }
105
+ }, /*#__PURE__*/_react.default.createElement(_styles.TextAreaWrapper, {
106
+ className: className,
107
+ $disabled: disabled
108
+ }, /*#__PURE__*/_react.default.createElement(_styles.default, _extends({
109
+ placeholder: placeholder,
110
+ maxLength: maxLength,
111
+ className: "custom-textarea-gradient",
112
+ value: value,
113
+ onChange: onChange,
114
+ disabled: disabled,
115
+ autoSize: maxRows ? {
116
+ minRows,
117
+ maxRows
118
+ } : {
119
+ minRows
120
+ }
121
+ }, restAntDesignProps)), shouldShowIcon && /*#__PURE__*/_react.default.createElement(_styles.SendIconWrapper, {
122
+ className: disabled || sendIconConfig.disabled || !isSendEnabled ? 'icon-disabled' : 'icon-enabled'
123
+ }, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
124
+ icon: _SendRounded.default,
125
+ size: 24,
126
+ color: isSendEnabled ? 'primary' : 'placeholder-text',
127
+ onClick: handleSendClick
128
+ }))));
129
+ }
130
+
131
+ // Render default variant (existing behavior - completely unchanged)
132
+ // All props including value, onChange pass through naturally via antDesignProps
48
133
  return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
49
134
  theme: {
50
135
  token: {
@@ -63,12 +148,14 @@ CustomTextArea.propTypes = {
63
148
  rows: _propTypes.default.number,
64
149
  placeholder: _propTypes.default.string,
65
150
  maxLength: _propTypes.default.number,
66
- className: _propTypes.default.string
151
+ className: _propTypes.default.string,
152
+ variant: _propTypes.default.oneOf(['default', 'gradient'])
67
153
  };
68
154
  CustomTextArea.defaultProps = {
69
- rows: 2,
155
+ rows: _constants.DEFAULT_ROWS,
70
156
  placeholder: null,
71
157
  maxLength: 5000,
72
- className: ''
158
+ className: '',
159
+ variant: 'default'
73
160
  };
74
161
  var _default = exports.default = CustomTextArea;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TEXTAREA_SHADOW = exports.TEXTAREA_BORDER_RADIUS = exports.SEND_ICON_SIZE = exports.GRADIENT_BORDER_COLORS = exports.DEFAULT_SEND_ICON_CONFIG = exports.DEFAULT_ROWS = exports.DEFAULT_MIN_ROWS = exports.DEFAULT_MAX_ROWS = void 0;
7
+ /**
8
+ * Constants for CustomTextArea component
9
+ */
10
+
11
+ // Default values for textarea configuration
12
+ const DEFAULT_MIN_ROWS = exports.DEFAULT_MIN_ROWS = 1;
13
+ const DEFAULT_MAX_ROWS = exports.DEFAULT_MAX_ROWS = null; // null means unlimited growth
14
+ const DEFAULT_ROWS = exports.DEFAULT_ROWS = 2;
15
+
16
+ // Gradient border colors
17
+ const GRADIENT_BORDER_COLORS = exports.GRADIENT_BORDER_COLORS = {
18
+ top: '#0098FF',
19
+ // Blue
20
+ middle: '#9A6CFF',
21
+ // Purple
22
+ bottom: '#FB6252' // Coral/Orange-Red
23
+ };
24
+
25
+ // Shadow styles
26
+ const TEXTAREA_SHADOW = exports.TEXTAREA_SHADOW = '0px 2px 10px rgba(0, 0, 0, 0.14)';
27
+
28
+ // Border radius
29
+ const TEXTAREA_BORDER_RADIUS = exports.TEXTAREA_BORDER_RADIUS = '12px';
30
+
31
+ // Icon sizes
32
+ const SEND_ICON_SIZE = exports.SEND_ICON_SIZE = 24;
33
+
34
+ // Default send icon configuration
35
+ const DEFAULT_SEND_ICON_CONFIG = exports.DEFAULT_SEND_ICON_CONFIG = {
36
+ show: false,
37
+ // Hidden by default - only show when explicitly requested
38
+ disabled: false
39
+ };
@@ -3,14 +3,23 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = exports.TextAreaWrapper = exports.SendIconWrapper = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
8
  var _antd = require("antd");
9
- var _templateObject;
9
+ var _constants = require("./constants");
10
+ var _templateObject, _templateObject2, _templateObject3;
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
13
  const {
13
14
  TextArea: AntdTextArea
14
15
  } = _antd.Input;
15
- const StyledTextArea = (0, _styledComponents.default)(AntdTextArea)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.custom-textarea {\n padding: 16px;\n resize: none;\n border-radius: 4px;\n max-height: 92px;\n border: 1px solid var(--color-placeholder-text);\n }\n &.custom-textarea:hover {\n border: 1px solid var(--color-primary);\n }\n &.custom-textarea:focus-within {\n box-shadow: 0px 0px 4px 0px rgba(1, 79, 197, 0.90);\n }\n"])));
16
+
17
+ // Default textarea styles (existing)
18
+ const StyledTextArea = (0, _styledComponents.default)(AntdTextArea)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.custom-textarea {\n padding: 16px;\n resize: none;\n border-radius: 4px;\n max-height: 92px;\n border: 1px solid var(--color-placeholder-text);\n }\n &.custom-textarea:hover {\n border: 1px solid var(--color-primary);\n }\n &.custom-textarea:focus-within {\n box-shadow: 0px 0px 4px 0px rgba(1, 79, 197, 0.90);\n }\n\n /* Gradient variant styles */\n &.custom-textarea-gradient {\n padding: 16px 48px 16px 16px;\n resize: none;\n border-radius: calc(", " - 2px);\n border: none;\n background: var(--color-primary-background);\n font-size: 16px;\n line-height: 24px;\n color: var(--color-primary-content);\n min-height: auto !important;\n box-shadow: none;\n width: 100%;\n }\n\n &.custom-textarea-gradient::placeholder {\n color: var(--color-secondary-content);\n }\n\n &.custom-textarea-gradient:hover {\n box-shadow: none;\n }\n\n &.custom-textarea-gradient:focus {\n outline: none;\n box-shadow: none;\n }\n\n &.custom-textarea-gradient:focus-within {\n box-shadow: none;\n }\n"])), _constants.TEXTAREA_BORDER_RADIUS);
19
+
20
+ // Wrapper for gradient variant with gradient border
21
+ const TextAreaWrapper = exports.TextAreaWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n display: block;\n width: 100%;\n border-radius: ", ";\n padding: 2px;\n background: ", ";\n box-shadow: ", ";\n opacity: ", ";\n"])), _constants.TEXTAREA_BORDER_RADIUS, props => props.$disabled ? 'var(--color-divider)' : "linear-gradient(\n 135deg,\n ".concat(_constants.GRADIENT_BORDER_COLORS.top, " 0%,\n ").concat(_constants.GRADIENT_BORDER_COLORS.middle, " 50%,\n ").concat(_constants.GRADIENT_BORDER_COLORS.bottom, " 100%\n )"), props => props.$disabled ? 'none' : _constants.TEXTAREA_SHADOW, props => props.$disabled ? 0.6 : 1);
22
+
23
+ // Send icon wrapper positioned absolutely
24
+ const SendIconWrapper = exports.SendIconWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 18px;\n right: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n pointer-events: none;\n\n button,\n svg {\n pointer-events: auto;\n }\n\n /* Icon disabled state */\n &.icon-disabled {\n opacity: 0.5;\n \n button,\n svg {\n cursor: not-allowed;\n }\n }\n\n /* Icon enabled state */\n &.icon-enabled {\n opacity: 1;\n \n button,\n svg {\n cursor: pointer;\n }\n }\n"])));
16
25
  var _default = exports.default = StyledTextArea;
@@ -132,14 +132,14 @@ function DocumentSideDrawer(_ref) {
132
132
  color: item.type === "positive" ? "positive" : "negative"
133
133
  }), /*#__PURE__*/_react.default.createElement("p", null, item.title)))))));
134
134
  };
135
- return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, _extends({
135
+ return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, {
136
136
  buttonConfig: drawerButtonConfig,
137
137
  "data-test": "document-side-drawer",
138
138
  className: "documentDrawer",
139
139
  width: calculatedWidth,
140
140
  onClose: handleCloseDrawer,
141
141
  title: title
142
- }, props), /*#__PURE__*/_react.default.createElement(_styles.default, null, /*#__PURE__*/_react.default.createElement("div", {
142
+ }, /*#__PURE__*/_react.default.createElement(_styles.default, null, /*#__PURE__*/_react.default.createElement("div", {
143
143
  className: "viewerContainer"
144
144
  }, renderDocumentViewer(), !onlyDocumentView && /*#__PURE__*/_react.default.createElement("div", {
145
145
  className: "rightContSection"
@@ -8,5 +8,5 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
8
  var _templateObject;
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 ViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-tabs-nav{\n margin: 0;\n}\n .ant-tabs-top>.ant-tabs-nav::before {\n border: none;\n border-right: 1px solid #E0E0E0;\n }\n .ant-tabs-content-holder .customDocumentViewerOverlayHeader{\n bottom: 60px;\n }\n .ant-tabs-tab{\n border-radius: 0px !important;\n border: none !important;\n border-bottom: 2px solid transparent !important;\n }\n .ant-tabs-tab-active{\n border-bottom: 2px solid var(--color-primary) !important;\n }\n .viewerContainer > div {\n flex: 1;\n box-sizing: border-box;\n }\n .viewerContainer {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n }\n .rightContSection {\n display: flex;\n flex-direction: column;\n padding: 24px;\n min-width: 300px;\n max-width: 450px;\n overflow-x: visible;\n }\n .grayBoxSec {\n border-radius: 8px;\n background: #f6f6f6;\n padding: 12px 16px;\n }\n .statusSec {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n .statusSec button {\n margin-left: 8px;\n }\n"])));
11
+ const ViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-tabs-nav{\n margin: 0;\n}\n .ant-tabs-top>.ant-tabs-nav::before {\n border: none;\n border-right: 1px solid #E0E0E0;\n }\n .ant-tabs-content-holder .customDocumentViewerOverlayHeader{\n bottom: 60px;\n }\n .ant-tabs-tab{\n border-radius: 0px !important;\n border: none !important;\n border-bottom: 2px solid transparent !important;\n }\n .ant-tabs-tab-active{\n border-bottom: 2px solid var(--color-primary) !important;\n }\n .viewerContainer > div {\n flex: 1;\n box-sizing: border-box;\n }\n .viewerContainer {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n }\n .rightContSection {\n display: flex;\n flex-direction: column;\n padding: 24px;\n }\n .grayBoxSec {\n border-radius: 8px;\n background: #f6f6f6;\n padding: 12px 16px;\n }\n .statusSec {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n .statusSec button {\n margin-left: 8px;\n }\n"])));
12
12
  var _default = exports.default = ViewerContainer;
package/build/index.js CHANGED
@@ -335,12 +335,6 @@ Object.defineProperty(exports, "DocUploadWidget", {
335
335
  return _DocUploadWidget.default;
336
336
  }
337
337
  });
338
- Object.defineProperty(exports, "DocumentDetailsPanel", {
339
- enumerable: true,
340
- get: function get() {
341
- return _DocumentDetailsPanel.default;
342
- }
343
- });
344
338
  Object.defineProperty(exports, "DocumentSideDrawer", {
345
339
  enumerable: true,
346
340
  get: function get() {
@@ -353,12 +347,6 @@ Object.defineProperty(exports, "DocumentSideModal", {
353
347
  return _DocumentSideModal.default;
354
348
  }
355
349
  });
356
- Object.defineProperty(exports, "DocumentViewerWithDetails", {
357
- enumerable: true,
358
- get: function get() {
359
- return _DocumentViewerWithDetails.default;
360
- }
361
- });
362
350
  Object.defineProperty(exports, "DropdownSearchInput", {
363
351
  enumerable: true,
364
352
  get: function get() {
@@ -587,12 +575,6 @@ Object.defineProperty(exports, "StageTimelineWidget", {
587
575
  return _StageTimelineWidget.default;
588
576
  }
589
577
  });
590
- Object.defineProperty(exports, "TableWithSearchAndFilter", {
591
- enumerable: true,
592
- get: function get() {
593
- return _TableWithSearchAndFilter.default;
594
- }
595
- });
596
578
  Object.defineProperty(exports, "TextArea", {
597
579
  enumerable: true,
598
580
  get: function get() {
@@ -701,7 +683,6 @@ var _CustomSelect = _interopRequireDefault(require("./components/oa-component-se
701
683
  var _CustomTimePicker = _interopRequireDefault(require("./components/oa-component-timepicker/CustomTimePicker"));
702
684
  var _CustomDatePicker = _interopRequireDefault(require("./components/oa-component-datepicker/CustomDatePicker"));
703
685
  var _CustomTable = _interopRequireDefault(require("./components/oa-component-table/CustomTable"));
704
- var _TableWithSearchAndFilter = _interopRequireDefault(require("./components/oa-component-table-with-search-and-filter/TableWithSearchAndFilter"));
705
686
  var _CustomTabs = _interopRequireDefault(require("./components/oa-component-tabs/CustomTabs"));
706
687
  var _CustomTag = _interopRequireDefault(require("./components/oa-component-tag/CustomTag"));
707
688
  var _CustomTimeline = _interopRequireDefault(require("./components/oa-component-timeline/CustomTimeline"));
@@ -773,8 +754,6 @@ var _CustomUpload2 = _interopRequireDefault(require("./dev/oa-component-upload/C
773
754
  var _DocumentSideDrawer = _interopRequireDefault(require("./dev/oa-widget-document-side-drawer/DocumentSideDrawer"));
774
755
  var _CustomDocumentViewer = _interopRequireDefault(require("./dev/oa-component-document-viewer/CustomDocumentViewer"));
775
756
  var _DocumentSideModal = _interopRequireDefault(require("./dev/oa-widget-document-modal/DocumentSideModal"));
776
- var _DocumentDetailsPanel = _interopRequireDefault(require("./components/oa-component-document-details-panel/DocumentDetailsPanel"));
777
- var _DocumentViewerWithDetails = _interopRequireDefault(require("./dev/oa-widget-document-viewer-with-details/DocumentViewerWithDetails"));
778
757
  var _PaymentAndConsent = _interopRequireDefault(require("./layout/paymentAndConsent/PaymentAndConsent"));
779
758
  var _GenricLayOut = _interopRequireDefault(require("./layout/GenricLayOut/GenricLayOut"));
780
759
  var _EntityOverviewLayout = _interopRequireDefault(require("./layout/EntityOverviewLayout/EntityOverviewLayout"));
@@ -58,7 +58,8 @@ function EntityOverviewLayout(_ref) {
58
58
  profileData,
59
59
  accordionData,
60
60
  drawer,
61
- modal
61
+ modal,
62
+ misc
62
63
  } = state !== null && state !== void 0 ? state : {};
63
64
  (0, _react.useEffect)(() => {
64
65
  init();
@@ -121,8 +122,90 @@ function EntityOverviewLayout(_ref) {
121
122
  placement: "bottomRight"
122
123
  });
123
124
  };
124
- const handleCloseDrawer = () => {
125
- init();
125
+ const handleCloseDrawer = async () => {
126
+ var _state$misc2, _state$misc3, _state$misc4;
127
+ // Get selected enterprise from session storage to ensure profile data reflects correct enterprise
128
+ const selectedEnterpriseFromStorage = JSON.parse(sessionStorage.getItem('selectedEnterprise') || 'null');
129
+ const enterpriseIdFromStorage = (selectedEnterpriseFromStorage === null || selectedEnterpriseFromStorage === void 0 ? void 0 : selectedEnterpriseFromStorage.value) || (selectedEnterpriseFromStorage === null || selectedEnterpriseFromStorage === void 0 ? void 0 : selectedEnterpriseFromStorage.enterpriseId) || (selectedEnterpriseFromStorage === null || selectedEnterpriseFromStorage === void 0 ? void 0 : selectedEnterpriseFromStorage.id);
130
+
131
+ // Update misc with enterpriseId from session storage
132
+ const currentMisc = _objectSpread(_objectSpread({}, (_state$misc2 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc2 !== void 0 ? _state$misc2 : {}), {}, {
133
+ enterpriseId: enterpriseIdFromStorage || (state === null || state === void 0 || (_state$misc3 = state.misc) === null || _state$misc3 === void 0 ? void 0 : _state$misc3.enterpriseId),
134
+ enterpriseData: selectedEnterpriseFromStorage || (state === null || state === void 0 || (_state$misc4 = state.misc) === null || _state$misc4 === void 0 ? void 0 : _state$misc4.enterpriseData)
135
+ });
136
+ dispatch({
137
+ type: _entityOverviewLayoutReducer.actionTypes.SET_LOADING,
138
+ payload: true
139
+ });
140
+ if (getInitialData) {
141
+ const {
142
+ error,
143
+ data
144
+ } = await (getInitialData === null || getInitialData === void 0 ? void 0 : getInitialData(_objectSpread({}, currentMisc)));
145
+ if (error) {
146
+ showErrorNotification(error);
147
+ const dynamicConfig = (0, _staticConfigResolver.default)(config, {});
148
+ // Update misc with enterpriseId from session storage
149
+ if (currentMisc) {
150
+ dynamicConfig.misc = currentMisc;
151
+ }
152
+ // Don't preserve profile data - let it be re-rendered from config with correct enterprise
153
+ // Don't preserve accordion data - use fresh data from API (or empty if error)
154
+ dispatch({
155
+ type: _entityOverviewLayoutReducer.actionTypes.INIT,
156
+ payload: dynamicConfig
157
+ });
158
+ } else {
159
+ const dynamicConfig = (0, _staticConfigResolver.default)(config, data !== null && data !== void 0 ? data : {});
160
+ // Update misc with enterpriseId from session storage
161
+ if (currentMisc) {
162
+ dynamicConfig.misc = currentMisc;
163
+ }
164
+ // Use fresh profile data from API response to reflect correct enterprise
165
+ if (data !== null && data !== void 0 && data.data) {
166
+ dispatch({
167
+ type: _entityOverviewLayoutReducer.actionTypes.UPDATE_PROFILE_DATA,
168
+ payload: data.data
169
+ });
170
+ }
171
+ // Use fresh accordion data from API response (includes newly added users)
172
+ // Check for both 'accordionData' and 'accordianData' (typo in API response)
173
+ const freshAccordionData = (data === null || data === void 0 ? void 0 : data.accordionData) || (data === null || data === void 0 ? void 0 : data.accordianData);
174
+ if (freshAccordionData) {
175
+ let accordionDataToUpdate;
176
+ if (Array.isArray(freshAccordionData)) {
177
+ accordionDataToUpdate = freshAccordionData;
178
+ } else if (freshAccordionData.data && Array.isArray(freshAccordionData.data)) {
179
+ accordionDataToUpdate = freshAccordionData.data;
180
+ } else {
181
+ accordionDataToUpdate = freshAccordionData;
182
+ }
183
+ // Update accordion data with fresh data from API
184
+ dispatch({
185
+ type: _entityOverviewLayoutReducer.actionTypes.UPDATE_ACCORDION_DATA,
186
+ payload: accordionDataToUpdate
187
+ });
188
+ }
189
+ dispatch({
190
+ type: _entityOverviewLayoutReducer.actionTypes.INIT,
191
+ payload: dynamicConfig
192
+ });
193
+ }
194
+ } else {
195
+ const dynamicConfig = (0, _staticConfigResolver.default)(config, {});
196
+ // Update misc with enterpriseId from session storage
197
+ if (currentMisc) {
198
+ dynamicConfig.misc = currentMisc;
199
+ }
200
+ dispatch({
201
+ type: _entityOverviewLayoutReducer.actionTypes.INIT,
202
+ payload: dynamicConfig
203
+ });
204
+ }
205
+ dispatch({
206
+ type: _entityOverviewLayoutReducer.actionTypes.SET_LOADING,
207
+ payload: false
208
+ });
126
209
  dispatch({
127
210
  type: _entityOverviewLayoutReducer.actionTypes.CLOSE_DRAWER
128
211
  });
@@ -140,14 +223,70 @@ function EntityOverviewLayout(_ref) {
140
223
  {
141
224
  (config === null || config === void 0 ? void 0 : config.storageType) == "sessionStorage" && (config === null || config === void 0 ? void 0 : config.storageKey) && sessionStorage.setItem(config === null || config === void 0 ? void 0 : config.storageKey, JSON.stringify(selectedData));
142
225
  }
226
+ // Always update 'selectedEnterprise' in sessionStorage to keep misc.enterpriseId in sync
227
+ if (selectedData) {
228
+ sessionStorage.setItem('selectedEnterprise', JSON.stringify(selectedData));
229
+ }
143
230
  showSuccessNotification(config === null || config === void 0 ? void 0 : config.successMessage);
144
231
  if (error) {
145
232
  showErrorNotification(error);
146
233
  } else {
234
+ // Update misc.enterpriseId to keep it in sync with selected enterprise
235
+ // Read from selectedData to match the sessionStorage structure
236
+ const enterpriseId = (selectedData === null || selectedData === void 0 ? void 0 : selectedData.value) || (selectedData === null || selectedData === void 0 ? void 0 : selectedData.enterpriseId) || (selectedData === null || selectedData === void 0 ? void 0 : selectedData.id) || selectedValue;
237
+ if (enterpriseId) {
238
+ dispatch({
239
+ type: _entityOverviewLayoutReducer.actionTypes.SET_MISC,
240
+ payload: _objectSpread(_objectSpread({}, state === null || state === void 0 ? void 0 : state.misc), {}, {
241
+ enterpriseId: enterpriseId,
242
+ enterpriseData: selectedData // Also update enterpriseData to match sessionStorage
243
+ })
244
+ });
245
+ }
147
246
  dispatch({
148
247
  type: _entityOverviewLayoutReducer.actionTypes.UPDATE_PROFILE_DATA,
149
248
  payload: selectedItem
150
249
  });
250
+ // Update accordion data if provided in the response
251
+ // Note: API returns 'accordianData' (typo) but we check for both
252
+ const accordionDataFromResponse = (data === null || data === void 0 ? void 0 : data.accordionData) || (data === null || data === void 0 ? void 0 : data.accordianData);
253
+
254
+ // Check if accordionDataFromResponse is an object with data array, or if it's directly an array
255
+ if (accordionDataFromResponse) {
256
+ let accordionDataToUpdate;
257
+ if (Array.isArray(accordionDataFromResponse)) {
258
+ // If it's directly an array, use it as is
259
+ accordionDataToUpdate = accordionDataFromResponse;
260
+ } else if (accordionDataFromResponse.data && Array.isArray(accordionDataFromResponse.data)) {
261
+ // If it's an object with a data property containing the array, extract the data array
262
+ accordionDataToUpdate = accordionDataFromResponse.data;
263
+ }
264
+ if (accordionDataToUpdate) {
265
+ dispatch({
266
+ type: _entityOverviewLayoutReducer.actionTypes.UPDATE_ACCORDION_DATA,
267
+ payload: accordionDataToUpdate
268
+ });
269
+ } else {
270
+ console.log('Accordion data structure not recognized:', accordionDataFromResponse);
271
+ }
272
+ } else {
273
+ if (getInitialData && config !== null && config !== void 0 && config.refreshAccordionOnSwitch) {
274
+ var _state$misc5;
275
+ // Optionally refresh accordion data by calling getInitialData again
276
+ const {
277
+ error: refreshError,
278
+ data: refreshData
279
+ } = await (getInitialData === null || getInitialData === void 0 ? void 0 : getInitialData(_objectSpread(_objectSpread({}, (_state$misc5 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc5 !== void 0 ? _state$misc5 : {}), {}, {
280
+ selectedValue
281
+ })));
282
+ if (!refreshError && refreshData !== null && refreshData !== void 0 && refreshData.accordionData) {
283
+ dispatch({
284
+ type: _entityOverviewLayoutReducer.actionTypes.UPDATE_ACCORDION_DATA,
285
+ payload: refreshData.accordionData
286
+ });
287
+ }
288
+ }
289
+ }
151
290
  }
152
291
  }
153
292
  };
@@ -255,7 +394,9 @@ function EntityOverviewLayout(_ref) {
255
394
  customPageModal: modal,
256
395
  addUserClick: addUserClick,
257
396
  deleteUserClick: deleteUserClick,
258
- editUserClick: editUserClick
397
+ editUserClick: editUserClick,
398
+ misc: misc,
399
+ drawer: drawer
259
400
  }))))));
260
401
  }
261
402
  EntityOverviewLayout.propTypes = {};
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.initialState = exports.entityOverviewLayoutReducer = exports.actionTypes = void 0;
7
+ require("core-js/modules/web.dom-collections.iterator.js");
7
8
  require("core-js/modules/es.symbol.description.js");
8
9
  var _staticConfigResolver = require("../../GenricLayOut/resolver/staticConfigResolver");
9
10
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -19,7 +20,8 @@ const actionTypes = exports.actionTypes = {
19
20
  SET_DRAWER: 'SET_DRAWER',
20
21
  TOGGLE_DRAWER: 'TOGGLE_DRAWER',
21
22
  CLOSE_DRAWER: 'CLOSE_DRAWER',
22
- UPDATE_PROFILE_DATA: 'UPDATE_PROFILE_DATA'
23
+ UPDATE_PROFILE_DATA: 'UPDATE_PROFILE_DATA',
24
+ UPDATE_ACCORDION_DATA: 'UPDATE_ACCORDION_DATA'
23
25
  };
24
26
  const initialState = exports.initialState = {};
25
27
  const entityOverviewLayoutReducer = (state, action) => {
@@ -38,6 +40,21 @@ const entityOverviewLayoutReducer = (state, action) => {
38
40
  return _objectSpread(_objectSpread({}, state), {}, {
39
41
  profileData: action.payload
40
42
  });
43
+ case actionTypes.UPDATE_ACCORDION_DATA:
44
+ {
45
+ var _state$accordionData$, _state$accordionData;
46
+ console.log('Reducer: Updating accordion data with payload:', action.payload);
47
+ const newAccordionData = _objectSpread(_objectSpread({}, (state === null || state === void 0 ? void 0 : state.accordionData) || {}), {}, {
48
+ // Preserve all existing accordionData properties
49
+ visible: (_state$accordionData$ = state === null || state === void 0 || (_state$accordionData = state.accordionData) === null || _state$accordionData === void 0 ? void 0 : _state$accordionData.visible) !== null && _state$accordionData$ !== void 0 ? _state$accordionData$ : true,
50
+ // Preserve visible property, default to true
51
+ data: Array.isArray(action.payload) ? [...action.payload] : action.payload // Ensure new array reference
52
+ });
53
+ console.log('Reducer: New accordion data:', newAccordionData);
54
+ return _objectSpread(_objectSpread({}, state), {}, {
55
+ accordionData: newAccordionData
56
+ });
57
+ }
41
58
  case actionTypes.SET_MISC:
42
59
  return _objectSpread(_objectSpread({}, state), {}, {
43
60
  misc: _objectSpread(_objectSpread({}, state.misc), action.payload)
@@ -452,7 +452,8 @@ function FormWidget(props) {
452
452
  initialData: (item === null || item === void 0 ? void 0 : item.value) || [],
453
453
  fields: item === null || item === void 0 ? void 0 : item.fields,
454
454
  disabled: (item === null || item === void 0 ? void 0 : item.disabled) || false,
455
- customPageModal: props === null || props === void 0 ? void 0 : props.customPageModal
455
+ customPageModal: props === null || props === void 0 ? void 0 : props.customPageModal,
456
+ misc: props === null || props === void 0 ? void 0 : props.misc
456
457
  }, props)));
457
458
  case "field":
458
459
  return renderFieldWidget(item);