oa-componentbook 1.0.1-stage.38 → 1.0.1-stage.380
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 +118 -42
- package/build/components/oa-component-accordion/styles.js +2 -2
- package/build/components/oa-component-button/CustomButton.js +6 -4
- 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 +25 -22
- 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/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-select/CustomSelect.js +116 -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 +531 -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/{TextArea.js → CustomTextArea.js} +4 -4
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +120 -40
- package/build/components/oa-component-viewer/CustomViewer.js +3 -1
- 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 +3 -0
- 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 +235 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +63 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2290 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +84 -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 +85 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +87 -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 +294 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +25 -0
- package/build/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +544 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +73 -12
- 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 +18 -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 +395 -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 +77 -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 +40 -10
- 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 +2 -1
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +117 -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-sidebar/SidebarWidget.js +105 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/sidebar.css +0 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +57 -29
- package/build/widgets/oa-widget-track-shipment-list/fn.js +16 -4
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +351 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +4 -2
|
@@ -25,7 +25,8 @@ var _CustomTag = _interopRequireDefault(require("../oa-component-tag/CustomTag")
|
|
|
25
25
|
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
26
26
|
var _utils = require("../../utils");
|
|
27
27
|
var _styles = require("./styles");
|
|
28
|
-
|
|
28
|
+
var _CustomPagination = _interopRequireDefault(require("../oa-component-pagination/CustomPagination"));
|
|
29
|
+
const _excluded = ["columns", "dataSource", "pagination", "rowKey", "size", "style", "tableBorder", "emptyText", "noOfColumnToShow", "defaultCardShow", "onMobilePageChange", "showNumberPagination"],
|
|
29
30
|
_excluded2 = ["title"];
|
|
30
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
32
|
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); }
|
|
@@ -64,7 +65,9 @@ function CustomTable(_ref) {
|
|
|
64
65
|
tableBorder,
|
|
65
66
|
emptyText,
|
|
66
67
|
noOfColumnToShow,
|
|
67
|
-
defaultCardShow
|
|
68
|
+
defaultCardShow,
|
|
69
|
+
onMobilePageChange,
|
|
70
|
+
showNumberPagination
|
|
68
71
|
} = _ref,
|
|
69
72
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
70
73
|
const [viewMore, setViewMore] = (0, _react.useState)([]);
|
|
@@ -202,7 +205,11 @@ function CustomTable(_ref) {
|
|
|
202
205
|
emptyText
|
|
203
206
|
},
|
|
204
207
|
size: size
|
|
205
|
-
}, antDesignProps
|
|
208
|
+
}, antDesignProps, {
|
|
209
|
+
scroll: {
|
|
210
|
+
x: 'max-content'
|
|
211
|
+
}
|
|
212
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
206
213
|
className: cardShow && dataSource ? 'bottomPadding' : ''
|
|
207
214
|
}, cardShow && dataSource && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.map((row, rowIndex) => {
|
|
208
215
|
var _uppercaseColumns$, _uppercaseColumns3;
|
|
@@ -248,6 +255,18 @@ function CustomTable(_ref) {
|
|
|
248
255
|
type: "secondary",
|
|
249
256
|
size: "large",
|
|
250
257
|
onClick: () => pagination === null || pagination === void 0 ? void 0 : pagination.onChangeHandlerForMobile()
|
|
258
|
+
})), cardShow && dataSource.length > 0 && onMobilePageChange && showNumberPagination && /*#__PURE__*/_react.default.createElement("div", {
|
|
259
|
+
className: "mobileViewPagination"
|
|
260
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
261
|
+
current: pagination.current,
|
|
262
|
+
pageSize: pagination.pageSize,
|
|
263
|
+
total: pagination.total,
|
|
264
|
+
onChange: page => {
|
|
265
|
+
onMobilePageChange === null || onMobilePageChange === void 0 || onMobilePageChange({
|
|
266
|
+
current: page,
|
|
267
|
+
pageSize: pagination.pageSize
|
|
268
|
+
});
|
|
269
|
+
}
|
|
251
270
|
})));
|
|
252
271
|
}
|
|
253
272
|
CustomTable.propTypes = {
|
|
@@ -260,7 +279,9 @@ CustomTable.propTypes = {
|
|
|
260
279
|
tableBorder: _propTypes.default.bool,
|
|
261
280
|
emptyText: _propTypes.default.string,
|
|
262
281
|
noOfColumnToShow: _propTypes.default.number,
|
|
263
|
-
defaultCardShow: _propTypes.default.bool
|
|
282
|
+
defaultCardShow: _propTypes.default.bool,
|
|
283
|
+
onMobilePageChange: _propTypes.default.func,
|
|
284
|
+
showNumberPagination: _propTypes.default.bool
|
|
264
285
|
};
|
|
265
286
|
CustomTable.defaultProps = {
|
|
266
287
|
dataSource: [],
|
|
@@ -272,6 +293,8 @@ CustomTable.defaultProps = {
|
|
|
272
293
|
tableBorder: true,
|
|
273
294
|
emptyText: 'No Data',
|
|
274
295
|
noOfColumnToShow: 5,
|
|
275
|
-
defaultCardShow: false
|
|
296
|
+
defaultCardShow: false,
|
|
297
|
+
onMobilePageChange: null,
|
|
298
|
+
showNumberPagination: false
|
|
276
299
|
};
|
|
277
300
|
var _default = exports.default = CustomTable;
|
|
@@ -0,0 +1,531 @@
|
|
|
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.array.reduce.js");
|
|
12
|
+
require("core-js/modules/es.array.includes.js");
|
|
13
|
+
require("core-js/modules/es.string.includes.js");
|
|
14
|
+
require("core-js/modules/es.string.trim.js");
|
|
15
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
var _antd = require("antd");
|
|
18
|
+
var _KeyboardArrowUp = _interopRequireDefault(require("@material-ui/icons/KeyboardArrowUp"));
|
|
19
|
+
var _KeyboardArrowDown = _interopRequireDefault(require("@material-ui/icons/KeyboardArrowDown"));
|
|
20
|
+
var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
|
|
21
|
+
var _CustomTooltip = _interopRequireDefault(require("../oa-component-tooltip/CustomTooltip"));
|
|
22
|
+
var _utils = require("../../utils");
|
|
23
|
+
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
24
|
+
require("antd/dist/reset.css");
|
|
25
|
+
var _CustomButton = _interopRequireDefault(require("../oa-component-button/CustomButton"));
|
|
26
|
+
var _CustomSelect = _interopRequireDefault(require("../oa-component-select/CustomSelect"));
|
|
27
|
+
var _stylesV = require("./stylesV1");
|
|
28
|
+
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
29
|
+
var _CustomDropdown = _interopRequireDefault(require("../oa-component-dropdown/CustomDropdown"));
|
|
30
|
+
var _CustomTag = _interopRequireDefault(require("../oa-component-tag/CustomTag"));
|
|
31
|
+
var _CustomPagination = _interopRequireDefault(require("../oa-component-pagination/CustomPagination"));
|
|
32
|
+
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"];
|
|
34
|
+
/* eslint-disable */
|
|
35
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
|
+
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); }
|
|
37
|
+
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; }
|
|
38
|
+
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); }
|
|
39
|
+
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; }
|
|
40
|
+
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; }
|
|
41
|
+
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; }
|
|
42
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
43
|
+
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
|
+
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
|
+
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
|
+
function CustomTableV1(_ref) {
|
|
47
|
+
let {
|
|
48
|
+
columns,
|
|
49
|
+
dataSource,
|
|
50
|
+
pagination,
|
|
51
|
+
rowKey,
|
|
52
|
+
size,
|
|
53
|
+
style,
|
|
54
|
+
tableBorder,
|
|
55
|
+
emptyText,
|
|
56
|
+
ellipsisConfig,
|
|
57
|
+
multiItemConfig,
|
|
58
|
+
defaultCardShow,
|
|
59
|
+
setConfig,
|
|
60
|
+
customTableChange,
|
|
61
|
+
selectedRows = [],
|
|
62
|
+
onMobilePageChange,
|
|
63
|
+
emptyStateCard
|
|
64
|
+
} = _ref,
|
|
65
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
66
|
+
// State to manage card vs table view and expanded cards
|
|
67
|
+
|
|
68
|
+
const [viewMore, setViewMore] = (0, _react.useState)([]);
|
|
69
|
+
const [ctaColumnsSorted, setCtaColumnsSorted] = (0, _react.useState)(null);
|
|
70
|
+
const [cardShow, setCardShow] = (0, _react.useState)(false);
|
|
71
|
+
const threshold = 10;
|
|
72
|
+
function getByPath(obj, path) {
|
|
73
|
+
var _path$split;
|
|
74
|
+
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);
|
|
75
|
+
}
|
|
76
|
+
// Determine card view on initial load if on mobile
|
|
77
|
+
(0, _react.useEffect)(() => {
|
|
78
|
+
if (window.innerWidth <= 600) {
|
|
79
|
+
setCardShow(true);
|
|
80
|
+
}
|
|
81
|
+
}, [defaultCardShow, columns.length]);
|
|
82
|
+
const mergedPagination = pagination && typeof pagination === "object" ? _objectSpread(_objectSpread({}, pagination), {}, {
|
|
83
|
+
position: ["bottomLeft", "bottomRight"]
|
|
84
|
+
}) : pagination;
|
|
85
|
+
// Add helper function to check if row is selected
|
|
86
|
+
const isRowSelected = record => {
|
|
87
|
+
let isSelected = selectedRows.some(row => row.rowKey === record.rowKey);
|
|
88
|
+
return isSelected;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// Process columns: wrap titles in Typography, handle jsxConfig and custom renderers
|
|
92
|
+
// Process columns: wrap titles in Typography, handle jsxConfig and custom renderers
|
|
93
|
+
const finalColumns = (0, _react.useMemo)(() => {
|
|
94
|
+
// Check if any column has non-array filters (like '{{branchDetails}}')
|
|
95
|
+
const hasInvalidFilters = columns.some(col => col.filters && !Array.isArray(col.filters));
|
|
96
|
+
|
|
97
|
+
// If there are invalid filters, return empty array to prevent table rendering
|
|
98
|
+
if (hasInvalidFilters) {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Process each column while preserving the original order
|
|
103
|
+
const processedColumns = columns.map(col => {
|
|
104
|
+
const {
|
|
105
|
+
title,
|
|
106
|
+
dataIndex,
|
|
107
|
+
jsxConfig,
|
|
108
|
+
render: userRender,
|
|
109
|
+
ellipsisConfig: colEllipsisConfig,
|
|
110
|
+
multiItemConfig: colMultiItemConfig
|
|
111
|
+
} = col,
|
|
112
|
+
rest = _objectWithoutProperties(col, _excluded2);
|
|
113
|
+
const titleNode = (0, _utils.isString)(title) || (0, _utils.isNumber)(title) ? /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
114
|
+
typography: "type-sl1-700"
|
|
115
|
+
}, title) : title;
|
|
116
|
+
|
|
117
|
+
// Handle jsxConfig for columns - now supports array
|
|
118
|
+
if (jsxConfig) {
|
|
119
|
+
var _jsxConfigs$;
|
|
120
|
+
// Check if jsxConfig is an array or single object
|
|
121
|
+
const jsxConfigs = Array.isArray(jsxConfig) ? jsxConfig : [jsxConfig];
|
|
122
|
+
|
|
123
|
+
// Determine position from first config or default
|
|
124
|
+
const position = ((_jsxConfigs$ = jsxConfigs[0]) === null || _jsxConfigs$ === void 0 ? void 0 : _jsxConfigs$.position) || "end";
|
|
125
|
+
|
|
126
|
+
// Check if any config has customRenderers type
|
|
127
|
+
const hasCustomRenderers = jsxConfigs.some(config => config && config.type === "customRenderers");
|
|
128
|
+
let ctaRender = (_, record) => /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
+
style: {
|
|
130
|
+
display: "flex",
|
|
131
|
+
gap: "8px",
|
|
132
|
+
alignItems: "center"
|
|
133
|
+
}
|
|
134
|
+
}, jsxConfigs.map((config, index) => {
|
|
135
|
+
var _config$options, _record$config$styleK;
|
|
136
|
+
// Add safety check for undefined config
|
|
137
|
+
if (!config) return null;
|
|
138
|
+
const {
|
|
139
|
+
type,
|
|
140
|
+
subType,
|
|
141
|
+
label,
|
|
142
|
+
onClickHandler,
|
|
143
|
+
options,
|
|
144
|
+
disabled = false,
|
|
145
|
+
icon
|
|
146
|
+
} = config;
|
|
147
|
+
|
|
148
|
+
// Handle different CTA types
|
|
149
|
+
switch (type) {
|
|
150
|
+
case "icon":
|
|
151
|
+
return /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
152
|
+
key: index,
|
|
153
|
+
size: 24,
|
|
154
|
+
icon: icon,
|
|
155
|
+
color: "secondary-content",
|
|
156
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config)
|
|
157
|
+
});
|
|
158
|
+
case "customRenderers":
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
+
key: index
|
|
161
|
+
}, (config === null || config === void 0 ? void 0 : config.mainLink) && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
162
|
+
role: "button",
|
|
163
|
+
onClick: () => {
|
|
164
|
+
!isRowSelected(record) && customTableChange(record, config.mainLink);
|
|
165
|
+
},
|
|
166
|
+
onKeyDown: e => !isRowSelected(record) && (e.key === "Enter" || e.key === " ") && customTableChange(record, config.mainLink),
|
|
167
|
+
label: label || _,
|
|
168
|
+
type: "text-only",
|
|
169
|
+
disabled: disabled || isRowSelected(record)
|
|
170
|
+
}), config === null || config === void 0 || (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.map((option, idx) => {
|
|
171
|
+
var _record$option$styleK, _record$option$styleK2;
|
|
172
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
+
key: idx
|
|
174
|
+
}, (option === null || option === void 0 ? void 0 : option.type) === "button" ? /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
175
|
+
type: (option === null || option === void 0 ? void 0 : option.subType) || "primary",
|
|
176
|
+
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]) || "",
|
|
177
|
+
onClick: () => customTableChange(record, config)
|
|
178
|
+
}) : (option === null || option === void 0 ? void 0 : option.type) === "tag" ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
179
|
+
label: getByPath(record, option === null || option === void 0 ? void 0 : option.key) || "",
|
|
180
|
+
type: (option === null || option === void 0 ? void 0 : option.tagType) || "primary",
|
|
181
|
+
visible: true
|
|
182
|
+
}) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
183
|
+
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",
|
|
184
|
+
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)
|
|
185
|
+
}, getByPath(record, option === null || option === void 0 ? void 0 : option.key)));
|
|
186
|
+
}));
|
|
187
|
+
case "tag":
|
|
188
|
+
const tagType = typeof subType === "function" ? subType(_, record) : subType;
|
|
189
|
+
const tagLabel = label || _;
|
|
190
|
+
return tagLabel ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
191
|
+
key: index,
|
|
192
|
+
label: tagLabel,
|
|
193
|
+
type: tagType,
|
|
194
|
+
visible: true
|
|
195
|
+
}) : null;
|
|
196
|
+
case "link":
|
|
197
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
198
|
+
key: index,
|
|
199
|
+
role: "button",
|
|
200
|
+
onClick: () => {
|
|
201
|
+
!isRowSelected(record) && customTableChange(record, config);
|
|
202
|
+
},
|
|
203
|
+
onKeyDown: e => !isRowSelected(record) && (e.key === "Enter" || e.key === " ") && customTableChange(record, config),
|
|
204
|
+
label: label || _,
|
|
205
|
+
type: "text-only",
|
|
206
|
+
disabled: disabled || isRowSelected(record)
|
|
207
|
+
});
|
|
208
|
+
case "button":
|
|
209
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
210
|
+
key: index,
|
|
211
|
+
type: subType || "primary",
|
|
212
|
+
label: label || _,
|
|
213
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config),
|
|
214
|
+
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)
|
|
215
|
+
});
|
|
216
|
+
case "dropdown":
|
|
217
|
+
return /*#__PURE__*/_react.default.createElement(_CustomSelect.default, {
|
|
218
|
+
key: index,
|
|
219
|
+
options: options,
|
|
220
|
+
onChange: val => !isRowSelected(record) && onClickHandler(record, val, setConfig),
|
|
221
|
+
disabled: isRowSelected(record)
|
|
222
|
+
});
|
|
223
|
+
case "popover":
|
|
224
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDropdown.default, {
|
|
225
|
+
key: index,
|
|
226
|
+
type: "primary",
|
|
227
|
+
disabled: isRowSelected(record),
|
|
228
|
+
items: options.map(opt => {
|
|
229
|
+
var _record$opt$styleKey;
|
|
230
|
+
return {
|
|
231
|
+
label: opt.label,
|
|
232
|
+
key: opt.key,
|
|
233
|
+
danger: opt.danger || false,
|
|
234
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config, opt.key),
|
|
235
|
+
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)
|
|
236
|
+
};
|
|
237
|
+
})
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
239
|
+
size: 24,
|
|
240
|
+
icon: _MoreVert.default,
|
|
241
|
+
color: isRowSelected(record) ? "disabled" : "secondary-content"
|
|
242
|
+
}));
|
|
243
|
+
default:
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
}));
|
|
247
|
+
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
248
|
+
dataIndex,
|
|
249
|
+
title: titleNode,
|
|
250
|
+
isCTA: !hasCustomRenderers,
|
|
251
|
+
position,
|
|
252
|
+
render: ctaRender
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Handle Data columns with ellipsisConfig and multiItemConfig
|
|
257
|
+
let effectiveEllipsisConfig = ellipsisConfig;
|
|
258
|
+
let effectiveMultiItemConfig = multiItemConfig;
|
|
259
|
+
if (!cardShow) {
|
|
260
|
+
if (colEllipsisConfig && colEllipsisConfig.enabled) {
|
|
261
|
+
effectiveEllipsisConfig = colEllipsisConfig;
|
|
262
|
+
effectiveMultiItemConfig = _objectSpread(_objectSpread({}, multiItemConfig), {}, {
|
|
263
|
+
enabled: false
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
if (colMultiItemConfig && colMultiItemConfig.enabled) {
|
|
267
|
+
effectiveMultiItemConfig = colMultiItemConfig;
|
|
268
|
+
effectiveEllipsisConfig = _objectSpread(_objectSpread({}, effectiveEllipsisConfig), {}, {
|
|
269
|
+
enabled: false
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
} else {
|
|
273
|
+
// In cardShow mode -> ellipsis off
|
|
274
|
+
effectiveEllipsisConfig = _objectSpread(_objectSpread({}, effectiveEllipsisConfig), {}, {
|
|
275
|
+
enabled: false
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
279
|
+
dataIndex,
|
|
280
|
+
title: titleNode,
|
|
281
|
+
render: (value, record) => {
|
|
282
|
+
let items = [];
|
|
283
|
+
if (Array.isArray(value)) {
|
|
284
|
+
items = value;
|
|
285
|
+
} else if ((0, _utils.isString)(value) && value.includes(",")) {
|
|
286
|
+
items = value.split(",").map(item => item.trim());
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Multi-item popover logic
|
|
290
|
+
if (effectiveMultiItemConfig.enabled && items && items.length > effectiveMultiItemConfig.displayCount) {
|
|
291
|
+
const visible = items.slice(0, effectiveMultiItemConfig.displayCount);
|
|
292
|
+
const moreCount = items.length - effectiveMultiItemConfig.displayCount;
|
|
293
|
+
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, {
|
|
294
|
+
key: (0, _utils.getUUID)(),
|
|
295
|
+
typography: "type-b2-400"
|
|
296
|
+
}, item, /*#__PURE__*/_react.default.createElement("br", null)))));
|
|
297
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, visible.map((item, idx) => /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
298
|
+
key: (0, _utils.getUUID)(),
|
|
299
|
+
typography: "type-b2-400",
|
|
300
|
+
style: {
|
|
301
|
+
display: "inline",
|
|
302
|
+
marginRight: 4
|
|
303
|
+
}
|
|
304
|
+
}, item, idx < visible.length - 1 ? "," : "")), /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
|
|
305
|
+
title: popList,
|
|
306
|
+
trigger: "hover",
|
|
307
|
+
placement: "topLeft",
|
|
308
|
+
className: "pointer"
|
|
309
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
310
|
+
typography: "type-b2-400",
|
|
311
|
+
color: "primary"
|
|
312
|
+
}, "+", moreCount, " more")));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Ellipsis popover
|
|
316
|
+
if (effectiveEllipsisConfig.enabled && !cardShow &&
|
|
317
|
+
// Completely disable ellipsis for mobile card view
|
|
318
|
+
(0, _utils.isString)(value) && value.length > effectiveEllipsisConfig.limit) {
|
|
319
|
+
const truncated = "".concat(value.slice(0, effectiveEllipsisConfig.limit), "...");
|
|
320
|
+
const popText = /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
321
|
+
typography: "type-b2-400",
|
|
322
|
+
style: {
|
|
323
|
+
maxWidth: 300,
|
|
324
|
+
whiteSpace: "normal",
|
|
325
|
+
color: "#fff"
|
|
326
|
+
}
|
|
327
|
+
}, value);
|
|
328
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
329
|
+
style: {
|
|
330
|
+
whiteSpace: "nowrap",
|
|
331
|
+
overflow: "hidden",
|
|
332
|
+
textOverflow: "ellipsis",
|
|
333
|
+
display: "inline-flex",
|
|
334
|
+
alignItems: "center"
|
|
335
|
+
}
|
|
336
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
337
|
+
typography: "type-b2-400"
|
|
338
|
+
}, truncated), effectiveEllipsisConfig.expandText && /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
|
|
339
|
+
title: popText,
|
|
340
|
+
trigger: "hover",
|
|
341
|
+
placement: "topLeft"
|
|
342
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
343
|
+
className: "margin-left-4"
|
|
344
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
345
|
+
typography: "type-b2-400",
|
|
346
|
+
color: "primary"
|
|
347
|
+
}, effectiveEllipsisConfig.expandText))));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Default rendering
|
|
351
|
+
if (typeof userRender === "function") {
|
|
352
|
+
return userRender(value, record);
|
|
353
|
+
}
|
|
354
|
+
if ((0, _utils.isString)(value) || (0, _utils.isNumber)(value)) {
|
|
355
|
+
return /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
356
|
+
typography: "type-b2-400"
|
|
357
|
+
}, value);
|
|
358
|
+
}
|
|
359
|
+
return value;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
const ctaColumnsSorted = [...processedColumns.filter(c => c.isCTA && c.position === "start"), ...processedColumns.filter(c => c.isCTA && c.position !== "start")];
|
|
364
|
+
setCtaColumnsSorted(ctaColumnsSorted);
|
|
365
|
+
|
|
366
|
+
// Returning processed columns in the same order as initial `columns` array
|
|
367
|
+
return processedColumns;
|
|
368
|
+
}, [columns, setConfig, ellipsisConfig, multiItemConfig, selectedRows, cardShow]);
|
|
369
|
+
const tableStyle = {
|
|
370
|
+
borderTop: "1px solid var(--color-divider)",
|
|
371
|
+
overflow: "hidden",
|
|
372
|
+
borderRight: tableBorder ? "1px solid var(--color-divider)" : 0,
|
|
373
|
+
borderBottom: tableBorder ? "1px solid var(--color-divider)" : 0,
|
|
374
|
+
borderLeft: tableBorder ? "1px solid var(--color-divider)" : 0,
|
|
375
|
+
borderRadius: tableBorder ? "4px" : 0
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
// Helper to get cell content (uses column render or dataIndex)
|
|
379
|
+
// Updated getContentToBeRender to handle array dataIndex
|
|
380
|
+
const getContentToBeRender = (col, row) => {
|
|
381
|
+
if (typeof col.render === "function") {
|
|
382
|
+
const value = Array.isArray(col.dataIndex) ? getByPath(row, col.dataIndex.join(".")) : col.dataIndex ? row[col.dataIndex] : undefined;
|
|
383
|
+
return col.render(value, row);
|
|
384
|
+
}
|
|
385
|
+
if (Array.isArray(col.dataIndex)) {
|
|
386
|
+
var _getByPath;
|
|
387
|
+
return (_getByPath = getByPath(row, col.dataIndex.join("."))) !== null && _getByPath !== void 0 ? _getByPath : "";
|
|
388
|
+
}
|
|
389
|
+
if (col.dataIndex) {
|
|
390
|
+
var _row$col$dataIndex;
|
|
391
|
+
return (_row$col$dataIndex = row[col.dataIndex]) !== null && _row$col$dataIndex !== void 0 ? _row$col$dataIndex : "";
|
|
392
|
+
}
|
|
393
|
+
return "";
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
// Toggle expanded view for a card (add/remove row index in viewMore array)
|
|
397
|
+
const handleViewMore = index => {
|
|
398
|
+
setViewMore(prev => prev.includes(index) ? prev.filter(i => i !== index) : [...prev, index]);
|
|
399
|
+
};
|
|
400
|
+
const customLocale = {
|
|
401
|
+
filterReset: "Reset",
|
|
402
|
+
filterConfirm: "Apply"
|
|
403
|
+
};
|
|
404
|
+
return /*#__PURE__*/_react.default.createElement(_stylesV.MainContainer, null, /*#__PURE__*/_react.default.createElement(_stylesV.GlobalStyle, null), !cardShow && /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
405
|
+
theme: {
|
|
406
|
+
components: {
|
|
407
|
+
Table: {}
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
locale: {
|
|
411
|
+
Table: customLocale
|
|
412
|
+
}
|
|
413
|
+
}, /*#__PURE__*/_react.default.createElement(_stylesV.StyledTable, _extends({
|
|
414
|
+
style: _objectSpread(_objectSpread({}, tableStyle), style),
|
|
415
|
+
columns: finalColumns,
|
|
416
|
+
dataSource: dataSource,
|
|
417
|
+
pagination: mergedPagination,
|
|
418
|
+
rowKey: row => row.rowKey,
|
|
419
|
+
locale: {
|
|
420
|
+
emptyText
|
|
421
|
+
},
|
|
422
|
+
size: size,
|
|
423
|
+
scroll: {
|
|
424
|
+
x: "max-content"
|
|
425
|
+
}
|
|
426
|
+
}, antDesignProps))), /*#__PURE__*/_react.default.createElement("div", {
|
|
427
|
+
className: cardShow && dataSource ? "bottomPadding" : ""
|
|
428
|
+
}, cardShow && dataSource && dataSource.map((row, rowIndex) => {
|
|
429
|
+
var _finalColumns$;
|
|
430
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
431
|
+
key: (0, _utils.getUUID)(),
|
|
432
|
+
className: "cardStyles"
|
|
433
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
434
|
+
className: "srDetails"
|
|
435
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
436
|
+
typography: "type-t2-700",
|
|
437
|
+
color: "primary-content"
|
|
438
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, (_finalColumns$ = finalColumns[0]) === null || _finalColumns$ === void 0 ? void 0 : _finalColumns$.title, ": "), getContentToBeRender(finalColumns[0], row))), finalColumns.map((col, colIndex) => {
|
|
439
|
+
// Exclude the first column and any column with action buttons (jsxConfig) from the card view
|
|
440
|
+
if (colIndex === 0 || col.isCTA) return null; // Ensure no action buttons in card
|
|
441
|
+
if (!viewMore.includes(rowIndex) && colIndex > threshold) return null;
|
|
442
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
443
|
+
key: (0, _utils.getUUID)(),
|
|
444
|
+
className: "keyValue"
|
|
445
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, col.title), /*#__PURE__*/_react.default.createElement("strong", null, getContentToBeRender(col, row)));
|
|
446
|
+
}), finalColumns.length > threshold && /*#__PURE__*/_react.default.createElement("div", {
|
|
447
|
+
className: "showHideBtn"
|
|
448
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
449
|
+
size: "medium",
|
|
450
|
+
type: "text-only",
|
|
451
|
+
label: viewMore.includes(rowIndex) ? "View Less" : "View More",
|
|
452
|
+
iconConfig: {
|
|
453
|
+
icon: viewMore.includes(rowIndex) ? /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
454
|
+
icon: _KeyboardArrowUp.default,
|
|
455
|
+
size: 16
|
|
456
|
+
}) : /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
457
|
+
icon: _KeyboardArrowDown.default,
|
|
458
|
+
size: 16
|
|
459
|
+
}),
|
|
460
|
+
position: "right"
|
|
461
|
+
},
|
|
462
|
+
onClick: () => handleViewMore(rowIndex)
|
|
463
|
+
})), ctaColumnsSorted.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
464
|
+
className: "footerCta"
|
|
465
|
+
}, ctaColumnsSorted.filter(col => col.isCTA && col !== finalColumns[0]) // Exclude first column from footer
|
|
466
|
+
.map(col => /*#__PURE__*/_react.default.createElement("div", {
|
|
467
|
+
key: col.key || col.dataIndex,
|
|
468
|
+
style: {
|
|
469
|
+
display: "flex",
|
|
470
|
+
gap: "8px",
|
|
471
|
+
flexWrap: "wrap"
|
|
472
|
+
}
|
|
473
|
+
}, getContentToBeRender(col, row)))));
|
|
474
|
+
}), cardShow && dataSource.length == 0 && emptyStateCard), cardShow && dataSource.length > 0 && onMobilePageChange && /*#__PURE__*/_react.default.createElement("div", {
|
|
475
|
+
className: "mobileViewPagination"
|
|
476
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomPagination.default, {
|
|
477
|
+
current: pagination.current,
|
|
478
|
+
pageSize: pagination.pageSize,
|
|
479
|
+
total: pagination.total,
|
|
480
|
+
onChange: page => {
|
|
481
|
+
onMobilePageChange === null || onMobilePageChange === void 0 || onMobilePageChange({
|
|
482
|
+
current: page,
|
|
483
|
+
pageSize: pagination.pageSize
|
|
484
|
+
});
|
|
485
|
+
},
|
|
486
|
+
showLessItems: true
|
|
487
|
+
})));
|
|
488
|
+
}
|
|
489
|
+
CustomTableV1.propTypes = {
|
|
490
|
+
columns: _propTypes.default.array.isRequired,
|
|
491
|
+
dataSource: _propTypes.default.array,
|
|
492
|
+
pagination: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
493
|
+
rowKey: _propTypes.default.string,
|
|
494
|
+
size: _propTypes.default.oneOf(["small", "middle", "large"]),
|
|
495
|
+
style: _propTypes.default.object,
|
|
496
|
+
tableBorder: _propTypes.default.bool,
|
|
497
|
+
emptyText: _propTypes.default.string,
|
|
498
|
+
defaultCardShow: _propTypes.default.bool,
|
|
499
|
+
setConfig: _propTypes.default.func.isRequired,
|
|
500
|
+
ellipsisConfig: _propTypes.default.shape({
|
|
501
|
+
enabled: _propTypes.default.bool,
|
|
502
|
+
limit: _propTypes.default.number,
|
|
503
|
+
expandText: _propTypes.default.string
|
|
504
|
+
}),
|
|
505
|
+
multiItemConfig: _propTypes.default.shape({
|
|
506
|
+
enabled: _propTypes.default.bool,
|
|
507
|
+
displayCount: _propTypes.default.number
|
|
508
|
+
}),
|
|
509
|
+
selectedRows: _propTypes.default.array
|
|
510
|
+
};
|
|
511
|
+
CustomTableV1.defaultProps = {
|
|
512
|
+
dataSource: [],
|
|
513
|
+
pagination: false,
|
|
514
|
+
rowKey: "",
|
|
515
|
+
size: "middle",
|
|
516
|
+
style: {},
|
|
517
|
+
tableBorder: true,
|
|
518
|
+
emptyText: "No Data",
|
|
519
|
+
defaultCardShow: false,
|
|
520
|
+
ellipsisConfig: {
|
|
521
|
+
enabled: false,
|
|
522
|
+
limit: 100,
|
|
523
|
+
expandText: ""
|
|
524
|
+
},
|
|
525
|
+
multiItemConfig: {
|
|
526
|
+
enabled: false,
|
|
527
|
+
displayCount: 2
|
|
528
|
+
},
|
|
529
|
+
selectedRows: []
|
|
530
|
+
};
|
|
531
|
+
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\xA0{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"])));
|
|
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: 4px;\n align-items: center;\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 .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"])));
|