@variocube/app-ui 1.14.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 +65 -0
- package/esm/AppShell/AppShell.d.ts +12 -0
- package/esm/AppShell/AppShell.js +92 -0
- package/esm/AppShell/AppShell.js.map +1 -0
- package/esm/AppShell/index.d.ts +1 -0
- package/esm/AppShell/index.js +2 -0
- package/esm/AppShell/index.js.map +1 -0
- package/esm/ErrorAlert.d.ts +12 -0
- package/esm/ErrorAlert.js +61 -0
- package/esm/ErrorAlert.js.map +1 -0
- package/esm/Input/ActionsMenu.d.ts +9 -0
- package/esm/Input/ActionsMenu.js +29 -0
- package/esm/Input/ActionsMenu.js.map +1 -0
- package/esm/Input/Checkbox.d.ts +9 -0
- package/esm/Input/Checkbox.js +23 -0
- package/esm/Input/Checkbox.js.map +1 -0
- package/esm/Input/EmailSenderField.d.ts +8 -0
- package/esm/Input/EmailSenderField.js +71 -0
- package/esm/Input/EmailSenderField.js.map +1 -0
- package/esm/Input/NumberField.d.ts +10 -0
- package/esm/Input/NumberField.js +94 -0
- package/esm/Input/NumberField.js.map +1 -0
- package/esm/Input/RadioGroup.d.ts +12 -0
- package/esm/Input/RadioGroup.js +20 -0
- package/esm/Input/RadioGroup.js.map +1 -0
- package/esm/Input/Select.d.ts +11 -0
- package/esm/Input/Select.js +19 -0
- package/esm/Input/Select.js.map +1 -0
- package/esm/Input/Selector.d.ts +10 -0
- package/esm/Input/Selector.js +19 -0
- package/esm/Input/Selector.js.map +1 -0
- package/esm/Input/Switch.d.ts +9 -0
- package/esm/Input/Switch.js +23 -0
- package/esm/Input/Switch.js.map +1 -0
- package/esm/Input/TextField.d.ts +7 -0
- package/esm/Input/TextField.js +58 -0
- package/esm/Input/TextField.js.map +1 -0
- package/esm/Input/UrlUploadField.d.ts +9 -0
- package/esm/Input/UrlUploadField.js +43 -0
- package/esm/Input/UrlUploadField.js.map +1 -0
- package/esm/Input/index.d.ts +9 -0
- package/esm/Input/index.js +10 -0
- package/esm/Input/index.js.map +1 -0
- package/esm/LanguageSwitcher/LanguageSwitcher.d.ts +14 -0
- package/esm/LanguageSwitcher/LanguageSwitcher.js +20 -0
- package/esm/LanguageSwitcher/LanguageSwitcher.js.map +1 -0
- package/esm/LanguageSwitcher/index.d.ts +1 -0
- package/esm/LanguageSwitcher/index.js +2 -0
- package/esm/LanguageSwitcher/index.js.map +1 -0
- package/esm/Paging/Paging.d.ts +40 -0
- package/esm/Paging/Paging.js +43 -0
- package/esm/Paging/Paging.js.map +1 -0
- package/esm/Paging/index.d.ts +1 -0
- package/esm/Paging/index.js +2 -0
- package/esm/Paging/index.js.map +1 -0
- package/esm/VCThemeProvider/JetbrainsMonoFont.d.ts +5 -0
- package/esm/VCThemeProvider/JetbrainsMonoFont.js +52 -0
- package/esm/VCThemeProvider/JetbrainsMonoFont.js.map +1 -0
- package/esm/VCThemeProvider/RobotoFont.d.ts +7 -0
- package/esm/VCThemeProvider/RobotoFont.js +49 -0
- package/esm/VCThemeProvider/RobotoFont.js.map +1 -0
- package/esm/VCThemeProvider/ThemeModeSwitcher.d.ts +2 -0
- package/esm/VCThemeProvider/ThemeModeSwitcher.js +14 -0
- package/esm/VCThemeProvider/ThemeModeSwitcher.js.map +1 -0
- package/esm/VCThemeProvider/VCThemeProvider.d.ts +25 -0
- package/esm/VCThemeProvider/VCThemeProvider.js +173 -0
- package/esm/VCThemeProvider/VCThemeProvider.js.map +1 -0
- package/esm/VCThemeProvider/code-colors.d.ts +108 -0
- package/esm/VCThemeProvider/code-colors.js +26 -0
- package/esm/VCThemeProvider/code-colors.js.map +1 -0
- package/esm/VCThemeProvider/index.d.ts +5 -0
- package/esm/VCThemeProvider/index.js +6 -0
- package/esm/VCThemeProvider/index.js.map +1 -0
- package/esm/audit/AuditChanges.d.ts +9 -0
- package/esm/audit/AuditChanges.js +43 -0
- package/esm/audit/AuditChanges.js.map +1 -0
- package/esm/audit/AuditTimeline.d.ts +6 -0
- package/esm/audit/AuditTimeline.js +13 -0
- package/esm/audit/AuditTimeline.js.map +1 -0
- package/esm/audit/AuditTimelineItem.d.ts +10 -0
- package/esm/audit/AuditTimelineItem.js +27 -0
- package/esm/audit/AuditTimelineItem.js.map +1 -0
- package/esm/audit/index.d.ts +4 -0
- package/esm/audit/index.js +5 -0
- package/esm/audit/index.js.map +1 -0
- package/esm/audit/types.d.ts +42 -0
- package/esm/audit/types.js +2 -0
- package/esm/audit/types.js.map +1 -0
- package/esm/breadcrumbs.d.ts +6 -0
- package/esm/breadcrumbs.js +13 -0
- package/esm/breadcrumbs.js.map +1 -0
- package/esm/code/Code.d.ts +10 -0
- package/esm/code/Code.js +19 -0
- package/esm/code/Code.js.map +1 -0
- package/esm/code/CodeBlock.d.ts +4 -0
- package/esm/code/CodeBlock.js +6 -0
- package/esm/code/CodeBlock.js.map +1 -0
- package/esm/code/Json.d.ts +4 -0
- package/esm/code/Json.js +60 -0
- package/esm/code/Json.js.map +1 -0
- package/esm/code/index.d.ts +3 -0
- package/esm/code/index.js +4 -0
- package/esm/code/index.js.map +1 -0
- package/esm/confirm/ConfirmButton.d.ts +16 -0
- package/esm/confirm/ConfirmButton.js +29 -0
- package/esm/confirm/ConfirmButton.js.map +1 -0
- package/esm/confirm/ConfirmDialog.d.ts +16 -0
- package/esm/confirm/ConfirmDialog.js +35 -0
- package/esm/confirm/ConfirmDialog.js.map +1 -0
- package/esm/confirm/ConfirmIconButton.d.ts +14 -0
- package/esm/confirm/ConfirmIconButton.js +29 -0
- package/esm/confirm/ConfirmIconButton.js.map +1 -0
- package/esm/confirm/ConfirmMenuItem.d.ts +15 -0
- package/esm/confirm/ConfirmMenuItem.js +31 -0
- package/esm/confirm/ConfirmMenuItem.js.map +1 -0
- package/esm/confirm/index.d.ts +4 -0
- package/esm/confirm/index.js +5 -0
- package/esm/confirm/index.js.map +1 -0
- package/esm/container/ContainerLayout.d.ts +8 -0
- package/esm/container/ContainerLayout.js +20 -0
- package/esm/container/ContainerLayout.js.map +1 -0
- package/esm/container/ContainerSettingsContext.d.ts +12 -0
- package/esm/container/ContainerSettingsContext.js +46 -0
- package/esm/container/ContainerSettingsContext.js.map +1 -0
- package/esm/container/ContainerWidthControl.d.ts +6 -0
- package/esm/container/ContainerWidthControl.js +12 -0
- package/esm/container/ContainerWidthControl.js.map +1 -0
- package/esm/container/index.d.ts +3 -0
- package/esm/container/index.js +4 -0
- package/esm/container/index.js.map +1 -0
- package/esm/content-table/ContentTable.d.ts +25 -0
- package/esm/content-table/ContentTable.js +87 -0
- package/esm/content-table/ContentTable.js.map +1 -0
- package/esm/content-table/UndrawEmpty.d.ts +2 -0
- package/esm/content-table/UndrawEmpty.js +71 -0
- package/esm/content-table/UndrawEmpty.js.map +1 -0
- package/esm/content-table/index.d.ts +1 -0
- package/esm/content-table/index.js +2 -0
- package/esm/content-table/index.js.map +1 -0
- package/esm/country/countries.d.ts +34 -0
- package/esm/country/countries.js +266 -0
- package/esm/country/countries.js.map +1 -0
- package/esm/country/country-select.d.ts +8 -0
- package/esm/country/country-select.js +18 -0
- package/esm/country/country-select.js.map +1 -0
- package/esm/country/index.d.ts +5 -0
- package/esm/country/index.js +6 -0
- package/esm/country/index.js.map +1 -0
- package/esm/country/locale-select.d.ts +9 -0
- package/esm/country/locale-select.js +15 -0
- package/esm/country/locale-select.js.map +1 -0
- package/esm/country/locales.d.ts +10 -0
- package/esm/country/locales.js +190 -0
- package/esm/country/locales.js.map +1 -0
- package/esm/country/phone-prefix-select.d.ts +9 -0
- package/esm/country/phone-prefix-select.js +18 -0
- package/esm/country/phone-prefix-select.js.map +1 -0
- package/esm/cube/BoxFeatures.d.ts +11 -0
- package/esm/cube/BoxFeatures.js +40 -0
- package/esm/cube/BoxFeatures.js.map +1 -0
- package/esm/cube/BoxMaintenanceChip.d.ts +9 -0
- package/esm/cube/BoxMaintenanceChip.js +15 -0
- package/esm/cube/BoxMaintenanceChip.js.map +1 -0
- package/esm/cube/BoxNumber.d.ts +6 -0
- package/esm/cube/BoxNumber.js +6 -0
- package/esm/cube/BoxNumber.js.map +1 -0
- package/esm/cube/BoxType.d.ts +7 -0
- package/esm/cube/BoxType.js +21 -0
- package/esm/cube/BoxType.js.map +1 -0
- package/esm/cube/CubeConnectedChip.d.ts +9 -0
- package/esm/cube/CubeConnectedChip.js +22 -0
- package/esm/cube/CubeConnectedChip.js.map +1 -0
- package/esm/cube/LockStatusChip.d.ts +11 -0
- package/esm/cube/LockStatusChip.js +40 -0
- package/esm/cube/LockStatusChip.js.map +1 -0
- package/esm/cube/UtilizationBar.d.ts +11 -0
- package/esm/cube/UtilizationBar.js +38 -0
- package/esm/cube/UtilizationBar.js.map +1 -0
- package/esm/cube/accessibility.d.ts +48 -0
- package/esm/cube/accessibility.js +242 -0
- package/esm/cube/accessibility.js.map +1 -0
- package/esm/cube/index.d.ts +8 -0
- package/esm/cube/index.js +9 -0
- package/esm/cube/index.js.map +1 -0
- package/esm/data-table/DataTable.d.ts +63 -0
- package/esm/data-table/DataTable.js +124 -0
- package/esm/data-table/DataTable.js.map +1 -0
- package/esm/data-table/DataTableColumnSettings.d.ts +10 -0
- package/esm/data-table/DataTableColumnSettings.js +98 -0
- package/esm/data-table/DataTableColumnSettings.js.map +1 -0
- package/esm/data-table/DataTableHeader.d.ts +2 -0
- package/esm/data-table/DataTableHeader.js +6 -0
- package/esm/data-table/DataTableHeader.js.map +1 -0
- package/esm/data-table/DataTableToolbar.d.ts +2 -0
- package/esm/data-table/DataTableToolbar.js +6 -0
- package/esm/data-table/DataTableToolbar.js.map +1 -0
- package/esm/data-table/index.d.ts +8 -0
- package/esm/data-table/index.js +9 -0
- package/esm/data-table/index.js.map +1 -0
- package/esm/data-table/useDataTableColumnStorage.d.ts +5 -0
- package/esm/data-table/useDataTableColumnStorage.js +20 -0
- package/esm/data-table/useDataTableColumnStorage.js.map +1 -0
- package/esm/data-table/useDataTableStorage.d.ts +16 -0
- package/esm/data-table/useDataTableStorage.js +19 -0
- package/esm/data-table/useDataTableStorage.js.map +1 -0
- package/esm/data-table/useSpringPage.d.ts +6 -0
- package/esm/data-table/useSpringPage.js +18 -0
- package/esm/data-table/useSpringPage.js.map +1 -0
- package/esm/data-table/useSpringPageable.d.ts +9 -0
- package/esm/data-table/useSpringPageable.js +10 -0
- package/esm/data-table/useSpringPageable.js.map +1 -0
- package/esm/date-pickers/PlainAdapterCommon.d.ts +31 -0
- package/esm/date-pickers/PlainAdapterCommon.js +97 -0
- package/esm/date-pickers/PlainAdapterCommon.js.map +1 -0
- package/esm/date-pickers/PlainDateAdapter.d.ts +30 -0
- package/esm/date-pickers/PlainDateAdapter.js +114 -0
- package/esm/date-pickers/PlainDateAdapter.js.map +1 -0
- package/esm/date-pickers/PlainDatePicker.d.ts +21 -0
- package/esm/date-pickers/PlainDatePicker.js +26 -0
- package/esm/date-pickers/PlainDatePicker.js.map +1 -0
- package/esm/date-pickers/PlainDatePicker.spec.d.ts +1 -0
- package/esm/date-pickers/PlainDatePicker.spec.js +15 -0
- package/esm/date-pickers/PlainDatePicker.spec.js.map +1 -0
- package/esm/date-pickers/PlainDateTimeAdapter.d.ts +30 -0
- package/esm/date-pickers/PlainDateTimeAdapter.js +114 -0
- package/esm/date-pickers/PlainDateTimeAdapter.js.map +1 -0
- package/esm/date-pickers/PlainDateTimePicker.d.ts +20 -0
- package/esm/date-pickers/PlainDateTimePicker.js +26 -0
- package/esm/date-pickers/PlainDateTimePicker.js.map +1 -0
- package/esm/date-pickers/PlainDateTimePicker.spec.d.ts +1 -0
- package/esm/date-pickers/PlainDateTimePicker.spec.js +15 -0
- package/esm/date-pickers/PlainDateTimePicker.spec.js.map +1 -0
- package/esm/date-pickers/PlainTimeAdapter.d.ts +58 -0
- package/esm/date-pickers/PlainTimeAdapter.js +194 -0
- package/esm/date-pickers/PlainTimeAdapter.js.map +1 -0
- package/esm/date-pickers/PlainTimePicker.d.ts +16 -0
- package/esm/date-pickers/PlainTimePicker.js +24 -0
- package/esm/date-pickers/PlainTimePicker.js.map +1 -0
- package/esm/date-pickers/PlainTimePicker.spec.d.ts +1 -0
- package/esm/date-pickers/PlainTimePicker.spec.js +15 -0
- package/esm/date-pickers/PlainTimePicker.spec.js.map +1 -0
- package/esm/date-pickers/TemporalAdapter.d.ts +18 -0
- package/esm/date-pickers/TemporalAdapter.js +109 -0
- package/esm/date-pickers/TemporalAdapter.js.map +1 -0
- package/esm/date-pickers/TimezoneSelect.d.ts +9 -0
- package/esm/date-pickers/TimezoneSelect.js +357 -0
- package/esm/date-pickers/TimezoneSelect.js.map +1 -0
- package/esm/date-pickers/getFormatString.d.ts +11 -0
- package/esm/date-pickers/getFormatString.js +26 -0
- package/esm/date-pickers/getFormatString.js.map +1 -0
- package/esm/date-pickers/index.d.ts +5 -0
- package/esm/date-pickers/index.js +6 -0
- package/esm/date-pickers/index.js.map +1 -0
- package/esm/date-pickers/parse.d.ts +4 -0
- package/esm/date-pickers/parse.js +66 -0
- package/esm/date-pickers/parse.js.map +1 -0
- package/esm/date-pickers/timeframe-picker.d.ts +46 -0
- package/esm/date-pickers/timeframe-picker.js +120 -0
- package/esm/date-pickers/timeframe-picker.js.map +1 -0
- package/esm/date-pickers/useLocale.d.ts +1 -0
- package/esm/date-pickers/useLocale.js +6 -0
- package/esm/date-pickers/useLocale.js.map +1 -0
- package/esm/date-pickers/useRenderInput.d.ts +4 -0
- package/esm/date-pickers/useRenderInput.js +8 -0
- package/esm/date-pickers/useRenderInput.js.map +1 -0
- package/esm/fetch.d.ts +51 -0
- package/esm/fetch.js +138 -0
- package/esm/fetch.js.map +1 -0
- package/esm/filter/Filter.d.ts +38 -0
- package/esm/filter/Filter.js +72 -0
- package/esm/filter/Filter.js.map +1 -0
- package/esm/filter/index.d.ts +1 -0
- package/esm/filter/index.js +2 -0
- package/esm/filter/index.js.map +1 -0
- package/esm/formats/CompactFormat.d.ts +22 -0
- package/esm/formats/CompactFormat.js +21 -0
- package/esm/formats/CompactFormat.js.map +1 -0
- package/esm/formats/CompactFormat.spec.d.ts +1 -0
- package/esm/formats/CompactFormat.spec.js +22 -0
- package/esm/formats/CompactFormat.spec.js.map +1 -0
- package/esm/formats/CurrencyFormat.d.ts +39 -0
- package/esm/formats/CurrencyFormat.js +25 -0
- package/esm/formats/CurrencyFormat.js.map +1 -0
- package/esm/formats/CurrencyFormat.spec.d.ts +1 -0
- package/esm/formats/CurrencyFormat.spec.js +22 -0
- package/esm/formats/CurrencyFormat.spec.js.map +1 -0
- package/esm/formats/DecimalFormat.d.ts +29 -0
- package/esm/formats/DecimalFormat.js +22 -0
- package/esm/formats/DecimalFormat.js.map +1 -0
- package/esm/formats/DecimalFormat.spec.d.ts +1 -0
- package/esm/formats/DecimalFormat.spec.js +22 -0
- package/esm/formats/DecimalFormat.spec.js.map +1 -0
- package/esm/formats/DurationFormat.d.ts +23 -0
- package/esm/formats/DurationFormat.js +35 -0
- package/esm/formats/DurationFormat.js.map +1 -0
- package/esm/formats/DurationFormat.spec.d.ts +1 -0
- package/esm/formats/DurationFormat.spec.js +52 -0
- package/esm/formats/DurationFormat.spec.js.map +1 -0
- package/esm/formats/RelativeTemporalFormat.d.ts +22 -0
- package/esm/formats/RelativeTemporalFormat.js +57 -0
- package/esm/formats/RelativeTemporalFormat.js.map +1 -0
- package/esm/formats/RelativeTemporalFormat.spec.d.ts +1 -0
- package/esm/formats/RelativeTemporalFormat.spec.js +77 -0
- package/esm/formats/RelativeTemporalFormat.spec.js.map +1 -0
- package/esm/formats/SwitchableTemporalFormat.d.ts +5 -0
- package/esm/formats/SwitchableTemporalFormat.js +11 -0
- package/esm/formats/SwitchableTemporalFormat.js.map +1 -0
- package/esm/formats/TemporalFormat.d.ts +27 -0
- package/esm/formats/TemporalFormat.js +19 -0
- package/esm/formats/TemporalFormat.js.map +1 -0
- package/esm/formats/TemporalFormat.spec.d.ts +1 -0
- package/esm/formats/TemporalFormat.spec.js +87 -0
- package/esm/formats/TemporalFormat.spec.js.map +1 -0
- package/esm/formats/TemporalRangeFormat.d.ts +30 -0
- package/esm/formats/TemporalRangeFormat.js +17 -0
- package/esm/formats/TemporalRangeFormat.js.map +1 -0
- package/esm/formats/TemporalRangeFormat.spec.d.ts +1 -0
- package/esm/formats/TemporalRangeFormat.spec.js +87 -0
- package/esm/formats/TemporalRangeFormat.spec.js.map +1 -0
- package/esm/formats/index.d.ts +8 -0
- package/esm/formats/index.js +9 -0
- package/esm/formats/index.js.map +1 -0
- package/esm/formats/types.d.ts +2 -0
- package/esm/formats/types.js +2 -0
- package/esm/formats/types.js.map +1 -0
- package/esm/formats/useDateTimeFormat.d.ts +2 -0
- package/esm/formats/useDateTimeFormat.js +7 -0
- package/esm/formats/useDateTimeFormat.js.map +1 -0
- package/esm/formats/useNumberFormat.d.ts +1 -0
- package/esm/formats/useNumberFormat.js +6 -0
- package/esm/formats/useNumberFormat.js.map +1 -0
- package/esm/formats/useRelativeTimeFormat.d.ts +1 -0
- package/esm/formats/useRelativeTimeFormat.js +6 -0
- package/esm/formats/useRelativeTimeFormat.js.map +1 -0
- package/esm/forms/EditForm.d.ts +13 -0
- package/esm/forms/EditForm.js +22 -0
- package/esm/forms/EditForm.js.map +1 -0
- package/esm/forms/SearchForm.d.ts +7 -0
- package/esm/forms/SearchForm.js +36 -0
- package/esm/forms/SearchForm.js.map +1 -0
- package/esm/forms/SubmitButton.d.ts +9 -0
- package/esm/forms/SubmitButton.js +28 -0
- package/esm/forms/SubmitButton.js.map +1 -0
- package/esm/forms/index.d.ts +4 -0
- package/esm/forms/index.js +5 -0
- package/esm/forms/index.js.map +1 -0
- package/esm/forms/useFormSubmit.d.ts +12 -0
- package/esm/forms/useFormSubmit.js +28 -0
- package/esm/forms/useFormSubmit.js.map +1 -0
- package/esm/getNavigatorLanguages.d.ts +5 -0
- package/esm/getNavigatorLanguages.js +11 -0
- package/esm/getNavigatorLanguages.js.map +1 -0
- package/esm/getSupportedFormatLocale.d.ts +19 -0
- package/esm/getSupportedFormatLocale.js +21 -0
- package/esm/getSupportedFormatLocale.js.map +1 -0
- package/esm/help/HelpButton.d.ts +12 -0
- package/esm/help/HelpButton.js +74 -0
- package/esm/help/HelpButton.js.map +1 -0
- package/esm/help/HelpDrawer.d.ts +3 -0
- package/esm/help/HelpDrawer.js +48 -0
- package/esm/help/HelpDrawer.js.map +1 -0
- package/esm/help/HelpSettingsContext.d.ts +26 -0
- package/esm/help/HelpSettingsContext.js +94 -0
- package/esm/help/HelpSettingsContext.js.map +1 -0
- package/esm/help/index.d.ts +3 -0
- package/esm/help/index.js +4 -0
- package/esm/help/index.js.map +1 -0
- package/esm/icons.d.ts +21 -0
- package/esm/icons.js +22 -0
- package/esm/icons.js.map +1 -0
- package/esm/index.d.ts +34 -0
- package/esm/index.js +35 -0
- package/esm/index.js.map +1 -0
- package/esm/layout/ErrorBoundary.d.ts +46 -0
- package/esm/layout/ErrorBoundary.js +186 -0
- package/esm/layout/ErrorBoundary.js.map +1 -0
- package/esm/layout/NotFound.d.ts +9 -0
- package/esm/layout/NotFound.js +26 -0
- package/esm/layout/NotFound.js.map +1 -0
- package/esm/layout/NotFoundSvg.d.ts +2 -0
- package/esm/layout/NotFoundSvg.js +37 -0
- package/esm/layout/NotFoundSvg.js.map +1 -0
- package/esm/layout/UserNav.d.ts +15 -0
- package/esm/layout/UserNav.js +50 -0
- package/esm/layout/UserNav.js.map +1 -0
- package/esm/layout/index.d.ts +5 -0
- package/esm/layout/index.js +6 -0
- package/esm/layout/index.js.map +1 -0
- package/esm/layout/layout-context.d.ts +9 -0
- package/esm/layout/layout-context.js +23 -0
- package/esm/layout/layout-context.js.map +1 -0
- package/esm/layout/page-title.d.ts +7 -0
- package/esm/layout/page-title.js +41 -0
- package/esm/layout/page-title.js.map +1 -0
- package/esm/list/List.d.ts +14 -0
- package/esm/list/List.js +25 -0
- package/esm/list/List.js.map +1 -0
- package/esm/list/SkeletonListItem.d.ts +14 -0
- package/esm/list/SkeletonListItem.js +11 -0
- package/esm/list/SkeletonListItem.js.map +1 -0
- package/esm/list/index.d.ts +1 -0
- package/esm/list/index.js +2 -0
- package/esm/list/index.js.map +1 -0
- package/esm/localization.d.ts +140 -0
- package/esm/localization.js +200 -0
- package/esm/localization.js.map +1 -0
- package/esm/logo/Logo.d.ts +7 -0
- package/esm/logo/Logo.js +29 -0
- package/esm/logo/Logo.js.map +1 -0
- package/esm/logo/VCAppLogo.d.ts +7 -0
- package/esm/logo/VCAppLogo.js +28 -0
- package/esm/logo/VCAppLogo.js.map +1 -0
- package/esm/logo/VCLogo.d.ts +4 -0
- package/esm/logo/VCLogo.js +33 -0
- package/esm/logo/VCLogo.js.map +1 -0
- package/esm/logo/VCLogoIcon.d.ts +4 -0
- package/esm/logo/VCLogoIcon.js +36 -0
- package/esm/logo/VCLogoIcon.js.map +1 -0
- package/esm/logo/index.d.ts +4 -0
- package/esm/logo/index.js +5 -0
- package/esm/logo/index.js.map +1 -0
- package/esm/splash/index.d.ts +3 -0
- package/esm/splash/index.js +37 -0
- package/esm/splash/index.js.map +1 -0
- package/esm/spring.d.ts +14 -0
- package/esm/spring.js +2 -0
- package/esm/spring.js.map +1 -0
- package/esm/storage/MemoryStorage.d.ts +7 -0
- package/esm/storage/MemoryStorage.js +18 -0
- package/esm/storage/MemoryStorage.js.map +1 -0
- package/esm/storage/index.d.ts +2 -0
- package/esm/storage/index.js +3 -0
- package/esm/storage/index.js.map +1 -0
- package/esm/storage/storage.d.ts +16 -0
- package/esm/storage/storage.js +87 -0
- package/esm/storage/storage.js.map +1 -0
- package/esm/storage/useStorage.d.ts +1 -0
- package/esm/storage/useStorage.js +29 -0
- package/esm/storage/useStorage.js.map +1 -0
- package/esm/tabs/Tabs.d.ts +10 -0
- package/esm/tabs/Tabs.js +95 -0
- package/esm/tabs/Tabs.js.map +1 -0
- package/esm/tabs/index.d.ts +1 -0
- package/esm/tabs/index.js +2 -0
- package/esm/tabs/index.js.map +1 -0
- package/esm/temporal/index.d.ts +2 -0
- package/esm/temporal/index.js +3 -0
- package/esm/temporal/index.js.map +1 -0
- package/esm/temporal/parse.d.ts +4 -0
- package/esm/temporal/parse.js +25 -0
- package/esm/temporal/parse.js.map +1 -0
- package/esm/temporal/polyfill.d.ts +34 -0
- package/esm/temporal/polyfill.js +10 -0
- package/esm/temporal/polyfill.js.map +1 -0
- package/esm/utils/defined.d.ts +1 -0
- package/esm/utils/defined.js +4 -0
- package/esm/utils/defined.js.map +1 -0
- package/esm/utils/index.d.ts +3 -0
- package/esm/utils/index.js +4 -0
- package/esm/utils/index.js.map +1 -0
- package/esm/utils/useFlag.d.ts +1 -0
- package/esm/utils/useFlag.js +9 -0
- package/esm/utils/useFlag.js.map +1 -0
- package/esm/utils/useIsMounted.d.ts +1 -0
- package/esm/utils/useIsMounted.js +12 -0
- package/esm/utils/useIsMounted.js.map +1 -0
- package/esm/view/View.d.ts +9 -0
- package/esm/view/View.js +22 -0
- package/esm/view/View.js.map +1 -0
- package/esm/view/ViewHeader.d.ts +10 -0
- package/esm/view/ViewHeader.js +15 -0
- package/esm/view/ViewHeader.js.map +1 -0
- package/esm/view/index.d.ts +2 -0
- package/esm/view/index.js +3 -0
- package/esm/view/index.js.map +1 -0
- package/package.json +72 -0
- package/src/AppShell/AppShell.tsx +165 -0
- package/src/AppShell/index.tsx +1 -0
- package/src/ErrorAlert.tsx +71 -0
- package/src/Input/ActionsMenu.tsx +102 -0
- package/src/Input/Checkbox.tsx +33 -0
- package/src/Input/EmailSenderField.tsx +64 -0
- package/src/Input/NumberField.tsx +127 -0
- package/src/Input/RadioGroup.tsx +37 -0
- package/src/Input/Select.tsx +33 -0
- package/src/Input/Selector.tsx +21 -0
- package/src/Input/Switch.tsx +33 -0
- package/src/Input/TextField.tsx +69 -0
- package/src/Input/UrlUploadField.tsx +84 -0
- package/src/Input/index.ts +9 -0
- package/src/LanguageSwitcher/LanguageSwitcher.tsx +63 -0
- package/src/LanguageSwitcher/index.ts +1 -0
- package/src/Paging/Paging.ts +77 -0
- package/src/Paging/index.ts +1 -0
- package/src/VCThemeProvider/JetbrainsMonoFont.tsx +55 -0
- package/src/VCThemeProvider/RobotoFont.tsx +52 -0
- package/src/VCThemeProvider/ThemeModeSwitcher.tsx +23 -0
- package/src/VCThemeProvider/VCThemeProvider.tsx +232 -0
- package/src/VCThemeProvider/code-colors.ts +34 -0
- package/src/VCThemeProvider/files.d.ts +2 -0
- package/src/VCThemeProvider/index.ts +5 -0
- package/src/audit/AuditChanges.tsx +82 -0
- package/src/audit/AuditTimeline.tsx +25 -0
- package/src/audit/AuditTimelineItem.tsx +75 -0
- package/src/audit/index.ts +4 -0
- package/src/audit/types.ts +46 -0
- package/src/breadcrumbs.tsx +27 -0
- package/src/code/Code.tsx +53 -0
- package/src/code/CodeBlock.tsx +15 -0
- package/src/code/Json.tsx +73 -0
- package/src/code/index.ts +3 -0
- package/src/confirm/ConfirmButton.tsx +69 -0
- package/src/confirm/ConfirmDialog.tsx +68 -0
- package/src/confirm/ConfirmIconButton.tsx +62 -0
- package/src/confirm/ConfirmMenuItem.tsx +66 -0
- package/src/confirm/index.ts +4 -0
- package/src/container/ContainerLayout.tsx +40 -0
- package/src/container/ContainerSettingsContext.tsx +77 -0
- package/src/container/ContainerWidthControl.tsx +20 -0
- package/src/container/index.ts +3 -0
- package/src/content-table/ContentTable.tsx +214 -0
- package/src/content-table/UndrawEmpty.tsx +285 -0
- package/src/content-table/index.ts +1 -0
- package/src/country/countries.ts +268 -0
- package/src/country/country-select.tsx +48 -0
- package/src/country/index.ts +5 -0
- package/src/country/locale-select.tsx +43 -0
- package/src/country/locales.ts +192 -0
- package/src/country/phone-prefix-select.tsx +50 -0
- package/src/cube/BoxFeatures.tsx +91 -0
- package/src/cube/BoxMaintenanceChip.tsx +33 -0
- package/src/cube/BoxNumber.tsx +10 -0
- package/src/cube/BoxType.tsx +22 -0
- package/src/cube/CubeConnectedChip.tsx +16 -0
- package/src/cube/LockStatusChip.tsx +54 -0
- package/src/cube/UtilizationBar.tsx +94 -0
- package/src/cube/accessibility.tsx +422 -0
- package/src/cube/index.tsx +8 -0
- package/src/data-table/DataTable.tsx +338 -0
- package/src/data-table/DataTableColumnSettings.tsx +204 -0
- package/src/data-table/DataTableHeader.tsx +10 -0
- package/src/data-table/DataTableToolbar.tsx +10 -0
- package/src/data-table/index.tsx +8 -0
- package/src/data-table/useDataTableColumnStorage.ts +26 -0
- package/src/data-table/useDataTableStorage.ts +43 -0
- package/src/data-table/useSpringPage.ts +21 -0
- package/src/data-table/useSpringPageable.ts +25 -0
- package/src/date-pickers/PlainAdapterCommon.ts +125 -0
- package/src/date-pickers/PlainDateAdapter.spec.ts +50 -0
- package/src/date-pickers/PlainDateAdapter.ts +139 -0
- package/src/date-pickers/PlainDatePicker.spec.tsx +22 -0
- package/src/date-pickers/PlainDatePicker.tsx +73 -0
- package/src/date-pickers/PlainDateTimeAdapter.spec.ts +50 -0
- package/src/date-pickers/PlainDateTimeAdapter.ts +140 -0
- package/src/date-pickers/PlainDateTimePicker.spec.tsx +22 -0
- package/src/date-pickers/PlainDateTimePicker.tsx +65 -0
- package/src/date-pickers/PlainTimeAdapter.ts +247 -0
- package/src/date-pickers/PlainTimePicker.spec.tsx +22 -0
- package/src/date-pickers/PlainTimePicker.tsx +45 -0
- package/src/date-pickers/TemporalAdapter.ts +150 -0
- package/src/date-pickers/TimezoneSelect.tsx +387 -0
- package/src/date-pickers/getFormatString.ts +38 -0
- package/src/date-pickers/index.ts +5 -0
- package/src/date-pickers/parse.spec.ts +43 -0
- package/src/date-pickers/parse.ts +72 -0
- package/src/date-pickers/timeframe-picker.tsx +202 -0
- package/src/date-pickers/useLocale.ts +6 -0
- package/src/date-pickers/useRenderInput.tsx +20 -0
- package/src/fetch.spec.ts +85 -0
- package/src/fetch.ts +165 -0
- package/src/filter/Filter.tsx +194 -0
- package/src/filter/index.ts +1 -0
- package/src/formats/CompactFormat.spec.tsx +25 -0
- package/src/formats/CompactFormat.tsx +48 -0
- package/src/formats/CurrencyFormat.spec.tsx +25 -0
- package/src/formats/CurrencyFormat.tsx +77 -0
- package/src/formats/DecimalFormat.spec.tsx +25 -0
- package/src/formats/DecimalFormat.tsx +59 -0
- package/src/formats/DurationFormat.spec.tsx +57 -0
- package/src/formats/DurationFormat.tsx +72 -0
- package/src/formats/RelativeTemporalFormat.spec.tsx +84 -0
- package/src/formats/RelativeTemporalFormat.tsx +86 -0
- package/src/formats/SwitchableTemporalFormat.tsx +17 -0
- package/src/formats/TemporalFormat.spec.tsx +110 -0
- package/src/formats/TemporalFormat.tsx +58 -0
- package/src/formats/TemporalRangeFormat.spec.tsx +159 -0
- package/src/formats/TemporalRangeFormat.tsx +62 -0
- package/src/formats/index.ts +8 -0
- package/src/formats/types.ts +4 -0
- package/src/formats/useDateTimeFormat.ts +7 -0
- package/src/formats/useNumberFormat.ts +6 -0
- package/src/formats/useRelativeTimeFormat.ts +6 -0
- package/src/forms/EditForm.tsx +69 -0
- package/src/forms/SearchForm.tsx +51 -0
- package/src/forms/SubmitButton.tsx +34 -0
- package/src/forms/index.ts +4 -0
- package/src/forms/useFormSubmit.tsx +28 -0
- package/src/getNavigatorLanguages.ts +11 -0
- package/src/getSupportedFormatLocale.ts +24 -0
- package/src/help/HelpButton.tsx +134 -0
- package/src/help/HelpDrawer.tsx +65 -0
- package/src/help/HelpSettingsContext.tsx +178 -0
- package/src/help/index.ts +3 -0
- package/src/icons.ts +23 -0
- package/src/index.ts +34 -0
- package/src/layout/ErrorBoundary.tsx +232 -0
- package/src/layout/NotFound.tsx +51 -0
- package/src/layout/NotFoundSvg.tsx +172 -0
- package/src/layout/UserNav.tsx +107 -0
- package/src/layout/index.ts +5 -0
- package/src/layout/layout-context.tsx +40 -0
- package/src/layout/page-title.tsx +33 -0
- package/src/list/List.tsx +40 -0
- package/src/list/SkeletonListItem.tsx +50 -0
- package/src/list/index.tsx +1 -0
- package/src/localization.tsx +404 -0
- package/src/logo/Logo.tsx +35 -0
- package/src/logo/VCAppLogo.tsx +28 -0
- package/src/logo/VCLogo.tsx +56 -0
- package/src/logo/VCLogoIcon.tsx +55 -0
- package/src/logo/V_C_LOGO.svg +1 -0
- package/src/logo/V_C_LOGO_ICON.svg +1 -0
- package/src/logo/V_C_LOGO_ICON_WHITE.svg +1 -0
- package/src/logo/V_C_LOGO_WHITE.svg +1 -0
- package/src/logo/index.tsx +4 -0
- package/src/splash/index.tsx +34 -0
- package/src/splash/template.html +86 -0
- package/src/spring.ts +15 -0
- package/src/storage/MemoryStorage.ts +21 -0
- package/src/storage/index.ts +2 -0
- package/src/storage/storage.ts +97 -0
- package/src/storage/useStorage.ts +35 -0
- package/src/tabs/Tabs.tsx +187 -0
- package/src/tabs/index.ts +1 -0
- package/src/temporal/index.ts +2 -0
- package/src/temporal/parse.ts +29 -0
- package/src/temporal/polyfill.ts +36 -0
- package/src/utils/defined.ts +4 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/useFlag.ts +9 -0
- package/src/utils/useIsMounted.ts +12 -0
- package/src/view/View.tsx +22 -0
- package/src/view/ViewHeader.tsx +35 -0
- package/src/view/index.ts +2 -0
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@variocube/app-ui",
|
|
3
|
+
"version": "1.14.0",
|
|
4
|
+
"description": "Common UI components for Variocube applications.",
|
|
5
|
+
"module": "esm/index.js",
|
|
6
|
+
"types": "esm/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "webpack serve --progress",
|
|
9
|
+
"clean": "rimraf esm/",
|
|
10
|
+
"build": "npm run clean && tsc",
|
|
11
|
+
"test": "npx jest",
|
|
12
|
+
"build:demo": "webpack"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"esm/**/*",
|
|
16
|
+
"src/**/*"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@emotion/react": "11.x",
|
|
20
|
+
"@emotion/styled": "11.x",
|
|
21
|
+
"@mui/icons-material": "5.x",
|
|
22
|
+
"@mui/lab": ">5.0.0-alpha <6",
|
|
23
|
+
"@mui/material": "5.x",
|
|
24
|
+
"@mui/x-date-pickers": ">5.0.0-beta <6",
|
|
25
|
+
"mustache": "4.x",
|
|
26
|
+
"react": "17.x"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@fontsource/jetbrains-mono": "^5.0.18",
|
|
30
|
+
"@js-temporal/polyfill": "0.4.3",
|
|
31
|
+
"deepmerge": "^4.3.0",
|
|
32
|
+
"error-stack-parser": "^2.1.4",
|
|
33
|
+
"json-lexer": "^1.2.0",
|
|
34
|
+
"react-async-hook": "^4.0.0",
|
|
35
|
+
"roboto-fontface": "^0.10.0",
|
|
36
|
+
"semver": "^7.5.4"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@emotion/react": "^11.9.0",
|
|
40
|
+
"@emotion/styled": "^11.8.1",
|
|
41
|
+
"@mui/icons-material": "^5.15.7",
|
|
42
|
+
"@mui/lab": "^5.0.0-alpha.162",
|
|
43
|
+
"@mui/material": "^5.15.7",
|
|
44
|
+
"@mui/x-date-pickers": "^5.0.0-beta.0",
|
|
45
|
+
"@types/jest": "^27.5.1",
|
|
46
|
+
"@types/mustache": "^4.1.2",
|
|
47
|
+
"@types/react-dom": "^17.0.17",
|
|
48
|
+
"@types/react-helmet": "^6.1.11",
|
|
49
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
50
|
+
"@types/react-test-renderer": "^17.0.2",
|
|
51
|
+
"dprint": "^0.46.3",
|
|
52
|
+
"file-loader": "^6.2.0",
|
|
53
|
+
"html-webpack-plugin": "^5.5.0",
|
|
54
|
+
"jest": "^29.7.0",
|
|
55
|
+
"react": "^17.0.2",
|
|
56
|
+
"react-dom": "^17.0.2",
|
|
57
|
+
"react-router": "^6.3.0",
|
|
58
|
+
"react-router-dom": "^6.3.0",
|
|
59
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
60
|
+
"react-test-renderer": "^17.0.2",
|
|
61
|
+
"rimraf": "^3.0.2",
|
|
62
|
+
"ts-jest": "^29.1.2",
|
|
63
|
+
"ts-loader": "^9.5.1",
|
|
64
|
+
"typescript": "^5.3.3",
|
|
65
|
+
"webpack": "^5.73.0",
|
|
66
|
+
"webpack-cli": "^4.10.0",
|
|
67
|
+
"webpack-dev-server": "^4.9.2"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {AppBar, Box, Breakpoint, Drawer, IconButton, useMediaQuery, useTheme} from "@mui/material";
|
|
2
|
+
import React, {PropsWithChildren, useEffect} from "react";
|
|
3
|
+
import {useFlag} from "../utils";
|
|
4
|
+
import {MenuIcon} from "../icons";
|
|
5
|
+
import {LayoutProvider} from "../layout";
|
|
6
|
+
import {VCAppLogo} from "../logo/VCAppLogo";
|
|
7
|
+
|
|
8
|
+
interface AppShellProps {
|
|
9
|
+
appName: string;
|
|
10
|
+
sideNav?: JSX.Element | null | undefined;
|
|
11
|
+
sideNavWidth?: number;
|
|
12
|
+
sideNavFixed?: Breakpoint;
|
|
13
|
+
topNav?: JSX.Element | null | undefined;
|
|
14
|
+
footer?: JSX.Element | null | undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function AppShell(props: PropsWithChildren<AppShellProps>) {
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
children,
|
|
21
|
+
appName,
|
|
22
|
+
sideNav,
|
|
23
|
+
sideNavWidth = 200,
|
|
24
|
+
topNav,
|
|
25
|
+
sideNavFixed = "md",
|
|
26
|
+
footer,
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
const [drawerOpen, setDrawerOpen, clearDrawerOpen, toggleDrawerOpen] = useFlag(false);
|
|
30
|
+
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
|
|
33
|
+
const drawerPermanent = useMediaQuery(theme.breakpoints.up(sideNavFixed));
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (drawerPermanent) {
|
|
36
|
+
setDrawerOpen();
|
|
37
|
+
}
|
|
38
|
+
}, [drawerPermanent]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<LayoutProvider appName={appName}>
|
|
42
|
+
<Box sx={{
|
|
43
|
+
display: "flex",
|
|
44
|
+
flexFlow: "column nowrap",
|
|
45
|
+
"@media screen": {
|
|
46
|
+
height: "100vh",
|
|
47
|
+
overflowY: "scroll"
|
|
48
|
+
},
|
|
49
|
+
"@media print": {
|
|
50
|
+
padding:0,
|
|
51
|
+
margin:0
|
|
52
|
+
}
|
|
53
|
+
}}>
|
|
54
|
+
<AppBar
|
|
55
|
+
elevation={0}
|
|
56
|
+
position="static"
|
|
57
|
+
color="inherit"
|
|
58
|
+
sx={{
|
|
59
|
+
borderBottom: 1,
|
|
60
|
+
borderColor: "divider",
|
|
61
|
+
backgroundColor: "paper.elevation1",
|
|
62
|
+
color: "text.primary",
|
|
63
|
+
displayPrint: "none"
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<Box
|
|
67
|
+
sx={{
|
|
68
|
+
position: "relative",
|
|
69
|
+
display: "flex",
|
|
70
|
+
flexFlow: "row nowrap",
|
|
71
|
+
justifyContent: "space-between",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
px: 2
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
{!drawerPermanent && (
|
|
77
|
+
<IconButton
|
|
78
|
+
edge="start"
|
|
79
|
+
sx={{marginRight: 1}}
|
|
80
|
+
color="inherit"
|
|
81
|
+
aria-label="menu"
|
|
82
|
+
onClick={toggleDrawerOpen}
|
|
83
|
+
disabled={!sideNav}
|
|
84
|
+
size="large"
|
|
85
|
+
>
|
|
86
|
+
<MenuIcon/>
|
|
87
|
+
</IconButton>
|
|
88
|
+
)}
|
|
89
|
+
<VCAppLogo
|
|
90
|
+
appName={drawerPermanent ? appName : undefined}
|
|
91
|
+
sx={{
|
|
92
|
+
py: 1,
|
|
93
|
+
...(!drawerPermanent && {
|
|
94
|
+
position: "absolute",
|
|
95
|
+
top: "50%",
|
|
96
|
+
left: "50%",
|
|
97
|
+
transform: "translate(-50%, -50%)"
|
|
98
|
+
})
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
{topNav}
|
|
102
|
+
{!topNav && <Box/>}
|
|
103
|
+
</Box>
|
|
104
|
+
</AppBar>
|
|
105
|
+
<Box sx={{
|
|
106
|
+
flex: "1 1 auto",
|
|
107
|
+
display: "flex",
|
|
108
|
+
flexFlow: "row nowrap",
|
|
109
|
+
}}>
|
|
110
|
+
{sideNav && (
|
|
111
|
+
<Drawer
|
|
112
|
+
variant={!drawerPermanent ? "temporary" : "permanent"}
|
|
113
|
+
sx={{
|
|
114
|
+
displayPrint: "none",
|
|
115
|
+
[`& .MuiDrawer-paper`]: {
|
|
116
|
+
position: "relative",
|
|
117
|
+
whiteSpace: "nowrap",
|
|
118
|
+
overflowX: "hidden",
|
|
119
|
+
width: sideNavWidth,
|
|
120
|
+
boxSizing: "border-box"
|
|
121
|
+
},
|
|
122
|
+
["& .MuiPaper-elevation0"]: {
|
|
123
|
+
backgroundColor: "paper.elevation1"
|
|
124
|
+
}
|
|
125
|
+
}}
|
|
126
|
+
open={drawerOpen}
|
|
127
|
+
onClick={!drawerPermanent ? clearDrawerOpen : undefined}
|
|
128
|
+
onClose={clearDrawerOpen}
|
|
129
|
+
>
|
|
130
|
+
{!drawerPermanent && (
|
|
131
|
+
<VCAppLogo
|
|
132
|
+
appName={appName}
|
|
133
|
+
sx={{
|
|
134
|
+
px: 2,
|
|
135
|
+
py: 1,
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
139
|
+
{sideNav}
|
|
140
|
+
</Drawer>
|
|
141
|
+
)}
|
|
142
|
+
<Box sx={{
|
|
143
|
+
py: 4,
|
|
144
|
+
flex: 1,
|
|
145
|
+
maxWidth: "100%",
|
|
146
|
+
"@media print": { padding:0, margin:0 }
|
|
147
|
+
}}>
|
|
148
|
+
{children}
|
|
149
|
+
</Box>
|
|
150
|
+
</Box>
|
|
151
|
+
{footer && (
|
|
152
|
+
<Box sx={{
|
|
153
|
+
borderTop: 1,
|
|
154
|
+
borderColor: "divider",
|
|
155
|
+
backgroundColor: theme.palette.background.paper,
|
|
156
|
+
color: "text.primary",
|
|
157
|
+
displayPrint: "none"
|
|
158
|
+
}}>
|
|
159
|
+
{footer}
|
|
160
|
+
</Box>
|
|
161
|
+
)}
|
|
162
|
+
</Box>
|
|
163
|
+
</LayoutProvider>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {AppShell} from "./AppShell";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {Alert, AlertTitle, Typography} from "@mui/material";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import {ForwardedRef} from "react";
|
|
4
|
+
import {ApiError, ProblemJson} from "./fetch";
|
|
5
|
+
import {ErrorIcon} from "./icons";
|
|
6
|
+
|
|
7
|
+
export interface ErrorAlertProps {
|
|
8
|
+
/**
|
|
9
|
+
* The error to display.
|
|
10
|
+
*
|
|
11
|
+
* This can be an API error, JavaScript error, an error message string. If the passed value evaluates to `false`,
|
|
12
|
+
* no error message is displayed.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
error: Partial<ProblemJson> | Error | string | any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ErrorAlert = React.forwardRef(
|
|
19
|
+
({error}: ErrorAlertProps, ref: ForwardedRef<HTMLDivElement>) => {
|
|
20
|
+
if (!error) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const {title, status, detail, type, instance, stack, ...rest} = normalizeError(error);
|
|
24
|
+
return (
|
|
25
|
+
<Alert ref={ref} severity="error" icon={<ErrorIcon />}>
|
|
26
|
+
<AlertTitle>{title}</AlertTitle>
|
|
27
|
+
{detail}
|
|
28
|
+
{status && <Typography component="div" variant="caption">Status: {status}</Typography>}
|
|
29
|
+
{instance && <Typography component="div" variant="caption">Instance: {instance}</Typography>}
|
|
30
|
+
{type && type != "about:blank" && (
|
|
31
|
+
<Typography component="div" variant="caption">Type: {type}</Typography>
|
|
32
|
+
)}
|
|
33
|
+
{Object.entries(rest).map(([key, value]) => (
|
|
34
|
+
<Typography component="div" variant="caption" key={key}>{key}: {value}</Typography>
|
|
35
|
+
))}
|
|
36
|
+
</Alert>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
type NormalizedError =
|
|
42
|
+
// `title` from `ProblemJson` is required
|
|
43
|
+
& Pick<ProblemJson, "title">
|
|
44
|
+
// other properties from `ProblemJson` are optional
|
|
45
|
+
& Partial<ProblemJson>
|
|
46
|
+
// properties from `Error` are optional
|
|
47
|
+
& Partial<Error>;
|
|
48
|
+
|
|
49
|
+
function normalizeError(error: any): NormalizedError {
|
|
50
|
+
if (typeof error == "string") {
|
|
51
|
+
return {
|
|
52
|
+
title: error,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (error instanceof ApiError) {
|
|
56
|
+
return error;
|
|
57
|
+
}
|
|
58
|
+
if (error instanceof Error) {
|
|
59
|
+
return {
|
|
60
|
+
title: error.message,
|
|
61
|
+
type: error.name,
|
|
62
|
+
stack: error.stack,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (typeof error.title != "undefined") {
|
|
66
|
+
return error;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
title: error.toString(),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {Button, ButtonGroup, ButtonPropsSizeOverrides, Menu, MenuItem} from "@mui/material";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import {PropsWithChildren, useState} from "react";
|
|
4
|
+
import {OverridableStringUnion} from "@mui/types";
|
|
5
|
+
import {ExpandMore} from "@mui/icons-material";
|
|
6
|
+
|
|
7
|
+
export interface ActionMenuItem {
|
|
8
|
+
label: string;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ActionsMenuProps {
|
|
13
|
+
actions: ActionMenuItem[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function ActionsMenu(props: ActionsMenuProps) {
|
|
17
|
+
const {actions} = props;
|
|
18
|
+
|
|
19
|
+
if (actions.length == 0) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (actions.length == 1) {
|
|
24
|
+
return <SimpleButton label={actions[0].label} onClick={actions[0].onClick} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<PushButtonWithMenu label={actions[0].label} onClick={actions[0].onClick}>
|
|
29
|
+
{actions.slice(1).map((action, index) => (
|
|
30
|
+
<MenuItem key={index} onClick={action.onClick}>{action.label}</MenuItem>
|
|
31
|
+
))}
|
|
32
|
+
</PushButtonWithMenu>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
interface SimpleButtonProps {
|
|
38
|
+
label: string;
|
|
39
|
+
onClick: () => void;
|
|
40
|
+
primary?: boolean;
|
|
41
|
+
size?: OverridableStringUnion<"small" | "medium" | "large", ButtonPropsSizeOverrides>;
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function SimpleButton({label, onClick, primary, size, loading}: SimpleButtonProps) {
|
|
46
|
+
return (
|
|
47
|
+
<Button
|
|
48
|
+
color={primary ? "primary" : undefined}
|
|
49
|
+
variant={primary ? "contained" : "outlined"}
|
|
50
|
+
size={size}
|
|
51
|
+
disabled={loading}
|
|
52
|
+
onClick={onClick}
|
|
53
|
+
>
|
|
54
|
+
{label}
|
|
55
|
+
</Button>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface PushButtonWithMenuProps extends PropsWithChildren<any> {
|
|
60
|
+
label: string;
|
|
61
|
+
onClick: () => void;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
size?: "small" | "medium" | "large";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function PushButtonWithMenu(props: PushButtonWithMenuProps) {
|
|
67
|
+
const {label, onClick, disabled, size, children} = props;
|
|
68
|
+
|
|
69
|
+
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<React.Fragment>
|
|
73
|
+
<ButtonGroup size={size}>
|
|
74
|
+
<Button variant="outlined" disabled={disabled} onClick={onClick}>{label}</Button>
|
|
75
|
+
<Button
|
|
76
|
+
variant="outlined"
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
size="small"
|
|
79
|
+
onClick={(e) => setAnchorEl(e.currentTarget)}
|
|
80
|
+
>
|
|
81
|
+
<ExpandMore />
|
|
82
|
+
</Button>
|
|
83
|
+
</ButtonGroup>
|
|
84
|
+
{children
|
|
85
|
+
&& (
|
|
86
|
+
<Menu
|
|
87
|
+
open={Boolean(anchorEl)}
|
|
88
|
+
anchorEl={anchorEl}
|
|
89
|
+
onClose={() => setAnchorEl(null)}
|
|
90
|
+
keepMounted
|
|
91
|
+
onClick={() => setAnchorEl(null)}
|
|
92
|
+
anchorOrigin={{vertical: "bottom", horizontal: "center"}}
|
|
93
|
+
transformOrigin={{vertical: "top", horizontal: "center"}}
|
|
94
|
+
>
|
|
95
|
+
{children}
|
|
96
|
+
</Menu>
|
|
97
|
+
)}
|
|
98
|
+
</React.Fragment>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {Checkbox as MuiCheckbox, CheckboxProps as MuiCheckboxProps, FormControlLabel} from "@mui/material";
|
|
2
|
+
import React, {ReactNode, useCallback} from "react";
|
|
3
|
+
|
|
4
|
+
export type CheckboxProps = Omit<MuiCheckboxProps, "onChange" | "value"> & {
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
value?: boolean;
|
|
7
|
+
onChange?: (checked: boolean) => any;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Checkbox = ({label, value, onChange, disabled, className, color, ...props}: CheckboxProps) => {
|
|
12
|
+
const handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
|
|
13
|
+
if (onChange) {
|
|
14
|
+
onChange(e.target.checked);
|
|
15
|
+
}
|
|
16
|
+
}, [onChange]);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<FormControlLabel
|
|
20
|
+
control={
|
|
21
|
+
<MuiCheckbox
|
|
22
|
+
checked={value}
|
|
23
|
+
onChange={handleChange}
|
|
24
|
+
disabled={disabled}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
}
|
|
28
|
+
label={label}
|
|
29
|
+
disabled={disabled}
|
|
30
|
+
className={className}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {TextField, TextFieldProps} from "./TextField";
|
|
3
|
+
import {useState} from "react";
|
|
4
|
+
|
|
5
|
+
export type EmailSenderFieldProps = Omit<TextFieldProps, "onChange"> & {
|
|
6
|
+
onChange?: (value: string, e: React.ChangeEvent<HTMLInputElement>) => any;
|
|
7
|
+
updateValidity?: (valid: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function EmailSenderField({onChange, validate, onBlur, helperText, select, SelectProps, error, updateValidity, ...props}: EmailSenderFieldProps) {
|
|
11
|
+
const [valid, setValid] = useState<boolean>(false);
|
|
12
|
+
|
|
13
|
+
async function validateEmailSender(value: string) {
|
|
14
|
+
let valid = false;
|
|
15
|
+
if(isEmail(value)) {
|
|
16
|
+
const response = await fetch("https://28pdqh9qy3.execute-api.eu-west-1.amazonaws.com/dev/validate-email-sender", {
|
|
17
|
+
method: "POST",
|
|
18
|
+
body: JSON.stringify({
|
|
19
|
+
"email": value
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
if(response.ok) {
|
|
23
|
+
const json = await response.json();
|
|
24
|
+
valid = json.valid;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
setValid(valid);
|
|
28
|
+
if(updateValidity) {
|
|
29
|
+
updateValidity(valid);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function handleChange(value: string, e: React.ChangeEvent<HTMLInputElement>) {
|
|
34
|
+
if (onChange) {
|
|
35
|
+
onChange(value, e);
|
|
36
|
+
}
|
|
37
|
+
validateEmailSender(value);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function handleBlur(e: React.FocusEvent<HTMLInputElement>) {
|
|
41
|
+
const value = e.currentTarget?.value || e.target.value;
|
|
42
|
+
if (onBlur) {
|
|
43
|
+
onBlur(e);
|
|
44
|
+
}
|
|
45
|
+
validateEmailSender(value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<TextField
|
|
50
|
+
{...props}
|
|
51
|
+
onChange={handleChange}
|
|
52
|
+
onBlur={handleBlur}
|
|
53
|
+
error={error || !valid}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function isEmail(email: string): boolean {
|
|
59
|
+
if(!email) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
63
|
+
return re.test(email.toLowerCase());
|
|
64
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {TextField} from "@mui/material";
|
|
2
|
+
import {TextFieldProps} from "@mui/material/TextField/TextField";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {useCallback, useEffect, useMemo, useRef, useState} from "react";
|
|
5
|
+
|
|
6
|
+
export const IntegerNumberFormat = new Intl.NumberFormat("en-US", {
|
|
7
|
+
minimumFractionDigits: 0,
|
|
8
|
+
maximumFractionDigits: 0,
|
|
9
|
+
useGrouping: false,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type NumberFieldProps = TextFieldProps & {
|
|
13
|
+
numberFormat: Intl.NumberFormat;
|
|
14
|
+
numberValue: number | null;
|
|
15
|
+
onChangeNumber: (value: number | null) => void;
|
|
16
|
+
invalidMessage?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export function NumberField(
|
|
20
|
+
{
|
|
21
|
+
numberValue,
|
|
22
|
+
onChangeNumber,
|
|
23
|
+
onChange,
|
|
24
|
+
onFocus,
|
|
25
|
+
onBlur,
|
|
26
|
+
onKeyPress,
|
|
27
|
+
numberFormat,
|
|
28
|
+
invalidMessage,
|
|
29
|
+
helperText,
|
|
30
|
+
...props
|
|
31
|
+
}: NumberFieldProps,
|
|
32
|
+
) {
|
|
33
|
+
const [strValue, setStrValue] = useState("");
|
|
34
|
+
const [error, setError] = useState("");
|
|
35
|
+
const [focus, setFocus] = useState(false);
|
|
36
|
+
const input = useRef<HTMLInputElement | null>(null);
|
|
37
|
+
|
|
38
|
+
// find out decimal separator
|
|
39
|
+
const decimalSeparator = useMemo(() => {
|
|
40
|
+
return numberFormat.format(1.1).replace(/[01]/g, "");
|
|
41
|
+
}, [numberFormat]);
|
|
42
|
+
|
|
43
|
+
// find out thousands separator
|
|
44
|
+
const thousandSeparator = useMemo(() => {
|
|
45
|
+
return numberFormat.format(1111).replace(/[01]/g, "").replace(decimalSeparator, "");
|
|
46
|
+
}, [numberFormat, decimalSeparator]);
|
|
47
|
+
|
|
48
|
+
// restrict key press to chars that can be part of a number
|
|
49
|
+
const handleKeyPress = useCallback((e) => {
|
|
50
|
+
const keyValue = String.fromCharCode(e.charCode);
|
|
51
|
+
if (!keyValue.match(/[\-0-9]/g) && keyValue !== thousandSeparator && keyValue !== decimalSeparator) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
} else {
|
|
54
|
+
onKeyPress && onKeyPress(e);
|
|
55
|
+
}
|
|
56
|
+
}, [onKeyPress, thousandSeparator, decimalSeparator]);
|
|
57
|
+
|
|
58
|
+
// set controlled string value and call onChange with numeric value
|
|
59
|
+
const handleChange = useCallback((e) => {
|
|
60
|
+
const {value} = e.currentTarget;
|
|
61
|
+
setStrValue(value);
|
|
62
|
+
onChangeNumber(value ? parseNumber(value, thousandSeparator, decimalSeparator) : null);
|
|
63
|
+
onChange && onChange(e);
|
|
64
|
+
}, [thousandSeparator, decimalSeparator, onChangeNumber, onChange]);
|
|
65
|
+
|
|
66
|
+
// remember focus
|
|
67
|
+
const handleFocus = useCallback(e => {
|
|
68
|
+
setFocus(true);
|
|
69
|
+
onFocus && onFocus(e);
|
|
70
|
+
}, [onFocus]);
|
|
71
|
+
|
|
72
|
+
// format on blur
|
|
73
|
+
const handleBlur = useCallback((e) => {
|
|
74
|
+
setFocus(false);
|
|
75
|
+
onBlur && onBlur(e);
|
|
76
|
+
}, [onBlur, numberFormat, numberValue]);
|
|
77
|
+
|
|
78
|
+
// format when number value changes and user is not editing
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (!focus) {
|
|
81
|
+
if (numberValue !== null && Number.isFinite(numberValue)) {
|
|
82
|
+
setStrValue(numberFormat.format(numberValue));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, [focus, numberValue]);
|
|
86
|
+
|
|
87
|
+
// set error message when user entered a string that is NaN
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const valid = (numberValue === null || Number.isFinite(numberValue));
|
|
90
|
+
setError(valid ? "" : (invalidMessage || "Invalid number"));
|
|
91
|
+
}, [numberValue, invalidMessage]);
|
|
92
|
+
|
|
93
|
+
// apply error to HTML5 form validation
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (input.current) {
|
|
96
|
+
input.current.setCustomValidity(error);
|
|
97
|
+
}
|
|
98
|
+
}, [error]);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<TextField
|
|
102
|
+
{...props}
|
|
103
|
+
value={strValue}
|
|
104
|
+
inputRef={input}
|
|
105
|
+
error={!!error}
|
|
106
|
+
helperText={error || helperText}
|
|
107
|
+
onFocus={handleFocus}
|
|
108
|
+
onBlur={handleBlur}
|
|
109
|
+
onKeyPress={handleKeyPress}
|
|
110
|
+
onChange={handleChange}
|
|
111
|
+
/>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function parseNumber(value: string, thousandSeparator: string, decimalSeparator: string) {
|
|
116
|
+
if (thousandSeparator) {
|
|
117
|
+
value = replaceAll(value, thousandSeparator, "");
|
|
118
|
+
}
|
|
119
|
+
if (decimalSeparator) {
|
|
120
|
+
value = replaceAll(value, decimalSeparator, ".");
|
|
121
|
+
}
|
|
122
|
+
return Number.parseFloat(value);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function replaceAll(str: string, search: string, replacement: string) {
|
|
126
|
+
return str.split(search).join(replacement);
|
|
127
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl,
|
|
3
|
+
FormControlLabel,
|
|
4
|
+
FormLabel,
|
|
5
|
+
Radio,
|
|
6
|
+
RadioGroup as MuiRadioGroup,
|
|
7
|
+
RadioGroupProps as MuiRadioGroupProps,
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import React, {ReactNode} from "react";
|
|
10
|
+
|
|
11
|
+
interface RadioGroupProps<T extends string> extends Omit<MuiRadioGroupProps, "value" | "onChange" | "children"> {
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
value: T | undefined;
|
|
14
|
+
onChange: (value: T) => any;
|
|
15
|
+
options: ReadonlyArray<T>;
|
|
16
|
+
renderLabel?: (option: T) => ReactNode;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function RadioGroup<T extends string>(props: Readonly<RadioGroupProps<T>>) {
|
|
21
|
+
const {label, value, onChange, options, renderLabel, required, ...radioGroupProps} = props;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<FormControl required={required}>
|
|
25
|
+
{label && <FormLabel>{label}</FormLabel>}
|
|
26
|
+
<MuiRadioGroup value={value} onChange={(_, value) => onChange(value as T)} {...radioGroupProps}>
|
|
27
|
+
{options.map(option => (
|
|
28
|
+
<FormControlLabel
|
|
29
|
+
key={option}
|
|
30
|
+
control={<Radio required={required} value={option} />}
|
|
31
|
+
label={renderLabel ? renderLabel(option) : option}
|
|
32
|
+
/>
|
|
33
|
+
))}
|
|
34
|
+
</MuiRadioGroup>
|
|
35
|
+
</FormControl>
|
|
36
|
+
);
|
|
37
|
+
}
|