@popsure/dirty-swan 0.66.27 → 0.66.28
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 +10 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/tabs/Tabs.d.ts +1 -0
- package/dist/esm/components/table/Table.js +9 -1
- package/dist/esm/components/table/Table.js.map +1 -1
- package/dist/esm/components/table/Table.test.js +25 -0
- package/dist/esm/components/table/Table.test.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.js +1 -1
- package/dist/esm/components/tabs/Tabs.js.map +1 -1
- package/dist/esm/lib/components/tabs/Tabs.d.ts +1 -0
- package/package.json +1 -1
- package/src/lib/components/table/Table.test.tsx +43 -0
- package/src/lib/components/table/Table.tsx +9 -1
- package/src/lib/components/tabs/Tabs.tsx +2 -0
package/dist/cjs/index.js
CHANGED
|
@@ -23115,7 +23115,7 @@ var Tabs = function (_a) {
|
|
|
23115
23115
|
var _a;
|
|
23116
23116
|
return (jsxRuntime.jsx("button", { ref: setTabRef(index), type: "button", role: "tab", "aria-selected": activeIndex === index, tabIndex: activeIndex === index ? 0 : -1, className: classNames('p-p bg-transparent c-pointer', styles$1.tab, (_a = {},
|
|
23117
23117
|
_a[styles$1.tabActive] = activeIndex === index,
|
|
23118
|
-
_a)), onClick: function () { return onTabChange(index); }, onKeyDown: function (e) { return handleKeyDown(e, index); }, children: tab.label }, tab.id));
|
|
23118
|
+
_a)), onClick: function () { return onTabChange(index); }, onKeyDown: function (e) { return handleKeyDown(e, index); }, "data-testid": tab.dataTestId, children: tab.label }, tab.id));
|
|
23119
23119
|
}) }));
|
|
23120
23120
|
};
|
|
23121
23121
|
|
|
@@ -23123,6 +23123,9 @@ var defaultTextOverrides = {
|
|
|
23123
23123
|
showDetails: 'Show details',
|
|
23124
23124
|
hideDetails: 'Hide details',
|
|
23125
23125
|
};
|
|
23126
|
+
var getCellDataTestId = function (cell) {
|
|
23127
|
+
return cell && 'dataTestId' in cell ? cell.dataTestId : undefined;
|
|
23128
|
+
};
|
|
23126
23129
|
var Table = function (_a) {
|
|
23127
23130
|
var _b, _c, _d, _e, _f;
|
|
23128
23131
|
var cellReplacements = _a.cellReplacements, className = _a.className, collapsibleSections = _a.collapsibleSections, _g = _a.hideColumns, hideColumns = _g === void 0 ? [] : _g, hideDetails = _a.hideDetails, _h = _a.hideRows, hideRows = _h === void 0 ? [] : _h, imageComponent = _a.imageComponent, modalContentRenderer = _a.modalContentRenderer, onModalOpen = _a.onModalOpen, onSelectionChanged = _a.onSelectionChanged, scrollOnOpen = _a.scrollOnOpen, _j = _a.scrollTopOffset, scrollTopOffset = _j === void 0 ? 0 : _j, _k = _a.stickyHeaderTopOffset, stickyHeaderTopOffset = _k === void 0 ? 0 : _k, tableData = _a.tableData, definedTextOverrides = _a.textOverrides, title = _a.title, externalActiveSection = _a.activeSection, _l = _a.hideTableNavigation, hideTableNavigation = _l === void 0 ? false : _l, _m = _a.hideStickyHeader, hideStickyHeader = _m === void 0 ? false : _m, _o = _a.showSelectedColumn, showSelectedColumn = _o === void 0 ? false : _o, _p = _a.mobileNavigationMode, mobileNavigationMode = _p === void 0 ? 'arrows' : _p;
|
|
@@ -23147,6 +23150,7 @@ var Table = function (_a) {
|
|
|
23147
23150
|
var currentActiveSection = headerRow === null || headerRow === void 0 ? void 0 : headerRow[activeSection];
|
|
23148
23151
|
var mobileTabs = useTabs
|
|
23149
23152
|
? (_d = headerRow === null || headerRow === void 0 ? void 0 : headerRow.slice(1).map(function (cell, index) {
|
|
23153
|
+
var _a;
|
|
23150
23154
|
var label = '';
|
|
23151
23155
|
if (!cell.type)
|
|
23152
23156
|
label = String(cell.text || '');
|
|
@@ -23154,7 +23158,11 @@ var Table = function (_a) {
|
|
|
23154
23158
|
label = String(cell.title || '');
|
|
23155
23159
|
else if (cell.type === 'BUTTON')
|
|
23156
23160
|
label = String(cell.buttonCaption || '');
|
|
23157
|
-
|
|
23161
|
+
var replacement = cell.cellId
|
|
23162
|
+
? cellReplacements === null || cellReplacements === void 0 ? void 0 : cellReplacements[cell.cellId]
|
|
23163
|
+
: undefined;
|
|
23164
|
+
var dataTestId = (_a = getCellDataTestId(replacement)) !== null && _a !== void 0 ? _a : getCellDataTestId(cell);
|
|
23165
|
+
return { id: String(index), label: label, dataTestId: dataTestId };
|
|
23158
23166
|
})) !== null && _d !== void 0 ? _d : []
|
|
23159
23167
|
: [];
|
|
23160
23168
|
var currentActiveSectionReplacements = ((currentActiveSection === null || currentActiveSection === void 0 ? void 0 : currentActiveSection.cellId) &&
|