oa-componentbook 1.0.1-stage.44 → 1.0.1-stage.440
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/oa-component-accordion/Accordion.js +123 -43
- package/build/components/oa-component-accordion/styles.js +2 -2
- package/build/components/oa-component-button/CustomButton.js +24 -19
- package/build/components/oa-component-button/styles.js +1 -1
- package/build/components/oa-component-checkbox/CustomCheckBox.js +20 -17
- package/build/components/oa-component-checkbox/styles.js +1 -1
- package/build/components/oa-component-datepicker/CustomDatePicker.js +37 -26
- package/build/components/oa-component-drawer/CustomDrawer.js +2 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +16 -4
- package/build/components/oa-component-icons/MaterialIcon.js +1 -1
- package/build/components/oa-component-modal/CustomModal.js +59 -48
- package/build/components/oa-component-modal/styles.js +3 -2
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-progress-bar/CustomProgressBar.js +8 -4
- package/build/components/oa-component-select/CustomSelect.js +130 -56
- package/build/components/oa-component-steps/CustomSteps.js +117 -0
- package/build/components/oa-component-steps/styles.js +12 -0
- package/build/components/oa-component-table/CustomTable.js +28 -5
- package/build/components/oa-component-table/CustomTableV1.js +613 -0
- package/build/components/oa-component-table/styles.js +1 -1
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-tabs/CustomTabs.js +1 -1
- package/build/components/oa-component-tag/CustomTag.js +29 -11
- package/build/components/oa-component-tag/styles.js +30 -3
- package/build/components/oa-component-textarea/CustomTextArea.js +161 -0
- package/build/components/oa-component-textarea/constants.js +39 -0
- package/build/components/oa-component-textarea/styles.js +12 -3
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +129 -42
- package/build/components/oa-component-viewer/CustomViewer.js +17 -11
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-upload/CustomUpload.js +116 -29
- package/build/dev/oa-component-upload/styles.js +2 -2
- package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/global-css/GlobalCss.js +2 -1
- package/build/global-css/GridLayout.js +1 -1
- package/build/global-css/commonStyles.js +11 -0
- package/build/images/Car.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/exportGrp01.png +0 -0
- package/build/images/exportGrp02.png +0 -0
- package/build/images/exportGrp03.png +0 -0
- package/build/images/outOfStock.png +0 -0
- package/build/index.js +114 -2
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +403 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +85 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2421 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +90 -0
- package/build/layout/GenricLayOut/components/CardList.js +34 -0
- package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
- package/build/layout/GenricLayOut/components/Header.js +74 -0
- package/build/layout/GenricLayOut/components/Modal.js +96 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +219 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +310 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +42 -0
- package/build/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +577 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +80 -16
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
- package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +19 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +396 -0
- package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
- package/build/widgets/oa-widget-content-panel/styles.js +12 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
- package/build/widgets/oa-widget-detailcard/styles.js +1 -1
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
- package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +256 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +83 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +46 -12
- package/build/widgets/oa-widget-key-value/styles.js +1 -1
- package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
- package/build/widgets/oa-widget-kpi/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
- package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
- package/build/widgets/oa-widget-notes/NotesWidget.js +32 -30
- package/build/widgets/oa-widget-notes/styles.js +4 -3
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +165 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-select-list-item-modal/SelectListItemModal.js +91 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +175 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +63 -35
- package/build/widgets/oa-widget-track-shipment-list/fn.js +16 -4
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +407 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +4 -2
- package/build/components/oa-component-textarea/TextArea.js +0 -74
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.object.assign.js");
|
|
5
|
+
require("core-js/modules/es.weak-map.js");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.default = void 0;
|
|
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");
|
|
13
|
+
require("core-js/modules/es.array.reduce.js");
|
|
14
|
+
require("core-js/modules/es.array.includes.js");
|
|
15
|
+
require("core-js/modules/es.string.includes.js");
|
|
16
|
+
require("core-js/modules/es.string.trim.js");
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
var _antd = require("antd");
|
|
20
|
+
var _KeyboardArrowUp = _interopRequireDefault(require("@material-ui/icons/KeyboardArrowUp"));
|
|
21
|
+
var _KeyboardArrowDown = _interopRequireDefault(require("@material-ui/icons/KeyboardArrowDown"));
|
|
22
|
+
var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
|
|
23
|
+
var _CustomTooltip = _interopRequireDefault(require("../oa-component-tooltip/CustomTooltip"));
|
|
24
|
+
var _utils = require("../../utils");
|
|
25
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
26
|
+
require("antd/dist/reset.css");
|
|
27
|
+
var _CustomButton = _interopRequireDefault(require("../oa-component-button/CustomButton"));
|
|
28
|
+
var _CustomSelect = _interopRequireDefault(require("../oa-component-select/CustomSelect"));
|
|
29
|
+
var _stylesV = require("./stylesV1");
|
|
30
|
+
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
31
|
+
var _CustomDropdown = _interopRequireDefault(require("../oa-component-dropdown/CustomDropdown"));
|
|
32
|
+
var _CustomTag = _interopRequireDefault(require("../oa-component-tag/CustomTag"));
|
|
33
|
+
var _CustomPagination = _interopRequireDefault(require("../oa-component-pagination/CustomPagination"));
|
|
34
|
+
var _checkbox = _interopRequireDefault(require("antd/lib/checkbox"));
|
|
35
|
+
const _excluded = ["columns", "dataSource", "pagination", "rowKey", "size", "style", "tableBorder", "emptyText", "ellipsisConfig", "multiItemConfig", "defaultCardShow", "setConfig", "customTableChange", "selectedRows", "onMobilePageChange", "emptyStateCard"],
|
|
36
|
+
_excluded2 = ["title", "dataIndex", "jsxConfig", "render", "ellipsisConfig", "multiItemConfig", "filterDropdown", "filterDropdownProps", "filters"];
|
|
37
|
+
/* eslint-disable */
|
|
38
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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); }
|
|
40
|
+
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; }
|
|
41
|
+
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); }
|
|
42
|
+
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; }
|
|
43
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
44
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
45
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
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); }
|
|
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; }
|
|
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; }
|
|
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) {
|
|
112
|
+
let {
|
|
113
|
+
columns,
|
|
114
|
+
dataSource,
|
|
115
|
+
pagination,
|
|
116
|
+
rowKey,
|
|
117
|
+
size,
|
|
118
|
+
style,
|
|
119
|
+
tableBorder,
|
|
120
|
+
emptyText,
|
|
121
|
+
ellipsisConfig,
|
|
122
|
+
multiItemConfig,
|
|
123
|
+
defaultCardShow,
|
|
124
|
+
setConfig,
|
|
125
|
+
customTableChange,
|
|
126
|
+
selectedRows = [],
|
|
127
|
+
onMobilePageChange,
|
|
128
|
+
emptyStateCard
|
|
129
|
+
} = _ref2,
|
|
130
|
+
antDesignProps = _objectWithoutProperties(_ref2, _excluded);
|
|
131
|
+
// State to manage card vs table view and expanded cards
|
|
132
|
+
const [viewMore, setViewMore] = (0, _react.useState)([]);
|
|
133
|
+
const [ctaColumnsSorted, setCtaColumnsSorted] = (0, _react.useState)(null);
|
|
134
|
+
const [cardShow, setCardShow] = (0, _react.useState)(false);
|
|
135
|
+
const threshold = 10;
|
|
136
|
+
function getByPath(obj, path) {
|
|
137
|
+
var _path$split;
|
|
138
|
+
return path === null || path === void 0 || (_path$split = path.split(".")) === null || _path$split === void 0 ? void 0 : _path$split.reduce((acc, part) => acc === null || acc === void 0 ? void 0 : acc[part], obj);
|
|
139
|
+
}
|
|
140
|
+
// Determine card view on initial load if on mobile
|
|
141
|
+
(0, _react.useEffect)(() => {
|
|
142
|
+
if (window.innerWidth <= 600) {
|
|
143
|
+
setCardShow(true);
|
|
144
|
+
}
|
|
145
|
+
}, [defaultCardShow, columns.length]);
|
|
146
|
+
const mergedPagination = pagination && typeof pagination === "object" ? _objectSpread(_objectSpread({}, pagination), {}, {
|
|
147
|
+
position: ["bottomLeft", "bottomRight"]
|
|
148
|
+
}) : pagination;
|
|
149
|
+
// Add helper function to check if row is selected
|
|
150
|
+
const isRowSelected = record => {
|
|
151
|
+
let isSelected = selectedRows.some(row => row.rowKey === record.rowKey);
|
|
152
|
+
return isSelected;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// Process columns: wrap titles in Typography, handle jsxConfig and custom renderers
|
|
156
|
+
const finalColumns = (0, _react.useMemo)(() => {
|
|
157
|
+
// Check if any column has non-array filters (like '{{branchDetails}}')
|
|
158
|
+
const hasInvalidFilters = columns.some(col => col.filters && !Array.isArray(col.filters));
|
|
159
|
+
|
|
160
|
+
// If there are invalid filters, return empty array to prevent table rendering
|
|
161
|
+
if (hasInvalidFilters) {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Process each column while preserving the original order
|
|
166
|
+
const processedColumns = columns.map(col => {
|
|
167
|
+
const {
|
|
168
|
+
title,
|
|
169
|
+
dataIndex,
|
|
170
|
+
jsxConfig,
|
|
171
|
+
render: userRender,
|
|
172
|
+
ellipsisConfig: colEllipsisConfig,
|
|
173
|
+
multiItemConfig: colMultiItemConfig,
|
|
174
|
+
filterDropdown,
|
|
175
|
+
filterDropdownProps,
|
|
176
|
+
filters
|
|
177
|
+
} = col,
|
|
178
|
+
rest = _objectWithoutProperties(col, _excluded2);
|
|
179
|
+
const titleNode = (0, _utils.isString)(title) || (0, _utils.isNumber)(title) ? /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
180
|
+
typography: "type-sl1-700"
|
|
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
|
+
}
|
|
189
|
+
|
|
190
|
+
// Handle jsxConfig for columns - now supports array
|
|
191
|
+
if (jsxConfig) {
|
|
192
|
+
var _jsxConfigs$;
|
|
193
|
+
// Check if jsxConfig is an array or single object
|
|
194
|
+
const jsxConfigs = Array.isArray(jsxConfig) ? jsxConfig : [jsxConfig];
|
|
195
|
+
|
|
196
|
+
// Determine position from first config or default
|
|
197
|
+
const position = ((_jsxConfigs$ = jsxConfigs[0]) === null || _jsxConfigs$ === void 0 ? void 0 : _jsxConfigs$.position) || "end";
|
|
198
|
+
|
|
199
|
+
// Check if any config has customRenderers type
|
|
200
|
+
const hasCustomRenderers = jsxConfigs.some(config => config && config.type === "customRenderers");
|
|
201
|
+
let ctaRender = (_, record) => /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
+
style: {
|
|
203
|
+
display: "flex",
|
|
204
|
+
gap: "8px",
|
|
205
|
+
alignItems: "center"
|
|
206
|
+
}
|
|
207
|
+
}, jsxConfigs.map((config, index) => {
|
|
208
|
+
var _config$options, _record$config$styleK;
|
|
209
|
+
// Add safety check for undefined config
|
|
210
|
+
if (!config) return null;
|
|
211
|
+
const {
|
|
212
|
+
type,
|
|
213
|
+
subType,
|
|
214
|
+
label,
|
|
215
|
+
onClickHandler,
|
|
216
|
+
options,
|
|
217
|
+
disabled = false,
|
|
218
|
+
icon
|
|
219
|
+
} = config;
|
|
220
|
+
|
|
221
|
+
// Handle different CTA types
|
|
222
|
+
switch (type) {
|
|
223
|
+
case "icon":
|
|
224
|
+
return /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
225
|
+
key: index,
|
|
226
|
+
size: 24,
|
|
227
|
+
icon: icon,
|
|
228
|
+
color: "secondary-content",
|
|
229
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config)
|
|
230
|
+
});
|
|
231
|
+
case "customRenderers":
|
|
232
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
233
|
+
key: index
|
|
234
|
+
}, (config === null || config === void 0 ? void 0 : config.mainLink) && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
235
|
+
role: "button",
|
|
236
|
+
onClick: () => {
|
|
237
|
+
!isRowSelected(record) && customTableChange(record, config.mainLink);
|
|
238
|
+
},
|
|
239
|
+
onKeyDown: e => !isRowSelected(record) && (e.key === "Enter" || e.key === " ") && customTableChange(record, config.mainLink),
|
|
240
|
+
label: label || _,
|
|
241
|
+
type: "text-only",
|
|
242
|
+
disabled: disabled || isRowSelected(record)
|
|
243
|
+
}), config === null || config === void 0 || (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.map((option, idx) => {
|
|
244
|
+
var _record$option$styleK, _record$option$styleK2;
|
|
245
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
246
|
+
key: idx
|
|
247
|
+
}, (option === null || option === void 0 ? void 0 : option.type) === "button" ? /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
248
|
+
style: _objectSpread({}, typeof getByPath(record, option === null || option === void 0 ? void 0 : option.key) === "object" ? getByPath(record, option === null || option === void 0 ? void 0 : option.key) : {}),
|
|
249
|
+
disabled: (record === null || record === void 0 ? void 0 : record[option === null || option === void 0 ? void 0 : option.disabled]) || false,
|
|
250
|
+
type: (option === null || option === void 0 ? void 0 : option.subType) || "primary",
|
|
251
|
+
label: (option === null || option === void 0 ? void 0 : option.label) || (record === null || record === void 0 ? void 0 : record[option === null || option === void 0 ? void 0 : option.key]) || "",
|
|
252
|
+
onClick: () => customTableChange(record, config)
|
|
253
|
+
}) : (option === null || option === void 0 ? void 0 : option.type) === "tag" ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
254
|
+
label: getByPath(record, option === null || option === void 0 ? void 0 : option.key) || "",
|
|
255
|
+
type: getByPath(record, option === null || option === void 0 ? void 0 : option.tagType) || (option === null || option === void 0 ? void 0 : option.tagType) || "primary",
|
|
256
|
+
visible: true
|
|
257
|
+
}) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
258
|
+
typography: (option === null || option === void 0 ? void 0 : option.typography) || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$option$styleK = record[option === null || option === void 0 ? void 0 : option.styleKey]) === null || _record$option$styleK === void 0 ? void 0 : _record$option$styleK.typography) || "type-b2-400",
|
|
259
|
+
color: (option === null || option === void 0 ? void 0 : option.color) || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$option$styleK2 = record[option === null || option === void 0 ? void 0 : option.styleKey]) === null || _record$option$styleK2 === void 0 ? void 0 : _record$option$styleK2.color)
|
|
260
|
+
}, getByPath(record, option === null || option === void 0 ? void 0 : option.key)));
|
|
261
|
+
}));
|
|
262
|
+
case "tag":
|
|
263
|
+
const tagType = typeof subType === "function" ? subType(_, record) : subType;
|
|
264
|
+
const tagLabel = label || _;
|
|
265
|
+
console.log("tagLabel", tagLabel);
|
|
266
|
+
return tagLabel ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
267
|
+
key: index,
|
|
268
|
+
label: tagLabel,
|
|
269
|
+
type: tagType,
|
|
270
|
+
visible: true
|
|
271
|
+
}) : null;
|
|
272
|
+
case "link":
|
|
273
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
274
|
+
key: index,
|
|
275
|
+
role: "button",
|
|
276
|
+
onClick: () => {
|
|
277
|
+
!isRowSelected(record) && customTableChange(record, config);
|
|
278
|
+
},
|
|
279
|
+
onKeyDown: e => !isRowSelected(record) && (e.key === "Enter" || e.key === " ") && customTableChange(record, config),
|
|
280
|
+
label: label || _,
|
|
281
|
+
type: "text-only",
|
|
282
|
+
disabled: disabled || isRowSelected(record)
|
|
283
|
+
});
|
|
284
|
+
case "button":
|
|
285
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
286
|
+
key: index,
|
|
287
|
+
type: subType || "primary",
|
|
288
|
+
label: label || _,
|
|
289
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config),
|
|
290
|
+
disabled: disabled || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$config$styleK = record[config === null || config === void 0 ? void 0 : config.styleKey]) === null || _record$config$styleK === void 0 ? void 0 : _record$config$styleK.disabled) || isRowSelected(record)
|
|
291
|
+
});
|
|
292
|
+
case "dropdown":
|
|
293
|
+
return /*#__PURE__*/_react.default.createElement(_CustomSelect.default, {
|
|
294
|
+
key: index,
|
|
295
|
+
options: options,
|
|
296
|
+
onChange: val => !isRowSelected(record) && onClickHandler(record, val, setConfig),
|
|
297
|
+
disabled: isRowSelected(record)
|
|
298
|
+
});
|
|
299
|
+
case "popover":
|
|
300
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDropdown.default, {
|
|
301
|
+
key: index,
|
|
302
|
+
type: "primary",
|
|
303
|
+
disabled: isRowSelected(record),
|
|
304
|
+
items: options.map(opt => {
|
|
305
|
+
var _record$opt$styleKey;
|
|
306
|
+
return {
|
|
307
|
+
label: opt.label,
|
|
308
|
+
key: opt.key,
|
|
309
|
+
danger: opt.danger || false,
|
|
310
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config, opt.key),
|
|
311
|
+
disabled: (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$opt$styleKey = record[opt === null || opt === void 0 ? void 0 : opt.styleKey]) === null || _record$opt$styleKey === void 0 ? void 0 : _record$opt$styleKey.disabled) || isRowSelected(record)
|
|
312
|
+
};
|
|
313
|
+
})
|
|
314
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
315
|
+
size: 24,
|
|
316
|
+
icon: _MoreVert.default,
|
|
317
|
+
color: isRowSelected(record) ? "disabled" : "secondary-content"
|
|
318
|
+
}));
|
|
319
|
+
default:
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
}));
|
|
323
|
+
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
324
|
+
dataIndex,
|
|
325
|
+
title: titleNode,
|
|
326
|
+
isCTA: !hasCustomRenderers,
|
|
327
|
+
position,
|
|
328
|
+
render: ctaRender
|
|
329
|
+
}, finalFilterDropdown && {
|
|
330
|
+
filterDropdown: finalFilterDropdown
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Handle Data columns with ellipsisConfig and multiItemConfig
|
|
335
|
+
let effectiveEllipsisConfig = ellipsisConfig;
|
|
336
|
+
let effectiveMultiItemConfig = multiItemConfig;
|
|
337
|
+
if (!cardShow) {
|
|
338
|
+
if (colEllipsisConfig && colEllipsisConfig.enabled) {
|
|
339
|
+
effectiveEllipsisConfig = colEllipsisConfig;
|
|
340
|
+
effectiveMultiItemConfig = _objectSpread(_objectSpread({}, multiItemConfig), {}, {
|
|
341
|
+
enabled: false
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
if (colMultiItemConfig && colMultiItemConfig.enabled) {
|
|
345
|
+
effectiveMultiItemConfig = colMultiItemConfig;
|
|
346
|
+
effectiveEllipsisConfig = _objectSpread(_objectSpread({}, effectiveEllipsisConfig), {}, {
|
|
347
|
+
enabled: false
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
} else {
|
|
351
|
+
// In cardShow mode -> ellipsis off
|
|
352
|
+
effectiveEllipsisConfig = _objectSpread(_objectSpread({}, effectiveEllipsisConfig), {}, {
|
|
353
|
+
enabled: false
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
return _objectSpread(_objectSpread(_objectSpread({}, rest), {}, {
|
|
357
|
+
dataIndex,
|
|
358
|
+
title: titleNode
|
|
359
|
+
}, finalFilterDropdown && {
|
|
360
|
+
filterDropdown: finalFilterDropdown
|
|
361
|
+
}), {}, {
|
|
362
|
+
render: (value, record) => {
|
|
363
|
+
let items = [];
|
|
364
|
+
if (Array.isArray(value)) {
|
|
365
|
+
items = value;
|
|
366
|
+
} else if ((0, _utils.isString)(value) && value.includes(",")) {
|
|
367
|
+
items = value.split(",").map(item => item.trim());
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Multi-item popover logic
|
|
371
|
+
if (effectiveMultiItemConfig.enabled && items && items.length > effectiveMultiItemConfig.displayCount) {
|
|
372
|
+
const visible = items.slice(0, effectiveMultiItemConfig.displayCount);
|
|
373
|
+
const moreCount = items.length - effectiveMultiItemConfig.displayCount;
|
|
374
|
+
const popList = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, items.slice(effectiveMultiItemConfig.displayCount).map(item => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
375
|
+
key: (0, _utils.getUUID)(),
|
|
376
|
+
typography: "type-b2-400"
|
|
377
|
+
}, item, /*#__PURE__*/_react.default.createElement("br", null)))));
|
|
378
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, visible.map((item, idx) => /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
379
|
+
key: (0, _utils.getUUID)(),
|
|
380
|
+
typography: "type-b2-400",
|
|
381
|
+
style: {
|
|
382
|
+
display: "inline",
|
|
383
|
+
marginRight: 4
|
|
384
|
+
}
|
|
385
|
+
}, item, idx < visible.length - 1 ? "," : "")), /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
|
|
386
|
+
title: popList,
|
|
387
|
+
trigger: "hover",
|
|
388
|
+
placement: "topLeft",
|
|
389
|
+
className: "pointer"
|
|
390
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
391
|
+
typography: "type-b2-400",
|
|
392
|
+
color: "primary"
|
|
393
|
+
}, "+", moreCount, " more")));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Ellipsis popover
|
|
397
|
+
if (effectiveEllipsisConfig.enabled && !cardShow &&
|
|
398
|
+
// Completely disable ellipsis for mobile card view
|
|
399
|
+
(0, _utils.isString)(value) && value.length > effectiveEllipsisConfig.limit) {
|
|
400
|
+
const truncated = "".concat(value.slice(0, effectiveEllipsisConfig.limit), "...");
|
|
401
|
+
const popText = /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
402
|
+
typography: "type-b2-400",
|
|
403
|
+
style: {
|
|
404
|
+
maxWidth: 300,
|
|
405
|
+
whiteSpace: "normal",
|
|
406
|
+
color: "#fff"
|
|
407
|
+
}
|
|
408
|
+
}, value);
|
|
409
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
410
|
+
style: {
|
|
411
|
+
whiteSpace: "nowrap",
|
|
412
|
+
overflow: "hidden",
|
|
413
|
+
textOverflow: "ellipsis",
|
|
414
|
+
display: "inline-flex",
|
|
415
|
+
alignItems: "center"
|
|
416
|
+
}
|
|
417
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
418
|
+
typography: "type-b2-400"
|
|
419
|
+
}, truncated), effectiveEllipsisConfig.expandText && /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
|
|
420
|
+
title: popText,
|
|
421
|
+
trigger: "hover",
|
|
422
|
+
placement: "topLeft"
|
|
423
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
424
|
+
className: "margin-left-4"
|
|
425
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
426
|
+
typography: "type-b2-400",
|
|
427
|
+
color: "primary"
|
|
428
|
+
}, effectiveEllipsisConfig.expandText))));
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// Default rendering
|
|
432
|
+
if (typeof userRender === "function") {
|
|
433
|
+
return userRender(value, record);
|
|
434
|
+
}
|
|
435
|
+
if ((0, _utils.isString)(value) || (0, _utils.isNumber)(value)) {
|
|
436
|
+
return /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
437
|
+
typography: "type-b2-400"
|
|
438
|
+
}, value);
|
|
439
|
+
}
|
|
440
|
+
return value;
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
const ctaColumnsSorted = [...processedColumns.filter(c => c.isCTA && c.position === "start"), ...processedColumns.filter(c => c.isCTA && c.position !== "start")];
|
|
445
|
+
setCtaColumnsSorted(ctaColumnsSorted);
|
|
446
|
+
|
|
447
|
+
// Returning processed columns in the same order as initial `columns` array
|
|
448
|
+
return processedColumns;
|
|
449
|
+
}, [columns, setConfig, ellipsisConfig, multiItemConfig, selectedRows, cardShow]);
|
|
450
|
+
const tableStyle = {
|
|
451
|
+
borderTop: "1px solid var(--color-divider)",
|
|
452
|
+
overflow: "hidden",
|
|
453
|
+
borderRight: tableBorder ? "1px solid var(--color-divider)" : 0,
|
|
454
|
+
borderBottom: tableBorder ? "1px solid var(--color-divider)" : 0,
|
|
455
|
+
borderLeft: tableBorder ? "1px solid var(--color-divider)" : 0,
|
|
456
|
+
borderRadius: tableBorder ? "4px" : 0
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
// Helper to get cell content (uses column render or dataIndex)
|
|
460
|
+
const getContentToBeRender = (col, row) => {
|
|
461
|
+
if (typeof col.render === "function") {
|
|
462
|
+
const value = Array.isArray(col.dataIndex) ? getByPath(row, col.dataIndex.join(".")) : col.dataIndex ? row[col.dataIndex] : undefined;
|
|
463
|
+
return col.render(value, row);
|
|
464
|
+
}
|
|
465
|
+
if (Array.isArray(col.dataIndex)) {
|
|
466
|
+
var _getByPath;
|
|
467
|
+
return (_getByPath = getByPath(row, col.dataIndex.join("."))) !== null && _getByPath !== void 0 ? _getByPath : "";
|
|
468
|
+
}
|
|
469
|
+
if (col.dataIndex) {
|
|
470
|
+
var _row$col$dataIndex;
|
|
471
|
+
return (_row$col$dataIndex = row[col.dataIndex]) !== null && _row$col$dataIndex !== void 0 ? _row$col$dataIndex : "";
|
|
472
|
+
}
|
|
473
|
+
return "";
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
// Toggle expanded view for a card (add/remove row index in viewMore array)
|
|
477
|
+
const handleViewMore = index => {
|
|
478
|
+
setViewMore(prev => prev.includes(index) ? prev.filter(i => i !== index) : [...prev, index]);
|
|
479
|
+
};
|
|
480
|
+
const customLocale = {
|
|
481
|
+
filterReset: "Reset",
|
|
482
|
+
filterConfirm: "Apply"
|
|
483
|
+
};
|
|
484
|
+
return /*#__PURE__*/_react.default.createElement(_stylesV.MainContainer, null, /*#__PURE__*/_react.default.createElement(_stylesV.GlobalStyle, null), !cardShow && /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
485
|
+
theme: {
|
|
486
|
+
components: {
|
|
487
|
+
Table: {}
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
locale: {
|
|
491
|
+
Table: customLocale
|
|
492
|
+
}
|
|
493
|
+
}, /*#__PURE__*/_react.default.createElement(_stylesV.StyledTable, _extends({
|
|
494
|
+
style: _objectSpread(_objectSpread({}, tableStyle), style),
|
|
495
|
+
columns: finalColumns,
|
|
496
|
+
dataSource: dataSource,
|
|
497
|
+
pagination: mergedPagination,
|
|
498
|
+
rowKey: row => row.rowKey,
|
|
499
|
+
locale: {
|
|
500
|
+
emptyText
|
|
501
|
+
},
|
|
502
|
+
size: size,
|
|
503
|
+
scroll: {
|
|
504
|
+
x: "max-content"
|
|
505
|
+
}
|
|
506
|
+
}, antDesignProps))), /*#__PURE__*/_react.default.createElement("div", {
|
|
507
|
+
className: cardShow && dataSource ? "bottomPadding" : ""
|
|
508
|
+
}, cardShow && dataSource && dataSource.map((row, rowIndex) => {
|
|
509
|
+
var _finalColumns$;
|
|
510
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
511
|
+
key: (0, _utils.getUUID)(),
|
|
512
|
+
className: "cardStyles"
|
|
513
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
514
|
+
className: "srDetails"
|
|
515
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
516
|
+
typography: "type-t2-700",
|
|
517
|
+
color: "primary-content"
|
|
518
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, (_finalColumns$ = finalColumns[0]) === null || _finalColumns$ === void 0 ? void 0 : _finalColumns$.title, " : "), /*#__PURE__*/_react.default.createElement("div", {
|
|
519
|
+
className: "srValue"
|
|
520
|
+
}, getContentToBeRender(finalColumns[0], row)))), finalColumns.map((col, colIndex) => {
|
|
521
|
+
// Exclude the first column and any column with action buttons (jsxConfig) from the card view
|
|
522
|
+
if (colIndex === 0 || col.isCTA) return null; // Ensure no action buttons in card
|
|
523
|
+
if (!viewMore.includes(rowIndex) && colIndex > threshold) return null;
|
|
524
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
525
|
+
key: (0, _utils.getUUID)(),
|
|
526
|
+
className: "keyValue"
|
|
527
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, col.title), /*#__PURE__*/_react.default.createElement("strong", null, getContentToBeRender(col, row)));
|
|
528
|
+
}), finalColumns.length > threshold && /*#__PURE__*/_react.default.createElement("div", {
|
|
529
|
+
className: "showHideBtn"
|
|
530
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
531
|
+
size: "medium",
|
|
532
|
+
type: "text-only",
|
|
533
|
+
label: viewMore.includes(rowIndex) ? "View Less" : "View More",
|
|
534
|
+
iconConfig: {
|
|
535
|
+
icon: viewMore.includes(rowIndex) ? /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
536
|
+
icon: _KeyboardArrowUp.default,
|
|
537
|
+
size: 16
|
|
538
|
+
}) : /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
539
|
+
icon: _KeyboardArrowDown.default,
|
|
540
|
+
size: 16
|
|
541
|
+
}),
|
|
542
|
+
position: "right"
|
|
543
|
+
},
|
|
544
|
+
onClick: () => handleViewMore(rowIndex)
|
|
545
|
+
})), ctaColumnsSorted.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
546
|
+
className: "footerCta"
|
|
547
|
+
}, ctaColumnsSorted.filter(col => col.isCTA && col !== finalColumns[0]) // Exclude first column from footer
|
|
548
|
+
.map(col => /*#__PURE__*/_react.default.createElement("div", {
|
|
549
|
+
key: col.key || col.dataIndex,
|
|
550
|
+
style: {
|
|
551
|
+
display: "flex",
|
|
552
|
+
gap: "8px",
|
|
553
|
+
flexWrap: "wrap"
|
|
554
|
+
}
|
|
555
|
+
}, getContentToBeRender(col, row)))));
|
|
556
|
+
}), cardShow && dataSource.length == 0 && emptyStateCard), cardShow && dataSource.length > 0 && onMobilePageChange && /*#__PURE__*/_react.default.createElement("div", {
|
|
557
|
+
className: "mobileViewPagination"
|
|
558
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
559
|
+
current: pagination.current,
|
|
560
|
+
pageSize: pagination.pageSize,
|
|
561
|
+
total: pagination.total,
|
|
562
|
+
onChange: page => {
|
|
563
|
+
onMobilePageChange === null || onMobilePageChange === void 0 || onMobilePageChange({
|
|
564
|
+
current: page,
|
|
565
|
+
pageSize: pagination.pageSize
|
|
566
|
+
});
|
|
567
|
+
},
|
|
568
|
+
showLessItems: true
|
|
569
|
+
})));
|
|
570
|
+
}
|
|
571
|
+
CustomTableV1.propTypes = {
|
|
572
|
+
columns: _propTypes.default.array.isRequired,
|
|
573
|
+
dataSource: _propTypes.default.array,
|
|
574
|
+
pagination: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
575
|
+
rowKey: _propTypes.default.string,
|
|
576
|
+
size: _propTypes.default.oneOf(["small", "middle", "large"]),
|
|
577
|
+
style: _propTypes.default.object,
|
|
578
|
+
tableBorder: _propTypes.default.bool,
|
|
579
|
+
emptyText: _propTypes.default.string,
|
|
580
|
+
defaultCardShow: _propTypes.default.bool,
|
|
581
|
+
setConfig: _propTypes.default.func.isRequired,
|
|
582
|
+
ellipsisConfig: _propTypes.default.shape({
|
|
583
|
+
enabled: _propTypes.default.bool,
|
|
584
|
+
limit: _propTypes.default.number,
|
|
585
|
+
expandText: _propTypes.default.string
|
|
586
|
+
}),
|
|
587
|
+
multiItemConfig: _propTypes.default.shape({
|
|
588
|
+
enabled: _propTypes.default.bool,
|
|
589
|
+
displayCount: _propTypes.default.number
|
|
590
|
+
}),
|
|
591
|
+
selectedRows: _propTypes.default.array
|
|
592
|
+
};
|
|
593
|
+
CustomTableV1.defaultProps = {
|
|
594
|
+
dataSource: [],
|
|
595
|
+
pagination: false,
|
|
596
|
+
rowKey: "",
|
|
597
|
+
size: "middle",
|
|
598
|
+
style: {},
|
|
599
|
+
tableBorder: true,
|
|
600
|
+
emptyText: "No Data",
|
|
601
|
+
defaultCardShow: false,
|
|
602
|
+
ellipsisConfig: {
|
|
603
|
+
enabled: false,
|
|
604
|
+
limit: 100,
|
|
605
|
+
expandText: ""
|
|
606
|
+
},
|
|
607
|
+
multiItemConfig: {
|
|
608
|
+
enabled: false,
|
|
609
|
+
displayCount: 2
|
|
610
|
+
},
|
|
611
|
+
selectedRows: []
|
|
612
|
+
};
|
|
613
|
+
var _default = exports.default = CustomTableV1;
|
|
@@ -11,4 +11,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
12
|
var _default = exports.default = {};
|
|
13
13
|
const StyledTable = exports.StyledTable = (0, _styledComponents.default)(_antd.Table)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n tr > td {\n vertical-align: top;\n }\n .ant-table-row:last-child td {\n border: none;\n }\n"])));
|
|
14
|
-
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _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: 4px;\n border: 1px solid var(--color-divider);\n background: var(--color-primary-background);\n margin: 0 0 24px;\n }\n .bottomPadding{\n padding: 0 0 84px;\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, .keyValue span {\n width: 100%;\n }\n .keyValue strong {\n color: var(--color-primary-content);\n font-size: 14px;\n font-weight: 500;\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 .srDetails >span > .type-sl1-700{\n font-size: initial;\n }\n .footerCta {\n display: flex;\n justify-content: space-between;\n gap: 16px;\n padding: 16px 16px 0;\n border-top: 1px solid var(--color-divider);\n width: 100%;\n }\n .footerCta button{\n width: 100%;\n }\n .flexEnd {\n display: flex;\n justify-content: end;\n margin: 0 0 12px;\n }\n"])));
|
|
14
|
+
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _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: 4px;\n border: 1px solid var(--color-divider);\n background: var(--color-primary-background);\n margin: 0 0 24px;\n }\n .bottomPadding{\n padding: 0 0 84px;\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, .keyValue span {\n width: 100%;\n }\n .keyValue strong {\n color: var(--color-primary-content);\n font-size: 14px;\n font-weight: 500;\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 .srDetails >span > .type-sl1-700{\n font-size: initial;\n }\n .footerCta {\n display: flex;\n justify-content: space-between;\n gap: 16px;\n padding: 16px 16px 0;\n border-top: 1px solid var(--color-divider);\n width: 100%;\n }\n .footerCta button{\n width: 100%;\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 .mobileViewPagination{display: flex;\n justify-content: flex-end;\n margin: 16px 0px;\n }\n\n .mobileViewPagination .ant-pagination {\n padding: 0;\n }\n}\n"])));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.StyledTable = exports.MainContainer = exports.GlobalStyle = void 0;
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
12
|
+
/* eslint-disable */
|
|
13
|
+
// components/oa-component-table/styles.js
|
|
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
|
+
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
|
+
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 {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
|
+
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: 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"])));
|