@carto/meridian-ds 2.9.2 → 2.9.3-alpha-lists.5
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 +6 -0
- package/dist/{Alert-C4W0H_uN.cjs → Alert-0VBqBP4P.cjs} +1 -1
- package/dist/{Alert-BZPM5zpX.js → Alert-BEzNSCqV.js} +1 -1
- package/dist/{MenuItem-DoBJsRR_.cjs → MenuItem-0c7Cz5g_.cjs} +1 -1
- package/dist/{MenuItem-Cx5lTXXm.js → MenuItem-D4v_HV1x.js} +1 -1
- package/dist/components/index.cjs +255 -7
- package/dist/components/index.js +259 -11
- package/dist/{css-utils-CH7es90t.cjs → css-utils-B3V0Xzli.cjs} +8 -0
- package/dist/{css-utils-CjUBRJVK.js → css-utils-D9LibDjo.js} +12 -4
- package/dist/custom-icons/index.cjs +7 -24
- package/dist/custom-icons/index.js +7 -24
- package/dist/theme/index.cjs +342 -51
- package/dist/theme/index.js +344 -53
- package/dist/types/components/Avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/types/components/List/List.d.ts +24 -0
- package/dist/types/components/List/List.d.ts.map +1 -0
- package/dist/types/components/List/List.stories.d.ts +452 -0
- package/dist/types/components/List/List.stories.d.ts.map +1 -0
- package/dist/types/components/List/List.test.d.ts +2 -0
- package/dist/types/components/List/List.test.d.ts.map +1 -0
- package/dist/types/components/List/ListItem/ListItem.d.ts +9 -0
- package/dist/types/components/List/ListItem/ListItem.d.ts.map +1 -0
- package/dist/types/components/List/ListItem/ListItem.stories.d.ts +346 -0
- package/dist/types/components/List/ListItem/ListItem.stories.d.ts.map +1 -0
- package/dist/types/components/List/ListItem/ListItem.test.d.ts +2 -0
- package/dist/types/components/List/ListItem/ListItem.test.d.ts.map +1 -0
- package/dist/types/components/List/ListItemButton/ListItemButton.d.ts +9 -0
- package/dist/types/components/List/ListItemButton/ListItemButton.d.ts.map +1 -0
- package/dist/types/components/List/ListItemButton/ListItemButton.test.d.ts +2 -0
- package/dist/types/components/List/ListItemButton/ListItemButton.test.d.ts.map +1 -0
- package/dist/types/components/List/ListItemRightContent/ListItemRightContent.d.ts +14 -0
- package/dist/types/components/List/ListItemRightContent/ListItemRightContent.d.ts.map +1 -0
- package/dist/types/components/List/ListItemRightContent/ListItemRightContent.test.d.ts +2 -0
- package/dist/types/components/List/ListItemRightContent/ListItemRightContent.test.d.ts.map +1 -0
- package/dist/types/components/List/ListSubheader/ListSubheader.d.ts +9 -0
- package/dist/types/components/List/ListSubheader/ListSubheader.d.ts.map +1 -0
- package/dist/types/components/List/ListSubheader/ListSubheader.test.d.ts +2 -0
- package/dist/types/components/List/ListSubheader/ListSubheader.test.d.ts.map +1 -0
- package/dist/types/components/List/index.d.ts +12 -0
- package/dist/types/components/List/index.d.ts.map +1 -0
- package/dist/types/components/List/types.d.ts +3 -0
- package/dist/types/components/List/types.d.ts.map +1 -0
- package/dist/types/components/Menu/Menu/Menu.stories.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/custom-icons/SwitchAccessShortcut.d.ts.map +1 -1
- package/dist/types/theme/components/data-display.d.ts.map +1 -1
- package/dist/types/theme/components/navigation.d.ts.map +1 -1
- package/dist/types/theme/types.d.ts +151 -0
- package/dist/types/theme/types.d.ts.map +1 -1
- package/dist/types/utils/theme-constants.d.ts +4 -0
- package/dist/types/utils/theme-constants.d.ts.map +1 -1
- package/dist/widgets/index.cjs +2 -2
- package/dist/widgets/index.js +2 -2
- package/package.json +1 -1
- package/dist/types/theme/components/stories/List.stories.d.ts +0 -62
- package/dist/types/theme/components/stories/List.stories.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- New List components (List, ListItem, ListSubheader, ListItemRightContent) [#336](https://github.com/CartoDB/meridian-ds/pull/336)
|
|
6
|
+
|
|
5
7
|
## 2.0
|
|
6
8
|
|
|
9
|
+
### 2.9.3
|
|
10
|
+
|
|
11
|
+
- Custom Icons: SwitchAccessShortcut [#347](https://github.com/CartoDB/meridian-ds/pull/347)
|
|
12
|
+
|
|
7
13
|
### 2.9.2
|
|
8
14
|
|
|
9
15
|
- Custom Icons: ArrowDownHigh, ArrowRightHigh, FolderEmpty [#345](https://github.com/CartoDB/meridian-ds/pull/345)
|
|
@@ -4,7 +4,7 @@ const React = require("react");
|
|
|
4
4
|
const material = require("@mui/material");
|
|
5
5
|
const iconsMaterial = require("@mui/icons-material");
|
|
6
6
|
require("cartocolor");
|
|
7
|
-
const cssUtils = require("./css-utils-
|
|
7
|
+
const cssUtils = require("./css-utils-B3V0Xzli.cjs");
|
|
8
8
|
const ScreenReaderOnly = material.styled("span")(() => ({
|
|
9
9
|
position: "absolute",
|
|
10
10
|
width: 1,
|
|
@@ -3,7 +3,7 @@ import { forwardRef, useState } from "react";
|
|
|
3
3
|
import { styled, Link as Link$1, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
|
|
4
4
|
import { OpenInNewOutlined } from "@mui/icons-material";
|
|
5
5
|
import "cartocolor";
|
|
6
|
-
import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, u as useTranslationWithFallback, T as Typography } from "./css-utils-
|
|
6
|
+
import { c as ICON_SIZE_SMALL, b as ICON_SIZE_MEDIUM, u as useTranslationWithFallback, T as Typography } from "./css-utils-D9LibDjo.js";
|
|
7
7
|
const ScreenReaderOnly = styled("span")(() => ({
|
|
8
8
|
position: "absolute",
|
|
9
9
|
width: 1,
|
|
@@ -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 cssUtils = require("./css-utils-
|
|
5
|
+
const cssUtils = require("./css-utils-B3V0Xzli.cjs");
|
|
6
6
|
function getPixelToRem(px) {
|
|
7
7
|
const fontBase = 16;
|
|
8
8
|
const rem = 1 / fontBase * px + "rem";
|
|
@@ -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 { f as MENU_ITEM_SIZE_DENSE,
|
|
4
|
+
import { f as MENU_ITEM_SIZE_DENSE, i as MENU_ITEM_SIZE_EXTENDED } from "./css-utils-D9LibDjo.js";
|
|
5
5
|
function getPixelToRem(px) {
|
|
6
6
|
const fontBase = 16;
|
|
7
7
|
const rem = 1 / fontBase * px + "rem";
|
|
@@ -4,11 +4,11 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const material = require("@mui/material");
|
|
6
6
|
const iconsMaterial = require("@mui/icons-material");
|
|
7
|
-
const cssUtils = require("../css-utils-
|
|
8
|
-
const Alert$1 = require("../Alert-
|
|
7
|
+
const cssUtils = require("../css-utils-B3V0Xzli.cjs");
|
|
8
|
+
const Alert$1 = require("../Alert-0VBqBP4P.cjs");
|
|
9
9
|
const ArrowDown = require("../ArrowDown-DJ0vhbsw.cjs");
|
|
10
10
|
const OpenDiagonallyRight = require("../OpenDiagonallyRight-CpL4ROwg.cjs");
|
|
11
|
-
const MenuItem = require("../MenuItem-
|
|
11
|
+
const MenuItem = require("../MenuItem-0c7Cz5g_.cjs");
|
|
12
12
|
require("cartocolor");
|
|
13
13
|
const reactWindow = require("react-window");
|
|
14
14
|
const reactCodemirror2 = require("react-codemirror2");
|
|
@@ -1479,7 +1479,7 @@ function useMultipleAutocomplete({
|
|
|
1479
1479
|
getCounterRenderTags
|
|
1480
1480
|
};
|
|
1481
1481
|
}
|
|
1482
|
-
const List = material.styled("ul")(
|
|
1482
|
+
const List$1 = material.styled("ul")(
|
|
1483
1483
|
({ theme, hasFilters }) => ({
|
|
1484
1484
|
...!hasFilters && {
|
|
1485
1485
|
paddingTop: `${theme.spacing(1)} !important`
|
|
@@ -1606,7 +1606,7 @@ function _AutocompleteList({
|
|
|
1606
1606
|
);
|
|
1607
1607
|
};
|
|
1608
1608
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1609
|
-
List,
|
|
1609
|
+
List$1,
|
|
1610
1610
|
{
|
|
1611
1611
|
ref,
|
|
1612
1612
|
...otherProps,
|
|
@@ -4928,7 +4928,7 @@ const StyledMenu = material.styled(material.Menu, {
|
|
|
4928
4928
|
}
|
|
4929
4929
|
}
|
|
4930
4930
|
}));
|
|
4931
|
-
function _Menu({ extended, width, height, MenuListProps, ...otherProps }, ref) {
|
|
4931
|
+
function _Menu({ extended, width, height, MenuListProps: MenuListProps2, ...otherProps }, ref) {
|
|
4932
4932
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4933
4933
|
StyledMenu,
|
|
4934
4934
|
{
|
|
@@ -4939,7 +4939,7 @@ function _Menu({ extended, width, height, MenuListProps, ...otherProps }, ref) {
|
|
|
4939
4939
|
height,
|
|
4940
4940
|
extended,
|
|
4941
4941
|
MenuListProps: {
|
|
4942
|
-
...
|
|
4942
|
+
...MenuListProps2,
|
|
4943
4943
|
"data-width": width,
|
|
4944
4944
|
"data-height": height,
|
|
4945
4945
|
"data-extended": extended
|
|
@@ -6263,6 +6263,249 @@ function _EllipsisWithTooltip({
|
|
|
6263
6263
|
);
|
|
6264
6264
|
}
|
|
6265
6265
|
const EllipsisWithTooltip = React.forwardRef(_EllipsisWithTooltip);
|
|
6266
|
+
const ListContext = React.createContext({});
|
|
6267
|
+
const ListItemWrapper = material.styled("div")({
|
|
6268
|
+
pointerEvents: "none",
|
|
6269
|
+
"& > *": {
|
|
6270
|
+
pointerEvents: "auto"
|
|
6271
|
+
}
|
|
6272
|
+
});
|
|
6273
|
+
function _List({
|
|
6274
|
+
variant = "standard",
|
|
6275
|
+
spacing,
|
|
6276
|
+
dense,
|
|
6277
|
+
virtualized = false,
|
|
6278
|
+
virtualizedItemHeight,
|
|
6279
|
+
virtualizedListHeight = cssUtils.LIST_MAX_SIZE,
|
|
6280
|
+
overscanCount = cssUtils.LIST_OVERSCAN_ITEMS_COUNT,
|
|
6281
|
+
disableGutters = false,
|
|
6282
|
+
disablePadding = false,
|
|
6283
|
+
fixedHeight = true,
|
|
6284
|
+
divider = false,
|
|
6285
|
+
children,
|
|
6286
|
+
...otherProps
|
|
6287
|
+
}, ref) {
|
|
6288
|
+
const isBoxed = variant === "boxed";
|
|
6289
|
+
const defaultSpacing = spacing ?? (isBoxed ? 1 : 0);
|
|
6290
|
+
const contextValue = React.useMemo(
|
|
6291
|
+
() => ({
|
|
6292
|
+
variant,
|
|
6293
|
+
fixedHeight,
|
|
6294
|
+
dense,
|
|
6295
|
+
disableGutters,
|
|
6296
|
+
disablePadding,
|
|
6297
|
+
divider
|
|
6298
|
+
}),
|
|
6299
|
+
[variant, fixedHeight, dense, disableGutters, disablePadding, divider]
|
|
6300
|
+
);
|
|
6301
|
+
const childrenArray = React.useMemo(
|
|
6302
|
+
() => React.Children.toArray(children),
|
|
6303
|
+
[children]
|
|
6304
|
+
);
|
|
6305
|
+
const defaultItemHeight = virtualizedItemHeight ?? (dense || dense === void 0 ? cssUtils.LIST_ITEM_SIZE_DENSE : cssUtils.LIST_ITEM_SIZE_DEFAULT);
|
|
6306
|
+
const listHeight = React.useMemo(() => {
|
|
6307
|
+
const calculatedHeight = childrenArray.length * defaultItemHeight;
|
|
6308
|
+
return Math.min(calculatedHeight, virtualizedListHeight);
|
|
6309
|
+
}, [childrenArray.length, defaultItemHeight, virtualizedListHeight]);
|
|
6310
|
+
if (!virtualized) {
|
|
6311
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ListContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6312
|
+
material.List,
|
|
6313
|
+
{
|
|
6314
|
+
...otherProps,
|
|
6315
|
+
variant,
|
|
6316
|
+
spacing: defaultSpacing,
|
|
6317
|
+
dense,
|
|
6318
|
+
ref,
|
|
6319
|
+
"data-name": "list",
|
|
6320
|
+
"data-variant": variant,
|
|
6321
|
+
"data-spacing": defaultSpacing,
|
|
6322
|
+
"data-virtualized": false,
|
|
6323
|
+
"data-disable-gutters": disableGutters,
|
|
6324
|
+
"data-disable-padding": disablePadding,
|
|
6325
|
+
"data-fixed-height": fixedHeight,
|
|
6326
|
+
"data-divider": divider,
|
|
6327
|
+
children
|
|
6328
|
+
}
|
|
6329
|
+
) });
|
|
6330
|
+
}
|
|
6331
|
+
const renderItem = ({
|
|
6332
|
+
index,
|
|
6333
|
+
style
|
|
6334
|
+
}) => {
|
|
6335
|
+
const child = childrenArray[index];
|
|
6336
|
+
if (!child) return null;
|
|
6337
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ListItemWrapper, { style, "data-name": "virtual-list-item", children: child });
|
|
6338
|
+
};
|
|
6339
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ListContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6340
|
+
material.List,
|
|
6341
|
+
{
|
|
6342
|
+
...otherProps,
|
|
6343
|
+
variant,
|
|
6344
|
+
spacing: defaultSpacing,
|
|
6345
|
+
dense,
|
|
6346
|
+
ref,
|
|
6347
|
+
"data-name": "virtual-list",
|
|
6348
|
+
"data-variant": variant,
|
|
6349
|
+
"data-spacing": defaultSpacing,
|
|
6350
|
+
"data-disable-gutters": disableGutters,
|
|
6351
|
+
"data-disable-padding": disablePadding,
|
|
6352
|
+
"data-fixed-height": fixedHeight,
|
|
6353
|
+
"data-virtualized": virtualized,
|
|
6354
|
+
"data-divider": divider,
|
|
6355
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6356
|
+
reactWindow.FixedSizeList,
|
|
6357
|
+
{
|
|
6358
|
+
height: listHeight,
|
|
6359
|
+
width: "100%",
|
|
6360
|
+
itemCount: childrenArray.length,
|
|
6361
|
+
itemSize: defaultItemHeight,
|
|
6362
|
+
overscanCount,
|
|
6363
|
+
children: renderItem
|
|
6364
|
+
}
|
|
6365
|
+
)
|
|
6366
|
+
}
|
|
6367
|
+
) });
|
|
6368
|
+
}
|
|
6369
|
+
const List = React.forwardRef(_List);
|
|
6370
|
+
List.displayName = "List";
|
|
6371
|
+
function _ListItem({
|
|
6372
|
+
variant,
|
|
6373
|
+
dense,
|
|
6374
|
+
disabled,
|
|
6375
|
+
fixedHeight,
|
|
6376
|
+
onClick,
|
|
6377
|
+
disablePadding,
|
|
6378
|
+
disableGutters,
|
|
6379
|
+
divider,
|
|
6380
|
+
...otherProps
|
|
6381
|
+
}, ref) {
|
|
6382
|
+
const listContext = React.useContext(ListContext);
|
|
6383
|
+
const effectiveVariant = variant ?? listContext.variant ?? "standard";
|
|
6384
|
+
const effectiveDense = dense ?? listContext.dense ?? true;
|
|
6385
|
+
const effectiveFixedHeight = fixedHeight ?? listContext.fixedHeight ?? true;
|
|
6386
|
+
const effectiveDisableGutters = disableGutters ?? listContext.disableGutters ?? false;
|
|
6387
|
+
const effectiveDisablePadding = disablePadding ?? listContext.disablePadding ?? false;
|
|
6388
|
+
const effectiveDivider = divider ?? listContext.divider ?? false;
|
|
6389
|
+
if (onClick) {
|
|
6390
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6391
|
+
material.ListItemButton,
|
|
6392
|
+
{
|
|
6393
|
+
...otherProps,
|
|
6394
|
+
dense: effectiveDense,
|
|
6395
|
+
disabled,
|
|
6396
|
+
disableGutters: effectiveDisableGutters,
|
|
6397
|
+
divider: effectiveDivider,
|
|
6398
|
+
onClick,
|
|
6399
|
+
ref,
|
|
6400
|
+
"data-name": "list-item-button",
|
|
6401
|
+
"data-variant": effectiveVariant,
|
|
6402
|
+
"data-fixed-height": effectiveFixedHeight,
|
|
6403
|
+
"data-disable-padding": effectiveDisablePadding,
|
|
6404
|
+
"data-disable-gutters": effectiveDisableGutters,
|
|
6405
|
+
"data-divider": effectiveDivider
|
|
6406
|
+
}
|
|
6407
|
+
);
|
|
6408
|
+
}
|
|
6409
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6410
|
+
material.ListItem,
|
|
6411
|
+
{
|
|
6412
|
+
...otherProps,
|
|
6413
|
+
dense: effectiveDense,
|
|
6414
|
+
disabled,
|
|
6415
|
+
disablePadding: effectiveDisablePadding,
|
|
6416
|
+
disableGutters: effectiveDisableGutters,
|
|
6417
|
+
divider: effectiveDivider,
|
|
6418
|
+
"aria-disabled": disabled,
|
|
6419
|
+
ref,
|
|
6420
|
+
"data-name": "list-item",
|
|
6421
|
+
"data-variant": effectiveVariant,
|
|
6422
|
+
"data-fixed-height": effectiveFixedHeight,
|
|
6423
|
+
"data-disable-padding": effectiveDisablePadding,
|
|
6424
|
+
"data-disable-gutters": effectiveDisableGutters,
|
|
6425
|
+
"data-divider": effectiveDivider
|
|
6426
|
+
}
|
|
6427
|
+
);
|
|
6428
|
+
}
|
|
6429
|
+
const ListItem = React.forwardRef(_ListItem);
|
|
6430
|
+
ListItem.displayName = "ListItem";
|
|
6431
|
+
function _ListItemButton({
|
|
6432
|
+
variant,
|
|
6433
|
+
dense,
|
|
6434
|
+
disabled,
|
|
6435
|
+
fixedHeight,
|
|
6436
|
+
onClick,
|
|
6437
|
+
disablePadding,
|
|
6438
|
+
disableGutters,
|
|
6439
|
+
divider,
|
|
6440
|
+
...otherProps
|
|
6441
|
+
}, ref) {
|
|
6442
|
+
const listContext = React.useContext(ListContext);
|
|
6443
|
+
const effectiveVariant = variant ?? listContext.variant ?? "standard";
|
|
6444
|
+
const effectiveDense = dense ?? listContext.dense ?? true;
|
|
6445
|
+
const effectiveFixedHeight = fixedHeight ?? listContext.fixedHeight ?? true;
|
|
6446
|
+
const effectiveDisableGutters = disableGutters ?? listContext.disableGutters ?? false;
|
|
6447
|
+
const effectiveDisablePadding = disablePadding ?? listContext.disablePadding ?? false;
|
|
6448
|
+
const effectiveDivider = divider ?? listContext.divider ?? false;
|
|
6449
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6450
|
+
material.ListItemButton,
|
|
6451
|
+
{
|
|
6452
|
+
...otherProps,
|
|
6453
|
+
dense: effectiveDense,
|
|
6454
|
+
disabled,
|
|
6455
|
+
disableGutters: effectiveDisableGutters,
|
|
6456
|
+
divider: effectiveDivider,
|
|
6457
|
+
onClick,
|
|
6458
|
+
ref,
|
|
6459
|
+
"data-name": "list-item-button",
|
|
6460
|
+
"data-variant": effectiveVariant,
|
|
6461
|
+
"data-fixed-height": effectiveFixedHeight,
|
|
6462
|
+
"data-disable-padding": effectiveDisablePadding,
|
|
6463
|
+
"data-disable-gutters": effectiveDisableGutters,
|
|
6464
|
+
"data-divider": effectiveDivider
|
|
6465
|
+
}
|
|
6466
|
+
);
|
|
6467
|
+
}
|
|
6468
|
+
const ListItemButton = React.forwardRef(_ListItemButton);
|
|
6469
|
+
ListItemButton.displayName = "ListItemButton";
|
|
6470
|
+
function ListItemRightContent({
|
|
6471
|
+
children,
|
|
6472
|
+
...props
|
|
6473
|
+
}) {
|
|
6474
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6475
|
+
material.Stack,
|
|
6476
|
+
{
|
|
6477
|
+
direction: "row",
|
|
6478
|
+
alignItems: "center",
|
|
6479
|
+
gap: 1.5,
|
|
6480
|
+
...props,
|
|
6481
|
+
"data-name": "list-item-right-content",
|
|
6482
|
+
children
|
|
6483
|
+
}
|
|
6484
|
+
);
|
|
6485
|
+
}
|
|
6486
|
+
function _ListSubheader({
|
|
6487
|
+
backgroundColor = "paper",
|
|
6488
|
+
dense,
|
|
6489
|
+
disableGutters,
|
|
6490
|
+
...otherProps
|
|
6491
|
+
}, ref) {
|
|
6492
|
+
const listContext = React.useContext(ListContext);
|
|
6493
|
+
const effectiveDense = dense ?? listContext.dense ?? true;
|
|
6494
|
+
const effectiveDisableGutters = disableGutters ?? listContext.disableGutters ?? false;
|
|
6495
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6496
|
+
material.ListSubheader,
|
|
6497
|
+
{
|
|
6498
|
+
...otherProps,
|
|
6499
|
+
ref,
|
|
6500
|
+
disableGutters: effectiveDisableGutters,
|
|
6501
|
+
"data-name": "list-subheader",
|
|
6502
|
+
"data-background-color": backgroundColor,
|
|
6503
|
+
"data-dense": effectiveDense,
|
|
6504
|
+
"data-disable-gutters": effectiveDisableGutters
|
|
6505
|
+
}
|
|
6506
|
+
);
|
|
6507
|
+
}
|
|
6508
|
+
const ListSubheader = React.forwardRef(_ListSubheader);
|
|
6266
6509
|
exports.IconButton = cssUtils.IconButton;
|
|
6267
6510
|
exports.TablePaginationActions = cssUtils.TablePaginationActions;
|
|
6268
6511
|
exports.Typography = cssUtils.Typography;
|
|
@@ -6308,6 +6551,11 @@ exports.EmptyState = EmptyState;
|
|
|
6308
6551
|
exports.FilterDropdown = FilterDropdown;
|
|
6309
6552
|
exports.FilterDropdownMenuItem = FilterDropdownMenuItem;
|
|
6310
6553
|
exports.LabelWithIndicator = LabelWithIndicator;
|
|
6554
|
+
exports.List = List;
|
|
6555
|
+
exports.ListItem = ListItem;
|
|
6556
|
+
exports.ListItemButton = ListItemButton;
|
|
6557
|
+
exports.ListItemRightContent = ListItemRightContent;
|
|
6558
|
+
exports.ListSubheader = ListSubheader;
|
|
6311
6559
|
exports.Loader = Loader;
|
|
6312
6560
|
exports.Menu = Menu;
|
|
6313
6561
|
exports.MenuItemFilter = MenuItemFilter;
|
package/dist/components/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
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 as CircularProgress$1, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, Select, FormControl, InputLabel, FormHelperText, Link, Checkbox, IconButton as IconButton$1, ListItemText, Tooltip, ToggleButtonGroup as ToggleButtonGroup$1, Stack, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Snackbar as Snackbar$1, Portal, Fade } from "@mui/material";
|
|
2
|
+
import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle, createContext, useContext } from "react";
|
|
3
|
+
import { styled, Box, Button as Button$1, CircularProgress as CircularProgress$1, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, Select, FormControl, InputLabel, FormHelperText, Link, Checkbox, IconButton as IconButton$1, ListItemText, Tooltip, ToggleButtonGroup as ToggleButtonGroup$1, Stack, Autocomplete as Autocomplete$1, Divider, ListItemIcon, createFilterOptions, alpha, useTheme, AppBar as AppBar$1, Toolbar, Dialog as Dialog$1, DialogTitle as DialogTitle$1, Chip, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Slide, Accordion, AccordionSummary, AccordionDetails, Avatar as Avatar$1, Menu as Menu$2, useMediaQuery, Snackbar as Snackbar$1, Portal, Fade, List as List$2, ListItemButton as ListItemButton$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1 } from "@mui/material";
|
|
4
4
|
import { OpenInNewOutlined, VisibilityOffOutlined, VisibilityOutlined, Cancel, ContentCopyOutlined, AddCircleOutlineOutlined, MenuOutlined, MoreVertOutlined, HelpOutline, ErrorOutline, CloseOutlined, Check, TodayOutlined } from "@mui/icons-material";
|
|
5
|
-
import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL,
|
|
6
|
-
import { a } from "../css-utils-
|
|
7
|
-
import { S as ScreenReaderOnly, A as Alert$1 } from "../Alert-
|
|
8
|
-
import { L } from "../Alert-
|
|
5
|
+
import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, l as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, i as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, m as useImperativeIntl, b as ICON_SIZE_MEDIUM, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles, j as LIST_MAX_SIZE, k as LIST_OVERSCAN_ITEMS_COUNT, L as LIST_ITEM_SIZE_DENSE, h as LIST_ITEM_SIZE_DEFAULT } from "../css-utils-D9LibDjo.js";
|
|
6
|
+
import { a } from "../css-utils-D9LibDjo.js";
|
|
7
|
+
import { S as ScreenReaderOnly, A as Alert$1 } from "../Alert-BEzNSCqV.js";
|
|
8
|
+
import { L } from "../Alert-BEzNSCqV.js";
|
|
9
9
|
import { A as ArrowDown } from "../ArrowDown-d6bxUL0F.js";
|
|
10
10
|
import { A as ArrowUp, O as OpenDiagonallyRight, C as CloseDiagonallyRight } from "../OpenDiagonallyRight-CGdCEXlF.js";
|
|
11
|
-
import { M as MenuItem$1, a as getThemeColor } from "../MenuItem-
|
|
11
|
+
import { M as MenuItem$1, a as getThemeColor } from "../MenuItem-D4v_HV1x.js";
|
|
12
12
|
import "cartocolor";
|
|
13
13
|
import { FixedSizeList } from "react-window";
|
|
14
14
|
import { Controlled, UnControlled } from "react-codemirror2";
|
|
@@ -1479,7 +1479,7 @@ function useMultipleAutocomplete({
|
|
|
1479
1479
|
getCounterRenderTags
|
|
1480
1480
|
};
|
|
1481
1481
|
}
|
|
1482
|
-
const List = styled("ul")(
|
|
1482
|
+
const List$1 = styled("ul")(
|
|
1483
1483
|
({ theme, hasFilters }) => ({
|
|
1484
1484
|
...!hasFilters && {
|
|
1485
1485
|
paddingTop: `${theme.spacing(1)} !important`
|
|
@@ -1606,7 +1606,7 @@ function _AutocompleteList({
|
|
|
1606
1606
|
);
|
|
1607
1607
|
};
|
|
1608
1608
|
return /* @__PURE__ */ jsxs(
|
|
1609
|
-
List,
|
|
1609
|
+
List$1,
|
|
1610
1610
|
{
|
|
1611
1611
|
ref,
|
|
1612
1612
|
...otherProps,
|
|
@@ -4928,7 +4928,7 @@ const StyledMenu = styled(Menu$2, {
|
|
|
4928
4928
|
}
|
|
4929
4929
|
}
|
|
4930
4930
|
}));
|
|
4931
|
-
function _Menu({ extended, width, height, MenuListProps, ...otherProps }, ref) {
|
|
4931
|
+
function _Menu({ extended, width, height, MenuListProps: MenuListProps2, ...otherProps }, ref) {
|
|
4932
4932
|
return /* @__PURE__ */ jsx(
|
|
4933
4933
|
StyledMenu,
|
|
4934
4934
|
{
|
|
@@ -4939,7 +4939,7 @@ function _Menu({ extended, width, height, MenuListProps, ...otherProps }, ref) {
|
|
|
4939
4939
|
height,
|
|
4940
4940
|
extended,
|
|
4941
4941
|
MenuListProps: {
|
|
4942
|
-
...
|
|
4942
|
+
...MenuListProps2,
|
|
4943
4943
|
"data-width": width,
|
|
4944
4944
|
"data-height": height,
|
|
4945
4945
|
"data-extended": extended
|
|
@@ -6263,6 +6263,249 @@ function _EllipsisWithTooltip({
|
|
|
6263
6263
|
);
|
|
6264
6264
|
}
|
|
6265
6265
|
const EllipsisWithTooltip = forwardRef(_EllipsisWithTooltip);
|
|
6266
|
+
const ListContext = createContext({});
|
|
6267
|
+
const ListItemWrapper = styled("div")({
|
|
6268
|
+
pointerEvents: "none",
|
|
6269
|
+
"& > *": {
|
|
6270
|
+
pointerEvents: "auto"
|
|
6271
|
+
}
|
|
6272
|
+
});
|
|
6273
|
+
function _List({
|
|
6274
|
+
variant = "standard",
|
|
6275
|
+
spacing,
|
|
6276
|
+
dense,
|
|
6277
|
+
virtualized = false,
|
|
6278
|
+
virtualizedItemHeight,
|
|
6279
|
+
virtualizedListHeight = LIST_MAX_SIZE,
|
|
6280
|
+
overscanCount = LIST_OVERSCAN_ITEMS_COUNT,
|
|
6281
|
+
disableGutters = false,
|
|
6282
|
+
disablePadding = false,
|
|
6283
|
+
fixedHeight = true,
|
|
6284
|
+
divider = false,
|
|
6285
|
+
children,
|
|
6286
|
+
...otherProps
|
|
6287
|
+
}, ref) {
|
|
6288
|
+
const isBoxed = variant === "boxed";
|
|
6289
|
+
const defaultSpacing = spacing ?? (isBoxed ? 1 : 0);
|
|
6290
|
+
const contextValue = useMemo(
|
|
6291
|
+
() => ({
|
|
6292
|
+
variant,
|
|
6293
|
+
fixedHeight,
|
|
6294
|
+
dense,
|
|
6295
|
+
disableGutters,
|
|
6296
|
+
disablePadding,
|
|
6297
|
+
divider
|
|
6298
|
+
}),
|
|
6299
|
+
[variant, fixedHeight, dense, disableGutters, disablePadding, divider]
|
|
6300
|
+
);
|
|
6301
|
+
const childrenArray = useMemo(
|
|
6302
|
+
() => React.Children.toArray(children),
|
|
6303
|
+
[children]
|
|
6304
|
+
);
|
|
6305
|
+
const defaultItemHeight = virtualizedItemHeight ?? (dense || dense === void 0 ? LIST_ITEM_SIZE_DENSE : LIST_ITEM_SIZE_DEFAULT);
|
|
6306
|
+
const listHeight = useMemo(() => {
|
|
6307
|
+
const calculatedHeight = childrenArray.length * defaultItemHeight;
|
|
6308
|
+
return Math.min(calculatedHeight, virtualizedListHeight);
|
|
6309
|
+
}, [childrenArray.length, defaultItemHeight, virtualizedListHeight]);
|
|
6310
|
+
if (!virtualized) {
|
|
6311
|
+
return /* @__PURE__ */ jsx(ListContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
6312
|
+
List$2,
|
|
6313
|
+
{
|
|
6314
|
+
...otherProps,
|
|
6315
|
+
variant,
|
|
6316
|
+
spacing: defaultSpacing,
|
|
6317
|
+
dense,
|
|
6318
|
+
ref,
|
|
6319
|
+
"data-name": "list",
|
|
6320
|
+
"data-variant": variant,
|
|
6321
|
+
"data-spacing": defaultSpacing,
|
|
6322
|
+
"data-virtualized": false,
|
|
6323
|
+
"data-disable-gutters": disableGutters,
|
|
6324
|
+
"data-disable-padding": disablePadding,
|
|
6325
|
+
"data-fixed-height": fixedHeight,
|
|
6326
|
+
"data-divider": divider,
|
|
6327
|
+
children
|
|
6328
|
+
}
|
|
6329
|
+
) });
|
|
6330
|
+
}
|
|
6331
|
+
const renderItem = ({
|
|
6332
|
+
index,
|
|
6333
|
+
style
|
|
6334
|
+
}) => {
|
|
6335
|
+
const child = childrenArray[index];
|
|
6336
|
+
if (!child) return null;
|
|
6337
|
+
return /* @__PURE__ */ jsx(ListItemWrapper, { style, "data-name": "virtual-list-item", children: child });
|
|
6338
|
+
};
|
|
6339
|
+
return /* @__PURE__ */ jsx(ListContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
6340
|
+
List$2,
|
|
6341
|
+
{
|
|
6342
|
+
...otherProps,
|
|
6343
|
+
variant,
|
|
6344
|
+
spacing: defaultSpacing,
|
|
6345
|
+
dense,
|
|
6346
|
+
ref,
|
|
6347
|
+
"data-name": "virtual-list",
|
|
6348
|
+
"data-variant": variant,
|
|
6349
|
+
"data-spacing": defaultSpacing,
|
|
6350
|
+
"data-disable-gutters": disableGutters,
|
|
6351
|
+
"data-disable-padding": disablePadding,
|
|
6352
|
+
"data-fixed-height": fixedHeight,
|
|
6353
|
+
"data-virtualized": virtualized,
|
|
6354
|
+
"data-divider": divider,
|
|
6355
|
+
children: /* @__PURE__ */ jsx(
|
|
6356
|
+
FixedSizeList,
|
|
6357
|
+
{
|
|
6358
|
+
height: listHeight,
|
|
6359
|
+
width: "100%",
|
|
6360
|
+
itemCount: childrenArray.length,
|
|
6361
|
+
itemSize: defaultItemHeight,
|
|
6362
|
+
overscanCount,
|
|
6363
|
+
children: renderItem
|
|
6364
|
+
}
|
|
6365
|
+
)
|
|
6366
|
+
}
|
|
6367
|
+
) });
|
|
6368
|
+
}
|
|
6369
|
+
const List = forwardRef(_List);
|
|
6370
|
+
List.displayName = "List";
|
|
6371
|
+
function _ListItem({
|
|
6372
|
+
variant,
|
|
6373
|
+
dense,
|
|
6374
|
+
disabled,
|
|
6375
|
+
fixedHeight,
|
|
6376
|
+
onClick,
|
|
6377
|
+
disablePadding,
|
|
6378
|
+
disableGutters,
|
|
6379
|
+
divider,
|
|
6380
|
+
...otherProps
|
|
6381
|
+
}, ref) {
|
|
6382
|
+
const listContext = useContext(ListContext);
|
|
6383
|
+
const effectiveVariant = variant ?? listContext.variant ?? "standard";
|
|
6384
|
+
const effectiveDense = dense ?? listContext.dense ?? true;
|
|
6385
|
+
const effectiveFixedHeight = fixedHeight ?? listContext.fixedHeight ?? true;
|
|
6386
|
+
const effectiveDisableGutters = disableGutters ?? listContext.disableGutters ?? false;
|
|
6387
|
+
const effectiveDisablePadding = disablePadding ?? listContext.disablePadding ?? false;
|
|
6388
|
+
const effectiveDivider = divider ?? listContext.divider ?? false;
|
|
6389
|
+
if (onClick) {
|
|
6390
|
+
return /* @__PURE__ */ jsx(
|
|
6391
|
+
ListItemButton$1,
|
|
6392
|
+
{
|
|
6393
|
+
...otherProps,
|
|
6394
|
+
dense: effectiveDense,
|
|
6395
|
+
disabled,
|
|
6396
|
+
disableGutters: effectiveDisableGutters,
|
|
6397
|
+
divider: effectiveDivider,
|
|
6398
|
+
onClick,
|
|
6399
|
+
ref,
|
|
6400
|
+
"data-name": "list-item-button",
|
|
6401
|
+
"data-variant": effectiveVariant,
|
|
6402
|
+
"data-fixed-height": effectiveFixedHeight,
|
|
6403
|
+
"data-disable-padding": effectiveDisablePadding,
|
|
6404
|
+
"data-disable-gutters": effectiveDisableGutters,
|
|
6405
|
+
"data-divider": effectiveDivider
|
|
6406
|
+
}
|
|
6407
|
+
);
|
|
6408
|
+
}
|
|
6409
|
+
return /* @__PURE__ */ jsx(
|
|
6410
|
+
ListItem$1,
|
|
6411
|
+
{
|
|
6412
|
+
...otherProps,
|
|
6413
|
+
dense: effectiveDense,
|
|
6414
|
+
disabled,
|
|
6415
|
+
disablePadding: effectiveDisablePadding,
|
|
6416
|
+
disableGutters: effectiveDisableGutters,
|
|
6417
|
+
divider: effectiveDivider,
|
|
6418
|
+
"aria-disabled": disabled,
|
|
6419
|
+
ref,
|
|
6420
|
+
"data-name": "list-item",
|
|
6421
|
+
"data-variant": effectiveVariant,
|
|
6422
|
+
"data-fixed-height": effectiveFixedHeight,
|
|
6423
|
+
"data-disable-padding": effectiveDisablePadding,
|
|
6424
|
+
"data-disable-gutters": effectiveDisableGutters,
|
|
6425
|
+
"data-divider": effectiveDivider
|
|
6426
|
+
}
|
|
6427
|
+
);
|
|
6428
|
+
}
|
|
6429
|
+
const ListItem = forwardRef(_ListItem);
|
|
6430
|
+
ListItem.displayName = "ListItem";
|
|
6431
|
+
function _ListItemButton({
|
|
6432
|
+
variant,
|
|
6433
|
+
dense,
|
|
6434
|
+
disabled,
|
|
6435
|
+
fixedHeight,
|
|
6436
|
+
onClick,
|
|
6437
|
+
disablePadding,
|
|
6438
|
+
disableGutters,
|
|
6439
|
+
divider,
|
|
6440
|
+
...otherProps
|
|
6441
|
+
}, ref) {
|
|
6442
|
+
const listContext = useContext(ListContext);
|
|
6443
|
+
const effectiveVariant = variant ?? listContext.variant ?? "standard";
|
|
6444
|
+
const effectiveDense = dense ?? listContext.dense ?? true;
|
|
6445
|
+
const effectiveFixedHeight = fixedHeight ?? listContext.fixedHeight ?? true;
|
|
6446
|
+
const effectiveDisableGutters = disableGutters ?? listContext.disableGutters ?? false;
|
|
6447
|
+
const effectiveDisablePadding = disablePadding ?? listContext.disablePadding ?? false;
|
|
6448
|
+
const effectiveDivider = divider ?? listContext.divider ?? false;
|
|
6449
|
+
return /* @__PURE__ */ jsx(
|
|
6450
|
+
ListItemButton$1,
|
|
6451
|
+
{
|
|
6452
|
+
...otherProps,
|
|
6453
|
+
dense: effectiveDense,
|
|
6454
|
+
disabled,
|
|
6455
|
+
disableGutters: effectiveDisableGutters,
|
|
6456
|
+
divider: effectiveDivider,
|
|
6457
|
+
onClick,
|
|
6458
|
+
ref,
|
|
6459
|
+
"data-name": "list-item-button",
|
|
6460
|
+
"data-variant": effectiveVariant,
|
|
6461
|
+
"data-fixed-height": effectiveFixedHeight,
|
|
6462
|
+
"data-disable-padding": effectiveDisablePadding,
|
|
6463
|
+
"data-disable-gutters": effectiveDisableGutters,
|
|
6464
|
+
"data-divider": effectiveDivider
|
|
6465
|
+
}
|
|
6466
|
+
);
|
|
6467
|
+
}
|
|
6468
|
+
const ListItemButton = forwardRef(_ListItemButton);
|
|
6469
|
+
ListItemButton.displayName = "ListItemButton";
|
|
6470
|
+
function ListItemRightContent({
|
|
6471
|
+
children,
|
|
6472
|
+
...props
|
|
6473
|
+
}) {
|
|
6474
|
+
return /* @__PURE__ */ jsx(
|
|
6475
|
+
Stack,
|
|
6476
|
+
{
|
|
6477
|
+
direction: "row",
|
|
6478
|
+
alignItems: "center",
|
|
6479
|
+
gap: 1.5,
|
|
6480
|
+
...props,
|
|
6481
|
+
"data-name": "list-item-right-content",
|
|
6482
|
+
children
|
|
6483
|
+
}
|
|
6484
|
+
);
|
|
6485
|
+
}
|
|
6486
|
+
function _ListSubheader({
|
|
6487
|
+
backgroundColor = "paper",
|
|
6488
|
+
dense,
|
|
6489
|
+
disableGutters,
|
|
6490
|
+
...otherProps
|
|
6491
|
+
}, ref) {
|
|
6492
|
+
const listContext = useContext(ListContext);
|
|
6493
|
+
const effectiveDense = dense ?? listContext.dense ?? true;
|
|
6494
|
+
const effectiveDisableGutters = disableGutters ?? listContext.disableGutters ?? false;
|
|
6495
|
+
return /* @__PURE__ */ jsx(
|
|
6496
|
+
ListSubheader$1,
|
|
6497
|
+
{
|
|
6498
|
+
...otherProps,
|
|
6499
|
+
ref,
|
|
6500
|
+
disableGutters: effectiveDisableGutters,
|
|
6501
|
+
"data-name": "list-subheader",
|
|
6502
|
+
"data-background-color": backgroundColor,
|
|
6503
|
+
"data-dense": effectiveDense,
|
|
6504
|
+
"data-disable-gutters": effectiveDisableGutters
|
|
6505
|
+
}
|
|
6506
|
+
);
|
|
6507
|
+
}
|
|
6508
|
+
const ListSubheader = forwardRef(_ListSubheader);
|
|
6266
6509
|
export {
|
|
6267
6510
|
AUTOCOMPLETE_GROUP_HEADER_PROPERTY,
|
|
6268
6511
|
AccordionGroup,
|
|
@@ -6305,6 +6548,11 @@ export {
|
|
|
6305
6548
|
IconButton,
|
|
6306
6549
|
LabelWithIndicator,
|
|
6307
6550
|
L as Link,
|
|
6551
|
+
List,
|
|
6552
|
+
ListItem,
|
|
6553
|
+
ListItemButton,
|
|
6554
|
+
ListItemRightContent,
|
|
6555
|
+
ListSubheader,
|
|
6308
6556
|
Loader,
|
|
6309
6557
|
Menu,
|
|
6310
6558
|
MenuItem$1 as MenuItem,
|