@portnet/ui 6.0.2 → 6.0.3
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/CHANGELOG.md +652 -0
- package/dist/esm/index.js +72 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/v2/__tests__/AppMain.test.js +130 -0
- package/dist/esm/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js +180 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js +150 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js +93 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldError.test.js +71 -38
- package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FieldNaming.test.js +160 -0
- package/dist/esm/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldWidth.test.js +11 -11
- package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FileCard.test.js +18 -17
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js +87 -179
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +32 -44
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js +101 -0
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js +118 -199
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -42
- package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js +165 -0
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js +156 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +37 -52
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/esm/v2/__tests__/apiError.test.js +50 -69
- package/dist/esm/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/banned-patterns.test.js +41 -122
- package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/esm/v2/__tests__/chart-palette.test.js +204 -0
- package/dist/esm/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/esm/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/esm/v2/__tests__/fileValidation.test.js +134 -0
- package/dist/esm/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js +321 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js +68 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js +218 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js +17 -21
- package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/esm/v2/__tests__/locale-fallback.test.js +35 -40
- package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js +143 -0
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/rowActions.test.js +182 -0
- package/dist/esm/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js +155 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js +266 -402
- package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js +120 -0
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/esm/v2/components/Accordion.js +48 -70
- package/dist/esm/v2/components/Accordion.js.map +1 -1
- package/dist/esm/v2/components/ActionStrip.js +31 -43
- package/dist/esm/v2/components/ActionStrip.js.map +1 -1
- package/dist/esm/v2/components/Banner.js +25 -22
- package/dist/esm/v2/components/Banner.js.map +1 -1
- package/dist/esm/v2/components/Busy.js +14 -19
- package/dist/esm/v2/components/Busy.js.map +1 -1
- package/dist/esm/v2/components/Button.js +34 -45
- package/dist/esm/v2/components/Button.js.map +1 -1
- package/dist/esm/v2/components/CategoryTag.js +44 -27
- package/dist/esm/v2/components/CategoryTag.js.map +1 -1
- package/dist/esm/v2/components/Checkbox.js +32 -38
- package/dist/esm/v2/components/Checkbox.js.map +1 -1
- package/dist/esm/v2/components/Chip.js +23 -36
- package/dist/esm/v2/components/Chip.js.map +1 -1
- package/dist/esm/v2/components/Combobox.js +112 -136
- package/dist/esm/v2/components/Combobox.js.map +1 -1
- package/dist/esm/v2/components/CommandPalette.js +113 -198
- package/dist/esm/v2/components/CommandPalette.js.map +1 -1
- package/dist/esm/v2/components/ConfirmDialog.js +36 -45
- package/dist/esm/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/esm/v2/components/DatePicker.js +78 -81
- package/dist/esm/v2/components/DatePicker.js.map +1 -1
- package/dist/esm/v2/components/DateRangePicker.js +63 -74
- package/dist/esm/v2/components/DateRangePicker.js.map +1 -1
- package/dist/esm/v2/components/DateTimePicker.js +81 -86
- package/dist/esm/v2/components/DateTimePicker.js.map +1 -1
- package/dist/esm/v2/components/Drawer.js +71 -65
- package/dist/esm/v2/components/Drawer.js.map +1 -1
- package/dist/esm/v2/components/Dropzone.js +130 -177
- package/dist/esm/v2/components/Dropzone.js.map +1 -1
- package/dist/esm/v2/components/EmptyState.js +9 -9
- package/dist/esm/v2/components/EmptyState.js.map +1 -1
- package/dist/esm/v2/components/FavoriteToggle.js +24 -33
- package/dist/esm/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/esm/v2/components/Field.js +155 -59
- package/dist/esm/v2/components/Field.js.map +1 -1
- package/dist/esm/v2/components/FieldError.js +9 -13
- package/dist/esm/v2/components/FieldError.js.map +1 -1
- package/dist/esm/v2/components/FieldHelp.js +28 -49
- package/dist/esm/v2/components/FieldHelp.js.map +1 -1
- package/dist/esm/v2/components/FileCard.js +14 -19
- package/dist/esm/v2/components/FileCard.js.map +1 -1
- package/dist/esm/v2/components/FilterTab.js +22 -31
- package/dist/esm/v2/components/FilterTab.js.map +1 -1
- package/dist/esm/v2/components/ForbiddenPage.js +28 -8
- package/dist/esm/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/esm/v2/components/FormGrid.js +48 -54
- package/dist/esm/v2/components/FormGrid.js.map +1 -1
- package/dist/esm/v2/components/FormikDisplay.js +98 -24
- package/dist/esm/v2/components/FormikDisplay.js.map +1 -1
- package/dist/esm/v2/components/Input.js +75 -34
- package/dist/esm/v2/components/Input.js.map +1 -1
- package/dist/esm/v2/components/KPICard.js +42 -51
- package/dist/esm/v2/components/KPICard.js.map +1 -1
- package/dist/esm/v2/components/KPIStrip.js +9 -15
- package/dist/esm/v2/components/KPIStrip.js.map +1 -1
- package/dist/esm/v2/components/KV.js +16 -23
- package/dist/esm/v2/components/KV.js.map +1 -1
- package/dist/esm/v2/components/KVGrid.js +15 -23
- package/dist/esm/v2/components/KVGrid.js.map +1 -1
- package/dist/esm/v2/components/Layout.js +81 -117
- package/dist/esm/v2/components/Layout.js.map +1 -1
- package/dist/esm/v2/components/MobileRowCard.js +64 -75
- package/dist/esm/v2/components/MobileRowCard.js.map +1 -1
- package/dist/esm/v2/components/Modal.js +44 -53
- package/dist/esm/v2/components/Modal.js.map +1 -1
- package/dist/esm/v2/components/NetworkErrorPage.js +28 -11
- package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/esm/v2/components/NotFoundPage.js +28 -9
- package/dist/esm/v2/components/NotFoundPage.js.map +1 -1
- package/dist/esm/v2/components/NumberInput.js +77 -107
- package/dist/esm/v2/components/NumberInput.js.map +1 -1
- package/dist/esm/v2/components/OverflowMenu.js +24 -42
- package/dist/esm/v2/components/OverflowMenu.js.map +1 -1
- package/dist/esm/v2/components/PdfViewer.js +24 -33
- package/dist/esm/v2/components/PdfViewer.js.map +1 -1
- package/dist/esm/v2/components/ProgressBar.js +28 -36
- package/dist/esm/v2/components/ProgressBar.js.map +1 -1
- package/dist/esm/v2/components/Radio.js +49 -57
- package/dist/esm/v2/components/Radio.js.map +1 -1
- package/dist/esm/v2/components/SectionErrorBoundary.js +84 -130
- package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/esm/v2/components/SectionHeader.js +24 -31
- package/dist/esm/v2/components/SectionHeader.js.map +1 -1
- package/dist/esm/v2/components/Segmented.js +59 -84
- package/dist/esm/v2/components/Segmented.js.map +1 -1
- package/dist/esm/v2/components/Select.js +100 -138
- package/dist/esm/v2/components/Select.js.map +1 -1
- package/dist/esm/v2/components/ServerErrorPage.js +27 -10
- package/dist/esm/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/esm/v2/components/Skeleton.js +81 -96
- package/dist/esm/v2/components/Skeleton.js.map +1 -1
- package/dist/esm/v2/components/SkipLink.js +6 -7
- package/dist/esm/v2/components/SkipLink.js.map +1 -1
- package/dist/esm/v2/components/Spinner.js +13 -22
- package/dist/esm/v2/components/Spinner.js.map +1 -1
- package/dist/esm/v2/components/Status.js +14 -25
- package/dist/esm/v2/components/Status.js.map +1 -1
- package/dist/esm/v2/components/Stepper.js +68 -71
- package/dist/esm/v2/components/Stepper.js.map +1 -1
- package/dist/esm/v2/components/Surface.js +25 -44
- package/dist/esm/v2/components/Surface.js.map +1 -1
- package/dist/esm/v2/components/Switch.js +21 -29
- package/dist/esm/v2/components/Switch.js.map +1 -1
- package/dist/esm/v2/components/TabPanel.js +84 -0
- package/dist/esm/v2/components/TabPanel.js.map +1 -0
- package/dist/esm/v2/components/Tabs.js +43 -19
- package/dist/esm/v2/components/Tabs.js.map +1 -1
- package/dist/esm/v2/components/TelInput.js +75 -108
- package/dist/esm/v2/components/TelInput.js.map +1 -1
- package/dist/esm/v2/components/Textarea.js +21 -30
- package/dist/esm/v2/components/Textarea.js.map +1 -1
- package/dist/esm/v2/components/TimePicker.js +59 -69
- package/dist/esm/v2/components/TimePicker.js.map +1 -1
- package/dist/esm/v2/components/Toast.js +109 -163
- package/dist/esm/v2/components/Toast.js.map +1 -1
- package/dist/esm/v2/components/Tooltip.js +18 -31
- package/dist/esm/v2/components/Tooltip.js.map +1 -1
- package/dist/esm/v2/components/_ErrorPageBody.js +6 -5
- package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/esm/v2/components/_pickerShared.js +2 -2
- package/dist/esm/v2/components/_pickerShared.js.map +1 -1
- package/dist/esm/v2/components/index.js +37 -0
- package/dist/esm/v2/components/index.js.map +1 -1
- package/dist/esm/v2/hooks/index.js +62 -0
- package/dist/esm/v2/hooks/index.js.map +1 -1
- package/dist/esm/v2/hooks/useAppliedFilters.js +112 -0
- package/dist/esm/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js +82 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js +5 -19
- package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/esm/v2/hooks/useDensity.js +13 -17
- package/dist/esm/v2/hooks/useDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusFirstError.js +25 -33
- package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js +81 -0
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusTrap.js +19 -23
- package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/esm/v2/hooks/useFormAutoSave.js +38 -53
- package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/esm/v2/hooks/useFormCompletionProgress.js +32 -51
- package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js +125 -0
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js +99 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js +2 -10
- package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useSortedRows.js +3 -5
- package/dist/esm/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/esm/v2/hooks/useTabLoading.js +6 -21
- package/dist/esm/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/esm/v2/index.js +2 -3
- package/dist/esm/v2/index.js.map +1 -1
- package/dist/esm/v2/modalContext.js +2 -2
- package/dist/esm/v2/modalContext.js.map +1 -1
- package/dist/esm/v2/models/favorite.js.map +1 -1
- package/dist/esm/v2/models/personalization.js.map +1 -1
- package/dist/esm/v2/models/referentiel.js.map +1 -1
- package/dist/esm/v2/models/savedFilter.js.map +1 -1
- package/dist/esm/v2/patterns/ActionBar.js +115 -159
- package/dist/esm/v2/patterns/ActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/AppMain.js +108 -0
- package/dist/esm/v2/patterns/AppMain.js.map +1 -0
- package/dist/esm/v2/patterns/BulkActionBar.js +31 -34
- package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/ChartFigure.js +151 -0
- package/dist/esm/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js +111 -152
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/ColumnsToggle.js +43 -77
- package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/esm/v2/patterns/DataGrid.js +221 -255
- package/dist/esm/v2/patterns/DataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js +76 -94
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridToolbar.js +85 -89
- package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridVirtualized.js +141 -182
- package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +26 -30
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/esm/v2/patterns/DetailSplit.js +108 -0
- package/dist/esm/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js +15 -17
- package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/esm/v2/patterns/FavoritesFilter.js +30 -39
- package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/esm/v2/patterns/FilterTabBar.js +112 -0
- package/dist/esm/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js +12 -13
- package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/esm/v2/patterns/FormPageShell.js +43 -41
- package/dist/esm/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/FormSection.js +30 -38
- package/dist/esm/v2/patterns/FormSection.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCheckbox.js +29 -39
- package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js +56 -60
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCombobox.js +51 -69
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDatePicker.js +44 -58
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDateTimePicker.js +44 -58
- package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikErrorFocus.js +22 -23
- package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/esm/v2/patterns/FormikErrorSummary.js +89 -0
- package/dist/esm/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/esm/v2/patterns/FormikFile.js +94 -78
- package/dist/esm/v2/patterns/FormikFile.js.map +1 -1
- package/dist/esm/v2/patterns/FormikInput.js +40 -53
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
- package/dist/esm/v2/patterns/FormikRadioGroup.js +39 -51
- package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -1
- package/dist/esm/v2/patterns/FormikReferentielField.js +49 -59
- package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/FormikSelect.js +64 -87
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/esm/v2/patterns/FormikTextarea.js +30 -46
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +53 -71
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/esm/v2/patterns/NetworkErrorBanner.js +6 -7
- package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/esm/v2/patterns/PageContent.js +10 -14
- package/dist/esm/v2/patterns/PageContent.js.map +1 -1
- package/dist/esm/v2/patterns/PreviewDrawer.js +153 -0
- package/dist/esm/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/esm/v2/patterns/ReferentielField.js +327 -312
- package/dist/esm/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/RowFavoriteToggle.js +27 -22
- package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -1
- package/dist/esm/v2/patterns/SaveFilterDialog.js +38 -66
- package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/esm/v2/patterns/SavedFiltersMenu.js +62 -81
- package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/esm/v2/patterns/SkeletonPageShell.js +106 -129
- package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/SortableHeader.js +22 -45
- package/dist/esm/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/esm/v2/patterns/Tour.js +94 -120
- package/dist/esm/v2/patterns/Tour.js.map +1 -1
- package/dist/esm/v2/patterns/_dataGridShared.js +107 -128
- package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/esm/v2/patterns/_pickerSerialisation.js +6 -8
- package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -1
- package/dist/esm/v2/patterns/_sort.js +17 -33
- package/dist/esm/v2/patterns/_sort.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnReorder.js +122 -160
- package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnResize.js +78 -96
- package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/esm/v2/patterns/filterCriteria.js +102 -0
- package/dist/esm/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/esm/v2/patterns/index.js +152 -0
- package/dist/esm/v2/patterns/index.js.map +1 -1
- package/dist/esm/v2/patterns/rowActions.js +223 -0
- package/dist/esm/v2/patterns/rowActions.js.map +1 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js +50 -47
- package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +22 -23
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +13 -13
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favorites.js +36 -60
- package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favoritesView.js +22 -34
- package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js +28 -34
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js +119 -0
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js +90 -98
- package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/esm/v2/personalization/createPersonalizationStore.js +78 -181
- package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/esm/v2/personalization/index.js +17 -0
- package/dist/esm/v2/personalization/index.js.map +1 -1
- package/dist/esm/v2/personalization/personalizationContext.js +9 -9
- package/dist/esm/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/esm/v2/personalization/schema.js +8 -9
- package/dist/esm/v2/personalization/schema.js.map +1 -1
- package/dist/esm/v2/referentiel/ReferentielProvider.js +27 -42
- package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/esm/v2/referentiel/types.js +2 -0
- package/dist/esm/v2/referentiel/types.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js +10 -11
- package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielOptions.js +60 -117
- package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielSearch.js +37 -91
- package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/esm/v2/theme/_brand.js +8 -24
- package/dist/esm/v2/theme/_brand.js.map +1 -1
- package/dist/esm/v2/theme/_brandSecondary.js +8 -24
- package/dist/esm/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/esm/v2/theme/createPortnetTheme.js +51 -61
- package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/esm/v2/theme/cssVariables.js +62 -69
- package/dist/esm/v2/theme/cssVariables.js.map +1 -1
- package/dist/esm/v2/theme/index.js +5 -5
- package/dist/esm/v2/theme/index.js.map +1 -1
- package/dist/esm/v2/tokens/breakpoints.js +14 -14
- package/dist/esm/v2/tokens/breakpoints.js.map +1 -1
- package/dist/esm/v2/tokens/chart.js +261 -0
- package/dist/esm/v2/tokens/chart.js.map +1 -0
- package/dist/esm/v2/tokens/colors.js +22 -22
- package/dist/esm/v2/tokens/colors.js.map +1 -1
- package/dist/esm/v2/tokens/density.js +62 -7
- package/dist/esm/v2/tokens/density.js.map +1 -1
- package/dist/esm/v2/tokens/index.js +49 -34
- package/dist/esm/v2/tokens/index.js.map +1 -1
- package/dist/esm/v2/tokens/motion.js +12 -20
- package/dist/esm/v2/tokens/motion.js.map +1 -1
- package/dist/esm/v2/tokens/radius.js +1 -1
- package/dist/esm/v2/tokens/radius.js.map +1 -1
- package/dist/esm/v2/tokens/shadows.js +6 -6
- package/dist/esm/v2/tokens/shadows.js.map +1 -1
- package/dist/esm/v2/tokens/spacing.js +2 -2
- package/dist/esm/v2/tokens/spacing.js.map +1 -1
- package/dist/esm/v2/tokens/state.js +1 -1
- package/dist/esm/v2/tokens/state.js.map +1 -1
- package/dist/esm/v2/tokens/statusPalette.js +17 -21
- package/dist/esm/v2/tokens/statusPalette.js.map +1 -1
- package/dist/esm/v2/tokens/tokens.json +6 -1
- package/dist/esm/v2/tokens/typography.js +13 -13
- package/dist/esm/v2/tokens/typography.js.map +1 -1
- package/dist/esm/v2/tokens/zIndex.js +1 -1
- package/dist/esm/v2/tokens/zIndex.js.map +1 -1
- package/dist/esm/v2/types/datagrid.js.map +1 -1
- package/dist/esm/v2/utils/apiError.js +16 -37
- package/dist/esm/v2/utils/apiError.js.map +1 -1
- package/dist/esm/v2/utils/contrast.js +31 -32
- package/dist/esm/v2/utils/contrast.js.map +1 -1
- package/dist/esm/v2/utils/cx.js +5 -25
- package/dist/esm/v2/utils/cx.js.map +1 -1
- package/dist/esm/v2/utils/fileDownload.js +23 -26
- package/dist/esm/v2/utils/fileDownload.js.map +1 -1
- package/dist/esm/v2/utils/fileValidation.js +209 -0
- package/dist/esm/v2/utils/fileValidation.js.map +1 -0
- package/dist/esm/v2/utils/fmtDate.js +111 -0
- package/dist/esm/v2/utils/fmtDate.js.map +1 -0
- package/dist/esm/v2/utils/fmtMoney.js +8 -10
- package/dist/esm/v2/utils/fmtMoney.js.map +1 -1
- package/dist/esm/v2/utils/formikErrors.js +78 -0
- package/dist/esm/v2/utils/formikErrors.js.map +1 -0
- package/dist/esm/v2/utils/index.js +35 -2
- package/dist/esm/v2/utils/index.js.map +1 -1
- package/dist/esm/v2/utils/mergeLabels.js +7 -12
- package/dist/esm/v2/utils/mergeLabels.js.map +1 -1
- package/dist/esm/v2/utils/networkStatus.js +12 -12
- package/dist/esm/v2/utils/networkStatus.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -49
- package/dist/index.js.map +1 -1
- package/dist/v2/__tests__/AppMain.test.js +133 -0
- package/dist/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/v2/__tests__/ChartFigure.test.js +183 -0
- package/dist/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js +153 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js +94 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/v2/__tests__/FieldError.test.js +82 -49
- package/dist/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/v2/__tests__/FieldNaming.test.js +161 -0
- package/dist/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/v2/__tests__/FieldWidth.test.js +23 -25
- package/dist/v2/__tests__/FieldWidth.test.js.map +1 -1
- package/dist/v2/__tests__/FileCard.test.js +29 -28
- package/dist/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/v2/__tests__/FormikCheckbox.test.js +90 -183
- package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -1
- package/dist/v2/__tests__/FormikDateTimePicker.test.js +38 -48
- package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
- package/dist/v2/__tests__/FormikDisplayWidth.test.js +102 -0
- package/dist/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/v2/__tests__/FormikRadioGroup.test.js +123 -204
- package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
- package/dist/v2/__tests__/MobileRowCard.test.js +63 -61
- package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/v2/__tests__/PreviewDrawer.test.js +169 -0
- package/dist/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js +159 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js +53 -68
- package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/v2/__tests__/apiError.test.js +50 -69
- package/dist/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/v2/__tests__/banned-patterns.test.js +42 -123
- package/dist/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/v2/__tests__/chart-palette.test.js +205 -0
- package/dist/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/v2/__tests__/fileValidation.test.js +136 -0
- package/dist/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/v2/__tests__/filterCriteria.test.js +324 -0
- package/dist/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/fmtDate.test.js +69 -0
- package/dist/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js +221 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/v2/__tests__/labels-merge.test.js +23 -27
- package/dist/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/v2/__tests__/locale-fallback.test.js +47 -52
- package/dist/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/v2/__tests__/reviveSavedCriteria.test.js +144 -0
- package/dist/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/rowActions.test.js +186 -0
- package/dist/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js +156 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusTrap.test.js +270 -407
- package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js +123 -0
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/v2/components/Accordion.js +60 -82
- package/dist/v2/components/Accordion.js.map +1 -1
- package/dist/v2/components/ActionStrip.js +40 -52
- package/dist/v2/components/ActionStrip.js.map +1 -1
- package/dist/v2/components/Banner.js +42 -41
- package/dist/v2/components/Banner.js.map +1 -1
- package/dist/v2/components/Busy.js +22 -27
- package/dist/v2/components/Busy.js.map +1 -1
- package/dist/v2/components/Button.js +39 -50
- package/dist/v2/components/Button.js.map +1 -1
- package/dist/v2/components/CategoryTag.d.ts.map +1 -1
- package/dist/v2/components/CategoryTag.js +49 -32
- package/dist/v2/components/CategoryTag.js.map +1 -1
- package/dist/v2/components/Checkbox.js +39 -45
- package/dist/v2/components/Checkbox.js.map +1 -1
- package/dist/v2/components/Chip.js +29 -42
- package/dist/v2/components/Chip.js.map +1 -1
- package/dist/v2/components/Combobox.js +122 -144
- package/dist/v2/components/Combobox.js.map +1 -1
- package/dist/v2/components/CommandPalette.js +138 -225
- package/dist/v2/components/CommandPalette.js.map +1 -1
- package/dist/v2/components/ConfirmDialog.js +46 -56
- package/dist/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/v2/components/DatePicker.js +81 -86
- package/dist/v2/components/DatePicker.js.map +1 -1
- package/dist/v2/components/DateRangePicker.js +77 -87
- package/dist/v2/components/DateRangePicker.js.map +1 -1
- package/dist/v2/components/DateTimePicker.js +84 -91
- package/dist/v2/components/DateTimePicker.js.map +1 -1
- package/dist/v2/components/Drawer.d.ts.map +1 -1
- package/dist/v2/components/Drawer.js +93 -88
- package/dist/v2/components/Drawer.js.map +1 -1
- package/dist/v2/components/Dropzone.js +150 -196
- package/dist/v2/components/Dropzone.js.map +1 -1
- package/dist/v2/components/EmptyState.js +18 -20
- package/dist/v2/components/EmptyState.js.map +1 -1
- package/dist/v2/components/FavoriteToggle.js +28 -39
- package/dist/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/v2/components/Field.d.ts +62 -4
- package/dist/v2/components/Field.d.ts.map +1 -1
- package/dist/v2/components/Field.js +169 -70
- package/dist/v2/components/Field.js.map +1 -1
- package/dist/v2/components/FieldError.js +18 -21
- package/dist/v2/components/FieldError.js.map +1 -1
- package/dist/v2/components/FieldHelp.js +40 -60
- package/dist/v2/components/FieldHelp.js.map +1 -1
- package/dist/v2/components/FileCard.js +27 -31
- package/dist/v2/components/FileCard.js.map +1 -1
- package/dist/v2/components/FilterTab.js +30 -38
- package/dist/v2/components/FilterTab.js.map +1 -1
- package/dist/v2/components/ForbiddenPage.d.ts +25 -1
- package/dist/v2/components/ForbiddenPage.d.ts.map +1 -1
- package/dist/v2/components/ForbiddenPage.js +37 -17
- package/dist/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/v2/components/FormGrid.js +53 -59
- package/dist/v2/components/FormGrid.js.map +1 -1
- package/dist/v2/components/FormikDisplay.d.ts +50 -1
- package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
- package/dist/v2/components/FormikDisplay.js +108 -33
- package/dist/v2/components/FormikDisplay.js.map +1 -1
- package/dist/v2/components/Input.d.ts +40 -0
- package/dist/v2/components/Input.d.ts.map +1 -1
- package/dist/v2/components/Input.js +81 -41
- package/dist/v2/components/Input.js.map +1 -1
- package/dist/v2/components/KPICard.js +57 -67
- package/dist/v2/components/KPICard.js.map +1 -1
- package/dist/v2/components/KPIStrip.js +16 -22
- package/dist/v2/components/KPIStrip.js.map +1 -1
- package/dist/v2/components/KV.js +25 -31
- package/dist/v2/components/KV.js.map +1 -1
- package/dist/v2/components/KVGrid.js +19 -26
- package/dist/v2/components/KVGrid.js.map +1 -1
- package/dist/v2/components/Layout.js +91 -120
- package/dist/v2/components/Layout.js.map +1 -1
- package/dist/v2/components/MobileRowCard.js +79 -91
- package/dist/v2/components/MobileRowCard.js.map +1 -1
- package/dist/v2/components/Modal.js +61 -69
- package/dist/v2/components/Modal.js.map +1 -1
- package/dist/v2/components/NetworkErrorPage.d.ts +19 -1
- package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
- package/dist/v2/components/NetworkErrorPage.js +38 -21
- package/dist/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/v2/components/NotFoundPage.d.ts +17 -1
- package/dist/v2/components/NotFoundPage.d.ts.map +1 -1
- package/dist/v2/components/NotFoundPage.js +37 -18
- package/dist/v2/components/NotFoundPage.js.map +1 -1
- package/dist/v2/components/NumberInput.js +88 -118
- package/dist/v2/components/NumberInput.js.map +1 -1
- package/dist/v2/components/OverflowMenu.js +38 -56
- package/dist/v2/components/OverflowMenu.js.map +1 -1
- package/dist/v2/components/PdfViewer.js +34 -45
- package/dist/v2/components/PdfViewer.js.map +1 -1
- package/dist/v2/components/ProgressBar.js +42 -49
- package/dist/v2/components/ProgressBar.js.map +1 -1
- package/dist/v2/components/Radio.js +59 -67
- package/dist/v2/components/Radio.js.map +1 -1
- package/dist/v2/components/SectionErrorBoundary.js +90 -135
- package/dist/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/v2/components/SectionHeader.js +34 -41
- package/dist/v2/components/SectionHeader.js.map +1 -1
- package/dist/v2/components/Segmented.js +69 -93
- package/dist/v2/components/Segmented.js.map +1 -1
- package/dist/v2/components/Select.d.ts +26 -2
- package/dist/v2/components/Select.d.ts.map +1 -1
- package/dist/v2/components/Select.js +120 -155
- package/dist/v2/components/Select.js.map +1 -1
- package/dist/v2/components/ServerErrorPage.d.ts +27 -1
- package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
- package/dist/v2/components/ServerErrorPage.js +37 -20
- package/dist/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/v2/components/Skeleton.js +86 -100
- package/dist/v2/components/Skeleton.js.map +1 -1
- package/dist/v2/components/SkipLink.js +9 -12
- package/dist/v2/components/SkipLink.js.map +1 -1
- package/dist/v2/components/Spinner.js +16 -25
- package/dist/v2/components/Spinner.js.map +1 -1
- package/dist/v2/components/Status.js +18 -29
- package/dist/v2/components/Status.js.map +1 -1
- package/dist/v2/components/Stepper.js +80 -82
- package/dist/v2/components/Stepper.js.map +1 -1
- package/dist/v2/components/Surface.js +34 -49
- package/dist/v2/components/Surface.js.map +1 -1
- package/dist/v2/components/Switch.js +29 -37
- package/dist/v2/components/Switch.js.map +1 -1
- package/dist/v2/components/TabPanel.d.ts +17 -0
- package/dist/v2/components/TabPanel.d.ts.map +1 -0
- package/dist/v2/components/TabPanel.js +90 -0
- package/dist/v2/components/TabPanel.js.map +1 -0
- package/dist/v2/components/Tabs.d.ts +25 -0
- package/dist/v2/components/Tabs.d.ts.map +1 -1
- package/dist/v2/components/Tabs.js +53 -29
- package/dist/v2/components/Tabs.js.map +1 -1
- package/dist/v2/components/TelInput.js +80 -115
- package/dist/v2/components/TelInput.js.map +1 -1
- package/dist/v2/components/Textarea.js +26 -35
- package/dist/v2/components/Textarea.js.map +1 -1
- package/dist/v2/components/TimePicker.js +62 -74
- package/dist/v2/components/TimePicker.js.map +1 -1
- package/dist/v2/components/Toast.js +119 -174
- package/dist/v2/components/Toast.js.map +1 -1
- package/dist/v2/components/Tooltip.js +23 -38
- package/dist/v2/components/Tooltip.js.map +1 -1
- package/dist/v2/components/_ErrorPageBody.js +15 -16
- package/dist/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/v2/components/_pickerShared.js +5 -5
- package/dist/v2/components/_pickerShared.js.map +1 -1
- package/dist/v2/components/index.d.ts +40 -1
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/components/index.js +153 -136
- package/dist/v2/components/index.js.map +1 -1
- package/dist/v2/hooks/index.d.ts +65 -0
- package/dist/v2/hooks/index.d.ts.map +1 -1
- package/dist/v2/hooks/index.js +63 -24
- package/dist/v2/hooks/index.js.map +1 -1
- package/dist/v2/hooks/useAppliedFilters.d.ts +102 -0
- package/dist/v2/hooks/useAppliedFilters.d.ts.map +1 -0
- package/dist/v2/hooks/useAppliedFilters.js +117 -0
- package/dist/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts +64 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.js +87 -0
- package/dist/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.js +6 -20
- package/dist/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/v2/hooks/useDensity.d.ts.map +1 -1
- package/dist/v2/hooks/useDensity.js +14 -18
- package/dist/v2/hooks/useDensity.js.map +1 -1
- package/dist/v2/hooks/useFocusFirstError.js +26 -34
- package/dist/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts +65 -0
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js +88 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/v2/hooks/useFocusTrap.js +20 -24
- package/dist/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.d.ts +4 -4
- package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.js +39 -54
- package/dist/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.js +33 -52
- package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts +25 -0
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js +132 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts +56 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js +105 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.js +5 -13
- package/dist/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/v2/hooks/useSortedRows.js +4 -6
- package/dist/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/v2/hooks/useTabLoading.js +7 -22
- package/dist/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/v2/index.js +143 -145
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/modalContext.js +2 -2
- package/dist/v2/modalContext.js.map +1 -1
- package/dist/v2/models/favorite.d.ts +8 -9
- package/dist/v2/models/favorite.d.ts.map +1 -1
- package/dist/v2/models/favorite.js.map +1 -1
- package/dist/v2/models/index.js +4 -4
- package/dist/v2/models/index.js.map +1 -1
- package/dist/v2/models/personalization.d.ts +44 -48
- package/dist/v2/models/personalization.d.ts.map +1 -1
- package/dist/v2/models/personalization.js.map +1 -1
- package/dist/v2/models/referentiel.d.ts +32 -50
- package/dist/v2/models/referentiel.d.ts.map +1 -1
- package/dist/v2/models/referentiel.js.map +1 -1
- package/dist/v2/models/savedFilter.d.ts +8 -17
- package/dist/v2/models/savedFilter.d.ts.map +1 -1
- package/dist/v2/models/savedFilter.js.map +1 -1
- package/dist/v2/patterns/ActionBar.js +152 -187
- package/dist/v2/patterns/ActionBar.js.map +1 -1
- package/dist/v2/patterns/AppMain.d.ts +109 -0
- package/dist/v2/patterns/AppMain.d.ts.map +1 -0
- package/dist/v2/patterns/AppMain.js +115 -0
- package/dist/v2/patterns/AppMain.js.map +1 -0
- package/dist/v2/patterns/BulkActionBar.js +40 -42
- package/dist/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/v2/patterns/ChartFigure.d.ts +124 -0
- package/dist/v2/patterns/ChartFigure.d.ts.map +1 -0
- package/dist/v2/patterns/ChartFigure.js +159 -0
- package/dist/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js +138 -174
- package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/v2/patterns/ColumnsToggle.js +60 -94
- package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/v2/patterns/DataGrid.d.ts.map +1 -1
- package/dist/v2/patterns/DataGrid.js +262 -297
- package/dist/v2/patterns/DataGrid.js.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.js +104 -121
- package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/v2/patterns/DataGridToolbar.js +103 -106
- package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/v2/patterns/DataGridVirtualized.js +179 -217
- package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js +32 -35
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/v2/patterns/DetailSplit.d.ts +87 -0
- package/dist/v2/patterns/DetailSplit.d.ts.map +1 -0
- package/dist/v2/patterns/DetailSplit.js +116 -0
- package/dist/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.js +22 -23
- package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/v2/patterns/FavoritesFilter.js +36 -44
- package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/v2/patterns/FilterTabBar.d.ts +28 -0
- package/dist/v2/patterns/FilterTabBar.d.ts.map +1 -0
- package/dist/v2/patterns/FilterTabBar.js +120 -0
- package/dist/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.js +20 -23
- package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/v2/patterns/FormPageShell.js +53 -50
- package/dist/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/v2/patterns/FormSection.d.ts +8 -3
- package/dist/v2/patterns/FormSection.d.ts.map +1 -1
- package/dist/v2/patterns/FormSection.js +44 -51
- package/dist/v2/patterns/FormSection.js.map +1 -1
- package/dist/v2/patterns/FormikCheckbox.js +36 -45
- package/dist/v2/patterns/FormikCheckbox.js.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts +17 -1
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.js +62 -65
- package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/v2/patterns/FormikCombobox.js +55 -72
- package/dist/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.js +50 -64
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/v2/patterns/FormikDateTimePicker.js +50 -64
- package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -1
- package/dist/v2/patterns/FormikErrorFocus.js +25 -26
- package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/v2/patterns/FormikErrorSummary.d.ts +74 -0
- package/dist/v2/patterns/FormikErrorSummary.d.ts.map +1 -0
- package/dist/v2/patterns/FormikErrorSummary.js +97 -0
- package/dist/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/v2/patterns/FormikFile.d.ts +14 -1
- package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
- package/dist/v2/patterns/FormikFile.js +99 -83
- package/dist/v2/patterns/FormikFile.js.map +1 -1
- package/dist/v2/patterns/FormikInput.js +45 -58
- package/dist/v2/patterns/FormikInput.js.map +1 -1
- package/dist/v2/patterns/FormikRadioGroup.js +45 -56
- package/dist/v2/patterns/FormikRadioGroup.js.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.d.ts +12 -1
- package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.js +54 -64
- package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/v2/patterns/FormikSelect.js +70 -92
- package/dist/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/v2/patterns/FormikTextarea.js +35 -51
- package/dist/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +60 -80
- package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/v2/patterns/NetworkErrorBanner.js +13 -16
- package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/v2/patterns/PageContent.js +17 -20
- package/dist/v2/patterns/PageContent.js.map +1 -1
- package/dist/v2/patterns/PreviewDrawer.d.ts +49 -0
- package/dist/v2/patterns/PreviewDrawer.d.ts.map +1 -0
- package/dist/v2/patterns/PreviewDrawer.js +159 -0
- package/dist/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/v2/patterns/ReferentielField.d.ts +86 -2
- package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/ReferentielField.js +347 -327
- package/dist/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/v2/patterns/RowFavoriteToggle.d.ts +6 -0
- package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -1
- package/dist/v2/patterns/RowFavoriteToggle.js +38 -30
- package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -1
- package/dist/v2/patterns/SaveFilterDialog.js +50 -77
- package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/v2/patterns/SavedFiltersMenu.js +89 -107
- package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/v2/patterns/SkeletonPageShell.js +122 -143
- package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/v2/patterns/SortableHeader.js +35 -57
- package/dist/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/v2/patterns/Tour.js +121 -142
- package/dist/v2/patterns/Tour.js.map +1 -1
- package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
- package/dist/v2/patterns/_dataGridShared.js +131 -147
- package/dist/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/v2/patterns/_pickerSerialisation.js +9 -10
- package/dist/v2/patterns/_pickerSerialisation.js.map +1 -1
- package/dist/v2/patterns/_sort.js +17 -33
- package/dist/v2/patterns/_sort.js.map +1 -1
- package/dist/v2/patterns/_useColumnReorder.js +124 -163
- package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/v2/patterns/_useColumnResize.js +80 -99
- package/dist/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/v2/patterns/filterCriteria.d.ts +78 -0
- package/dist/v2/patterns/filterCriteria.d.ts.map +1 -0
- package/dist/v2/patterns/filterCriteria.js +110 -0
- package/dist/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/v2/patterns/index.d.ts +160 -0
- package/dist/v2/patterns/index.d.ts.map +1 -1
- package/dist/v2/patterns/index.js +157 -79
- package/dist/v2/patterns/index.js.map +1 -1
- package/dist/v2/patterns/rowActions.d.ts +150 -0
- package/dist/v2/patterns/rowActions.d.ts.map +1 -0
- package/dist/v2/patterns/rowActions.js +232 -0
- package/dist/v2/patterns/rowActions.js.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
- package/dist/v2/personalization/PersonalizationProvider.js +57 -53
- package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +25 -24
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/createMemoryAdapter.js +14 -14
- package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/index.js +5 -5
- package/dist/v2/personalization/adapters/index.js.map +1 -1
- package/dist/v2/personalization/capabilities/favorites.js +39 -62
- package/dist/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/v2/personalization/capabilities/favoritesView.js +25 -37
- package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/v2/personalization/capabilities/gridPreferences.js +31 -36
- package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -1
- package/dist/v2/personalization/capabilities/index.js +12 -12
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts +88 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js +126 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.js +93 -100
- package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.js +81 -182
- package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/v2/personalization/index.d.ts +16 -0
- package/dist/v2/personalization/index.d.ts.map +1 -1
- package/dist/v2/personalization/index.js +30 -23
- package/dist/v2/personalization/index.js.map +1 -1
- package/dist/v2/personalization/personalizationContext.js +10 -12
- package/dist/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/v2/personalization/schema.js +8 -9
- package/dist/v2/personalization/schema.js.map +1 -1
- package/dist/v2/referentiel/ReferentielProvider.js +31 -45
- package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/v2/referentiel/index.js +11 -13
- package/dist/v2/referentiel/index.js.map +1 -1
- package/dist/v2/referentiel/types.d.ts +105 -0
- package/dist/v2/referentiel/types.d.ts.map +1 -0
- package/dist/v2/referentiel/types.js +6 -0
- package/dist/v2/referentiel/types.js.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.js +13 -16
- package/dist/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.d.ts +7 -17
- package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.js +63 -120
- package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.d.ts +7 -48
- package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.js +40 -95
- package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/v2/theme/_brand.js +12 -26
- package/dist/v2/theme/_brand.js.map +1 -1
- package/dist/v2/theme/_brandSecondary.js +12 -26
- package/dist/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/v2/theme/createPortnetTheme.js +41 -49
- package/dist/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/v2/theme/cssVariables.d.ts +3 -3
- package/dist/v2/theme/cssVariables.d.ts.map +1 -1
- package/dist/v2/theme/cssVariables.js +65 -70
- package/dist/v2/theme/cssVariables.js.map +1 -1
- package/dist/v2/theme/index.js +10 -10
- package/dist/v2/theme/index.js.map +1 -1
- package/dist/v2/tokens/breakpoints.js +16 -16
- package/dist/v2/tokens/breakpoints.js.map +1 -1
- package/dist/v2/tokens/chart.d.ts +103 -0
- package/dist/v2/tokens/chart.d.ts.map +1 -0
- package/dist/v2/tokens/chart.js +270 -0
- package/dist/v2/tokens/chart.js.map +1 -0
- package/dist/v2/tokens/colors.js +24 -24
- package/dist/v2/tokens/colors.js.map +1 -1
- package/dist/v2/tokens/density.d.ts +104 -0
- package/dist/v2/tokens/density.d.ts.map +1 -1
- package/dist/v2/tokens/density.js +67 -12
- package/dist/v2/tokens/density.js.map +1 -1
- package/dist/v2/tokens/index.d.ts +50 -1
- package/dist/v2/tokens/index.d.ts.map +1 -1
- package/dist/v2/tokens/index.js +116 -68
- package/dist/v2/tokens/index.js.map +1 -1
- package/dist/v2/tokens/motion.js +16 -22
- package/dist/v2/tokens/motion.js.map +1 -1
- package/dist/v2/tokens/radius.js +3 -3
- package/dist/v2/tokens/radius.js.map +1 -1
- package/dist/v2/tokens/shadows.js +8 -8
- package/dist/v2/tokens/shadows.js.map +1 -1
- package/dist/v2/tokens/spacing.js +4 -4
- package/dist/v2/tokens/spacing.js.map +1 -1
- package/dist/v2/tokens/state.js +3 -3
- package/dist/v2/tokens/state.js.map +1 -1
- package/dist/v2/tokens/statusPalette.js +21 -23
- package/dist/v2/tokens/statusPalette.js.map +1 -1
- package/dist/v2/tokens/tokens.json +6 -1
- package/dist/v2/tokens/typography.js +15 -15
- package/dist/v2/tokens/typography.js.map +1 -1
- package/dist/v2/tokens/zIndex.js +3 -3
- package/dist/v2/tokens/zIndex.js.map +1 -1
- package/dist/v2/types/datagrid.d.ts +9 -1
- package/dist/v2/types/datagrid.d.ts.map +1 -1
- package/dist/v2/types/datagrid.js.map +1 -1
- package/dist/v2/types/index.js +2 -2
- package/dist/v2/types/index.js.map +1 -1
- package/dist/v2/utils/apiError.js +16 -37
- package/dist/v2/utils/apiError.js.map +1 -1
- package/dist/v2/utils/contrast.js +31 -32
- package/dist/v2/utils/contrast.js.map +1 -1
- package/dist/v2/utils/cx.js +7 -27
- package/dist/v2/utils/cx.js.map +1 -1
- package/dist/v2/utils/fileDownload.js +25 -28
- package/dist/v2/utils/fileDownload.js.map +1 -1
- package/dist/v2/utils/fileValidation.d.ts +116 -0
- package/dist/v2/utils/fileValidation.d.ts.map +1 -0
- package/dist/v2/utils/fileValidation.js +220 -0
- package/dist/v2/utils/fileValidation.js.map +1 -0
- package/dist/v2/utils/fmtDate.d.ts +103 -0
- package/dist/v2/utils/fmtDate.d.ts.map +1 -0
- package/dist/v2/utils/fmtDate.js +119 -0
- package/dist/v2/utils/fmtDate.js.map +1 -0
- package/dist/v2/utils/fmtMoney.d.ts +3 -3
- package/dist/v2/utils/fmtMoney.d.ts.map +1 -1
- package/dist/v2/utils/fmtMoney.js +9 -11
- package/dist/v2/utils/fmtMoney.js.map +1 -1
- package/dist/v2/utils/formikErrors.d.ts +67 -0
- package/dist/v2/utils/formikErrors.d.ts.map +1 -0
- package/dist/v2/utils/formikErrors.js +85 -0
- package/dist/v2/utils/formikErrors.js.map +1 -0
- package/dist/v2/utils/index.d.ts +5 -0
- package/dist/v2/utils/index.d.ts.map +1 -1
- package/dist/v2/utils/index.js +67 -18
- package/dist/v2/utils/index.js.map +1 -1
- package/dist/v2/utils/mergeLabels.js +9 -14
- package/dist/v2/utils/mergeLabels.js.map +1 -1
- package/dist/v2/utils/networkStatus.js +14 -14
- package/dist/v2/utils/networkStatus.js.map +1 -1
- package/package.json +26 -9
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("@testing-library/jest-dom");
|
|
4
|
+
var _react = require("@testing-library/react");
|
|
5
|
+
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
6
|
+
var _ReferentielField = _interopRequireDefault(require("../patterns/ReferentielField"));
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* ReferentielField — `container="drawer"` (S-1) et `searchOnOpen` (S-2).
|
|
11
|
+
*
|
|
12
|
+
* CE QUE CE FICHIER PROTÈGE
|
|
13
|
+
* -------------------------
|
|
14
|
+
* Ces deux capacités ont été ajoutées pour débloquer l'adoption du pattern par
|
|
15
|
+
* des hôtes qui ne pouvaient pas l'utiliser :
|
|
16
|
+
*
|
|
17
|
+
* S-1 — R-M.5 impose un `Drawer` au-delà de 3 champs ou pour du contenu
|
|
18
|
+
* défilable long, ce qu'est un sélecteur à critères + grille paginée.
|
|
19
|
+
* Le conteneur était en dur.
|
|
20
|
+
* S-2 — certaines populations sont courtes et connues (les mandatants d'un
|
|
21
|
+
* transitaire), et la réponse attendue à l'ouverture est la LISTE, pas
|
|
22
|
+
* un formulaire vide.
|
|
23
|
+
*
|
|
24
|
+
* L'assertion centrale n'est pas que la recherche initiale part — c'est
|
|
25
|
+
* qu'elle part UNE SEULE FOIS. `runSearch` dépend de `draft`, donc un effet
|
|
26
|
+
* naïf repartirait à chaque frappe dans un critère : le sélecteur émettrait une
|
|
27
|
+
* requête par caractère, ce que le bouton « Rechercher » existe précisément
|
|
28
|
+
* pour éviter. La garde est un `ref`, et c'est elle que le troisième test
|
|
29
|
+
* exerce.
|
|
30
|
+
*
|
|
31
|
+
* Le corps est UNE expression partagée par les deux conteneurs, donc les tests
|
|
32
|
+
* de contenu ci-dessous valent pour les deux branches par construction. Ce
|
|
33
|
+
* fichier vérifie que la branche drawer rend bien ce corps — pas les internes
|
|
34
|
+
* de `Drawer`, qui ont leurs propres tests.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
const LIGNES = [{
|
|
38
|
+
id: 1,
|
|
39
|
+
code: "7108",
|
|
40
|
+
description: "Or sous formes brutes"
|
|
41
|
+
}];
|
|
42
|
+
const COLONNES = [{
|
|
43
|
+
key: "code",
|
|
44
|
+
header: "Code"
|
|
45
|
+
}, {
|
|
46
|
+
key: "description",
|
|
47
|
+
header: "Description"
|
|
48
|
+
}];
|
|
49
|
+
const CRITERES = [{
|
|
50
|
+
name: "code",
|
|
51
|
+
label: "Code"
|
|
52
|
+
}];
|
|
53
|
+
function renderPicker(options) {
|
|
54
|
+
return (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ReferentielField.default, {
|
|
55
|
+
value: null,
|
|
56
|
+
onChange: () => {},
|
|
57
|
+
search: options.search,
|
|
58
|
+
columns: COLONNES,
|
|
59
|
+
criteria: CRITERES,
|
|
60
|
+
title: "Rechercher un code",
|
|
61
|
+
...(options.container !== undefined ? {
|
|
62
|
+
container: options.container
|
|
63
|
+
} : {}),
|
|
64
|
+
...(options.searchOnOpen !== undefined ? {
|
|
65
|
+
searchOnOpen: options.searchOnOpen
|
|
66
|
+
} : {})
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Ouvre le sélecteur par son trigger (un Input en lecture seule). */
|
|
71
|
+
async function ouvrir() {
|
|
72
|
+
await _userEvent.default.click(_react.screen.getByRole("textbox"));
|
|
73
|
+
}
|
|
74
|
+
describe("ReferentielField — conteneur drawer (S-1)", () => {
|
|
75
|
+
test("rend le corps du sélecteur dans la branche drawer", async () => {
|
|
76
|
+
const search = jest.fn(() => ({
|
|
77
|
+
items: LIGNES,
|
|
78
|
+
total: 1
|
|
79
|
+
}));
|
|
80
|
+
renderPicker({
|
|
81
|
+
container: "drawer",
|
|
82
|
+
searchOnOpen: true,
|
|
83
|
+
search
|
|
84
|
+
});
|
|
85
|
+
await ouvrir();
|
|
86
|
+
|
|
87
|
+
/* Le critère ET la ligne de résultat : c'est le corps commun, pas un
|
|
88
|
+
* détail de `Drawer`. Si la branche ne rendait pas `pickerBody`, ces deux
|
|
89
|
+
* assertions tomberaient. */
|
|
90
|
+
expect(await _react.screen.findByText("Or sous formes brutes")).toBeInTheDocument();
|
|
91
|
+
expect(_react.screen.getByLabelText(/Code/)).toBeInTheDocument();
|
|
92
|
+
});
|
|
93
|
+
test("le défaut reste la modale — aucun appelant existant ne change", async () => {
|
|
94
|
+
const search = jest.fn(() => ({
|
|
95
|
+
items: LIGNES,
|
|
96
|
+
total: 1
|
|
97
|
+
}));
|
|
98
|
+
renderPicker({
|
|
99
|
+
searchOnOpen: true,
|
|
100
|
+
search
|
|
101
|
+
});
|
|
102
|
+
await ouvrir();
|
|
103
|
+
expect(await _react.screen.findByText("Or sous formes brutes")).toBeInTheDocument();
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
describe("ReferentielField — searchOnOpen (S-2)", () => {
|
|
107
|
+
test("cherche à vide dès l'ouverture", async () => {
|
|
108
|
+
const search = jest.fn(() => ({
|
|
109
|
+
items: LIGNES,
|
|
110
|
+
total: 1
|
|
111
|
+
}));
|
|
112
|
+
renderPicker({
|
|
113
|
+
searchOnOpen: true,
|
|
114
|
+
search
|
|
115
|
+
});
|
|
116
|
+
await ouvrir();
|
|
117
|
+
await (0, _react.waitFor)(() => expect(search).toHaveBeenCalledTimes(1));
|
|
118
|
+
/* À vide : c'est tout l'objet de la prop — la liste, pas un formulaire. */
|
|
119
|
+
expect(search).toHaveBeenCalledWith(expect.objectContaining({
|
|
120
|
+
criteria: {
|
|
121
|
+
code: ""
|
|
122
|
+
},
|
|
123
|
+
page: 1
|
|
124
|
+
}));
|
|
125
|
+
});
|
|
126
|
+
test("ne cherche pas à l'ouverture quand la prop est absente", async () => {
|
|
127
|
+
const search = jest.fn(() => ({
|
|
128
|
+
items: LIGNES,
|
|
129
|
+
total: 1
|
|
130
|
+
}));
|
|
131
|
+
renderPicker({
|
|
132
|
+
search
|
|
133
|
+
});
|
|
134
|
+
await ouvrir();
|
|
135
|
+
|
|
136
|
+
/* L'état « Aucune recherche » reste le comportement par défaut : la prop
|
|
137
|
+
* est un opt-in, pas un changement de contrat. */
|
|
138
|
+
expect(search).not.toHaveBeenCalled();
|
|
139
|
+
});
|
|
140
|
+
test("UNE SEULE recherche par ouverture, même en saisissant un critère", async () => {
|
|
141
|
+
const search = jest.fn(() => ({
|
|
142
|
+
items: LIGNES,
|
|
143
|
+
total: 1
|
|
144
|
+
}));
|
|
145
|
+
renderPicker({
|
|
146
|
+
searchOnOpen: true,
|
|
147
|
+
search
|
|
148
|
+
});
|
|
149
|
+
await ouvrir();
|
|
150
|
+
await (0, _react.waitFor)(() => expect(search).toHaveBeenCalledTimes(1));
|
|
151
|
+
|
|
152
|
+
/* LE test de ce fichier. `runSearch` dépend de `draft` : sans la garde par
|
|
153
|
+
* `ref`, l'effet d'ouverture repartirait à chaque frappe et le sélecteur
|
|
154
|
+
* émettrait une requête par caractère. */
|
|
155
|
+
await _userEvent.default.type(_react.screen.getByLabelText(/Code/), "710");
|
|
156
|
+
expect(search).toHaveBeenCalledTimes(1);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
//# sourceMappingURL=ReferentielFieldContainer.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReferentielFieldContainer.test.js","names":["require","_react","_userEvent","_interopRequireDefault","_ReferentielField","_jsxRuntime","e","__esModule","default","LIGNES","id","code","description","COLONNES","key","header","CRITERES","name","label","renderPicker","options","render","jsx","value","onChange","search","columns","criteria","title","container","undefined","searchOnOpen","ouvrir","userEvent","click","screen","getByRole","describe","test","jest","fn","items","total","expect","findByText","toBeInTheDocument","getByLabelText","waitFor","toHaveBeenCalledTimes","toHaveBeenCalledWith","objectContaining","page","not","toHaveBeenCalled","type"],"sources":["../../../src/lib/v2/__tests__/ReferentielFieldContainer.test.tsx"],"sourcesContent":["import \"@testing-library/jest-dom\";\r\nimport { render, screen, waitFor } from \"@testing-library/react\";\r\nimport userEvent from \"@testing-library/user-event\";\r\nimport ReferentielField from \"../patterns/ReferentielField\";\r\nimport type { ReferentielSearchResult } from \"../patterns/ReferentielField\";\r\n\r\n/**\r\n * ReferentielField — `container=\"drawer\"` (S-1) et `searchOnOpen` (S-2).\r\n *\r\n * CE QUE CE FICHIER PROTÈGE\r\n * -------------------------\r\n * Ces deux capacités ont été ajoutées pour débloquer l'adoption du pattern par\r\n * des hôtes qui ne pouvaient pas l'utiliser :\r\n *\r\n * S-1 — R-M.5 impose un `Drawer` au-delà de 3 champs ou pour du contenu\r\n * défilable long, ce qu'est un sélecteur à critères + grille paginée.\r\n * Le conteneur était en dur.\r\n * S-2 — certaines populations sont courtes et connues (les mandatants d'un\r\n * transitaire), et la réponse attendue à l'ouverture est la LISTE, pas\r\n * un formulaire vide.\r\n *\r\n * L'assertion centrale n'est pas que la recherche initiale part — c'est\r\n * qu'elle part UNE SEULE FOIS. `runSearch` dépend de `draft`, donc un effet\r\n * naïf repartirait à chaque frappe dans un critère : le sélecteur émettrait une\r\n * requête par caractère, ce que le bouton « Rechercher » existe précisément\r\n * pour éviter. La garde est un `ref`, et c'est elle que le troisième test\r\n * exerce.\r\n *\r\n * Le corps est UNE expression partagée par les deux conteneurs, donc les tests\r\n * de contenu ci-dessous valent pour les deux branches par construction. Ce\r\n * fichier vérifie que la branche drawer rend bien ce corps — pas les internes\r\n * de `Drawer`, qui ont leurs propres tests.\r\n */\r\n\r\ninterface Ligne {\r\n id: number;\r\n code: string;\r\n description: string;\r\n}\r\n\r\nconst LIGNES: Ligne[] = [\r\n { id: 1, code: \"7108\", description: \"Or sous formes brutes\" },\r\n];\r\n\r\nconst COLONNES = [\r\n { key: \"code\", header: \"Code\" },\r\n { key: \"description\", header: \"Description\" },\r\n];\r\n\r\nconst CRITERES = [{ name: \"code\", label: \"Code\" }];\r\n\r\nfunction renderPicker(options: {\r\n container?: \"modal\" | \"drawer\";\r\n searchOnOpen?: boolean;\r\n search: () => ReferentielSearchResult<Ligne>;\r\n}) {\r\n return render(\r\n <ReferentielField<Ligne>\r\n value={null}\r\n onChange={() => {}}\r\n search={options.search}\r\n columns={COLONNES}\r\n criteria={CRITERES}\r\n title=\"Rechercher un code\"\r\n {...(options.container !== undefined\r\n ? { container: options.container }\r\n : {})}\r\n {...(options.searchOnOpen !== undefined\r\n ? { searchOnOpen: options.searchOnOpen }\r\n : {})}\r\n />\r\n );\r\n}\r\n\r\n/** Ouvre le sélecteur par son trigger (un Input en lecture seule). */\r\nasync function ouvrir(): Promise<void> {\r\n await userEvent.click(screen.getByRole(\"textbox\"));\r\n}\r\n\r\ndescribe(\"ReferentielField — conteneur drawer (S-1)\", () => {\r\n test(\"rend le corps du sélecteur dans la branche drawer\", async () => {\r\n const search = jest.fn(() => ({ items: LIGNES, total: 1 }));\r\n renderPicker({ container: \"drawer\", searchOnOpen: true, search });\r\n\r\n await ouvrir();\r\n\r\n /* Le critère ET la ligne de résultat : c'est le corps commun, pas un\r\n * détail de `Drawer`. Si la branche ne rendait pas `pickerBody`, ces deux\r\n * assertions tomberaient. */\r\n expect(await screen.findByText(\"Or sous formes brutes\")).toBeInTheDocument();\r\n expect(screen.getByLabelText(/Code/)).toBeInTheDocument();\r\n });\r\n\r\n test(\"le défaut reste la modale — aucun appelant existant ne change\", async () => {\r\n const search = jest.fn(() => ({ items: LIGNES, total: 1 }));\r\n renderPicker({ searchOnOpen: true, search });\r\n\r\n await ouvrir();\r\n\r\n expect(await screen.findByText(\"Or sous formes brutes\")).toBeInTheDocument();\r\n });\r\n});\r\n\r\ndescribe(\"ReferentielField — searchOnOpen (S-2)\", () => {\r\n test(\"cherche à vide dès l'ouverture\", async () => {\r\n const search = jest.fn(() => ({ items: LIGNES, total: 1 }));\r\n renderPicker({ searchOnOpen: true, search });\r\n\r\n await ouvrir();\r\n\r\n await waitFor(() => expect(search).toHaveBeenCalledTimes(1));\r\n /* À vide : c'est tout l'objet de la prop — la liste, pas un formulaire. */\r\n expect(search).toHaveBeenCalledWith(\r\n expect.objectContaining({ criteria: { code: \"\" }, page: 1 })\r\n );\r\n });\r\n\r\n test(\"ne cherche pas à l'ouverture quand la prop est absente\", async () => {\r\n const search = jest.fn(() => ({ items: LIGNES, total: 1 }));\r\n renderPicker({ search });\r\n\r\n await ouvrir();\r\n\r\n /* L'état « Aucune recherche » reste le comportement par défaut : la prop\r\n * est un opt-in, pas un changement de contrat. */\r\n expect(search).not.toHaveBeenCalled();\r\n });\r\n\r\n test(\"UNE SEULE recherche par ouverture, même en saisissant un critère\", async () => {\r\n const search = jest.fn(() => ({ items: LIGNES, total: 1 }));\r\n renderPicker({ searchOnOpen: true, search });\r\n\r\n await ouvrir();\r\n await waitFor(() => expect(search).toHaveBeenCalledTimes(1));\r\n\r\n /* LE test de ce fichier. `runSearch` dépend de `draft` : sans la garde par\r\n * `ref`, l'effet d'ouverture repartirait à chaque frappe et le sélecteur\r\n * émettrait une requête par caractère. */\r\n await userEvent.type(screen.getByLabelText(/Code/), \"710\");\r\n\r\n expect(search).toHaveBeenCalledTimes(1);\r\n });\r\n});\r\n"],"mappings":";;AAAAA,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA4D,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAA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AC;EACzC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
require("@testing-library/jest-dom");
|
|
5
4
|
var React = _interopRequireWildcard(require("react"));
|
|
6
5
|
var _react2 = require("@testing-library/react");
|
|
7
6
|
var _SectionErrorBoundary = _interopRequireDefault(require("../components/SectionErrorBoundary"));
|
|
8
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
16
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
17
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /**
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
|
+
/**
|
|
18
11
|
* SectionErrorBoundary — behaviour tests.
|
|
19
12
|
*
|
|
20
13
|
* WHY THIS FILE MATTERS MORE THAN MOST
|
|
@@ -32,25 +25,26 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /**
|
|
|
32
25
|
* NOTE ON CONSOLE NOISE — React logs caught errors to console.error itself, on
|
|
33
26
|
* top of the boundary's own log. Both are silenced per-test rather than globally
|
|
34
27
|
* so a genuine unexpected console.error still surfaces in the other suites.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** A component that throws on render, controlled by a prop. */function Boom({
|
|
31
|
+
shouldThrow = true
|
|
32
|
+
}) {
|
|
39
33
|
if (shouldThrow) throw new Error("payload inattendu: articles.map n'est pas une fonction");
|
|
40
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
41
35
|
children: "contenu r\xE9tabli"
|
|
42
36
|
});
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
beforeEach(
|
|
46
|
-
consoleErrorSpy = jest.spyOn(console, "error").mockImplementation(
|
|
38
|
+
let consoleErrorSpy;
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
consoleErrorSpy = jest.spyOn(console, "error").mockImplementation(() => {});
|
|
47
41
|
});
|
|
48
|
-
afterEach(
|
|
42
|
+
afterEach(() => {
|
|
49
43
|
consoleErrorSpy.mockRestore();
|
|
50
44
|
});
|
|
51
|
-
describe("SectionErrorBoundary — containment",
|
|
52
|
-
test("renders children untouched when nothing throws",
|
|
53
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
45
|
+
describe("SectionErrorBoundary — containment", () => {
|
|
46
|
+
test("renders children untouched when nothing throws", () => {
|
|
47
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
54
48
|
title: "Marchandises",
|
|
55
49
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
56
50
|
children: "contenu normal"
|
|
@@ -59,7 +53,7 @@ describe("SectionErrorBoundary — containment", function () {
|
|
|
59
53
|
expect(_react2.screen.getByText("contenu normal")).toBeInTheDocument();
|
|
60
54
|
expect(_react2.screen.queryByRole("alert")).not.toBeInTheDocument();
|
|
61
55
|
});
|
|
62
|
-
test("catches a render exception and keeps its SIBLINGS mounted",
|
|
56
|
+
test("catches a render exception and keeps its SIBLINGS mounted", () => {
|
|
63
57
|
/* THE contract. The assertion that matters is not that the banner appears —
|
|
64
58
|
* it is that `sibling` is still in the document. Without a boundary React
|
|
65
59
|
* unmounts the entire tree and BOTH would be gone: that is the blank screen
|
|
@@ -67,7 +61,7 @@ describe("SectionErrorBoundary — containment", function () {
|
|
|
67
61
|
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
68
62
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
69
63
|
children: "sibling"
|
|
70
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
71
65
|
title: "Marchandises",
|
|
72
66
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
73
67
|
})]
|
|
@@ -75,22 +69,22 @@ describe("SectionErrorBoundary — containment", function () {
|
|
|
75
69
|
expect(_react2.screen.getByText("sibling")).toBeInTheDocument();
|
|
76
70
|
expect(_react2.screen.getByRole("alert")).toBeInTheDocument();
|
|
77
71
|
});
|
|
78
|
-
test("names the failing section so the user knows WHAT broke",
|
|
79
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
72
|
+
test("names the failing section so the user knows WHAT broke", () => {
|
|
73
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
80
74
|
title: "Marchandises",
|
|
81
75
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
82
76
|
}));
|
|
83
77
|
expect(_react2.screen.getByRole("alert")).toHaveTextContent("Marchandises");
|
|
84
78
|
});
|
|
85
|
-
test("falls back to a generic label when no title is supplied",
|
|
86
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
79
|
+
test("falls back to a generic label when no title is supplied", () => {
|
|
80
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
87
81
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
88
82
|
}));
|
|
89
83
|
expect(_react2.screen.getByRole("alert")).toHaveTextContent("Section");
|
|
90
84
|
});
|
|
91
85
|
});
|
|
92
|
-
describe("SectionErrorBoundary — user-facing copy (§09.3)",
|
|
93
|
-
test("shows French recovery copy, never a raw exception message",
|
|
86
|
+
describe("SectionErrorBoundary — user-facing copy (§09.3)", () => {
|
|
87
|
+
test("shows French recovery copy, never a raw exception message", () => {
|
|
94
88
|
/* Charter §09.3 forbids exposing technical detail to the user, and a raw JS
|
|
95
89
|
* exception is worse than the "Erreur HTTP 422" the charter uses as its DON'T
|
|
96
90
|
* example. The reference implementation this was promoted from rendered
|
|
@@ -100,14 +94,14 @@ describe("SectionErrorBoundary — user-facing copy (§09.3)", function () {
|
|
|
100
94
|
* render — which is why this test targets the recovery sentence rather than
|
|
101
95
|
* asserting the absence of the message. The production-only behaviour is
|
|
102
96
|
* asserted separately below. */
|
|
103
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
97
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
104
98
|
title: "Marchandises",
|
|
105
99
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
106
100
|
}));
|
|
107
101
|
expect(_react2.screen.getByRole("alert")).toHaveTextContent(/Cette section n'a pas pu s'afficher/);
|
|
108
102
|
});
|
|
109
|
-
test("suppresses the technical detail in production",
|
|
110
|
-
|
|
103
|
+
test("suppresses the technical detail in production", () => {
|
|
104
|
+
const previous = process.env["NODE_ENV"];
|
|
111
105
|
/* Bracket access throughout, matching the component: `process.env` is an index
|
|
112
106
|
* signature and `noPropertyAccessFromIndexSignature` is mandatory. Tests are
|
|
113
107
|
* outside tsconfig.build.json's scope so dot access would have compiled here —
|
|
@@ -117,25 +111,25 @@ describe("SectionErrorBoundary — user-facing copy (§09.3)", function () {
|
|
|
117
111
|
* finally block restores it even if the assertion throws. */
|
|
118
112
|
process.env["NODE_ENV"] = "production";
|
|
119
113
|
try {
|
|
120
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
114
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
121
115
|
title: "Marchandises",
|
|
122
116
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
123
117
|
}));
|
|
124
118
|
expect(_react2.screen.getByRole("alert")).toHaveTextContent(/Cette section n'a pas pu s'afficher/);
|
|
125
119
|
expect(_react2.screen.getByRole("alert")).not.toHaveTextContent(/articles\.map/);
|
|
126
120
|
} finally {
|
|
127
|
-
process.env["NODE_ENV"] = previous
|
|
121
|
+
process.env["NODE_ENV"] = previous ?? "test";
|
|
128
122
|
}
|
|
129
123
|
});
|
|
130
124
|
});
|
|
131
|
-
describe("SectionErrorBoundary — retry REMOUNTS",
|
|
132
|
-
test("retry clears the error and re-renders the subtree",
|
|
125
|
+
describe("SectionErrorBoundary — retry REMOUNTS", () => {
|
|
126
|
+
test("retry clears the error and re-renders the subtree", () => {
|
|
133
127
|
/* The re-key on `attempt` is what makes this work. Without it React reuses
|
|
134
128
|
* the instance that threw and retry fails identically — a retry button that
|
|
135
129
|
* cannot succeed is worse than no retry button. `shouldThrow` is read from a
|
|
136
130
|
* mutable holder so the same element throws first and succeeds second,
|
|
137
131
|
* exactly as a transient payload problem would. */
|
|
138
|
-
|
|
132
|
+
const holder = {
|
|
139
133
|
shouldThrow: true
|
|
140
134
|
};
|
|
141
135
|
function Flaky() {
|
|
@@ -143,7 +137,7 @@ describe("SectionErrorBoundary — retry REMOUNTS", function () {
|
|
|
143
137
|
shouldThrow: holder.shouldThrow
|
|
144
138
|
});
|
|
145
139
|
}
|
|
146
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
140
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
147
141
|
title: "Marchandises",
|
|
148
142
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Flaky, {})
|
|
149
143
|
}));
|
|
@@ -155,8 +149,8 @@ describe("SectionErrorBoundary — retry REMOUNTS", function () {
|
|
|
155
149
|
expect(_react2.screen.getByText("contenu rétabli")).toBeInTheDocument();
|
|
156
150
|
expect(_react2.screen.queryByRole("alert")).not.toBeInTheDocument();
|
|
157
151
|
});
|
|
158
|
-
test("a custom retryLabel is used on the button and in the copy",
|
|
159
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
152
|
+
test("a custom retryLabel is used on the button and in the copy", () => {
|
|
153
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
160
154
|
title: "Marchandises",
|
|
161
155
|
retryLabel: "Recharger",
|
|
162
156
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
@@ -167,45 +161,40 @@ describe("SectionErrorBoundary — retry REMOUNTS", function () {
|
|
|
167
161
|
expect(_react2.screen.getByRole("alert")).toHaveTextContent(/Recharger/);
|
|
168
162
|
});
|
|
169
163
|
});
|
|
170
|
-
describe("SectionErrorBoundary — reporting and second exit",
|
|
171
|
-
test("calls onError with the error and the component info",
|
|
164
|
+
describe("SectionErrorBoundary — reporting and second exit", () => {
|
|
165
|
+
test("calls onError with the error and the component info", () => {
|
|
172
166
|
/* console.error is invisible in production, so without this hook a boundary
|
|
173
167
|
* silently swallows the only signal an operator would ever get. */
|
|
174
|
-
|
|
175
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
168
|
+
const onError = jest.fn();
|
|
169
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
176
170
|
title: "Marchandises",
|
|
177
171
|
onError: onError,
|
|
178
172
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
179
173
|
}));
|
|
180
174
|
expect(onError).toHaveBeenCalledTimes(1);
|
|
181
|
-
|
|
182
|
-
_ref3 = _slicedToArray(_ref2, 2),
|
|
183
|
-
err = _ref3[0],
|
|
184
|
-
info = _ref3[1];
|
|
175
|
+
const [err, info] = onError.mock.calls[0];
|
|
185
176
|
expect(err).toBeInstanceOf(Error);
|
|
186
177
|
expect(err.message).toMatch(/articles\.map/);
|
|
187
178
|
expect(info).toHaveProperty("componentStack");
|
|
188
179
|
});
|
|
189
|
-
test("a throwing onError does not take the boundary down with it",
|
|
180
|
+
test("a throwing onError does not take the boundary down with it", () => {
|
|
190
181
|
/* Guard on the guard. A reporter that throws must not defeat the component
|
|
191
182
|
* whose entire purpose is stopping one failure from causing another. */
|
|
192
|
-
|
|
183
|
+
const onError = jest.fn(() => {
|
|
193
184
|
throw new Error("APM indisponible");
|
|
194
185
|
});
|
|
195
|
-
expect(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}));
|
|
201
|
-
}).not.toThrow();
|
|
186
|
+
expect(() => (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
187
|
+
title: "Marchandises",
|
|
188
|
+
onError: onError,
|
|
189
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
190
|
+
}))).not.toThrow();
|
|
202
191
|
expect(_react2.screen.getByRole("alert")).toBeInTheDocument();
|
|
203
192
|
});
|
|
204
|
-
test("renders the optional secondary exit when supplied",
|
|
193
|
+
test("renders the optional secondary exit when supplied", () => {
|
|
205
194
|
/* Only possible since Banner gained secondaryAction (gap G-19). The reference
|
|
206
195
|
* implementation offered no way out when retrying could not help. */
|
|
207
|
-
|
|
208
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
196
|
+
const onEscape = jest.fn();
|
|
197
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
209
198
|
title: "Marchandises",
|
|
210
199
|
secondaryAction: {
|
|
211
200
|
label: "Retour à la liste",
|
|
@@ -213,24 +202,20 @@ describe("SectionErrorBoundary — reporting and second exit", function () {
|
|
|
213
202
|
},
|
|
214
203
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
215
204
|
}));
|
|
216
|
-
|
|
205
|
+
const escape = _react2.screen.getByRole("button", {
|
|
217
206
|
name: /Retour à la liste/
|
|
218
207
|
});
|
|
219
208
|
_react2.fireEvent.click(escape);
|
|
220
209
|
expect(onEscape).toHaveBeenCalledTimes(1);
|
|
221
210
|
});
|
|
222
|
-
test("logs the section title and the component stack",
|
|
223
|
-
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary
|
|
211
|
+
test("logs the section title and the component stack", () => {
|
|
212
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_SectionErrorBoundary.default, {
|
|
224
213
|
title: "Marchandises",
|
|
225
214
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Boom, {})
|
|
226
215
|
}));
|
|
227
216
|
/* Asserted loosely — the point is that an operator grepping logs can find
|
|
228
217
|
* WHICH section failed, not the exact format of the line. */
|
|
229
|
-
|
|
230
|
-
return args.some(function (a) {
|
|
231
|
-
return typeof a === "string" && a.includes("Marchandises");
|
|
232
|
-
});
|
|
233
|
-
});
|
|
218
|
+
const logged = consoleErrorSpy.mock.calls.some(args => args.some(a => typeof a === "string" && a.includes("Marchandises")));
|
|
234
219
|
expect(logged).toBe(true);
|
|
235
220
|
});
|
|
236
221
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionErrorBoundary.test.js","names":["require","React","_interopRequireWildcard","_react2","_SectionErrorBoundary","_interopRequireDefault","_jsxRuntime","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","isArray","Boom","_ref","_ref$shouldThrow","shouldThrow","Error","jsx","children","consoleErrorSpy","beforeEach","jest","spyOn","console","mockImplementation","afterEach","mockRestore","describe","render","title","expect","screen","getByText","toBeInTheDocument","queryByRole","not","jsxs","getByRole","toHaveTextContent","previous","process","env","holder","Flaky","fireEvent","click","retryLabel","onError","fn","toHaveBeenCalledTimes","_ref2","mock","calls","_ref3","info","toBeInstanceOf","message","toMatch","toHaveProperty","toThrow","onEscape","secondaryAction","label","onClick","escape","logged","some","args","a","includes","toBe"],"sources":["../../../src/lib/v2/__tests__/SectionErrorBoundary.test.tsx"],"sourcesContent":["import \"@testing-library/jest-dom\";\r\nimport * as React from \"react\";\r\nimport { render, screen, fireEvent } from \"@testing-library/react\";\r\nimport SectionErrorBoundary from \"../components/SectionErrorBoundary\";\r\n\r\n/**\r\n * SectionErrorBoundary — behaviour tests.\r\n *\r\n * WHY THIS FILE MATTERS MORE THAN MOST\r\n * ------------------------------------\r\n * §10.3 R-G.6 MUST, but the real reason is that this is the one component in the\r\n * library whose ENTIRE contract is a failure path. Every other component can be\r\n * eyeballed in Storybook; this one only does its job when something throws, which\r\n * nobody exercises by hand. And its failure mode is total: if the boundary does\r\n * not catch, React unmounts the whole tree and the user gets a blank screen\r\n * (ISO/IEC 25010 § Reliability — fault tolerance).\r\n *\r\n * jsdom is the right tool here, unusually: catching, re-mounting, logging and\r\n * conditional detail are all logic, not layout.\r\n *\r\n * NOTE ON CONSOLE NOISE — React logs caught errors to console.error itself, on\r\n * top of the boundary's own log. Both are silenced per-test rather than globally\r\n * so a genuine unexpected console.error still surfaces in the other suites.\r\n */\r\n\r\n/** A component that throws on render, controlled by a prop. */\r\nfunction Boom({ shouldThrow = true }: { shouldThrow?: boolean }) {\r\n if (shouldThrow) throw new Error(\"payload inattendu: articles.map n'est pas une fonction\");\r\n return <div>contenu rétabli</div>;\r\n}\r\n\r\nlet consoleErrorSpy: jest.SpyInstance;\r\n\r\nbeforeEach(() => {\r\n consoleErrorSpy = jest.spyOn(console, \"error\").mockImplementation(() => {});\r\n});\r\n\r\nafterEach(() => {\r\n consoleErrorSpy.mockRestore();\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — containment\", () => {\r\n test(\"renders children untouched when nothing throws\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <div>contenu normal</div>\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByText(\"contenu normal\")).toBeInTheDocument();\r\n expect(screen.queryByRole(\"alert\")).not.toBeInTheDocument();\r\n });\r\n\r\n test(\"catches a render exception and keeps its SIBLINGS mounted\", () => {\r\n /* THE contract. The assertion that matters is not that the banner appears —\r\n * it is that `sibling` is still in the document. Without a boundary React\r\n * unmounts the entire tree and BOTH would be gone: that is the blank screen\r\n * this component exists to prevent. */\r\n render(\r\n <div>\r\n <div>sibling</div>\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n </div>\r\n );\r\n\r\n expect(screen.getByText(\"sibling\")).toBeInTheDocument();\r\n expect(screen.getByRole(\"alert\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"names the failing section so the user knows WHAT broke\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\"Marchandises\");\r\n });\r\n\r\n test(\"falls back to a generic label when no title is supplied\", () => {\r\n render(\r\n <SectionErrorBoundary>\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\"Section\");\r\n });\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — user-facing copy (§09.3)\", () => {\r\n test(\"shows French recovery copy, never a raw exception message\", () => {\r\n /* Charter §09.3 forbids exposing technical detail to the user, and a raw JS\r\n * exception is worse than the \"Erreur HTTP 422\" the charter uses as its DON'T\r\n * example. The reference implementation this was promoted from rendered\r\n * error.message straight into the banner body; this asserts we do not.\r\n *\r\n * NODE_ENV is \"test\" here, not \"production\", so the dev detail block DOES\r\n * render — which is why this test targets the recovery sentence rather than\r\n * asserting the absence of the message. The production-only behaviour is\r\n * asserted separately below. */\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\r\n /Cette section n'a pas pu s'afficher/\r\n );\r\n });\r\n\r\n test(\"suppresses the technical detail in production\", () => {\r\n const previous = process.env[\"NODE_ENV\"];\r\n /* Bracket access throughout, matching the component: `process.env` is an index\r\n * signature and `noPropertyAccessFromIndexSignature` is mandatory. Tests are\r\n * outside tsconfig.build.json's scope so dot access would have compiled here —\r\n * two conventions in neighbouring files is the drift this audit exists to stop.\r\n *\r\n * Assigned rather than replaced wholesale: other suites read NODE_ENV, and the\r\n * finally block restores it even if the assertion throws. */\r\n (process.env as Record<string, string>)[\"NODE_ENV\"] = \"production\";\r\n try {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\r\n /Cette section n'a pas pu s'afficher/\r\n );\r\n expect(screen.getByRole(\"alert\")).not.toHaveTextContent(/articles\\.map/);\r\n } finally {\r\n (process.env as Record<string, string>)[\"NODE_ENV\"] = previous ?? \"test\";\r\n }\r\n });\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — retry REMOUNTS\", () => {\r\n test(\"retry clears the error and re-renders the subtree\", () => {\r\n /* The re-key on `attempt` is what makes this work. Without it React reuses\r\n * the instance that threw and retry fails identically — a retry button that\r\n * cannot succeed is worse than no retry button. `shouldThrow` is read from a\r\n * mutable holder so the same element throws first and succeeds second,\r\n * exactly as a transient payload problem would. */\r\n const holder = { shouldThrow: true };\r\n function Flaky() {\r\n return <Boom shouldThrow={holder.shouldThrow} />;\r\n }\r\n\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Flaky />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toBeInTheDocument();\r\n\r\n holder.shouldThrow = false;\r\n fireEvent.click(screen.getByRole(\"button\", { name: /Réessayer/ }));\r\n\r\n expect(screen.getByText(\"contenu rétabli\")).toBeInTheDocument();\r\n expect(screen.queryByRole(\"alert\")).not.toBeInTheDocument();\r\n });\r\n\r\n test(\"a custom retryLabel is used on the button and in the copy\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\" retryLabel=\"Recharger\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"button\", { name: /Recharger/ })).toBeInTheDocument();\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(/Recharger/);\r\n });\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — reporting and second exit\", () => {\r\n test(\"calls onError with the error and the component info\", () => {\r\n /* console.error is invisible in production, so without this hook a boundary\r\n * silently swallows the only signal an operator would ever get. */\r\n const onError = jest.fn();\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\" onError={onError}>\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n\r\n expect(onError).toHaveBeenCalledTimes(1);\r\n const [err, info] = onError.mock.calls[0] as [Error, React.ErrorInfo];\r\n expect(err).toBeInstanceOf(Error);\r\n expect(err.message).toMatch(/articles\\.map/);\r\n expect(info).toHaveProperty(\"componentStack\");\r\n });\r\n\r\n test(\"a throwing onError does not take the boundary down with it\", () => {\r\n /* Guard on the guard. A reporter that throws must not defeat the component\r\n * whose entire purpose is stopping one failure from causing another. */\r\n const onError = jest.fn(() => {\r\n throw new Error(\"APM indisponible\");\r\n });\r\n\r\n expect(() =>\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\" onError={onError}>\r\n <Boom />\r\n </SectionErrorBoundary>\r\n )\r\n ).not.toThrow();\r\n\r\n expect(screen.getByRole(\"alert\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"renders the optional secondary exit when supplied\", () => {\r\n /* Only possible since Banner gained secondaryAction (gap G-19). The reference\r\n * implementation offered no way out when retrying could not help. */\r\n const onEscape = jest.fn();\r\n render(\r\n <SectionErrorBoundary\r\n title=\"Marchandises\"\r\n secondaryAction={{ label: \"Retour à la liste\", onClick: onEscape }}\r\n >\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n\r\n const escape = screen.getByRole(\"button\", { name: /Retour à la liste/ });\r\n fireEvent.click(escape);\r\n expect(onEscape).toHaveBeenCalledTimes(1);\r\n });\r\n\r\n test(\"logs the section title and the component stack\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n /* Asserted loosely — the point is that an operator grepping logs can find\r\n * WHICH section failed, not the exact format of the line. */\r\n const logged = consoleErrorSpy.mock.calls.some((args) =>\r\n args.some((a: unknown) => typeof a === \"string\" && a.includes(\"Marchandises\"))\r\n );\r\n expect(logged).toBe(true);\r\n });\r\n});\r\n"],"mappings":";;;AAAAA,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAsE,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAK,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAA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AAGjC,cAAM,CAACM,SAAS,CAAC,QAAQ,EAAE;MAAEhD,IAAI,EAAE;IAAoB,CAAC,CAAC;IACxEuD,iBAAS,CAACC,KAAK,CAACmB,MAAM,CAAC;IACvBlC,MAAM,CAAC8B,QAAQ,CAAC,CAACX,qBAAqB,CAAC,CAAC,CAAC;EAC3C,CAAC,CAAC;EAEFzD,IAAI,CAAC,gDAAgD,EAAE,YAAM;IAC3D,IAAAoC,cAAM,eACJ,IAAA7E,WAAA,CAAAkE,GAAA,EAACpE,qBAAA,WAAoB;MAACgF,KAAK,EAAC,cAAc;MAAAX,QAAA,eACxC,IAAAnE,WAAA,CAAAkE,GAAA,EAACL,IAAI,IAAE;IAAC,CACY,CACxB,CAAC;IACD;AACJ;IACI,IAAMqD,MAAM,GAAG9C,eAAe,CAACgC,IAAI,CAACC,KAAK,CAACc,IAAI,CAAC,UAACC,IAAI;MAAA,OAClDA,IAAI,CAACD,IAAI,CAAC,UAACE,CAAU;QAAA,OAAK,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,CAACC,QAAQ,CAAC,cAAc,CAAC;MAAA,EAAC;IAAA,CAChF,CAAC;IACDvC,MAAM,CAACmC,MAAM,CAAC,CAACK,IAAI,CAAC,IAAI,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"SectionErrorBoundary.test.js","names":["require","React","_interopRequireWildcard","_react2","_SectionErrorBoundary","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Boom","shouldThrow","Error","jsx","children","consoleErrorSpy","beforeEach","jest","spyOn","console","mockImplementation","afterEach","mockRestore","describe","test","render","title","expect","screen","getByText","toBeInTheDocument","queryByRole","not","jsxs","getByRole","toHaveTextContent","previous","process","env","holder","Flaky","fireEvent","click","name","retryLabel","onError","fn","toHaveBeenCalledTimes","err","info","mock","calls","toBeInstanceOf","message","toMatch","toHaveProperty","toThrow","onEscape","secondaryAction","label","onClick","escape","logged","some","args","a","includes","toBe"],"sources":["../../../src/lib/v2/__tests__/SectionErrorBoundary.test.tsx"],"sourcesContent":["import \"@testing-library/jest-dom\";\r\nimport * as React from \"react\";\r\nimport { render, screen, fireEvent } from \"@testing-library/react\";\r\nimport SectionErrorBoundary from \"../components/SectionErrorBoundary\";\r\n\r\n/**\r\n * SectionErrorBoundary — behaviour tests.\r\n *\r\n * WHY THIS FILE MATTERS MORE THAN MOST\r\n * ------------------------------------\r\n * §10.3 R-G.6 MUST, but the real reason is that this is the one component in the\r\n * library whose ENTIRE contract is a failure path. Every other component can be\r\n * eyeballed in Storybook; this one only does its job when something throws, which\r\n * nobody exercises by hand. And its failure mode is total: if the boundary does\r\n * not catch, React unmounts the whole tree and the user gets a blank screen\r\n * (ISO/IEC 25010 § Reliability — fault tolerance).\r\n *\r\n * jsdom is the right tool here, unusually: catching, re-mounting, logging and\r\n * conditional detail are all logic, not layout.\r\n *\r\n * NOTE ON CONSOLE NOISE — React logs caught errors to console.error itself, on\r\n * top of the boundary's own log. Both are silenced per-test rather than globally\r\n * so a genuine unexpected console.error still surfaces in the other suites.\r\n */\r\n\r\n/** A component that throws on render, controlled by a prop. */\r\nfunction Boom({ shouldThrow = true }: { shouldThrow?: boolean }) {\r\n if (shouldThrow) throw new Error(\"payload inattendu: articles.map n'est pas une fonction\");\r\n return <div>contenu rétabli</div>;\r\n}\r\n\r\nlet consoleErrorSpy: jest.SpyInstance;\r\n\r\nbeforeEach(() => {\r\n consoleErrorSpy = jest.spyOn(console, \"error\").mockImplementation(() => {});\r\n});\r\n\r\nafterEach(() => {\r\n consoleErrorSpy.mockRestore();\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — containment\", () => {\r\n test(\"renders children untouched when nothing throws\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <div>contenu normal</div>\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByText(\"contenu normal\")).toBeInTheDocument();\r\n expect(screen.queryByRole(\"alert\")).not.toBeInTheDocument();\r\n });\r\n\r\n test(\"catches a render exception and keeps its SIBLINGS mounted\", () => {\r\n /* THE contract. The assertion that matters is not that the banner appears —\r\n * it is that `sibling` is still in the document. Without a boundary React\r\n * unmounts the entire tree and BOTH would be gone: that is the blank screen\r\n * this component exists to prevent. */\r\n render(\r\n <div>\r\n <div>sibling</div>\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n </div>\r\n );\r\n\r\n expect(screen.getByText(\"sibling\")).toBeInTheDocument();\r\n expect(screen.getByRole(\"alert\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"names the failing section so the user knows WHAT broke\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\"Marchandises\");\r\n });\r\n\r\n test(\"falls back to a generic label when no title is supplied\", () => {\r\n render(\r\n <SectionErrorBoundary>\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\"Section\");\r\n });\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — user-facing copy (§09.3)\", () => {\r\n test(\"shows French recovery copy, never a raw exception message\", () => {\r\n /* Charter §09.3 forbids exposing technical detail to the user, and a raw JS\r\n * exception is worse than the \"Erreur HTTP 422\" the charter uses as its DON'T\r\n * example. The reference implementation this was promoted from rendered\r\n * error.message straight into the banner body; this asserts we do not.\r\n *\r\n * NODE_ENV is \"test\" here, not \"production\", so the dev detail block DOES\r\n * render — which is why this test targets the recovery sentence rather than\r\n * asserting the absence of the message. The production-only behaviour is\r\n * asserted separately below. */\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\r\n /Cette section n'a pas pu s'afficher/\r\n );\r\n });\r\n\r\n test(\"suppresses the technical detail in production\", () => {\r\n const previous = process.env[\"NODE_ENV\"];\r\n /* Bracket access throughout, matching the component: `process.env` is an index\r\n * signature and `noPropertyAccessFromIndexSignature` is mandatory. Tests are\r\n * outside tsconfig.build.json's scope so dot access would have compiled here —\r\n * two conventions in neighbouring files is the drift this audit exists to stop.\r\n *\r\n * Assigned rather than replaced wholesale: other suites read NODE_ENV, and the\r\n * finally block restores it even if the assertion throws. */\r\n (process.env as Record<string, string>)[\"NODE_ENV\"] = \"production\";\r\n try {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(\r\n /Cette section n'a pas pu s'afficher/\r\n );\r\n expect(screen.getByRole(\"alert\")).not.toHaveTextContent(/articles\\.map/);\r\n } finally {\r\n (process.env as Record<string, string>)[\"NODE_ENV\"] = previous ?? \"test\";\r\n }\r\n });\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — retry REMOUNTS\", () => {\r\n test(\"retry clears the error and re-renders the subtree\", () => {\r\n /* The re-key on `attempt` is what makes this work. Without it React reuses\r\n * the instance that threw and retry fails identically — a retry button that\r\n * cannot succeed is worse than no retry button. `shouldThrow` is read from a\r\n * mutable holder so the same element throws first and succeeds second,\r\n * exactly as a transient payload problem would. */\r\n const holder = { shouldThrow: true };\r\n function Flaky() {\r\n return <Boom shouldThrow={holder.shouldThrow} />;\r\n }\r\n\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Flaky />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"alert\")).toBeInTheDocument();\r\n\r\n holder.shouldThrow = false;\r\n fireEvent.click(screen.getByRole(\"button\", { name: /Réessayer/ }));\r\n\r\n expect(screen.getByText(\"contenu rétabli\")).toBeInTheDocument();\r\n expect(screen.queryByRole(\"alert\")).not.toBeInTheDocument();\r\n });\r\n\r\n test(\"a custom retryLabel is used on the button and in the copy\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\" retryLabel=\"Recharger\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n expect(screen.getByRole(\"button\", { name: /Recharger/ })).toBeInTheDocument();\r\n expect(screen.getByRole(\"alert\")).toHaveTextContent(/Recharger/);\r\n });\r\n});\r\n\r\ndescribe(\"SectionErrorBoundary — reporting and second exit\", () => {\r\n test(\"calls onError with the error and the component info\", () => {\r\n /* console.error is invisible in production, so without this hook a boundary\r\n * silently swallows the only signal an operator would ever get. */\r\n const onError = jest.fn();\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\" onError={onError}>\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n\r\n expect(onError).toHaveBeenCalledTimes(1);\r\n const [err, info] = onError.mock.calls[0] as [Error, React.ErrorInfo];\r\n expect(err).toBeInstanceOf(Error);\r\n expect(err.message).toMatch(/articles\\.map/);\r\n expect(info).toHaveProperty(\"componentStack\");\r\n });\r\n\r\n test(\"a throwing onError does not take the boundary down with it\", () => {\r\n /* Guard on the guard. A reporter that throws must not defeat the component\r\n * whose entire purpose is stopping one failure from causing another. */\r\n const onError = jest.fn(() => {\r\n throw new Error(\"APM indisponible\");\r\n });\r\n\r\n expect(() =>\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\" onError={onError}>\r\n <Boom />\r\n </SectionErrorBoundary>\r\n )\r\n ).not.toThrow();\r\n\r\n expect(screen.getByRole(\"alert\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"renders the optional secondary exit when supplied\", () => {\r\n /* Only possible since Banner gained secondaryAction (gap G-19). The reference\r\n * implementation offered no way out when retrying could not help. */\r\n const onEscape = jest.fn();\r\n render(\r\n <SectionErrorBoundary\r\n title=\"Marchandises\"\r\n secondaryAction={{ label: \"Retour à la liste\", onClick: onEscape }}\r\n >\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n\r\n const escape = screen.getByRole(\"button\", { name: /Retour à la liste/ });\r\n fireEvent.click(escape);\r\n expect(onEscape).toHaveBeenCalledTimes(1);\r\n });\r\n\r\n test(\"logs the section title and the component stack\", () => {\r\n render(\r\n <SectionErrorBoundary title=\"Marchandises\">\r\n <Boom />\r\n </SectionErrorBoundary>\r\n );\r\n /* Asserted loosely — the point is that an operator grepping logs can find\r\n * WHICH section failed, not the exact format of the line. */\r\n const logged = consoleErrorSpy.mock.calls.some((args) =>\r\n args.some((a: unknown) => typeof a === \"string\" && a.includes(\"Marchandises\"))\r\n );\r\n expect(logged).toBe(true);\r\n });\r\n});\r\n"],"mappings":";;AAAAA,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAsE,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAK,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAK,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,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