oa-componentbook 0.18.373 → 0.18.374
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/oa-component-accordion/styles.js +1 -1
- package/build/components/oa-component-modal/CustomModal.js +6 -3
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +29 -2
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +6 -1
- package/build/layout/GenricLayOut/GenricLayOut.js +158 -91
- package/build/layout/GenricLayOut/components/AppliedFilters.js +0 -1
- package/build/layout/GenricLayOut/components/Modal.js +7 -4
- package/build/layout/GenricLayOut/components/ProfileSection.js +141 -9
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +15 -3
- package/build/layout/GenricLayOut/styles.js +16 -4
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +1 -1
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +51 -3
- package/build/widgets/oa-widget-profile-data/styles.js +2 -2
- package/build/widgets/oa-widget-select-list-item-modal/SelectListItemModal.js +19 -7
- package/build/widgets/oa-widget-sidebar/styles.js +1 -1
- package/package.json +1 -1
|
@@ -10,4 +10,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
11
|
var _default = exports.default = {};
|
|
12
12
|
const SmallText = exports.SmallText = _styledComponents.default.small(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: 18px;\n color: #e21616;\n margin: 0 0 0 4px;\n"])));
|
|
13
|
-
const CollapseStyle = exports.CollapseStyle = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-collapse .ant-collapse-item-disabled {\n background: var(--color-disabled-button);\n }\n /* .ant-collapse-item-active .ant-collapse-expand-icon{\n transform: rotate(180deg);\n } */\n /* .ant-collapse-expand-icon{\n padding-inline-start: 0 !important;\n } */\n .ant-collapse-header-text {\n color: var(--color-primary-content);\n }\n /* .ant-collapse-arrow{\n color: var(--color-secondary-content) !important;\n } */\n .ant-collapse > .ant-collapse-item:last-child,\n .ant-collapse > .ant-collapse-item:last-child > .ant-collapse-header,\n .ant-collapse .ant-collapse-item:last-child > .ant-collapse-content {\n border-radius: 0 0 4px 4px;\n }\n .ant-collapse > .ant-collapse-item {\n border: none;\n }\n .ant-collapse {\n border: 1px solid var(--color-divider);\n border-radius: 4px;\n overflow: hidden;\n }\n\n .ant-collapse > .ant-collapse-item > .ant-collapse-header {\n padding: 12px
|
|
13
|
+
const CollapseStyle = exports.CollapseStyle = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-collapse .ant-collapse-item-disabled {\n background: var(--color-disabled-button);\n }\n /* .ant-collapse-item-active .ant-collapse-expand-icon{\n transform: rotate(180deg);\n } */\n /* .ant-collapse-expand-icon{\n padding-inline-start: 0 !important;\n } */\n .ant-collapse-header-text {\n color: var(--color-primary-content);\n }\n /* .ant-collapse-arrow{\n color: var(--color-secondary-content) !important;\n } */\n .ant-collapse > .ant-collapse-item:last-child,\n .ant-collapse > .ant-collapse-item:last-child > .ant-collapse-header,\n .ant-collapse .ant-collapse-item:last-child > .ant-collapse-content {\n border-radius: 0 0 4px 4px;\n }\n .ant-collapse > .ant-collapse-item {\n border: none;\n }\n .ant-collapse {\n border: 1px solid var(--color-divider);\n border-radius: 4px;\n overflow: hidden;\n }\n\n .ant-collapse > .ant-collapse-item > .ant-collapse-header {\n padding: 12px 12px;\n }\n\n /* New styles for header content layout */\n .header-content {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n width: 100%;\n }\n\n .header-main {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n flex: 1;\n gap: 8px;\n }\n\n .header-tag {\n margin-bottom: 4px;\n }\n\n .header-text {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .header-subtext {\n margin-top: 4px;\n color: var(--color-secondary-content);\n }\n\n /* Custom body styles */\n .custom-body-item {\n margin-bottom: 24px;\n }\n\n .custom-body-item:last-child {\n margin-bottom: 0;\n }\n\n .custom-body-heading {\n margin-bottom: 16px;\n }\n\n .custom-body-content {\n // margin-top: 8px;\n }\n\n .custom-body-button {\n margin-top: 16px;\n display: flex;\n justify-content: flex-end;\n }\n\n .gst-details-keyvalue {\n .key-value-item {\n margin-bottom: 4px;\n }\n\n .key {\n font-weight: 400;\n color: var(--color-primary-content);\n }\n\n .value {\n font-weight: 700;\n color: var(--color-primary-content);\n }\n }\n\n @media only screen and (max-width: 600px) {\n .ant-collapse .ant-collapse-content > .ant-collapse-content-box {\n padding: 16px;\n }\n .ant-collapse > .ant-collapse-item > .ant-collapse-header {\n padding: 12px 16px;\n }\n }\n\n .custom-body-content-titleSubtitle {\n display: flex;\n flex-direction: column;\n gap: 16px; /* spacing between each item */\n }\n\n .title-subtitle-item {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n }\n\n .title-subtitle-item .user-details {\n flex: 1;\n display: flex; /* \uD83D\uDC48 add this */\n flex-direction: column; /* stack name & email vertically */\n gap: 2px; /* optional: tighten spacing between name & email */\n }\n"])));
|
|
@@ -14,7 +14,7 @@ var _Typography = _interopRequireDefault(require("../oa-component-typography/Typ
|
|
|
14
14
|
var _typographyOptions = require("../../global-css/typography-options");
|
|
15
15
|
var _utils = require("../../utils");
|
|
16
16
|
var _styles = require("./styles");
|
|
17
|
-
const _excluded = ["buttonConfig", "children", "data-test", "imgSrc", "onCancel", "open", "title", "typographies", "width", "bgColor", "showCloseIcon"];
|
|
17
|
+
const _excluded = ["buttonConfig", "children", "data-test", "imgSrc", "onCancel", "open", "title", "typographies", "width", "bgColor", "showCloseIcon", "maskClosable"];
|
|
18
18
|
/* eslint-disable */
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -63,7 +63,9 @@ function CustomModal(_ref) {
|
|
|
63
63
|
typographies,
|
|
64
64
|
width,
|
|
65
65
|
bgColor,
|
|
66
|
-
showCloseIcon = true
|
|
66
|
+
showCloseIcon = true,
|
|
67
|
+
// Add this prop with default value
|
|
68
|
+
maskClosable = true // Control whether clicking mask closes modal
|
|
67
69
|
} = _ref,
|
|
68
70
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
69
71
|
/*
|
|
@@ -107,7 +109,8 @@ function CustomModal(_ref) {
|
|
|
107
109
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
108
110
|
typography: typographies.title
|
|
109
111
|
}, title)),
|
|
110
|
-
width: width
|
|
112
|
+
width: width,
|
|
113
|
+
maskClosable: maskClosable
|
|
111
114
|
}, props), children && /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null,
|
|
112
115
|
// The label is a string or a number
|
|
113
116
|
((0, _utils.isString)(children) || (0, _utils.isNumber)(children)) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = EntityOverviewLayout;
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
11
|
require("core-js/modules/es.promise.js");
|
|
12
|
+
require("core-js/modules/es.json.stringify.js");
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _entityOverviewLayoutReducer = require("./reducer/entityOverviewLayoutReducer");
|
|
14
15
|
var _GlobalCss = _interopRequireDefault(require("../../global-css/GlobalCss"));
|
|
@@ -43,7 +44,8 @@ function EntityOverviewLayout(_ref) {
|
|
|
43
44
|
addUserClick,
|
|
44
45
|
deleteUserClick,
|
|
45
46
|
editUserClick,
|
|
46
|
-
handleDrawerData
|
|
47
|
+
handleDrawerData,
|
|
48
|
+
handleSwitchSelectItem
|
|
47
49
|
}
|
|
48
50
|
} = _ref;
|
|
49
51
|
const [state, dispatch] = (0, _react.useReducer)(_entityOverviewLayoutReducer.entityOverviewLayoutReducer, config !== null && config !== void 0 ? config : _entityOverviewLayoutReducer.initialState);
|
|
@@ -125,6 +127,30 @@ function EntityOverviewLayout(_ref) {
|
|
|
125
127
|
type: _entityOverviewLayoutReducer.actionTypes.CLOSE_DRAWER
|
|
126
128
|
});
|
|
127
129
|
};
|
|
130
|
+
const handleSwitchSelectItemInternal = async (selectedValue, config) => {
|
|
131
|
+
if (selectedValue) {
|
|
132
|
+
var _data$listData;
|
|
133
|
+
// Call the external handler to get new data based on selected value
|
|
134
|
+
const {
|
|
135
|
+
error,
|
|
136
|
+
data
|
|
137
|
+
} = await (handleSwitchSelectItem === null || handleSwitchSelectItem === void 0 ? void 0 : handleSwitchSelectItem(selectedValue));
|
|
138
|
+
let selectedItem = data === null || data === void 0 ? void 0 : data.data;
|
|
139
|
+
const selectedData = data === null || data === void 0 || (_data$listData = data.listData) === null || _data$listData === void 0 ? void 0 : _data$listData.find(item => item.value === selectedValue);
|
|
140
|
+
{
|
|
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));
|
|
142
|
+
}
|
|
143
|
+
showSuccessNotification(config === null || config === void 0 ? void 0 : config.successMessage);
|
|
144
|
+
if (error) {
|
|
145
|
+
showErrorNotification(error);
|
|
146
|
+
} else {
|
|
147
|
+
dispatch({
|
|
148
|
+
type: _entityOverviewLayoutReducer.actionTypes.UPDATE_PROFILE_DATA,
|
|
149
|
+
payload: selectedItem
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
128
154
|
const handleActionClick = (actionType, actionData) => {
|
|
129
155
|
var _config$drawer, _drawerDetailData$dat, _state$drawer;
|
|
130
156
|
switch (actionType) {
|
|
@@ -186,7 +212,8 @@ function EntityOverviewLayout(_ref) {
|
|
|
186
212
|
rows: 1
|
|
187
213
|
}
|
|
188
214
|
}, /*#__PURE__*/_react.default.createElement(_ProfileDataWidget.default, _extends({}, profileData === null || profileData === void 0 ? void 0 : profileData.data, {
|
|
189
|
-
alignProfile: profileData === null || profileData === void 0 ? void 0 : profileData.alignProfile
|
|
215
|
+
alignProfile: profileData === null || profileData === void 0 ? void 0 : profileData.alignProfile,
|
|
216
|
+
handleSwitchSelectItem: handleSwitchSelectItemInternal
|
|
190
217
|
}))), (accordionData === null || accordionData === void 0 ? void 0 : accordionData.visible) && Array.isArray(accordionData === null || accordionData === void 0 ? void 0 : accordionData.data) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
|
|
191
218
|
loading: state === null || state === void 0 ? void 0 : state.isLoading,
|
|
192
219
|
active: true,
|
|
@@ -18,7 +18,8 @@ const actionTypes = exports.actionTypes = {
|
|
|
18
18
|
SET_MISC: 'SET_MISC',
|
|
19
19
|
SET_DRAWER: 'SET_DRAWER',
|
|
20
20
|
TOGGLE_DRAWER: 'TOGGLE_DRAWER',
|
|
21
|
-
CLOSE_DRAWER: 'CLOSE_DRAWER'
|
|
21
|
+
CLOSE_DRAWER: 'CLOSE_DRAWER',
|
|
22
|
+
UPDATE_PROFILE_DATA: 'UPDATE_PROFILE_DATA'
|
|
22
23
|
};
|
|
23
24
|
const initialState = exports.initialState = {};
|
|
24
25
|
const entityOverviewLayoutReducer = (state, action) => {
|
|
@@ -33,6 +34,10 @@ const entityOverviewLayoutReducer = (state, action) => {
|
|
|
33
34
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
34
35
|
profileData: _objectSpread(_objectSpread({}, state.profileData), action.payload)
|
|
35
36
|
});
|
|
37
|
+
case actionTypes.UPDATE_PROFILE_DATA:
|
|
38
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
39
|
+
profileData: action.payload
|
|
40
|
+
});
|
|
36
41
|
case actionTypes.SET_MISC:
|
|
37
42
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
38
43
|
misc: _objectSpread(_objectSpread({}, state.misc), action.payload)
|