@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,14 +1,14 @@
|
|
|
1
1
|
import { Paper } from '@mui/material';
|
|
2
2
|
|
|
3
|
+
import { Form, GroupDirection } from './Form';
|
|
3
4
|
import {
|
|
4
5
|
BasicForm,
|
|
6
|
+
CustomButton,
|
|
5
7
|
basicFormGroups,
|
|
6
8
|
basicFormInitialValues,
|
|
7
9
|
basicFormInputs,
|
|
8
|
-
basicFormValidationSchema
|
|
9
|
-
CustomButton
|
|
10
|
+
basicFormValidationSchema
|
|
10
11
|
} from './storiesData';
|
|
11
|
-
import { Form, GroupDirection } from './Form';
|
|
12
12
|
|
|
13
13
|
export default { title: 'Form' };
|
|
14
14
|
|
package/src/Form/Form.tsx
CHANGED
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
FormikSharedConfig,
|
|
5
5
|
FormikValues
|
|
6
6
|
} from 'formik';
|
|
7
|
-
import * as Yup from 'yup';
|
|
8
7
|
|
|
8
|
+
import { ComponentType } from 'react';
|
|
9
|
+
import { Schema } from 'yup';
|
|
10
|
+
import { useStyles } from './Form.styles';
|
|
9
11
|
import FormButtons from './FormButtons';
|
|
10
12
|
import Inputs from './Inputs';
|
|
11
13
|
import { Group, InputProps } from './Inputs/models';
|
|
12
|
-
import { useStyles } from './Form.styles';
|
|
13
14
|
|
|
14
15
|
export enum GroupDirection {
|
|
15
16
|
Horizontal = 'horizontal',
|
|
@@ -17,7 +18,7 @@ export enum GroupDirection {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export type FormProps<T> = {
|
|
20
|
-
Buttons?:
|
|
21
|
+
Buttons?: ComponentType;
|
|
21
22
|
areGroupsOpen?: boolean;
|
|
22
23
|
children?: JSX.Element;
|
|
23
24
|
className?: string;
|
|
@@ -30,7 +31,7 @@ export type FormProps<T> = {
|
|
|
30
31
|
isLoading?: boolean;
|
|
31
32
|
submit: (values: T, bag: FormikHelpers<T>) => void | Promise<void>;
|
|
32
33
|
validate?: (values: FormikValues) => void;
|
|
33
|
-
validationSchema:
|
|
34
|
+
validationSchema: Schema<T>;
|
|
34
35
|
} & Omit<FormikSharedConfig<T>, 'isInitialValid'>;
|
|
35
36
|
|
|
36
37
|
const Form = <T extends object>({
|
package/src/Form/FormButtons.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
5
4
|
import { not } from 'ramda';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
|
|
8
8
|
import { Button } from '@mui/material';
|
|
9
9
|
|
|
10
10
|
import SaveButton from '../Button/Save';
|
|
11
|
-
import {
|
|
11
|
+
import { getNormalizedId, useMemoComponent } from '../utils';
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
labelReset,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
|
-
import { equals, isNil, map, not,
|
|
4
|
+
import { path, equals, isNil, map, not, prop, type } from 'ramda';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
7
|
import { FormHelperText, Stack } from '@mui/material';
|
|
8
8
|
|
|
9
|
+
import { SelectEntry } from '../../InputField/Select';
|
|
9
10
|
import SingleAutocompleteField from '../../InputField/Select/Autocomplete';
|
|
10
|
-
import { labelPressEnterToAccept } from '../translatedLabels';
|
|
11
11
|
import MultiAutocompleteField from '../../InputField/Select/Autocomplete/Multi';
|
|
12
12
|
import { useMemoComponent } from '../../utils';
|
|
13
|
-
import {
|
|
13
|
+
import { labelPressEnterToAccept } from '../translatedLabels';
|
|
14
14
|
|
|
15
15
|
import { InputPropsWithoutGroup, InputType } from './models';
|
|
16
16
|
|
|
@@ -5,8 +5,8 @@ import { path, split } from 'ramda';
|
|
|
5
5
|
|
|
6
6
|
import { Box } from '@mui/material';
|
|
7
7
|
|
|
8
|
-
import { Checkbox as CheckboxComponent } from '../../Checkbox';
|
|
9
8
|
import { useMemoComponent } from '../..';
|
|
9
|
+
import { Checkbox as CheckboxComponent } from '../../Checkbox';
|
|
10
10
|
|
|
11
11
|
import { InputPropsWithoutGroup } from './models';
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ChangeEvent, useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
|
-
import { equals, includes,
|
|
4
|
+
import { path, equals, includes, split } from 'ramda';
|
|
5
5
|
|
|
6
6
|
import { Box, Typography } from '@mui/material';
|
|
7
7
|
|
|
8
|
-
import { CheckboxGroup as CheckboxGroupComponent } from '../../Checkbox';
|
|
9
8
|
import { useMemoComponent } from '../..';
|
|
9
|
+
import { CheckboxGroup as CheckboxGroupComponent } from '../../Checkbox';
|
|
10
10
|
|
|
11
11
|
import { InputPropsWithoutGroup } from './models';
|
|
12
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
|
-
import { equals, isEmpty,
|
|
4
|
+
import { path, equals, isEmpty, propEq, reject, split } from 'ramda';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
7
|
import {
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import { DraggableSyntheticListeners, rectIntersection } from '@dnd-kit/core';
|
|
4
|
+
import { verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
3
5
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
6
|
import { useAtomValue } from 'jotai';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { makeStyles } from 'tss-react/mui';
|
|
7
|
-
import { verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
8
|
-
import { DraggableSyntheticListeners, rectIntersection } from '@dnd-kit/core';
|
|
9
7
|
import {
|
|
8
|
+
path,
|
|
9
|
+
clone,
|
|
10
10
|
dec,
|
|
11
11
|
equals,
|
|
12
|
+
filter,
|
|
12
13
|
inc,
|
|
14
|
+
is,
|
|
13
15
|
isNil,
|
|
14
|
-
pick,
|
|
15
|
-
split,
|
|
16
|
-
path,
|
|
17
|
-
type,
|
|
18
|
-
not,
|
|
19
|
-
filter,
|
|
20
|
-
pipe,
|
|
21
16
|
map,
|
|
17
|
+
not,
|
|
22
18
|
or,
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
pick,
|
|
20
|
+
pipe,
|
|
21
|
+
split,
|
|
22
|
+
type
|
|
25
23
|
} from 'ramda';
|
|
24
|
+
import { useTranslation } from 'react-i18next';
|
|
25
|
+
import { makeStyles } from 'tss-react/mui';
|
|
26
26
|
|
|
27
|
-
import { FormHelperText, IconButton, Typography } from '@mui/material';
|
|
28
27
|
import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore';
|
|
28
|
+
import { FormHelperText, IconButton, Typography } from '@mui/material';
|
|
29
29
|
|
|
30
30
|
import { userAtom } from '@centreon/ui-context';
|
|
31
31
|
|
|
32
|
-
import { DragEnd } from '../../../SortableItems';
|
|
33
32
|
import { SortableItems, useMemoComponent } from '../../..';
|
|
33
|
+
import { DragEnd } from '../../../SortableItems';
|
|
34
34
|
import {
|
|
35
35
|
InputPropsWithoutGroup,
|
|
36
36
|
InputPropsWithoutGroupAndType
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Children } from 'react';
|
|
2
2
|
|
|
3
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
|
-
import {
|
|
4
|
+
import { path, inc, is, not, remove, split } from 'ramda';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
|
|
8
8
|
import DeleteIcon from '@mui/icons-material/Delete';
|
|
9
9
|
|
|
10
|
-
import { IconButton } from '../../..';
|
|
11
10
|
import { getInput } from '..';
|
|
11
|
+
import { IconButton } from '../../..';
|
|
12
12
|
import { InputPropsWithoutGroup } from '../models';
|
|
13
13
|
|
|
14
14
|
interface StylesProps {
|
|
@@ -2,8 +2,8 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { DraggableSyntheticListeners } from '@dnd-kit/core';
|
|
4
4
|
|
|
5
|
-
import KrilinIndicatorIcon from '@mui/icons-material/DragIndicator';
|
|
6
5
|
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
6
|
+
import KrilinIndicatorIcon from '@mui/icons-material/DragIndicator';
|
|
7
7
|
|
|
8
8
|
import { IconButton } from '../../../components';
|
|
9
9
|
|
|
@@ -4,12 +4,12 @@ import { closestCenter } from '@dnd-kit/core';
|
|
|
4
4
|
import { verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
|
-
import { InputPropsWithoutGroup } from '../models';
|
|
8
7
|
import { SortableItems, Subtitle } from '../../..';
|
|
8
|
+
import { InputPropsWithoutGroup } from '../models';
|
|
9
9
|
|
|
10
|
-
import { useList } from './useList';
|
|
11
|
-
import { useListStyles } from './List.styles';
|
|
12
10
|
import Content, { ContentProps } from './Content';
|
|
11
|
+
import { useListStyles } from './List.styles';
|
|
12
|
+
import { useList } from './useList';
|
|
13
13
|
|
|
14
14
|
const List = ({
|
|
15
15
|
list,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useTranslation } from 'react-i18next';
|
|
2
2
|
|
|
3
|
-
import { InputAdornment } from '@mui/material';
|
|
4
3
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
5
4
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
5
|
+
import { InputAdornment } from '@mui/material';
|
|
6
6
|
|
|
7
7
|
import { IconButton } from '../..';
|
|
8
8
|
import {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { FormikValues, useFormikContext } from 'formik';
|
|
2
|
-
import { equals, includes,
|
|
2
|
+
import { path, equals, includes, split, type } from 'ramda';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
FormControlLabel,
|
|
7
7
|
FormGroup,
|
|
8
8
|
FormLabel,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Radio as MUIRadio,
|
|
10
|
+
RadioGroup
|
|
11
11
|
} from '@mui/material';
|
|
12
12
|
|
|
13
13
|
import { useMemoComponent } from '../..';
|
|
@@ -6,8 +6,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
|
|
7
7
|
import { FormControlLabel, Switch as MUISwitch } from '@mui/material';
|
|
8
8
|
|
|
9
|
-
import { getNormalizedId } from '../../utils/getNormalizedId';
|
|
10
9
|
import { useMemoComponent } from '../..';
|
|
10
|
+
import { getNormalizedId } from '../../utils/getNormalizedId';
|
|
11
11
|
|
|
12
12
|
import { InputPropsWithoutGroup } from './models';
|
|
13
13
|
|
package/src/Form/Inputs/Text.tsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ChangeEvent, useCallback, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { useFormikContext, FormikValues } from 'formik';
|
|
3
|
+
import { FormikValues, useFormikContext } from 'formik';
|
|
5
4
|
import {
|
|
5
|
+
path,
|
|
6
6
|
equals,
|
|
7
7
|
gt,
|
|
8
8
|
isEmpty,
|
|
9
9
|
not,
|
|
10
|
-
path,
|
|
11
10
|
split,
|
|
12
11
|
type as variableType
|
|
13
12
|
} from 'ramda';
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
14
|
|
|
15
15
|
import { InputAdornment } from '@mui/material';
|
|
16
16
|
|
|
@@ -51,7 +51,7 @@ const Text = ({
|
|
|
51
51
|
|
|
52
52
|
const formattedValue =
|
|
53
53
|
equals(text?.type, 'number') && !isEmpty(value)
|
|
54
|
-
? parseInt(value, 10)
|
|
54
|
+
? Number.parseInt(value, 10)
|
|
55
55
|
: value;
|
|
56
56
|
|
|
57
57
|
setFieldValue(fieldName, formattedValue);
|
|
@@ -1,74 +1,84 @@
|
|
|
1
1
|
import { Fragment, useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import * as R from 'ramda';
|
|
4
|
-
import { makeStyles } from 'tss-react/mui';
|
|
5
3
|
import { FormikValues, useFormikContext } from 'formik';
|
|
4
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
5
|
|
|
7
6
|
import { Divider, Typography } from '@mui/material';
|
|
8
7
|
|
|
9
|
-
import CollapsibleGroup from '../CollapsibleGroup';
|
|
10
8
|
import { GroupDirection } from '..';
|
|
9
|
+
import CollapsibleGroup from '../CollapsibleGroup';
|
|
11
10
|
|
|
12
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
T,
|
|
13
|
+
always,
|
|
14
|
+
any,
|
|
15
|
+
ascend,
|
|
16
|
+
cond,
|
|
17
|
+
equals,
|
|
18
|
+
filter,
|
|
19
|
+
find,
|
|
20
|
+
groupBy,
|
|
21
|
+
isEmpty,
|
|
22
|
+
isNil,
|
|
23
|
+
keys,
|
|
24
|
+
last,
|
|
25
|
+
not,
|
|
26
|
+
pluck,
|
|
27
|
+
prop,
|
|
28
|
+
propEq,
|
|
29
|
+
reduce,
|
|
30
|
+
sort,
|
|
31
|
+
toPairs
|
|
32
|
+
} from 'ramda';
|
|
13
33
|
import Autocomplete from './Autocomplete';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import TextInput from './Text';
|
|
34
|
+
import Checkbox from './Checkbox';
|
|
35
|
+
import CheckboxGroup from './CheckboxGroup';
|
|
17
36
|
import ConnectedAutocomplete from './ConnectedAutocomplete';
|
|
37
|
+
import Custom from './Custom';
|
|
18
38
|
import FieldsTable from './FieldsTable/FieldsTable';
|
|
19
39
|
import Grid from './Grid';
|
|
20
|
-
import CheckboxGroup from './CheckboxGroup';
|
|
21
|
-
import Checkbox from './Checkbox';
|
|
22
|
-
import Custom from './Custom';
|
|
23
|
-
import LoadingSkeleton from './LoadingSkeleton';
|
|
24
40
|
import List from './List/List';
|
|
41
|
+
import LoadingSkeleton from './LoadingSkeleton';
|
|
42
|
+
import RadioInput from './Radio';
|
|
43
|
+
import SwitchInput from './Switch';
|
|
44
|
+
import TextInput from './Text';
|
|
45
|
+
import { Group, InputProps, InputPropsWithoutGroup, InputType } from './models';
|
|
25
46
|
|
|
26
|
-
export const getInput =
|
|
47
|
+
export const getInput = cond<
|
|
27
48
|
Array<InputType>,
|
|
28
49
|
(props: InputPropsWithoutGroup) => JSX.Element | null
|
|
29
50
|
>([
|
|
51
|
+
[equals(InputType.Switch) as (b: InputType) => boolean, always(SwitchInput)],
|
|
52
|
+
[equals(InputType.Radio) as (b: InputType) => boolean, always(RadioInput)],
|
|
30
53
|
[
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
R.equals(InputType.Radio) as (b: InputType) => boolean,
|
|
36
|
-
R.always(RadioInput)
|
|
37
|
-
],
|
|
38
|
-
[
|
|
39
|
-
R.equals(InputType.SingleAutocomplete) as (b: InputType) => boolean,
|
|
40
|
-
R.always(Autocomplete)
|
|
41
|
-
],
|
|
42
|
-
[
|
|
43
|
-
R.equals(InputType.MultiAutocomplete) as (b: InputType) => boolean,
|
|
44
|
-
R.always(Autocomplete)
|
|
54
|
+
equals(InputType.SingleAutocomplete) as (b: InputType) => boolean,
|
|
55
|
+
always(Autocomplete)
|
|
45
56
|
],
|
|
46
57
|
[
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
equals(InputType.MultiAutocomplete) as (b: InputType) => boolean,
|
|
59
|
+
always(Autocomplete)
|
|
49
60
|
],
|
|
50
61
|
[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
) => boolean,
|
|
54
|
-
R.always(ConnectedAutocomplete)
|
|
62
|
+
equals(InputType.MultiConnectedAutocomplete) as (b: InputType) => boolean,
|
|
63
|
+
always(ConnectedAutocomplete)
|
|
55
64
|
],
|
|
56
65
|
[
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
equals(InputType.SingleConnectedAutocomplete) as (b: InputType) => boolean,
|
|
67
|
+
always(ConnectedAutocomplete)
|
|
59
68
|
],
|
|
60
|
-
[R.equals(InputType.Grid) as (b: InputType) => boolean, R.always(Grid)],
|
|
61
|
-
[R.equals(InputType.Custom) as (b: InputType) => boolean, R.always(Custom)],
|
|
62
69
|
[
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
equals(InputType.FieldsTable) as (b: InputType) => boolean,
|
|
71
|
+
always(FieldsTable)
|
|
65
72
|
],
|
|
73
|
+
[equals(InputType.Grid) as (b: InputType) => boolean, always(Grid)],
|
|
74
|
+
[equals(InputType.Custom) as (b: InputType) => boolean, always(Custom)],
|
|
75
|
+
[equals(InputType.Checkbox) as (b: InputType) => boolean, always(Checkbox)],
|
|
66
76
|
[
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
equals(InputType.CheckboxGroup) as (b: InputType) => boolean,
|
|
78
|
+
always(CheckboxGroup)
|
|
69
79
|
],
|
|
70
|
-
[
|
|
71
|
-
[
|
|
80
|
+
[equals(InputType.List) as (b: InputType) => boolean, always(List)],
|
|
81
|
+
[T, always(TextInput)]
|
|
72
82
|
]);
|
|
73
83
|
|
|
74
84
|
interface StylesProps {
|
|
@@ -86,13 +96,13 @@ const useStyles = makeStyles<StylesProps>()((theme, { groupDirection }) => ({
|
|
|
86
96
|
justifyContent: 'flex-end'
|
|
87
97
|
},
|
|
88
98
|
divider: {
|
|
89
|
-
margin:
|
|
99
|
+
margin: equals(groupDirection, GroupDirection.Horizontal)
|
|
90
100
|
? theme.spacing(0, 2)
|
|
91
101
|
: theme.spacing(2, 0)
|
|
92
102
|
},
|
|
93
103
|
groups: {
|
|
94
104
|
display: 'flex',
|
|
95
|
-
flexDirection:
|
|
105
|
+
flexDirection: equals(groupDirection, GroupDirection.Horizontal)
|
|
96
106
|
? 'row'
|
|
97
107
|
: 'column'
|
|
98
108
|
},
|
|
@@ -129,9 +139,9 @@ const Inputs = ({
|
|
|
129
139
|
const { classes, cx } = useStyles({ groupDirection });
|
|
130
140
|
const formikContext = useFormikContext<FormikValues>();
|
|
131
141
|
|
|
132
|
-
const groupsName =
|
|
142
|
+
const groupsName = pluck('name', groups);
|
|
133
143
|
|
|
134
|
-
const visibleInputs =
|
|
144
|
+
const visibleInputs = filter(
|
|
135
145
|
({ hideInput }) =>
|
|
136
146
|
formikContext ? !hideInput?.(formikContext?.values) || false : true,
|
|
137
147
|
inputs
|
|
@@ -139,30 +149,30 @@ const Inputs = ({
|
|
|
139
149
|
|
|
140
150
|
const inputsByGroup = useMemo(
|
|
141
151
|
() =>
|
|
142
|
-
|
|
143
|
-
({ group }) =>
|
|
152
|
+
groupBy(
|
|
153
|
+
({ group }) => find(equals(group), groupsName) as string,
|
|
144
154
|
visibleInputs
|
|
145
155
|
),
|
|
146
156
|
[visibleInputs]
|
|
147
157
|
) as Record<string, Array<InputProps>>;
|
|
148
158
|
|
|
149
159
|
const sortedGroupNames = useMemo(() => {
|
|
150
|
-
const sortedGroups =
|
|
160
|
+
const sortedGroups = sort(ascend(prop('order')), groups);
|
|
151
161
|
|
|
152
|
-
const usedGroups =
|
|
153
|
-
({ name }) =>
|
|
162
|
+
const usedGroups = filter(
|
|
163
|
+
({ name }) => any(equals(name), keys(inputsByGroup)),
|
|
154
164
|
sortedGroups
|
|
155
165
|
);
|
|
156
166
|
|
|
157
|
-
return
|
|
167
|
+
return pluck('name', usedGroups);
|
|
158
168
|
}, []);
|
|
159
169
|
|
|
160
170
|
const sortedInputsByGroup = useMemo(
|
|
161
171
|
() =>
|
|
162
|
-
|
|
172
|
+
reduce<string, Record<string, Array<InputProps>>>(
|
|
163
173
|
(acc, value) => ({
|
|
164
174
|
...acc,
|
|
165
|
-
[value]:
|
|
175
|
+
[value]: sort(
|
|
166
176
|
(a, b) => (b?.required ? 1 : 0) - (a?.required ? 1 : 0),
|
|
167
177
|
inputsByGroup[value]
|
|
168
178
|
)
|
|
@@ -173,24 +183,24 @@ const Inputs = ({
|
|
|
173
183
|
[visibleInputs]
|
|
174
184
|
);
|
|
175
185
|
|
|
176
|
-
const lastGroup = useMemo(() =>
|
|
186
|
+
const lastGroup = useMemo(() => last(sortedGroupNames), []);
|
|
177
187
|
|
|
178
188
|
const normalizedInputsByGroup = (
|
|
179
|
-
|
|
189
|
+
isEmpty(sortedInputsByGroup)
|
|
180
190
|
? [[null, visibleInputs]]
|
|
181
|
-
:
|
|
191
|
+
: toPairs(sortedInputsByGroup)
|
|
182
192
|
) as Array<[string | null, Array<InputProps>]>;
|
|
183
193
|
|
|
184
194
|
return (
|
|
185
195
|
<div className={classes.groups}>
|
|
186
196
|
{normalizedInputsByGroup.map(([groupName, groupedInputs], index) => {
|
|
187
|
-
const hasGroupTitle =
|
|
197
|
+
const hasGroupTitle = not(isNil(groupName));
|
|
188
198
|
|
|
189
199
|
const groupProps = hasGroupTitle
|
|
190
|
-
?
|
|
200
|
+
? find(propEq(groupName, 'name'), groups)
|
|
191
201
|
: ({} as Group);
|
|
192
202
|
|
|
193
|
-
const isFirstElement = areGroupsOpen ||
|
|
203
|
+
const isFirstElement = areGroupsOpen || equals(index, 0);
|
|
194
204
|
|
|
195
205
|
return (
|
|
196
206
|
<Fragment key={groupName}>
|
|
@@ -240,18 +250,17 @@ const Inputs = ({
|
|
|
240
250
|
</div>
|
|
241
251
|
</CollapsibleGroup>
|
|
242
252
|
</div>
|
|
243
|
-
{hasGroupTitle &&
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)}
|
|
253
|
+
{hasGroupTitle && not(equals(lastGroup, groupName as string)) && (
|
|
254
|
+
<Divider
|
|
255
|
+
flexItem
|
|
256
|
+
className={classes.divider}
|
|
257
|
+
orientation={
|
|
258
|
+
equals(groupDirection, GroupDirection.Horizontal)
|
|
259
|
+
? 'vertical'
|
|
260
|
+
: 'horizontal'
|
|
261
|
+
}
|
|
262
|
+
/>
|
|
263
|
+
)}
|
|
255
264
|
</Fragment>
|
|
256
265
|
);
|
|
257
266
|
})}
|
|
@@ -6,20 +6,20 @@ import { SelectEntry } from '../../InputField/Select';
|
|
|
6
6
|
import { ConditionsSearchParameter } from '../../api/buildListingEndpoint/models';
|
|
7
7
|
|
|
8
8
|
export enum InputType {
|
|
9
|
-
Switch,
|
|
10
|
-
Radio,
|
|
11
|
-
Text,
|
|
12
|
-
SingleAutocomplete,
|
|
13
|
-
MultiAutocomplete,
|
|
14
|
-
Password,
|
|
15
|
-
SingleConnectedAutocomplete,
|
|
16
|
-
MultiConnectedAutocomplete,
|
|
17
|
-
FieldsTable,
|
|
18
|
-
Grid,
|
|
19
|
-
Custom,
|
|
20
|
-
Checkbox,
|
|
21
|
-
CheckboxGroup,
|
|
22
|
-
List
|
|
9
|
+
Switch = 0,
|
|
10
|
+
Radio = 1,
|
|
11
|
+
Text = 2,
|
|
12
|
+
SingleAutocomplete = 3,
|
|
13
|
+
MultiAutocomplete = 4,
|
|
14
|
+
Password = 5,
|
|
15
|
+
SingleConnectedAutocomplete = 6,
|
|
16
|
+
MultiConnectedAutocomplete = 7,
|
|
17
|
+
FieldsTable = 8,
|
|
18
|
+
Grid = 9,
|
|
19
|
+
Custom = 10,
|
|
20
|
+
Checkbox = 11,
|
|
21
|
+
CheckboxGroup = 12,
|
|
22
|
+
List = 13
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
interface FieldsTableGetRequiredProps {
|