@carto/meridian-ds 2.6.0 → 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 +13 -0
- package/dist/{Alert-DHd9hCGz.js → Alert-1-pacqlp.js} +3 -13
- package/dist/{Alert-DOeOwxOe.cjs → Alert-N-6EugaP.cjs} +2 -12
- package/dist/{MenuItem-CYJN2OVU.cjs → MenuItem-BPvH70wa.cjs} +1 -1
- package/dist/{MenuItem-MUmADf3e.js → MenuItem-GpTpLidu.js} +1 -1
- package/dist/{SwatchSquare-CaaLsjAC.js → Search-C7wkXu3f.js} +4 -23
- package/dist/{SwatchSquare-B8PIY3Rd.cjs → Search-CMWbM9nD.cjs} +3 -22
- package/dist/SwatchSquare-B6KYVoqV.js +24 -0
- package/dist/SwatchSquare-DuXPIL7t.cjs +23 -0
- package/dist/components/index.cjs +557 -169
- package/dist/components/index.js +557 -169
- package/dist/{css-utils-WejOmkiI.js → css-utils-BHYA7By_.js} +32 -13
- package/dist/{css-utils-CCi3p7os.cjs → css-utils-DjvM17Vb.cjs} +30 -11
- package/dist/custom-icons/index.cjs +643 -558
- package/dist/custom-icons/index.js +643 -558
- package/dist/theme/index.cjs +14 -4
- package/dist/theme/index.js +15 -5
- 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 -1
- package/dist/types/components/Autocomplete/CreatableAutocomplete/CreatableAutocomplete.stories.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/CreatableAutocomplete/useCreatableAutocomplete.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/MultipleAutocomplete/useMultipleAutocomplete.d.ts.map +1 -1
- package/dist/types/components/Autocomplete/types.d.ts +13 -1
- 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/CopiableComponent/CopiableComponent.stories.d.ts +3 -0
- package/dist/types/components/CopiableComponent/CopiableComponent.stories.d.ts.map +1 -1
- package/dist/types/components/CopiableComponent/types.d.ts +8 -1
- package/dist/types/components/CopiableComponent/types.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/FilterDropdown/FilterDropdown.d.ts +1 -1
- package/dist/types/components/FilterDropdown/FilterDropdown.d.ts.map +1 -1
- package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts +48 -0
- package/dist/types/components/FilterDropdown/FilterDropdown.stories.d.ts.map +1 -1
- package/dist/types/components/FilterDropdown/types.d.ts +8 -0
- package/dist/types/components/FilterDropdown/types.d.ts.map +1 -1
- package/dist/types/components/Menu/MenuItemFilter/MenuItemFilter.d.ts.map +1 -1
- package/dist/types/components/Menu/types.d.ts +1 -0
- 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 +4 -0
- package/dist/types/components/SearchField/SearchField.d.ts.map +1 -0
- package/dist/types/components/SearchField/SearchField.stories.d.ts +114 -0
- package/dist/types/components/SearchField/SearchField.stories.d.ts.map +1 -0
- package/dist/types/components/SearchField/SearchField.styled.d.ts +23 -0
- package/dist/types/components/SearchField/SearchField.styled.d.ts.map +1 -0
- package/dist/types/components/SearchField/SearchField.test.d.ts +2 -0
- package/dist/types/components/SearchField/SearchField.test.d.ts.map +1 -0
- 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/index.d.ts +3 -0
- package/dist/types/components/SearchField/index.d.ts.map +1 -0
- package/dist/types/components/SearchField/types.d.ts +72 -0
- package/dist/types/components/SearchField/types.d.ts.map +1 -0
- package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.d.ts.map +1 -1
- package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts +22 -2
- package/dist/types/components/SelectField/MultipleSelectField/MultipleSelectField.stories.d.ts.map +1 -1
- package/dist/types/components/SelectField/types.d.ts +4 -0
- package/dist/types/components/SelectField/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/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/custom-icons/FoldersStackedOutlined.d.ts +4 -0
- package/dist/types/custom-icons/FoldersStackedOutlined.d.ts.map +1 -0
- package/dist/types/custom-icons/RedoAlt.d.ts +4 -0
- package/dist/types/custom-icons/RedoAlt.d.ts.map +1 -0
- package/dist/types/custom-icons/SelectFeature.d.ts.map +1 -1
- package/dist/types/custom-icons/UndoAlt.d.ts +4 -0
- package/dist/types/custom-icons/UndoAlt.d.ts.map +1 -0
- package/dist/types/custom-icons/index.d.ts +3 -0
- package/dist/types/custom-icons/index.d.ts.map +1 -1
- package/dist/types/localization/en.d.ts +1 -0
- package/dist/types/localization/en.d.ts.map +1 -1
- package/dist/types/localization/es.d.ts +1 -0
- package/dist/types/localization/es.d.ts.map +1 -1
- package/dist/types/localization/id.d.ts +1 -0
- package/dist/types/localization/id.d.ts.map +1 -1
- package/dist/types/localization/index.d.ts +3 -0
- package/dist/types/localization/index.d.ts.map +1 -1
- package/dist/types/theme/carto-theme.d.ts.map +1 -1
- package/dist/types/theme/components/layout.d.ts +3 -0
- package/dist/types/theme/components/layout.d.ts.map +1 -0
- package/dist/types/theme/components/navigation.d.ts.map +1 -1
- package/dist/types/utils/useTranslationWithFallback.d.ts +39 -0
- package/dist/types/utils/useTranslationWithFallback.d.ts.map +1 -0
- package/dist/types/utils/useTranslationWithFallback.test.d.ts +2 -0
- package/dist/types/utils/useTranslationWithFallback.test.d.ts.map +1 -0
- package/dist/widgets/index.cjs +8 -7
- package/dist/widgets/index.js +4 -3
- package/package.json +1 -1
- package/dist/types/utils/useTranslationFallback.d.ts +0 -20
- package/dist/types/utils/useTranslationFallback.d.ts.map +0 -1
- package/dist/types/utils/useTranslationFallback.test.d.ts +0 -2
- package/dist/types/utils/useTranslationFallback.test.d.ts.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { forwardRef, useState, useRef, useEffect, useMemo, createElement, Fragment as Fragment$1, useCallback, useImperativeHandle } from "react";
|
|
3
|
-
import { styled, Box, Button as Button$1, CircularProgress, Popper, Grow, Paper, ClickAwayListener, MenuList as MenuList$1, MenuItem, ButtonGroup as ButtonGroup$1, TextField, InputAdornment, 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, Snackbar as Snackbar$1, Portal, Fade } from "@mui/material";
|
|
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
|
|
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-MUmADf3e.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,10 +36,12 @@ 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";
|
|
43
43
|
import { DateTimePicker as DateTimePicker$1 } from "@mui/x-date-pickers/DateTimePicker";
|
|
44
|
+
import { S as Search } from "../Search-C7wkXu3f.js";
|
|
44
45
|
import DOMPurify from "dompurify";
|
|
45
46
|
const IndicatorIcon = styled(Box)({
|
|
46
47
|
position: "absolute",
|
|
@@ -69,7 +70,7 @@ function _Button({
|
|
|
69
70
|
"aria-describedby": ariaDescribedby,
|
|
70
71
|
...otherProps
|
|
71
72
|
}, ref) {
|
|
72
|
-
const screenReaderTextValue =
|
|
73
|
+
const screenReaderTextValue = useTranslationWithFallback(
|
|
73
74
|
"c4r.button.opensInNewTab",
|
|
74
75
|
screenReaderText
|
|
75
76
|
);
|
|
@@ -282,14 +283,25 @@ function _LabelWithIndicator({
|
|
|
282
283
|
);
|
|
283
284
|
}
|
|
284
285
|
const LabelWithIndicator = forwardRef(_LabelWithIndicator);
|
|
285
|
-
function _PasswordField({
|
|
286
|
-
|
|
287
|
-
|
|
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
|
+
);
|
|
288
302
|
const [showPassword, setShowPassword] = useState(false);
|
|
289
303
|
const handleClickShowPassword = () => setShowPassword(!showPassword);
|
|
290
|
-
const
|
|
291
|
-
id: `c4r.form.${showPassword ? "hidePassword" : "showPassword"}`
|
|
292
|
-
});
|
|
304
|
+
const label = showPassword ? hidePasswordLabel : showPasswordLabel;
|
|
293
305
|
return /* @__PURE__ */ jsx(
|
|
294
306
|
TextField,
|
|
295
307
|
{
|
|
@@ -311,8 +323,8 @@ function _PasswordField({ InputProps, size = "small", disabled, ...otherProps },
|
|
|
311
323
|
disabled,
|
|
312
324
|
onClick: handleClickShowPassword,
|
|
313
325
|
icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOffOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOutlined, {}),
|
|
314
|
-
tooltip:
|
|
315
|
-
"aria-label":
|
|
326
|
+
tooltip: label,
|
|
327
|
+
"aria-label": label
|
|
316
328
|
}
|
|
317
329
|
) })
|
|
318
330
|
},
|
|
@@ -522,11 +534,14 @@ function _MenuItemFilter({
|
|
|
522
534
|
areAnySelected,
|
|
523
535
|
selectAll,
|
|
524
536
|
selectAllDisabled,
|
|
537
|
+
selectAllText,
|
|
525
538
|
"aria-label": ariaLabel,
|
|
526
539
|
"data-testid": dataTestId
|
|
527
540
|
}, ref) {
|
|
528
|
-
const
|
|
529
|
-
|
|
541
|
+
const selectAllLabel = useTranslationWithFallback(
|
|
542
|
+
"c4r.form.selectAll",
|
|
543
|
+
selectAllText
|
|
544
|
+
);
|
|
530
545
|
return /* @__PURE__ */ jsx(
|
|
531
546
|
StyledMenuItem$1,
|
|
532
547
|
{
|
|
@@ -554,7 +569,7 @@ function _MenuItemFilter({
|
|
|
554
569
|
disabled: selectAllDisabled
|
|
555
570
|
}
|
|
556
571
|
),
|
|
557
|
-
|
|
572
|
+
selectAllLabel
|
|
558
573
|
]
|
|
559
574
|
}
|
|
560
575
|
)
|
|
@@ -601,6 +616,10 @@ function _MultipleSelectField({
|
|
|
601
616
|
selectAllDisabled,
|
|
602
617
|
tooltipPlacement,
|
|
603
618
|
variant,
|
|
619
|
+
allSelectedText,
|
|
620
|
+
noneSelectedText,
|
|
621
|
+
selectedText,
|
|
622
|
+
selectAllText,
|
|
604
623
|
...props
|
|
605
624
|
}, ref) {
|
|
606
625
|
const {
|
|
@@ -617,11 +636,19 @@ function _MultipleSelectField({
|
|
|
617
636
|
});
|
|
618
637
|
const isSmall = size === "small";
|
|
619
638
|
const paddingSize = isSmall || variant === "standard" ? 0 : 2;
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
639
|
+
const allSelectedLabel = useTranslationWithFallback(
|
|
640
|
+
"c4r.form.allSelected",
|
|
641
|
+
allSelectedText
|
|
642
|
+
);
|
|
643
|
+
const noneSelectedLabel = useTranslationWithFallback(
|
|
644
|
+
"c4r.form.noneSelected",
|
|
645
|
+
noneSelectedText
|
|
646
|
+
);
|
|
647
|
+
const selectedLabel = useTranslationWithFallback(
|
|
648
|
+
"c4r.form.selected",
|
|
649
|
+
selectedText
|
|
650
|
+
);
|
|
651
|
+
const counterText = `${currentOptions.length} ${selectedLabel}`;
|
|
625
652
|
const renderValue = useMemo(() => {
|
|
626
653
|
if (areAllSelected) {
|
|
627
654
|
return /* @__PURE__ */ jsx(
|
|
@@ -631,7 +658,7 @@ function _MultipleSelectField({
|
|
|
631
658
|
variant: isSmall ? "body2" : "body1",
|
|
632
659
|
color: "textPrimary",
|
|
633
660
|
ml: paddingSize,
|
|
634
|
-
children:
|
|
661
|
+
children: allSelectedLabel
|
|
635
662
|
}
|
|
636
663
|
);
|
|
637
664
|
}
|
|
@@ -654,16 +681,17 @@ function _MultipleSelectField({
|
|
|
654
681
|
variant: isSmall ? "body2" : "body1",
|
|
655
682
|
color: "text.hint",
|
|
656
683
|
ml: paddingSize,
|
|
657
|
-
children: placeholder ??
|
|
684
|
+
children: placeholder ?? noneSelectedLabel
|
|
658
685
|
}
|
|
659
686
|
);
|
|
660
687
|
}, [
|
|
661
688
|
areAllSelected,
|
|
662
689
|
areAnySelected,
|
|
690
|
+
allSelectedLabel,
|
|
663
691
|
counterText,
|
|
664
692
|
currentOptions,
|
|
665
|
-
intlConfig,
|
|
666
693
|
isSmall,
|
|
694
|
+
noneSelectedLabel,
|
|
667
695
|
paddingSize,
|
|
668
696
|
placeholder,
|
|
669
697
|
showCounter
|
|
@@ -704,7 +732,8 @@ function _MultipleSelectField({
|
|
|
704
732
|
areAllSelected,
|
|
705
733
|
areAnySelected,
|
|
706
734
|
selectAll,
|
|
707
|
-
selectAllDisabled
|
|
735
|
+
selectAllDisabled,
|
|
736
|
+
selectAllText
|
|
708
737
|
}
|
|
709
738
|
)
|
|
710
739
|
}
|
|
@@ -871,19 +900,22 @@ const _CopiableComponent = ({
|
|
|
871
900
|
copiedText,
|
|
872
901
|
button,
|
|
873
902
|
buttonLabel,
|
|
903
|
+
buttonIcon,
|
|
874
904
|
buttonProps,
|
|
875
905
|
ariaLabel,
|
|
876
906
|
dataTestId,
|
|
877
907
|
tooltipPlacement = "top",
|
|
908
|
+
tooltipProps,
|
|
909
|
+
snackbarProps,
|
|
878
910
|
...props
|
|
879
911
|
}, ref) => {
|
|
880
912
|
const [open, setOpen] = useState(false);
|
|
881
|
-
const
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
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
|
+
);
|
|
887
919
|
const { copy } = useCopyValue(copyTooltipText, copySuccessMessage);
|
|
888
920
|
const handleClick = (e) => {
|
|
889
921
|
e.preventDefault();
|
|
@@ -892,6 +924,7 @@ const _CopiableComponent = ({
|
|
|
892
924
|
setOpen(true);
|
|
893
925
|
}).catch(console.error);
|
|
894
926
|
};
|
|
927
|
+
const copyIcon = buttonIcon ?? /* @__PURE__ */ jsx(ContentCopyOutlined, {});
|
|
895
928
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
896
929
|
/* @__PURE__ */ jsx(
|
|
897
930
|
Tooltip,
|
|
@@ -899,6 +932,7 @@ const _CopiableComponent = ({
|
|
|
899
932
|
title: copyTooltipText,
|
|
900
933
|
leaveDelay: 0,
|
|
901
934
|
placement: tooltipPlacement,
|
|
935
|
+
...tooltipProps,
|
|
902
936
|
children: /* @__PURE__ */ jsxs(
|
|
903
937
|
Box,
|
|
904
938
|
{
|
|
@@ -914,9 +948,9 @@ const _CopiableComponent = ({
|
|
|
914
948
|
{
|
|
915
949
|
...buttonProps,
|
|
916
950
|
disabled,
|
|
917
|
-
icon:
|
|
951
|
+
icon: copyIcon,
|
|
918
952
|
"data-testid": dataTestId,
|
|
919
|
-
"aria-label": ariaLabel || buttonLabel || copyTooltipText
|
|
953
|
+
"aria-label": ariaLabel || buttonLabel || (copyTooltipText ?? ""),
|
|
920
954
|
sx: {
|
|
921
955
|
display: "flex"
|
|
922
956
|
}
|
|
@@ -930,10 +964,11 @@ const _CopiableComponent = ({
|
|
|
930
964
|
/* @__PURE__ */ jsx(
|
|
931
965
|
Snackbar,
|
|
932
966
|
{
|
|
933
|
-
open,
|
|
934
967
|
autoWidth: true,
|
|
935
968
|
closeable: false,
|
|
936
969
|
autoHideDuration: 4e3,
|
|
970
|
+
...snackbarProps,
|
|
971
|
+
open,
|
|
937
972
|
onClose: () => setOpen(false),
|
|
938
973
|
children: copySuccessMessage
|
|
939
974
|
}
|
|
@@ -977,16 +1012,22 @@ function _CopiableInputText({
|
|
|
977
1012
|
size = "small",
|
|
978
1013
|
onFocus,
|
|
979
1014
|
onBlur,
|
|
1015
|
+
showText: showTextProp,
|
|
1016
|
+
hideText: hideTextProp,
|
|
980
1017
|
...rest
|
|
981
1018
|
}, ref) {
|
|
982
|
-
const
|
|
983
|
-
const intlConfig = useImperativeIntl(intl);
|
|
984
|
-
const [showText, setShowText] = useState(false);
|
|
1019
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
985
1020
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
986
|
-
const inputType = !password ? "text" :
|
|
987
|
-
const showTextLabel =
|
|
988
|
-
|
|
989
|
-
|
|
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;
|
|
990
1031
|
const handleFocus = (event) => {
|
|
991
1032
|
setIsInputFocused(true);
|
|
992
1033
|
onFocus == null ? void 0 : onFocus(event);
|
|
@@ -999,11 +1040,11 @@ function _CopiableInputText({
|
|
|
999
1040
|
IconButton,
|
|
1000
1041
|
{
|
|
1001
1042
|
edge: variant !== "standard" ? "end" : void 0,
|
|
1002
|
-
onClick: () =>
|
|
1043
|
+
onClick: () => setShowPassword(!showPassword),
|
|
1003
1044
|
size,
|
|
1004
|
-
icon:
|
|
1005
|
-
tooltip:
|
|
1006
|
-
"aria-label":
|
|
1045
|
+
icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOffOutlined, {}),
|
|
1046
|
+
tooltip: currentLabel,
|
|
1047
|
+
"aria-label": currentLabel
|
|
1007
1048
|
}
|
|
1008
1049
|
) });
|
|
1009
1050
|
return /* @__PURE__ */ jsx(
|
|
@@ -1273,10 +1314,12 @@ function useCreatableAutocomplete({
|
|
|
1273
1314
|
newItemIcon,
|
|
1274
1315
|
multiple
|
|
1275
1316
|
}) {
|
|
1276
|
-
const intl = useIntl();
|
|
1277
|
-
const intlConfig = useImperativeIntl(intl);
|
|
1278
1317
|
const filter = createFilterOptions();
|
|
1279
1318
|
const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
|
|
1319
|
+
const addLabel = useTranslationWithFallback(
|
|
1320
|
+
"c4r.form.add",
|
|
1321
|
+
typeof newItemLabel === "string" ? newItemLabel : void 0
|
|
1322
|
+
);
|
|
1280
1323
|
const creatableFilterOptions = (options, params) => {
|
|
1281
1324
|
const filtered = filter(
|
|
1282
1325
|
options,
|
|
@@ -1290,10 +1333,8 @@ function useCreatableAutocomplete({
|
|
|
1290
1333
|
let newItemText;
|
|
1291
1334
|
if (typeof newItemLabel === "function") {
|
|
1292
1335
|
newItemText = newItemLabel(inputValue);
|
|
1293
|
-
} else if (newItemLabel) {
|
|
1294
|
-
newItemText = `${newItemLabel} "${inputValue}"`;
|
|
1295
1336
|
} else {
|
|
1296
|
-
newItemText = `${
|
|
1337
|
+
newItemText = `${addLabel} "${inputValue}"`;
|
|
1297
1338
|
}
|
|
1298
1339
|
filtered.push({
|
|
1299
1340
|
inputValue,
|
|
@@ -1338,14 +1379,18 @@ function useMultipleAutocomplete({
|
|
|
1338
1379
|
counterText,
|
|
1339
1380
|
allSelectedText
|
|
1340
1381
|
}) {
|
|
1341
|
-
const intl = useIntl();
|
|
1342
|
-
const intlConfig = useImperativeIntl(intl);
|
|
1343
|
-
const defaultCounterText = counterText || intlConfig.formatMessage({ id: "c4r.form.selected" });
|
|
1344
|
-
const defaultAllSelectedText = allSelectedText || intlConfig.formatMessage({ id: "c4r.form.allSelected" });
|
|
1345
1382
|
const [multipleValue, setMultipleValue] = useState(
|
|
1346
1383
|
Array.isArray(value) ? value : value ? [value] : []
|
|
1347
1384
|
);
|
|
1348
1385
|
const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
|
|
1386
|
+
const defaultCounterText = useTranslationWithFallback(
|
|
1387
|
+
"c4r.form.selected",
|
|
1388
|
+
counterText
|
|
1389
|
+
);
|
|
1390
|
+
const defaultAllSelectedText = useTranslationWithFallback(
|
|
1391
|
+
"c4r.form.allSelected",
|
|
1392
|
+
allSelectedText
|
|
1393
|
+
);
|
|
1349
1394
|
useEffect(() => {
|
|
1350
1395
|
const newValue = Array.isArray(value) ? value : value ? [value] : [];
|
|
1351
1396
|
setMultipleValue(newValue);
|
|
@@ -1476,6 +1521,7 @@ function _AutocompleteList({
|
|
|
1476
1521
|
extended,
|
|
1477
1522
|
itemHeight,
|
|
1478
1523
|
maxListHeight = MENU_LIST_MAX_SIZE,
|
|
1524
|
+
selectAllText,
|
|
1479
1525
|
...otherProps
|
|
1480
1526
|
}, ref) {
|
|
1481
1527
|
const childrenArray = useMemo(() => {
|
|
@@ -1551,7 +1597,8 @@ function _AutocompleteList({
|
|
|
1551
1597
|
{
|
|
1552
1598
|
areAllSelected: !!allSelected,
|
|
1553
1599
|
areAnySelected: !!someSelected,
|
|
1554
|
-
selectAll: handleSelectAll
|
|
1600
|
+
selectAll: handleSelectAll,
|
|
1601
|
+
selectAllText
|
|
1555
1602
|
}
|
|
1556
1603
|
),
|
|
1557
1604
|
/* @__PURE__ */ jsx(
|
|
@@ -1582,6 +1629,7 @@ function _CreatableAutocomplete({
|
|
|
1582
1629
|
counterFormatter,
|
|
1583
1630
|
counterText,
|
|
1584
1631
|
allSelectedText,
|
|
1632
|
+
selectAllText,
|
|
1585
1633
|
options = [],
|
|
1586
1634
|
value,
|
|
1587
1635
|
onChange,
|
|
@@ -1632,7 +1680,8 @@ function _CreatableAutocomplete({
|
|
|
1632
1680
|
multiple,
|
|
1633
1681
|
itemHeight,
|
|
1634
1682
|
maxListHeight,
|
|
1635
|
-
extended
|
|
1683
|
+
extended,
|
|
1684
|
+
selectAllText
|
|
1636
1685
|
};
|
|
1637
1686
|
const finalRenderTags = showCounter && multiple && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1638
1687
|
return /* @__PURE__ */ jsx(
|
|
@@ -1671,6 +1720,7 @@ function _MultipleAutocomplete({
|
|
|
1671
1720
|
counterFormatter,
|
|
1672
1721
|
counterText,
|
|
1673
1722
|
allSelectedText,
|
|
1723
|
+
selectAllText,
|
|
1674
1724
|
options,
|
|
1675
1725
|
value,
|
|
1676
1726
|
onChange,
|
|
@@ -1712,7 +1762,8 @@ function _MultipleAutocomplete({
|
|
|
1712
1762
|
multiple: true,
|
|
1713
1763
|
itemHeight,
|
|
1714
1764
|
maxListHeight,
|
|
1715
|
-
extended
|
|
1765
|
+
extended,
|
|
1766
|
+
selectAllText
|
|
1716
1767
|
};
|
|
1717
1768
|
const finalRenderTags = showCounter && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1718
1769
|
return /* @__PURE__ */ jsx(
|
|
@@ -1918,16 +1969,24 @@ const Footer = styled(Box, {
|
|
|
1918
1969
|
function CodeAreaFooter({
|
|
1919
1970
|
onClickFooter,
|
|
1920
1971
|
buttonFooterLabelId,
|
|
1972
|
+
buttonFooterText,
|
|
1921
1973
|
disabledButtonFooter,
|
|
1922
1974
|
withGutter = true,
|
|
1923
1975
|
showSnackbar,
|
|
1924
1976
|
onCloseSnackbar,
|
|
1925
1977
|
loading,
|
|
1926
1978
|
disabled,
|
|
1979
|
+
changesSavedText,
|
|
1927
1980
|
...props
|
|
1928
1981
|
}) {
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1982
|
+
const buttonFooterLabel = useTranslationWithFallback(
|
|
1983
|
+
buttonFooterLabelId ?? "c4r.button.save",
|
|
1984
|
+
buttonFooterText
|
|
1985
|
+
);
|
|
1986
|
+
const changesSavedLabel = useTranslationWithFallback(
|
|
1987
|
+
"c4r.notifications.changesSaved",
|
|
1988
|
+
changesSavedText
|
|
1989
|
+
);
|
|
1931
1990
|
if (!onClickFooter) return null;
|
|
1932
1991
|
return /* @__PURE__ */ jsxs(
|
|
1933
1992
|
Footer,
|
|
@@ -1945,9 +2004,7 @@ function CodeAreaFooter({
|
|
|
1945
2004
|
loading,
|
|
1946
2005
|
onClick: onClickFooter,
|
|
1947
2006
|
disabled: disabled || disabledButtonFooter,
|
|
1948
|
-
children:
|
|
1949
|
-
id: buttonFooterLabelId || "c4r.button.save"
|
|
1950
|
-
})
|
|
2007
|
+
children: buttonFooterLabel
|
|
1951
2008
|
}
|
|
1952
2009
|
),
|
|
1953
2010
|
/* @__PURE__ */ jsx(
|
|
@@ -1958,9 +2015,7 @@ function CodeAreaFooter({
|
|
|
1958
2015
|
closeable: false,
|
|
1959
2016
|
autoHideDuration: 4e3,
|
|
1960
2017
|
onClose: onCloseSnackbar,
|
|
1961
|
-
children:
|
|
1962
|
-
id: "c4r.notifications.changesSaved"
|
|
1963
|
-
})
|
|
2018
|
+
children: changesSavedLabel
|
|
1964
2019
|
}
|
|
1965
2020
|
)
|
|
1966
2021
|
]
|
|
@@ -1982,10 +2037,12 @@ function CodeAreaHeader({
|
|
|
1982
2037
|
disabled,
|
|
1983
2038
|
copyValue,
|
|
1984
2039
|
onClickExpand,
|
|
1985
|
-
size
|
|
2040
|
+
size,
|
|
2041
|
+
showOptionsTooltipText,
|
|
2042
|
+
copyText,
|
|
2043
|
+
expandText,
|
|
2044
|
+
copiedText
|
|
1986
2045
|
}) {
|
|
1987
|
-
const intl = useIntl();
|
|
1988
|
-
const intlConfig = useImperativeIntl(intl);
|
|
1989
2046
|
const showExpandButton = !!onClickExpand;
|
|
1990
2047
|
const showCopyButton = copyValue !== void 0;
|
|
1991
2048
|
const showMenu = showExpandButton && showCopyButton;
|
|
@@ -1993,6 +2050,19 @@ function CodeAreaHeader({
|
|
|
1993
2050
|
const [openSnackbar, setOpenSnackbar] = useState(false);
|
|
1994
2051
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
1995
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
|
+
);
|
|
1996
2066
|
const openDropdown = (event) => {
|
|
1997
2067
|
setAnchorEl(event.currentTarget);
|
|
1998
2068
|
};
|
|
@@ -2020,7 +2090,7 @@ function CodeAreaHeader({
|
|
|
2020
2090
|
size,
|
|
2021
2091
|
icon: /* @__PURE__ */ jsx(MoreVertOutlined, {}),
|
|
2022
2092
|
disabled,
|
|
2023
|
-
tooltip:
|
|
2093
|
+
tooltip: showOptionsTooltipLabel,
|
|
2024
2094
|
tooltipPlacement: "top",
|
|
2025
2095
|
"aria-controls": open ? "basic-menu" : void 0,
|
|
2026
2096
|
"aria-haspopup": "true",
|
|
@@ -2042,11 +2112,11 @@ function CodeAreaHeader({
|
|
|
2042
2112
|
children: [
|
|
2043
2113
|
/* @__PURE__ */ jsxs(MenuItem$1, { onClick: handleCopy, disabled, id: "copy", children: [
|
|
2044
2114
|
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ContentCopyOutlined, {}) }),
|
|
2045
|
-
/* @__PURE__ */ jsx(ListItemText, { children:
|
|
2115
|
+
/* @__PURE__ */ jsx(ListItemText, { children: copyLabel })
|
|
2046
2116
|
] }),
|
|
2047
2117
|
/* @__PURE__ */ jsxs(MenuItem$1, { onClick: onClickExpand, disabled, id: "expand", children: [
|
|
2048
2118
|
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(OpenDiagonallyRight, {}) }),
|
|
2049
|
-
/* @__PURE__ */ jsx(ListItemText, { children:
|
|
2119
|
+
/* @__PURE__ */ jsx(ListItemText, { children: expandLabel })
|
|
2050
2120
|
] })
|
|
2051
2121
|
]
|
|
2052
2122
|
}
|
|
@@ -2060,9 +2130,7 @@ function CodeAreaHeader({
|
|
|
2060
2130
|
closeable: false,
|
|
2061
2131
|
autoHideDuration: 4e3,
|
|
2062
2132
|
onClose: () => setOpenSnackbar(false),
|
|
2063
|
-
children:
|
|
2064
|
-
id: "c4r.notifications.copiedToClipboard"
|
|
2065
|
-
})
|
|
2133
|
+
children: copiedLabel
|
|
2066
2134
|
}
|
|
2067
2135
|
)
|
|
2068
2136
|
] });
|
|
@@ -2074,7 +2142,9 @@ function CodeAreaHeader({
|
|
|
2074
2142
|
disabled,
|
|
2075
2143
|
value: copyValue,
|
|
2076
2144
|
button: true,
|
|
2077
|
-
buttonProps: { size }
|
|
2145
|
+
buttonProps: { size },
|
|
2146
|
+
copyText,
|
|
2147
|
+
copiedText
|
|
2078
2148
|
}
|
|
2079
2149
|
),
|
|
2080
2150
|
showExpandButton && /* @__PURE__ */ jsx(
|
|
@@ -2085,7 +2155,7 @@ function CodeAreaHeader({
|
|
|
2085
2155
|
onClick: onClickExpand,
|
|
2086
2156
|
icon: /* @__PURE__ */ jsx(OpenDiagonallyRight, {}),
|
|
2087
2157
|
disabled,
|
|
2088
|
-
tooltip:
|
|
2158
|
+
tooltip: expandLabel,
|
|
2089
2159
|
tooltipPlacement: "top"
|
|
2090
2160
|
}
|
|
2091
2161
|
)
|
|
@@ -3134,10 +3204,13 @@ function DialogHeader({
|
|
|
3134
3204
|
secondaryActions,
|
|
3135
3205
|
"aria-label": ariaLabel,
|
|
3136
3206
|
closeIcon,
|
|
3207
|
+
closeTooltipText,
|
|
3137
3208
|
...otherProps
|
|
3138
3209
|
}) {
|
|
3139
|
-
const
|
|
3140
|
-
|
|
3210
|
+
const closeTooltipLabel = useTranslationWithFallback(
|
|
3211
|
+
"c4r.button.close",
|
|
3212
|
+
closeTooltipText
|
|
3213
|
+
);
|
|
3141
3214
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3142
3215
|
/* @__PURE__ */ jsxs(DialogTitle, { component: "div", "data-name": "dialog-header", ...otherProps, children: [
|
|
3143
3216
|
/* @__PURE__ */ jsxs(Main$1, { children: [
|
|
@@ -3157,14 +3230,7 @@ function DialogHeader({
|
|
|
3157
3230
|
] }),
|
|
3158
3231
|
/* @__PURE__ */ jsxs(ItemsWrapper$1, { children: [
|
|
3159
3232
|
secondaryActions,
|
|
3160
|
-
onClose && /* @__PURE__ */ jsx(
|
|
3161
|
-
Tooltip,
|
|
3162
|
-
{
|
|
3163
|
-
title: intlConfig.formatMessage({ id: "c4r.button.close" }),
|
|
3164
|
-
placement: "left",
|
|
3165
|
-
children: /* @__PURE__ */ jsx(IconButton$1, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsx(CloseIcon, { "data-testid": "CloseIcon" }) })
|
|
3166
|
-
}
|
|
3167
|
-
)
|
|
3233
|
+
onClose && /* @__PURE__ */ jsx(Tooltip, { title: closeTooltipLabel, placement: "left", children: /* @__PURE__ */ jsx(IconButton$1, { onClick: onClose, children: closeIcon || /* @__PURE__ */ jsx(CloseIcon, { "data-testid": "CloseIcon" }) }) })
|
|
3168
3234
|
] })
|
|
3169
3235
|
] }),
|
|
3170
3236
|
children
|
|
@@ -3173,42 +3239,56 @@ function DialogHeader({
|
|
|
3173
3239
|
] });
|
|
3174
3240
|
}
|
|
3175
3241
|
const Content$4 = styled(DialogContent$1, {
|
|
3176
|
-
shouldForwardProp: (prop) => ![
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
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
|
+
}
|
|
3203
3282
|
}
|
|
3204
|
-
}
|
|
3205
|
-
|
|
3283
|
+
})
|
|
3284
|
+
);
|
|
3206
3285
|
function _DialogContent({
|
|
3207
3286
|
children,
|
|
3208
3287
|
scrollableContent,
|
|
3209
3288
|
hasFooterAlert,
|
|
3210
3289
|
withGutter = true,
|
|
3211
3290
|
withBottomGutter = true,
|
|
3291
|
+
spacing,
|
|
3212
3292
|
onScroll,
|
|
3213
3293
|
...props
|
|
3214
3294
|
}, ref) {
|
|
@@ -3256,6 +3336,7 @@ function _DialogContent({
|
|
|
3256
3336
|
scrollableContent,
|
|
3257
3337
|
withGutter,
|
|
3258
3338
|
withBottomGutter: withBottomGutter && withGutter,
|
|
3339
|
+
spacing,
|
|
3259
3340
|
"data-name": "dialog-content",
|
|
3260
3341
|
...props,
|
|
3261
3342
|
children
|
|
@@ -3583,15 +3664,30 @@ function CodeAreaDialogConfirmation({
|
|
|
3583
3664
|
onClose,
|
|
3584
3665
|
onCancel,
|
|
3585
3666
|
cancelLabelId,
|
|
3667
|
+
cancelText,
|
|
3586
3668
|
cancelButton,
|
|
3587
3669
|
closeButton,
|
|
3588
3670
|
contentLabelId,
|
|
3671
|
+
contentText,
|
|
3589
3672
|
titleLabelId,
|
|
3673
|
+
titleText,
|
|
3590
3674
|
severity = "warning",
|
|
3591
|
-
content
|
|
3675
|
+
content,
|
|
3676
|
+
leaveText
|
|
3592
3677
|
}) {
|
|
3593
|
-
const
|
|
3594
|
-
|
|
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
|
+
);
|
|
3595
3691
|
if (!onClose || !onCancel) {
|
|
3596
3692
|
return null;
|
|
3597
3693
|
}
|
|
@@ -3600,20 +3696,12 @@ function CodeAreaDialogConfirmation({
|
|
|
3600
3696
|
{
|
|
3601
3697
|
opened: true,
|
|
3602
3698
|
severity,
|
|
3603
|
-
title:
|
|
3604
|
-
id: titleLabelId || "c4r.dialog.confirmation.title"
|
|
3605
|
-
}),
|
|
3699
|
+
title: titleLabel,
|
|
3606
3700
|
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3607
|
-
onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsx(Button, { onClick: onCancel, children:
|
|
3608
|
-
|
|
3609
|
-
}) })),
|
|
3610
|
-
onClose && (closeButton ? closeButton : /* @__PURE__ */ jsx(Button, { variant: "contained", onClick: onClose, children: intlConfig.formatMessage({
|
|
3611
|
-
id: "c4r.button.leave"
|
|
3612
|
-
}) }))
|
|
3701
|
+
onCancel && (cancelButton ? cancelButton : /* @__PURE__ */ jsx(Button, { onClick: onCancel, children: cancelLabel })),
|
|
3702
|
+
onClose && (closeButton ? closeButton : /* @__PURE__ */ jsx(Button, { variant: "contained", onClick: onClose, children: leaveLabel }))
|
|
3613
3703
|
] }),
|
|
3614
|
-
children: content
|
|
3615
|
-
id: contentLabelId || "c4r.dialog.confirmation.content"
|
|
3616
|
-
})
|
|
3704
|
+
children: content ?? contentLabel
|
|
3617
3705
|
}
|
|
3618
3706
|
);
|
|
3619
3707
|
}
|
|
@@ -3630,6 +3718,7 @@ function CodeAreaDialog({
|
|
|
3630
3718
|
showConfirmation,
|
|
3631
3719
|
onCancelConfirm,
|
|
3632
3720
|
onCloseConfirm,
|
|
3721
|
+
confirmationDialogTexts,
|
|
3633
3722
|
footerProps,
|
|
3634
3723
|
saveLoading,
|
|
3635
3724
|
showSaveSnackbar,
|
|
@@ -3694,7 +3783,11 @@ function CodeAreaDialog({
|
|
|
3694
3783
|
{
|
|
3695
3784
|
onClose: onCloseConfirm ?? onClose,
|
|
3696
3785
|
onCancel: onCancelConfirm,
|
|
3697
|
-
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
|
|
3698
3791
|
}
|
|
3699
3792
|
)
|
|
3700
3793
|
]
|
|
@@ -4852,6 +4945,9 @@ function _FilterDropdown({
|
|
|
4852
4945
|
responsive,
|
|
4853
4946
|
tooltipLabel,
|
|
4854
4947
|
tooltipPlacement,
|
|
4948
|
+
tooltipProps,
|
|
4949
|
+
buttonProps,
|
|
4950
|
+
iconButtonProps,
|
|
4855
4951
|
slotProps,
|
|
4856
4952
|
MenuListProps,
|
|
4857
4953
|
...props
|
|
@@ -4889,14 +4985,30 @@ function _FilterDropdown({
|
|
|
4889
4985
|
"data-color": buttonColor
|
|
4890
4986
|
};
|
|
4891
4987
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4892
|
-
/* @__PURE__ */ jsx(
|
|
4893
|
-
|
|
4988
|
+
/* @__PURE__ */ jsx(
|
|
4989
|
+
Tooltip,
|
|
4894
4990
|
{
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4991
|
+
title: tooltipLabel,
|
|
4992
|
+
placement: tooltipPlacement,
|
|
4993
|
+
...tooltipProps,
|
|
4994
|
+
children: /* @__PURE__ */ jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsx(
|
|
4995
|
+
IconButton,
|
|
4996
|
+
{
|
|
4997
|
+
...commonButtonProps,
|
|
4998
|
+
icon,
|
|
4999
|
+
...iconButtonProps
|
|
5000
|
+
}
|
|
5001
|
+
) : /* @__PURE__ */ jsx(
|
|
5002
|
+
Button,
|
|
5003
|
+
{
|
|
5004
|
+
...commonButtonProps,
|
|
5005
|
+
endIcon: isOpen ? /* @__PURE__ */ jsx(ArrowUp, {}) : /* @__PURE__ */ jsx(ArrowDown, {}),
|
|
5006
|
+
...buttonProps,
|
|
5007
|
+
children: menuLabel
|
|
5008
|
+
}
|
|
5009
|
+
) })
|
|
4898
5010
|
}
|
|
4899
|
-
)
|
|
5011
|
+
),
|
|
4900
5012
|
/* @__PURE__ */ jsxs(
|
|
4901
5013
|
Menu,
|
|
4902
5014
|
{
|
|
@@ -4946,6 +5058,280 @@ function _FilterDropdown({
|
|
|
4946
5058
|
const FilterDropdown = forwardRef(
|
|
4947
5059
|
_FilterDropdown
|
|
4948
5060
|
);
|
|
5061
|
+
const SearchIcon = styled(Search, {
|
|
5062
|
+
shouldForwardProp: (prop) => prop !== "minimized" && prop !== "disabled"
|
|
5063
|
+
})(
|
|
5064
|
+
({ theme, minimized, disabled }) => ({
|
|
5065
|
+
cursor: !disabled && minimized ? "pointer" : "inherit",
|
|
5066
|
+
width: ICON_SIZE_MEDIUM,
|
|
5067
|
+
height: ICON_SIZE_MEDIUM,
|
|
5068
|
+
path: {
|
|
5069
|
+
fillOpacity: 1,
|
|
5070
|
+
fill: disabled ? theme.palette.text.disabled : theme.palette.text.secondary
|
|
5071
|
+
}
|
|
5072
|
+
})
|
|
5073
|
+
);
|
|
5074
|
+
const ClearSearchIcon = styled(Cancel)(({ theme }) => ({
|
|
5075
|
+
color: `${theme.palette.text.hint} !important`
|
|
5076
|
+
}));
|
|
5077
|
+
const LoadingSearchIcon = styled(CircularProgress)(({ theme }) => ({
|
|
5078
|
+
svg: {
|
|
5079
|
+
color: `${theme.palette.primary.main} !important`
|
|
5080
|
+
}
|
|
5081
|
+
}));
|
|
5082
|
+
const SearchInputAdornment = styled(InputAdornment, {
|
|
5083
|
+
shouldForwardProp: (prop) => prop !== "minimized" && prop !== "expanded"
|
|
5084
|
+
})(
|
|
5085
|
+
({ theme, minimized, expanded }) => ({
|
|
5086
|
+
// Start adornment
|
|
5087
|
+
"&.MuiInputAdornment-positionStart": {
|
|
5088
|
+
marginLeft: minimized ? theme.spacing(1) : void 0
|
|
5089
|
+
},
|
|
5090
|
+
// End adornment
|
|
5091
|
+
"&.MuiInputAdornment-positionEnd": {
|
|
5092
|
+
minWidth: theme.spacing(4),
|
|
5093
|
+
"&.MuiInputAdornment-sizeSmall": {
|
|
5094
|
+
minWidth: theme.spacing(3)
|
|
5095
|
+
}
|
|
5096
|
+
},
|
|
5097
|
+
...expanded && !minimized && {
|
|
5098
|
+
"&.MuiInputAdornment-root": {
|
|
5099
|
+
minWidth: theme.spacing(9),
|
|
5100
|
+
"&.MuiInputAdornment-sizeSmall": {
|
|
5101
|
+
minWidth: theme.spacing(7)
|
|
5102
|
+
}
|
|
5103
|
+
}
|
|
5104
|
+
}
|
|
5105
|
+
})
|
|
5106
|
+
);
|
|
5107
|
+
const SearchFieldBase = styled(TextField, {
|
|
5108
|
+
shouldForwardProp: (prop) => prop !== "minimized" && prop !== "isInputFocused" && prop !== "emphasis"
|
|
5109
|
+
})(({ theme, emphasis = "filled", minimized, isInputFocused }) => ({
|
|
5110
|
+
"&.MuiTextField-root .MuiInputBase-root": {
|
|
5111
|
+
paddingRight: theme.spacing(1),
|
|
5112
|
+
transition: theme.transitions.create("width", {
|
|
5113
|
+
easing: theme.transitions.easing.easeInOut,
|
|
5114
|
+
duration: theme.transitions.duration.shortest
|
|
5115
|
+
}),
|
|
5116
|
+
"&.MuiInputBase-sizeSmall": {
|
|
5117
|
+
paddingRight: theme.spacing(0.5)
|
|
5118
|
+
},
|
|
5119
|
+
"&:before": {
|
|
5120
|
+
border: "none !important",
|
|
5121
|
+
"&:hover": {
|
|
5122
|
+
border: "none !important"
|
|
5123
|
+
}
|
|
5124
|
+
},
|
|
5125
|
+
// Input
|
|
5126
|
+
"& .MuiInputBase-input": {
|
|
5127
|
+
pointerEvents: isInputFocused ? "auto" : "none"
|
|
5128
|
+
// Fix Chrome scroll issue https://issues.chromium.org/issues/41245282
|
|
5129
|
+
},
|
|
5130
|
+
// Error state
|
|
5131
|
+
"&.Mui-error": {
|
|
5132
|
+
"&::after": {
|
|
5133
|
+
borderColor: "transparent !important"
|
|
5134
|
+
}
|
|
5135
|
+
},
|
|
5136
|
+
...minimized && {
|
|
5137
|
+
display: "flex",
|
|
5138
|
+
alignItems: "center",
|
|
5139
|
+
justifyContent: "center",
|
|
5140
|
+
padding: 0,
|
|
5141
|
+
width: theme.spacing(6),
|
|
5142
|
+
cursor: "pointer",
|
|
5143
|
+
"& .MuiInputBase-input": {
|
|
5144
|
+
display: "none"
|
|
5145
|
+
},
|
|
5146
|
+
"&.MuiInputBase-sizeSmall": {
|
|
5147
|
+
width: theme.spacing(4)
|
|
5148
|
+
}
|
|
5149
|
+
}
|
|
5150
|
+
},
|
|
5151
|
+
// Variants
|
|
5152
|
+
...emphasis === "filled" && {
|
|
5153
|
+
"& .MuiInputBase-root": {
|
|
5154
|
+
backgroundColor: minimized ? "inherit !important" : void 0,
|
|
5155
|
+
// not disabled
|
|
5156
|
+
"&:not(.Mui-disabled):hover": {
|
|
5157
|
+
backgroundColor: `${theme.palette.action.hover} !important`
|
|
5158
|
+
}
|
|
5159
|
+
}
|
|
5160
|
+
},
|
|
5161
|
+
...emphasis === "transparent" && {
|
|
5162
|
+
"& .MuiInputBase-root": {
|
|
5163
|
+
backgroundColor: "transparent !important",
|
|
5164
|
+
"&:hover": {
|
|
5165
|
+
backgroundColor: "transparent"
|
|
5166
|
+
},
|
|
5167
|
+
"&.Mui-disabled": {
|
|
5168
|
+
backgroundColor: "transparent"
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
},
|
|
5172
|
+
...emphasis === "floating" && {
|
|
5173
|
+
"& .MuiInputBase-root": {
|
|
5174
|
+
backgroundColor: `${theme.palette.background.paper} !important`,
|
|
5175
|
+
boxShadow: theme.shadows[1],
|
|
5176
|
+
"&:hover": {
|
|
5177
|
+
backgroundColor: theme.palette.background.paper
|
|
5178
|
+
},
|
|
5179
|
+
"&.Mui-disabled": {
|
|
5180
|
+
backgroundColor: theme.palette.background.paper
|
|
5181
|
+
}
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
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
|
+
};
|
|
5239
|
+
function _SearchField({
|
|
5240
|
+
value,
|
|
5241
|
+
defaultValue,
|
|
5242
|
+
placeholder,
|
|
5243
|
+
disabled,
|
|
5244
|
+
minimized = false,
|
|
5245
|
+
loading = false,
|
|
5246
|
+
variant = "filled",
|
|
5247
|
+
size = "small",
|
|
5248
|
+
InputProps,
|
|
5249
|
+
inputProps,
|
|
5250
|
+
startAdornment,
|
|
5251
|
+
endAdornment,
|
|
5252
|
+
onFocus,
|
|
5253
|
+
onBlur,
|
|
5254
|
+
onChange,
|
|
5255
|
+
onClick,
|
|
5256
|
+
onResetSearch,
|
|
5257
|
+
showClearButton = true,
|
|
5258
|
+
clearButtonLabel,
|
|
5259
|
+
clearButton,
|
|
5260
|
+
...otherProps
|
|
5261
|
+
}, ref) {
|
|
5262
|
+
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
5263
|
+
const clearButtonVisibility = !disabled && Boolean(value ?? defaultValue) && showClearButton;
|
|
5264
|
+
const clearButtonLabelValue = useTranslationWithFallback(
|
|
5265
|
+
"c4r.button.clear",
|
|
5266
|
+
clearButtonLabel
|
|
5267
|
+
);
|
|
5268
|
+
const handleFocus = (event) => {
|
|
5269
|
+
setIsInputFocused(true);
|
|
5270
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
5271
|
+
};
|
|
5272
|
+
const handleBlur = (event) => {
|
|
5273
|
+
setIsInputFocused(false);
|
|
5274
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
5275
|
+
};
|
|
5276
|
+
const handleClear = () => {
|
|
5277
|
+
onResetSearch == null ? void 0 : onResetSearch();
|
|
5278
|
+
onChange == null ? void 0 : onChange({ target: { value: "" } });
|
|
5279
|
+
};
|
|
5280
|
+
return /* @__PURE__ */ jsx(
|
|
5281
|
+
SearchFieldBase,
|
|
5282
|
+
{
|
|
5283
|
+
value: minimized ? "" : value,
|
|
5284
|
+
defaultValue,
|
|
5285
|
+
placeholder: minimized ? "" : placeholder,
|
|
5286
|
+
onChange,
|
|
5287
|
+
onClick,
|
|
5288
|
+
variant: "filled",
|
|
5289
|
+
emphasis: variant,
|
|
5290
|
+
size,
|
|
5291
|
+
focused: false,
|
|
5292
|
+
isInputFocused,
|
|
5293
|
+
disabled,
|
|
5294
|
+
minimized,
|
|
5295
|
+
InputProps: {
|
|
5296
|
+
onFocus: handleFocus,
|
|
5297
|
+
onBlur: handleBlur,
|
|
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
|
+
),
|
|
5320
|
+
...InputProps
|
|
5321
|
+
},
|
|
5322
|
+
inputProps: {
|
|
5323
|
+
role: "searchbox",
|
|
5324
|
+
...inputProps
|
|
5325
|
+
},
|
|
5326
|
+
role: "search",
|
|
5327
|
+
"data-variant": variant,
|
|
5328
|
+
"data-name": "search-field",
|
|
5329
|
+
ref,
|
|
5330
|
+
...otherProps
|
|
5331
|
+
}
|
|
5332
|
+
);
|
|
5333
|
+
}
|
|
5334
|
+
const SearchField = forwardRef(_SearchField);
|
|
4949
5335
|
const MAX_WIDTH = 480;
|
|
4950
5336
|
const SnackbarRoot = styled(Snackbar$1)(({ theme }) => ({
|
|
4951
5337
|
bottom: theme.spacing(2),
|
|
@@ -5050,10 +5436,13 @@ function Snackbar({
|
|
|
5050
5436
|
onClose = () => void 0,
|
|
5051
5437
|
autoWidth,
|
|
5052
5438
|
icon,
|
|
5439
|
+
closeTooltipText,
|
|
5053
5440
|
...rest
|
|
5054
5441
|
}) {
|
|
5055
|
-
const
|
|
5056
|
-
|
|
5442
|
+
const closeTooltipLabel = useTranslationWithFallback(
|
|
5443
|
+
"c4r.button.close",
|
|
5444
|
+
closeTooltipText
|
|
5445
|
+
);
|
|
5057
5446
|
const isNeutral = severity === "neutral";
|
|
5058
5447
|
const disabledIcon = icon === false || isNeutral && !icon;
|
|
5059
5448
|
const disabledAutoHide = autoHideDuration === null;
|
|
@@ -5094,9 +5483,7 @@ function Snackbar({
|
|
|
5094
5483
|
color: "default",
|
|
5095
5484
|
onClick: (e) => onClose(e, "timeout"),
|
|
5096
5485
|
icon: /* @__PURE__ */ jsx(CloseOutlined, {}),
|
|
5097
|
-
tooltip:
|
|
5098
|
-
id: "c4r.button.close"
|
|
5099
|
-
})
|
|
5486
|
+
tooltip: closeTooltipLabel
|
|
5100
5487
|
}
|
|
5101
5488
|
) })
|
|
5102
5489
|
]
|
|
@@ -5419,10 +5806,26 @@ function useFileUpload({
|
|
|
5419
5806
|
files,
|
|
5420
5807
|
multiple,
|
|
5421
5808
|
placeholder,
|
|
5422
|
-
uploadInputRef
|
|
5809
|
+
uploadInputRef,
|
|
5810
|
+
filesSelectedText,
|
|
5811
|
+
dragPlaceholderText,
|
|
5812
|
+
dragActivePlaceholderText
|
|
5423
5813
|
}) {
|
|
5424
|
-
const
|
|
5425
|
-
|
|
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
|
+
);
|
|
5426
5829
|
const [filesText, setFilesText] = useState("");
|
|
5427
5830
|
const [dragOver, setDragOver] = useState(false);
|
|
5428
5831
|
useEffect(() => {
|
|
@@ -5431,14 +5834,9 @@ function useFileUpload({
|
|
|
5431
5834
|
} else if (files.length === 1) {
|
|
5432
5835
|
setFilesText(files[0].name);
|
|
5433
5836
|
} else {
|
|
5434
|
-
setFilesText(
|
|
5435
|
-
intlConfig.formatMessage(
|
|
5436
|
-
{ id: "c4r.form.filesSelected" },
|
|
5437
|
-
{ count: files.length }
|
|
5438
|
-
)
|
|
5439
|
-
);
|
|
5837
|
+
setFilesText(filesSelectedLabel);
|
|
5440
5838
|
}
|
|
5441
|
-
}, [files,
|
|
5839
|
+
}, [files, filesSelectedLabel]);
|
|
5442
5840
|
const handleBrowse = () => {
|
|
5443
5841
|
var _a;
|
|
5444
5842
|
(_a = uploadInputRef.current) == null ? void 0 : _a.click();
|
|
@@ -5478,22 +5876,11 @@ function useFileUpload({
|
|
|
5478
5876
|
onChange == null ? void 0 : onChange([]);
|
|
5479
5877
|
};
|
|
5480
5878
|
const getPlaceholder = useMemo(() => {
|
|
5481
|
-
const defaultPlaceholder = intlConfig.formatMessage(
|
|
5482
|
-
{ id: `c4r.form.dragPlaceholder` },
|
|
5483
|
-
{ count: multiple ? 0 : 1 }
|
|
5484
|
-
);
|
|
5485
|
-
const dragPlaceholder = intlConfig.formatMessage(
|
|
5486
|
-
{ id: `c4r.form.dragActivePlaceholder` },
|
|
5487
|
-
{ count: multiple ? 0 : 1 }
|
|
5488
|
-
);
|
|
5489
|
-
let placeholderText = "";
|
|
5490
5879
|
if (dragOver) {
|
|
5491
|
-
|
|
5492
|
-
} else {
|
|
5493
|
-
placeholderText = placeholder ?? defaultPlaceholder;
|
|
5880
|
+
return dragActivePlaceholderLabel;
|
|
5494
5881
|
}
|
|
5495
|
-
return
|
|
5496
|
-
}, [dragOver,
|
|
5882
|
+
return placeholder ?? dragPlaceholderLabel;
|
|
5883
|
+
}, [dragOver, placeholder, dragPlaceholderLabel, dragActivePlaceholderLabel]);
|
|
5497
5884
|
const inputEvents = {
|
|
5498
5885
|
onDragOver: handleDragOver,
|
|
5499
5886
|
onDragLeave: handleDragLeave,
|
|
@@ -5768,6 +6155,7 @@ export {
|
|
|
5768
6155
|
MultipleSelectField,
|
|
5769
6156
|
PasswordField,
|
|
5770
6157
|
ScreenReaderOnly,
|
|
6158
|
+
SearchField,
|
|
5771
6159
|
SelectField,
|
|
5772
6160
|
Snackbar,
|
|
5773
6161
|
SplitButton,
|