@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
|
@@ -30,6 +30,22 @@ export { useFavorites, useIsFavorite, FAVORITES_CAPABILITY_ID } from "./capabili
|
|
|
30
30
|
export { useFavoritesView, filterRowsByFavorites, sortRowsByFavorites, FAVORITES_FILTER, FAVORITES_SORT, } from "./capabilities/favoritesView";
|
|
31
31
|
export { default as FavoriteToggle } from "../components/FavoriteToggle";
|
|
32
32
|
export { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from "./capabilities/savedFilters";
|
|
33
|
+
/**
|
|
34
|
+
* Reading a saved filter BACK (gap G-50).
|
|
35
|
+
*
|
|
36
|
+
* `criteria` is opaque here on purpose, but the round trip is not symmetrical:
|
|
37
|
+
* `createLocalStorageAdapter` writes with `JSON.stringify` (so a `Date` becomes
|
|
38
|
+
* an ISO string) and reads with a bare `JSON.parse`, with NO reviver. Every host
|
|
39
|
+
* that persists a date therefore got a string back, in a field its own types
|
|
40
|
+
* declare as a `Date` — straight into `<DatePicker value>` and into the search
|
|
41
|
+
* payload, silently, since the only way to assign the parsed payload into typed
|
|
42
|
+
* form state is an assertion.
|
|
43
|
+
*
|
|
44
|
+
* Nine list screens of one module carried a DOUBLE conversion per `onApply` to
|
|
45
|
+
* get around it. See the file header for why the fix belongs here and not in the
|
|
46
|
+
* adapter.
|
|
47
|
+
*/
|
|
48
|
+
export { reviveSavedCriteria } from "./capabilities/reviveSavedCriteria";
|
|
33
49
|
/**
|
|
34
50
|
* Grid preferences capability (gap G-35) — per-user, per-resource hidden
|
|
35
51
|
* columns.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/personalization/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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K5D,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE3F;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC"}
|
|
@@ -5,109 +5,115 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "FAVORITES_CAPABILITY_ID", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _favorites.FAVORITES_CAPABILITY_ID;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "FAVORITES_FILTER", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _favoritesView.FAVORITES_FILTER;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "FAVORITES_SORT", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _favoritesView.FAVORITES_SORT;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "FavoriteToggle", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
27
|
-
return _FavoriteToggle
|
|
26
|
+
get: function () {
|
|
27
|
+
return _FavoriteToggle.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "GRID_PREFERENCES_CAPABILITY_ID", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function
|
|
32
|
+
get: function () {
|
|
33
33
|
return _gridPreferences.GRID_PREFERENCES_CAPABILITY_ID;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "SAVED_FILTERS_CAPABILITY_ID", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function
|
|
38
|
+
get: function () {
|
|
39
39
|
return _savedFilters.SAVED_FILTERS_CAPABILITY_ID;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "UserPersonalizationProvider", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function
|
|
45
|
-
return _PersonalizationProvider
|
|
44
|
+
get: function () {
|
|
45
|
+
return _PersonalizationProvider.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "createLocalStorageAdapter", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function
|
|
51
|
-
return _createLocalStorageAdapter
|
|
50
|
+
get: function () {
|
|
51
|
+
return _createLocalStorageAdapter.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "createMemoryAdapter", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function
|
|
57
|
-
return _createMemoryAdapter
|
|
56
|
+
get: function () {
|
|
57
|
+
return _createMemoryAdapter.default;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "filterRowsByFavorites", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function
|
|
62
|
+
get: function () {
|
|
63
63
|
return _favoritesView.filterRowsByFavorites;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "makeEnvelope", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function
|
|
68
|
+
get: function () {
|
|
69
69
|
return _schema.makeEnvelope;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "registerCapability", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function
|
|
74
|
+
get: function () {
|
|
75
75
|
return _schema.registerCapability;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
Object.defineProperty(exports, "reviveSavedCriteria", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _reviveSavedCriteria.reviveSavedCriteria;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
78
84
|
Object.defineProperty(exports, "sortRowsByFavorites", {
|
|
79
85
|
enumerable: true,
|
|
80
|
-
get: function
|
|
86
|
+
get: function () {
|
|
81
87
|
return _favoritesView.sortRowsByFavorites;
|
|
82
88
|
}
|
|
83
89
|
});
|
|
84
90
|
Object.defineProperty(exports, "useFavorites", {
|
|
85
91
|
enumerable: true,
|
|
86
|
-
get: function
|
|
92
|
+
get: function () {
|
|
87
93
|
return _favorites.useFavorites;
|
|
88
94
|
}
|
|
89
95
|
});
|
|
90
96
|
Object.defineProperty(exports, "useFavoritesView", {
|
|
91
97
|
enumerable: true,
|
|
92
|
-
get: function
|
|
98
|
+
get: function () {
|
|
93
99
|
return _favoritesView.useFavoritesView;
|
|
94
100
|
}
|
|
95
101
|
});
|
|
96
102
|
Object.defineProperty(exports, "useGridPreferences", {
|
|
97
103
|
enumerable: true,
|
|
98
|
-
get: function
|
|
104
|
+
get: function () {
|
|
99
105
|
return _gridPreferences.useGridPreferences;
|
|
100
106
|
}
|
|
101
107
|
});
|
|
102
108
|
Object.defineProperty(exports, "useIsFavorite", {
|
|
103
109
|
enumerable: true,
|
|
104
|
-
get: function
|
|
110
|
+
get: function () {
|
|
105
111
|
return _favorites.useIsFavorite;
|
|
106
112
|
}
|
|
107
113
|
});
|
|
108
114
|
Object.defineProperty(exports, "useSavedFilters", {
|
|
109
115
|
enumerable: true,
|
|
110
|
-
get: function
|
|
116
|
+
get: function () {
|
|
111
117
|
return _savedFilters.useSavedFilters;
|
|
112
118
|
}
|
|
113
119
|
});
|
|
@@ -119,6 +125,7 @@ var _favorites = require("./capabilities/favorites");
|
|
|
119
125
|
var _favoritesView = require("./capabilities/favoritesView");
|
|
120
126
|
var _FavoriteToggle = _interopRequireDefault(require("../components/FavoriteToggle"));
|
|
121
127
|
var _savedFilters = require("./capabilities/savedFilters");
|
|
128
|
+
var _reviveSavedCriteria = require("./capabilities/reviveSavedCriteria");
|
|
122
129
|
var _gridPreferences = require("./capabilities/gridPreferences");
|
|
123
|
-
function _interopRequireDefault(
|
|
130
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
124
131
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_PersonalizationProvider","_interopRequireDefault","require","_createLocalStorageAdapter","_createMemoryAdapter","_schema","_favorites","_favoritesView","_FavoriteToggle","_savedFilters","_gridPreferences","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_PersonalizationProvider","_interopRequireDefault","require","_createLocalStorageAdapter","_createMemoryAdapter","_schema","_favorites","_favoritesView","_FavoriteToggle","_savedFilters","_reviveSavedCriteria","_gridPreferences","e","__esModule","default"],"sources":["../../../src/lib/v2/personalization/index.ts"],"sourcesContent":["/**\r\n * @portnet/ui · v2 · User Personalization Foundation\r\n * Public surface.\r\n *\r\n * Import via the dedicated subpath:\r\n * import {\r\n * UserPersonalizationProvider,\r\n * useFavorites,\r\n * useFavoritesView,\r\n * useSavedFilters,\r\n * FavoriteToggle,\r\n * } from \"@portnet/ui/v2/personalization\";\r\n *\r\n * Surface is intentionally minimal (architecture doc §2.8 — minimum API\r\n * surface). The store handle and the internal selector primitive are NOT\r\n * exported; hosts interact through the provider, the capability hooks,\r\n * and the capability components.\r\n *\r\n * The grid-bound composites — SaveFilterDialog / SavedFiltersMenu (saved\r\n * filters) and makeFavoriteColumn / FavoritesFilter (favorites) — are\r\n * exposed via @portnet/ui/v2 (patterns/), not re-exported here, so the\r\n * personalization barrel never imports from patterns/.\r\n */\r\n\r\n/* Provider — the single configuration point. */\r\nexport { default as UserPersonalizationProvider } from \"./PersonalizationProvider\";\r\n\r\n/* Built-in storage adapters (a remote adapter will join them, swap-in). */\r\nexport { default as createLocalStorageAdapter } from \"./adapters/createLocalStorageAdapter\";\r\nexport { default as createMemoryAdapter } from \"./adapters/createMemoryAdapter\";\r\n\r\n/* Capability registration seam — for custom/host-defined capabilities. */\r\nexport { registerCapability, makeEnvelope } from \"./schema\";\r\n\r\n/* Canonical domain types — the TS contract that replaced the runtime\r\n * PropTypes shapes (Scope / Adapter / FavoriteRef / SavedFilter). Type-only:\r\n * erased from the runtime bundle. */\r\nexport type { Scope, Adapter, FavoriteRef, SavedFilter } from \"./types\";\r\n\r\n/* Favorites capability (Batch 3) + view logic (Batch 5). */\r\nexport { useFavorites, useIsFavorite, FAVORITES_CAPABILITY_ID } from \"./capabilities/favorites\";\r\nexport {\r\n useFavoritesView,\r\n filterRowsByFavorites,\r\n sortRowsByFavorites,\r\n FAVORITES_FILTER,\r\n FAVORITES_SORT,\r\n} from \"./capabilities/favoritesView\";\r\nexport { default as FavoriteToggle } from \"../components/FavoriteToggle\";\r\n\r\n/* Saved filters capability (Batch 4). Composites in v2 patterns/. */\r\nexport { useSavedFilters, SAVED_FILTERS_CAPABILITY_ID } from \"./capabilities/savedFilters\";\r\n\r\n/**\r\n * Reading a saved filter BACK (gap G-50).\r\n *\r\n * `criteria` is opaque here on purpose, but the round trip is not symmetrical:\r\n * `createLocalStorageAdapter` writes with `JSON.stringify` (so a `Date` becomes\r\n * an ISO string) and reads with a bare `JSON.parse`, with NO reviver. Every host\r\n * that persists a date therefore got a string back, in a field its own types\r\n * declare as a `Date` — straight into `<DatePicker value>` and into the search\r\n * payload, silently, since the only way to assign the parsed payload into typed\r\n * form state is an assertion.\r\n *\r\n * Nine list screens of one module carried a DOUBLE conversion per `onApply` to\r\n * get around it. See the file header for why the fix belongs here and not in the\r\n * adapter.\r\n */\r\nexport { reviveSavedCriteria } from \"./capabilities/reviveSavedCriteria\";\r\n\r\n/**\r\n * Grid preferences capability (gap G-35) — per-user, per-resource hidden\r\n * columns.\r\n *\r\n * `DataGridToolbar` owns the column-visibility UI but holds no state, so every\r\n * host persisted the choice itself in a bare `localStorage` key, which is NOT\r\n * user-scoped — unlike this foundation's `…:{userId}:{capabilityId}` scheme.\r\n * On a shared workstation one user inherited another's hidden columns.\r\n *\r\n * A host could not fix it: `registerCapability` is exported below as a seam\r\n * \"for custom/host-defined capabilities\", but `usePersonalizationStore` and\r\n * `useStoreSelector` are deliberately private (§2.8, minimum API surface), so\r\n * a registered capability had no way to be read or written. The seam is\r\n * advertised without being complete; until that is resolved, a new capability\r\n * has to ship here.\r\n */\r\nexport {\r\n useGridPreferences,\r\n GRID_PREFERENCES_CAPABILITY_ID,\r\n} from \"./capabilities/gridPreferences\";\r\nexport type {\r\n UseGridPreferencesResult,\r\n GridPreferencesEntry,\r\n} from \"./capabilities/gridPreferences\";\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAAA,wBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,0BAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,oBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAGA,IAAAG,OAAA,GAAAH,OAAA;AAQA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAOA,IAAAM,eAAA,GAAAP,sBAAA,CAAAC,OAAA;AAGA,IAAAO,aAAA,GAAAP,OAAA;AAiBA,IAAAQ,oBAAA,GAAAR,OAAA;AAkBA,IAAAS,gBAAA,GAAAT,OAAA;AAGwC,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
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
|
});
|
|
@@ -11,8 +10,7 @@ exports.usePersonalizationStore = usePersonalizationStore;
|
|
|
11
10
|
exports.useScope = useScope;
|
|
12
11
|
exports.useStoreSelector = useStoreSelector;
|
|
13
12
|
var React = _interopRequireWildcard(require("react"));
|
|
14
|
-
function
|
|
15
|
-
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; }
|
|
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); }
|
|
16
14
|
/**
|
|
17
15
|
* personalizationContext — Portnet UI v2 · personalization
|
|
18
16
|
*
|
|
@@ -40,10 +38,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
40
38
|
|
|
41
39
|
/** Stable configuration carried by PersonalizationConfigContext. */
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const PersonalizationConfigContext = exports.PersonalizationConfigContext = /*#__PURE__*/React.createContext(null);
|
|
42
|
+
const PersonalizationStoreContext = exports.PersonalizationStoreContext = /*#__PURE__*/React.createContext(null);
|
|
45
43
|
function usePersonalizationConfig() {
|
|
46
|
-
|
|
44
|
+
const ctx = React.useContext(PersonalizationConfigContext);
|
|
47
45
|
if (!ctx) {
|
|
48
46
|
throw new Error("[@portnet/ui v2] usePersonalizationConfig() must be used inside <UserPersonalizationProvider>.");
|
|
49
47
|
}
|
|
@@ -52,7 +50,7 @@ function usePersonalizationConfig() {
|
|
|
52
50
|
|
|
53
51
|
/** The store handle. */
|
|
54
52
|
function usePersonalizationStore() {
|
|
55
|
-
|
|
53
|
+
const store = React.useContext(PersonalizationStoreContext);
|
|
56
54
|
if (!store) {
|
|
57
55
|
throw new Error("[@portnet/ui v2] personalization hooks must be used inside <UserPersonalizationProvider>.");
|
|
58
56
|
}
|
|
@@ -85,15 +83,15 @@ function usePersonalizationLabels() {
|
|
|
85
83
|
* loop-free.
|
|
86
84
|
*/
|
|
87
85
|
function useStoreSelector(selector, isEqual) {
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
const store = usePersonalizationStore();
|
|
87
|
+
const cacheRef = React.useRef(null);
|
|
90
88
|
function getSelection() {
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
const snapshot = store.getSnapshot();
|
|
90
|
+
const cache = cacheRef.current;
|
|
93
91
|
if (cache && Object.is(cache.snapshot, snapshot) && cache.selector === selector && cache.isEqual === isEqual) {
|
|
94
92
|
return cache.selection;
|
|
95
93
|
}
|
|
96
|
-
|
|
94
|
+
const nextSelection = selector(snapshot);
|
|
97
95
|
if (cache && cache.hasValue && typeof isEqual === "function" && isEqual(cache.selection, nextSelection)) {
|
|
98
96
|
cacheRef.current = {
|
|
99
97
|
snapshot: snapshot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personalizationContext.js","names":["React","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"file":"personalizationContext.js","names":["React","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PersonalizationConfigContext","exports","createContext","PersonalizationStoreContext","usePersonalizationConfig","ctx","useContext","Error","usePersonalizationStore","store","useScope","scope","usePersonalizationLabels","labels","useStoreSelector","selector","isEqual","cacheRef","useRef","getSelection","snapshot","getSnapshot","cache","current","is","selection","nextSelection","hasValue","getServerSelection","getServerSnapshot","useSyncExternalStore","subscribe"],"sources":["../../../src/lib/v2/personalization/personalizationContext.ts"],"sourcesContent":["/**\r\n * personalizationContext — Portnet UI v2 · personalization\r\n *\r\n * Two contexts, by design (architecture doc §2.5):\r\n * - PersonalizationConfigContext : STABLE config { scope, labels }, set\r\n * once by the provider. Low churn.\r\n * - PersonalizationStoreContext : the store handle. Mutable preference\r\n * state NEVER travels through context — it is read via\r\n * useSyncExternalStore selectors. A component toggling a favorite\r\n * cannot re-render a component reading saved filters.\r\n *\r\n * `useStoreSelector` is the internal subscription primitive: a\r\n * useSyncExternalStore wrapper that caches by (snapshot, selector) and\r\n * supports an optional equality function so derived/object selections stay\r\n * referentially stable. It is NOT exported from the public surface — the\r\n * capability slices (Batch 3/4) consume it; hosts use the capability hooks.\r\n */\r\n\r\nimport * as React from \"react\";\r\n\r\nimport type {\r\n PersonalizationSnapshot,\r\n PersonalizationStore,\r\n} from \"./createPersonalizationStore\";\r\nimport type { Scope } from \"./types\";\r\n\r\n/**\r\n * Merged label bag (provider defaults + host overrides). The concrete\r\n * default values live in DEFAULT_PERSONALIZATION_LABELS in the provider;\r\n * this is the canonical type both the provider and the capability slices\r\n * import.\r\n */\r\nexport interface PersonalizationLabels {\r\n // Follow / \"suivis\" (Batch 3)\r\n addFavorite: string;\r\n removeFavorite: string;\r\n favoritesOnly: string;\r\n showAll: string;\r\n favoriteColumnHeader: string;\r\n // Saved filters (Batch 4)\r\n savedFilters: string;\r\n saveCurrentFilter: string;\r\n filterNameLabel: string;\r\n filterNamePlaceholder: string;\r\n saveFilter: string;\r\n updateFilter: string;\r\n deleteFilter: string;\r\n deleteFilterConfirm: string;\r\n setAsDefault: string;\r\n defaultBadge: string;\r\n manageFilters: string;\r\n noSavedFilters: string;\r\n cancel: string;\r\n}\r\n\r\n/** Stable configuration carried by PersonalizationConfigContext. */\r\nexport interface PersonalizationConfig {\r\n scope: Scope;\r\n labels: PersonalizationLabels;\r\n}\r\n\r\nexport const PersonalizationConfigContext =\r\n React.createContext<PersonalizationConfig | null>(null);\r\nexport const PersonalizationStoreContext =\r\n React.createContext<PersonalizationStore | null>(null);\r\n\r\nexport function usePersonalizationConfig(): PersonalizationConfig {\r\n const ctx = React.useContext(PersonalizationConfigContext);\r\n if (!ctx) {\r\n throw new Error(\r\n \"[@portnet/ui v2] usePersonalizationConfig() must be used inside <UserPersonalizationProvider>.\"\r\n );\r\n }\r\n return ctx;\r\n}\r\n\r\n/** The store handle. */\r\nexport function usePersonalizationStore(): PersonalizationStore {\r\n const store = React.useContext(PersonalizationStoreContext);\r\n if (!store) {\r\n throw new Error(\r\n \"[@portnet/ui v2] personalization hooks must be used inside <UserPersonalizationProvider>.\"\r\n );\r\n }\r\n return store;\r\n}\r\n\r\n/** Convenience: the current scope. */\r\nexport function useScope(): Scope {\r\n return usePersonalizationConfig().scope;\r\n}\r\n\r\n/** Convenience: merged labels (provider defaults + host overrides). */\r\nexport function usePersonalizationLabels(): PersonalizationLabels {\r\n return usePersonalizationConfig().labels;\r\n}\r\n\r\ninterface SelectorCache<T> {\r\n snapshot: PersonalizationSnapshot;\r\n selector: (snapshot: PersonalizationSnapshot) => T;\r\n isEqual: ((a: T, b: T) => boolean) | undefined;\r\n selection: T;\r\n hasValue: boolean;\r\n}\r\n\r\n/**\r\n * Subscribe to the store with a selector. Returns a referentially stable\r\n * value when the selected slice is unchanged — required by\r\n * useSyncExternalStore and the basis of the no-cross-capability-re-render\r\n * guarantee.\r\n *\r\n * The cache is keyed on (snapshot identity, selector identity, isEqual\r\n * identity). When the snapshot is unchanged for the same selector, the\r\n * memoised selection is returned without re-running the selector. When the\r\n * snapshot changes, the selector re-runs; if `isEqual` is supplied and the\r\n * new value is equal to the previous one, the previous reference is kept.\r\n *\r\n * Selectors should be stable (e.g. useCallback) OR rely on the store's\r\n * structural sharing returning stable slice references — both keep this\r\n * loop-free.\r\n */\r\nexport function useStoreSelector<T>(\r\n selector: (snapshot: PersonalizationSnapshot) => T,\r\n isEqual?: (a: T, b: T) => boolean\r\n): T {\r\n const store = usePersonalizationStore();\r\n const cacheRef = React.useRef<SelectorCache<T> | null>(null);\r\n\r\n function getSelection(): T {\r\n const snapshot = store.getSnapshot();\r\n const cache = cacheRef.current;\r\n if (\r\n cache &&\r\n Object.is(cache.snapshot, snapshot) &&\r\n cache.selector === selector &&\r\n cache.isEqual === isEqual\r\n ) {\r\n return cache.selection;\r\n }\r\n const nextSelection = selector(snapshot);\r\n if (\r\n cache &&\r\n cache.hasValue &&\r\n typeof isEqual === \"function\" &&\r\n isEqual(cache.selection, nextSelection)\r\n ) {\r\n cacheRef.current = {\r\n snapshot: snapshot,\r\n selector: selector,\r\n isEqual: isEqual,\r\n selection: cache.selection,\r\n hasValue: true,\r\n };\r\n return cache.selection;\r\n }\r\n cacheRef.current = {\r\n snapshot: snapshot,\r\n selector: selector,\r\n isEqual: isEqual,\r\n selection: nextSelection,\r\n hasValue: true,\r\n };\r\n return nextSelection;\r\n }\r\n\r\n function getServerSelection(): T {\r\n return selector(store.getServerSnapshot());\r\n }\r\n\r\n return React.useSyncExternalStore(\r\n store.subscribe,\r\n getSelection,\r\n getServerSelection\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;AAkBA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA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CAACsB,SAAS,EACfZ,YAAY,EACZS,kBACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -28,7 +28,7 @@ exports.registerCapability = registerCapability;
|
|
|
28
28
|
* the OPAQUE envelope; the `payload` shape is owned by the slice.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const isDev = typeof process !== "undefined" && !!process.env && process.env["NODE_ENV"] !== "production";
|
|
32
32
|
|
|
33
33
|
/** A capability's migrate function: upgrade an old payload to the current version. */
|
|
34
34
|
|
|
@@ -37,7 +37,7 @@ var isDev = typeof process !== "undefined" && !!process.env && process.env["NODE
|
|
|
37
37
|
/** Frozen, normalised capability descriptor stored in the registry. */
|
|
38
38
|
|
|
39
39
|
/** id -> frozen descriptor. Module-level (same lifecycle model as useDensity's store). */
|
|
40
|
-
|
|
40
|
+
const registry = new Map();
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Register a capability descriptor. Idempotent: the first registration for an
|
|
@@ -52,16 +52,15 @@ function registerCapability(descriptor) {
|
|
|
52
52
|
}
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
const existing = registry.get(descriptor.id);
|
|
56
56
|
if (existing) {
|
|
57
|
-
|
|
58
|
-
if (isDev && existing.schemaVersion !== ((_descriptor$schemaVer = descriptor.schemaVersion) !== null && _descriptor$schemaVer !== void 0 ? _descriptor$schemaVer : 1)) {
|
|
57
|
+
if (isDev && existing.schemaVersion !== (descriptor.schemaVersion ?? 1)) {
|
|
59
58
|
// eslint-disable-next-line no-console
|
|
60
|
-
console.warn(
|
|
59
|
+
console.warn(`[@portnet/ui v2] registerCapability: "${descriptor.id}" re-registered with a different ` + `schemaVersion (${existing.schemaVersion} → ${descriptor.schemaVersion}). Keeping the first ` + `registration. This usually means two @portnet/ui copies are loaded.`);
|
|
61
60
|
}
|
|
62
61
|
return existing;
|
|
63
62
|
}
|
|
64
|
-
|
|
63
|
+
const frozen = Object.freeze({
|
|
65
64
|
id: descriptor.id,
|
|
66
65
|
schemaVersion: typeof descriptor.schemaVersion === "number" ? descriptor.schemaVersion : 1,
|
|
67
66
|
defaultState: descriptor.defaultState !== undefined ? descriptor.defaultState : Object.freeze({}),
|
|
@@ -89,7 +88,7 @@ function makeEnvelope(schemaVersion, payload) {
|
|
|
89
88
|
return {
|
|
90
89
|
schemaVersion: typeof schemaVersion === "number" ? schemaVersion : 1,
|
|
91
90
|
updatedAt: new Date().toISOString(),
|
|
92
|
-
payload
|
|
91
|
+
payload
|
|
93
92
|
};
|
|
94
93
|
}
|
|
95
94
|
|
|
@@ -98,5 +97,5 @@ function makeEnvelope(schemaVersion, payload) {
|
|
|
98
97
|
* capability's payload `schemaVersion`). Bumped only on a global re-partition.
|
|
99
98
|
* Mirrored by adapters/_storageKey.ts.
|
|
100
99
|
*/
|
|
101
|
-
|
|
100
|
+
const KEY_SCHEME_VERSION = exports.KEY_SCHEME_VERSION = "v1";
|
|
102
101
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":["isDev","process","env","registry","Map","registerCapability","descriptor","id","console","warn","existing","get","
|
|
1
|
+
{"version":3,"file":"schema.js","names":["isDev","process","env","registry","Map","registerCapability","descriptor","id","console","warn","existing","get","schemaVersion","frozen","Object","freeze","defaultState","undefined","migrate","set","getCapability","getRegisteredCapabilities","Array","from","values","makeEnvelope","payload","updatedAt","Date","toISOString","KEY_SCHEME_VERSION","exports"],"sources":["../../../src/lib/v2/personalization/schema.ts"],"sourcesContent":["/**\r\n * schema — Portnet UI v2 · User Personalization Foundation\r\n *\r\n * Capability registry + persistence envelope. The foundation is deliberately\r\n * capability-AGNOSTIC: the store and provider know nothing about \"favorites\"\r\n * or \"savedFilters\". Each capability *slice* registers itself here at import\r\n * time:\r\n *\r\n * import { registerCapability } from \"../schema\";\r\n * registerCapability({\r\n * id: \"favorites\",\r\n * schemaVersion: 1,\r\n * defaultState: Object.freeze({}),\r\n * migrate: (fromVersion, payload) => payload,\r\n * });\r\n *\r\n * Adding a new capability is therefore purely additive. The adapter persists\r\n * the OPAQUE envelope; the `payload` shape is owned by the slice.\r\n */\r\n\r\nimport type { Envelope } from \"./types\";\r\n\r\nconst isDev =\r\n typeof process !== \"undefined\" &&\r\n !!process.env &&\r\n process.env[\"NODE_ENV\"] !== \"production\";\r\n\r\n/** A capability's migrate function: upgrade an old payload to the current version. */\r\nexport type CapabilityMigrate = (\r\n fromVersion: number,\r\n payload: unknown\r\n) => unknown;\r\n\r\n/** Registration input for a capability slice. */\r\nexport interface CapabilityDescriptorInput {\r\n /** Unique capability id (e.g. \"favorites\"). */\r\n id: string;\r\n schemaVersion?: number | undefined;\r\n /** Seed when nothing is persisted (should be a STABLE/frozen ref). */\r\n defaultState?: unknown;\r\n migrate?: CapabilityMigrate | undefined;\r\n}\r\n\r\n/** Frozen, normalised capability descriptor stored in the registry. */\r\nexport interface CapabilityDescriptor {\r\n id: string;\r\n schemaVersion: number;\r\n defaultState: unknown;\r\n migrate: CapabilityMigrate | null;\r\n}\r\n\r\n/** id -> frozen descriptor. Module-level (same lifecycle model as useDensity's store). */\r\nconst registry = new Map<string, CapabilityDescriptor>();\r\n\r\n/**\r\n * Register a capability descriptor. Idempotent: the first registration for an\r\n * id wins; a second registration with a *different* schemaVersion is reported\r\n * in development (usually two library copies or a mismatched host version).\r\n */\r\nexport function registerCapability(\r\n descriptor: CapabilityDescriptorInput\r\n): CapabilityDescriptor | null {\r\n if (!descriptor || typeof descriptor.id !== \"string\" || !descriptor.id) {\r\n if (isDev) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n \"[@portnet/ui v2] registerCapability: a non-empty string `id` is required.\"\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n const existing = registry.get(descriptor.id);\r\n if (existing) {\r\n if (isDev && existing.schemaVersion !== (descriptor.schemaVersion ?? 1)) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n `[@portnet/ui v2] registerCapability: \"${descriptor.id}\" re-registered with a different ` +\r\n `schemaVersion (${existing.schemaVersion} → ${descriptor.schemaVersion}). Keeping the first ` +\r\n `registration. This usually means two @portnet/ui copies are loaded.`\r\n );\r\n }\r\n return existing;\r\n }\r\n\r\n const frozen: CapabilityDescriptor = Object.freeze({\r\n id: descriptor.id,\r\n schemaVersion:\r\n typeof descriptor.schemaVersion === \"number\"\r\n ? descriptor.schemaVersion\r\n : 1,\r\n defaultState:\r\n descriptor.defaultState !== undefined\r\n ? descriptor.defaultState\r\n : Object.freeze({}),\r\n migrate:\r\n typeof descriptor.migrate === \"function\" ? descriptor.migrate : null,\r\n });\r\n registry.set(frozen.id, frozen);\r\n return frozen;\r\n}\r\n\r\n/** @returns the descriptor registered for `id`, or null. */\r\nexport function getCapability(id: string): CapabilityDescriptor | null {\r\n return registry.get(id) || null;\r\n}\r\n\r\n/** @returns every registered descriptor (snapshot array). */\r\nexport function getRegisteredCapabilities(): CapabilityDescriptor[] {\r\n return Array.from(registry.values());\r\n}\r\n\r\n/**\r\n * Build the versioned persistence envelope. The adapter treats `payload` as\r\n * opaque; `schemaVersion` lets a slice's migrate() upgrade old payloads on load.\r\n */\r\nexport function makeEnvelope(schemaVersion: number, payload: unknown): Envelope {\r\n return {\r\n schemaVersion: typeof schemaVersion === \"number\" ? schemaVersion : 1,\r\n updatedAt: new Date().toISOString(),\r\n payload,\r\n };\r\n}\r\n\r\n/**\r\n * Key-scheme version (the layout of the *storage key*, distinct from a\r\n * capability's payload `schemaVersion`). Bumped only on a global re-partition.\r\n * Mirrored by adapters/_storageKey.ts.\r\n */\r\nexport const KEY_SCHEME_VERSION = \"v1\";\r\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,KAAK,GACT,OAAOC,OAAO,KAAK,WAAW,IAC9B,CAAC,CAACA,OAAO,CAACC,GAAG,IACbD,OAAO,CA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AM,CAACN,EAAE,EAAEM,MAAM,CAAC;EAC/B,OAAOA,MAAM;AACf;;AAEA;AACO,SAASO,aAAaA,CAACb,EAAU,EAA+B;EACrE,OAAOJ,QAAQ,CAACQ,GAAG,CAACJ,EAAE,CAAC,IAAI,IAAI;AACjC;;AAEA;AACO,SAASc,yBAAyBA,CAAA,EAA2B;EAClE,OAAOC,KAAK,CAACC,IAAI,CAACpB,QAAQ,CAACqB,MAAM,CAAC,CAAC,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAACb,aAAqB,EAAEc,OAAgB,EAAY;EAC9E,OAAO;IACLd,aAAa,EAAE,OAAOA,aAAa,KAAK,QAAQ,GAAGA,aAAa,GAAG,CAAC;IACpEe,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;IACnCH;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMI,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAI","ignoreList":[]}
|
|
@@ -4,44 +4,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ReferentielContext = void 0;
|
|
7
|
-
exports
|
|
7
|
+
exports.default = ReferentielProvider;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
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); }
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
17
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
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; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
-
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); } /**
|
|
10
|
+
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); }
|
|
11
|
+
/**
|
|
24
12
|
* ReferentielContext — Portnet UI v2
|
|
25
13
|
*
|
|
26
14
|
* Carries the referential API configuration + a per-searchKey option cache.
|
|
27
15
|
* Consumed by useReferentielClient / useReferentielOptions and (later) the
|
|
28
16
|
* paginated search builder for ReferentielField.
|
|
29
17
|
*/
|
|
30
|
-
|
|
18
|
+
|
|
19
|
+
const ReferentielContext = exports.ReferentielContext = /*#__PURE__*/React.createContext({
|
|
31
20
|
baseURL: "",
|
|
32
21
|
token: "",
|
|
33
22
|
secret: false,
|
|
34
23
|
langue: "fr",
|
|
35
24
|
cache: {},
|
|
36
|
-
cacheDispatch:
|
|
25
|
+
cacheDispatch: () => {}
|
|
37
26
|
});
|
|
38
|
-
|
|
39
|
-
function cacheReducer(state,
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
const INITIAL_CACHE = {};
|
|
28
|
+
function cacheReducer(state, {
|
|
29
|
+
type,
|
|
30
|
+
payload
|
|
31
|
+
}) {
|
|
42
32
|
switch (type) {
|
|
43
33
|
case "SET":
|
|
44
|
-
return
|
|
34
|
+
return {
|
|
35
|
+
...state,
|
|
36
|
+
[payload.key]: payload.data
|
|
37
|
+
};
|
|
45
38
|
default:
|
|
46
39
|
return state;
|
|
47
40
|
}
|
|
@@ -63,29 +56,22 @@ function cacheReducer(state, _ref) {
|
|
|
63
56
|
* Auth contract (see useReferentielClient): secret => the raw token is sent
|
|
64
57
|
* in the Authorization header; otherwise a Bearer prefix is used.
|
|
65
58
|
*/
|
|
66
|
-
function ReferentielProvider(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
token: token,
|
|
83
|
-
secret: secret,
|
|
84
|
-
langue: langue,
|
|
85
|
-
cache: cache,
|
|
86
|
-
cacheDispatch: cacheDispatch
|
|
87
|
-
};
|
|
88
|
-
}, [baseURL, token, secret, langue, cache]);
|
|
59
|
+
function ReferentielProvider({
|
|
60
|
+
baseURL,
|
|
61
|
+
token = "",
|
|
62
|
+
secret = false,
|
|
63
|
+
langue = "fr",
|
|
64
|
+
children
|
|
65
|
+
}) {
|
|
66
|
+
const [cache, cacheDispatch] = React.useReducer(cacheReducer, INITIAL_CACHE);
|
|
67
|
+
const value = React.useMemo(() => ({
|
|
68
|
+
baseURL,
|
|
69
|
+
token,
|
|
70
|
+
secret,
|
|
71
|
+
langue,
|
|
72
|
+
cache,
|
|
73
|
+
cacheDispatch
|
|
74
|
+
}), [baseURL, token, secret, langue, cache]);
|
|
89
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ReferentielContext.Provider, {
|
|
90
76
|
value: value,
|
|
91
77
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferentielProvider.js","names":["React","_interopRequireWildcard","require","_jsxRuntime","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Symbol","iterator","constructor","_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","name","Array","from","test","len","length","arr2","_i","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","isArray","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","apply","_objectSpread","target","arguments","source","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","Number","ReferentielContext","exports","createContext","baseURL","token","secret","langue","cacheDispatch","INITIAL_CACHE","cacheReducer","state","_ref","type","payload","data","ReferentielProvider","_ref2","_ref2$token","_ref2$secret","_ref2$langue","children","_React$useReducer","useReducer","_React$useReducer2","useMemo","jsx","Provider"],"sources":["../../../src/lib/v2/referentiel/ReferentielProvider.tsx"],"sourcesContent":["import * as React from \"react\";\r\n\r\n/**\r\n * ReferentielContext — Portnet UI v2\r\n *\r\n * Carries the referential API configuration + a per-searchKey option cache.\r\n * Consumed by useReferentielClient / useReferentielOptions and (later) the\r\n * paginated search builder for ReferentielField.\r\n */\r\n\r\nexport type ReferentielCache = Record<string, unknown>;\r\n\r\ninterface ReferentielCacheSetPayload {\r\n key: string;\r\n data: unknown;\r\n}\r\n\r\nexport type ReferentielCacheAction = {\r\n type: \"SET\";\r\n payload: ReferentielCacheSetPayload;\r\n};\r\n\r\nexport interface ReferentielContextValue {\r\n baseURL: string;\r\n token: string;\r\n secret: boolean;\r\n langue: string;\r\n cache: ReferentielCache;\r\n cacheDispatch: React.Dispatch<ReferentielCacheAction>;\r\n}\r\n\r\nexport const ReferentielContext = React.createContext<ReferentielContextValue>({\r\n baseURL: \"\",\r\n token: \"\",\r\n secret: false,\r\n langue: \"fr\",\r\n cache: {},\r\n cacheDispatch: () => {},\r\n});\r\n\r\nconst INITIAL_CACHE: ReferentielCache = {};\r\n\r\nfunction cacheReducer(\r\n state: ReferentielCache,\r\n { type, payload }: ReferentielCacheAction\r\n): ReferentielCache {\r\n switch (type) {\r\n case \"SET\":\r\n return { ...state, [payload.key]: payload.data };\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nexport interface ReferentielProviderProps {\r\n baseURL: string;\r\n token?: string | undefined;\r\n secret?: boolean | undefined;\r\n langue?: string | undefined;\r\n children?: React.ReactNode | undefined;\r\n}\r\n\r\n/**\r\n * ReferentielProvider\r\n *\r\n * Set once at the app root with the referential API configuration:\r\n *\r\n * <ReferentielProvider\r\n * baseURL={config.referentielBaseURL}\r\n * token={config.referentielToken}\r\n * secret={config.referentielTypeAuth === \"SECRET\"}\r\n * langue=\"fr\"\r\n * >\r\n * {app}\r\n * </ReferentielProvider>\r\n *\r\n * Auth contract (see useReferentielClient): secret => the raw token is sent\r\n * in the Authorization header; otherwise a Bearer prefix is used.\r\n */\r\nexport default function ReferentielProvider({\r\n baseURL,\r\n token = \"\",\r\n secret = false,\r\n langue = \"fr\",\r\n children,\r\n}: ReferentielProviderProps): React.JSX.Element {\r\n const [cache, cacheDispatch] = React.useReducer(cacheReducer, INITIAL_CACHE);\r\n\r\n const value = React.useMemo<ReferentielContextValue>(\r\n () => ({ baseURL, token, secret, langue, cache, cacheDispatch }),\r\n [baseURL, token, secret, langue, cache]\r\n );\r\n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AAA,GAAAF,KAAA,CACVX,MAAM;IAANA,MAAM,GAAAa,YAAA,cAAG,KAAK,GAAAA,YAAA;IAAAC,YAAA,GAAAH,KAAA,CACdV,MAAM;IAANA,MAAM,GAAAa,YAAA,cAAG,IAAI,GAAAA,YAAA;IACbC,QAAQ,GAAAJ,KAAA,CAARI,QAAQ;EAER,IAAAC,iBAAA,GAA+BpH,KAAK,CAACqH,UAAU,CAACb,YAAY,EAAED,aAAa,CAAC;IAAAe,kBAAA,GAAAzF,cAAA,CAAAuF,iBAAA;IAArExG,KAAK,GAAA0G,kBAAA;IAAEhB,aAAa,GAAAgB,kBAAA;EAE3B,IAAMzD,KAAK,GAAG7D,KAAK,CAACuH,OAAO,CACzB;IAAA,OAAO;MAAErB,OAAO,EAAPA,OAAO;MAAEC,KAAK,EAALA,KAAK;MAAEC,MAAM,EAANA,MAAM;MAAEC,MAAM,EAANA,MAAM;MAAEzF,KAAK,EAALA,KAAK;MAAE0F,aAAa,EAAbA;IAAc,CAAC;EAAA,CAAC,EAChE,CAACJ,OAAO,EAAEC,KAAK,EAAEC,MAAM,EAAEC,MAAM,EAAEzF,KAAK,CACxC,CAAC;EAED,oBACE,IAAAT,WAAA,CAAAqH,GAAA,EAACzB,kBAAkB,CAAC0B,QAAQ;IAAC5D,KAAK,EAAEA,KAAM;IAAAsD,QAAA,EACvCA;EAAQ,CACkB,CAAC;AAElC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReferentielProvider.js","names":["React","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ReferentielContext","exports","createContext","baseURL","token","secret","langue","cache","cacheDispatch","INITIAL_CACHE","cacheReducer","state","type","payload","key","data","ReferentielProvider","children","useReducer","value","useMemo","jsx","Provider"],"sources":["../../../src/lib/v2/referentiel/ReferentielProvider.tsx"],"sourcesContent":["import * as React from \"react\";\r\n\r\n/**\r\n * ReferentielContext — Portnet UI v2\r\n *\r\n * Carries the referential API configuration + a per-searchKey option cache.\r\n * Consumed by useReferentielClient / useReferentielOptions and (later) the\r\n * paginated search builder for ReferentielField.\r\n */\r\n\r\nexport type ReferentielCache = Record<string, unknown>;\r\n\r\ninterface ReferentielCacheSetPayload {\r\n key: string;\r\n data: unknown;\r\n}\r\n\r\nexport type ReferentielCacheAction = {\r\n type: \"SET\";\r\n payload: ReferentielCacheSetPayload;\r\n};\r\n\r\nexport interface ReferentielContextValue {\r\n baseURL: string;\r\n token: string;\r\n secret: boolean;\r\n langue: string;\r\n cache: ReferentielCache;\r\n cacheDispatch: React.Dispatch<ReferentielCacheAction>;\r\n}\r\n\r\nexport const ReferentielContext = React.createContext<ReferentielContextValue>({\r\n baseURL: \"\",\r\n token: \"\",\r\n secret: false,\r\n langue: \"fr\",\r\n cache: {},\r\n cacheDispatch: () => {},\r\n});\r\n\r\nconst INITIAL_CACHE: ReferentielCache = {};\r\n\r\nfunction cacheReducer(\r\n state: ReferentielCache,\r\n { type, payload }: ReferentielCacheAction\r\n): ReferentielCache {\r\n switch (type) {\r\n case \"SET\":\r\n return { ...state, [payload.key]: payload.data };\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\nexport interface ReferentielProviderProps {\r\n baseURL: string;\r\n token?: string | undefined;\r\n secret?: boolean | undefined;\r\n langue?: string | undefined;\r\n children?: React.ReactNode | undefined;\r\n}\r\n\r\n/**\r\n * ReferentielProvider\r\n *\r\n * Set once at the app root with the referential API configuration:\r\n *\r\n * <ReferentielProvider\r\n * baseURL={config.referentielBaseURL}\r\n * token={config.referentielToken}\r\n * secret={config.referentielTypeAuth === \"SECRET\"}\r\n * langue=\"fr\"\r\n * >\r\n * {app}\r\n * </ReferentielProvider>\r\n *\r\n * Auth contract (see useReferentielClient): secret => the raw token is sent\r\n * in the Authorization header; otherwise a Bearer prefix is used.\r\n */\r\nexport default function ReferentielProvider({\r\n baseURL,\r\n token = \"\",\r\n secret = false,\r\n langue = \"fr\",\r\n children,\r\n}: ReferentielProviderProps): React.JSX.Element {\r\n const [cache, cacheDispatch] = React.useReducer(cacheReducer, INITIAL_CACHE);\r\n\r\n const value = React.useMemo<ReferentielContextValue>(\r\n () => ({ baseURL, token, secret, langue, cache, cacheDispatch }),\r\n [baseURL, token, secret, langue, cache]\r\n );\r\n\r\n return (\r\n <ReferentielContext.Provider value={value}>\r\n {children}\r\n </ReferentielContext.Provider>\r\n );\r\n}\r\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA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