@popsure/dirty-swan 0.54.3 → 0.54.4
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/dist/cjs/index.js +74 -71
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/table/components/TableCell/BaseCell/BaseCell.d.ts +5 -5
- package/dist/cjs/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.d.ts +7 -7
- package/dist/cjs/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +3 -3
- package/dist/cjs/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.d.ts +4 -4
- package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +4 -3
- package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +5 -4
- package/dist/cjs/lib/components/table/types.d.ts +12 -4
- package/dist/esm/TableSection-f6d0028e.js +80 -0
- package/dist/esm/TableSection-f6d0028e.js.map +1 -0
- package/dist/esm/components/table/Table.js +8 -13
- package/dist/esm/components/table/Table.js.map +1 -1
- package/dist/esm/components/table/Table.stories.js +61 -35
- package/dist/esm/components/table/Table.stories.js.map +1 -1
- package/dist/esm/components/table/Table.test.js +3 -6
- package/dist/esm/components/table/Table.test.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js +3 -3
- package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.stories.js +7 -7
- package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.stories.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js +6 -6
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.stories.js +4 -4
- package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.stories.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js +3 -3
- package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/CTACell/CTACell.stories.js +5 -4
- package/dist/esm/components/table/components/TableCell/CTACell/CTACell.stories.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/TableCell.js +5 -2
- package/dist/esm/components/table/components/TableCell/TableCell.js.map +1 -1
- package/dist/esm/components/table/components/TableCell/TableCell.test.js +3 -5
- package/dist/esm/components/table/components/TableCell/TableCell.test.js.map +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.js +1 -1
- package/dist/esm/components/table/components/TableContents/TableContents.test.js +5 -5
- package/dist/esm/components/table/components/TableContents/TableContents.test.js.map +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.js +7 -75
- package/dist/esm/components/table/components/TableSection/TableSection.js.map +1 -1
- package/dist/esm/components/table/components/TableSection/TableSection.test.js +3 -3
- package/dist/esm/components/table/components/TableSection/TableSection.test.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/components/table/components/TableCell/BaseCell/BaseCell.d.ts +5 -5
- package/dist/esm/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.d.ts +7 -7
- package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +3 -3
- package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.d.ts +4 -4
- package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +4 -3
- package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +5 -4
- package/dist/esm/lib/components/table/types.d.ts +12 -4
- package/package.json +1 -1
- package/src/lib/components/table/Table.stories.tsx +61 -35
- package/src/lib/components/table/Table.test.tsx +2 -5
- package/src/lib/components/table/Table.tsx +7 -14
- package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.tsx +11 -11
- package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.tsx +17 -19
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.module.scss +2 -2
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.tsx +13 -13
- package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx +8 -8
- package/src/lib/components/table/components/TableCell/CTACell/CTACell.stories.tsx +9 -6
- package/src/lib/components/table/components/TableCell/CTACell/CTACell.tsx +9 -7
- package/src/lib/components/table/components/TableCell/TableCell.test.tsx +8 -7
- package/src/lib/components/table/components/TableCell/TableCell.tsx +5 -1
- package/src/lib/components/table/components/TableContents/TableContents.test.tsx +4 -4
- package/src/lib/components/table/components/TableSection/TableSection.test.tsx +2 -2
- package/src/lib/components/table/components/TableSection/TableSection.tsx +64 -65
- package/src/lib/components/table/types.ts +11 -4
package/dist/cjs/index.js
CHANGED
|
@@ -14295,7 +14295,7 @@ var progressLookup = {
|
|
|
14295
14295
|
'100%': 5,
|
|
14296
14296
|
};
|
|
14297
14297
|
var BaseCell = function (_a) {
|
|
14298
|
-
var _b = _a.align, align = _b === void 0 ? 'center' : _b, checkmarkValue = _a.checkmarkValue, _c = _a.
|
|
14298
|
+
var _b = _a.align, align = _b === void 0 ? 'center' : _b, checkmarkValue = _a.checkmarkValue, _c = _a.fontVariant, fontVariant = _c === void 0 ? 'NORMAL' : _c, _d = _a.description, description = _d === void 0 ? '' : _d, _e = _a.modalContent, modalContent = _e === void 0 ? '' : _e, openModal = _a.openModal, rating = _a.rating, _f = _a.text, text = _f === void 0 ? '' : _f;
|
|
14299
14299
|
var alignClassName = {
|
|
14300
14300
|
center: 'ta-center jc-center ai-center',
|
|
14301
14301
|
left: 'ta-left jc-start',
|
|
@@ -14303,10 +14303,10 @@ var BaseCell = function (_a) {
|
|
|
14303
14303
|
}[align];
|
|
14304
14304
|
var validRatingValues = [1, 2, 3];
|
|
14305
14305
|
var SelectedIcon = (rating === null || rating === void 0 ? void 0 : rating.type) === 'zap' ? ZapFilledIcon : StarFilledIcon;
|
|
14306
|
-
var progressBarValue = typeof
|
|
14306
|
+
var progressBarValue = typeof text === 'string' ? progressLookup[text] : undefined;
|
|
14307
14307
|
return (jsxRuntime.jsxs("div", { className: classNames$1('d-flex gap8 ai-center', {
|
|
14308
14308
|
'jc-center': align === 'center',
|
|
14309
|
-
}), children: [jsxRuntime.jsxs("div", { className: classNames$1('d-flex fd-column', alignClassName), children: [progressBarValue !== undefined && (jsxRuntime.jsx(MiniProgressBar, { nFilledBars: progressBarValue })), (rating === null || rating === void 0 ? void 0 : rating.value) && (jsxRuntime.jsx("span", { "data-testid": "table-cell-rating", title: "".concat(rating === null || rating === void 0 ? void 0 : rating.value, " out of 3"), children: validRatingValues.map(function (value) { return (jsxRuntime.jsx(SelectedIcon, { "aria-hidden": "true", color: value <= (rating === null || rating === void 0 ? void 0 : rating.value) ? 'primary-500' : 'grey-400', className: styles$7.icon }, value)); }) })), jsxRuntime.jsxs("div", { className: "d-flex ai-center", children: [checkmarkValue !== undefined && (jsxRuntime.jsx("span", { title: checkmarkValue ? 'Yes' : 'No', children: checkmarkValue ? (jsxRuntime.jsx(CheckIcon, { "data-testid": "table-cell-boolean-yes", size: 24, "aria-hidden": true, color: "primary-500" })) : (jsxRuntime.jsx(XIcon, { "data-testid": "table-cell-boolean-no", size: 24, "aria-hidden": true, color: "grey-400" })) })),
|
|
14309
|
+
}), children: [jsxRuntime.jsxs("div", { className: classNames$1('d-flex fd-column', alignClassName), children: [progressBarValue !== undefined && (jsxRuntime.jsx(MiniProgressBar, { nFilledBars: progressBarValue })), (rating === null || rating === void 0 ? void 0 : rating.value) && (jsxRuntime.jsx("span", { "data-testid": "table-cell-rating", title: "".concat(rating === null || rating === void 0 ? void 0 : rating.value, " out of 3"), children: validRatingValues.map(function (value) { return (jsxRuntime.jsx(SelectedIcon, { "aria-hidden": "true", color: value <= (rating === null || rating === void 0 ? void 0 : rating.value) ? 'primary-500' : 'grey-400', className: styles$7.icon }, value)); }) })), jsxRuntime.jsxs("div", { className: "d-flex ai-center", children: [checkmarkValue !== undefined && (jsxRuntime.jsx("span", { title: checkmarkValue ? 'Yes' : 'No', children: checkmarkValue ? (jsxRuntime.jsx(CheckIcon, { "data-testid": "table-cell-boolean-yes", size: 24, "aria-hidden": true, color: "primary-500" })) : (jsxRuntime.jsx(XIcon, { "data-testid": "table-cell-boolean-no", size: 24, "aria-hidden": true, color: "grey-400" })) })), text && fontVariant === 'NORMAL' && (jsxRuntime.jsx("div", { className: "p-p", "data-testid": "table-cell-text", children: text })), text && fontVariant === 'PRICE' && (jsxRuntime.jsx("div", { className: "p-h1 p--serif tc-primary-500", "data-testid": "table-cell-content", children: text })), text && fontVariant === 'BIG_WITH_UNDERLINE' && (jsxRuntime.jsx("div", { "aria-hidden": true, className: classNames$1('tc-grey-800 p-h2 p--serif', styles$7.bigWithUnderline), children: text }))] }), description && (jsxRuntime.jsx("div", { className: classNames$1('d-flex p-p--small tc-grey-500', alignClassName), children: description }))] }), modalContent && openModal && (jsxRuntime.jsx(TableInfoButton, { onClick: function () { return openModal(modalContent); } }))] }));
|
|
14310
14310
|
};
|
|
14311
14311
|
|
|
14312
14312
|
var css_248z$5 = ".CTACell-module_narrow__1EPPT {\n height: 40px;\n}";
|
|
@@ -14315,32 +14315,33 @@ styleInject(css_248z$5);
|
|
|
14315
14315
|
|
|
14316
14316
|
var CTACell = function (_a) {
|
|
14317
14317
|
var _b;
|
|
14318
|
-
var
|
|
14319
|
-
return (jsxRuntime.jsxs("div", { className: "wmn3 ta-center", children: [jsxRuntime.jsxs("p", { className: "p-h3", children: [
|
|
14318
|
+
var title = _a.title, price = _a.price, grey = _a.grey, narrow = _a.narrow, href = _a.href, buttonCaption = _a.buttonCaption;
|
|
14319
|
+
return (jsxRuntime.jsxs("div", { className: "wmn3 ta-center", children: [jsxRuntime.jsxs("p", { className: "p-h3", children: [title, price && jsxRuntime.jsxs("span", { className: "tc-purple-500", children: [" ", price] })] }), jsxRuntime.jsx("a", { className: classNames$1('mt16', (_b = {
|
|
14320
14320
|
'p-btn--primary': !grey,
|
|
14321
14321
|
'p-btn--secondary-grey': grey
|
|
14322
14322
|
},
|
|
14323
14323
|
_b[styles$5.narrow] = narrow,
|
|
14324
|
-
_b)), href: href, target: "_blank", rel: "noopener noreferrer", children:
|
|
14324
|
+
_b)), href: href, target: "_blank", rel: "noopener noreferrer", children: buttonCaption })] }));
|
|
14325
14325
|
};
|
|
14326
14326
|
|
|
14327
|
-
var css_248z$4 = ".ButtonCell-module_buttonCell__x4NNi {\n color: #26262e;\n border: 1px solid #d2d2d8;\n transition: all 0.3s ease-in-out;\n}\n@media (max-width: 34rem) {\n .ButtonCell-module_buttonCell__x4NNi {\n max-width: calc(100% - 96px);\n }\n}\n.ButtonCell-module_buttonCell__x4NNi:disabled {\n border: none;\n background-color: #f5f6fb;\n color: #26262e;\n opacity: 1;\n cursor: default;\n}\n.ButtonCell-module_buttonCell__x4NNi:disabled:hover {\n background-color: #f5f6fb;\n}\n@media (max-width: 34rem) {\n .ButtonCell-module_buttonCell__x4NNi {\n pointer-events: none;\n }\n}\n\n.ButtonCell-
|
|
14328
|
-
var styles$4 = {"buttonCell":"ButtonCell-module_buttonCell__x4NNi","
|
|
14327
|
+
var css_248z$4 = ".ButtonCell-module_buttonCell__x4NNi {\n color: #26262e;\n border: 1px solid #d2d2d8;\n transition: all 0.3s ease-in-out;\n}\n@media (max-width: 34rem) {\n .ButtonCell-module_buttonCell__x4NNi {\n max-width: calc(100% - 96px);\n }\n}\n.ButtonCell-module_buttonCell__x4NNi:disabled {\n border: none;\n background-color: #f5f6fb;\n color: #26262e;\n opacity: 1;\n cursor: default;\n}\n.ButtonCell-module_buttonCell__x4NNi:disabled:hover {\n background-color: #f5f6fb;\n}\n@media (max-width: 34rem) {\n .ButtonCell-module_buttonCell__x4NNi {\n pointer-events: none;\n }\n}\n\n.ButtonCell-module_withoutPrice__2rpe9 {\n height: 64px;\n}\n\n.ButtonCell-module_withPrice__3bd_t {\n height: 75px;\n}\n\n.ButtonCell-module_selected__22pF_ {\n transition: all 0.3 ease-in-out;\n border: 2px solid #8e8cee;\n background-color: #f7f7ff;\n}";
|
|
14328
|
+
var styles$4 = {"buttonCell":"ButtonCell-module_buttonCell__x4NNi","withoutPrice":"ButtonCell-module_withoutPrice__2rpe9","withPrice":"ButtonCell-module_withPrice__3bd_t","selected":"ButtonCell-module_selected__22pF_"};
|
|
14329
14329
|
styleInject(css_248z$4);
|
|
14330
14330
|
|
|
14331
14331
|
var ButtonCell = function (_a) {
|
|
14332
14332
|
var _b;
|
|
14333
|
-
var isSelected = _a.isSelected, onClick = _a.onClick,
|
|
14333
|
+
var isSelected = _a.isSelected, onClick = _a.onClick, buttonCaption = _a.buttonCaption, price = _a.price, disabled = _a.disabled;
|
|
14334
14334
|
return (jsxRuntime.jsx("div", { className: "w100 d-flex fd-column ai-center jc-center gap8", children: jsxRuntime.jsxs(Button, { className: classNames$1('w100 wmx5 d-flex fd-column', styles$4.buttonCell, (_b = {},
|
|
14335
14335
|
_b[styles$4.selected] = isSelected,
|
|
14336
|
-
_b[styles$4.
|
|
14337
|
-
_b[styles$4.
|
|
14338
|
-
_b)), variant: "filledWhite", type: "submit", onClick: onClick, disabled: disabled, children: [
|
|
14336
|
+
_b[styles$4.withoutPrice] = !price,
|
|
14337
|
+
_b[styles$4.withPrice] = !!price,
|
|
14338
|
+
_b)), variant: "filledWhite", type: "submit", onClick: onClick, disabled: disabled, children: [buttonCaption, price && jsxRuntime.jsx("span", { className: "p-p tc-purple-500", children: price })] }) }));
|
|
14339
14339
|
};
|
|
14340
14340
|
|
|
14341
14341
|
var TableCell = function (_a) {
|
|
14342
14342
|
var _b;
|
|
14343
|
-
var _c
|
|
14343
|
+
var _c;
|
|
14344
|
+
var _d = _a.isFirstCellInRow, isFirstCellInRow = _d === void 0 ? false : _d, _e = _a.isHeader, isHeader = _e === void 0 ? false : _e, _f = _a.isNavigation, isNavigation = _f === void 0 ? false : _f, _g = _a.isTopLeftCell, isTopLeftCell = _g === void 0 ? false : _g, cellProps = __rest$1(_a, ["isFirstCellInRow", "isHeader", "isNavigation", "isTopLeftCell"]);
|
|
14344
14345
|
// prettier-ignore
|
|
14345
14346
|
var Tag = isNavigation
|
|
14346
14347
|
? 'div'
|
|
@@ -14357,7 +14358,9 @@ var TableCell = function (_a) {
|
|
|
14357
14358
|
},
|
|
14358
14359
|
_b[styles$8.fixedCell] = isFirstCellInRow,
|
|
14359
14360
|
_b.pl32 = isFirstCellInRow,
|
|
14360
|
-
_b)), children: [!cellProps.type && (jsxRuntime.jsx(BaseCell, __assign({}, cellProps, {
|
|
14361
|
+
_b)), children: [!cellProps.type && (jsxRuntime.jsx(BaseCell, __assign({}, cellProps, { fontVariant: isTopLeftCell
|
|
14362
|
+
? 'BIG_WITH_UNDERLINE'
|
|
14363
|
+
: (_c = cellProps.fontVariant) !== null && _c !== void 0 ? _c : 'NORMAL' }))), cellProps.type === 'CTA' && jsxRuntime.jsx(CTACell, __assign({}, cellProps)), cellProps.type === 'BUTTON' && jsxRuntime.jsx(ButtonCell, __assign({}, cellProps))] })));
|
|
14361
14364
|
};
|
|
14362
14365
|
|
|
14363
14366
|
var css_248z$3 = ".Table-module_wrapper__2MMNq {\n position: relative;\n}\n\n.Table-module_container__3VFLP {\n overflow-x: auto;\n overflow-y: hidden;\n -ms-overflow-style: none;\n /* IE and Edge */\n scrollbar-width: none;\n /* Firefox */\n -webkit-overflow-scrolling: touch;\n scroll-snap-type: x mandatory;\n}\n.Table-module_container__3VFLP::-webkit-scrollbar {\n display: none;\n}\n@media (min-width: 34rem) {\n .Table-module_container__3VFLP {\n scroll-snap-type: unset;\n }\n}\n\n.Table-module_stickyHeader__2uEpP {\n display: flex;\n position: sticky;\n z-index: 9;\n}";
|
|
@@ -14419,65 +14422,70 @@ var css_248z$2 = ".TableSection-module_table__sNbDq {\n border-collapse: collap
|
|
|
14419
14422
|
var styles$2 = {"table":"TableSection-module_table__sNbDq","tr":"TableSection-module_tr__UbkbE"};
|
|
14420
14423
|
styleInject(css_248z$2);
|
|
14421
14424
|
|
|
14425
|
+
var isBaseCell = function (tableCellData) {
|
|
14426
|
+
return !tableCellData.type;
|
|
14427
|
+
};
|
|
14428
|
+
|
|
14422
14429
|
var TableSection = function (_a) {
|
|
14423
14430
|
var className = _a.className, tableCellRows = _a.tableCellRows, hideHeader = _a.hideHeader, openModal = _a.openModal, title = _a.title, width = _a.width;
|
|
14424
14431
|
var headerRow = tableCellRows === null || tableCellRows === void 0 ? void 0 : tableCellRows[0];
|
|
14425
|
-
var
|
|
14426
|
-
|
|
14427
|
-
var
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
|
|
14432
|
+
var getModalTitleFromColumnHeader = function (cellIndex) {
|
|
14433
|
+
var _a;
|
|
14434
|
+
var firstCellInColumn = (_a = tableCellRows === null || tableCellRows === void 0 ? void 0 : tableCellRows[0]) === null || _a === void 0 ? void 0 : _a[cellIndex];
|
|
14435
|
+
var titleFromColumn;
|
|
14436
|
+
switch (firstCellInColumn.type) {
|
|
14437
|
+
case 'BUTTON':
|
|
14438
|
+
titleFromColumn = firstCellInColumn.buttonCaption;
|
|
14439
|
+
break;
|
|
14440
|
+
case 'CTA':
|
|
14441
|
+
titleFromColumn = firstCellInColumn.title;
|
|
14442
|
+
break;
|
|
14443
|
+
case undefined:
|
|
14444
|
+
titleFromColumn = firstCellInColumn.text || '';
|
|
14445
|
+
break;
|
|
14446
|
+
}
|
|
14447
|
+
return titleFromColumn;
|
|
14432
14448
|
};
|
|
14433
|
-
|
|
14449
|
+
var getModalTitleFromRowHeader = function (currentRow) {
|
|
14450
|
+
var firstCellInRow = currentRow === null || currentRow === void 0 ? void 0 : currentRow[0];
|
|
14451
|
+
var titleFromRow = (isBaseCell(firstCellInRow) && firstCellInRow.text) || '';
|
|
14452
|
+
return titleFromRow;
|
|
14453
|
+
};
|
|
14454
|
+
return (jsxRuntime.jsxs("table", { className: classNames$1(className, 'w100', styles$2.table), width: width, children: [jsxRuntime.jsx("caption", { className: "sr-only", children: title }), headerRow && (jsxRuntime.jsx("thead", { className: hideHeader ? 'sr-only' : '', children: jsxRuntime.jsx("tr", { children: headerRow.map(function (tableCellData, cellIndex) {
|
|
14434
14455
|
var isFirstCellInRow = cellIndex === 0;
|
|
14435
|
-
|
|
14436
|
-
var openModal;
|
|
14437
|
-
var align = 'left';
|
|
14438
|
-
if (isBaseCell) {
|
|
14439
|
-
openModal = function (body) {
|
|
14440
|
-
return handleOpenModal({
|
|
14441
|
-
cellIndex: cellIndex,
|
|
14442
|
-
body: body,
|
|
14443
|
-
title: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.content,
|
|
14444
|
-
});
|
|
14445
|
-
};
|
|
14446
|
-
align = isFirstCellInRow ? 'left' : 'center';
|
|
14447
|
-
}
|
|
14448
|
-
return (jsxRuntime.jsx(TableCell, __assign({ isHeader: true, isFirstCellInRow: isFirstCellInRow, isTopLeftCell: isFirstCellInRow }, tableCellProps, (isBaseCell
|
|
14456
|
+
return (jsxRuntime.jsx(TableCell, __assign({ isHeader: true, isFirstCellInRow: isFirstCellInRow, isTopLeftCell: isFirstCellInRow }, tableCellData, (isBaseCell(tableCellData)
|
|
14449
14457
|
? {
|
|
14450
|
-
openModal:
|
|
14451
|
-
|
|
14458
|
+
openModal: function (body) {
|
|
14459
|
+
return openModal === null || openModal === void 0 ? void 0 : openModal({
|
|
14460
|
+
body: body,
|
|
14461
|
+
title: tableCellData.text ||
|
|
14462
|
+
getModalTitleFromColumnHeader(cellIndex),
|
|
14463
|
+
});
|
|
14464
|
+
},
|
|
14465
|
+
align: isFirstCellInRow ? 'left' : 'center',
|
|
14452
14466
|
}
|
|
14453
14467
|
: {})), cellIndex));
|
|
14454
14468
|
}) }) })), jsxRuntime.jsx("tbody", { children: tableCellRows.map(function (row, rowIndex) {
|
|
14455
14469
|
row.length === 1;
|
|
14456
|
-
return (rowIndex > 0 && (jsxRuntime.jsx("tr", { className: styles$2.tr, children: row.map(function (
|
|
14470
|
+
return (rowIndex > 0 && (jsxRuntime.jsx("tr", { className: styles$2.tr, children: row.map(function (tableCellData, cellIndex) {
|
|
14457
14471
|
var key = "".concat(rowIndex, "-").concat(cellIndex);
|
|
14458
14472
|
var isFirstCellInRow = cellIndex === 0;
|
|
14459
|
-
|
|
14460
|
-
return handleOpenModal({
|
|
14461
|
-
cellIndex: cellIndex,
|
|
14462
|
-
body: body,
|
|
14463
|
-
title: isFirstCellInRow
|
|
14464
|
-
? tableCellProps.content
|
|
14465
|
-
: undefined,
|
|
14466
|
-
});
|
|
14467
|
-
};
|
|
14468
|
-
var openModal;
|
|
14469
|
-
var align = 'left';
|
|
14470
|
-
var isBaseCell = !tableCellProps.type;
|
|
14471
|
-
if (isBaseCell) {
|
|
14472
|
-
openModal = onCelInfoClick;
|
|
14473
|
-
align = isFirstCellInRow ? 'left' : 'center';
|
|
14474
|
-
}
|
|
14475
|
-
return (require$$0.createElement(TableCell, __assign({}, (isBaseCell
|
|
14473
|
+
return (jsxRuntime.jsx(TableCell, __assign({ isFirstCellInRow: isFirstCellInRow }, tableCellData, (isBaseCell(tableCellData)
|
|
14476
14474
|
? {
|
|
14477
|
-
openModal:
|
|
14478
|
-
|
|
14475
|
+
openModal: function (body) {
|
|
14476
|
+
var titleFromRow = getModalTitleFromRowHeader(row);
|
|
14477
|
+
var titleFromColumnOrRow = getModalTitleFromColumnHeader(cellIndex) ||
|
|
14478
|
+
getModalTitleFromRowHeader(row);
|
|
14479
|
+
return openModal === null || openModal === void 0 ? void 0 : openModal({
|
|
14480
|
+
body: body,
|
|
14481
|
+
title: isFirstCellInRow
|
|
14482
|
+
? titleFromRow
|
|
14483
|
+
: titleFromColumnOrRow,
|
|
14484
|
+
});
|
|
14485
|
+
},
|
|
14486
|
+
align: isFirstCellInRow ? 'left' : 'center',
|
|
14479
14487
|
}
|
|
14480
|
-
: {}),
|
|
14488
|
+
: {})), key));
|
|
14481
14489
|
}) }, rowIndex)));
|
|
14482
14490
|
}) })] }));
|
|
14483
14491
|
};
|
|
@@ -14636,19 +14644,14 @@ var Table = function (_a) {
|
|
|
14636
14644
|
onModalOpen === null || onModalOpen === void 0 ? void 0 : onModalOpen({ body: body, title: title });
|
|
14637
14645
|
setInfoModalData({ body: body, title: title });
|
|
14638
14646
|
};
|
|
14639
|
-
|
|
14640
|
-
var openModal;
|
|
14641
|
-
if (isBaseCell) {
|
|
14642
|
-
openModal = function (body) {
|
|
14643
|
-
return handleOpenModal({
|
|
14644
|
-
body: body,
|
|
14645
|
-
title: currentActiveSection === null || currentActiveSection === void 0 ? void 0 : currentActiveSection.content,
|
|
14646
|
-
});
|
|
14647
|
-
};
|
|
14648
|
-
}
|
|
14649
|
-
return (jsxRuntime.jsxs("div", { className: classNames$1(styles$3.wrapper, 'bg-white'), children: [isMobile ? (jsxRuntime.jsx(TableControls, { activeSection: activeSection, columnsLength: columnsLength, navigateTable: navigateTable, stickyHeaderTopOffset: stickyHeaderTopOffset, children: jsxRuntime.jsx(TableCell, __assign({}, currentActiveSection, (isBaseCell
|
|
14647
|
+
return (jsxRuntime.jsxs("div", { className: classNames$1(styles$3.wrapper, 'bg-white'), children: [isMobile ? (jsxRuntime.jsx(TableControls, { activeSection: activeSection, columnsLength: columnsLength, navigateTable: navigateTable, stickyHeaderTopOffset: stickyHeaderTopOffset, children: jsxRuntime.jsx(TableCell, __assign({}, currentActiveSection, (isBaseCell(currentActiveSection)
|
|
14650
14648
|
? {
|
|
14651
|
-
openModal:
|
|
14649
|
+
openModal: function (body) {
|
|
14650
|
+
return handleOpenModal({
|
|
14651
|
+
body: body,
|
|
14652
|
+
title: currentActiveSection === null || currentActiveSection === void 0 ? void 0 : currentActiveSection.text,
|
|
14653
|
+
});
|
|
14654
|
+
},
|
|
14652
14655
|
}
|
|
14653
14656
|
: {}), { isNavigation: true })) })) : (jsxRuntime.jsx("div", { "aria-hidden": true, className: styles$3.stickyHeader, style: { top: "".concat(stickyHeaderTopOffset, "px") }, children: jsxRuntime.jsx("div", { className: styles$3.container, ref: headerRef, children: jsxRuntime.jsx(TableSection, { tableCellRows: [(_f = (_e = tableData === null || tableData === void 0 ? void 0 : tableData[0]) === null || _e === void 0 ? void 0 : _e.rows) === null || _f === void 0 ? void 0 : _f[0]], title: title, className: className, openModal: handleOpenModal }) }) })), jsxRuntime.jsx("div", { ref: containerRef, className: classNames$1(styles$3.container, 'pb8'), children: jsxRuntime.jsx(TableContents, { tableData: tableData, title: title, className: className, collapsibleSections: collapsibleSections, hideDetails: hideDetails, isMobile: isMobile, shouldHideDetails: shouldHideDetails, openModal: handleOpenModal }) }), hideDetails && (jsxRuntime.jsx(Card, { "data-testid": "show-hide-details", classNames: {
|
|
14654
14657
|
buttonWrapper: 'm8 mt32',
|