@carto/meridian-ds 1.5.0-alpha-virtual-autocomplete.2 → 1.5.0-alpha.split
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 +0 -1
- package/dist/{Alert-BzEgeyQJ.cjs → Alert-BiOR9aar.cjs} +1 -1
- package/dist/{Alert-CnaTtNJd.js → Alert-CywtIMOj.js} +1 -1
- package/dist/{MenuItem-lAxlHrDp.cjs → MenuItem-Br2jY2lt.cjs} +5 -9
- package/dist/{MenuItem-D6wJym7Z.js → MenuItem-CXnnE5lK.js} +5 -9
- package/dist/{TablePaginationActions-mbbjzV6Y.cjs → TablePaginationActions-CFGXm44W.cjs} +0 -8
- package/dist/{TablePaginationActions-Cz5Hbi6N.js → TablePaginationActions-KpTvhN4Y.js} +1 -9
- package/dist/components/index.cjs +35 -196
- package/dist/components/index.js +37 -198
- package/dist/theme/index.cjs +9 -13
- package/dist/theme/index.js +10 -14
- package/dist/types/components/molecules/Autocomplete/CreatableAutocomplete.d.ts +1 -1
- package/dist/types/components/molecules/Autocomplete/CreatableAutocomplete.d.ts.map +1 -1
- package/dist/types/components/molecules/Autocomplete/ListBoxWithFilter.d.ts +3 -21
- package/dist/types/components/molecules/Autocomplete/ListBoxWithFilter.d.ts.map +1 -1
- package/dist/types/components/molecules/Autocomplete/MultipleAutocomplete.d.ts +1 -1
- package/dist/types/components/molecules/Autocomplete/MultipleAutocomplete.d.ts.map +1 -1
- package/dist/types/components/molecules/Autocomplete/index.d.ts +0 -1
- package/dist/types/components/molecules/Autocomplete/index.d.ts.map +1 -1
- package/dist/types/components/molecules/Autocomplete/types.d.ts +7 -59
- package/dist/types/components/molecules/Autocomplete/types.d.ts.map +1 -1
- package/dist/types/components/molecules/Autocomplete/useMultipleAutocomplete.d.ts +1 -26
- package/dist/types/components/molecules/Autocomplete/useMultipleAutocomplete.d.ts.map +1 -1
- package/dist/types/components/molecules/Autocomplete/utils.d.ts +0 -49
- package/dist/types/components/molecules/Autocomplete/utils.d.ts.map +1 -1
- package/dist/types/components/molecules/Menu/Menu.d.ts.map +1 -1
- package/dist/types/components/molecules/Menu/MenuItem.d.ts.map +1 -1
- package/dist/types/components/molecules/Menu/MenuItemFilter.d.ts.map +1 -1
- package/dist/types/components/molecules/Menu/MenuList.d.ts.map +1 -1
- package/dist/types/components/molecules/MultipleSelectField/MultipleSelectField.d.ts.map +1 -1
- package/dist/types/theme/sections/components/forms.d.ts.map +1 -1
- package/dist/types/theme/sections/components/navigation.d.ts.map +1 -1
- package/dist/types/theme/theme-constants.d.ts +0 -4
- package/dist/types/theme/theme-constants.d.ts.map +1 -1
- package/dist/widgets/index.cjs +2 -2
- package/dist/widgets/index.js +2 -2
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -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-CFGXm44W.cjs");
|
|
6
6
|
const Option = material.styled("div")(({ theme }) => ({
|
|
7
7
|
position: "relative",
|
|
8
8
|
display: "inline-flex",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState } from "react";
|
|
3
3
|
import { styled, IconButton as IconButton$1, Tooltip, CircularProgress, Alert as Alert$1, Fade, AlertTitle } from "@mui/material";
|
|
4
|
-
import { b as ICON_SIZE_MEDIUM, T as Typography } from "./TablePaginationActions-
|
|
4
|
+
import { b as ICON_SIZE_MEDIUM, T as Typography } from "./TablePaginationActions-KpTvhN4Y.js";
|
|
5
5
|
const Option = styled("div")(({ theme }) => ({
|
|
6
6
|
position: "relative",
|
|
7
7
|
display: "inline-flex",
|
|
@@ -2,7 +2,6 @@
|
|
|
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-mbbjzV6Y.cjs");
|
|
6
5
|
const StyledMenuItem = material.styled(material.MenuItem, {
|
|
7
6
|
shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
|
|
8
7
|
prop
|
|
@@ -29,7 +28,7 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
29
28
|
color: theme.palette.text.secondary
|
|
30
29
|
},
|
|
31
30
|
"&.MuiMenuItem-root": {
|
|
32
|
-
minHeight:
|
|
31
|
+
minHeight: theme.spacing(3),
|
|
33
32
|
paddingTop: 0,
|
|
34
33
|
paddingBottom: 0,
|
|
35
34
|
marginTop: theme.spacing(1),
|
|
@@ -96,7 +95,7 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
96
95
|
},
|
|
97
96
|
...extended && {
|
|
98
97
|
"&.MuiButtonBase-root.MuiMenuItem-root": {
|
|
99
|
-
minHeight:
|
|
98
|
+
minHeight: theme.spacing(6)
|
|
100
99
|
}
|
|
101
100
|
},
|
|
102
101
|
...fixed && {
|
|
@@ -107,14 +106,14 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
107
106
|
bottom: 0,
|
|
108
107
|
right: 0,
|
|
109
108
|
zIndex: 2,
|
|
110
|
-
minHeight:
|
|
109
|
+
minHeight: theme.spacing(6),
|
|
111
110
|
marginBottom: theme.spacing(1),
|
|
112
111
|
padding: theme.spacing(0.5, 1.5),
|
|
113
112
|
backgroundColor: `${theme.palette.background.paper} !important`,
|
|
114
113
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
115
114
|
},
|
|
116
115
|
".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type": {
|
|
117
|
-
minHeight:
|
|
116
|
+
minHeight: theme.spacing(6),
|
|
118
117
|
marginTop: 0,
|
|
119
118
|
"&:hover": {
|
|
120
119
|
backgroundColor: theme.palette.background.paper
|
|
@@ -128,7 +127,7 @@ const StyledMenuItem = material.styled(material.MenuItem, {
|
|
|
128
127
|
},
|
|
129
128
|
...dense && {
|
|
130
129
|
"&.MuiButtonBase-root.MuiMenuItem-root": {
|
|
131
|
-
minHeight:
|
|
130
|
+
minHeight: theme.spacing(3),
|
|
132
131
|
padding: theme.spacing(0.25, 1.5)
|
|
133
132
|
}
|
|
134
133
|
}
|
|
@@ -141,7 +140,6 @@ function _MenuItem({
|
|
|
141
140
|
extended,
|
|
142
141
|
fixed,
|
|
143
142
|
iconColor = "primary",
|
|
144
|
-
dense,
|
|
145
143
|
...props
|
|
146
144
|
}, ref) {
|
|
147
145
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -154,12 +152,10 @@ function _MenuItem({
|
|
|
154
152
|
subtitle,
|
|
155
153
|
destructive,
|
|
156
154
|
extended,
|
|
157
|
-
dense,
|
|
158
155
|
fixed,
|
|
159
156
|
color: iconColor,
|
|
160
157
|
"data-destructive": destructive,
|
|
161
158
|
"data-extended": extended,
|
|
162
|
-
"data-dense": dense,
|
|
163
159
|
"data-fixed": fixed
|
|
164
160
|
}
|
|
165
161
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
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-Cz5Hbi6N.js";
|
|
5
4
|
const StyledMenuItem = styled(MenuItem$1, {
|
|
6
5
|
shouldForwardProp: (prop) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
|
|
7
6
|
prop
|
|
@@ -28,7 +27,7 @@ const StyledMenuItem = styled(MenuItem$1, {
|
|
|
28
27
|
color: theme.palette.text.secondary
|
|
29
28
|
},
|
|
30
29
|
"&.MuiMenuItem-root": {
|
|
31
|
-
minHeight:
|
|
30
|
+
minHeight: theme.spacing(3),
|
|
32
31
|
paddingTop: 0,
|
|
33
32
|
paddingBottom: 0,
|
|
34
33
|
marginTop: theme.spacing(1),
|
|
@@ -95,7 +94,7 @@ const StyledMenuItem = styled(MenuItem$1, {
|
|
|
95
94
|
},
|
|
96
95
|
...extended && {
|
|
97
96
|
"&.MuiButtonBase-root.MuiMenuItem-root": {
|
|
98
|
-
minHeight:
|
|
97
|
+
minHeight: theme.spacing(6)
|
|
99
98
|
}
|
|
100
99
|
},
|
|
101
100
|
...fixed && {
|
|
@@ -106,14 +105,14 @@ const StyledMenuItem = styled(MenuItem$1, {
|
|
|
106
105
|
bottom: 0,
|
|
107
106
|
right: 0,
|
|
108
107
|
zIndex: 2,
|
|
109
|
-
minHeight:
|
|
108
|
+
minHeight: theme.spacing(6),
|
|
110
109
|
marginBottom: theme.spacing(1),
|
|
111
110
|
padding: theme.spacing(0.5, 1.5),
|
|
112
111
|
backgroundColor: `${theme.palette.background.paper} !important`,
|
|
113
112
|
borderBottom: `1px solid ${theme.palette.divider}`
|
|
114
113
|
},
|
|
115
114
|
".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type": {
|
|
116
|
-
minHeight:
|
|
115
|
+
minHeight: theme.spacing(6),
|
|
117
116
|
marginTop: 0,
|
|
118
117
|
"&:hover": {
|
|
119
118
|
backgroundColor: theme.palette.background.paper
|
|
@@ -127,7 +126,7 @@ const StyledMenuItem = styled(MenuItem$1, {
|
|
|
127
126
|
},
|
|
128
127
|
...dense && {
|
|
129
128
|
"&.MuiButtonBase-root.MuiMenuItem-root": {
|
|
130
|
-
minHeight:
|
|
129
|
+
minHeight: theme.spacing(3),
|
|
131
130
|
padding: theme.spacing(0.25, 1.5)
|
|
132
131
|
}
|
|
133
132
|
}
|
|
@@ -140,7 +139,6 @@ function _MenuItem({
|
|
|
140
139
|
extended,
|
|
141
140
|
fixed,
|
|
142
141
|
iconColor = "primary",
|
|
143
|
-
dense,
|
|
144
142
|
...props
|
|
145
143
|
}, ref) {
|
|
146
144
|
return /* @__PURE__ */ jsx(
|
|
@@ -153,12 +151,10 @@ function _MenuItem({
|
|
|
153
151
|
subtitle,
|
|
154
152
|
destructive,
|
|
155
153
|
extended,
|
|
156
|
-
dense,
|
|
157
154
|
fixed,
|
|
158
155
|
color: iconColor,
|
|
159
156
|
"data-destructive": destructive,
|
|
160
157
|
"data-extended": extended,
|
|
161
|
-
"data-dense": dense,
|
|
162
158
|
"data-fixed": fixed
|
|
163
159
|
}
|
|
164
160
|
);
|
|
@@ -778,10 +778,6 @@ const ICON_SIZE_MEDIUM = getSpacing(2.25);
|
|
|
778
778
|
const ICON_SIZE_LARGE = getSpacing(3);
|
|
779
779
|
const APPBAR_SIZE = getSpacing(6);
|
|
780
780
|
const NOTIFICATION_DURATION_IN_MS = 6e3;
|
|
781
|
-
const MENU_LIST_MAX_SIZE = 312;
|
|
782
|
-
const MENU_ITEM_SIZE_DENSE = 24;
|
|
783
|
-
const MENU_ITEM_SIZE_DEFAULT = 32;
|
|
784
|
-
const MENU_ITEM_SIZE_EXTENDED = 48;
|
|
785
781
|
const FontWeight = {
|
|
786
782
|
regular: 400,
|
|
787
783
|
medium: 500,
|
|
@@ -5656,10 +5652,6 @@ exports.BREAKPOINTS = BREAKPOINTS;
|
|
|
5656
5652
|
exports.ICON_SIZE_LARGE = ICON_SIZE_LARGE;
|
|
5657
5653
|
exports.ICON_SIZE_MEDIUM = ICON_SIZE_MEDIUM;
|
|
5658
5654
|
exports.ICON_SIZE_SMALL = ICON_SIZE_SMALL;
|
|
5659
|
-
exports.MENU_ITEM_SIZE_DEFAULT = MENU_ITEM_SIZE_DEFAULT;
|
|
5660
|
-
exports.MENU_ITEM_SIZE_DENSE = MENU_ITEM_SIZE_DENSE;
|
|
5661
|
-
exports.MENU_ITEM_SIZE_EXTENDED = MENU_ITEM_SIZE_EXTENDED;
|
|
5662
|
-
exports.MENU_LIST_MAX_SIZE = MENU_LIST_MAX_SIZE;
|
|
5663
5655
|
exports.NOTIFICATION_DURATION_IN_MS = NOTIFICATION_DURATION_IN_MS;
|
|
5664
5656
|
exports.SPACING = SPACING;
|
|
5665
5657
|
exports.TablePaginationActions = TablePaginationActions;
|
|
@@ -777,10 +777,6 @@ const ICON_SIZE_MEDIUM = getSpacing(2.25);
|
|
|
777
777
|
const ICON_SIZE_LARGE = getSpacing(3);
|
|
778
778
|
const APPBAR_SIZE = getSpacing(6);
|
|
779
779
|
const NOTIFICATION_DURATION_IN_MS = 6e3;
|
|
780
|
-
const MENU_LIST_MAX_SIZE = 312;
|
|
781
|
-
const MENU_ITEM_SIZE_DENSE = 24;
|
|
782
|
-
const MENU_ITEM_SIZE_DEFAULT = 32;
|
|
783
|
-
const MENU_ITEM_SIZE_EXTENDED = 48;
|
|
784
780
|
const FontWeight = {
|
|
785
781
|
regular: 400,
|
|
786
782
|
medium: 500,
|
|
@@ -5654,17 +5650,13 @@ export {
|
|
|
5654
5650
|
APPBAR_SIZE as A,
|
|
5655
5651
|
BREAKPOINTS as B,
|
|
5656
5652
|
ICON_SIZE_LARGE as I,
|
|
5657
|
-
MENU_ITEM_SIZE_DEFAULT as M,
|
|
5658
5653
|
NOTIFICATION_DURATION_IN_MS as N,
|
|
5659
5654
|
SPACING as S,
|
|
5660
5655
|
Typography as T,
|
|
5661
5656
|
TablePaginationActions as a,
|
|
5662
5657
|
ICON_SIZE_MEDIUM as b,
|
|
5663
5658
|
ICON_SIZE_SMALL as c,
|
|
5664
|
-
|
|
5665
|
-
MENU_ITEM_SIZE_DENSE as e,
|
|
5666
|
-
MENU_ITEM_SIZE_EXTENDED as f,
|
|
5659
|
+
getDefaultExportFromCjs as d,
|
|
5667
5660
|
getSpacing as g,
|
|
5668
|
-
getDefaultExportFromCjs as h,
|
|
5669
5661
|
useImperativeIntl as u
|
|
5670
5662
|
};
|
|
@@ -3,15 +3,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const material = require("@mui/material");
|
|
6
|
-
const TablePaginationActions = require("../TablePaginationActions-
|
|
6
|
+
const TablePaginationActions = require("../TablePaginationActions-CFGXm44W.cjs");
|
|
7
7
|
const ArrowDown = require("../ArrowDown-8fLj23Ge.cjs");
|
|
8
8
|
const OpenDiagonallyRight = require("../OpenDiagonallyRight-CM1tojUq.cjs");
|
|
9
9
|
const reactIntl = require("react-intl");
|
|
10
10
|
const iconsMaterial = require("@mui/icons-material");
|
|
11
|
-
const Alert$1 = require("../Alert-
|
|
11
|
+
const Alert$1 = require("../Alert-BiOR9aar.cjs");
|
|
12
12
|
require("cartocolor");
|
|
13
|
-
const MenuItem = require("../MenuItem-
|
|
14
|
-
const reactWindow = require("react-window");
|
|
13
|
+
const MenuItem = require("../MenuItem-Br2jY2lt.cjs");
|
|
15
14
|
const DatePicker$1 = require("@mui/x-date-pickers/DatePicker");
|
|
16
15
|
const xDatePickers = require("@mui/x-date-pickers");
|
|
17
16
|
const TimePicker$1 = require("@mui/x-date-pickers/TimePicker");
|
|
@@ -480,10 +479,10 @@ function ToggleButtonGroup({
|
|
|
480
479
|
}
|
|
481
480
|
const StyledMenu = material.styled(material.Menu, {
|
|
482
481
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
483
|
-
})(({ extended, width, height }) => ({
|
|
482
|
+
})(({ theme, extended, width, height }) => ({
|
|
484
483
|
...extended && {
|
|
485
484
|
".MuiMenuItem-root": {
|
|
486
|
-
minHeight:
|
|
485
|
+
minHeight: theme.spacing(6)
|
|
487
486
|
}
|
|
488
487
|
},
|
|
489
488
|
...width && {
|
|
@@ -523,10 +522,10 @@ function _Menu({ extended, width, height, MenuListProps, ...otherProps }, ref) {
|
|
|
523
522
|
const Menu$1 = React.forwardRef(_Menu);
|
|
524
523
|
const StyledMenuList = material.styled(material.MenuList, {
|
|
525
524
|
shouldForwardProp: (prop) => !["extended", "width", "height"].includes(prop)
|
|
526
|
-
})(({ extended, width, height }) => ({
|
|
525
|
+
})(({ theme, extended, width, height }) => ({
|
|
527
526
|
...extended && {
|
|
528
527
|
".MuiMenuItem-root": {
|
|
529
|
-
minHeight:
|
|
528
|
+
minHeight: theme.spacing(6)
|
|
530
529
|
}
|
|
531
530
|
},
|
|
532
531
|
"&.MuiList-root": {
|
|
@@ -557,8 +556,7 @@ function _MenuList({ extended, width, height, ...otherProps }, ref) {
|
|
|
557
556
|
}
|
|
558
557
|
const MenuList = React.forwardRef(_MenuList);
|
|
559
558
|
const StyledMenuItem$1 = material.styled(MenuItem.MenuItem)(() => ({
|
|
560
|
-
marginTop: "0 !important"
|
|
561
|
-
marginBottom: "0 !important"
|
|
559
|
+
marginTop: "0 !important"
|
|
562
560
|
}));
|
|
563
561
|
const LinkFilter = material.styled(material.Link)(
|
|
564
562
|
({ disabled, theme }) => ({
|
|
@@ -798,20 +796,12 @@ function _MultipleSelectField({
|
|
|
798
796
|
},
|
|
799
797
|
children: [
|
|
800
798
|
showFilters && /* @__PURE__ */ jsxRuntime.jsx(
|
|
801
|
-
|
|
799
|
+
MenuItemFilter,
|
|
802
800
|
{
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
MenuItemFilter,
|
|
808
|
-
{
|
|
809
|
-
areAllSelected,
|
|
810
|
-
areAnySelected,
|
|
811
|
-
selectAll,
|
|
812
|
-
selectAllDisabled
|
|
813
|
-
}
|
|
814
|
-
)
|
|
801
|
+
areAllSelected,
|
|
802
|
+
areAnySelected,
|
|
803
|
+
selectAll,
|
|
804
|
+
selectAllDisabled
|
|
815
805
|
}
|
|
816
806
|
),
|
|
817
807
|
options == null ? void 0 : options.map((option) => {
|
|
@@ -1145,55 +1135,7 @@ const getDefaultOptionLabel = (option) => {
|
|
|
1145
1135
|
const createOptionWithMultiple = (option, multiple) => {
|
|
1146
1136
|
return typeof option !== "object" || option === null ? { value: option, multiple } : { ...option, multiple };
|
|
1147
1137
|
};
|
|
1148
|
-
const getDefaultLimitTagsText = (more) => /* @__PURE__ */ jsxRuntime.
|
|
1149
|
-
"+",
|
|
1150
|
-
more
|
|
1151
|
-
] });
|
|
1152
|
-
function createCounterRenderTags(formatCounter, options = [], size = "small", getOptionLabel = getDefaultOptionLabel) {
|
|
1153
|
-
const CounterRenderTags = (value) => {
|
|
1154
|
-
if (value.length === 0) {
|
|
1155
|
-
return null;
|
|
1156
|
-
}
|
|
1157
|
-
const selectedCount = value.length;
|
|
1158
|
-
const totalCount = options.length;
|
|
1159
|
-
const text = formatCounter({
|
|
1160
|
-
selectedCount,
|
|
1161
|
-
totalCount,
|
|
1162
|
-
selectedItems: value,
|
|
1163
|
-
allItems: options,
|
|
1164
|
-
getOptionLabel
|
|
1165
|
-
});
|
|
1166
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1167
|
-
TablePaginationActions.Typography,
|
|
1168
|
-
{
|
|
1169
|
-
variant: size === "small" ? "body2" : "body1",
|
|
1170
|
-
component: "span",
|
|
1171
|
-
"data-testid": "counter-tag",
|
|
1172
|
-
sx: {
|
|
1173
|
-
ml: 1
|
|
1174
|
-
},
|
|
1175
|
-
children: text
|
|
1176
|
-
}
|
|
1177
|
-
);
|
|
1178
|
-
};
|
|
1179
|
-
return CounterRenderTags;
|
|
1180
|
-
}
|
|
1181
|
-
function createCounterFormatter(counterText, allText, showSingleItemText = true) {
|
|
1182
|
-
return ({
|
|
1183
|
-
selectedCount,
|
|
1184
|
-
totalCount,
|
|
1185
|
-
selectedItems,
|
|
1186
|
-
getOptionLabel
|
|
1187
|
-
}) => {
|
|
1188
|
-
if (selectedCount === totalCount && totalCount > 0) {
|
|
1189
|
-
return allText;
|
|
1190
|
-
} else if (selectedCount === 1 && showSingleItemText) {
|
|
1191
|
-
return getOptionLabel(selectedItems[0]);
|
|
1192
|
-
} else {
|
|
1193
|
-
return `${selectedCount} ${counterText}`;
|
|
1194
|
-
}
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1138
|
+
const getDefaultLimitTagsText = (more) => /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "more-options-tag", children: `+${more}` });
|
|
1197
1139
|
function useAutocompleteRenderOption() {
|
|
1198
1140
|
const renderOption = (props, option, state, getOptionLabel, customIcon) => {
|
|
1199
1141
|
const {
|
|
@@ -1335,16 +1277,8 @@ function useMultipleAutocomplete({
|
|
|
1335
1277
|
options,
|
|
1336
1278
|
value,
|
|
1337
1279
|
onChange,
|
|
1338
|
-
getOptionLabel
|
|
1339
|
-
size,
|
|
1340
|
-
counterFormatter,
|
|
1341
|
-
counterText,
|
|
1342
|
-
allSelectedText
|
|
1280
|
+
getOptionLabel
|
|
1343
1281
|
}) {
|
|
1344
|
-
const intl = reactIntl.useIntl();
|
|
1345
|
-
const intlConfig = TablePaginationActions.useImperativeIntl(intl);
|
|
1346
|
-
const defaultCounterText = counterText || intlConfig.formatMessage({ id: "c4r.form.selected" });
|
|
1347
|
-
const defaultAllSelectedText = allSelectedText || intlConfig.formatMessage({ id: "c4r.form.allSelected" });
|
|
1348
1282
|
const [multipleValue, setMultipleValue] = React.useState(
|
|
1349
1283
|
Array.isArray(value) ? value : value ? [value] : []
|
|
1350
1284
|
);
|
|
@@ -1378,23 +1312,13 @@ function useMultipleAutocomplete({
|
|
|
1378
1312
|
getOptionLabel
|
|
1379
1313
|
);
|
|
1380
1314
|
};
|
|
1381
|
-
const getCounterRenderTags = () => {
|
|
1382
|
-
const formatter = counterFormatter || createCounterFormatter(defaultCounterText, defaultAllSelectedText);
|
|
1383
|
-
return createCounterRenderTags(
|
|
1384
|
-
formatter,
|
|
1385
|
-
options,
|
|
1386
|
-
size,
|
|
1387
|
-
getOptionLabel ? (option) => getOptionLabel(option) : void 0
|
|
1388
|
-
);
|
|
1389
|
-
};
|
|
1390
1315
|
return {
|
|
1391
1316
|
multipleValue,
|
|
1392
1317
|
allSelected,
|
|
1393
1318
|
someSelected,
|
|
1394
1319
|
handleSelectAll,
|
|
1395
1320
|
handleChange,
|
|
1396
|
-
multipleRenderOption
|
|
1397
|
-
getCounterRenderTags
|
|
1321
|
+
multipleRenderOption
|
|
1398
1322
|
};
|
|
1399
1323
|
}
|
|
1400
1324
|
function _ListboxWithFilter({
|
|
@@ -1404,50 +1328,15 @@ function _ListboxWithFilter({
|
|
|
1404
1328
|
someSelected,
|
|
1405
1329
|
handleSelectAll = () => void 0,
|
|
1406
1330
|
multiple,
|
|
1407
|
-
extended,
|
|
1408
|
-
itemHeight,
|
|
1409
|
-
maxListHeight = TablePaginationActions.MENU_LIST_MAX_SIZE,
|
|
1410
1331
|
...otherProps
|
|
1411
1332
|
}, ref) {
|
|
1412
|
-
const childrenArray = React.useMemo(() => {
|
|
1413
|
-
return React.Children.toArray(children);
|
|
1414
|
-
}, [children]);
|
|
1415
|
-
const defaultItemHeight = itemHeight ?? (extended ? TablePaginationActions.MENU_ITEM_SIZE_EXTENDED : TablePaginationActions.MENU_ITEM_SIZE_DEFAULT);
|
|
1416
|
-
const listboxHeight = React.useMemo(() => {
|
|
1417
|
-
const filterHeight = showFilters && multiple ? TablePaginationActions.MENU_ITEM_SIZE_EXTENDED : 0;
|
|
1418
|
-
const availableHeight = maxListHeight - filterHeight;
|
|
1419
|
-
const calculatedHeight = Math.min(
|
|
1420
|
-
childrenArray.length * defaultItemHeight,
|
|
1421
|
-
availableHeight
|
|
1422
|
-
);
|
|
1423
|
-
return Math.max(calculatedHeight, defaultItemHeight + 8);
|
|
1424
|
-
}, [
|
|
1425
|
-
showFilters,
|
|
1426
|
-
multiple,
|
|
1427
|
-
maxListHeight,
|
|
1428
|
-
childrenArray.length,
|
|
1429
|
-
defaultItemHeight
|
|
1430
|
-
]);
|
|
1431
|
-
const renderItem = ({
|
|
1432
|
-
index,
|
|
1433
|
-
style
|
|
1434
|
-
}) => {
|
|
1435
|
-
const child = childrenArray[index];
|
|
1436
|
-
if (!child) return null;
|
|
1437
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style, children: child });
|
|
1438
|
-
};
|
|
1439
1333
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1440
1334
|
"ul",
|
|
1441
1335
|
{
|
|
1442
1336
|
ref,
|
|
1443
1337
|
...otherProps,
|
|
1444
1338
|
role: "listbox",
|
|
1445
|
-
"data-list-height": listboxHeight,
|
|
1446
|
-
"data-item-height": defaultItemHeight,
|
|
1447
1339
|
"aria-multiselectable": multiple,
|
|
1448
|
-
style: {
|
|
1449
|
-
maxHeight: maxListHeight + defaultItemHeight
|
|
1450
|
-
},
|
|
1451
1340
|
children: [
|
|
1452
1341
|
showFilters && multiple && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1453
1342
|
MenuItemFilter,
|
|
@@ -1457,16 +1346,7 @@ function _ListboxWithFilter({
|
|
|
1457
1346
|
selectAll: handleSelectAll
|
|
1458
1347
|
}
|
|
1459
1348
|
),
|
|
1460
|
-
|
|
1461
|
-
reactWindow.FixedSizeList,
|
|
1462
|
-
{
|
|
1463
|
-
height: listboxHeight,
|
|
1464
|
-
width: "100%",
|
|
1465
|
-
itemCount: childrenArray.length,
|
|
1466
|
-
itemSize: defaultItemHeight,
|
|
1467
|
-
children: renderItem
|
|
1468
|
-
}
|
|
1469
|
-
)
|
|
1349
|
+
children
|
|
1470
1350
|
]
|
|
1471
1351
|
}
|
|
1472
1352
|
);
|
|
@@ -1481,18 +1361,10 @@ function _CreatableAutocomplete({
|
|
|
1481
1361
|
disabled,
|
|
1482
1362
|
loading,
|
|
1483
1363
|
showFilters,
|
|
1484
|
-
showCounter = false,
|
|
1485
|
-
counterFormatter,
|
|
1486
|
-
counterText,
|
|
1487
|
-
allSelectedText,
|
|
1488
1364
|
options = [],
|
|
1489
1365
|
value,
|
|
1490
1366
|
onChange,
|
|
1491
1367
|
getLimitTagsText,
|
|
1492
|
-
renderTags,
|
|
1493
|
-
itemHeight,
|
|
1494
|
-
maxListHeight,
|
|
1495
|
-
extended,
|
|
1496
1368
|
...props
|
|
1497
1369
|
}, ref) {
|
|
1498
1370
|
const { freeSolo = true, ...otherProps } = props;
|
|
@@ -1501,17 +1373,11 @@ function _CreatableAutocomplete({
|
|
|
1501
1373
|
allSelected,
|
|
1502
1374
|
someSelected,
|
|
1503
1375
|
handleSelectAll,
|
|
1504
|
-
handleChange
|
|
1505
|
-
getCounterRenderTags
|
|
1376
|
+
handleChange
|
|
1506
1377
|
} = useMultipleAutocomplete({
|
|
1507
1378
|
options,
|
|
1508
1379
|
value,
|
|
1509
|
-
onChange
|
|
1510
|
-
getOptionLabel,
|
|
1511
|
-
size: props.size,
|
|
1512
|
-
counterFormatter,
|
|
1513
|
-
counterText,
|
|
1514
|
-
allSelectedText
|
|
1380
|
+
onChange
|
|
1515
1381
|
});
|
|
1516
1382
|
const {
|
|
1517
1383
|
creatableFilterOptions,
|
|
@@ -1523,17 +1389,6 @@ function _CreatableAutocomplete({
|
|
|
1523
1389
|
newItemIcon,
|
|
1524
1390
|
multiple
|
|
1525
1391
|
});
|
|
1526
|
-
const listboxProps = {
|
|
1527
|
-
showFilters,
|
|
1528
|
-
allSelected,
|
|
1529
|
-
someSelected,
|
|
1530
|
-
handleSelectAll,
|
|
1531
|
-
multiple,
|
|
1532
|
-
itemHeight,
|
|
1533
|
-
maxListHeight,
|
|
1534
|
-
extended
|
|
1535
|
-
};
|
|
1536
|
-
const finalRenderTags = showCounter && multiple && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1537
1392
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1538
1393
|
material.Autocomplete,
|
|
1539
1394
|
{
|
|
@@ -1545,13 +1400,18 @@ function _CreatableAutocomplete({
|
|
|
1545
1400
|
filterOptions: creatableFilterOptions,
|
|
1546
1401
|
getOptionLabel: creatableOptionLabel,
|
|
1547
1402
|
renderOption: creatableRenderOption,
|
|
1548
|
-
renderTags: finalRenderTags,
|
|
1549
1403
|
freeSolo,
|
|
1550
1404
|
forcePopupIcon: true,
|
|
1551
1405
|
multiple,
|
|
1552
1406
|
disableCloseOnSelect: disableCloseOnSelect ?? multiple,
|
|
1553
1407
|
ListboxComponent: ListboxWithFilter,
|
|
1554
|
-
ListboxProps:
|
|
1408
|
+
ListboxProps: {
|
|
1409
|
+
showFilters,
|
|
1410
|
+
allSelected,
|
|
1411
|
+
someSelected,
|
|
1412
|
+
handleSelectAll,
|
|
1413
|
+
multiple
|
|
1414
|
+
},
|
|
1555
1415
|
getLimitTagsText: getLimitTagsText ?? getDefaultLimitTagsText,
|
|
1556
1416
|
disabled: disabled || loading,
|
|
1557
1417
|
popupIcon: loading ? /* @__PURE__ */ jsxRuntime.jsx(material.CircularProgress, { size: 18, color: "inherit" }) : /* @__PURE__ */ jsxRuntime.jsx(ArrowDown.ArrowDown, {}),
|
|
@@ -1566,19 +1426,11 @@ function _MultipleAutocomplete({
|
|
|
1566
1426
|
disabled,
|
|
1567
1427
|
loading,
|
|
1568
1428
|
showFilters,
|
|
1569
|
-
showCounter = false,
|
|
1570
|
-
counterFormatter,
|
|
1571
|
-
counterText,
|
|
1572
|
-
allSelectedText,
|
|
1573
1429
|
options,
|
|
1574
1430
|
value,
|
|
1575
1431
|
onChange,
|
|
1576
1432
|
getOptionLabel,
|
|
1577
1433
|
getLimitTagsText,
|
|
1578
|
-
renderTags,
|
|
1579
|
-
itemHeight,
|
|
1580
|
-
maxListHeight,
|
|
1581
|
-
extended,
|
|
1582
1434
|
...props
|
|
1583
1435
|
}, ref) {
|
|
1584
1436
|
const {
|
|
@@ -1587,29 +1439,13 @@ function _MultipleAutocomplete({
|
|
|
1587
1439
|
someSelected,
|
|
1588
1440
|
handleSelectAll,
|
|
1589
1441
|
handleChange,
|
|
1590
|
-
multipleRenderOption
|
|
1591
|
-
getCounterRenderTags
|
|
1442
|
+
multipleRenderOption
|
|
1592
1443
|
} = useMultipleAutocomplete({
|
|
1593
1444
|
options,
|
|
1594
1445
|
value,
|
|
1595
1446
|
onChange,
|
|
1596
|
-
getOptionLabel
|
|
1597
|
-
size: props.size,
|
|
1598
|
-
counterFormatter,
|
|
1599
|
-
counterText,
|
|
1600
|
-
allSelectedText
|
|
1447
|
+
getOptionLabel
|
|
1601
1448
|
});
|
|
1602
|
-
const listboxProps = {
|
|
1603
|
-
showFilters,
|
|
1604
|
-
allSelected,
|
|
1605
|
-
someSelected,
|
|
1606
|
-
handleSelectAll,
|
|
1607
|
-
multiple: true,
|
|
1608
|
-
itemHeight,
|
|
1609
|
-
maxListHeight,
|
|
1610
|
-
extended
|
|
1611
|
-
};
|
|
1612
|
-
const finalRenderTags = showCounter && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1613
1449
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1614
1450
|
material.Autocomplete,
|
|
1615
1451
|
{
|
|
@@ -1620,9 +1456,14 @@ function _MultipleAutocomplete({
|
|
|
1620
1456
|
onChange: handleChange,
|
|
1621
1457
|
getOptionLabel,
|
|
1622
1458
|
renderOption: renderOption ?? multipleRenderOption,
|
|
1623
|
-
renderTags: finalRenderTags,
|
|
1624
1459
|
ListboxComponent: ListboxWithFilter,
|
|
1625
|
-
ListboxProps:
|
|
1460
|
+
ListboxProps: {
|
|
1461
|
+
showFilters,
|
|
1462
|
+
allSelected,
|
|
1463
|
+
someSelected,
|
|
1464
|
+
handleSelectAll,
|
|
1465
|
+
multiple: true
|
|
1466
|
+
},
|
|
1626
1467
|
multiple: true,
|
|
1627
1468
|
getLimitTagsText: getLimitTagsText ?? getDefaultLimitTagsText,
|
|
1628
1469
|
disableCloseOnSelect,
|
|
@@ -4903,7 +4744,5 @@ exports.TooltipData = TooltipData;
|
|
|
4903
4744
|
exports.UploadField = UploadField;
|
|
4904
4745
|
exports.UploadFieldBase = UploadFieldBase;
|
|
4905
4746
|
exports.copyString = copyString;
|
|
4906
|
-
exports.createCounterFormatter = createCounterFormatter;
|
|
4907
|
-
exports.createCounterRenderTags = createCounterRenderTags;
|
|
4908
4747
|
exports.dialogDimensionsBySize = dialogDimensionsBySize;
|
|
4909
4748
|
exports.useCopyValue = useCopyValue;
|