@portnet/ui 6.0.1 → 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 +737 -0
- package/dist/esm/index.js +90 -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 -39
- 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 +146 -0
- package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FileCard.test.js +18 -18
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js +173 -0
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +236 -0
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
- 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 +299 -0
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -43
- 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 -22
- 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 +118 -90
- 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 +210 -52
- 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 +64 -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 +14 -4
- 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 +26 -75
- 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 +130 -0
- package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -0
- 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 -66
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDatePicker.js +51 -99
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDateTimePicker.js +136 -0
- package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -0
- 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 -50
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
- package/dist/esm/v2/patterns/FormikRadioGroup.js +129 -0
- package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -0
- 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 -84
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/esm/v2/patterns/FormikTextarea.js +30 -43
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +64 -65
- 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 +127 -0
- package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -0
- 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 +72 -0
- package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -0
- 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 +235 -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 +203 -0
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/index.js +5 -0
- package/dist/esm/v2/personalization/capabilities/index.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 +35 -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 +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -47
- 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 +98 -69
- 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 +148 -0
- package/dist/v2/__tests__/FieldWidth.test.js.map +1 -0
- package/dist/v2/__tests__/FileCard.test.js +45 -48
- package/dist/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/v2/__tests__/FormikCheckbox.test.js +175 -0
- package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -0
- package/dist/v2/__tests__/FormikDateTimePicker.test.js +237 -0
- package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
- 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 +300 -0
- package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
- package/dist/v2/__tests__/MobileRowCard.test.js +100 -102
- 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 +38 -46
- 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.d.ts.map +1 -1
- package/dist/v2/components/DateTimePicker.js +121 -95
- 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 +121 -5
- package/dist/v2/components/Field.d.ts.map +1 -1
- package/dist/v2/components/Field.js +221 -62
- 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 +67 -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.d.ts.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.d.ts +9 -9
- package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
- package/dist/v2/patterns/FavoriteColumn.js +32 -80
- 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.d.ts +77 -0
- package/dist/v2/patterns/FormikCheckbox.d.ts.map +1 -0
- package/dist/v2/patterns/FormikCheckbox.js +138 -0
- package/dist/v2/patterns/FormikCheckbox.js.map +1 -0
- 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.d.ts +7 -1
- package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCombobox.js +55 -69
- package/dist/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.d.ts +13 -1
- package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.js +59 -106
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/v2/patterns/FormikDateTimePicker.d.ts +111 -0
- package/dist/v2/patterns/FormikDateTimePicker.d.ts.map +1 -0
- package/dist/v2/patterns/FormikDateTimePicker.js +144 -0
- package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -0
- 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.d.ts +11 -1
- package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
- package/dist/v2/patterns/FormikInput.js +45 -55
- package/dist/v2/patterns/FormikInput.js.map +1 -1
- package/dist/v2/patterns/FormikRadioGroup.d.ts +80 -0
- package/dist/v2/patterns/FormikRadioGroup.d.ts.map +1 -0
- package/dist/v2/patterns/FormikRadioGroup.js +137 -0
- package/dist/v2/patterns/FormikRadioGroup.js.map +1 -0
- 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.d.ts +9 -1
- package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
- package/dist/v2/patterns/FormikSelect.js +70 -89
- package/dist/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/v2/patterns/FormikTextarea.d.ts +9 -1
- package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
- package/dist/v2/patterns/FormikTextarea.js +35 -48
- package/dist/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +14 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +71 -74
- 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 +98 -0
- package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -0
- package/dist/v2/patterns/RowFavoriteToggle.js +135 -0
- package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -0
- 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.d.ts +44 -0
- package/dist/v2/patterns/_pickerSerialisation.d.ts.map +1 -0
- package/dist/v2/patterns/_pickerSerialisation.js +80 -0
- package/dist/v2/patterns/_pickerSerialisation.js.map +1 -0
- 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 +247 -0
- package/dist/v2/patterns/index.d.ts.map +1 -1
- package/dist/v2/patterns/index.js +182 -70
- 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.d.ts +100 -0
- package/dist/v2/personalization/capabilities/gridPreferences.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/gridPreferences.js +210 -0
- package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -0
- package/dist/v2/personalization/capabilities/index.d.ts +6 -0
- package/dist/v2/personalization/capabilities/index.d.ts.map +1 -1
- package/dist/v2/personalization/capabilities/index.js +23 -10
- package/dist/v2/personalization/capabilities/index.js.map +1 -1
- 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 +34 -0
- package/dist/v2/personalization/index.d.ts.map +1 -1
- package/dist/v2/personalization/index.js +41 -21
- 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
|
@@ -1,10 +1,72 @@
|
|
|
1
1
|
export { default as useFocusTrap } from "./useFocusTrap";
|
|
2
|
+
/**
|
|
3
|
+
* Raccourcis clavier de page — l'autre moitié de `KeyboardShortcutsHelp`
|
|
4
|
+
* (gap G-48).
|
|
5
|
+
*
|
|
6
|
+
* La library possédait les DEUX BOUTS et pas l'écouteur entre eux : le
|
|
7
|
+
* dialogue « ? » qui LISTE les raccourcis, et l'attribut
|
|
8
|
+
* `data-v2-overlay-open` qu'elle POSE sur le `body` et que les raccourcis
|
|
9
|
+
* doivent respecter.
|
|
10
|
+
*
|
|
11
|
+
* Un hôte qui les câblait devait donc lire cet attribut lui-même — un module
|
|
12
|
+
* dépendant d'un détail d'implémentation du composant qu'il rend, et qui
|
|
13
|
+
* casserait EN SILENCE s'il était renommé : les raccourcis se mettraient à
|
|
14
|
+
* tirer derrière les modales ouvertes, ce que rien ne teste.
|
|
15
|
+
*
|
|
16
|
+
* Relevé depuis `addm-fe` (Area 14), dont les listings portaient un
|
|
17
|
+
* `searchInputRef` déclaré et transmis POUR le raccourci « / » — un câblage
|
|
18
|
+
* qui attendait un écouteur jamais écrit.
|
|
19
|
+
*/
|
|
20
|
+
export { default as useKeyboardShortcuts } from "./useKeyboardShortcuts";
|
|
2
21
|
export { default as useTabLoading, PERCEPTION_THRESHOLD_MS } from "./useTabLoading";
|
|
3
22
|
export { default as useDelayedFlag } from "./useDelayedFlag";
|
|
23
|
+
/**
|
|
24
|
+
* Defers a CALL until the input settles — the companion `useDelayedFlag` is
|
|
25
|
+
* not: that one flips a boolean after a delay. Gap G-39; see the file header
|
|
26
|
+
* for the three defects the `lodash.debounce` era produced in every host.
|
|
27
|
+
*/
|
|
28
|
+
export { default as useDebouncedCallback } from "./useDebouncedCallback";
|
|
29
|
+
/**
|
|
30
|
+
* Tracks the criteria ACTUALLY applied to a listing (gap G-43), so chips
|
|
31
|
+
* cannot announce a filter that is only being typed. Companion to
|
|
32
|
+
* `buildFilterChips`. Promoted from `refonte-frontend` (Area 5).
|
|
33
|
+
*/
|
|
34
|
+
export { default as useAppliedFilters } from "./useAppliedFilters";
|
|
35
|
+
/**
|
|
36
|
+
* Runtime read of `prefers-reduced-motion` (gap G-49), for animation the
|
|
37
|
+
* library does not own — charts, canvases, imperative scroll, third-party
|
|
38
|
+
* widgets configured in JS. CSS cannot answer those, so every host wrote the
|
|
39
|
+
* same one-line snapshot helper, which never subscribed: turning the
|
|
40
|
+
* preference on left the animations running. See the file header.
|
|
41
|
+
*/
|
|
42
|
+
export { default as usePrefersReducedMotion } from "./usePrefersReducedMotion";
|
|
43
|
+
export { PREFERS_REDUCED_MOTION_QUERY } from "./usePrefersReducedMotion";
|
|
4
44
|
export { default as useDensity } from "./useDensity";
|
|
5
45
|
export { default as useResolvedDensity } from "./useResolvedDensity";
|
|
6
46
|
export { default as useSortedRows } from "./useSortedRows";
|
|
7
47
|
export { default as useFormAutoSave } from "./useFormAutoSave";
|
|
8
48
|
export { default as useFormCompletionProgress } from "./useFormCompletionProgress";
|
|
9
49
|
export { default as useFocusFirstError, focusFieldByName } from "./useFocusFirstError";
|
|
50
|
+
/**
|
|
51
|
+
* Déplace le focus sur le landmark principal à chaque changement de PAGE
|
|
52
|
+
* (gap G-60).
|
|
53
|
+
*
|
|
54
|
+
* Dans une application à page unique, naviguer ne déplace PAS le focus — le
|
|
55
|
+
* navigateur ne le fait qu'au chargement d'un vrai document. Le focus reste
|
|
56
|
+
* donc sur ce qui a été cliqué, ou tombe sur `document.body` quand cet élément
|
|
57
|
+
* est démonté par la navigation qu'il vient de déclencher. Depuis `body`, le
|
|
58
|
+
* Tab suivant repart du haut du NAVIGATEUR : l'utilisateur au clavier retraverse
|
|
59
|
+
* la barre d'adresse à chaque écran, et le lecteur d'écran n'annonce rien.
|
|
60
|
+
*
|
|
61
|
+
* Agnostique du routeur : l'hôte passe la clé qu'il veut surveiller — et doit
|
|
62
|
+
* passer le CHEMIN, pas `location.key`, sinon un changement de filtre dans la
|
|
63
|
+
* query string vole le focus au champ en cours de saisie.
|
|
64
|
+
*
|
|
65
|
+
* La library est le bon endroit même sans connaître de routeur : `AppMain` est
|
|
66
|
+
* la cible, et c'est lui qui porte le `tabIndex={-1}` qui rend la région
|
|
67
|
+
* focalisable. Relevé depuis `autorisation-admis-pour-conforme-fe` (Area 10),
|
|
68
|
+
* où archiver un dossier ferme un dialogue et navigue en arrière — le piège de
|
|
69
|
+
* focus restituant alors le focus à un bouton qui n'existe plus.
|
|
70
|
+
*/
|
|
71
|
+
export { default as useFocusOnRouteChange } from "./useFocusOnRouteChange";
|
|
10
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","useFocusTrap","useTabLoading","PERCEPTION_THRESHOLD_MS","useDelayedFlag","useDensity","useResolvedDensity","useSortedRows","useFormAutoSave","useFormCompletionProgress","useFocusFirstError","focusFieldByName"],"sources":["../../../../src/lib/v2/hooks/index.ts"],"sourcesContent":["export { default as useFocusTrap } from \"./useFocusTrap\";\r\nexport {\r\n default as useTabLoading,\r\n PERCEPTION_THRESHOLD_MS,\r\n} from \"./useTabLoading\";\r\nexport { default as useDelayedFlag } from \"./useDelayedFlag\";\r\nexport { default as useDensity } from \"./useDensity\";\r\nexport { default as useResolvedDensity } from \"./useResolvedDensity\";\r\nexport { default as useSortedRows } from \"./useSortedRows\";\r\nexport { default as useFormAutoSave } from \"./useFormAutoSave\";\r\nexport { default as useFormCompletionProgress } from \"./useFormCompletionProgress\";\r\nexport {\r\n default as useFocusFirstError,\r\n focusFieldByName,\r\n} from \"./useFocusFirstError\";\r\nexport type {\r\n FocusFieldOptions,\r\n UseFocusFirstErrorOptions,\r\n} from \"./useFocusFirstError\";\r\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,YAAY,QAAQ,gBAAgB;AACxD,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","useFocusTrap","useKeyboardShortcuts","useTabLoading","PERCEPTION_THRESHOLD_MS","useDelayedFlag","useDebouncedCallback","useAppliedFilters","usePrefersReducedMotion","PREFERS_REDUCED_MOTION_QUERY","useDensity","useResolvedDensity","useSortedRows","useFormAutoSave","useFormCompletionProgress","useFocusFirstError","focusFieldByName","useFocusOnRouteChange"],"sources":["../../../../src/lib/v2/hooks/index.ts"],"sourcesContent":["export { default as useFocusTrap } from \"./useFocusTrap\";\r\n/**\r\n * Raccourcis clavier de page — l'autre moitié de `KeyboardShortcutsHelp`\r\n * (gap G-48).\r\n *\r\n * La library possédait les DEUX BOUTS et pas l'écouteur entre eux : le\r\n * dialogue « ? » qui LISTE les raccourcis, et l'attribut\r\n * `data-v2-overlay-open` qu'elle POSE sur le `body` et que les raccourcis\r\n * doivent respecter.\r\n *\r\n * Un hôte qui les câblait devait donc lire cet attribut lui-même — un module\r\n * dépendant d'un détail d'implémentation du composant qu'il rend, et qui\r\n * casserait EN SILENCE s'il était renommé : les raccourcis se mettraient à\r\n * tirer derrière les modales ouvertes, ce que rien ne teste.\r\n *\r\n * Relevé depuis `addm-fe` (Area 14), dont les listings portaient un\r\n * `searchInputRef` déclaré et transmis POUR le raccourci « / » — un câblage\r\n * qui attendait un écouteur jamais écrit.\r\n */\r\nexport { default as useKeyboardShortcuts } from \"./useKeyboardShortcuts\";\r\nexport type {\r\n KeyboardShortcut,\r\n UseKeyboardShortcutsOptions,\r\n} from \"./useKeyboardShortcuts\";\r\nexport {\r\n default as useTabLoading,\r\n PERCEPTION_THRESHOLD_MS,\r\n} from \"./useTabLoading\";\r\nexport { default as useDelayedFlag } from \"./useDelayedFlag\";\r\n/**\r\n * Defers a CALL until the input settles — the companion `useDelayedFlag` is\r\n * not: that one flips a boolean after a delay. Gap G-39; see the file header\r\n * for the three defects the `lodash.debounce` era produced in every host.\r\n */\r\nexport { default as useDebouncedCallback } from \"./useDebouncedCallback\";\r\n/**\r\n * Tracks the criteria ACTUALLY applied to a listing (gap G-43), so chips\r\n * cannot announce a filter that is only being typed. Companion to\r\n * `buildFilterChips`. Promoted from `refonte-frontend` (Area 5).\r\n */\r\nexport {\r\n default as useAppliedFilters,\r\n} from \"./useAppliedFilters\";\r\nexport type {\r\n AppliedFiltersForm,\r\n UseAppliedFiltersOptions,\r\n UseAppliedFiltersResult,\r\n} from \"./useAppliedFilters\";\r\n/**\r\n * Runtime read of `prefers-reduced-motion` (gap G-49), for animation the\r\n * library does not own — charts, canvases, imperative scroll, third-party\r\n * widgets configured in JS. CSS cannot answer those, so every host wrote the\r\n * same one-line snapshot helper, which never subscribed: turning the\r\n * preference on left the animations running. See the file header.\r\n */\r\nexport { default as usePrefersReducedMotion } from \"./usePrefersReducedMotion\";\r\nexport { PREFERS_REDUCED_MOTION_QUERY } from \"./usePrefersReducedMotion\";\r\nexport { default as useDensity } from \"./useDensity\";\r\nexport { default as useResolvedDensity } from \"./useResolvedDensity\";\r\nexport { default as useSortedRows } from \"./useSortedRows\";\r\nexport { default as useFormAutoSave } from \"./useFormAutoSave\";\r\nexport { default as useFormCompletionProgress } from \"./useFormCompletionProgress\";\r\nexport {\r\n default as useFocusFirstError,\r\n focusFieldByName,\r\n} from \"./useFocusFirstError\";\r\nexport type {\r\n FocusFieldOptions,\r\n UseFocusFirstErrorOptions,\r\n} from \"./useFocusFirstError\";\r\n/**\r\n * Déplace le focus sur le landmark principal à chaque changement de PAGE\r\n * (gap G-60).\r\n *\r\n * Dans une application à page unique, naviguer ne déplace PAS le focus — le\r\n * navigateur ne le fait qu'au chargement d'un vrai document. Le focus reste\r\n * donc sur ce qui a été cliqué, ou tombe sur `document.body` quand cet élément\r\n * est démonté par la navigation qu'il vient de déclencher. Depuis `body`, le\r\n * Tab suivant repart du haut du NAVIGATEUR : l'utilisateur au clavier retraverse\r\n * la barre d'adresse à chaque écran, et le lecteur d'écran n'annonce rien.\r\n *\r\n * Agnostique du routeur : l'hôte passe la clé qu'il veut surveiller — et doit\r\n * passer le CHEMIN, pas `location.key`, sinon un changement de filtre dans la\r\n * query string vole le focus au champ en cours de saisie.\r\n *\r\n * La library est le bon endroit même sans connaître de routeur : `AppMain` est\r\n * la cible, et c'est lui qui porte le `tabIndex={-1}` qui rend la région\r\n * focalisable. Relevé depuis `autorisation-admis-pour-conforme-fe` (Area 10),\r\n * où archiver un dossier ferme un dialogue et navigue en arrière — le piège de\r\n * focus restituant alors le focus à un bouton qui n'existe plus.\r\n */\r\nexport { default as useFocusOnRouteChange } from \"./useFocusOnRouteChange\";\r\nexport type { UseFocusOnRouteChangeOptions } from \"./useFocusOnRouteChange\";\r\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,YAAY,QAAQ,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASD,OAAO,IAAIE,oBAAoB,QAAQ,wBAAwB;AAKxE,SACEF,OAAO,IAAIG,aAAa,EACxBC,uBAAuB,QAClB,iBAAiB;AACxB,SAASJ,OAAO,IAAIK,cAAc,QAAQ,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA,SAASL,OAAO,IAAIM,oBAAoB,QAAQ,wBAAwB;AACxE;AACA;AACA;AACA;AACA;AACA,SACEN,OAAO,IAAIO,iBAAiB,QACvB,qBAAqB;AAM5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASP,OAAO,IAAIQ,uBAAuB,QAAQ,2BAA2B;AAC9E,SAASC,4BAA4B,QAAQ,2BAA2B;AACxE,SAAST,OAAO,IAAIU,UAAU,QAAQ,cAAc;AACpD,SAASV,OAAO,IAAIW,kBAAkB,QAAQ,sBAAsB;AACpE,SAASX,OAAO,IAAIY,aAAa,QAAQ,iBAAiB;AAC1D,SAASZ,OAAO,IAAIa,eAAe,QAAQ,mBAAmB;AAC9D,SAASb,OAAO,IAAIc,yBAAyB,QAAQ,6BAA6B;AAClF,SACEd,OAAO,IAAIe,kBAAkB,EAC7BC,gBAAgB,QACX,sBAAsB;AAK7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAShB,OAAO,IAAIiB,qBAAqB,QAAQ,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useAppliedFilters — tracks the criteria ACTUALLY applied to a listing
|
|
5
|
+
* (capability gap G-43).
|
|
6
|
+
*
|
|
7
|
+
* Companion to `buildFilterChips`: that one builds the chips, this one decides
|
|
8
|
+
* what they are allowed to show.
|
|
9
|
+
*
|
|
10
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
* THE DEFECT IT PREVENTS — AND IT WAS SHIPPED TWICE BEFORE BEING UNDERSTOOD
|
|
12
|
+
*
|
|
13
|
+
* Chips CANNOT be built from live form values. `DataGridToolbar`'s search input
|
|
14
|
+
* writes into them ON EVERY KEYSTROKE, so a chip "Référence : ABC" appears
|
|
15
|
+
* while the user is still typing — announcing an active criterion that filters
|
|
16
|
+
* nothing. Active criteria are the ones filtering the DISPLAYED list.
|
|
17
|
+
*
|
|
18
|
+
* Two distinct states are therefore required, and the split is counter-intuitive
|
|
19
|
+
* enough that it was got wrong twice: form values track TYPING, this snapshot
|
|
20
|
+
* tracks APPLICATION.
|
|
21
|
+
*
|
|
22
|
+
* The mirror-image defect is just as real: a snapshot left full after a "clear
|
|
23
|
+
* criteria" shows chips for criteria that no longer filter anything. Both
|
|
24
|
+
* failures are one forgotten line away, in opposite directions — which is the
|
|
25
|
+
* argument for one hook rather than three lines per screen.
|
|
26
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
27
|
+
*
|
|
28
|
+
* IT BUILDS NO PAYLOAD. Every screen has its own — key names, scope flags, page
|
|
29
|
+
* value — and `onRemove` hands the turn back with the REMAINING criteria. This
|
|
30
|
+
* hook knows only the cycle typing → application → removal.
|
|
31
|
+
*
|
|
32
|
+
* `setApplied`: THE THREE PATHS THAT BYPASS `apply()`. The snapshot is not only
|
|
33
|
+
* filled by a click on "Search". Three other gestures change what actually
|
|
34
|
+
* filters the list, and each one used to leave the chips lying:
|
|
35
|
+
*
|
|
36
|
+
* 1. RESTORING A SAVED FILTER. `SavedFiltersMenu` re-injects values and
|
|
37
|
+
* payload: the list is filtered, the snapshot stays empty, so NO chip
|
|
38
|
+
* appears. Observed on a real screen before this existed.
|
|
39
|
+
* 2. CLICKING A STATUS CHIP. Screens with `FilterTab` write the payload
|
|
40
|
+
* directly — on purpose, to avoid the async `setFieldValue` followed by a
|
|
41
|
+
* submit that reads the previous render's values. Without updating the
|
|
42
|
+
* snapshot, a later chip removal rebuilds the payload from a stale
|
|
43
|
+
* snapshot and LOSES the active status.
|
|
44
|
+
* 3. Any other direct payload write by the screen.
|
|
45
|
+
*
|
|
46
|
+
* Hence a function that SETS the snapshot, distinct from the one that freezes it
|
|
47
|
+
* from the form. The screen alone knows when what-filters has changed; the hook
|
|
48
|
+
* cannot guess it.
|
|
49
|
+
*
|
|
50
|
+
* Promoted from `refonte-frontend` (Area 5), where three listings consumed it.
|
|
51
|
+
*
|
|
52
|
+
* WHAT WAS NOT PROMOTED WITH IT. The original exported a ready-made
|
|
53
|
+
* `videAvecMiroirsNumeriques` helper — "id mirrors clear to `0`, everything
|
|
54
|
+
* else to `""`" — and a measurement of its call sites found NONE: the three
|
|
55
|
+
* hosts each passed their own inline strategy, and they disagree (`0` / `null`
|
|
56
|
+
* / `""`, per field). Codifying one of the three as the library's convention
|
|
57
|
+
* would have blessed a rule no host follows, and the disagreement is exactly
|
|
58
|
+
* why `emptyValueFor` is a parameter rather than a constant.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/** What a search form must expose to this hook — Formik satisfies it. */
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Explicit return type: §Hooks requires it ("Every hook must expose explicit
|
|
65
|
+
* return types"), and inference left this surface implicit while four screens
|
|
66
|
+
* consumed it.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export default function useAppliedFilters(form, options) {
|
|
70
|
+
const [appliedFilters, setAppliedFilters] = useState({});
|
|
71
|
+
const empty = options.emptyValueFor ?? (() => null);
|
|
72
|
+
return {
|
|
73
|
+
appliedFilters,
|
|
74
|
+
apply: () => {
|
|
75
|
+
setAppliedFilters({
|
|
76
|
+
...form.values
|
|
77
|
+
});
|
|
78
|
+
options.onApply();
|
|
79
|
+
},
|
|
80
|
+
resetAll: () => {
|
|
81
|
+
setAppliedFilters({});
|
|
82
|
+
options.onReset();
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Clears the fields and the snapshot, then hands the turn back so the
|
|
86
|
+
* screen can rebuild its payload.
|
|
87
|
+
*
|
|
88
|
+
* The payload is rebuilt from the AMPUTATED SNAPSHOT, never re-read from
|
|
89
|
+
* the form afterwards: `setFieldValue` is asynchronous, so reading values
|
|
90
|
+
* back would give the criteria as they were BEFORE the removal.
|
|
91
|
+
*/
|
|
92
|
+
removeCriteria: keys => {
|
|
93
|
+
keys.forEach(key => {
|
|
94
|
+
void form.setFieldValue(key, empty(key));
|
|
95
|
+
});
|
|
96
|
+
const remaining = {
|
|
97
|
+
...appliedFilters
|
|
98
|
+
};
|
|
99
|
+
keys.forEach(key => {
|
|
100
|
+
remaining[key] = empty(key);
|
|
101
|
+
});
|
|
102
|
+
setAppliedFilters(remaining);
|
|
103
|
+
options.onRemove(remaining);
|
|
104
|
+
},
|
|
105
|
+
setApplied: values => {
|
|
106
|
+
setAppliedFilters({
|
|
107
|
+
...values
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=useAppliedFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppliedFilters.js","names":["useState","useAppliedFilters","form","options","appliedFilters","setAppliedFilters","empty","emptyValueFor","apply","values","onApply","resetAll","onReset","removeCriteria","keys","forEach","key","setFieldValue","remaining","onRemove","setApplied"],"sources":["../../../../src/lib/v2/hooks/useAppliedFilters.ts"],"sourcesContent":["import { useState } from \"react\";\r\n\r\n/**\r\n * useAppliedFilters — tracks the criteria ACTUALLY applied to a listing\r\n * (capability gap G-43).\r\n *\r\n * Companion to `buildFilterChips`: that one builds the chips, this one decides\r\n * what they are allowed to show.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * THE DEFECT IT PREVENTS — AND IT WAS SHIPPED TWICE BEFORE BEING UNDERSTOOD\r\n *\r\n * Chips CANNOT be built from live form values. `DataGridToolbar`'s search input\r\n * writes into them ON EVERY KEYSTROKE, so a chip \"Référence : ABC\" appears\r\n * while the user is still typing — announcing an active criterion that filters\r\n * nothing. Active criteria are the ones filtering the DISPLAYED list.\r\n *\r\n * Two distinct states are therefore required, and the split is counter-intuitive\r\n * enough that it was got wrong twice: form values track TYPING, this snapshot\r\n * tracks APPLICATION.\r\n *\r\n * The mirror-image defect is just as real: a snapshot left full after a \"clear\r\n * criteria\" shows chips for criteria that no longer filter anything. Both\r\n * failures are one forgotten line away, in opposite directions — which is the\r\n * argument for one hook rather than three lines per screen.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * IT BUILDS NO PAYLOAD. Every screen has its own — key names, scope flags, page\r\n * value — and `onRemove` hands the turn back with the REMAINING criteria. This\r\n * hook knows only the cycle typing → application → removal.\r\n *\r\n * `setApplied`: THE THREE PATHS THAT BYPASS `apply()`. The snapshot is not only\r\n * filled by a click on \"Search\". Three other gestures change what actually\r\n * filters the list, and each one used to leave the chips lying:\r\n *\r\n * 1. RESTORING A SAVED FILTER. `SavedFiltersMenu` re-injects values and\r\n * payload: the list is filtered, the snapshot stays empty, so NO chip\r\n * appears. Observed on a real screen before this existed.\r\n * 2. CLICKING A STATUS CHIP. Screens with `FilterTab` write the payload\r\n * directly — on purpose, to avoid the async `setFieldValue` followed by a\r\n * submit that reads the previous render's values. Without updating the\r\n * snapshot, a later chip removal rebuilds the payload from a stale\r\n * snapshot and LOSES the active status.\r\n * 3. Any other direct payload write by the screen.\r\n *\r\n * Hence a function that SETS the snapshot, distinct from the one that freezes it\r\n * from the form. The screen alone knows when what-filters has changed; the hook\r\n * cannot guess it.\r\n *\r\n * Promoted from `refonte-frontend` (Area 5), where three listings consumed it.\r\n *\r\n * WHAT WAS NOT PROMOTED WITH IT. The original exported a ready-made\r\n * `videAvecMiroirsNumeriques` helper — \"id mirrors clear to `0`, everything\r\n * else to `\"\"`\" — and a measurement of its call sites found NONE: the three\r\n * hosts each passed their own inline strategy, and they disagree (`0` / `null`\r\n * / `\"\"`, per field). Codifying one of the three as the library's convention\r\n * would have blessed a rule no host follows, and the disagreement is exactly\r\n * why `emptyValueFor` is a parameter rather than a constant.\r\n */\r\n\r\n/** What a search form must expose to this hook — Formik satisfies it. */\r\nexport interface AppliedFiltersForm {\r\n values: Record<string, unknown>;\r\n setFieldValue: (\r\n field: string,\r\n value: unknown,\r\n shouldValidate?: boolean\r\n ) => unknown;\r\n}\r\n\r\nexport interface UseAppliedFiltersOptions {\r\n /** Applies the current search (the screen's existing function). */\r\n onApply: () => void;\r\n /** Resets the search (the screen's existing function). */\r\n onReset: () => void;\r\n /**\r\n * Rebuilds and re-runs the payload after a removal, from the REMAINING\r\n * criteria. Only the screen knows the shape of its payload.\r\n */\r\n onRemove: (remaining: Record<string, unknown>) => void;\r\n /**\r\n * The value that means \"empty\" for a given field. Hosts disagree, and the\r\n * disagreement is legitimate: some clear to `null`, others to `\"\"`, and\r\n * reference-id mirrors to `0`. A convention imposed here would have broken\r\n * half the payloads. @default `null`\r\n */\r\n emptyValueFor?: ((key: string) => unknown) | undefined;\r\n}\r\n\r\n/**\r\n * Explicit return type: §Hooks requires it (\"Every hook must expose explicit\r\n * return types\"), and inference left this surface implicit while four screens\r\n * consumed it.\r\n */\r\nexport interface UseAppliedFiltersResult {\r\n /** Criteria ACTUALLY applied to the displayed list. */\r\n appliedFilters: Record<string, unknown>;\r\n /** Freezes the snapshot from the form, then runs the screen's search. */\r\n apply: () => void;\r\n /** Clears the snapshot, then resets the screen. */\r\n resetAll: () => void;\r\n /** Removes one or more criteria and hands the turn back to `onRemove`. */\r\n removeCriteria: (keys: string[]) => void;\r\n /**\r\n * Sets the snapshot from values SUPPLIED by the screen, for the three paths\r\n * that bypass `apply` — see the note above.\r\n */\r\n setApplied: (values: Record<string, unknown>) => void;\r\n}\r\n\r\nexport default function useAppliedFilters(\r\n form: AppliedFiltersForm,\r\n options: UseAppliedFiltersOptions\r\n): UseAppliedFiltersResult {\r\n const [appliedFilters, setAppliedFilters] = useState<Record<string, unknown>>(\r\n {}\r\n );\r\n\r\n const empty = options.emptyValueFor ?? (() => null);\r\n\r\n return {\r\n appliedFilters,\r\n\r\n apply: () => {\r\n setAppliedFilters({ ...form.values });\r\n options.onApply();\r\n },\r\n\r\n resetAll: () => {\r\n setAppliedFilters({});\r\n options.onReset();\r\n },\r\n\r\n /**\r\n * Clears the fields and the snapshot, then hands the turn back so the\r\n * screen can rebuild its payload.\r\n *\r\n * The payload is rebuilt from the AMPUTATED SNAPSHOT, never re-read from\r\n * the form afterwards: `setFieldValue` is asynchronous, so reading values\r\n * back would give the criteria as they were BEFORE the removal.\r\n */\r\n removeCriteria: (keys: string[]) => {\r\n keys.forEach((key) => {\r\n void form.setFieldValue(key, empty(key));\r\n });\r\n const remaining: Record<string, unknown> = { ...appliedFilters };\r\n keys.forEach((key) => {\r\n remaining[key] = empty(key);\r\n });\r\n setAppliedFilters(remaining);\r\n options.onRemove(remaining);\r\n },\r\n\r\n setApplied: (values: Record<string, unknown>) => {\r\n setAppliedFilters({ ...values });\r\n },\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,OAAO;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AA6BA;AACA;AACA;AACA;AACA;;AAiBA,eAAe,SAASC,iBAAiBA,CACvCC,IAAwB,EACxBC,OAAiC,EACR;EACzB,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGL,QAAQ,CAClD,CAAC,CACH,CAAC;EAED,MAAMM,KAAK,GAAGH,OAAO,CAACI,aAAa,KAAK,MAAM,IAAI,CAAC;EAEnD,OAAO;IACLH,cAAc;IAEdI,KAAK,EAAEA,CAAA,KAAM;MACXH,iBAAiB,CAAC;QAAE,GAAGH,IAAI,CAACO;MAAO,CAAC,CAAC;MACrCN,OAAO,CAACO,OAAO,CAAC,CAAC;IACnB,CAAC;IAEDC,QAAQ,EAAEA,CAAA,KAAM;MACdN,iBAAiB,CAAC,CAAC,CAAC,CAAC;MACrBF,OAAO,CAACS,OAAO,CAAC,CAAC;IACnB,CAAC;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,cAAc,EAAGC,IAAc,IAAK;MAClCA,IAAI,CAACC,OAAO,CAAEC,GAAG,IAAK;QACpB,KAAKd,IAAI,CAACe,aAAa,CAACD,GAAG,EAAEV,KAAK,CAACU,GAAG,CAAC,CAAC;MAC1C,CAAC,CAAC;MACF,MAAME,SAAkC,GAAG;QAAE,GAAGd;MAAe,CAAC;MAChEU,IAAI,CAACC,OAAO,CAAEC,GAAG,IAAK;QACpBE,SAAS,CAACF,GAAG,CAAC,GAAGV,KAAK,CAACU,GAAG,CAAC;MAC7B,CAAC,CAAC;MACFX,iBAAiB,CAACa,SAAS,CAAC;MAC5Bf,OAAO,CAACgB,QAAQ,CAACD,SAAS,CAAC;IAC7B,CAAC;IAEDE,UAAU,EAAGX,MAA+B,IAAK;MAC/CJ,iBAAiB,CAAC;QAAE,GAAGI;MAAO,CAAC,CAAC;IAClC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useDebouncedCallback — defer a call until the input settles
|
|
5
|
+
* (capability gap G-39).
|
|
6
|
+
*
|
|
7
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
8
|
+
* WHY THIS BELONGS IN THE LIBRARY
|
|
9
|
+
*
|
|
10
|
+
* §Search of the Platform Mandatory UX Patterns makes "instant filtering" a
|
|
11
|
+
* MUST on every listing, and R-Pp/§Performance forbid paying for it with a
|
|
12
|
+
* request per keystroke. Between those two rules sits a debounce — needed by
|
|
13
|
+
* every search field, every referential lookup, every quick-filter in the
|
|
14
|
+
* fleet — and the library shipped `useDelayedFlag` (a boolean that turns on
|
|
15
|
+
* after a delay) and `useTabLoading`, neither of which defers a CALL.
|
|
16
|
+
*
|
|
17
|
+
* So each host reached for `lodash.debounce`, and the three defects that
|
|
18
|
+
* followed were the same everywhere. Promoted from `refonte-frontend` (Area 5),
|
|
19
|
+
* where its own header recorded them:
|
|
20
|
+
*
|
|
21
|
+
* 1. NO TYPES on the package (TS7016), whose two usual workarounds are both
|
|
22
|
+
* forbidden here — an extra dependency for ten lines, or a
|
|
23
|
+
* `declare module` that makes the import `any`.
|
|
24
|
+
* 2. THE DEBOUNCE DID NOT DEBOUNCE. `debounce(...)` was called in the render
|
|
25
|
+
* body, so every keystroke built a NEW instance with its own timer; the
|
|
26
|
+
* previous one was orphaned but still fired. The result was not
|
|
27
|
+
* coalescing — it was a delay applied to every character, i.e. one
|
|
28
|
+
* request per keystroke, arriving late.
|
|
29
|
+
* 3. NOTHING CANCELLED THE TIMER ON UNMOUNT, so switching tab produced a
|
|
30
|
+
* `setState` on an unmounted component.
|
|
31
|
+
*
|
|
32
|
+
* >>> DEFECT 2 IS WHY THIS IS A LIBRARY CONCERN AND NOT A SNIPPET. It is
|
|
33
|
+
* >>> invisible in review — the call site reads exactly like a correct one —
|
|
34
|
+
* >>> and invisible in use, because the feature still works. Only the network
|
|
35
|
+
* >>> panel shows it. A hook cannot be misused that way: the identity below is
|
|
36
|
+
* >>> stable by construction, so there is no per-render instance to orphan. <<<
|
|
37
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
38
|
+
*
|
|
39
|
+
* WHY `action` GOES THROUGH A REF. Callers naturally pass an inline arrow
|
|
40
|
+
* (`(v) => { setPage(0); setSearch(v); }`), so its identity is new on every
|
|
41
|
+
* render. Holding it in a ref keeps the returned trigger STABLE — without
|
|
42
|
+
* which the trigger would change every render and defect 2 would be back, one
|
|
43
|
+
* level up — while still invoking the LATEST action rather than a stale
|
|
44
|
+
* closure.
|
|
45
|
+
*
|
|
46
|
+
* Only `delay` is a dependency of the returned callback. Changing it mid-flight
|
|
47
|
+
* does not reschedule a pending call; the next trigger uses the new delay.
|
|
48
|
+
*
|
|
49
|
+
* Usage:
|
|
50
|
+
*
|
|
51
|
+
* const onSearchChange = useDebouncedCallback<string>((value) => {
|
|
52
|
+
* setPage(0);
|
|
53
|
+
* dispatch(search(value));
|
|
54
|
+
* });
|
|
55
|
+
* <Input onChange={(e) => onSearchChange(e.target.value)} />
|
|
56
|
+
*
|
|
57
|
+
* @param action what to do once the input has settled
|
|
58
|
+
* @param delay milliseconds. Defaults to 500 — the value the promoted
|
|
59
|
+
* implementation already shipped, kept deliberately: every
|
|
60
|
+
* existing call site relies on the default, and lowering it here
|
|
61
|
+
* would silently increase the request rate of nine listings
|
|
62
|
+
* while looking like a tidy-up. R-1.1's 100 ms feedback promise
|
|
63
|
+
* is met by the field's own visual state, not by this call.
|
|
64
|
+
*/
|
|
65
|
+
export default function useDebouncedCallback(action, delay = 500) {
|
|
66
|
+
const actionRef = useRef(action);
|
|
67
|
+
const timer = useRef(null);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
actionRef.current = action;
|
|
70
|
+
}, [action]);
|
|
71
|
+
useEffect(() => () => {
|
|
72
|
+
if (timer.current !== null) clearTimeout(timer.current);
|
|
73
|
+
}, []);
|
|
74
|
+
return useCallback(value => {
|
|
75
|
+
if (timer.current !== null) clearTimeout(timer.current);
|
|
76
|
+
timer.current = setTimeout(() => {
|
|
77
|
+
timer.current = null;
|
|
78
|
+
actionRef.current(value);
|
|
79
|
+
}, delay);
|
|
80
|
+
}, [delay]);
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=useDebouncedCallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedCallback.js","names":["useCallback","useEffect","useRef","useDebouncedCallback","action","delay","actionRef","timer","current","clearTimeout","value","setTimeout"],"sources":["../../../../src/lib/v2/hooks/useDebouncedCallback.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\r\n\r\n/**\r\n * useDebouncedCallback — defer a call until the input settles\r\n * (capability gap G-39).\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY\r\n *\r\n * §Search of the Platform Mandatory UX Patterns makes \"instant filtering\" a\r\n * MUST on every listing, and R-Pp/§Performance forbid paying for it with a\r\n * request per keystroke. Between those two rules sits a debounce — needed by\r\n * every search field, every referential lookup, every quick-filter in the\r\n * fleet — and the library shipped `useDelayedFlag` (a boolean that turns on\r\n * after a delay) and `useTabLoading`, neither of which defers a CALL.\r\n *\r\n * So each host reached for `lodash.debounce`, and the three defects that\r\n * followed were the same everywhere. Promoted from `refonte-frontend` (Area 5),\r\n * where its own header recorded them:\r\n *\r\n * 1. NO TYPES on the package (TS7016), whose two usual workarounds are both\r\n * forbidden here — an extra dependency for ten lines, or a\r\n * `declare module` that makes the import `any`.\r\n * 2. THE DEBOUNCE DID NOT DEBOUNCE. `debounce(...)` was called in the render\r\n * body, so every keystroke built a NEW instance with its own timer; the\r\n * previous one was orphaned but still fired. The result was not\r\n * coalescing — it was a delay applied to every character, i.e. one\r\n * request per keystroke, arriving late.\r\n * 3. NOTHING CANCELLED THE TIMER ON UNMOUNT, so switching tab produced a\r\n * `setState` on an unmounted component.\r\n *\r\n * >>> DEFECT 2 IS WHY THIS IS A LIBRARY CONCERN AND NOT A SNIPPET. It is\r\n * >>> invisible in review — the call site reads exactly like a correct one —\r\n * >>> and invisible in use, because the feature still works. Only the network\r\n * >>> panel shows it. A hook cannot be misused that way: the identity below is\r\n * >>> stable by construction, so there is no per-render instance to orphan. <<<\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * WHY `action` GOES THROUGH A REF. Callers naturally pass an inline arrow\r\n * (`(v) => { setPage(0); setSearch(v); }`), so its identity is new on every\r\n * render. Holding it in a ref keeps the returned trigger STABLE — without\r\n * which the trigger would change every render and defect 2 would be back, one\r\n * level up — while still invoking the LATEST action rather than a stale\r\n * closure.\r\n *\r\n * Only `delay` is a dependency of the returned callback. Changing it mid-flight\r\n * does not reschedule a pending call; the next trigger uses the new delay.\r\n *\r\n * Usage:\r\n *\r\n * const onSearchChange = useDebouncedCallback<string>((value) => {\r\n * setPage(0);\r\n * dispatch(search(value));\r\n * });\r\n * <Input onChange={(e) => onSearchChange(e.target.value)} />\r\n *\r\n * @param action what to do once the input has settled\r\n * @param delay milliseconds. Defaults to 500 — the value the promoted\r\n * implementation already shipped, kept deliberately: every\r\n * existing call site relies on the default, and lowering it here\r\n * would silently increase the request rate of nine listings\r\n * while looking like a tidy-up. R-1.1's 100 ms feedback promise\r\n * is met by the field's own visual state, not by this call.\r\n */\r\nexport default function useDebouncedCallback<T>(\r\n action: (value: T) => void,\r\n delay = 500\r\n): (value: T) => void {\r\n const actionRef = useRef(action);\r\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n useEffect(() => {\r\n actionRef.current = action;\r\n }, [action]);\r\n\r\n useEffect(\r\n () => () => {\r\n if (timer.current !== null) clearTimeout(timer.current);\r\n },\r\n []\r\n );\r\n\r\n return useCallback(\r\n (value: T) => {\r\n if (timer.current !== null) clearTimeout(timer.current);\r\n timer.current = setTimeout(() => {\r\n timer.current = null;\r\n actionRef.current(value);\r\n }, delay);\r\n },\r\n [delay]\r\n );\r\n}\r\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAC1CC,MAA0B,EAC1BC,KAAK,GAAG,GAAG,EACS;EACpB,MAAMC,SAAS,GAAGJ,MAAM,CAACE,MAAM,CAAC;EAChC,MAAMG,KAAK,GAAGL,MAAM,CAAuC,IAAI,CAAC;EAEhED,SAAS,CAAC,MAAM;IACdK,SAAS,CAACE,OAAO,GAAGJ,MAAM;EAC5B,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZH,SAAS,CACP,MAAM,MAAM;IACV,IAAIM,KAAK,CAACC,OAAO,KAAK,IAAI,EAAEC,YAAY,CAACF,KAAK,CAACC,OAAO,CAAC;EACzD,CAAC,EACD,EACF,CAAC;EAED,OAAOR,WAAW,CACfU,KAAQ,IAAK;IACZ,IAAIH,KAAK,CAACC,OAAO,KAAK,IAAI,EAAEC,YAAY,CAACF,KAAK,CAACC,OAAO,CAAC;IACvDD,KAAK,CAACC,OAAO,GAAGG,UAAU,CAAC,MAAM;MAC/BJ,KAAK,CAACC,OAAO,GAAG,IAAI;MACpBF,SAAS,CAACE,OAAO,CAACE,KAAK,CAAC;IAC1B,CAAC,EAAEL,KAAK,CAAC;EACX,CAAC,EACD,CAACA,KAAK,CACR,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
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."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
1
|
import { useState, useEffect } from "react";
|
|
8
2
|
import { PERCEPTION_THRESHOLD_MS } from "./useTabLoading";
|
|
9
3
|
|
|
@@ -27,13 +21,9 @@ import { PERCEPTION_THRESHOLD_MS } from "./useTabLoading";
|
|
|
27
21
|
* (preserves across tab swap to avoid flicker between two
|
|
28
22
|
* consecutive skeletons), use `useTabLoading`.
|
|
29
23
|
*/
|
|
30
|
-
export default function useDelayedFlag(active) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
-
delayed = _useState2[0],
|
|
35
|
-
setDelayed = _useState2[1];
|
|
36
|
-
useEffect(function () {
|
|
24
|
+
export default function useDelayedFlag(active, delayMs = PERCEPTION_THRESHOLD_MS) {
|
|
25
|
+
const [delayed, setDelayed] = useState(false);
|
|
26
|
+
useEffect(() => {
|
|
37
27
|
if (!active) {
|
|
38
28
|
// Inactive — drop any in-flight delayed flag immediately so
|
|
39
29
|
// the consumer can render the success path without waiting.
|
|
@@ -43,12 +33,8 @@ export default function useDelayedFlag(active) {
|
|
|
43
33
|
// Schedule the flag flip. If `active` resolves false before the
|
|
44
34
|
// timer fires, cleanup clears the timer and the flag never goes
|
|
45
35
|
// true (the perception-threshold contract).
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, delayMs);
|
|
49
|
-
return function () {
|
|
50
|
-
return clearTimeout(t);
|
|
51
|
-
};
|
|
36
|
+
const t = setTimeout(() => setDelayed(true), delayMs);
|
|
37
|
+
return () => clearTimeout(t);
|
|
52
38
|
}, [active, delayMs]);
|
|
53
39
|
return delayed;
|
|
54
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDelayedFlag.js","names":["useState","useEffect","PERCEPTION_THRESHOLD_MS","useDelayedFlag","active","delayMs","
|
|
1
|
+
{"version":3,"file":"useDelayedFlag.js","names":["useState","useEffect","PERCEPTION_THRESHOLD_MS","useDelayedFlag","active","delayMs","delayed","setDelayed","undefined","t","setTimeout","clearTimeout"],"sources":["../../../../src/lib/v2/hooks/useDelayedFlag.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\r\nimport { PERCEPTION_THRESHOLD_MS } from \"./useTabLoading\";\r\n\r\n/**\r\n * useDelayedFlag — Portnet UI v2\r\n *\r\n * Returns `true` only when `active` has been continuously true for\r\n * at least `delayMs` ms. Resets to `false` the moment `active` flips\r\n * back to false. Charter R-Sk.1 — perception threshold.\r\n *\r\n * const showSkeleton = useDelayedFlag(loading);\r\n * if (showSkeleton) return <Skeleton />;\r\n * if (loading) return null; // sub-threshold, render nothing\r\n * return <Data rows={rows} />;\r\n *\r\n * Use when:\r\n * - You want to delay showing a loading affordance (skeleton,\r\n * spinner overlay, \"Loading…\" text) until the user actually\r\n * perceives the wait.\r\n * - The flag has no tab/key semantics. For tab-aware loading\r\n * (preserves across tab swap to avoid flicker between two\r\n * consecutive skeletons), use `useTabLoading`.\r\n */\r\nexport default function useDelayedFlag(\r\n active: boolean,\r\n delayMs: number = PERCEPTION_THRESHOLD_MS\r\n): boolean {\r\n const [delayed, setDelayed] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!active) {\r\n // Inactive — drop any in-flight delayed flag immediately so\r\n // the consumer can render the success path without waiting.\r\n setDelayed(false);\r\n return undefined;\r\n }\r\n // Schedule the flag flip. If `active` resolves false before the\r\n // timer fires, cleanup clears the timer and the flag never goes\r\n // true (the perception-threshold contract).\r\n const t = setTimeout(() => setDelayed(true), delayMs);\r\n return () => clearTimeout(t);\r\n }, [active, delayMs]);\r\n\r\n return delayed;\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,SAASC,uBAAuB,QAAQ,iBAAiB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,cAAcA,CACpCC,MAAe,EACfC,OAAe,GAAGH,uBAAuB,EAChC;EACT,MAAM,CAACI,OAAO,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAAC,KAAK,CAAC;EAE7CC,SAAS,CAAC,MAAM;IACd,IAAI,CAACG,MAAM,EAAE;MACX;MACA;MACAG,UAAU,CAAC,KAAK,CAAC;MACjB,OAAOC,SAAS;IAClB;IACA;IACA;IACA;IACA,MAAMC,CAAC,GAAGC,UAAU,CAAC,MAAMH,UAAU,CAAC,IAAI,CAAC,EAAEF,OAAO,CAAC;IACrD,OAAO,MAAMM,YAAY,CAACF,CAAC,CAAC;EAC9B,CAAC,EAAE,CAACL,MAAM,EAAEC,OAAO,CAAC,CAAC;EAErB,OAAOC,OAAO;AAChB","ignoreList":[]}
|
|
@@ -20,10 +20,10 @@ import { useSyncExternalStore } from "react";
|
|
|
20
20
|
* storage interactions are guarded.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const STORAGE_KEY = "portnet-ui-density";
|
|
24
|
+
const DEFAULT = "comfortable";
|
|
25
|
+
const VALID = Object.freeze(["comfortable", "compact"]);
|
|
26
|
+
const VALID_SET = new Set(VALID);
|
|
27
27
|
function isDensityPref(v) {
|
|
28
28
|
return typeof v === "string" && VALID_SET.has(v);
|
|
29
29
|
}
|
|
@@ -31,16 +31,16 @@ function isDensityPref(v) {
|
|
|
31
31
|
/* ── Module-level store ───────────────────────────────── */
|
|
32
32
|
|
|
33
33
|
/** Source of truth. Lazy-read from storage at module load on the client. */
|
|
34
|
-
|
|
34
|
+
let memoryValue = readInitialValue();
|
|
35
35
|
|
|
36
36
|
/** Active hook subscribers — notified on every value change. */
|
|
37
|
-
|
|
37
|
+
const subscribers = new Set();
|
|
38
38
|
function readInitialValue() {
|
|
39
39
|
if (typeof window === "undefined") return DEFAULT;
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
42
42
|
return isDensityPref(raw) ? raw : DEFAULT;
|
|
43
|
-
} catch
|
|
43
|
+
} catch {
|
|
44
44
|
return DEFAULT;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -55,7 +55,7 @@ applyToDom(memoryValue);
|
|
|
55
55
|
/* Cross-tab sync. The `storage` event fires in OTHER tabs only —
|
|
56
56
|
* the writing tab is informed via the in-memory subscribers path. */
|
|
57
57
|
if (typeof window !== "undefined") {
|
|
58
|
-
window.addEventListener("storage",
|
|
58
|
+
window.addEventListener("storage", e => {
|
|
59
59
|
if (e.key !== STORAGE_KEY) return;
|
|
60
60
|
if (!isDensityPref(e.newValue)) return;
|
|
61
61
|
if (e.newValue === memoryValue) return;
|
|
@@ -68,16 +68,11 @@ if (typeof window !== "undefined") {
|
|
|
68
68
|
function notify() {
|
|
69
69
|
// Iterate a snapshot — a subscriber that unmounts during notify
|
|
70
70
|
// would otherwise mutate the Set under iteration.
|
|
71
|
-
for (
|
|
72
|
-
var cb = _Array$from[_i];
|
|
73
|
-
cb();
|
|
74
|
-
}
|
|
71
|
+
for (const cb of Array.from(subscribers)) cb();
|
|
75
72
|
}
|
|
76
73
|
function subscribe(callback) {
|
|
77
74
|
subscribers.add(callback);
|
|
78
|
-
return
|
|
79
|
-
return subscribers["delete"](callback);
|
|
80
|
-
};
|
|
75
|
+
return () => subscribers.delete(callback);
|
|
81
76
|
}
|
|
82
77
|
function getSnapshot() {
|
|
83
78
|
return memoryValue;
|
|
@@ -104,6 +99,7 @@ function setDensityValue(value) {
|
|
|
104
99
|
} catch (err) {
|
|
105
100
|
// Quota, private mode, or sandboxed iframe — preference is
|
|
106
101
|
// applied for this session but won't persist. Surface in dev.
|
|
102
|
+
// eslint-disable-next-line no-console
|
|
107
103
|
if (typeof console !== "undefined" && console.warn) {
|
|
108
104
|
// eslint-disable-next-line no-console
|
|
109
105
|
console.warn("[@portnet/ui v2] useDensity: localStorage write failed", err);
|
|
@@ -113,7 +109,7 @@ function setDensityValue(value) {
|
|
|
113
109
|
notify();
|
|
114
110
|
}
|
|
115
111
|
export default function useDensity() {
|
|
116
|
-
|
|
112
|
+
const density = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
117
113
|
return [density, setDensityValue];
|
|
118
114
|
}
|
|
119
115
|
//# sourceMappingURL=useDensity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDensity.js","names":["useSyncExternalStore","STORAGE_KEY","DEFAULT","VALID","Object","freeze","VALID_SET","Set","isDensityPref","v","has","memoryValue","readInitialValue","subscribers","window","raw","localStorage","getItem","
|
|
1
|
+
{"version":3,"file":"useDensity.js","names":["useSyncExternalStore","STORAGE_KEY","DEFAULT","VALID","Object","freeze","VALID_SET","Set","isDensityPref","v","has","memoryValue","readInitialValue","subscribers","window","raw","localStorage","getItem","applyToDom","value","document","documentElement","dataset","addEventListener","e","key","newValue","notify","cb","Array","from","subscribe","callback","add","delete","getSnapshot","getServerSnapshot","setDensityValue","setItem","err","console","warn","useDensity","density"],"sources":["../../../../src/lib/v2/hooks/useDensity.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\r\n\r\n/**\r\n * useDensity — Portnet UI v2\r\n *\r\n * Reads / writes the user's density preference (charter R-DG.11).\r\n * Applies it as `data-density` on <html> so all density-aware\r\n * tokens cascade.\r\n *\r\n * const [density, setDensity] = useDensity();\r\n * <button onClick={() => setDensity(density === \"compact\" ? \"comfortable\" : \"compact\")} />\r\n *\r\n * Synchronisation guarantees\r\n * - Multi-instance same-tab: every useDensity() consumer sees\r\n * the same value at all times. Implemented via a module-level\r\n * subscriber set fed by useSyncExternalStore.\r\n * - Cross-tab: a `storage` event listener at module load\r\n * propagates updates from sibling tabs sharing the origin.\r\n * - SSR-safe: server snapshot returns the DEFAULT; all DOM and\r\n * storage interactions are guarded.\r\n */\r\n\r\ntype DensityPref = \"comfortable\" | \"compact\";\r\n\r\nconst STORAGE_KEY = \"portnet-ui-density\";\r\nconst DEFAULT: DensityPref = \"comfortable\";\r\nconst VALID = Object.freeze([\"comfortable\", \"compact\"]);\r\nconst VALID_SET = new Set<string>(VALID);\r\n\r\nfunction isDensityPref(v: unknown): v is DensityPref {\r\n return typeof v === \"string\" && VALID_SET.has(v);\r\n}\r\n\r\n/* ── Module-level store ───────────────────────────────── */\r\n\r\n/** Source of truth. Lazy-read from storage at module load on the client. */\r\nlet memoryValue: DensityPref = readInitialValue();\r\n\r\n/** Active hook subscribers — notified on every value change. */\r\nconst subscribers = new Set<() => void>();\r\n\r\nfunction readInitialValue(): DensityPref {\r\n if (typeof window === \"undefined\") return DEFAULT;\r\n try {\r\n const raw = window.localStorage.getItem(STORAGE_KEY);\r\n return isDensityPref(raw) ? raw : DEFAULT;\r\n } catch {\r\n return DEFAULT;\r\n }\r\n}\r\n\r\nfunction applyToDom(value: DensityPref): void {\r\n if (typeof document === \"undefined\") return;\r\n document.documentElement.dataset[\"density\"] = value;\r\n}\r\n\r\n/** Apply the initial value to the DOM at module load (client-side). */\r\napplyToDom(memoryValue);\r\n\r\n/* Cross-tab sync. The `storage` event fires in OTHER tabs only —\r\n * the writing tab is informed via the in-memory subscribers path. */\r\nif (typeof window !== \"undefined\") {\r\n window.addEventListener(\"storage\", (e) => {\r\n if (e.key !== STORAGE_KEY) return;\r\n if (!isDensityPref(e.newValue)) return;\r\n if (e.newValue === memoryValue) return;\r\n memoryValue = e.newValue;\r\n applyToDom(memoryValue);\r\n // No storage write here — the originating tab already wrote.\r\n notify();\r\n });\r\n}\r\n\r\nfunction notify(): void {\r\n // Iterate a snapshot — a subscriber that unmounts during notify\r\n // would otherwise mutate the Set under iteration.\r\n for (const cb of Array.from(subscribers)) cb();\r\n}\r\n\r\nfunction subscribe(callback: () => void): () => void {\r\n subscribers.add(callback);\r\n return () => subscribers.delete(callback);\r\n}\r\n\r\nfunction getSnapshot(): DensityPref {\r\n return memoryValue;\r\n}\r\n\r\nfunction getServerSnapshot(): DensityPref {\r\n return DEFAULT;\r\n}\r\n\r\n/* ── Setter (module-level so identity is stable across renders) ── */\r\n\r\n/**\r\n * Set the density preference. Ignores invalid values silently\r\n * (consumer-supplied data sanitation is not this hook's job) and\r\n * short-circuits when the value is unchanged.\r\n */\r\nfunction setDensityValue(value: DensityPref): void {\r\n if (!VALID_SET.has(value)) return;\r\n if (value === memoryValue) return;\r\n memoryValue = value;\r\n applyToDom(value);\r\n if (typeof window !== \"undefined\") {\r\n try {\r\n window.localStorage.setItem(STORAGE_KEY, value);\r\n } catch (err) {\r\n // Quota, private mode, or sandboxed iframe — preference is\r\n // applied for this session but won't persist. Surface in dev.\r\n // eslint-disable-next-line no-console\r\n if (typeof console !== \"undefined\" && console.warn) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\"[@portnet/ui v2] useDensity: localStorage write failed\", err);\r\n }\r\n }\r\n }\r\n notify();\r\n}\r\n\r\nexport default function useDensity(): [DensityPref, (value: DensityPref) => void] {\r\n const density = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\r\n return [density, setDensityValue];\r\n}\r\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,OAAO;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMC,WAAW,GAAG,oBAAoB;AACxC,MAAMC,OAAoB,GAAG,aAAa;AAC1C,MAAMC,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACvD,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAASJ,KAAK,CAAC;AAExC,SAASK,aAAaA,CAACC,CAAU,EAAoB;EACnD,OAAO,OAAOA,CAAC,KAAK,QAAQ,IAAIH,SAAS,CAACI,GAAG,CAACD,CAAC,CAAC;AAClD;;AAEA;;AAEA;AACA,IAAIE,WAAwB,GAAGC,gBAAgB,CAAC,CAAC;;AAEjD;AACA,MAAMC,WAAW,GAAG,IAAIN,GAAG,CAAa,CAAC;AAEzC,SAASK,gBAAgBA,CAAA,EAAgB;EACvC,IAAI,OAAOE,MAAM,KAAK,WAAW,EAAE,OAAOZ,OAAO;EACjD,IAAI;IACF,MAAMa,GAAG,GAAGD,MAAM,CAACE,YAAY,CAACC,OAAO,CAAChB,WAAW,CAAC;IACpD,OAAOO,aAAa,CAACO,GAAG,CAAC,GAAGA,GAAG,GAAGb,OAAO;EAC3C,CAAC,CAAC,MAAM;IACN,OAAOA,OAAO;EAChB;AACF;AAEA,SAASgB,UAAUA,CAACC,KAAkB,EAAQ;EAC5C,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;EACrCA,QAAQ,CAACC,eAAe,CAACC,OAAO,CAAC,SAAS,CAAC,GAAGH,KAAK;AACrD;;AAEA;AACAD,UAAU,CAACP,WAAW,CAAC;;AAEvB;AACA;AACA,IAAI,OAAOG,MAAM,KAAK,WAAW,EAAE;EACjCA,MAAM,CAACS,gBAAgB,CAAC,SAAS,EAAGC,CAAC,IAAK;IACxC,IAAIA,CAAC,CAACC,GAAG,KAAKxB,WAAW,EAAE;IAC3B,IAAI,CAACO,aAAa,CAACgB,CAAC,CAACE,QAAQ,CAAC,EAAE;IAChC,IAAIF,CAAC,CAACE,QAAQ,KAAKf,WAAW,EAAE;IAChCA,WAAW,GAAGa,CAAC,CAACE,QAAQ;IACxBR,UAAU,CAACP,WAAW,CAAC;IACvB;IACAgB,MAAM,CAAC,CAAC;EACV,CAAC,CAAC;AACJ;AAEA,SAASA,MAAMA,CAAA,EAAS;EACtB;EACA;EACA,KAAK,MAAMC,EAAE,IAAIC,KAAK,CAACC,IAAI,CAACjB,WAAW,CAAC,EAAEe,EAAE,CAAC,CAAC;AAChD;AAEA,SAASG,SAASA,CAACC,QAAoB,EAAc;EACnDnB,WAAW,CAACoB,GAAG,CAACD,QAAQ,CAAC;EACzB,OAAO,MAAMnB,WAAW,CAACqB,MAAM,CAACF,QAAQ,CAAC;AAC3C;AAEA,SAASG,WAAWA,CAAA,EAAgB;EAClC,OAAOxB,WAAW;AACpB;AAEA,SAASyB,iBAAiBA,CAAA,EAAgB;EACxC,OAAOlC,OAAO;AAChB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASmC,eAAeA,CAAClB,KAAkB,EAAQ;EACjD,IAAI,CAACb,SAAS,CAACI,GAAG,CAACS,KAAK,CAAC,EAAE;EAC3B,IAAIA,KAAK,KAAKR,WAAW,EAAE;EAC3BA,WAAW,GAAGQ,KAAK;EACnBD,UAAU,CAACC,KAAK,CAAC;EACjB,IAAI,OAAOL,MAAM,KAAK,WAAW,EAAE;IACjC,IAAI;MACFA,MAAM,CAACE,YAAY,CAACsB,OAAO,CAACrC,WAAW,EAAEkB,KAAK,CAAC;IACjD,CAAC,CAAC,OAAOoB,GAAG,EAAE;MACZ;MACA;MACA;MACA,IAAI,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACC,IAAI,EAAE;QAClD;QACAD,OAAO,CAACC,IAAI,CAAC,wDAAwD,EAAEF,GAAG,CAAC;MAC7E;IACF;EACF;EACAZ,MAAM,CAAC,CAAC;AACV;AAEA,eAAe,SAASe,UAAUA,CAAA,EAAgD;EAChF,MAAMC,OAAO,GAAG3C,oBAAoB,CAAC+B,SAAS,EAAEI,WAAW,EAAEC,iBAAiB,CAAC;EAC/E,OAAO,CAACO,OAAO,EAAEN,eAAe,CAAC;AACnC","ignoreList":[]}
|
|
@@ -63,7 +63,7 @@ import { useEffect, useRef } from "react";
|
|
|
63
63
|
* programmatically focusable but deliberately out of the tab order — landing
|
|
64
64
|
* there would put the user somewhere Tab cannot return to.
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
const FOCUSABLE_WITHIN = 'input,select,textarea,button,[href],[tabindex]:not([tabindex="-1"])';
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Escape a value for use inside an attribute selector.
|
|
@@ -104,26 +104,24 @@ function isFocusableNow(el) {
|
|
|
104
104
|
* caller should keep its inline error and, ideally, render
|
|
105
105
|
* FormErrorSummary so the field is still reachable.
|
|
106
106
|
*/
|
|
107
|
-
export function focusFieldByName(name) {
|
|
108
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
107
|
+
export function focusFieldByName(name, options = {}) {
|
|
109
108
|
if (typeof document === "undefined") return false;
|
|
110
109
|
if (!name) return false;
|
|
111
|
-
|
|
110
|
+
const escaped = escapeAttributeValue(name);
|
|
112
111
|
|
|
113
112
|
/* Order matters — see the `[id=]` note in the module docstring. */
|
|
114
|
-
|
|
115
|
-
for (
|
|
116
|
-
|
|
117
|
-
var host = null;
|
|
113
|
+
const selectors = [`[id="${escaped}"]`, `[name="${escaped}"]`, `[data-field="${escaped}"]`];
|
|
114
|
+
for (const selector of selectors) {
|
|
115
|
+
let host = null;
|
|
118
116
|
try {
|
|
119
117
|
host = document.querySelector(selector);
|
|
120
|
-
} catch
|
|
118
|
+
} catch {
|
|
121
119
|
/* Malformed selector — try the next shape rather than throwing into
|
|
122
120
|
the caller's validation branch. */
|
|
123
121
|
host = null;
|
|
124
122
|
}
|
|
125
123
|
if (host === null) continue;
|
|
126
|
-
|
|
124
|
+
const target = isFocusableNow(host) ? host : host.querySelector(FOCUSABLE_WITHIN);
|
|
127
125
|
if (!isFocusableNow(target)) continue;
|
|
128
126
|
if (options.scroll !== false) {
|
|
129
127
|
try {
|
|
@@ -131,7 +129,7 @@ export function focusFieldByName(name) {
|
|
|
131
129
|
block: "center",
|
|
132
130
|
behavior: "auto"
|
|
133
131
|
});
|
|
134
|
-
} catch
|
|
132
|
+
} catch {
|
|
135
133
|
/* jsdom and older Safari lack the options overload. Focus below
|
|
136
134
|
still scrolls the control into view natively. */
|
|
137
135
|
}
|
|
@@ -152,25 +150,21 @@ export function focusFieldByName(name) {
|
|
|
152
150
|
* error is actually found lets the effect re-run when the errors land,
|
|
153
151
|
* without re-firing for the same attempt afterwards.
|
|
154
152
|
*/
|
|
155
|
-
export default function useFocusFirstError(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
_ref$scroll = _ref.scroll,
|
|
163
|
-
scroll = _ref$scroll === void 0 ? true : _ref$scroll;
|
|
153
|
+
export default function useFocusFirstError({
|
|
154
|
+
errors,
|
|
155
|
+
order,
|
|
156
|
+
submitCount = 0,
|
|
157
|
+
enabled = true,
|
|
158
|
+
scroll = true
|
|
159
|
+
}) {
|
|
164
160
|
/** Highest submitCount already acted on. */
|
|
165
|
-
|
|
166
|
-
useEffect(
|
|
161
|
+
const handledRef = useRef(0);
|
|
162
|
+
useEffect(() => {
|
|
167
163
|
if (!enabled) return undefined;
|
|
168
164
|
if (submitCount <= handledRef.current) return undefined;
|
|
169
165
|
if (!errors) return undefined;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return Boolean(errors[name]);
|
|
173
|
-
});
|
|
166
|
+
const names = order !== undefined && order.length > 0 ? order : Object.keys(errors);
|
|
167
|
+
const first = names.find(name => Boolean(errors[name]));
|
|
174
168
|
|
|
175
169
|
/* No error yet: either validation is still in flight for this attempt,
|
|
176
170
|
or it passed. Leave handledRef alone so a later errors update for the
|
|
@@ -180,18 +174,16 @@ export default function useFocusFirstError(_ref) {
|
|
|
180
174
|
|
|
181
175
|
/* One frame, so the inline errors have rendered and the target exists
|
|
182
176
|
and is measurable before it is focused and scrolled to. */
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
scroll
|
|
177
|
+
const frame = requestAnimationFrame(() => {
|
|
178
|
+
const focused = focusFieldByName(first, {
|
|
179
|
+
scroll
|
|
186
180
|
});
|
|
187
181
|
if (!focused && process.env["NODE_ENV"] !== "production") {
|
|
188
182
|
// eslint-disable-next-line no-console
|
|
189
|
-
console.warn(
|
|
183
|
+
console.warn(`[v2.useFocusFirstError] Could not focus "${first}" — no visible, ` + "enabled control matched [id], [name] or [data-field]. Either the " + "field is in a collapsed section, or its control does not publish " + "the field name (a hand-rolled control that skips Field). R-F.3 is " + "NOT satisfied for this field; render FormErrorSummary (R-FV.2) so " + "it stays reachable.");
|
|
190
184
|
}
|
|
191
185
|
});
|
|
192
|
-
return
|
|
193
|
-
return cancelAnimationFrame(frame);
|
|
194
|
-
};
|
|
186
|
+
return () => cancelAnimationFrame(frame);
|
|
195
187
|
}, [errors, order, submitCount, enabled, scroll]);
|
|
196
188
|
}
|
|
197
189
|
//# sourceMappingURL=useFocusFirstError.js.map
|