oa-componentbook 1.0.1-stage.438 → 1.0.1-stage.439
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-document-details-panel/DocumentDetailsPanel.js +139 -0
- package/build/components/oa-component-progress-bar/CustomProgressBar.js +4 -8
- package/build/components/oa-component-select/CustomSelect.js +1 -1
- package/build/components/oa-component-table-with-search-and-filter/TableWithSearchAndFilter.js +450 -0
- package/build/components/oa-component-table-with-search-and-filter/styles.js +24 -0
- package/build/components/oa-component-textarea/CustomTextArea.js +8 -95
- package/build/components/oa-component-textarea/styles.js +3 -12
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +2 -2
- package/build/dev/oa-widget-document-side-drawer/styles.js +1 -1
- package/build/dev/oa-widget-document-viewer-with-details/DocumentViewerWithDetails.js +122 -0
- package/build/index.js +21 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +4 -145
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +1 -18
- package/build/widgets/oa-form-widget/FormWidget.js +1 -2
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +8 -58
- package/package.json +1 -1
- package/build/components/oa-component-textarea/constants.js +0 -39
|
@@ -1,25 +1,16 @@
|
|
|
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");
|
|
6
4
|
Object.defineProperty(exports, "__esModule", {
|
|
7
5
|
value: true
|
|
8
6
|
});
|
|
9
7
|
exports.default = void 0;
|
|
10
|
-
require("core-js/modules/es.string.trim.js");
|
|
11
8
|
var _react = _interopRequireDefault(require("react"));
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
10
|
var _antd = require("antd");
|
|
14
|
-
var
|
|
15
|
-
var _styles = _interopRequireWildcard(require("./styles"));
|
|
11
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
16
12
|
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
17
|
-
|
|
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; }
|
|
13
|
+
const _excluded = ["rows", "placeholder", "maxLength", "className"];
|
|
23
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
15
|
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); }
|
|
25
16
|
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; }
|
|
@@ -28,25 +19,19 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
19
|
* A custom text area component.
|
|
29
20
|
*
|
|
30
21
|
* The component includes the following properties:
|
|
31
|
-
* - `rows`: The number of rows for the text area
|
|
22
|
+
* - `rows`: The number of rows for the text area.
|
|
32
23
|
* - `placeholder`: The placeholder text for the text area.
|
|
33
24
|
* - `maxLength`: The maximum length of the input value.
|
|
34
25
|
* - `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).
|
|
40
26
|
* - `antDesignProps`: Any other props to pass to the antd Input.TextArea component.
|
|
41
27
|
*
|
|
42
28
|
* The component will apply the following styles:
|
|
43
29
|
* - A dark grey background when the component is disabled.
|
|
44
30
|
* - A dark grey text color when the component is disabled.
|
|
45
31
|
* - A custom style class of `custom-textarea` to the outer element.
|
|
46
|
-
* - Gradient border and auto-growing height for gradient variant.
|
|
47
32
|
*
|
|
48
33
|
* The component will also apply the following props to the antd Input.TextArea component:
|
|
49
|
-
* - `rows`
|
|
34
|
+
* - `rows`
|
|
50
35
|
* - `placeholder`
|
|
51
36
|
* - `maxLength`
|
|
52
37
|
* - `className` (appended to the outer element)
|
|
@@ -57,79 +42,9 @@ function CustomTextArea(_ref) {
|
|
|
57
42
|
rows,
|
|
58
43
|
placeholder,
|
|
59
44
|
maxLength,
|
|
60
|
-
className
|
|
61
|
-
variant = 'default'
|
|
45
|
+
className
|
|
62
46
|
} = _ref,
|
|
63
47
|
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
|
|
133
48
|
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
134
49
|
theme: {
|
|
135
50
|
token: {
|
|
@@ -148,14 +63,12 @@ CustomTextArea.propTypes = {
|
|
|
148
63
|
rows: _propTypes.default.number,
|
|
149
64
|
placeholder: _propTypes.default.string,
|
|
150
65
|
maxLength: _propTypes.default.number,
|
|
151
|
-
className: _propTypes.default.string
|
|
152
|
-
variant: _propTypes.default.oneOf(['default', 'gradient'])
|
|
66
|
+
className: _propTypes.default.string
|
|
153
67
|
};
|
|
154
68
|
CustomTextArea.defaultProps = {
|
|
155
|
-
rows:
|
|
69
|
+
rows: 2,
|
|
156
70
|
placeholder: null,
|
|
157
71
|
maxLength: 5000,
|
|
158
|
-
className: ''
|
|
159
|
-
variant: 'default'
|
|
72
|
+
className: ''
|
|
160
73
|
};
|
|
161
74
|
var _default = exports.default = CustomTextArea;
|
|
@@ -3,23 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _antd = require("antd");
|
|
9
|
-
var
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
9
|
+
var _templateObject;
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
12
|
const {
|
|
14
13
|
TextArea: AntdTextArea
|
|
15
14
|
} = _antd.Input;
|
|
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"])));
|
|
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"])));
|
|
25
16
|
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, {
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, _extends({
|
|
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
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
+
}, props), /*#__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 }\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 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"])));
|
|
12
12
|
var _default = exports.default = ViewerContainer;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _DocumentSideDrawer = _interopRequireDefault(require("../oa-widget-document-side-drawer/DocumentSideDrawer"));
|
|
11
|
+
var _DocumentDetailsPanel = _interopRequireDefault(require("../../components/oa-component-document-details-panel/DocumentDetailsPanel"));
|
|
12
|
+
const _excluded = ["title", "onClose", "drawerWidth", "fileUrl", "fileType", "documentConfig", "detailsTitle", "sectionTitle", "details", "actions", "children"];
|
|
13
|
+
/* eslint-disable */
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
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
|
+
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; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
+
/**
|
|
19
|
+
* DocumentViewerWithDetails Component
|
|
20
|
+
*
|
|
21
|
+
* A split-view component that displays a document viewer on the left
|
|
22
|
+
* and a details panel with actions on the right.
|
|
23
|
+
*
|
|
24
|
+
* Uses DocumentSideDrawer and DocumentDetailsPanel internally.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <DocumentViewerWithDetails
|
|
28
|
+
* title="VIEW DOCUMENT"
|
|
29
|
+
* fileUrl="/path/to/document.pdf"
|
|
30
|
+
* fileType="pdf"
|
|
31
|
+
* detailsTitle="Document Information"
|
|
32
|
+
* sectionTitle="DETAILS"
|
|
33
|
+
* details={[
|
|
34
|
+
* { label: 'Date', value: '17 Nov 2025' },
|
|
35
|
+
* { label: 'Document Number', value: 'DOC-12345' },
|
|
36
|
+
* ]}
|
|
37
|
+
* actions={[
|
|
38
|
+
* { label: 'Download', onClick: () => {}, icon: <DownloadIcon /> },
|
|
39
|
+
* ]}
|
|
40
|
+
* onClose={() => setIsOpen(false)}
|
|
41
|
+
* />
|
|
42
|
+
*/
|
|
43
|
+
function DocumentViewerWithDetails(_ref) {
|
|
44
|
+
let {
|
|
45
|
+
// Drawer props
|
|
46
|
+
title,
|
|
47
|
+
onClose,
|
|
48
|
+
drawerWidth,
|
|
49
|
+
// Document props
|
|
50
|
+
fileUrl,
|
|
51
|
+
fileType,
|
|
52
|
+
documentConfig,
|
|
53
|
+
// Details panel props
|
|
54
|
+
detailsTitle,
|
|
55
|
+
sectionTitle,
|
|
56
|
+
details,
|
|
57
|
+
actions,
|
|
58
|
+
// Additional children
|
|
59
|
+
children
|
|
60
|
+
} = _ref,
|
|
61
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
62
|
+
// Build document config from fileUrl or use provided documentConfig
|
|
63
|
+
const finalDocumentConfig = documentConfig || (fileUrl ? {
|
|
64
|
+
fileUrl,
|
|
65
|
+
fileType: fileType || 'pdf'
|
|
66
|
+
} : null);
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_DocumentSideDrawer.default, _extends({
|
|
68
|
+
title: title,
|
|
69
|
+
handleCloseDrawer: onClose,
|
|
70
|
+
documentConfig: finalDocumentConfig,
|
|
71
|
+
drawerWidth: drawerWidth
|
|
72
|
+
}, restProps), /*#__PURE__*/_react.default.createElement(_DocumentDetailsPanel.default, {
|
|
73
|
+
title: detailsTitle,
|
|
74
|
+
sectionTitle: sectionTitle,
|
|
75
|
+
details: details,
|
|
76
|
+
actions: actions
|
|
77
|
+
}, children));
|
|
78
|
+
}
|
|
79
|
+
DocumentViewerWithDetails.propTypes = {
|
|
80
|
+
/** Drawer title displayed in the header */
|
|
81
|
+
title: _propTypes.default.string,
|
|
82
|
+
/** Callback function when drawer is closed */
|
|
83
|
+
onClose: _propTypes.default.func.isRequired,
|
|
84
|
+
/** Custom drawer width (default: 1200) */
|
|
85
|
+
drawerWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
86
|
+
/** URL of the document to display */
|
|
87
|
+
fileUrl: _propTypes.default.string,
|
|
88
|
+
/** Type of document: 'pdf', 'pdfWithCarousel', or 'image' */
|
|
89
|
+
fileType: _propTypes.default.oneOf(['pdf', 'pdfWithCarousel', 'image']),
|
|
90
|
+
/** Full document config (alternative to fileUrl) */
|
|
91
|
+
documentConfig: _propTypes.default.object,
|
|
92
|
+
/** Title text for the details panel */
|
|
93
|
+
detailsTitle: _propTypes.default.string,
|
|
94
|
+
/** Section header text (e.g., "DETAILS") */
|
|
95
|
+
sectionTitle: _propTypes.default.string,
|
|
96
|
+
/** Array of detail items to display */
|
|
97
|
+
details: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
98
|
+
label: _propTypes.default.string.isRequired,
|
|
99
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
|
|
100
|
+
})),
|
|
101
|
+
/** Array of action buttons to display */
|
|
102
|
+
actions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
103
|
+
label: _propTypes.default.string.isRequired,
|
|
104
|
+
onClick: _propTypes.default.func,
|
|
105
|
+
icon: _propTypes.default.node
|
|
106
|
+
})),
|
|
107
|
+
/** Additional content to render in the details panel */
|
|
108
|
+
children: _propTypes.default.node
|
|
109
|
+
};
|
|
110
|
+
DocumentViewerWithDetails.defaultProps = {
|
|
111
|
+
title: null,
|
|
112
|
+
drawerWidth: "1200",
|
|
113
|
+
fileUrl: null,
|
|
114
|
+
fileType: null,
|
|
115
|
+
documentConfig: null,
|
|
116
|
+
detailsTitle: null,
|
|
117
|
+
sectionTitle: null,
|
|
118
|
+
details: [],
|
|
119
|
+
actions: [],
|
|
120
|
+
children: null
|
|
121
|
+
};
|
|
122
|
+
var _default = exports.default = DocumentViewerWithDetails;
|
package/build/index.js
CHANGED
|
@@ -335,6 +335,12 @@ 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
|
+
});
|
|
338
344
|
Object.defineProperty(exports, "DocumentSideDrawer", {
|
|
339
345
|
enumerable: true,
|
|
340
346
|
get: function get() {
|
|
@@ -347,6 +353,12 @@ Object.defineProperty(exports, "DocumentSideModal", {
|
|
|
347
353
|
return _DocumentSideModal.default;
|
|
348
354
|
}
|
|
349
355
|
});
|
|
356
|
+
Object.defineProperty(exports, "DocumentViewerWithDetails", {
|
|
357
|
+
enumerable: true,
|
|
358
|
+
get: function get() {
|
|
359
|
+
return _DocumentViewerWithDetails.default;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
350
362
|
Object.defineProperty(exports, "DropdownSearchInput", {
|
|
351
363
|
enumerable: true,
|
|
352
364
|
get: function get() {
|
|
@@ -575,6 +587,12 @@ Object.defineProperty(exports, "StageTimelineWidget", {
|
|
|
575
587
|
return _StageTimelineWidget.default;
|
|
576
588
|
}
|
|
577
589
|
});
|
|
590
|
+
Object.defineProperty(exports, "TableWithSearchAndFilter", {
|
|
591
|
+
enumerable: true,
|
|
592
|
+
get: function get() {
|
|
593
|
+
return _TableWithSearchAndFilter.default;
|
|
594
|
+
}
|
|
595
|
+
});
|
|
578
596
|
Object.defineProperty(exports, "TextArea", {
|
|
579
597
|
enumerable: true,
|
|
580
598
|
get: function get() {
|
|
@@ -683,6 +701,7 @@ var _CustomSelect = _interopRequireDefault(require("./components/oa-component-se
|
|
|
683
701
|
var _CustomTimePicker = _interopRequireDefault(require("./components/oa-component-timepicker/CustomTimePicker"));
|
|
684
702
|
var _CustomDatePicker = _interopRequireDefault(require("./components/oa-component-datepicker/CustomDatePicker"));
|
|
685
703
|
var _CustomTable = _interopRequireDefault(require("./components/oa-component-table/CustomTable"));
|
|
704
|
+
var _TableWithSearchAndFilter = _interopRequireDefault(require("./components/oa-component-table-with-search-and-filter/TableWithSearchAndFilter"));
|
|
686
705
|
var _CustomTabs = _interopRequireDefault(require("./components/oa-component-tabs/CustomTabs"));
|
|
687
706
|
var _CustomTag = _interopRequireDefault(require("./components/oa-component-tag/CustomTag"));
|
|
688
707
|
var _CustomTimeline = _interopRequireDefault(require("./components/oa-component-timeline/CustomTimeline"));
|
|
@@ -754,6 +773,8 @@ var _CustomUpload2 = _interopRequireDefault(require("./dev/oa-component-upload/C
|
|
|
754
773
|
var _DocumentSideDrawer = _interopRequireDefault(require("./dev/oa-widget-document-side-drawer/DocumentSideDrawer"));
|
|
755
774
|
var _CustomDocumentViewer = _interopRequireDefault(require("./dev/oa-component-document-viewer/CustomDocumentViewer"));
|
|
756
775
|
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"));
|
|
757
778
|
var _PaymentAndConsent = _interopRequireDefault(require("./layout/paymentAndConsent/PaymentAndConsent"));
|
|
758
779
|
var _GenricLayOut = _interopRequireDefault(require("./layout/GenricLayOut/GenricLayOut"));
|
|
759
780
|
var _EntityOverviewLayout = _interopRequireDefault(require("./layout/EntityOverviewLayout/EntityOverviewLayout"));
|
|
@@ -58,8 +58,7 @@ function EntityOverviewLayout(_ref) {
|
|
|
58
58
|
profileData,
|
|
59
59
|
accordionData,
|
|
60
60
|
drawer,
|
|
61
|
-
modal
|
|
62
|
-
misc
|
|
61
|
+
modal
|
|
63
62
|
} = state !== null && state !== void 0 ? state : {};
|
|
64
63
|
(0, _react.useEffect)(() => {
|
|
65
64
|
init();
|
|
@@ -122,90 +121,8 @@ function EntityOverviewLayout(_ref) {
|
|
|
122
121
|
placement: "bottomRight"
|
|
123
122
|
});
|
|
124
123
|
};
|
|
125
|
-
const handleCloseDrawer =
|
|
126
|
-
|
|
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
|
-
});
|
|
124
|
+
const handleCloseDrawer = () => {
|
|
125
|
+
init();
|
|
209
126
|
dispatch({
|
|
210
127
|
type: _entityOverviewLayoutReducer.actionTypes.CLOSE_DRAWER
|
|
211
128
|
});
|
|
@@ -223,70 +140,14 @@ function EntityOverviewLayout(_ref) {
|
|
|
223
140
|
{
|
|
224
141
|
(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));
|
|
225
142
|
}
|
|
226
|
-
// Always update 'selectedEnterprise' in sessionStorage to keep misc.enterpriseId in sync
|
|
227
|
-
if (selectedData) {
|
|
228
|
-
sessionStorage.setItem('selectedEnterprise', JSON.stringify(selectedData));
|
|
229
|
-
}
|
|
230
143
|
showSuccessNotification(config === null || config === void 0 ? void 0 : config.successMessage);
|
|
231
144
|
if (error) {
|
|
232
145
|
showErrorNotification(error);
|
|
233
146
|
} 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
|
-
}
|
|
246
147
|
dispatch({
|
|
247
148
|
type: _entityOverviewLayoutReducer.actionTypes.UPDATE_PROFILE_DATA,
|
|
248
149
|
payload: selectedItem
|
|
249
150
|
});
|
|
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
|
-
}
|
|
290
151
|
}
|
|
291
152
|
}
|
|
292
153
|
};
|
|
@@ -394,9 +255,7 @@ function EntityOverviewLayout(_ref) {
|
|
|
394
255
|
customPageModal: modal,
|
|
395
256
|
addUserClick: addUserClick,
|
|
396
257
|
deleteUserClick: deleteUserClick,
|
|
397
|
-
editUserClick: editUserClick
|
|
398
|
-
misc: misc,
|
|
399
|
-
drawer: drawer
|
|
258
|
+
editUserClick: editUserClick
|
|
400
259
|
}))))));
|
|
401
260
|
}
|
|
402
261
|
EntityOverviewLayout.propTypes = {};
|
|
@@ -4,7 +4,6 @@ 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");
|
|
8
7
|
require("core-js/modules/es.symbol.description.js");
|
|
9
8
|
var _staticConfigResolver = require("../../GenricLayOut/resolver/staticConfigResolver");
|
|
10
9
|
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; }
|
|
@@ -20,8 +19,7 @@ const actionTypes = exports.actionTypes = {
|
|
|
20
19
|
SET_DRAWER: 'SET_DRAWER',
|
|
21
20
|
TOGGLE_DRAWER: 'TOGGLE_DRAWER',
|
|
22
21
|
CLOSE_DRAWER: 'CLOSE_DRAWER',
|
|
23
|
-
UPDATE_PROFILE_DATA: 'UPDATE_PROFILE_DATA'
|
|
24
|
-
UPDATE_ACCORDION_DATA: 'UPDATE_ACCORDION_DATA'
|
|
22
|
+
UPDATE_PROFILE_DATA: 'UPDATE_PROFILE_DATA'
|
|
25
23
|
};
|
|
26
24
|
const initialState = exports.initialState = {};
|
|
27
25
|
const entityOverviewLayoutReducer = (state, action) => {
|
|
@@ -40,21 +38,6 @@ const entityOverviewLayoutReducer = (state, action) => {
|
|
|
40
38
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
41
39
|
profileData: action.payload
|
|
42
40
|
});
|
|
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
|
-
}
|
|
58
41
|
case actionTypes.SET_MISC:
|
|
59
42
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
60
43
|
misc: _objectSpread(_objectSpread({}, state.misc), action.payload)
|
|
@@ -452,8 +452,7 @@ 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
|
|
456
|
-
misc: props === null || props === void 0 ? void 0 : props.misc
|
|
455
|
+
customPageModal: props === null || props === void 0 ? void 0 : props.customPageModal
|
|
457
456
|
}, props)));
|
|
458
457
|
case "field":
|
|
459
458
|
return renderFieldWidget(item);
|