oa-componentbook 0.18.366 → 0.18.368
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/Accordion.js +5 -3
- package/build/components/oa-component-accordion/styles.js +1 -1
- package/build/components/oa-component-button/CustomButton.js +21 -18
- package/build/components/oa-component-table/CustomTableV1.js +90 -11
- package/build/components/oa-component-table/stylesV1.js +2 -2
- package/build/layout/EntityOverviewLayout/styles.js +1 -1
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +1 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +7 -3
- package/build/widgets/oa-widget-key-value/styles.js +1 -1
- package/build/widgets/oa-widget-notes/NotesWidget.js +30 -29
- package/build/widgets/oa-widget-notes/styles.js +4 -3
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +1 -0
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ function CollapseIcon(_ref) {
|
|
|
31
31
|
function renderCustomBody(customBody, onActionClick) {
|
|
32
32
|
if (!customBody || !customBody.items) return null;
|
|
33
33
|
return customBody.items.map((item, index) => {
|
|
34
|
-
var _item$dataConfig;
|
|
34
|
+
var _item$dataConfig, _item$dataConfig2, _item$dataConfig3, _item$dataConfig4;
|
|
35
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
36
|
key: index,
|
|
37
37
|
className: "custom-body-item"
|
|
@@ -43,11 +43,13 @@ function renderCustomBody(customBody, onActionClick) {
|
|
|
43
43
|
}, item.heading.label)), item.dataConfig && item.dataConfig.type === "keyvalue" && /*#__PURE__*/_react.default.createElement("div", {
|
|
44
44
|
className: "custom-body-content"
|
|
45
45
|
}, /*#__PURE__*/_react.default.createElement(_KeyValueWidget.default, {
|
|
46
|
-
|
|
46
|
+
fullWidth: item === null || item === void 0 || (_item$dataConfig = item.dataConfig) === null || _item$dataConfig === void 0 ? void 0 : _item$dataConfig.fullWidth,
|
|
47
|
+
columnLayout: item === null || item === void 0 || (_item$dataConfig2 = item.dataConfig) === null || _item$dataConfig2 === void 0 ? void 0 : _item$dataConfig2.columnLayout,
|
|
48
|
+
data: item === null || item === void 0 || (_item$dataConfig3 = item.dataConfig) === null || _item$dataConfig3 === void 0 ? void 0 : _item$dataConfig3.data,
|
|
47
49
|
customClassName: "gst-details-keyvalue"
|
|
48
50
|
})), item.dataConfig && item.dataConfig.type === "titleSubtitle" && /*#__PURE__*/_react.default.createElement("div", {
|
|
49
51
|
className: "custom-body-content-titleSubtitle"
|
|
50
|
-
}, (item === null || item === void 0 || (_item$
|
|
52
|
+
}, (item === null || item === void 0 || (_item$dataConfig4 = item.dataConfig) === null || _item$dataConfig4 === void 0 || (_item$dataConfig4 = _item$dataConfig4.data) === null || _item$dataConfig4 === void 0 ? void 0 : _item$dataConfig4.length) > 0 && item.dataConfig.data.map((field, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
51
53
|
key: index,
|
|
52
54
|
className: "title-subtitle-item"
|
|
53
55
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -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 24px;\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-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"])));
|
|
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 24px;\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"])));
|
|
@@ -12,6 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
13
13
|
var _styles = require("./styles");
|
|
14
14
|
const _excluded = ["className", "disabled", "onClick", "htmlType", "iconConfig", "label", "showEllipsis", "size", "type", "data-test"];
|
|
15
|
+
/* eslint-disable */
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
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); }
|
|
17
18
|
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; }
|
|
@@ -46,13 +47,13 @@ function CustomButton(_ref) {
|
|
|
46
47
|
showEllipsis,
|
|
47
48
|
size,
|
|
48
49
|
type,
|
|
49
|
-
|
|
50
|
+
"data-test": dataTest
|
|
50
51
|
} = _ref,
|
|
51
52
|
domProps = _objectWithoutProperties(_ref, _excluded);
|
|
52
53
|
const buttonTypography = (0, _styles.getButtonTypography)(size);
|
|
53
54
|
const iconSize = (0, _styles.getIconSize)(size);
|
|
54
55
|
return /*#__PURE__*/_react.default.createElement(_styles.ColoredStyledButton, _extends({
|
|
55
|
-
className: "".concat(disabled ? "".concat(type.replace(
|
|
56
|
+
className: "".concat(disabled ? "".concat(type.replace("danger-", ""), "-disabled") : type, " ").concat(type.replace("danger-", "") === "text-only" ? "".concat(size, "-text-only") : size, " ").concat(className),
|
|
56
57
|
disabled: disabled,
|
|
57
58
|
onClick: disabled ? null : onClick,
|
|
58
59
|
type: htmlType,
|
|
@@ -60,46 +61,48 @@ function CustomButton(_ref) {
|
|
|
60
61
|
"data-test": dataTest
|
|
61
62
|
}, domProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
62
63
|
className: "text-container"
|
|
63
|
-
}, iconConfig.position ===
|
|
64
|
-
size: (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.size) || iconSize
|
|
64
|
+
}, iconConfig.position === "left" && /*#__PURE__*/_react.default.isValidElement(iconConfig.icon) && /*#__PURE__*/_react.default.cloneElement(iconConfig.icon, {
|
|
65
|
+
size: (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.size) || iconSize,
|
|
66
|
+
color: (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.color) || undefined
|
|
65
67
|
}), label && (showEllipsis ? /*#__PURE__*/_react.default.createElement(_styles.EllipsisTypography, {
|
|
66
68
|
title: label,
|
|
67
69
|
typography: buttonTypography
|
|
68
70
|
}, label) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
69
71
|
typography: buttonTypography
|
|
70
|
-
}, label)), iconConfig.position ===
|
|
71
|
-
size: (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.size) || iconSize
|
|
72
|
+
}, label)), iconConfig.position === "right" && /*#__PURE__*/_react.default.isValidElement(iconConfig.icon) && /*#__PURE__*/_react.default.cloneElement(iconConfig.icon, {
|
|
73
|
+
size: (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.size) || iconSize,
|
|
74
|
+
color: (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.color) || undefined
|
|
72
75
|
})));
|
|
73
76
|
}
|
|
74
77
|
CustomButton.propTypes = {
|
|
75
78
|
className: _propTypes.default.string,
|
|
76
|
-
|
|
79
|
+
"data-test": _propTypes.default.string,
|
|
77
80
|
disabled: _propTypes.default.bool,
|
|
78
81
|
onClick: _propTypes.default.func.isRequired,
|
|
79
|
-
htmlType: _propTypes.default.oneOf([
|
|
82
|
+
htmlType: _propTypes.default.oneOf(["button", "submit", "reset"]),
|
|
80
83
|
iconConfig: _propTypes.default.shape({
|
|
81
84
|
icon: _propTypes.default.node,
|
|
82
|
-
position: _propTypes.default.oneOf([
|
|
85
|
+
position: _propTypes.default.oneOf(["left", "right"]),
|
|
83
86
|
style: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])),
|
|
84
87
|
size: _propTypes.default.number
|
|
85
88
|
}),
|
|
86
89
|
label: _propTypes.default.node,
|
|
87
90
|
showEllipsis: _propTypes.default.bool,
|
|
88
|
-
size: _propTypes.default.oneOf([
|
|
89
|
-
type: _propTypes.default.oneOf([
|
|
91
|
+
size: _propTypes.default.oneOf(["small", "medium", "large"]),
|
|
92
|
+
type: _propTypes.default.oneOf(["primary", "secondary", "text-only", "danger-primary", "danger-secondary", "danger-text-only"])
|
|
90
93
|
};
|
|
91
94
|
CustomButton.defaultProps = {
|
|
92
|
-
className:
|
|
93
|
-
|
|
95
|
+
className: "",
|
|
96
|
+
"data-test": null,
|
|
94
97
|
disabled: false,
|
|
95
|
-
htmlType:
|
|
98
|
+
htmlType: "button",
|
|
96
99
|
iconConfig: {
|
|
97
|
-
position:
|
|
100
|
+
position: "left",
|
|
98
101
|
size: 20
|
|
99
102
|
},
|
|
100
|
-
label:
|
|
103
|
+
label: "",
|
|
101
104
|
showEllipsis: false,
|
|
102
|
-
size:
|
|
103
|
-
type:
|
|
105
|
+
size: "medium",
|
|
106
|
+
type: "primary"
|
|
104
107
|
};
|
|
105
108
|
var _default = exports.default = CustomButton;
|
|
@@ -8,6 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
+
require("core-js/modules/es.json.stringify.js");
|
|
12
|
+
require("core-js/modules/es.array.sort.js");
|
|
11
13
|
require("core-js/modules/es.array.reduce.js");
|
|
12
14
|
require("core-js/modules/es.array.includes.js");
|
|
13
15
|
require("core-js/modules/es.string.includes.js");
|
|
@@ -29,8 +31,9 @@ var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/Materi
|
|
|
29
31
|
var _CustomDropdown = _interopRequireDefault(require("../oa-component-dropdown/CustomDropdown"));
|
|
30
32
|
var _CustomTag = _interopRequireDefault(require("../oa-component-tag/CustomTag"));
|
|
31
33
|
var _CustomPagination = _interopRequireDefault(require("../oa-component-pagination/CustomPagination"));
|
|
34
|
+
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
32
35
|
const _excluded = ["columns", "dataSource", "pagination", "rowKey", "size", "style", "tableBorder", "emptyText", "ellipsisConfig", "multiItemConfig", "defaultCardShow", "setConfig", "customTableChange", "selectedRows", "onMobilePageChange", "emptyStateCard"],
|
|
33
|
-
_excluded2 = ["title", "dataIndex", "jsxConfig", "render", "ellipsisConfig", "multiItemConfig"];
|
|
36
|
+
_excluded2 = ["title", "dataIndex", "jsxConfig", "render", "ellipsisConfig", "multiItemConfig", "filterDropdown", "filterDropdownProps", "filters"];
|
|
34
37
|
/* eslint-disable */
|
|
35
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
39
|
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); }
|
|
@@ -43,7 +46,69 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
43
46
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
44
47
|
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; }
|
|
45
48
|
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; }
|
|
46
|
-
|
|
49
|
+
// Custom Filter Dropdown Component
|
|
50
|
+
const CustomFilterDropdown = _ref => {
|
|
51
|
+
let {
|
|
52
|
+
setSelectedKeys,
|
|
53
|
+
selectedKeys,
|
|
54
|
+
confirm,
|
|
55
|
+
clearFilters,
|
|
56
|
+
filters,
|
|
57
|
+
filterDropdownProps
|
|
58
|
+
} = _ref;
|
|
59
|
+
// Initialize with empty array - local state should start clean
|
|
60
|
+
const [localSelectedKeys, setLocalSelectedKeys] = (0, _react.useState)([]);
|
|
61
|
+
|
|
62
|
+
// Update local state when selectedKeys prop changes (when filters are applied)
|
|
63
|
+
(0, _react.useEffect)(() => {
|
|
64
|
+
// Only update if selectedKeys actually changed (when filters are applied)
|
|
65
|
+
setLocalSelectedKeys(selectedKeys || []);
|
|
66
|
+
}, [selectedKeys]);
|
|
67
|
+
const handleFilterChange = checkedValues => {
|
|
68
|
+
setLocalSelectedKeys(checkedValues);
|
|
69
|
+
};
|
|
70
|
+
const handleFilterConfirm = () => {
|
|
71
|
+
setSelectedKeys(localSelectedKeys);
|
|
72
|
+
confirm();
|
|
73
|
+
};
|
|
74
|
+
const handleFilterReset = () => {
|
|
75
|
+
// Clear the local state
|
|
76
|
+
setLocalSelectedKeys([]);
|
|
77
|
+
// Clear the applied filters
|
|
78
|
+
setSelectedKeys([]);
|
|
79
|
+
// Clear filters and close popup
|
|
80
|
+
clearFilters();
|
|
81
|
+
// Confirm the changes to close the popup
|
|
82
|
+
confirm();
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// Check if current local state is different from applied state
|
|
86
|
+
const hasChanges = JSON.stringify([...localSelectedKeys].sort()) !== JSON.stringify([...(selectedKeys || [])].sort());
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
className: "statusBox"
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
90
|
+
color: "secondary-content",
|
|
91
|
+
className: "type-sl1-700"
|
|
92
|
+
}, filterDropdownProps.filterTitle || "FILTER"), /*#__PURE__*/_react.default.createElement(_checkbox.default.Group, {
|
|
93
|
+
options: filters.map(filter => ({
|
|
94
|
+
label: filter.text,
|
|
95
|
+
value: filter.value
|
|
96
|
+
})),
|
|
97
|
+
value: localSelectedKeys,
|
|
98
|
+
onChange: handleFilterChange
|
|
99
|
+
}), /*#__PURE__*/_react.default.createElement("aside", null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
100
|
+
type: "secondary",
|
|
101
|
+
onClick: handleFilterReset,
|
|
102
|
+
size: "small",
|
|
103
|
+
label: filterDropdownProps.filterReset || "Clear All"
|
|
104
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
105
|
+
onClick: handleFilterConfirm,
|
|
106
|
+
size: "small",
|
|
107
|
+
disabled: !hasChanges,
|
|
108
|
+
label: filterDropdownProps.filterConfirm || "Submit"
|
|
109
|
+
})));
|
|
110
|
+
};
|
|
111
|
+
function CustomTableV1(_ref2) {
|
|
47
112
|
let {
|
|
48
113
|
columns,
|
|
49
114
|
dataSource,
|
|
@@ -61,10 +126,9 @@ function CustomTableV1(_ref) {
|
|
|
61
126
|
selectedRows = [],
|
|
62
127
|
onMobilePageChange,
|
|
63
128
|
emptyStateCard
|
|
64
|
-
} =
|
|
65
|
-
antDesignProps = _objectWithoutProperties(
|
|
129
|
+
} = _ref2,
|
|
130
|
+
antDesignProps = _objectWithoutProperties(_ref2, _excluded);
|
|
66
131
|
// State to manage card vs table view and expanded cards
|
|
67
|
-
|
|
68
132
|
const [viewMore, setViewMore] = (0, _react.useState)([]);
|
|
69
133
|
const [ctaColumnsSorted, setCtaColumnsSorted] = (0, _react.useState)(null);
|
|
70
134
|
const [cardShow, setCardShow] = (0, _react.useState)(false);
|
|
@@ -88,7 +152,6 @@ function CustomTableV1(_ref) {
|
|
|
88
152
|
return isSelected;
|
|
89
153
|
};
|
|
90
154
|
|
|
91
|
-
// Process columns: wrap titles in Typography, handle jsxConfig and custom renderers
|
|
92
155
|
// Process columns: wrap titles in Typography, handle jsxConfig and custom renderers
|
|
93
156
|
const finalColumns = (0, _react.useMemo)(() => {
|
|
94
157
|
// Check if any column has non-array filters (like '{{branchDetails}}')
|
|
@@ -107,12 +170,22 @@ function CustomTableV1(_ref) {
|
|
|
107
170
|
jsxConfig,
|
|
108
171
|
render: userRender,
|
|
109
172
|
ellipsisConfig: colEllipsisConfig,
|
|
110
|
-
multiItemConfig: colMultiItemConfig
|
|
173
|
+
multiItemConfig: colMultiItemConfig,
|
|
174
|
+
filterDropdown,
|
|
175
|
+
filterDropdownProps,
|
|
176
|
+
filters
|
|
111
177
|
} = col,
|
|
112
178
|
rest = _objectWithoutProperties(col, _excluded2);
|
|
113
179
|
const titleNode = (0, _utils.isString)(title) || (0, _utils.isNumber)(title) ? /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
114
180
|
typography: "type-sl1-700"
|
|
115
181
|
}, title) : title;
|
|
182
|
+
let finalFilterDropdown = filterDropdown;
|
|
183
|
+
if (filterDropdownProps && filters && Array.isArray(filters)) {
|
|
184
|
+
finalFilterDropdown = props => /*#__PURE__*/_react.default.createElement(CustomFilterDropdown, _extends({}, props, {
|
|
185
|
+
filters: filters,
|
|
186
|
+
filterDropdownProps: filterDropdownProps
|
|
187
|
+
}));
|
|
188
|
+
}
|
|
116
189
|
|
|
117
190
|
// Handle jsxConfig for columns - now supports array
|
|
118
191
|
if (jsxConfig) {
|
|
@@ -250,6 +323,8 @@ function CustomTableV1(_ref) {
|
|
|
250
323
|
isCTA: !hasCustomRenderers,
|
|
251
324
|
position,
|
|
252
325
|
render: ctaRender
|
|
326
|
+
}, finalFilterDropdown && {
|
|
327
|
+
filterDropdown: finalFilterDropdown
|
|
253
328
|
});
|
|
254
329
|
}
|
|
255
330
|
|
|
@@ -275,9 +350,12 @@ function CustomTableV1(_ref) {
|
|
|
275
350
|
enabled: false
|
|
276
351
|
});
|
|
277
352
|
}
|
|
278
|
-
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
353
|
+
return _objectSpread(_objectSpread(_objectSpread({}, rest), {}, {
|
|
279
354
|
dataIndex,
|
|
280
|
-
title: titleNode
|
|
355
|
+
title: titleNode
|
|
356
|
+
}, finalFilterDropdown && {
|
|
357
|
+
filterDropdown: finalFilterDropdown
|
|
358
|
+
}), {}, {
|
|
281
359
|
render: (value, record) => {
|
|
282
360
|
let items = [];
|
|
283
361
|
if (Array.isArray(value)) {
|
|
@@ -376,7 +454,6 @@ function CustomTableV1(_ref) {
|
|
|
376
454
|
};
|
|
377
455
|
|
|
378
456
|
// Helper to get cell content (uses column render or dataIndex)
|
|
379
|
-
// Updated getContentToBeRender to handle array dataIndex
|
|
380
457
|
const getContentToBeRender = (col, row) => {
|
|
381
458
|
if (typeof col.render === "function") {
|
|
382
459
|
const value = Array.isArray(col.dataIndex) ? getByPath(row, col.dataIndex.join(".")) : col.dataIndex ? row[col.dataIndex] : undefined;
|
|
@@ -435,7 +512,9 @@ function CustomTableV1(_ref) {
|
|
|
435
512
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
436
513
|
typography: "type-t2-700",
|
|
437
514
|
color: "primary-content"
|
|
438
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, (_finalColumns$ = finalColumns[0]) === null || _finalColumns$ === void 0 ? void 0 : _finalColumns$.title, ": "),
|
|
515
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, (_finalColumns$ = finalColumns[0]) === null || _finalColumns$ === void 0 ? void 0 : _finalColumns$.title, " : "), /*#__PURE__*/_react.default.createElement("div", {
|
|
516
|
+
className: "srValue"
|
|
517
|
+
}, getContentToBeRender(finalColumns[0], row)))), finalColumns.map((col, colIndex) => {
|
|
439
518
|
// Exclude the first column and any column with action buttons (jsxConfig) from the card view
|
|
440
519
|
if (colIndex === 0 || col.isCTA) return null; // Ensure no action buttons in card
|
|
441
520
|
if (!viewMore.includes(rowIndex) && colIndex > threshold) return null;
|
|
@@ -14,6 +14,6 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
16
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
17
|
-
const GlobalStyle = exports.GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-dropdown .ant-table-filter-dropdown .ant-dropdown-menu
|
|
17
|
+
const GlobalStyle = exports.GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-dropdown .ant-table-filter-dropdown .ant-dropdown-menu {padding: 0; top: 0;}\n.ant-dropdown .ant-dropdown-menu .ant-dropdown-menu-item {border-radius: 0; padding: 12px !important;}\n.ant-dropdown .ant-table-filter-dropdown {border-radius: 8px;background: #FFF;box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);}\n.ant-dropdown .ant-table-filter-dropdown .ant-table-filter-dropdown-btns {padding: 12px; border: none;}\n.ant-dropdown .ant-table-filter-dropdown .ant-btn-link, .ant-dropdown .ant-table-filter-dropdown .ant-btn-primary {border-radius: 4px; min-width: 100px; padding: 7px 16px;\n border: 1px solid #014FC5; height: auto;text-align: center;font-size: 14px;font-style: normal;font-weight: 500;line-height: 20px; }\n.ant-dropdown .ant-table-filter-dropdown .ant-btn-link {color: #014FC5; background: #fff;}\n.ant-dropdown .ant-table-filter-dropdown .ant-btn-primary {background: #014FC5; color: #fff;}\n.ant-checkbox .ant-checkbox-inner {width: 18px; height: 18px; border: 1px solid #717171; border-radius: 2px;}\n.ant-checkbox-checked .ant-checkbox-inner {background-color: #014FC5; border-color: #014FC5;}\n.ant-dropdown .ant-table-filter-dropdown .ant-btn-primary:hover {background:#82a9e2; border: 1px solid #82a9e2;}\n.ant-dropdown .ant-table-filter-dropdown .ant-btn-link:hover {border: 1px solid #82a9e2; color: #82a9e2;}\n.ant-table-wrapper .ant-table-tbody .ant-table-row.ant-table-row-selected >.ant-table-cell {background: #DEF1FB;}\n.ant-table-wrapper .ant-table-pagination.ant-pagination {\n padding: 16px; margin: 0;\n border-top: solid 1px #E0E0E0;\n}\n\n/* Custom filter dropdown styles */\n.statusBox {\n padding: 20px 12px;\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n\n.statusBox .ant-checkbox-group {\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n\n.statusBox aside {\n display: flex;\n justify-content: space-between;\n gap: 12px;\n padding: 8px 0 0;\n}\n\n.statusBox aside button {\n width: 100% !important;\n}\n\n.statusBox .type-sl1-700 {\n margin-bottom: 0;\n color: var(--color-secondary-content);\n font-weight: 700;\n font-size: 14px;\n line-height: 20px;\n}\n"])));
|
|
18
18
|
const StyledTable = exports.StyledTable = (0, _styledComponents.default)(_antd.Table)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n tr > td {\n vertical-align: top;\n }\n .ant-table-row:last-child td {\n border: none;\n }\n .ant-table-row .ant-table-cell,\n .ant-table-thead .ant-table-cell {\n padding: 16px !important;\n }\n .ant-table-measure-row > td {\n padding: 0 !important;\n }\n"])));
|
|
19
|
-
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .fullWidthBtn button {\n width: 100%;\n }\n .fullWidthBtn {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n background: #fff;\n padding: 16px;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n }\n .secondary:hover {\n background: transparent;\n border: 1px solid var(--color-primary);\n color: var(--color-primary);\n }\n .cardStyles {\n padding: 16px;\n border-radius: 8px;\n border: 1px solid var(--color-divider);\n background: var(--color-primary-background);\n margin: 0 0 24px;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n }\n\n .showHideBtn {\n padding: 8px 0 16px;\n }\n .keyValue {\n display: flex;\n gap: 12px;\n margin: 0 0 16px;\n }\n .keyValue:last-child {\n margin: 0;\n }\n .keyValue strong,\n .keyValue span {\n width: 100%;\n }\n .keyValue strong {\n color: var(--color-primary-content);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n }\n .keyValue span {\n color: var(--color-primary-content);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n }\n .srDetails {\n padding: 0 0 12px;\n margin: 0 0 16px;\n border-bottom: 1px solid var(--color-divider);\n }\n\n .srDetails span {\n display: flex;\n flex-direction: row;\n gap:
|
|
19
|
+
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .fullWidthBtn button {\n width: 100%;\n }\n .fullWidthBtn {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n background: #fff;\n padding: 16px;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n }\n .secondary:hover {\n background: transparent;\n border: 1px solid var(--color-primary);\n color: var(--color-primary);\n }\n .cardStyles {\n padding: 16px;\n border-radius: 8px;\n border: 1px solid var(--color-divider);\n background: var(--color-primary-background);\n margin: 0 0 24px;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n }\n\n .showHideBtn {\n padding: 8px 0 16px;\n }\n .keyValue {\n display: flex;\n gap: 12px;\n margin: 0 0 16px;\n }\n .keyValue:last-child {\n margin: 0;\n }\n .keyValue strong,\n .keyValue span {\n width: 100%;\n }\n .keyValue strong {\n color: var(--color-primary-content);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n }\n .keyValue span {\n color: var(--color-primary-content);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n }\n .srDetails {\n padding: 0 0 12px;\n margin: 0 0 16px;\n border-bottom: 1px solid var(--color-divider);\n }\n\n .srDetails span {\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: flex-start;\n white-space: nowrap;\n }\n\n .srDetails .ctaContainer {\n display: flex;\n gap: 8px;\n align-items: center;\n word-break: break-word;\n white-space: normal;\n }\n\n .srDetails > span > div {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n .srDetails > span > .type-sl1-700 {\n font-size: initial;\n }\n\n .srDetails .srValue span {\n white-space: break-spaces;\n }\n\n .footerCta {\n display: flex;\n justify-content: end;\n gap: 16px;\n padding: 16px 0 0 0;\n border-top: 1px solid var(--color-divider);\n width: 100%;\n align-items: center;\n }\n\n .footerCta .ant-dropdown-trigger {\n margin-bottom: 0;\n }\n\n .flexEnd {\n display: flex;\n justify-content: end;\n margin: 0 0 12px;\n }\n\n @media only screen and (max-width: 600px) {\n .keyValue span {\n word-break: break-word;\n overflow-wrap: break-word;\n }\n .keyValue strong {\n word-break: break-word;\n overflow-wrap: break-word;\n }\n .mobileViewPagination {\n display: flex;\n justify-content: flex-end;\n margin: 16px 0px;\n }\n\n .mobileViewPagination .ant-pagination {\n padding: 0;\n }\n }\n"])));
|
|
@@ -8,6 +8,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
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 ProfilePageStyle = exports.ProfilePageStyle = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .fullPageLayout {\n display: flex;\n min-height: 100vh;\n background: #fafafa;\n }\n\n .oaRightLayouts {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .oaTopHeaderAndBtnSec {\n background: #ffffff;\n border-bottom: 1px solid #e8e8e8;\n padding: 20px 24px;\n\n .headerContent {\n margin-left: 160px;\n display: flex;\n align-items: center;\n gap: 16px;\n\n .pageTitle {\n margin: 0;\n }\n\n .backButton {\n border-radius: 50%;\n width: 48px; /* Default desktop size */\n height: 48px; /* Default desktop size */\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--color-secondary-background);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n cursor: pointer;\n transition: all 0.2s ease;\n }\n }\n }\n\n .profileContent {\n flex: 1;\n padding: 0;\n overflow-y: auto;\n background: #ffffff;\n }\n\n .accordionsContainer {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n padding: 0 24px;\n\n .accordion-item {\n width: 100%;\n max-width: 600px;\n background: var(--color-secondary-background);\n overflow: hidden;\n\n .accordion-content {\n padding: 20px;\n\n .key-value-section {\n margin-bottom: 20px;\n }\n\n .action-buttons-section {\n display: flex;\n gap: 12px;\n justify-content: flex-end;\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid var(--color-border);\n }\n\n .custom-content {\n margin-top: 16px;\n }\n }\n }\n }\n\n @media (max-width: 768px) {\n .oaTopHeaderAndBtnSec {\n padding: 12px 16px;\n\n .headerContent {\n margin-left: 0; /* Remove left margin for mobile */\n gap: 12px;\n justify-content: flex-start; /* Align content to left */\n }\n }\n\n .oaTopHeaderAndBtnSec .headerContent .backButton {\n width: 40px !important; /* Mobile size with higher specificity */\n height: 40px !important; /* Mobile size with higher specificity */\n }\n\n .oaTopHeaderAndBtnSec .headerContent .backButton .MuiSvgIcon-root {\n font-size: 20px !important; /* Mobile icon size for Material-UI icons */\n }\n\n .profileContent {\n padding: 16px;\n }\n\n .accordionsContainer {\n padding: 0 16px;\n\n .accordion-item {\n max-width: 100%;\n\n .accordion-content {\n padding: 16px;\n\n .action-buttons-section {\n flex-direction: column;\n align-items: stretch;\n }\n }\n }\n }\n }\n"])));
|
|
11
|
+
const ProfilePageStyle = exports.ProfilePageStyle = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .fullPageLayout {\n display: flex;\n min-height: 100vh;\n background: #fafafa;\n }\n\n .oaRightLayouts {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .oaTopHeaderAndBtnSec {\n background: #ffffff;\n border-bottom: 1px solid #e8e8e8;\n padding: 20px 24px;\n\n .headerContent {\n margin-left: 160px;\n display: flex;\n align-items: center;\n gap: 16px;\n\n .pageTitle {\n margin: 0;\n }\n\n .backButton {\n border-radius: 50%;\n width: 48px; /* Default desktop size */\n height: 48px; /* Default desktop size */\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--color-secondary-background);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n cursor: pointer;\n transition: all 0.2s ease;\n }\n }\n }\n\n .profileContent {\n flex: 1;\n padding: 0;\n overflow-y: auto;\n background: #ffffff;\n }\n\n .accordionsContainer {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n padding: 0 24px;\n\n .accordion-item {\n width: 100%;\n max-width: 600px;\n background: var(--color-secondary-background);\n overflow: hidden;\n\n .accordion-content {\n padding: 20px;\n\n .key-value-section {\n margin-bottom: 20px;\n }\n\n .action-buttons-section {\n display: flex;\n gap: 12px;\n justify-content: flex-end;\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid var(--color-border);\n }\n\n .custom-content {\n margin-top: 16px;\n }\n }\n }\n\n /* Add bottom padding to last accordion item */\n .accordion-item:last-child {\n margin-bottom: 24px;\n }\n }\n\n @media (max-width: 768px) {\n .oaTopHeaderAndBtnSec {\n padding: 12px 16px;\n\n .headerContent {\n margin-left: 0; /* Remove left margin for mobile */\n gap: 12px;\n justify-content: flex-start; /* Align content to left */\n }\n }\n\n .oaTopHeaderAndBtnSec .headerContent .backButton {\n width: 40px !important; /* Mobile size with higher specificity */\n height: 40px !important; /* Mobile size with higher specificity */\n }\n\n .oaTopHeaderAndBtnSec .headerContent .backButton .MuiSvgIcon-root {\n font-size: 20px !important; /* Mobile icon size for Material-UI icons */\n }\n\n .profileContent {\n padding: 16px;\n }\n\n .accordionsContainer {\n padding: 0 16px;\n\n .accordion-item {\n max-width: 100%;\n\n .accordion-content {\n padding: 16px;\n\n .action-buttons-section {\n flex-direction: column;\n align-items: stretch;\n }\n }\n }\n }\n }\n"])));
|
|
12
12
|
const DrawerWithOutFooter = exports.DrawerWithOutFooter = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-drawer-footer {\n display: none !important;\n }\n"])));
|
|
13
13
|
const DrawerContent = exports.DrawerContent = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 24px;\n\n .drawerTitle {\n margin-bottom: 24px;\n }\n\n .drawerDescription {\n margin-top: 24px;\n }\n"])));
|
|
@@ -17,6 +17,7 @@ var _CustomRadio = _interopRequireDefault(require("../../components/oa-component
|
|
|
17
17
|
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
18
18
|
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
19
19
|
const _excluded = ["children", "description", "docDetails", "approvalForm", "isMandatory", "hasDivider", "isQuestionStyleWidget", "questionId", "title", "viewOnClick", "data-test", "maxLength"];
|
|
20
|
+
/* eslint-disable */
|
|
20
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
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
23
|
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; }
|
|
@@ -20,6 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
* @param {Object} props.data - An object containing key-value pairs to be displayed.
|
|
21
21
|
* @param {Array<number>} [props.columnLayout] - An array defining the number of items per column.
|
|
22
22
|
* @param {Object} [props.info] - An object containing information about a key-value pair.
|
|
23
|
+
* @param {boolean} [props.fullWidth] - If true, uses 30%/70% width distribution, otherwise uses previous layout.
|
|
23
24
|
*
|
|
24
25
|
* @returns {JSX.Element} A component that renders key-value pairs in a grid layout.
|
|
25
26
|
*/
|
|
@@ -29,7 +30,8 @@ function KeyValueDataView(_ref) {
|
|
|
29
30
|
columnLayout,
|
|
30
31
|
info,
|
|
31
32
|
tagStatus,
|
|
32
|
-
customClassName
|
|
33
|
+
customClassName,
|
|
34
|
+
fullWidth = false
|
|
33
35
|
} = _ref;
|
|
34
36
|
let actualColumnLayout = [];
|
|
35
37
|
if (columnLayout.length === 0) {
|
|
@@ -50,7 +52,7 @@ function KeyValueDataView(_ref) {
|
|
|
50
52
|
}, Object.entries(data).splice(entryIdx, element).map(_ref2 => {
|
|
51
53
|
let [key, value] = _ref2;
|
|
52
54
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
-
className: "valuestyle",
|
|
55
|
+
className: "valuestyle ".concat(fullWidth ? "full-width" : null),
|
|
54
56
|
key: (0, _utils.getUUID)()
|
|
55
57
|
}, (info === null || info === void 0 ? void 0 : info.infoKey) === key ? /*#__PURE__*/_react.default.createElement("b", {
|
|
56
58
|
className: "type-b2-400"
|
|
@@ -101,7 +103,9 @@ KeyValueDataView.propTypes = {
|
|
|
101
103
|
label: _propTypes.default.string,
|
|
102
104
|
size: _propTypes.default.string
|
|
103
105
|
})
|
|
104
|
-
})
|
|
106
|
+
}),
|
|
107
|
+
customClassName: _propTypes.default.string,
|
|
108
|
+
fullWidth: _propTypes.default.bool
|
|
105
109
|
};
|
|
106
110
|
KeyValueDataView.defaultProps = {
|
|
107
111
|
columnLayout: [],
|
|
@@ -8,7 +8,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4; // KeyValueWidgetStyles.js
|
|
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 KeyValueGroup = exports.KeyValueGroup = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .col-md-4:last-child,.col-md-12:last-child,.col-md-3:last-child,.col-md-6:last-child {\n padding: 0;\n }\n \n .valuestyle {\n display: flex;\n gap: 16px;\n padding: 0 0 8px;\n }\n\n .valuestyle b {\n width: 38.734%;\n font-style: normal;\n color: var(--color-primary-content); \n }\n\n .valuestyle span {\n width: 180px;\n word-wrap: break-word;\n font-style: normal;\n color: var(--color-secondary-content); }\n\n .valuestyle span + span{\n color: var(--color-primary-content);\n font-size: 14px;\n padding: 0 4px 0 0;\n }\n"])));
|
|
11
|
+
const KeyValueGroup = exports.KeyValueGroup = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .col-md-4:last-child,.col-md-12:last-child,.col-md-3:last-child,.col-md-6:last-child {\n padding: 0;\n }\n \n .valuestyle {\n display: flex;\n gap: 16px;\n padding: 0 0 8px;\n }\n\n .valuestyle b {\n width: 38.734%;\n font-style: normal;\n color: var(--color-primary-content); \n }\n\n .valuestyle span {\n width: 180px;\n word-wrap: break-word;\n font-style: normal;\n color: var(--color-secondary-content); }\n\n .valuestyle span + span{\n color: var(--color-primary-content);\n font-size: 14px;\n padding: 0 4px 0 0;\n }\n\n /* Add these CSS rules for full-width */\n .valuestyle.full-width {\n display: flex;\n gap: 16px;\n padding: 0 0 8px;\n }\n\n .valuestyle.full-width b {\n width: 30%;\n }\n\n .valuestyle.full-width span {\n width: 100%;\n }\n\n"])));
|
|
12
12
|
const KeyValueGroups = exports.KeyValueGroups = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n.container {\n max-width: 1154px;\n margin: 0 auto;\n padding: 0 16px;\n}\n.container-fluid{\n width: 100%;\n padding: 0 16px;\n}\n.row {\n display: flex;\n flex-direction: column;\n}\n.row::after {\n content: \"\";\n clear: both;\n display: table;\n}\n.col-xs-1 {\n width: 8.33333%;\n}\n\n.col-xs-2 {\n width: 16.66667%;\n}\n\n.col-xs-3 {\n width: 25%;\n}\n\n.col-xs-4 {\n width: 33.33333%;\n}\n\n.col-xs-5 {\n width: 41.66667%;\n}\n\n.col-xs-6 {\n width: 50%;\n}\n\n.col-xs-7 {\n width: 58.33333%;\n}\n\n.col-xs-8 {\n width: 66.66667%;\n}\n\n.col-xs-9 {\n width: 75%;\n}\n\n.col-xs-10 {\n width: 83.33333%;\n}\n\n.col-xs-11 {\n width: 91.66667%;\n}\n\n.col-xs-12 {\n width: 100%;\n}\n@media (min-width: 768px) {\n .row {\n flex-direction: row;\n}\n .col-sm-1 {\n width: 8.33333%;\n }\n\n .col-sm-2 {\n width: 16.66667%;\n }\n\n .col-sm-3 {\n width: 25%;\n }\n\n .col-sm-4 {\n width: 33.33333%;\n }\n\n .col-sm-5 {\n width: 41.66667%;\n }\n\n .col-sm-6 {\n width: 50%;\n }\n .col-sm-7 {\n width: 58.33333%;\n }\n .col-sm-8 {\n width: 66.66667%;\n }\n .col-sm-9 {\n width: 75%;\n }\n .col-sm-10 {\n width: 83.33333%;\n }\n .col-sm-11 {\n width: 91.66667%;\n }\n .col-sm-12 {\n width: 100%;\n }\n}\n\n@media (min-width: 768px) {\n .col-md-1 {\n width: 8.33333%;\n }\n .col-md-2 {\n width: 16.66667%;\n }\n .col-md-3 {\n width: 25%;\n }\n .col-md-4 {\n width: 33.33333%;\n float: left;\n }\n\n .col-md-5 {\n width: 41.66667%;\n }\n\n .col-md-6 {\n width: 50%;\n }\n\n .col-md-7 {\n width: 58.33333%;\n }\n\n .col-md-8 {\n width: 66.66667%;\n }\n\n .col-md-9 {\n width: 75%;\n }\n\n .col-md-10 {\n width: 83.33333%;\n }\n .col-md-11 {\n width: 91.66667%;\n }\n\n .col-md-12 {\n width: 100%;\n }\n\n}\n/* Large Devices (desktops) */\n@media (min-width: 992px) {\n .gutter{\n padding: 0 24px 0 0;\n }\n .col-lg-1 {\n width: 8.33333%;\n }\n .col-lg-2 {\n width: 16.66667%;\n }\n .col-lg-3 {\n width: 25%;\n float: left;\n }\n .col-lg-4 {\n width: 33.33333%;\n float: left;\n }\n .col-lg-5 {\n width: 41.66667%;\n }\n .col-lg-6 {\n width: 50%;\n }\n .col-lg-7 {\n width: 58.33333%;\n }\n .col-lg-8 {\n width: 66.66667%;\n }\n .col-lg-9 {\n width: 75%;\n }\n .col-lg-10 {\n width: 83.33333%;\n }\n\n .col-lg-11 {\n width: 91.66667%;\n }\n\n .col-lg-12 {\n width: 100%;\n }\n}\n\n@media (min-width: 1200px) {\n .gutter{\n padding: 0 32px 0 0;\n }\n .col-xl-1 {\n width: 8.33333%;\n }\n\n \n}\n@media (max-width: 767px) {\n .gutter{\n padding: 0;\n }\n}\n"])));
|
|
13
13
|
const StyledBold = exports.StyledBold = _styledComponents.default.b(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: var(--color-primary-content);\n font-weight: 400;\n"])));
|
|
14
14
|
const StyledSpan = exports.StyledSpan = _styledComponents.default.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n /* vertical-align: bottom; */\n color: var(--color-secondary-content);\n font-weight: 400;\n word-break: break-word;\n"])));
|
|
@@ -14,6 +14,7 @@ var _CustomTable = _interopRequireDefault(require("../../components/oa-component
|
|
|
14
14
|
var _CustomInput = _interopRequireDefault(require("../../components/oa-component-input/CustomInput"));
|
|
15
15
|
var _styles = require("./styles");
|
|
16
16
|
const _excluded = ["data-test", "disabled", "records", "tableBorder", "onBlur", "extraColumnData"];
|
|
17
|
+
/* eslint-disable */
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
19
|
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); }
|
|
19
20
|
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; }
|
|
@@ -22,7 +23,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
22
23
|
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; }
|
|
23
24
|
function NotesWidget(_ref) {
|
|
24
25
|
let {
|
|
25
|
-
|
|
26
|
+
"data-test": dataTest,
|
|
26
27
|
disabled,
|
|
27
28
|
records,
|
|
28
29
|
tableBorder,
|
|
@@ -30,32 +31,32 @@ function NotesWidget(_ref) {
|
|
|
30
31
|
extraColumnData
|
|
31
32
|
} = _ref,
|
|
32
33
|
antDesignTableProps = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
const [noteInputValue, setNoteInputValue] = (0, _react.useState)(
|
|
34
|
+
const [noteInputValue, setNoteInputValue] = (0, _react.useState)("");
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
* Call to callback from props.
|
|
38
|
+
* Clearing the notes input, on blur.
|
|
39
|
+
*/
|
|
39
40
|
const handleBlur = event => {
|
|
40
41
|
// Call to callback from props.
|
|
41
42
|
onBlur(event);
|
|
42
43
|
|
|
43
44
|
// Clearing the notes input, on blur.
|
|
44
|
-
setNoteInputValue(
|
|
45
|
+
setNoteInputValue("");
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
// Used a local variable to avoid mutating the passed prop.
|
|
48
49
|
const mutatedRecords = [...records];
|
|
49
50
|
if (!disabled) {
|
|
50
51
|
mutatedRecords === null || mutatedRecords === void 0 || mutatedRecords.unshift({
|
|
51
|
-
key:
|
|
52
|
+
key: "0"
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
const extraColumns = Array.isArray(extraColumnData) && extraColumnData.map(column => ({
|
|
55
56
|
title: column.title,
|
|
56
57
|
dataIndex: column.dataIndex,
|
|
57
58
|
key: column.key,
|
|
58
|
-
width:
|
|
59
|
+
width: "20%"
|
|
59
60
|
}));
|
|
60
61
|
const columns = [
|
|
61
62
|
// {
|
|
@@ -65,9 +66,9 @@ function NotesWidget(_ref) {
|
|
|
65
66
|
// width: '20%',
|
|
66
67
|
// },
|
|
67
68
|
{
|
|
68
|
-
title:
|
|
69
|
-
width:
|
|
70
|
-
dataIndex:
|
|
69
|
+
title: "NOTES",
|
|
70
|
+
width: "40%",
|
|
71
|
+
dataIndex: "notes",
|
|
71
72
|
render: (text, obj, index) => {
|
|
72
73
|
if (!disabled && index === 0) {
|
|
73
74
|
return /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
|
|
@@ -82,30 +83,30 @@ function NotesWidget(_ref) {
|
|
|
82
83
|
}
|
|
83
84
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
84
85
|
style: {
|
|
85
|
-
overflow:
|
|
86
|
+
overflow: "auto"
|
|
86
87
|
}
|
|
87
88
|
}, text);
|
|
88
89
|
},
|
|
89
|
-
key:
|
|
90
|
+
key: "notes"
|
|
90
91
|
}, {
|
|
91
|
-
title:
|
|
92
|
-
dataIndex:
|
|
93
|
-
key:
|
|
92
|
+
title: "DATE AND TIME",
|
|
93
|
+
dataIndex: "dateTime",
|
|
94
|
+
key: "dateTime"
|
|
94
95
|
}, {
|
|
95
|
-
title:
|
|
96
|
-
dataIndex:
|
|
97
|
-
key:
|
|
98
|
-
width:
|
|
96
|
+
title: "USER",
|
|
97
|
+
dataIndex: "user",
|
|
98
|
+
key: "user",
|
|
99
|
+
width: "20%"
|
|
99
100
|
}, ...(extraColumns || [])];
|
|
100
101
|
const tableStyle = {
|
|
101
|
-
borderTop:
|
|
102
|
-
borderRight: tableBorder ?
|
|
103
|
-
borderBottom: tableBorder ?
|
|
104
|
-
borderLeft: tableBorder ?
|
|
105
|
-
borderRadius: tableBorder ?
|
|
102
|
+
borderTop: "1px solid var(--color-divider)",
|
|
103
|
+
borderRight: tableBorder ? "1px solid var(--color-divider)" : "0",
|
|
104
|
+
borderBottom: tableBorder ? "1px solid var(--color-divider)" : "0",
|
|
105
|
+
borderLeft: tableBorder ? "1px solid var(--color-divider)" : "0",
|
|
106
|
+
borderRadius: tableBorder ? "4px" : "0"
|
|
106
107
|
// visibility: (!(records.length > 0) && disabled) ? 'hidden' : undefined,
|
|
107
108
|
};
|
|
108
|
-
return /*#__PURE__*/_react.default.createElement(_CustomTable.default, _extends({
|
|
109
|
+
return /*#__PURE__*/_react.default.createElement(NotesTable, null, /*#__PURE__*/_react.default.createElement(_CustomTable.default, _extends({
|
|
109
110
|
style: tableStyle,
|
|
110
111
|
columns: columns,
|
|
111
112
|
dataSource: mutatedRecords,
|
|
@@ -113,10 +114,10 @@ function NotesWidget(_ref) {
|
|
|
113
114
|
size: "small",
|
|
114
115
|
emptyText: "No Notes Available",
|
|
115
116
|
tableBorder: tableBorder
|
|
116
|
-
}, antDesignTableProps));
|
|
117
|
+
}, antDesignTableProps)));
|
|
117
118
|
}
|
|
118
119
|
NotesWidget.propTypes = {
|
|
119
|
-
|
|
120
|
+
"data-test": _propTypes.default.string,
|
|
120
121
|
disabled: _propTypes.default.bool,
|
|
121
122
|
records: _propTypes.default.arrayOf(_propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))),
|
|
122
123
|
onBlur: _propTypes.default.func,
|
|
@@ -124,7 +125,7 @@ NotesWidget.propTypes = {
|
|
|
124
125
|
extraColumnData: _propTypes.default.array
|
|
125
126
|
};
|
|
126
127
|
NotesWidget.defaultProps = {
|
|
127
|
-
|
|
128
|
+
"data-test": null,
|
|
128
129
|
disabled: false,
|
|
129
130
|
onBlur: () => {},
|
|
130
131
|
records: [],
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.NoNotesMessage = void 0;
|
|
6
|
+
exports.default = exports.NotesTable = exports.NoNotesMessage = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _templateObject;
|
|
8
|
+
var _templateObject, _templateObject2;
|
|
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
11
|
var _default = exports.default = {};
|
|
12
|
-
const NoNotesMessage = exports.NoNotesMessage = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n input{\n height: 30px;\n }\n"])));
|
|
12
|
+
const NoNotesMessage = exports.NoNotesMessage = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n input {\n height: 30px;\n }\n"])));
|
|
13
|
+
const NotesTable = exports.NotesTable = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n table {\n width: auto !important;\n }\n"])));
|