@carto/meridian-ds 2.6.1 → 2.6.2-alpha.0
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-1A6BG2aO.js} +5 -41
- package/dist/{Alert-DOeOwxOe.cjs → Alert-eVzJvC47.cjs} +4 -40
- package/dist/{MenuItem-CYJN2OVU.cjs → MenuItem-6ZIV5V7a.cjs} +1 -1
- package/dist/{MenuItem-MUmADf3e.js → MenuItem-DgHhHW-j.js} +1 -1
- package/dist/components/index.cjs +329 -235
- package/dist/components/index.js +328 -234
- package/dist/{css-utils-CCi3p7os.cjs → css-utils-BNXxLCyb.cjs} +27 -11
- package/dist/{css-utils-WejOmkiI.js → css-utils-lmkjeCdF.js} +29 -13
- package/dist/custom-icons/index.cjs +771 -609
- package/dist/custom-icons/index.js +771 -609
- package/dist/theme/index.cjs +61 -5
- package/dist/theme/index.js +63 -7
- package/dist/types/components/Alert/Alert.d.ts.map +1 -1
- package/dist/types/components/AppBar/AppBar.d.ts.map +1 -1
- 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/Avatar/Avatar.d.ts +0 -2
- package/dist/types/components/Avatar/Avatar.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/DatePickers/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/components/DatePickers/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts +3 -0
- package/dist/types/components/DatePickers/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts +3 -0
- package/dist/types/components/DatePickers/DateRangePicker/DateRangePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts +3 -0
- package/dist/types/components/DatePickers/DateTimePicker/DateTimePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts +1 -1
- package/dist/types/components/DatePickers/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts +3 -0
- package/dist/types/components/DatePickers/TimePicker/TimePicker.stories.d.ts.map +1 -1
- package/dist/types/components/DatePickers/types.d.ts +7 -0
- package/dist/types/components/DatePickers/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/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/custom-icons/ApiAccessToken.d.ts +4 -0
- package/dist/types/custom-icons/ApiAccessToken.d.ts.map +1 -0
- package/dist/types/custom-icons/ApiBaseUrl.d.ts +4 -0
- package/dist/types/custom-icons/ApiBaseUrl.d.ts.map +1 -0
- package/dist/types/custom-icons/AppCredentials.d.ts +4 -0
- package/dist/types/custom-icons/AppCredentials.d.ts.map +1 -0
- package/dist/types/custom-icons/M2mOauthClient.d.ts +4 -0
- package/dist/types/custom-icons/M2mOauthClient.d.ts.map +1 -0
- package/dist/types/custom-icons/SpaOauthClient.d.ts +4 -0
- package/dist/types/custom-icons/SpaOauthClient.d.ts.map +1 -0
- package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts +4 -0
- package/dist/types/custom-icons/WorkflowApiEndpoint.d.ts.map +1 -0
- package/dist/types/custom-icons/index.d.ts +6 -0
- package/dist/types/custom-icons/index.d.ts.map +1 -1
- package/dist/types/theme/components/data-display.d.ts.map +1 -1
- package/dist/types/theme/components/feedback.d.ts.map +1 -1
- package/dist/types/theme/types.d.ts +11 -0
- package/dist/types/theme/types.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 +2 -2
- package/dist/widgets/index.js +2 -2
- package/package.json +3 -2
- 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
|
@@ -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, 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, N as NOTIFICATION_DURATION_IN_MS, e as ellipsisStyles } from "../css-utils-lmkjeCdF.js";
|
|
6
|
+
import { a } from "../css-utils-lmkjeCdF.js";
|
|
7
|
+
import { S as ScreenReaderOnly, A as Alert$1 } from "../Alert-1A6BG2aO.js";
|
|
8
|
+
import { L } from "../Alert-1A6BG2aO.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-DgHhHW-j.js";
|
|
13
12
|
import "cartocolor";
|
|
14
13
|
import { FixedSizeList } from "react-window";
|
|
15
14
|
import { Controlled, UnControlled } from "react-codemirror2";
|
|
@@ -38,6 +37,7 @@ 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";
|
|
40
39
|
import { DatePicker as DatePicker$1 } from "@mui/x-date-pickers/DatePicker";
|
|
40
|
+
import { useIntl } from "react-intl";
|
|
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";
|
|
@@ -69,7 +69,7 @@ function _Button({
|
|
|
69
69
|
"aria-describedby": ariaDescribedby,
|
|
70
70
|
...otherProps
|
|
71
71
|
}, ref) {
|
|
72
|
-
const screenReaderTextValue =
|
|
72
|
+
const screenReaderTextValue = useTranslationWithFallback(
|
|
73
73
|
"c4r.button.opensInNewTab",
|
|
74
74
|
screenReaderText
|
|
75
75
|
);
|
|
@@ -282,14 +282,25 @@ function _LabelWithIndicator({
|
|
|
282
282
|
);
|
|
283
283
|
}
|
|
284
284
|
const LabelWithIndicator = forwardRef(_LabelWithIndicator);
|
|
285
|
-
function _PasswordField({
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
function _PasswordField({
|
|
286
|
+
InputProps,
|
|
287
|
+
size = "small",
|
|
288
|
+
disabled,
|
|
289
|
+
showPasswordText,
|
|
290
|
+
hidePasswordText,
|
|
291
|
+
...otherProps
|
|
292
|
+
}, ref) {
|
|
293
|
+
const showPasswordLabel = useTranslationWithFallback(
|
|
294
|
+
"c4r.form.showPassword",
|
|
295
|
+
showPasswordText
|
|
296
|
+
);
|
|
297
|
+
const hidePasswordLabel = useTranslationWithFallback(
|
|
298
|
+
"c4r.form.hidePassword",
|
|
299
|
+
hidePasswordText
|
|
300
|
+
);
|
|
288
301
|
const [showPassword, setShowPassword] = useState(false);
|
|
289
302
|
const handleClickShowPassword = () => setShowPassword(!showPassword);
|
|
290
|
-
const
|
|
291
|
-
id: `c4r.form.${showPassword ? "hidePassword" : "showPassword"}`
|
|
292
|
-
});
|
|
303
|
+
const label = showPassword ? hidePasswordLabel : showPasswordLabel;
|
|
293
304
|
return /* @__PURE__ */ jsx(
|
|
294
305
|
TextField,
|
|
295
306
|
{
|
|
@@ -311,8 +322,8 @@ function _PasswordField({ InputProps, size = "small", disabled, ...otherProps },
|
|
|
311
322
|
disabled,
|
|
312
323
|
onClick: handleClickShowPassword,
|
|
313
324
|
icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOffOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOutlined, {}),
|
|
314
|
-
tooltip:
|
|
315
|
-
"aria-label":
|
|
325
|
+
tooltip: label,
|
|
326
|
+
"aria-label": label
|
|
316
327
|
}
|
|
317
328
|
) })
|
|
318
329
|
},
|
|
@@ -522,11 +533,14 @@ function _MenuItemFilter({
|
|
|
522
533
|
areAnySelected,
|
|
523
534
|
selectAll,
|
|
524
535
|
selectAllDisabled,
|
|
536
|
+
selectAllText,
|
|
525
537
|
"aria-label": ariaLabel,
|
|
526
538
|
"data-testid": dataTestId
|
|
527
539
|
}, ref) {
|
|
528
|
-
const
|
|
529
|
-
|
|
540
|
+
const selectAllLabel = useTranslationWithFallback(
|
|
541
|
+
"c4r.form.selectAll",
|
|
542
|
+
selectAllText
|
|
543
|
+
);
|
|
530
544
|
return /* @__PURE__ */ jsx(
|
|
531
545
|
StyledMenuItem$1,
|
|
532
546
|
{
|
|
@@ -554,7 +568,7 @@ function _MenuItemFilter({
|
|
|
554
568
|
disabled: selectAllDisabled
|
|
555
569
|
}
|
|
556
570
|
),
|
|
557
|
-
|
|
571
|
+
selectAllLabel
|
|
558
572
|
]
|
|
559
573
|
}
|
|
560
574
|
)
|
|
@@ -601,6 +615,10 @@ function _MultipleSelectField({
|
|
|
601
615
|
selectAllDisabled,
|
|
602
616
|
tooltipPlacement,
|
|
603
617
|
variant,
|
|
618
|
+
allSelectedText,
|
|
619
|
+
noneSelectedText,
|
|
620
|
+
selectedText,
|
|
621
|
+
selectAllText,
|
|
604
622
|
...props
|
|
605
623
|
}, ref) {
|
|
606
624
|
const {
|
|
@@ -617,11 +635,19 @@ function _MultipleSelectField({
|
|
|
617
635
|
});
|
|
618
636
|
const isSmall = size === "small";
|
|
619
637
|
const paddingSize = isSmall || variant === "standard" ? 0 : 2;
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
638
|
+
const allSelectedLabel = useTranslationWithFallback(
|
|
639
|
+
"c4r.form.allSelected",
|
|
640
|
+
allSelectedText
|
|
641
|
+
);
|
|
642
|
+
const noneSelectedLabel = useTranslationWithFallback(
|
|
643
|
+
"c4r.form.noneSelected",
|
|
644
|
+
noneSelectedText
|
|
645
|
+
);
|
|
646
|
+
const selectedLabel = useTranslationWithFallback(
|
|
647
|
+
"c4r.form.selected",
|
|
648
|
+
selectedText
|
|
649
|
+
);
|
|
650
|
+
const counterText = `${currentOptions.length} ${selectedLabel}`;
|
|
625
651
|
const renderValue = useMemo(() => {
|
|
626
652
|
if (areAllSelected) {
|
|
627
653
|
return /* @__PURE__ */ jsx(
|
|
@@ -631,7 +657,7 @@ function _MultipleSelectField({
|
|
|
631
657
|
variant: isSmall ? "body2" : "body1",
|
|
632
658
|
color: "textPrimary",
|
|
633
659
|
ml: paddingSize,
|
|
634
|
-
children:
|
|
660
|
+
children: allSelectedLabel
|
|
635
661
|
}
|
|
636
662
|
);
|
|
637
663
|
}
|
|
@@ -654,16 +680,17 @@ function _MultipleSelectField({
|
|
|
654
680
|
variant: isSmall ? "body2" : "body1",
|
|
655
681
|
color: "text.hint",
|
|
656
682
|
ml: paddingSize,
|
|
657
|
-
children: placeholder ??
|
|
683
|
+
children: placeholder ?? noneSelectedLabel
|
|
658
684
|
}
|
|
659
685
|
);
|
|
660
686
|
}, [
|
|
661
687
|
areAllSelected,
|
|
662
688
|
areAnySelected,
|
|
689
|
+
allSelectedLabel,
|
|
663
690
|
counterText,
|
|
664
691
|
currentOptions,
|
|
665
|
-
intlConfig,
|
|
666
692
|
isSmall,
|
|
693
|
+
noneSelectedLabel,
|
|
667
694
|
paddingSize,
|
|
668
695
|
placeholder,
|
|
669
696
|
showCounter
|
|
@@ -704,7 +731,8 @@ function _MultipleSelectField({
|
|
|
704
731
|
areAllSelected,
|
|
705
732
|
areAnySelected,
|
|
706
733
|
selectAll,
|
|
707
|
-
selectAllDisabled
|
|
734
|
+
selectAllDisabled,
|
|
735
|
+
selectAllText
|
|
708
736
|
}
|
|
709
737
|
)
|
|
710
738
|
}
|
|
@@ -871,19 +899,22 @@ const _CopiableComponent = ({
|
|
|
871
899
|
copiedText,
|
|
872
900
|
button,
|
|
873
901
|
buttonLabel,
|
|
902
|
+
buttonIcon,
|
|
874
903
|
buttonProps,
|
|
875
904
|
ariaLabel,
|
|
876
905
|
dataTestId,
|
|
877
906
|
tooltipPlacement = "top",
|
|
907
|
+
tooltipProps,
|
|
908
|
+
snackbarProps,
|
|
878
909
|
...props
|
|
879
910
|
}, ref) => {
|
|
880
911
|
const [open, setOpen] = useState(false);
|
|
881
|
-
const
|
|
882
|
-
const
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
912
|
+
const _copyText = useTranslationWithFallback("c4r.button.copy", copyText);
|
|
913
|
+
const copyTooltipText = copyText === null ? null : _copyText;
|
|
914
|
+
const copySuccessMessage = useTranslationWithFallback(
|
|
915
|
+
"c4r.notifications.copiedToClipboard",
|
|
916
|
+
copiedText
|
|
917
|
+
);
|
|
887
918
|
const { copy } = useCopyValue(copyTooltipText, copySuccessMessage);
|
|
888
919
|
const handleClick = (e) => {
|
|
889
920
|
e.preventDefault();
|
|
@@ -892,6 +923,7 @@ const _CopiableComponent = ({
|
|
|
892
923
|
setOpen(true);
|
|
893
924
|
}).catch(console.error);
|
|
894
925
|
};
|
|
926
|
+
const copyIcon = buttonIcon ?? /* @__PURE__ */ jsx(ContentCopyOutlined, {});
|
|
895
927
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
896
928
|
/* @__PURE__ */ jsx(
|
|
897
929
|
Tooltip,
|
|
@@ -899,6 +931,7 @@ const _CopiableComponent = ({
|
|
|
899
931
|
title: copyTooltipText,
|
|
900
932
|
leaveDelay: 0,
|
|
901
933
|
placement: tooltipPlacement,
|
|
934
|
+
...tooltipProps,
|
|
902
935
|
children: /* @__PURE__ */ jsxs(
|
|
903
936
|
Box,
|
|
904
937
|
{
|
|
@@ -914,9 +947,9 @@ const _CopiableComponent = ({
|
|
|
914
947
|
{
|
|
915
948
|
...buttonProps,
|
|
916
949
|
disabled,
|
|
917
|
-
icon:
|
|
950
|
+
icon: copyIcon,
|
|
918
951
|
"data-testid": dataTestId,
|
|
919
|
-
"aria-label": ariaLabel || buttonLabel || copyTooltipText
|
|
952
|
+
"aria-label": ariaLabel || buttonLabel || (copyTooltipText ?? ""),
|
|
920
953
|
sx: {
|
|
921
954
|
display: "flex"
|
|
922
955
|
}
|
|
@@ -930,10 +963,11 @@ const _CopiableComponent = ({
|
|
|
930
963
|
/* @__PURE__ */ jsx(
|
|
931
964
|
Snackbar,
|
|
932
965
|
{
|
|
933
|
-
open,
|
|
934
966
|
autoWidth: true,
|
|
935
967
|
closeable: false,
|
|
936
968
|
autoHideDuration: 4e3,
|
|
969
|
+
...snackbarProps,
|
|
970
|
+
open,
|
|
937
971
|
onClose: () => setOpen(false),
|
|
938
972
|
children: copySuccessMessage
|
|
939
973
|
}
|
|
@@ -977,16 +1011,22 @@ function _CopiableInputText({
|
|
|
977
1011
|
size = "small",
|
|
978
1012
|
onFocus,
|
|
979
1013
|
onBlur,
|
|
1014
|
+
showText: showTextProp,
|
|
1015
|
+
hideText: hideTextProp,
|
|
980
1016
|
...rest
|
|
981
1017
|
}, ref) {
|
|
982
|
-
const
|
|
983
|
-
const intlConfig = useImperativeIntl(intl);
|
|
984
|
-
const [showText, setShowText] = useState(false);
|
|
1018
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
985
1019
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
986
|
-
const inputType = !password ? "text" :
|
|
987
|
-
const showTextLabel =
|
|
988
|
-
|
|
989
|
-
|
|
1020
|
+
const inputType = !password ? "text" : showPassword ? "text" : "password";
|
|
1021
|
+
const showTextLabel = useTranslationWithFallback(
|
|
1022
|
+
"c4r.button.show",
|
|
1023
|
+
showTextProp
|
|
1024
|
+
);
|
|
1025
|
+
const hideTextLabel = useTranslationWithFallback(
|
|
1026
|
+
"c4r.button.hide",
|
|
1027
|
+
hideTextProp
|
|
1028
|
+
);
|
|
1029
|
+
const currentLabel = showPassword ? hideTextLabel : showTextLabel;
|
|
990
1030
|
const handleFocus = (event) => {
|
|
991
1031
|
setIsInputFocused(true);
|
|
992
1032
|
onFocus == null ? void 0 : onFocus(event);
|
|
@@ -999,11 +1039,11 @@ function _CopiableInputText({
|
|
|
999
1039
|
IconButton,
|
|
1000
1040
|
{
|
|
1001
1041
|
edge: variant !== "standard" ? "end" : void 0,
|
|
1002
|
-
onClick: () =>
|
|
1042
|
+
onClick: () => setShowPassword(!showPassword),
|
|
1003
1043
|
size,
|
|
1004
|
-
icon:
|
|
1005
|
-
tooltip:
|
|
1006
|
-
"aria-label":
|
|
1044
|
+
icon: showPassword ? /* @__PURE__ */ jsx(VisibilityOutlined, {}) : /* @__PURE__ */ jsx(VisibilityOffOutlined, {}),
|
|
1045
|
+
tooltip: currentLabel,
|
|
1046
|
+
"aria-label": currentLabel
|
|
1007
1047
|
}
|
|
1008
1048
|
) });
|
|
1009
1049
|
return /* @__PURE__ */ jsx(
|
|
@@ -1273,10 +1313,12 @@ function useCreatableAutocomplete({
|
|
|
1273
1313
|
newItemIcon,
|
|
1274
1314
|
multiple
|
|
1275
1315
|
}) {
|
|
1276
|
-
const intl = useIntl();
|
|
1277
|
-
const intlConfig = useImperativeIntl(intl);
|
|
1278
1316
|
const filter = createFilterOptions();
|
|
1279
1317
|
const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
|
|
1318
|
+
const addLabel = useTranslationWithFallback(
|
|
1319
|
+
"c4r.form.add",
|
|
1320
|
+
typeof newItemLabel === "string" ? newItemLabel : void 0
|
|
1321
|
+
);
|
|
1280
1322
|
const creatableFilterOptions = (options, params) => {
|
|
1281
1323
|
const filtered = filter(
|
|
1282
1324
|
options,
|
|
@@ -1290,10 +1332,8 @@ function useCreatableAutocomplete({
|
|
|
1290
1332
|
let newItemText;
|
|
1291
1333
|
if (typeof newItemLabel === "function") {
|
|
1292
1334
|
newItemText = newItemLabel(inputValue);
|
|
1293
|
-
} else if (newItemLabel) {
|
|
1294
|
-
newItemText = `${newItemLabel} "${inputValue}"`;
|
|
1295
1335
|
} else {
|
|
1296
|
-
newItemText = `${
|
|
1336
|
+
newItemText = `${addLabel} "${inputValue}"`;
|
|
1297
1337
|
}
|
|
1298
1338
|
filtered.push({
|
|
1299
1339
|
inputValue,
|
|
@@ -1338,14 +1378,18 @@ function useMultipleAutocomplete({
|
|
|
1338
1378
|
counterText,
|
|
1339
1379
|
allSelectedText
|
|
1340
1380
|
}) {
|
|
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
1381
|
const [multipleValue, setMultipleValue] = useState(
|
|
1346
1382
|
Array.isArray(value) ? value : value ? [value] : []
|
|
1347
1383
|
);
|
|
1348
1384
|
const { renderOption: autocompleteRenderOption } = useAutocompleteRenderOption();
|
|
1385
|
+
const defaultCounterText = useTranslationWithFallback(
|
|
1386
|
+
"c4r.form.selected",
|
|
1387
|
+
counterText
|
|
1388
|
+
);
|
|
1389
|
+
const defaultAllSelectedText = useTranslationWithFallback(
|
|
1390
|
+
"c4r.form.allSelected",
|
|
1391
|
+
allSelectedText
|
|
1392
|
+
);
|
|
1349
1393
|
useEffect(() => {
|
|
1350
1394
|
const newValue = Array.isArray(value) ? value : value ? [value] : [];
|
|
1351
1395
|
setMultipleValue(newValue);
|
|
@@ -1476,6 +1520,7 @@ function _AutocompleteList({
|
|
|
1476
1520
|
extended,
|
|
1477
1521
|
itemHeight,
|
|
1478
1522
|
maxListHeight = MENU_LIST_MAX_SIZE,
|
|
1523
|
+
selectAllText,
|
|
1479
1524
|
...otherProps
|
|
1480
1525
|
}, ref) {
|
|
1481
1526
|
const childrenArray = useMemo(() => {
|
|
@@ -1551,7 +1596,8 @@ function _AutocompleteList({
|
|
|
1551
1596
|
{
|
|
1552
1597
|
areAllSelected: !!allSelected,
|
|
1553
1598
|
areAnySelected: !!someSelected,
|
|
1554
|
-
selectAll: handleSelectAll
|
|
1599
|
+
selectAll: handleSelectAll,
|
|
1600
|
+
selectAllText
|
|
1555
1601
|
}
|
|
1556
1602
|
),
|
|
1557
1603
|
/* @__PURE__ */ jsx(
|
|
@@ -1582,6 +1628,7 @@ function _CreatableAutocomplete({
|
|
|
1582
1628
|
counterFormatter,
|
|
1583
1629
|
counterText,
|
|
1584
1630
|
allSelectedText,
|
|
1631
|
+
selectAllText,
|
|
1585
1632
|
options = [],
|
|
1586
1633
|
value,
|
|
1587
1634
|
onChange,
|
|
@@ -1632,7 +1679,8 @@ function _CreatableAutocomplete({
|
|
|
1632
1679
|
multiple,
|
|
1633
1680
|
itemHeight,
|
|
1634
1681
|
maxListHeight,
|
|
1635
|
-
extended
|
|
1682
|
+
extended,
|
|
1683
|
+
selectAllText
|
|
1636
1684
|
};
|
|
1637
1685
|
const finalRenderTags = showCounter && multiple && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1638
1686
|
return /* @__PURE__ */ jsx(
|
|
@@ -1671,6 +1719,7 @@ function _MultipleAutocomplete({
|
|
|
1671
1719
|
counterFormatter,
|
|
1672
1720
|
counterText,
|
|
1673
1721
|
allSelectedText,
|
|
1722
|
+
selectAllText,
|
|
1674
1723
|
options,
|
|
1675
1724
|
value,
|
|
1676
1725
|
onChange,
|
|
@@ -1712,7 +1761,8 @@ function _MultipleAutocomplete({
|
|
|
1712
1761
|
multiple: true,
|
|
1713
1762
|
itemHeight,
|
|
1714
1763
|
maxListHeight,
|
|
1715
|
-
extended
|
|
1764
|
+
extended,
|
|
1765
|
+
selectAllText
|
|
1716
1766
|
};
|
|
1717
1767
|
const finalRenderTags = showCounter && !renderTags ? getCounterRenderTags() : renderTags;
|
|
1718
1768
|
return /* @__PURE__ */ jsx(
|
|
@@ -1853,6 +1903,7 @@ function SecondaryText({ text }) {
|
|
|
1853
1903
|
}
|
|
1854
1904
|
const Root$4 = styled(AppBar$1)(({ theme }) => ({
|
|
1855
1905
|
backgroundColor: theme.palette.brand.appBarMain,
|
|
1906
|
+
userSelect: "none",
|
|
1856
1907
|
"& .MuiTypography-root": {
|
|
1857
1908
|
color: theme.palette.brand.appBarContrastText
|
|
1858
1909
|
},
|
|
@@ -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
|
]
|
|
@@ -3862,10 +3955,13 @@ function DatePicker({
|
|
|
3862
3955
|
readOnly,
|
|
3863
3956
|
"aria-label": ariaLabel,
|
|
3864
3957
|
"data-testid": dataTestId,
|
|
3958
|
+
chooseDateAriaLabel,
|
|
3865
3959
|
...props
|
|
3866
3960
|
}) {
|
|
3867
|
-
const
|
|
3868
|
-
|
|
3961
|
+
const chooseDateText = useTranslationWithFallback(
|
|
3962
|
+
"c4r.form.chooseDate",
|
|
3963
|
+
chooseDateAriaLabel
|
|
3964
|
+
);
|
|
3869
3965
|
return (
|
|
3870
3966
|
// Don't remove className, it's used for styling
|
|
3871
3967
|
/* @__PURE__ */ jsx(Box, { className: "CartoDatePicker-root", "data-testid": "date-picker", children: /* @__PURE__ */ jsx(
|
|
@@ -3910,16 +4006,7 @@ function DatePicker({
|
|
|
3910
4006
|
},
|
|
3911
4007
|
slots: {
|
|
3912
4008
|
clearButton: (props2) => /* @__PURE__ */ jsx(ClearButton, { ...props2, size, variant }),
|
|
3913
|
-
openPickerButton: (props2) => /* @__PURE__ */ jsx(
|
|
3914
|
-
IconButton$1,
|
|
3915
|
-
{
|
|
3916
|
-
...props2,
|
|
3917
|
-
size,
|
|
3918
|
-
"aria-label": intlConfig.formatMessage({
|
|
3919
|
-
id: "c4r.form.chooseDate"
|
|
3920
|
-
})
|
|
3921
|
-
}
|
|
3922
|
-
),
|
|
4009
|
+
openPickerButton: (props2) => /* @__PURE__ */ jsx(IconButton$1, { ...props2, size, "aria-label": chooseDateText }),
|
|
3923
4010
|
...slots
|
|
3924
4011
|
},
|
|
3925
4012
|
disableOpenPicker: !showCalendar,
|
|
@@ -4148,12 +4235,14 @@ function DateRangePicker({
|
|
|
4148
4235
|
variant = "outlined",
|
|
4149
4236
|
startProps,
|
|
4150
4237
|
endProps,
|
|
4238
|
+
startDateLabel,
|
|
4239
|
+
endDateLabel,
|
|
4240
|
+
startDateCalendarAriaLabel,
|
|
4241
|
+
endDateCalendarAriaLabel,
|
|
4151
4242
|
"aria-label": ariaLabel,
|
|
4152
4243
|
"data-testid": dataTestId,
|
|
4153
4244
|
...props
|
|
4154
4245
|
}) {
|
|
4155
|
-
const intl = useIntl();
|
|
4156
|
-
const intlConfig = useImperativeIntl(intl);
|
|
4157
4246
|
const [isEndDateOpen, setIsEndDateOpen] = useState(false);
|
|
4158
4247
|
const [isStartDateOpen, setIsStartDateOpen] = useState(false);
|
|
4159
4248
|
const [startDate, setStartDate] = useState(
|
|
@@ -4164,6 +4253,22 @@ function DateRangePicker({
|
|
|
4164
4253
|
(endProps == null ? void 0 : endProps.value) ?? (startProps == null ? void 0 : startProps.value) ?? /* @__PURE__ */ new Date()
|
|
4165
4254
|
);
|
|
4166
4255
|
const hasError = error ?? (startProps == null ? void 0 : startProps.error) ?? (endProps == null ? void 0 : endProps.error);
|
|
4256
|
+
const _startDateLabel = useTranslationWithFallback(
|
|
4257
|
+
"c4r.form.startDate",
|
|
4258
|
+
startDateLabel
|
|
4259
|
+
);
|
|
4260
|
+
const _endDateLabel = useTranslationWithFallback(
|
|
4261
|
+
"c4r.form.endDate",
|
|
4262
|
+
endDateLabel
|
|
4263
|
+
);
|
|
4264
|
+
const startCalendarAriaLabel = useTranslationWithFallback(
|
|
4265
|
+
"c4r.form.startDateCalendar",
|
|
4266
|
+
startDateCalendarAriaLabel
|
|
4267
|
+
);
|
|
4268
|
+
const endCalendarAriaLabel = useTranslationWithFallback(
|
|
4269
|
+
"c4r.form.endDateCalendar",
|
|
4270
|
+
endDateCalendarAriaLabel
|
|
4271
|
+
);
|
|
4167
4272
|
const handleStartDateChange = (value, context) => {
|
|
4168
4273
|
setStartDate(value);
|
|
4169
4274
|
if (startProps == null ? void 0 : startProps.onChange) {
|
|
@@ -4217,13 +4322,11 @@ function DateRangePicker({
|
|
|
4217
4322
|
...startProps,
|
|
4218
4323
|
value: (startProps == null ? void 0 : startProps.value) ?? startDate,
|
|
4219
4324
|
maxDate: endDate ?? void 0,
|
|
4220
|
-
label: (startProps == null ? void 0 : startProps.label) ??
|
|
4325
|
+
label: (startProps == null ? void 0 : startProps.label) ?? _startDateLabel,
|
|
4221
4326
|
slotProps: {
|
|
4222
4327
|
popper: {
|
|
4223
4328
|
placement: "bottom-start",
|
|
4224
|
-
"aria-label":
|
|
4225
|
-
id: "c4r.form.startDateCalendar"
|
|
4226
|
-
})
|
|
4329
|
+
"aria-label": startCalendarAriaLabel
|
|
4227
4330
|
},
|
|
4228
4331
|
...startProps == null ? void 0 : startProps.slotProps
|
|
4229
4332
|
},
|
|
@@ -4258,9 +4361,7 @@ function DateRangePicker({
|
|
|
4258
4361
|
minDate: startDate ?? void 0,
|
|
4259
4362
|
slotProps: {
|
|
4260
4363
|
popper: {
|
|
4261
|
-
"aria-label":
|
|
4262
|
-
id: "c4r.form.endDateCalendar"
|
|
4263
|
-
})
|
|
4364
|
+
"aria-label": endCalendarAriaLabel
|
|
4264
4365
|
},
|
|
4265
4366
|
...endProps == null ? void 0 : endProps.slotProps
|
|
4266
4367
|
},
|
|
@@ -4276,7 +4377,7 @@ function DateRangePicker({
|
|
|
4276
4377
|
),
|
|
4277
4378
|
...endProps == null ? void 0 : endProps.slots
|
|
4278
4379
|
},
|
|
4279
|
-
label: (endProps == null ? void 0 : endProps.label) ??
|
|
4380
|
+
label: (endProps == null ? void 0 : endProps.label) ?? _endDateLabel,
|
|
4280
4381
|
error: (endProps == null ? void 0 : endProps.error) ?? error,
|
|
4281
4382
|
open: isEndDateOpen,
|
|
4282
4383
|
onOpen: handleEndDateOpen,
|
|
@@ -4336,12 +4437,16 @@ function TimePicker({
|
|
|
4336
4437
|
ampm = true,
|
|
4337
4438
|
views = ["hours", "minutes"],
|
|
4338
4439
|
format,
|
|
4440
|
+
openPickerAriaLabel,
|
|
4339
4441
|
"data-testid": dataTestId,
|
|
4340
4442
|
"aria-label": ariaLabel,
|
|
4341
4443
|
...props
|
|
4342
4444
|
}) {
|
|
4343
|
-
const
|
|
4344
|
-
const
|
|
4445
|
+
const fieldLabel = useTranslationWithFallback("c4r.form.time", label);
|
|
4446
|
+
const chooseDateAriaLabel = useTranslationWithFallback(
|
|
4447
|
+
"c4r.form.chooseDate",
|
|
4448
|
+
openPickerAriaLabel
|
|
4449
|
+
);
|
|
4345
4450
|
const inputRef = useRef(null);
|
|
4346
4451
|
const [inputWidth, setInputWidth] = useState(0);
|
|
4347
4452
|
useEffect(() => {
|
|
@@ -4375,7 +4480,7 @@ function TimePicker({
|
|
|
4375
4480
|
label: /* @__PURE__ */ jsx(
|
|
4376
4481
|
LabelWithIndicator,
|
|
4377
4482
|
{
|
|
4378
|
-
label:
|
|
4483
|
+
label: fieldLabel,
|
|
4379
4484
|
type,
|
|
4380
4485
|
icon: labelHelpTooltip && /* @__PURE__ */ jsx(Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsx(HelpOutline, { htmlColor: "text.secondary" }) })
|
|
4381
4486
|
}
|
|
@@ -4415,9 +4520,7 @@ function TimePicker({
|
|
|
4415
4520
|
{
|
|
4416
4521
|
...props2,
|
|
4417
4522
|
size,
|
|
4418
|
-
"aria-label":
|
|
4419
|
-
id: "c4r.form.chooseDate"
|
|
4420
|
-
})
|
|
4523
|
+
"aria-label": chooseDateAriaLabel
|
|
4421
4524
|
}
|
|
4422
4525
|
),
|
|
4423
4526
|
...slots
|
|
@@ -4447,12 +4550,16 @@ function DateTimePicker({
|
|
|
4447
4550
|
ampm = true,
|
|
4448
4551
|
views = ["hours", "minutes"],
|
|
4449
4552
|
format,
|
|
4553
|
+
openPickerAriaLabel,
|
|
4450
4554
|
"data-testid": dataTestId,
|
|
4451
4555
|
"aria-label": ariaLabel,
|
|
4452
4556
|
...props
|
|
4453
4557
|
}) {
|
|
4454
|
-
const
|
|
4455
|
-
const
|
|
4558
|
+
const fieldLabel = useTranslationWithFallback("c4r.form.time", label);
|
|
4559
|
+
const chooseDateAriaLabel = useTranslationWithFallback(
|
|
4560
|
+
"c4r.form.chooseDate",
|
|
4561
|
+
openPickerAriaLabel
|
|
4562
|
+
);
|
|
4456
4563
|
return /* @__PURE__ */ jsx(
|
|
4457
4564
|
DateFieldContainer,
|
|
4458
4565
|
{
|
|
@@ -4469,7 +4576,7 @@ function DateTimePicker({
|
|
|
4469
4576
|
label: /* @__PURE__ */ jsx(
|
|
4470
4577
|
LabelWithIndicator,
|
|
4471
4578
|
{
|
|
4472
|
-
label:
|
|
4579
|
+
label: fieldLabel,
|
|
4473
4580
|
type,
|
|
4474
4581
|
icon: labelHelpTooltip && /* @__PURE__ */ jsx(Tooltip, { title: labelHelpTooltip, children: /* @__PURE__ */ jsx(HelpOutline, { htmlColor: "text.secondary" }) })
|
|
4475
4582
|
}
|
|
@@ -4501,9 +4608,7 @@ function DateTimePicker({
|
|
|
4501
4608
|
{
|
|
4502
4609
|
...props2,
|
|
4503
4610
|
size,
|
|
4504
|
-
"aria-label":
|
|
4505
|
-
id: "c4r.form.chooseDate"
|
|
4506
|
-
})
|
|
4611
|
+
"aria-label": chooseDateAriaLabel
|
|
4507
4612
|
}
|
|
4508
4613
|
),
|
|
4509
4614
|
...slots
|
|
@@ -4616,37 +4721,6 @@ function _AccordionGroup({
|
|
|
4616
4721
|
);
|
|
4617
4722
|
}
|
|
4618
4723
|
const AccordionGroup = forwardRef(_AccordionGroup);
|
|
4619
|
-
const sizes = {
|
|
4620
|
-
large: 5,
|
|
4621
|
-
medium: 4,
|
|
4622
|
-
small: 3,
|
|
4623
|
-
xsmall: 2.25
|
|
4624
|
-
};
|
|
4625
|
-
const StyledAvatar = styled(Avatar$1, {
|
|
4626
|
-
shouldForwardProp: (prop) => prop !== "size" && prop !== "disabled"
|
|
4627
|
-
})(({ theme, size = "medium", disabled = false }) => ({
|
|
4628
|
-
width: theme.spacing(sizes[size]),
|
|
4629
|
-
height: theme.spacing(sizes[size]),
|
|
4630
|
-
...theme.typography.subtitle1,
|
|
4631
|
-
...size === "large" && {
|
|
4632
|
-
...theme.typography.h6
|
|
4633
|
-
},
|
|
4634
|
-
...size === "small" && {
|
|
4635
|
-
...theme.typography.caption,
|
|
4636
|
-
fontWeight: 500
|
|
4637
|
-
},
|
|
4638
|
-
...size === "xsmall" && {
|
|
4639
|
-
...theme.typography.caption,
|
|
4640
|
-
fontWeight: 500,
|
|
4641
|
-
svg: {
|
|
4642
|
-
width: ICON_SIZE_SMALL,
|
|
4643
|
-
height: ICON_SIZE_SMALL
|
|
4644
|
-
}
|
|
4645
|
-
},
|
|
4646
|
-
...disabled && {
|
|
4647
|
-
opacity: 0.6
|
|
4648
|
-
}
|
|
4649
|
-
}));
|
|
4650
4724
|
function _Avatar({
|
|
4651
4725
|
size,
|
|
4652
4726
|
disabled,
|
|
@@ -4655,7 +4729,7 @@ function _Avatar({
|
|
|
4655
4729
|
...otherProps
|
|
4656
4730
|
}, ref) {
|
|
4657
4731
|
return /* @__PURE__ */ jsx(
|
|
4658
|
-
|
|
4732
|
+
Avatar$1,
|
|
4659
4733
|
{
|
|
4660
4734
|
...otherProps,
|
|
4661
4735
|
ref,
|
|
@@ -4852,6 +4926,9 @@ function _FilterDropdown({
|
|
|
4852
4926
|
responsive,
|
|
4853
4927
|
tooltipLabel,
|
|
4854
4928
|
tooltipPlacement,
|
|
4929
|
+
tooltipProps,
|
|
4930
|
+
buttonProps,
|
|
4931
|
+
iconButtonProps,
|
|
4855
4932
|
slotProps,
|
|
4856
4933
|
MenuListProps,
|
|
4857
4934
|
...props
|
|
@@ -4889,14 +4966,30 @@ function _FilterDropdown({
|
|
|
4889
4966
|
"data-color": buttonColor
|
|
4890
4967
|
};
|
|
4891
4968
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4892
|
-
/* @__PURE__ */ jsx(
|
|
4893
|
-
|
|
4969
|
+
/* @__PURE__ */ jsx(
|
|
4970
|
+
Tooltip,
|
|
4894
4971
|
{
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4972
|
+
title: tooltipLabel,
|
|
4973
|
+
placement: tooltipPlacement,
|
|
4974
|
+
...tooltipProps,
|
|
4975
|
+
children: /* @__PURE__ */ jsx(ButtonWrapper, { isOpen, buttonColor, ref, children: isIcon ? /* @__PURE__ */ jsx(
|
|
4976
|
+
IconButton,
|
|
4977
|
+
{
|
|
4978
|
+
...commonButtonProps,
|
|
4979
|
+
icon,
|
|
4980
|
+
...iconButtonProps
|
|
4981
|
+
}
|
|
4982
|
+
) : /* @__PURE__ */ jsx(
|
|
4983
|
+
Button,
|
|
4984
|
+
{
|
|
4985
|
+
...commonButtonProps,
|
|
4986
|
+
endIcon: isOpen ? /* @__PURE__ */ jsx(ArrowUp, {}) : /* @__PURE__ */ jsx(ArrowDown, {}),
|
|
4987
|
+
...buttonProps,
|
|
4988
|
+
children: menuLabel
|
|
4989
|
+
}
|
|
4990
|
+
) })
|
|
4898
4991
|
}
|
|
4899
|
-
)
|
|
4992
|
+
),
|
|
4900
4993
|
/* @__PURE__ */ jsxs(
|
|
4901
4994
|
Menu,
|
|
4902
4995
|
{
|
|
@@ -5050,10 +5143,13 @@ function Snackbar({
|
|
|
5050
5143
|
onClose = () => void 0,
|
|
5051
5144
|
autoWidth,
|
|
5052
5145
|
icon,
|
|
5146
|
+
closeTooltipText,
|
|
5053
5147
|
...rest
|
|
5054
5148
|
}) {
|
|
5055
|
-
const
|
|
5056
|
-
|
|
5149
|
+
const closeTooltipLabel = useTranslationWithFallback(
|
|
5150
|
+
"c4r.button.close",
|
|
5151
|
+
closeTooltipText
|
|
5152
|
+
);
|
|
5057
5153
|
const isNeutral = severity === "neutral";
|
|
5058
5154
|
const disabledIcon = icon === false || isNeutral && !icon;
|
|
5059
5155
|
const disabledAutoHide = autoHideDuration === null;
|
|
@@ -5094,9 +5190,7 @@ function Snackbar({
|
|
|
5094
5190
|
color: "default",
|
|
5095
5191
|
onClick: (e) => onClose(e, "timeout"),
|
|
5096
5192
|
icon: /* @__PURE__ */ jsx(CloseOutlined, {}),
|
|
5097
|
-
tooltip:
|
|
5098
|
-
id: "c4r.button.close"
|
|
5099
|
-
})
|
|
5193
|
+
tooltip: closeTooltipLabel
|
|
5100
5194
|
}
|
|
5101
5195
|
) })
|
|
5102
5196
|
]
|
|
@@ -5419,10 +5513,26 @@ function useFileUpload({
|
|
|
5419
5513
|
files,
|
|
5420
5514
|
multiple,
|
|
5421
5515
|
placeholder,
|
|
5422
|
-
uploadInputRef
|
|
5516
|
+
uploadInputRef,
|
|
5517
|
+
filesSelectedText,
|
|
5518
|
+
dragPlaceholderText,
|
|
5519
|
+
dragActivePlaceholderText
|
|
5423
5520
|
}) {
|
|
5424
|
-
const
|
|
5425
|
-
|
|
5521
|
+
const filesSelectedLabel = useTranslationWithFallback(
|
|
5522
|
+
"c4r.form.filesSelected",
|
|
5523
|
+
filesSelectedText,
|
|
5524
|
+
{ count: (files == null ? void 0 : files.length) ?? 0 }
|
|
5525
|
+
);
|
|
5526
|
+
const dragPlaceholderLabel = useTranslationWithFallback(
|
|
5527
|
+
"c4r.form.dragPlaceholder",
|
|
5528
|
+
dragPlaceholderText,
|
|
5529
|
+
{ count: multiple ? 0 : 1 }
|
|
5530
|
+
);
|
|
5531
|
+
const dragActivePlaceholderLabel = useTranslationWithFallback(
|
|
5532
|
+
"c4r.form.dragActivePlaceholder",
|
|
5533
|
+
dragActivePlaceholderText,
|
|
5534
|
+
{ count: multiple ? 0 : 1 }
|
|
5535
|
+
);
|
|
5426
5536
|
const [filesText, setFilesText] = useState("");
|
|
5427
5537
|
const [dragOver, setDragOver] = useState(false);
|
|
5428
5538
|
useEffect(() => {
|
|
@@ -5431,14 +5541,9 @@ function useFileUpload({
|
|
|
5431
5541
|
} else if (files.length === 1) {
|
|
5432
5542
|
setFilesText(files[0].name);
|
|
5433
5543
|
} else {
|
|
5434
|
-
setFilesText(
|
|
5435
|
-
intlConfig.formatMessage(
|
|
5436
|
-
{ id: "c4r.form.filesSelected" },
|
|
5437
|
-
{ count: files.length }
|
|
5438
|
-
)
|
|
5439
|
-
);
|
|
5544
|
+
setFilesText(filesSelectedLabel);
|
|
5440
5545
|
}
|
|
5441
|
-
}, [files,
|
|
5546
|
+
}, [files, filesSelectedLabel]);
|
|
5442
5547
|
const handleBrowse = () => {
|
|
5443
5548
|
var _a;
|
|
5444
5549
|
(_a = uploadInputRef.current) == null ? void 0 : _a.click();
|
|
@@ -5478,22 +5583,11 @@ function useFileUpload({
|
|
|
5478
5583
|
onChange == null ? void 0 : onChange([]);
|
|
5479
5584
|
};
|
|
5480
5585
|
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
5586
|
if (dragOver) {
|
|
5491
|
-
|
|
5492
|
-
} else {
|
|
5493
|
-
placeholderText = placeholder ?? defaultPlaceholder;
|
|
5587
|
+
return dragActivePlaceholderLabel;
|
|
5494
5588
|
}
|
|
5495
|
-
return
|
|
5496
|
-
}, [dragOver,
|
|
5589
|
+
return placeholder ?? dragPlaceholderLabel;
|
|
5590
|
+
}, [dragOver, placeholder, dragPlaceholderLabel, dragActivePlaceholderLabel]);
|
|
5497
5591
|
const inputEvents = {
|
|
5498
5592
|
onDragOver: handleDragOver,
|
|
5499
5593
|
onDragLeave: handleDragLeave,
|