@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
|
@@ -3,20 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = makeFavoriteColumn;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
9
|
var _RowFavoriteToggle = _interopRequireWildcard(require("./RowFavoriteToggle"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
-
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); } /**
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
20
14
|
* FavoriteColumn - Portnet UI v2 (pattern)
|
|
21
15
|
*
|
|
22
16
|
* `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for
|
|
@@ -62,12 +56,14 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
62
56
|
* `mobileBreakpoint`, and the copies drifted on their accessible names. Both
|
|
63
57
|
* now render the same component, so desktop and mobile agree by construction.
|
|
64
58
|
*/
|
|
65
|
-
|
|
59
|
+
|
|
60
|
+
const DEFAULT_LABELS = Object.freeze({
|
|
61
|
+
..._RowFavoriteToggle.DEFAULT_ROW_FAVORITE_LABELS,
|
|
66
62
|
columnHeader: "Suivis"
|
|
67
|
-
})
|
|
63
|
+
});
|
|
68
64
|
|
|
69
65
|
/** Visually hidden, but exposed to assistive tech (the column's accessible name). */
|
|
70
|
-
|
|
66
|
+
const SR_ONLY_SX = Object.freeze({
|
|
71
67
|
position: "absolute",
|
|
72
68
|
width: "1px",
|
|
73
69
|
height: "1px",
|
|
@@ -82,23 +78,26 @@ var SR_ONLY_SX = Object.freeze({
|
|
|
82
78
|
* Builds a v2 DataGrid column definition for the compact follow-star column.
|
|
83
79
|
*/
|
|
84
80
|
function makeFavoriteColumn(options) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
const opts = options;
|
|
82
|
+
const resourceKey = opts.resourceKey;
|
|
83
|
+
const getRowId = typeof opts.getRowId === "function" ? opts.getRowId : function defaultGetRowId(r) {
|
|
88
84
|
return r.id;
|
|
89
85
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
const key = opts.key || "__favorite__";
|
|
87
|
+
const size = opts.size || "sm";
|
|
88
|
+
const width = opts.width != null ? opts.width : 44;
|
|
89
|
+
const getRowLabel = typeof opts.getRowLabel === "function" ? opts.getRowLabel : null;
|
|
90
|
+
const L = opts.labels ? {
|
|
91
|
+
...DEFAULT_LABELS,
|
|
92
|
+
...opts.labels
|
|
93
|
+
} : DEFAULT_LABELS;
|
|
95
94
|
if (process.env["NODE_ENV"] !== "production" && !resourceKey) {
|
|
96
95
|
// eslint-disable-next-line no-console
|
|
97
96
|
console.warn("[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.");
|
|
98
97
|
}
|
|
99
98
|
return {
|
|
100
99
|
key: key,
|
|
101
|
-
header: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box
|
|
100
|
+
header: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
102
101
|
component: "span",
|
|
103
102
|
sx: SR_ONLY_SX,
|
|
104
103
|
children: L.columnHeader
|
|
@@ -111,7 +110,7 @@ function makeFavoriteColumn(options) {
|
|
|
111
110
|
reorderable: false,
|
|
112
111
|
width: width,
|
|
113
112
|
render: function renderFavorite(row) {
|
|
114
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowFavoriteToggle
|
|
113
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowFavoriteToggle.default, {
|
|
115
114
|
resourceKey: resourceKey,
|
|
116
115
|
rowId: getRowId(row),
|
|
117
116
|
size: size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteColumn.js","names":["React","_interopRequireWildcard","require","_Box","_interopRequireDefault","_RowFavoriteToggle","_jsxRuntime","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Symbol","iterator","constructor","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","TypeError","Number","DEFAULT_LABELS","freeze","DEFAULT_ROW_FAVORITE_LABELS","columnHeader","SR_ONLY_SX","position","width","height","padding","margin","overflow","clip","whiteSpace","border","makeFavoriteColumn","options","opts","resourceKey","getRowId","defaultGetRowId","r","id","size","getRowLabel","L","labels","process","env","console","warn","header","jsx","component","sx","children","align","sortable","toggleable","resizable","reorderable","render","renderFavorite","row","rowId","rowLabel"],"sources":["../../../src/lib/v2/patterns/FavoriteColumn.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport RowFavoriteToggle, {\r\n DEFAULT_ROW_FAVORITE_LABELS,\r\n} from \"./RowFavoriteToggle\";\r\nimport type {\r\n FavoriteToggleSize,\r\n RowFavoriteToggleLabels,\r\n} from \"./RowFavoriteToggle\";\r\nimport type { DataGridColumn } from \"../types/datagrid\";\r\nimport type { RowId } from \"../types/common\";\r\n\r\n/**\r\n * FavoriteColumn - Portnet UI v2 (pattern)\r\n *\r\n * `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for\r\n * a compact \"follow\" (suivi) star column. Spread it into the grid's\r\n * `columns` first so it sits at the LEFT of each row:\r\n *\r\n * const columns = [\r\n * makeFavoriteColumn({ resourceKey: \"ti:list\", getRowId: (r) => r.reference }),\r\n * { key: \"reference\", header: \"Référence\", ... },\r\n * ...\r\n * ];\r\n * <DataGrid columns={columns} rows={rows} getRowId={(r) => r.reference} ... />\r\n *\r\n * Behaviour:\r\n * - ALWAYS VISIBLE: the star is rendered on every row in both states\r\n * (filled ★ when followed, outline ☆ when not) — it is NOT\r\n * hover-revealed. It sits at the left of the row.\r\n * - COMPACT: no visible column header (the header carries only a\r\n * visually hidden accessible name \"Suivis\"), and a narrow 44px width,\r\n * so the column takes minimal space.\r\n * - STATUS TOOLTIP: hovering or focusing the star shows its current\r\n * status — \"Suivi\" when followed, \"Non suivi\" otherwise. The button's\r\n * accessible name stays action-oriented (\"Suivre\" / \"Ne plus suivre\",\r\n * optionally enriched with the row label) and aria-pressed conveys the\r\n * state, so screen-reader semantics are unaffected.\r\n * - `toggleable: false` keeps the column out of ColumnsToggle (the user\r\n * can't hide it); not sortable / resizable / reorderable (sorting BY\r\n * follow status is a separate concern — see useFavoritesView /\r\n * sortRowsByFavorites).\r\n * - Each cell reads useIsFavorite (a boolean selector), so toggling one\r\n * row re-renders only that row's star.\r\n * - Toggling never triggers the row's onRowClick (click + keydown\r\n * propagation stopped, mirroring the DataGrid selection checkbox).\r\n *\r\n * `getRowId` MUST match the one passed to <DataGrid> so the follow id and\r\n * the grid row id agree. Requires a <UserPersonalizationProvider>\r\n * ancestor (useIsFavorite throws otherwise).\r\n *\r\n * The per-row star itself is `RowFavoriteToggle` (gap G-36). It used to be a\r\n * private `FavoriteCell` in this file, which made the follow control reachable\r\n * as a DataGrid column and nowhere else — so hosts rebuilt it by hand for the\r\n * `MobileRowCard` `leading` slot that DataGrid switches to below its\r\n * `mobileBreakpoint`, and the copies drifted on their accessible names. Both\r\n * now render the same component, so desktop and mobile agree by construction.\r\n */\r\n\r\nexport interface FavoriteColumnLabels extends RowFavoriteToggleLabels {\r\n columnHeader: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n ...DEFAULT_ROW_FAVORITE_LABELS,\r\n columnHeader: \"Suivis\",\r\n} satisfies FavoriteColumnLabels);\r\n\r\n/** Visually hidden, but exposed to assistive tech (the column's accessible name). */\r\nconst SR_ONLY_SX = Object.freeze({\r\n position: \"absolute\",\r\n width: \"1px\",\r\n height: \"1px\",\r\n padding: 0,\r\n margin: \"-1px\",\r\n overflow: \"hidden\",\r\n clip: \"rect(0 0 0 0)\",\r\n whiteSpace: \"nowrap\",\r\n border: 0,\r\n} satisfies SxProps<Theme>);\r\n\r\nexport interface MakeFavoriteColumnOptions<T> {\r\n /** Required — follow namespace. */\r\n resourceKey: string;\r\n /** MUST match the grid's getRowId. Defaults to (r) => r.id. */\r\n getRowId?: ((row: T) => RowId) | undefined;\r\n /** Column key. @default \"__favorite__\" */\r\n key?: string | undefined;\r\n /** Toggle size (sm fits dense rows). @default \"sm\" */\r\n size?: FavoriteToggleSize | undefined;\r\n /** Column width (narrow / compact). @default 44 */\r\n width?: number | string | undefined;\r\n /** (row) => string, enriches the per-row aria-label. */\r\n getRowLabel?: ((row: T) => string) | undefined;\r\n labels?: Partial<FavoriteColumnLabels> | undefined;\r\n}\r\n\r\n/**\r\n * Builds a v2 DataGrid column definition for the compact follow-star column.\r\n */\r\nexport default function makeFavoriteColumn<T>(\r\n options: MakeFavoriteColumnOptions<T>\r\n): DataGridColumn<T> {\r\n const opts = options;\r\n const resourceKey = opts.resourceKey;\r\n const getRowId: (row: T) => RowId =\r\n typeof opts.getRowId === \"function\"\r\n ? opts.getRowId\r\n : function defaultGetRowId(r: T): RowId {\r\n return (r as { id: RowId }).id;\r\n };\r\n const key = opts.key || \"__favorite__\";\r\n const size = opts.size || \"sm\";\r\n const width: number | string = opts.width != null ? opts.width : 44;\r\n const getRowLabel =\r\n typeof opts.getRowLabel === \"function\" ? opts.getRowLabel : null;\r\n const L: FavoriteColumnLabels = opts.labels\r\n ? { ...DEFAULT_LABELS, ...opts.labels }\r\n : DEFAULT_LABELS;\r\n\r\n if (process.env[\"NODE_ENV\"] !== \"production\" && !resourceKey) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n \"[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.\"\r\n );\r\n }\r\n\r\n return {\r\n key: key,\r\n header: (\r\n <Box component=\"span\" sx={SR_ONLY_SX}>\r\n {L.columnHeader}\r\n </Box>\r\n ),\r\n align: \"center\",\r\n sortable: false,\r\n toggleable: false, // kept out of ColumnsToggle (cannot be hidden)\r\n resizable: false,\r\n reorderable: false,\r\n width: width,\r\n render: function renderFavorite(row: T): React.ReactNode {\r\n return (\r\n <RowFavoriteToggle\r\n resourceKey={resourceKey}\r\n rowId={getRowId(row)}\r\n size={size}\r\n labels={L}\r\n rowLabel={getRowLabel ? getRowLabel(row) : undefined}\r\n />\r\n );\r\n },\r\n };\r\n}\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAE6B,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,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EAAE,KAAK;IAAE;IACnBC,SAAS,EAAE,KAAK;IAChBC,WAAW,EAAE,KAAK;IAClBjC,KAAK,EAAEA,KAAK;IACZkC,MAAM,EAAE,SAASC,cAAcA,CAACC,GAAM,EAAmB;MACvD,oBACE,IAAAxG,WAAA,CAAA6F,GAAA,EAAC9F,kBAAA,WAAiB;QAChBgF,WAAW,EAAEA,WAAY;QACzB0B,KAAK,EAAEzB,QAAQ,CAACwB,GAAG,CAAE;QACrBpB,IAAI,EAAEA,IAAK;QACXG,MAAM,EAAED,CAAE;QACVoB,QAAQ,EAAErB,WAAW,GAAGA,WAAW,CAACmB,GAAG,CAAC,GAAG9C;MAAU,CACtD,CAAC;IAEN;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FavoriteColumn.js","names":["React","_interopRequireWildcard","require","_Box","_interopRequireDefault","_RowFavoriteToggle","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","freeze","DEFAULT_ROW_FAVORITE_LABELS","columnHeader","SR_ONLY_SX","position","width","height","padding","margin","overflow","clip","whiteSpace","border","makeFavoriteColumn","options","opts","resourceKey","getRowId","defaultGetRowId","id","key","size","getRowLabel","L","labels","process","env","console","warn","header","jsx","component","sx","children","align","sortable","toggleable","resizable","reorderable","render","renderFavorite","row","rowId","rowLabel","undefined"],"sources":["../../../src/lib/v2/patterns/FavoriteColumn.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport RowFavoriteToggle, {\r\n DEFAULT_ROW_FAVORITE_LABELS,\r\n} from \"./RowFavoriteToggle\";\r\nimport type {\r\n FavoriteToggleSize,\r\n RowFavoriteToggleLabels,\r\n} from \"./RowFavoriteToggle\";\r\nimport type { DataGridColumn } from \"../types/datagrid\";\r\nimport type { RowId } from \"../types/common\";\r\n\r\n/**\r\n * FavoriteColumn - Portnet UI v2 (pattern)\r\n *\r\n * `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for\r\n * a compact \"follow\" (suivi) star column. Spread it into the grid's\r\n * `columns` first so it sits at the LEFT of each row:\r\n *\r\n * const columns = [\r\n * makeFavoriteColumn({ resourceKey: \"ti:list\", getRowId: (r) => r.reference }),\r\n * { key: \"reference\", header: \"Référence\", ... },\r\n * ...\r\n * ];\r\n * <DataGrid columns={columns} rows={rows} getRowId={(r) => r.reference} ... />\r\n *\r\n * Behaviour:\r\n * - ALWAYS VISIBLE: the star is rendered on every row in both states\r\n * (filled ★ when followed, outline ☆ when not) — it is NOT\r\n * hover-revealed. It sits at the left of the row.\r\n * - COMPACT: no visible column header (the header carries only a\r\n * visually hidden accessible name \"Suivis\"), and a narrow 44px width,\r\n * so the column takes minimal space.\r\n * - STATUS TOOLTIP: hovering or focusing the star shows its current\r\n * status — \"Suivi\" when followed, \"Non suivi\" otherwise. The button's\r\n * accessible name stays action-oriented (\"Suivre\" / \"Ne plus suivre\",\r\n * optionally enriched with the row label) and aria-pressed conveys the\r\n * state, so screen-reader semantics are unaffected.\r\n * - `toggleable: false` keeps the column out of ColumnsToggle (the user\r\n * can't hide it); not sortable / resizable / reorderable (sorting BY\r\n * follow status is a separate concern — see useFavoritesView /\r\n * sortRowsByFavorites).\r\n * - Each cell reads useIsFavorite (a boolean selector), so toggling one\r\n * row re-renders only that row's star.\r\n * - Toggling never triggers the row's onRowClick (click + keydown\r\n * propagation stopped, mirroring the DataGrid selection checkbox).\r\n *\r\n * `getRowId` MUST match the one passed to <DataGrid> so the follow id and\r\n * the grid row id agree. Requires a <UserPersonalizationProvider>\r\n * ancestor (useIsFavorite throws otherwise).\r\n *\r\n * The per-row star itself is `RowFavoriteToggle` (gap G-36). It used to be a\r\n * private `FavoriteCell` in this file, which made the follow control reachable\r\n * as a DataGrid column and nowhere else — so hosts rebuilt it by hand for the\r\n * `MobileRowCard` `leading` slot that DataGrid switches to below its\r\n * `mobileBreakpoint`, and the copies drifted on their accessible names. Both\r\n * now render the same component, so desktop and mobile agree by construction.\r\n */\r\n\r\nexport interface FavoriteColumnLabels extends RowFavoriteToggleLabels {\r\n columnHeader: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n ...DEFAULT_ROW_FAVORITE_LABELS,\r\n columnHeader: \"Suivis\",\r\n} satisfies FavoriteColumnLabels);\r\n\r\n/** Visually hidden, but exposed to assistive tech (the column's accessible name). */\r\nconst SR_ONLY_SX = Object.freeze({\r\n position: \"absolute\",\r\n width: \"1px\",\r\n height: \"1px\",\r\n padding: 0,\r\n margin: \"-1px\",\r\n overflow: \"hidden\",\r\n clip: \"rect(0 0 0 0)\",\r\n whiteSpace: \"nowrap\",\r\n border: 0,\r\n} satisfies SxProps<Theme>);\r\n\r\nexport interface MakeFavoriteColumnOptions<T> {\r\n /** Required — follow namespace. */\r\n resourceKey: string;\r\n /** MUST match the grid's getRowId. Defaults to (r) => r.id. */\r\n getRowId?: ((row: T) => RowId) | undefined;\r\n /** Column key. @default \"__favorite__\" */\r\n key?: string | undefined;\r\n /** Toggle size (sm fits dense rows). @default \"sm\" */\r\n size?: FavoriteToggleSize | undefined;\r\n /** Column width (narrow / compact). @default 44 */\r\n width?: number | string | undefined;\r\n /** (row) => string, enriches the per-row aria-label. */\r\n getRowLabel?: ((row: T) => string) | undefined;\r\n labels?: Partial<FavoriteColumnLabels> | undefined;\r\n}\r\n\r\n/**\r\n * Builds a v2 DataGrid column definition for the compact follow-star column.\r\n */\r\nexport default function makeFavoriteColumn<T>(\r\n options: MakeFavoriteColumnOptions<T>\r\n): DataGridColumn<T> {\r\n const opts = options;\r\n const resourceKey = opts.resourceKey;\r\n const getRowId: (row: T) => RowId =\r\n typeof opts.getRowId === \"function\"\r\n ? opts.getRowId\r\n : function defaultGetRowId(r: T): RowId {\r\n return (r as { id: RowId }).id;\r\n };\r\n const key = opts.key || \"__favorite__\";\r\n const size = opts.size || \"sm\";\r\n const width: number | string = opts.width != null ? opts.width : 44;\r\n const getRowLabel =\r\n typeof opts.getRowLabel === \"function\" ? opts.getRowLabel : null;\r\n const L: FavoriteColumnLabels = opts.labels\r\n ? { ...DEFAULT_LABELS, ...opts.labels }\r\n : DEFAULT_LABELS;\r\n\r\n if (process.env[\"NODE_ENV\"] !== \"production\" && !resourceKey) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n \"[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.\"\r\n );\r\n }\r\n\r\n return {\r\n key: key,\r\n header: (\r\n <Box component=\"span\" sx={SR_ONLY_SX}>\r\n {L.columnHeader}\r\n </Box>\r\n ),\r\n align: \"center\",\r\n sortable: false,\r\n toggleable: false, // kept out of ColumnsToggle (cannot be hidden)\r\n resizable: false,\r\n reorderable: false,\r\n width: width,\r\n render: function renderFavorite(row: T): React.ReactNode {\r\n return (\r\n <RowFavoriteToggle\r\n resourceKey={resourceKey}\r\n rowId={getRowId(row)}\r\n size={size}\r\n labels={L}\r\n rowLabel={getRowLabel ? getRowLabel(row) : undefined}\r\n />\r\n );\r\n },\r\n };\r\n}\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAE6B,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAM,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,U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B;IAAY,CACZ,CACN;IACDgC,KAAK,EAAE,QAAQ;IACfC,QAAQ,EAAE,KAAK;IACfC,UAAU,EAAE,KAAK;IAAE;IACnBC,SAAS,EAAE,KAAK;IAChBC,WAAW,EAAE,KAAK;IAClBjC,KAAK,EAAEA,KAAK;IACZkC,MAAM,EAAE,SAASC,cAAcA,CAACC,GAAM,EAAmB;MACvD,oBACE,IAAA9D,WAAA,CAAAmD,GAAA,EAACpD,kBAAA,CAAAI,OAAiB;QAChBkC,WAAW,EAAEA,WAAY;QACzB0B,KAAK,EAAEzB,QAAQ,CAACwB,GAAG,CAAE;QACrBpB,IAAI,EAAEA,IAAK;QACXG,MAAM,EAAED,CAAE;QACVoB,QAAQ,EAAErB,WAAW,GAAGA,WAAW,CAACmB,GAAG,CAAC,GAAGG;MAAU,CACtD,CAAC;IAEN;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -3,21 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _StarRounded = _interopRequireDefault(require("@mui/icons-material/StarRounded"));
|
|
9
9
|
var _Segmented = _interopRequireDefault(require("../components/Segmented"));
|
|
10
10
|
var _mergeLabels = require("../utils/mergeLabels");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
-
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); } /**
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/**
|
|
21
15
|
* FavoritesFilter - Portnet UI v2 (pattern)
|
|
22
16
|
*
|
|
23
17
|
* Presentational "Tous / Suivis" toggle for the follow filter, built on
|
|
@@ -39,7 +33,8 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
39
33
|
* Values ("all" | "only") match FAVORITES_FILTER. Pass `fullWidth` to let
|
|
40
34
|
* it span its row on narrow / mobile toolbars.
|
|
41
35
|
*/
|
|
42
|
-
|
|
36
|
+
|
|
37
|
+
const DEFAULT_LABELS = Object.freeze({
|
|
43
38
|
all: "Tous",
|
|
44
39
|
favorites: "Suivis",
|
|
45
40
|
ariaLabel: "Filtrer par suivis"
|
|
@@ -48,51 +43,48 @@ function withCount(label, count) {
|
|
|
48
43
|
return typeof count === "number" ? label + " (" + count + ")" : label;
|
|
49
44
|
}
|
|
50
45
|
function FavoritesFilter(props) {
|
|
51
|
-
|
|
52
|
-
value =
|
|
53
|
-
onChange
|
|
54
|
-
favoriteCount
|
|
55
|
-
totalCount
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
sx = props.sx;
|
|
66
|
-
var L = React.useMemo(function () {
|
|
67
|
-
return (0, _mergeLabels.mergeLabels)(DEFAULT_LABELS, labels);
|
|
68
|
-
}, [labels]);
|
|
69
|
-
var options = React.useMemo(function buildOptions() {
|
|
46
|
+
const {
|
|
47
|
+
value = "all",
|
|
48
|
+
onChange,
|
|
49
|
+
favoriteCount,
|
|
50
|
+
totalCount,
|
|
51
|
+
showCounts = true,
|
|
52
|
+
showIcon = true,
|
|
53
|
+
size = "sm",
|
|
54
|
+
fullWidth = false,
|
|
55
|
+
labels,
|
|
56
|
+
sx
|
|
57
|
+
} = props;
|
|
58
|
+
const L = React.useMemo(() => (0, _mergeLabels.mergeLabels)(DEFAULT_LABELS, labels), [labels]);
|
|
59
|
+
const options = React.useMemo(function buildOptions() {
|
|
70
60
|
return [{
|
|
71
61
|
value: "all",
|
|
72
62
|
label: showCounts ? withCount(L.all, totalCount) : L.all
|
|
73
|
-
},
|
|
63
|
+
}, {
|
|
74
64
|
value: "only",
|
|
75
|
-
label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
65
|
+
label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites,
|
|
66
|
+
...(showIcon ? {
|
|
67
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StarRounded.default, {
|
|
68
|
+
fontSize: "small"
|
|
69
|
+
})
|
|
70
|
+
} : {})
|
|
71
|
+
}];
|
|
81
72
|
}, [L, showCounts, showIcon, totalCount, favoriteCount]);
|
|
82
|
-
|
|
73
|
+
const handleChange = React.useCallback(function handleChange(v) {
|
|
83
74
|
// Segmented emits its configured option values only ("all" / "only").
|
|
84
75
|
if (onChange) onChange(v);
|
|
85
76
|
}, [onChange]);
|
|
86
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segmented
|
|
77
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segmented.default, {
|
|
87
78
|
value: value,
|
|
88
79
|
onChange: handleChange,
|
|
89
80
|
options: options,
|
|
90
81
|
size: size,
|
|
91
82
|
fullWidth: fullWidth,
|
|
92
|
-
"aria-label": L.ariaLabel
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
"aria-label": L.ariaLabel,
|
|
84
|
+
...(sx !== undefined ? {
|
|
85
|
+
sx
|
|
86
|
+
} : {})
|
|
87
|
+
});
|
|
96
88
|
}
|
|
97
|
-
var _default = exports
|
|
89
|
+
var _default = exports.default = FavoritesFilter;
|
|
98
90
|
//# sourceMappingURL=FavoritesFilter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritesFilter.js","names":["React","_interopRequireWildcard","require","_StarRounded","_interopRequireDefault","_Segmented","_mergeLabels","_jsxRuntime","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Symbol","iterator","constructor","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","TypeError","Number","DEFAULT_LABELS","freeze","all","favorites","ariaLabel","withCount","label","count","FavoritesFilter","props","_props$value","onChange","favoriteCount","totalCount","_props$showCounts","showCounts","_props$showIcon","showIcon","_props$size","size","_props$fullWidth","fullWidth","labels","sx","L","useMemo","mergeLabels","options","buildOptions","icon","jsx","fontSize","handleChange","useCallback","v","_default","exports"],"sources":["../../../src/lib/v2/patterns/FavoritesFilter.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport StarRoundedIcon from \"@mui/icons-material/StarRounded\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport Segmented from \"../components/Segmented\";\r\nimport type { SegmentedOption, SegmentedValue } from \"../components/Segmented\";\r\nimport type { FavoritesFilterMode } from \"../personalization/capabilities/favoritesView\";\r\nimport { mergeLabels } from \"../utils/mergeLabels\";\r\n\r\n/**\r\n * FavoritesFilter - Portnet UI v2 (pattern)\r\n *\r\n * Presentational \"Tous / Suivis\" toggle for the follow filter, built on\r\n * the v2 Segmented (role=radiogroup, arrow-key selection, focus halo).\r\n * Provider-free — drive it from the same state you pass to\r\n * useFavoritesView:\r\n *\r\n * const [favFilter, setFavFilter] = React.useState(\"all\");\r\n * const view = useFavoritesView(\"ti:list\", rows, {\r\n * getRowId, filterMode: favFilter,\r\n * });\r\n * <FavoritesFilter\r\n * value={favFilter}\r\n * onChange={setFavFilter}\r\n * favoriteCount={view.favoriteCount}\r\n * totalCount={rows.length}\r\n * />\r\n *\r\n * Values (\"all\" | \"only\") match FAVORITES_FILTER. Pass `fullWidth` to let\r\n * it span its row on narrow / mobile toolbars.\r\n */\r\n\r\nexport interface FavoritesFilterLabels {\r\n all: string;\r\n favorites: string;\r\n ariaLabel: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n all: \"Tous\",\r\n favorites: \"Suivis\",\r\n ariaLabel: \"Filtrer par suivis\",\r\n} satisfies FavoritesFilterLabels);\r\n\r\nfunction withCount(label: string, count: number | undefined): string {\r\n return typeof count === \"number\" ? label + \" (\" + count + \")\" : label;\r\n}\r\n\r\nexport interface FavoritesFilterProps {\r\n /** Current mode (matches FAVORITES_FILTER). @default \"all\" */\r\n value?: FavoritesFilterMode | undefined;\r\n /** (mode) => void. */\r\n onChange?: ((value: FavoritesFilterMode) => void) | undefined;\r\n /** Count shown on the \"Suivis\" segment. */\r\n favoriteCount?: number | undefined;\r\n /** Count shown on the \"Tous\" segment. */\r\n totalCount?: number | undefined;\r\n showCounts?: boolean | undefined;\r\n showIcon?: boolean | undefined;\r\n size?: \"sm\" | \"md\" | undefined;\r\n /** Span the available width — useful on narrow / mobile toolbars. */\r\n fullWidth?: boolean | undefined;\r\n /** Localised labels (FR default; EN/AR supported). */\r\n labels?: Partial<FavoritesFilterLabels> | undefined;\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FavoritesFilter(props: FavoritesFilterProps): React.JSX.Element {\r\n const {\r\n value = \"all\",\r\n onChange,\r\n favoriteCount,\r\n totalCount,\r\n showCounts = true,\r\n showIcon = true,\r\n size = \"sm\",\r\n fullWidth = false,\r\n labels,\r\n sx,\r\n } = props;\r\n const L = React.useMemo<FavoritesFilterLabels>(\r\n () => (mergeLabels(DEFAULT_LABELS, labels)),\r\n [labels]\r\n );\r\n\r\n const options = React.useMemo<SegmentedOption[]>(\r\n function buildOptions() {\r\n return [\r\n {\r\n value: \"all\",\r\n label: showCounts ? withCount(L.all, totalCount) : L.all,\r\n },\r\n {\r\n value: \"only\",\r\n label: showCounts\r\n ? withCount(L.favorites, favoriteCount)\r\n : L.favorites,\r\n ...(showIcon ? { icon: <StarRoundedIcon fontSize=\"small\" /> } : {}),\r\n },\r\n ];\r\n },\r\n [L, showCounts, showIcon, totalCount, favoriteCount]\r\n );\r\n\r\n const handleChange = React.useCallback(\r\n function handleChange(v: SegmentedValue): void {\r\n // Segmented emits its configured option values only (\"all\" / \"only\").\r\n if (onChange) onChange(v as FavoritesFilterMode);\r\n },\r\n [onChange]\r\n );\r\n\r\n return (\r\n <Segmented\r\n value={value}\r\n onChange={handleChange}\r\n options={options}\r\n size={size}\r\n fullWidth={fullWidth}\r\n aria-label={L.ariaLabel}\r\n {...(sx !== undefined ? { sx } : {})}\r\n />\r\n );\r\n}\r\n\r\nexport default FavoritesFilter;\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AAAmD,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAE,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAO,GAAA,EAAAG,WAAA,SAAAA,WAAA,IAAAH,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAO,OAAA,CAAAP,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAQ,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AAAzE,WAAA,CAAA4F,GAAA,EAAC9F,UAAA,WAAS,EAAAuC,aAAA;IACRU,KAAK,EAAEA,KAAM;IACb0B,QAAQ,EAAEqB,YAAa;IACvBL,OAAO,EAAEA,OAAQ;IACjBR,IAAI,EAAEA,IAAK;IACXE,SAAS,EAAEA,SAAU;IACrB,cAAYG,CAAC,CAACpB;EAAU,GACnBmB,EAAE,KAAK3B,SAAS,GAAG;IAAE2B,EAAE,EAAFA;EAAG,CAAC,GAAG,CAAC,CAAC,CACpC,CAAC;AAEN;AAAC,IAAAY,QAAA,GAAAC,OAAA,cAEc5B,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FavoritesFilter.js","names":["React","_interopRequireWildcard","require","_StarRounded","_interopRequireDefault","_Segmented","_mergeLabels","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","freeze","all","favorites","ariaLabel","withCount","label","count","FavoritesFilter","props","value","onChange","favoriteCount","totalCount","showCounts","showIcon","size","fullWidth","labels","sx","L","useMemo","mergeLabels","options","buildOptions","icon","jsx","fontSize","handleChange","useCallback","v","undefined","_default","exports"],"sources":["../../../src/lib/v2/patterns/FavoritesFilter.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport StarRoundedIcon from \"@mui/icons-material/StarRounded\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport Segmented from \"../components/Segmented\";\r\nimport type { SegmentedOption, SegmentedValue } from \"../components/Segmented\";\r\nimport type { FavoritesFilterMode } from \"../personalization/capabilities/favoritesView\";\r\nimport { mergeLabels } from \"../utils/mergeLabels\";\r\n\r\n/**\r\n * FavoritesFilter - Portnet UI v2 (pattern)\r\n *\r\n * Presentational \"Tous / Suivis\" toggle for the follow filter, built on\r\n * the v2 Segmented (role=radiogroup, arrow-key selection, focus halo).\r\n * Provider-free — drive it from the same state you pass to\r\n * useFavoritesView:\r\n *\r\n * const [favFilter, setFavFilter] = React.useState(\"all\");\r\n * const view = useFavoritesView(\"ti:list\", rows, {\r\n * getRowId, filterMode: favFilter,\r\n * });\r\n * <FavoritesFilter\r\n * value={favFilter}\r\n * onChange={setFavFilter}\r\n * favoriteCount={view.favoriteCount}\r\n * totalCount={rows.length}\r\n * />\r\n *\r\n * Values (\"all\" | \"only\") match FAVORITES_FILTER. Pass `fullWidth` to let\r\n * it span its row on narrow / mobile toolbars.\r\n */\r\n\r\nexport interface FavoritesFilterLabels {\r\n all: string;\r\n favorites: string;\r\n ariaLabel: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n all: \"Tous\",\r\n favorites: \"Suivis\",\r\n ariaLabel: \"Filtrer par suivis\",\r\n} satisfies FavoritesFilterLabels);\r\n\r\nfunction withCount(label: string, count: number | undefined): string {\r\n return typeof count === \"number\" ? label + \" (\" + count + \")\" : label;\r\n}\r\n\r\nexport interface FavoritesFilterProps {\r\n /** Current mode (matches FAVORITES_FILTER). @default \"all\" */\r\n value?: FavoritesFilterMode | undefined;\r\n /** (mode) => void. */\r\n onChange?: ((value: FavoritesFilterMode) => void) | undefined;\r\n /** Count shown on the \"Suivis\" segment. */\r\n favoriteCount?: number | undefined;\r\n /** Count shown on the \"Tous\" segment. */\r\n totalCount?: number | undefined;\r\n showCounts?: boolean | undefined;\r\n showIcon?: boolean | undefined;\r\n size?: \"sm\" | \"md\" | undefined;\r\n /** Span the available width — useful on narrow / mobile toolbars. */\r\n fullWidth?: boolean | undefined;\r\n /** Localised labels (FR default; EN/AR supported). */\r\n labels?: Partial<FavoritesFilterLabels> | undefined;\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FavoritesFilter(props: FavoritesFilterProps): React.JSX.Element {\r\n const {\r\n value = \"all\",\r\n onChange,\r\n favoriteCount,\r\n totalCount,\r\n showCounts = true,\r\n showIcon = true,\r\n size = \"sm\",\r\n fullWidth = false,\r\n labels,\r\n sx,\r\n } = props;\r\n const L = React.useMemo<FavoritesFilterLabels>(\r\n () => (mergeLabels(DEFAULT_LABELS, labels)),\r\n [labels]\r\n );\r\n\r\n const options = React.useMemo<SegmentedOption[]>(\r\n function buildOptions() {\r\n return [\r\n {\r\n value: \"all\",\r\n label: showCounts ? withCount(L.all, totalCount) : L.all,\r\n },\r\n {\r\n value: \"only\",\r\n label: showCounts\r\n ? withCount(L.favorites, favoriteCount)\r\n : L.favorites,\r\n ...(showIcon ? { icon: <StarRoundedIcon fontSize=\"small\" /> } : {}),\r\n },\r\n ];\r\n },\r\n [L, showCounts, showIcon, totalCount, favoriteCount]\r\n );\r\n\r\n const handleChange = React.useCallback(\r\n function handleChange(v: SegmentedValue): void {\r\n // Segmented emits its configured option values only (\"all\" / \"only\").\r\n if (onChange) onChange(v as FavoritesFilterMode);\r\n },\r\n [onChange]\r\n );\r\n\r\n return (\r\n <Segmented\r\n value={value}\r\n onChange={handleChange}\r\n options={options}\r\n size={size}\r\n fullWidth={fullWidth}\r\n aria-label={L.ariaLabel}\r\n {...(sx !== undefined ? { sx } : {})}\r\n />\r\n );\r\n}\r\n\r\nexport default FavoritesFilter;\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AAAmD,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAA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AAAK,OAAS;IACR2B,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEiB,YAAa;IACvBL,OAAO,EAAEA,OAAQ;IACjBP,IAAI,EAAEA,IAAK;IACXC,SAAS,EAAEA,SAAU;IACrB,cAAYG,CAAC,CAAChB,SAAU;IAAA,IACnBe,EAAE,KAAKY,SAAS,GAAG;MAAEZ;IAAG,CAAC,GAAG,CAAC,CAAC;EAAA,CACpC,CAAC;AAEN;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAlD,OAAA,GAEcyB,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { SxProps, Theme } from "@mui/material/styles";
|
|
3
|
+
export interface FilterTabBarProps {
|
|
4
|
+
/** The status pills (`FilterTab`), left-hand group. */
|
|
5
|
+
children?: React.ReactNode | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Right-hand group — typically `FavoritesFilter` + `SavedFiltersMenu`.
|
|
8
|
+
* Omit it and the pills fill the row.
|
|
9
|
+
*/
|
|
10
|
+
end?: React.ReactNode | undefined;
|
|
11
|
+
/** Accessible name of the pill group. @default "Filtrer par statut" */
|
|
12
|
+
ariaLabel?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Accessible name of the right-hand group.
|
|
15
|
+
* @default "Favoris et filtres enregistrés"
|
|
16
|
+
*/
|
|
17
|
+
endAriaLabel?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Bottom border marking the bar as the listing card's header.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
divider?: boolean | undefined;
|
|
23
|
+
/** MUI sx overrides applied to the bar. */
|
|
24
|
+
sx?: SxProps<Theme> | undefined;
|
|
25
|
+
}
|
|
26
|
+
declare function FilterTabBar({ children, end, ariaLabel, endAriaLabel, divider, sx, }: FilterTabBarProps): React.JSX.Element;
|
|
27
|
+
export default FilterTabBar;
|
|
28
|
+
//# sourceMappingURL=FilterTabBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterTabBar.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/patterns/FilterTabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA4E3D,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACvC;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAClC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,2CAA2C;IAC3C,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;CACjC;AAED,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,GAAG,EACH,SAAgC,EAChC,YAA+C,EAC/C,OAAc,EACd,EAAE,GACH,EAAE,iBAAiB,qBA0BnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* FilterTabBar — Portnet UI v2 (pattern)
|
|
14
|
+
*
|
|
15
|
+
* Charter §03 · Platform Mandatory UX Patterns §Status Chips, §Favorites,
|
|
16
|
+
* §User Personalization.
|
|
17
|
+
*
|
|
18
|
+
* The bar that seats the status pills at the top of a listing card. The
|
|
19
|
+
* library shipped `FilterTab` — the pill — and nothing to seat them in,
|
|
20
|
+
* so every listing re-derived the same row: the geometry, the card-header
|
|
21
|
+
* separator, and the split between the status group on the left and the
|
|
22
|
+
* personalization controls (favorites toggle, saved filters) on the right.
|
|
23
|
+
*
|
|
24
|
+
* Promoted from `refonte-frontend` (Area 5), where FOUR listings carried
|
|
25
|
+
* the identical pair of frozen style objects:
|
|
26
|
+
*
|
|
27
|
+
* const BARRE_CHIPS_STATUT = { display: "flex", flexWrap: "wrap",
|
|
28
|
+
* alignItems: "center", justifyContent: "space-between",
|
|
29
|
+
* gap: "var(--s-2)", padding: "var(--s-3) var(--s-4)",
|
|
30
|
+
* borderBottom: "1px solid var(--border)" };
|
|
31
|
+
* const GROUPE_BARRE = { display: "flex", flexWrap: "wrap",
|
|
32
|
+
* alignItems: "center", gap: "var(--s-2)" };
|
|
33
|
+
*
|
|
34
|
+
* THE COPIES HAD ALREADY DRIFTED, which is the whole argument: one of the
|
|
35
|
+
* four omitted `justifyContent: "space-between"`, so its right-hand group
|
|
36
|
+
* sat against the pills instead of at the far edge — the same listing,
|
|
37
|
+
* two layouts, on screens a user moves between in one session (R-2.1).
|
|
38
|
+
*
|
|
39
|
+
* TWO GROUPS, TWO LANDMARKS. Each half renders as `role="group"` with its
|
|
40
|
+
* own accessible name rather than one flat row of buttons: a listing
|
|
41
|
+
* commonly shows eight or more pills, and a screen-reader user needs to
|
|
42
|
+
* know where the status filters end and the personalization controls
|
|
43
|
+
* begin. The names default to French, per this library's label
|
|
44
|
+
* convention; override them on a localised host.
|
|
45
|
+
*
|
|
46
|
+
* THE SEPARATOR ASSUMES THE CANONICAL CARD. §07 stacks this bar directly
|
|
47
|
+
* above the toolbar and the grid inside a single
|
|
48
|
+
* `<Surface padding="none" elevation="xs" clip>`, and `borderBottom`
|
|
49
|
+
* is what makes the bar read as that card's header instead of a floating
|
|
50
|
+
* row. Pass `divider={false}` when the bar is not the first child of a
|
|
51
|
+
* card.
|
|
52
|
+
*
|
|
53
|
+
* Usage:
|
|
54
|
+
* <Surface padding="none" elevation="xs" clip>
|
|
55
|
+
* <FilterTabBar
|
|
56
|
+
* end={
|
|
57
|
+
* <>
|
|
58
|
+
* <FavoritesFilter … />
|
|
59
|
+
* <SavedFiltersMenu … />
|
|
60
|
+
* </>
|
|
61
|
+
* }
|
|
62
|
+
* >
|
|
63
|
+
* <FilterTab active={!statut} variant="neutral" onClick={…}>Tous</FilterTab>
|
|
64
|
+
* {statuts.map((s) => (
|
|
65
|
+
* <FilterTab key={s.id} …>{s.description}</FilterTab>
|
|
66
|
+
* ))}
|
|
67
|
+
* </FilterTabBar>
|
|
68
|
+
*
|
|
69
|
+
* <DataGridToolbar … />
|
|
70
|
+
* <DataGrid … />
|
|
71
|
+
* </Surface>
|
|
72
|
+
*
|
|
73
|
+
* With no `end`, the pills simply fill the row — `space-between` on a
|
|
74
|
+
* single group behaves as `flex-start`, so no branch is needed.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/** Geometry of one half of the bar. Both groups share it by construction. */
|
|
78
|
+
const GROUP_SX = Object.freeze({
|
|
79
|
+
display: "flex",
|
|
80
|
+
flexWrap: "wrap",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
gap: "var(--s-2)"
|
|
83
|
+
});
|
|
84
|
+
function FilterTabBar({
|
|
85
|
+
children,
|
|
86
|
+
end,
|
|
87
|
+
ariaLabel = "Filtrer par statut",
|
|
88
|
+
endAriaLabel = "Favoris et filtres enregistrés",
|
|
89
|
+
divider = true,
|
|
90
|
+
sx
|
|
91
|
+
}) {
|
|
92
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
93
|
+
sx: {
|
|
94
|
+
display: "flex",
|
|
95
|
+
flexWrap: "wrap",
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
/* Pills left, personalization right. Harmless with one group. */
|
|
98
|
+
justifyContent: "space-between",
|
|
99
|
+
gap: "var(--s-2)",
|
|
100
|
+
padding: "var(--s-3) var(--s-4)",
|
|
101
|
+
...(divider ? {
|
|
102
|
+
borderBottom: "1px solid var(--border)"
|
|
103
|
+
} : {}),
|
|
104
|
+
...sx
|
|
105
|
+
},
|
|
106
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
107
|
+
role: "group",
|
|
108
|
+
"aria-label": ariaLabel,
|
|
109
|
+
sx: GROUP_SX,
|
|
110
|
+
children: children
|
|
111
|
+
}), end != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
112
|
+
role: "group",
|
|
113
|
+
"aria-label": endAriaLabel,
|
|
114
|
+
sx: GROUP_SX,
|
|
115
|
+
children: end
|
|
116
|
+
}) : null]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
var _default = exports.default = FilterTabBar;
|
|
120
|
+
//# sourceMappingURL=FilterTabBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterTabBar.js","names":["React","_interopRequireWildcard","require","_Box","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GROUP_SX","freeze","display","flexWrap","alignItems","gap","FilterTabBar","children","end","ariaLabel","endAriaLabel","divider","sx","jsxs","justifyContent","padding","borderBottom","jsx","role","_default","exports"],"sources":["../../../src/lib/v2/patterns/FilterTabBar.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\nimport type { SystemStyleObject } from \"@mui/system\";\r\n\r\n/**\r\n * FilterTabBar — Portnet UI v2 (pattern)\r\n *\r\n * Charter §03 · Platform Mandatory UX Patterns §Status Chips, §Favorites,\r\n * §User Personalization.\r\n *\r\n * The bar that seats the status pills at the top of a listing card. The\r\n * library shipped `FilterTab` — the pill — and nothing to seat them in,\r\n * so every listing re-derived the same row: the geometry, the card-header\r\n * separator, and the split between the status group on the left and the\r\n * personalization controls (favorites toggle, saved filters) on the right.\r\n *\r\n * Promoted from `refonte-frontend` (Area 5), where FOUR listings carried\r\n * the identical pair of frozen style objects:\r\n *\r\n * const BARRE_CHIPS_STATUT = { display: \"flex\", flexWrap: \"wrap\",\r\n * alignItems: \"center\", justifyContent: \"space-between\",\r\n * gap: \"var(--s-2)\", padding: \"var(--s-3) var(--s-4)\",\r\n * borderBottom: \"1px solid var(--border)\" };\r\n * const GROUPE_BARRE = { display: \"flex\", flexWrap: \"wrap\",\r\n * alignItems: \"center\", gap: \"var(--s-2)\" };\r\n *\r\n * THE COPIES HAD ALREADY DRIFTED, which is the whole argument: one of the\r\n * four omitted `justifyContent: \"space-between\"`, so its right-hand group\r\n * sat against the pills instead of at the far edge — the same listing,\r\n * two layouts, on screens a user moves between in one session (R-2.1).\r\n *\r\n * TWO GROUPS, TWO LANDMARKS. Each half renders as `role=\"group\"` with its\r\n * own accessible name rather than one flat row of buttons: a listing\r\n * commonly shows eight or more pills, and a screen-reader user needs to\r\n * know where the status filters end and the personalization controls\r\n * begin. The names default to French, per this library's label\r\n * convention; override them on a localised host.\r\n *\r\n * THE SEPARATOR ASSUMES THE CANONICAL CARD. §07 stacks this bar directly\r\n * above the toolbar and the grid inside a single\r\n * `<Surface padding=\"none\" elevation=\"xs\" clip>`, and `borderBottom`\r\n * is what makes the bar read as that card's header instead of a floating\r\n * row. Pass `divider={false}` when the bar is not the first child of a\r\n * card.\r\n *\r\n * Usage:\r\n * <Surface padding=\"none\" elevation=\"xs\" clip>\r\n * <FilterTabBar\r\n * end={\r\n * <>\r\n * <FavoritesFilter … />\r\n * <SavedFiltersMenu … />\r\n * </>\r\n * }\r\n * >\r\n * <FilterTab active={!statut} variant=\"neutral\" onClick={…}>Tous</FilterTab>\r\n * {statuts.map((s) => (\r\n * <FilterTab key={s.id} …>{s.description}</FilterTab>\r\n * ))}\r\n * </FilterTabBar>\r\n *\r\n * <DataGridToolbar … />\r\n * <DataGrid … />\r\n * </Surface>\r\n *\r\n * With no `end`, the pills simply fill the row — `space-between` on a\r\n * single group behaves as `flex-start`, so no branch is needed.\r\n */\r\n\r\n/** Geometry of one half of the bar. Both groups share it by construction. */\r\nconst GROUP_SX = Object.freeze({\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n alignItems: \"center\",\r\n gap: \"var(--s-2)\",\r\n} as const);\r\n\r\nexport interface FilterTabBarProps {\r\n /** The status pills (`FilterTab`), left-hand group. */\r\n children?: React.ReactNode | undefined;\r\n /**\r\n * Right-hand group — typically `FavoritesFilter` + `SavedFiltersMenu`.\r\n * Omit it and the pills fill the row.\r\n */\r\n end?: React.ReactNode | undefined;\r\n /** Accessible name of the pill group. @default \"Filtrer par statut\" */\r\n ariaLabel?: string | undefined;\r\n /**\r\n * Accessible name of the right-hand group.\r\n * @default \"Favoris et filtres enregistrés\"\r\n */\r\n endAriaLabel?: string | undefined;\r\n /**\r\n * Bottom border marking the bar as the listing card's header.\r\n * @default true\r\n */\r\n divider?: boolean | undefined;\r\n /** MUI sx overrides applied to the bar. */\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FilterTabBar({\r\n children,\r\n end,\r\n ariaLabel = \"Filtrer par statut\",\r\n endAriaLabel = \"Favoris et filtres enregistrés\",\r\n divider = true,\r\n sx,\r\n}: FilterTabBarProps) {\r\n return (\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n alignItems: \"center\",\r\n /* Pills left, personalization right. Harmless with one group. */\r\n justifyContent: \"space-between\",\r\n gap: \"var(--s-2)\",\r\n padding: \"var(--s-3) var(--s-4)\",\r\n ...(divider ? { borderBottom: \"1px solid var(--border)\" } : {}),\r\n ...(sx as SystemStyleObject<Theme>),\r\n }}\r\n >\r\n <Box role=\"group\" aria-label={ariaLabel} sx={GROUP_SX}>\r\n {children}\r\n </Box>\r\n\r\n {end != null ? (\r\n <Box role=\"group\" aria-label={endAriaLabel} sx={GROUP_SX}>\r\n {end}\r\n </Box>\r\n ) : null}\r\n </Box>\r\n );\r\n}\r\n\r\nexport default FilterTabBar;\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAK,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA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CAAAiC,IAAA,EAACnC,IAAA,CAAAK,OAAG;IACF6B,EAAE,EAAE;MACFV,OAAO,EAAE,MAAM;MACfC,QAAQ,EAAE,MAAM;MAChBC,UAAU,EAAE,QAAQ;MACpB;MACAU,cAAc,EAAE,eAAe;MAC/BT,GAAG,EAAE,YAAY;MACjBU,OAAO,EAAE,uBAAuB;MAChC,IAAIJ,OAAO,GAAG;QAAEK,YAAY,EAAE;MAA0B,CAAC,GAAG,CAAC,CAAC,CAAC;MAC/D,GAAIJ;IACN,CAAE;IAAAL,QAAA,gBAEF,IAAA3B,WAAA,CAAAqC,GAAA,EAACvC,IAAA,CAAAK,OAAG;MAACmC,IAAI,EAAC,OAAO;MAAC,cAAYT,SAAU;MAACG,EAAE,EAAEZ,QAAS;MAAAO,QAAA,EACnDA;IAAQ,CACN,CAAC,EAELC,GAAG,IAAI,IAAI,gBACV,IAAA5B,WAAA,CAAAqC,GAAA,EAACvC,IAAA,CAAAK,OAAG;MAACmC,IAAI,EAAC,OAAO;MAAC,cAAYR,YAAa;MAACE,EAAE,EAAEZ,QAAS;MAAAO,QAAA,EACtDC;IAAG,CACD,CAAC,GACJ,IAAI;EAAA,CACL,CAAC;AAEV;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAArC,OAAA,GAEcuB,YAAY","ignoreList":[]}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
10
9
|
var _Banner = _interopRequireDefault(require("../components/Banner"));
|
|
11
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
13
|
/**
|
|
16
14
|
* FormErrorSummary — Portnet UI v2
|
|
17
15
|
*
|
|
@@ -38,23 +36,24 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
38
36
|
* Charter R-AI.2: composition of v2.Banner only — no local primitive.
|
|
39
37
|
*/
|
|
40
38
|
|
|
41
|
-
function FormErrorSummary(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
function FormErrorSummary({
|
|
40
|
+
errors,
|
|
41
|
+
labelByName,
|
|
42
|
+
onItemClick,
|
|
43
|
+
title
|
|
44
|
+
}) {
|
|
46
45
|
if (!errors || errors.length === 0) return null;
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const heading = title || "Veuillez corriger les erreurs ci-dessous";
|
|
47
|
+
const handleClick = (e, name) => {
|
|
49
48
|
e.preventDefault();
|
|
50
49
|
if (typeof onItemClick === "function") {
|
|
51
50
|
onItemClick(name);
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Banner
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Banner.default, {
|
|
55
54
|
variant: "error",
|
|
56
55
|
title: heading,
|
|
57
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box
|
|
56
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
58
57
|
component: "ul",
|
|
59
58
|
role: "list",
|
|
60
59
|
sx: {
|
|
@@ -63,20 +62,18 @@ function FormErrorSummary(_ref) {
|
|
|
63
62
|
fontSize: "var(--text-sm)",
|
|
64
63
|
listStyle: "disc"
|
|
65
64
|
},
|
|
66
|
-
children: errors.map(
|
|
67
|
-
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box
|
|
65
|
+
children: errors.map((err, idx) => {
|
|
66
|
+
const label = labelByName && labelByName[err.name] || err.name;
|
|
67
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
69
68
|
component: "li",
|
|
70
69
|
role: "listitem",
|
|
71
70
|
sx: {
|
|
72
71
|
marginBottom: "var(--s-1)"
|
|
73
72
|
},
|
|
74
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box
|
|
73
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
75
74
|
component: "button",
|
|
76
75
|
type: "button",
|
|
77
|
-
onClick:
|
|
78
|
-
return handleClick(e, err.name);
|
|
79
|
-
},
|
|
76
|
+
onClick: e => handleClick(e, err.name),
|
|
80
77
|
sx: {
|
|
81
78
|
// Reset default <button> chrome so the link reads visually
|
|
82
79
|
// as a hyperlink in the banner body.
|
|
@@ -102,10 +99,10 @@ function FormErrorSummary(_ref) {
|
|
|
102
99
|
}), ": ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
103
100
|
children: err.message
|
|
104
101
|
})]
|
|
105
|
-
},
|
|
102
|
+
}, `${err.name}-${idx}`);
|
|
106
103
|
})
|
|
107
104
|
})
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
|
-
var _default = exports
|
|
107
|
+
var _default = exports.default = FormErrorSummary;
|
|
111
108
|
//# sourceMappingURL=FormErrorSummary.js.map
|