@carto/meridian-ds 2.6.1-alpha-searchfield.3 → 2.6.1-alpha-searchfield.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/{Alert-BN993lHa.js → Alert-1-pacqlp.js} +2 -15
- package/dist/{Alert-CL9Y3l7D.cjs → Alert-N-6EugaP.cjs} +2 -15
- package/dist/{MenuItem-Bssr5qGq.cjs → MenuItem-BPvH70wa.cjs} +1 -1
- package/dist/{MenuItem-COajCLkS.js → MenuItem-GpTpLidu.js} +1 -1
- package/dist/components/index.cjs +305 -199
- package/dist/components/index.js +295 -189
- package/dist/{css-utils-hxI-qUxK.js → css-utils-BHYA7By_.js} +29 -13
- package/dist/{css-utils-CqIN_t7x.cjs → css-utils-DjvM17Vb.cjs} +27 -11
- package/dist/theme/index.cjs +2 -2
- package/dist/theme/index.js +3 -3
- package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts +1 -0
- package/dist/types/components/Autocomplete/AutocompleteList/AutocompleteList.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts +1 -1
- package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts +1 -26
- package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts +1 -1
- package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts +1 -1
- package/dist/types/components/Autocomplete/MultipleAutocomplete/MultipleAutocomplete.stories.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/types.d.ts +9 -0
- package/dist/types/components/Autocomplete/types.d.ts.map +1 -1
- package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts +7 -1
- package/dist/types/components/CodeArea/CodeAreaDialog/CodeAreaDialog.d.ts.map +1 -1
- package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts +5 -1
- package/dist/types/components/CodeArea/CodeAreaDialog/components/CodeAreaDialogConfirmation.d.ts.map +1 -1
- package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts +3 -1
- package/dist/types/components/CodeArea/CodeAreaFooter/CodeAreaFooter.d.ts.map +1 -1
- package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts +5 -1
- package/dist/types/components/CodeArea/CodeAreaHeader/CodeAreaHeader.d.ts.map +1 -1
- package/dist/types/components/CopiableComponent/CopiableComponent.d.ts.map +1 -1
- package/dist/types/components/CopiableInputText/CopiableInputText.d.ts +9 -3
- package/dist/types/components/CopiableInputText/CopiableInputText.d.ts.map +1 -1
- package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts +28 -3
- package/dist/types/components/CopiableInputText/CopiableInputText.stories.d.ts.map +1 -1
- package/dist/types/components/CopiableInputText/types.d.ts +4 -1
- package/dist/types/components/CopiableInputText/types.d.ts.map +1 -1
- package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts +48 -0
- package/dist/types/components/Dialog/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/components/Dialog/DialogContent/DialogContent.d.ts.map +1 -1
- package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts +2 -0
- package/dist/types/components/Dialog/DialogContent/DialogContent.test.d.ts.map +1 -0
- package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts +1 -1
- package/dist/types/components/Dialog/DialogHeader/DialogHeader.d.ts.map +1 -1
- package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts +14 -0
- package/dist/types/components/Dialog/DialogHeader/DialogHeader.stories.d.ts.map +1 -1
- package/dist/types/components/Dialog/types.d.ts +6 -0
- package/dist/types/components/Dialog/types.d.ts.map +1 -1
- package/dist/types/components/Menu/types.d.ts +1 -1
- package/dist/types/components/Menu/types.d.ts.map +1 -1
- package/dist/types/components/PasswordField/PasswordField.d.ts +10 -1
- package/dist/types/components/PasswordField/PasswordField.d.ts.map +1 -1
- package/dist/types/components/PasswordField/PasswordField.stories.d.ts +10 -1
- package/dist/types/components/PasswordField/PasswordField.stories.d.ts.map +1 -1
- package/dist/types/components/SearchField/SearchField.d.ts.map +1 -1
- package/dist/types/components/SearchField/SearchField.stories.d.ts +14 -31
- package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -1
- package/dist/types/components/SearchField/SearchField.styled.d.ts +1 -1
- package/dist/types/components/SearchField/SearchField.styled.d.ts.map +1 -1
- package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts +19 -0
- package/dist/types/components/SearchField/components/SearchFieldEndAdornment.d.ts.map +1 -0
- package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts +14 -0
- package/dist/types/components/SearchField/components/SearchFieldStartAdornment.d.ts.map +1 -0
- package/dist/types/components/SearchField/types.d.ts +45 -4
- package/dist/types/components/SearchField/types.d.ts.map +1 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts +2 -1
- package/dist/types/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/dist/types/components/Snackbar/Snackbar.stories.d.ts +15 -0
- package/dist/types/components/Snackbar/Snackbar.stories.d.ts.map +1 -1
- package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts +3 -0
- package/dist/types/components/TablePaginationActions/TablePaginationActions.d.ts.map +1 -1
- package/dist/types/components/UploadField/useFileUpload.d.ts +4 -1
- package/dist/types/components/UploadField/useFileUpload.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/components/index.js
CHANGED
|
@@ -2,14 +2,13 @@ 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
3
|
import { styled, Box, Button as Button$1, CircularProgress, 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, 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, Stack, Snackbar as Snackbar$1, Portal, Fade } 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,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { u as useTranslationWithFallback, T as Typography, c as ICON_SIZE_SMALL, i as IconButton, f as MENU_ITEM_SIZE_DENSE, d as MENU_LIST_MAX_SIZE, h as MENU_ITEM_SIZE_EXTENDED, M as MENU_ITEM_SIZE_DEFAULT, A as APPBAR_SIZE, j as useImperativeIntl, b as ICON_SIZE_MEDIUM, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-BHYA7By_.js";
|
|
6
|
+
import { a } from "../css-utils-BHYA7By_.js";
|
|
7
|
+
import { S as ScreenReaderOnly, A as Alert$1 } from "../Alert-1-pacqlp.js";
|
|
8
|
+
import { L } from "../Alert-1-pacqlp.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 {
|
|
12
|
-
import { M as MenuItem$1 } from "../MenuItem-COajCLkS.js";
|
|
11
|
+
import { M as MenuItem$1 } from "../MenuItem-GpTpLidu.js";
|
|
13
12
|
import "cartocolor";
|
|
14
13
|
import { FixedSizeList } from "react-window";
|
|
15
14
|
import { Controlled, UnControlled } from "react-codemirror2";
|
|
@@ -37,6 +36,7 @@ import "codemirror/addon/fold/indent-fold.js";
|
|
|
37
36
|
import "codemirror/addon/fold/markdown-fold.js";
|
|
38
37
|
import "codemirror/addon/fold/comment-fold.js";
|
|
39
38
|
import ClickAwayListener$1 from "@mui/material/ClickAwayListener";
|
|
39
|
+
import { useIntl } from "react-intl";
|
|
40
40
|
import { DatePicker as DatePicker$1 } from "@mui/x-date-pickers/DatePicker";
|
|
41
41
|
import { PickersDay as PickersDay$1 } from "@mui/x-date-pickers";
|
|
42
42
|
import { TimePicker as TimePicker$1 } from "@mui/x-date-pickers/TimePicker";
|
|
@@ -283,14 +283,25 @@ function _LabelWithIndicator({
|
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
285
|
const LabelWithIndicator = forwardRef(_LabelWithIndicator);
|
|
286
|
-
function _PasswordField({
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
function _PasswordField({
|
|
287
|
+
InputProps,
|
|
288
|
+
size = "small",
|
|
289
|
+
disabled,
|
|
290
|
+
showPasswordText,
|
|
291
|
+
hidePasswordText,
|
|
292
|
+
...otherProps
|
|
293
|
+
}, ref) {
|
|
294
|
+
const showPasswordLabel = useTranslationWithFallback(
|
|
295
|
+
"c4r.form.showPassword",
|
|
296
|
+
showPasswordText
|
|
297
|
+
);
|
|
298
|
+
const hidePasswordLabel = useTranslationWithFallback(
|
|
299
|
+
"c4r.form.hidePassword",
|
|
300
|
+
hidePasswordText
|
|
301
|
+
);
|
|
289
302
|
const [showPassword, setShowPassword] = useState(false);
|
|
290
303
|
const handleClickShowPassword = () => setShowPassword(!showPassword);
|
|
291
|
-
const
|
|
292
|
-
id: `c4r.form.${showPassword ? "hidePassword" : "showPassword"}`
|
|
293
|
-
});
|
|
304
|
+
const label = showPassword ? hidePasswordLabel : showPasswordLabel;
|
|
294
305
|
return /* @__PURE__ */ jsx(
|
|
295
306
|
TextField,
|
|
296
307
|
{
|
|
@@ -312,8 +323,8 @@ function _PasswordField({ InputProps, size = "small", disabled, ...otherProps },
|
|
|
312
323
|
disabled,
|
|
313
324
|
onClick: handleClickShowPassword,
|
|
314
325
|
icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOffOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOutlined, {}),
|
|
315
|
-
tooltip:
|
|
316
|
-
"aria-label":
|
|
326
|
+
tooltip: label,
|
|
327
|
+
"aria-label": label
|
|
317
328
|
}
|
|
318
329
|
) })
|
|
319
330
|
},
|
|
@@ -899,12 +910,12 @@ const _CopiableComponent = ({
|
|
|
899
910
|
...props
|
|
900
911
|
}, ref) => {
|
|
901
912
|
const [open, setOpen] = useState(false);
|
|
902
|
-
const
|
|
903
|
-
const
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
913
|
+
const _copyText = useTranslationWithFallback("c4r.button.copy", copyText);
|
|
914
|
+
const copyTooltipText = copyText === null ? null : _copyText;
|
|
915
|
+
const copySuccessMessage = useTranslationWithFallback(
|
|
916
|
+
"c4r.notifications.copiedToClipboard",
|
|
917
|
+
copiedText
|
|
918
|
+
);
|
|
908
919
|
const { copy } = useCopyValue(copyTooltipText, copySuccessMessage);
|
|
909
920
|
const handleClick = (e) => {
|
|
910
921
|
e.preventDefault();
|
|
@@ -939,7 +950,7 @@ const _CopiableComponent = ({
|
|
|
939
950
|
disabled,
|
|
940
951
|
icon: copyIcon,
|
|
941
952
|
"data-testid": dataTestId,
|
|
942
|
-
"aria-label": ariaLabel || buttonLabel || copyTooltipText
|
|
953
|
+
"aria-label": ariaLabel || buttonLabel || (copyTooltipText ?? ""),
|
|
943
954
|
sx: {
|
|
944
955
|
display: "flex"
|
|
945
956
|
}
|
|
@@ -1001,16 +1012,22 @@ function _CopiableInputText({
|
|
|
1001
1012
|
size = "small",
|
|
1002
1013
|
onFocus,
|
|
1003
1014
|
onBlur,
|
|
1015
|
+
showText: showTextProp,
|
|
1016
|
+
hideText: hideTextProp,
|
|
1004
1017
|
...rest
|
|
1005
1018
|
}, ref) {
|
|
1006
|
-
const
|
|
1007
|
-
const intlConfig = useImperativeIntl(intl);
|
|
1008
|
-
const [showText, setShowText] = useState(false);
|
|
1019
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
1009
1020
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
1010
|
-
const inputType = !password ? "text" :
|
|
1011
|
-
const showTextLabel =
|
|
1012
|
-
|
|
1013
|
-
|
|
1021
|
+
const inputType = !password ? "text" : showPassword ? "text" : "password";
|
|
1022
|
+
const showTextLabel = useTranslationWithFallback(
|
|
1023
|
+
"c4r.button.show",
|
|
1024
|
+
showTextProp
|
|
1025
|
+
);
|
|
1026
|
+
const hideTextLabel = useTranslationWithFallback(
|
|
1027
|
+
"c4r.button.hide",
|
|
1028
|
+
hideTextProp
|
|
1029
|
+
);
|
|
1030
|
+
const currentLabel = showPassword ? hideTextLabel : showTextLabel;
|
|
1014
1031
|
const handleFocus = (event) => {
|
|
1015
1032
|
setIsInputFocused(true);
|
|
1016
1033
|
onFocus == null ? void 0 : onFocus(event);
|
|
@@ -1023,11 +1040,11 @@ function _CopiableInputText({
|
|
|
1023
1040
|
IconButton,
|
|
1024
1041
|
{
|
|
1025
1042
|
edge: variant !== "standard" ? "end" : void 0,
|
|
1026
|
-
onClick: () =>
|
|
1043
|
+
onClick: () => setShowPassword(!showPassword),
|
|
1027
1044
|
size,
|
|
1028
|
-
icon:
|
|
1029
|
-
tooltip:
|
|
1030
|
-
"aria-label":
|
|
1045
|
+
icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOffOutlined, {}),
|
|
1046
|
+
tooltip: currentLabel,
|
|
1047
|
+
"aria-label": currentLabel
|
|
1031
1048
|
}
|
|
1032
1049
|
) });
|
|
1033
1050
|
return /* @__PURE__ */ jsx(
|
|
@@ -1504,6 +1521,7 @@ function _AutocompleteList({
|
|
|
1504
1521
|
extended,
|
|
1505
1522
|
itemHeight,
|
|
1506
1523
|
maxListHeight = MENU_LIST_MAX_SIZE,
|
|
1524
|
+
selectAllText,
|
|
1507
1525
|
...otherProps
|
|
1508
1526
|
}, ref) {
|
|
1509
1527
|
const childrenArray = useMemo(() => {
|
|
@@ -1579,7 +1597,8 @@ function _AutocompleteList({
|
|
|
1579
1597
|
{
|
|
1580
1598
|
areAllSelected: !!allSelected,
|
|
1581
1599
|
areAnySelected: !!someSelected,
|
|
1582
|
-
selectAll: handleSelectAll
|
|
1600
|
+
selectAll: handleSelectAll,
|
|
1601
|
+
selectAllText
|
|
1583
1602
|
}
|
|
1584
1603
|
),
|
|
1585
1604
|
/* @__PURE__ */ jsx(
|
|
@@ -1610,6 +1629,7 @@ function _CreatableAutocomplete({
|
|
|
1610
1629
|
counterFormatter,
|
|
1611
1630
|
counterText,
|
|
1612
1631
|
allSelectedText,
|
|
1632
|
+
selectAllText,
|
|
1613
1633
|
options = [],
|
|
1614
1634
|
value,
|
|
1615
1635
|
onChange,
|
|
@@ -1660,7 +1680,8 @@ function _CreatableAutocomplete({
|
|
|
1660
1680
|
multiple,
|
|
1661
1681
|
itemHeight,
|
|
1662
1682
|
maxListHeight,
|
|
1663
|
-
extended
|
|
1683
|
+
extended,
|
|
1684
|
+
selectAllText
|
|
1664
1685
|
};
|
|
1665
1686
|
const finalRenderTags = showCounter && multiple && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1666
1687
|
return /* @__PURE__ */ jsx(
|
|
@@ -1699,6 +1720,7 @@ function _MultipleAutocomplete({
|
|
|
1699
1720
|
counterFormatter,
|
|
1700
1721
|
counterText,
|
|
1701
1722
|
allSelectedText,
|
|
1723
|
+
selectAllText,
|
|
1702
1724
|
options,
|
|
1703
1725
|
value,
|
|
1704
1726
|
onChange,
|
|
@@ -1740,7 +1762,8 @@ function _MultipleAutocomplete({
|
|
|
1740
1762
|
multiple: true,
|
|
1741
1763
|
itemHeight,
|
|
1742
1764
|
maxListHeight,
|
|
1743
|
-
extended
|
|
1765
|
+
extended,
|
|
1766
|
+
selectAllText
|
|
1744
1767
|
};
|
|
1745
1768
|
const finalRenderTags = showCounter && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1746
1769
|
return /* @__PURE__ */ jsx(
|
|
@@ -1946,16 +1969,24 @@ const Footer = styled(Box, {
|
|
|
1946
1969
|
function CodeAreaFooter({
|
|
1947
1970
|
onClickFooter,
|
|
1948
1971
|
buttonFooterLabelId,
|
|
1972
|
+
buttonFooterText,
|
|
1949
1973
|
disabledButtonFooter,
|
|
1950
1974
|
withGutter = true,
|
|
1951
1975
|
showSnackbar,
|
|
1952
1976
|
onCloseSnackbar,
|
|
1953
1977
|
loading,
|
|
1954
1978
|
disabled,
|
|
1979
|
+
changesSavedText,
|
|
1955
1980
|
...props
|
|
1956
1981
|
}) {
|
|
1957
|
-
const
|
|
1958
|
-
|
|
1982
|
+
const buttonFooterLabel = useTranslationWithFallback(
|
|
1983
|
+
buttonFooterLabelId ?? "c4r.button.save",
|
|
1984
|
+
buttonFooterText
|
|
1985
|
+
);
|
|
1986
|
+
const changesSavedLabel = useTranslationWithFallback(
|
|
1987
|
+
"c4r.notifications.changesSaved",
|
|
1988
|
+
changesSavedText
|
|
1989
|
+
);
|
|
1959
1990
|
if (!onClickFooter) return null;
|
|
1960
1991
|
return /* @__PURE__ */ jsxs(
|
|
1961
1992
|
Footer,
|
|
@@ -1973,9 +2004,7 @@ function CodeAreaFooter({
|
|
|
1973
2004
|
loading,
|
|
1974
2005
|
onClick: onClickFooter,
|
|
1975
2006
|
disabled: disabled || disabledButtonFooter,
|
|
1976
|
-
children:
|
|
1977
|
-
id: buttonFooterLabelId || "c4r.button.save"
|
|
1978
|
-
})
|
|
2007
|
+
children: buttonFooterLabel
|
|
1979
2008
|
}
|
|
1980
2009
|
),
|
|
1981
2010
|
/* @__PURE__ */ jsx(
|
|
@@ -1986,9 +2015,7 @@ function CodeAreaFooter({
|
|
|
1986
2015
|
closeable: false,
|
|
1987
2016
|
autoHideDuration: 4e3,
|
|
1988
2017
|
onClose: onCloseSnackbar,
|
|
1989
|
-
children:
|
|
1990
|
-
id: "c4r.notifications.changesSaved"
|
|
1991
|
-
})
|
|
2018
|
+
children: changesSavedLabel
|
|
1992
2019
|
}
|
|
1993
2020
|
)
|
|
1994
2021
|
]
|
|
@@ -2010,10 +2037,12 @@ function CodeAreaHeader({
|
|
|
2010
2037
|
disabled,
|
|
2011
2038
|
copyValue,
|
|
2012
2039
|
onClickExpand,
|
|
2013
|
-
size
|
|
2040
|
+
size,
|
|
2041
|
+
showOptionsTooltipText,
|
|
2042
|
+
copyText,
|
|
2043
|
+
expandText,
|
|
2044
|
+
copiedText
|
|
2014
2045
|
}) {
|
|
2015
|
-
const intl = useIntl();
|
|
2016
|
-
const intlConfig = useImperativeIntl(intl);
|
|
2017
2046
|
const showExpandButton = !!onClickExpand;
|
|
2018
2047
|
const showCopyButton = copyValue !== void 0;
|
|
2019
2048
|
const showMenu = showExpandButton && showCopyButton;
|
|
@@ -2021,6 +2050,19 @@ function CodeAreaHeader({
|
|
|
2021
2050
|
const [openSnackbar, setOpenSnackbar] = useState(false);
|
|
2022
2051
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
2023
2052
|
const open = Boolean(anchorEl);
|
|
2053
|
+
const showOptionsTooltipLabel = useTranslationWithFallback(
|
|
2054
|
+
"c4r.button.showOptions",
|
|
2055
|
+
showOptionsTooltipText
|
|
2056
|
+
);
|
|
2057
|
+
const copyLabel = useTranslationWithFallback("c4r.button.copy", copyText);
|
|
2058
|
+
const expandLabel = useTranslationWithFallback(
|
|
2059
|
+
"c4r.button.expand",
|
|
2060
|
+
expandText
|
|
2061
|
+
);
|
|
2062
|
+
const copiedLabel = useTranslationWithFallback(
|
|
2063
|
+
"c4r.notifications.copiedToClipboard",
|
|
2064
|
+
copiedText
|
|
2065
|
+
);
|
|
2024
2066
|
const openDropdown = (event) => {
|
|
2025
2067
|
setAnchorEl(event.currentTarget);
|
|
2026
2068
|
};
|
|
@@ -2048,7 +2090,7 @@ function CodeAreaHeader({
|
|
|
2048
2090
|
size,
|
|
2049
2091
|
icon: /* @__PURE__ */ jsx(MoreVertOutlined, {}),
|
|
2050
2092
|
disabled,
|
|
2051
|
-
tooltip:
|
|
2093
|
+
tooltip: showOptionsTooltipLabel,
|
|
2052
2094
|
tooltipPlacement: "top",
|
|
2053
2095
|
"aria-controls": open ? "basic-menu" : void 0,
|
|
2054
2096
|
"aria-haspopup": "true",
|
|
@@ -2070,11 +2112,11 @@ function CodeAreaHeader({
|
|
|
2070
2112
|
children: [
|
|
2071
2113
|
/* @__PURE__ */ jsxs(MenuItem$1, { onClick: handleCopy, disabled, id: "copy", children: [
|
|
2072
2114
|
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ContentCopyOutlined, {}) }),
|
|
2073
|
-
/* @__PURE__ */ jsx(ListItemText, { children:
|
|
2115
|
+
/* @__PURE__ */ jsx(ListItemText, { children: copyLabel })
|
|
2074
2116
|
] }),
|
|
2075
2117
|
/* @__PURE__ */ jsxs(MenuItem$1, { onClick: onClickExpand, disabled, id: "expand", children: [
|
|
2076
2118
|
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(OpenDiagonallyRight, {}) }),
|
|
2077
|
-
/* @__PURE__ */ jsx(ListItemText, { children:
|
|
2119
|
+
/* @__PURE__ */ jsx(ListItemText, { children: expandLabel })
|
|
2078
2120
|
] })
|
|
2079
2121
|
]
|
|
2080
2122
|
}
|
|
@@ -2088,9 +2130,7 @@ function CodeAreaHeader({
|
|
|
2088
2130
|
closeable: false,
|
|
2089
2131
|
autoHideDuration: 4e3,
|
|
2090
2132
|
onClose: () => setOpenSnackbar(false),
|
|
2091
|
-
children:
|
|
2092
|
-
id: "c4r.notifications.copiedToClipboard"
|
|
2093
|
-
})
|
|
2133
|
+
children: copiedLabel
|
|
2094
2134
|
}
|
|
2095
2135
|
)
|
|
2096
2136
|
] });
|
|
@@ -2102,7 +2142,9 @@ function CodeAreaHeader({
|
|
|
2102
2142
|
disabled,
|
|
2103
2143
|
value: copyValue,
|
|
2104
2144
|
button: true,
|
|
2105
|
-
buttonProps: { size }
|
|
2145
|
+
buttonProps: { size },
|
|
2146
|
+
copyText,
|
|
2147
|
+
copiedText
|
|
2106
2148
|
}
|
|
2107
2149
|
),
|
|
2108
2150
|
showExpandButton && /* @__PURE__ */ jsx(
|
|
@@ -2113,7 +2155,7 @@ function CodeAreaHeader({
|
|
|
2113
2155
|
onClick: onClickExpand,
|
|
2114
2156
|
icon: /* @__PURE__ */ jsx(OpenDiagonallyRight, {}),
|
|
2115
2157
|
disabled,
|
|
2116
|
-
tooltip:
|
|
2158
|
+
tooltip: expandLabel,
|
|
2117
2159
|
tooltipPlacement: "top"
|
|
2118
2160
|
}
|
|
2119
2161
|
)
|
|
@@ -3162,10 +3204,13 @@ function DialogHeader({
|
|
|
3162
3204
|
secondaryActions,
|
|
3163
3205
|
"aria-label": ariaLabel,
|
|
3164
3206
|
closeIcon,
|
|
3207
|
+
closeTooltipText,
|
|
3165
3208
|
...otherProps
|
|
3166
3209
|
}) {
|
|
3167
|
-
const
|
|
3168
|
-
|
|
3210
|
+
const closeTooltipLabel = useTranslationWithFallback(
|
|
3211
|
+
"c4r.button.close",
|
|
3212
|
+
closeTooltipText
|
|
3213
|
+
);
|
|
3169
3214
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3170
3215
|
/* @__PURE__ */ jsxs(DialogTitle, { component: "div", "data-name": "dialog-header", ...otherProps, children: [
|
|
3171
3216
|
/* @__PURE__ */ jsxs(Main$1, { children: [
|
|
@@ -3185,14 +3230,7 @@ function DialogHeader({
|
|
|
3185
3230
|
] }),
|
|
3186
3231
|
/* @__PURE__ */ jsxs(ItemsWrapper$1, { children: [
|
|
3187
3232
|
secondaryActions,
|
|
3188
|
-
onClose && /* @__PURE__ */ jsx(
|
|
3189
|
-
Tooltip,
|
|
3190
|
-
{
|
|
3191
|
-
title: intlConfig.formatMessage({ id: "c4r.button.close" }),
|
|
3192
|
-
placement: "left",
|
|
3193
|
-
children: /* @__PURE__ */ jsx(IconButton$1, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsx(CloseIcon, { "data-testid": "CloseIcon" }) })
|
|
3194
|
-
}
|
|
3195
|
-
)
|
|
3233
|
+
onClose && /* @__PURE__ */ jsx(Tooltip, { title: closeTooltipLabel, placement: "left", children: /* @__PURE__ */ jsx(IconButton$1, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsx(CloseIcon, { "data-testid": "CloseIcon" }) }) })
|
|
3196
3234
|
] })
|
|
3197
3235
|
] }),
|
|
3198
3236
|
children
|
|
@@ -3201,42 +3239,56 @@ function DialogHeader({
|
|
|
3201
3239
|
] });
|
|
3202
3240
|
}
|
|
3203
3241
|
const Content$4 = styled(DialogContent$1, {
|
|
3204
|
-
shouldForwardProp: (prop) => ![
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3242
|
+
shouldForwardProp: (prop) => ![
|
|
3243
|
+
"scrollableContent",
|
|
3244
|
+
"withGutter",
|
|
3245
|
+
"withBottomGutter",
|
|
3246
|
+
"spacing"
|
|
3247
|
+
].includes(prop)
|
|
3248
|
+
})(
|
|
3249
|
+
({
|
|
3250
|
+
theme,
|
|
3251
|
+
scrollableContent,
|
|
3252
|
+
withGutter,
|
|
3253
|
+
withBottomGutter,
|
|
3254
|
+
spacing = 3
|
|
3255
|
+
}) => ({
|
|
3256
|
+
display: "flex",
|
|
3257
|
+
flexDirection: "column",
|
|
3258
|
+
gap: theme.spacing(spacing),
|
|
3259
|
+
padding: 0,
|
|
3260
|
+
...theme.typography.body2,
|
|
3261
|
+
color: theme.palette.text.secondary,
|
|
3262
|
+
".MuiAlert-root": {
|
|
3263
|
+
minHeight: "auto"
|
|
3264
|
+
},
|
|
3265
|
+
...scrollableContent && {
|
|
3266
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
3267
|
+
"+ .MuiDivider-root": {
|
|
3268
|
+
display: "none"
|
|
3269
|
+
}
|
|
3270
|
+
},
|
|
3271
|
+
...withGutter && {
|
|
3272
|
+
padding: ` ${theme.spacing(1, 2, 0)} !important`,
|
|
3273
|
+
".MuiDialog-paperFullScreen &": {
|
|
3274
|
+
padding: `${theme.spacing(2, 2, 0)} !important`
|
|
3275
|
+
}
|
|
3276
|
+
},
|
|
3277
|
+
...withBottomGutter && {
|
|
3278
|
+
paddingBottom: `${theme.spacing(3)} !important`,
|
|
3279
|
+
".MuiDialog-paperFullScreen &": {
|
|
3280
|
+
paddingBottom: `${theme.spacing(3)} !important`
|
|
3281
|
+
}
|
|
3231
3282
|
}
|
|
3232
|
-
}
|
|
3233
|
-
|
|
3283
|
+
})
|
|
3284
|
+
);
|
|
3234
3285
|
function _DialogContent({
|
|
3235
3286
|
children,
|
|
3236
3287
|
scrollableContent,
|
|
3237
3288
|
hasFooterAlert,
|
|
3238
3289
|
withGutter = true,
|
|
3239
3290
|
withBottomGutter = true,
|
|
3291
|
+
spacing,
|
|
3240
3292
|
onScroll,
|
|
3241
3293
|
...props
|
|
3242
3294
|
}, ref) {
|
|
@@ -3284,6 +3336,7 @@ function _DialogContent({
|
|
|
3284
3336
|
scrollableContent,
|
|
3285
3337
|
withGutter,
|
|
3286
3338
|
withBottomGutter: withBottomGutter && withGutter,
|
|
3339
|
+
spacing,
|
|
3287
3340
|
"data-name": "dialog-content",
|
|
3288
3341
|
...props,
|
|
3289
3342
|
children
|
|
@@ -3611,15 +3664,30 @@ function CodeAreaDialogConfirmation({
|
|
|
3611
3664
|
onClose,
|
|
3612
3665
|
onCancel,
|
|
3613
3666
|
cancelLabelId,
|
|
3667
|
+
cancelText,
|
|
3614
3668
|
cancelButton,
|
|
3615
3669
|
closeButton,
|
|
3616
3670
|
contentLabelId,
|
|
3671
|
+
contentText,
|
|
3617
3672
|
titleLabelId,
|
|
3673
|
+
titleText,
|
|
3618
3674
|
severity = "warning",
|
|
3619
|
-
content
|
|
3675
|
+
content,
|
|
3676
|
+
leaveText
|
|
3620
3677
|
}) {
|
|
3621
|
-
const
|
|
3622
|
-
|
|
3678
|
+
const titleLabel = useTranslationWithFallback(
|
|
3679
|
+
titleLabelId || "c4r.dialog.confirmation.title",
|
|
3680
|
+
titleText
|
|
3681
|
+
);
|
|
3682
|
+
const cancelLabel = useTranslationWithFallback(
|
|
3683
|
+
cancelLabelId || "c4r.button.cancel",
|
|
3684
|
+
cancelText
|
|
3685
|
+
);
|
|
3686
|
+
const leaveLabel = useTranslationWithFallback("c4r.button.leave", leaveText);
|
|
3687
|
+
const contentLabel = useTranslationWithFallback(
|
|
3688
|
+
contentLabelId || "c4r.dialog.confirmation.content",
|
|
3689
|
+
contentText
|
|
3690
|
+
);
|
|
3623
3691
|
if (!onClose || !onCancel) {
|
|
3624
3692
|
return null;
|
|
3625
3693
|
}
|
|
@@ -3628,20 +3696,12 @@ function CodeAreaDialogConfirmation({
|
|
|
3628
3696
|
{
|
|
3629
3697
|
opened: true,
|
|
3630
3698
|
severity,
|
|
3631
|
-
title:
|
|
3632
|
-
id: titleLabelId || "c4r.dialog.confirmation.title"
|
|
3633
|
-
}),
|
|
3699
|
+
title: titleLabel,
|
|
3634
3700
|
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3635
|
-
onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsx(Button, { onClick: onCancel, children:
|
|
3636
|
-
|
|
3637
|
-
}) })),
|
|
3638
|
-
onClose && (closeButton ? closeButton : /* @__PURE__ */ jsx(Button, { variant: "contained", onClick: onClose, children: intlConfig.formatMessage({
|
|
3639
|
-
id: "c4r.button.leave"
|
|
3640
|
-
}) }))
|
|
3701
|
+
onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsx(Button, { onClick: onCancel, children: cancelLabel })),
|
|
3702
|
+
onClose && (closeButton ? closeButton : /* @__PURE__ */ jsx(Button, { variant: "contained", onClick: onClose, children: leaveLabel }))
|
|
3641
3703
|
] }),
|
|
3642
|
-
children: content
|
|
3643
|
-
id: contentLabelId || "c4r.dialog.confirmation.content"
|
|
3644
|
-
})
|
|
3704
|
+
children: content ?? contentLabel
|
|
3645
3705
|
}
|
|
3646
3706
|
);
|
|
3647
3707
|
}
|
|
@@ -3658,6 +3718,7 @@ function CodeAreaDialog({
|
|
|
3658
3718
|
showConfirmation,
|
|
3659
3719
|
onCancelConfirm,
|
|
3660
3720
|
onCloseConfirm,
|
|
3721
|
+
confirmationDialogTexts,
|
|
3661
3722
|
footerProps,
|
|
3662
3723
|
saveLoading,
|
|
3663
3724
|
showSaveSnackbar,
|
|
@@ -3722,7 +3783,11 @@ function CodeAreaDialog({
|
|
|
3722
3783
|
{
|
|
3723
3784
|
onClose: onCloseConfirm ?? onClose,
|
|
3724
3785
|
onCancel: onCancelConfirm,
|
|
3725
|
-
cancelLabelId: "c4r.button.keepEditing"
|
|
3786
|
+
cancelLabelId: "c4r.button.keepEditing",
|
|
3787
|
+
titleText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.titleText,
|
|
3788
|
+
contentText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.contentText,
|
|
3789
|
+
cancelText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.cancelText,
|
|
3790
|
+
leaveText: confirmationDialogTexts == null ? void 0 : confirmationDialogTexts.leaveText
|
|
3726
3791
|
}
|
|
3727
3792
|
)
|
|
3728
3793
|
]
|
|
@@ -5006,30 +5071,32 @@ const SearchIcon = styled(Search, {
|
|
|
5006
5071
|
}
|
|
5007
5072
|
})
|
|
5008
5073
|
);
|
|
5009
|
-
const
|
|
5074
|
+
const ClearSearchIcon = styled(Cancel)(({ theme }) => ({
|
|
5010
5075
|
color: `${theme.palette.text.hint} !important`
|
|
5011
5076
|
}));
|
|
5012
5077
|
const LoadingSearchIcon = styled(CircularProgress)(({ theme }) => ({
|
|
5013
5078
|
svg: {
|
|
5014
|
-
color: theme.palette.primary.main
|
|
5079
|
+
color: `${theme.palette.primary.main} !important`
|
|
5015
5080
|
}
|
|
5016
5081
|
}));
|
|
5017
5082
|
const SearchInputAdornment = styled(InputAdornment, {
|
|
5018
5083
|
shouldForwardProp: (prop) => prop !== "minimized" && prop !== "expanded"
|
|
5019
5084
|
})(
|
|
5020
5085
|
({ theme, minimized, expanded }) => ({
|
|
5086
|
+
// Start adornment
|
|
5087
|
+
"&.MuiInputAdornment-positionStart": {
|
|
5088
|
+
marginLeft: minimized ? theme.spacing(1) : void 0
|
|
5089
|
+
},
|
|
5090
|
+
// End adornment
|
|
5021
5091
|
"&.MuiInputAdornment-positionEnd": {
|
|
5022
5092
|
minWidth: theme.spacing(4),
|
|
5023
5093
|
"&.MuiInputAdornment-sizeSmall": {
|
|
5024
5094
|
minWidth: theme.spacing(3)
|
|
5025
5095
|
}
|
|
5026
5096
|
},
|
|
5027
|
-
"&.MuiInputAdornment-positionStart": {
|
|
5028
|
-
marginLeft: minimized ? theme.spacing(1.5) : void 0
|
|
5029
|
-
},
|
|
5030
5097
|
...expanded && !minimized && {
|
|
5031
5098
|
"&.MuiInputAdornment-root": {
|
|
5032
|
-
minWidth: theme.spacing(
|
|
5099
|
+
minWidth: theme.spacing(9),
|
|
5033
5100
|
"&.MuiInputAdornment-sizeSmall": {
|
|
5034
5101
|
minWidth: theme.spacing(7)
|
|
5035
5102
|
}
|
|
@@ -5115,13 +5182,64 @@ const SearchFieldBase = styled(TextField, {
|
|
|
5115
5182
|
}
|
|
5116
5183
|
}
|
|
5117
5184
|
}));
|
|
5185
|
+
const SearchFieldEndAdornment = ({
|
|
5186
|
+
disabled,
|
|
5187
|
+
showClearButton = true,
|
|
5188
|
+
loading,
|
|
5189
|
+
size,
|
|
5190
|
+
endAdornment,
|
|
5191
|
+
clearButton,
|
|
5192
|
+
clearButtonLabel,
|
|
5193
|
+
onClear
|
|
5194
|
+
}) => {
|
|
5195
|
+
if (!showClearButton && !endAdornment && !loading) {
|
|
5196
|
+
return null;
|
|
5197
|
+
}
|
|
5198
|
+
return /* @__PURE__ */ jsx(
|
|
5199
|
+
SearchInputAdornment,
|
|
5200
|
+
{
|
|
5201
|
+
position: "end",
|
|
5202
|
+
expanded: Boolean(endAdornment && showClearButton),
|
|
5203
|
+
children: /* @__PURE__ */ jsxs(
|
|
5204
|
+
Stack,
|
|
5205
|
+
{
|
|
5206
|
+
direction: "row",
|
|
5207
|
+
spacing: 1,
|
|
5208
|
+
sx: {
|
|
5209
|
+
alignItems: "center"
|
|
5210
|
+
},
|
|
5211
|
+
children: [
|
|
5212
|
+
loading ? /* @__PURE__ */ jsx(LoadingSearchIcon, { size: ICON_SIZE_MEDIUM }) : showClearButton ? clearButton ?? /* @__PURE__ */ jsx(
|
|
5213
|
+
IconButton,
|
|
5214
|
+
{
|
|
5215
|
+
onClick: onClear,
|
|
5216
|
+
size,
|
|
5217
|
+
color: "default",
|
|
5218
|
+
disabled,
|
|
5219
|
+
tooltip: clearButtonLabel,
|
|
5220
|
+
"aria-label": String(clearButtonLabel),
|
|
5221
|
+
icon: /* @__PURE__ */ jsx(ClearSearchIcon, {})
|
|
5222
|
+
}
|
|
5223
|
+
) : null,
|
|
5224
|
+
endAdornment
|
|
5225
|
+
]
|
|
5226
|
+
}
|
|
5227
|
+
)
|
|
5228
|
+
}
|
|
5229
|
+
);
|
|
5230
|
+
};
|
|
5231
|
+
const SearchFieldStartAdornment = ({
|
|
5232
|
+
minimized,
|
|
5233
|
+
loading,
|
|
5234
|
+
startAdornment,
|
|
5235
|
+
disabled
|
|
5236
|
+
}) => {
|
|
5237
|
+
return /* @__PURE__ */ jsx(SearchInputAdornment, { position: "start", minimized, children: loading && minimized ? /* @__PURE__ */ jsx(LoadingSearchIcon, { size: ICON_SIZE_MEDIUM }) : startAdornment || /* @__PURE__ */ jsx(SearchIcon, { disabled, minimized }) });
|
|
5238
|
+
};
|
|
5118
5239
|
function _SearchField({
|
|
5119
5240
|
value,
|
|
5120
5241
|
defaultValue,
|
|
5121
5242
|
placeholder,
|
|
5122
|
-
onChange,
|
|
5123
|
-
onClick,
|
|
5124
|
-
onResetSearch,
|
|
5125
5243
|
disabled,
|
|
5126
5244
|
minimized = false,
|
|
5127
5245
|
loading = false,
|
|
@@ -5133,10 +5251,16 @@ function _SearchField({
|
|
|
5133
5251
|
endAdornment,
|
|
5134
5252
|
onFocus,
|
|
5135
5253
|
onBlur,
|
|
5254
|
+
onChange,
|
|
5255
|
+
onClick,
|
|
5256
|
+
onResetSearch,
|
|
5257
|
+
showClearButton = true,
|
|
5136
5258
|
clearButtonLabel,
|
|
5259
|
+
clearButton,
|
|
5137
5260
|
...otherProps
|
|
5138
5261
|
}, ref) {
|
|
5139
5262
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
5263
|
+
const clearButtonVisibility = !disabled && Boolean(value ?? defaultValue) && showClearButton;
|
|
5140
5264
|
const clearButtonLabelValue = useTranslationWithFallback(
|
|
5141
5265
|
"c4r.button.clear",
|
|
5142
5266
|
clearButtonLabel
|
|
@@ -5149,49 +5273,10 @@ function _SearchField({
|
|
|
5149
5273
|
setIsInputFocused(false);
|
|
5150
5274
|
onBlur == null ? void 0 : onBlur(event);
|
|
5151
5275
|
};
|
|
5152
|
-
const
|
|
5276
|
+
const handleClear = () => {
|
|
5153
5277
|
onResetSearch == null ? void 0 : onResetSearch();
|
|
5154
5278
|
onChange == null ? void 0 : onChange({ target: { value: "" } });
|
|
5155
5279
|
};
|
|
5156
|
-
const getEndAdornment = () => {
|
|
5157
|
-
const showClearButton = !disabled && (value ?? defaultValue);
|
|
5158
|
-
if (minimized) {
|
|
5159
|
-
return void 0;
|
|
5160
|
-
}
|
|
5161
|
-
const clearButtonAriaLabel = typeof clearButtonLabelValue === "string" ? clearButtonLabelValue : String(clearButtonLabelValue);
|
|
5162
|
-
return /* @__PURE__ */ jsx(
|
|
5163
|
-
SearchInputAdornment,
|
|
5164
|
-
{
|
|
5165
|
-
position: "end",
|
|
5166
|
-
expanded: Boolean(endAdornment && showClearButton),
|
|
5167
|
-
children: /* @__PURE__ */ jsxs(
|
|
5168
|
-
Stack,
|
|
5169
|
-
{
|
|
5170
|
-
direction: "row",
|
|
5171
|
-
spacing: 1,
|
|
5172
|
-
sx: {
|
|
5173
|
-
alignItems: "center"
|
|
5174
|
-
},
|
|
5175
|
-
children: [
|
|
5176
|
-
loading ? /* @__PURE__ */ jsx(LoadingSearchIcon, { size: ICON_SIZE_MEDIUM }) : !disabled && showClearButton ? /* @__PURE__ */ jsx(
|
|
5177
|
-
IconButton,
|
|
5178
|
-
{
|
|
5179
|
-
icon: /* @__PURE__ */ jsx(CancelSearchIcon, {}),
|
|
5180
|
-
onClick: handleClearText,
|
|
5181
|
-
size,
|
|
5182
|
-
color: "default",
|
|
5183
|
-
disabled,
|
|
5184
|
-
tooltip: clearButtonLabelValue,
|
|
5185
|
-
"aria-label": clearButtonAriaLabel
|
|
5186
|
-
}
|
|
5187
|
-
) : void 0,
|
|
5188
|
-
endAdornment
|
|
5189
|
-
]
|
|
5190
|
-
}
|
|
5191
|
-
)
|
|
5192
|
-
}
|
|
5193
|
-
);
|
|
5194
|
-
};
|
|
5195
5280
|
return /* @__PURE__ */ jsx(
|
|
5196
5281
|
SearchFieldBase,
|
|
5197
5282
|
{
|
|
@@ -5210,8 +5295,28 @@ function _SearchField({
|
|
|
5210
5295
|
InputProps: {
|
|
5211
5296
|
onFocus: handleFocus,
|
|
5212
5297
|
onBlur: handleBlur,
|
|
5213
|
-
startAdornment: /* @__PURE__ */ jsx(
|
|
5214
|
-
|
|
5298
|
+
startAdornment: /* @__PURE__ */ jsx(
|
|
5299
|
+
SearchFieldStartAdornment,
|
|
5300
|
+
{
|
|
5301
|
+
minimized,
|
|
5302
|
+
loading,
|
|
5303
|
+
disabled,
|
|
5304
|
+
startAdornment
|
|
5305
|
+
}
|
|
5306
|
+
),
|
|
5307
|
+
endAdornment: !minimized && /* @__PURE__ */ jsx(
|
|
5308
|
+
SearchFieldEndAdornment,
|
|
5309
|
+
{
|
|
5310
|
+
disabled,
|
|
5311
|
+
loading,
|
|
5312
|
+
showClearButton: clearButtonVisibility,
|
|
5313
|
+
clearButton,
|
|
5314
|
+
clearButtonLabel: clearButtonLabelValue,
|
|
5315
|
+
onClear: handleClear,
|
|
5316
|
+
size,
|
|
5317
|
+
endAdornment
|
|
5318
|
+
}
|
|
5319
|
+
),
|
|
5215
5320
|
...InputProps
|
|
5216
5321
|
},
|
|
5217
5322
|
inputProps: {
|
|
@@ -5331,10 +5436,13 @@ function Snackbar({
|
|
|
5331
5436
|
onClose = () => void 0,
|
|
5332
5437
|
autoWidth,
|
|
5333
5438
|
icon,
|
|
5439
|
+
closeTooltipText,
|
|
5334
5440
|
...rest
|
|
5335
5441
|
}) {
|
|
5336
|
-
const
|
|
5337
|
-
|
|
5442
|
+
const closeTooltipLabel = useTranslationWithFallback(
|
|
5443
|
+
"c4r.button.close",
|
|
5444
|
+
closeTooltipText
|
|
5445
|
+
);
|
|
5338
5446
|
const isNeutral = severity === "neutral";
|
|
5339
5447
|
const disabledIcon = icon === false || isNeutral && !icon;
|
|
5340
5448
|
const disabledAutoHide = autoHideDuration === null;
|
|
@@ -5375,9 +5483,7 @@ function Snackbar({
|
|
|
5375
5483
|
color: "default",
|
|
5376
5484
|
onClick: (e) => onClose(e, "timeout"),
|
|
5377
5485
|
icon: /* @__PURE__ */ jsx(CloseOutlined, {}),
|
|
5378
|
-
tooltip:
|
|
5379
|
-
id: "c4r.button.close"
|
|
5380
|
-
})
|
|
5486
|
+
tooltip: closeTooltipLabel
|
|
5381
5487
|
}
|
|
5382
5488
|
) })
|
|
5383
5489
|
]
|
|
@@ -5700,10 +5806,26 @@ function useFileUpload({
|
|
|
5700
5806
|
files,
|
|
5701
5807
|
multiple,
|
|
5702
5808
|
placeholder,
|
|
5703
|
-
uploadInputRef
|
|
5809
|
+
uploadInputRef,
|
|
5810
|
+
filesSelectedText,
|
|
5811
|
+
dragPlaceholderText,
|
|
5812
|
+
dragActivePlaceholderText
|
|
5704
5813
|
}) {
|
|
5705
|
-
const
|
|
5706
|
-
|
|
5814
|
+
const filesSelectedLabel = useTranslationWithFallback(
|
|
5815
|
+
"c4r.form.filesSelected",
|
|
5816
|
+
filesSelectedText,
|
|
5817
|
+
{ count: (files == null ? void 0 : files.length) ?? 0 }
|
|
5818
|
+
);
|
|
5819
|
+
const dragPlaceholderLabel = useTranslationWithFallback(
|
|
5820
|
+
"c4r.form.dragPlaceholder",
|
|
5821
|
+
dragPlaceholderText,
|
|
5822
|
+
{ count: multiple ? 0 : 1 }
|
|
5823
|
+
);
|
|
5824
|
+
const dragActivePlaceholderLabel = useTranslationWithFallback(
|
|
5825
|
+
"c4r.form.dragActivePlaceholder",
|
|
5826
|
+
dragActivePlaceholderText,
|
|
5827
|
+
{ count: multiple ? 0 : 1 }
|
|
5828
|
+
);
|
|
5707
5829
|
const [filesText, setFilesText] = useState("");
|
|
5708
5830
|
const [dragOver, setDragOver] = useState(false);
|
|
5709
5831
|
useEffect(() => {
|
|
@@ -5712,14 +5834,9 @@ function useFileUpload({
|
|
|
5712
5834
|
} else if (files.length === 1) {
|
|
5713
5835
|
setFilesText(files[0].name);
|
|
5714
5836
|
} else {
|
|
5715
|
-
setFilesText(
|
|
5716
|
-
intlConfig.formatMessage(
|
|
5717
|
-
{ id: "c4r.form.filesSelected" },
|
|
5718
|
-
{ count: files.length }
|
|
5719
|
-
)
|
|
5720
|
-
);
|
|
5837
|
+
setFilesText(filesSelectedLabel);
|
|
5721
5838
|
}
|
|
5722
|
-
}, [files,
|
|
5839
|
+
}, [files, filesSelectedLabel]);
|
|
5723
5840
|
const handleBrowse = () => {
|
|
5724
5841
|
var _a;
|
|
5725
5842
|
(_a = uploadInputRef.current) == null ? void 0 : _a.click();
|
|
@@ -5759,22 +5876,11 @@ function useFileUpload({
|
|
|
5759
5876
|
onChange == null ? void 0 : onChange([]);
|
|
5760
5877
|
};
|
|
5761
5878
|
const getPlaceholder = useMemo(() => {
|
|
5762
|
-
const defaultPlaceholder = intlConfig.formatMessage(
|
|
5763
|
-
{ id: `c4r.form.dragPlaceholder` },
|
|
5764
|
-
{ count: multiple ? 0 : 1 }
|
|
5765
|
-
);
|
|
5766
|
-
const dragPlaceholder = intlConfig.formatMessage(
|
|
5767
|
-
{ id: `c4r.form.dragActivePlaceholder` },
|
|
5768
|
-
{ count: multiple ? 0 : 1 }
|
|
5769
|
-
);
|
|
5770
|
-
let placeholderText = "";
|
|
5771
5879
|
if (dragOver) {
|
|
5772
|
-
|
|
5773
|
-
} else {
|
|
5774
|
-
placeholderText = placeholder ?? defaultPlaceholder;
|
|
5880
|
+
return dragActivePlaceholderLabel;
|
|
5775
5881
|
}
|
|
5776
|
-
return
|
|
5777
|
-
}, [dragOver,
|
|
5882
|
+
return placeholder ?? dragPlaceholderLabel;
|
|
5883
|
+
}, [dragOver, placeholder, dragPlaceholderLabel, dragActivePlaceholderLabel]);
|
|
5778
5884
|
const inputEvents = {
|
|
5779
5885
|
onDragOver: handleDragOver,
|
|
5780
5886
|
onDragLeave: handleDragLeave,
|