@centreon/ui 23.10.35 → 23.10.37
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/.storybook/main.js +82 -0
- package/.storybook/preview.tsx +21 -0
- package/README.md +14 -44
- package/jest.config.js +20 -0
- package/package.json +26 -84
- package/{test/setupTests.js → setupTests.js} +1 -1
- package/src/Button/Icon/index.tsx +1 -1
- package/src/Button/Save/index.stories.tsx +5 -10
- package/src/Button/Save/index.tsx +1 -1
- package/src/Dialog/Confirm/index.tsx +4 -14
- package/src/Dialog/Duplicate/index.test.tsx +1 -1
- package/src/Dialog/index.tsx +1 -10
- package/src/FallbackPage/FallbackPage.tsx +2 -2
- package/src/FileDropZone/index.tsx +1 -1
- package/src/Form/CollapsibleGroup.tsx +5 -11
- package/src/Form/FormButtons.tsx +4 -2
- package/src/Form/Inputs/Autocomplete.tsx +1 -1
- package/src/Form/Inputs/Grid.tsx +2 -4
- package/src/Form/Inputs/Radio.tsx +1 -1
- package/src/Form/Inputs/Switch.tsx +1 -1
- package/src/Form/Inputs/Text.tsx +7 -18
- package/src/Form/Inputs/index.tsx +12 -30
- package/src/Form/Inputs/models.ts +1 -15
- package/src/Form/{Form.stories.tsx → index.stories.tsx} +3 -2
- package/src/Form/{Form.tsx → index.tsx} +16 -38
- package/src/Form/storiesData.tsx +3 -50
- package/src/Home.stories.mdx +84 -1
- package/src/Image/index.stories.tsx +2 -2
- package/src/Image/index.test.tsx +3 -3
- package/src/InputField/Search/PersistentTooltip.tsx +2 -7
- package/src/InputField/Select/Autocomplete/Connected/Multi/index.test.tsx +22 -3
- package/src/InputField/Select/Autocomplete/Connected/index.stories.tsx +3 -0
- package/src/InputField/Select/Autocomplete/Connected/index.test.tsx +1 -1
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +3 -16
- package/src/InputField/Select/Autocomplete/Draggable/index.stories.tsx +2 -0
- package/src/InputField/Select/Autocomplete/index.stories.tsx +10 -1
- package/src/InputField/Select/Autocomplete/index.tsx +1 -1
- package/src/InputField/Select/index.tsx +1 -1
- package/src/InputField/Text/index.tsx +2 -4
- package/src/Listing/ActionBar/index.tsx +1 -1
- package/src/Listing/Cell/DataCell.tsx +63 -26
- package/src/Listing/Cell/index.tsx +1 -1
- package/src/Listing/Header/{_internals/PredefinedSelectionList.tsx → PredefinedSelectionList.tsx} +1 -1
- package/src/Listing/Header/{Cell/ListingHeaderCell.tsx → SortableCell/Content.tsx} +81 -16
- package/src/Listing/Header/SortableCell/DraggableIcon.tsx +41 -0
- package/src/Listing/Header/{ListingHeader.tsx → index.tsx} +102 -25
- package/src/Listing/{Row/Row.tsx → Row.tsx} +6 -4
- package/src/Listing/Skeleton.tsx +11 -0
- package/src/Listing/index.stories.tsx +4 -34
- package/src/Listing/index.test.tsx +1 -1
- package/src/Listing/index.tsx +128 -21
- package/src/Listing/useStyleTable.ts +1 -1
- package/src/ListingPage/index.tsx +1 -1
- package/src/Logo/CentreonLogo.tsx +2 -2
- package/src/Module/LicensedModule/LicenseCheck/index.stories.tsx +2 -0
- package/src/Panel/Memoized.tsx +1 -1
- package/src/Panel/Section/index.test.tsx +1 -1
- package/src/Panel/Section/index.tsx +1 -1
- package/src/Panel/index.tsx +4 -6
- package/src/RichTextEditor/ContentEditable.tsx +7 -27
- package/src/RichTextEditor/RichTextEditor.tsx +45 -86
- package/src/RichTextEditor/plugins/FloatingLinkEditorPlugin.tsx +0 -1
- package/src/Snackbar/index.tsx +4 -14
- package/src/Snackbar/useSnackbar.tsx +1 -5
- package/src/SortableItems/SortableItem.tsx +1 -1
- package/src/ThemeProvider/index.tsx +4 -37
- package/src/ThemeProvider/palettes.ts +201 -389
- package/src/Typography/{Typography.stories.tsx → index.stories.tsx} +5 -5
- package/src/WallpaperPage/index.stories.tsx +1 -1
- package/src/Wizard/ActionsBar.test.tsx +1 -1
- package/src/Wizard/index.stories.tsx +18 -5
- package/src/Wizard/index.test.tsx +1 -1
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-listing-loading-with-no-data-1-snap.png +0 -0
- package/src/api/TestQueryProvider.tsx +1 -2
- package/src/api/customFetch.ts +0 -10
- package/src/api/useFetchQuery/index.ts +7 -8
- package/src/api/useMutationQuery/index.ts +13 -18
- package/src/api/useRequest/index.ts +6 -9
- package/src/index.ts +19 -7
- package/src/storyshots.test.js +52 -0
- package/{test → src}/testRenderer.tsx +1 -1
- package/src/utils/getNormalizedId.ts +3 -1
- package/src/utils/useCopyToClipboard.ts +3 -2
- package/src/utils/useDebounce.ts +3 -1
- package/src/utils/useDeepCallback.ts +3 -1
- package/src/utils/useDeepMemo.ts +3 -1
- package/src/utils/useIntersectionObserver.ts +5 -5
- package/src/utils/useKeyObserver.tsx +3 -1
- package/src/utils/useLocaleDateTimeFormat/index.test.tsx +1 -1
- package/src/utils/useLocaleDateTimeFormat/index.ts +2 -1
- package/src/utils/useLocaleDateTimeFormat/localeFallback.test.tsx +1 -1
- package/src/utils/useMemoComponent.ts +1 -1
- package/testRunner.js +36 -0
- package/tsconfig.json +29 -0
- package/types/declarations.d.ts +9 -0
- package/public/README.md +0 -39
- package/public/mockServiceWorker.js +0 -303
- package/src/@assets/README.md +0 -5
- package/src/@assets/brand/centreon-logo-one-line-dark.svg +0 -1
- package/src/@assets/brand/centreon-logo-one-line-light.svg +0 -1
- package/src/@assets/icons/downtime.icon.svg +0 -1
- package/src/@types/aria-attributes.d.ts +0 -10
- package/src/@types/data-attributes.d.ts +0 -3
- package/src/@types/globals.d.ts +0 -9
- package/src/@types/vite-env.d.ts +0 -2
- package/src/Checkbox/Checkbox.tsx +0 -107
- package/src/Checkbox/CheckboxGroup/index.stories.tsx +0 -41
- package/src/Checkbox/CheckboxGroup/index.tsx +0 -66
- package/src/Checkbox/index.stories.tsx +0 -39
- package/src/Checkbox/index.tsx +0 -2
- package/src/Dashboard/Dashboard.styles.ts +0 -85
- package/src/Dashboard/DashboardLayout.stories.tsx +0 -104
- package/src/Dashboard/Grid.tsx +0 -70
- package/src/Dashboard/Item.tsx +0 -81
- package/src/Dashboard/Layout.tsx +0 -74
- package/src/Dashboard/index.tsx +0 -9
- package/src/Dashboard/utils.ts +0 -28
- package/src/Form/Form.styles.ts +0 -11
- package/src/Form/Inputs/Checkbox.tsx +0 -57
- package/src/Form/Inputs/CheckboxGroup.tsx +0 -76
- package/src/Form/index.ts +0 -1
- package/src/Graph/BasicComponents/Axes/UnitLabel.tsx +0 -20
- package/src/Graph/BasicComponents/Axes/index.tsx +0 -88
- package/src/Graph/BasicComponents/Axes/models.ts +0 -26
- package/src/Graph/BasicComponents/Axes/useAxisY.ts +0 -100
- package/src/Graph/BasicComponents/Grids/index.tsx +0 -20
- package/src/Graph/BasicComponents/Lines/RegularLines/index.tsx +0 -91
- package/src/Graph/BasicComponents/Lines/RegularLines/useRegularLines.ts +0 -15
- package/src/Graph/BasicComponents/Lines/StackedLines/index.tsx +0 -76
- package/src/Graph/BasicComponents/Lines/StackedLines/useStackedLines.ts +0 -39
- package/src/Graph/BasicComponents/Lines/Threshold/BasicThreshold.tsx +0 -51
- package/src/Graph/BasicComponents/Lines/Threshold/Circle.tsx +0 -43
- package/src/Graph/BasicComponents/Lines/Threshold/ThresholdWithPatternLines.tsx +0 -73
- package/src/Graph/BasicComponents/Lines/Threshold/ThresholdWithVariation.tsx +0 -59
- package/src/Graph/BasicComponents/Lines/Threshold/helpers/index.ts +0 -69
- package/src/Graph/BasicComponents/Lines/Threshold/index.tsx +0 -138
- package/src/Graph/BasicComponents/Lines/Threshold/models.ts +0 -105
- package/src/Graph/BasicComponents/Lines/Threshold/useCoordinateCircle.ts +0 -46
- package/src/Graph/BasicComponents/Lines/Threshold/useScaleThreshold.ts +0 -171
- package/src/Graph/BasicComponents/Lines/index.tsx +0 -180
- package/src/Graph/BasicComponents/Lines/models.ts +0 -42
- package/src/Graph/BasicComponents/LoadingProgress.tsx +0 -46
- package/src/Graph/BasicComponents/useFilterLines.ts +0 -60
- package/src/Graph/Graph.styles.ts +0 -45
- package/src/Graph/Graph.tsx +0 -217
- package/src/Graph/Header/index.tsx +0 -65
- package/src/Graph/Icons/Downtime.tsx +0 -9
- package/src/Graph/InteractiveComponents/AnchorPoint/AnchorPoint.styles.ts +0 -58
- package/src/Graph/InteractiveComponents/AnchorPoint/GuidingLines.tsx +0 -45
- package/src/Graph/InteractiveComponents/AnchorPoint/RegularAnchorPoint.tsx +0 -66
- package/src/Graph/InteractiveComponents/AnchorPoint/StackedAnchorPoint.tsx +0 -76
- package/src/Graph/InteractiveComponents/AnchorPoint/TooltipAnchorPoint.tsx +0 -70
- package/src/Graph/InteractiveComponents/AnchorPoint/index.tsx +0 -20
- package/src/Graph/InteractiveComponents/AnchorPoint/models.ts +0 -62
- package/src/Graph/InteractiveComponents/AnchorPoint/useTickGraph.ts +0 -94
- package/src/Graph/InteractiveComponents/AnchorPoint/useTooltipAnchorPoint.ts +0 -107
- package/src/Graph/InteractiveComponents/Annotations/Annotation/Area.tsx +0 -114
- package/src/Graph/InteractiveComponents/Annotations/Annotation/Line.tsx +0 -103
- package/src/Graph/InteractiveComponents/Annotations/Annotation/index.tsx +0 -81
- package/src/Graph/InteractiveComponents/Annotations/Area/Downtime.tsx +0 -27
- package/src/Graph/InteractiveComponents/Annotations/EventAnnotations.tsx +0 -61
- package/src/Graph/InteractiveComponents/Annotations/Line/Acknowledgement.tsx +0 -27
- package/src/Graph/InteractiveComponents/Annotations/Line/Comments.tsx +0 -25
- package/src/Graph/InteractiveComponents/Annotations/annotationsAtoms.ts +0 -183
- package/src/Graph/InteractiveComponents/Annotations/index.tsx +0 -49
- package/src/Graph/InteractiveComponents/Annotations/models.ts +0 -25
- package/src/Graph/InteractiveComponents/Annotations/useAnnotation.ts +0 -56
- package/src/Graph/InteractiveComponents/Bar.tsx +0 -21
- package/src/Graph/InteractiveComponents/TimeShiftZones/TimeShiftIcon.tsx +0 -62
- package/src/Graph/InteractiveComponents/TimeShiftZones/TimeShiftZone.tsx +0 -74
- package/src/Graph/InteractiveComponents/TimeShiftZones/index.tsx +0 -85
- package/src/Graph/InteractiveComponents/TimeShiftZones/models.ts +0 -12
- package/src/Graph/InteractiveComponents/TimeShiftZones/useTimeShiftZones.ts +0 -72
- package/src/Graph/InteractiveComponents/Tooltip/index.tsx +0 -59
- package/src/Graph/InteractiveComponents/Tooltip/models.ts +0 -9
- package/src/Graph/InteractiveComponents/Tooltip/useGraphTooltip.ts +0 -67
- package/src/Graph/InteractiveComponents/ZoomPreview/index.tsx +0 -38
- package/src/Graph/InteractiveComponents/ZoomPreview/models.ts +0 -9
- package/src/Graph/InteractiveComponents/ZoomPreview/useZoomPreview.ts +0 -107
- package/src/Graph/InteractiveComponents/ZoomPreview/zoomPreviewAtoms.ts +0 -3
- package/src/Graph/InteractiveComponents/index.tsx +0 -168
- package/src/Graph/InteractiveComponents/interactionWithGraphAtoms.ts +0 -51
- package/src/Graph/Legend/InteractiveValue.tsx +0 -22
- package/src/Graph/Legend/Legend.styles.ts +0 -71
- package/src/Graph/Legend/LegendContent.tsx +0 -27
- package/src/Graph/Legend/LegendHeader.tsx +0 -45
- package/src/Graph/Legend/Marker.tsx +0 -43
- package/src/Graph/Legend/index.tsx +0 -166
- package/src/Graph/Legend/models.ts +0 -11
- package/src/Graph/Legend/useInteractiveValues.ts +0 -86
- package/src/Graph/Legend/useLegend.ts +0 -114
- package/src/Graph/LoadingSkeleton.tsx +0 -44
- package/src/Graph/common/index.ts +0 -35
- package/src/Graph/graphAtoms.ts +0 -6
- package/src/Graph/helpers/doc.ts +0 -560
- package/src/Graph/helpers/index.ts +0 -58
- package/src/Graph/index.stories.tsx +0 -372
- package/src/Graph/index.tsx +0 -90
- package/src/Graph/mockedData/annotationData.json +0 -326
- package/src/Graph/mockedData/exclusionPeriodFirstPeriod.json +0 -588
- package/src/Graph/mockedData/exclusionPeriodSecondPeriod.json +0 -588
- package/src/Graph/mockedData/exclusionPeriodThirdPeriod.json +0 -581
- package/src/Graph/mockedData/lastDay.json +0 -1326
- package/src/Graph/mockedData/lastDayAreaStack.json +0 -3106
- package/src/Graph/mockedData/lastDayForward.json +0 -1338
- package/src/Graph/mockedData/lastDayThreshold.json +0 -2352
- package/src/Graph/mockedData/lastMonth.json +0 -1674
- package/src/Graph/mockedData/lastWeek.json +0 -2202
- package/src/Graph/mockedData/zoomPreview.json +0 -742
- package/src/Graph/models.ts +0 -150
- package/src/Graph/timeSeries/index.test.ts +0 -506
- package/src/Graph/timeSeries/index.ts +0 -512
- package/src/Graph/timeSeries/models.ts +0 -120
- package/src/Graph/translatedLabels.ts +0 -9
- package/src/Graph/useGraphData.ts +0 -47
- package/src/Graph/useGraphIntersection.ts +0 -36
- package/src/InputField/Select/Autocomplete/Connected/Multi/MultiConnectedAutocompleteField.cypress.spec.tsx +0 -161
- package/src/InputField/Select/Autocomplete/Connected/Multi/utils/index.ts +0 -22
- package/src/Listing/Cell/DataCell.styles.ts +0 -24
- package/src/Listing/EmptyResult/EmptyResult.tsx +0 -13
- package/src/Listing/Header/Cell/ListingHeaderCell.styles.ts +0 -71
- package/src/Listing/Header/Cell/SelectActionListingHeaderCell.styles.ts +0 -26
- package/src/Listing/Header/Cell/SelectActionListingHeaderCell.tsx +0 -70
- package/src/Listing/Header/ListingHeader.styles.ts +0 -16
- package/src/Listing/Header/_internals/DraggableIconButton.tsx +0 -35
- package/src/Listing/Header/index.ts +0 -1
- package/src/Listing/Listing.styles.ts +0 -76
- package/src/Listing/Row/EmptyRow.styles.ts +0 -14
- package/src/Listing/Row/EmptyRow.tsx +0 -30
- package/src/Listing/Row/SkeletonLoaderRows.tsx +0 -23
- package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +0 -204
- package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.styles.ts +0 -51
- package/src/TimePeriods/CustomTimePeriod/CompactCustomTimePeriod.tsx +0 -95
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/ErrorText.tsx +0 -14
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/PickersStartEndDate.tsx +0 -163
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/index.tsx +0 -76
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/models.ts +0 -61
- package/src/TimePeriods/CustomTimePeriod/PopoverCustomTimePeriod/usePickersStartEndDate.ts +0 -82
- package/src/TimePeriods/CustomTimePeriod/index.tsx +0 -66
- package/src/TimePeriods/DateTimePickerInput.tsx +0 -49
- package/src/TimePeriods/ResolutionTimePeriod.cypress.spec.tsx +0 -65
- package/src/TimePeriods/SelectedTimePeriod.tsx +0 -102
- package/src/TimePeriods/TimePeriods.cypress.spec.tsx +0 -510
- package/src/TimePeriods/TimePeriods.styles.ts +0 -22
- package/src/TimePeriods/helpers/index.ts +0 -26
- package/src/TimePeriods/index.stories.tsx +0 -98
- package/src/TimePeriods/index.tsx +0 -78
- package/src/TimePeriods/mockedData.ts +0 -12
- package/src/TimePeriods/models.ts +0 -97
- package/src/TimePeriods/timePeriodsAtoms.ts +0 -102
- package/src/TimePeriods/translatedLabels.ts +0 -9
- package/src/TimePeriods/useSortTimePeriods.ts +0 -31
- package/src/TimePeriods/useTimePeriod.ts +0 -49
- package/src/Typography/FluidTypography/index.stories.tsx +0 -63
- package/src/Typography/FluidTypography/index.tsx +0 -51
- package/src/Typography/FluidTypography/useFluidResizeObserver.ts +0 -56
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-dashboard-normal-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-dashboard-with-item-header-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-dashboard-with-many-panels-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-fluid-typography-basic-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-fluid-typography-with-20-px-height-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-fluid-typography-with-200-px-width-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-fluid-typography-with-heading-5-variant-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-fluid-typography-with-long-text-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-listing-as-empty-state-1-snap.png +0 -0
- package/src/__image_snapshots__/storyshots-test-js-image-story-shots-listing-with-editable-and-sortable-columns-1-snap.png +0 -0
- package/src/base/tokens/README.md +0 -3
- package/src/base/tokens/source/$metadata.json +0 -5
- package/src/base/tokens/source/base.json +0 -142
- package/src/base/tokens/themes/base.tokens.d.ts +0 -38
- package/src/base/tokens/themes/base.tokens.json +0 -695
- package/src/base/tokens/themes/base.tokens.ts +0 -38
- package/src/base/tokens/themes/ui-dark.tokens.d.ts +0 -38
- package/src/base/tokens/themes/ui-dark.tokens.json +0 -695
- package/src/base/tokens/themes/ui-dark.tokens.ts +0 -38
- package/src/base/tokens/themes/ui-light.tokens.d.ts +0 -38
- package/src/base/tokens/themes/ui-light.tokens.json +0 -695
- package/src/base/tokens/themes/ui-light.tokens.ts +0 -38
- package/src/components/Button/Button.stories.tsx +0 -34
- package/src/components/Button/Button.styles.ts +0 -44
- package/src/components/Button/Button.tsx +0 -78
- package/src/components/Button/Icon/IconButton.stories.tsx +0 -18
- package/src/components/Button/Icon/IconButton.styles.ts +0 -14
- package/src/components/Button/Icon/IconButton.tsx +0 -58
- package/src/components/Button/Icon/index.tsx +0 -1
- package/src/components/Button/index.ts +0 -2
- package/src/components/DataTable/DataTable.stories.tsx +0 -51
- package/src/components/DataTable/DataTable.styles.ts +0 -27
- package/src/components/DataTable/DataTable.tsx +0 -35
- package/src/components/DataTable/EmptyState/DataTableEmptyState.stories.tsx +0 -21
- package/src/components/DataTable/EmptyState/DataTableEmptyState.styles.ts +0 -26
- package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +0 -53
- package/src/components/DataTable/Item/DataTableItem.stories.tsx +0 -25
- package/src/components/DataTable/Item/DataTableItem.styles.ts +0 -39
- package/src/components/DataTable/Item/DataTableItem.tsx +0 -102
- package/src/components/DataTable/Item/DataTableItemSkeleton.tsx +0 -13
- package/src/components/DataTable/index.ts +0 -10
- package/src/components/Form/Dashboard/Dashboard.resource.ts +0 -4
- package/src/components/Form/Dashboard/DashboardForm.stories.ts +0 -39
- package/src/components/Form/Dashboard/DashboardForm.styles.ts +0 -19
- package/src/components/Form/Dashboard/DashboardForm.tsx +0 -104
- package/src/components/Form/Dashboard/DashboardFormActions.tsx +0 -56
- package/src/components/Form/Dashboard/index.ts +0 -2
- package/src/components/Form/Dashboard/translatedLabels.ts +0 -6
- package/src/components/Form/Form.models.ts +0 -1
- package/src/components/Form/index.ts +0 -2
- package/src/components/Header/Header.styles.ts +0 -0
- package/src/components/Header/PageHeader/PageHeader.stories.tsx +0 -88
- package/src/components/Header/PageHeader/PageHeader.styles.ts +0 -99
- package/src/components/Header/PageHeader/PageHeader.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderActions.tsx +0 -17
- package/src/components/Header/PageHeader/PageHeaderMain.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderMenu.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderTitle.tsx +0 -47
- package/src/components/Header/PageHeader/index.ts +0 -12
- package/src/components/Header/index.ts +0 -1
- package/src/components/Icon/Icon.styles.ts +0 -0
- package/src/components/Icon/Icon.tsx +0 -2
- package/src/components/Icon/index.ts +0 -0
- package/src/components/Layout/AreaIndicator.styles.ts +0 -33
- package/src/components/Layout/AreaIndicator.tsx +0 -35
- package/src/components/Layout/PageLayout/PageLayout.stories.tsx +0 -81
- package/src/components/Layout/PageLayout/PageLayout.styles.ts +0 -40
- package/src/components/Layout/PageLayout/PageLayout.tsx +0 -21
- package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -15
- package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -24
- package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +0 -15
- package/src/components/Layout/PageLayout/index.ts +0 -10
- package/src/components/Layout/index.ts +0 -1
- package/src/components/Menu/Button/MenuButton.stories.tsx +0 -16
- package/src/components/Menu/Button/MenuButton.styles.ts +0 -27
- package/src/components/Menu/Button/MenuButton.tsx +0 -62
- package/src/components/Menu/Button/index.ts +0 -1
- package/src/components/Menu/Menu.stories.tsx +0 -71
- package/src/components/Menu/Menu.styles.ts +0 -70
- package/src/components/Menu/Menu.tsx +0 -25
- package/src/components/Menu/MenuDivider.tsx +0 -13
- package/src/components/Menu/MenuItem.tsx +0 -36
- package/src/components/Menu/MenuItems.tsx +0 -35
- package/src/components/Menu/index.ts +0 -12
- package/src/components/Menu/useMenu.tsx +0 -79
- package/src/components/Modal/Modal.stories.tsx +0 -111
- package/src/components/Modal/Modal.styles.ts +0 -55
- package/src/components/Modal/Modal.tsx +0 -59
- package/src/components/Modal/ModalActions.tsx +0 -59
- package/src/components/Modal/ModalBody.tsx +0 -15
- package/src/components/Modal/ModalHeader.tsx +0 -21
- package/src/components/Modal/index.ts +0 -12
- package/src/components/README.md +0 -3
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +0 -70
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.styles.ts +0 -5
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +0 -115
- package/src/components/Tooltip/TextOverflowTooltip/index.tsx +0 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -41
- package/src/components/Tooltip/Tooltip.styles.ts +0 -5
- package/src/components/Tooltip/Tooltip.tsx +0 -46
- package/src/components/Tooltip/index.ts +0 -1
- package/src/components/index.ts +0 -8
- package/src/screens/dashboard/DashboardsDetail.stories.tsx +0 -108
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +0 -281
- package/src/styles/tokens/themes/_ui-dark.tokens.json +0 -695
- package/src/styles/tokens/themes/_ui-light.tokens.json +0 -695
- package/src/utils/docsURL.ts +0 -31
- package/src/utils/index.ts +0 -18
- package/src/utils/panelSize.ts +0 -15
- package/src/utils/sanitizedHTML.ts +0 -18
- package/src/utils/useDateTimePickerAdapter.ts +0 -309
- package/src/utils/useResizeObserver.ts +0 -6
- /package/{public/brand → assets}/centreon-logo-one-line-dark.svg +0 -0
- /package/{public/brand → assets}/centreon-logo-one-line-light.svg +0 -0
- /package/{src/@assets/images → assets}/not-authorized-template-background-dark.svg +0 -0
- /package/{src/@assets/images → assets}/not-authorized-template-background-light.svg +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-bold-webfont.ttf +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-bold-webfont.woff +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-bold-webfont.woff2 +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-light-webfont.ttf +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-light-webfont.woff +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-light-webfont.woff2 +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-medium-webfont.ttf +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-medium-webfont.woff +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-medium-webfont.woff2 +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-regular-webfont.ttf +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-regular-webfont.woff +0 -0
- /package/{public/fonts → fonts/fonts-generated}/roboto-regular-webfont.woff2 +0 -0
- /package/src/Listing/Header/{_internals/Label.tsx → Label.tsx} +0 -0
- /package/src/Typography/{story.utils.tsx → index.tsx} +0 -0
|
@@ -16,18 +16,16 @@ import {
|
|
|
16
16
|
import { CircularProgress, useTheme } from '@mui/material';
|
|
17
17
|
|
|
18
18
|
import { Props as AutocompleteFieldProps } from '..';
|
|
19
|
-
import
|
|
20
|
-
useDebounce,
|
|
21
|
-
useIntersectionObserver,
|
|
22
|
-
useDeepCompare
|
|
23
|
-
} from '../../../../utils';
|
|
19
|
+
import useIntersectionObserver from '../../../../utils/useIntersectionObserver';
|
|
24
20
|
import { ListingModel, SelectEntry } from '../../../..';
|
|
25
21
|
import Option from '../../Option';
|
|
26
22
|
import {
|
|
27
23
|
ConditionsSearchParameter,
|
|
28
24
|
SearchParameter
|
|
29
25
|
} from '../../../../api/buildListingEndpoint/models';
|
|
26
|
+
import useDebounce from '../../../../utils/useDebounce';
|
|
30
27
|
import useFetchQuery from '../../../../api/useFetchQuery';
|
|
28
|
+
import { useDeepCompare } from '../../../../utils/useMemoComponent';
|
|
31
29
|
|
|
32
30
|
export interface ConnectedAutoCompleteFieldProps<TData> {
|
|
33
31
|
conditionField?: keyof SelectEntry;
|
|
@@ -65,9 +63,6 @@ const ConnectedAutocompleteField = (
|
|
|
65
63
|
const [searchParameter, setSearchParameter] = useState<
|
|
66
64
|
SearchParameter | undefined
|
|
67
65
|
>(undefined);
|
|
68
|
-
|
|
69
|
-
const [autocompleteChangedValue, setAutocompleteChangedValue] =
|
|
70
|
-
useState<Array<SelectEntry>>();
|
|
71
66
|
const debounce = useDebounce({
|
|
72
67
|
functionToDebounce: (value): void => {
|
|
73
68
|
setSearchParameter(getSearchParameter(value));
|
|
@@ -277,13 +272,6 @@ const ConnectedAutocompleteField = (
|
|
|
277
272
|
);
|
|
278
273
|
}, useDeepCompare([searchConditions]));
|
|
279
274
|
|
|
280
|
-
useEffect(() => {
|
|
281
|
-
if (!autocompleteChangedValue && !props?.value) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
setSearchParameter(undefined);
|
|
285
|
-
}, [autocompleteChangedValue, props?.value]);
|
|
286
|
-
|
|
287
275
|
useEffect(() => {
|
|
288
276
|
if (!optionsOpen) {
|
|
289
277
|
return;
|
|
@@ -299,7 +287,6 @@ const ConnectedAutocompleteField = (
|
|
|
299
287
|
open={optionsOpen}
|
|
300
288
|
options={options}
|
|
301
289
|
renderOption={renderOptions}
|
|
302
|
-
onChange={(_, value) => setAutocompleteChangedValue(value)}
|
|
303
290
|
onClose={(): void => setOptionsOpen(false)}
|
|
304
291
|
onOpen={(): void => setOptionsOpen(true)}
|
|
305
292
|
onTextChange={changeText}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { isNil, not } from 'ramda';
|
|
4
|
+
import withMock from 'storybook-addon-mock';
|
|
4
5
|
|
|
5
6
|
import { Tooltip, Typography } from '@mui/material';
|
|
6
7
|
|
|
@@ -14,6 +15,7 @@ import MultiDraggableAutocompleteField from './Multi';
|
|
|
14
15
|
import { ItemActionProps } from '.';
|
|
15
16
|
|
|
16
17
|
export default {
|
|
18
|
+
decorators: [withMock],
|
|
17
19
|
title: 'InputField/Autocomplete/Draggable'
|
|
18
20
|
};
|
|
19
21
|
|
|
@@ -85,7 +85,7 @@ const AutoSizeAutocompleteField = ({
|
|
|
85
85
|
endAdornment,
|
|
86
86
|
customPadding
|
|
87
87
|
}: AutoSizeAutocompleteFieldProps): JSX.Element => {
|
|
88
|
-
const [value, setValue] = React.useState(
|
|
88
|
+
const [value, setValue] = React.useState(autoSizeOptions[1]);
|
|
89
89
|
|
|
90
90
|
const change = (_, newValue): void => {
|
|
91
91
|
setValue(newValue);
|
|
@@ -108,3 +108,12 @@ const AutoSizeAutocompleteField = ({
|
|
|
108
108
|
export const autoSize = (): JSX.Element => {
|
|
109
109
|
return <AutoSizeAutocompleteField />;
|
|
110
110
|
};
|
|
111
|
+
|
|
112
|
+
export const autoSizeWithCustomPadding = (): JSX.Element => {
|
|
113
|
+
return (
|
|
114
|
+
<AutoSizeAutocompleteField
|
|
115
|
+
customPadding={5}
|
|
116
|
+
endAdornment={<EndAdornment />}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
@@ -20,7 +20,7 @@ import Option from '../Option';
|
|
|
20
20
|
import TextField from '../../Text';
|
|
21
21
|
import { SelectEntry } from '..';
|
|
22
22
|
import { searchLabel } from '../../translatedLabels';
|
|
23
|
-
import
|
|
23
|
+
import getNormalizedId from '../../../utils/getNormalizedId';
|
|
24
24
|
|
|
25
25
|
export type Props = {
|
|
26
26
|
autoFocus?: boolean;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Typography
|
|
13
13
|
} from '@mui/material';
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import getNormalizedId from '../../utils/getNormalizedId';
|
|
16
16
|
|
|
17
17
|
import useAutoSize from './useAutoSize';
|
|
18
18
|
|
|
@@ -84,7 +84,6 @@ export type Props = {
|
|
|
84
84
|
error?: string;
|
|
85
85
|
externalValueForAutoSize?: string;
|
|
86
86
|
open?: boolean;
|
|
87
|
-
required?: boolean;
|
|
88
87
|
size?: SizeVariant;
|
|
89
88
|
transparent?: boolean;
|
|
90
89
|
value?: string;
|
|
@@ -109,7 +108,6 @@ const TextField = forwardRef(
|
|
|
109
108
|
externalValueForAutoSize,
|
|
110
109
|
autoSizeCustomPadding,
|
|
111
110
|
defaultValue,
|
|
112
|
-
required = false,
|
|
113
111
|
...rest
|
|
114
112
|
}: Props,
|
|
115
113
|
ref: React.ForwardedRef<HTMLDivElement>
|
|
@@ -166,6 +164,7 @@ const TextField = forwardRef(
|
|
|
166
164
|
},
|
|
167
165
|
className
|
|
168
166
|
),
|
|
167
|
+
disableUnderline: true,
|
|
169
168
|
endAdornment: (
|
|
170
169
|
<OptionalLabelInputAdornment label={label} position="end">
|
|
171
170
|
{EndAdornment ? (
|
|
@@ -183,7 +182,6 @@ const TextField = forwardRef(
|
|
|
183
182
|
...rest.InputProps
|
|
184
183
|
}}
|
|
185
184
|
className={classes.textField}
|
|
186
|
-
required={required}
|
|
187
185
|
sx={{
|
|
188
186
|
width: autoSize ? width : undefined,
|
|
189
187
|
...rest?.sx
|
|
@@ -11,7 +11,7 @@ import { userAtom, ListingVariant } from '@centreon/ui-context';
|
|
|
11
11
|
|
|
12
12
|
import { ListingProps } from '../..';
|
|
13
13
|
import { labelOf, labelRowsPerPage } from '../translatedLabels';
|
|
14
|
-
import
|
|
14
|
+
import useMemoComponent from '../../utils/useMemoComponent';
|
|
15
15
|
import IconButton from '../../Button/Icon/index';
|
|
16
16
|
|
|
17
17
|
import StyledPagination from './Pagination';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { equals, props } from 'ramda';
|
|
4
|
+
import { makeStyles } from 'tss-react/mui';
|
|
4
5
|
|
|
5
6
|
import { Tooltip } from '@mui/material';
|
|
6
7
|
|
|
7
8
|
import { ListingVariant } from '@centreon/ui-context';
|
|
8
9
|
|
|
10
|
+
import DraggableIcon from '../Header/SortableCell/DraggableIcon';
|
|
9
11
|
import {
|
|
10
12
|
Column,
|
|
11
13
|
ColumnType,
|
|
@@ -15,11 +17,11 @@ import {
|
|
|
15
17
|
import useStyleTable from '../useStyleTable';
|
|
16
18
|
|
|
17
19
|
import EllipsisTypography from './EllipsisTypography';
|
|
18
|
-
import { useStyles } from './DataCell.styles';
|
|
19
20
|
|
|
20
21
|
import Cell from '.';
|
|
21
22
|
|
|
22
23
|
interface Props {
|
|
24
|
+
areColumnsEditable: boolean;
|
|
23
25
|
column: Column;
|
|
24
26
|
disableRowCondition: (row) => boolean;
|
|
25
27
|
getHighlightRowCondition?: (row) => boolean;
|
|
@@ -30,6 +32,31 @@ interface Props {
|
|
|
30
32
|
viewMode?: ListingVariant;
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
const useStyles = makeStyles()((theme) => ({
|
|
36
|
+
cell: {
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
backgroundColor: 'transparent',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
height: '100%',
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
whiteSpace: 'nowrap'
|
|
43
|
+
},
|
|
44
|
+
componentColumn: {
|
|
45
|
+
width: theme.spacing(2.75)
|
|
46
|
+
},
|
|
47
|
+
headerCell: {
|
|
48
|
+
padding: theme.spacing(0, 0, 0, 1)
|
|
49
|
+
},
|
|
50
|
+
rowNotHovered: {
|
|
51
|
+
color: theme.palette.text.secondary
|
|
52
|
+
},
|
|
53
|
+
text: {
|
|
54
|
+
overflow: 'hidden',
|
|
55
|
+
textOverflow: 'ellipsis',
|
|
56
|
+
whiteSpace: 'nowrap'
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
|
|
33
60
|
const DataCell = ({
|
|
34
61
|
row,
|
|
35
62
|
column,
|
|
@@ -38,12 +65,14 @@ const DataCell = ({
|
|
|
38
65
|
rowColorConditions,
|
|
39
66
|
disableRowCondition,
|
|
40
67
|
viewMode,
|
|
41
|
-
getHighlightRowCondition
|
|
68
|
+
getHighlightRowCondition,
|
|
69
|
+
areColumnsEditable
|
|
42
70
|
}: Props): JSX.Element | null => {
|
|
43
|
-
const { classes } = useStyles();
|
|
44
71
|
const { dataStyle } = useStyleTable({ viewMode });
|
|
72
|
+
const { classes } = useStyles();
|
|
45
73
|
|
|
46
74
|
const commonCellProps = {
|
|
75
|
+
align: 'left' as const,
|
|
47
76
|
disableRowCondition,
|
|
48
77
|
isRowHovered,
|
|
49
78
|
row,
|
|
@@ -73,7 +102,6 @@ const DataCell = ({
|
|
|
73
102
|
|
|
74
103
|
return (
|
|
75
104
|
<Cell
|
|
76
|
-
className={classes.cell}
|
|
77
105
|
isRowHighlighted={isRowHighlighted}
|
|
78
106
|
style={{
|
|
79
107
|
gridColumn
|
|
@@ -84,7 +112,10 @@ const DataCell = ({
|
|
|
84
112
|
{isTruncated && (
|
|
85
113
|
<Tooltip title={formattedString}>{typography}</Tooltip>
|
|
86
114
|
)}
|
|
87
|
-
|
|
115
|
+
<>
|
|
116
|
+
{areColumnsEditable && <DraggableIcon />}
|
|
117
|
+
{!isTruncated && typography}
|
|
118
|
+
</>
|
|
88
119
|
</Cell>
|
|
89
120
|
);
|
|
90
121
|
},
|
|
@@ -102,7 +133,6 @@ const DataCell = ({
|
|
|
102
133
|
|
|
103
134
|
return (
|
|
104
135
|
<Cell
|
|
105
|
-
className={classes.cell}
|
|
106
136
|
isRowHighlighted={isRowHighlighted}
|
|
107
137
|
viewMode={viewMode}
|
|
108
138
|
onClick={(e): void => {
|
|
@@ -114,25 +144,31 @@ const DataCell = ({
|
|
|
114
144
|
}}
|
|
115
145
|
{...commonCellProps}
|
|
116
146
|
>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
147
|
+
<>
|
|
148
|
+
{areColumnsEditable && (
|
|
149
|
+
<DraggableIcon className={classes.componentColumn} />
|
|
150
|
+
)}
|
|
151
|
+
|
|
152
|
+
<Component
|
|
153
|
+
isHovered={isRowHovered}
|
|
154
|
+
isSelected={isRowSelected}
|
|
155
|
+
renderEllipsisTypography={({
|
|
156
|
+
className,
|
|
157
|
+
formattedString
|
|
158
|
+
}): JSX.Element => {
|
|
159
|
+
return (
|
|
160
|
+
<EllipsisTypography
|
|
161
|
+
className={className}
|
|
162
|
+
dataStyle={dataStyle}
|
|
163
|
+
disableRowCondition={disableRowCondition(row)}
|
|
164
|
+
formattedString={formattedString}
|
|
165
|
+
isRowHovered={isRowHovered}
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
}}
|
|
169
|
+
row={row}
|
|
170
|
+
/>
|
|
171
|
+
</>
|
|
136
172
|
</Cell>
|
|
137
173
|
);
|
|
138
174
|
}
|
|
@@ -244,7 +280,8 @@ const MemoizedDataCell = memo<Props>(
|
|
|
244
280
|
nextProps.disableRowCondition(nextProps.row)
|
|
245
281
|
) &&
|
|
246
282
|
equals(previousIsRowHighlighted, nextIsRowHighlighted) &&
|
|
247
|
-
equals(prevProps.viewMode, nextProps.viewMode)
|
|
283
|
+
equals(prevProps.viewMode, nextProps.viewMode) &&
|
|
284
|
+
equals(prevProps.areColumnsEditable, nextProps.areColumnsEditable)
|
|
248
285
|
);
|
|
249
286
|
}
|
|
250
287
|
);
|
|
@@ -99,7 +99,7 @@ const useStyles = makeStyles<StylesProps>()(
|
|
|
99
99
|
overflow: 'hidden',
|
|
100
100
|
...getTextStyleByViewMode({ theme, viewMode }),
|
|
101
101
|
p: getRowHighlightStyle({ isRowHighlighted, theme }),
|
|
102
|
-
padding:
|
|
102
|
+
padding: 0,
|
|
103
103
|
whiteSpace: 'nowrap'
|
|
104
104
|
}
|
|
105
105
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import { always, and, equals, ifElse, isNil } from 'ramda';
|
|
4
|
+
import { makeStyles } from 'tss-react/mui';
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
TableCell,
|
|
@@ -9,12 +10,61 @@ import {
|
|
|
9
10
|
Tooltip
|
|
10
11
|
} from '@mui/material';
|
|
11
12
|
|
|
13
|
+
import { ListingVariant } from '@centreon/ui-context';
|
|
14
|
+
|
|
12
15
|
import { Props as ListingProps } from '../..';
|
|
13
16
|
import { Column } from '../../models';
|
|
14
|
-
import HeaderLabel from '../
|
|
15
|
-
import {
|
|
17
|
+
import HeaderLabel from '../Label';
|
|
18
|
+
import { getTextStyleByViewMode } from '../../useStyleTable';
|
|
19
|
+
|
|
20
|
+
import DraggableIcon from './DraggableIcon';
|
|
21
|
+
|
|
22
|
+
type StylesProps = Pick<Props, 'isDragging' | 'isInDragOverlay' | 'viewMode'>;
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
const useStyles = makeStyles<StylesProps>()(
|
|
25
|
+
(theme, { isDragging, isInDragOverlay, viewMode }) => ({
|
|
26
|
+
active: {
|
|
27
|
+
'&.Mui-active': {
|
|
28
|
+
'& .MuiTableSortLabel-icon': {
|
|
29
|
+
color: theme.palette.common.white
|
|
30
|
+
},
|
|
31
|
+
color: theme.palette.common.white
|
|
32
|
+
},
|
|
33
|
+
'&:hover': {
|
|
34
|
+
'& .MuiTableSortLabel-icon': {
|
|
35
|
+
opacity: 1
|
|
36
|
+
},
|
|
37
|
+
color: theme.palette.common.white
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
content: {
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
borderRadius: isDragging && isInDragOverlay ? theme.spacing(0.5) : 0,
|
|
43
|
+
color: theme.palette.common.white,
|
|
44
|
+
display: 'flex',
|
|
45
|
+
minHeight: theme.spacing(3)
|
|
46
|
+
},
|
|
47
|
+
dragHandle: {
|
|
48
|
+
alignSelf: 'center',
|
|
49
|
+
cursor: isDragging ? 'grabbing' : 'grab',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
outline: 'none'
|
|
52
|
+
},
|
|
53
|
+
simpleHeaderCellContent: {
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
display: 'inline-flex',
|
|
56
|
+
marginRight: theme.spacing(2)
|
|
57
|
+
},
|
|
58
|
+
tableCell: {
|
|
59
|
+
backgroundColor: isInDragOverlay
|
|
60
|
+
? 'transparent'
|
|
61
|
+
: theme.palette.background.listingHeader,
|
|
62
|
+
borderBottom: 'none',
|
|
63
|
+
padding: 0,
|
|
64
|
+
...getTextStyleByViewMode({ theme, viewMode })
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
);
|
|
18
68
|
|
|
19
69
|
type Props = Pick<
|
|
20
70
|
ListingProps<unknown>,
|
|
@@ -23,11 +73,14 @@ type Props = Pick<
|
|
|
23
73
|
areColumnsEditable: boolean;
|
|
24
74
|
className: string;
|
|
25
75
|
column: Column;
|
|
76
|
+
isDragging?: boolean;
|
|
77
|
+
isInDragOverlay?: boolean;
|
|
26
78
|
itemRef: React.RefObject<HTMLDivElement>;
|
|
27
79
|
style;
|
|
28
|
-
|
|
80
|
+
viewMode?: ListingVariant;
|
|
81
|
+
};
|
|
29
82
|
|
|
30
|
-
const
|
|
83
|
+
const SortableHeaderCellContent = ({
|
|
31
84
|
column,
|
|
32
85
|
columnConfiguration,
|
|
33
86
|
sortField,
|
|
@@ -46,6 +99,8 @@ const ListingHeaderCell = ({
|
|
|
46
99
|
isInDragOverlay,
|
|
47
100
|
viewMode
|
|
48
101
|
});
|
|
102
|
+
const [cellHovered, setCellHovered] = React.useState(false);
|
|
103
|
+
|
|
49
104
|
const columnLabel = column.shortLabel || column.label;
|
|
50
105
|
|
|
51
106
|
const columnSortField = column.sortField || column.id;
|
|
@@ -64,6 +119,14 @@ const ListingHeaderCell = ({
|
|
|
64
119
|
});
|
|
65
120
|
};
|
|
66
121
|
|
|
122
|
+
const mouseOver = (): void => {
|
|
123
|
+
setCellHovered(true);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const mouseOut = (): void => {
|
|
127
|
+
setCellHovered(false);
|
|
128
|
+
};
|
|
129
|
+
|
|
67
130
|
const headerContent = (
|
|
68
131
|
<Tooltip placement="top" title={getTooltipLabel(column.shortLabel)}>
|
|
69
132
|
<HeaderLabel>{columnLabel}</HeaderLabel>
|
|
@@ -74,12 +137,22 @@ const ListingHeaderCell = ({
|
|
|
74
137
|
<TableCell
|
|
75
138
|
className={classes.tableCell}
|
|
76
139
|
component={'div' as unknown as React.ElementType<TableCellBaseProps>}
|
|
77
|
-
data-isdragging={isDragging}
|
|
78
|
-
data-isindragoverlay={isInDragOverlay}
|
|
79
140
|
ref={itemRef}
|
|
80
141
|
style={style}
|
|
142
|
+
onMouseOut={mouseOut}
|
|
143
|
+
onMouseOver={mouseOver}
|
|
81
144
|
>
|
|
82
145
|
<div className={classes.content}>
|
|
146
|
+
{columnConfiguration?.sortable && areColumnsEditable && (
|
|
147
|
+
<DraggableIcon
|
|
148
|
+
visible={cellHovered}
|
|
149
|
+
{...props}
|
|
150
|
+
isInteractive
|
|
151
|
+
className={cx({ [classes.dragHandle]: cellHovered })}
|
|
152
|
+
columnLabel={columnLabel}
|
|
153
|
+
/>
|
|
154
|
+
)}
|
|
155
|
+
|
|
83
156
|
{column.sortable ? (
|
|
84
157
|
<TableSortLabel
|
|
85
158
|
active={sortField === columnSortField}
|
|
@@ -93,17 +166,9 @@ const ListingHeaderCell = ({
|
|
|
93
166
|
) : (
|
|
94
167
|
<div className={classes.simpleHeaderCellContent}>{headerContent}</div>
|
|
95
168
|
)}
|
|
96
|
-
|
|
97
|
-
{columnConfiguration?.sortable && areColumnsEditable && (
|
|
98
|
-
<DraggableIconButton
|
|
99
|
-
{...props}
|
|
100
|
-
className={cx(classes.dragHandle, 'dragHandle')}
|
|
101
|
-
columnLabel={columnLabel}
|
|
102
|
-
/>
|
|
103
|
-
)}
|
|
104
169
|
</div>
|
|
105
170
|
</TableCell>
|
|
106
171
|
);
|
|
107
172
|
};
|
|
108
173
|
|
|
109
|
-
export default
|
|
174
|
+
export default SortableHeaderCellContent;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
import SvgIcon from '@mui/material/SvgIcon';
|
|
6
|
+
|
|
7
|
+
import { labelDragHandle } from '../../translatedLabels';
|
|
8
|
+
|
|
9
|
+
interface Icon {
|
|
10
|
+
className?: string;
|
|
11
|
+
columnLabel?: string;
|
|
12
|
+
isInteractive?: boolean;
|
|
13
|
+
visible?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const DraggableIcon = ({
|
|
17
|
+
visible = false,
|
|
18
|
+
columnLabel,
|
|
19
|
+
className,
|
|
20
|
+
isInteractive = false,
|
|
21
|
+
...rest
|
|
22
|
+
}: Icon): JSX.Element => {
|
|
23
|
+
const { t } = useTranslation();
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<SvgIcon
|
|
27
|
+
aria-label={`${columnLabel} ${t(labelDragHandle)}`}
|
|
28
|
+
fontSize="medium"
|
|
29
|
+
{...rest}
|
|
30
|
+
className={className}
|
|
31
|
+
role={isInteractive ? 'button' : undefined}
|
|
32
|
+
tabIndex={isInteractive ? 0 : undefined}
|
|
33
|
+
>
|
|
34
|
+
{visible && (
|
|
35
|
+
<path d="M 12 8 c 1.1 0 2 -0.9 2 -2 s -0.9 -2 -2 -2 s -2 0.9 -2 2 s 0.9 2 2 2 Z m 0 2 c -1.1 0 -2 0.9 -2 2 s 0.9 2 2 2 s 2 -0.9 2 -2 s -0.9 -2 -2 -2 Z m 0 6 c -1.1 0 -2 0.9 -2 2 s 0.9 2 2 2 s 2 -0.9 2 -2 s -0.9 -2 -2 -2 Z" />
|
|
36
|
+
)}
|
|
37
|
+
</SvgIcon>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default DraggableIcon;
|