@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,5 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
import LoadingSkeleton from '../../LoadingSkeleton';
|
|
4
2
|
|
|
5
3
|
import { EmptyRow } from './EmptyRow';
|
|
@@ -10,13 +8,13 @@ interface SkeletonLoaderProps {
|
|
|
10
8
|
|
|
11
9
|
const SkeletonLoader = ({ rows = 10 }: SkeletonLoaderProps): JSX.Element => (
|
|
12
10
|
<>
|
|
13
|
-
{[...Array(rows)]
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
{[...Array(rows)]
|
|
12
|
+
.map((_, i) => i)
|
|
13
|
+
.map((v) => (
|
|
14
|
+
<EmptyRow key={`skeleton-row-${v}`}>
|
|
15
|
+
<LoadingSkeleton variant="text" width="100%" />
|
|
16
|
+
</EmptyRow>
|
|
17
|
+
))}
|
|
20
18
|
</>
|
|
21
19
|
);
|
|
22
20
|
|
|
@@ -331,7 +331,7 @@ const listingWithSubItems = [...tenElements].map((_, index) => ({
|
|
|
331
331
|
selected: false,
|
|
332
332
|
subItems:
|
|
333
333
|
index % 2 === 0
|
|
334
|
-
? [...tenElements].map((
|
|
334
|
+
? [...tenElements].map((_, subIndex) => ({
|
|
335
335
|
active: false,
|
|
336
336
|
description: `Sub item ${subIndex + (index + 10) * 10} description`,
|
|
337
337
|
disableCheckbox: false,
|
package/src/Listing/index.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/no-array-index-key */
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import { useAtomValue } from 'jotai';
|
|
5
4
|
import {
|
|
6
5
|
concat,
|
|
7
6
|
differenceWith,
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
findIndex,
|
|
11
10
|
gt,
|
|
12
11
|
gte,
|
|
12
|
+
identity,
|
|
13
13
|
includes,
|
|
14
14
|
isNil,
|
|
15
15
|
last,
|
|
@@ -27,19 +27,31 @@ import {
|
|
|
27
27
|
uniqBy
|
|
28
28
|
} from 'ramda';
|
|
29
29
|
import { useTranslation } from 'react-i18next';
|
|
30
|
-
import { useAtomValue } from 'jotai';
|
|
31
30
|
|
|
32
31
|
import { Box, LinearProgress, Table, TableBody } from '@mui/material';
|
|
33
32
|
|
|
34
33
|
import { ListingVariant } from '@centreon/ui-context';
|
|
35
34
|
|
|
36
|
-
import { useKeyObserver, useMemoComponent } from '../utils';
|
|
37
35
|
import { ParentSize } from '..';
|
|
36
|
+
import { useKeyObserver, useMemoComponent } from '../utils';
|
|
38
37
|
|
|
38
|
+
import {
|
|
39
|
+
RefObject,
|
|
40
|
+
useCallback,
|
|
41
|
+
useEffect,
|
|
42
|
+
useMemo,
|
|
43
|
+
useRef,
|
|
44
|
+
useState
|
|
45
|
+
} from 'react';
|
|
39
46
|
import ListingActionBar from './ActionBar';
|
|
40
47
|
import Cell from './Cell';
|
|
41
48
|
import DataCell from './Cell/DataCell';
|
|
42
49
|
import Checkbox from './Checkbox';
|
|
50
|
+
import { EmptyResult } from './EmptyResult/EmptyResult';
|
|
51
|
+
import { ListingHeader } from './Header';
|
|
52
|
+
import { useListingStyles } from './Listing.styles';
|
|
53
|
+
import ListingRow from './Row/Row';
|
|
54
|
+
import { SkeletonLoader } from './Row/SkeletonLoaderRows';
|
|
43
55
|
import {
|
|
44
56
|
Column,
|
|
45
57
|
ColumnConfiguration,
|
|
@@ -48,14 +60,9 @@ import {
|
|
|
48
60
|
RowId,
|
|
49
61
|
SortOrder
|
|
50
62
|
} from './models';
|
|
51
|
-
import
|
|
63
|
+
import { subItemsPivotsAtom } from './tableAtoms';
|
|
52
64
|
import { labelNoResultFound } from './translatedLabels';
|
|
53
65
|
import useStyleTable from './useStyleTable';
|
|
54
|
-
import { useListingStyles } from './Listing.styles';
|
|
55
|
-
import { EmptyResult } from './EmptyResult/EmptyResult';
|
|
56
|
-
import { SkeletonLoader } from './Row/SkeletonLoaderRows';
|
|
57
|
-
import { ListingHeader } from './Header';
|
|
58
|
-
import { subItemsPivotsAtom } from './tableAtoms';
|
|
59
66
|
|
|
60
67
|
const subItemPrefixKey = 'listing';
|
|
61
68
|
|
|
@@ -69,9 +76,9 @@ const getVisibleColumns = ({
|
|
|
69
76
|
return columns;
|
|
70
77
|
}
|
|
71
78
|
|
|
72
|
-
return selectedColumnIds
|
|
73
|
-
columns.find(propEq(id, 'id'))
|
|
74
|
-
|
|
79
|
+
return selectedColumnIds
|
|
80
|
+
.map((id) => columns.find(propEq(id, 'id')))
|
|
81
|
+
.filter(identity) as Array<Column>;
|
|
75
82
|
};
|
|
76
83
|
|
|
77
84
|
interface CustomStyle {
|
|
@@ -198,19 +205,19 @@ const Listing = <TRow extends { id: RowId; internalListingParentId?: RowId }>({
|
|
|
198
205
|
|
|
199
206
|
const { t } = useTranslation();
|
|
200
207
|
|
|
201
|
-
const [hoveredRowId, setHoveredRowId] =
|
|
202
|
-
const [shiftKeyDownRowPivot, setShiftKeyDownRowPivot] =
|
|
208
|
+
const [hoveredRowId, setHoveredRowId] = useState<RowId | null>(null);
|
|
209
|
+
const [shiftKeyDownRowPivot, setShiftKeyDownRowPivot] = useState<
|
|
203
210
|
number | null
|
|
204
211
|
>(null);
|
|
205
|
-
const [lastSelectionIndex, setLastSelectionIndex] =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const containerRef =
|
|
209
|
-
const actionBarRef =
|
|
212
|
+
const [lastSelectionIndex, setLastSelectionIndex] = useState<number | null>(
|
|
213
|
+
null
|
|
214
|
+
);
|
|
215
|
+
const containerRef = useRef<HTMLDivElement>();
|
|
216
|
+
const actionBarRef = useRef<HTMLDivElement>();
|
|
210
217
|
|
|
211
218
|
const subItemsPivots = useAtomValue(subItemsPivotsAtom);
|
|
212
219
|
|
|
213
|
-
const allSubItemIds =
|
|
220
|
+
const allSubItemIds = useMemo(
|
|
214
221
|
() =>
|
|
215
222
|
reduce<TRow | number, Array<string | number>>(
|
|
216
223
|
(acc, row) => [
|
|
@@ -225,7 +232,7 @@ const Listing = <TRow extends { id: RowId; internalListingParentId?: RowId }>({
|
|
|
225
232
|
[rows, subItems]
|
|
226
233
|
);
|
|
227
234
|
|
|
228
|
-
const rowsToDisplay =
|
|
235
|
+
const rowsToDisplay = useMemo(
|
|
229
236
|
() =>
|
|
230
237
|
subItems?.enable
|
|
231
238
|
? reduce<TRow, Array<TRow>>(
|
|
@@ -253,18 +260,18 @@ const Listing = <TRow extends { id: RowId; internalListingParentId?: RowId }>({
|
|
|
253
260
|
[rows, subItemsPivots, subItems]
|
|
254
261
|
);
|
|
255
262
|
|
|
256
|
-
const getSubItemRowId =
|
|
263
|
+
const getSubItemRowId = useCallback((row: TRow) => {
|
|
257
264
|
return `${subItemPrefixKey}_${row.internalListingParentId}_${row.id}`;
|
|
258
265
|
}, []);
|
|
259
266
|
|
|
260
|
-
const getIsSubItem =
|
|
267
|
+
const getIsSubItem = useCallback(
|
|
261
268
|
(row: TRow) => {
|
|
262
269
|
return allSubItemIds.includes(getSubItemRowId(row));
|
|
263
270
|
},
|
|
264
271
|
[allSubItemIds]
|
|
265
272
|
);
|
|
266
273
|
|
|
267
|
-
const getRowId =
|
|
274
|
+
const getRowId = useCallback(
|
|
268
275
|
(row: TRow) => {
|
|
269
276
|
return getIsSubItem(row) ? getSubItemRowId(row) : getId(row);
|
|
270
277
|
},
|
|
@@ -429,7 +436,7 @@ const Listing = <TRow extends { id: RowId; internalListingParentId?: RowId }>({
|
|
|
429
436
|
);
|
|
430
437
|
};
|
|
431
438
|
|
|
432
|
-
const selectRow = (event:
|
|
439
|
+
const selectRow = (event: MouseEvent, row): void => {
|
|
433
440
|
event.preventDefault();
|
|
434
441
|
event.stopPropagation();
|
|
435
442
|
// This prevents unwanted text selection
|
|
@@ -487,7 +494,7 @@ const Listing = <TRow extends { id: RowId; internalListingParentId?: RowId }>({
|
|
|
487
494
|
columns
|
|
488
495
|
});
|
|
489
496
|
|
|
490
|
-
|
|
497
|
+
useEffect(() => {
|
|
491
498
|
if (not(isShiftKeyDown)) {
|
|
492
499
|
setShiftKeyDownRowPivot(null);
|
|
493
500
|
|
|
@@ -508,11 +515,11 @@ const Listing = <TRow extends { id: RowId; internalListingParentId?: RowId }>({
|
|
|
508
515
|
)}
|
|
509
516
|
<div
|
|
510
517
|
className={classes.container}
|
|
511
|
-
ref={containerRef as
|
|
518
|
+
ref={containerRef as RefObject<HTMLDivElement>}
|
|
512
519
|
>
|
|
513
520
|
<div
|
|
514
521
|
className={classes.actionBar}
|
|
515
|
-
ref={actionBarRef as
|
|
522
|
+
ref={actionBarRef as RefObject<HTMLDivElement>}
|
|
516
523
|
>
|
|
517
524
|
<ListingActionBar
|
|
518
525
|
actions={actions}
|
|
@@ -557,7 +564,6 @@ const Listing = <TRow extends { id: RowId; internalListingParentId?: RowId }>({
|
|
|
557
564
|
stickyHeader
|
|
558
565
|
className={classes.table}
|
|
559
566
|
component="div"
|
|
560
|
-
role={undefined}
|
|
561
567
|
size="small"
|
|
562
568
|
>
|
|
563
569
|
<ListingHeader
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
1
|
import { makeStyles } from 'tss-react/mui';
|
|
4
2
|
|
|
5
3
|
import { Box } from '@mui/material';
|
|
6
4
|
|
|
5
|
+
import { ReactElement, forwardRef } from 'react';
|
|
7
6
|
import { useMemoComponent } from '..';
|
|
8
7
|
|
|
9
8
|
const useStyles = makeStyles()((theme) => ({
|
|
@@ -14,24 +13,22 @@ const useStyles = makeStyles()((theme) => ({
|
|
|
14
13
|
}));
|
|
15
14
|
|
|
16
15
|
export interface FilterProps {
|
|
17
|
-
content?:
|
|
16
|
+
content?: ReactElement;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
const Filter =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
);
|
|
19
|
+
const Filter = forwardRef(({ content }: FilterProps, ref): JSX.Element => {
|
|
20
|
+
const { classes } = useStyles();
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Box
|
|
24
|
+
className={classes.content}
|
|
25
|
+
component="div"
|
|
26
|
+
ref={ref as React.RefObject<HTMLDivElement>}
|
|
27
|
+
>
|
|
28
|
+
{content}
|
|
29
|
+
</Box>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
35
32
|
|
|
36
33
|
interface MemoizedFilterProps extends FilterProps {
|
|
37
34
|
memoProps?: Array<unknown>;
|
|
@@ -4,9 +4,9 @@ import { makeStyles } from 'tss-react/mui';
|
|
|
4
4
|
|
|
5
5
|
import { Box } from '@mui/material';
|
|
6
6
|
|
|
7
|
-
import { useMemoComponent } from '../utils';
|
|
8
|
-
import WithPanel from '../Panel/WithPanel';
|
|
9
7
|
import { ParentSize } from '..';
|
|
8
|
+
import WithPanel from '../Panel/WithPanel';
|
|
9
|
+
import { useMemoComponent } from '../utils';
|
|
10
10
|
|
|
11
11
|
import FilterSkeleton from './FilterSkeleton';
|
|
12
12
|
import ListingSkeleton from './ListingSkeleton';
|
|
@@ -4,10 +4,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import { makeStyles } from 'tss-react/mui';
|
|
5
5
|
|
|
6
6
|
import { Image, ImageVariant } from '..';
|
|
7
|
+
import CentreonLogoDark from '../@assets/brand/centreon-logo-one-line-dark.svg';
|
|
8
|
+
import CentreonLogoLight from '../@assets/brand/centreon-logo-one-line-light.svg';
|
|
7
9
|
import LoadingSkeleton from '../LoadingSkeleton';
|
|
8
10
|
import { useThemeMode } from '../utils/useThemeMode';
|
|
9
|
-
import CentreonLogoLight from '../@assets/brand/centreon-logo-one-line-light.svg';
|
|
10
|
-
import CentreonLogoDark from '../@assets/brand/centreon-logo-one-line-dark.svg';
|
|
11
11
|
|
|
12
12
|
import { labelCentreonLogo } from './translatedLabels';
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTranslation } from 'react-i18next';
|
|
2
2
|
|
|
3
|
-
import { FallbackPage } from '../../../FallbackPage/FallbackPage';
|
|
4
3
|
import { MenuSkeleton, PageSkeleton, useFetchQuery } from '../../..';
|
|
4
|
+
import { FallbackPage } from '../../../FallbackPage/FallbackPage';
|
|
5
5
|
import { getModuleLicenseCheckEndpoint } from '../api';
|
|
6
6
|
|
|
7
7
|
import { licenseDecoder } from './decoder';
|
package/src/Module/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Provider as JotaiProvider, createStore } from 'jotai';
|
|
2
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Provider as JotaiProvider, createStore } from 'jotai';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { StylesProvider, createGenerateClassName } from '@mui/styles';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { QueryProvider, ThemeProvider } from '..';
|
|
7
7
|
import SnackbarProvider from '../Snackbar/SnackbarProvider';
|
|
8
8
|
|
|
9
9
|
export interface ModuleProps {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { Ref } from 'react';
|
|
4
4
|
|
|
5
|
-
import { makeStyles } from 'tss-react/mui';
|
|
6
5
|
import { CxArg } from 'tss-react';
|
|
6
|
+
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
|
|
8
8
|
import IconCreate from '@mui/icons-material/Create';
|
|
9
9
|
import { Box, Chip, FormHelperText, Grid, Typography } from '@mui/material';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { makeStyles } from 'tss-react/mui';
|
|
2
2
|
|
|
3
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
3
4
|
import {
|
|
4
|
-
Typography,
|
|
5
|
-
AccordionSummary,
|
|
6
|
-
AccordionDetails,
|
|
7
5
|
Accordion,
|
|
8
|
-
|
|
6
|
+
AccordionDetails,
|
|
9
7
|
AccordionProps,
|
|
10
|
-
|
|
8
|
+
AccordionSummary,
|
|
9
|
+
AccordionSummaryProps,
|
|
10
|
+
Typography,
|
|
11
|
+
styled
|
|
11
12
|
} from '@mui/material';
|
|
12
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
13
13
|
|
|
14
14
|
const useStyles = makeStyles()((theme) => ({
|
|
15
15
|
details: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isNil } from 'ramda';
|
|
2
2
|
import { makeStyles } from 'tss-react/mui';
|
|
3
3
|
|
|
4
|
-
import { List, ListItem, Slide, Paper } from '@mui/material';
|
|
5
4
|
import ForwardIcon from '@mui/icons-material/ArrowForwardIos';
|
|
5
|
+
import { List, ListItem, Paper, Slide } from '@mui/material';
|
|
6
6
|
|
|
7
7
|
import Panel from '..';
|
|
8
8
|
import ContentWithCircularLoading from '../../ContentWithCircularProgress';
|
package/src/Panel/index.tsx
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
2
|
-
// There is an issue about using forwardRef: https://github.com/yannickcr/eslint-plugin-react/issues/2760
|
|
3
|
-
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
|
|
6
1
|
import { isEmpty, isNil } from 'ramda';
|
|
7
2
|
import { makeStyles } from 'tss-react/mui';
|
|
8
3
|
|
|
9
|
-
import { Paper, Slide, Divider, AppBar, Tabs } from '@mui/material';
|
|
10
4
|
import IconClose from '@mui/icons-material/Clear';
|
|
5
|
+
import { AppBar, Divider, Paper, Slide, Tabs } from '@mui/material';
|
|
11
6
|
|
|
12
7
|
import { IconButton } from '..';
|
|
13
8
|
|
|
9
|
+
import {
|
|
10
|
+
ReactElement,
|
|
11
|
+
RefObject,
|
|
12
|
+
forwardRef,
|
|
13
|
+
useCallback,
|
|
14
|
+
useEffect
|
|
15
|
+
} from 'react';
|
|
14
16
|
import { minTabHeight } from './Tab';
|
|
15
17
|
|
|
16
18
|
interface StylesProps extends Pick<Props, 'headerBackgroundColor' | 'width'> {
|
|
@@ -86,20 +88,20 @@ export interface Tab {
|
|
|
86
88
|
|
|
87
89
|
export interface Props {
|
|
88
90
|
className?: string;
|
|
89
|
-
header?:
|
|
91
|
+
header?: ReactElement;
|
|
90
92
|
headerBackgroundColor?: string;
|
|
91
93
|
labelClose?: string;
|
|
92
94
|
minWidth?: number;
|
|
93
95
|
onClose?: () => void;
|
|
94
96
|
onResize?: (newWidth: number) => void;
|
|
95
97
|
onTabSelect?: (event, id: number) => void;
|
|
96
|
-
selectedTab:
|
|
98
|
+
selectedTab: ReactElement;
|
|
97
99
|
selectedTabId?: number;
|
|
98
100
|
tabs?: Array<JSX.Element>;
|
|
99
101
|
width?: number;
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
const Panel =
|
|
104
|
+
const Panel = forwardRef(
|
|
103
105
|
(
|
|
104
106
|
{
|
|
105
107
|
header,
|
|
@@ -133,7 +135,7 @@ const Panel = React.forwardRef(
|
|
|
133
135
|
}
|
|
134
136
|
};
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
useEffect(() => {
|
|
137
139
|
window.addEventListener('resize', resizeWindow);
|
|
138
140
|
|
|
139
141
|
return (): void => {
|
|
@@ -151,7 +153,7 @@ const Panel = React.forwardRef(
|
|
|
151
153
|
document.removeEventListener('mousemove', moveMouse, true);
|
|
152
154
|
};
|
|
153
155
|
|
|
154
|
-
const moveMouse =
|
|
156
|
+
const moveMouse = useCallback((e) => {
|
|
155
157
|
e.preventDefault();
|
|
156
158
|
|
|
157
159
|
const maxWidth = getMaxWidth();
|
|
@@ -183,7 +185,7 @@ const Panel = React.forwardRef(
|
|
|
183
185
|
>
|
|
184
186
|
<Paper className={cx(classes.container, className)} elevation={2}>
|
|
185
187
|
{!isNil(onResize) && (
|
|
186
|
-
<div className={classes.dragger}
|
|
188
|
+
<div className={classes.dragger} onMouseDown={resize} />
|
|
187
189
|
)}
|
|
188
190
|
{header && (
|
|
189
191
|
<>
|
|
@@ -224,7 +226,7 @@ const Panel = React.forwardRef(
|
|
|
224
226
|
</AppBar>
|
|
225
227
|
<div
|
|
226
228
|
className={classes.contentContainer}
|
|
227
|
-
ref={ref as
|
|
229
|
+
ref={ref as RefObject<HTMLDivElement>}
|
|
228
230
|
>
|
|
229
231
|
<div className={classes.content} id="panel-content">
|
|
230
232
|
{selectedTab}
|