@portnet/ui 5.0.32 → 6.0.1
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 +524 -0
- package/README.md +101 -38
- package/dist/esm/index.js +196 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldError.test.js +160 -0
- package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FileCard.test.js +144 -0
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -0
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +333 -0
- package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +235 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
- package/dist/esm/v2/__tests__/apiError.test.js +181 -0
- package/dist/esm/v2/__tests__/apiError.test.js.map +1 -0
- package/dist/esm/v2/__tests__/banned-patterns.test.js +270 -0
- package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js +224 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -0
- package/dist/esm/v2/__tests__/cssVariables.test.js +157 -0
- package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js +147 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -0
- package/dist/esm/v2/__tests__/locale-fallback.test.js +109 -0
- package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js +514 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -0
- package/dist/esm/v2/components/Accordion.js +230 -0
- package/dist/esm/v2/components/Accordion.js.map +1 -0
- package/dist/esm/v2/components/ActionStrip.js +146 -0
- package/dist/esm/v2/components/ActionStrip.js.map +1 -0
- package/dist/esm/v2/components/Banner.js +254 -0
- package/dist/esm/v2/components/Banner.js.map +1 -0
- package/dist/esm/v2/components/Busy.js +97 -0
- package/dist/esm/v2/components/Busy.js.map +1 -0
- package/dist/esm/v2/components/Button.js +114 -0
- package/dist/esm/v2/components/Button.js.map +1 -0
- package/dist/esm/v2/components/CategoryTag.js +81 -0
- package/dist/esm/v2/components/CategoryTag.js.map +1 -0
- package/dist/esm/v2/components/Checkbox.js +124 -0
- package/dist/esm/v2/components/Checkbox.js.map +1 -0
- package/dist/esm/v2/components/Chip.js +124 -0
- package/dist/esm/v2/components/Chip.js.map +1 -0
- package/dist/esm/v2/components/Combobox.js +394 -0
- package/dist/esm/v2/components/Combobox.js.map +1 -0
- package/dist/esm/v2/components/CommandPalette.js +660 -0
- package/dist/esm/v2/components/CommandPalette.js.map +1 -0
- package/dist/esm/v2/components/ConfirmDialog.js +144 -0
- package/dist/esm/v2/components/ConfirmDialog.js.map +1 -0
- package/dist/esm/v2/components/DatePicker.js +200 -0
- package/dist/esm/v2/components/DatePicker.js.map +1 -0
- package/dist/esm/v2/components/DateRangePicker.js +289 -0
- package/dist/esm/v2/components/DateRangePicker.js.map +1 -0
- package/dist/esm/v2/components/DateTimePicker.js +182 -0
- package/dist/esm/v2/components/DateTimePicker.js.map +1 -0
- package/dist/esm/v2/components/Drawer.js +333 -0
- package/dist/esm/v2/components/Drawer.js.map +1 -0
- package/dist/esm/v2/components/Dropzone.js +540 -0
- package/dist/esm/v2/components/Dropzone.js.map +1 -0
- package/dist/esm/v2/components/EmptyState.js +102 -0
- package/dist/esm/v2/components/EmptyState.js.map +1 -0
- package/dist/esm/v2/components/FavoriteToggle.js +127 -0
- package/dist/esm/v2/components/FavoriteToggle.js.map +1 -0
- package/dist/esm/v2/components/Field.js +197 -0
- package/dist/esm/v2/components/Field.js.map +1 -0
- package/dist/esm/v2/components/FieldError.js +124 -0
- package/dist/esm/v2/components/FieldError.js.map +1 -0
- package/dist/esm/v2/components/FieldHelp.js +202 -0
- package/dist/esm/v2/components/FieldHelp.js.map +1 -0
- package/dist/esm/v2/components/FileCard.js +162 -0
- package/dist/esm/v2/components/FileCard.js.map +1 -0
- package/dist/esm/v2/components/FilterTab.js +138 -0
- package/dist/esm/v2/components/FilterTab.js.map +1 -0
- package/dist/esm/v2/components/ForbiddenPage.js +74 -0
- package/dist/esm/v2/components/ForbiddenPage.js.map +1 -0
- package/dist/esm/v2/components/FormGrid.js +179 -0
- package/dist/esm/v2/components/FormGrid.js.map +1 -0
- package/dist/esm/v2/components/FormikDisplay.js +118 -0
- package/dist/esm/v2/components/FormikDisplay.js.map +1 -0
- package/dist/esm/v2/components/Input.js +107 -0
- package/dist/esm/v2/components/Input.js.map +1 -0
- package/dist/esm/v2/components/KPICard.js +237 -0
- package/dist/esm/v2/components/KPICard.js.map +1 -0
- package/dist/esm/v2/components/KPIStrip.js +84 -0
- package/dist/esm/v2/components/KPIStrip.js.map +1 -0
- package/dist/esm/v2/components/KV.js +75 -0
- package/dist/esm/v2/components/KV.js.map +1 -0
- package/dist/esm/v2/components/KVGrid.js +74 -0
- package/dist/esm/v2/components/KVGrid.js.map +1 -0
- package/dist/esm/v2/components/Layout.js +284 -0
- package/dist/esm/v2/components/Layout.js.map +1 -0
- package/dist/esm/v2/components/MobileRowCard.js +314 -0
- package/dist/esm/v2/components/MobileRowCard.js.map +1 -0
- package/dist/esm/v2/components/Modal.js +276 -0
- package/dist/esm/v2/components/Modal.js.map +1 -0
- package/dist/esm/v2/components/NetworkErrorPage.js +78 -0
- package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -0
- package/dist/esm/v2/components/NotFoundPage.js +58 -0
- package/dist/esm/v2/components/NotFoundPage.js.map +1 -0
- package/dist/esm/v2/components/NumberInput.js +309 -0
- package/dist/esm/v2/components/NumberInput.js.map +1 -0
- package/dist/esm/v2/components/OverflowMenu.js +184 -0
- package/dist/esm/v2/components/OverflowMenu.js.map +1 -0
- package/dist/esm/v2/components/PdfViewer.js +122 -0
- package/dist/esm/v2/components/PdfViewer.js.map +1 -0
- package/dist/esm/v2/components/ProgressBar.js +202 -0
- package/dist/esm/v2/components/ProgressBar.js.map +1 -0
- package/dist/esm/v2/components/Radio.js +228 -0
- package/dist/esm/v2/components/Radio.js.map +1 -0
- package/dist/esm/v2/components/SectionErrorBoundary.js +214 -0
- package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -0
- package/dist/esm/v2/components/SectionHeader.js +132 -0
- package/dist/esm/v2/components/SectionHeader.js.map +1 -0
- package/dist/esm/v2/components/Segmented.js +254 -0
- package/dist/esm/v2/components/Segmented.js.map +1 -0
- package/dist/esm/v2/components/Select.js +490 -0
- package/dist/esm/v2/components/Select.js.map +1 -0
- package/dist/esm/v2/components/ServerErrorPage.js +74 -0
- package/dist/esm/v2/components/ServerErrorPage.js.map +1 -0
- package/dist/esm/v2/components/Skeleton.js +269 -0
- package/dist/esm/v2/components/Skeleton.js.map +1 -0
- package/dist/esm/v2/components/SkipLink.js +49 -0
- package/dist/esm/v2/components/SkipLink.js.map +1 -0
- package/dist/esm/v2/components/Spinner.js +69 -0
- package/dist/esm/v2/components/Spinner.js.map +1 -0
- package/dist/esm/v2/components/Status.js +64 -0
- package/dist/esm/v2/components/Status.js.map +1 -0
- package/dist/esm/v2/components/Stepper.js +432 -0
- package/dist/esm/v2/components/Stepper.js.map +1 -0
- package/dist/esm/v2/components/Surface.js +159 -0
- package/dist/esm/v2/components/Surface.js.map +1 -0
- package/dist/esm/v2/components/Switch.js +128 -0
- package/dist/esm/v2/components/Switch.js.map +1 -0
- package/dist/esm/v2/components/Tabs.js +150 -0
- package/dist/esm/v2/components/Tabs.js.map +1 -0
- package/dist/esm/v2/components/TelInput.js +274 -0
- package/dist/esm/v2/components/TelInput.js.map +1 -0
- package/dist/esm/v2/components/Textarea.js +72 -0
- package/dist/esm/v2/components/Textarea.js.map +1 -0
- package/dist/esm/v2/components/TimePicker.js +134 -0
- package/dist/esm/v2/components/TimePicker.js.map +1 -0
- package/dist/esm/v2/components/Toast.js +376 -0
- package/dist/esm/v2/components/Toast.js.map +1 -0
- package/dist/esm/v2/components/Tooltip.js +161 -0
- package/dist/esm/v2/components/Tooltip.js.map +1 -0
- package/dist/esm/v2/components/_ErrorPageBody.js +85 -0
- package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -0
- package/dist/esm/v2/components/_pickerShared.js +60 -0
- package/dist/esm/v2/components/_pickerShared.js.map +1 -0
- package/dist/esm/v2/components/index.js +244 -0
- package/dist/esm/v2/components/index.js.map +1 -0
- package/dist/esm/v2/hooks/index.js +10 -0
- package/dist/esm/v2/hooks/index.js.map +1 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js +55 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -0
- package/dist/esm/v2/hooks/useDensity.js +119 -0
- package/dist/esm/v2/hooks/useDensity.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusFirstError.js +197 -0
- package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusTrap.js +202 -0
- package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -0
- package/dist/esm/v2/hooks/useFormAutoSave.js +181 -0
- package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -0
- package/dist/esm/v2/hooks/useFormCompletionProgress.js +131 -0
- package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js +44 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -0
- package/dist/esm/v2/hooks/useSortedRows.js +32 -0
- package/dist/esm/v2/hooks/useSortedRows.js.map +1 -0
- package/dist/esm/v2/hooks/useTabLoading.js +79 -0
- package/dist/esm/v2/hooks/useTabLoading.js.map +1 -0
- package/dist/esm/v2/index.js +121 -0
- package/dist/esm/v2/index.js.map +1 -0
- package/dist/esm/v2/modalContext.js +108 -0
- package/dist/esm/v2/modalContext.js.map +1 -0
- package/dist/esm/v2/models/favorite.js +2 -0
- package/dist/esm/v2/models/favorite.js.map +1 -0
- package/dist/esm/v2/models/index.js +12 -0
- package/dist/esm/v2/models/index.js.map +1 -0
- package/dist/esm/v2/models/personalization.js +2 -0
- package/dist/esm/v2/models/personalization.js.map +1 -0
- package/dist/esm/v2/models/referentiel.js +2 -0
- package/dist/esm/v2/models/referentiel.js.map +1 -0
- package/dist/esm/v2/models/savedFilter.js +2 -0
- package/dist/esm/v2/models/savedFilter.js.map +1 -0
- package/dist/esm/v2/patterns/ActionBar.js +603 -0
- package/dist/esm/v2/patterns/ActionBar.js.map +1 -0
- package/dist/esm/v2/patterns/BulkActionBar.js +147 -0
- package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js +303 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -0
- package/dist/esm/v2/patterns/ColumnsToggle.js +301 -0
- package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -0
- package/dist/esm/v2/patterns/DataGrid.js +820 -0
- package/dist/esm/v2/patterns/DataGrid.js.map +1 -0
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js +375 -0
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -0
- package/dist/esm/v2/patterns/DataGridToolbar.js +249 -0
- package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -0
- package/dist/esm/v2/patterns/DataGridVirtualized.js +523 -0
- package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -0
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +70 -0
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js +164 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -0
- package/dist/esm/v2/patterns/FavoritesFilter.js +91 -0
- package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js +101 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -0
- package/dist/esm/v2/patterns/FormPageShell.js +126 -0
- package/dist/esm/v2/patterns/FormPageShell.js.map +1 -0
- package/dist/esm/v2/patterns/FormSection.js +190 -0
- package/dist/esm/v2/patterns/FormSection.js.map +1 -0
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js +110 -0
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -0
- package/dist/esm/v2/patterns/FormikCombobox.js +115 -0
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -0
- package/dist/esm/v2/patterns/FormikDatePicker.js +196 -0
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -0
- package/dist/esm/v2/patterns/FormikErrorFocus.js +77 -0
- package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -0
- package/dist/esm/v2/patterns/FormikFile.js +148 -0
- package/dist/esm/v2/patterns/FormikFile.js.map +1 -0
- package/dist/esm/v2/patterns/FormikInput.js +127 -0
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -0
- package/dist/esm/v2/patterns/FormikReferentielField.js +116 -0
- package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -0
- package/dist/esm/v2/patterns/FormikSelect.js +159 -0
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -0
- package/dist/esm/v2/patterns/FormikTextarea.js +76 -0
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -0
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +195 -0
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -0
- package/dist/esm/v2/patterns/NetworkErrorBanner.js +72 -0
- package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -0
- package/dist/esm/v2/patterns/PageContent.js +62 -0
- package/dist/esm/v2/patterns/PageContent.js.map +1 -0
- package/dist/esm/v2/patterns/ReferentielField.js +615 -0
- package/dist/esm/v2/patterns/ReferentielField.js.map +1 -0
- package/dist/esm/v2/patterns/SaveFilterDialog.js +197 -0
- package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -0
- package/dist/esm/v2/patterns/SavedFiltersMenu.js +406 -0
- package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -0
- package/dist/esm/v2/patterns/SkeletonPageShell.js +342 -0
- package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -0
- package/dist/esm/v2/patterns/SortableHeader.js +179 -0
- package/dist/esm/v2/patterns/SortableHeader.js.map +1 -0
- package/dist/esm/v2/patterns/Tour.js +471 -0
- package/dist/esm/v2/patterns/Tour.js.map +1 -0
- package/dist/esm/v2/patterns/_dataGridShared.js +431 -0
- package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -0
- package/dist/esm/v2/patterns/_sort.js +112 -0
- package/dist/esm/v2/patterns/_sort.js.map +1 -0
- package/dist/esm/v2/patterns/_useColumnReorder.js +257 -0
- package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -0
- package/dist/esm/v2/patterns/_useColumnResize.js +191 -0
- package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -0
- package/dist/esm/v2/patterns/index.js +95 -0
- package/dist/esm/v2/patterns/index.js.map +1 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js +168 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/_storageKey.js +60 -0
- package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +124 -0
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +70 -0
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/index.js +11 -0
- package/dist/esm/v2/personalization/adapters/index.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/favorites.js +216 -0
- package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/favoritesView.js +111 -0
- package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/index.js +17 -0
- package/dist/esm/v2/personalization/capabilities/index.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js +291 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -0
- package/dist/esm/v2/personalization/createPersonalizationStore.js +472 -0
- package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -0
- package/dist/esm/v2/personalization/index.js +46 -0
- package/dist/esm/v2/personalization/index.js.map +1 -0
- package/dist/esm/v2/personalization/personalizationContext.js +108 -0
- package/dist/esm/v2/personalization/personalizationContext.js.map +1 -0
- package/dist/esm/v2/personalization/schema.js +92 -0
- package/dist/esm/v2/personalization/schema.js.map +1 -0
- package/dist/esm/v2/personalization/types.js +2 -0
- package/dist/esm/v2/personalization/types.js.map +1 -0
- package/dist/esm/v2/referentiel/ReferentielProvider.js +87 -0
- package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -0
- package/dist/esm/v2/referentiel/index.js +15 -0
- package/dist/esm/v2/referentiel/index.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js +37 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielOptions.js +169 -0
- package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielSearch.js +132 -0
- package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -0
- package/dist/esm/v2/styles/base.css +425 -0
- package/dist/esm/v2/styles/css.d.ts +10 -0
- package/dist/esm/v2/styles/index.js +12 -0
- package/dist/esm/v2/styles/index.js.map +1 -0
- package/dist/esm/v2/theme/_brand.js +64 -0
- package/dist/esm/v2/theme/_brand.js.map +1 -0
- package/dist/esm/v2/theme/_brandSecondary.js +60 -0
- package/dist/esm/v2/theme/_brandSecondary.js.map +1 -0
- package/dist/esm/v2/theme/createPortnetTheme.js +548 -0
- package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -0
- package/dist/esm/v2/theme/cssVariables.js +198 -0
- package/dist/esm/v2/theme/cssVariables.js.map +1 -0
- package/dist/esm/v2/theme/index.js +32 -0
- package/dist/esm/v2/theme/index.js.map +1 -0
- package/dist/esm/v2/tokens/breakpoints.js +106 -0
- package/dist/esm/v2/tokens/breakpoints.js.map +1 -0
- package/dist/esm/v2/tokens/colors.js +219 -0
- package/dist/esm/v2/tokens/colors.js.map +1 -0
- package/dist/esm/v2/tokens/density.js +98 -0
- package/dist/esm/v2/tokens/density.js.map +1 -0
- package/dist/esm/v2/tokens/index.js +80 -0
- package/dist/esm/v2/tokens/index.js.map +1 -0
- package/dist/esm/v2/tokens/motion.js +88 -0
- package/dist/esm/v2/tokens/motion.js.map +1 -0
- package/dist/esm/v2/tokens/radius.js +22 -0
- package/dist/esm/v2/tokens/radius.js.map +1 -0
- package/dist/esm/v2/tokens/shadows.js +40 -0
- package/dist/esm/v2/tokens/shadows.js.map +1 -0
- package/dist/esm/v2/tokens/spacing.js +51 -0
- package/dist/esm/v2/tokens/spacing.js.map +1 -0
- package/dist/esm/v2/tokens/state.js +41 -0
- package/dist/esm/v2/tokens/state.js.map +1 -0
- package/dist/esm/v2/tokens/statusPalette.js +66 -0
- package/dist/esm/v2/tokens/statusPalette.js.map +1 -0
- package/dist/esm/v2/tokens/tokens.json +153 -0
- package/dist/esm/v2/tokens/typography.js +149 -0
- package/dist/esm/v2/tokens/typography.js.map +1 -0
- package/dist/esm/v2/tokens/zIndex.js +44 -0
- package/dist/esm/v2/tokens/zIndex.js.map +1 -0
- package/dist/esm/v2/types/common.js +2 -0
- package/dist/esm/v2/types/common.js.map +1 -0
- package/dist/esm/v2/types/datagrid.js +2 -0
- package/dist/esm/v2/types/datagrid.js.map +1 -0
- package/dist/esm/v2/types/index.js +12 -0
- package/dist/esm/v2/types/index.js.map +1 -0
- package/dist/esm/v2/utils/apiError.js +281 -0
- package/dist/esm/v2/utils/apiError.js.map +1 -0
- package/dist/esm/v2/utils/contrast.js +157 -0
- package/dist/esm/v2/utils/contrast.js.map +1 -0
- package/dist/esm/v2/utils/cx.js +38 -0
- package/dist/esm/v2/utils/cx.js.map +1 -0
- package/dist/esm/v2/utils/fileDownload.js +226 -0
- package/dist/esm/v2/utils/fileDownload.js.map +1 -0
- package/dist/esm/v2/utils/fmtMoney.js +78 -0
- package/dist/esm/v2/utils/fmtMoney.js.map +1 -0
- package/dist/esm/v2/utils/index.js +43 -0
- package/dist/esm/v2/utils/index.js.map +1 -0
- package/dist/esm/v2/utils/mergeLabels.js +86 -0
- package/dist/esm/v2/utils/mergeLabels.js.map +1 -0
- package/dist/esm/v2/utils/networkStatus.js +114 -0
- package/dist/esm/v2/utils/networkStatus.js.map +1 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +183 -191
- package/dist/index.js.map +1 -0
- package/dist/v2/__tests__/FieldError.test.js +164 -0
- package/dist/v2/__tests__/FieldError.test.js.map +1 -0
- package/dist/v2/__tests__/FileCard.test.js +148 -0
- package/dist/v2/__tests__/FileCard.test.js.map +1 -0
- package/dist/v2/__tests__/MobileRowCard.test.js +337 -0
- package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js +237 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
- package/dist/v2/__tests__/apiError.test.js +182 -0
- package/dist/v2/__tests__/apiError.test.js.map +1 -0
- package/dist/v2/__tests__/banned-patterns.test.js +272 -0
- package/dist/v2/__tests__/banned-patterns.test.js.map +1 -0
- package/dist/v2/__tests__/contrast-palette.test.js +225 -0
- package/dist/v2/__tests__/contrast-palette.test.js.map +1 -0
- package/dist/v2/__tests__/cssVariables.test.js +158 -0
- package/dist/v2/__tests__/cssVariables.test.js.map +1 -0
- package/dist/v2/__tests__/labels-merge.test.js +153 -0
- package/dist/v2/__tests__/labels-merge.test.js.map +1 -0
- package/dist/v2/__tests__/locale-fallback.test.js +111 -0
- package/dist/v2/__tests__/locale-fallback.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusTrap.test.js +517 -0
- package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -0
- package/dist/v2/components/Accordion.d.ts +56 -0
- package/dist/v2/components/Accordion.d.ts.map +1 -0
- package/dist/v2/components/Accordion.js +238 -0
- package/dist/v2/components/Accordion.js.map +1 -0
- package/dist/v2/components/ActionStrip.d.ts +67 -0
- package/dist/v2/components/ActionStrip.d.ts.map +1 -0
- package/dist/v2/components/ActionStrip.js +154 -0
- package/dist/v2/components/ActionStrip.js.map +1 -0
- package/dist/v2/components/Banner.d.ts +88 -0
- package/dist/v2/components/Banner.d.ts.map +1 -0
- package/dist/v2/components/Banner.js +264 -0
- package/dist/v2/components/Banner.js.map +1 -0
- package/dist/v2/components/Busy.d.ts +18 -0
- package/dist/v2/components/Busy.d.ts.map +1 -0
- package/dist/v2/components/Busy.js +104 -0
- package/dist/v2/components/Busy.js.map +1 -0
- package/dist/v2/components/Button.d.ts +36 -0
- package/dist/v2/components/Button.d.ts.map +1 -0
- package/dist/v2/components/Button.js +122 -0
- package/dist/v2/components/Button.js.map +1 -0
- package/dist/v2/components/CategoryTag.d.ts +45 -0
- package/dist/v2/components/CategoryTag.d.ts.map +1 -0
- package/dist/v2/components/CategoryTag.js +89 -0
- package/dist/v2/components/CategoryTag.js.map +1 -0
- package/dist/v2/components/Checkbox.d.ts +59 -0
- package/dist/v2/components/Checkbox.d.ts.map +1 -0
- package/dist/v2/components/Checkbox.js +134 -0
- package/dist/v2/components/Checkbox.js.map +1 -0
- package/dist/v2/components/Chip.d.ts +48 -0
- package/dist/v2/components/Chip.d.ts.map +1 -0
- package/dist/v2/components/Chip.js +132 -0
- package/dist/v2/components/Chip.js.map +1 -0
- package/dist/v2/components/Combobox.d.ts +134 -0
- package/dist/v2/components/Combobox.d.ts.map +1 -0
- package/dist/v2/components/Combobox.js +400 -0
- package/dist/v2/components/Combobox.js.map +1 -0
- package/dist/v2/components/CommandPalette.d.ts +36 -0
- package/dist/v2/components/CommandPalette.d.ts.map +1 -0
- package/dist/v2/components/CommandPalette.js +668 -0
- package/dist/v2/components/CommandPalette.js.map +1 -0
- package/dist/v2/components/ConfirmDialog.d.ts +23 -0
- package/dist/v2/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/v2/components/ConfirmDialog.js +151 -0
- package/dist/v2/components/ConfirmDialog.js.map +1 -0
- package/dist/v2/components/DatePicker.d.ts +21 -0
- package/dist/v2/components/DatePicker.d.ts.map +1 -0
- package/dist/v2/components/DatePicker.js +207 -0
- package/dist/v2/components/DatePicker.js.map +1 -0
- package/dist/v2/components/DateRangePicker.d.ts +81 -0
- package/dist/v2/components/DateRangePicker.d.ts.map +1 -0
- package/dist/v2/components/DateRangePicker.js +296 -0
- package/dist/v2/components/DateRangePicker.js.map +1 -0
- package/dist/v2/components/DateTimePicker.d.ts +21 -0
- package/dist/v2/components/DateTimePicker.d.ts.map +1 -0
- package/dist/v2/components/DateTimePicker.js +189 -0
- package/dist/v2/components/DateTimePicker.js.map +1 -0
- package/dist/v2/components/Drawer.d.ts +34 -0
- package/dist/v2/components/Drawer.d.ts.map +1 -0
- package/dist/v2/components/Drawer.js +340 -0
- package/dist/v2/components/Drawer.js.map +1 -0
- package/dist/v2/components/Dropzone.d.ts +150 -0
- package/dist/v2/components/Dropzone.d.ts.map +1 -0
- package/dist/v2/components/Dropzone.js +547 -0
- package/dist/v2/components/Dropzone.js.map +1 -0
- package/dist/v2/components/EmptyState.d.ts +36 -0
- package/dist/v2/components/EmptyState.d.ts.map +1 -0
- package/dist/v2/components/EmptyState.js +112 -0
- package/dist/v2/components/EmptyState.js.map +1 -0
- package/dist/v2/components/FavoriteToggle.d.ts +22 -0
- package/dist/v2/components/FavoriteToggle.d.ts.map +1 -0
- package/dist/v2/components/FavoriteToggle.js +135 -0
- package/dist/v2/components/FavoriteToggle.js.map +1 -0
- package/dist/v2/components/Field.d.ts +63 -0
- package/dist/v2/components/Field.d.ts.map +1 -0
- package/dist/v2/components/Field.js +204 -0
- package/dist/v2/components/Field.js.map +1 -0
- package/dist/v2/components/FieldError.d.ts +78 -0
- package/dist/v2/components/FieldError.d.ts.map +1 -0
- package/dist/v2/components/FieldError.js +131 -0
- package/dist/v2/components/FieldError.js.map +1 -0
- package/dist/v2/components/FieldHelp.d.ts +54 -0
- package/dist/v2/components/FieldHelp.d.ts.map +1 -0
- package/dist/v2/components/FieldHelp.js +209 -0
- package/dist/v2/components/FieldHelp.js.map +1 -0
- package/dist/v2/components/FileCard.d.ts +75 -0
- package/dist/v2/components/FileCard.d.ts.map +1 -0
- package/dist/v2/components/FileCard.js +169 -0
- package/dist/v2/components/FileCard.js.map +1 -0
- package/dist/v2/components/FilterTab.d.ts +35 -0
- package/dist/v2/components/FilterTab.d.ts.map +1 -0
- package/dist/v2/components/FilterTab.js +145 -0
- package/dist/v2/components/FilterTab.js.map +1 -0
- package/dist/v2/components/ForbiddenPage.d.ts +40 -0
- package/dist/v2/components/ForbiddenPage.d.ts.map +1 -0
- package/dist/v2/components/ForbiddenPage.js +81 -0
- package/dist/v2/components/ForbiddenPage.js.map +1 -0
- package/dist/v2/components/FormGrid.d.ts +81 -0
- package/dist/v2/components/FormGrid.d.ts.map +1 -0
- package/dist/v2/components/FormGrid.js +187 -0
- package/dist/v2/components/FormGrid.js.map +1 -0
- package/dist/v2/components/FormikDisplay.d.ts +38 -0
- package/dist/v2/components/FormikDisplay.d.ts.map +1 -0
- package/dist/v2/components/FormikDisplay.js +125 -0
- package/dist/v2/components/FormikDisplay.js.map +1 -0
- package/dist/v2/components/Input.d.ts +62 -0
- package/dist/v2/components/Input.d.ts.map +1 -0
- package/dist/v2/components/Input.js +115 -0
- package/dist/v2/components/Input.js.map +1 -0
- package/dist/v2/components/KPICard.d.ts +52 -0
- package/dist/v2/components/KPICard.d.ts.map +1 -0
- package/dist/v2/components/KPICard.js +244 -0
- package/dist/v2/components/KPICard.js.map +1 -0
- package/dist/v2/components/KPIStrip.d.ts +68 -0
- package/dist/v2/components/KPIStrip.d.ts.map +1 -0
- package/dist/v2/components/KPIStrip.js +92 -0
- package/dist/v2/components/KPIStrip.js.map +1 -0
- package/dist/v2/components/KV.d.ts +25 -0
- package/dist/v2/components/KV.d.ts.map +1 -0
- package/dist/v2/components/KV.js +82 -0
- package/dist/v2/components/KV.js.map +1 -0
- package/dist/v2/components/KVGrid.d.ts +44 -0
- package/dist/v2/components/KVGrid.d.ts.map +1 -0
- package/dist/v2/components/KVGrid.js +80 -0
- package/dist/v2/components/KVGrid.js.map +1 -0
- package/dist/v2/components/Layout.d.ts +78 -0
- package/dist/v2/components/Layout.d.ts.map +1 -0
- package/dist/v2/components/Layout.js +284 -0
- package/dist/v2/components/Layout.js.map +1 -0
- package/dist/v2/components/MobileRowCard.d.ts +63 -0
- package/dist/v2/components/MobileRowCard.d.ts.map +1 -0
- package/dist/v2/components/MobileRowCard.js +321 -0
- package/dist/v2/components/MobileRowCard.js.map +1 -0
- package/dist/v2/components/Modal.d.ts +21 -0
- package/dist/v2/components/Modal.d.ts.map +1 -0
- package/dist/v2/components/Modal.js +281 -0
- package/dist/v2/components/Modal.js.map +1 -0
- package/dist/v2/components/NetworkErrorPage.d.ts +11 -0
- package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -0
- package/dist/v2/components/NetworkErrorPage.js +86 -0
- package/dist/v2/components/NetworkErrorPage.js.map +1 -0
- package/dist/v2/components/NotFoundPage.d.ts +9 -0
- package/dist/v2/components/NotFoundPage.d.ts.map +1 -0
- package/dist/v2/components/NotFoundPage.js +66 -0
- package/dist/v2/components/NotFoundPage.js.map +1 -0
- package/dist/v2/components/NumberInput.d.ts +83 -0
- package/dist/v2/components/NumberInput.d.ts.map +1 -0
- package/dist/v2/components/NumberInput.js +317 -0
- package/dist/v2/components/NumberInput.js.map +1 -0
- package/dist/v2/components/OverflowMenu.d.ts +55 -0
- package/dist/v2/components/OverflowMenu.d.ts.map +1 -0
- package/dist/v2/components/OverflowMenu.js +192 -0
- package/dist/v2/components/OverflowMenu.js.map +1 -0
- package/dist/v2/components/PdfViewer.d.ts +56 -0
- package/dist/v2/components/PdfViewer.d.ts.map +1 -0
- package/dist/v2/components/PdfViewer.js +132 -0
- package/dist/v2/components/PdfViewer.js.map +1 -0
- package/dist/v2/components/ProgressBar.d.ts +53 -0
- package/dist/v2/components/ProgressBar.d.ts.map +1 -0
- package/dist/v2/components/ProgressBar.js +209 -0
- package/dist/v2/components/ProgressBar.js.map +1 -0
- package/dist/v2/components/Radio.d.ts +78 -0
- package/dist/v2/components/Radio.d.ts.map +1 -0
- package/dist/v2/components/Radio.js +238 -0
- package/dist/v2/components/Radio.js.map +1 -0
- package/dist/v2/components/SectionErrorBoundary.d.ts +89 -0
- package/dist/v2/components/SectionErrorBoundary.d.ts.map +1 -0
- package/dist/v2/components/SectionErrorBoundary.js +221 -0
- package/dist/v2/components/SectionErrorBoundary.js.map +1 -0
- package/dist/v2/components/SectionHeader.d.ts +53 -0
- package/dist/v2/components/SectionHeader.d.ts.map +1 -0
- package/dist/v2/components/SectionHeader.js +140 -0
- package/dist/v2/components/SectionHeader.js.map +1 -0
- package/dist/v2/components/Segmented.d.ts +61 -0
- package/dist/v2/components/Segmented.d.ts.map +1 -0
- package/dist/v2/components/Segmented.js +261 -0
- package/dist/v2/components/Segmented.js.map +1 -0
- package/dist/v2/components/Select.d.ts +90 -0
- package/dist/v2/components/Select.d.ts.map +1 -0
- package/dist/v2/components/Select.js +499 -0
- package/dist/v2/components/Select.js.map +1 -0
- package/dist/v2/components/ServerErrorPage.d.ts +11 -0
- package/dist/v2/components/ServerErrorPage.d.ts.map +1 -0
- package/dist/v2/components/ServerErrorPage.js +82 -0
- package/dist/v2/components/ServerErrorPage.js.map +1 -0
- package/dist/v2/components/Skeleton.d.ts +56 -0
- package/dist/v2/components/Skeleton.d.ts.map +1 -0
- package/dist/v2/components/Skeleton.js +281 -0
- package/dist/v2/components/Skeleton.js.map +1 -0
- package/dist/v2/components/SkipLink.d.ts +30 -0
- package/dist/v2/components/SkipLink.d.ts.map +1 -0
- package/dist/v2/components/SkipLink.js +58 -0
- package/dist/v2/components/SkipLink.js.map +1 -0
- package/dist/v2/components/Spinner.d.ts +40 -0
- package/dist/v2/components/Spinner.d.ts.map +1 -0
- package/dist/v2/components/Spinner.js +76 -0
- package/dist/v2/components/Spinner.js.map +1 -0
- package/dist/v2/components/Status.d.ts +42 -0
- package/dist/v2/components/Status.d.ts.map +1 -0
- package/dist/v2/components/Status.js +71 -0
- package/dist/v2/components/Status.js.map +1 -0
- package/dist/v2/components/Stepper.d.ts +142 -0
- package/dist/v2/components/Stepper.d.ts.map +1 -0
- package/dist/v2/components/Stepper.js +441 -0
- package/dist/v2/components/Stepper.js.map +1 -0
- package/dist/v2/components/Surface.d.ts +94 -0
- package/dist/v2/components/Surface.d.ts.map +1 -0
- package/dist/v2/components/Surface.js +163 -0
- package/dist/v2/components/Surface.js.map +1 -0
- package/dist/v2/components/Switch.d.ts +30 -0
- package/dist/v2/components/Switch.d.ts.map +1 -0
- package/dist/v2/components/Switch.js +136 -0
- package/dist/v2/components/Switch.js.map +1 -0
- package/dist/v2/components/Tabs.d.ts +49 -0
- package/dist/v2/components/Tabs.d.ts.map +1 -0
- package/dist/v2/components/Tabs.js +160 -0
- package/dist/v2/components/Tabs.js.map +1 -0
- package/dist/v2/components/TelInput.d.ts +33 -0
- package/dist/v2/components/TelInput.d.ts.map +1 -0
- package/dist/v2/components/TelInput.js +282 -0
- package/dist/v2/components/TelInput.js.map +1 -0
- package/dist/v2/components/Textarea.d.ts +23 -0
- package/dist/v2/components/Textarea.d.ts.map +1 -0
- package/dist/v2/components/Textarea.js +80 -0
- package/dist/v2/components/Textarea.js.map +1 -0
- package/dist/v2/components/TimePicker.d.ts +21 -0
- package/dist/v2/components/TimePicker.d.ts.map +1 -0
- package/dist/v2/components/TimePicker.js +141 -0
- package/dist/v2/components/TimePicker.js.map +1 -0
- package/dist/v2/components/Toast.d.ts +32 -0
- package/dist/v2/components/Toast.d.ts.map +1 -0
- package/dist/v2/components/Toast.js +385 -0
- package/dist/v2/components/Toast.js.map +1 -0
- package/dist/v2/components/Tooltip.d.ts +9 -0
- package/dist/v2/components/Tooltip.d.ts.map +1 -0
- package/dist/v2/components/Tooltip.js +169 -0
- package/dist/v2/components/Tooltip.js.map +1 -0
- package/dist/v2/components/_ErrorPageBody.d.ts +48 -0
- package/dist/v2/components/_ErrorPageBody.d.ts.map +1 -0
- package/dist/v2/components/_ErrorPageBody.js +96 -0
- package/dist/v2/components/_ErrorPageBody.js.map +1 -0
- package/dist/v2/components/_pickerShared.d.ts +47 -0
- package/dist/v2/components/_pickerShared.d.ts.map +1 -0
- package/dist/v2/components/_pickerShared.js +68 -0
- package/dist/v2/components/_pickerShared.js.map +1 -0
- package/dist/v2/components/index.d.ts +226 -0
- package/dist/v2/components/index.d.ts.map +1 -0
- package/dist/v2/components/index.js +512 -0
- package/dist/v2/components/index.js.map +1 -0
- package/dist/v2/hooks/index.d.ts +11 -0
- package/dist/v2/hooks/index.d.ts.map +1 -0
- package/dist/v2/hooks/index.js +85 -0
- package/dist/v2/hooks/index.js.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.d.ts +22 -0
- package/dist/v2/hooks/useDelayedFlag.d.ts.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.js +60 -0
- package/dist/v2/hooks/useDelayedFlag.js.map +1 -0
- package/dist/v2/hooks/useDensity.d.ts +23 -0
- package/dist/v2/hooks/useDensity.d.ts.map +1 -0
- package/dist/v2/hooks/useDensity.js +124 -0
- package/dist/v2/hooks/useDensity.js.map +1 -0
- package/dist/v2/hooks/useFocusFirstError.d.ts +121 -0
- package/dist/v2/hooks/useFocusFirstError.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusFirstError.js +203 -0
- package/dist/v2/hooks/useFocusFirstError.js.map +1 -0
- package/dist/v2/hooks/useFocusTrap.d.ts +3 -0
- package/dist/v2/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusTrap.js +207 -0
- package/dist/v2/hooks/useFocusTrap.js.map +1 -0
- package/dist/v2/hooks/useFormAutoSave.d.ts +42 -0
- package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -0
- package/dist/v2/hooks/useFormAutoSave.js +186 -0
- package/dist/v2/hooks/useFormAutoSave.js.map +1 -0
- package/dist/v2/hooks/useFormCompletionProgress.d.ts +52 -0
- package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -0
- package/dist/v2/hooks/useFormCompletionProgress.js +136 -0
- package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.d.ts +31 -0
- package/dist/v2/hooks/useResolvedDensity.d.ts.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.js +50 -0
- package/dist/v2/hooks/useResolvedDensity.js.map +1 -0
- package/dist/v2/hooks/useSortedRows.d.ts +25 -0
- package/dist/v2/hooks/useSortedRows.d.ts.map +1 -0
- package/dist/v2/hooks/useSortedRows.js +38 -0
- package/dist/v2/hooks/useSortedRows.js.map +1 -0
- package/dist/v2/hooks/useTabLoading.d.ts +39 -0
- package/dist/v2/hooks/useTabLoading.d.ts.map +1 -0
- package/dist/v2/hooks/useTabLoading.js +85 -0
- package/dist/v2/hooks/useTabLoading.js.map +1 -0
- package/dist/v2/index.d.ts +115 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.js +1127 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/modalContext.d.ts +96 -0
- package/dist/v2/modalContext.d.ts.map +1 -0
- package/dist/v2/modalContext.js +113 -0
- package/dist/v2/modalContext.js.map +1 -0
- package/dist/v2/models/favorite.d.ts +14 -0
- package/dist/v2/models/favorite.d.ts.map +1 -0
- package/dist/v2/models/favorite.js +6 -0
- package/dist/v2/models/favorite.js.map +1 -0
- package/dist/v2/models/index.d.ts +11 -0
- package/dist/v2/models/index.d.ts.map +1 -0
- package/dist/v2/models/index.js +50 -0
- package/dist/v2/models/index.js.map +1 -0
- package/dist/v2/models/personalization.d.ts +65 -0
- package/dist/v2/models/personalization.d.ts.map +1 -0
- package/dist/v2/models/personalization.js +6 -0
- package/dist/v2/models/personalization.js.map +1 -0
- package/dist/v2/models/referentiel.d.ts +67 -0
- package/dist/v2/models/referentiel.d.ts.map +1 -0
- package/dist/v2/models/referentiel.js +6 -0
- package/dist/v2/models/referentiel.js.map +1 -0
- package/dist/v2/models/savedFilter.d.ts +22 -0
- package/dist/v2/models/savedFilter.d.ts.map +1 -0
- package/dist/v2/models/savedFilter.js +6 -0
- package/dist/v2/models/savedFilter.js.map +1 -0
- package/dist/v2/patterns/ActionBar.d.ts +137 -0
- package/dist/v2/patterns/ActionBar.d.ts.map +1 -0
- package/dist/v2/patterns/ActionBar.js +602 -0
- package/dist/v2/patterns/ActionBar.js.map +1 -0
- package/dist/v2/patterns/BulkActionBar.d.ts +63 -0
- package/dist/v2/patterns/BulkActionBar.d.ts.map +1 -0
- package/dist/v2/patterns/BulkActionBar.js +154 -0
- package/dist/v2/patterns/BulkActionBar.js.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.d.ts +62 -0
- package/dist/v2/patterns/CollapsibleDataGrid.d.ts.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js +306 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -0
- package/dist/v2/patterns/ColumnsToggle.d.ts +55 -0
- package/dist/v2/patterns/ColumnsToggle.d.ts.map +1 -0
- package/dist/v2/patterns/ColumnsToggle.js +310 -0
- package/dist/v2/patterns/ColumnsToggle.js.map +1 -0
- package/dist/v2/patterns/DataGrid.d.ts +7 -0
- package/dist/v2/patterns/DataGrid.d.ts.map +1 -0
- package/dist/v2/patterns/DataGrid.js +834 -0
- package/dist/v2/patterns/DataGrid.js.map +1 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts +68 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -0
- package/dist/v2/patterns/DataGridSettingsMenu.js +382 -0
- package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -0
- package/dist/v2/patterns/DataGridToolbar.d.ts +81 -0
- package/dist/v2/patterns/DataGridToolbar.d.ts.map +1 -0
- package/dist/v2/patterns/DataGridToolbar.js +256 -0
- package/dist/v2/patterns/DataGridToolbar.js.map +1 -0
- package/dist/v2/patterns/DataGridVirtualized.d.ts +76 -0
- package/dist/v2/patterns/DataGridVirtualized.d.ts.map +1 -0
- package/dist/v2/patterns/DataGridVirtualized.js +528 -0
- package/dist/v2/patterns/DataGridVirtualized.js.map +1 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts +46 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts.map +1 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js +77 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.d.ts +72 -0
- package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.js +171 -0
- package/dist/v2/patterns/FavoriteColumn.js.map +1 -0
- package/dist/v2/patterns/FavoritesFilter.d.ts +51 -0
- package/dist/v2/patterns/FavoritesFilter.d.ts.map +1 -0
- package/dist/v2/patterns/FavoritesFilter.js +98 -0
- package/dist/v2/patterns/FavoritesFilter.js.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.d.ts +39 -0
- package/dist/v2/patterns/FormErrorSummary.d.ts.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.js +111 -0
- package/dist/v2/patterns/FormErrorSummary.js.map +1 -0
- package/dist/v2/patterns/FormPageShell.d.ts +55 -0
- package/dist/v2/patterns/FormPageShell.d.ts.map +1 -0
- package/dist/v2/patterns/FormPageShell.js +133 -0
- package/dist/v2/patterns/FormPageShell.js.map +1 -0
- package/dist/v2/patterns/FormSection.d.ts +64 -0
- package/dist/v2/patterns/FormSection.d.ts.map +1 -0
- package/dist/v2/patterns/FormSection.js +197 -0
- package/dist/v2/patterns/FormSection.js.map +1 -0
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts +51 -0
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -0
- package/dist/v2/patterns/FormikCheckboxGroup.js +117 -0
- package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -0
- package/dist/v2/patterns/FormikCombobox.d.ts +43 -0
- package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -0
- package/dist/v2/patterns/FormikCombobox.js +121 -0
- package/dist/v2/patterns/FormikCombobox.js.map +1 -0
- package/dist/v2/patterns/FormikDatePicker.d.ts +115 -0
- package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -0
- package/dist/v2/patterns/FormikDatePicker.js +203 -0
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -0
- package/dist/v2/patterns/FormikErrorFocus.d.ts +59 -0
- package/dist/v2/patterns/FormikErrorFocus.d.ts.map +1 -0
- package/dist/v2/patterns/FormikErrorFocus.js +83 -0
- package/dist/v2/patterns/FormikErrorFocus.js.map +1 -0
- package/dist/v2/patterns/FormikFile.d.ts +43 -0
- package/dist/v2/patterns/FormikFile.d.ts.map +1 -0
- package/dist/v2/patterns/FormikFile.js +156 -0
- package/dist/v2/patterns/FormikFile.js.map +1 -0
- package/dist/v2/patterns/FormikInput.d.ts +72 -0
- package/dist/v2/patterns/FormikInput.d.ts.map +1 -0
- package/dist/v2/patterns/FormikInput.js +135 -0
- package/dist/v2/patterns/FormikInput.js.map +1 -0
- package/dist/v2/patterns/FormikReferentielField.d.ts +33 -0
- package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -0
- package/dist/v2/patterns/FormikReferentielField.js +124 -0
- package/dist/v2/patterns/FormikReferentielField.js.map +1 -0
- package/dist/v2/patterns/FormikSelect.d.ts +61 -0
- package/dist/v2/patterns/FormikSelect.d.ts.map +1 -0
- package/dist/v2/patterns/FormikSelect.js +165 -0
- package/dist/v2/patterns/FormikSelect.js.map +1 -0
- package/dist/v2/patterns/FormikTextarea.d.ts +31 -0
- package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -0
- package/dist/v2/patterns/FormikTextarea.js +84 -0
- package/dist/v2/patterns/FormikTextarea.js.map +1 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +44 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +203 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -0
- package/dist/v2/patterns/NetworkErrorBanner.d.ts +26 -0
- package/dist/v2/patterns/NetworkErrorBanner.d.ts.map +1 -0
- package/dist/v2/patterns/NetworkErrorBanner.js +82 -0
- package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -0
- package/dist/v2/patterns/PageContent.d.ts +40 -0
- package/dist/v2/patterns/PageContent.d.ts.map +1 -0
- package/dist/v2/patterns/PageContent.js +69 -0
- package/dist/v2/patterns/PageContent.js.map +1 -0
- package/dist/v2/patterns/ReferentielField.d.ts +118 -0
- package/dist/v2/patterns/ReferentielField.d.ts.map +1 -0
- package/dist/v2/patterns/ReferentielField.js +618 -0
- package/dist/v2/patterns/ReferentielField.js.map +1 -0
- package/dist/v2/patterns/SaveFilterDialog.d.ts +68 -0
- package/dist/v2/patterns/SaveFilterDialog.d.ts.map +1 -0
- package/dist/v2/patterns/SaveFilterDialog.js +204 -0
- package/dist/v2/patterns/SaveFilterDialog.js.map +1 -0
- package/dist/v2/patterns/SavedFiltersMenu.d.ts +74 -0
- package/dist/v2/patterns/SavedFiltersMenu.d.ts.map +1 -0
- package/dist/v2/patterns/SavedFiltersMenu.js +413 -0
- package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -0
- package/dist/v2/patterns/SkeletonPageShell.d.ts +76 -0
- package/dist/v2/patterns/SkeletonPageShell.d.ts.map +1 -0
- package/dist/v2/patterns/SkeletonPageShell.js +347 -0
- package/dist/v2/patterns/SkeletonPageShell.js.map +1 -0
- package/dist/v2/patterns/SortableHeader.d.ts +47 -0
- package/dist/v2/patterns/SortableHeader.d.ts.map +1 -0
- package/dist/v2/patterns/SortableHeader.js +193 -0
- package/dist/v2/patterns/SortableHeader.js.map +1 -0
- package/dist/v2/patterns/Tour.d.ts +55 -0
- package/dist/v2/patterns/Tour.d.ts.map +1 -0
- package/dist/v2/patterns/Tour.js +474 -0
- package/dist/v2/patterns/Tour.js.map +1 -0
- package/dist/v2/patterns/_dataGridShared.d.ts +144 -0
- package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -0
- package/dist/v2/patterns/_dataGridShared.js +440 -0
- package/dist/v2/patterns/_dataGridShared.js.map +1 -0
- package/dist/v2/patterns/_sort.d.ts +22 -0
- package/dist/v2/patterns/_sort.d.ts.map +1 -0
- package/dist/v2/patterns/_sort.js +118 -0
- package/dist/v2/patterns/_sort.js.map +1 -0
- package/dist/v2/patterns/_useColumnReorder.d.ts +69 -0
- package/dist/v2/patterns/_useColumnReorder.d.ts.map +1 -0
- package/dist/v2/patterns/_useColumnReorder.js +264 -0
- package/dist/v2/patterns/_useColumnReorder.js.map +1 -0
- package/dist/v2/patterns/_useColumnResize.d.ts +49 -0
- package/dist/v2/patterns/_useColumnResize.d.ts.map +1 -0
- package/dist/v2/patterns/_useColumnResize.js +198 -0
- package/dist/v2/patterns/_useColumnResize.js.map +1 -0
- package/dist/v2/patterns/index.d.ts +89 -0
- package/dist/v2/patterns/index.d.ts.map +1 -0
- package/dist/v2/patterns/index.js +246 -0
- package/dist/v2/patterns/index.js.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts +80 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.js +177 -0
- package/dist/v2/personalization/PersonalizationProvider.js.map +1 -0
- package/dist/v2/personalization/adapters/_storageKey.d.ts +35 -0
- package/dist/v2/personalization/adapters/_storageKey.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/_storageKey.js +69 -0
- package/dist/v2/personalization/adapters/_storageKey.js.map +1 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts +31 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +128 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts +25 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.js +76 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -0
- package/dist/v2/personalization/adapters/index.d.ts +10 -0
- package/dist/v2/personalization/adapters/index.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/index.js +21 -0
- package/dist/v2/personalization/adapters/index.js.map +1 -0
- package/dist/v2/personalization/capabilities/favorites.d.ts +53 -0
- package/dist/v2/personalization/capabilities/favorites.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/favorites.js +223 -0
- package/dist/v2/personalization/capabilities/favorites.js.map +1 -0
- package/dist/v2/personalization/capabilities/favoritesView.d.ts +58 -0
- package/dist/v2/personalization/capabilities/favoritesView.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/favoritesView.js +121 -0
- package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -0
- package/dist/v2/personalization/capabilities/index.d.ts +16 -0
- package/dist/v2/personalization/capabilities/index.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/index.js +69 -0
- package/dist/v2/personalization/capabilities/index.js.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.d.ts +61 -0
- package/dist/v2/personalization/capabilities/savedFilters.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.js +297 -0
- package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -0
- package/dist/v2/personalization/createPersonalizationStore.d.ts +76 -0
- package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -0
- package/dist/v2/personalization/createPersonalizationStore.js +475 -0
- package/dist/v2/personalization/createPersonalizationStore.js.map +1 -0
- package/dist/v2/personalization/index.d.ts +33 -0
- package/dist/v2/personalization/index.d.ts.map +1 -0
- package/dist/v2/personalization/index.js +111 -0
- package/dist/v2/personalization/index.js.map +1 -0
- package/dist/v2/personalization/personalizationContext.d.ts +78 -0
- package/dist/v2/personalization/personalizationContext.d.ts.map +1 -0
- package/dist/v2/personalization/personalizationContext.js +121 -0
- package/dist/v2/personalization/personalizationContext.js.map +1 -0
- package/dist/v2/personalization/schema.d.ts +60 -0
- package/dist/v2/personalization/schema.d.ts.map +1 -0
- package/dist/v2/personalization/schema.js +102 -0
- package/dist/v2/personalization/schema.js.map +1 -0
- package/dist/v2/personalization/types.d.ts +81 -0
- package/dist/v2/personalization/types.d.ts.map +1 -0
- package/dist/v2/personalization/types.js +6 -0
- package/dist/v2/personalization/types.js.map +1 -0
- package/dist/v2/referentiel/ReferentielProvider.d.ts +53 -0
- package/dist/v2/referentiel/ReferentielProvider.d.ts.map +1 -0
- package/dist/v2/referentiel/ReferentielProvider.js +94 -0
- package/dist/v2/referentiel/ReferentielProvider.js.map +1 -0
- package/dist/v2/referentiel/index.d.ts +18 -0
- package/dist/v2/referentiel/index.d.ts.map +1 -0
- package/dist/v2/referentiel/index.js +44 -0
- package/dist/v2/referentiel/index.js.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.d.ts +15 -0
- package/dist/v2/referentiel/useReferentielClient.d.ts.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.js +46 -0
- package/dist/v2/referentiel/useReferentielClient.js.map +1 -0
- package/dist/v2/referentiel/useReferentielOptions.d.ts +40 -0
- package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -0
- package/dist/v2/referentiel/useReferentielOptions.js +177 -0
- package/dist/v2/referentiel/useReferentielOptions.js.map +1 -0
- package/dist/v2/referentiel/useReferentielSearch.d.ts +76 -0
- package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -0
- package/dist/v2/referentiel/useReferentielSearch.js +140 -0
- package/dist/v2/referentiel/useReferentielSearch.js.map +1 -0
- package/dist/v2/styles/base.css +425 -0
- package/dist/v2/styles/css.d.ts +10 -0
- package/dist/v2/styles/index.d.ts +12 -0
- package/dist/v2/styles/index.d.ts.map +1 -0
- package/dist/v2/styles/index.js +4 -0
- package/dist/v2/styles/index.js.map +1 -0
- package/dist/v2/theme/_brand.d.ts +29 -0
- package/dist/v2/theme/_brand.d.ts.map +1 -0
- package/dist/v2/theme/_brand.js +69 -0
- package/dist/v2/theme/_brand.js.map +1 -0
- package/dist/v2/theme/_brandSecondary.d.ts +26 -0
- package/dist/v2/theme/_brandSecondary.d.ts.map +1 -0
- package/dist/v2/theme/_brandSecondary.js +65 -0
- package/dist/v2/theme/_brandSecondary.js.map +1 -0
- package/dist/v2/theme/createPortnetTheme.d.ts +75 -0
- package/dist/v2/theme/createPortnetTheme.d.ts.map +1 -0
- package/dist/v2/theme/createPortnetTheme.js +553 -0
- package/dist/v2/theme/createPortnetTheme.js.map +1 -0
- package/dist/v2/theme/cssVariables.d.ts +41 -0
- package/dist/v2/theme/cssVariables.d.ts.map +1 -0
- package/dist/v2/theme/cssVariables.js +205 -0
- package/dist/v2/theme/cssVariables.js.map +1 -0
- package/dist/v2/theme/index.d.ts +33 -0
- package/dist/v2/theme/index.d.ts.map +1 -0
- package/dist/v2/theme/index.js +60 -0
- package/dist/v2/theme/index.js.map +1 -0
- package/dist/v2/tokens/breakpoints.d.ts +74 -0
- package/dist/v2/tokens/breakpoints.d.ts.map +1 -0
- package/dist/v2/tokens/breakpoints.js +114 -0
- package/dist/v2/tokens/breakpoints.js.map +1 -0
- package/dist/v2/tokens/colors.d.ts +228 -0
- package/dist/v2/tokens/colors.d.ts.map +1 -0
- package/dist/v2/tokens/colors.js +225 -0
- package/dist/v2/tokens/colors.js.map +1 -0
- package/dist/v2/tokens/density.d.ts +142 -0
- package/dist/v2/tokens/density.d.ts.map +1 -0
- package/dist/v2/tokens/density.js +111 -0
- package/dist/v2/tokens/density.js.map +1 -0
- package/dist/v2/tokens/index.d.ts +556 -0
- package/dist/v2/tokens/index.d.ts.map +1 -0
- package/dist/v2/tokens/index.js +313 -0
- package/dist/v2/tokens/index.js.map +1 -0
- package/dist/v2/tokens/motion.d.ts +85 -0
- package/dist/v2/tokens/motion.d.ts.map +1 -0
- package/dist/v2/tokens/motion.js +94 -0
- package/dist/v2/tokens/motion.js.map +1 -0
- package/dist/v2/tokens/radius.d.ts +18 -0
- package/dist/v2/tokens/radius.d.ts.map +1 -0
- package/dist/v2/tokens/radius.js +28 -0
- package/dist/v2/tokens/radius.js.map +1 -0
- package/dist/v2/tokens/shadows.d.ts +25 -0
- package/dist/v2/tokens/shadows.d.ts.map +1 -0
- package/dist/v2/tokens/shadows.js +46 -0
- package/dist/v2/tokens/shadows.js.map +1 -0
- package/dist/v2/tokens/spacing.d.ts +38 -0
- package/dist/v2/tokens/spacing.d.ts.map +1 -0
- package/dist/v2/tokens/spacing.js +57 -0
- package/dist/v2/tokens/spacing.js.map +1 -0
- package/dist/v2/tokens/state.d.ts +40 -0
- package/dist/v2/tokens/state.d.ts.map +1 -0
- package/dist/v2/tokens/state.js +47 -0
- package/dist/v2/tokens/state.js.map +1 -0
- package/dist/v2/tokens/statusPalette.d.ts +54 -0
- package/dist/v2/tokens/statusPalette.d.ts.map +1 -0
- package/dist/v2/tokens/statusPalette.js +72 -0
- package/dist/v2/tokens/statusPalette.js.map +1 -0
- package/dist/v2/tokens/tokens.json +153 -0
- package/dist/v2/tokens/typography.d.ts +206 -0
- package/dist/v2/tokens/typography.d.ts.map +1 -0
- package/dist/v2/tokens/typography.js +155 -0
- package/dist/v2/tokens/typography.js.map +1 -0
- package/dist/v2/tokens/zIndex.d.ts +33 -0
- package/dist/v2/tokens/zIndex.d.ts.map +1 -0
- package/dist/v2/tokens/zIndex.js +50 -0
- package/dist/v2/tokens/zIndex.js.map +1 -0
- package/dist/v2/types/common.d.ts +24 -0
- package/dist/v2/types/common.d.ts.map +1 -0
- package/dist/v2/types/common.js +6 -0
- package/dist/v2/types/common.js.map +1 -0
- package/dist/v2/types/datagrid.d.ts +131 -0
- package/dist/v2/types/datagrid.d.ts.map +1 -0
- package/dist/v2/types/datagrid.js +6 -0
- package/dist/v2/types/datagrid.js.map +1 -0
- package/dist/v2/types/index.d.ts +11 -0
- package/dist/v2/types/index.d.ts.map +1 -0
- package/dist/v2/types/index.js +28 -0
- package/dist/v2/types/index.js.map +1 -0
- package/dist/v2/utils/apiError.d.ts +151 -0
- package/dist/v2/utils/apiError.d.ts.map +1 -0
- package/dist/v2/utils/apiError.js +290 -0
- package/dist/v2/utils/apiError.js.map +1 -0
- package/dist/v2/utils/contrast.d.ts +68 -0
- package/dist/v2/utils/contrast.d.ts.map +1 -0
- package/dist/v2/utils/contrast.js +167 -0
- package/dist/v2/utils/contrast.js.map +1 -0
- package/dist/v2/utils/cx.d.ts +9 -0
- package/dist/v2/utils/cx.d.ts.map +1 -0
- package/dist/v2/utils/cx.js +45 -0
- package/dist/v2/utils/cx.js.map +1 -0
- package/dist/v2/utils/fileDownload.d.ts +94 -0
- package/dist/v2/utils/fileDownload.d.ts.map +1 -0
- package/dist/v2/utils/fileDownload.js +236 -0
- package/dist/v2/utils/fileDownload.js.map +1 -0
- package/dist/v2/utils/fmtMoney.d.ts +28 -0
- package/dist/v2/utils/fmtMoney.d.ts.map +1 -0
- package/dist/v2/utils/fmtMoney.js +84 -0
- package/dist/v2/utils/fmtMoney.js.map +1 -0
- package/dist/v2/utils/index.d.ts +9 -0
- package/dist/v2/utils/index.d.ts.map +1 -0
- package/dist/v2/utils/index.js +97 -0
- package/dist/v2/utils/index.js.map +1 -0
- package/dist/v2/utils/mergeLabels.d.ts +59 -0
- package/dist/v2/utils/mergeLabels.d.ts.map +1 -0
- package/dist/v2/utils/mergeLabels.js +93 -0
- package/dist/v2/utils/mergeLabels.js.map +1 -0
- package/dist/v2/utils/networkStatus.d.ts +88 -0
- package/dist/v2/utils/networkStatus.d.ts.map +1 -0
- package/dist/v2/utils/networkStatus.js +121 -0
- package/dist/v2/utils/networkStatus.js.map +1 -0
- package/package.json +198 -76
- package/dist/api/guideApi.js +0 -12
- package/dist/api/guideImageService.js +0 -119
- package/dist/api/reclamationApi.js +0 -119
- package/dist/assets/guides/FAQ.json +0 -118
- package/dist/assets/guides/index.js +0 -11
- package/dist/assets/images/tijariaLogo.ico +0 -0
- package/dist/components/buttons/PuiButton.js +0 -217
- package/dist/components/buttons/PuiIconButton.js +0 -98
- package/dist/components/common/PuiAlertContext.js +0 -12
- package/dist/components/common/PuiHelpWidgetContext.js +0 -17
- package/dist/components/common/StyledMuiButton.js +0 -48
- package/dist/components/common/StyledMuiTextField.js +0 -180
- package/dist/components/inputs/PuiAutocomplete.js +0 -352
- package/dist/components/inputs/PuiCheckbox.js +0 -308
- package/dist/components/inputs/PuiCheckboxGroup.js +0 -215
- package/dist/components/inputs/PuiCheckboxItem.js +0 -162
- package/dist/components/inputs/PuiDateField.js +0 -280
- package/dist/components/inputs/PuiDateTimeField.js +0 -276
- package/dist/components/inputs/PuiFileField.js +0 -265
- package/dist/components/inputs/PuiRadioGroup.js +0 -197
- package/dist/components/inputs/PuiRadioItem.js +0 -100
- package/dist/components/inputs/PuiSelect.js +0 -427
- package/dist/components/inputs/PuiTextField.js +0 -263
- package/dist/components/others/PuiBadge.js +0 -58
- package/dist/components/others/PuiChip.js +0 -150
- package/dist/components/others/PuiDialog.js +0 -102
- package/dist/components/others/PuiFormikForm.js +0 -70
- package/dist/components/others/PuiGrid.js +0 -23
- package/dist/components/others/PuiIcon.js +0 -92
- package/dist/components/others/PuiLoadingBackdrop.js +0 -32
- package/dist/components/others/PuiMainContainer.js +0 -41
- package/dist/components/others/PuiNavigation.js +0 -68
- package/dist/components/others/PuiSection.js +0 -187
- package/dist/components/others/PuiTooltip.js +0 -86
- package/dist/components/providers/PuiAlertProvider.js +0 -134
- package/dist/components/providers/PuiHelpWidgetProvider.js +0 -91
- package/dist/components/providers/PuiLocalizationProvider.js +0 -34
- package/dist/components/referentiel/common/ReferetielContext.js +0 -12
- package/dist/components/referentiel/common/constants/specificReferentielsApis.js +0 -22
- package/dist/components/referentiel/common/constants/specificReferentielsBaseColumns.js +0 -691
- package/dist/components/referentiel/common/constants/specificReferentielsBaseFilters.js +0 -598
- package/dist/components/referentiel/common/constants/specificReferentielsInitialValues.js +0 -80
- package/dist/components/referentiel/common/constants/specificReferentielsKeys.js +0 -18
- package/dist/components/referentiel/common/constants/specificReferentielsTitles.js +0 -22
- package/dist/components/referentiel/common/constants/specificReferentielsValidationSchemas.js +0 -85
- package/dist/components/referentiel/components/PuiBasePopupReferentielField.js +0 -356
- package/dist/components/referentiel/components/PuiCustomPopupReferentielField.js +0 -181
- package/dist/components/referentiel/components/PuiSimplePopupReferentielField.js +0 -325
- package/dist/components/referentiel/components/PuiSimpleReferentielField.js +0 -203
- package/dist/components/referentiel/components/PuiSpecificReferentielField.js +0 -352
- package/dist/components/referentiel/providers/PuiReferentielProvider.js +0 -66
- package/dist/components/tab/PuiTab.js +0 -25
- package/dist/components/tab/PuiTabs.js +0 -148
- package/dist/components/table/PuiTable.js +0 -643
- package/dist/components/table/PuiTableAction.js +0 -75
- package/dist/components/typography/PuiDefinition.js +0 -42
- package/dist/components/typography/PuiIndication.js +0 -80
- package/dist/components/typography/PuiMainTitle.js +0 -144
- package/dist/components/ui/dialogs/PuiSearchDialog.js +0 -106
- package/dist/components/ui/pages/errors/PuiErrorBasePage.js +0 -73
- package/dist/components/ui/pages/errors/PuiForbiddenErrorPage.js +0 -36
- package/dist/components/ui/pages/errors/PuiNetworkErrorPage.js +0 -36
- package/dist/components/ui/pages/errors/PuiNotFoundErrorPage.js +0 -30
- package/dist/components/ui/pages/errors/PuiServerErrorPage.js +0 -37
- package/dist/components/ui/pages/general/PuiDefaultPage.js +0 -68
- package/dist/components/ui/pages/general/PuiSearchPage.js +0 -203
- package/dist/components/widgets/GuideImage.js +0 -251
- package/dist/components/widgets/PuiHelpWidget.js +0 -4276
- package/dist/config/apperance.js +0 -26
- package/dist/config/mapping.js +0 -26
- package/dist/config/referentiel.js +0 -10
- package/dist/general/yupValidationErrors.js +0 -8
- package/dist/hooks/useAlert.js +0 -19
- package/dist/hooks/useAxios.js +0 -23
- package/dist/hooks/useQuery.js +0 -21
- package/dist/hooks/useReclamation.js +0 -116
- package/dist/styles/ReclamationFormModal.css +0 -629
- package/dist/styles/help-widget.css +0 -621
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File download utilities — Portnet UI v2
|
|
3
|
+
*
|
|
4
|
+
* Turns a base64 payload from the API into a browser download. Every GU
|
|
5
|
+
* module that lets a user retrieve an attached document needs this, and
|
|
6
|
+
* before this file each one carried its own copy of the same
|
|
7
|
+
* atob → Uint8Array → Blob → anchor sequence plus its own MIME map.
|
|
8
|
+
*
|
|
9
|
+
* DEPENDENCY-FREE ON PURPOSE. Multi-file (zip) bundling is deliberately NOT
|
|
10
|
+
* here: it needs a zip library, and making that a hard dependency of the
|
|
11
|
+
* design system would put it in every module's bundle against the
|
|
12
|
+
* R-8.2 budget (180 KB gz initial JS) for a capability only
|
|
13
|
+
* document-heavy modules use. If it is promoted later it belongs behind an
|
|
14
|
+
* OPTIONAL peer dependency, the way PdfViewer sits behind pdfjs-dist and
|
|
15
|
+
* @react-pdf-viewer/* in peerDependenciesMeta.
|
|
16
|
+
*
|
|
17
|
+
* Charter ref: §09.3 — the caller owns the user-facing message; these
|
|
18
|
+
* return a boolean rather than throwing so a failure surfaces as copy
|
|
19
|
+
* (R-4.4) instead of an unhandled rejection.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Extension → MIME type for the formats the platform accepts as
|
|
24
|
+
* attachments.
|
|
25
|
+
*
|
|
26
|
+
* Anything unmapped resolves to application/octet-stream, which makes the
|
|
27
|
+
* browser download the file rather than attempt to render it — the safe
|
|
28
|
+
* default for an unknown payload.
|
|
29
|
+
*/
|
|
30
|
+
var MIME_TYPES = Object.freeze({
|
|
31
|
+
// Documents
|
|
32
|
+
pdf: "application/pdf",
|
|
33
|
+
doc: "application/msword",
|
|
34
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
35
|
+
xls: "application/vnd.ms-excel",
|
|
36
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
37
|
+
csv: "text/csv",
|
|
38
|
+
txt: "text/plain",
|
|
39
|
+
// Images
|
|
40
|
+
png: "image/png",
|
|
41
|
+
jpg: "image/jpeg",
|
|
42
|
+
jpeg: "image/jpeg",
|
|
43
|
+
gif: "image/gif",
|
|
44
|
+
bmp: "image/bmp",
|
|
45
|
+
webp: "image/webp",
|
|
46
|
+
svg: "image/svg+xml",
|
|
47
|
+
ico: "image/x-icon",
|
|
48
|
+
tiff: "image/tiff",
|
|
49
|
+
tif: "image/tiff"
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Resolve the MIME type for a file extension.
|
|
54
|
+
*
|
|
55
|
+
* @param extension - Extension WITHOUT a leading dot. Case-insensitive.
|
|
56
|
+
* @returns The mapped MIME type, or "application/octet-stream".
|
|
57
|
+
*/
|
|
58
|
+
export function getMimeType(extension) {
|
|
59
|
+
var _MIME_TYPES$extension;
|
|
60
|
+
return (_MIME_TYPES$extension = MIME_TYPES[extension.toLowerCase()]) !== null && _MIME_TYPES$extension !== void 0 ? _MIME_TYPES$extension : "application/octet-stream";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Decode a base64 payload and hand it to the browser as a download.
|
|
65
|
+
*
|
|
66
|
+
* @param base64Data - Base64 WITHOUT a `data:` prefix, as the getFile /
|
|
67
|
+
* downloadFile endpoints return it.
|
|
68
|
+
* @param fileName - Filename offered to the user. The extension is NOT
|
|
69
|
+
* appended automatically; pass it already suffixed if
|
|
70
|
+
* you want one.
|
|
71
|
+
* @param extension - Used only to resolve the Blob's MIME type.
|
|
72
|
+
* @returns true on success; false if decoding failed or there is no DOM.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* const ok = downloadBase64File(body.content, body.fileName, body.extension);
|
|
76
|
+
* if (!ok) toast("Le téléchargement a échoué. Veuillez réessayer.", "error");
|
|
77
|
+
*/
|
|
78
|
+
export function downloadBase64File(base64Data, fileName, extension) {
|
|
79
|
+
// Guarded rather than assumed: this runs in jsdom under test and could be
|
|
80
|
+
// reached during SSR. The host modules' copies of this threw in both.
|
|
81
|
+
if (typeof document === "undefined" || typeof atob === "undefined") {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
var url = null;
|
|
85
|
+
var link = null;
|
|
86
|
+
try {
|
|
87
|
+
var binary = atob(base64Data);
|
|
88
|
+
var bytes = new Uint8Array(binary.length);
|
|
89
|
+
for (var i = 0; i < binary.length; i += 1) {
|
|
90
|
+
bytes[i] = binary.charCodeAt(i);
|
|
91
|
+
}
|
|
92
|
+
var blob = new Blob([bytes], {
|
|
93
|
+
type: getMimeType(extension)
|
|
94
|
+
});
|
|
95
|
+
url = URL.createObjectURL(blob);
|
|
96
|
+
link = document.createElement("a");
|
|
97
|
+
link.href = url;
|
|
98
|
+
link.download = fileName;
|
|
99
|
+
document.body.appendChild(link);
|
|
100
|
+
link.click();
|
|
101
|
+
return true;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
// eslint-disable-next-line no-console
|
|
104
|
+
console.error("[@portnet/ui] downloadBase64File failed:", error);
|
|
105
|
+
return false;
|
|
106
|
+
} finally {
|
|
107
|
+
// finally, not the happy path: the host copies leaked both the anchor
|
|
108
|
+
// and the object URL whenever click() or appendChild threw.
|
|
109
|
+
if (link && link.parentNode) link.parentNode.removeChild(link);
|
|
110
|
+
if (url) URL.revokeObjectURL(url);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Delay before revoking a preview's object URL.
|
|
116
|
+
*
|
|
117
|
+
* It CANNOT be revoked synchronously: the newly opened tab still has to fetch
|
|
118
|
+
* the blob. There is no portable "that tab finished loading" signal for a blob
|
|
119
|
+
* URL, so a timeout is the only cross-browser option. Deliberately generous:
|
|
120
|
+
* revoking early shows the user a blank tab, while being late costs one
|
|
121
|
+
* short-lived blob.
|
|
122
|
+
*/
|
|
123
|
+
var PREVIEW_REVOKE_DELAY_MS = 60000;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Decode a base64 payload and open it in a new tab for preview.
|
|
127
|
+
*
|
|
128
|
+
* Companion to downloadBase64File: every document-bearing GU module offers a
|
|
129
|
+
* « Visualiser » action next to « Télécharger », and each carried its own copy of
|
|
130
|
+
* this atob -> Uint8Array -> Blob -> window.open sequence. NONE of those copies
|
|
131
|
+
* revoked the object URL, so every preview leaked a blob for the lifetime of the
|
|
132
|
+
* page.
|
|
133
|
+
*
|
|
134
|
+
* RETURN VALUE — read this before relying on it. `window.open` returns null BY
|
|
135
|
+
* SPECIFICATION when "noopener" is set, so a blocked popup is indistinguishable
|
|
136
|
+
* from a successful one. `true` therefore means "decoded and the open call was
|
|
137
|
+
* issued without throwing" — NOT "the tab is on screen". Do not use it to claim
|
|
138
|
+
* success to the user; use `false` to report a genuine failure (bad payload, no
|
|
139
|
+
* DOM). Dropping "noopener" would make blocked-popup detection possible but
|
|
140
|
+
* would hand the opened tab a window.opener reference — not a trade worth making
|
|
141
|
+
* for a diagnostic.
|
|
142
|
+
*
|
|
143
|
+
* @param base64Data - Base64 WITHOUT a `data:` prefix.
|
|
144
|
+
* @param extension - Resolves the Blob MIME type. Required for inline
|
|
145
|
+
* rendering: with the wrong type the browser downloads the
|
|
146
|
+
* file instead of displaying it.
|
|
147
|
+
* @returns false if there is no DOM or the payload could not be decoded.
|
|
148
|
+
*/
|
|
149
|
+
export function openBase64FileInTab(base64Data, extension) {
|
|
150
|
+
if (typeof window === "undefined" || typeof atob === "undefined") {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
var url = null;
|
|
154
|
+
try {
|
|
155
|
+
var binary = atob(base64Data);
|
|
156
|
+
var bytes = new Uint8Array(binary.length);
|
|
157
|
+
for (var i = 0; i < binary.length; i += 1) {
|
|
158
|
+
bytes[i] = binary.charCodeAt(i);
|
|
159
|
+
}
|
|
160
|
+
var blob = new Blob([bytes], {
|
|
161
|
+
type: getMimeType(extension)
|
|
162
|
+
});
|
|
163
|
+
url = URL.createObjectURL(blob);
|
|
164
|
+
window.open(url, "_blank", "noopener,noreferrer");
|
|
165
|
+
var revokeTarget = url;
|
|
166
|
+
window.setTimeout(function () {
|
|
167
|
+
return URL.revokeObjectURL(revokeTarget);
|
|
168
|
+
}, PREVIEW_REVOKE_DELAY_MS);
|
|
169
|
+
return true;
|
|
170
|
+
} catch (error) {
|
|
171
|
+
// Revoke straight away here: nothing consumed the URL on this path.
|
|
172
|
+
if (url) URL.revokeObjectURL(url);
|
|
173
|
+
// eslint-disable-next-line no-console
|
|
174
|
+
console.error("[@portnet/ui] openBase64FileInTab failed:", error);
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Hand an already-materialised Blob to the browser as a download.
|
|
181
|
+
*
|
|
182
|
+
* Companion to downloadBase64File for endpoints that return a binary body
|
|
183
|
+
* directly (axios `responseType: "blob"`) instead of base64 — Excel exports,
|
|
184
|
+
* server-generated PDFs. Host modules built the anchor by hand for this too,
|
|
185
|
+
* and every copy found so far never revoked the object URL.
|
|
186
|
+
*
|
|
187
|
+
* Revoked synchronously in `finally`, unlike openBase64FileInTab: a download is
|
|
188
|
+
* snapshotted by the browser at click() time, so nothing needs the URL
|
|
189
|
+
* afterwards — only a preview in another tab does.
|
|
190
|
+
*
|
|
191
|
+
* @param blob - The payload. Its own `type` is used as-is; no MIME lookup,
|
|
192
|
+
* the server already declared it.
|
|
193
|
+
* @param fileName - Filename offered to the user, extension included.
|
|
194
|
+
* @returns true on success; false if there is no DOM.
|
|
195
|
+
*/
|
|
196
|
+
export function downloadBlobFile(blob, fileName) {
|
|
197
|
+
if (typeof document === "undefined" || typeof URL === "undefined") {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
var url = null;
|
|
201
|
+
var link = null;
|
|
202
|
+
try {
|
|
203
|
+
url = URL.createObjectURL(blob);
|
|
204
|
+
link = document.createElement("a");
|
|
205
|
+
link.href = url;
|
|
206
|
+
link.download = fileName;
|
|
207
|
+
document.body.appendChild(link);
|
|
208
|
+
link.click();
|
|
209
|
+
return true;
|
|
210
|
+
} catch (error) {
|
|
211
|
+
// eslint-disable-next-line no-console
|
|
212
|
+
console.error("[@portnet/ui] downloadBlobFile failed:", error);
|
|
213
|
+
return false;
|
|
214
|
+
} finally {
|
|
215
|
+
if (link && link.parentNode) link.parentNode.removeChild(link);
|
|
216
|
+
if (url) URL.revokeObjectURL(url);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
var fileDownloadApi = {
|
|
220
|
+
getMimeType: getMimeType,
|
|
221
|
+
downloadBase64File: downloadBase64File,
|
|
222
|
+
openBase64FileInTab: openBase64FileInTab,
|
|
223
|
+
downloadBlobFile: downloadBlobFile
|
|
224
|
+
};
|
|
225
|
+
export default fileDownloadApi;
|
|
226
|
+
//# sourceMappingURL=fileDownload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileDownload.js","names":["MIME_TYPES","Object","freeze","pdf","doc","docx","xls","xlsx","csv","txt","png","jpg","jpeg","gif","bmp","webp","svg","ico","tiff","tif","getMimeType","extension","_MIME_TYPES$extension","toLowerCase","downloadBase64File","base64Data","fileName","document","atob","url","link","binary","bytes","Uint8Array","length","i","charCodeAt","blob","Blob","type","URL","createObjectURL","createElement","href","download","body","appendChild","click","error","console","parentNode","removeChild","revokeObjectURL","PREVIEW_REVOKE_DELAY_MS","openBase64FileInTab","window","open","revokeTarget","setTimeout","downloadBlobFile","fileDownloadApi"],"sources":["../../../../src/lib/v2/utils/fileDownload.ts"],"sourcesContent":["/**\r\n * File download utilities — Portnet UI v2\r\n *\r\n * Turns a base64 payload from the API into a browser download. Every GU\r\n * module that lets a user retrieve an attached document needs this, and\r\n * before this file each one carried its own copy of the same\r\n * atob → Uint8Array → Blob → anchor sequence plus its own MIME map.\r\n *\r\n * DEPENDENCY-FREE ON PURPOSE. Multi-file (zip) bundling is deliberately NOT\r\n * here: it needs a zip library, and making that a hard dependency of the\r\n * design system would put it in every module's bundle against the\r\n * R-8.2 budget (180 KB gz initial JS) for a capability only\r\n * document-heavy modules use. If it is promoted later it belongs behind an\r\n * OPTIONAL peer dependency, the way PdfViewer sits behind pdfjs-dist and\r\n * @react-pdf-viewer/* in peerDependenciesMeta.\r\n *\r\n * Charter ref: §09.3 — the caller owns the user-facing message; these\r\n * return a boolean rather than throwing so a failure surfaces as copy\r\n * (R-4.4) instead of an unhandled rejection.\r\n */\r\n\r\n/**\r\n * Extension → MIME type for the formats the platform accepts as\r\n * attachments.\r\n *\r\n * Anything unmapped resolves to application/octet-stream, which makes the\r\n * browser download the file rather than attempt to render it — the safe\r\n * default for an unknown payload.\r\n */\r\nconst MIME_TYPES: Readonly<Record<string, string>> = Object.freeze({\r\n // Documents\r\n pdf: \"application/pdf\",\r\n doc: \"application/msword\",\r\n docx: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\r\n xls: \"application/vnd.ms-excel\",\r\n xlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\r\n csv: \"text/csv\",\r\n txt: \"text/plain\",\r\n\r\n // Images\r\n png: \"image/png\",\r\n jpg: \"image/jpeg\",\r\n jpeg: \"image/jpeg\",\r\n gif: \"image/gif\",\r\n bmp: \"image/bmp\",\r\n webp: \"image/webp\",\r\n svg: \"image/svg+xml\",\r\n ico: \"image/x-icon\",\r\n tiff: \"image/tiff\",\r\n tif: \"image/tiff\",\r\n});\r\n\r\n/**\r\n * Resolve the MIME type for a file extension.\r\n *\r\n * @param extension - Extension WITHOUT a leading dot. Case-insensitive.\r\n * @returns The mapped MIME type, or \"application/octet-stream\".\r\n */\r\nexport function getMimeType(extension: string): string {\r\n return MIME_TYPES[extension.toLowerCase()] ?? \"application/octet-stream\";\r\n}\r\n\r\n/**\r\n * Decode a base64 payload and hand it to the browser as a download.\r\n *\r\n * @param base64Data - Base64 WITHOUT a `data:` prefix, as the getFile /\r\n * downloadFile endpoints return it.\r\n * @param fileName - Filename offered to the user. The extension is NOT\r\n * appended automatically; pass it already suffixed if\r\n * you want one.\r\n * @param extension - Used only to resolve the Blob's MIME type.\r\n * @returns true on success; false if decoding failed or there is no DOM.\r\n *\r\n * @example\r\n * const ok = downloadBase64File(body.content, body.fileName, body.extension);\r\n * if (!ok) toast(\"Le téléchargement a échoué. Veuillez réessayer.\", \"error\");\r\n */\r\nexport function downloadBase64File(\r\n base64Data: string,\r\n fileName: string,\r\n extension: string,\r\n): boolean {\r\n // Guarded rather than assumed: this runs in jsdom under test and could be\r\n // reached during SSR. The host modules' copies of this threw in both.\r\n if (typeof document === \"undefined\" || typeof atob === \"undefined\") {\r\n return false;\r\n }\r\n\r\n let url: string | null = null;\r\n let link: HTMLAnchorElement | null = null;\r\n\r\n try {\r\n const binary = atob(base64Data);\r\n const bytes = new Uint8Array(binary.length);\r\n for (let i = 0; i < binary.length; i += 1) {\r\n bytes[i] = binary.charCodeAt(i);\r\n }\r\n\r\n const blob = new Blob([bytes], { type: getMimeType(extension) });\r\n\r\n url = URL.createObjectURL(blob);\r\n link = document.createElement(\"a\");\r\n link.href = url;\r\n link.download = fileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n return true;\r\n } catch (error) {\r\n // eslint-disable-next-line no-console\r\n console.error(\"[@portnet/ui] downloadBase64File failed:\", error);\r\n return false;\r\n } finally {\r\n // finally, not the happy path: the host copies leaked both the anchor\r\n // and the object URL whenever click() or appendChild threw.\r\n if (link && link.parentNode) link.parentNode.removeChild(link);\r\n if (url) URL.revokeObjectURL(url);\r\n }\r\n}\r\n\r\n/**\r\n * Delay before revoking a preview's object URL.\r\n *\r\n * It CANNOT be revoked synchronously: the newly opened tab still has to fetch\r\n * the blob. There is no portable \"that tab finished loading\" signal for a blob\r\n * URL, so a timeout is the only cross-browser option. Deliberately generous:\r\n * revoking early shows the user a blank tab, while being late costs one\r\n * short-lived blob.\r\n */\r\nconst PREVIEW_REVOKE_DELAY_MS = 60_000;\r\n\r\n/**\r\n * Decode a base64 payload and open it in a new tab for preview.\r\n *\r\n * Companion to downloadBase64File: every document-bearing GU module offers a\r\n * « Visualiser » action next to « Télécharger », and each carried its own copy of\r\n * this atob -> Uint8Array -> Blob -> window.open sequence. NONE of those copies\r\n * revoked the object URL, so every preview leaked a blob for the lifetime of the\r\n * page.\r\n *\r\n * RETURN VALUE — read this before relying on it. `window.open` returns null BY\r\n * SPECIFICATION when \"noopener\" is set, so a blocked popup is indistinguishable\r\n * from a successful one. `true` therefore means \"decoded and the open call was\r\n * issued without throwing\" — NOT \"the tab is on screen\". Do not use it to claim\r\n * success to the user; use `false` to report a genuine failure (bad payload, no\r\n * DOM). Dropping \"noopener\" would make blocked-popup detection possible but\r\n * would hand the opened tab a window.opener reference — not a trade worth making\r\n * for a diagnostic.\r\n *\r\n * @param base64Data - Base64 WITHOUT a `data:` prefix.\r\n * @param extension - Resolves the Blob MIME type. Required for inline\r\n * rendering: with the wrong type the browser downloads the\r\n * file instead of displaying it.\r\n * @returns false if there is no DOM or the payload could not be decoded.\r\n */\r\nexport function openBase64FileInTab(base64Data: string, extension: string): boolean {\r\n if (typeof window === \"undefined\" || typeof atob === \"undefined\") {\r\n return false;\r\n }\r\n let url: string | null = null;\r\n try {\r\n const binary = atob(base64Data);\r\n const bytes = new Uint8Array(binary.length);\r\n for (let i = 0; i < binary.length; i += 1) {\r\n bytes[i] = binary.charCodeAt(i);\r\n }\r\n const blob = new Blob([bytes], { type: getMimeType(extension) });\r\n url = URL.createObjectURL(blob);\r\n window.open(url, \"_blank\", \"noopener,noreferrer\");\r\n const revokeTarget = url;\r\n window.setTimeout(() => URL.revokeObjectURL(revokeTarget), PREVIEW_REVOKE_DELAY_MS);\r\n return true;\r\n } catch (error) {\r\n // Revoke straight away here: nothing consumed the URL on this path.\r\n if (url) URL.revokeObjectURL(url);\r\n // eslint-disable-next-line no-console\r\n console.error(\"[@portnet/ui] openBase64FileInTab failed:\", error);\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Hand an already-materialised Blob to the browser as a download.\r\n *\r\n * Companion to downloadBase64File for endpoints that return a binary body\r\n * directly (axios `responseType: \"blob\"`) instead of base64 — Excel exports,\r\n * server-generated PDFs. Host modules built the anchor by hand for this too,\r\n * and every copy found so far never revoked the object URL.\r\n *\r\n * Revoked synchronously in `finally`, unlike openBase64FileInTab: a download is\r\n * snapshotted by the browser at click() time, so nothing needs the URL\r\n * afterwards — only a preview in another tab does.\r\n *\r\n * @param blob - The payload. Its own `type` is used as-is; no MIME lookup,\r\n * the server already declared it.\r\n * @param fileName - Filename offered to the user, extension included.\r\n * @returns true on success; false if there is no DOM.\r\n */\r\nexport function downloadBlobFile(blob: Blob, fileName: string): boolean {\r\n if (typeof document === \"undefined\" || typeof URL === \"undefined\") {\r\n return false;\r\n }\r\n let url: string | null = null;\r\n let link: HTMLAnchorElement | null = null;\r\n try {\r\n url = URL.createObjectURL(blob);\r\n link = document.createElement(\"a\");\r\n link.href = url;\r\n link.download = fileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n return true;\r\n } catch (error) {\r\n // eslint-disable-next-line no-console\r\n console.error(\"[@portnet/ui] downloadBlobFile failed:\", error);\r\n return false;\r\n } finally {\r\n if (link && link.parentNode) link.parentNode.removeChild(link);\r\n if (url) URL.revokeObjectURL(url);\r\n }\r\n}\r\n\r\nconst fileDownloadApi = {\r\n getMimeType,\r\n downloadBase64File,\r\n openBase64FileInTab,\r\n downloadBlobFile,\r\n};\r\nexport default fileDownloadApi;\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,UAA4C,GAAGC,MAAM,CAACC,MAAM,CAAC;EACjE;EACAC,GAAG,EAAE,iBAAiB;EACtBC,GAAG,EAAE,oBAAoB;EACzBC,IAAI,EAAE,yEAAyE;EAC/EC,GAAG,EAAE,0BAA0B;EAC/BC,IAAI,EAAE,mEAAmE;EACzEC,GAAG,EAAE,UAAU;EACfC,GAAG,EAAE,YAAY;EAEjB;EACAC,GAAG,EAAE,WAAW;EAChBC,GAAG,EAAE,YAAY;EACjBC,IAAI,EAAE,YAAY;EAClBC,GAAG,EAAE,WAAW;EAChBC,GAAG,EAAE,WAAW;EAChBC,IAAI,EAAE,YAAY;EAClBC,GAAG,EAAE,eAAe;EACpBC,GAAG,EAAE,cAAc;EACnBC,IAAI,EAAE,YAAY;EAClBC,GAAG,EAAE;AACP,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,SAAiB,EAAU;EAAA,IAAAC,qBAAA;EACrD,QAAAA,qBAAA,GAAOtB,UAAU,CAACqB,SAAS,CAACE,WAAW,CAAC,CAAC,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAAI,0BAA0B;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAChCC,UAAkB,EAClBC,QAAgB,EAChBL,SAAiB,EACR;EACT;EACA;EACA,IAAI,OAAOM,QAAQ,KAAK,WAAW,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;IAClE,OAAO,KAAK;EACd;EAEA,IAAIC,GAAkB,GAAG,IAAI;EAC7B,IAAIC,IAA8B,GAAG,IAAI;EAEzC,IAAI;IACF,IAAMC,MAAM,GAAGH,IAAI,CAACH,UAAU,CAAC;IAC/B,IAAMO,KAAK,GAAG,IAAIC,UAAU,CAACF,MAAM,CAACG,MAAM,CAAC;IAC3C,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,MAAM,CAACG,MAAM,EAAEC,CAAC,IAAI,CAAC,EAAE;MACzCH,KAAK,CAACG,CAAC,CAAC,GAAGJ,MAAM,CAACK,UAAU,CAACD,CAAC,CAAC;IACjC;IAEA,IAAME,IAAI,GAAG,IAAIC,IAAI,CAAC,CAACN,KAAK,CAAC,EAAE;MAAEO,IAAI,EAAEnB,WAAW,CAACC,SAAS;IAAE,CAAC,CAAC;IAEhEQ,GAAG,GAAGW,GAAG,CAACC,eAAe,CAACJ,IAAI,CAAC;IAC/BP,IAAI,GAAGH,QAAQ,CAACe,aAAa,CAAC,GAAG,CAAC;IAClCZ,IAAI,CAACa,IAAI,GAAGd,GAAG;IACfC,IAAI,CAACc,QAAQ,GAAGlB,QAAQ;IACxBC,QAAQ,CAACkB,IAAI,CAACC,WAAW,CAAChB,IAAI,CAAC;IAC/BA,IAAI,CAACiB,KAAK,CAAC,CAAC;IACZ,OAAO,IAAI;EACb,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd;IACAC,OAAO,CAACD,KAAK,CAAC,0CAA0C,EAAEA,KAAK,CAAC;IAChE,OAAO,KAAK;EACd,CAAC,SAAS;IACR;IACA;IACA,IAAIlB,IAAI,IAAIA,IAAI,CAACoB,UAAU,EAAEpB,IAAI,CAACoB,UAAU,CAACC,WAAW,CAACrB,IAAI,CAAC;IAC9D,IAAID,GAAG,EAAEW,GAAG,CAACY,eAAe,CAACvB,GAAG,CAAC;EACnC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMwB,uBAAuB,GAAG,KAAM;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAC7B,UAAkB,EAAEJ,SAAiB,EAAW;EAClF,IAAI,OAAOkC,MAAM,KAAK,WAAW,IAAI,OAAO3B,IAAI,KAAK,WAAW,EAAE;IAChE,OAAO,KAAK;EACd;EACA,IAAIC,GAAkB,GAAG,IAAI;EAC7B,IAAI;IACF,IAAME,MAAM,GAAGH,IAAI,CAACH,UAAU,CAAC;IAC/B,IAAMO,KAAK,GAAG,IAAIC,UAAU,CAACF,MAAM,CAACG,MAAM,CAAC;IAC3C,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,MAAM,CAACG,MAAM,EAAEC,CAAC,IAAI,CAAC,EAAE;MACzCH,KAAK,CAACG,CAAC,CAAC,GAAGJ,MAAM,CAACK,UAAU,CAACD,CAAC,CAAC;IACjC;IACA,IAAME,IAAI,GAAG,IAAIC,IAAI,CAAC,CAACN,KAAK,CAAC,EAAE;MAAEO,IAAI,EAAEnB,WAAW,CAACC,SAAS;IAAE,CAAC,CAAC;IAChEQ,GAAG,GAAGW,GAAG,CAACC,eAAe,CAACJ,IAAI,CAAC;IAC/BkB,MAAM,CAACC,IAAI,CAAC3B,GAAG,EAAE,QAAQ,EAAE,qBAAqB,CAAC;IACjD,IAAM4B,YAAY,GAAG5B,GAAG;IACxB0B,MAAM,CAACG,UAAU,CAAC;MAAA,OAAMlB,GAAG,CAACY,eAAe,CAACK,YAAY,CAAC;IAAA,GAAEJ,uBAAuB,CAAC;IACnF,OAAO,IAAI;EACb,CAAC,CAAC,OAAOL,KAAK,EAAE;IACd;IACA,IAAInB,GAAG,EAAEW,GAAG,CAACY,eAAe,CAACvB,GAAG,CAAC;IACjC;IACAoB,OAAO,CAACD,KAAK,CAAC,2CAA2C,EAAEA,KAAK,CAAC;IACjE,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASW,gBAAgBA,CAACtB,IAAU,EAAEX,QAAgB,EAAW;EACtE,IAAI,OAAOC,QAAQ,KAAK,WAAW,IAAI,OAAOa,GAAG,KAAK,WAAW,EAAE;IACjE,OAAO,KAAK;EACd;EACA,IAAIX,GAAkB,GAAG,IAAI;EAC7B,IAAIC,IAA8B,GAAG,IAAI;EACzC,IAAI;IACFD,GAAG,GAAGW,GAAG,CAACC,eAAe,CAACJ,IAAI,CAAC;IAC/BP,IAAI,GAAGH,QAAQ,CAACe,aAAa,CAAC,GAAG,CAAC;IAClCZ,IAAI,CAACa,IAAI,GAAGd,GAAG;IACfC,IAAI,CAACc,QAAQ,GAAGlB,QAAQ;IACxBC,QAAQ,CAACkB,IAAI,CAACC,WAAW,CAAChB,IAAI,CAAC;IAC/BA,IAAI,CAACiB,KAAK,CAAC,CAAC;IACZ,OAAO,IAAI;EACb,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd;IACAC,OAAO,CAACD,KAAK,CAAC,wCAAwC,EAAEA,KAAK,CAAC;IAC9D,OAAO,KAAK;EACd,CAAC,SAAS;IACR,IAAIlB,IAAI,IAAIA,IAAI,CAACoB,UAAU,EAAEpB,IAAI,CAACoB,UAAU,CAACC,WAAW,CAACrB,IAAI,CAAC;IAC9D,IAAID,GAAG,EAAEW,GAAG,CAACY,eAAe,CAACvB,GAAG,CAAC;EACnC;AACF;AAEA,IAAM+B,eAAe,GAAG;EACtBxC,WAAW,EAAXA,WAAW;EACXI,kBAAkB,EAAlBA,kBAAkB;EAClB8B,mBAAmB,EAAnBA,mBAAmB;EACnBK,gBAAgB,EAAhBA;AACF,CAAC;AACD,eAAeC,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fmtMoney — format a number with locale-aware grouping.
|
|
3
|
+
*
|
|
4
|
+
* Returns "—" for null / empty / non-finite inputs (graceful empty
|
|
5
|
+
* cells in tables — never "NaN" or "∞").
|
|
6
|
+
*
|
|
7
|
+
* Defaults to "fr-FR" for back-compat with v1 callers; pass `locale`
|
|
8
|
+
* (BCP-47 tag) to format under any locale supported by the runtime
|
|
9
|
+
* Intl.NumberFormat. Currency placement is a trailing suffix in the
|
|
10
|
+
* locale-formatted number; future evolution toward `style:"currency"`
|
|
11
|
+
* (locale-correct symbol position, proper RTL handling) is deliberately
|
|
12
|
+
* deferred to avoid breaking consumers that grep on the suffix.
|
|
13
|
+
*
|
|
14
|
+
* fmtMoney(1234567.5) → "1 234 567,5"
|
|
15
|
+
* fmtMoney(1234567.5, "EUR") → "1 234 567,5 EUR"
|
|
16
|
+
* fmtMoney(1234567.5, "EUR", { locale: "en-US" }) → "1,234,567.5 EUR"
|
|
17
|
+
* fmtMoney(1234.5, "", { minimumFractionDigits: 2 })
|
|
18
|
+
* → "1 234,50"
|
|
19
|
+
* fmtMoney(null) / fmtMoney("abc") / fmtMoney(Infinity) → "—"
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The locale every unresolvable request falls back to.
|
|
24
|
+
*
|
|
25
|
+
* ── WHY THIS IS NEGOTIATED, NOT JUST CAUGHT ─────────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* The previous implementation relied ONLY on `try/catch`, on the assumption that
|
|
28
|
+
* an unusable locale throws `RangeError`. It does not — and the gap was a live
|
|
29
|
+
* defect, not a theoretical one:
|
|
30
|
+
*
|
|
31
|
+
* `Intl.NumberFormat` throws only on a STRUCTURALLY INVALID tag. A tag that is
|
|
32
|
+
* well-formed but has no data does NOT throw — it negotiates, and with a single
|
|
33
|
+
* unmatched tag the negotiation lands on the RUNTIME DEFAULT LOCALE.
|
|
34
|
+
*
|
|
35
|
+
* `"not-a-real-locale"` is well-formed: `not` parses as a 3-letter language
|
|
36
|
+
* subtag and `-a-real-locale` as a singleton `a` extension sequence. So it never
|
|
37
|
+
* threw, the `catch` never ran, and the result was formatted in whatever locale
|
|
38
|
+
* the host happened to default to. On a German or Spanish host that renders
|
|
39
|
+
* `"1.234,5"` — dot grouping — inside a French application.
|
|
40
|
+
*
|
|
41
|
+
* That is a real consistency breach (Charter §09: a French UI formats numbers in
|
|
42
|
+
* French), and it is invisible on a French dev machine, which is exactly why it
|
|
43
|
+
* survived: the unit test caught it only because CI ran under a non-FR default.
|
|
44
|
+
*
|
|
45
|
+
* Listing the fallback as the SECOND preference makes the guarantee explicit:
|
|
46
|
+
* an unmatched-but-valid tag negotiates down to fr-FR instead of to the host.
|
|
47
|
+
* The `try/catch` is still required for genuinely malformed input.
|
|
48
|
+
*/
|
|
49
|
+
var FALLBACK_LOCALE = "fr-FR";
|
|
50
|
+
export default function fmtMoney(n) {
|
|
51
|
+
var currency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
52
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
53
|
+
if (n == null || n === "") return "—";
|
|
54
|
+
var num = typeof n === "number" ? n : Number(n);
|
|
55
|
+
if (!Number.isFinite(num)) return "—";
|
|
56
|
+
var locale = opts.locale || FALLBACK_LOCALE;
|
|
57
|
+
var formatOpts = {};
|
|
58
|
+
if (opts.minimumFractionDigits != null) {
|
|
59
|
+
formatOpts.minimumFractionDigits = opts.minimumFractionDigits;
|
|
60
|
+
}
|
|
61
|
+
if (opts.maximumFractionDigits != null) {
|
|
62
|
+
formatOpts.maximumFractionDigits = opts.maximumFractionDigits;
|
|
63
|
+
}
|
|
64
|
+
var formatted;
|
|
65
|
+
try {
|
|
66
|
+
/* Requested locale first, fr-FR as the declared next preference — see
|
|
67
|
+
* FALLBACK_LOCALE. A resolvable request ("en-US") still wins outright; an
|
|
68
|
+
* unmatched-but-well-formed tag lands on fr-FR rather than on the host's
|
|
69
|
+
* default locale. */
|
|
70
|
+
formatted = new Intl.NumberFormat([locale, FALLBACK_LOCALE], formatOpts).format(num);
|
|
71
|
+
} catch (_unused) {
|
|
72
|
+
/* Reached only for a STRUCTURALLY invalid tag (RangeError) or a non-string
|
|
73
|
+
* value from an untyped host — negotiation cannot help there. */
|
|
74
|
+
formatted = new Intl.NumberFormat(FALLBACK_LOCALE, formatOpts).format(num);
|
|
75
|
+
}
|
|
76
|
+
return currency ? "".concat(formatted, " ").concat(currency) : formatted;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=fmtMoney.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fmtMoney.js","names":["FALLBACK_LOCALE","fmtMoney","n","currency","arguments","length","undefined","opts","num","Number","isFinite","locale","formatOpts","minimumFractionDigits","maximumFractionDigits","formatted","Intl","NumberFormat","format","_unused","concat"],"sources":["../../../../src/lib/v2/utils/fmtMoney.ts"],"sourcesContent":["/**\r\n * fmtMoney — format a number with locale-aware grouping.\r\n *\r\n * Returns \"—\" for null / empty / non-finite inputs (graceful empty\r\n * cells in tables — never \"NaN\" or \"∞\").\r\n *\r\n * Defaults to \"fr-FR\" for back-compat with v1 callers; pass `locale`\r\n * (BCP-47 tag) to format under any locale supported by the runtime\r\n * Intl.NumberFormat. Currency placement is a trailing suffix in the\r\n * locale-formatted number; future evolution toward `style:\"currency\"`\r\n * (locale-correct symbol position, proper RTL handling) is deliberately\r\n * deferred to avoid breaking consumers that grep on the suffix.\r\n *\r\n * fmtMoney(1234567.5) → \"1 234 567,5\"\r\n * fmtMoney(1234567.5, \"EUR\") → \"1 234 567,5 EUR\"\r\n * fmtMoney(1234567.5, \"EUR\", { locale: \"en-US\" }) → \"1,234,567.5 EUR\"\r\n * fmtMoney(1234.5, \"\", { minimumFractionDigits: 2 })\r\n * → \"1 234,50\"\r\n * fmtMoney(null) / fmtMoney(\"abc\") / fmtMoney(Infinity) → \"—\"\r\n */\r\ntype FmtMoneyOptions = {\r\n locale?: string;\r\n minimumFractionDigits?: number;\r\n maximumFractionDigits?: number;\r\n};\r\n\r\n/**\r\n * The locale every unresolvable request falls back to.\r\n *\r\n * ── WHY THIS IS NEGOTIATED, NOT JUST CAUGHT ─────────────────────────────\r\n *\r\n * The previous implementation relied ONLY on `try/catch`, on the assumption that\r\n * an unusable locale throws `RangeError`. It does not — and the gap was a live\r\n * defect, not a theoretical one:\r\n *\r\n * `Intl.NumberFormat` throws only on a STRUCTURALLY INVALID tag. A tag that is\r\n * well-formed but has no data does NOT throw — it negotiates, and with a single\r\n * unmatched tag the negotiation lands on the RUNTIME DEFAULT LOCALE.\r\n *\r\n * `\"not-a-real-locale\"` is well-formed: `not` parses as a 3-letter language\r\n * subtag and `-a-real-locale` as a singleton `a` extension sequence. So it never\r\n * threw, the `catch` never ran, and the result was formatted in whatever locale\r\n * the host happened to default to. On a German or Spanish host that renders\r\n * `\"1.234,5\"` — dot grouping — inside a French application.\r\n *\r\n * That is a real consistency breach (Charter §09: a French UI formats numbers in\r\n * French), and it is invisible on a French dev machine, which is exactly why it\r\n * survived: the unit test caught it only because CI ran under a non-FR default.\r\n *\r\n * Listing the fallback as the SECOND preference makes the guarantee explicit:\r\n * an unmatched-but-valid tag negotiates down to fr-FR instead of to the host.\r\n * The `try/catch` is still required for genuinely malformed input.\r\n */\r\nconst FALLBACK_LOCALE = \"fr-FR\";\r\n\r\nexport default function fmtMoney(\r\n n: number | string | null | undefined,\r\n currency: string = \"\",\r\n opts: FmtMoneyOptions = {}\r\n): string {\r\n if (n == null || n === \"\") return \"—\";\r\n const num = typeof n === \"number\" ? n : Number(n);\r\n if (!Number.isFinite(num)) return \"—\";\r\n\r\n const locale = opts.locale || FALLBACK_LOCALE;\r\n\r\n const formatOpts: Intl.NumberFormatOptions = {};\r\n if (opts.minimumFractionDigits != null) {\r\n formatOpts.minimumFractionDigits = opts.minimumFractionDigits;\r\n }\r\n if (opts.maximumFractionDigits != null) {\r\n formatOpts.maximumFractionDigits = opts.maximumFractionDigits;\r\n }\r\n\r\n let formatted: string;\r\n try {\r\n /* Requested locale first, fr-FR as the declared next preference — see\r\n * FALLBACK_LOCALE. A resolvable request (\"en-US\") still wins outright; an\r\n * unmatched-but-well-formed tag lands on fr-FR rather than on the host's\r\n * default locale. */\r\n formatted = new Intl.NumberFormat(\r\n [locale, FALLBACK_LOCALE],\r\n formatOpts\r\n ).format(num);\r\n } catch {\r\n /* Reached only for a STRUCTURALLY invalid tag (RangeError) or a non-string\r\n * value from an untyped host — negotiation cannot help there. */\r\n formatted = new Intl.NumberFormat(FALLBACK_LOCALE, formatOpts).format(num);\r\n }\r\n\r\n return currency ? `${formatted} ${currency}` : formatted;\r\n}\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,eAAe,GAAG,OAAO;AAE/B,eAAe,SAASC,QAAQA,CAC9BC,CAAqC,EAG7B;EAAA,IAFRC,QAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IACrBG,IAAqB,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE1B,IAAIF,CAAC,IAAI,IAAI,IAAIA,CAAC,KAAK,EAAE,EAAE,OAAO,GAAG;EACrC,IAAMM,GAAG,GAAG,OAAON,CAAC,KAAK,QAAQ,GAAGA,CAAC,GAAGO,MAAM,CAACP,CAAC,CAAC;EACjD,IAAI,CAACO,MAAM,CAACC,QAAQ,CAACF,GAAG,CAAC,EAAE,OAAO,GAAG;EAErC,IAAMG,MAAM,GAAGJ,IAAI,CAACI,MAAM,IAAIX,eAAe;EAE7C,IAAMY,UAAoC,GAAG,CAAC,CAAC;EAC/C,IAAIL,IAAI,CAACM,qBAAqB,IAAI,IAAI,EAAE;IACtCD,UAAU,CAACC,qBAAqB,GAAGN,IAAI,CAACM,qBAAqB;EAC/D;EACA,IAAIN,IAAI,CAACO,qBAAqB,IAAI,IAAI,EAAE;IACtCF,UAAU,CAACE,qBAAqB,GAAGP,IAAI,CAACO,qBAAqB;EAC/D;EAEA,IAAIC,SAAiB;EACrB,IAAI;IACF;AACJ;AACA;AACA;IACIA,SAAS,GAAG,IAAIC,IAAI,CAACC,YAAY,CAC/B,CAACN,MAAM,EAAEX,eAAe,CAAC,EACzBY,UACF,CAAC,CAACM,MAAM,CAACV,GAAG,CAAC;EACf,CAAC,CAAC,OAAAW,OAAA,EAAM;IACN;AACJ;IACIJ,SAAS,GAAG,IAAIC,IAAI,CAACC,YAAY,CAACjB,eAAe,EAAEY,UAAU,CAAC,CAACM,MAAM,CAACV,GAAG,CAAC;EAC5E;EAEA,OAAOL,QAAQ,MAAAiB,MAAA,CAAML,SAAS,OAAAK,MAAA,CAAIjB,QAAQ,IAAKY,SAAS;AAC1D","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export { cx } from "./cx";
|
|
2
|
+
export { default as fmtMoney } from "./fmtMoney";
|
|
3
|
+
|
|
4
|
+
// Undefined-safe label merge. Every localisable component used to write
|
|
5
|
+
// `labels ? { ...DEFAULTS, ...labels } : DEFAULTS`, and a spread does NOT skip
|
|
6
|
+
// explicit `undefined` — so an override of `undefined` DELETED the default and
|
|
7
|
+
// the component threw `L.x is not a function` at render. Eleven components
|
|
8
|
+
// shipped that hazard; the `?: T` declarations hid it from the compiler by
|
|
9
|
+
// asserting the merged value could never be undefined, which was false at
|
|
10
|
+
// runtime. Surfaced by the G-14 widening. Latent runtime defect, not cosmetics.
|
|
11
|
+
export { mergeLabels } from "./mergeLabels";
|
|
12
|
+
|
|
13
|
+
// Base64 → browser download, plus the extension→MIME map it uses.
|
|
14
|
+
// Flat named exports (not a namespace like contrast below): two
|
|
15
|
+
// independent functions with no shared state, and downloadBase64File
|
|
16
|
+
// is the common call site — qualifying it would only add noise.
|
|
17
|
+
export { downloadBase64File, getMimeType, openBase64FileInTab, downloadBlobFile } from "./fileDownload";
|
|
18
|
+
|
|
19
|
+
// WCAG 2.1 contrast utilities. Re-exported under a namespace at
|
|
20
|
+
// the public barrel (v2.contrast.*) so the named API is grouped
|
|
21
|
+
// and self-describing for callers — used to validate runtime
|
|
22
|
+
// brand overrides against WCAG 1.4.3 and to audit dark-mode
|
|
23
|
+
// token pairs (F29).
|
|
24
|
+
import * as _contrast from "./contrast";
|
|
25
|
+
export { _contrast as contrast }; // `unknown`-rejection narrowing. Mandated by the platform's own
|
|
26
|
+
// `useUnknownInCatchVariables` flag, which makes `catch (e)` bind `unknown` in
|
|
27
|
+
// every consuming saga while `any` and unsafe assertions stay forbidden — the
|
|
28
|
+
// library previously left no sanctioned route between those two rules, and the
|
|
29
|
+
// modules that filled the gap filled it with the forbidden construct.
|
|
30
|
+
// Raised as capability gap G-04 (procuration-portnet-fe Area 5).
|
|
31
|
+
//
|
|
32
|
+
// `getApiErrorDetail` is the LOGGING counterpart added with G-07: since
|
|
33
|
+
// `getApiErrorMessage` now suppresses axios transport phrasings so they cannot
|
|
34
|
+
// reach a user (Charter §09.3), operators still need the unfiltered string for a
|
|
35
|
+
// console or an APM breadcrumb. Display one, log the other.
|
|
36
|
+
export { getApiErrorMessage, getApiErrorDetail, getApiErrorStatus, DEFAULT_API_ERROR_MESSAGE } from "./apiError";
|
|
37
|
+
|
|
38
|
+
// The feed behind NetworkErrorBanner. The banner was exported without the
|
|
39
|
+
// plumbing that decides when it shows, so every module rebuilt the same
|
|
40
|
+
// subscribe/report/clear channel. Raised as capability gap G-03
|
|
41
|
+
// (procuration-portnet-fe Area 5).
|
|
42
|
+
export { networkStatus, createNetworkStatus } from "./networkStatus";
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["cx","default","fmtMoney","mergeLabels","downloadBase64File","getMimeType","openBase64FileInTab","downloadBlobFile","_contrast","contrast","getApiErrorMessage","getApiErrorDetail","getApiErrorStatus","DEFAULT_API_ERROR_MESSAGE","networkStatus","createNetworkStatus"],"sources":["../../../../src/lib/v2/utils/index.ts"],"sourcesContent":["export { cx } from \"./cx\";\r\nexport { default as fmtMoney } from \"./fmtMoney\";\r\n\r\n// Undefined-safe label merge. Every localisable component used to write\r\n// `labels ? { ...DEFAULTS, ...labels } : DEFAULTS`, and a spread does NOT skip\r\n// explicit `undefined` — so an override of `undefined` DELETED the default and\r\n// the component threw `L.x is not a function` at render. Eleven components\r\n// shipped that hazard; the `?: T` declarations hid it from the compiler by\r\n// asserting the merged value could never be undefined, which was false at\r\n// runtime. Surfaced by the G-14 widening. Latent runtime defect, not cosmetics.\r\nexport { mergeLabels } from \"./mergeLabels\";\r\n\r\n// Base64 → browser download, plus the extension→MIME map it uses.\r\n// Flat named exports (not a namespace like contrast below): two\r\n// independent functions with no shared state, and downloadBase64File\r\n// is the common call site — qualifying it would only add noise.\r\nexport {\r\n downloadBase64File,\r\n getMimeType,\r\n openBase64FileInTab,\r\n downloadBlobFile,\r\n} from \"./fileDownload\";\r\n\r\n// WCAG 2.1 contrast utilities. Re-exported under a namespace at\r\n// the public barrel (v2.contrast.*) so the named API is grouped\r\n// and self-describing for callers — used to validate runtime\r\n// brand overrides against WCAG 1.4.3 and to audit dark-mode\r\n// token pairs (F29).\r\nexport * as contrast from \"./contrast\";\r\n\r\n// `unknown`-rejection narrowing. Mandated by the platform's own\r\n// `useUnknownInCatchVariables` flag, which makes `catch (e)` bind `unknown` in\r\n// every consuming saga while `any` and unsafe assertions stay forbidden — the\r\n// library previously left no sanctioned route between those two rules, and the\r\n// modules that filled the gap filled it with the forbidden construct.\r\n// Raised as capability gap G-04 (procuration-portnet-fe Area 5).\r\n//\r\n// `getApiErrorDetail` is the LOGGING counterpart added with G-07: since\r\n// `getApiErrorMessage` now suppresses axios transport phrasings so they cannot\r\n// reach a user (Charter §09.3), operators still need the unfiltered string for a\r\n// console or an APM breadcrumb. Display one, log the other.\r\nexport {\r\n getApiErrorMessage,\r\n getApiErrorDetail,\r\n getApiErrorStatus,\r\n DEFAULT_API_ERROR_MESSAGE,\r\n} from \"./apiError\";\r\n\r\n// The feed behind NetworkErrorBanner. The banner was exported without the\r\n// plumbing that decides when it shows, so every module rebuilt the same\r\n// subscribe/report/clear channel. Raised as capability gap G-03\r\n// (procuration-portnet-fe Area 5).\r\nexport { networkStatus, createNetworkStatus } from \"./networkStatus\";\r\nexport type { NetworkStatus, NetworkStatusListener } from \"./networkStatus\";\r\n"],"mappings":"AAAA,SAASA,EAAE,QAAyB,MAAM;AAC1C,SAASC,OAAO,IAAIC,QAAQ,QAAQ,YAAY;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,WAAW,QAAQ,eAAe;;AAE3C;AACA;AACA;AACA;AACA,SACEC,kBAAkB,EAClBC,WAAW,EACXC,mBAAmB,EACnBC,gBAAgB,QACX,gBAAgB;;AAEvB;AACA;AACA;AACA;AACA;AAAA,YAAAC,SAAA,MAC0B,YAAY;AAAA,SAAAA,SAAA,IAA1BC,QAAQ,IAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEC,kBAAkB,EAClBC,iBAAiB,EACjBC,iBAAiB,EACjBC,yBAAyB,QACpB,YAAY;;AAEnB;AACA;AACA;AACA;AACA,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
/**
|
|
8
|
+
* mergeLabels — Portnet UI v2
|
|
9
|
+
*
|
|
10
|
+
* Merges a consumer's partial label overrides onto a component's frozen
|
|
11
|
+
* defaults, IGNORING keys whose value is `undefined`.
|
|
12
|
+
*
|
|
13
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
* WHY THIS EXISTS (capability gap G-14, latent runtime defect)
|
|
15
|
+
*
|
|
16
|
+
* Every localisable component in this library merged its labels like this:
|
|
17
|
+
*
|
|
18
|
+
* const L = labels ? { ...DEFAULT_LABELS, ...labels } : DEFAULT_LABELS;
|
|
19
|
+
*
|
|
20
|
+
* A spread does NOT skip explicit `undefined`. `{ ...{a: 1}, ...{a: undefined} }`
|
|
21
|
+
* is `{ a: undefined }` — so a consumer writing
|
|
22
|
+
*
|
|
23
|
+
* <FilterTab labels={{ countLabel: maybeFn }} /> // maybeFn possibly undefined
|
|
24
|
+
*
|
|
25
|
+
* silently DELETED the default and the component then threw
|
|
26
|
+
* `L.countLabel is not a function` at render time. Eleven components shipped
|
|
27
|
+
* that hazard.
|
|
28
|
+
*
|
|
29
|
+
* It stayed invisible because the label interfaces declared `?: T` rather than
|
|
30
|
+
* `?: T | undefined`: under that declaration TypeScript concluded the merged
|
|
31
|
+
* value could never be `undefined`, which is false at runtime. Widening the
|
|
32
|
+
* optional props (G-14) removed the blindfold and the compiler reported all
|
|
33
|
+
* seventeen call sites at once. The types were wrong; the code was wrong; only
|
|
34
|
+
* the combination of the two looked right.
|
|
35
|
+
*
|
|
36
|
+
* The fix restores what every call site already intended: an override REPLACES a
|
|
37
|
+
* default, an absent or `undefined` override LEAVES it alone.
|
|
38
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
*
|
|
40
|
+
* const L = mergeLabels(DEFAULT_LABELS, labels);
|
|
41
|
+
* // ^ every key guaranteed present, typed from the defaults
|
|
42
|
+
*
|
|
43
|
+
* The return type is the DEFAULTS' type, deliberately: defaults are the
|
|
44
|
+
* exhaustive, all-required shape, so the component can call `L.anything()`
|
|
45
|
+
* without a null check. That is the whole point.
|
|
46
|
+
*
|
|
47
|
+
* `overrides` is a mapped type over `keyof TDefaults` with `unknown` values
|
|
48
|
+
* rather than `Partial<TDefaults>`. Two reasons, both load-bearing:
|
|
49
|
+
* - a mapped type accepts an INTERFACE argument, whereas `Record<string,
|
|
50
|
+
* unknown>` would not (TypeScript grants implicit index signatures to type
|
|
51
|
+
* aliases, not to interfaces), and most label contracts here are interfaces;
|
|
52
|
+
* - some label interfaces legitimately widen a default's type (`React.ReactNode`
|
|
53
|
+
* where the default is a `string`), which `Partial<TDefaults>` would reject.
|
|
54
|
+
* Value types are already checked at the component's `labels` prop boundary,
|
|
55
|
+
* so nothing is lost by not re-checking them here.
|
|
56
|
+
*
|
|
57
|
+
* Returns the defaults object ITSELF when there is nothing to override, so the
|
|
58
|
+
* common path allocates nothing and stays referentially stable across renders —
|
|
59
|
+
* which matters because these results are routinely wrapped in `useMemo`.
|
|
60
|
+
*/
|
|
61
|
+
export function mergeLabels(defaults, overrides) {
|
|
62
|
+
if (!overrides) return defaults;
|
|
63
|
+
|
|
64
|
+
// Single documented assertion, guarded by the `!overrides` check above: the
|
|
65
|
+
// mapped parameter type deliberately says nothing about value types, so the
|
|
66
|
+
// only way to read them is through an index signature.
|
|
67
|
+
var source = overrides;
|
|
68
|
+
var out;
|
|
69
|
+
for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
|
|
70
|
+
var key = _Object$keys[_i];
|
|
71
|
+
var value = source[key];
|
|
72
|
+
// THE point of this helper. `undefined` means "not specified", never
|
|
73
|
+
// "unset the default".
|
|
74
|
+
if (value === undefined) continue;
|
|
75
|
+
// Second assertion, same cause: `TDefaults extends object` carries no index
|
|
76
|
+
// signature, so spreading it into a writable record needs one. Allocated
|
|
77
|
+
// LAZILY — only once a real override is found — so the common paths (no
|
|
78
|
+
// overrides at all, or an object whose every value is undefined) return the
|
|
79
|
+
// defaults object itself and stay referentially stable across renders.
|
|
80
|
+
if (!out) out = _objectSpread({}, defaults);
|
|
81
|
+
out[key] = value;
|
|
82
|
+
}
|
|
83
|
+
return out === undefined ? defaults : out;
|
|
84
|
+
}
|
|
85
|
+
export default mergeLabels;
|
|
86
|
+
//# sourceMappingURL=mergeLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeLabels.js","names":["mergeLabels","defaults","overrides","source","out","_i","_Object$keys","Object","keys","length","key","value","undefined","_objectSpread"],"sources":["../../../../src/lib/v2/utils/mergeLabels.ts"],"sourcesContent":["/**\r\n * mergeLabels — Portnet UI v2\r\n *\r\n * Merges a consumer's partial label overrides onto a component's frozen\r\n * defaults, IGNORING keys whose value is `undefined`.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS EXISTS (capability gap G-14, latent runtime defect)\r\n *\r\n * Every localisable component in this library merged its labels like this:\r\n *\r\n * const L = labels ? { ...DEFAULT_LABELS, ...labels } : DEFAULT_LABELS;\r\n *\r\n * A spread does NOT skip explicit `undefined`. `{ ...{a: 1}, ...{a: undefined} }`\r\n * is `{ a: undefined }` — so a consumer writing\r\n *\r\n * <FilterTab labels={{ countLabel: maybeFn }} /> // maybeFn possibly undefined\r\n *\r\n * silently DELETED the default and the component then threw\r\n * `L.countLabel is not a function` at render time. Eleven components shipped\r\n * that hazard.\r\n *\r\n * It stayed invisible because the label interfaces declared `?: T` rather than\r\n * `?: T | undefined`: under that declaration TypeScript concluded the merged\r\n * value could never be `undefined`, which is false at runtime. Widening the\r\n * optional props (G-14) removed the blindfold and the compiler reported all\r\n * seventeen call sites at once. The types were wrong; the code was wrong; only\r\n * the combination of the two looked right.\r\n *\r\n * The fix restores what every call site already intended: an override REPLACES a\r\n * default, an absent or `undefined` override LEAVES it alone.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * const L = mergeLabels(DEFAULT_LABELS, labels);\r\n * // ^ every key guaranteed present, typed from the defaults\r\n *\r\n * The return type is the DEFAULTS' type, deliberately: defaults are the\r\n * exhaustive, all-required shape, so the component can call `L.anything()`\r\n * without a null check. That is the whole point.\r\n *\r\n * `overrides` is a mapped type over `keyof TDefaults` with `unknown` values\r\n * rather than `Partial<TDefaults>`. Two reasons, both load-bearing:\r\n * - a mapped type accepts an INTERFACE argument, whereas `Record<string,\r\n * unknown>` would not (TypeScript grants implicit index signatures to type\r\n * aliases, not to interfaces), and most label contracts here are interfaces;\r\n * - some label interfaces legitimately widen a default's type (`React.ReactNode`\r\n * where the default is a `string`), which `Partial<TDefaults>` would reject.\r\n * Value types are already checked at the component's `labels` prop boundary,\r\n * so nothing is lost by not re-checking them here.\r\n *\r\n * Returns the defaults object ITSELF when there is nothing to override, so the\r\n * common path allocates nothing and stays referentially stable across renders —\r\n * which matters because these results are routinely wrapped in `useMemo`.\r\n */\r\nexport function mergeLabels<TDefaults extends object>(\r\n defaults: TDefaults,\r\n overrides?: { readonly [K in keyof TDefaults]?: unknown } | undefined\r\n): TDefaults {\r\n if (!overrides) return defaults;\r\n\r\n // Single documented assertion, guarded by the `!overrides` check above: the\r\n // mapped parameter type deliberately says nothing about value types, so the\r\n // only way to read them is through an index signature.\r\n const source = overrides as Record<string, unknown>;\r\n\r\n let out: Record<string, unknown> | undefined;\r\n\r\n for (const key of Object.keys(source)) {\r\n const value = source[key];\r\n // THE point of this helper. `undefined` means \"not specified\", never\r\n // \"unset the default\".\r\n if (value === undefined) continue;\r\n // Second assertion, same cause: `TDefaults extends object` carries no index\r\n // signature, so spreading it into a writable record needs one. Allocated\r\n // LAZILY — only once a real override is found — so the common paths (no\r\n // overrides at all, or an object whose every value is undefined) return the\r\n // defaults object itself and stay referentially stable across renders.\r\n if (!out) out = { ...(defaults as Record<string, unknown>) };\r\n out[key] = value;\r\n }\r\n\r\n return out === undefined ? defaults : (out as TDefaults);\r\n}\r\n\r\nexport default mergeLabels;\r\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,WAAWA,CACzBC,QAAmB,EACnBC,SAAqE,EAC1D;EACX,IAAI,CAACA,SAAS,EAAE,OAAOD,QAAQ;;EAE/B;EACA;EACA;EACA,IAAME,MAAM,GAAGD,SAAoC;EAEnD,IAAIE,GAAwC;EAE5C,SAAAC,EAAA,MAAAC,YAAA,GAAkBC,MAAM,CAACC,IAAI,CAACL,MAAM,CAAC,EAAAE,EAAA,GAAAC,YAAA,CAAAG,MAAA,EAAAJ,EAAA,IAAE;IAAlC,IAAMK,GAAG,GAAAJ,YAAA,CAAAD,EAAA;IACZ,IAAMM,KAAK,GAAGR,MAAM,CAACO,GAAG,CAAC;IACzB;IACA;IACA,IAAIC,KAAK,KAAKC,SAAS,EAAE;IACzB;IACA;IACA;IACA;IACA;IACA,IAAI,CAACR,GAAG,EAAEA,GAAG,GAAAS,aAAA,KAASZ,QAAQ,CAA8B;IAC5DG,GAAG,CAACM,GAAG,CAAC,GAAGC,KAAK;EAClB;EAEA,OAAOP,GAAG,KAAKQ,SAAS,GAAGX,QAAQ,GAAIG,GAAiB;AAC1D;AAEA,eAAeJ,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* networkStatus — the feed behind `NetworkErrorBanner`.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* WHY THIS BELONGS IN THE LIBRARY (capability gap G-03)
|
|
6
|
+
*
|
|
7
|
+
* The library shipped `NetworkErrorBanner` — a presentational component — but
|
|
8
|
+
* not the plumbing that decides when it appears. Charter R-A.3 / R-4.3 make the
|
|
9
|
+
* banner MANDATORY ("erreur réseau → bandeau persistant top, bouton
|
|
10
|
+
* « Réessayer »"), so every consuming module had to invent the same
|
|
11
|
+
* subscribe / report / clear singleton and the same transport-interceptor
|
|
12
|
+
* bridge. Two audited modules (`procuration-portnet-fe`, `procuration-fe`) had
|
|
13
|
+
* each written their own.
|
|
14
|
+
*
|
|
15
|
+
* A presentational component whose trigger contract is left to consumers
|
|
16
|
+
* guarantees divergence in precisely the state users encounter least often and
|
|
17
|
+
* trust least — the offline path.
|
|
18
|
+
*
|
|
19
|
+
* NOT a redux slice, deliberately
|
|
20
|
+
* -------------------------------
|
|
21
|
+
* This state is presentation-only and high-frequency on a flaky link. Crossing a
|
|
22
|
+
* dispatch boundary on every retry would slow the alert path for no benefit, and
|
|
23
|
+
* would force the library to take an opinion on the host's store.
|
|
24
|
+
*
|
|
25
|
+
* Late subscribers are hydrated on subscribe, so a banner that mounts after the
|
|
26
|
+
* failure (lazy route, remount) still shows the current state instead of missing
|
|
27
|
+
* the edge.
|
|
28
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
29
|
+
*
|
|
30
|
+
* Wiring (once, at the app root):
|
|
31
|
+
*
|
|
32
|
+
* const [netError, setNetError] = useState<string | null>(null);
|
|
33
|
+
* useEffect(() => networkStatus.subscribe(setNetError), []);
|
|
34
|
+
*
|
|
35
|
+
* <NetworkErrorBanner
|
|
36
|
+
* visible={Boolean(netError)}
|
|
37
|
+
* message={netError ?? ""}
|
|
38
|
+
* onRetry={() => { networkStatus.clear(); window.location.reload(); }}
|
|
39
|
+
* />
|
|
40
|
+
*
|
|
41
|
+
* And in the transport layer:
|
|
42
|
+
*
|
|
43
|
+
* instance.interceptors.response.use(
|
|
44
|
+
* (response) => { networkStatus.clear(); return response; },
|
|
45
|
+
* (error: unknown) => {
|
|
46
|
+
* if (getApiErrorStatus(error) === undefined) {
|
|
47
|
+
* networkStatus.report("Connexion perdue. Vérifiez votre réseau, puis réessayez.");
|
|
48
|
+
* }
|
|
49
|
+
* return Promise.reject(error);
|
|
50
|
+
* }
|
|
51
|
+
* );
|
|
52
|
+
*
|
|
53
|
+
* A status-less failure is the network case (offline, DNS, ingress timeout); a
|
|
54
|
+
* failure WITH a status is a server error and belongs in a toast (R-A.4).
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/** Receives the latest banner message, or `null` when the banner should clear. */
|
|
58
|
+
|
|
59
|
+
/** Public shape of a network-status channel. */
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Create an independent network-status channel.
|
|
63
|
+
*
|
|
64
|
+
* Exported alongside the shared singleton so tests can use an isolated instance
|
|
65
|
+
* — a module-level singleton shared between test cases leaks state across them.
|
|
66
|
+
* Application code should normally use the `networkStatus` export below.
|
|
67
|
+
*/
|
|
68
|
+
export function createNetworkStatus() {
|
|
69
|
+
var subscribers = new Set();
|
|
70
|
+
var lastError = null;
|
|
71
|
+
var channel = {
|
|
72
|
+
subscribe: function subscribe(listener) {
|
|
73
|
+
subscribers.add(listener);
|
|
74
|
+
if (lastError !== null) listener(lastError);
|
|
75
|
+
return function () {
|
|
76
|
+
subscribers["delete"](listener);
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
report: function report(message) {
|
|
80
|
+
var next = message || null;
|
|
81
|
+
/* De-duplicated: a flaky link can fail many times per second, and
|
|
82
|
+
* re-notifying an unchanged message would re-render every subscriber for
|
|
83
|
+
* no visible difference. */
|
|
84
|
+
if (lastError === next) return;
|
|
85
|
+
lastError = next;
|
|
86
|
+
subscribers.forEach(function (listener) {
|
|
87
|
+
try {
|
|
88
|
+
listener(lastError);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
/* One bad subscriber must not stop the others from being notified,
|
|
91
|
+
* and must not propagate into the transport layer that reported the
|
|
92
|
+
* failure. */
|
|
93
|
+
// eslint-disable-next-line no-console
|
|
94
|
+
console.error("[@portnet/ui networkStatus] subscriber threw:", e);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
clear: function clear() {
|
|
99
|
+
channel.report(null);
|
|
100
|
+
},
|
|
101
|
+
current: function current() {
|
|
102
|
+
return lastError;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return channel;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The shared channel. One per bundle, which is the right granularity: the
|
|
110
|
+
* transport layer and the banner must agree, and both live in the same app.
|
|
111
|
+
*/
|
|
112
|
+
export var networkStatus = createNetworkStatus();
|
|
113
|
+
export default networkStatus;
|
|
114
|
+
//# sourceMappingURL=networkStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkStatus.js","names":["createNetworkStatus","subscribers","Set","lastError","channel","subscribe","listener","add","report","message","next","forEach","e","console","error","clear","current","networkStatus"],"sources":["../../../../src/lib/v2/utils/networkStatus.ts"],"sourcesContent":["/**\r\n * networkStatus — the feed behind `NetworkErrorBanner`.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-03)\r\n *\r\n * The library shipped `NetworkErrorBanner` — a presentational component — but\r\n * not the plumbing that decides when it appears. Charter R-A.3 / R-4.3 make the\r\n * banner MANDATORY (\"erreur réseau → bandeau persistant top, bouton\r\n * « Réessayer »\"), so every consuming module had to invent the same\r\n * subscribe / report / clear singleton and the same transport-interceptor\r\n * bridge. Two audited modules (`procuration-portnet-fe`, `procuration-fe`) had\r\n * each written their own.\r\n *\r\n * A presentational component whose trigger contract is left to consumers\r\n * guarantees divergence in precisely the state users encounter least often and\r\n * trust least — the offline path.\r\n *\r\n * NOT a redux slice, deliberately\r\n * -------------------------------\r\n * This state is presentation-only and high-frequency on a flaky link. Crossing a\r\n * dispatch boundary on every retry would slow the alert path for no benefit, and\r\n * would force the library to take an opinion on the host's store.\r\n *\r\n * Late subscribers are hydrated on subscribe, so a banner that mounts after the\r\n * failure (lazy route, remount) still shows the current state instead of missing\r\n * the edge.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * Wiring (once, at the app root):\r\n *\r\n * const [netError, setNetError] = useState<string | null>(null);\r\n * useEffect(() => networkStatus.subscribe(setNetError), []);\r\n *\r\n * <NetworkErrorBanner\r\n * visible={Boolean(netError)}\r\n * message={netError ?? \"\"}\r\n * onRetry={() => { networkStatus.clear(); window.location.reload(); }}\r\n * />\r\n *\r\n * And in the transport layer:\r\n *\r\n * instance.interceptors.response.use(\r\n * (response) => { networkStatus.clear(); return response; },\r\n * (error: unknown) => {\r\n * if (getApiErrorStatus(error) === undefined) {\r\n * networkStatus.report(\"Connexion perdue. Vérifiez votre réseau, puis réessayez.\");\r\n * }\r\n * return Promise.reject(error);\r\n * }\r\n * );\r\n *\r\n * A status-less failure is the network case (offline, DNS, ingress timeout); a\r\n * failure WITH a status is a server error and belongs in a toast (R-A.4).\r\n */\r\n\r\n/** Receives the latest banner message, or `null` when the banner should clear. */\r\nexport type NetworkStatusListener = (message: string | null) => void;\r\n\r\n/** Public shape of a network-status channel. */\r\nexport interface NetworkStatus {\r\n /**\r\n * Subscribe to changes. The listener is invoked immediately with the current\r\n * state when that state is non-null, so a late-mounting banner hydrates\r\n * instead of missing the transition. Returns an unsubscribe function suitable\r\n * for returning directly from `useEffect`.\r\n */\r\n subscribe(listener: NetworkStatusListener): () => void;\r\n /** Report a global network failure. `null` (or omitted) clears. */\r\n report(message?: string | null): void;\r\n /** Clear the banner. Equivalent to `report(null)`. */\r\n clear(): void;\r\n /** Current message, or `null`. Useful in tests and for SSR snapshots. */\r\n current(): string | null;\r\n}\r\n\r\n/**\r\n * Create an independent network-status channel.\r\n *\r\n * Exported alongside the shared singleton so tests can use an isolated instance\r\n * — a module-level singleton shared between test cases leaks state across them.\r\n * Application code should normally use the `networkStatus` export below.\r\n */\r\nexport function createNetworkStatus(): NetworkStatus {\r\n const subscribers = new Set<NetworkStatusListener>();\r\n let lastError: string | null = null;\r\n\r\n const channel: NetworkStatus = {\r\n subscribe(listener) {\r\n subscribers.add(listener);\r\n if (lastError !== null) listener(lastError);\r\n return () => {\r\n subscribers.delete(listener);\r\n };\r\n },\r\n\r\n report(message) {\r\n const next = message || null;\r\n /* De-duplicated: a flaky link can fail many times per second, and\r\n * re-notifying an unchanged message would re-render every subscriber for\r\n * no visible difference. */\r\n if (lastError === next) return;\r\n lastError = next;\r\n subscribers.forEach((listener) => {\r\n try {\r\n listener(lastError);\r\n } catch (e) {\r\n /* One bad subscriber must not stop the others from being notified,\r\n * and must not propagate into the transport layer that reported the\r\n * failure. */\r\n // eslint-disable-next-line no-console\r\n console.error(\"[@portnet/ui networkStatus] subscriber threw:\", e);\r\n }\r\n });\r\n },\r\n\r\n clear() {\r\n channel.report(null);\r\n },\r\n\r\n current() {\r\n return lastError;\r\n },\r\n };\r\n\r\n return channel;\r\n}\r\n\r\n/**\r\n * The shared channel. One per bundle, which is the right granularity: the\r\n * transport layer and the banner must agree, and both live in the same app.\r\n */\r\nexport const networkStatus: NetworkStatus = createNetworkStatus();\r\n\r\nexport default networkStatus;\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAGA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAAA,EAAkB;EACnD,IAAMC,WAAW,GAAG,IAAIC,GAAG,CAAwB,CAAC;EACpD,IAAIC,SAAwB,GAAG,IAAI;EAEnC,IAAMC,OAAsB,GAAG;IAC7BC,SAAS,WAAAA,UAACC,QAAQ,EAAE;MAClBL,WAAW,CAACM,GAAG,CAACD,QAAQ,CAAC;MACzB,IAAIH,SAAS,KAAK,IAAI,EAAEG,QAAQ,CAACH,SAAS,CAAC;MAC3C,OAAO,YAAM;QACXF,WAAW,UAAO,CAACK,QAAQ,CAAC;MAC9B,CAAC;IACH,CAAC;IAEDE,MAAM,WAAAA,OAACC,OAAO,EAAE;MACd,IAAMC,IAAI,GAAGD,OAAO,IAAI,IAAI;MAC5B;AACN;AACA;MACM,IAAIN,SAAS,KAAKO,IAAI,EAAE;MACxBP,SAAS,GAAGO,IAAI;MAChBT,WAAW,CAACU,OAAO,CAAC,UAACL,QAAQ,EAAK;QAChC,IAAI;UACFA,QAAQ,CAACH,SAAS,CAAC;QACrB,CAAC,CAAC,OAAOS,CAAC,EAAE;UACV;AACV;AACA;UACU;UACAC,OAAO,CAACC,KAAK,CAAC,+CAA+C,EAAEF,CAAC,CAAC;QACnE;MACF,CAAC,CAAC;IACJ,CAAC;IAEDG,KAAK,WAAAA,MAAA,EAAG;MACNX,OAAO,CAACI,MAAM,CAAC,IAAI,CAAC;IACtB,CAAC;IAEDQ,OAAO,WAAAA,QAAA,EAAG;MACR,OAAOb,SAAS;IAClB;EACF,CAAC;EAED,OAAOC,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA,OAAO,IAAMa,aAA4B,GAAGjB,mBAAmB,CAAC,CAAC;AAEjE,eAAeiB,aAAa","ignoreList":[]}
|