@portnet/ui 6.0.2 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +652 -0
- package/dist/esm/index.js +72 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/v2/__tests__/AppMain.test.js +130 -0
- package/dist/esm/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js +180 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js +150 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js +93 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldError.test.js +71 -38
- package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FieldNaming.test.js +160 -0
- package/dist/esm/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldWidth.test.js +11 -11
- package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FileCard.test.js +18 -17
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js +87 -179
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +32 -44
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js +101 -0
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js +118 -199
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -42
- package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js +165 -0
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js +156 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +37 -52
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/esm/v2/__tests__/apiError.test.js +50 -69
- package/dist/esm/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/banned-patterns.test.js +41 -122
- package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/esm/v2/__tests__/chart-palette.test.js +204 -0
- package/dist/esm/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/esm/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/esm/v2/__tests__/fileValidation.test.js +134 -0
- package/dist/esm/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js +321 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js +68 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js +218 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js +17 -21
- package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/esm/v2/__tests__/locale-fallback.test.js +35 -40
- package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js +143 -0
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/rowActions.test.js +182 -0
- package/dist/esm/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js +155 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js +266 -402
- package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js +120 -0
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/esm/v2/components/Accordion.js +48 -70
- package/dist/esm/v2/components/Accordion.js.map +1 -1
- package/dist/esm/v2/components/ActionStrip.js +31 -43
- package/dist/esm/v2/components/ActionStrip.js.map +1 -1
- package/dist/esm/v2/components/Banner.js +25 -22
- package/dist/esm/v2/components/Banner.js.map +1 -1
- package/dist/esm/v2/components/Busy.js +14 -19
- package/dist/esm/v2/components/Busy.js.map +1 -1
- package/dist/esm/v2/components/Button.js +34 -45
- package/dist/esm/v2/components/Button.js.map +1 -1
- package/dist/esm/v2/components/CategoryTag.js +44 -27
- package/dist/esm/v2/components/CategoryTag.js.map +1 -1
- package/dist/esm/v2/components/Checkbox.js +32 -38
- package/dist/esm/v2/components/Checkbox.js.map +1 -1
- package/dist/esm/v2/components/Chip.js +23 -36
- package/dist/esm/v2/components/Chip.js.map +1 -1
- package/dist/esm/v2/components/Combobox.js +112 -136
- package/dist/esm/v2/components/Combobox.js.map +1 -1
- package/dist/esm/v2/components/CommandPalette.js +113 -198
- package/dist/esm/v2/components/CommandPalette.js.map +1 -1
- package/dist/esm/v2/components/ConfirmDialog.js +36 -45
- package/dist/esm/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/esm/v2/components/DatePicker.js +78 -81
- package/dist/esm/v2/components/DatePicker.js.map +1 -1
- package/dist/esm/v2/components/DateRangePicker.js +63 -74
- package/dist/esm/v2/components/DateRangePicker.js.map +1 -1
- package/dist/esm/v2/components/DateTimePicker.js +81 -86
- package/dist/esm/v2/components/DateTimePicker.js.map +1 -1
- package/dist/esm/v2/components/Drawer.js +71 -65
- package/dist/esm/v2/components/Drawer.js.map +1 -1
- package/dist/esm/v2/components/Dropzone.js +130 -177
- package/dist/esm/v2/components/Dropzone.js.map +1 -1
- package/dist/esm/v2/components/EmptyState.js +9 -9
- package/dist/esm/v2/components/EmptyState.js.map +1 -1
- package/dist/esm/v2/components/FavoriteToggle.js +24 -33
- package/dist/esm/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/esm/v2/components/Field.js +155 -59
- package/dist/esm/v2/components/Field.js.map +1 -1
- package/dist/esm/v2/components/FieldError.js +9 -13
- package/dist/esm/v2/components/FieldError.js.map +1 -1
- package/dist/esm/v2/components/FieldHelp.js +28 -49
- package/dist/esm/v2/components/FieldHelp.js.map +1 -1
- package/dist/esm/v2/components/FileCard.js +14 -19
- package/dist/esm/v2/components/FileCard.js.map +1 -1
- package/dist/esm/v2/components/FilterTab.js +22 -31
- package/dist/esm/v2/components/FilterTab.js.map +1 -1
- package/dist/esm/v2/components/ForbiddenPage.js +28 -8
- package/dist/esm/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/esm/v2/components/FormGrid.js +48 -54
- package/dist/esm/v2/components/FormGrid.js.map +1 -1
- package/dist/esm/v2/components/FormikDisplay.js +98 -24
- package/dist/esm/v2/components/FormikDisplay.js.map +1 -1
- package/dist/esm/v2/components/Input.js +75 -34
- package/dist/esm/v2/components/Input.js.map +1 -1
- package/dist/esm/v2/components/KPICard.js +42 -51
- package/dist/esm/v2/components/KPICard.js.map +1 -1
- package/dist/esm/v2/components/KPIStrip.js +9 -15
- package/dist/esm/v2/components/KPIStrip.js.map +1 -1
- package/dist/esm/v2/components/KV.js +16 -23
- package/dist/esm/v2/components/KV.js.map +1 -1
- package/dist/esm/v2/components/KVGrid.js +15 -23
- package/dist/esm/v2/components/KVGrid.js.map +1 -1
- package/dist/esm/v2/components/Layout.js +81 -117
- package/dist/esm/v2/components/Layout.js.map +1 -1
- package/dist/esm/v2/components/MobileRowCard.js +64 -75
- package/dist/esm/v2/components/MobileRowCard.js.map +1 -1
- package/dist/esm/v2/components/Modal.js +44 -53
- package/dist/esm/v2/components/Modal.js.map +1 -1
- package/dist/esm/v2/components/NetworkErrorPage.js +28 -11
- package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/esm/v2/components/NotFoundPage.js +28 -9
- package/dist/esm/v2/components/NotFoundPage.js.map +1 -1
- package/dist/esm/v2/components/NumberInput.js +77 -107
- package/dist/esm/v2/components/NumberInput.js.map +1 -1
- package/dist/esm/v2/components/OverflowMenu.js +24 -42
- package/dist/esm/v2/components/OverflowMenu.js.map +1 -1
- package/dist/esm/v2/components/PdfViewer.js +24 -33
- package/dist/esm/v2/components/PdfViewer.js.map +1 -1
- package/dist/esm/v2/components/ProgressBar.js +28 -36
- package/dist/esm/v2/components/ProgressBar.js.map +1 -1
- package/dist/esm/v2/components/Radio.js +49 -57
- package/dist/esm/v2/components/Radio.js.map +1 -1
- package/dist/esm/v2/components/SectionErrorBoundary.js +84 -130
- package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/esm/v2/components/SectionHeader.js +24 -31
- package/dist/esm/v2/components/SectionHeader.js.map +1 -1
- package/dist/esm/v2/components/Segmented.js +59 -84
- package/dist/esm/v2/components/Segmented.js.map +1 -1
- package/dist/esm/v2/components/Select.js +100 -138
- package/dist/esm/v2/components/Select.js.map +1 -1
- package/dist/esm/v2/components/ServerErrorPage.js +27 -10
- package/dist/esm/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/esm/v2/components/Skeleton.js +81 -96
- package/dist/esm/v2/components/Skeleton.js.map +1 -1
- package/dist/esm/v2/components/SkipLink.js +6 -7
- package/dist/esm/v2/components/SkipLink.js.map +1 -1
- package/dist/esm/v2/components/Spinner.js +13 -22
- package/dist/esm/v2/components/Spinner.js.map +1 -1
- package/dist/esm/v2/components/Status.js +14 -25
- package/dist/esm/v2/components/Status.js.map +1 -1
- package/dist/esm/v2/components/Stepper.js +68 -71
- package/dist/esm/v2/components/Stepper.js.map +1 -1
- package/dist/esm/v2/components/Surface.js +25 -44
- package/dist/esm/v2/components/Surface.js.map +1 -1
- package/dist/esm/v2/components/Switch.js +21 -29
- package/dist/esm/v2/components/Switch.js.map +1 -1
- package/dist/esm/v2/components/TabPanel.js +84 -0
- package/dist/esm/v2/components/TabPanel.js.map +1 -0
- package/dist/esm/v2/components/Tabs.js +43 -19
- package/dist/esm/v2/components/Tabs.js.map +1 -1
- package/dist/esm/v2/components/TelInput.js +75 -108
- package/dist/esm/v2/components/TelInput.js.map +1 -1
- package/dist/esm/v2/components/Textarea.js +21 -30
- package/dist/esm/v2/components/Textarea.js.map +1 -1
- package/dist/esm/v2/components/TimePicker.js +59 -69
- package/dist/esm/v2/components/TimePicker.js.map +1 -1
- package/dist/esm/v2/components/Toast.js +109 -163
- package/dist/esm/v2/components/Toast.js.map +1 -1
- package/dist/esm/v2/components/Tooltip.js +18 -31
- package/dist/esm/v2/components/Tooltip.js.map +1 -1
- package/dist/esm/v2/components/_ErrorPageBody.js +6 -5
- package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/esm/v2/components/_pickerShared.js +2 -2
- package/dist/esm/v2/components/_pickerShared.js.map +1 -1
- package/dist/esm/v2/components/index.js +37 -0
- package/dist/esm/v2/components/index.js.map +1 -1
- package/dist/esm/v2/hooks/index.js +62 -0
- package/dist/esm/v2/hooks/index.js.map +1 -1
- package/dist/esm/v2/hooks/useAppliedFilters.js +112 -0
- package/dist/esm/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js +82 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js +5 -19
- package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/esm/v2/hooks/useDensity.js +13 -17
- package/dist/esm/v2/hooks/useDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusFirstError.js +25 -33
- package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js +81 -0
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusTrap.js +19 -23
- package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/esm/v2/hooks/useFormAutoSave.js +38 -53
- package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/esm/v2/hooks/useFormCompletionProgress.js +32 -51
- package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js +125 -0
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js +99 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js +2 -10
- package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useSortedRows.js +3 -5
- package/dist/esm/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/esm/v2/hooks/useTabLoading.js +6 -21
- package/dist/esm/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/esm/v2/index.js +2 -3
- package/dist/esm/v2/index.js.map +1 -1
- package/dist/esm/v2/modalContext.js +2 -2
- package/dist/esm/v2/modalContext.js.map +1 -1
- package/dist/esm/v2/models/favorite.js.map +1 -1
- package/dist/esm/v2/models/personalization.js.map +1 -1
- package/dist/esm/v2/models/referentiel.js.map +1 -1
- package/dist/esm/v2/models/savedFilter.js.map +1 -1
- package/dist/esm/v2/patterns/ActionBar.js +115 -159
- package/dist/esm/v2/patterns/ActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/AppMain.js +108 -0
- package/dist/esm/v2/patterns/AppMain.js.map +1 -0
- package/dist/esm/v2/patterns/BulkActionBar.js +31 -34
- package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/ChartFigure.js +151 -0
- package/dist/esm/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js +111 -152
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/ColumnsToggle.js +43 -77
- package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/esm/v2/patterns/DataGrid.js +221 -255
- package/dist/esm/v2/patterns/DataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js +76 -94
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridToolbar.js +85 -89
- package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridVirtualized.js +141 -182
- package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +26 -30
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/esm/v2/patterns/DetailSplit.js +108 -0
- package/dist/esm/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js +15 -17
- package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/esm/v2/patterns/FavoritesFilter.js +30 -39
- package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/esm/v2/patterns/FilterTabBar.js +112 -0
- package/dist/esm/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js +12 -13
- package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/esm/v2/patterns/FormPageShell.js +43 -41
- package/dist/esm/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/FormSection.js +30 -38
- package/dist/esm/v2/patterns/FormSection.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCheckbox.js +29 -39
- package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js +56 -60
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCombobox.js +51 -69
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDatePicker.js +44 -58
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDateTimePicker.js +44 -58
- package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikErrorFocus.js +22 -23
- package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/esm/v2/patterns/FormikErrorSummary.js +89 -0
- package/dist/esm/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/esm/v2/patterns/FormikFile.js +94 -78
- package/dist/esm/v2/patterns/FormikFile.js.map +1 -1
- package/dist/esm/v2/patterns/FormikInput.js +40 -53
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
- package/dist/esm/v2/patterns/FormikRadioGroup.js +39 -51
- package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -1
- package/dist/esm/v2/patterns/FormikReferentielField.js +49 -59
- package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/FormikSelect.js +64 -87
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/esm/v2/patterns/FormikTextarea.js +30 -46
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +53 -71
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/esm/v2/patterns/NetworkErrorBanner.js +6 -7
- package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/esm/v2/patterns/PageContent.js +10 -14
- package/dist/esm/v2/patterns/PageContent.js.map +1 -1
- package/dist/esm/v2/patterns/PreviewDrawer.js +153 -0
- package/dist/esm/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/esm/v2/patterns/ReferentielField.js +327 -312
- package/dist/esm/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/RowFavoriteToggle.js +27 -22
- package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -1
- package/dist/esm/v2/patterns/SaveFilterDialog.js +38 -66
- package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/esm/v2/patterns/SavedFiltersMenu.js +62 -81
- package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/esm/v2/patterns/SkeletonPageShell.js +106 -129
- package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/SortableHeader.js +22 -45
- package/dist/esm/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/esm/v2/patterns/Tour.js +94 -120
- package/dist/esm/v2/patterns/Tour.js.map +1 -1
- package/dist/esm/v2/patterns/_dataGridShared.js +107 -128
- package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/esm/v2/patterns/_pickerSerialisation.js +6 -8
- package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -1
- package/dist/esm/v2/patterns/_sort.js +17 -33
- package/dist/esm/v2/patterns/_sort.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnReorder.js +122 -160
- package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnResize.js +78 -96
- package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/esm/v2/patterns/filterCriteria.js +102 -0
- package/dist/esm/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/esm/v2/patterns/index.js +152 -0
- package/dist/esm/v2/patterns/index.js.map +1 -1
- package/dist/esm/v2/patterns/rowActions.js +223 -0
- package/dist/esm/v2/patterns/rowActions.js.map +1 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js +50 -47
- package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +22 -23
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +13 -13
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favorites.js +36 -60
- package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favoritesView.js +22 -34
- package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js +28 -34
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js +119 -0
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js +90 -98
- package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/esm/v2/personalization/createPersonalizationStore.js +78 -181
- package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/esm/v2/personalization/index.js +17 -0
- package/dist/esm/v2/personalization/index.js.map +1 -1
- package/dist/esm/v2/personalization/personalizationContext.js +9 -9
- package/dist/esm/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/esm/v2/personalization/schema.js +8 -9
- package/dist/esm/v2/personalization/schema.js.map +1 -1
- package/dist/esm/v2/referentiel/ReferentielProvider.js +27 -42
- package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/esm/v2/referentiel/types.js +2 -0
- package/dist/esm/v2/referentiel/types.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js +10 -11
- package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielOptions.js +60 -117
- package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielSearch.js +37 -91
- package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/esm/v2/theme/_brand.js +8 -24
- package/dist/esm/v2/theme/_brand.js.map +1 -1
- package/dist/esm/v2/theme/_brandSecondary.js +8 -24
- package/dist/esm/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/esm/v2/theme/createPortnetTheme.js +51 -61
- package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/esm/v2/theme/cssVariables.js +62 -69
- package/dist/esm/v2/theme/cssVariables.js.map +1 -1
- package/dist/esm/v2/theme/index.js +5 -5
- package/dist/esm/v2/theme/index.js.map +1 -1
- package/dist/esm/v2/tokens/breakpoints.js +14 -14
- package/dist/esm/v2/tokens/breakpoints.js.map +1 -1
- package/dist/esm/v2/tokens/chart.js +261 -0
- package/dist/esm/v2/tokens/chart.js.map +1 -0
- package/dist/esm/v2/tokens/colors.js +22 -22
- package/dist/esm/v2/tokens/colors.js.map +1 -1
- package/dist/esm/v2/tokens/density.js +62 -7
- package/dist/esm/v2/tokens/density.js.map +1 -1
- package/dist/esm/v2/tokens/index.js +49 -34
- package/dist/esm/v2/tokens/index.js.map +1 -1
- package/dist/esm/v2/tokens/motion.js +12 -20
- package/dist/esm/v2/tokens/motion.js.map +1 -1
- package/dist/esm/v2/tokens/radius.js +1 -1
- package/dist/esm/v2/tokens/radius.js.map +1 -1
- package/dist/esm/v2/tokens/shadows.js +6 -6
- package/dist/esm/v2/tokens/shadows.js.map +1 -1
- package/dist/esm/v2/tokens/spacing.js +2 -2
- package/dist/esm/v2/tokens/spacing.js.map +1 -1
- package/dist/esm/v2/tokens/state.js +1 -1
- package/dist/esm/v2/tokens/state.js.map +1 -1
- package/dist/esm/v2/tokens/statusPalette.js +17 -21
- package/dist/esm/v2/tokens/statusPalette.js.map +1 -1
- package/dist/esm/v2/tokens/tokens.json +6 -1
- package/dist/esm/v2/tokens/typography.js +13 -13
- package/dist/esm/v2/tokens/typography.js.map +1 -1
- package/dist/esm/v2/tokens/zIndex.js +1 -1
- package/dist/esm/v2/tokens/zIndex.js.map +1 -1
- package/dist/esm/v2/types/datagrid.js.map +1 -1
- package/dist/esm/v2/utils/apiError.js +16 -37
- package/dist/esm/v2/utils/apiError.js.map +1 -1
- package/dist/esm/v2/utils/contrast.js +31 -32
- package/dist/esm/v2/utils/contrast.js.map +1 -1
- package/dist/esm/v2/utils/cx.js +5 -25
- package/dist/esm/v2/utils/cx.js.map +1 -1
- package/dist/esm/v2/utils/fileDownload.js +23 -26
- package/dist/esm/v2/utils/fileDownload.js.map +1 -1
- package/dist/esm/v2/utils/fileValidation.js +209 -0
- package/dist/esm/v2/utils/fileValidation.js.map +1 -0
- package/dist/esm/v2/utils/fmtDate.js +111 -0
- package/dist/esm/v2/utils/fmtDate.js.map +1 -0
- package/dist/esm/v2/utils/fmtMoney.js +8 -10
- package/dist/esm/v2/utils/fmtMoney.js.map +1 -1
- package/dist/esm/v2/utils/formikErrors.js +78 -0
- package/dist/esm/v2/utils/formikErrors.js.map +1 -0
- package/dist/esm/v2/utils/index.js +35 -2
- package/dist/esm/v2/utils/index.js.map +1 -1
- package/dist/esm/v2/utils/mergeLabels.js +7 -12
- package/dist/esm/v2/utils/mergeLabels.js.map +1 -1
- package/dist/esm/v2/utils/networkStatus.js +12 -12
- package/dist/esm/v2/utils/networkStatus.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -49
- package/dist/index.js.map +1 -1
- package/dist/v2/__tests__/AppMain.test.js +133 -0
- package/dist/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/v2/__tests__/ChartFigure.test.js +183 -0
- package/dist/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js +153 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js +94 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/v2/__tests__/FieldError.test.js +82 -49
- package/dist/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/v2/__tests__/FieldNaming.test.js +161 -0
- package/dist/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/v2/__tests__/FieldWidth.test.js +23 -25
- package/dist/v2/__tests__/FieldWidth.test.js.map +1 -1
- package/dist/v2/__tests__/FileCard.test.js +29 -28
- package/dist/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/v2/__tests__/FormikCheckbox.test.js +90 -183
- package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -1
- package/dist/v2/__tests__/FormikDateTimePicker.test.js +38 -48
- package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
- package/dist/v2/__tests__/FormikDisplayWidth.test.js +102 -0
- package/dist/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/v2/__tests__/FormikRadioGroup.test.js +123 -204
- package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
- package/dist/v2/__tests__/MobileRowCard.test.js +63 -61
- package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/v2/__tests__/PreviewDrawer.test.js +169 -0
- package/dist/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js +159 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js +53 -68
- package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/v2/__tests__/apiError.test.js +50 -69
- package/dist/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/v2/__tests__/banned-patterns.test.js +42 -123
- package/dist/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/v2/__tests__/chart-palette.test.js +205 -0
- package/dist/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/v2/__tests__/fileValidation.test.js +136 -0
- package/dist/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/v2/__tests__/filterCriteria.test.js +324 -0
- package/dist/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/fmtDate.test.js +69 -0
- package/dist/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js +221 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/v2/__tests__/labels-merge.test.js +23 -27
- package/dist/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/v2/__tests__/locale-fallback.test.js +47 -52
- package/dist/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/v2/__tests__/reviveSavedCriteria.test.js +144 -0
- package/dist/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/rowActions.test.js +186 -0
- package/dist/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js +156 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusTrap.test.js +270 -407
- package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js +123 -0
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/v2/components/Accordion.js +60 -82
- package/dist/v2/components/Accordion.js.map +1 -1
- package/dist/v2/components/ActionStrip.js +40 -52
- package/dist/v2/components/ActionStrip.js.map +1 -1
- package/dist/v2/components/Banner.js +42 -41
- package/dist/v2/components/Banner.js.map +1 -1
- package/dist/v2/components/Busy.js +22 -27
- package/dist/v2/components/Busy.js.map +1 -1
- package/dist/v2/components/Button.js +39 -50
- package/dist/v2/components/Button.js.map +1 -1
- package/dist/v2/components/CategoryTag.d.ts.map +1 -1
- package/dist/v2/components/CategoryTag.js +49 -32
- package/dist/v2/components/CategoryTag.js.map +1 -1
- package/dist/v2/components/Checkbox.js +39 -45
- package/dist/v2/components/Checkbox.js.map +1 -1
- package/dist/v2/components/Chip.js +29 -42
- package/dist/v2/components/Chip.js.map +1 -1
- package/dist/v2/components/Combobox.js +122 -144
- package/dist/v2/components/Combobox.js.map +1 -1
- package/dist/v2/components/CommandPalette.js +138 -225
- package/dist/v2/components/CommandPalette.js.map +1 -1
- package/dist/v2/components/ConfirmDialog.js +46 -56
- package/dist/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/v2/components/DatePicker.js +81 -86
- package/dist/v2/components/DatePicker.js.map +1 -1
- package/dist/v2/components/DateRangePicker.js +77 -87
- package/dist/v2/components/DateRangePicker.js.map +1 -1
- package/dist/v2/components/DateTimePicker.js +84 -91
- package/dist/v2/components/DateTimePicker.js.map +1 -1
- package/dist/v2/components/Drawer.d.ts.map +1 -1
- package/dist/v2/components/Drawer.js +93 -88
- package/dist/v2/components/Drawer.js.map +1 -1
- package/dist/v2/components/Dropzone.js +150 -196
- package/dist/v2/components/Dropzone.js.map +1 -1
- package/dist/v2/components/EmptyState.js +18 -20
- package/dist/v2/components/EmptyState.js.map +1 -1
- package/dist/v2/components/FavoriteToggle.js +28 -39
- package/dist/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/v2/components/Field.d.ts +62 -4
- package/dist/v2/components/Field.d.ts.map +1 -1
- package/dist/v2/components/Field.js +169 -70
- package/dist/v2/components/Field.js.map +1 -1
- package/dist/v2/components/FieldError.js +18 -21
- package/dist/v2/components/FieldError.js.map +1 -1
- package/dist/v2/components/FieldHelp.js +40 -60
- package/dist/v2/components/FieldHelp.js.map +1 -1
- package/dist/v2/components/FileCard.js +27 -31
- package/dist/v2/components/FileCard.js.map +1 -1
- package/dist/v2/components/FilterTab.js +30 -38
- package/dist/v2/components/FilterTab.js.map +1 -1
- package/dist/v2/components/ForbiddenPage.d.ts +25 -1
- package/dist/v2/components/ForbiddenPage.d.ts.map +1 -1
- package/dist/v2/components/ForbiddenPage.js +37 -17
- package/dist/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/v2/components/FormGrid.js +53 -59
- package/dist/v2/components/FormGrid.js.map +1 -1
- package/dist/v2/components/FormikDisplay.d.ts +50 -1
- package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
- package/dist/v2/components/FormikDisplay.js +108 -33
- package/dist/v2/components/FormikDisplay.js.map +1 -1
- package/dist/v2/components/Input.d.ts +40 -0
- package/dist/v2/components/Input.d.ts.map +1 -1
- package/dist/v2/components/Input.js +81 -41
- package/dist/v2/components/Input.js.map +1 -1
- package/dist/v2/components/KPICard.js +57 -67
- package/dist/v2/components/KPICard.js.map +1 -1
- package/dist/v2/components/KPIStrip.js +16 -22
- package/dist/v2/components/KPIStrip.js.map +1 -1
- package/dist/v2/components/KV.js +25 -31
- package/dist/v2/components/KV.js.map +1 -1
- package/dist/v2/components/KVGrid.js +19 -26
- package/dist/v2/components/KVGrid.js.map +1 -1
- package/dist/v2/components/Layout.js +91 -120
- package/dist/v2/components/Layout.js.map +1 -1
- package/dist/v2/components/MobileRowCard.js +79 -91
- package/dist/v2/components/MobileRowCard.js.map +1 -1
- package/dist/v2/components/Modal.js +61 -69
- package/dist/v2/components/Modal.js.map +1 -1
- package/dist/v2/components/NetworkErrorPage.d.ts +19 -1
- package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
- package/dist/v2/components/NetworkErrorPage.js +38 -21
- package/dist/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/v2/components/NotFoundPage.d.ts +17 -1
- package/dist/v2/components/NotFoundPage.d.ts.map +1 -1
- package/dist/v2/components/NotFoundPage.js +37 -18
- package/dist/v2/components/NotFoundPage.js.map +1 -1
- package/dist/v2/components/NumberInput.js +88 -118
- package/dist/v2/components/NumberInput.js.map +1 -1
- package/dist/v2/components/OverflowMenu.js +38 -56
- package/dist/v2/components/OverflowMenu.js.map +1 -1
- package/dist/v2/components/PdfViewer.js +34 -45
- package/dist/v2/components/PdfViewer.js.map +1 -1
- package/dist/v2/components/ProgressBar.js +42 -49
- package/dist/v2/components/ProgressBar.js.map +1 -1
- package/dist/v2/components/Radio.js +59 -67
- package/dist/v2/components/Radio.js.map +1 -1
- package/dist/v2/components/SectionErrorBoundary.js +90 -135
- package/dist/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/v2/components/SectionHeader.js +34 -41
- package/dist/v2/components/SectionHeader.js.map +1 -1
- package/dist/v2/components/Segmented.js +69 -93
- package/dist/v2/components/Segmented.js.map +1 -1
- package/dist/v2/components/Select.d.ts +26 -2
- package/dist/v2/components/Select.d.ts.map +1 -1
- package/dist/v2/components/Select.js +120 -155
- package/dist/v2/components/Select.js.map +1 -1
- package/dist/v2/components/ServerErrorPage.d.ts +27 -1
- package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
- package/dist/v2/components/ServerErrorPage.js +37 -20
- package/dist/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/v2/components/Skeleton.js +86 -100
- package/dist/v2/components/Skeleton.js.map +1 -1
- package/dist/v2/components/SkipLink.js +9 -12
- package/dist/v2/components/SkipLink.js.map +1 -1
- package/dist/v2/components/Spinner.js +16 -25
- package/dist/v2/components/Spinner.js.map +1 -1
- package/dist/v2/components/Status.js +18 -29
- package/dist/v2/components/Status.js.map +1 -1
- package/dist/v2/components/Stepper.js +80 -82
- package/dist/v2/components/Stepper.js.map +1 -1
- package/dist/v2/components/Surface.js +34 -49
- package/dist/v2/components/Surface.js.map +1 -1
- package/dist/v2/components/Switch.js +29 -37
- package/dist/v2/components/Switch.js.map +1 -1
- package/dist/v2/components/TabPanel.d.ts +17 -0
- package/dist/v2/components/TabPanel.d.ts.map +1 -0
- package/dist/v2/components/TabPanel.js +90 -0
- package/dist/v2/components/TabPanel.js.map +1 -0
- package/dist/v2/components/Tabs.d.ts +25 -0
- package/dist/v2/components/Tabs.d.ts.map +1 -1
- package/dist/v2/components/Tabs.js +53 -29
- package/dist/v2/components/Tabs.js.map +1 -1
- package/dist/v2/components/TelInput.js +80 -115
- package/dist/v2/components/TelInput.js.map +1 -1
- package/dist/v2/components/Textarea.js +26 -35
- package/dist/v2/components/Textarea.js.map +1 -1
- package/dist/v2/components/TimePicker.js +62 -74
- package/dist/v2/components/TimePicker.js.map +1 -1
- package/dist/v2/components/Toast.js +119 -174
- package/dist/v2/components/Toast.js.map +1 -1
- package/dist/v2/components/Tooltip.js +23 -38
- package/dist/v2/components/Tooltip.js.map +1 -1
- package/dist/v2/components/_ErrorPageBody.js +15 -16
- package/dist/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/v2/components/_pickerShared.js +5 -5
- package/dist/v2/components/_pickerShared.js.map +1 -1
- package/dist/v2/components/index.d.ts +40 -1
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/components/index.js +153 -136
- package/dist/v2/components/index.js.map +1 -1
- package/dist/v2/hooks/index.d.ts +65 -0
- package/dist/v2/hooks/index.d.ts.map +1 -1
- package/dist/v2/hooks/index.js +63 -24
- package/dist/v2/hooks/index.js.map +1 -1
- package/dist/v2/hooks/useAppliedFilters.d.ts +102 -0
- package/dist/v2/hooks/useAppliedFilters.d.ts.map +1 -0
- package/dist/v2/hooks/useAppliedFilters.js +117 -0
- package/dist/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts +64 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.js +87 -0
- package/dist/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.js +6 -20
- package/dist/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/v2/hooks/useDensity.d.ts.map +1 -1
- package/dist/v2/hooks/useDensity.js +14 -18
- package/dist/v2/hooks/useDensity.js.map +1 -1
- package/dist/v2/hooks/useFocusFirstError.js +26 -34
- package/dist/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts +65 -0
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js +88 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/v2/hooks/useFocusTrap.js +20 -24
- package/dist/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.d.ts +4 -4
- package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.js +39 -54
- package/dist/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.js +33 -52
- package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts +25 -0
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js +132 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts +56 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js +105 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.js +5 -13
- package/dist/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/v2/hooks/useSortedRows.js +4 -6
- package/dist/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/v2/hooks/useTabLoading.js +7 -22
- package/dist/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/v2/index.js +143 -145
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/modalContext.js +2 -2
- package/dist/v2/modalContext.js.map +1 -1
- package/dist/v2/models/favorite.d.ts +8 -9
- package/dist/v2/models/favorite.d.ts.map +1 -1
- package/dist/v2/models/favorite.js.map +1 -1
- package/dist/v2/models/index.js +4 -4
- package/dist/v2/models/index.js.map +1 -1
- package/dist/v2/models/personalization.d.ts +44 -48
- package/dist/v2/models/personalization.d.ts.map +1 -1
- package/dist/v2/models/personalization.js.map +1 -1
- package/dist/v2/models/referentiel.d.ts +32 -50
- package/dist/v2/models/referentiel.d.ts.map +1 -1
- package/dist/v2/models/referentiel.js.map +1 -1
- package/dist/v2/models/savedFilter.d.ts +8 -17
- package/dist/v2/models/savedFilter.d.ts.map +1 -1
- package/dist/v2/models/savedFilter.js.map +1 -1
- package/dist/v2/patterns/ActionBar.js +152 -187
- package/dist/v2/patterns/ActionBar.js.map +1 -1
- package/dist/v2/patterns/AppMain.d.ts +109 -0
- package/dist/v2/patterns/AppMain.d.ts.map +1 -0
- package/dist/v2/patterns/AppMain.js +115 -0
- package/dist/v2/patterns/AppMain.js.map +1 -0
- package/dist/v2/patterns/BulkActionBar.js +40 -42
- package/dist/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/v2/patterns/ChartFigure.d.ts +124 -0
- package/dist/v2/patterns/ChartFigure.d.ts.map +1 -0
- package/dist/v2/patterns/ChartFigure.js +159 -0
- package/dist/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js +138 -174
- package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/v2/patterns/ColumnsToggle.js +60 -94
- package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/v2/patterns/DataGrid.d.ts.map +1 -1
- package/dist/v2/patterns/DataGrid.js +262 -297
- package/dist/v2/patterns/DataGrid.js.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.js +104 -121
- package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/v2/patterns/DataGridToolbar.js +103 -106
- package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/v2/patterns/DataGridVirtualized.js +179 -217
- package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js +32 -35
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/v2/patterns/DetailSplit.d.ts +87 -0
- package/dist/v2/patterns/DetailSplit.d.ts.map +1 -0
- package/dist/v2/patterns/DetailSplit.js +116 -0
- package/dist/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.js +22 -23
- package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/v2/patterns/FavoritesFilter.js +36 -44
- package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/v2/patterns/FilterTabBar.d.ts +28 -0
- package/dist/v2/patterns/FilterTabBar.d.ts.map +1 -0
- package/dist/v2/patterns/FilterTabBar.js +120 -0
- package/dist/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.js +20 -23
- package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/v2/patterns/FormPageShell.js +53 -50
- package/dist/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/v2/patterns/FormSection.d.ts +8 -3
- package/dist/v2/patterns/FormSection.d.ts.map +1 -1
- package/dist/v2/patterns/FormSection.js +44 -51
- package/dist/v2/patterns/FormSection.js.map +1 -1
- package/dist/v2/patterns/FormikCheckbox.js +36 -45
- package/dist/v2/patterns/FormikCheckbox.js.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts +17 -1
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.js +62 -65
- package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/v2/patterns/FormikCombobox.js +55 -72
- package/dist/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.js +50 -64
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/v2/patterns/FormikDateTimePicker.js +50 -64
- package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -1
- package/dist/v2/patterns/FormikErrorFocus.js +25 -26
- package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/v2/patterns/FormikErrorSummary.d.ts +74 -0
- package/dist/v2/patterns/FormikErrorSummary.d.ts.map +1 -0
- package/dist/v2/patterns/FormikErrorSummary.js +97 -0
- package/dist/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/v2/patterns/FormikFile.d.ts +14 -1
- package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
- package/dist/v2/patterns/FormikFile.js +99 -83
- package/dist/v2/patterns/FormikFile.js.map +1 -1
- package/dist/v2/patterns/FormikInput.js +45 -58
- package/dist/v2/patterns/FormikInput.js.map +1 -1
- package/dist/v2/patterns/FormikRadioGroup.js +45 -56
- package/dist/v2/patterns/FormikRadioGroup.js.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.d.ts +12 -1
- package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.js +54 -64
- package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/v2/patterns/FormikSelect.js +70 -92
- package/dist/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/v2/patterns/FormikTextarea.js +35 -51
- package/dist/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +60 -80
- package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/v2/patterns/NetworkErrorBanner.js +13 -16
- package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/v2/patterns/PageContent.js +17 -20
- package/dist/v2/patterns/PageContent.js.map +1 -1
- package/dist/v2/patterns/PreviewDrawer.d.ts +49 -0
- package/dist/v2/patterns/PreviewDrawer.d.ts.map +1 -0
- package/dist/v2/patterns/PreviewDrawer.js +159 -0
- package/dist/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/v2/patterns/ReferentielField.d.ts +86 -2
- package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/ReferentielField.js +347 -327
- package/dist/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/v2/patterns/RowFavoriteToggle.d.ts +6 -0
- package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -1
- package/dist/v2/patterns/RowFavoriteToggle.js +38 -30
- package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -1
- package/dist/v2/patterns/SaveFilterDialog.js +50 -77
- package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/v2/patterns/SavedFiltersMenu.js +89 -107
- package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/v2/patterns/SkeletonPageShell.js +122 -143
- package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/v2/patterns/SortableHeader.js +35 -57
- package/dist/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/v2/patterns/Tour.js +121 -142
- package/dist/v2/patterns/Tour.js.map +1 -1
- package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
- package/dist/v2/patterns/_dataGridShared.js +131 -147
- package/dist/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/v2/patterns/_pickerSerialisation.js +9 -10
- package/dist/v2/patterns/_pickerSerialisation.js.map +1 -1
- package/dist/v2/patterns/_sort.js +17 -33
- package/dist/v2/patterns/_sort.js.map +1 -1
- package/dist/v2/patterns/_useColumnReorder.js +124 -163
- package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/v2/patterns/_useColumnResize.js +80 -99
- package/dist/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/v2/patterns/filterCriteria.d.ts +78 -0
- package/dist/v2/patterns/filterCriteria.d.ts.map +1 -0
- package/dist/v2/patterns/filterCriteria.js +110 -0
- package/dist/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/v2/patterns/index.d.ts +160 -0
- package/dist/v2/patterns/index.d.ts.map +1 -1
- package/dist/v2/patterns/index.js +157 -79
- package/dist/v2/patterns/index.js.map +1 -1
- package/dist/v2/patterns/rowActions.d.ts +150 -0
- package/dist/v2/patterns/rowActions.d.ts.map +1 -0
- package/dist/v2/patterns/rowActions.js +232 -0
- package/dist/v2/patterns/rowActions.js.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
- package/dist/v2/personalization/PersonalizationProvider.js +57 -53
- package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +25 -24
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/createMemoryAdapter.js +14 -14
- package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/index.js +5 -5
- package/dist/v2/personalization/adapters/index.js.map +1 -1
- package/dist/v2/personalization/capabilities/favorites.js +39 -62
- package/dist/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/v2/personalization/capabilities/favoritesView.js +25 -37
- package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/v2/personalization/capabilities/gridPreferences.js +31 -36
- package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -1
- package/dist/v2/personalization/capabilities/index.js +12 -12
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts +88 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js +126 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.js +93 -100
- package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.js +81 -182
- package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/v2/personalization/index.d.ts +16 -0
- package/dist/v2/personalization/index.d.ts.map +1 -1
- package/dist/v2/personalization/index.js +30 -23
- package/dist/v2/personalization/index.js.map +1 -1
- package/dist/v2/personalization/personalizationContext.js +10 -12
- package/dist/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/v2/personalization/schema.js +8 -9
- package/dist/v2/personalization/schema.js.map +1 -1
- package/dist/v2/referentiel/ReferentielProvider.js +31 -45
- package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/v2/referentiel/index.js +11 -13
- package/dist/v2/referentiel/index.js.map +1 -1
- package/dist/v2/referentiel/types.d.ts +105 -0
- package/dist/v2/referentiel/types.d.ts.map +1 -0
- package/dist/v2/referentiel/types.js +6 -0
- package/dist/v2/referentiel/types.js.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.js +13 -16
- package/dist/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.d.ts +7 -17
- package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.js +63 -120
- package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.d.ts +7 -48
- package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.js +40 -95
- package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/v2/theme/_brand.js +12 -26
- package/dist/v2/theme/_brand.js.map +1 -1
- package/dist/v2/theme/_brandSecondary.js +12 -26
- package/dist/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/v2/theme/createPortnetTheme.js +41 -49
- package/dist/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/v2/theme/cssVariables.d.ts +3 -3
- package/dist/v2/theme/cssVariables.d.ts.map +1 -1
- package/dist/v2/theme/cssVariables.js +65 -70
- package/dist/v2/theme/cssVariables.js.map +1 -1
- package/dist/v2/theme/index.js +10 -10
- package/dist/v2/theme/index.js.map +1 -1
- package/dist/v2/tokens/breakpoints.js +16 -16
- package/dist/v2/tokens/breakpoints.js.map +1 -1
- package/dist/v2/tokens/chart.d.ts +103 -0
- package/dist/v2/tokens/chart.d.ts.map +1 -0
- package/dist/v2/tokens/chart.js +270 -0
- package/dist/v2/tokens/chart.js.map +1 -0
- package/dist/v2/tokens/colors.js +24 -24
- package/dist/v2/tokens/colors.js.map +1 -1
- package/dist/v2/tokens/density.d.ts +104 -0
- package/dist/v2/tokens/density.d.ts.map +1 -1
- package/dist/v2/tokens/density.js +67 -12
- package/dist/v2/tokens/density.js.map +1 -1
- package/dist/v2/tokens/index.d.ts +50 -1
- package/dist/v2/tokens/index.d.ts.map +1 -1
- package/dist/v2/tokens/index.js +116 -68
- package/dist/v2/tokens/index.js.map +1 -1
- package/dist/v2/tokens/motion.js +16 -22
- package/dist/v2/tokens/motion.js.map +1 -1
- package/dist/v2/tokens/radius.js +3 -3
- package/dist/v2/tokens/radius.js.map +1 -1
- package/dist/v2/tokens/shadows.js +8 -8
- package/dist/v2/tokens/shadows.js.map +1 -1
- package/dist/v2/tokens/spacing.js +4 -4
- package/dist/v2/tokens/spacing.js.map +1 -1
- package/dist/v2/tokens/state.js +3 -3
- package/dist/v2/tokens/state.js.map +1 -1
- package/dist/v2/tokens/statusPalette.js +21 -23
- package/dist/v2/tokens/statusPalette.js.map +1 -1
- package/dist/v2/tokens/tokens.json +6 -1
- package/dist/v2/tokens/typography.js +15 -15
- package/dist/v2/tokens/typography.js.map +1 -1
- package/dist/v2/tokens/zIndex.js +3 -3
- package/dist/v2/tokens/zIndex.js.map +1 -1
- package/dist/v2/types/datagrid.d.ts +9 -1
- package/dist/v2/types/datagrid.d.ts.map +1 -1
- package/dist/v2/types/datagrid.js.map +1 -1
- package/dist/v2/types/index.js +2 -2
- package/dist/v2/types/index.js.map +1 -1
- package/dist/v2/utils/apiError.js +16 -37
- package/dist/v2/utils/apiError.js.map +1 -1
- package/dist/v2/utils/contrast.js +31 -32
- package/dist/v2/utils/contrast.js.map +1 -1
- package/dist/v2/utils/cx.js +7 -27
- package/dist/v2/utils/cx.js.map +1 -1
- package/dist/v2/utils/fileDownload.js +25 -28
- package/dist/v2/utils/fileDownload.js.map +1 -1
- package/dist/v2/utils/fileValidation.d.ts +116 -0
- package/dist/v2/utils/fileValidation.d.ts.map +1 -0
- package/dist/v2/utils/fileValidation.js +220 -0
- package/dist/v2/utils/fileValidation.js.map +1 -0
- package/dist/v2/utils/fmtDate.d.ts +103 -0
- package/dist/v2/utils/fmtDate.d.ts.map +1 -0
- package/dist/v2/utils/fmtDate.js +119 -0
- package/dist/v2/utils/fmtDate.js.map +1 -0
- package/dist/v2/utils/fmtMoney.d.ts +3 -3
- package/dist/v2/utils/fmtMoney.d.ts.map +1 -1
- package/dist/v2/utils/fmtMoney.js +9 -11
- package/dist/v2/utils/fmtMoney.js.map +1 -1
- package/dist/v2/utils/formikErrors.d.ts +67 -0
- package/dist/v2/utils/formikErrors.d.ts.map +1 -0
- package/dist/v2/utils/formikErrors.js +85 -0
- package/dist/v2/utils/formikErrors.js.map +1 -0
- package/dist/v2/utils/index.d.ts +5 -0
- package/dist/v2/utils/index.d.ts.map +1 -1
- package/dist/v2/utils/index.js +67 -18
- package/dist/v2/utils/index.js.map +1 -1
- package/dist/v2/utils/mergeLabels.js +9 -14
- package/dist/v2/utils/mergeLabels.js.map +1 -1
- package/dist/v2/utils/networkStatus.js +14 -14
- package/dist/v2/utils/networkStatus.js.map +1 -1
- package/package.json +26 -9
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
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."); }
|
|
9
|
-
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); }
|
|
10
|
-
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; }
|
|
11
|
-
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; } }
|
|
12
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
1
|
import * as React from "react";
|
|
14
2
|
|
|
15
3
|
/**
|
|
@@ -49,113 +37,104 @@ import * as React from "react";
|
|
|
49
37
|
*/
|
|
50
38
|
|
|
51
39
|
/** Width delta (px) applied per Arrow key press in keyboard resize. */
|
|
52
|
-
|
|
53
|
-
export default function useColumnResize(columnWidths, onColumnWidthsChange) {
|
|
54
|
-
|
|
55
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
56
|
-
var minWidth = (_options$minWidth = options.minWidth) !== null && _options$minWidth !== void 0 ? _options$minWidth : 50;
|
|
40
|
+
const KEYBOARD_STEP = 16;
|
|
41
|
+
export default function useColumnResize(columnWidths, onColumnWidthsChange, options = {}) {
|
|
42
|
+
const minWidth = options.minWidth ?? 50;
|
|
57
43
|
|
|
58
44
|
// React state for "draggingKey" + "liveWidth" drives the rendered
|
|
59
45
|
// width during drag. Refs carry the latest values across the
|
|
60
46
|
// mouseup closure (avoids the stale-closure bug).
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var _React$useState3 = React.useState(null),
|
|
66
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
67
|
-
liveWidth = _React$useState4[0],
|
|
68
|
-
setLiveWidth = _React$useState4[1];
|
|
69
|
-
var liveWidthRef = React.useRef(null);
|
|
70
|
-
var dragStateRef = React.useRef(null);
|
|
47
|
+
const [draggingKey, setDraggingKey] = React.useState(null);
|
|
48
|
+
const [liveWidth, setLiveWidth] = React.useState(null);
|
|
49
|
+
const liveWidthRef = React.useRef(null);
|
|
50
|
+
const dragStateRef = React.useRef(null);
|
|
71
51
|
|
|
72
52
|
// Keep the latest columnWidths reference reachable from the
|
|
73
53
|
// mouseup closure without re-binding listeners on every prop
|
|
74
54
|
// change. Avoids tearing down + re-adding the window listeners
|
|
75
55
|
// on each parent re-render that ships a fresh widths object.
|
|
76
|
-
|
|
77
|
-
React.useEffect(
|
|
56
|
+
const columnWidthsRef = React.useRef(columnWidths);
|
|
57
|
+
React.useEffect(() => {
|
|
78
58
|
columnWidthsRef.current = columnWidths;
|
|
79
59
|
}, [columnWidths]);
|
|
80
60
|
|
|
81
61
|
// Shared RTL probe for a grip's owning <th>: -1 in RTL, 1 otherwise.
|
|
82
|
-
|
|
83
|
-
|
|
62
|
+
const cellDirection = grip => {
|
|
63
|
+
const cell = grip.closest("th");
|
|
84
64
|
return cell && typeof window !== "undefined" && typeof window.getComputedStyle === "function" && window.getComputedStyle(cell).direction === "rtl" ? -1 : 1;
|
|
85
65
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var cell = grip.closest("th");
|
|
96
|
-
if (!cell) return;
|
|
66
|
+
const handleMouseDown = React.useCallback(key => e => {
|
|
67
|
+
// Block native browser drag (text selection, image drag, the
|
|
68
|
+
// ancestor `<th draggable>` if reorder is also on) and the
|
|
69
|
+
// sortable-header click that lives next door in the same `<th>`.
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
const grip = e.currentTarget;
|
|
73
|
+
const cell = grip.closest("th");
|
|
74
|
+
if (!cell) return;
|
|
97
75
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
76
|
+
// RTL detection at the cell level — most accurate (a `dir`
|
|
77
|
+
// attribute may be set anywhere up the ancestor chain).
|
|
78
|
+
const direction = cellDirection(grip);
|
|
101
79
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
111
|
-
liveWidthRef.current = currentWidth;
|
|
112
|
-
setLiveWidth(currentWidth);
|
|
113
|
-
setDraggingKey(key);
|
|
80
|
+
// Starting width: prefer the host-controlled value, fall back to
|
|
81
|
+
// the rendered offsetWidth for a column the host hasn't sized.
|
|
82
|
+
const currentWidth = (columnWidthsRef.current && columnWidthsRef.current[key]) ?? cell.offsetWidth;
|
|
83
|
+
dragStateRef.current = {
|
|
84
|
+
x: e.clientX,
|
|
85
|
+
width: currentWidth,
|
|
86
|
+
key,
|
|
87
|
+
direction
|
|
114
88
|
};
|
|
89
|
+
liveWidthRef.current = currentWidth;
|
|
90
|
+
setLiveWidth(currentWidth);
|
|
91
|
+
setDraggingKey(key);
|
|
115
92
|
}, []);
|
|
116
93
|
|
|
117
94
|
// DG-2 — keyboard resize on the focusable grip. Commits immediately;
|
|
118
95
|
// no drag session / window listeners involved.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
var direction = cellDirection(grip);
|
|
131
|
-
var current = (_ref2 = columnWidthsRef.current && columnWidthsRef.current[key]) !== null && _ref2 !== void 0 ? _ref2 : cell ? cell.offsetWidth : minWidth;
|
|
96
|
+
const handleKeyDown = React.useCallback(key => e => {
|
|
97
|
+
const isLeft = e.key === "ArrowLeft";
|
|
98
|
+
const isRight = e.key === "ArrowRight";
|
|
99
|
+
const isHome = e.key === "Home";
|
|
100
|
+
if (!isLeft && !isRight && !isHome) return;
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
e.stopPropagation();
|
|
103
|
+
const grip = e.currentTarget;
|
|
104
|
+
const cell = grip.closest("th");
|
|
105
|
+
const direction = cellDirection(grip);
|
|
106
|
+
const current = (columnWidthsRef.current && columnWidthsRef.current[key]) ?? (cell ? cell.offsetWidth : minWidth);
|
|
132
107
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
108
|
+
// RTL-aware so ArrowRight matches a rightward drag (which grows the
|
|
109
|
+
// column in LTR and shrinks it in RTL, the grip being on the
|
|
110
|
+
// inline-end edge).
|
|
111
|
+
const next = isHome ? minWidth : current + (isRight ? 1 : -1) * KEYBOARD_STEP * direction;
|
|
112
|
+
const clamped = Math.max(minWidth, Math.round(next));
|
|
113
|
+
if (onColumnWidthsChange) {
|
|
114
|
+
onColumnWidthsChange({
|
|
115
|
+
...(columnWidthsRef.current || {}),
|
|
116
|
+
[key]: clamped
|
|
117
|
+
});
|
|
118
|
+
}
|
|
142
119
|
}, [minWidth, onColumnWidthsChange]);
|
|
143
|
-
React.useEffect(
|
|
120
|
+
React.useEffect(() => {
|
|
144
121
|
if (!draggingKey) return undefined;
|
|
145
|
-
|
|
146
|
-
|
|
122
|
+
const onMove = e => {
|
|
123
|
+
const start = dragStateRef.current;
|
|
147
124
|
if (!start) return;
|
|
148
|
-
|
|
149
|
-
|
|
125
|
+
const delta = (e.clientX - start.x) * start.direction;
|
|
126
|
+
const next = Math.max(minWidth, start.width + delta);
|
|
150
127
|
liveWidthRef.current = next;
|
|
151
128
|
setLiveWidth(next);
|
|
152
129
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
var finalWidth = (_liveWidthRef$current = liveWidthRef.current) !== null && _liveWidthRef$current !== void 0 ? _liveWidthRef$current : start ? start.width : null;
|
|
130
|
+
const onUp = () => {
|
|
131
|
+
const start = dragStateRef.current;
|
|
132
|
+
const finalWidth = liveWidthRef.current ?? (start ? start.width : null);
|
|
157
133
|
if (start && finalWidth != null && onColumnWidthsChange) {
|
|
158
|
-
onColumnWidthsChange(
|
|
134
|
+
onColumnWidthsChange({
|
|
135
|
+
...(columnWidthsRef.current || {}),
|
|
136
|
+
[start.key]: finalWidth
|
|
137
|
+
});
|
|
159
138
|
}
|
|
160
139
|
dragStateRef.current = null;
|
|
161
140
|
liveWidthRef.current = null;
|
|
@@ -164,7 +143,7 @@ export default function useColumnResize(columnWidths, onColumnWidthsChange) {
|
|
|
164
143
|
};
|
|
165
144
|
window.addEventListener("mousemove", onMove);
|
|
166
145
|
window.addEventListener("mouseup", onUp);
|
|
167
|
-
return
|
|
146
|
+
return () => {
|
|
168
147
|
window.removeEventListener("mousemove", onMove);
|
|
169
148
|
window.removeEventListener("mouseup", onUp);
|
|
170
149
|
};
|
|
@@ -176,16 +155,19 @@ export default function useColumnResize(columnWidths, onColumnWidthsChange) {
|
|
|
176
155
|
// Live widths map = host columnWidths with the in-flight drag value
|
|
177
156
|
// patched in. Memoised on [draggingKey, liveWidth, columnWidths] so
|
|
178
157
|
// the reference is stable when nothing is dragging.
|
|
179
|
-
|
|
158
|
+
const liveWidths = React.useMemo(() => {
|
|
180
159
|
if (!draggingKey || liveWidth == null) return columnWidths;
|
|
181
|
-
return
|
|
160
|
+
return {
|
|
161
|
+
...(columnWidths || {}),
|
|
162
|
+
[draggingKey]: liveWidth
|
|
163
|
+
};
|
|
182
164
|
}, [draggingKey, liveWidth, columnWidths]);
|
|
183
165
|
return {
|
|
184
|
-
handleMouseDown
|
|
185
|
-
handleKeyDown
|
|
186
|
-
liveWidths
|
|
166
|
+
handleMouseDown,
|
|
167
|
+
handleKeyDown,
|
|
168
|
+
liveWidths,
|
|
187
169
|
isResizing: draggingKey != null,
|
|
188
|
-
minWidth
|
|
170
|
+
minWidth
|
|
189
171
|
};
|
|
190
172
|
}
|
|
191
173
|
//# sourceMappingURL=_useColumnResize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_useColumnResize.js","names":["React","KEYBOARD_STEP","useColumnResize","columnWidths","onColumnWidthsChange","_options$minWidth","options","arguments","length","undefined","minWidth","_React$useState","useState","_React$useState2","_slicedToArray","draggingKey","setDraggingKey","_React$useState3","_React$useState4","liveWidth","setLiveWidth","liveWidthRef","useRef","dragStateRef","columnWidthsRef","useEffect","current","cellDirection","grip","cell","closest","window","getComputedStyle","direction","handleMouseDown","useCallback","key","e","_ref","preventDefault","stopPropagation","currentTarget","currentWidth","offsetWidth","x","clientX","width","handleKeyDown","_ref2","isLeft","isRight","isHome","next","clamped","Math","max","round","_objectSpread","_defineProperty","onMove","start","delta","onUp","_liveWidthRef$current","finalWidth","addEventListener","removeEventListener","liveWidths","useMemo","isResizing"],"sources":["../../../../src/lib/v2/patterns/_useColumnResize.ts"],"sourcesContent":["import * as React from \"react\";\r\n\r\n/**\r\n * useColumnResize — Portnet UI v2 (private)\r\n *\r\n * Internal hook for the DataGrid + DataGridVirtualized resize\r\n * feature. NOT exported from the patterns barrel; underscore filename\r\n * prefix is the convention.\r\n *\r\n * const { handleMouseDown, handleKeyDown, liveWidths, isResizing, minWidth } =\r\n * useColumnResize(\r\n * columnWidths, // controlled\r\n * onColumnWidthsChange, // controlled\r\n * { minWidth: 50 }\r\n * );\r\n *\r\n * Behaviour (pointer):\r\n * - handleMouseDown(key) returns an onMouseDown handler. Attach to\r\n * the grip element on each `<th>` border.\r\n * - On mousedown: captures starting clientX + current width + the\r\n * direction of the cell's writing mode (LTR vs RTL). Sets\r\n * `isResizing = true` so callers (e.g. the reorder hook) can\r\n * short-circuit.\r\n * - On mousemove (window-bound): computes the resize delta\r\n * respecting RTL and updates a local \"live\" width via state.\r\n * Floors at `minWidth`.\r\n * - On mouseup (window-bound): commits the live width to the host\r\n * via `onColumnWidthsChange`. Clears all internal state.\r\n *\r\n * Behaviour (keyboard, DG-2 / WCAG 2.1.1):\r\n * - handleKeyDown(key) returns an onKeyDown handler for the SAME grip\r\n * (the grip is a focusable role=\"separator\"). ArrowRight / ArrowLeft\r\n * nudge the width by KEYBOARD_STEP px, RTL-aware so the direction\r\n * matches a rightward drag; Home resets to `minWidth`. Each press\r\n * commits immediately via `onColumnWidthsChange` (no drag session).\r\n * - `minWidth` is returned so the separator can advertise aria-valuemin.\r\n */\r\n\r\nexport type ColumnWidths = Record<string, number>;\r\n\r\n/** Width delta (px) applied per Arrow key press in keyboard resize. */\r\nconst KEYBOARD_STEP = 16;\r\n\r\nexport interface UseColumnResizeOptions {\r\n minWidth?: number | undefined;\r\n}\r\n\r\nexport interface UseColumnResizeResult {\r\n handleMouseDown: (key: string) => (e: React.MouseEvent) => void;\r\n handleKeyDown: (key: string) => (e: React.KeyboardEvent) => void;\r\n liveWidths: ColumnWidths | undefined;\r\n isResizing: boolean;\r\n minWidth: number;\r\n}\r\n\r\ninterface DragState {\r\n x: number;\r\n width: number;\r\n key: string;\r\n direction: 1 | -1;\r\n}\r\n\r\nexport default function useColumnResize(\r\n columnWidths: ColumnWidths | undefined,\r\n onColumnWidthsChange: ((widths: ColumnWidths) => void) | undefined,\r\n options: UseColumnResizeOptions = {}\r\n): UseColumnResizeResult {\r\n const minWidth = options.minWidth ?? 50;\r\n\r\n // React state for \"draggingKey\" + \"liveWidth\" drives the rendered\r\n // width during drag. Refs carry the latest values across the\r\n // mouseup closure (avoids the stale-closure bug).\r\n const [draggingKey, setDraggingKey] = React.useState<string | null>(null);\r\n const [liveWidth, setLiveWidth] = React.useState<number | null>(null);\r\n const liveWidthRef = React.useRef<number | null>(null);\r\n const dragStateRef = React.useRef<DragState | null>(null);\r\n\r\n // Keep the latest columnWidths reference reachable from the\r\n // mouseup closure without re-binding listeners on every prop\r\n // change. Avoids tearing down + re-adding the window listeners\r\n // on each parent re-render that ships a fresh widths object.\r\n const columnWidthsRef = React.useRef<ColumnWidths | undefined>(columnWidths);\r\n React.useEffect(() => {\r\n columnWidthsRef.current = columnWidths;\r\n }, [columnWidths]);\r\n\r\n // Shared RTL probe for a grip's owning <th>: -1 in RTL, 1 otherwise.\r\n const cellDirection = (grip: HTMLElement): 1 | -1 => {\r\n const cell = grip.closest(\"th\");\r\n return cell &&\r\n typeof window !== \"undefined\" &&\r\n typeof window.getComputedStyle === \"function\" &&\r\n window.getComputedStyle(cell).direction === \"rtl\"\r\n ? -1\r\n : 1;\r\n };\r\n\r\n const handleMouseDown = React.useCallback((key: string) => (e: React.MouseEvent) => {\r\n // Block native browser drag (text selection, image drag, the\r\n // ancestor `<th draggable>` if reorder is also on) and the\r\n // sortable-header click that lives next door in the same `<th>`.\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n const grip = e.currentTarget as HTMLElement;\r\n const cell = grip.closest(\"th\");\r\n if (!cell) return;\r\n\r\n // RTL detection at the cell level — most accurate (a `dir`\r\n // attribute may be set anywhere up the ancestor chain).\r\n const direction = cellDirection(grip);\r\n\r\n // Starting width: prefer the host-controlled value, fall back to\r\n // the rendered offsetWidth for a column the host hasn't sized.\r\n const currentWidth =\r\n (columnWidthsRef.current && columnWidthsRef.current[key]) ??\r\n cell.offsetWidth;\r\n\r\n dragStateRef.current = {\r\n x: e.clientX,\r\n width: currentWidth,\r\n key,\r\n direction,\r\n };\r\n\r\n liveWidthRef.current = currentWidth;\r\n setLiveWidth(currentWidth);\r\n setDraggingKey(key);\r\n }, []);\r\n\r\n // DG-2 — keyboard resize on the focusable grip. Commits immediately;\r\n // no drag session / window listeners involved.\r\n const handleKeyDown = React.useCallback(\r\n (key: string) => (e: React.KeyboardEvent) => {\r\n const isLeft = e.key === \"ArrowLeft\";\r\n const isRight = e.key === \"ArrowRight\";\r\n const isHome = e.key === \"Home\";\r\n if (!isLeft && !isRight && !isHome) return;\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n const grip = e.currentTarget as HTMLElement;\r\n const cell = grip.closest(\"th\");\r\n const direction = cellDirection(grip);\r\n\r\n const current =\r\n (columnWidthsRef.current && columnWidthsRef.current[key]) ??\r\n (cell ? cell.offsetWidth : minWidth);\r\n\r\n // RTL-aware so ArrowRight matches a rightward drag (which grows the\r\n // column in LTR and shrinks it in RTL, the grip being on the\r\n // inline-end edge).\r\n const next = isHome\r\n ? minWidth\r\n : current + (isRight ? 1 : -1) * KEYBOARD_STEP * direction;\r\n\r\n const clamped = Math.max(minWidth, Math.round(next));\r\n if (onColumnWidthsChange) {\r\n onColumnWidthsChange({ ...(columnWidthsRef.current || {}), [key]: clamped });\r\n }\r\n },\r\n [minWidth, onColumnWidthsChange]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (!draggingKey) return undefined;\r\n\r\n const onMove = (e: MouseEvent) => {\r\n const start = dragStateRef.current;\r\n if (!start) return;\r\n const delta = (e.clientX - start.x) * start.direction;\r\n const next = Math.max(minWidth, start.width + delta);\r\n liveWidthRef.current = next;\r\n setLiveWidth(next);\r\n };\r\n\r\n const onUp = () => {\r\n const start = dragStateRef.current;\r\n const finalWidth = liveWidthRef.current ?? (start ? start.width : null);\r\n if (start && finalWidth != null && onColumnWidthsChange) {\r\n onColumnWidthsChange({\r\n ...(columnWidthsRef.current || {}),\r\n [start.key]: finalWidth,\r\n });\r\n }\r\n dragStateRef.current = null;\r\n liveWidthRef.current = null;\r\n setLiveWidth(null);\r\n setDraggingKey(null);\r\n };\r\n\r\n window.addEventListener(\"mousemove\", onMove);\r\n window.addEventListener(\"mouseup\", onUp);\r\n return () => {\r\n window.removeEventListener(\"mousemove\", onMove);\r\n window.removeEventListener(\"mouseup\", onUp);\r\n };\r\n // onColumnWidthsChange is intentionally listed — re-creates the\r\n // mouseup closure with the latest setter ref. minWidth is rare\r\n // to change but listed for correctness.\r\n }, [draggingKey, onColumnWidthsChange, minWidth]);\r\n\r\n // Live widths map = host columnWidths with the in-flight drag value\r\n // patched in. Memoised on [draggingKey, liveWidth, columnWidths] so\r\n // the reference is stable when nothing is dragging.\r\n const liveWidths = React.useMemo(() => {\r\n if (!draggingKey || liveWidth == null) return columnWidths;\r\n return { ...(columnWidths || {}), [draggingKey]: liveWidth };\r\n }, [draggingKey, liveWidth, columnWidths]);\r\n\r\n return {\r\n handleMouseDown,\r\n handleKeyDown,\r\n liveWidths,\r\n isResizing: draggingKey != null,\r\n minWidth,\r\n };\r\n}\r\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;;AAE9B;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;;AAIA;AACA,IAAMC,aAAa,GAAG,EAAE;AAqBxB,eAAe,SAASC,eAAeA,CACrCC,YAAsC,EACtCC,oBAAkE,EAE3C;EAAA,IAAAC,iBAAA;EAAA,IADvBC,OAA+B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF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AAC,YAAM;IACrC,IAAI,CAACrD,WAAW,IAAII,SAAS,IAAI,IAAI,EAAE,OAAOhB,YAAY;IAC1D,OAAAsD,aAAA,CAAAA,aAAA,KAAatD,YAAY,IAAI,CAAC,CAAC,OAAAuD,eAAA,KAAI3C,WAAW,EAAGI,SAAS;EAC5D,CAAC,EAAE,CAACJ,WAAW,EAAEI,SAAS,EAAEhB,YAAY,CAAC,CAAC;EAE1C,OAAO;IACL+B,eAAe,EAAfA,eAAe;IACfa,aAAa,EAAbA,aAAa;IACboB,UAAU,EAAVA,UAAU;IACVE,UAAU,EAAEtD,WAAW,IAAI,IAAI;IAC/BL,QAAQ,EAARA;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"_useColumnResize.js","names":["React","KEYBOARD_STEP","useColumnResize","columnWidths","onColumnWidthsChange","options","minWidth","draggingKey","setDraggingKey","useState","liveWidth","setLiveWidth","liveWidthRef","useRef","dragStateRef","columnWidthsRef","useEffect","current","cellDirection","grip","cell","closest","window","getComputedStyle","direction","handleMouseDown","useCallback","key","e","preventDefault","stopPropagation","currentTarget","currentWidth","offsetWidth","x","clientX","width","handleKeyDown","isLeft","isRight","isHome","next","clamped","Math","max","round","undefined","onMove","start","delta","onUp","finalWidth","addEventListener","removeEventListener","liveWidths","useMemo","isResizing"],"sources":["../../../../src/lib/v2/patterns/_useColumnResize.ts"],"sourcesContent":["import * as React from \"react\";\r\n\r\n/**\r\n * useColumnResize — Portnet UI v2 (private)\r\n *\r\n * Internal hook for the DataGrid + DataGridVirtualized resize\r\n * feature. NOT exported from the patterns barrel; underscore filename\r\n * prefix is the convention.\r\n *\r\n * const { handleMouseDown, handleKeyDown, liveWidths, isResizing, minWidth } =\r\n * useColumnResize(\r\n * columnWidths, // controlled\r\n * onColumnWidthsChange, // controlled\r\n * { minWidth: 50 }\r\n * );\r\n *\r\n * Behaviour (pointer):\r\n * - handleMouseDown(key) returns an onMouseDown handler. Attach to\r\n * the grip element on each `<th>` border.\r\n * - On mousedown: captures starting clientX + current width + the\r\n * direction of the cell's writing mode (LTR vs RTL). Sets\r\n * `isResizing = true` so callers (e.g. the reorder hook) can\r\n * short-circuit.\r\n * - On mousemove (window-bound): computes the resize delta\r\n * respecting RTL and updates a local \"live\" width via state.\r\n * Floors at `minWidth`.\r\n * - On mouseup (window-bound): commits the live width to the host\r\n * via `onColumnWidthsChange`. Clears all internal state.\r\n *\r\n * Behaviour (keyboard, DG-2 / WCAG 2.1.1):\r\n * - handleKeyDown(key) returns an onKeyDown handler for the SAME grip\r\n * (the grip is a focusable role=\"separator\"). ArrowRight / ArrowLeft\r\n * nudge the width by KEYBOARD_STEP px, RTL-aware so the direction\r\n * matches a rightward drag; Home resets to `minWidth`. Each press\r\n * commits immediately via `onColumnWidthsChange` (no drag session).\r\n * - `minWidth` is returned so the separator can advertise aria-valuemin.\r\n */\r\n\r\nexport type ColumnWidths = Record<string, number>;\r\n\r\n/** Width delta (px) applied per Arrow key press in keyboard resize. */\r\nconst KEYBOARD_STEP = 16;\r\n\r\nexport interface UseColumnResizeOptions {\r\n minWidth?: number | undefined;\r\n}\r\n\r\nexport interface UseColumnResizeResult {\r\n handleMouseDown: (key: string) => (e: React.MouseEvent) => void;\r\n handleKeyDown: (key: string) => (e: React.KeyboardEvent) => void;\r\n liveWidths: ColumnWidths | undefined;\r\n isResizing: boolean;\r\n minWidth: number;\r\n}\r\n\r\ninterface DragState {\r\n x: number;\r\n width: number;\r\n key: string;\r\n direction: 1 | -1;\r\n}\r\n\r\nexport default function useColumnResize(\r\n columnWidths: ColumnWidths | undefined,\r\n onColumnWidthsChange: ((widths: ColumnWidths) => void) | undefined,\r\n options: UseColumnResizeOptions = {}\r\n): UseColumnResizeResult {\r\n const minWidth = options.minWidth ?? 50;\r\n\r\n // React state for \"draggingKey\" + \"liveWidth\" drives the rendered\r\n // width during drag. Refs carry the latest values across the\r\n // mouseup closure (avoids the stale-closure bug).\r\n const [draggingKey, setDraggingKey] = React.useState<string | null>(null);\r\n const [liveWidth, setLiveWidth] = React.useState<number | null>(null);\r\n const liveWidthRef = React.useRef<number | null>(null);\r\n const dragStateRef = React.useRef<DragState | null>(null);\r\n\r\n // Keep the latest columnWidths reference reachable from the\r\n // mouseup closure without re-binding listeners on every prop\r\n // change. Avoids tearing down + re-adding the window listeners\r\n // on each parent re-render that ships a fresh widths object.\r\n const columnWidthsRef = React.useRef<ColumnWidths | undefined>(columnWidths);\r\n React.useEffect(() => {\r\n columnWidthsRef.current = columnWidths;\r\n }, [columnWidths]);\r\n\r\n // Shared RTL probe for a grip's owning <th>: -1 in RTL, 1 otherwise.\r\n const cellDirection = (grip: HTMLElement): 1 | -1 => {\r\n const cell = grip.closest(\"th\");\r\n return cell &&\r\n typeof window !== \"undefined\" &&\r\n typeof window.getComputedStyle === \"function\" &&\r\n window.getComputedStyle(cell).direction === \"rtl\"\r\n ? -1\r\n : 1;\r\n };\r\n\r\n const handleMouseDown = React.useCallback((key: string) => (e: React.MouseEvent) => {\r\n // Block native browser drag (text selection, image drag, the\r\n // ancestor `<th draggable>` if reorder is also on) and the\r\n // sortable-header click that lives next door in the same `<th>`.\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n const grip = e.currentTarget as HTMLElement;\r\n const cell = grip.closest(\"th\");\r\n if (!cell) return;\r\n\r\n // RTL detection at the cell level — most accurate (a `dir`\r\n // attribute may be set anywhere up the ancestor chain).\r\n const direction = cellDirection(grip);\r\n\r\n // Starting width: prefer the host-controlled value, fall back to\r\n // the rendered offsetWidth for a column the host hasn't sized.\r\n const currentWidth =\r\n (columnWidthsRef.current && columnWidthsRef.current[key]) ??\r\n cell.offsetWidth;\r\n\r\n dragStateRef.current = {\r\n x: e.clientX,\r\n width: currentWidth,\r\n key,\r\n direction,\r\n };\r\n\r\n liveWidthRef.current = currentWidth;\r\n setLiveWidth(currentWidth);\r\n setDraggingKey(key);\r\n }, []);\r\n\r\n // DG-2 — keyboard resize on the focusable grip. Commits immediately;\r\n // no drag session / window listeners involved.\r\n const handleKeyDown = React.useCallback(\r\n (key: string) => (e: React.KeyboardEvent) => {\r\n const isLeft = e.key === \"ArrowLeft\";\r\n const isRight = e.key === \"ArrowRight\";\r\n const isHome = e.key === \"Home\";\r\n if (!isLeft && !isRight && !isHome) return;\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n const grip = e.currentTarget as HTMLElement;\r\n const cell = grip.closest(\"th\");\r\n const direction = cellDirection(grip);\r\n\r\n const current =\r\n (columnWidthsRef.current && columnWidthsRef.current[key]) ??\r\n (cell ? cell.offsetWidth : minWidth);\r\n\r\n // RTL-aware so ArrowRight matches a rightward drag (which grows the\r\n // column in LTR and shrinks it in RTL, the grip being on the\r\n // inline-end edge).\r\n const next = isHome\r\n ? minWidth\r\n : current + (isRight ? 1 : -1) * KEYBOARD_STEP * direction;\r\n\r\n const clamped = Math.max(minWidth, Math.round(next));\r\n if (onColumnWidthsChange) {\r\n onColumnWidthsChange({ ...(columnWidthsRef.current || {}), [key]: clamped });\r\n }\r\n },\r\n [minWidth, onColumnWidthsChange]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (!draggingKey) return undefined;\r\n\r\n const onMove = (e: MouseEvent) => {\r\n const start = dragStateRef.current;\r\n if (!start) return;\r\n const delta = (e.clientX - start.x) * start.direction;\r\n const next = Math.max(minWidth, start.width + delta);\r\n liveWidthRef.current = next;\r\n setLiveWidth(next);\r\n };\r\n\r\n const onUp = () => {\r\n const start = dragStateRef.current;\r\n const finalWidth = liveWidthRef.current ?? (start ? start.width : null);\r\n if (start && finalWidth != null && onColumnWidthsChange) {\r\n onColumnWidthsChange({\r\n ...(columnWidthsRef.current || {}),\r\n [start.key]: finalWidth,\r\n });\r\n }\r\n dragStateRef.current = null;\r\n liveWidthRef.current = null;\r\n setLiveWidth(null);\r\n setDraggingKey(null);\r\n };\r\n\r\n window.addEventListener(\"mousemove\", onMove);\r\n window.addEventListener(\"mouseup\", onUp);\r\n return () => {\r\n window.removeEventListener(\"mousemove\", onMove);\r\n window.removeEventListener(\"mouseup\", onUp);\r\n };\r\n // onColumnWidthsChange is intentionally listed — re-creates the\r\n // mouseup closure with the latest setter ref. minWidth is rare\r\n // to change but listed for correctness.\r\n }, [draggingKey, onColumnWidthsChange, minWidth]);\r\n\r\n // Live widths map = host columnWidths with the in-flight drag value\r\n // patched in. Memoised on [draggingKey, liveWidth, columnWidths] so\r\n // the reference is stable when nothing is dragging.\r\n const liveWidths = React.useMemo(() => {\r\n if (!draggingKey || liveWidth == null) return columnWidths;\r\n return { ...(columnWidths || {}), [draggingKey]: liveWidth };\r\n }, [draggingKey, liveWidth, columnWidths]);\r\n\r\n return {\r\n handleMouseDown,\r\n handleKeyDown,\r\n liveWidths,\r\n isResizing: draggingKey != null,\r\n minWidth,\r\n };\r\n}\r\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;;AAE9B;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;;AAIA;AACA,MAAMC,aAAa,GAAG,EAAE;AAqBxB,eAAe,SAASC,eAAeA,CACrCC,YAAsC,EACtCC,oBAAkE,EAClEC,OAA+B,GAAG,CAAC,CAAC,EACb;EACvB,MAAMC,QAAQ,GAAGD,OAAO,CAACC,QAAQ,IAAI,EAAE;;EAEvC;EACA;EACA;EACA,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGR,KAAK,CAACS,QAAQ,CAAgB,IAAI,CAAC;EACzE,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGX,KAAK,CAACS,QAAQ,CAAgB,IAAI,CAAC;EACrE,MAAMG,YAAY,GAAGZ,KAAK,CAACa,MAAM,CAAgB,IAAI,CAAC;EACtD,MAAMC,YAAY,GAAGd,KAAK,CAACa,MAAM,CAAmB,IAAI,CAAC;;EAEzD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AAC+B,mBAAmB,CAAC,WAAW,EAAEN,MAAM,CAAC;MAC/CzB,MAAM,CAAC+B,mBAAmB,CAAC,SAAS,EAAEH,IAAI,CAAC;IAC7C,CAAC;IACD;IACA;IACA;EACF,CAAC,EAAE,CAAC3C,WAAW,EAAEH,oBAAoB,EAAEE,QAAQ,CAAC,CAAC;;EAEjD;EACA;EACA;EACA,MAAMgD,UAAU,GAAGtD,KAAK,CAACuD,OAAO,CAAC,MAAM;IACrC,IAAI,CAAChD,WAAW,IAAIG,SAAS,IAAI,IAAI,EAAE,OAAOP,YAAY;IAC1D,OAAO;MAAE,IAAIA,YAAY,IAAI,CAAC,CAAC,CAAC;MAAE,CAACI,WAAW,GAAGG;IAAU,CAAC;EAC9D,CAAC,EAAE,CAACH,WAAW,EAAEG,SAAS,EAAEP,YAAY,CAAC,CAAC;EAE1C,OAAO;IACLsB,eAAe;IACfY,aAAa;IACbiB,UAAU;IACVE,UAAU,EAAEjD,WAAW,IAAI,IAAI;IAC/BD;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* filterCriteria — active search criteria as removable chips
|
|
3
|
+
* (capability gap G-42).
|
|
4
|
+
*
|
|
5
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
6
|
+
* WHY THIS BELONGS IN THE LIBRARY
|
|
7
|
+
*
|
|
8
|
+
* The library owns HALF of this already, and the half it owns is the rendering:
|
|
9
|
+
* `DataGridToolbar.filterChips` draws one removable chip per criterion, and
|
|
10
|
+
* `DataGridToolbarFilterChip` describes an entry. That type's own docstring
|
|
11
|
+
* records where the request came from — `refonte-frontend`, whose ten listings
|
|
12
|
+
* each had to build the array — and that §Filters and §Search make removable
|
|
13
|
+
* active criteria a MUST.
|
|
14
|
+
*
|
|
15
|
+
* What was missing is the BUILDER. Ten local copies would have drifted on the
|
|
16
|
+
* two things that are not obvious:
|
|
17
|
+
*
|
|
18
|
+
* 1. WHAT COUNTS AS SET. `0` is the "unset" value of a reference mirror on
|
|
19
|
+
* some hosts (`villeEntreeId: 0`), `""` on others, `null` elsewhere. A
|
|
20
|
+
* chip that appears for `0` announces a filter nobody chose.
|
|
21
|
+
* 2. WHAT A REMOVAL MUST CLEAR. Reference criteria are held as PAIRS — a
|
|
22
|
+
* scalar mirror for the payload and an object for display
|
|
23
|
+
* (`importateurCode` / `importateurId`). Clearing only the displayed key
|
|
24
|
+
* removes the chip from the screen while the criterion STAYS IN THE
|
|
25
|
+
* PAYLOAD: the worst of both worlds, an invisible filter that still
|
|
26
|
+
* filters. Hence `linkedKeys`.
|
|
27
|
+
*
|
|
28
|
+
* >>> THIS BUILDER DOES NOT RE-RUN THE SEARCH, and that is deliberate. `onRemove`
|
|
29
|
+
* >>> hands the host the keys to clear and gives the turn back: only the host
|
|
30
|
+
* >>> knows whether to clear Formik fields, rebuild its payload and redispatch —
|
|
31
|
+
* >>> and on server-paginated listings a removal is a REQUEST, not a local
|
|
32
|
+
* >>> filtering pass. A builder that dispatched would be wrong on every screen
|
|
33
|
+
* >>> whose payload it cannot know. <<<
|
|
34
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
35
|
+
*
|
|
36
|
+
* Promoted from `refonte-frontend` (Area 5), where it served ten listings.
|
|
37
|
+
* Pair it with `useAppliedFilters`: this builds the chips, that decides which
|
|
38
|
+
* criteria they may show — chips built from live form values announce a filter
|
|
39
|
+
* that is being typed and filters nothing.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/** A filterable criterion, as the screen describes it. */
|
|
43
|
+
|
|
44
|
+
/** Values that mean "not set" — see point 1 of the note above. */
|
|
45
|
+
function isEmpty(value) {
|
|
46
|
+
if (value === null || value === undefined || value === "") return true;
|
|
47
|
+
/* `0` is the "unset" value of reference mirrors on several hosts
|
|
48
|
+
* (`villeEntreeId: 0`, `importateurId: 0`). A chip for `0` would announce a
|
|
49
|
+
* criterion nobody chose. */
|
|
50
|
+
if (value === 0) return true;
|
|
51
|
+
if (Array.isArray(value) && value.length === 0) return true;
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Default rendering: a reference object's description, or the value. */
|
|
56
|
+
function formatDefault(value) {
|
|
57
|
+
if (value !== null && typeof value === "object") {
|
|
58
|
+
const object = value;
|
|
59
|
+
const readable = object["description"] ?? object["libelle"] ?? object["label"] ?? object["code"] ?? object["id"];
|
|
60
|
+
return readable === undefined ? "" : String(readable);
|
|
61
|
+
}
|
|
62
|
+
return String(value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* `true` if a criterion is SET — exactly the rule the chips use.
|
|
67
|
+
*
|
|
68
|
+
* Exported so a "Filters" button counter can count the same criteria the chips
|
|
69
|
+
* render. Screens used to count non-empty `formik.values`, which counts every
|
|
70
|
+
* reference criterion TWICE — the pair again — so picking one category showed
|
|
71
|
+
* "2 filters".
|
|
72
|
+
*/
|
|
73
|
+
export function isCriterionSet(value) {
|
|
74
|
+
return !isEmpty(value);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Every key of every descriptor — for a "clear all". */
|
|
78
|
+
export function filterCriteriaKeys(criteria) {
|
|
79
|
+
return criteria.flatMap(c => [c.key, ...(c.linkedKeys ?? [])]);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Builds the chips of the criteria that are SET.
|
|
84
|
+
*
|
|
85
|
+
* @param values current values of the search form (or the applied snapshot)
|
|
86
|
+
* @param criteria criteria to watch, in display order
|
|
87
|
+
* @param onRemove called with every key to clear for that criterion
|
|
88
|
+
*/
|
|
89
|
+
export function buildFilterChips(values, criteria, onRemove) {
|
|
90
|
+
return criteria.filter(criterion => !isEmpty(values[criterion.key])).map(criterion => {
|
|
91
|
+
const render = criterion.format ?? formatDefault;
|
|
92
|
+
const value = render(values[criterion.key]);
|
|
93
|
+
return {
|
|
94
|
+
key: criterion.key,
|
|
95
|
+
/* "Label: value" rather than the value alone: "AFFECTE" does not say
|
|
96
|
+
* WHICH criterion it is when three chips sit side by side. */
|
|
97
|
+
label: value ? `${criterion.label} : ${value}` : criterion.label,
|
|
98
|
+
onRemove: () => onRemove([criterion.key, ...(criterion.linkedKeys ?? [])])
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=filterCriteria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterCriteria.js","names":["isEmpty","value","undefined","Array","isArray","length","formatDefault","object","readable","String","isCriterionSet","filterCriteriaKeys","criteria","flatMap","c","key","linkedKeys","buildFilterChips","values","onRemove","filter","criterion","map","render","format","label"],"sources":["../../../../src/lib/v2/patterns/filterCriteria.ts"],"sourcesContent":["import type { DataGridToolbarFilterChip } from \"./DataGridToolbar\";\r\n\r\n/**\r\n * filterCriteria — active search criteria as removable chips\r\n * (capability gap G-42).\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY\r\n *\r\n * The library owns HALF of this already, and the half it owns is the rendering:\r\n * `DataGridToolbar.filterChips` draws one removable chip per criterion, and\r\n * `DataGridToolbarFilterChip` describes an entry. That type's own docstring\r\n * records where the request came from — `refonte-frontend`, whose ten listings\r\n * each had to build the array — and that §Filters and §Search make removable\r\n * active criteria a MUST.\r\n *\r\n * What was missing is the BUILDER. Ten local copies would have drifted on the\r\n * two things that are not obvious:\r\n *\r\n * 1. WHAT COUNTS AS SET. `0` is the \"unset\" value of a reference mirror on\r\n * some hosts (`villeEntreeId: 0`), `\"\"` on others, `null` elsewhere. A\r\n * chip that appears for `0` announces a filter nobody chose.\r\n * 2. WHAT A REMOVAL MUST CLEAR. Reference criteria are held as PAIRS — a\r\n * scalar mirror for the payload and an object for display\r\n * (`importateurCode` / `importateurId`). Clearing only the displayed key\r\n * removes the chip from the screen while the criterion STAYS IN THE\r\n * PAYLOAD: the worst of both worlds, an invisible filter that still\r\n * filters. Hence `linkedKeys`.\r\n *\r\n * >>> THIS BUILDER DOES NOT RE-RUN THE SEARCH, and that is deliberate. `onRemove`\r\n * >>> hands the host the keys to clear and gives the turn back: only the host\r\n * >>> knows whether to clear Formik fields, rebuild its payload and redispatch —\r\n * >>> and on server-paginated listings a removal is a REQUEST, not a local\r\n * >>> filtering pass. A builder that dispatched would be wrong on every screen\r\n * >>> whose payload it cannot know. <<<\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * Promoted from `refonte-frontend` (Area 5), where it served ten listings.\r\n * Pair it with `useAppliedFilters`: this builds the chips, that decides which\r\n * criteria they may show — chips built from live form values announce a filter\r\n * that is being typed and filters nothing.\r\n */\r\n\r\n/** A filterable criterion, as the screen describes it. */\r\nexport interface FilterCriterion {\r\n /** Form field holding the displayed value. */\r\n key: string;\r\n /** Label the user reads on the chip. */\r\n label: string;\r\n /**\r\n * Fields to clear IN ADDITION to `key` — scalar mirrors, ids. See the note\r\n * on pairs above: omitting them leaves the criterion in the payload.\r\n */\r\n linkedKeys?: string[] | undefined;\r\n /**\r\n * Renders the value on the chip. Defaults to the description of a reference\r\n * object, otherwise the value as-is.\r\n */\r\n format?: ((value: unknown) => string) | undefined;\r\n}\r\n\r\n/** Values that mean \"not set\" — see point 1 of the note above. */\r\nfunction isEmpty(value: unknown): boolean {\r\n if (value === null || value === undefined || value === \"\") return true;\r\n /* `0` is the \"unset\" value of reference mirrors on several hosts\r\n * (`villeEntreeId: 0`, `importateurId: 0`). A chip for `0` would announce a\r\n * criterion nobody chose. */\r\n if (value === 0) return true;\r\n if (Array.isArray(value) && value.length === 0) return true;\r\n return false;\r\n}\r\n\r\n/** Default rendering: a reference object's description, or the value. */\r\nfunction formatDefault(value: unknown): string {\r\n if (value !== null && typeof value === \"object\") {\r\n const object = value as Record<string, unknown>;\r\n const readable =\r\n object[\"description\"] ?? object[\"libelle\"] ?? object[\"label\"] ??\r\n object[\"code\"] ?? object[\"id\"];\r\n return readable === undefined ? \"\" : String(readable);\r\n }\r\n return String(value);\r\n}\r\n\r\n/**\r\n * `true` if a criterion is SET — exactly the rule the chips use.\r\n *\r\n * Exported so a \"Filters\" button counter can count the same criteria the chips\r\n * render. Screens used to count non-empty `formik.values`, which counts every\r\n * reference criterion TWICE — the pair again — so picking one category showed\r\n * \"2 filters\".\r\n */\r\nexport function isCriterionSet(value: unknown): boolean {\r\n return !isEmpty(value);\r\n}\r\n\r\n/** Every key of every descriptor — for a \"clear all\". */\r\nexport function filterCriteriaKeys(criteria: readonly FilterCriterion[]): string[] {\r\n return criteria.flatMap((c) => [c.key, ...(c.linkedKeys ?? [])]);\r\n}\r\n\r\n/**\r\n * Builds the chips of the criteria that are SET.\r\n *\r\n * @param values current values of the search form (or the applied snapshot)\r\n * @param criteria criteria to watch, in display order\r\n * @param onRemove called with every key to clear for that criterion\r\n */\r\nexport function buildFilterChips(\r\n values: Record<string, unknown>,\r\n criteria: readonly FilterCriterion[],\r\n onRemove: (keys: string[]) => void\r\n): DataGridToolbarFilterChip[] {\r\n return criteria\r\n .filter((criterion) => !isEmpty(values[criterion.key]))\r\n .map((criterion) => {\r\n const render = criterion.format ?? formatDefault;\r\n const value = render(values[criterion.key]);\r\n return {\r\n key: criterion.key,\r\n /* \"Label: value\" rather than the value alone: \"AFFECTE\" does not say\r\n * WHICH criterion it is when three chips sit side by side. */\r\n label: value ? `${criterion.label} : ${value}` : criterion.label,\r\n onRemove: () => onRemove([criterion.key, ...(criterion.linkedKeys ?? [])]),\r\n };\r\n });\r\n}\r\n"],"mappings":"AAEA;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;;AAkBA;AACA,SAASA,OAAOA,CAACC,KAAc,EAAW;EACxC,IAAIA,KAAK,KAAK,IAAI,IAAIA,KAAK,K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,CAACN,GAAG,CAAC,CAAC,CAAC,CACtDO,GAAG,CAAED,SAAS,IAAK;IAClB,MAAME,MAAM,GAAGF,SAAS,CAACG,MAAM,IAAIlB,aAAa;IAChD,MAAML,KAAK,GAAGsB,MAAM,CAACL,MAAM,CAACG,SAAS,CAACN,GAAG,CAAC,CAAC;IAC3C,OAAO;MACLA,GAAG,EAAEM,SAAS,CAACN,GAAG;MAClB;AACR;MACQU,KAAK,EAAExB,KAAK,GAAG,GAAGoB,SAAS,CAACI,KAAK,MAAMxB,KAAK,EAAE,GAAGoB,SAAS,CAACI,KAAK;MAChEN,QAAQ,EAAEA,CAAA,KAAMA,QAAQ,CAAC,CAACE,SAAS,CAACN,GAAG,EAAE,IAAIM,SAAS,CAACL,UAAU,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;EACH,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
export { default as ActionBar } from "./ActionBar";
|
|
2
|
+
/**
|
|
3
|
+
* AppMain — the `<main>` landmark (gap G-53).
|
|
4
|
+
*
|
|
5
|
+
* The library shipped HALF of a two-part contract: `SkipLink`'s docblock
|
|
6
|
+
* prescribes `<main id="main-content">` as its target and the library never
|
|
7
|
+
* provided it, so every module wrote the landmark — with `tabIndex={-1}`
|
|
8
|
+
* (without which the skip link scrolls but does not move focus in Safari),
|
|
9
|
+
* `outline: none` (R-F.1: the ring belongs on controls, not on a whole page),
|
|
10
|
+
* and the content measure of R-L.5, a MUST nothing here honoured:
|
|
11
|
+
* `PageContent` owns the canonical padding and caps NOTHING, so a certified
|
|
12
|
+
* module still stretched its tables across a 1920 px display.
|
|
13
|
+
*
|
|
14
|
+
* Two copies existed in the portfolio (autorisation-admis-pour-conforme-fe and
|
|
15
|
+
* the reference module ms-ti-fe), which is what a gap looks like from the
|
|
16
|
+
* outside.
|
|
17
|
+
*/
|
|
18
|
+
export { default as AppMain } from "./AppMain";
|
|
2
19
|
export { default as BulkActionBar } from "./BulkActionBar";
|
|
20
|
+
/**
|
|
21
|
+
* ChartFigure — a chart, its title, and its TEXT EQUIVALENT (gap G-55).
|
|
22
|
+
*
|
|
23
|
+
* `tokens/chart` states the obligation and shipped nothing to meet it, in its
|
|
24
|
+
* own words: the palette "does not make a chart accessible. Every consumer
|
|
25
|
+
* still owes a legend with text labels, and a text equivalent of the data —
|
|
26
|
+
* 1.1.1 for the chart as a whole." A rule stated without a component to carry
|
|
27
|
+
* it is met by whoever remembers it, and the text equivalent is the part that
|
|
28
|
+
* goes missing first — the only one nobody SEES missing.
|
|
29
|
+
*
|
|
30
|
+
* Hence `caption` being REQUIRED: a chart rendered through here cannot ship
|
|
31
|
+
* without its numbers in text. The canvas is `aria-hidden` (a renderer emits
|
|
32
|
+
* dozens of unstructured SVG text nodes, which is noise worse than silence) —
|
|
33
|
+
* so no interactive control goes inside it.
|
|
34
|
+
*/
|
|
35
|
+
export { default as ChartFigure } from "./ChartFigure";
|
|
3
36
|
export { default as ColumnsToggle } from "./ColumnsToggle";
|
|
4
37
|
export { default as FormSection } from "./FormSection";
|
|
5
38
|
export { default as FormPageShell } from "./FormPageShell";
|
|
@@ -7,11 +40,130 @@ export { default as FormErrorSummary } from "./FormErrorSummary";
|
|
|
7
40
|
// R-FV.3 companion to FormErrorSummary (R-FV.2) — renders nothing, moves
|
|
8
41
|
// focus to the first field in error after a failed submit. Adopt both.
|
|
9
42
|
export { default as FormikErrorFocus } from "./FormikErrorFocus";
|
|
43
|
+
/**
|
|
44
|
+
* FormikErrorSummary — the Formik bridge for FormErrorSummary (R-FV.2).
|
|
45
|
+
*
|
|
46
|
+
* The library owned all three parts of the failed-submit recipe and no way to
|
|
47
|
+
* assemble them inside the form shape modules actually write:
|
|
48
|
+
* `FormErrorSummary` renders the banner from a flat list,
|
|
49
|
+
* `flattenFormikErrors` (G-38) produces that list, `focusFieldByName`
|
|
50
|
+
* (R-FV.3) resolves an item back to its control.
|
|
51
|
+
*
|
|
52
|
+
* Reaching `errors` / `submitCount` needs the Formik CONTEXT, and the
|
|
53
|
+
* prevailing shape is `<Formik><Form>…</Form></Formik>` with STATIC children —
|
|
54
|
+
* the host's body sits outside the provider, and `innerRef` does not help
|
|
55
|
+
* because mutating a ref does not re-render the holder when `errors` changes.
|
|
56
|
+
* So each host had to convert its form to a render-prop purely to reach the
|
|
57
|
+
* errors, or write a local null-rendering context reader.
|
|
58
|
+
*
|
|
59
|
+
* Raised from ms-ti-fe (Area 11), where ONE of eleven Formik forms had the
|
|
60
|
+
* banner: wiring the other ten meant ten copies of that wrapper. The sibling
|
|
61
|
+
* rule HAS a bridge (`FormikErrorFocus`), which is why field adoption of the
|
|
62
|
+
* two MUSTs diverged — the one needing boilerplate is the one nobody applied.
|
|
63
|
+
*/
|
|
64
|
+
export { default as FormikErrorSummary } from "./FormikErrorSummary";
|
|
10
65
|
export { default as PageContent } from "./PageContent";
|
|
66
|
+
/**
|
|
67
|
+
* DetailSplit — content + progression rail on a consultation page (gap G-44).
|
|
68
|
+
*
|
|
69
|
+
* §Detail / Consultation Pattern makes the vertical progress rail a MUST on
|
|
70
|
+
* every consultation page, and §07 R-L.7 fixes the skeleton. The library shipped
|
|
71
|
+
* the rail (`VStepper`) and not the geometry that places it beside the record,
|
|
72
|
+
* so each host wrote the same three-value flex row by hand.
|
|
73
|
+
*
|
|
74
|
+
* Promoted from `refonte-frontend` (Area 4), where the SAME row existed twice
|
|
75
|
+
* — `DetailPage` and `TraitementDemande` — with `560` / `300` / `260` written
|
|
76
|
+
* out in both (R-2.3), and already drifting: neither `<aside>` had an
|
|
77
|
+
* accessible name. Widths now live in `tokens.layout.detail`.
|
|
78
|
+
*/
|
|
79
|
+
export { default as DetailSplit } from "./DetailSplit";
|
|
80
|
+
/**
|
|
81
|
+
* PreviewDrawer — the listing preview, body included (gap G-40).
|
|
82
|
+
*
|
|
83
|
+
* §Row Interaction and §Preview Drawer are MUST on every listing page of the
|
|
84
|
+
* platform, and the library shipped only `Drawer`, the empty shell. Each module
|
|
85
|
+
* assembled the same summary by hand, and the copies drifted where it shows
|
|
86
|
+
* least: `ms-ti-fe` uses `KVGrid` + `KV`, `refonte-frontend` had built a local
|
|
87
|
+
* `<dl>` with its own grid — one concept, two renderings (R-2.1).
|
|
88
|
+
*
|
|
89
|
+
* Promoted from `refonte-frontend` (Area 5). Reads NO field of `row`, which is
|
|
90
|
+
* what removed the `as unknown as` assertion its single-component ancestor
|
|
91
|
+
* needed; business defaults live in a host wrapper over a concrete row type.
|
|
92
|
+
*/
|
|
93
|
+
export { default as PreviewDrawer } from "./PreviewDrawer";
|
|
11
94
|
export { default as DataGrid, applySort } from "./DataGrid";
|
|
95
|
+
/**
|
|
96
|
+
* DataGridVirtualized — la seconde table, pour les grands volumes.
|
|
97
|
+
*
|
|
98
|
+
* Sa frontière d'emploi est énoncée dans son propre en-tête : au-delà de mille
|
|
99
|
+
* lignes où la pagination paraîtrait artificielle (journaux d'audit, « tout
|
|
100
|
+
* afficher ») ; sous cent lignes, `DataGrid` est plus simple.
|
|
101
|
+
*
|
|
102
|
+
* >>> LES TYPES SONT AJOUTÉS ICI (audit lot 12, Area 13) — MÊME CLASSE
|
|
103
|
+
* >>> GAP-TS-003 QUE CE FICHIER DOCUMENTE DÉJÀ CINQ FOIS. La VALEUR était
|
|
104
|
+
* >>> exportée, les types décrivant ses props ne l'étaient pas : un hôte ne
|
|
105
|
+
* >>> pouvait donc ni écrire un adaptateur typé autour de ce composant, ni
|
|
106
|
+
* >>> nommer `DataGridVirtualizedDensity` — dont il a besoin, puisque ce
|
|
107
|
+
* >>> palier de HAUTEUR DE LIGNE compte quatre valeurs là où le `Density`
|
|
108
|
+
* >>> canonique en a deux. Le repli aurait été un jumeau local, que les
|
|
109
|
+
* >>> Platform TypeScript Guidelines interdisent.
|
|
110
|
+
* >>>
|
|
111
|
+
* >>> Relevé depuis `autorisation-admis-pour-conforme-fe` (Area 13) : ce
|
|
112
|
+
* >>> module n'utilise pas ce composant — il pagine côté serveur — mais son
|
|
113
|
+
* >>> audit RGESN a dû établir où vivait la virtualisation, et a trouvé une
|
|
114
|
+
* >>> capacité complète dont la surface type était muette.
|
|
115
|
+
* >>>
|
|
116
|
+
* >>> Additif et purement typographique : aucun changement d'exécution. <<<
|
|
117
|
+
*/
|
|
12
118
|
export { default as DataGridVirtualized } from "./DataGridVirtualized";
|
|
13
119
|
export { default as DataGridSettingsMenu } from "./DataGridSettingsMenu";
|
|
14
120
|
export { default as DataGridToolbar } from "./DataGridToolbar";
|
|
121
|
+
/**
|
|
122
|
+
* rowActions — business descriptors → the row's kebab menu (gap G-41).
|
|
123
|
+
*
|
|
124
|
+
* The library shipped both halves — `OverflowMenu` renders flat actions,
|
|
125
|
+
* `DataGrid.rowActions` takes a `(row) => ReactNode` — and not the step
|
|
126
|
+
* between them, which every listing wrote for itself while carrying three
|
|
127
|
+
* Charter rules (R-3.3, R-B.6, R-K.1).
|
|
128
|
+
*
|
|
129
|
+
* `buildRowActionMenu` is exported alongside the renderer on purpose: a row
|
|
130
|
+
* appears twice, as a table row and as a `MobileRowCard` whose `actions` prop
|
|
131
|
+
* takes `OverflowMenuAction[]` rather than a node. Without it, hosts rebuilt
|
|
132
|
+
* the menu by hand for the card and the two copies drifted — the same failure
|
|
133
|
+
* the library records for `RowFavoriteToggle` (G-36).
|
|
134
|
+
*
|
|
135
|
+
* Promoted from `refonte-frontend` (Area 5), where it served twelve screens.
|
|
136
|
+
*/
|
|
137
|
+
export { buildRowActions, buildRowActionMenu, MAX_ROW_ACTIONS } from "./rowActions";
|
|
138
|
+
/**
|
|
139
|
+
* FilterTabBar — the status-chip bar of a listing card (gap G-45).
|
|
140
|
+
*
|
|
141
|
+
* §Status Chips is a MUST on every listing, and the library shipped the PILL
|
|
142
|
+
* (`FilterTab`) without the bar that seats it — so each listing re-derived the
|
|
143
|
+
* row geometry, the card-header separator, and the split between the status
|
|
144
|
+
* group and the personalization controls.
|
|
145
|
+
*
|
|
146
|
+
* Promoted from `refonte-frontend` (Area 5), where FOUR listings carried the
|
|
147
|
+
* same `BARRE_CHIPS_STATUT` + `GROUPE_BARRE` pair — and had already drifted:
|
|
148
|
+
* one of the four omitted `justifyContent: "space-between"`, so the same
|
|
149
|
+
* listing family rendered two different layouts (R-2.1).
|
|
150
|
+
*/
|
|
151
|
+
export { default as FilterTabBar } from "./FilterTabBar";
|
|
152
|
+
/**
|
|
153
|
+
* filterCriteria — active criteria as removable chips (gap G-42).
|
|
154
|
+
*
|
|
155
|
+
* The library owned the RENDERING (`DataGridToolbar.filterChips` and the
|
|
156
|
+
* `DataGridToolbarFilterChip` type, itself added at this module's request) and
|
|
157
|
+
* not the builder. Ten local copies would have drifted on the two things that
|
|
158
|
+
* are not obvious: what counts as SET (`0` is the unset value of a reference
|
|
159
|
+
* mirror on several hosts) and what a removal must CLEAR (reference criteria
|
|
160
|
+
* are held as pairs, so clearing only the displayed key leaves an invisible
|
|
161
|
+
* filter that still filters).
|
|
162
|
+
*
|
|
163
|
+
* Pair with `useAppliedFilters`. Promoted from `refonte-frontend` (Area 5).
|
|
164
|
+
*/
|
|
165
|
+
export { buildFilterChips, filterCriteriaKeys, isCriterionSet } from "./filterCriteria";
|
|
166
|
+
|
|
15
167
|
/**
|
|
16
168
|
* DataGridToolbar contracts — public typed surface (gap G-I).
|
|
17
169
|
*
|