@carto/meridian-ds 2.5.5-alpha-ellipsis.1 → 2.5.5-alpha-translations.1
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 -1
- package/dist/{Alert-wE4A0ify.js → Alert-CRVceJ9N.js} +20 -77
- package/dist/{Alert-CaashKPj.cjs → Alert-Dyw7Z9wJ.cjs} +22 -79
- package/dist/{MenuItem-BUe4eJZH.js → MenuItem-h41wtQTz.js} +1 -1
- package/dist/{MenuItem-BZWWJptW.cjs → MenuItem-o51jnNjL.cjs} +6 -6
- package/dist/{css-utils-W9dzgcXq.cjs → TablePaginationActions-CMC_ZxDN.cjs} +117 -61
- package/dist/{css-utils-CTJjJR0x.js → TablePaginationActions-DIFPc_wQ.js} +119 -63
- package/dist/components/index.cjs +163 -259
- package/dist/components/index.js +103 -199
- package/dist/theme/index.cjs +114 -108
- package/dist/theme/index.js +13 -7
- 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/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 -20
- 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 +4 -176
- 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 +0 -2
- 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/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 +119 -114
- package/dist/widgets/index.js +9 -4
- package/package.json +1 -1
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts +0 -117
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts.map +0 -1
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts +0 -66
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.stories.d.ts.map +0 -1
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts +0 -2
- package/dist/types/components/EllipsisWithTooltip/EllipsisWithTooltip.test.d.ts.map +0 -1
- package/dist/types/components/EllipsisWithTooltip/index.d.ts +0 -3
- package/dist/types/components/EllipsisWithTooltip/index.d.ts.map +0 -1
- package/dist/types/utils/css-utils.d.ts +0 -14
- package/dist/types/utils/css-utils.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Improve translations handling with `useTranslationFallback` hook [#293](https://github.com/CartoDB/meridian-ds/pull/293)
|
|
6
|
+
- Add unit tests for data display components [#292](https://github.com/CartoDB/meridian-ds/pull/292)
|
|
7
|
+
- Add unit tests for action components [#290](https://github.com/CartoDB/meridian-ds/pull/290)
|
|
6
8
|
|
|
7
9
|
## 2.0
|
|
8
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState } from "react";
|
|
3
|
-
import { styled,
|
|
4
|
-
import { useIntl } from "react-intl";
|
|
3
|
+
import { styled, Link as Link$1, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
|
|
5
4
|
import { OpenInNewOutlined } from "@mui/icons-material";
|
|
6
|
-
import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, I as ICON_SIZE_LARGE, u as useImperativeIntl, T as Typography } from "./css-utils-CTJjJR0x.js";
|
|
7
5
|
import "cartocolor";
|
|
6
|
+
import { u as useImperativeIntl, c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, T as Typography } from "./TablePaginationActions-DIFPc_wQ.js";
|
|
7
|
+
import { useIntl } from "react-intl";
|
|
8
8
|
const ScreenReaderOnly = styled("span")(() => ({
|
|
9
9
|
position: "absolute",
|
|
10
10
|
width: 1,
|
|
@@ -16,64 +16,14 @@ const ScreenReaderOnly = styled("span")(() => ({
|
|
|
16
16
|
whiteSpace: "nowrap",
|
|
17
17
|
border: 0
|
|
18
18
|
}));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"& + &, & + .optionIconButton": {
|
|
25
|
-
marginLeft: theme.spacing(0.5)
|
|
26
|
-
}
|
|
27
|
-
}));
|
|
28
|
-
const StyledIconButton = styled(IconButton$1, {
|
|
29
|
-
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
30
|
-
})(({ active, theme }) => ({
|
|
31
|
-
...active && {
|
|
32
|
-
color: theme.palette.primary.main,
|
|
33
|
-
backgroundColor: theme.palette.primary.background,
|
|
34
|
-
"& svg:not(.doNotFillIcon) path": {
|
|
35
|
-
fill: theme.palette.primary.main
|
|
36
|
-
}
|
|
19
|
+
function useTranslationFallback(translationKey, customText) {
|
|
20
|
+
const intl = useIntl();
|
|
21
|
+
const intlConfig = useImperativeIntl(intl);
|
|
22
|
+
if (customText !== void 0 && customText !== null) {
|
|
23
|
+
return customText;
|
|
37
24
|
}
|
|
38
|
-
})
|
|
39
|
-
function _IconButton({
|
|
40
|
-
tooltip,
|
|
41
|
-
tooltipPlacement = "top",
|
|
42
|
-
icon,
|
|
43
|
-
size = "medium",
|
|
44
|
-
variant = "icon",
|
|
45
|
-
color = "default",
|
|
46
|
-
sx,
|
|
47
|
-
className,
|
|
48
|
-
loading,
|
|
49
|
-
disabled,
|
|
50
|
-
active,
|
|
51
|
-
...props
|
|
52
|
-
}, ref) {
|
|
53
|
-
return /* @__PURE__ */ jsx(Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsx(
|
|
54
|
-
Option,
|
|
55
|
-
{
|
|
56
|
-
className: `optionIconButton ${className ?? ""}`,
|
|
57
|
-
sx,
|
|
58
|
-
"data-testid": "icon-button",
|
|
59
|
-
children: /* @__PURE__ */ jsx(
|
|
60
|
-
StyledIconButton,
|
|
61
|
-
{
|
|
62
|
-
...props,
|
|
63
|
-
ref,
|
|
64
|
-
size,
|
|
65
|
-
variant,
|
|
66
|
-
color,
|
|
67
|
-
active,
|
|
68
|
-
disabled: disabled || loading,
|
|
69
|
-
role: "button",
|
|
70
|
-
children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
) });
|
|
25
|
+
return intlConfig.formatMessage({ id: translationKey });
|
|
75
26
|
}
|
|
76
|
-
const IconButton = forwardRef(_IconButton);
|
|
77
27
|
const StyledLink = styled(Link$1)(() => ({
|
|
78
28
|
display: "inline-block"
|
|
79
29
|
}));
|
|
@@ -107,21 +57,13 @@ const Icon = styled("span", {
|
|
|
107
57
|
fontSize: ICON_SIZE_SMALL
|
|
108
58
|
}
|
|
109
59
|
},
|
|
110
|
-
// Button and
|
|
111
|
-
...(variant === "button" || variant === "body2") && {
|
|
60
|
+
// Button, body2 and body1 variants use medium-sized icons
|
|
61
|
+
...(variant === "button" || variant === "body2" || variant === "body1") && {
|
|
112
62
|
top: "calc(1em * 1/4)",
|
|
113
63
|
// 25% offset ratio
|
|
114
64
|
svg: {
|
|
115
65
|
fontSize: ICON_SIZE_MEDIUM
|
|
116
66
|
}
|
|
117
|
-
},
|
|
118
|
-
// Body1 variant uses large icons
|
|
119
|
-
...variant === "body1" && {
|
|
120
|
-
top: "calc(1em * 1/3)",
|
|
121
|
-
// 33% offset ratio
|
|
122
|
-
svg: {
|
|
123
|
-
fontSize: ICON_SIZE_LARGE
|
|
124
|
-
}
|
|
125
67
|
}
|
|
126
68
|
})
|
|
127
69
|
);
|
|
@@ -133,14 +75,17 @@ function _Link({
|
|
|
133
75
|
color,
|
|
134
76
|
external,
|
|
135
77
|
showExternalIcon = true,
|
|
78
|
+
screenReaderText,
|
|
136
79
|
fontWeight = 500,
|
|
137
80
|
target,
|
|
138
81
|
rel,
|
|
139
82
|
"aria-describedby": ariaDescribedby,
|
|
140
83
|
...otherProps
|
|
141
84
|
}, ref) {
|
|
142
|
-
const
|
|
143
|
-
|
|
85
|
+
const screenReaderTextValue = useTranslationFallback(
|
|
86
|
+
"c4r.button.opensInNewTab",
|
|
87
|
+
screenReaderText
|
|
88
|
+
);
|
|
144
89
|
const isButtonLink = otherProps.component === "button";
|
|
145
90
|
return /* @__PURE__ */ jsxs(
|
|
146
91
|
StyledLink,
|
|
@@ -160,9 +105,7 @@ function _Link({
|
|
|
160
105
|
startIcon && /* @__PURE__ */ jsx(Icon, { variant, iconPosition: "left", children: startIcon }),
|
|
161
106
|
children,
|
|
162
107
|
(endIcon || external && showExternalIcon) && /* @__PURE__ */ jsx(Icon, { variant, iconPosition: "right", children: endIcon || /* @__PURE__ */ jsx(OpenInNewOutlined, {}) }),
|
|
163
|
-
external && /* @__PURE__ */ jsx(ScreenReaderOnly, { id: "external-hint", children:
|
|
164
|
-
id: "c4r.button.opensInNewTab"
|
|
165
|
-
})})` })
|
|
108
|
+
external && /* @__PURE__ */ jsx(ScreenReaderOnly, { id: "external-hint", children: screenReaderTextValue })
|
|
166
109
|
]
|
|
167
110
|
}
|
|
168
111
|
);
|
|
@@ -297,7 +240,7 @@ function _Alert({
|
|
|
297
240
|
const Alert = forwardRef(_Alert);
|
|
298
241
|
export {
|
|
299
242
|
Alert as A,
|
|
300
|
-
IconButton as I,
|
|
301
243
|
Link as L,
|
|
302
|
-
ScreenReaderOnly as S
|
|
244
|
+
ScreenReaderOnly as S,
|
|
245
|
+
useTranslationFallback as u
|
|
303
246
|
};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const material = require("@mui/material");
|
|
5
|
-
const reactIntl = require("react-intl");
|
|
6
5
|
const iconsMaterial = require("@mui/icons-material");
|
|
7
|
-
const cssUtils = require("./css-utils-W9dzgcXq.cjs");
|
|
8
6
|
require("cartocolor");
|
|
7
|
+
const TablePaginationActions = require("./TablePaginationActions-CMC_ZxDN.cjs");
|
|
8
|
+
const reactIntl = require("react-intl");
|
|
9
9
|
const ScreenReaderOnly = material.styled("span")(() => ({
|
|
10
10
|
position: "absolute",
|
|
11
11
|
width: 1,
|
|
@@ -17,64 +17,14 @@ const ScreenReaderOnly = material.styled("span")(() => ({
|
|
|
17
17
|
whiteSpace: "nowrap",
|
|
18
18
|
border: 0
|
|
19
19
|
}));
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"& + &, & + .optionIconButton": {
|
|
26
|
-
marginLeft: theme.spacing(0.5)
|
|
27
|
-
}
|
|
28
|
-
}));
|
|
29
|
-
const StyledIconButton = material.styled(material.IconButton, {
|
|
30
|
-
shouldForwardProp: (prop) => !["active"].includes(prop)
|
|
31
|
-
})(({ active, theme }) => ({
|
|
32
|
-
...active && {
|
|
33
|
-
color: theme.palette.primary.main,
|
|
34
|
-
backgroundColor: theme.palette.primary.background,
|
|
35
|
-
"& svg:not(.doNotFillIcon) path": {
|
|
36
|
-
fill: theme.palette.primary.main
|
|
37
|
-
}
|
|
20
|
+
function useTranslationFallback(translationKey, customText) {
|
|
21
|
+
const intl = reactIntl.useIntl();
|
|
22
|
+
const intlConfig = TablePaginationActions.useImperativeIntl(intl);
|
|
23
|
+
if (customText !== void 0 && customText !== null) {
|
|
24
|
+
return customText;
|
|
38
25
|
}
|
|
39
|
-
})
|
|
40
|
-
function _IconButton({
|
|
41
|
-
tooltip,
|
|
42
|
-
tooltipPlacement = "top",
|
|
43
|
-
icon,
|
|
44
|
-
size = "medium",
|
|
45
|
-
variant = "icon",
|
|
46
|
-
color = "default",
|
|
47
|
-
sx,
|
|
48
|
-
className,
|
|
49
|
-
loading,
|
|
50
|
-
disabled,
|
|
51
|
-
active,
|
|
52
|
-
...props
|
|
53
|
-
}, ref) {
|
|
54
|
-
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { placement: tooltipPlacement, title: tooltip ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
-
Option,
|
|
56
|
-
{
|
|
57
|
-
className: `optionIconButton ${className ?? ""}`,
|
|
58
|
-
sx,
|
|
59
|
-
"data-testid": "icon-button",
|
|
60
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
-
StyledIconButton,
|
|
62
|
-
{
|
|
63
|
-
...props,
|
|
64
|
-
ref,
|
|
65
|
-
size,
|
|
66
|
-
variant,
|
|
67
|
-
color,
|
|
68
|
-
active,
|
|
69
|
-
disabled: disabled || loading,
|
|
70
|
-
role: "button",
|
|
71
|
-
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" }) : icon
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
) });
|
|
26
|
+
return intlConfig.formatMessage({ id: translationKey });
|
|
76
27
|
}
|
|
77
|
-
const IconButton = React.forwardRef(_IconButton);
|
|
78
28
|
const StyledLink = material.styled(material.Link)(() => ({
|
|
79
29
|
display: "inline-block"
|
|
80
30
|
}));
|
|
@@ -94,7 +44,7 @@ const Icon = material.styled("span", {
|
|
|
94
44
|
},
|
|
95
45
|
svg: {
|
|
96
46
|
// Size adapts to the text size, but make sure the icon size is at least 12px
|
|
97
|
-
fontSize: `max(1em, ${
|
|
47
|
+
fontSize: `max(1em, ${TablePaginationActions.ICON_SIZE_SMALL})`,
|
|
98
48
|
color: "inherit !important",
|
|
99
49
|
"> path": {
|
|
100
50
|
color: "inherit !important"
|
|
@@ -105,23 +55,15 @@ const Icon = material.styled("span", {
|
|
|
105
55
|
top: "calc(1em * 1/5)",
|
|
106
56
|
// 20% offset ratio
|
|
107
57
|
svg: {
|
|
108
|
-
fontSize:
|
|
58
|
+
fontSize: TablePaginationActions.ICON_SIZE_SMALL
|
|
109
59
|
}
|
|
110
60
|
},
|
|
111
|
-
// Button and
|
|
112
|
-
...(variant === "button" || variant === "body2") && {
|
|
61
|
+
// Button, body2 and body1 variants use medium-sized icons
|
|
62
|
+
...(variant === "button" || variant === "body2" || variant === "body1") && {
|
|
113
63
|
top: "calc(1em * 1/4)",
|
|
114
64
|
// 25% offset ratio
|
|
115
65
|
svg: {
|
|
116
|
-
fontSize:
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
// Body1 variant uses large icons
|
|
120
|
-
...variant === "body1" && {
|
|
121
|
-
top: "calc(1em * 1/3)",
|
|
122
|
-
// 33% offset ratio
|
|
123
|
-
svg: {
|
|
124
|
-
fontSize: cssUtils.ICON_SIZE_LARGE
|
|
66
|
+
fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
|
|
125
67
|
}
|
|
126
68
|
}
|
|
127
69
|
})
|
|
@@ -134,14 +76,17 @@ function _Link({
|
|
|
134
76
|
color,
|
|
135
77
|
external,
|
|
136
78
|
showExternalIcon = true,
|
|
79
|
+
screenReaderText,
|
|
137
80
|
fontWeight = 500,
|
|
138
81
|
target,
|
|
139
82
|
rel,
|
|
140
83
|
"aria-describedby": ariaDescribedby,
|
|
141
84
|
...otherProps
|
|
142
85
|
}, ref) {
|
|
143
|
-
const
|
|
144
|
-
|
|
86
|
+
const screenReaderTextValue = useTranslationFallback(
|
|
87
|
+
"c4r.button.opensInNewTab",
|
|
88
|
+
screenReaderText
|
|
89
|
+
);
|
|
145
90
|
const isButtonLink = otherProps.component === "button";
|
|
146
91
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
147
92
|
StyledLink,
|
|
@@ -161,9 +106,7 @@ function _Link({
|
|
|
161
106
|
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, iconPosition: "left", children: startIcon }),
|
|
162
107
|
children,
|
|
163
108
|
(endIcon || external && showExternalIcon) && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, iconPosition: "right", children: endIcon || /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.OpenInNewOutlined, {}) }),
|
|
164
|
-
external && /* @__PURE__ */ jsxRuntime.jsx(ScreenReaderOnly, { id: "external-hint", children:
|
|
165
|
-
id: "c4r.button.opensInNewTab"
|
|
166
|
-
})})` })
|
|
109
|
+
external && /* @__PURE__ */ jsxRuntime.jsx(ScreenReaderOnly, { id: "external-hint", children: screenReaderTextValue })
|
|
167
110
|
]
|
|
168
111
|
}
|
|
169
112
|
);
|
|
@@ -196,7 +139,7 @@ const StyledAlert = material.styled(material.Alert, {
|
|
|
196
139
|
"icon message"
|
|
197
140
|
"icon actions"
|
|
198
141
|
`,
|
|
199
|
-
gridTemplateColumns: hasCloseButton ? `${
|
|
142
|
+
gridTemplateColumns: hasCloseButton ? `${TablePaginationActions.ICON_SIZE_MEDIUM} 1fr ${theme.spacing(3)}` : `${TablePaginationActions.ICON_SIZE_MEDIUM}`
|
|
200
143
|
},
|
|
201
144
|
...isNeutral && {
|
|
202
145
|
backgroundColor: theme.palette.default.background,
|
|
@@ -290,13 +233,13 @@ function _Alert({
|
|
|
290
233
|
...otherProps,
|
|
291
234
|
children: [
|
|
292
235
|
title && /* @__PURE__ */ jsxRuntime.jsx(material.AlertTitle, { children: title }),
|
|
293
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
236
|
+
/* @__PURE__ */ jsxRuntime.jsx(TablePaginationActions.Typography, { variant: "caption", color: "inherit", component: "div", children })
|
|
294
237
|
]
|
|
295
238
|
}
|
|
296
239
|
) });
|
|
297
240
|
}
|
|
298
241
|
const Alert = React.forwardRef(_Alert);
|
|
299
242
|
exports.Alert = Alert;
|
|
300
|
-
exports.IconButton = IconButton;
|
|
301
243
|
exports.Link = Link;
|
|
302
244
|
exports.ScreenReaderOnly = ScreenReaderOnly;
|
|
245
|
+
exports.useTranslationFallback = useTranslationFallback;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { styled, MenuItem as MenuItem$1 } from "@mui/material";
|
|
4
|
-
import {
|
|
4
|
+
import { e as MENU_ITEM_SIZE_DENSE, f as MENU_ITEM_SIZE_EXTENDED } from "./TablePaginationActions-DIFPc_wQ.js";
|
|
5
5
|
const StyledMenuItem = styled(MenuItem$1, {
|
|
6
6
|
shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
|
|
7
7
|
prop
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const material = require("@mui/material");
|
|
5
|
-
const
|
|
5
|
+
const TablePaginationActions = require("./TablePaginationActions-CMC_ZxDN.cjs");
|
|
6
6
|
const StyledMenuItem = material.styled(material.MenuItem, {
|
|
7
7
|
shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
|
|
8
8
|
prop
|
|
@@ -29,7 +29,7 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
29
29
|
color: theme.palette.text.secondary
|
|
30
30
|
},
|
|
31
31
|
"&.MuiMenuItem-root": {
|
|
32
|
-
minHeight:
|
|
32
|
+
minHeight: TablePaginationActions.MENU_ITEM_SIZE_DENSE,
|
|
33
33
|
paddingTop: 0,
|
|
34
34
|
paddingBottom: 0,
|
|
35
35
|
marginTop: theme.spacing(1),
|
|
@@ -96,7 +96,7 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
96
96
|
},
|
|
97
97
|
...extended && {
|
|
98
98
|
"&.MuiButtonBase-root.MuiMenuItem-root": {
|
|
99
|
-
minHeight:
|
|
99
|
+
minHeight: TablePaginationActions.MENU_ITEM_SIZE_EXTENDED
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
...fixed && {
|
|
@@ -107,14 +107,14 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
107
107
|
bottom: 0,
|
|
108
108
|
right: 0,
|
|
109
109
|
zIndex: 2,
|
|
110
|
-
minHeight:
|
|
110
|
+
minHeight: TablePaginationActions.MENU_ITEM_SIZE_EXTENDED,
|
|
111
111
|
marginBottom: theme.spacing(1),
|
|
112
112
|
padding: theme.spacing(0.5, 1.5),
|
|
113
113
|
backgroundColor: `${theme.palette.background.paper} !important`,
|
|
114
114
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
115
115
|
},
|
|
116
116
|
".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type": {
|
|
117
|
-
minHeight:
|
|
117
|
+
minHeight: TablePaginationActions.MENU_ITEM_SIZE_EXTENDED,
|
|
118
118
|
marginTop: 0,
|
|
119
119
|
"&:hover": {
|
|
120
120
|
backgroundColor: theme.palette.background.paper
|
|
@@ -128,7 +128,7 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
128
128
|
},
|
|
129
129
|
...dense && {
|
|
130
130
|
"&.MuiButtonBase-root.MuiMenuItem-root": {
|
|
131
|
-
minHeight:
|
|
131
|
+
minHeight: TablePaginationActions.MENU_ITEM_SIZE_DENSE,
|
|
132
132
|
padding: theme.spacing(0.25, 1.5)
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -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,43 +5682,45 @@ 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
|
}
|
|
5657
|
-
const
|
|
5658
|
-
textOverflow: "ellipsis",
|
|
5659
|
-
overflow: "hidden",
|
|
5660
|
-
whiteSpace: "nowrap"
|
|
5661
|
-
};
|
|
5717
|
+
const TablePaginationActions = React.forwardRef(_TablePaginationActions);
|
|
5662
5718
|
exports.APPBAR_SIZE = APPBAR_SIZE;
|
|
5663
5719
|
exports.BREAKPOINTS = BREAKPOINTS;
|
|
5664
5720
|
exports.ICON_SIZE_LARGE = ICON_SIZE_LARGE;
|
|
5665
5721
|
exports.ICON_SIZE_MEDIUM = ICON_SIZE_MEDIUM;
|
|
5666
5722
|
exports.ICON_SIZE_SMALL = ICON_SIZE_SMALL;
|
|
5723
|
+
exports.IconButton = IconButton;
|
|
5667
5724
|
exports.MENU_ITEM_SIZE_DEFAULT = MENU_ITEM_SIZE_DEFAULT;
|
|
5668
5725
|
exports.MENU_ITEM_SIZE_DENSE = MENU_ITEM_SIZE_DENSE;
|
|
5669
5726
|
exports.MENU_ITEM_SIZE_EXTENDED = MENU_ITEM_SIZE_EXTENDED;
|
|
@@ -5672,7 +5729,6 @@ exports.NOTIFICATION_DURATION_IN_MS = NOTIFICATION_DURATION_IN_MS;
|
|
|
5672
5729
|
exports.SPACING = SPACING;
|
|
5673
5730
|
exports.TablePaginationActions = TablePaginationActions;
|
|
5674
5731
|
exports.Typography = Typography;
|
|
5675
|
-
exports.ellipsisStyles = ellipsisStyles;
|
|
5676
5732
|
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
5677
5733
|
exports.getSpacing = getSpacing;
|
|
5678
5734
|
exports.useImperativeIntl = useImperativeIntl;
|