@centreon/ui 24.8.6 → 24.9.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/package.json +4 -3
- package/src/@types/globals.d.ts +4 -4
- package/src/ActionsList/ActionsList.styles.ts +1 -1
- package/src/ActionsList/index.stories.tsx +1 -1
- package/src/ActionsList/index.tsx +6 -6
- package/src/Button/Icon/index.stories.tsx +1 -1
- package/src/Button/Icon/index.tsx +1 -1
- package/src/Button/Save/StartIcon.tsx +1 -1
- package/src/Checkbox/Checkbox.tsx +2 -2
- package/src/Colors/index.stories.tsx +0 -2
- package/src/Colors/index.tsx +7 -3
- package/src/ContentWithCircularProgress/index.stories.tsx +1 -1
- package/src/Dashboard/Dashboard.styles.ts +111 -111
- package/src/Dashboard/Grid.tsx +2 -2
- package/src/Dashboard/Item.tsx +3 -3
- package/src/Dashboard/Layout.tsx +3 -3
- package/src/Dashboard/index.tsx +9 -9
- package/src/Dialog/Duplicate/index.test.tsx +1 -1
- package/src/Dialog/Duplicate/index.tsx +5 -2
- package/src/Dialog/UnsavedChanges/index.tsx +2 -2
- package/src/Dialog/index.stories.tsx +1 -1
- package/src/Dialog/index.tsx +5 -5
- package/src/FallbackPage/FallbackPage.tsx +4 -4
- package/src/FileDropZone/index.stories.tsx +1 -1
- package/src/FileDropZone/index.tsx +5 -5
- package/src/FileDropZone/useDropzone.test.ts +1 -1
- package/src/FileDropZone/useDropzone.ts +1 -1
- package/src/Form/CollapsibleGroup.tsx +6 -6
- package/src/Form/Form.cypress.spec.tsx +1 -1
- package/src/Form/Form.stories.tsx +3 -3
- package/src/Form/Form.tsx +5 -4
- package/src/Form/FormButtons.tsx +2 -2
- package/src/Form/Inputs/Autocomplete.tsx +3 -3
- package/src/Form/Inputs/Checkbox.tsx +1 -1
- package/src/Form/Inputs/CheckboxGroup.tsx +2 -2
- package/src/Form/Inputs/ConnectedAutocomplete.tsx +1 -1
- package/src/Form/Inputs/FieldsTable/FieldsTable.tsx +15 -15
- package/src/Form/Inputs/FieldsTable/Row.tsx +2 -2
- package/src/Form/Inputs/List/Content.tsx +1 -1
- package/src/Form/Inputs/List/List.tsx +3 -3
- package/src/Form/Inputs/PasswordEndAdornment.tsx +1 -1
- package/src/Form/Inputs/Radio.tsx +3 -3
- package/src/Form/Inputs/Switch.tsx +1 -1
- package/src/Form/Inputs/Text.tsx +4 -4
- package/src/Form/Inputs/index.tsx +81 -72
- package/src/Form/Inputs/models.ts +14 -14
- package/src/Form/storiesData.tsx +26 -30
- package/src/Form/storiesData.tsx-E +481 -0
- package/src/Graph/BarChart/BarChart.stories.tsx +1 -1
- package/src/Graph/BarChart/BarChart.tsx +3 -3
- package/src/Graph/BarChart/BarGroup.tsx +6 -4
- package/src/Graph/BarChart/BarStack.tsx +4 -4
- package/src/Graph/BarChart/ResponsiveBarChart.tsx +10 -10
- package/src/Graph/BarChart/Tooltip/BarChartTooltip.tsx +5 -5
- package/src/Graph/BarChart/useBarStack.ts +2 -2
- package/src/Graph/BarStack/BarStack.cypress.spec.tsx +1 -1
- package/src/Graph/BarStack/BarStack.stories.tsx +1 -1
- package/src/Graph/BarStack/ResponsiveBarStack.tsx +10 -6
- package/src/Graph/BarStack/useResponsiveBarStack.ts +4 -4
- package/src/Graph/Chart/BasicComponents/Lines/RegularLines/index.tsx +1 -1
- package/src/Graph/Chart/BasicComponents/Lines/RegularLines/useRegularLines.ts +1 -1
- package/src/Graph/Chart/BasicComponents/Lines/StackedLines/index.tsx +4 -4
- package/src/Graph/Chart/BasicComponents/Lines/Threshold/ThresholdWithPatternLines.tsx +1 -1
- package/src/Graph/Chart/BasicComponents/Lines/Threshold/index.tsx +1 -1
- package/src/Graph/Chart/BasicComponents/Lines/Threshold/models.ts +1 -1
- package/src/Graph/Chart/BasicComponents/Lines/Threshold/useScaleThreshold.ts +2 -2
- package/src/Graph/Chart/BasicComponents/Lines/index.tsx +7 -7
- package/src/Graph/Chart/BasicComponents/Lines/models.ts +1 -1
- package/src/Graph/Chart/Chart.cypress.spec.tsx +4 -4
- package/src/Graph/Chart/Chart.stories.tsx +6 -6
- package/src/Graph/Chart/Chart.tsx +11 -11
- package/src/Graph/Chart/InteractiveComponents/AnchorPoint/RegularAnchorPoint.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/AnchorPoint/useTickGraph.ts +1 -1
- package/src/Graph/Chart/InteractiveComponents/Annotations/Annotation/Area.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/Annotations/Annotation/Line.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/Annotations/Annotation/index.tsx +3 -3
- package/src/Graph/Chart/InteractiveComponents/Annotations/Area/Downtime.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/Annotations/EventAnnotations.tsx +3 -3
- package/src/Graph/Chart/InteractiveComponents/Annotations/Line/Comments.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/Annotations/annotationsAtoms.ts +4 -4
- package/src/Graph/Chart/InteractiveComponents/Bar.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/GraphValueTooltip/GraphValueTooltip.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/GraphValueTooltip/GraphValueTooltipContent.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/GraphValueTooltip/useGraphValueTooltip.ts +3 -3
- package/src/Graph/Chart/InteractiveComponents/TimeShiftZones/index.tsx +1 -1
- package/src/Graph/Chart/InteractiveComponents/TimeShiftZones/models.ts +2 -2
- package/src/Graph/Chart/InteractiveComponents/Tooltip/useGraphTooltip.ts +1 -1
- package/src/Graph/Chart/InteractiveComponents/index.tsx +7 -7
- package/src/Graph/Chart/Legend/LegendHeader.tsx +2 -2
- package/src/Graph/Chart/Legend/index.tsx +3 -3
- package/src/Graph/Chart/common/index.ts +5 -5
- package/src/Graph/Chart/helpers/index.ts +5 -5
- package/src/Graph/Chart/index.tsx +2 -2
- package/src/Graph/Chart/models.ts +4 -4
- package/src/Graph/Gauge/AnimatedPie.tsx +1 -1
- package/src/Graph/Gauge/Gauge.cypress.spec.tsx +2 -2
- package/src/Graph/Gauge/PieData.tsx +1 -1
- package/src/Graph/Gauge/ResponsiveGauge.tsx +5 -5
- package/src/Graph/Gauge/models.ts +3 -3
- package/src/Graph/HeatMap/HeatMap.cypress.spec.tsx +3 -3
- package/src/Graph/HeatMap/HeatMapData.json +1 -1
- package/src/Graph/HeatMap/ResponsiveHeatMap.tsx +1 -1
- package/src/Graph/PieChart/PieChart.stories.tsx +1 -1
- package/src/Graph/PieChart/ResponsivePie.tsx +7 -3
- package/src/Graph/SingleBar/ResponsiveSingleBar.tsx +8 -8
- package/src/Graph/SingleBar/SingleBar.cypress.spec.tsx +1 -1
- package/src/Graph/SingleBar/SingleBar.tsx +1 -1
- package/src/Graph/Text/Text.cypress.spec.tsx +2 -2
- package/src/Graph/Tree/DescendantNodes.tsx +1 -1
- package/src/Graph/Tree/Links.tsx +5 -5
- package/src/Graph/Tree/StandaloneTree.tsx +1 -1
- package/src/Graph/Tree/Tree.cypress.spec.tsx +2 -2
- package/src/Graph/Tree/Tree.stories.tsx +2 -2
- package/src/Graph/Tree/Tree.tsx +3 -3
- package/src/Graph/Tree/stories/contents.tsx +2 -2
- package/src/Graph/common/Axes/index.tsx +1 -1
- package/src/Graph/common/Axes/models.ts +1 -1
- package/src/Graph/common/Axes/useAxisY.ts +1 -1
- package/src/Graph/common/BaseChart/BaseChart.tsx +1 -1
- package/src/Graph/common/BaseChart/Header/index.tsx +1 -1
- package/src/Graph/common/Thresholds/Thresholds.tsx +2 -2
- package/src/Graph/common/timeSeries/index.test.ts +57 -45
- package/src/Graph/common/timeSeries/index.test.ts-E +622 -0
- package/src/Graph/common/timeSeries/index.ts +30 -30
- package/src/Graph/common/utils.ts +2 -2
- package/src/Graph/mockedData/annotationData.json +318 -320
- package/src/Graph/mockedData/curvesWithSameColor.json +1 -1
- package/src/Graph/mockedData/exclusionPeriodFirstPeriod.json +366 -586
- package/src/Graph/mockedData/exclusionPeriodSecondPeriod.json +370 -586
- package/src/Graph/mockedData/exclusionPeriodThirdPeriod.json +365 -579
- package/src/Graph/mockedData/lastDay.json +1290 -1324
- package/src/Graph/mockedData/lastDayAreaStack.json +3048 -3104
- package/src/Graph/mockedData/lastDayForward.json +1303 -1336
- package/src/Graph/mockedData/lastDayThreshold.json +2318 -2350
- package/src/Graph/mockedData/lastDayWithIncompleteValues.json +7 -41
- package/src/Graph/mockedData/lastDayWithLotOfUnits.json +1618 -1665
- package/src/Graph/mockedData/lastDayWithNullValues.json +7 -41
- package/src/Graph/mockedData/lastMonth.json +1639 -1672
- package/src/Graph/mockedData/lastWeek.json +2167 -2200
- package/src/Graph/mockedData/pingService.json +4 -12
- package/src/Graph/mockedData/pingServiceLinesBars.json +242 -250
- package/src/Graph/mockedData/pingServiceLinesBarsMixed.json +242 -250
- package/src/Graph/mockedData/pingServiceLinesBarsStacked.json +242 -250
- package/src/Graph/mockedData/pingServiceMixedStacked.json +4 -12
- package/src/Graph/mockedData/pingServiceStacked.json +4 -12
- package/src/Graph/mockedData/zoomPreview.json +370 -740
- package/src/Icon/IconAttach/index.tsx +1 -6
- package/src/Image/Image.tsx +75 -75
- package/src/Image/atoms.ts +3 -3
- package/src/Image/index.stories.tsx +1 -1
- package/src/Image/index.test.tsx +53 -53
- package/src/Image/models.ts +3 -3
- package/src/Image/useLoadImage.ts +49 -49
- package/src/InputField/Number/Number.tsx +2 -2
- package/src/InputField/Search/PersistentTooltip.tsx +2 -2
- package/src/InputField/Search/RegexpHelpTooltip.tsx +1 -1
- package/src/InputField/Search/index.stories.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Connected/Multi/index.test.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Connected/Multi/index.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Connected/index.stories.tsx +4 -4
- package/src/InputField/Select/Autocomplete/Connected/index.test.tsx +6 -6
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +12 -12
- package/src/InputField/Select/Autocomplete/Draggable/MultiConnected.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/SortableList.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Draggable/SortableListContent.tsx +5 -6
- package/src/InputField/Select/Autocomplete/Draggable/index.stories.tsx +6 -6
- package/src/InputField/Select/Autocomplete/Draggable/index.tsx +15 -16
- package/src/InputField/Select/Autocomplete/Multi/index.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Popover/index.tsx +1 -1
- package/src/InputField/Select/Autocomplete/index.stories.tsx +2 -3
- package/src/InputField/Select/Autocomplete/index.tsx +10 -11
- package/src/InputField/Select/IconPopover/index.tsx +3 -3
- package/src/InputField/Select/Option.tsx +1 -1
- package/src/InputField/Select/index.tsx +6 -6
- package/src/InputField/Text/index.stories.tsx +3 -4
- package/src/InputField/Text/index.tsx +3 -3
- package/src/InputField/Text/useAutoSize.ts +62 -62
- package/src/LicenseMessage/index.tsx +1 -1
- package/src/Listing/ActionBar/ColumnMultiSelect.tsx +4 -4
- package/src/Listing/ActionBar/PaginationActions.tsx +1 -1
- package/src/Listing/ActionBar/index.tsx +6 -6
- package/src/Listing/Cell/DataCell.tsx +2 -2
- package/src/Listing/Cell/EllipsisTypography.tsx +0 -2
- package/src/Listing/Cell/index.tsx +7 -8
- package/src/Listing/Checkbox.tsx +1 -1
- package/src/Listing/EmptyResult/EmptyResult.tsx +0 -2
- package/src/Listing/Header/Cell/ListingHeaderCell.styles.ts +1 -1
- package/src/Listing/Header/Cell/ListingHeaderCell.tsx +1 -3
- package/src/Listing/Header/Cell/SelectActionListingHeaderCell.tsx +3 -5
- package/src/Listing/Header/ListingHeader.tsx +6 -7
- package/src/Listing/Header/_internals/DraggableIconButton.tsx +1 -3
- package/src/Listing/Header/_internals/Label.tsx +2 -3
- package/src/Listing/Listing.cypress.spec.tsx +307 -307
- package/src/Listing/Row/Row.tsx +4 -5
- package/src/Listing/Row/SkeletonLoaderRows.tsx +7 -9
- package/src/Listing/index.stories.tsx +1 -1
- package/src/Listing/index.tsx +36 -30
- package/src/Listing/useResizeObserver.ts +1 -1
- package/src/ListingPage/Filter.tsx +15 -18
- package/src/ListingPage/index.tsx +2 -2
- package/src/Logo/CentreonLogo.tsx +2 -2
- package/src/MenuSkeleton/index.tsx +1 -1
- package/src/Module/LicensedModule/LicenseCheck/index.tsx +1 -1
- package/src/Module/index.tsx +3 -3
- package/src/MultiSelectEntries/index.tsx +1 -1
- package/src/MultiSelectEntries/useHover.ts +1 -1
- package/src/Panel/Section/ExpandableSection.tsx +6 -6
- package/src/Panel/Section/index.test.tsx +1 -1
- package/src/Panel/Section/index.tsx +1 -1
- package/src/Panel/index.tsx +15 -13
- package/src/RichTextEditor/ContentEditable.tsx +195 -195
- package/src/RichTextEditor/RichTextEditor.tsx +244 -244
- package/src/RichTextEditor/index.ts +2 -2
- package/src/RichTextEditor/initialEditorState.json +113 -113
- package/src/RichTextEditor/plugins/AutoLinkPlugin/index.tsx +4 -4
- package/src/RichTextEditor/plugins/FloatingLinkEditorPlugin.tsx +10 -10
- package/src/RichTextEditor/plugins/ToolbarPlugin/AlignPicker.tsx +4 -4
- package/src/RichTextEditor/plugins/ToolbarPlugin/BlockButtons.tsx +7 -7
- package/src/RichTextEditor/plugins/ToolbarPlugin/FormatButtons.tsx +124 -124
- package/src/RichTextEditor/plugins/ToolbarPlugin/LinkButton.tsx +5 -5
- package/src/RichTextEditor/plugins/ToolbarPlugin/ListButton.tsx +2 -2
- package/src/RichTextEditor/plugins/ToolbarPlugin/MacrosButton.tsx +4 -4
- package/src/RichTextEditor/plugins/ToolbarPlugin/UndoRedoButtons.tsx +97 -97
- package/src/RichTextEditor/plugins/ToolbarPlugin/index.tsx +62 -62
- package/src/RichTextEditor/translatedLabels.ts +8 -8
- package/src/Snackbar/SnackbarProvider.tsx +3 -4
- package/src/Snackbar/Transition.tsx +5 -6
- package/src/Snackbar/index.tsx +7 -8
- package/src/SortableItems/Item.tsx +3 -3
- package/src/SortableItems/SortableItem.tsx +1 -1
- package/src/SortableItems/index.stories.tsx +5 -6
- package/src/SortableItems/index.tsx +18 -19
- package/src/StatusChip/index.tsx +1 -1
- package/src/StoryBookThemeProvider/index.tsx +35 -36
- package/src/ThemeProvider/index.tsx +8 -10
- package/src/ThemeProvider/palettes.ts +42 -27
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +1 -1
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/index.tsx +1 -1
- package/src/TimePeriods/SelectedTimePeriod.tsx +1 -1
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +3 -3
- package/src/TimePeriods/TimePeriods.tsx +1 -1
- package/src/TimePeriods/helpers/index.ts +1 -1
- package/src/TimePeriods/index.stories.tsx +1 -1
- package/src/TimePeriods/index.tsx +1 -1
- package/src/TimePeriods/models.ts +2 -2
- package/src/TimePeriods/timePeriodsAtoms.ts +1 -1
- package/src/TimePeriods/useTimePeriod.ts +4 -4
- package/src/TopCounterElements/ResourceSubMenu.tsx +1 -4
- package/src/TopCounterElements/StatusCounter.tsx +2 -2
- package/src/Typography/FluidTypography/index.tsx +46 -46
- package/src/Typography/Subtitle.tsx +2 -2
- package/src/Typography/story.utils.tsx +6 -6
- package/src/WallpaperPage/index.tsx +1 -1
- package/src/Wizard/ActionsBar.test.tsx +1 -1
- package/src/Wizard/ActionsBar.tsx +1 -1
- package/src/Wizard/StepIcon.tsx +1 -1
- package/src/Wizard/Stepper.tsx +2 -2
- package/src/Wizard/WizardContent.tsx +1 -1
- package/src/Wizard/index.stories.tsx +2 -2
- package/src/Wizard/index.test.tsx +3 -3
- package/src/Wizard/index.tsx +2 -2
- package/src/Wizard/models.ts +1 -1
- package/src/api/TestQueryProvider.tsx +24 -24
- package/src/api/buildListingDecoder.ts +1 -1
- package/src/api/buildListingEndpoint/getSearchQueryParameterValue.ts +11 -11
- package/src/api/buildListingEndpoint/index.ts +1 -1
- package/src/api/useFetchQuery/index.test.ts +1 -1
- package/src/api/useFetchQuery/index.ts +8 -8
- package/src/api/useGraphQuery/index.ts +1 -1
- package/src/api/useMutationQuery/index.test.ts +1 -1
- package/src/api/useMutationQuery/index.ts +4 -4
- package/src/api/useRequest/index.test.ts +1 -1
- package/src/api/useRequest/index.ts +3 -3
- package/src/base/tokens/source/$metadata.json +2 -4
- package/src/base/tokens/source/base.json +1 -1
- package/src/base/tokens/themes/base.tokens.json +34 -166
- package/src/base/tokens/themes/ui-dark.tokens.json +34 -166
- package/src/base/tokens/themes/ui-light.tokens.json +34 -166
- package/src/components/Button/Icon/IconButton.tsx +1 -1
- package/src/components/CollapsibleItem/CollapsibleItem.tsx +2 -2
- package/src/components/DataTable/DataListing.tsx +1 -1
- package/src/components/DataTable/DataTable.cypress.spec.tsx +1 -1
- package/src/components/DataTable/DataTable.stories.tsx +4 -1
- package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +1 -1
- package/src/components/DataTable/index.ts +2 -2
- package/src/components/Form/AccessRights/AccessRights.cypress.spec.tsx +11 -11
- package/src/components/Form/AccessRights/Actions/Actions.tsx +1 -1
- package/src/components/Form/AccessRights/List/Item.tsx +5 -5
- package/src/components/Form/AccessRights/List/List.tsx +4 -4
- package/src/components/Form/AccessRights/ShareInput/ContactSwitch.tsx +2 -2
- package/src/components/Form/AccessRights/ShareInput/ShareInput.styles.ts +1 -1
- package/src/components/Form/AccessRights/ShareInput/ShareInput.tsx +3 -3
- package/src/components/Form/AccessRights/ShareInput/useShareInput.tsx +2 -2
- package/src/components/Form/AccessRights/Stats/Stats.tsx +2 -2
- package/src/components/Form/AccessRights/atoms.ts +1 -1
- package/src/components/Form/AccessRights/storiesData.ts +1 -1
- package/src/components/Form/AccessRights/useAccessRightsChange.ts +1 -1
- package/src/components/Form/Dashboard/DashboardDuplicationForm.tsx +3 -3
- package/src/components/Form/Dashboard/DashboardForm.tsx +5 -5
- package/src/components/Form/Dashboard/GlobalRefreshFieldOption.tsx +4 -4
- package/src/components/Header/PageHeader/PageHeader.tsx +1 -1
- package/src/components/Header/PageHeader/PageHeaderActions.tsx +1 -1
- package/src/components/Header/PageHeader/PageHeaderMain.tsx +1 -1
- package/src/components/Header/PageHeader/PageHeaderMenu.tsx +1 -1
- package/src/components/Header/PageHeader/PageHeaderTitle.tsx +1 -1
- package/src/components/Header/PageHeader/index.ts +2 -2
- package/src/components/Inputs/Switch/Switch.tsx +1 -1
- package/src/components/ItemComposition/ItemComposition.stories.tsx +6 -4
- package/src/components/ItemComposition/index.ts +1 -1
- package/src/components/Layout/PageLayout/PageLayout.stories.tsx +1 -1
- package/src/components/Layout/PageLayout/PageQuickAccess.tsx +12 -13
- package/src/components/Layout/PageLayout/index.ts +2 -2
- package/src/components/List/Item/ListItem.tsx +3 -3
- package/src/components/List/Item/index.ts +2 -2
- package/src/components/List/List.stories.tsx +16 -14
- package/src/components/List/List.tsx +2 -2
- package/src/components/List/index.ts +1 -1
- package/src/components/Menu/Button/MenuButton.tsx +1 -1
- package/src/components/Menu/index.ts +2 -2
- package/src/components/Menu/useMenu.tsx +3 -3
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.cypress.spec.tsx +1 -1
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.stories.tsx +1 -1
- package/src/components/Modal/ConfirmationModal/ConfirmationModal.tsx +1 -1
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Modal/ModalBody.tsx +1 -1
- package/src/components/Modal/ModalHeader.tsx +1 -1
- package/src/components/Modal/index.ts +2 -2
- package/src/components/Tooltip/ConfirmationTooltip/ConfirmationTooltip.tsx +2 -2
- package/src/components/Tooltip/ConfirmationTooltip/TooltipContent.tsx +1 -1
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +1 -1
- package/src/components/Zoom/Minimap.tsx +1 -1
- package/src/components/Zoom/Zoom.stories.tsx +1 -1
- package/src/components/Zoom/ZoomContent.tsx +3 -3
- package/src/components/Zoom/localPoint.ts +4 -4
- package/src/components/Zoom/useMinimap.ts +1 -1
- package/src/queryParameters/index.ts +1 -1
- package/src/styles/tokens/themes/_ui-dark.tokens.json +34 -166
- package/src/styles/tokens/themes/_ui-light.tokens.json +34 -166
- package/src/utils/index.ts +29 -29
- package/src/utils/resourcesStatusURL.ts +2 -2
- package/src/utils/sanitizedHTML.ts +1 -1
- package/src/utils/useCopyToClipboard.ts +1 -1
- package/src/utils/useDebounce.ts +1 -1
- package/src/utils/useFullscreen/useFullscreen.ts +2 -2
- package/src/utils/useInfiniteScrollListing.ts +129 -129
- package/src/utils/useIntersectionObserver.ts +1 -1
- package/src/utils/useKeyObserver.tsx +1 -1
- package/src/utils/useLicenseExpirationWarning.test.tsx +1 -1
- package/src/utils/useLicenseExpirationWarning.ts +1 -1
- package/src/utils/useLocaleDateTimeFormat/index.test.tsx +3 -3
- package/src/utils/useLocaleDateTimeFormat/index.ts +1 -1
- package/src/utils/useLocaleDateTimeFormat/localeFallback.test.tsx +4 -4
- package/src/utils/useLocaleTimezoneDate/LocaleTimezoneDate.cypress.spec.tsx +2 -2
- package/src/utils/useMemoComponent.ts +1 -1
- package/src/utils/usePluralizedTranslation.ts +2 -2
- package/src/utils/useViewportIntersection.ts +1 -1
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
CAN_UNDO_COMMAND,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
import { IconButton } from '../../..';
|
|
17
|
-
import { labelRedo, labelUndo } from '../../translatedLabels';
|
|
18
|
-
|
|
19
|
-
import { useStyles } from './ToolbarPlugin.styles';
|
|
20
|
-
|
|
21
|
-
const LowPriority = 1;
|
|
22
|
-
|
|
23
|
-
interface Props {
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const UndoRedoButtons = ({ disabled }: Props): JSX.Element => {
|
|
28
|
-
const { classes } = useStyles();
|
|
29
|
-
|
|
30
|
-
const { t } = useTranslation();
|
|
31
|
-
|
|
32
|
-
const [canUndo, setCanUndo] = useState(false);
|
|
33
|
-
const [canRedo, setCanRedo] = useState(false);
|
|
34
|
-
|
|
35
|
-
const [editor] = useLexicalComposerContext();
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
return mergeRegister(
|
|
39
|
-
editor.registerCommand(
|
|
40
|
-
CAN_UNDO_COMMAND,
|
|
41
|
-
(payload) => {
|
|
42
|
-
setCanUndo(payload);
|
|
43
|
-
|
|
44
|
-
return false;
|
|
45
|
-
},
|
|
46
|
-
LowPriority
|
|
47
|
-
),
|
|
48
|
-
editor.registerCommand(
|
|
49
|
-
CAN_REDO_COMMAND,
|
|
50
|
-
(payload) => {
|
|
51
|
-
setCanRedo(payload);
|
|
52
|
-
|
|
53
|
-
return false;
|
|
54
|
-
},
|
|
55
|
-
LowPriority
|
|
56
|
-
)
|
|
57
|
-
);
|
|
58
|
-
}, []);
|
|
59
|
-
|
|
60
|
-
const undo = (): void => {
|
|
61
|
-
editor.dispatchCommand(UNDO_COMMAND, undefined);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const redo = (): void => {
|
|
65
|
-
editor.dispatchCommand(REDO_COMMAND, undefined);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const translatedUndo = t(labelUndo);
|
|
69
|
-
const translatedRedo = t(labelRedo);
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<>
|
|
73
|
-
<IconButton
|
|
74
|
-
ariaLabel={translatedUndo}
|
|
75
|
-
className={classes.button}
|
|
76
|
-
disabled={!canUndo || disabled}
|
|
77
|
-
title={translatedUndo}
|
|
78
|
-
tooltipPlacement="top"
|
|
79
|
-
onClick={undo}
|
|
80
|
-
>
|
|
81
|
-
<UndoIcon />
|
|
82
|
-
</IconButton>
|
|
83
|
-
<IconButton
|
|
84
|
-
ariaLabel={translatedRedo}
|
|
85
|
-
className={classes.button}
|
|
86
|
-
disabled={!canRedo || disabled}
|
|
87
|
-
title={translatedRedo}
|
|
88
|
-
tooltipPlacement="top"
|
|
89
|
-
onClick={redo}
|
|
90
|
-
>
|
|
91
|
-
<RedoIcon />
|
|
92
|
-
</IconButton>
|
|
93
|
-
</>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export default UndoRedoButtons;
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
4
|
+
import { mergeRegister } from '@lexical/utils';
|
|
5
|
+
import {
|
|
6
|
+
CAN_REDO_COMMAND,
|
|
7
|
+
CAN_UNDO_COMMAND,
|
|
8
|
+
REDO_COMMAND,
|
|
9
|
+
UNDO_COMMAND
|
|
10
|
+
} from 'lexical';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
|
+
|
|
13
|
+
import RedoIcon from '@mui/icons-material/Redo';
|
|
14
|
+
import UndoIcon from '@mui/icons-material/Undo';
|
|
15
|
+
|
|
16
|
+
import { IconButton } from '../../..';
|
|
17
|
+
import { labelRedo, labelUndo } from '../../translatedLabels';
|
|
18
|
+
|
|
19
|
+
import { useStyles } from './ToolbarPlugin.styles';
|
|
20
|
+
|
|
21
|
+
const LowPriority = 1;
|
|
22
|
+
|
|
23
|
+
interface Props {
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const UndoRedoButtons = ({ disabled }: Props): JSX.Element => {
|
|
28
|
+
const { classes } = useStyles();
|
|
29
|
+
|
|
30
|
+
const { t } = useTranslation();
|
|
31
|
+
|
|
32
|
+
const [canUndo, setCanUndo] = useState(false);
|
|
33
|
+
const [canRedo, setCanRedo] = useState(false);
|
|
34
|
+
|
|
35
|
+
const [editor] = useLexicalComposerContext();
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
return mergeRegister(
|
|
39
|
+
editor.registerCommand(
|
|
40
|
+
CAN_UNDO_COMMAND,
|
|
41
|
+
(payload) => {
|
|
42
|
+
setCanUndo(payload);
|
|
43
|
+
|
|
44
|
+
return false;
|
|
45
|
+
},
|
|
46
|
+
LowPriority
|
|
47
|
+
),
|
|
48
|
+
editor.registerCommand(
|
|
49
|
+
CAN_REDO_COMMAND,
|
|
50
|
+
(payload) => {
|
|
51
|
+
setCanRedo(payload);
|
|
52
|
+
|
|
53
|
+
return false;
|
|
54
|
+
},
|
|
55
|
+
LowPriority
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
const undo = (): void => {
|
|
61
|
+
editor.dispatchCommand(UNDO_COMMAND, undefined);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const redo = (): void => {
|
|
65
|
+
editor.dispatchCommand(REDO_COMMAND, undefined);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const translatedUndo = t(labelUndo);
|
|
69
|
+
const translatedRedo = t(labelRedo);
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
<IconButton
|
|
74
|
+
ariaLabel={translatedUndo}
|
|
75
|
+
className={classes.button}
|
|
76
|
+
disabled={!canUndo || disabled}
|
|
77
|
+
title={translatedUndo}
|
|
78
|
+
tooltipPlacement="top"
|
|
79
|
+
onClick={undo}
|
|
80
|
+
>
|
|
81
|
+
<UndoIcon />
|
|
82
|
+
</IconButton>
|
|
83
|
+
<IconButton
|
|
84
|
+
ariaLabel={translatedRedo}
|
|
85
|
+
className={classes.button}
|
|
86
|
+
disabled={!canRedo || disabled}
|
|
87
|
+
title={translatedRedo}
|
|
88
|
+
tooltipPlacement="top"
|
|
89
|
+
onClick={redo}
|
|
90
|
+
>
|
|
91
|
+
<RedoIcon />
|
|
92
|
+
</IconButton>
|
|
93
|
+
</>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default UndoRedoButtons;
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { makeStyles } from 'tss-react/mui';
|
|
2
|
-
|
|
3
|
-
import { Divider } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import ListButton from './ListButton';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
interface Props {
|
|
14
|
-
className?: string;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
displayBlockButtons: boolean;
|
|
17
|
-
displayMacrosButton?: boolean;
|
|
18
|
-
editable: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const useStyles = makeStyles()((theme) => ({
|
|
22
|
-
container: {
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
columnGap: theme.spacing(1),
|
|
25
|
-
display: 'flex',
|
|
26
|
-
marginBottom: theme.spacing(1)
|
|
27
|
-
}
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
const ToolbarPlugin = ({
|
|
31
|
-
editable,
|
|
32
|
-
displayMacrosButton,
|
|
33
|
-
disabled,
|
|
34
|
-
displayBlockButtons,
|
|
35
|
-
className
|
|
36
|
-
}: Props): JSX.Element | null => {
|
|
37
|
-
const { cx, classes } = useStyles();
|
|
38
|
-
|
|
39
|
-
return editable ? (
|
|
40
|
-
<div className={cx(classes.container, className)}>
|
|
41
|
-
<UndoRedoButtons disabled={disabled} />
|
|
42
|
-
{displayBlockButtons && (
|
|
43
|
-
<>
|
|
44
|
-
<Divider flexItem orientation="vertical" />
|
|
45
|
-
<BlockButtons disabled={disabled} />
|
|
46
|
-
</>
|
|
47
|
-
)}
|
|
48
|
-
<FormatButtons disabled={disabled} />
|
|
49
|
-
<AlignPicker disabled={disabled} />
|
|
50
|
-
<ListButton disabled={disabled} />
|
|
51
|
-
<LinkButton disabled={disabled} />
|
|
52
|
-
{displayMacrosButton && (
|
|
53
|
-
<>
|
|
54
|
-
<Divider flexItem orientation="vertical" />
|
|
55
|
-
<MacrosButton disabled={disabled} />
|
|
56
|
-
</>
|
|
57
|
-
)}
|
|
58
|
-
</div>
|
|
59
|
-
) : null;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default ToolbarPlugin;
|
|
1
|
+
import { makeStyles } from 'tss-react/mui';
|
|
2
|
+
|
|
3
|
+
import { Divider } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
import AlignPicker from './AlignPicker';
|
|
6
|
+
import BlockButtons from './BlockButtons';
|
|
7
|
+
import FormatButtons from './FormatButtons';
|
|
8
|
+
import LinkButton from './LinkButton';
|
|
9
|
+
import ListButton from './ListButton';
|
|
10
|
+
import MacrosButton from './MacrosButton';
|
|
11
|
+
import UndoRedoButtons from './UndoRedoButtons';
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
className?: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
displayBlockButtons: boolean;
|
|
17
|
+
displayMacrosButton?: boolean;
|
|
18
|
+
editable: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const useStyles = makeStyles()((theme) => ({
|
|
22
|
+
container: {
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
columnGap: theme.spacing(1),
|
|
25
|
+
display: 'flex',
|
|
26
|
+
marginBottom: theme.spacing(1)
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
const ToolbarPlugin = ({
|
|
31
|
+
editable,
|
|
32
|
+
displayMacrosButton,
|
|
33
|
+
disabled,
|
|
34
|
+
displayBlockButtons,
|
|
35
|
+
className
|
|
36
|
+
}: Props): JSX.Element | null => {
|
|
37
|
+
const { cx, classes } = useStyles();
|
|
38
|
+
|
|
39
|
+
return editable ? (
|
|
40
|
+
<div className={cx(classes.container, className)}>
|
|
41
|
+
<UndoRedoButtons disabled={disabled} />
|
|
42
|
+
{displayBlockButtons && (
|
|
43
|
+
<>
|
|
44
|
+
<Divider flexItem orientation="vertical" />
|
|
45
|
+
<BlockButtons disabled={disabled} />
|
|
46
|
+
</>
|
|
47
|
+
)}
|
|
48
|
+
<FormatButtons disabled={disabled} />
|
|
49
|
+
<AlignPicker disabled={disabled} />
|
|
50
|
+
<ListButton disabled={disabled} />
|
|
51
|
+
<LinkButton disabled={disabled} />
|
|
52
|
+
{displayMacrosButton && (
|
|
53
|
+
<>
|
|
54
|
+
<Divider flexItem orientation="vertical" />
|
|
55
|
+
<MacrosButton disabled={disabled} />
|
|
56
|
+
</>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
) : null;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default ToolbarPlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export const labelUndo = 'Undo';
|
|
2
|
-
export const labelRedo = 'Redo';
|
|
3
|
-
export const labelInputLink = 'Insert link';
|
|
4
|
-
export const labelSavedLink = 'Saved link';
|
|
5
|
-
export const labelEditLink = 'Edit link';
|
|
6
|
-
export const labelAlignPicker = 'align picker';
|
|
7
|
-
export const labelUnorderedList = 'Unordered List';
|
|
8
|
-
export const labelOrderedList = 'Ordered List';
|
|
1
|
+
export const labelUndo = 'Undo';
|
|
2
|
+
export const labelRedo = 'Redo';
|
|
3
|
+
export const labelInputLink = 'Insert link';
|
|
4
|
+
export const labelSavedLink = 'Saved link';
|
|
5
|
+
export const labelEditLink = 'Edit link';
|
|
6
|
+
export const labelAlignPicker = 'align picker';
|
|
7
|
+
export const labelUnorderedList = 'Unordered List';
|
|
8
|
+
export const labelOrderedList = 'Ordered List';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
1
|
import { SnackbarProvider as NotistackSnackbarProvider } from 'notistack';
|
|
4
2
|
|
|
5
3
|
import { TransitionProps } from '@mui/material/transitions';
|
|
6
4
|
|
|
5
|
+
import { JSXElementConstructor, ReactElement } from 'react';
|
|
7
6
|
import Transition from './Transition';
|
|
8
7
|
|
|
9
8
|
interface Props {
|
|
10
|
-
children:
|
|
9
|
+
children: ReactElement;
|
|
11
10
|
maxSnackbars?: number;
|
|
12
11
|
}
|
|
13
12
|
|
|
@@ -18,7 +17,7 @@ const SnackbarProvider = ({
|
|
|
18
17
|
return (
|
|
19
18
|
<NotistackSnackbarProvider
|
|
20
19
|
TransitionComponent={
|
|
21
|
-
Transition as
|
|
20
|
+
Transition as JSXElementConstructor<
|
|
22
21
|
TransitionProps & {
|
|
23
22
|
children;
|
|
24
23
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
TransitionActions,
|
|
3
|
+
TransitionProps as _TransitionProps
|
|
6
4
|
} from 'react-transition-group/Transition';
|
|
7
5
|
|
|
8
6
|
import { Fade } from '@mui/material';
|
|
7
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
9
8
|
|
|
10
9
|
type TransitionHandlerKeys =
|
|
11
10
|
| 'onEnter'
|
|
@@ -24,11 +23,11 @@ type TransitionKeys =
|
|
|
24
23
|
interface TransitionProps
|
|
25
24
|
extends TransitionActions,
|
|
26
25
|
Partial<Pick<_TransitionProps, TransitionKeys>> {
|
|
27
|
-
style?:
|
|
26
|
+
style?: CSSProperties;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
interface Props extends TransitionProps {
|
|
31
|
-
children?:
|
|
30
|
+
children?: ReactNode;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
const Transition = ({ children, ...rest }: Props): JSX.Element => (
|
package/src/Snackbar/index.tsx
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { useSnackbar, SnackbarContent } from 'notistack';
|
|
1
|
+
import { SnackbarContent, useSnackbar } from 'notistack';
|
|
4
2
|
import { isNil, not } from 'ramda';
|
|
5
3
|
import { makeStyles } from 'tss-react/mui';
|
|
6
4
|
|
|
7
|
-
import { IconButton, Alert } from '@mui/material';
|
|
8
5
|
import IconClose from '@mui/icons-material/Close';
|
|
6
|
+
import { Alert, IconButton } from '@mui/material';
|
|
9
7
|
|
|
10
8
|
import { sanitizedHTML } from '../utils';
|
|
11
9
|
|
|
10
|
+
import { forwardRef, useEffect, useRef } from 'react';
|
|
12
11
|
import Severity from './Severity';
|
|
13
12
|
|
|
14
13
|
const useStyles = makeStyles()((theme) => ({
|
|
@@ -36,16 +35,16 @@ export interface SnackbarProps {
|
|
|
36
35
|
severity: Severity;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
const Snackbar =
|
|
38
|
+
const Snackbar = forwardRef(
|
|
40
39
|
(
|
|
41
40
|
{ message, id, severity }: SnackbarProps,
|
|
42
41
|
ref: React.ForwardedRef<HTMLDivElement>
|
|
43
42
|
): JSX.Element => {
|
|
44
43
|
const { classes } = useStyles();
|
|
45
44
|
const { closeSnackbar } = useSnackbar();
|
|
46
|
-
const timeoutId =
|
|
45
|
+
const timeoutId = useRef<NodeJS.Timeout | undefined>();
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
useEffect((): void => {
|
|
49
48
|
timeoutId.current = setTimeout(() => {
|
|
50
49
|
closeSnackbar(id);
|
|
51
50
|
}, 6000);
|
|
@@ -53,7 +52,7 @@ const Snackbar = React.forwardRef(
|
|
|
53
52
|
|
|
54
53
|
const close = (): void => {
|
|
55
54
|
if (not(isNil(timeoutId.current))) {
|
|
56
|
-
clearTimeout(timeoutId.current
|
|
55
|
+
clearTimeout(timeoutId.current);
|
|
57
56
|
}
|
|
58
57
|
closeSnackbar(id);
|
|
59
58
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ForwardedRef, forwardRef } from 'react';
|
|
2
2
|
|
|
3
3
|
interface Props extends Record<string, unknown> {
|
|
4
4
|
Content: (props) => JSX.Element;
|
|
5
5
|
isInDragOverlay?: boolean;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const Item =
|
|
9
|
-
({ Content, ...props }: Props, ref:
|
|
8
|
+
const Item = forwardRef(
|
|
9
|
+
({ Content, ...props }: Props, ref: ForwardedRef<HTMLDivElement>) => {
|
|
10
10
|
return <Content {...props} itemRef={ref} />;
|
|
11
11
|
}
|
|
12
12
|
);
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
4
1
|
import { DraggableSyntheticListeners, rectIntersection } from '@dnd-kit/core';
|
|
5
2
|
import {
|
|
3
|
+
SortingStrategy,
|
|
6
4
|
horizontalListSortingStrategy,
|
|
7
5
|
rectSortingStrategy,
|
|
8
|
-
SortingStrategy,
|
|
9
6
|
verticalListSortingStrategy
|
|
10
7
|
} from '@dnd-kit/sortable';
|
|
8
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
11
9
|
import { not } from 'ramda';
|
|
12
10
|
import { makeStyles } from 'tss-react/mui';
|
|
13
11
|
|
|
14
|
-
import { Paper, Typography, Grid, IconButton } from '@mui/material';
|
|
15
12
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
13
|
+
import { Grid, IconButton, Paper, Typography } from '@mui/material';
|
|
16
14
|
|
|
15
|
+
import { RefObject } from 'react';
|
|
17
16
|
import SortableItems, { RootComponentProps } from '.';
|
|
18
17
|
|
|
19
18
|
export default {
|
|
@@ -89,7 +88,7 @@ const useContentStyles = makeStyles<StylesProps>()((theme, { isDragging }) => ({
|
|
|
89
88
|
interface ContentProps extends Entity {
|
|
90
89
|
attributes;
|
|
91
90
|
isDragging: boolean;
|
|
92
|
-
itemRef:
|
|
91
|
+
itemRef: RefObject<HTMLDivElement>;
|
|
93
92
|
listeners: DraggableSyntheticListeners;
|
|
94
93
|
style;
|
|
95
94
|
}
|
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
1
|
import {
|
|
2
|
+
CollisionDetection,
|
|
4
3
|
DndContext,
|
|
4
|
+
DragEndEvent,
|
|
5
|
+
DragOverEvent,
|
|
5
6
|
DragOverlay,
|
|
6
|
-
|
|
7
|
+
DragStartEvent,
|
|
8
|
+
DraggableSyntheticListeners,
|
|
7
9
|
KeyboardSensor,
|
|
10
|
+
MouseSensor,
|
|
11
|
+
Over,
|
|
8
12
|
PointerSensor,
|
|
9
13
|
useSensor,
|
|
10
|
-
useSensors
|
|
11
|
-
CollisionDetection,
|
|
12
|
-
DraggableSyntheticListeners,
|
|
13
|
-
DragOverEvent,
|
|
14
|
-
DragStartEvent,
|
|
15
|
-
DragEndEvent,
|
|
16
|
-
Over
|
|
14
|
+
useSensors
|
|
17
15
|
} from '@dnd-kit/core';
|
|
18
16
|
import { SortableContext, SortingStrategy } from '@dnd-kit/sortable';
|
|
19
17
|
import {
|
|
18
|
+
path,
|
|
20
19
|
equals,
|
|
21
20
|
find,
|
|
22
21
|
indexOf,
|
|
23
22
|
isNil,
|
|
24
23
|
move,
|
|
25
24
|
not,
|
|
26
|
-
path,
|
|
27
|
-
pipe,
|
|
28
|
-
propEq,
|
|
29
25
|
pick,
|
|
30
|
-
|
|
26
|
+
pipe,
|
|
27
|
+
pluck,
|
|
28
|
+
propEq
|
|
31
29
|
} from 'ramda';
|
|
32
30
|
|
|
33
31
|
import { useTheme } from '@mui/material';
|
|
34
32
|
|
|
35
|
-
import
|
|
33
|
+
import { RefObject, useEffect, useState } from 'react';
|
|
36
34
|
import Item from './Item';
|
|
35
|
+
import SortableItem from './SortableItem';
|
|
37
36
|
|
|
38
37
|
interface ContentProps {
|
|
39
38
|
attributes;
|
|
40
39
|
index;
|
|
41
40
|
isDragging: boolean;
|
|
42
|
-
itemRef:
|
|
41
|
+
itemRef: RefObject<HTMLDivElement>;
|
|
43
42
|
listeners: DraggableSyntheticListeners;
|
|
44
43
|
style;
|
|
45
44
|
}
|
|
@@ -106,8 +105,8 @@ const SortableItems = <T extends { [propertyToFilterItemsOn]: string }>({
|
|
|
106
105
|
const getItemsIds = (): Array<string> =>
|
|
107
106
|
pluck(propertyToFilterItemsOn, items);
|
|
108
107
|
|
|
109
|
-
const [activeId, setActiveId] =
|
|
110
|
-
const [sortableItemsIds, setSortableItemsIds] =
|
|
108
|
+
const [activeId, setActiveId] = useState<string | null>(null);
|
|
109
|
+
const [sortableItemsIds, setSortableItemsIds] = useState(getItemsIds());
|
|
111
110
|
|
|
112
111
|
const sensors = useSensors(
|
|
113
112
|
useSensor(MouseSensor),
|
|
@@ -168,7 +167,7 @@ const SortableItems = <T extends { [propertyToFilterItemsOn]: string }>({
|
|
|
168
167
|
|
|
169
168
|
const activeItem = getItemById(activeId) as Record<string, unknown>;
|
|
170
169
|
|
|
171
|
-
|
|
170
|
+
useEffect(() => {
|
|
172
171
|
if (not(updateSortableItemsOnItemsChange)) {
|
|
173
172
|
return;
|
|
174
173
|
}
|
package/src/StatusChip/index.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { makeStyles } from 'tss-react/mui';
|
|
|
5
5
|
|
|
6
6
|
import { Chip, ChipProps } from '@mui/material';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { SeverityCode, getStatusColors } from '../utils/statuses';
|
|
9
9
|
|
|
10
10
|
export type Props = {
|
|
11
11
|
clickable?: boolean;
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ThemeProvider as MuiThemeProvider,
|
|
6
|
-
StyledEngineProvider,
|
|
7
|
-
createTheme
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export default StoryBookThemeProvider;
|
|
1
|
+
import { ReactElement, useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CssBaseline,
|
|
5
|
+
ThemeProvider as MuiThemeProvider,
|
|
6
|
+
StyledEngineProvider,
|
|
7
|
+
createTheme
|
|
8
|
+
} from '@mui/material';
|
|
9
|
+
|
|
10
|
+
import { ThemeMode } from '@centreon/ui-context';
|
|
11
|
+
|
|
12
|
+
import { getTheme } from '../ThemeProvider';
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
children: ReactElement;
|
|
16
|
+
themeMode: ThemeMode;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const StoryBookThemeProvider = ({
|
|
20
|
+
children,
|
|
21
|
+
themeMode
|
|
22
|
+
}: Props): JSX.Element => {
|
|
23
|
+
const theme = useMemo(() => createTheme(getTheme(themeMode)), [themeMode]);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<StyledEngineProvider injectFirst>
|
|
27
|
+
<MuiThemeProvider theme={theme}>
|
|
28
|
+
{children}
|
|
29
|
+
<CssBaseline />
|
|
30
|
+
</MuiThemeProvider>
|
|
31
|
+
</StyledEngineProvider>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default StoryBookThemeProvider;
|