@centreon/ui 24.8.6 → 24.8.7
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 +32 -27
- 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,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
2
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
|
-
|
|
4
1
|
import { makeStyles } from 'tss-react/mui';
|
|
5
2
|
|
|
6
3
|
const useStyles = makeStyles()((theme) => ({
|
|
@@ -45,13 +42,11 @@ interface Props {
|
|
|
45
42
|
defaultImage: string;
|
|
46
43
|
imgSource: string;
|
|
47
44
|
labelNoIcon?: string;
|
|
48
|
-
onClick: () => void;
|
|
49
45
|
title: string;
|
|
50
46
|
uploadedImage: string;
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
const IconAttach = ({
|
|
54
|
-
onClick,
|
|
55
50
|
defaultImage,
|
|
56
51
|
uploadedImage,
|
|
57
52
|
imgSource,
|
|
@@ -61,7 +56,7 @@ const IconAttach = ({
|
|
|
61
56
|
const { classes } = useStyles();
|
|
62
57
|
|
|
63
58
|
return (
|
|
64
|
-
<span className={classes.iconAttach}
|
|
59
|
+
<span className={classes.iconAttach}>
|
|
65
60
|
{defaultImage && (
|
|
66
61
|
<span className={classes.iconAttachLabel}>{labelNoIcon}</span>
|
|
67
62
|
)}
|
package/src/Image/Image.tsx
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { memo } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { useLoadImage } from './useLoadImage';
|
|
7
|
-
|
|
8
|
-
export enum ImageVariant {
|
|
9
|
-
Contain = 'contain',
|
|
10
|
-
Cover = 'cover'
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface Props {
|
|
14
|
-
alt: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
fallback: JSX.Element;
|
|
17
|
-
height?: number | string;
|
|
18
|
-
imagePath: string;
|
|
19
|
-
variant?: ImageVariant;
|
|
20
|
-
width?: number | string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const useStyles = makeStyles<Pick<Props, 'width' | 'height' | 'variant'>>()(
|
|
24
|
-
(_, { width, height, variant }) => ({
|
|
25
|
-
fallbackContainer: {
|
|
26
|
-
height: '100%',
|
|
27
|
-
width: '100%'
|
|
28
|
-
},
|
|
29
|
-
imageContent: {
|
|
30
|
-
height,
|
|
31
|
-
objectFit: variant,
|
|
32
|
-
width
|
|
33
|
-
}
|
|
34
|
-
})
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
const ImageContent = ({
|
|
38
|
-
alt,
|
|
39
|
-
className,
|
|
40
|
-
height,
|
|
41
|
-
width,
|
|
42
|
-
imagePath,
|
|
43
|
-
variant = ImageVariant.Cover,
|
|
44
|
-
fallback
|
|
45
|
-
}: Props): JSX.Element => {
|
|
46
|
-
const { classes, cx } = useStyles({ height, variant, width });
|
|
47
|
-
const isImageLoaded = useLoadImage({ alt, imageSrc: imagePath });
|
|
48
|
-
|
|
49
|
-
if (!isImageLoaded) {
|
|
50
|
-
return (
|
|
51
|
-
<div className={classes.fallbackContainer} data-testid={alt}>
|
|
52
|
-
{fallback}
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<img
|
|
59
|
-
alt={alt}
|
|
60
|
-
className={cx(classes.imageContent, className)}
|
|
61
|
-
data-testid={alt}
|
|
62
|
-
src={imagePath}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const SuspendedImage = ({ imagePath, ...props }: Props): JSX.Element | null => {
|
|
68
|
-
if (isNil(imagePath)) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return <ImageContent {...props} imagePath={imagePath} />;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export default memo(SuspendedImage, equals);
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
|
|
3
|
+
import { equals, isNil } from 'ramda';
|
|
4
|
+
import { makeStyles } from 'tss-react/mui';
|
|
5
|
+
|
|
6
|
+
import { useLoadImage } from './useLoadImage';
|
|
7
|
+
|
|
8
|
+
export enum ImageVariant {
|
|
9
|
+
Contain = 'contain',
|
|
10
|
+
Cover = 'cover'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
alt: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
fallback: JSX.Element;
|
|
17
|
+
height?: number | string;
|
|
18
|
+
imagePath: string;
|
|
19
|
+
variant?: ImageVariant;
|
|
20
|
+
width?: number | string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const useStyles = makeStyles<Pick<Props, 'width' | 'height' | 'variant'>>()(
|
|
24
|
+
(_, { width, height, variant }) => ({
|
|
25
|
+
fallbackContainer: {
|
|
26
|
+
height: '100%',
|
|
27
|
+
width: '100%'
|
|
28
|
+
},
|
|
29
|
+
imageContent: {
|
|
30
|
+
height,
|
|
31
|
+
objectFit: variant,
|
|
32
|
+
width
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const ImageContent = ({
|
|
38
|
+
alt,
|
|
39
|
+
className,
|
|
40
|
+
height,
|
|
41
|
+
width,
|
|
42
|
+
imagePath,
|
|
43
|
+
variant = ImageVariant.Cover,
|
|
44
|
+
fallback
|
|
45
|
+
}: Props): JSX.Element => {
|
|
46
|
+
const { classes, cx } = useStyles({ height, variant, width });
|
|
47
|
+
const isImageLoaded = useLoadImage({ alt, imageSrc: imagePath });
|
|
48
|
+
|
|
49
|
+
if (!isImageLoaded) {
|
|
50
|
+
return (
|
|
51
|
+
<div className={classes.fallbackContainer} data-testid={alt}>
|
|
52
|
+
{fallback}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<img
|
|
59
|
+
alt={alt}
|
|
60
|
+
className={cx(classes.imageContent, className)}
|
|
61
|
+
data-testid={alt}
|
|
62
|
+
src={imagePath}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const SuspendedImage = ({ imagePath, ...props }: Props): JSX.Element | null => {
|
|
68
|
+
if (isNil(imagePath)) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return <ImageContent {...props} imagePath={imagePath} />;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default memo(SuspendedImage, equals);
|
package/src/Image/atoms.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { atom } from 'jotai';
|
|
2
|
-
|
|
3
|
-
export const imagesAtom = atom<Record<string, string>>({});
|
|
1
|
+
import { atom } from 'jotai';
|
|
2
|
+
|
|
3
|
+
export const imagesAtom = atom<Record<string, string>>({});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentStory } from '@storybook/react';
|
|
2
2
|
|
|
3
|
-
import LoadingSkeleton from '../LoadingSkeleton';
|
|
4
3
|
import CentreonLogoLight from '../@assets/brand/centreon-logo-one-line-light.svg';
|
|
5
4
|
import NotAuthorized from '../@assets/images/not-authorized-template-background-light.svg';
|
|
5
|
+
import LoadingSkeleton from '../LoadingSkeleton';
|
|
6
6
|
|
|
7
7
|
import Image, { ImageVariant } from './Image';
|
|
8
8
|
|
package/src/Image/index.test.tsx
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { RenderResult, screen, waitFor } from '@testing-library/react';
|
|
2
|
-
import { Provider } from 'jotai';
|
|
3
|
-
|
|
4
|
-
import { render } from '../../test/testRenderer';
|
|
5
|
-
import CentreonLogoLight from '../@assets/brand/centreon-logo-one-line-light.svg';
|
|
6
|
-
|
|
7
|
-
import Image from './Image';
|
|
8
|
-
|
|
9
|
-
jest.mock('../../@assets/centreon-logo-one-line-light.svg');
|
|
10
|
-
|
|
11
|
-
const renderImage = (): RenderResult =>
|
|
12
|
-
render(
|
|
13
|
-
<Provider>
|
|
14
|
-
<Image
|
|
15
|
-
alt="test"
|
|
16
|
-
fallback={<p>Loading...</p>}
|
|
17
|
-
imagePath={CentreonLogoLight}
|
|
18
|
-
/>
|
|
19
|
-
</Provider>
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const renderNotFoundImage = (): RenderResult =>
|
|
23
|
-
render(
|
|
24
|
-
<Provider>
|
|
25
|
-
<Image
|
|
26
|
-
alt="test"
|
|
27
|
-
fallback={<p>Loading...</p>}
|
|
28
|
-
imagePath="another_image"
|
|
29
|
-
/>
|
|
30
|
-
</Provider>
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
describe('useLoadImage', () => {
|
|
34
|
-
it('displays the loaded image', async () => {
|
|
35
|
-
renderImage();
|
|
36
|
-
|
|
37
|
-
expect(screen.getByText('Loading...')).toBeInTheDocument();
|
|
38
|
-
|
|
39
|
-
await waitFor(() => {
|
|
40
|
-
expect(screen.getByAltText('test')).toBeInTheDocument();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('displays a not found image', async () => {
|
|
45
|
-
renderNotFoundImage();
|
|
46
|
-
|
|
47
|
-
expect(screen.getByText('Loading...')).toBeInTheDocument();
|
|
48
|
-
|
|
49
|
-
await waitFor(() => {
|
|
50
|
-
expect(screen.getByAltText('test')).toBeInTheDocument();
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
});
|
|
1
|
+
import { RenderResult, screen, waitFor } from '@testing-library/react';
|
|
2
|
+
import { Provider } from 'jotai';
|
|
3
|
+
|
|
4
|
+
import { render } from '../../test/testRenderer';
|
|
5
|
+
import CentreonLogoLight from '../@assets/brand/centreon-logo-one-line-light.svg';
|
|
6
|
+
|
|
7
|
+
import Image from './Image';
|
|
8
|
+
|
|
9
|
+
jest.mock('../../@assets/centreon-logo-one-line-light.svg');
|
|
10
|
+
|
|
11
|
+
const renderImage = (): RenderResult =>
|
|
12
|
+
render(
|
|
13
|
+
<Provider>
|
|
14
|
+
<Image
|
|
15
|
+
alt="test"
|
|
16
|
+
fallback={<p>Loading...</p>}
|
|
17
|
+
imagePath={CentreonLogoLight}
|
|
18
|
+
/>
|
|
19
|
+
</Provider>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const renderNotFoundImage = (): RenderResult =>
|
|
23
|
+
render(
|
|
24
|
+
<Provider>
|
|
25
|
+
<Image
|
|
26
|
+
alt="test"
|
|
27
|
+
fallback={<p>Loading...</p>}
|
|
28
|
+
imagePath="another_image"
|
|
29
|
+
/>
|
|
30
|
+
</Provider>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
describe('useLoadImage', () => {
|
|
34
|
+
it('displays the loaded image', async () => {
|
|
35
|
+
renderImage();
|
|
36
|
+
|
|
37
|
+
expect(screen.getByText('Loading...')).toBeInTheDocument();
|
|
38
|
+
|
|
39
|
+
await waitFor(() => {
|
|
40
|
+
expect(screen.getByAltText('test')).toBeInTheDocument();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('displays a not found image', async () => {
|
|
45
|
+
renderNotFoundImage();
|
|
46
|
+
|
|
47
|
+
expect(screen.getByText('Loading...')).toBeInTheDocument();
|
|
48
|
+
|
|
49
|
+
await waitFor(() => {
|
|
50
|
+
expect(screen.getByAltText('test')).toBeInTheDocument();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
package/src/Image/models.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface Image {
|
|
2
|
-
read: () => string;
|
|
3
|
-
}
|
|
1
|
+
export interface Image {
|
|
2
|
+
read: () => string;
|
|
3
|
+
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { SetStateAction, useAtom } from 'jotai';
|
|
2
|
-
import { isEmpty, isNil, prop } from 'ramda';
|
|
3
|
-
|
|
4
|
-
import { imagesAtom } from './atoms';
|
|
5
|
-
|
|
6
|
-
interface CreateImageProps {
|
|
7
|
-
alt: string;
|
|
8
|
-
image?: string;
|
|
9
|
-
imageSrc: string;
|
|
10
|
-
setImages: (update: SetStateAction<Record<string, string>>) => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const createImage = ({
|
|
14
|
-
setImages,
|
|
15
|
-
imageSrc,
|
|
16
|
-
image,
|
|
17
|
-
alt
|
|
18
|
-
}: CreateImageProps): void => {
|
|
19
|
-
const imageLoaderPromise = (): Promise<string> =>
|
|
20
|
-
new Promise<string>((resolve, reject) => {
|
|
21
|
-
const img = new Image();
|
|
22
|
-
img.src = imageSrc;
|
|
23
|
-
img.onload = (): void => resolve(imageSrc);
|
|
24
|
-
img.onerror = (): void =>
|
|
25
|
-
reject(new Error(`Failed to load image ${imageSrc}`));
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
if (!isNil(image) || isEmpty(image)) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
imageLoaderPromise()
|
|
33
|
-
.then((result: string): void => {
|
|
34
|
-
setImages((currentImages) => ({ ...currentImages, [alt]: result }));
|
|
35
|
-
})
|
|
36
|
-
.catch(() => {
|
|
37
|
-
setImages((currentImages) => ({ ...currentImages, [alt]: '' }));
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const useLoadImage = ({ imageSrc, alt }): boolean => {
|
|
42
|
-
const [images, setImages] = useAtom(imagesAtom);
|
|
43
|
-
|
|
44
|
-
const image = prop(alt, images);
|
|
45
|
-
|
|
46
|
-
createImage({ alt, image, imageSrc, setImages });
|
|
47
|
-
|
|
48
|
-
return !isNil(image) || isEmpty(image);
|
|
49
|
-
};
|
|
1
|
+
import { SetStateAction, useAtom } from 'jotai';
|
|
2
|
+
import { isEmpty, isNil, prop } from 'ramda';
|
|
3
|
+
|
|
4
|
+
import { imagesAtom } from './atoms';
|
|
5
|
+
|
|
6
|
+
interface CreateImageProps {
|
|
7
|
+
alt: string;
|
|
8
|
+
image?: string;
|
|
9
|
+
imageSrc: string;
|
|
10
|
+
setImages: (update: SetStateAction<Record<string, string>>) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const createImage = ({
|
|
14
|
+
setImages,
|
|
15
|
+
imageSrc,
|
|
16
|
+
image,
|
|
17
|
+
alt
|
|
18
|
+
}: CreateImageProps): void => {
|
|
19
|
+
const imageLoaderPromise = (): Promise<string> =>
|
|
20
|
+
new Promise<string>((resolve, reject) => {
|
|
21
|
+
const img = new Image();
|
|
22
|
+
img.src = imageSrc;
|
|
23
|
+
img.onload = (): void => resolve(imageSrc);
|
|
24
|
+
img.onerror = (): void =>
|
|
25
|
+
reject(new Error(`Failed to load image ${imageSrc}`));
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (!isNil(image) || isEmpty(image)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
imageLoaderPromise()
|
|
33
|
+
.then((result: string): void => {
|
|
34
|
+
setImages((currentImages) => ({ ...currentImages, [alt]: result }));
|
|
35
|
+
})
|
|
36
|
+
.catch(() => {
|
|
37
|
+
setImages((currentImages) => ({ ...currentImages, [alt]: '' }));
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const useLoadImage = ({ imageSrc, alt }): boolean => {
|
|
42
|
+
const [images, setImages] = useAtom(imagesAtom);
|
|
43
|
+
|
|
44
|
+
const image = prop(alt, images);
|
|
45
|
+
|
|
46
|
+
createImage({ alt, image, imageSrc, setImages });
|
|
47
|
+
|
|
48
|
+
return !isNil(image) || isEmpty(image);
|
|
49
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactElement, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { T, cond, isNil } from 'ramda';
|
|
4
4
|
import { makeStyles } from 'tss-react/mui';
|
|
5
5
|
|
|
6
|
-
import { Tooltip, IconButton } from '@mui/material';
|
|
7
6
|
import IconHelp from '@mui/icons-material/HelpOutline';
|
|
8
7
|
import IconClose from '@mui/icons-material/HighlightOff';
|
|
8
|
+
import { IconButton, Tooltip } from '@mui/material';
|
|
9
9
|
|
|
10
10
|
const useStyles = makeStyles()((theme) => ({
|
|
11
11
|
buttonClose: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { buildListingEndpoint } from '../../../..';
|
|
2
1
|
import { SelectEntry } from '../..';
|
|
2
|
+
import { buildListingEndpoint } from '../../../..';
|
|
3
3
|
import { Listing } from '../../../../api/models';
|
|
4
4
|
|
|
5
|
-
import SingleConnectedAutocompleteField from './Single';
|
|
6
5
|
import MultiConnectedAutocompleteField from './Multi';
|
|
6
|
+
import SingleConnectedAutocompleteField from './Single';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: 'InputField/Autocomplete/Connected'
|
|
@@ -41,7 +41,7 @@ const mockSearch = (page: number): object => ({
|
|
|
41
41
|
response: (request): Listing<SelectEntry> => {
|
|
42
42
|
const { searchParams } = request;
|
|
43
43
|
|
|
44
|
-
return buildResult(parseInt(searchParams.page || '0', 10));
|
|
44
|
+
return buildResult(Number.parseInt(searchParams.page || '0', 10));
|
|
45
45
|
},
|
|
46
46
|
status: 200,
|
|
47
47
|
url: `/endpoint?page=${page}&search=`
|
|
@@ -54,7 +54,7 @@ const getMockData = (): Array<object> => [
|
|
|
54
54
|
response: (request): Listing<SelectEntry> => {
|
|
55
55
|
const { searchParams } = request;
|
|
56
56
|
|
|
57
|
-
return buildResult(parseInt(searchParams.page || '0', 10));
|
|
57
|
+
return buildResult(Number.parseInt(searchParams.page || '0', 10));
|
|
58
58
|
},
|
|
59
59
|
status: 200,
|
|
60
60
|
url: '/endpoint?page='
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
render,
|
|
3
|
-
fireEvent,
|
|
4
|
-
waitFor,
|
|
5
2
|
RenderResult,
|
|
6
3
|
act,
|
|
7
|
-
|
|
4
|
+
fireEvent,
|
|
5
|
+
getFetchCall,
|
|
8
6
|
mockResponse,
|
|
9
|
-
|
|
7
|
+
render,
|
|
8
|
+
resetMocks,
|
|
9
|
+
waitFor
|
|
10
10
|
} from '../../../../../test/testRenderer';
|
|
11
|
+
import TestQueryProvider from '../../../../api/TestQueryProvider';
|
|
11
12
|
import buildListingEndpoint from '../../../../api/buildListingEndpoint';
|
|
12
13
|
import { ConditionsSearchParameter } from '../../../../api/buildListingEndpoint/models';
|
|
13
|
-
import TestQueryProvider from '../../../../api/TestQueryProvider';
|
|
14
14
|
|
|
15
15
|
import SingleConnectedAutocompleteField from './Single';
|
|
16
16
|
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
equals,
|
|
5
|
-
|
|
6
|
-
last,
|
|
5
|
+
has,
|
|
7
6
|
isEmpty,
|
|
8
|
-
map,
|
|
9
7
|
isNil,
|
|
10
|
-
|
|
8
|
+
last,
|
|
9
|
+
map,
|
|
11
10
|
not,
|
|
12
|
-
has,
|
|
13
11
|
omit,
|
|
12
|
+
pipe,
|
|
13
|
+
prop,
|
|
14
14
|
uniqBy
|
|
15
15
|
} from 'ramda';
|
|
16
16
|
|
|
17
17
|
import { CircularProgress, useTheme } from '@mui/material';
|
|
18
18
|
|
|
19
19
|
import { Props as AutocompleteFieldProps } from '..';
|
|
20
|
-
import {
|
|
21
|
-
useDebounce,
|
|
22
|
-
useIntersectionObserver,
|
|
23
|
-
useDeepCompare
|
|
24
|
-
} from '../../../../utils';
|
|
25
20
|
import { ListingModel, SelectEntry } from '../../../..';
|
|
26
|
-
import Option from '../../Option';
|
|
27
21
|
import {
|
|
28
22
|
ConditionsSearchParameter,
|
|
29
23
|
SearchParameter
|
|
30
24
|
} from '../../../../api/buildListingEndpoint/models';
|
|
31
25
|
import useFetchQuery from '../../../../api/useFetchQuery';
|
|
26
|
+
import {
|
|
27
|
+
useDebounce,
|
|
28
|
+
useDeepCompare,
|
|
29
|
+
useIntersectionObserver
|
|
30
|
+
} from '../../../../utils';
|
|
31
|
+
import Option from '../../Option';
|
|
32
32
|
|
|
33
33
|
export interface ConnectedAutoCompleteFieldProps<TData> {
|
|
34
34
|
allowUniqOption?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { map, find, propEq } from 'ramda';
|
|
2
1
|
import { rectIntersection } from '@dnd-kit/core';
|
|
3
2
|
import { rectSortingStrategy } from '@dnd-kit/sortable';
|
|
3
|
+
import { find, map, propEq } from 'ramda';
|
|
4
4
|
import { makeStyles } from 'tss-react/mui';
|
|
5
5
|
|
|
6
6
|
import { lighten } from '@mui/material';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { findIndex, not, propEq } from 'ramda';
|
|
4
1
|
import { DraggableSyntheticListeners } from '@dnd-kit/core';
|
|
5
2
|
import clsx from 'clsx';
|
|
3
|
+
import { findIndex, not, propEq } from 'ramda';
|
|
6
4
|
|
|
7
5
|
import { Chip, Typography, useTheme } from '@mui/material';
|
|
8
6
|
|
|
7
|
+
import { RefObject, useRef } from 'react';
|
|
9
8
|
import { DraggableSelectEntry, SortableListProps } from './SortableList';
|
|
10
9
|
|
|
11
10
|
interface ContentProps
|
|
@@ -14,7 +13,7 @@ interface ContentProps
|
|
|
14
13
|
id: string;
|
|
15
14
|
index: number;
|
|
16
15
|
isDragging: boolean;
|
|
17
|
-
itemRef:
|
|
16
|
+
itemRef: RefObject<HTMLDivElement>;
|
|
18
17
|
listeners: DraggableSyntheticListeners;
|
|
19
18
|
style;
|
|
20
19
|
}
|
|
@@ -42,9 +41,9 @@ const SortableListContent = ({
|
|
|
42
41
|
isDragging
|
|
43
42
|
}: ContentProps): JSX.Element => {
|
|
44
43
|
const theme = useTheme();
|
|
45
|
-
const labelItemRef =
|
|
44
|
+
const labelItemRef = useRef<HTMLElement | null>(null);
|
|
46
45
|
|
|
47
|
-
const mouseUp = (event:
|
|
46
|
+
const mouseUp = (event: MouseEvent): void => {
|
|
48
47
|
if (not(event.shiftKey)) {
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
@@ -8,8 +8,8 @@ import { SelectEntry } from '../..';
|
|
|
8
8
|
import { buildListingEndpoint } from '../../../..';
|
|
9
9
|
import { Listing } from '../../../../api/models';
|
|
10
10
|
|
|
11
|
-
import MultiDraggableConnectedAutocompleteField from './MultiConnected';
|
|
12
11
|
import MultiDraggableAutocompleteField from './Multi';
|
|
12
|
+
import MultiDraggableConnectedAutocompleteField from './MultiConnected';
|
|
13
13
|
|
|
14
14
|
import { ItemActionProps } from '.';
|
|
15
15
|
|
|
@@ -49,7 +49,7 @@ const mockSearch = (page: number): object => ({
|
|
|
49
49
|
response: (request): Listing<SelectEntry> => {
|
|
50
50
|
const { searchParams } = request;
|
|
51
51
|
|
|
52
|
-
return buildResult(parseInt(searchParams.page || '0', 10));
|
|
52
|
+
return buildResult(Number.parseInt(searchParams.page || '0', 10));
|
|
53
53
|
},
|
|
54
54
|
status: 200,
|
|
55
55
|
url: `/endpoint?page=${page}&search=`
|
|
@@ -62,7 +62,7 @@ const getMockData = (): Array<object> => [
|
|
|
62
62
|
response: (request): Listing<SelectEntry> => {
|
|
63
63
|
const { searchParams } = request;
|
|
64
64
|
|
|
65
|
-
return buildResult(parseInt(searchParams.page || '0', 10));
|
|
65
|
+
return buildResult(Number.parseInt(searchParams.page || '0', 10));
|
|
66
66
|
},
|
|
67
67
|
status: 200,
|
|
68
68
|
url: '/endpoint?page='
|
|
@@ -74,9 +74,9 @@ const getMockData = (): Array<object> => [
|
|
|
74
74
|
];
|
|
75
75
|
|
|
76
76
|
const options = [
|
|
77
|
-
{ id:
|
|
78
|
-
{ id:
|
|
79
|
-
{ id:
|
|
77
|
+
{ id: '0', name: 'First Entity' },
|
|
78
|
+
{ id: '1', name: 'Second Entity' },
|
|
79
|
+
{ id: '2', name: 'Third Entity' }
|
|
80
80
|
];
|
|
81
81
|
|
|
82
82
|
const MultiDraggable = (): JSX.Element => (
|