@popsure/dirty-swan 0.30.4 → 0.30.6
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 +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/comparisonTable/index.js +9 -7
- package/dist/esm/components/comparisonTable/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/comparisonTable/hooks/useComparisonTable.ts +6 -3
- package/src/lib/components/comparisonTable/index.tsx +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { b as __awaiter, c as __generator, _ as __assign } from '../../tslib.es6-5bc94358.js';
|
|
2
|
-
import { jsx, jsxs
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { c as classnames } from '../../index-e9e37a34.js';
|
|
4
|
+
import React__default, { useState, useRef, useCallback, useEffect, Fragment } from 'react';
|
|
4
5
|
import { c as commonjsGlobal } from '../../_commonjsHelpers-e7f67fd8.js';
|
|
5
|
-
import React__default, { useState, useRef, useCallback, useEffect } from 'react';
|
|
6
6
|
import ReactDOM from 'react-dom';
|
|
7
7
|
import Chevron from './components/Chevron.js';
|
|
8
8
|
import Row from './components/Row/index.js';
|
|
@@ -1482,9 +1482,11 @@ var useComparisonTable = function () {
|
|
|
1482
1482
|
if (!headerRef.current) {
|
|
1483
1483
|
return;
|
|
1484
1484
|
}
|
|
1485
|
-
var
|
|
1486
|
-
|
|
1487
|
-
|
|
1485
|
+
var headerWidth = headerRef.current.getBoundingClientRect().width;
|
|
1486
|
+
var currentTabIndex = Math.round(headerRef.current.scrollLeft / headerWidth);
|
|
1487
|
+
if (headerWidth < 544) {
|
|
1488
|
+
setSelectedTabIndex(currentTabIndex);
|
|
1489
|
+
}
|
|
1488
1490
|
};
|
|
1489
1491
|
var debouncedTableScroll = lodash_debounce(handleTableScroll, 150);
|
|
1490
1492
|
useEffect(function () {
|
|
@@ -1571,13 +1573,13 @@ var ComparisonTable = function (props) {
|
|
|
1571
1573
|
var idString = "headerGroup-" + headerGroup.id;
|
|
1572
1574
|
return (jsx(Fragment, { children: headerGroup.label && collapsibleSections ? (jsx(AccordionItem, __assign({ className: "mt8", label: headerGroup.label, headerClassName: "p24 br8", isOpen: selectedSection === idString, onOpen: function () { return setSelectedSection(idString); }, onClose: function () { return setSelectedSection(''); } }, { children: jsx(dist.exports.ScrollSyncPane, { children: jsx("div", __assign({ className: classnames(baseStyles.container, styles === null || styles === void 0 ? void 0 : styles.container, (_a = {},
|
|
1573
1575
|
_a[baseStyles.noScrollBars] = hideScrollBars,
|
|
1574
|
-
_a)) }, { children: jsx("div", __assign({ className: classnames(baseStyles['overflow-container']) }, { children: jsx("div", __assign({ className: baseStyles['group-container'] }, { children: content }), void 0) }), void 0) }), void 0) }, void 0) }),
|
|
1576
|
+
_a)) }, { children: jsx("div", __assign({ className: classnames(baseStyles['overflow-container']) }, { children: jsx("div", __assign({ className: baseStyles['group-container'] }, { children: content }), void 0) }), void 0) }), void 0) }, void 0) }), void 0)) : (jsx("div", { children: jsx(dist.exports.ScrollSyncPane, { children: jsx("div", __assign({ className: classnames(baseStyles.container, styles === null || styles === void 0 ? void 0 : styles.container, (_b = {},
|
|
1575
1577
|
_b[baseStyles.noScrollBars] = hideScrollBars,
|
|
1576
1578
|
_b)) }, { children: jsx("div", __assign({ className: classnames(baseStyles['overflow-container']) }, { children: jsxs("div", __assign({ className: baseStyles['group-container'] }, { children: [
|
|
1577
1579
|
/**
|
|
1578
1580
|
* Print a table subheader if the `label` value is present
|
|
1579
1581
|
*/
|
|
1580
|
-
headerGroup.label && !collapsibleSections && (jsx("div", __assign({ className: baseStyles['group-title'] }, { children: jsx("h4", __assign({ className: "p-h4 " + baseStyles.sticky }, { children: headerGroup.label }), void 0) }), void 0)), content] }), void 0) }), void 0) }), void 0) }, void 0) }, idString)) },
|
|
1582
|
+
headerGroup.label && !collapsibleSections && (jsx("div", __assign({ className: baseStyles['group-title'] }, { children: jsx("h4", __assign({ className: "p-h4 " + baseStyles.sticky }, { children: headerGroup.label }), void 0) }), void 0)), content] }), void 0) }), void 0) }), void 0) }, void 0) }, idString)) }, idString));
|
|
1581
1583
|
}),
|
|
1582
1584
|
hideDetails && (jsx("div", __assign({ className: classnames(baseStyles['show-details-container'], baseStyles.sticky, 'mt48') }, { children: jsx("div", { children: jsxs("button", __assign({ className: "w100 d-flex p-a p-h4 c-pointer " + baseStyles['show-details-button'], onClick: toggleMoreRows, type: "button" }, { children: [showMore ? 'Hide details' : 'Show details', jsx(Chevron, { className: showMore ? '' : baseStyles['icon-inverted'] }, void 0)] }), void 0) }, void 0) }), void 0))] }), void 0)] }), void 0) }, void 0));
|
|
1583
1585
|
};
|