@carto/meridian-ds 1.5.1-alpha-virtual-autocomplete.10 → 2.0.0-alpha-external-link.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/CHANGELOG.md +10 -1
- package/dist/{Alert-BzEgeyQJ.cjs → Alert-CmglMdw_.cjs} +96 -1
- package/dist/{Alert-CnaTtNJd.js → Alert-DWK8eGnD.js} +98 -3
- package/dist/{ArrowDown-8fLj23Ge.cjs → ArrowDown-DJ0vhbsw.cjs} +2 -2
- package/dist/{ArrowDown-CY_wMVJT.js → ArrowDown-d6bxUL0F.js} +1 -1
- package/dist/{MenuItem-C1DvWMry.js → MenuItem-C8x-GasJ.js} +1 -1
- package/dist/{MenuItem-C4bG5WHw.cjs → MenuItem-CyIdh2wX.cjs} +1 -1
- package/dist/{OpenDiagonallyRight-CSm5GYYJ.js → OpenDiagonallyRight-CGdCEXlF.js} +1 -1
- package/dist/{OpenDiagonallyRight-CM1tojUq.cjs → OpenDiagonallyRight-CpL4ROwg.cjs} +4 -4
- package/dist/{SwatchSquare-benaO55C.cjs → SwatchSquare-B8PIY3Rd.cjs} +3 -3
- package/dist/{SwatchSquare-DhaaXt53.js → SwatchSquare-CaaLsjAC.js} +1 -1
- package/dist/{TablePaginationActions-Cz5Hbi6N.js → TablePaginationActions-BWer8cmX.js} +6 -3
- package/dist/{TablePaginationActions-mbbjzV6Y.cjs → TablePaginationActions-MwqZJoRm.cjs} +6 -3
- package/dist/components/index.cjs +31 -7
- package/dist/components/index.js +34 -9
- package/dist/custom-icons/index.cjs +608 -486
- package/dist/custom-icons/index.js +561 -439
- package/dist/theme/index.cjs +3 -3
- package/dist/theme/index.js +4 -4
- package/dist/types/components/atoms/Button.d.ts +10 -0
- package/dist/types/components/atoms/Button.d.ts.map +1 -1
- package/dist/types/components/atoms/Link.d.ts +16 -0
- package/dist/types/components/atoms/Link.d.ts.map +1 -0
- package/dist/types/components/atoms/ScreenReaderOnly.d.ts +3 -0
- package/dist/types/components/atoms/ScreenReaderOnly.d.ts.map +1 -0
- package/dist/types/components/atoms/index.d.ts +3 -0
- package/dist/types/components/atoms/index.d.ts.map +1 -1
- package/dist/types/custom-icons/AiAgent.d.ts +4 -0
- package/dist/types/custom-icons/AiAgent.d.ts.map +1 -0
- package/dist/types/custom-icons/HideRightsidebar.d.ts +4 -0
- package/dist/types/custom-icons/HideRightsidebar.d.ts.map +1 -0
- package/dist/types/custom-icons/ShowRightsidebar.d.ts +4 -0
- package/dist/types/custom-icons/ShowRightsidebar.d.ts.map +1 -0
- package/dist/types/custom-icons/index.d.ts +3 -0
- package/dist/types/custom-icons/index.d.ts.map +1 -1
- package/dist/types/localization/en.d.ts +1 -0
- package/dist/types/localization/en.d.ts.map +1 -1
- package/dist/types/localization/es.d.ts +1 -0
- package/dist/types/localization/es.d.ts.map +1 -1
- package/dist/types/localization/id.d.ts +1 -0
- package/dist/types/localization/id.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +3 -0
- package/dist/types/localization/index.d.ts.map +1 -1
- package/dist/types/widgets/comparative/ComparativeCategoryWidgetUI/ComparativeCategoryWidgetUI.d.ts.map +1 -1
- package/dist/widgets/index.cjs +6 -6
- package/dist/widgets/index.js +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- New Link components and Button with externalLink behavior [#202](https://github.com/CartoDB/meridian-ds/pull/202)
|
|
6
|
+
|
|
7
|
+
## 2.0
|
|
8
|
+
|
|
9
|
+
### 2.0.0
|
|
10
|
+
|
|
11
|
+
- Developer API change:
|
|
12
|
+
- `groupBy` deprecation in Autocomplete, use `createAutocompleteGroupByList` instead.
|
|
13
|
+
- **Breaking:** Support VirtualizedList in Autocomplete components [#215](https://github.com/CartoDB/meridian-ds/pull/215)
|
|
14
|
+
- Update import path for `createSvgIcon` from `@mui/material/utils` to `@mui/material` [#219](https://github.com/CartoDB/meridian-ds/pull/219)
|
|
6
15
|
|
|
7
16
|
## 1.0
|
|
8
17
|
|
|
@@ -2,7 +2,21 @@
|
|
|
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 reactIntl = require("react-intl");
|
|
6
|
+
const iconsMaterial = require("@mui/icons-material");
|
|
7
|
+
const TablePaginationActions = require("./TablePaginationActions-MwqZJoRm.cjs");
|
|
8
|
+
require("cartocolor");
|
|
9
|
+
const ScreenReaderOnly = material.styled("span")(() => ({
|
|
10
|
+
position: "absolute",
|
|
11
|
+
width: 1,
|
|
12
|
+
height: 1,
|
|
13
|
+
padding: 0,
|
|
14
|
+
margin: -1,
|
|
15
|
+
overflow: "hidden",
|
|
16
|
+
clip: "rect(0, 0, 0, 0)",
|
|
17
|
+
whiteSpace: "nowrap",
|
|
18
|
+
border: 0
|
|
19
|
+
}));
|
|
6
20
|
const Option = material.styled("div")(({ theme }) => ({
|
|
7
21
|
position: "relative",
|
|
8
22
|
display: "inline-flex",
|
|
@@ -61,6 +75,85 @@ function _IconButton({
|
|
|
61
75
|
) });
|
|
62
76
|
}
|
|
63
77
|
const IconButton = React.forwardRef(_IconButton);
|
|
78
|
+
const StyledLink = material.styled(material.Link)(() => ({
|
|
79
|
+
display: "inline"
|
|
80
|
+
}));
|
|
81
|
+
const Icon = material.styled(material.Box, {
|
|
82
|
+
shouldForwardProp: (prop) => prop !== "variant" && prop !== "iconPosition"
|
|
83
|
+
})(
|
|
84
|
+
({ variant, iconPosition }) => ({
|
|
85
|
+
display: "inline-flex",
|
|
86
|
+
position: "relative",
|
|
87
|
+
top: "calc(1em * 5.0/32)",
|
|
88
|
+
// heuristic to align icon with true perceived baseline
|
|
89
|
+
...iconPosition === "right" && {
|
|
90
|
+
marginLeft: "0.25em"
|
|
91
|
+
},
|
|
92
|
+
...iconPosition === "left" && {
|
|
93
|
+
marginRight: "0.25em"
|
|
94
|
+
},
|
|
95
|
+
svg: {
|
|
96
|
+
// Size adapts to the text size, but make sure the icon size is at least 12px
|
|
97
|
+
fontSize: `max(1em, ${TablePaginationActions.ICON_SIZE_SMALL})`,
|
|
98
|
+
color: "inherit !important",
|
|
99
|
+
"> path": {
|
|
100
|
+
color: "inherit !important"
|
|
101
|
+
},
|
|
102
|
+
// Defined sizes in design specs
|
|
103
|
+
...variant === "caption" && {
|
|
104
|
+
fontSize: TablePaginationActions.ICON_SIZE_SMALL
|
|
105
|
+
},
|
|
106
|
+
...variant === "button" && {
|
|
107
|
+
fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
|
|
108
|
+
},
|
|
109
|
+
...variant === "body2" && {
|
|
110
|
+
fontSize: TablePaginationActions.ICON_SIZE_MEDIUM
|
|
111
|
+
},
|
|
112
|
+
...variant === "body1" && {
|
|
113
|
+
fontSize: TablePaginationActions.ICON_SIZE_LARGE
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
);
|
|
118
|
+
function _Link({
|
|
119
|
+
children,
|
|
120
|
+
variant,
|
|
121
|
+
startIcon,
|
|
122
|
+
endIcon,
|
|
123
|
+
color,
|
|
124
|
+
external,
|
|
125
|
+
showExternalIcon = true,
|
|
126
|
+
fontWeight = 500,
|
|
127
|
+
...otherProps
|
|
128
|
+
}, ref) {
|
|
129
|
+
const intl = reactIntl.useIntl();
|
|
130
|
+
const intlConfig = TablePaginationActions.useImperativeIntl(intl);
|
|
131
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
132
|
+
StyledLink,
|
|
133
|
+
{
|
|
134
|
+
...otherProps,
|
|
135
|
+
variant,
|
|
136
|
+
fontWeight,
|
|
137
|
+
"data-color": color,
|
|
138
|
+
"data-name": "link",
|
|
139
|
+
role: "link",
|
|
140
|
+
color,
|
|
141
|
+
ref,
|
|
142
|
+
target: external ? "_blank" : void 0,
|
|
143
|
+
rel: external ? "noopener noreferrer" : void 0,
|
|
144
|
+
"aria-describedby": external ? "external-hint" : void 0,
|
|
145
|
+
children: [
|
|
146
|
+
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, iconPosition: "left", children: startIcon }),
|
|
147
|
+
children,
|
|
148
|
+
(endIcon || external && showExternalIcon) && /* @__PURE__ */ jsxRuntime.jsx(Icon, { variant, iconPosition: "right", children: endIcon || /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.OpenInNewOutlined, {}) }),
|
|
149
|
+
external && /* @__PURE__ */ jsxRuntime.jsx(ScreenReaderOnly, { id: "external-hint", children: `(${intlConfig.formatMessage({
|
|
150
|
+
id: "c4r.button.opensInNewTab"
|
|
151
|
+
})})` })
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
const Link = React.forwardRef(_Link);
|
|
64
157
|
const StyledAlert = material.styled(material.Alert, {
|
|
65
158
|
shouldForwardProp: (prop) => ![
|
|
66
159
|
"isNeutral",
|
|
@@ -190,3 +283,5 @@ function _Alert({
|
|
|
190
283
|
const Alert = React.forwardRef(_Alert);
|
|
191
284
|
exports.Alert = Alert;
|
|
192
285
|
exports.IconButton = IconButton;
|
|
286
|
+
exports.Link = Link;
|
|
287
|
+
exports.ScreenReaderOnly = ScreenReaderOnly;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState } from "react";
|
|
3
|
-
import { styled, IconButton as IconButton$1, Tooltip, CircularProgress, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
|
|
4
|
-
import {
|
|
3
|
+
import { styled, IconButton as IconButton$1, Tooltip, CircularProgress, Link as Link$1, Box, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
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 "./TablePaginationActions-BWer8cmX.js";
|
|
7
|
+
import "cartocolor";
|
|
8
|
+
const ScreenReaderOnly = styled("span")(() => ({
|
|
9
|
+
position: "absolute",
|
|
10
|
+
width: 1,
|
|
11
|
+
height: 1,
|
|
12
|
+
padding: 0,
|
|
13
|
+
margin: -1,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
clip: "rect(0, 0, 0, 0)",
|
|
16
|
+
whiteSpace: "nowrap",
|
|
17
|
+
border: 0
|
|
18
|
+
}));
|
|
5
19
|
const Option = styled("div")(({ theme }) => ({
|
|
6
20
|
position: "relative",
|
|
7
21
|
display: "inline-flex",
|
|
@@ -60,6 +74,85 @@ function _IconButton({
|
|
|
60
74
|
) });
|
|
61
75
|
}
|
|
62
76
|
const IconButton = forwardRef(_IconButton);
|
|
77
|
+
const StyledLink = styled(Link$1)(() => ({
|
|
78
|
+
display: "inline"
|
|
79
|
+
}));
|
|
80
|
+
const Icon = styled(Box, {
|
|
81
|
+
shouldForwardProp: (prop) => prop !== "variant" && prop !== "iconPosition"
|
|
82
|
+
})(
|
|
83
|
+
({ variant, iconPosition }) => ({
|
|
84
|
+
display: "inline-flex",
|
|
85
|
+
position: "relative",
|
|
86
|
+
top: "calc(1em * 5.0/32)",
|
|
87
|
+
// heuristic to align icon with true perceived baseline
|
|
88
|
+
...iconPosition === "right" && {
|
|
89
|
+
marginLeft: "0.25em"
|
|
90
|
+
},
|
|
91
|
+
...iconPosition === "left" && {
|
|
92
|
+
marginRight: "0.25em"
|
|
93
|
+
},
|
|
94
|
+
svg: {
|
|
95
|
+
// Size adapts to the text size, but make sure the icon size is at least 12px
|
|
96
|
+
fontSize: `max(1em, ${ICON_SIZE_SMALL})`,
|
|
97
|
+
color: "inherit !important",
|
|
98
|
+
"> path": {
|
|
99
|
+
color: "inherit !important"
|
|
100
|
+
},
|
|
101
|
+
// Defined sizes in design specs
|
|
102
|
+
...variant === "caption" && {
|
|
103
|
+
fontSize: ICON_SIZE_SMALL
|
|
104
|
+
},
|
|
105
|
+
...variant === "button" && {
|
|
106
|
+
fontSize: ICON_SIZE_MEDIUM
|
|
107
|
+
},
|
|
108
|
+
...variant === "body2" && {
|
|
109
|
+
fontSize: ICON_SIZE_MEDIUM
|
|
110
|
+
},
|
|
111
|
+
...variant === "body1" && {
|
|
112
|
+
fontSize: ICON_SIZE_LARGE
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
function _Link({
|
|
118
|
+
children,
|
|
119
|
+
variant,
|
|
120
|
+
startIcon,
|
|
121
|
+
endIcon,
|
|
122
|
+
color,
|
|
123
|
+
external,
|
|
124
|
+
showExternalIcon = true,
|
|
125
|
+
fontWeight = 500,
|
|
126
|
+
...otherProps
|
|
127
|
+
}, ref) {
|
|
128
|
+
const intl = useIntl();
|
|
129
|
+
const intlConfig = useImperativeIntl(intl);
|
|
130
|
+
return /* @__PURE__ */ jsxs(
|
|
131
|
+
StyledLink,
|
|
132
|
+
{
|
|
133
|
+
...otherProps,
|
|
134
|
+
variant,
|
|
135
|
+
fontWeight,
|
|
136
|
+
"data-color": color,
|
|
137
|
+
"data-name": "link",
|
|
138
|
+
role: "link",
|
|
139
|
+
color,
|
|
140
|
+
ref,
|
|
141
|
+
target: external ? "_blank" : void 0,
|
|
142
|
+
rel: external ? "noopener noreferrer" : void 0,
|
|
143
|
+
"aria-describedby": external ? "external-hint" : void 0,
|
|
144
|
+
children: [
|
|
145
|
+
startIcon && /* @__PURE__ */ jsx(Icon, { variant, iconPosition: "left", children: startIcon }),
|
|
146
|
+
children,
|
|
147
|
+
(endIcon || external && showExternalIcon) && /* @__PURE__ */ jsx(Icon, { variant, iconPosition: "right", children: endIcon || /* @__PURE__ */ jsx(OpenInNewOutlined, {}) }),
|
|
148
|
+
external && /* @__PURE__ */ jsx(ScreenReaderOnly, { id: "external-hint", children: `(${intlConfig.formatMessage({
|
|
149
|
+
id: "c4r.button.opensInNewTab"
|
|
150
|
+
})})` })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
const Link = forwardRef(_Link);
|
|
63
156
|
const StyledAlert = styled(Alert$1, {
|
|
64
157
|
shouldForwardProp: (prop) => ![
|
|
65
158
|
"isNeutral",
|
|
@@ -189,5 +282,7 @@ function _Alert({
|
|
|
189
282
|
const Alert = forwardRef(_Alert);
|
|
190
283
|
export {
|
|
191
284
|
Alert as A,
|
|
192
|
-
IconButton as I
|
|
285
|
+
IconButton as I,
|
|
286
|
+
Link as L,
|
|
287
|
+
ScreenReaderOnly as S
|
|
193
288
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
4
|
+
const material = require("@mui/material");
|
|
5
5
|
const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6
6
|
"path",
|
|
7
7
|
{
|
|
@@ -11,7 +11,7 @@ const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3
|
|
|
11
11
|
clipRule: "evenodd"
|
|
12
12
|
}
|
|
13
13
|
) });
|
|
14
|
-
const BaseSvgIcon =
|
|
14
|
+
const BaseSvgIcon = material.createSvgIcon(Icon(), "ArrowDown");
|
|
15
15
|
function ArrowDown({ width, height, sx, ...props }, ref) {
|
|
16
16
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
17
|
BaseSvgIcon,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { createSvgIcon } from "@mui/material
|
|
3
|
+
import { createSvgIcon } from "@mui/material";
|
|
4
4
|
const Icon = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
|
|
5
5
|
"path",
|
|
6
6
|
{
|
|
@@ -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 { e as MENU_ITEM_SIZE_DENSE, f as MENU_ITEM_SIZE_EXTENDED } from "./TablePaginationActions-
|
|
4
|
+
import { e as MENU_ITEM_SIZE_DENSE, f as MENU_ITEM_SIZE_EXTENDED } from "./TablePaginationActions-BWer8cmX.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 TablePaginationActions = require("./TablePaginationActions-
|
|
5
|
+
const TablePaginationActions = require("./TablePaginationActions-MwqZJoRm.cjs");
|
|
6
6
|
const StyledMenuItem = material.styled(material.MenuItem, {
|
|
7
7
|
shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
|
|
8
8
|
prop
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { createSvgIcon } from "@mui/material
|
|
3
|
+
import { createSvgIcon } from "@mui/material";
|
|
4
4
|
const Icon$2 = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
|
|
5
5
|
"path",
|
|
6
6
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
4
|
+
const material = require("@mui/material");
|
|
5
5
|
const Icon$2 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6
6
|
"path",
|
|
7
7
|
{
|
|
@@ -11,7 +11,7 @@ const Icon$2 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.
|
|
|
11
11
|
clipRule: "evenodd"
|
|
12
12
|
}
|
|
13
13
|
) });
|
|
14
|
-
const BaseSvgIcon$2 =
|
|
14
|
+
const BaseSvgIcon$2 = material.createSvgIcon(Icon$2(), "ArrowUp");
|
|
15
15
|
function ArrowUp({ width, height, sx, ...props }, ref) {
|
|
16
16
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
17
|
BaseSvgIcon$2,
|
|
@@ -37,7 +37,7 @@ const Icon$1 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.
|
|
|
37
37
|
clipRule: "evenodd"
|
|
38
38
|
}
|
|
39
39
|
) });
|
|
40
|
-
const BaseSvgIcon$1 =
|
|
40
|
+
const BaseSvgIcon$1 = material.createSvgIcon(Icon$1(), "CloseDiagonallyRight");
|
|
41
41
|
function CloseDiagonallyRight({ width, height, sx, ...props }, ref) {
|
|
42
42
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
43
|
BaseSvgIcon$1,
|
|
@@ -63,7 +63,7 @@ const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3
|
|
|
63
63
|
clipRule: "evenodd"
|
|
64
64
|
}
|
|
65
65
|
) });
|
|
66
|
-
const BaseSvgIcon =
|
|
66
|
+
const BaseSvgIcon = material.createSvgIcon(Icon(), "OpenDiagonallyRight");
|
|
67
67
|
function OpenDiagonallyRight({ width, height, sx, ...props }, ref) {
|
|
68
68
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
69
69
|
BaseSvgIcon,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const
|
|
4
|
+
const material = require("@mui/material");
|
|
5
5
|
const Icon$1 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6
6
|
"path",
|
|
7
7
|
{
|
|
@@ -11,7 +11,7 @@ const Icon$1 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.
|
|
|
11
11
|
clipRule: "evenodd"
|
|
12
12
|
}
|
|
13
13
|
) });
|
|
14
|
-
const BaseSvgIcon$1 =
|
|
14
|
+
const BaseSvgIcon$1 = material.createSvgIcon(Icon$1(), "Search");
|
|
15
15
|
function Search({ width, height, sx, ...props }, ref) {
|
|
16
16
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
17
|
BaseSvgIcon$1,
|
|
@@ -29,7 +29,7 @@ function Search({ width, height, sx, ...props }, ref) {
|
|
|
29
29
|
}
|
|
30
30
|
const Search$1 = React.forwardRef(Search);
|
|
31
31
|
const Icon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: 16, height: 16, x: 4, y: 4, fill: "currentColor", rx: 2 }) });
|
|
32
|
-
const BaseSvgIcon =
|
|
32
|
+
const BaseSvgIcon = material.createSvgIcon(Icon(), "SwatchSquare");
|
|
33
33
|
function SwatchSquare({ width, height, sx, ...props }, ref) {
|
|
34
34
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
35
|
BaseSvgIcon,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { createSvgIcon } from "@mui/material
|
|
3
|
+
import { createSvgIcon } from "@mui/material";
|
|
4
4
|
const Icon$1 = () => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ jsx(
|
|
5
5
|
"path",
|
|
6
6
|
{
|
|
@@ -817,7 +817,8 @@ const en = {
|
|
|
817
817
|
copy: "Copy",
|
|
818
818
|
save: "Save",
|
|
819
819
|
add: "Add",
|
|
820
|
-
showOptions: "Show options"
|
|
820
|
+
showOptions: "Show options",
|
|
821
|
+
opensInNewTab: "Opens in new tab"
|
|
821
822
|
},
|
|
822
823
|
form: {
|
|
823
824
|
selectAll: "Select all",
|
|
@@ -965,7 +966,8 @@ const es = {
|
|
|
965
966
|
copy: "Copiar",
|
|
966
967
|
save: "Guardar",
|
|
967
968
|
add: "Añadir",
|
|
968
|
-
showOptions: "Mostrar opciones"
|
|
969
|
+
showOptions: "Mostrar opciones",
|
|
970
|
+
opensInNewTab: "Abre en una nueva pestaña"
|
|
969
971
|
},
|
|
970
972
|
form: {
|
|
971
973
|
selectAll: "Seleccionar todos",
|
|
@@ -1111,7 +1113,8 @@ const id = {
|
|
|
1111
1113
|
copy: "Salin",
|
|
1112
1114
|
save: "Simpan",
|
|
1113
1115
|
add: "Tambah",
|
|
1114
|
-
showOptions: "Tampilkan opsi"
|
|
1116
|
+
showOptions: "Tampilkan opsi",
|
|
1117
|
+
opensInNewTab: "Buka di tab baru"
|
|
1115
1118
|
},
|
|
1116
1119
|
form: {
|
|
1117
1120
|
selectAll: "Select all",
|
|
@@ -818,7 +818,8 @@ const en = {
|
|
|
818
818
|
copy: "Copy",
|
|
819
819
|
save: "Save",
|
|
820
820
|
add: "Add",
|
|
821
|
-
showOptions: "Show options"
|
|
821
|
+
showOptions: "Show options",
|
|
822
|
+
opensInNewTab: "Opens in new tab"
|
|
822
823
|
},
|
|
823
824
|
form: {
|
|
824
825
|
selectAll: "Select all",
|
|
@@ -966,7 +967,8 @@ const es = {
|
|
|
966
967
|
copy: "Copiar",
|
|
967
968
|
save: "Guardar",
|
|
968
969
|
add: "Añadir",
|
|
969
|
-
showOptions: "Mostrar opciones"
|
|
970
|
+
showOptions: "Mostrar opciones",
|
|
971
|
+
opensInNewTab: "Abre en una nueva pestaña"
|
|
970
972
|
},
|
|
971
973
|
form: {
|
|
972
974
|
selectAll: "Seleccionar todos",
|
|
@@ -1112,7 +1114,8 @@ const id = {
|
|
|
1112
1114
|
copy: "Salin",
|
|
1113
1115
|
save: "Simpan",
|
|
1114
1116
|
add: "Tambah",
|
|
1115
|
-
showOptions: "Tampilkan opsi"
|
|
1117
|
+
showOptions: "Tampilkan opsi",
|
|
1118
|
+
opensInNewTab: "Buka di tab baru"
|
|
1116
1119
|
},
|
|
1117
1120
|
form: {
|
|
1118
1121
|
selectAll: "Select all",
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const material = require("@mui/material");
|
|
6
|
-
const TablePaginationActions = require("../TablePaginationActions-mbbjzV6Y.cjs");
|
|
7
|
-
const ArrowDown = require("../ArrowDown-8fLj23Ge.cjs");
|
|
8
|
-
const OpenDiagonallyRight = require("../OpenDiagonallyRight-CM1tojUq.cjs");
|
|
9
5
|
const reactIntl = require("react-intl");
|
|
6
|
+
const material = require("@mui/material");
|
|
10
7
|
const iconsMaterial = require("@mui/icons-material");
|
|
11
|
-
const
|
|
8
|
+
const TablePaginationActions = require("../TablePaginationActions-MwqZJoRm.cjs");
|
|
9
|
+
const Alert$1 = require("../Alert-CmglMdw_.cjs");
|
|
10
|
+
const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
|
|
11
|
+
const OpenDiagonallyRight = require("../OpenDiagonallyRight-CpL4ROwg.cjs");
|
|
12
12
|
require("cartocolor");
|
|
13
|
-
const MenuItem = require("../MenuItem-
|
|
13
|
+
const MenuItem = require("../MenuItem-CyIdh2wX.cjs");
|
|
14
14
|
const reactWindow = require("react-window");
|
|
15
15
|
const DatePicker$1 = require("@mui/x-date-pickers/DatePicker");
|
|
16
16
|
const xDatePickers = require("@mui/x-date-pickers");
|
|
@@ -62,10 +62,15 @@ function _Button({
|
|
|
62
62
|
startIcon,
|
|
63
63
|
endIcon,
|
|
64
64
|
loadingPosition,
|
|
65
|
+
external,
|
|
66
|
+
showExternalIcon = true,
|
|
65
67
|
...otherProps
|
|
66
68
|
}, ref) {
|
|
69
|
+
const intl = reactIntl.useIntl();
|
|
70
|
+
const intlConfig = TablePaginationActions.useImperativeIntl(intl);
|
|
67
71
|
const defaultIconLoader = /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" });
|
|
68
72
|
const isDefaultLoading = loading && loadingPosition === void 0;
|
|
73
|
+
const isExternalLink = otherProps.href && external;
|
|
69
74
|
const renderContent = () => {
|
|
70
75
|
if (isDefaultLoading) {
|
|
71
76
|
return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { position: "relative" }, children: [
|
|
@@ -73,6 +78,14 @@ function _Button({
|
|
|
73
78
|
/* @__PURE__ */ jsxRuntime.jsx(HiddenText, { children })
|
|
74
79
|
] });
|
|
75
80
|
}
|
|
81
|
+
if (isExternalLink) {
|
|
82
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
83
|
+
children,
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx(Alert$1.ScreenReaderOnly, { id: "external-hint", children: `(${intlConfig.formatMessage({
|
|
85
|
+
id: "c4r.button.opensInNewTab"
|
|
86
|
+
})})` })
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
76
89
|
return children;
|
|
77
90
|
};
|
|
78
91
|
const getIconForPosition = (position) => {
|
|
@@ -85,7 +98,11 @@ function _Button({
|
|
|
85
98
|
}
|
|
86
99
|
return void 0;
|
|
87
100
|
}
|
|
88
|
-
|
|
101
|
+
if (position === "start") {
|
|
102
|
+
return startIcon;
|
|
103
|
+
} else {
|
|
104
|
+
return endIcon || (isExternalLink && showExternalIcon ? /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.OpenInNewOutlined, {}) : void 0);
|
|
105
|
+
}
|
|
89
106
|
};
|
|
90
107
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
91
108
|
material.Button,
|
|
@@ -95,7 +112,12 @@ function _Button({
|
|
|
95
112
|
endIcon: getIconForPosition("end"),
|
|
96
113
|
...otherProps,
|
|
97
114
|
role: otherProps.href ? "link" : "button",
|
|
115
|
+
...isExternalLink && {
|
|
116
|
+
target: "_blank",
|
|
117
|
+
rel: "noopener noreferrer"
|
|
118
|
+
},
|
|
98
119
|
ref,
|
|
120
|
+
"aria-describedby": isExternalLink ? "external-hint" : void 0,
|
|
99
121
|
children: /* @__PURE__ */ jsxRuntime.jsx(TablePaginationActions.Typography, { variant: "inherit", color: "inherit", noWrap: true, component: "span", children: renderContent() })
|
|
100
122
|
}
|
|
101
123
|
);
|
|
@@ -5067,6 +5089,8 @@ exports.TablePaginationActions = TablePaginationActions.TablePaginationActions;
|
|
|
5067
5089
|
exports.Typography = TablePaginationActions.Typography;
|
|
5068
5090
|
exports.Alert = Alert$1.Alert;
|
|
5069
5091
|
exports.IconButton = Alert$1.IconButton;
|
|
5092
|
+
exports.Link = Alert$1.Link;
|
|
5093
|
+
exports.ScreenReaderOnly = Alert$1.ScreenReaderOnly;
|
|
5070
5094
|
exports.MenuItem = MenuItem.MenuItem;
|
|
5071
5095
|
exports.AUTOCOMPLETE_GROUP_HEADER_PROPERTY = AUTOCOMPLETE_GROUP_HEADER_PROPERTY;
|
|
5072
5096
|
exports.AccordionGroup = AccordionGroup;
|
package/dist/components/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle } from "react";
|
|
3
|
-
import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, IconButton, Tooltip, Select, FormControl, InputLabel, FormHelperText, ToggleButtonGroup as ToggleButtonGroup$1, Menu as Menu$2, Link, Checkbox, ListItemText, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Snackbar as Snackbar$1, Portal, Fade, Slide, alpha, useTheme, Toolbar, AppBar as AppBar$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1 } from "@mui/material";
|
|
4
|
-
import { T as Typography, c as ICON_SIZE_SMALL, u as useImperativeIntl, f as MENU_ITEM_SIZE_EXTENDED, e as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, M as MENU_ITEM_SIZE_DEFAULT, N as NOTIFICATION_DURATION_IN_MS, A as APPBAR_SIZE } from "../TablePaginationActions-Cz5Hbi6N.js";
|
|
5
|
-
import { a } from "../TablePaginationActions-Cz5Hbi6N.js";
|
|
6
|
-
import { A as ArrowDown } from "../ArrowDown-CY_wMVJT.js";
|
|
7
|
-
import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CSm5GYYJ.js";
|
|
8
3
|
import { useIntl } from "react-intl";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, IconButton, Tooltip, Select, FormControl, InputLabel, FormHelperText, ToggleButtonGroup as ToggleButtonGroup$1, Menu as Menu$2, Link, Checkbox, ListItemText, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Snackbar as Snackbar$1, Portal, Fade, Slide, alpha, useTheme, Toolbar, AppBar as AppBar$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1 } from "@mui/material";
|
|
5
|
+
import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, AddCircleOutlineOutlined, ContentCopyOutlined, CloseOutlined, MenuOutlined, HelpOutline, TodayOutlined, MoreVertOutlined, ErrorOutline, Check } from "@mui/icons-material";
|
|
6
|
+
import { u as useImperativeIntl, T as Typography, c as ICON_SIZE_SMALL, f as MENU_ITEM_SIZE_EXTENDED, e as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, M as MENU_ITEM_SIZE_DEFAULT, N as NOTIFICATION_DURATION_IN_MS, A as APPBAR_SIZE } from "../TablePaginationActions-BWer8cmX.js";
|
|
7
|
+
import { a } from "../TablePaginationActions-BWer8cmX.js";
|
|
8
|
+
import { S as ScreenReaderOnly, I as IconButton$1, A as Alert$1 } from "../Alert-DWK8eGnD.js";
|
|
9
|
+
import { L } from "../Alert-DWK8eGnD.js";
|
|
10
|
+
import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
|
|
11
|
+
import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CGdCEXlF.js";
|
|
11
12
|
import "cartocolor";
|
|
12
|
-
import { M as MenuItem$1 } from "../MenuItem-
|
|
13
|
+
import { M as MenuItem$1 } from "../MenuItem-C8x-GasJ.js";
|
|
13
14
|
import { FixedSizeList } from "react-window";
|
|
14
15
|
import { DatePicker as DatePicker$1 } from "@mui/x-date-pickers/DatePicker";
|
|
15
16
|
import { PickersDay as PickersDay$1 } from "@mui/x-date-pickers";
|
|
@@ -61,10 +62,15 @@ function _Button({
|
|
|
61
62
|
startIcon,
|
|
62
63
|
endIcon,
|
|
63
64
|
loadingPosition,
|
|
65
|
+
external,
|
|
66
|
+
showExternalIcon = true,
|
|
64
67
|
...otherProps
|
|
65
68
|
}, ref) {
|
|
69
|
+
const intl = useIntl();
|
|
70
|
+
const intlConfig = useImperativeIntl(intl);
|
|
66
71
|
const defaultIconLoader = /* @__PURE__ */ jsx(CircularProgress, { size: 18, color: "inherit" });
|
|
67
72
|
const isDefaultLoading = loading && loadingPosition === void 0;
|
|
73
|
+
const isExternalLink = otherProps.href && external;
|
|
68
74
|
const renderContent = () => {
|
|
69
75
|
if (isDefaultLoading) {
|
|
70
76
|
return /* @__PURE__ */ jsxs(Box, { sx: { position: "relative" }, children: [
|
|
@@ -72,6 +78,14 @@ function _Button({
|
|
|
72
78
|
/* @__PURE__ */ jsx(HiddenText, { children })
|
|
73
79
|
] });
|
|
74
80
|
}
|
|
81
|
+
if (isExternalLink) {
|
|
82
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
|
+
children,
|
|
84
|
+
/* @__PURE__ */ jsx(ScreenReaderOnly, { id: "external-hint", children: `(${intlConfig.formatMessage({
|
|
85
|
+
id: "c4r.button.opensInNewTab"
|
|
86
|
+
})})` })
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
75
89
|
return children;
|
|
76
90
|
};
|
|
77
91
|
const getIconForPosition = (position) => {
|
|
@@ -84,7 +98,11 @@ function _Button({
|
|
|
84
98
|
}
|
|
85
99
|
return void 0;
|
|
86
100
|
}
|
|
87
|
-
|
|
101
|
+
if (position === "start") {
|
|
102
|
+
return startIcon;
|
|
103
|
+
} else {
|
|
104
|
+
return endIcon || (isExternalLink && showExternalIcon ? /* @__PURE__ */ jsx(OpenInNewOutlined, {}) : void 0);
|
|
105
|
+
}
|
|
88
106
|
};
|
|
89
107
|
return /* @__PURE__ */ jsx(
|
|
90
108
|
Button$1,
|
|
@@ -94,7 +112,12 @@ function _Button({
|
|
|
94
112
|
endIcon: getIconForPosition("end"),
|
|
95
113
|
...otherProps,
|
|
96
114
|
role: otherProps.href ? "link" : "button",
|
|
115
|
+
...isExternalLink && {
|
|
116
|
+
target: "_blank",
|
|
117
|
+
rel: "noopener noreferrer"
|
|
118
|
+
},
|
|
97
119
|
ref,
|
|
120
|
+
"aria-describedby": isExternalLink ? "external-hint" : void 0,
|
|
98
121
|
children: /* @__PURE__ */ jsx(Typography, { variant: "inherit", color: "inherit", noWrap: true, component: "span", children: renderContent() })
|
|
99
122
|
}
|
|
100
123
|
);
|
|
@@ -5097,6 +5120,7 @@ export {
|
|
|
5097
5120
|
DialogStepper,
|
|
5098
5121
|
IconButton$1 as IconButton,
|
|
5099
5122
|
LabelWithIndicator,
|
|
5123
|
+
L as Link,
|
|
5100
5124
|
Menu$1 as Menu,
|
|
5101
5125
|
MenuItem$1 as MenuItem,
|
|
5102
5126
|
MenuItemFilter,
|
|
@@ -5104,6 +5128,7 @@ export {
|
|
|
5104
5128
|
MultipleAutocomplete,
|
|
5105
5129
|
MultipleSelectField,
|
|
5106
5130
|
PasswordField,
|
|
5131
|
+
ScreenReaderOnly,
|
|
5107
5132
|
SelectField,
|
|
5108
5133
|
Snackbar,
|
|
5109
5134
|
SplitButton,
|