@royaloperahouse/chord 2.4.3 → 2.4.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/CHANGELOG.md +3 -0
- package/dist/chord.cjs.development.js +104 -101
- package/dist/chord.cjs.development.js.map +1 -1
- package/dist/chord.cjs.production.min.js +1 -1
- package/dist/chord.cjs.production.min.js.map +1 -1
- package/dist/chord.esm.js +105 -102
- package/dist/chord.esm.js.map +1 -1
- package/dist/components/atoms/Icons/Icons.d.ts +1 -1
- package/dist/components/atoms/Icons/SvgIcons/Descriptors/Wheelchair.svg.d.ts +1 -1
- package/dist/components/atoms/Icons/SvgIcons/index.d.ts +1 -1
- package/dist/components/molecules/Select/Select.style.d.ts +1 -1
- package/dist/components/molecules/Table/Table.style.d.ts +2 -2
- package/dist/components/molecules/Table/components/TableCell.d.ts +3 -0
- package/dist/components/molecules/Table/components/TableHelpers.d.ts +4 -0
- package/dist/components/molecules/Table/components/TableRow.d.ts +3 -0
- package/dist/types/iconTypes.d.ts +5 -0
- package/dist/types/tableTypes.d.ts +5 -0
- package/package.json +2 -2
package/dist/chord.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { createElement, memo, useRef, useCallback, useEffect, useState, forwardRef, useMemo, cloneElement } from 'react';
|
|
1
|
+
import React__default, { createElement, memo, useRef, useCallback, useEffect, useState, forwardRef, useMemo, cloneElement, useLayoutEffect } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider, createGlobalStyle } from 'styled-components';
|
|
3
3
|
import moment from 'moment';
|
|
4
4
|
import { renderToString } from 'react-dom/server';
|
|
@@ -1544,13 +1544,15 @@ var Tickets = (function (_ref) {
|
|
|
1544
1544
|
|
|
1545
1545
|
var Wheelchair = (function (_ref) {
|
|
1546
1546
|
var _ref$color = _ref.color,
|
|
1547
|
-
color = _ref$color === void 0 ? '#1A1A1A' : _ref$color
|
|
1547
|
+
color = _ref$color === void 0 ? '#1A1A1A' : _ref$color,
|
|
1548
|
+
ariaLabel = _ref.ariaLabel;
|
|
1548
1549
|
return /*#__PURE__*/createElement("svg", {
|
|
1549
1550
|
width: "100%",
|
|
1550
1551
|
height: "100%",
|
|
1551
1552
|
viewBox: "0 0 24 24",
|
|
1552
1553
|
fill: "none",
|
|
1553
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1554
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1555
|
+
"aria-label": ariaLabel
|
|
1554
1556
|
}, /*#__PURE__*/createElement("path", {
|
|
1555
1557
|
d: "M8.4 18.8c-1.1 0-2.2-.4-3-1.1-.8-.8-1.3-1.8-1.3-2.9-.1-1.6.9-3.2 2.3-3.9l-.4-1c-1.9.9-3 2.8-3 4.9.1 2.8 2.4 5.1 5.3 5.1h.2c2.6-.1 4.7-2.1 5.1-4.6l-1.1-.1c-.3 2-2 3.6-4.1 3.6ZM9.8 4.5c1.2 0 2.2-1 2.2-2.2C12 1.1 11 .1 9.8.1c-1.2 0-2.2 1-2.2 2.2 0 1.2.9 2.2 2.2 2.2Zm0-3.3c.6 0 1.1.5 1.1 1.1 0 .6-.5 1.1-1.1 1.1-.6 0-1.1-.5-1.1-1.1 0-.6.5-1.1 1.1-1.1Zm4.9 12c-.3-.5-.9-.8-1.6-.8h-2.6V6.3c0-.6-.5-1.2-1.1-1.2H6.2c-.5.1-.9.5-.9 1v3.2h1.1V6.2l2.9.1v7.2h3.8c.3 0 .5.1.6.3l3.4 5.4.9-.6-3.3-5.4Z",
|
|
1556
1558
|
fill: color
|
|
@@ -2431,7 +2433,8 @@ var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
|
2431
2433
|
color = _ref.color,
|
|
2432
2434
|
iconName = _ref.iconName,
|
|
2433
2435
|
title = _ref.title,
|
|
2434
|
-
direction = _ref.direction
|
|
2436
|
+
direction = _ref.direction,
|
|
2437
|
+
ariaLabel = _ref.ariaLabel;
|
|
2435
2438
|
var IconComponent = IconLibrary[iconName];
|
|
2436
2439
|
return /*#__PURE__*/createElement(Wrapper, {
|
|
2437
2440
|
className: className,
|
|
@@ -2439,7 +2442,8 @@ var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
|
2439
2442
|
title: title,
|
|
2440
2443
|
direction: direction
|
|
2441
2444
|
}, /*#__PURE__*/createElement(IconComponent, {
|
|
2442
|
-
color: color
|
|
2445
|
+
color: color,
|
|
2446
|
+
ariaLabel: ariaLabel
|
|
2443
2447
|
}));
|
|
2444
2448
|
});
|
|
2445
2449
|
Icon.displayName = 'Icon';
|
|
@@ -10606,22 +10610,76 @@ var _templateObject$1i, _templateObject2$X, _templateObject3$O, _templateObject4
|
|
|
10606
10610
|
var TableContainer = /*#__PURE__*/styled.table(_templateObject$1i || (_templateObject$1i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-collapse: collapse;\n"])));
|
|
10607
10611
|
var Container$6 = /*#__PURE__*/styled.div(_templateObject2$X || (_templateObject2$X = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: auto;\n"])));
|
|
10608
10612
|
var Wrapper$7 = /*#__PURE__*/styled.div(_templateObject3$O || (_templateObject3$O = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n"])));
|
|
10609
|
-
var TableHeader = /*#__PURE__*/styled.th(_templateObject4$D || (_templateObject4$D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: var(--font-size-subtitle-2);\n font-family: var(--font-family-subtitle);\n font-feature-settings: var(--font-feature-settings-subtitle);\n font-weight: var(--font-weight-subtitle-2);\n letter-spacing: var(--letter-spacing-subtitle-2);\n line-height: var(--line-height-subtitle-2);\n padding: 30px 30px 30px 0;\n text-align: left;\n text-transform: uppercase;\n\n &:last-child {\n white-space: nowrap;\n width: auto;\n }\n\n &:not(:last-child) {\n width: ", ";\n }\n\n @media ", " {\n &:last-child {\n white-space: nowrap;\n }\n }\n\n @media ", " {\n padding: 20px 20px 20px 0;\n\n &:last-child {\n white-space: normal;\n }\n }\n"])), function (props) {
|
|
10613
|
+
var TableHeader = /*#__PURE__*/styled.th(_templateObject4$D || (_templateObject4$D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: var(--font-size-subtitle-2);\n font-family: var(--font-family-subtitle);\n font-feature-settings: var(--font-feature-settings-subtitle);\n font-weight: var(--font-weight-subtitle-2);\n letter-spacing: var(--letter-spacing-subtitle-2);\n line-height: var(--line-height-subtitle-2);\n padding: 30px 30px 30px 0;\n text-align: left;\n text-transform: uppercase;\n border-bottom: 1px solid;\n border-top: 1px solid;\n border-color: ", ";\n\n &:last-child {\n white-space: nowrap;\n width: auto;\n }\n\n &:not(:last-child) {\n width: ", ";\n }\n\n @media ", " {\n &:last-child {\n white-space: nowrap;\n }\n }\n\n @media ", " {\n padding: 20px 20px 20px 0;\n\n &:last-child {\n white-space: normal;\n }\n }\n"])), function (props) {
|
|
10614
|
+
return "var(--base-color-" + props.lineColor + ")";
|
|
10615
|
+
}, function (props) {
|
|
10610
10616
|
return "calc(100% / " + (props.columns - 1) + ")";
|
|
10611
10617
|
}, devices.tablet, devices.mobile);
|
|
10612
|
-
var TableCell = /*#__PURE__*/styled.td(_templateObject5$u || (_templateObject5$u = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: var(--font-size-body-1);\n font-family: var(--font-family-body);\n font-feature-settings: var(--font-feature-settings-body);\n font-weight: var(--font-weight-body-1);\n letter-spacing: var(--letter-spacing-body-1);\n line-height: var(--line-height-body-1);\n padding: 30px 30px 30px 0;\n text-align: left;\n vertical-align: top;\n\n &:last-child {\n width: auto;\n }\n\n &:not(:last-child) {\n width: ", ";\n }\n\n > span > svg {\n width: 24px;\n height: 24px;\n }\n\n @media ", " {\n padding: 20px 20px 20px 0;\n }\n"])), function (props) {
|
|
10618
|
+
var TableCell = /*#__PURE__*/styled.td(_templateObject5$u || (_templateObject5$u = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: var(--font-size-body-1);\n font-family: var(--font-family-body);\n font-feature-settings: var(--font-feature-settings-body);\n font-weight: var(--font-weight-body-1);\n letter-spacing: var(--letter-spacing-body-1);\n line-height: var(--line-height-body-1);\n padding: 30px 30px 30px 0;\n text-align: left;\n vertical-align: top;\n border-bottom: 1px solid;\n border-color: ", ";\n\n &:last-child {\n width: auto;\n }\n\n &:not(:last-child) {\n width: ", ";\n }\n\n > span > svg {\n width: 24px;\n height: 24px;\n }\n\n @media ", " {\n padding: 20px 20px 20px 0;\n }\n"])), function (props) {
|
|
10619
|
+
return "var(--base-color-" + props.lineColor + ")";
|
|
10620
|
+
}, function (props) {
|
|
10613
10621
|
return "calc(100% / " + (props.columns - 1) + ")";
|
|
10614
10622
|
}, devices.mobile);
|
|
10615
|
-
var
|
|
10616
|
-
|
|
10617
|
-
});
|
|
10618
|
-
var Pagination$1 = /*#__PURE__*/styled.div(_templateObject7$f || (_templateObject7$f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 40px 0;\n flex-wrap: nowrap;\n flex-direction: row;\n list-style: none;\n max-width: fit-content;\n margin: auto;\n li {\n font-size: var(--font-size-subtitle-1);\n font-weight: var(--font-weight-body-1);\n line-height: var(--line-height-subtitle-1);\n letter-spacing: var(--letter-spacing-subtitle-1);\n margin-left: 16px;\n color: var(--base-color-dark-grey);\n display: flex;\n align-items: center;\n border-bottom: none;\n }\n"])));
|
|
10619
|
-
var PageNumber$1 = /*#__PURE__*/styled.button(_templateObject8$c || (_templateObject8$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background: none;\n border: none;\n padding: 0;\n font-size: inherit;\n color: inherit;\n cursor: pointer;\n display: inline-block;\n margin: 0;\n border-bottom: 1px solid var(--base-color-transparent);\n line-height: var(--base-line-height);\n text-decoration: none;\n font-family: var(--font-family-body-1);\n\n :hover {\n outline: none;\n color: var(--base-color-core);\n border-bottom: 1px solid var(--base-color-core);\n svg > path {\n fill: var(--base-color-core);\n }\n }\n\n /* Active state */\n ", "\n"])), function (_ref) {
|
|
10623
|
+
var Pagination$1 = /*#__PURE__*/styled.div(_templateObject6$n || (_templateObject6$n = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 40px 0;\n flex-wrap: nowrap;\n flex-direction: row;\n list-style: none;\n max-width: fit-content;\n margin: auto;\n li {\n font-size: var(--font-size-subtitle-1);\n font-weight: var(--font-weight-body-1);\n line-height: var(--line-height-subtitle-1);\n letter-spacing: var(--letter-spacing-subtitle-1);\n margin-left: 16px;\n color: var(--base-color-dark-grey);\n display: flex;\n align-items: center;\n border-bottom: none;\n }\n"])));
|
|
10624
|
+
var PageNumber$1 = /*#__PURE__*/styled.button(_templateObject7$f || (_templateObject7$f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background: none;\n border: none;\n padding: 0;\n font-size: inherit;\n color: inherit;\n cursor: pointer;\n display: inline-block;\n margin: 0;\n border-bottom: 1px solid var(--base-color-transparent);\n line-height: var(--base-line-height);\n text-decoration: none;\n font-family: var(--font-family-body-1);\n\n :hover {\n outline: none;\n color: var(--base-color-core);\n border-bottom: 1px solid var(--base-color-core);\n svg > path {\n fill: var(--base-color-core);\n }\n }\n\n /* Active state */\n ", "\n"])), function (_ref) {
|
|
10620
10625
|
var active = _ref.active;
|
|
10621
10626
|
return active === 'true' && "\n color: var(--base-color-core);\n border-bottom: 1px solid var(--base-color-core);\n ";
|
|
10622
10627
|
});
|
|
10623
|
-
var Next = /*#__PURE__*/styled.span(
|
|
10624
|
-
var ScrollButtons = /*#__PURE__*/styled.div(
|
|
10628
|
+
var Next = /*#__PURE__*/styled.span(_templateObject8$c || (_templateObject8$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: inline-flex;\n width: 25px;\n align-items: center;\n justify-content: center;\n margin-left: 0;\n span {\n height: 1.5em;\n svg > path {\n fill: var(--base-color-dark-grey);\n }\n }\n"])));
|
|
10629
|
+
var ScrollButtons = /*#__PURE__*/styled.div(_templateObject9$7 || (_templateObject9$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: flex-end;\n padding: 0 0 24px 0;\n\n div:hover {\n background-color: var(--base-color-light-grey);\n }\n\n > div > div {\n background-color: var(--base-color-light-grey);\n }\n\n svg path {\n fill: var(--base-color-black) !important;\n }\n"])));
|
|
10630
|
+
var AriaDescription = /*#__PURE__*/styled.span(_templateObject10$7 || (_templateObject10$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n left: -9999px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n"])));
|
|
10631
|
+
|
|
10632
|
+
var Content = function Content(_ref) {
|
|
10633
|
+
var content = _ref.content;
|
|
10634
|
+
return typeof content === 'string' ? /*#__PURE__*/React__default.createElement("div", {
|
|
10635
|
+
dangerouslySetInnerHTML: {
|
|
10636
|
+
__html: content
|
|
10637
|
+
}
|
|
10638
|
+
}) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, content);
|
|
10639
|
+
};
|
|
10640
|
+
var scrollTable = function scrollTable(tableRef, direction) {
|
|
10641
|
+
if (tableRef.current) {
|
|
10642
|
+
var currentScroll = tableRef.current.scrollLeft;
|
|
10643
|
+
var scrollAmount = direction === 'left' ? -300 : 300;
|
|
10644
|
+
tableRef.current.scrollTo({
|
|
10645
|
+
left: currentScroll + scrollAmount,
|
|
10646
|
+
behavior: 'smooth'
|
|
10647
|
+
});
|
|
10648
|
+
}
|
|
10649
|
+
};
|
|
10650
|
+
|
|
10651
|
+
var Cell = function Cell(_ref) {
|
|
10652
|
+
var cell = _ref.cell,
|
|
10653
|
+
cellIndex = _ref.cellIndex,
|
|
10654
|
+
columns = _ref.columns,
|
|
10655
|
+
lineColor = _ref.lineColor;
|
|
10656
|
+
return /*#__PURE__*/React__default.createElement(TableCell, {
|
|
10657
|
+
key: cellIndex,
|
|
10658
|
+
columns: columns,
|
|
10659
|
+
role: "gridcell",
|
|
10660
|
+
lineColor: lineColor
|
|
10661
|
+
}, /*#__PURE__*/React__default.createElement(Content, {
|
|
10662
|
+
content: cell
|
|
10663
|
+
}));
|
|
10664
|
+
};
|
|
10665
|
+
|
|
10666
|
+
var Row = function Row(_ref) {
|
|
10667
|
+
var row = _ref.row,
|
|
10668
|
+
rowIndex = _ref.rowIndex,
|
|
10669
|
+
columns = _ref.columns,
|
|
10670
|
+
lineColor = _ref.lineColor;
|
|
10671
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
10672
|
+
key: rowIndex
|
|
10673
|
+
}, /*#__PURE__*/React__default.createElement("tr", null, row.map(function (cell, index) {
|
|
10674
|
+
return /*#__PURE__*/React__default.createElement(Cell, {
|
|
10675
|
+
key: index,
|
|
10676
|
+
cell: cell,
|
|
10677
|
+
cellIndex: index,
|
|
10678
|
+
columns: columns,
|
|
10679
|
+
lineColor: lineColor
|
|
10680
|
+
});
|
|
10681
|
+
})));
|
|
10682
|
+
};
|
|
10625
10683
|
|
|
10626
10684
|
var Table = function Table(_ref) {
|
|
10627
10685
|
var columns = _ref.columns,
|
|
@@ -10629,7 +10687,8 @@ var Table = function Table(_ref) {
|
|
|
10629
10687
|
children = _ref.children,
|
|
10630
10688
|
lineColors = _ref.lineColors,
|
|
10631
10689
|
rowsPerPage = _ref.rowsPerPage,
|
|
10632
|
-
pagination = _ref.pagination
|
|
10690
|
+
pagination = _ref.pagination,
|
|
10691
|
+
description = _ref.description;
|
|
10633
10692
|
|
|
10634
10693
|
var _useState = useState(0),
|
|
10635
10694
|
currentPage = _useState[0],
|
|
@@ -10639,121 +10698,63 @@ var Table = function Table(_ref) {
|
|
|
10639
10698
|
showScrollButtons = _useState2[0],
|
|
10640
10699
|
setShowScrollButtons = _useState2[1];
|
|
10641
10700
|
|
|
10642
|
-
var Content = function Content(_ref2) {
|
|
10643
|
-
var content = _ref2.content;
|
|
10644
|
-
return typeof content === 'string' ? /*#__PURE__*/React__default.createElement("div", {
|
|
10645
|
-
dangerouslySetInnerHTML: {
|
|
10646
|
-
__html: content
|
|
10647
|
-
}
|
|
10648
|
-
}) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, content);
|
|
10649
|
-
};
|
|
10650
|
-
|
|
10651
|
-
var Cell = function Cell(_ref3) {
|
|
10652
|
-
var cell = _ref3.cell,
|
|
10653
|
-
cellIndex = _ref3.cellIndex,
|
|
10654
|
-
columns = _ref3.columns;
|
|
10655
|
-
return /*#__PURE__*/React__default.createElement(TableCell, {
|
|
10656
|
-
key: cellIndex,
|
|
10657
|
-
columns: columns
|
|
10658
|
-
}, /*#__PURE__*/React__default.createElement(Content, {
|
|
10659
|
-
content: cell
|
|
10660
|
-
}));
|
|
10661
|
-
};
|
|
10662
|
-
|
|
10663
|
-
var Row = function Row(_ref4) {
|
|
10664
|
-
var row = _ref4.row,
|
|
10665
|
-
rowIndex = _ref4.rowIndex,
|
|
10666
|
-
columns = _ref4.columns,
|
|
10667
|
-
lineColor = _ref4.lineColor;
|
|
10668
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
10669
|
-
key: rowIndex
|
|
10670
|
-
}, /*#__PURE__*/React__default.createElement("tr", null, row.map(function (cell, index) {
|
|
10671
|
-
return /*#__PURE__*/React__default.createElement(Cell, {
|
|
10672
|
-
key: index,
|
|
10673
|
-
cell: cell,
|
|
10674
|
-
cellIndex: index,
|
|
10675
|
-
columns: columns
|
|
10676
|
-
});
|
|
10677
|
-
})), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
10678
|
-
colSpan: columns
|
|
10679
|
-
}, /*#__PURE__*/React__default.createElement(LineContainer$1, {
|
|
10680
|
-
lineColor: lineColor,
|
|
10681
|
-
role: "presentation"
|
|
10682
|
-
}))));
|
|
10683
|
-
};
|
|
10684
|
-
|
|
10685
10701
|
var lineColor = lineColors != null ? lineColors : Colors.Cinema;
|
|
10686
10702
|
var tableRef = useRef(null);
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
tableRef.current
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
var horizontalScroll = function horizontalScroll() {
|
|
10694
|
-
if (tableRef.current) {
|
|
10695
|
-
setShowScrollButtons(tableRef.current.scrollWidth > tableRef.current.clientWidth);
|
|
10696
|
-
}
|
|
10697
|
-
};
|
|
10703
|
+
useLayoutEffect(function () {
|
|
10704
|
+
var horizontalScroll = function horizontalScroll() {
|
|
10705
|
+
if (tableRef.current) {
|
|
10706
|
+
setShowScrollButtons(tableRef.current.scrollWidth > tableRef.current.clientWidth);
|
|
10707
|
+
}
|
|
10708
|
+
};
|
|
10698
10709
|
|
|
10699
|
-
useEffect(function () {
|
|
10700
10710
|
horizontalScroll();
|
|
10701
10711
|
window.addEventListener('resize', horizontalScroll);
|
|
10702
10712
|
return function () {
|
|
10703
10713
|
return window.removeEventListener('resize', horizontalScroll);
|
|
10704
10714
|
};
|
|
10705
10715
|
}, []);
|
|
10706
|
-
|
|
10707
|
-
var scrollTable = function scrollTable(direction) {
|
|
10708
|
-
if (tableRef.current) {
|
|
10709
|
-
var currentScroll = tableRef.current.scrollLeft;
|
|
10710
|
-
var scrollAmount = direction === 'left' ? -300 : 300;
|
|
10711
|
-
tableRef.current.scrollTo({
|
|
10712
|
-
left: currentScroll + scrollAmount,
|
|
10713
|
-
behavior: 'smooth'
|
|
10714
|
-
});
|
|
10715
|
-
}
|
|
10716
|
-
};
|
|
10717
|
-
|
|
10718
|
-
var totalRows = Array.isArray(children) ? children.length : 0;
|
|
10716
|
+
var totalRows = Array.isArray(children) ? children.length + 1 : 1;
|
|
10719
10717
|
var totalPages = pagination ? Math.ceil(totalRows / rowsPerPage) : 1;
|
|
10720
|
-
var currentRows = pagination ? Array.isArray(children) ? children.slice(currentPage * rowsPerPage, (currentPage + 1) * rowsPerPage) : [] : children;
|
|
10721
10718
|
var pageNumbers = Array.from({
|
|
10722
10719
|
length: totalPages
|
|
10723
10720
|
}, function (_, i) {
|
|
10724
10721
|
return i;
|
|
10725
10722
|
});
|
|
10726
10723
|
var reducedPageNumbers = reducePages(pageNumbers, currentPage);
|
|
10724
|
+
var currentRows = pagination ? Array.isArray(children) ? children.slice(currentPage * rowsPerPage, (currentPage + 1) * rowsPerPage) : [] : children;
|
|
10725
|
+
var visibleRows = pagination ? Array.isArray(currentRows) ? currentRows.length + 1 : 0 : totalRows;
|
|
10727
10726
|
return /*#__PURE__*/React__default.createElement(Wrapper$7, null, showScrollButtons && /*#__PURE__*/React__default.createElement(ScrollButtons, null, /*#__PURE__*/React__default.createElement(RotatorButtons, {
|
|
10728
10727
|
onClickPrev: function onClickPrev() {
|
|
10729
|
-
return scrollTable('left');
|
|
10728
|
+
return scrollTable(tableRef, 'left');
|
|
10730
10729
|
},
|
|
10731
10730
|
onClickNext: function onClickNext() {
|
|
10732
|
-
return scrollTable('right');
|
|
10731
|
+
return scrollTable(tableRef, 'right');
|
|
10733
10732
|
}
|
|
10734
10733
|
})), /*#__PURE__*/React__default.createElement(Container$6, {
|
|
10735
10734
|
role: "table",
|
|
10736
10735
|
tabIndex: 0,
|
|
10737
|
-
ref: tableRef
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10736
|
+
ref: tableRef,
|
|
10737
|
+
"aria-rowcount": totalRows,
|
|
10738
|
+
"aria-colcount": columns
|
|
10739
|
+
}, /*#__PURE__*/React__default.createElement(AriaDescription, {
|
|
10740
|
+
id: "table-description"
|
|
10741
|
+
}, description, " visible rows: ", visibleRows), /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement("thead", {
|
|
10742
|
+
role: "rowgroup"
|
|
10743
|
+
}, ' ', /*#__PURE__*/React__default.createElement("tr", {
|
|
10744
|
+
role: "columnheader"
|
|
10745
|
+
}, headings && headings.map(function (heading, index) {
|
|
10744
10746
|
return /*#__PURE__*/React__default.createElement(TableHeader, {
|
|
10745
10747
|
key: index,
|
|
10746
10748
|
role: "columnheader",
|
|
10747
|
-
|
|
10749
|
+
scope: "col",
|
|
10750
|
+
columns: columns,
|
|
10751
|
+
lineColor: lineColor
|
|
10748
10752
|
}, /*#__PURE__*/React__default.createElement(Content, {
|
|
10749
10753
|
content: heading
|
|
10750
10754
|
}));
|
|
10751
|
-
}))), /*#__PURE__*/React__default.createElement("
|
|
10752
|
-
|
|
10753
|
-
},
|
|
10754
|
-
lineColor: lineColor,
|
|
10755
|
-
role: "presentation"
|
|
10756
|
-
}))), /*#__PURE__*/React__default.createElement("tbody", null, Array.isArray(currentRows) && currentRows.map(function (row, rowIndex) {
|
|
10755
|
+
}))), /*#__PURE__*/React__default.createElement("tbody", {
|
|
10756
|
+
role: "rowgroup"
|
|
10757
|
+
}, ' ', Array.isArray(currentRows) && currentRows.map(function (row, rowIndex) {
|
|
10757
10758
|
return /*#__PURE__*/React__default.createElement(Row, {
|
|
10758
10759
|
key: rowIndex,
|
|
10759
10760
|
row: row,
|
|
@@ -10761,7 +10762,9 @@ var Table = function Table(_ref) {
|
|
|
10761
10762
|
columns: columns,
|
|
10762
10763
|
lineColor: lineColor
|
|
10763
10764
|
});
|
|
10764
|
-
}))), pagination && totalPages > 1 && /*#__PURE__*/React__default.createElement(
|
|
10765
|
+
}))), pagination && totalPages > 1 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(AriaDescription, {
|
|
10766
|
+
id: "pagination-description"
|
|
10767
|
+
}, "Table pagination: current page ", currentPage + 1, " of ", totalPages), /*#__PURE__*/React__default.createElement(Pagination$1, null, currentPage > 0 && /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement(PageNumber$1, {
|
|
10765
10768
|
key: "previous-page",
|
|
10766
10769
|
onClick: function onClick() {
|
|
10767
10770
|
return setCurrentPage(currentPage - 1);
|
|
@@ -10796,7 +10799,7 @@ var Table = function Table(_ref) {
|
|
|
10796
10799
|
}, /*#__PURE__*/React__default.createElement(Next, null, /*#__PURE__*/React__default.createElement(Icon, {
|
|
10797
10800
|
iconName: "DropdownArrow",
|
|
10798
10801
|
direction: "up"
|
|
10799
|
-
})))))));
|
|
10802
|
+
}))))))));
|
|
10800
10803
|
};
|
|
10801
10804
|
|
|
10802
10805
|
var UpsellSection = function UpsellSection(_ref) {
|