@carto/meridian-ds 1.4.7 → 1.4.8
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 -2
- package/dist/types/widgets/CategoryWidgetUI/CategoryWidgetUI.d.ts.map +1 -1
- package/dist/types/widgets/ChartLegend.d.ts +2 -1
- package/dist/types/widgets/ChartLegend.d.ts.map +1 -1
- package/dist/types/widgets/PieWidgetUI/PieWidgetUI.d.ts.map +1 -1
- package/dist/widgets/index.cjs +9 -8
- package/dist/widgets/index.js +10 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,14 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
## 1.0
|
|
6
6
|
|
|
7
|
+
### 1.4.8
|
|
8
|
+
|
|
9
|
+
- Fix Category Widget Blanks [#210](https://github.com/CartoDB/meridian-ds/pull/210)
|
|
10
|
+
- Add support for labels in Pie widget legend and ChartLegend [#208](https://github.com/CartoDB/meridian-ds/pull/208)
|
|
11
|
+
|
|
7
12
|
### 1.4.7
|
|
8
13
|
|
|
9
14
|
- Fix Category Widget max value calculation [#206](https://github.com/CartoDB/meridian-ds/pull/206)
|
|
10
15
|
|
|
11
16
|
### 1.4.6
|
|
12
17
|
|
|
13
|
-
- Fix tooltips in ChartLegend pagination buttons [201](https://github.com/CartoDB/meridian-ds/pull/201)
|
|
14
|
-
- Remove `scrollIntoView` from Category Widget [203](https://github.com/CartoDB/meridian-ds/pull/203)
|
|
18
|
+
- Fix tooltips in ChartLegend pagination buttons [#201](https://github.com/CartoDB/meridian-ds/pull/201)
|
|
19
|
+
- Remove `scrollIntoView` from Category Widget [#203](https://github.com/CartoDB/meridian-ds/pull/203)
|
|
15
20
|
|
|
16
21
|
### 1.4.5
|
|
17
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryWidgetUI.d.ts","sourceRoot":"","sources":["../../../../src/widgets/CategoryWidgetUI/CategoryWidget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8B,EAC9B,0BAAqC,EACrC,SAAgB,EAChB,UAAiB,EACjB,UAAiB,EACjB,SAAS,GACV,EAAE,qBAAqB,2CA4kBvB;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export default function ChartLegend({ series, selectedCategories, onCategoryClick, }: {
|
|
1
|
+
export default function ChartLegend({ series, selectedCategories, labels, onCategoryClick, }: {
|
|
2
2
|
series: {
|
|
3
3
|
name: string;
|
|
4
4
|
color: string;
|
|
5
5
|
value?: number;
|
|
6
6
|
}[];
|
|
7
7
|
selectedCategories: string[];
|
|
8
|
+
labels?: Record<string, string>;
|
|
8
9
|
onCategoryClick?: (categoryName: string) => void;
|
|
9
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
//# sourceMappingURL=ChartLegend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../src/widgets/ChartLegend.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../src/widgets/ChartLegend.tsx"],"names":[],"mappings":"AAoEA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,MAAM,EACN,kBAAkB,EAClB,MAAkB,EAClB,eAAe,GAChB,EAAE;IACD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzD,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;CACjD,2CAkJA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieWidgetUI.d.ts","sourceRoot":"","sources":["../../../../src/widgets/PieWidgetUI/PieWidgetUI.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAA;AAIzE,OAAO,EAA0B,aAAa,EAAE,MAAM,wBAAwB,CAAA;AA2C9E,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,IAAI,EACJ,IAAI,EACJ,SAAiD,EACjD,gBAA0C,EAC1C,gBAAgB,EAChB,MAAmB,EACnB,KAAkB,EAClB,MAAkB,EAClB,MAA8B,EAC9B,SAAgB,EAChB,UAAiB,EACjB,kBAA0C,EAC1C,0BAA0B,EAC1B,SAAS,EACT,QAAa,EACb,WAAW,EACX,KAA0B,GAC3B,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"PieWidgetUI.d.ts","sourceRoot":"","sources":["../../../../src/widgets/PieWidgetUI/PieWidgetUI.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAA;AAIzE,OAAO,EAA0B,aAAa,EAAE,MAAM,wBAAwB,CAAA;AA2C9E,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,IAAI,EACJ,IAAI,EACJ,SAAiD,EACjD,gBAA0C,EAC1C,gBAAgB,EAChB,MAAmB,EACnB,KAAkB,EAClB,MAAkB,EAClB,MAA8B,EAC9B,SAAgB,EAChB,UAAiB,EACjB,kBAA0C,EAC1C,0BAA0B,EAC1B,SAAS,EACT,QAAa,EACb,WAAW,EACX,KAA0B,GAC3B,EAAE,gBAAgB,2CA+NlB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG;IACjD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,YAAY,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACrC,gBAAgB,CAAC,EAAE,OAAO,uBAAuB,CAAA;IACjD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,0BAA0B,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAAA;AAED,iBAAS,uBAAuB,CAC9B,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EACpC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,iBAiB5C"}
|
package/dist/widgets/index.cjs
CHANGED
|
@@ -33,7 +33,7 @@ function processFormatterResult(formatterResult) {
|
|
|
33
33
|
return `${formatterResult.prefix ?? ""}${formatterResult.value}${formatterResult.suffix ?? ""}`;
|
|
34
34
|
}
|
|
35
35
|
const EMPTY_ARR$8 = [];
|
|
36
|
-
const EMPTY_OBJ$
|
|
36
|
+
const EMPTY_OBJ$6 = {};
|
|
37
37
|
const IDENTITY$5 = (n) => n;
|
|
38
38
|
function defaultTooltipFormatter$5(params, yAxisFormatter) {
|
|
39
39
|
if (!params) {
|
|
@@ -62,7 +62,7 @@ function defaultTooltipFormatter$5(params, yAxisFormatter) {
|
|
|
62
62
|
}
|
|
63
63
|
function useProcessedProps({
|
|
64
64
|
height,
|
|
65
|
-
labels = EMPTY_OBJ$
|
|
65
|
+
labels = EMPTY_OBJ$6,
|
|
66
66
|
yAxisData: _yAxisData,
|
|
67
67
|
selectedBars: _selectedBars = EMPTY_ARR$8,
|
|
68
68
|
series: _series,
|
|
@@ -786,13 +786,13 @@ function animateValues({
|
|
|
786
786
|
requestRef.current = requestAnimationFrame(animate);
|
|
787
787
|
}
|
|
788
788
|
const EMPTY_ARR$7 = [];
|
|
789
|
-
const EMPTY_OBJ$
|
|
789
|
+
const EMPTY_OBJ$5 = {};
|
|
790
790
|
const IDENTITY$4 = (v) => v;
|
|
791
791
|
const EMPTY_FN$a = () => void 0;
|
|
792
792
|
function CategoryWidgetUI({
|
|
793
793
|
data,
|
|
794
794
|
formatter = IDENTITY$4,
|
|
795
|
-
labels = EMPTY_OBJ$
|
|
795
|
+
labels = EMPTY_OBJ$5,
|
|
796
796
|
maxItems = 5,
|
|
797
797
|
othersValue,
|
|
798
798
|
order = OrderTypes.Ranking,
|
|
@@ -1242,9 +1242,6 @@ function CategoryWidgetUI({
|
|
|
1242
1242
|
/* @__PURE__ */ jsxRuntime.jsx(CategoriesWrapper, { container: true, item: true, children: animValues.length ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
1243
|
reactWindow.FixedSizeList,
|
|
1244
1244
|
{
|
|
1245
|
-
outerElementType: React.forwardRef(
|
|
1246
|
-
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-testid": "category-widget-list", ...props })
|
|
1247
|
-
),
|
|
1248
1245
|
height: getFixedSizeListHeight(),
|
|
1249
1246
|
width: "100%",
|
|
1250
1247
|
itemCount: animValues.length,
|
|
@@ -2069,9 +2066,11 @@ const Circle$1 = material.styled(material.Box, {
|
|
|
2069
2066
|
height: size
|
|
2070
2067
|
};
|
|
2071
2068
|
});
|
|
2069
|
+
const EMPTY_OBJ$4 = {};
|
|
2072
2070
|
function ChartLegend({
|
|
2073
2071
|
series,
|
|
2074
2072
|
selectedCategories,
|
|
2073
|
+
labels = EMPTY_OBJ$4,
|
|
2075
2074
|
onCategoryClick
|
|
2076
2075
|
}) {
|
|
2077
2076
|
var _a, _b;
|
|
@@ -2138,6 +2137,7 @@ function ChartLegend({
|
|
|
2138
2137
|
children: series.map((category, i) => {
|
|
2139
2138
|
if (i < offset) return null;
|
|
2140
2139
|
const selected = selectedCategories.length === 0 || selectedCategories.includes(category.name);
|
|
2140
|
+
const label = category.name in labels ? labels[category.name] : category.name;
|
|
2141
2141
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2142
2142
|
Item,
|
|
2143
2143
|
{
|
|
@@ -2159,7 +2159,7 @@ function ChartLegend({
|
|
|
2159
2159
|
{
|
|
2160
2160
|
variant: "overline",
|
|
2161
2161
|
color: selected ? void 0 : "text.disabled",
|
|
2162
|
-
children:
|
|
2162
|
+
children: label
|
|
2163
2163
|
}
|
|
2164
2164
|
)
|
|
2165
2165
|
]
|
|
@@ -2434,6 +2434,7 @@ function PieWidgetUI({
|
|
|
2434
2434
|
ChartLegend,
|
|
2435
2435
|
{
|
|
2436
2436
|
series: processedData,
|
|
2437
|
+
labels,
|
|
2437
2438
|
selectedCategories,
|
|
2438
2439
|
onCategoryClick: onSelectedCategoriesChange && handleLegendClick
|
|
2439
2440
|
}
|
package/dist/widgets/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, { useMemo, useState, useEffect, useCallback, useRef,
|
|
2
|
+
import React, { useMemo, useState, useEffect, useCallback, useRef, createContext, useContext, useLayoutEffect, createRef } from "react";
|
|
3
3
|
import { useTheme, styled, Box, Skeleton, Grid, Link, darken, Button, Divider, TextField, InputAdornment, Checkbox, Tooltip, debounce, Slider, TableCell, Table, TableHead, TableRow, TableBody, TableContainer, TableSortLabel, TablePagination, IconButton as IconButton$1, Menu, MenuItem, SvgIcon, lighten, Typography as Typography$1, ClickAwayListener, ToggleButton, capitalize, ListItem, Chip, List, Paper, Popover, Select, ListItemText, Collapse, Drawer, Icon, LinearProgress } from "@mui/material";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { d as getDefaultExportFromCjs, u as useImperativeIntl, T as Typography, S as SPACING, B as BREAKPOINTS, a as TablePaginationActions, b as ICON_SIZE_MEDIUM } from "../TablePaginationActions-KpTvhN4Y.js";
|
|
@@ -31,7 +31,7 @@ function processFormatterResult(formatterResult) {
|
|
|
31
31
|
return `${formatterResult.prefix ?? ""}${formatterResult.value}${formatterResult.suffix ?? ""}`;
|
|
32
32
|
}
|
|
33
33
|
const EMPTY_ARR$8 = [];
|
|
34
|
-
const EMPTY_OBJ$
|
|
34
|
+
const EMPTY_OBJ$6 = {};
|
|
35
35
|
const IDENTITY$5 = (n) => n;
|
|
36
36
|
function defaultTooltipFormatter$5(params, yAxisFormatter) {
|
|
37
37
|
if (!params) {
|
|
@@ -60,7 +60,7 @@ function defaultTooltipFormatter$5(params, yAxisFormatter) {
|
|
|
60
60
|
}
|
|
61
61
|
function useProcessedProps({
|
|
62
62
|
height,
|
|
63
|
-
labels = EMPTY_OBJ$
|
|
63
|
+
labels = EMPTY_OBJ$6,
|
|
64
64
|
yAxisData: _yAxisData,
|
|
65
65
|
selectedBars: _selectedBars = EMPTY_ARR$8,
|
|
66
66
|
series: _series,
|
|
@@ -784,13 +784,13 @@ function animateValues({
|
|
|
784
784
|
requestRef.current = requestAnimationFrame(animate);
|
|
785
785
|
}
|
|
786
786
|
const EMPTY_ARR$7 = [];
|
|
787
|
-
const EMPTY_OBJ$
|
|
787
|
+
const EMPTY_OBJ$5 = {};
|
|
788
788
|
const IDENTITY$4 = (v) => v;
|
|
789
789
|
const EMPTY_FN$a = () => void 0;
|
|
790
790
|
function CategoryWidgetUI({
|
|
791
791
|
data,
|
|
792
792
|
formatter = IDENTITY$4,
|
|
793
|
-
labels = EMPTY_OBJ$
|
|
793
|
+
labels = EMPTY_OBJ$5,
|
|
794
794
|
maxItems = 5,
|
|
795
795
|
othersValue,
|
|
796
796
|
order = OrderTypes.Ranking,
|
|
@@ -1240,9 +1240,6 @@ function CategoryWidgetUI({
|
|
|
1240
1240
|
/* @__PURE__ */ jsx(CategoriesWrapper, { container: true, item: true, children: animValues.length ? /* @__PURE__ */ jsx(
|
|
1241
1241
|
FixedSizeList,
|
|
1242
1242
|
{
|
|
1243
|
-
outerElementType: forwardRef(
|
|
1244
|
-
(props, ref) => /* @__PURE__ */ jsx("div", { ref, "data-testid": "category-widget-list", ...props })
|
|
1245
|
-
),
|
|
1246
1243
|
height: getFixedSizeListHeight(),
|
|
1247
1244
|
width: "100%",
|
|
1248
1245
|
itemCount: animValues.length,
|
|
@@ -2067,9 +2064,11 @@ const Circle$1 = styled(Box, {
|
|
|
2067
2064
|
height: size
|
|
2068
2065
|
};
|
|
2069
2066
|
});
|
|
2067
|
+
const EMPTY_OBJ$4 = {};
|
|
2070
2068
|
function ChartLegend({
|
|
2071
2069
|
series,
|
|
2072
2070
|
selectedCategories,
|
|
2071
|
+
labels = EMPTY_OBJ$4,
|
|
2073
2072
|
onCategoryClick
|
|
2074
2073
|
}) {
|
|
2075
2074
|
var _a, _b;
|
|
@@ -2136,6 +2135,7 @@ function ChartLegend({
|
|
|
2136
2135
|
children: series.map((category, i) => {
|
|
2137
2136
|
if (i < offset) return null;
|
|
2138
2137
|
const selected = selectedCategories.length === 0 || selectedCategories.includes(category.name);
|
|
2138
|
+
const label = category.name in labels ? labels[category.name] : category.name;
|
|
2139
2139
|
return /* @__PURE__ */ jsxs(
|
|
2140
2140
|
Item,
|
|
2141
2141
|
{
|
|
@@ -2157,7 +2157,7 @@ function ChartLegend({
|
|
|
2157
2157
|
{
|
|
2158
2158
|
variant: "overline",
|
|
2159
2159
|
color: selected ? void 0 : "text.disabled",
|
|
2160
|
-
children:
|
|
2160
|
+
children: label
|
|
2161
2161
|
}
|
|
2162
2162
|
)
|
|
2163
2163
|
]
|
|
@@ -2432,6 +2432,7 @@ function PieWidgetUI({
|
|
|
2432
2432
|
ChartLegend,
|
|
2433
2433
|
{
|
|
2434
2434
|
series: processedData,
|
|
2435
|
+
labels,
|
|
2435
2436
|
selectedCategories,
|
|
2436
2437
|
onCategoryClick: onSelectedCategoriesChange && handleLegendClick
|
|
2437
2438
|
}
|