@carto/meridian-ds 2.5.5 → 2.6.0
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 +7 -0
- package/dist/{Alert-lLA0z7fX.js → Alert-DHd9hCGz.js} +20 -77
- package/dist/{Alert-BdmDjcVc.cjs → Alert-DOeOwxOe.cjs} +22 -79
- package/dist/{MenuItem-nokUtiks.cjs → MenuItem-CYJN2OVU.cjs} +6 -6
- package/dist/{MenuItem-ZNdBUBvt.js → MenuItem-MUmADf3e.js} +1 -1
- package/dist/components/index.cjs +309 -112
- package/dist/components/index.js +249 -52
- package/dist/{TablePaginationActions-DAMGtIub.cjs → css-utils-CCi3p7os.cjs} +123 -55
- package/dist/{TablePaginationActions-C6TVGJM-.js → css-utils-WejOmkiI.js} +126 -58
- package/dist/theme/index.cjs +108 -114
- package/dist/theme/index.js +7 -13
- package/dist/types/components/AccordionGroup/AccordionGroup.d.ts +4 -1
- package/dist/types/components/AccordionGroup/AccordionGroup.d.ts.map +1 -1
- package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts +39 -9
- package/dist/types/components/AccordionGroup/AccordionGroup.stories.d.ts.map +1 -1
- package/dist/types/components/AccordionGroup/AccordionGroup.test.d.ts +2 -0
- package/dist/types/components/AccordionGroup/AccordionGroup.test.d.ts.map +1 -0
- package/dist/types/components/AppBar/AppBar.d.ts +3 -1
- package/dist/types/components/AppBar/AppBar.d.ts.map +1 -1
- package/dist/types/components/AppBar/AppBar.stories.d.ts +2 -2
- package/dist/types/components/AppBar/AppBar.stories.d.ts.map +1 -1
- package/dist/types/components/AppBar/AppBar.test.d.ts +2 -0
- package/dist/types/components/AppBar/AppBar.test.d.ts.map +1 -0
- package/dist/types/components/Avatar/Avatar.d.ts +4 -1
- package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/components/Avatar/Avatar.stories.d.ts +1 -2
- package/dist/types/components/Avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/types/components/Avatar/Avatar.test.d.ts +2 -0
- package/dist/types/components/Avatar/Avatar.test.d.ts.map +1 -0
- package/dist/types/components/Button/Button.d.ts +5 -0
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Button/Button.stories.d.ts +3 -0
- package/dist/types/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts +117 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts.map +1 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts +66 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts.map +1 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts +2 -0
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts.map +1 -0
- package/dist/types/components/EllipsisWithTooltip/index.d.ts +3 -0
- package/dist/types/components/EllipsisWithTooltip/index.d.ts.map +1 -0
- package/dist/types/components/Link/Link.d.ts +5 -0
- package/dist/types/components/Link/Link.d.ts.map +1 -1
- package/dist/types/components/Link/Link.stories.d.ts +9 -27
- package/dist/types/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +5 -2
- package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
- package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts +72 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.stories.d.ts.map +1 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.test.d.ts +2 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.test.d.ts.map +1 -0
- package/dist/types/components/Tag/Tag.d.ts +176 -4
- package/dist/types/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +3 -2
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts +2 -2
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts.map +1 -1
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.test.d.ts +2 -0
- package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.test.d.ts.map +1 -0
- package/dist/types/components/TooltipData/TooltipData.d.ts.map +1 -1
- package/dist/types/components/TooltipData/TooltipData.stories.d.ts +34 -0
- package/dist/types/components/TooltipData/TooltipData.stories.d.ts.map +1 -0
- package/dist/types/components/TooltipData/TooltipData.test.d.ts +2 -0
- package/dist/types/components/TooltipData/TooltipData.test.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/theme/components/forms.d.ts.map +1 -1
- package/dist/types/theme/components/stories/Tooltip.stories.d.ts +0 -3
- package/dist/types/theme/components/stories/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/utils/css-utils.d.ts +14 -0
- package/dist/types/utils/css-utils.d.ts.map +1 -0
- package/dist/types/utils/useTranslationFallback.d.ts +20 -0
- package/dist/types/utils/useTranslationFallback.d.ts.map +1 -0
- package/dist/types/utils/useTranslationFallback.test.d.ts +2 -0
- package/dist/types/utils/useTranslationFallback.test.d.ts.map +1 -0
- package/dist/types/widgets/TableWidgetUI/TableWidgetUI.d.ts.map +1 -1
- package/dist/types/widgets/WrapperWidgetUI/WrapperWidgetUI.d.ts.map +1 -1
- package/dist/widgets/index.cjs +114 -119
- package/dist/widgets/index.js +4 -9
- package/package.json +1 -1
|
@@ -782,6 +782,31 @@ const MENU_LIST_MAX_SIZE = 312;
|
|
|
782
782
|
const MENU_ITEM_SIZE_DENSE = 24;
|
|
783
783
|
const MENU_ITEM_SIZE_DEFAULT = 32;
|
|
784
784
|
const MENU_ITEM_SIZE_EXTENDED = 48;
|
|
785
|
+
const FontWeight = {
|
|
786
|
+
regular: 400,
|
|
787
|
+
medium: 500,
|
|
788
|
+
strong: 600
|
|
789
|
+
};
|
|
790
|
+
function _Typography({ italic, weight, style, children, ...otherProps }, ref) {
|
|
791
|
+
const fontConfiguration = {
|
|
792
|
+
fontWeight: FontWeight[weight],
|
|
793
|
+
fontStyle: italic ? "italic" : void 0
|
|
794
|
+
};
|
|
795
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
796
|
+
material.Typography,
|
|
797
|
+
{
|
|
798
|
+
...otherProps,
|
|
799
|
+
ref,
|
|
800
|
+
style: {
|
|
801
|
+
...fontConfiguration,
|
|
802
|
+
...style
|
|
803
|
+
},
|
|
804
|
+
"data-name": "typography",
|
|
805
|
+
children
|
|
806
|
+
}
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
const Typography = React.forwardRef(_Typography);
|
|
785
810
|
const en = {
|
|
786
811
|
c4r: {
|
|
787
812
|
button: {
|
|
@@ -796,7 +821,7 @@ const en = {
|
|
|
796
821
|
showOptions: "Show options",
|
|
797
822
|
hide: "Hide",
|
|
798
823
|
show: "Show",
|
|
799
|
-
opensInNewTab: "Opens in new tab"
|
|
824
|
+
opensInNewTab: "(Opens in new tab)"
|
|
800
825
|
},
|
|
801
826
|
form: {
|
|
802
827
|
selectAll: "Select all",
|
|
@@ -945,7 +970,7 @@ const es = {
|
|
|
945
970
|
showOptions: "Mostrar opciones",
|
|
946
971
|
hide: "Ocultar",
|
|
947
972
|
show: "Mostrar",
|
|
948
|
-
opensInNewTab: "Abre en una nueva pestaña"
|
|
973
|
+
opensInNewTab: "(Abre en una nueva pestaña)"
|
|
949
974
|
},
|
|
950
975
|
form: {
|
|
951
976
|
selectAll: "Seleccionar todos",
|
|
@@ -1092,7 +1117,7 @@ const id = {
|
|
|
1092
1117
|
showOptions: "Tampilkan opsi",
|
|
1093
1118
|
hide: "Sembunyikan",
|
|
1094
1119
|
show: "Tampilkan",
|
|
1095
|
-
opensInNewTab: "Buka di tab baru"
|
|
1120
|
+
opensInNewTab: "(Buka di tab baru)"
|
|
1096
1121
|
},
|
|
1097
1122
|
form: {
|
|
1098
1123
|
selectAll: "Select all",
|
|
@@ -5566,48 +5591,78 @@ const getGloballyCachedIntl = (intlConfig) => {
|
|
|
5566
5591
|
function useImperativeIntl(intlConfig) {
|
|
5567
5592
|
return getGloballyCachedIntl(intlConfig);
|
|
5568
5593
|
}
|
|
5569
|
-
const
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5594
|
+
const Option = material.styled("div")(({ theme }) => ({
|
|
5595
|
+
position: "relative",
|
|
5596
|
+
display: "inline-flex",
|
|
5597
|
+
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
5598
|
+
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
5599
|
+
"& + &, & + .optionIconButton": {
|
|
5600
|
+
marginLeft: theme.spacing(0.5)
|
|
5601
|
+
}
|
|
5602
|
+
}));
|
|
5603
|
+
const StyledIconButton = material.styled(material.IconButton, {
|
|
5604
|
+
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
5605
|
+
})(({ active, theme }) => ({
|
|
5606
|
+
...active && {
|
|
5607
|
+
color: theme.palette.primary.main,
|
|
5608
|
+
backgroundColor: theme.palette.primary.background,
|
|
5609
|
+
"& svg:not(.doNotFillIcon) path": {
|
|
5610
|
+
fill: theme.palette.primary.main
|
|
5611
|
+
}
|
|
5612
|
+
}
|
|
5613
|
+
}));
|
|
5614
|
+
function _IconButton({
|
|
5615
|
+
tooltip,
|
|
5616
|
+
tooltipPlacement = "top",
|
|
5617
|
+
icon,
|
|
5618
|
+
size = "medium",
|
|
5619
|
+
variant = "icon",
|
|
5620
|
+
color = "default",
|
|
5621
|
+
sx,
|
|
5622
|
+
className,
|
|
5623
|
+
loading,
|
|
5624
|
+
disabled,
|
|
5625
|
+
active,
|
|
5626
|
+
...props
|
|
5627
|
+
}, ref) {
|
|
5628
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5629
|
+
Option,
|
|
5581
5630
|
{
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5631
|
+
className: `optionIconButton ${className ?? ""}`,
|
|
5632
|
+
sx,
|
|
5633
|
+
"data-testid": "icon-button",
|
|
5634
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5635
|
+
StyledIconButton,
|
|
5636
|
+
{
|
|
5637
|
+
...props,
|
|
5638
|
+
ref,
|
|
5639
|
+
size,
|
|
5640
|
+
variant,
|
|
5641
|
+
color,
|
|
5642
|
+
active,
|
|
5643
|
+
disabled: disabled || loading,
|
|
5644
|
+
role: "button",
|
|
5645
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
5646
|
+
}
|
|
5647
|
+
)
|
|
5590
5648
|
}
|
|
5591
|
-
);
|
|
5649
|
+
) });
|
|
5592
5650
|
}
|
|
5593
|
-
const
|
|
5651
|
+
const IconButton = React.forwardRef(_IconButton);
|
|
5594
5652
|
const Root = material.styled(material.Box)(({ theme }) => ({
|
|
5595
5653
|
display: "flex",
|
|
5596
5654
|
gap: theme.spacing(0.5),
|
|
5597
5655
|
marginLeft: theme.spacing(1)
|
|
5598
5656
|
}));
|
|
5599
|
-
|
|
5600
|
-
"& .MuiIconButton-root:not(.Mui-disabled)": {
|
|
5601
|
-
color: theme.palette.text.secondary
|
|
5602
|
-
}
|
|
5603
|
-
}));
|
|
5604
|
-
function TablePaginationActions({
|
|
5657
|
+
function _TablePaginationActions({
|
|
5605
5658
|
count,
|
|
5606
5659
|
page,
|
|
5607
5660
|
rowsPerPage = 10,
|
|
5608
5661
|
onPageChange,
|
|
5609
|
-
lastPageTooltip
|
|
5610
|
-
|
|
5662
|
+
lastPageTooltip,
|
|
5663
|
+
"aria-label": ariaLabel,
|
|
5664
|
+
"data-testid": dataTestId
|
|
5665
|
+
}, ref) {
|
|
5611
5666
|
const intl = reactIntl.useIntl();
|
|
5612
5667
|
const intlConfig = useImperativeIntl(intl);
|
|
5613
5668
|
const handleBackButtonClick = (event) => {
|
|
@@ -5627,38 +5682,50 @@ function TablePaginationActions({
|
|
|
5627
5682
|
const noMorePagesText = intlConfig.formatMessage({
|
|
5628
5683
|
id: "c4r.form.pagination.noMorePages"
|
|
5629
5684
|
});
|
|
5630
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5685
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5686
|
+
Root,
|
|
5687
|
+
{
|
|
5688
|
+
ref,
|
|
5689
|
+
"data-testid": dataTestId,
|
|
5690
|
+
"aria-label": ariaLabel,
|
|
5691
|
+
"data-name": "table-pagination-actions",
|
|
5692
|
+
children: [
|
|
5693
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5694
|
+
IconButton,
|
|
5695
|
+
{
|
|
5696
|
+
onClick: handleBackButtonClick,
|
|
5697
|
+
disabled: page === 0,
|
|
5698
|
+
"aria-label": prevLabel,
|
|
5699
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.KeyboardArrowLeftOutlined, {}),
|
|
5700
|
+
tooltip: isFirstPage ? noMorePagesText : prevLabel
|
|
5701
|
+
}
|
|
5702
|
+
),
|
|
5703
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5704
|
+
IconButton,
|
|
5646
5705
|
{
|
|
5647
5706
|
onClick: handleNextButtonClick,
|
|
5648
5707
|
disabled: page >= Math.ceil(count / rowsPerPage) - 1,
|
|
5649
|
-
"aria-label": nextLabel
|
|
5650
|
-
|
|
5708
|
+
"aria-label": nextLabel,
|
|
5709
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.KeyboardArrowRightOutlined, {}),
|
|
5710
|
+
tooltip: isLastPage ? lastPageTooltip ?? noMorePagesText : nextLabel
|
|
5651
5711
|
}
|
|
5652
|
-
)
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5712
|
+
)
|
|
5713
|
+
]
|
|
5714
|
+
}
|
|
5715
|
+
);
|
|
5656
5716
|
}
|
|
5717
|
+
const TablePaginationActions = React.forwardRef(_TablePaginationActions);
|
|
5718
|
+
const ellipsisStyles = {
|
|
5719
|
+
textOverflow: "ellipsis",
|
|
5720
|
+
overflow: "hidden",
|
|
5721
|
+
whiteSpace: "nowrap"
|
|
5722
|
+
};
|
|
5657
5723
|
exports.APPBAR_SIZE = APPBAR_SIZE;
|
|
5658
5724
|
exports.BREAKPOINTS = BREAKPOINTS;
|
|
5659
5725
|
exports.ICON_SIZE_LARGE = ICON_SIZE_LARGE;
|
|
5660
5726
|
exports.ICON_SIZE_MEDIUM = ICON_SIZE_MEDIUM;
|
|
5661
5727
|
exports.ICON_SIZE_SMALL = ICON_SIZE_SMALL;
|
|
5728
|
+
exports.IconButton = IconButton;
|
|
5662
5729
|
exports.MENU_ITEM_SIZE_DEFAULT = MENU_ITEM_SIZE_DEFAULT;
|
|
5663
5730
|
exports.MENU_ITEM_SIZE_DENSE = MENU_ITEM_SIZE_DENSE;
|
|
5664
5731
|
exports.MENU_ITEM_SIZE_EXTENDED = MENU_ITEM_SIZE_EXTENDED;
|
|
@@ -5667,6 +5734,7 @@ exports.NOTIFICATION_DURATION_IN_MS = NOTIFICATION_DURATION_IN_MS;
|
|
|
5667
5734
|
exports.SPACING = SPACING;
|
|
5668
5735
|
exports.TablePaginationActions = TablePaginationActions;
|
|
5669
5736
|
exports.Typography = Typography;
|
|
5737
|
+
exports.ellipsisStyles = ellipsisStyles;
|
|
5670
5738
|
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
5671
5739
|
exports.getSpacing = getSpacing;
|
|
5672
5740
|
exports.useImperativeIntl = useImperativeIntl;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import require$$0 from "react-is";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Typography as Typography$1,
|
|
3
|
+
import { Typography as Typography$1, styled, IconButton as IconButton$1, Tooltip, CircularProgress, Box } from "@mui/material";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { KeyboardArrowLeftOutlined, KeyboardArrowRightOutlined } from "@mui/icons-material";
|
|
6
6
|
import { createIntlCache, createIntl, useIntl } from "react-intl";
|
|
@@ -781,6 +781,31 @@ const MENU_LIST_MAX_SIZE = 312;
|
|
|
781
781
|
const MENU_ITEM_SIZE_DENSE = 24;
|
|
782
782
|
const MENU_ITEM_SIZE_DEFAULT = 32;
|
|
783
783
|
const MENU_ITEM_SIZE_EXTENDED = 48;
|
|
784
|
+
const FontWeight = {
|
|
785
|
+
regular: 400,
|
|
786
|
+
medium: 500,
|
|
787
|
+
strong: 600
|
|
788
|
+
};
|
|
789
|
+
function _Typography({ italic, weight, style, children, ...otherProps }, ref) {
|
|
790
|
+
const fontConfiguration = {
|
|
791
|
+
fontWeight: FontWeight[weight],
|
|
792
|
+
fontStyle: italic ? "italic" : void 0
|
|
793
|
+
};
|
|
794
|
+
return /* @__PURE__ */ jsx(
|
|
795
|
+
Typography$1,
|
|
796
|
+
{
|
|
797
|
+
...otherProps,
|
|
798
|
+
ref,
|
|
799
|
+
style: {
|
|
800
|
+
...fontConfiguration,
|
|
801
|
+
...style
|
|
802
|
+
},
|
|
803
|
+
"data-name": "typography",
|
|
804
|
+
children
|
|
805
|
+
}
|
|
806
|
+
);
|
|
807
|
+
}
|
|
808
|
+
const Typography = forwardRef(_Typography);
|
|
784
809
|
const en = {
|
|
785
810
|
c4r: {
|
|
786
811
|
button: {
|
|
@@ -795,7 +820,7 @@ const en = {
|
|
|
795
820
|
showOptions: "Show options",
|
|
796
821
|
hide: "Hide",
|
|
797
822
|
show: "Show",
|
|
798
|
-
opensInNewTab: "Opens in new tab"
|
|
823
|
+
opensInNewTab: "(Opens in new tab)"
|
|
799
824
|
},
|
|
800
825
|
form: {
|
|
801
826
|
selectAll: "Select all",
|
|
@@ -944,7 +969,7 @@ const es = {
|
|
|
944
969
|
showOptions: "Mostrar opciones",
|
|
945
970
|
hide: "Ocultar",
|
|
946
971
|
show: "Mostrar",
|
|
947
|
-
opensInNewTab: "Abre en una nueva pestaña"
|
|
972
|
+
opensInNewTab: "(Abre en una nueva pestaña)"
|
|
948
973
|
},
|
|
949
974
|
form: {
|
|
950
975
|
selectAll: "Seleccionar todos",
|
|
@@ -1091,7 +1116,7 @@ const id = {
|
|
|
1091
1116
|
showOptions: "Tampilkan opsi",
|
|
1092
1117
|
hide: "Sembunyikan",
|
|
1093
1118
|
show: "Tampilkan",
|
|
1094
|
-
opensInNewTab: "Buka di tab baru"
|
|
1119
|
+
opensInNewTab: "(Buka di tab baru)"
|
|
1095
1120
|
},
|
|
1096
1121
|
form: {
|
|
1097
1122
|
selectAll: "Select all",
|
|
@@ -5565,48 +5590,78 @@ const getGloballyCachedIntl = (intlConfig) => {
|
|
|
5565
5590
|
function useImperativeIntl(intlConfig) {
|
|
5566
5591
|
return getGloballyCachedIntl(intlConfig);
|
|
5567
5592
|
}
|
|
5568
|
-
const
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5593
|
+
const Option = styled("div")(({ theme }) => ({
|
|
5594
|
+
position: "relative",
|
|
5595
|
+
display: "inline-flex",
|
|
5596
|
+
// TODO: Remove this once we have a better way to handle the spacing between icon buttons:
|
|
5597
|
+
// https://app.shortcut.com/cartoteam/story/471284/create-iconbuttongroup-component-to-properly-group-several-icons
|
|
5598
|
+
"& + &, & + .optionIconButton": {
|
|
5599
|
+
marginLeft: theme.spacing(0.5)
|
|
5600
|
+
}
|
|
5601
|
+
}));
|
|
5602
|
+
const StyledIconButton = styled(IconButton$1, {
|
|
5603
|
+
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
5604
|
+
})(({ active, theme }) => ({
|
|
5605
|
+
...active && {
|
|
5606
|
+
color: theme.palette.primary.main,
|
|
5607
|
+
backgroundColor: theme.palette.primary.background,
|
|
5608
|
+
"& svg:not(.doNotFillIcon) path": {
|
|
5609
|
+
fill: theme.palette.primary.main
|
|
5610
|
+
}
|
|
5611
|
+
}
|
|
5612
|
+
}));
|
|
5613
|
+
function _IconButton({
|
|
5614
|
+
tooltip,
|
|
5615
|
+
tooltipPlacement = "top",
|
|
5616
|
+
icon,
|
|
5617
|
+
size = "medium",
|
|
5618
|
+
variant = "icon",
|
|
5619
|
+
color = "default",
|
|
5620
|
+
sx,
|
|
5621
|
+
className,
|
|
5622
|
+
loading,
|
|
5623
|
+
disabled,
|
|
5624
|
+
active,
|
|
5625
|
+
...props
|
|
5626
|
+
}, ref) {
|
|
5627
|
+
return /* @__PURE__ */ jsx(Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsx(
|
|
5628
|
+
Option,
|
|
5580
5629
|
{
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5630
|
+
className: `optionIconButton ${className ?? ""}`,
|
|
5631
|
+
sx,
|
|
5632
|
+
"data-testid": "icon-button",
|
|
5633
|
+
children: /* @__PURE__ */ jsx(
|
|
5634
|
+
StyledIconButton,
|
|
5635
|
+
{
|
|
5636
|
+
...props,
|
|
5637
|
+
ref,
|
|
5638
|
+
size,
|
|
5639
|
+
variant,
|
|
5640
|
+
color,
|
|
5641
|
+
active,
|
|
5642
|
+
disabled: disabled || loading,
|
|
5643
|
+
role: "button",
|
|
5644
|
+
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
5645
|
+
}
|
|
5646
|
+
)
|
|
5589
5647
|
}
|
|
5590
|
-
);
|
|
5648
|
+
) });
|
|
5591
5649
|
}
|
|
5592
|
-
const
|
|
5650
|
+
const IconButton = forwardRef(_IconButton);
|
|
5593
5651
|
const Root = styled(Box)(({ theme }) => ({
|
|
5594
5652
|
display: "flex",
|
|
5595
5653
|
gap: theme.spacing(0.5),
|
|
5596
5654
|
marginLeft: theme.spacing(1)
|
|
5597
5655
|
}));
|
|
5598
|
-
|
|
5599
|
-
"& .MuiIconButton-root:not(.Mui-disabled)": {
|
|
5600
|
-
color: theme.palette.text.secondary
|
|
5601
|
-
}
|
|
5602
|
-
}));
|
|
5603
|
-
function TablePaginationActions({
|
|
5656
|
+
function _TablePaginationActions({
|
|
5604
5657
|
count,
|
|
5605
5658
|
page,
|
|
5606
5659
|
rowsPerPage = 10,
|
|
5607
5660
|
onPageChange,
|
|
5608
|
-
lastPageTooltip
|
|
5609
|
-
|
|
5661
|
+
lastPageTooltip,
|
|
5662
|
+
"aria-label": ariaLabel,
|
|
5663
|
+
"data-testid": dataTestId
|
|
5664
|
+
}, ref) {
|
|
5610
5665
|
const intl = useIntl();
|
|
5611
5666
|
const intlConfig = useImperativeIntl(intl);
|
|
5612
5667
|
const handleBackButtonClick = (event) => {
|
|
@@ -5626,33 +5681,44 @@ function TablePaginationActions({
|
|
|
5626
5681
|
const noMorePagesText = intlConfig.formatMessage({
|
|
5627
5682
|
id: "c4r.form.pagination.noMorePages"
|
|
5628
5683
|
});
|
|
5629
|
-
return /* @__PURE__ */ jsxs(
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5684
|
+
return /* @__PURE__ */ jsxs(
|
|
5685
|
+
Root,
|
|
5686
|
+
{
|
|
5687
|
+
ref,
|
|
5688
|
+
"data-testid": dataTestId,
|
|
5689
|
+
"aria-label": ariaLabel,
|
|
5690
|
+
"data-name": "table-pagination-actions",
|
|
5691
|
+
children: [
|
|
5692
|
+
/* @__PURE__ */ jsx(
|
|
5693
|
+
IconButton,
|
|
5694
|
+
{
|
|
5695
|
+
onClick: handleBackButtonClick,
|
|
5696
|
+
disabled: page === 0,
|
|
5697
|
+
"aria-label": prevLabel,
|
|
5698
|
+
icon: /* @__PURE__ */ jsx(KeyboardArrowLeftOutlined, {}),
|
|
5699
|
+
tooltip: isFirstPage ? noMorePagesText : prevLabel
|
|
5700
|
+
}
|
|
5701
|
+
),
|
|
5702
|
+
/* @__PURE__ */ jsx(
|
|
5644
5703
|
IconButton,
|
|
5645
5704
|
{
|
|
5646
5705
|
onClick: handleNextButtonClick,
|
|
5647
5706
|
disabled: page >= Math.ceil(count / rowsPerPage) - 1,
|
|
5648
|
-
"aria-label": nextLabel
|
|
5649
|
-
|
|
5707
|
+
"aria-label": nextLabel,
|
|
5708
|
+
icon: /* @__PURE__ */ jsx(KeyboardArrowRightOutlined, {}),
|
|
5709
|
+
tooltip: isLastPage ? lastPageTooltip ?? noMorePagesText : nextLabel
|
|
5650
5710
|
}
|
|
5651
|
-
)
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5711
|
+
)
|
|
5712
|
+
]
|
|
5713
|
+
}
|
|
5714
|
+
);
|
|
5655
5715
|
}
|
|
5716
|
+
const TablePaginationActions = forwardRef(_TablePaginationActions);
|
|
5717
|
+
const ellipsisStyles = {
|
|
5718
|
+
textOverflow: "ellipsis",
|
|
5719
|
+
overflow: "hidden",
|
|
5720
|
+
whiteSpace: "nowrap"
|
|
5721
|
+
};
|
|
5656
5722
|
export {
|
|
5657
5723
|
APPBAR_SIZE as A,
|
|
5658
5724
|
BREAKPOINTS as B,
|
|
@@ -5665,9 +5731,11 @@ export {
|
|
|
5665
5731
|
ICON_SIZE_MEDIUM as b,
|
|
5666
5732
|
ICON_SIZE_SMALL as c,
|
|
5667
5733
|
MENU_LIST_MAX_SIZE as d,
|
|
5668
|
-
|
|
5669
|
-
|
|
5734
|
+
ellipsisStyles as e,
|
|
5735
|
+
MENU_ITEM_SIZE_DENSE as f,
|
|
5670
5736
|
getSpacing as g,
|
|
5671
|
-
|
|
5737
|
+
MENU_ITEM_SIZE_EXTENDED as h,
|
|
5738
|
+
IconButton as i,
|
|
5739
|
+
getDefaultExportFromCjs as j,
|
|
5672
5740
|
useImperativeIntl as u
|
|
5673
5741
|
};
|