@stackcraftmx/calcita 0.23.0 → 0.26.0
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/README.md +127 -22
- package/cli/projectFiles.js +5 -3
- package/cli/templates/project/README.md.tpl +28 -0
- package/cli/templates/project/public/manifest.webmanifest.tpl +6 -6
- package/cli/templates/project/src/app/AppProviders.jsx.tpl +9 -4
- package/cli/templates/project/src/app/appRouter.jsx.tpl +4 -2
- package/cli/templates/project/src/app/appSettings.js.tpl +14 -0
- package/cli/templates/project/src/core/AppLogo.jsx.tpl +3 -1
- package/cli/templates/project/src/core/index.js.tpl +1 -0
- package/cli/templates/project/src/core/publicPaths.js.tpl +24 -0
- package/cli/templates/project/vite.config.js.tpl +27 -1
- package/dist/DataTable/AuditTrailTable.js +5 -3
- package/dist/DataTable/AuditTrailTable.js.map +1 -1
- package/dist/DataTable/ColumnFilters/MultiSelectColumnFilter.js +2 -1
- package/dist/DataTable/ColumnFilters/MultiSelectColumnFilter.js.map +1 -1
- package/dist/DataTable/EmptyState.js +2 -2
- package/dist/DataTable/EmptyState.js.map +1 -1
- package/dist/DataTable/FilterChips.js +2 -2
- package/dist/DataTable/FilterChips.js.map +1 -1
- package/dist/DataTable/GoToPage.js +4 -3
- package/dist/DataTable/GoToPage.js.map +1 -1
- package/dist/DataTable/ServerTable.js +153 -83
- package/dist/DataTable/ServerTable.js.map +1 -1
- package/dist/DataTable/rowSelection.js +61 -0
- package/dist/DataTable/rowSelection.js.map +1 -0
- package/dist/access/PermissionMatrix.js +3 -2
- package/dist/access/PermissionMatrix.js.map +1 -1
- package/dist/account/AccountSecuritySection.js +2 -2
- package/dist/account/AccountSecuritySection.js.map +1 -1
- package/dist/account/ForgotPasswordScreen.js +5 -4
- package/dist/account/ForgotPasswordScreen.js.map +1 -1
- package/dist/account/ProfileScreen.js +39 -13
- package/dist/account/ProfileScreen.js.map +1 -1
- package/dist/account/ResetPasswordScreen.js +3 -2
- package/dist/account/ResetPasswordScreen.js.map +1 -1
- package/dist/account/SignInScreen.js +7 -6
- package/dist/account/SignInScreen.js.map +1 -1
- package/dist/account/accountConnector.js.map +1 -1
- package/dist/account/restAccountConnector.js +2 -1
- package/dist/account/restAccountConnector.js.map +1 -1
- package/dist/adapters/reactRouterRoutes.js +7 -6
- package/dist/adapters/reactRouterRoutes.js.map +1 -1
- package/dist/api/createApiClient.js +40 -5
- package/dist/api/createApiClient.js.map +1 -1
- package/dist/appShell/AccountMenu.js +15 -23
- package/dist/appShell/AccountMenu.js.map +1 -1
- package/dist/appShell/AppLayout.js +42 -15
- package/dist/appShell/AppLayout.js.map +1 -1
- package/dist/appShell/AppearanceSettings.js +29 -6
- package/dist/appShell/AppearanceSettings.js.map +1 -1
- package/dist/appShell/AuthLayout.js +2 -0
- package/dist/appShell/AuthLayout.js.map +1 -1
- package/dist/appShell/BarActionButton.js +3 -3
- package/dist/appShell/BarActionButton.js.map +1 -1
- package/dist/appShell/BarActions.js +19 -8
- package/dist/appShell/BarActions.js.map +1 -1
- package/dist/appShell/BarCapsule.js +19 -4
- package/dist/appShell/BarCapsule.js.map +1 -1
- package/dist/appShell/BarSearch.js +92 -0
- package/dist/appShell/BarSearch.js.map +1 -0
- package/dist/appShell/HeaderTools.js +4 -2
- package/dist/appShell/HeaderTools.js.map +1 -1
- package/dist/appShell/MenuLinks.js +36 -0
- package/dist/appShell/MenuLinks.js.map +1 -0
- package/dist/appShell/MobileTabBar.js +6 -4
- package/dist/appShell/MobileTabBar.js.map +1 -1
- package/dist/appShell/SettingsMenu.js +10 -5
- package/dist/appShell/SettingsMenu.js.map +1 -1
- package/dist/appShell/SideMenu.js +5 -3
- package/dist/appShell/SideMenu.js.map +1 -1
- package/dist/appShell/SideMenuEntry.js +3 -3
- package/dist/appShell/SideMenuEntry.js.map +1 -1
- package/dist/appShell/SubmenuActionsMenu.js +3 -4
- package/dist/appShell/SubmenuActionsMenu.js.map +1 -1
- package/dist/appShell/TopMenu.js +5 -6
- package/dist/appShell/TopMenu.js.map +1 -1
- package/dist/appShell/Wordmark.js +11 -0
- package/dist/appShell/Wordmark.js.map +1 -0
- package/dist/appShell/menuItemText.js +4 -0
- package/dist/appShell/menuItemText.js.map +1 -1
- package/dist/appShell/shellSizes.js +2 -0
- package/dist/appShell/shellSizes.js.map +1 -1
- package/dist/auth/PasswordChecklist.js +2 -2
- package/dist/auth/PasswordChecklist.js.map +1 -1
- package/dist/calendar/EventCalendar.js +16 -5
- package/dist/calendar/EventCalendar.js.map +1 -1
- package/dist/calendar/EventDetails.js +74 -0
- package/dist/calendar/EventDetails.js.map +1 -0
- package/dist/calendar/calendarEvents.js +31 -0
- package/dist/calendar/calendarEvents.js.map +1 -0
- package/dist/calendar.js +8 -1
- package/dist/calendar.js.map +1 -1
- package/dist/charts.js +10 -1
- package/dist/charts.js.map +1 -1
- package/dist/datePickers/DateInput.js +3 -2
- package/dist/datePickers/DateInput.js.map +1 -1
- package/dist/downloads/DownloadManager.js +14 -20
- package/dist/downloads/DownloadManager.js.map +1 -1
- package/dist/downloads/downloadQueue.js +4 -2
- package/dist/downloads/downloadQueue.js.map +1 -1
- package/dist/downloads/downloadsMachine.js +4 -1
- package/dist/downloads/downloadsMachine.js.map +1 -1
- package/dist/downloads/fileTypes.js +22 -0
- package/dist/downloads/fileTypes.js.map +1 -0
- package/dist/feedback/ConfirmDialog.js +3 -2
- package/dist/feedback/ConfirmDialog.js.map +1 -1
- package/dist/feedback/ModalWaiting.js +2 -2
- package/dist/feedback/ModalWaiting.js.map +1 -1
- package/dist/feedback/NewBuildNotice.js +2 -2
- package/dist/feedback/NewBuildNotice.js.map +1 -1
- package/dist/filepond/FileDropzone.js +5 -3
- package/dist/filepond/FileDropzone.js.map +1 -1
- package/dist/formatting.js +171 -143
- package/dist/formatting.js.map +1 -1
- package/dist/forms/FormWizard.js +18 -45
- package/dist/forms/FormWizard.js.map +1 -1
- package/dist/forms/auth/ChangePasswordForm.js +5 -4
- package/dist/forms/auth/ChangePasswordForm.js.map +1 -1
- package/dist/forms/auth/ForgotPasswordForm.js +2 -2
- package/dist/forms/auth/ForgotPasswordForm.js.map +1 -1
- package/dist/forms/auth/SignInForm.js +2 -2
- package/dist/forms/auth/SignInForm.js.map +1 -1
- package/dist/forms/security/SecondStepForm.js +2 -2
- package/dist/forms/security/SecondStepForm.js.map +1 -1
- package/dist/forms/security/TwoStepVerificationCard.js +8 -6
- package/dist/forms/security/TwoStepVerificationCard.js.map +1 -1
- package/dist/hookForm/FormWizard.js +59 -0
- package/dist/hookForm/FormWizard.js.map +1 -0
- package/dist/inbox/InboxLayout.js +44 -8
- package/dist/inbox/InboxLayout.js.map +1 -1
- package/dist/inbox/MessageList.js +71 -21
- package/dist/inbox/MessageList.js.map +1 -1
- package/dist/inbox/MessageView.js +80 -29
- package/dist/inbox/MessageView.js.map +1 -1
- package/dist/inbox/inboxDates.js +4 -3
- package/dist/inbox/inboxDates.js.map +1 -1
- package/dist/index.js +163 -136
- package/dist/index.js.map +1 -1
- package/dist/inputs/CatalogInput.js +8 -4
- package/dist/inputs/CatalogInput.js.map +1 -1
- package/dist/inputs/ColorInput.js +3 -2
- package/dist/inputs/ColorInput.js.map +1 -1
- package/dist/inputs/FormSection.js +3 -3
- package/dist/inputs/FormSection.js.map +1 -1
- package/dist/inputs/NumberInput.js +3 -2
- package/dist/inputs/NumberInput.js.map +1 -1
- package/dist/inputs/SelectInput.js +29 -11
- package/dist/inputs/SelectInput.js.map +1 -1
- package/dist/inputs/TextInput.js +6 -2
- package/dist/inputs/TextInput.js.map +1 -1
- package/dist/inputs/WizardLayout.js +54 -0
- package/dist/inputs/WizardLayout.js.map +1 -0
- package/dist/kanban/KanbanBoard.js +239 -14
- package/dist/kanban/KanbanBoard.js.map +1 -1
- package/dist/kanban/kanbanCards.js +19 -0
- package/dist/kanban/kanbanCards.js.map +1 -0
- package/dist/kanban.js +7 -1
- package/dist/kanban.js.map +1 -1
- package/dist/locales/en.js +74 -1
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +74 -1
- package/dist/locales/es.js.map +1 -1
- package/dist/maps/MapView.js +28 -8
- package/dist/maps/MapView.js.map +1 -1
- package/dist/navigation/appMenu.js +13 -1
- package/dist/navigation/appMenu.js.map +1 -1
- package/dist/observability/logger.js +18 -0
- package/dist/observability/logger.js.map +1 -1
- package/dist/observability/usePublishedBuildWatch.js +4 -3
- package/dist/observability/usePublishedBuildWatch.js.map +1 -1
- package/dist/pwa/InstallAppSetting.js +6 -5
- package/dist/pwa/InstallAppSetting.js.map +1 -1
- package/dist/pwa/InstallInstructionsDialog.js +2 -2
- package/dist/pwa/InstallInstructionsDialog.js.map +1 -1
- package/dist/pwa/InstallPromptBanner.js +15 -9
- package/dist/pwa/InstallPromptBanner.js.map +1 -1
- package/dist/pwa/useInstallPrompt.js +2 -1
- package/dist/pwa/useInstallPrompt.js.map +1 -1
- package/dist/react-hook-form.js +6 -4
- package/dist/react-hook-form.js.map +1 -1
- package/dist/security/ActivityLog.js +4 -3
- package/dist/security/ActivityLog.js.map +1 -1
- package/dist/security/RecoveryCodesDialog.js +4 -3
- package/dist/security/RecoveryCodesDialog.js.map +1 -1
- package/dist/security/SessionsCard.js +8 -6
- package/dist/security/SessionsCard.js.map +1 -1
- package/dist/table.js +2 -0
- package/dist/table.js.map +1 -1
- package/dist/theme/components/MuiAppBar.js +6 -5
- package/dist/theme/components/MuiAppBar.js.map +1 -1
- package/dist/theme/components/MuiDialog.js +13 -0
- package/dist/theme/components/MuiDialog.js.map +1 -0
- package/dist/theme/components/glassComponents.js +32 -31
- package/dist/theme/components/glassComponents.js.map +1 -1
- package/dist/theme/components/minimalComponents.js +8 -4
- package/dist/theme/components/minimalComponents.js.map +1 -1
- package/dist/theme/createToolkitTheme.js.map +1 -1
- package/dist/theme/glassSurface.js +36 -38
- package/dist/theme/glassSurface.js.map +1 -1
- package/dist/theme/lightDarkStyles.js +48 -0
- package/dist/theme/lightDarkStyles.js.map +1 -0
- package/dist/theme/toolkitComponents.js +2 -0
- package/dist/theme/toolkitComponents.js.map +1 -1
- package/dist/toolkit/ComponentTexts.js +13 -0
- package/dist/toolkit/ComponentTexts.js.map +1 -0
- package/dist/toolkit/ToolkitProvider.js +36 -28
- package/dist/toolkit/ToolkitProvider.js.map +1 -1
- package/dist/toolkit/browserNavigation.js +19 -20
- package/dist/toolkit/browserNavigation.js.map +1 -1
- package/dist/toolkit/componentTextsContext.js +15 -0
- package/dist/toolkit/componentTextsContext.js.map +1 -0
- package/dist/toolkit/hashNavigation.js +40 -0
- package/dist/toolkit/hashNavigation.js.map +1 -0
- package/dist/toolkit/navigationPaths.js +49 -0
- package/dist/toolkit/navigationPaths.js.map +1 -0
- package/dist/toolkit/toolkitSettings.js +24 -4
- package/dist/toolkit/toolkitSettings.js.map +1 -1
- package/dist/toolkit/useFormatters.js +12 -0
- package/dist/toolkit/useFormatters.js.map +1 -0
- package/dist/toolkit/useToolkitTranslation.js +11 -7
- package/dist/toolkit/useToolkitTranslation.js.map +1 -1
- package/dist/types/DataTable/AuditTrailTable.d.ts +3 -1
- package/dist/types/DataTable/EmptyState.d.ts +7 -2
- package/dist/types/DataTable/FilterChips.d.ts +3 -1
- package/dist/types/DataTable/GoToPage.d.ts +7 -2
- package/dist/types/DataTable/SelectionBar.d.ts +32 -0
- package/dist/types/DataTable/ServerTable.d.ts +64 -3
- package/dist/types/DataTable/index.d.ts +1 -1
- package/dist/types/DataTable/rowSelection.d.ts +113 -0
- package/dist/types/access/PermissionMatrix.d.ts +3 -1
- package/dist/types/account/AccountSecuritySection.d.ts +3 -1
- package/dist/types/account/ForgotPasswordScreen.d.ts +3 -1
- package/dist/types/account/ProfileScreen.d.ts +31 -1
- package/dist/types/account/ResetPasswordScreen.d.ts +3 -1
- package/dist/types/account/SignInScreen.d.ts +3 -1
- package/dist/types/account/accountConnector.d.ts +7 -2
- package/dist/types/adapters/reactRouterRoutes.d.ts +14 -2
- package/dist/types/api/createApiClient.d.ts +46 -1
- package/dist/types/appShell/AppLayout.d.ts +15 -1
- package/dist/types/appShell/AppearanceSettings.d.ts +8 -1
- package/dist/types/appShell/BarActionButton.d.ts +2 -2
- package/dist/types/appShell/BarActions.d.ts +6 -1
- package/dist/types/appShell/BarCapsule.d.ts +8 -0
- package/dist/types/appShell/BarSearch.d.ts +24 -0
- package/dist/types/appShell/MenuLinks.d.ts +17 -0
- package/dist/types/appShell/MobileTabBar.d.ts +4 -1
- package/dist/types/appShell/SettingsMenu.d.ts +3 -1
- package/dist/types/appShell/SideMenu.d.ts +3 -1
- package/dist/types/appShell/Wordmark.d.ts +6 -0
- package/dist/types/appShell/menuItemText.d.ts +16 -0
- package/dist/types/appShell/shellSizes.d.ts +1 -0
- package/dist/types/auth/PasswordChecklist.d.ts +3 -1
- package/dist/types/calendar/EventCalendar.d.ts +18 -1
- package/dist/types/calendar/EventDetails.d.ts +36 -0
- package/dist/types/calendar/calendarEvents.d.ts +27 -0
- package/dist/types/calendar.d.ts +2 -0
- package/dist/types/charts.d.ts +4 -0
- package/dist/types/datePickers/DateInput.d.ts +3 -1
- package/dist/types/downloads/DownloadManager.d.ts +7 -1
- package/dist/types/downloads/downloadQueue.d.ts +8 -3
- package/dist/types/downloads/fileTypes.d.ts +39 -0
- package/dist/types/downloads/index.d.ts +1 -0
- package/dist/types/feedback/ConfirmDialog.d.ts +3 -1
- package/dist/types/feedback/ModalWaiting.d.ts +7 -2
- package/dist/types/feedback/NewBuildNotice.d.ts +3 -1
- package/dist/types/filepond/FileDropzone.d.ts +3 -1
- package/dist/types/formatting.d.ts +45 -90
- package/dist/types/forms/FormWizard.d.ts +3 -1
- package/dist/types/forms/auth/ChangePasswordForm.d.ts +3 -1
- package/dist/types/forms/auth/ForgotPasswordForm.d.ts +3 -1
- package/dist/types/forms/auth/SignInForm.d.ts +3 -1
- package/dist/types/forms/security/SecondStepForm.d.ts +3 -1
- package/dist/types/forms/security/TwoStepVerificationCard.d.ts +3 -1
- package/dist/types/hookForm/FormWizard.d.ts +22 -0
- package/dist/types/inbox/InboxLayout.d.ts +14 -2
- package/dist/types/inbox/MessageList.d.ts +30 -5
- package/dist/types/inbox/MessageView.d.ts +35 -3
- package/dist/types/inbox/inboxDates.d.ts +6 -1
- package/dist/types/index.d.ts +15 -8
- package/dist/types/inputs/CatalogInput.d.ts +9 -5
- package/dist/types/inputs/ColorInput.d.ts +3 -1
- package/dist/types/inputs/FormSection.d.ts +2 -2
- package/dist/types/inputs/NumberInput.d.ts +3 -1
- package/dist/types/inputs/SelectInput.d.ts +9 -5
- package/dist/types/inputs/TextInput.d.ts +3 -1
- package/dist/types/inputs/WizardLayout.d.ts +34 -0
- package/dist/types/kanban/KanbanBoard.d.ts +61 -6
- package/dist/types/kanban/kanbanCards.d.ts +22 -0
- package/dist/types/kanban.d.ts +1 -0
- package/dist/types/locales/en.d.ts +77 -0
- package/dist/types/locales/es.d.ts +77 -0
- package/dist/types/maps/MapView.d.ts +12 -3
- package/dist/types/navigation/appMenu.d.ts +8 -0
- package/dist/types/observability/logger.d.ts +13 -0
- package/dist/types/observability/usePublishedBuildWatch.d.ts +3 -1
- package/dist/types/pwa/InstallAppSetting.d.ts +7 -1
- package/dist/types/pwa/InstallInstructionsDialog.d.ts +3 -1
- package/dist/types/pwa/InstallPromptBanner.d.ts +10 -1
- package/dist/types/pwa/useInstallPrompt.d.ts +3 -2
- package/dist/types/react-hook-form.d.ts +1 -0
- package/dist/types/security/ActivityLog.d.ts +3 -1
- package/dist/types/security/RecoveryCodesDialog.d.ts +6 -1
- package/dist/types/security/SessionsCard.d.ts +3 -1
- package/dist/types/table.d.ts +3 -1
- package/dist/types/theme/components/MuiAppBar.d.ts +3 -1
- package/dist/types/theme/components/MuiDialog.d.ts +9 -0
- package/dist/types/theme/components/glassComponents.d.ts +5 -0
- package/dist/types/theme/lightDarkStyles.d.ts +8 -0
- package/dist/types/toolkit/ComponentTexts.d.ts +11 -0
- package/dist/types/toolkit/ToolkitProvider.d.ts +18 -2
- package/dist/types/toolkit/browserNavigation.d.ts +23 -28
- package/dist/types/toolkit/componentTextsContext.d.ts +20 -0
- package/dist/types/toolkit/hashNavigation.d.ts +12 -0
- package/dist/types/toolkit/navigationPaths.d.ts +43 -0
- package/dist/types/toolkit/toolkitSettings.d.ts +49 -4
- package/dist/types/toolkit/useFormatters.d.ts +6 -0
- package/dist/types/toolkit/useToolkitTranslation.d.ts +2 -1
- package/dist/types/ui/actions/ActionsMenu.d.ts +20 -0
- package/dist/types/ui/actions/CopyButton.d.ts +3 -1
- package/dist/types/ui/actions/DownloadMenu.d.ts +8 -3
- package/dist/types/ui/actions/SecretField.d.ts +5 -1
- package/dist/types/ui/actions/SelectionActions.d.ts +39 -0
- package/dist/types/ui/filters/DateRangeFilter.d.ts +3 -1
- package/dist/types/ui/filters/QuickFilters.d.ts +3 -1
- package/dist/types/ui/index.d.ts +1 -1
- package/dist/types/ui/labels/tagOf.d.ts +13 -0
- package/dist/types/ui/layout/CollapsibleSection.d.ts +4 -1
- package/dist/types/ui/layout/ContentDialog.d.ts +3 -1
- package/dist/types/ui/layout/ErrorPage.d.ts +14 -1
- package/dist/types/ui/layout/FullPageLoader.d.ts +7 -1
- package/dist/types/ui/layout/PageHeading.d.ts +3 -1
- package/dist/types/ui/metrics/BarList.d.ts +7 -1
- package/dist/types/ui/metrics/CalendarHeatmap.d.ts +7 -1
- package/dist/types/ui/metrics/ChartTooltip.d.ts +9 -3
- package/dist/types/ui/metrics/ColumnChart.d.ts +23 -11
- package/dist/types/ui/metrics/LineChart.d.ts +41 -0
- package/dist/types/ui/metrics/MetricCard.d.ts +9 -1
- package/dist/types/ui/metrics/TableToggle.d.ts +9 -2
- package/dist/types/ui/metrics/chartParts.d.ts +112 -0
- package/dist/types/ui/navigation/BackButton.d.ts +3 -1
- package/dist/types/ui/navigation/ColorSchemeToggle.d.ts +8 -2
- package/dist/types/ui/navigation/FontSizeToggle.d.ts +7 -2
- package/dist/types/ui/navigation/LanguageToggle.d.ts +8 -3
- package/dist/types/ui/navigation/PageBreadcrumbs.d.ts +5 -2
- package/dist/types/ui/timeline/GroupedTimeline.d.ts +4 -1
- package/dist/types/upload/FileDropzone.d.ts +3 -1
- package/dist/ui/actions/ActionsMenu.js +51 -0
- package/dist/ui/actions/ActionsMenu.js.map +1 -0
- package/dist/ui/actions/CopyButton.js +2 -2
- package/dist/ui/actions/CopyButton.js.map +1 -1
- package/dist/ui/actions/DownloadMenu.js +11 -12
- package/dist/ui/actions/DownloadMenu.js.map +1 -1
- package/dist/ui/actions/SecretField.js +8 -4
- package/dist/ui/actions/SecretField.js.map +1 -1
- package/dist/ui/actions/SelectionActions.js +142 -0
- package/dist/ui/actions/SelectionActions.js.map +1 -0
- package/dist/ui/filters/DateRangeFilter.js +4 -3
- package/dist/ui/filters/DateRangeFilter.js.map +1 -1
- package/dist/ui/filters/QuickFilters.js +2 -2
- package/dist/ui/filters/QuickFilters.js.map +1 -1
- package/dist/ui/labels/tagOf.js +7 -0
- package/dist/ui/labels/tagOf.js.map +1 -0
- package/dist/ui/layout/CollapsibleSection.js +6 -2
- package/dist/ui/layout/CollapsibleSection.js.map +1 -1
- package/dist/ui/layout/ContentDialog.js +2 -2
- package/dist/ui/layout/ContentDialog.js.map +1 -1
- package/dist/ui/layout/ErrorPage.js +21 -7
- package/dist/ui/layout/ErrorPage.js.map +1 -1
- package/dist/ui/layout/FullPageLoader.js +2 -2
- package/dist/ui/layout/FullPageLoader.js.map +1 -1
- package/dist/ui/layout/PageHeading.js +2 -2
- package/dist/ui/layout/PageHeading.js.map +1 -1
- package/dist/ui/metrics/BarList.js +18 -13
- package/dist/ui/metrics/BarList.js.map +1 -1
- package/dist/ui/metrics/CalendarHeatmap.js +11 -6
- package/dist/ui/metrics/CalendarHeatmap.js.map +1 -1
- package/dist/ui/metrics/ChartTooltip.js +1 -1
- package/dist/ui/metrics/ChartTooltip.js.map +1 -1
- package/dist/ui/metrics/ColumnChart.js +59 -63
- package/dist/ui/metrics/ColumnChart.js.map +1 -1
- package/dist/ui/metrics/LineChart.js +117 -0
- package/dist/ui/metrics/LineChart.js.map +1 -0
- package/dist/ui/metrics/MetricCard.js +41 -8
- package/dist/ui/metrics/MetricCard.js.map +1 -1
- package/dist/ui/metrics/TableToggle.js +4 -2
- package/dist/ui/metrics/TableToggle.js.map +1 -1
- package/dist/ui/metrics/chartParts.js +93 -0
- package/dist/ui/metrics/chartParts.js.map +1 -0
- package/dist/ui/navigation/BackButton.js +2 -2
- package/dist/ui/navigation/BackButton.js.map +1 -1
- package/dist/ui/navigation/ColorSchemeToggle.js +6 -3
- package/dist/ui/navigation/ColorSchemeToggle.js.map +1 -1
- package/dist/ui/navigation/FontSizeToggle.js +3 -2
- package/dist/ui/navigation/FontSizeToggle.js.map +1 -1
- package/dist/ui/navigation/LanguageToggle.js +40 -19
- package/dist/ui/navigation/LanguageToggle.js.map +1 -1
- package/dist/ui/navigation/PageBreadcrumbs.js +2 -2
- package/dist/ui/navigation/PageBreadcrumbs.js.map +1 -1
- package/dist/ui/timeline/GroupedTimeline.js +10 -8
- package/dist/ui/timeline/GroupedTimeline.js.map +1 -1
- package/dist/upload/FileDropzone.js +5 -3
- package/dist/upload/FileDropzone.js.map +1 -1
- package/package.json +16 -7
package/dist/index.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { ToolkitProvider } from "./toolkit/ToolkitProvider.js";
|
|
2
2
|
import { useToolkitNavigation, useToolkitSettings } from "./toolkit/toolkitContext.js";
|
|
3
3
|
import { useToolkitTranslation } from "./toolkit/useToolkitTranslation.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import {
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
4
|
+
import { default as default2 } from "./toolkit/ComponentTexts.js";
|
|
5
|
+
import { DEFAULT_CURRENCY, DEFAULT_LANGUAGE, DEFAULT_LANGUAGES, configureToolkit, toolkitSettings, translateToolkit } from "./toolkit/toolkitSettings.js";
|
|
6
|
+
import { browserNavigation, createBrowserNavigation } from "./toolkit/browserNavigation.js";
|
|
7
|
+
import { createHashNavigation } from "./toolkit/hashNavigation.js";
|
|
8
|
+
import { default as default3 } from "./locales/es.js";
|
|
9
|
+
import { default as default4 } from "./locales/en.js";
|
|
10
|
+
import { default as default5 } from "./feedback/ConfirmDialog.js";
|
|
11
|
+
import { default as default6 } from "./feedback/ModalWaiting.js";
|
|
12
|
+
import { NEW_BUILD_NOTICE_VARIANT, default as default7 } from "./feedback/NewBuildNotice.js";
|
|
13
|
+
import { default as default8 } from "./feedback/StaleBuildBoundary.js";
|
|
14
|
+
import { default as default9 } from "./feedback/Toaster.js";
|
|
13
15
|
import { confirmActionMachine } from "./feedback/confirmActionMachine.js";
|
|
14
16
|
import { TOAST_DEFAULT_OPTIONS, dismissToast, errorsObjectToMessage, toastDefault, toastError, toastInfo, toastLoading, toastProblem, toastPromise, toastSuccess, toastWarn } from "./feedback/toast.js";
|
|
15
17
|
import { useConfirmAction } from "./feedback/useConfirmAction.js";
|
|
16
|
-
import { default as
|
|
18
|
+
import { default as default10 } from "./downloads/DownloadManager.js";
|
|
17
19
|
import { cancelDownload, clearFinishedDownloads, startDownload } from "./downloads/downloadQueue.js";
|
|
20
|
+
import { DEFAULT_FILE_TYPES, UNKNOWN_FILE_TYPE, useFileTypes } from "./downloads/fileTypes.js";
|
|
18
21
|
import { DOWNLOAD_STATUS, downloadsMachine } from "./downloads/downloadsMachine.js";
|
|
19
22
|
import { THEME_LOOK, TOP_BAR, createToolkitTheme } from "./theme/createToolkitTheme.js";
|
|
20
23
|
import { isAndroidDevice } from "./theme/androidDevice.js";
|
|
@@ -25,77 +28,82 @@ import { mergeComponents } from "./theme/mergeComponents.js";
|
|
|
25
28
|
import { GLASS_INSET_PIXELS, GLASS_MENU_RADIUS_PIXELS, GLASS_OPACITY, GLASS_PANEL_RADIUS_PIXELS, accentTextStylesOf, ambientBackgroundOf, canvasFieldStylesOf, fieldWellStylesOf, fixedBackgroundLayerOf, glassDropOf, glassStylesOf, glassSurfaceOf, isGlassTheme, materialBackgroundOf, materialStylesOf, materialSurfaceOf, scrollEdgeStylesOf } from "./theme/glassSurface.js";
|
|
26
29
|
import { AppLayout, MENU_POSITION } from "./appShell/AppLayout.js";
|
|
27
30
|
import { AuthLayout } from "./appShell/AuthLayout.js";
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
31
|
+
import { default as default11 } from "./appShell/BarActions.js";
|
|
32
|
+
import { default as default12 } from "./appShell/BarActionButton.js";
|
|
33
|
+
import { default as default13 } from "./appShell/BarSearch.js";
|
|
34
|
+
import { default as default14 } from "./ui/actions/ActionsMenu.js";
|
|
35
|
+
import { SELECTION_PHONE_LAYOUT, default as default15, selectionFloatsOnPhone } from "./ui/actions/SelectionActions.js";
|
|
30
36
|
import { BAR_ACTIONS_PLACEMENT, useBarActionsPlacement, useCloseBarActionsMenu } from "./appShell/barActionsSlot.js";
|
|
31
|
-
import { BAR_CAPSULE_HEIGHT_PIXELS, default as
|
|
37
|
+
import { BAR_CAPSULE_HEIGHT_PIXELS, default as default16 } from "./appShell/BarCapsule.js";
|
|
32
38
|
import { usesMobileTabBar } from "./appShell/tabBarRule.js";
|
|
33
|
-
import { default as
|
|
39
|
+
import { default as default17, SettingSection } from "./appShell/AppearanceSettings.js";
|
|
34
40
|
import { barMenuPlacementOf } from "./appShell/barMenuPlacement.js";
|
|
35
41
|
import { DRAWER_WIDTH_COLLAPSED, DRAWER_WIDTH_EXPANDED, MAIN_CONTENT_ID } from "./appShell/shellSizes.js";
|
|
36
42
|
import { useAppMenu } from "./appShell/appMenuContext.js";
|
|
37
43
|
import { usePageTitle } from "./appShell/pageTitle.js";
|
|
38
44
|
import { initialsOf, menuItemDescriptionOf, menuItemLabelOf, menuItemSectionOf, menuSectionsOf } from "./appShell/menuItemText.js";
|
|
39
|
-
import { activeMenuItemOf, composeMenu, menuBadgeOf, menuBreadcrumbsOf, mobileTabsOf, parentMenuItemOf, screenMenuItemsOf } from "./navigation/appMenu.js";
|
|
45
|
+
import { activeMenuItemOf, composeMenu, menuBadgeOf, menuBreadcrumbsOf, menuItemsWithIconsOf, mobileTabsOf, parentMenuItemOf, screenMenuItemsOf } from "./navigation/appMenu.js";
|
|
40
46
|
import { menuBadgesFrom, useMenuBadges } from "./navigation/useMenuBadges.js";
|
|
41
47
|
import { allowOnlyUnrestricted, createAccessChecker } from "./access/accessRules.js";
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
48
|
+
import { default as default18 } from "./access/Can.js";
|
|
49
|
+
import { default as default19 } from "./access/RequireAccess.js";
|
|
44
50
|
import { useAccessChecker, useCan } from "./access/useCan.js";
|
|
45
|
-
import { default as
|
|
51
|
+
import { default as default20 } from "./access/PermissionMatrix.js";
|
|
46
52
|
import { composePermissionGroups, groupStateOf, withPermission, withPermissionGroup } from "./access/permissionGroups.js";
|
|
47
53
|
import { DEFAULT_PASSWORD_POLICY, PASSWORD_RULE, isPasswordAccepted, passwordChecksOf } from "./auth/passwordRules.js";
|
|
48
|
-
import { default as
|
|
49
|
-
import { ERROR_PAGE_KIND, default as
|
|
50
|
-
import { default as
|
|
54
|
+
import { default as default21 } from "./auth/PasswordChecklist.js";
|
|
55
|
+
import { ERROR_PAGE_KIND, default as default22 } from "./ui/layout/ErrorPage.js";
|
|
56
|
+
import { default as default23 } from "./upload/FileDropzone.js";
|
|
51
57
|
import { FILE_ACCEPT_PRESETS, FILE_REJECTION, matchesAccept, parseFileSize, resolveAccept } from "./upload/fileRules.js";
|
|
52
58
|
import { buildUploadActors, uploadMachine } from "./upload/uploadMachine.js";
|
|
53
59
|
import { uploadWithProgress } from "./upload/uploadWithProgress.js";
|
|
54
60
|
import { APP_BAR_HEIGHT_CSS_VARIABLE, SCROLL_MARGIN_BELOW_APP_BAR, useAppBarHeightPublisher } from "./ui/layout/appBarHeight.js";
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as
|
|
59
|
-
import { default as
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
63
|
-
import { default as
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as
|
|
69
|
-
import { default as
|
|
70
|
-
import { LANGUAGES, default as
|
|
71
|
-
import { default as
|
|
61
|
+
import { default as default24 } from "./ui/layout/CollapsibleSection.js";
|
|
62
|
+
import { default as default25 } from "./ui/layout/ContentDialog.js";
|
|
63
|
+
import { default as default26 } from "./ui/layout/DefinitionList.js";
|
|
64
|
+
import { default as default27 } from "./ui/layout/DetailHeader.js";
|
|
65
|
+
import { default as default28 } from "./ui/layout/FullPageLoader.js";
|
|
66
|
+
import { default as default29 } from "./ui/layout/GlassLensFilter.js";
|
|
67
|
+
import { default as default30 } from "./ui/layout/GlassPanel.js";
|
|
68
|
+
import { default as default31 } from "./ui/layout/PageHeader.js";
|
|
69
|
+
import { default as default32 } from "./ui/layout/PageHeading.js";
|
|
70
|
+
import { default as default33 } from "./ui/layout/ProfileHeader.js";
|
|
71
|
+
import { default as default34, scrollableRow } from "./ui/layout/ScrollableRow.js";
|
|
72
|
+
import { default as default35 } from "./ui/layout/SectionCard.js";
|
|
73
|
+
import { default as default36 } from "./ui/navigation/BackButton.js";
|
|
74
|
+
import { default as default37 } from "./ui/navigation/ColorSchemeToggle.js";
|
|
75
|
+
import { default as default38 } from "./ui/navigation/DocumentTitle.js";
|
|
76
|
+
import { LANGUAGES, default as default39 } from "./ui/navigation/LanguageToggle.js";
|
|
77
|
+
import { default as default40 } from "./ui/navigation/FontSizeToggle.js";
|
|
72
78
|
import { FONT_SIZE_LEVELS } from "./ui/navigation/fontSizeLevels.js";
|
|
73
|
-
import { default as
|
|
74
|
-
import { default as
|
|
75
|
-
import { default as
|
|
76
|
-
import { default as
|
|
77
|
-
import { SEGMENTED_CONTROL_SX, default as
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
81
|
-
import { default as
|
|
82
|
-
import { default as
|
|
83
|
-
import { default as
|
|
84
|
-
import { default as
|
|
85
|
-
import { default as
|
|
86
|
-
import { default as
|
|
87
|
-
import { default as
|
|
88
|
-
import { default as
|
|
89
|
-
import { default as
|
|
90
|
-
import { FORM_ROW_CLASS, FormRow, default as
|
|
91
|
-
import { default as
|
|
92
|
-
import { default as
|
|
93
|
-
import { default as
|
|
79
|
+
import { default as default41 } from "./ui/navigation/PageBreadcrumbs.js";
|
|
80
|
+
import { default as default42 } from "./ui/filters/DateRangeFilter.js";
|
|
81
|
+
import { default as default43 } from "./ui/filters/PeriodRangeSelector.js";
|
|
82
|
+
import { default as default44 } from "./ui/filters/QuickFilters.js";
|
|
83
|
+
import { SEGMENTED_CONTROL_SX, default as default45 } from "./ui/filters/SegmentedControl.js";
|
|
84
|
+
import { default as default46 } from "./ui/labels/DictionaryText.js";
|
|
85
|
+
import { default as default47 } from "./ui/labels/StatusChip.js";
|
|
86
|
+
import { default as default48 } from "./ui/labels/Tag.js";
|
|
87
|
+
import { default as default49 } from "./ui/actions/CopyButton.js";
|
|
88
|
+
import { default as default50 } from "./ui/actions/DownloadMenu.js";
|
|
89
|
+
import { default as default51 } from "./ui/actions/SecretField.js";
|
|
90
|
+
import { default as default52 } from "./ui/metrics/CalendarHeatmap.js";
|
|
91
|
+
import { default as default53, TREND_DIRECTION } from "./ui/metrics/MetricCard.js";
|
|
92
|
+
import { CHART_VIEW, default as default54 } from "./ui/metrics/TableToggle.js";
|
|
93
|
+
import { default as default55 } from "./inputs/CatalogInput.js";
|
|
94
|
+
import { default as default56 } from "./inputs/ColorInput.js";
|
|
95
|
+
import { default as default57 } from "./inputs/FieldFrame.js";
|
|
96
|
+
import { FORM_ROW_CLASS, FormRow, default as default58 } from "./inputs/FormSection.js";
|
|
97
|
+
import { default as default59 } from "./inputs/NumberInput.js";
|
|
98
|
+
import { default as default60 } from "./inputs/SelectInput.js";
|
|
99
|
+
import { default as default61 } from "./inputs/WizardLayout.js";
|
|
100
|
+
import { default as default62 } from "./inputs/TextInput.js";
|
|
94
101
|
import { HEX_COLOR, MIN_CONTRAST, contrastOnWhite, readableVariantOf } from "./inputs/colorContrast.js";
|
|
95
102
|
import { cleanNumberText, completeDecimals, groupThousands } from "./inputs/numberText.js";
|
|
96
103
|
import { translateValidationMessage } from "./forms/validationMessages.js";
|
|
97
104
|
import { dictionaryEntryOf, labelOf, lookup, shortLabelOf } from "./dictionaries/dictionaries.js";
|
|
98
|
-
import { dayOfPlainDate, formatCurrency, formatDate, formatDateTime, formatFileSize, formatList, formatMonthName, formatMonthShortName, formatNumber, formatPercent, formatTime, formatWeekdayShortName } from "./formatting.js";
|
|
105
|
+
import { dayOfPlainDate, formatCurrency, formatDate, formatDateTime, formatFileSize, formatList, formatMonthName, formatMonthShortName, formatNumber, formatPercent, formatTime, formatWeekdayShortName, formattersOf } from "./formatting.js";
|
|
106
|
+
import { useFormatters } from "./toolkit/useFormatters.js";
|
|
99
107
|
import { parseInstant, parsePlainDate } from "./dates.js";
|
|
100
108
|
import { fieldErrorsOf, problemMessage, problemTitle } from "./problems.js";
|
|
101
109
|
import { newIdentifier } from "./identifiers.js";
|
|
@@ -104,139 +112,151 @@ import { REDIRECT_PARAM, readRedirectParam, safeInternalPath, withRedirect } fro
|
|
|
104
112
|
import { recallListUrl, rememberListUrl, useRememberListUrl } from "./lastListUrl.js";
|
|
105
113
|
import { currentHistoryIndex, forgetPageName, pageNameAt, rememberPageName, useNavigationTrail, usePageName } from "./navigationTrail.js";
|
|
106
114
|
import { periodRangeIsValid, rangeEndAfterStartChange, rangeEndOptionsOf } from "./periodRanges.js";
|
|
107
|
-
import { createLogger, setLogLevel } from "./observability/logger.js";
|
|
115
|
+
import { addLogSink, createLogger, setLogLevel } from "./observability/logger.js";
|
|
108
116
|
import { isNewBuildPublished, reportPublishedBuild, useNewBuildPublished } from "./observability/publishedBuild.js";
|
|
109
117
|
import { BUILD_WATCH_ACTION, buildWatchActionOf, publishedBuildIdOf } from "./observability/buildWatch.js";
|
|
110
118
|
import { usePublishedBuildWatch } from "./observability/usePublishedBuildWatch.js";
|
|
111
119
|
import { API_ERROR_STATUS, ApiError } from "./api/ApiError.js";
|
|
112
|
-
import { API_RESPONSE_PARSE, apiUrlOf, createApiClient } from "./api/createApiClient.js";
|
|
120
|
+
import { API_RESPONSE_PARSE, apiErrorOf, apiUrlOf, createApiClient } from "./api/createApiClient.js";
|
|
113
121
|
import { isStaleChunkError, recoverFromStaleChunk } from "./api/staleChunks.js";
|
|
114
|
-
import { ACCOUNT_EVENT_KIND, default as
|
|
115
|
-
import { default as
|
|
116
|
-
import { default as
|
|
117
|
-
import { default as
|
|
118
|
-
import { default as
|
|
119
|
-
import { default as
|
|
122
|
+
import { ACCOUNT_EVENT_KIND, default as default63 } from "./security/ActivityLog.js";
|
|
123
|
+
import { default as default64 } from "./security/RecoveryCodesDialog.js";
|
|
124
|
+
import { default as default65 } from "./security/SessionsCard.js";
|
|
125
|
+
import { default as default66 } from "./inbox/InboxLayout.js";
|
|
126
|
+
import { default as default67 } from "./inbox/MessageList.js";
|
|
127
|
+
import { default as default68 } from "./inbox/MessageView.js";
|
|
120
128
|
import { inboxDateOf } from "./inbox/inboxDates.js";
|
|
121
129
|
import { INSTALL_VARIANT, detectPlatform, parseIOSMajor, resolveInstallVariant } from "./pwa/installInstructions.js";
|
|
122
130
|
import { useInstallPrompt } from "./pwa/useInstallPrompt.js";
|
|
123
|
-
import { default as
|
|
124
|
-
import { default as
|
|
125
|
-
import { default as
|
|
131
|
+
import { default as default69, variantHasInstructions } from "./pwa/InstallInstructionsDialog.js";
|
|
132
|
+
import { default as default70 } from "./pwa/InstallPromptBanner.js";
|
|
133
|
+
import { default as default71 } from "./pwa/InstallAppSetting.js";
|
|
126
134
|
export {
|
|
127
135
|
ACCOUNT_EVENT_KIND,
|
|
128
136
|
API_ERROR_STATUS,
|
|
129
137
|
API_RESPONSE_PARSE,
|
|
130
138
|
APP_BAR_HEIGHT_CSS_VARIABLE,
|
|
131
|
-
|
|
139
|
+
default14 as ActionsMenu,
|
|
140
|
+
default63 as ActivityLog,
|
|
132
141
|
ApiError,
|
|
133
142
|
AppLayout,
|
|
134
|
-
|
|
143
|
+
default17 as AppearanceSettings,
|
|
135
144
|
AuthLayout,
|
|
136
145
|
BAR_ACTIONS_PLACEMENT,
|
|
137
146
|
BAR_CAPSULE_HEIGHT_PIXELS,
|
|
138
147
|
BUILD_WATCH_ACTION,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
default36 as BackButton,
|
|
149
|
+
default12 as BarActionButton,
|
|
150
|
+
default11 as BarActions,
|
|
151
|
+
default16 as BarCapsule,
|
|
152
|
+
default13 as BarSearch,
|
|
153
|
+
CHART_VIEW,
|
|
154
|
+
default52 as CalendarHeatmap,
|
|
155
|
+
default18 as Can,
|
|
156
|
+
default55 as CatalogInput,
|
|
157
|
+
default24 as CollapsibleSection,
|
|
158
|
+
default56 as ColorInput,
|
|
159
|
+
default37 as ColorSchemeToggle,
|
|
160
|
+
default2 as ComponentTexts,
|
|
161
|
+
default5 as ConfirmDialog,
|
|
162
|
+
default25 as ContentDialog,
|
|
163
|
+
default49 as CopyButton,
|
|
152
164
|
DEFAULT_CURRENCY,
|
|
165
|
+
DEFAULT_FILE_TYPES,
|
|
153
166
|
DEFAULT_LANGUAGE,
|
|
167
|
+
DEFAULT_LANGUAGES,
|
|
154
168
|
DEFAULT_PASSWORD_POLICY,
|
|
155
169
|
DOWNLOAD_STATUS,
|
|
156
170
|
DRAWER_WIDTH_COLLAPSED,
|
|
157
171
|
DRAWER_WIDTH_EXPANDED,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
172
|
+
default42 as DateRangeFilter,
|
|
173
|
+
default26 as DefinitionList,
|
|
174
|
+
default27 as DetailHeader,
|
|
175
|
+
default46 as DictionaryText,
|
|
176
|
+
default38 as DocumentTitle,
|
|
177
|
+
default10 as DownloadManager,
|
|
178
|
+
default50 as DownloadMenu,
|
|
165
179
|
ERROR_PAGE_KIND,
|
|
166
|
-
|
|
180
|
+
default22 as ErrorPage,
|
|
167
181
|
FILE_ACCEPT_PRESETS,
|
|
168
182
|
FILE_REJECTION,
|
|
169
183
|
FONT_SIZE_LEVELS,
|
|
170
184
|
FORM_ROW_CLASS,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
185
|
+
default57 as FieldFrame,
|
|
186
|
+
default23 as FileDropzone,
|
|
187
|
+
default40 as FontSizeToggle,
|
|
174
188
|
FormRow,
|
|
175
|
-
|
|
176
|
-
|
|
189
|
+
default58 as FormSection,
|
|
190
|
+
default28 as FullPageLoader,
|
|
177
191
|
GLASS_INSET_PIXELS,
|
|
178
192
|
GLASS_MENU_RADIUS_PIXELS,
|
|
179
193
|
GLASS_OPACITY,
|
|
180
194
|
GLASS_PANEL_RADIUS_PIXELS,
|
|
181
|
-
|
|
182
|
-
|
|
195
|
+
default29 as GlassLensFilter,
|
|
196
|
+
default30 as GlassPanel,
|
|
183
197
|
HEX_COLOR,
|
|
184
198
|
INSTALL_VARIANT,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
default66 as InboxLayout,
|
|
200
|
+
default71 as InstallAppSetting,
|
|
201
|
+
default69 as InstallInstructionsDialog,
|
|
202
|
+
default70 as InstallPromptBanner,
|
|
189
203
|
LANGUAGES,
|
|
190
|
-
|
|
204
|
+
default39 as LanguageToggle,
|
|
191
205
|
MAIN_CONTENT_ID,
|
|
192
206
|
MENU_POSITION,
|
|
193
207
|
MINIMAL_BACKGROUND,
|
|
194
208
|
MIN_CONTRAST,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
209
|
+
default67 as MessageList,
|
|
210
|
+
default68 as MessageView,
|
|
211
|
+
default53 as MetricCard,
|
|
212
|
+
default6 as ModalWaiting,
|
|
199
213
|
NEW_BUILD_NOTICE_VARIANT,
|
|
200
|
-
|
|
201
|
-
|
|
214
|
+
default7 as NewBuildNotice,
|
|
215
|
+
default59 as NumberInput,
|
|
202
216
|
PASSWORD_RULE,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
217
|
+
default41 as PageBreadcrumbs,
|
|
218
|
+
default31 as PageHeader,
|
|
219
|
+
default32 as PageHeading,
|
|
220
|
+
default21 as PasswordChecklist,
|
|
221
|
+
default43 as PeriodRangeSelector,
|
|
222
|
+
default20 as PermissionMatrix,
|
|
223
|
+
default33 as ProfileHeader,
|
|
224
|
+
default44 as QuickFilters,
|
|
211
225
|
REDIRECT_PARAM,
|
|
212
|
-
|
|
213
|
-
|
|
226
|
+
default64 as RecoveryCodesDialog,
|
|
227
|
+
default19 as RequireAccess,
|
|
214
228
|
SCROLL_MARGIN_BELOW_APP_BAR,
|
|
215
229
|
SEGMENTED_CONTROL_SX,
|
|
230
|
+
SELECTION_PHONE_LAYOUT,
|
|
216
231
|
STACKCRAFT,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
232
|
+
default34 as ScrollableRow,
|
|
233
|
+
default51 as SecretField,
|
|
234
|
+
default35 as SectionCard,
|
|
235
|
+
default45 as SegmentedControl,
|
|
236
|
+
default60 as SelectInput,
|
|
237
|
+
default15 as SelectionActions,
|
|
238
|
+
default65 as SessionsCard,
|
|
223
239
|
SettingSection,
|
|
224
|
-
|
|
225
|
-
|
|
240
|
+
default8 as StaleBuildBoundary,
|
|
241
|
+
default47 as StatusChip,
|
|
226
242
|
THEME_LOOK,
|
|
227
243
|
TOAST_DEFAULT_OPTIONS,
|
|
228
244
|
TOP_BAR,
|
|
229
245
|
TREND_DIRECTION,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
246
|
+
default54 as TableToggle,
|
|
247
|
+
default48 as Tag,
|
|
248
|
+
default62 as TextInput,
|
|
249
|
+
default9 as Toaster,
|
|
234
250
|
ToolkitProvider,
|
|
251
|
+
UNKNOWN_FILE_TYPE,
|
|
252
|
+
default61 as WizardLayout,
|
|
235
253
|
XLSX_CONTENT_TYPE,
|
|
236
254
|
accentTextStylesOf,
|
|
237
255
|
activeMenuItemOf,
|
|
256
|
+
addLogSink,
|
|
238
257
|
allowOnlyUnrestricted,
|
|
239
258
|
ambientBackgroundOf,
|
|
259
|
+
apiErrorOf,
|
|
240
260
|
apiUrlOf,
|
|
241
261
|
barMenuPlacementOf,
|
|
242
262
|
browserNavigation,
|
|
@@ -254,6 +274,8 @@ export {
|
|
|
254
274
|
contrastOnWhite,
|
|
255
275
|
createAccessChecker,
|
|
256
276
|
createApiClient,
|
|
277
|
+
createBrowserNavigation,
|
|
278
|
+
createHashNavigation,
|
|
257
279
|
createLogger,
|
|
258
280
|
createToolkitTheme,
|
|
259
281
|
currentHistoryIndex,
|
|
@@ -279,6 +301,7 @@ export {
|
|
|
279
301
|
formatPercent,
|
|
280
302
|
formatTime,
|
|
281
303
|
formatWeekdayShortName,
|
|
304
|
+
formattersOf,
|
|
282
305
|
glassDropOf,
|
|
283
306
|
glassStylesOf,
|
|
284
307
|
glassSurfaceOf,
|
|
@@ -304,6 +327,7 @@ export {
|
|
|
304
327
|
menuItemDescriptionOf,
|
|
305
328
|
menuItemLabelOf,
|
|
306
329
|
menuItemSectionOf,
|
|
330
|
+
menuItemsWithIconsOf,
|
|
307
331
|
menuSectionsOf,
|
|
308
332
|
mergeComponents,
|
|
309
333
|
mobileTabsOf,
|
|
@@ -335,6 +359,7 @@ export {
|
|
|
335
359
|
screenMenuItemsOf,
|
|
336
360
|
scrollEdgeStylesOf,
|
|
337
361
|
scrollableRow,
|
|
362
|
+
selectionFloatsOnPhone,
|
|
338
363
|
setLogLevel,
|
|
339
364
|
shortLabelOf,
|
|
340
365
|
stackcraftDarkPalette,
|
|
@@ -350,8 +375,8 @@ export {
|
|
|
350
375
|
toastWarn,
|
|
351
376
|
toolkitComponents,
|
|
352
377
|
toolkitSettings,
|
|
353
|
-
|
|
354
|
-
|
|
378
|
+
default4 as toolkitTextsEn,
|
|
379
|
+
default3 as toolkitTextsEs,
|
|
355
380
|
translateToolkit,
|
|
356
381
|
translateValidationMessage,
|
|
357
382
|
uploadMachine,
|
|
@@ -363,6 +388,8 @@ export {
|
|
|
363
388
|
useCan,
|
|
364
389
|
useCloseBarActionsMenu,
|
|
365
390
|
useConfirmAction,
|
|
391
|
+
useFileTypes,
|
|
392
|
+
useFormatters,
|
|
366
393
|
useInstallPrompt,
|
|
367
394
|
useMenuBadges,
|
|
368
395
|
useNavigationTrail,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,18 +23,22 @@ function CatalogInput({
|
|
|
23
23
|
loading = false,
|
|
24
24
|
disabled = false,
|
|
25
25
|
inputRef,
|
|
26
|
-
placeholder
|
|
26
|
+
placeholder,
|
|
27
|
+
multiple = false,
|
|
28
|
+
texts
|
|
27
29
|
}) {
|
|
28
|
-
const { t } = useToolkitTranslation("common");
|
|
30
|
+
const { t } = useToolkitTranslation("common", texts);
|
|
29
31
|
const generatedId = useId();
|
|
30
32
|
const inputId = `${name ?? "catalog"}-${generatedId}`;
|
|
31
33
|
const errorText = translateValidationMessage(t, error);
|
|
32
|
-
const selectedOption = options.find((option) => option.code === value) ?? null;
|
|
34
|
+
const selectedOption = multiple ? (Array.isArray(value) ? value : []).map((code) => options.find((option) => option.code === code)).filter(Boolean) : options.find((option) => option.code === value) ?? null;
|
|
33
35
|
const optionLabelOf = (option) => formatLabel ? formatLabel(option) : `${option.label} (${option.code})`;
|
|
34
36
|
return /* @__PURE__ */ jsx(FieldFrame, { inputId, label, children: /* @__PURE__ */ jsx(
|
|
35
37
|
Autocomplete,
|
|
36
38
|
{
|
|
37
39
|
id: inputId,
|
|
40
|
+
multiple,
|
|
41
|
+
disableCloseOnSelect: multiple,
|
|
38
42
|
fullWidth: true,
|
|
39
43
|
size: "small",
|
|
40
44
|
options,
|
|
@@ -50,7 +54,7 @@ function CatalogInput({
|
|
|
50
54
|
const matchingOptions = wantedText ? allOptions.filter((option) => plainTextOf(optionLabelOf(option)).includes(wantedText)) : allOptions;
|
|
51
55
|
return matchingOptions.slice(0, MAX_VISIBLE_OPTIONS);
|
|
52
56
|
},
|
|
53
|
-
onChange: (event, option) => onChange(option?.code ?? ""),
|
|
57
|
+
onChange: (event, option) => onChange(multiple ? option.map((chosenOption) => chosenOption.code) : option?.code ?? ""),
|
|
54
58
|
onBlur,
|
|
55
59
|
renderInput: (inputProps) => /* @__PURE__ */ jsx(TextField, { ...inputProps, name, inputRef, placeholder, error: Boolean(errorText), helperText: errorText ?? helperText })
|
|
56
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogInput.js","sources":["../../src/inputs/CatalogInput.jsx"],"sourcesContent":["// Campo suelto que elige
|
|
1
|
+
{"version":3,"file":"CatalogInput.js","sources":["../../src/inputs/CatalogInput.jsx"],"sourcesContent":["// Campo suelto que elige una clave de un catálogo ([{code, label}]): actividad económica, giro, país, banco… Se busca por la\n// clave o por el texto, sin acentos ni mayúsculas, y al formulario llega solo la clave. Con `multiple` elige varias: cada una\n// queda como chip con su ×, la lista no se cierra al elegir y al formulario llega la lista de claves en el orden elegido.\n//\n// Por qué no un <select>: con catálogos de cientos de opciones no se puede usar; y con texto libre la gente inventa claves.\n// Se enseñan a lo más MAX_VISIBLE_OPTIONS coincidencias: con miles, la lista completa congela la pantalla.\n//\n// Genérico del paquete: function (regla de la casa).\nimport {useId} from 'react';\nimport {useToolkitTranslation} from '@/toolkit/useToolkitTranslation.js';\nimport Autocomplete from '@mui/material/Autocomplete';\nimport TextField from '@mui/material/TextField';\n\nimport {translateValidationMessage} from '@/forms/validationMessages.js';\nimport FieldFrame from '@/inputs/FieldFrame.jsx';\n\nconst MAX_VISIBLE_OPTIONS = 100;\n\n/**\n * Un texto sin acentos ni mayúsculas, para que «credito» encuentre «Crédito».\n *\n * @param {unknown} text\n * @returns {string}\n */\nfunction plainTextOf(text) {\n return String(text ?? '').normalize('NFD').replace(/\\p{Diacritic}/gu, '').toLowerCase();\n}\n\n/**\n * @param {object} props\n * @param {string} [props.name]\n * @param {string} props.label ya traducido\n * @param {string|string[]|null|undefined} props.value la clave elegida ('' = ninguna); con multiple, la lista ([] = ninguna)\n * @param {(code: any) => void} props.onChange recibe la clave ('' al borrar); con multiple, la lista de claves\n * @param {() => void} [props.onBlur]\n * @param {Array<{code: string, label: string}>} props.options\n * @param {(option: {code: string, label: string}) => string} [props.formatLabel] por omisión «Nombre (clave)»\n * @param {string|{key: string, values?: object}} [props.error]\n * @param {string} [props.helperText]\n * @param {boolean} [props.loading] el catálogo todavía no llega\n * @param {string} [props.placeholder] la pista con el campo vacío, ya traducida (p. ej. «Busque un estado»): sin ella, en un\n * formulario agrupado el campo vacío solo enseña su botón y no se entiende qué es\n * @param {boolean} [props.disabled]\n * @param {import('react').Ref<HTMLInputElement>} [props.inputRef]\n * @param {boolean} [props.multiple] elegir varias claves\n * @param {object} [props.texts] los textos que cambian, con la forma de `common` en los textos del paquete\n */\nexport default function CatalogInput({\n name, label, value, onChange, onBlur, options = [], formatLabel, error, helperText = ' ', loading = false, disabled = false, inputRef, placeholder,\n multiple = false, texts,\n}) {\n const {t} = useToolkitTranslation('common', texts);\n const generatedId = useId();\n const inputId = `${name ?? 'catalog'}-${generatedId}`;\n const errorText = translateValidationMessage(t, error);\n // con varias, en el orden en que se eligieron (el de la lista de claves)\n const selectedOption = multiple\n ? (Array.isArray(value) ? value : []).map((code) => options.find((option) => option.code === code)).filter(Boolean)\n : options.find((option) => option.code === value) ?? null;\n const optionLabelOf = (option) => (formatLabel ? formatLabel(option) : `${option.label} (${option.code})`);\n\n return (\n <FieldFrame inputId={inputId} label={label}>\n <Autocomplete\n id={inputId}\n multiple={multiple}\n disableCloseOnSelect={multiple}\n fullWidth\n size=\"small\"\n options={options}\n value={selectedOption}\n loading={loading}\n disabled={disabled}\n noOptionsText={t('form.noOptions')}\n loadingText={t('form.loadingOptions')}\n getOptionLabel={optionLabelOf}\n isOptionEqualToValue={(option, currentOption) => option.code === currentOption.code}\n filterOptions={(allOptions, {inputValue}) => {\n const wantedText = plainTextOf(inputValue);\n const matchingOptions = wantedText\n ? allOptions.filter((option) => plainTextOf(optionLabelOf(option)).includes(wantedText))\n : allOptions;\n return matchingOptions.slice(0, MAX_VISIBLE_OPTIONS);\n }}\n onChange={(event, option) => onChange(multiple ? option.map((chosenOption) => chosenOption.code) : option?.code ?? '')}\n onBlur={onBlur}\n renderInput={(inputProps) => (\n <TextField {...inputProps} name={name} inputRef={inputRef} placeholder={placeholder} error={Boolean(errorText)} helperText={errorText ?? helperText} />\n )}\n />\n </FieldFrame>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAgBA,MAAM,sBAAsB;AAQ5B,SAAS,YAAY,MAAM;AACvB,SAAO,OAAO,QAAQ,EAAE,EAAE,UAAU,KAAK,EAAE,QAAQ,WAAA,kBAAA,IAAA,GAAmB,EAAE,EAAE,YAAA;AAC9E;AAqBA,SAAwB,aAAa;AAAA,EACjC;AAAA,EAAM;AAAA,EAAO;AAAA,EAAO;AAAA,EAAU;AAAA,EAAQ,UAAU,CAAA;AAAA,EAAI;AAAA,EAAa;AAAA,EAAO,aAAa;AAAA,EAAK,UAAU;AAAA,EAAO,WAAW;AAAA,EAAO;AAAA,EAAU;AAAA,EACvI,WAAW;AAAA,EAAO;AACtB,GAAG;AACC,QAAM,EAAC,EAAA,IAAK,sBAAsB,UAAU,KAAK;AACjD,QAAM,cAAc,MAAA;AACpB,QAAM,UAAU,GAAG,QAAQ,SAAS,IAAI,WAAW;AACnD,QAAM,YAAY,2BAA2B,GAAG,KAAK;AAErD,QAAM,iBAAiB,YAChB,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAA,GAAI,IAAI,CAAC,SAAS,QAAQ,KAAK,CAAC,WAAW,OAAO,SAAS,IAAI,CAAC,EAAE,OAAO,OAAO,IAChH,QAAQ,KAAK,CAAC,WAAW,OAAO,SAAS,KAAK,KAAK;AACzD,QAAM,gBAAgB,CAAC,WAAY,cAAc,YAAY,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,OAAO,IAAI;AAEtG,SACI,oBAAC,YAAA,EAAW,SAAkB,OAC1B,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,IAAI;AAAA,MACJ;AAAA,MACA,sBAAsB;AAAA,MACtB,WAAS;AAAA,MACT,MAAK;AAAA,MACL;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,eAAe,EAAE,gBAAgB;AAAA,MACjC,aAAa,EAAE,qBAAqB;AAAA,MACpC,gBAAgB;AAAA,MAChB,sBAAsB,CAAC,QAAQ,kBAAkB,OAAO,SAAS,cAAc;AAAA,MAC/E,eAAe,CAAC,YAAY,EAAC,iBAAgB;AACzC,cAAM,aAAa,YAAY,UAAU;AACzC,cAAM,kBAAkB,aAClB,WAAW,OAAO,CAAC,WAAW,YAAY,cAAc,MAAM,CAAC,EAAE,SAAS,UAAU,CAAC,IACrF;AACN,eAAO,gBAAgB,MAAM,GAAG,mBAAmB;AAAA,MACvD;AAAA,MACA,UAAU,CAAC,OAAO,WAAW,SAAS,WAAW,OAAO,IAAI,CAAC,iBAAiB,aAAa,IAAI,IAAI,QAAQ,QAAQ,EAAE;AAAA,MACrH;AAAA,MACA,aAAa,CAAC,eACV,oBAAC,WAAA,EAAW,GAAG,YAAY,MAAY,UAAoB,aAA0B,OAAO,QAAQ,SAAS,GAAG,YAAY,aAAa,WAAA,CAAY;AAAA,IAAA;AAAA,EAAA,GAGjK;AAER;"}
|
|
@@ -26,9 +26,10 @@ function ColorInput({
|
|
|
26
26
|
helperText = " ",
|
|
27
27
|
checkContrast = true,
|
|
28
28
|
disabled = false,
|
|
29
|
-
inputRef
|
|
29
|
+
inputRef,
|
|
30
|
+
texts
|
|
30
31
|
}) {
|
|
31
|
-
const { t } = useToolkitTranslation("common");
|
|
32
|
+
const { t } = useToolkitTranslation("common", texts);
|
|
32
33
|
const generatedId = useId();
|
|
33
34
|
const inputId = `${name ?? "color"}-${generatedId}`;
|
|
34
35
|
const color = value ?? "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorInput.js","sources":["../../src/inputs/ColorInput.jsx"],"sourcesContent":["// Campo de COLOR suelto (viene de «Identidad de documentos» de PLD): la muestra redonda (el «color well» de Apple, que abre\n// el selector del sistema) dentro del campo del texto #RRGGBB, el contraste contra el blanco mientras se elige y, si el color casi no se leería, el mismo tono más oscuro con su botón\n// para usarlo.\n//\n// Para lo que se imprime o se lee sobre blanco (el color de una marca en un comprobante). El color llega al formulario en\n// mayúsculas (#2B3A67); '' = sin color.\n//\n// Genérico del paquete: function (regla de la casa).\nimport {useId} from 'react';\nimport {useToolkitTranslation} from '@/toolkit/useToolkitTranslation.js';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Stack from '@mui/material/Stack';\nimport TextField from '@mui/material/TextField';\n\nimport {translateValidationMessage} from '@/forms/validationMessages.js';\nimport {HEX_COLOR, MIN_CONTRAST, contrastOnWhite, readableVariantOf} from '@/inputs/colorContrast.js';\nimport FieldFrame from '@/inputs/FieldFrame.jsx';\n\n// #RRGGBB\nconst COLOR_LENGTH = 7;\n// el color que enseña el selector del navegador mientras el texto no es un color\nconst NEUTRAL_COLOR = '#000000';\nconst RATIO_DECIMALS = 1;\n// la muestra redonda (px) y su orilla fina en claro y en oscuro\nconst SWATCH_PIXELS = 24;\nconst SWATCH_EDGE = Object.freeze({light: 'rgba(15, 23, 42, 0.18)', dark: 'rgba(255, 255, 255, 0.24)'});\n\n/**\n * @param {object} props\n * @param {string} [props.name]\n * @param {string} props.label ya traducido\n * @param {string|null|undefined} props.value '#RRGGBB' o ''\n * @param {(color: string) => void} props.onChange recibe el color en mayúsculas\n * @param {() => void} [props.onBlur]\n * @param {string|{key: string, values?: object}} [props.error]\n * @param {string} [props.helperText] cuando no hay color\n * @param {boolean} [props.checkContrast] avisa si casi no se lee sobre blanco (por omisión sí)\n * @param {boolean} [props.disabled]\n * @param {import('react').Ref<HTMLInputElement>} [props.inputRef]\n */\nexport default function ColorInput({\n name, label, value, onChange, onBlur, error, helperText = ' ', checkContrast = true, disabled = false, inputRef,\n}) {\n const {t} = useToolkitTranslation('common');\n const generatedId = useId();\n const inputId = `${name ?? 'color'}-${generatedId}`;\n const color = value ?? '';\n const isValidColor = HEX_COLOR.test(color);\n const contrastRatio = isValidColor ? contrastOnWhite(color) : null;\n const suggestion = checkContrast && isValidColor && contrastRatio < MIN_CONTRAST ? readableVariantOf(color) : null;\n const errorText = translateValidationMessage(t, error);\n const contrastText = contrastRatio && checkContrast ? t('form.colorContrast', {ratio: contrastRatio.toFixed(RATIO_DECIMALS)}) : helperText;\n const choose = (nextColor) => onChange(nextColor.toUpperCase());\n\n return (\n <FieldFrame inputId={inputId} label={label}>\n <Stack spacing={1}>\n {/* un solo campo: la muestra redonda al inicio (el «color well» de Apple) y el código al lado. Picar la muestra\n abre el selector de colores del sistema (un input type=color invisible encima de ella). Antes eran dos cajas\n sueltas (el selector del navegador en la suya y el código en otra) y se veían como piezas sueltas */}\n <TextField\n name={name}\n id={inputId}\n inputRef={inputRef}\n size=\"small\"\n fullWidth\n value={color}\n disabled={disabled}\n placeholder=\"#RRGGBB\"\n onChange={(event) => choose(event.target.value)}\n onBlur={onBlur}\n error={Boolean(errorText)}\n helperText={errorText ?? contrastText}\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <Box component=\"label\"\n sx={(theme) => ({\n position: 'relative', display: 'block', flexShrink: 0, width: SWATCH_PIXELS, height: SWATCH_PIXELS,\n borderRadius: '50%', cursor: disabled ? 'default' : 'pointer',\n backgroundColor: isValidColor ? color : 'transparent',\n // la orilla de la muestra: que se vea aunque el color sea el del fondo (blanco en claro, negro en oscuro)\n boxShadow: `inset 0 0 0 1px ${SWATCH_EDGE.light}`,\n ...theme.applyStyles('dark', {boxShadow: `inset 0 0 0 1px ${SWATCH_EDGE.dark}`}),\n })}>\n <Box component=\"input\" type=\"color\" value={isValidColor ? color : NEUTRAL_COLOR} disabled={disabled}\n aria-label={t('form.pickColor')} onChange={(event) => choose(event.target.value)}\n sx={{position: 'absolute', inset: 0, width: '100%', height: '100%', opacity: 0, border: 0, p: 0, cursor: 'inherit'}} />\n </Box>\n </InputAdornment>\n ),\n },\n htmlInput: {maxLength: COLOR_LENGTH, spellCheck: false, style: {fontVariantNumeric: 'tabular-nums'}},\n }}\n />\n {suggestion && (\n <Alert severity=\"warning\"\n action={<Button color=\"inherit\" size=\"small\" onClick={() => choose(suggestion)}>{t('form.colorUseSuggestion', {color: suggestion})}</Button>}>\n {t('form.colorLowContrast', {suggestion})}\n </Alert>\n )}\n </Stack>\n </FieldFrame>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsBA,MAAM,eAAe;AAErB,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAEvB,MAAM,gBAAgB;AACtB,MAAM,cAAc,OAAO,OAAO,EAAC,OAAO,0BAA0B,MAAM,6BAA4B;
|
|
1
|
+
{"version":3,"file":"ColorInput.js","sources":["../../src/inputs/ColorInput.jsx"],"sourcesContent":["// Campo de COLOR suelto (viene de «Identidad de documentos» de PLD): la muestra redonda (el «color well» de Apple, que abre\n// el selector del sistema) dentro del campo del texto #RRGGBB, el contraste contra el blanco mientras se elige y, si el color casi no se leería, el mismo tono más oscuro con su botón\n// para usarlo.\n//\n// Para lo que se imprime o se lee sobre blanco (el color de una marca en un comprobante). El color llega al formulario en\n// mayúsculas (#2B3A67); '' = sin color.\n//\n// Genérico del paquete: function (regla de la casa).\nimport {useId} from 'react';\nimport {useToolkitTranslation} from '@/toolkit/useToolkitTranslation.js';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Stack from '@mui/material/Stack';\nimport TextField from '@mui/material/TextField';\n\nimport {translateValidationMessage} from '@/forms/validationMessages.js';\nimport {HEX_COLOR, MIN_CONTRAST, contrastOnWhite, readableVariantOf} from '@/inputs/colorContrast.js';\nimport FieldFrame from '@/inputs/FieldFrame.jsx';\n\n// #RRGGBB\nconst COLOR_LENGTH = 7;\n// el color que enseña el selector del navegador mientras el texto no es un color\nconst NEUTRAL_COLOR = '#000000';\nconst RATIO_DECIMALS = 1;\n// la muestra redonda (px) y su orilla fina en claro y en oscuro\nconst SWATCH_PIXELS = 24;\nconst SWATCH_EDGE = Object.freeze({light: 'rgba(15, 23, 42, 0.18)', dark: 'rgba(255, 255, 255, 0.24)'});\n\n/**\n * @param {object} props\n * @param {string} [props.name]\n * @param {string} props.label ya traducido\n * @param {string|null|undefined} props.value '#RRGGBB' o ''\n * @param {(color: string) => void} props.onChange recibe el color en mayúsculas\n * @param {() => void} [props.onBlur]\n * @param {string|{key: string, values?: object}} [props.error]\n * @param {string} [props.helperText] cuando no hay color\n * @param {boolean} [props.checkContrast] avisa si casi no se lee sobre blanco (por omisión sí)\n * @param {boolean} [props.disabled]\n * @param {import('react').Ref<HTMLInputElement>} [props.inputRef]\n * @param {object} [props.texts] los textos que cambian, con la forma de `common` en los textos del paquete\n */\nexport default function ColorInput({\n name, label, value, onChange, onBlur, error, helperText = ' ', checkContrast = true, disabled = false, inputRef, texts,\n}) {\n const {t} = useToolkitTranslation('common', texts);\n const generatedId = useId();\n const inputId = `${name ?? 'color'}-${generatedId}`;\n const color = value ?? '';\n const isValidColor = HEX_COLOR.test(color);\n const contrastRatio = isValidColor ? contrastOnWhite(color) : null;\n const suggestion = checkContrast && isValidColor && contrastRatio < MIN_CONTRAST ? readableVariantOf(color) : null;\n const errorText = translateValidationMessage(t, error);\n const contrastText = contrastRatio && checkContrast ? t('form.colorContrast', {ratio: contrastRatio.toFixed(RATIO_DECIMALS)}) : helperText;\n const choose = (nextColor) => onChange(nextColor.toUpperCase());\n\n return (\n <FieldFrame inputId={inputId} label={label}>\n <Stack spacing={1}>\n {/* un solo campo: la muestra redonda al inicio (el «color well» de Apple) y el código al lado. Picar la muestra\n abre el selector de colores del sistema (un input type=color invisible encima de ella). Antes eran dos cajas\n sueltas (el selector del navegador en la suya y el código en otra) y se veían como piezas sueltas */}\n <TextField\n name={name}\n id={inputId}\n inputRef={inputRef}\n size=\"small\"\n fullWidth\n value={color}\n disabled={disabled}\n placeholder=\"#RRGGBB\"\n onChange={(event) => choose(event.target.value)}\n onBlur={onBlur}\n error={Boolean(errorText)}\n helperText={errorText ?? contrastText}\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <Box component=\"label\"\n sx={(theme) => ({\n position: 'relative', display: 'block', flexShrink: 0, width: SWATCH_PIXELS, height: SWATCH_PIXELS,\n borderRadius: '50%', cursor: disabled ? 'default' : 'pointer',\n backgroundColor: isValidColor ? color : 'transparent',\n // la orilla de la muestra: que se vea aunque el color sea el del fondo (blanco en claro, negro en oscuro)\n boxShadow: `inset 0 0 0 1px ${SWATCH_EDGE.light}`,\n ...theme.applyStyles('dark', {boxShadow: `inset 0 0 0 1px ${SWATCH_EDGE.dark}`}),\n })}>\n <Box component=\"input\" type=\"color\" value={isValidColor ? color : NEUTRAL_COLOR} disabled={disabled}\n aria-label={t('form.pickColor')} onChange={(event) => choose(event.target.value)}\n sx={{position: 'absolute', inset: 0, width: '100%', height: '100%', opacity: 0, border: 0, p: 0, cursor: 'inherit'}} />\n </Box>\n </InputAdornment>\n ),\n },\n htmlInput: {maxLength: COLOR_LENGTH, spellCheck: false, style: {fontVariantNumeric: 'tabular-nums'}},\n }}\n />\n {suggestion && (\n <Alert severity=\"warning\"\n action={<Button color=\"inherit\" size=\"small\" onClick={() => choose(suggestion)}>{t('form.colorUseSuggestion', {color: suggestion})}</Button>}>\n {t('form.colorLowContrast', {suggestion})}\n </Alert>\n )}\n </Stack>\n </FieldFrame>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsBA,MAAM,eAAe;AAErB,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAEvB,MAAM,gBAAgB;AACtB,MAAM,cAAc,OAAO,OAAO,EAAC,OAAO,0BAA0B,MAAM,6BAA4B;AAgBtG,SAAwB,WAAW;AAAA,EAC/B;AAAA,EAAM;AAAA,EAAO;AAAA,EAAO;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAO,aAAa;AAAA,EAAK,gBAAgB;AAAA,EAAM,WAAW;AAAA,EAAO;AAAA,EAAU;AACrH,GAAG;AACC,QAAM,EAAC,EAAA,IAAK,sBAAsB,UAAU,KAAK;AACjD,QAAM,cAAc,MAAA;AACpB,QAAM,UAAU,GAAG,QAAQ,OAAO,IAAI,WAAW;AACjD,QAAM,QAAQ,SAAS;AACvB,QAAM,eAAe,UAAU,KAAK,KAAK;AACzC,QAAM,gBAAgB,eAAe,gBAAgB,KAAK,IAAI;AAC9D,QAAM,aAAa,iBAAiB,gBAAgB,gBAAgB,eAAe,kBAAkB,KAAK,IAAI;AAC9G,QAAM,YAAY,2BAA2B,GAAG,KAAK;AACrD,QAAM,eAAe,iBAAiB,gBAAgB,EAAE,sBAAsB,EAAC,OAAO,cAAc,QAAQ,cAAc,EAAA,CAAE,IAAI;AAChI,QAAM,SAAS,CAAC,cAAc,SAAS,UAAU,aAAa;AAE9D,6BACK,YAAA,EAAW,SAAkB,OAC1B,UAAA,qBAAC,OAAA,EAAM,SAAS,GAIZ,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG;AAAA,QACA,IAAI;AAAA,QACJ;AAAA,QACA,MAAK;AAAA,QACL,WAAS;AAAA,QACT,OAAO;AAAA,QACP;AAAA,QACA,aAAY;AAAA,QACZ,UAAU,CAAC,UAAU,OAAO,MAAM,OAAO,KAAK;AAAA,QAC9C;AAAA,QACA,OAAO,QAAQ,SAAS;AAAA,QACxB,YAAY,aAAa;AAAA,QACzB,WAAW;AAAA,UACP,OAAO;AAAA,YACH,gBACI,oBAAC,gBAAA,EAAe,UAAS,SACrB,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBAAI,WAAU;AAAA,gBACV,IAAI,CAAC,WAAW;AAAA,kBACZ,UAAU;AAAA,kBAAY,SAAS;AAAA,kBAAS,YAAY;AAAA,kBAAG,OAAO;AAAA,kBAAe,QAAQ;AAAA,kBACrF,cAAc;AAAA,kBAAO,QAAQ,WAAW,YAAY;AAAA,kBACpD,iBAAiB,eAAe,QAAQ;AAAA;AAAA,kBAExC,WAAW,mBAAmB,YAAY,KAAK;AAAA,kBAC/C,GAAG,MAAM,YAAY,QAAQ,EAAC,WAAW,mBAAmB,YAAY,IAAI,GAAA,CAAG;AAAA,gBAAA;AAAA,gBAEpF,UAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBAAI,WAAU;AAAA,oBAAQ,MAAK;AAAA,oBAAQ,OAAO,eAAe,QAAQ;AAAA,oBAAe;AAAA,oBAC5E,cAAY,EAAE,gBAAgB;AAAA,oBAAG,UAAU,CAAC,UAAU,OAAO,MAAM,OAAO,KAAK;AAAA,oBAC/E,IAAI,EAAC,UAAU,YAAY,OAAO,GAAG,OAAO,QAAQ,QAAQ,QAAQ,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,UAAA;AAAA,kBAAS;AAAA,gBAAA;AAAA,cAAG;AAAA,YAAA,EAC9H,CACJ;AAAA,UAAA;AAAA,UAGR,WAAW,EAAC,WAAW,cAAc,YAAY,OAAO,OAAO,EAAC,oBAAoB,eAAA,EAAc;AAAA,QAAC;AAAA,MACvG;AAAA,IAAA;AAAA,IAEH,cACG;AAAA,MAAC;AAAA,MAAA;AAAA,QAAM,UAAS;AAAA,QACT,QAAQ,oBAAC,QAAA,EAAO,OAAM,WAAU,MAAK,SAAQ,SAAS,MAAM,OAAO,UAAU,GAAI,UAAA,EAAE,2BAA2B,EAAC,OAAO,WAAA,CAAW,GAAE;AAAA,QACrI,UAAA,EAAE,yBAAyB,EAAC,WAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAC5C,EAAA,CAER,EAAA,CACJ;AAER;"}
|
|
@@ -80,8 +80,8 @@ function FormSection({ title, footer, children }) {
|
|
|
80
80
|
sx: (theme) => ({
|
|
81
81
|
borderRadius: `${GLASS_PANEL_RADIUS_PIXELS}px`,
|
|
82
82
|
overflow: "hidden",
|
|
83
|
-
// la línea
|
|
84
|
-
[`&
|
|
83
|
+
// la línea de arriba de cada renglón, desde donde empieza el texto (la del primero la recorta la tarjeta)
|
|
84
|
+
[`& .${FORM_ROW_CLASS}::before`]: {
|
|
85
85
|
content: '""',
|
|
86
86
|
position: "absolute",
|
|
87
87
|
top: 0,
|
|
@@ -91,7 +91,7 @@ function FormSection({ title, footer, children }) {
|
|
|
91
91
|
backgroundColor: (theme.vars ?? theme).palette.divider
|
|
92
92
|
}
|
|
93
93
|
}),
|
|
94
|
-
children
|
|
94
|
+
children: /* @__PURE__ */ jsx(Box, { sx: { mt: "-1px" }, children })
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
97
|
footer && /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "p", color: "text.secondary", sx: { px: 2, mt: 0.75 }, children: footer })
|