@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/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# app-ui
|
|
2
|
+
|
|
3
|
+
Common UI components for Variocube applications.
|
|
4
|
+
|
|
5
|
+
## Demos
|
|
6
|
+
|
|
7
|
+
Check out the demos hosted with GitHub pages: https://variocube.github.io/app-ui
|
|
8
|
+
|
|
9
|
+
## Using the splash screen
|
|
10
|
+
|
|
11
|
+
1. Reference the splash template in your `HtmlWebpackPlugin` options:
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
{
|
|
15
|
+
plugins:
|
|
16
|
+
[
|
|
17
|
+
new HtmlWebPackPlugin({
|
|
18
|
+
filename: "./index.html",
|
|
19
|
+
template: "./node_modules/@variocube/app-ui/src/splash/template.html",
|
|
20
|
+
title: "My splashy app",
|
|
21
|
+
}),
|
|
22
|
+
// ,..other plugins
|
|
23
|
+
];
|
|
24
|
+
// ...other config
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
1. Use the `render` function of `app-ui` instead of the one from `react-dom`:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import {render} from "@variocube/app-ui";
|
|
32
|
+
import * as React from "react";
|
|
33
|
+
import {App} from "./App";
|
|
34
|
+
|
|
35
|
+
render(<App />);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Using local Google Fonts
|
|
39
|
+
|
|
40
|
+
1. Add `VCThemeProvider` or the `RobotoFont` component to your application.
|
|
41
|
+
|
|
42
|
+
2. Configure a loader rule for webfonts in your webpack config:
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
{
|
|
46
|
+
module: {
|
|
47
|
+
rules:
|
|
48
|
+
[
|
|
49
|
+
{
|
|
50
|
+
test: /\.woff(2?)$/,
|
|
51
|
+
type: "asset/resource",
|
|
52
|
+
},
|
|
53
|
+
// ...other rules
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
// ...other config
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Using for local development
|
|
61
|
+
|
|
62
|
+
1. In the project run:
|
|
63
|
+
npm pack
|
|
64
|
+
2. In Consumer Project run:
|
|
65
|
+
npm install ..\app-ui\variocube-app-ui-1.0.0.tgz
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Breakpoint } from "@mui/material";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
interface AppShellProps {
|
|
4
|
+
appName: string;
|
|
5
|
+
sideNav?: JSX.Element | null | undefined;
|
|
6
|
+
sideNavWidth?: number;
|
|
7
|
+
sideNavFixed?: Breakpoint;
|
|
8
|
+
topNav?: JSX.Element | null | undefined;
|
|
9
|
+
footer?: JSX.Element | null | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function AppShell(props: PropsWithChildren<AppShellProps>): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { AppBar, Box, Drawer, IconButton, useMediaQuery, useTheme } from "@mui/material";
|
|
2
|
+
import React, { 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
|
+
export function AppShell(props) {
|
|
8
|
+
const { children, appName, sideNav, sideNavWidth = 200, topNav, sideNavFixed = "md", footer, } = props;
|
|
9
|
+
const [drawerOpen, setDrawerOpen, clearDrawerOpen, toggleDrawerOpen] = useFlag(false);
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const drawerPermanent = useMediaQuery(theme.breakpoints.up(sideNavFixed));
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (drawerPermanent) {
|
|
14
|
+
setDrawerOpen();
|
|
15
|
+
}
|
|
16
|
+
}, [drawerPermanent]);
|
|
17
|
+
return (React.createElement(LayoutProvider, { appName: appName },
|
|
18
|
+
React.createElement(Box, { sx: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexFlow: "column nowrap",
|
|
21
|
+
"@media screen": {
|
|
22
|
+
height: "100vh",
|
|
23
|
+
overflowY: "scroll"
|
|
24
|
+
},
|
|
25
|
+
"@media print": {
|
|
26
|
+
padding: 0,
|
|
27
|
+
margin: 0
|
|
28
|
+
}
|
|
29
|
+
} },
|
|
30
|
+
React.createElement(AppBar, { elevation: 0, position: "static", color: "inherit", sx: {
|
|
31
|
+
borderBottom: 1,
|
|
32
|
+
borderColor: "divider",
|
|
33
|
+
backgroundColor: "paper.elevation1",
|
|
34
|
+
color: "text.primary",
|
|
35
|
+
displayPrint: "none"
|
|
36
|
+
} },
|
|
37
|
+
React.createElement(Box, { sx: {
|
|
38
|
+
position: "relative",
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexFlow: "row nowrap",
|
|
41
|
+
justifyContent: "space-between",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
px: 2
|
|
44
|
+
} },
|
|
45
|
+
!drawerPermanent && (React.createElement(IconButton, { edge: "start", sx: { marginRight: 1 }, color: "inherit", "aria-label": "menu", onClick: toggleDrawerOpen, disabled: !sideNav, size: "large" },
|
|
46
|
+
React.createElement(MenuIcon, null))),
|
|
47
|
+
React.createElement(VCAppLogo, { appName: drawerPermanent ? appName : undefined, sx: Object.assign({ py: 1 }, (!drawerPermanent && {
|
|
48
|
+
position: "absolute",
|
|
49
|
+
top: "50%",
|
|
50
|
+
left: "50%",
|
|
51
|
+
transform: "translate(-50%, -50%)"
|
|
52
|
+
})) }),
|
|
53
|
+
topNav,
|
|
54
|
+
!topNav && React.createElement(Box, null))),
|
|
55
|
+
React.createElement(Box, { sx: {
|
|
56
|
+
flex: "1 1 auto",
|
|
57
|
+
display: "flex",
|
|
58
|
+
flexFlow: "row nowrap",
|
|
59
|
+
} },
|
|
60
|
+
sideNav && (React.createElement(Drawer, { variant: !drawerPermanent ? "temporary" : "permanent", sx: {
|
|
61
|
+
displayPrint: "none",
|
|
62
|
+
[`& .MuiDrawer-paper`]: {
|
|
63
|
+
position: "relative",
|
|
64
|
+
whiteSpace: "nowrap",
|
|
65
|
+
overflowX: "hidden",
|
|
66
|
+
width: sideNavWidth,
|
|
67
|
+
boxSizing: "border-box"
|
|
68
|
+
},
|
|
69
|
+
["& .MuiPaper-elevation0"]: {
|
|
70
|
+
backgroundColor: "paper.elevation1"
|
|
71
|
+
}
|
|
72
|
+
}, open: drawerOpen, onClick: !drawerPermanent ? clearDrawerOpen : undefined, onClose: clearDrawerOpen },
|
|
73
|
+
!drawerPermanent && (React.createElement(VCAppLogo, { appName: appName, sx: {
|
|
74
|
+
px: 2,
|
|
75
|
+
py: 1,
|
|
76
|
+
} })),
|
|
77
|
+
sideNav)),
|
|
78
|
+
React.createElement(Box, { sx: {
|
|
79
|
+
py: 4,
|
|
80
|
+
flex: 1,
|
|
81
|
+
maxWidth: "100%",
|
|
82
|
+
"@media print": { padding: 0, margin: 0 }
|
|
83
|
+
} }, children)),
|
|
84
|
+
footer && (React.createElement(Box, { sx: {
|
|
85
|
+
borderTop: 1,
|
|
86
|
+
borderColor: "divider",
|
|
87
|
+
backgroundColor: theme.palette.background.paper,
|
|
88
|
+
color: "text.primary",
|
|
89
|
+
displayPrint: "none"
|
|
90
|
+
} }, footer)))));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=AppShell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../src/AppShell/AppShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,GAAG,EAAc,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACnG,OAAO,KAAK,EAAE,EAAoB,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AACjC,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAClC,OAAO,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAW5C,MAAM,UAAU,QAAQ,CAAC,KAAuC;IAE5D,MAAM,EACF,QAAQ,EACR,OAAO,EACP,OAAO,EACP,YAAY,GAAG,GAAG,EAClB,MAAM,EACN,YAAY,GAAG,IAAI,EACnB,MAAM,GACT,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEtF,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,eAAe,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1E,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,eAAe,EAAE,CAAC;YAClB,aAAa,EAAE,CAAC;QACpB,CAAC;IACL,CAAC,EAAE,CAAC,eAAe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BACD,SAAS,EAAE,CAAC;oBACZ,WAAW,EAAE,SAAS;oBACtB,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK;oBAC/C,KAAK,EAAE,cAAc;oBACrB,YAAY,EAAE,MAAM;iBAC3B,IACI,MAAM,CACL,CACT,CACC,CACO,CACpB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppShell } from "./AppShell";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AppShell/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ProblemJson } from "./fetch";
|
|
3
|
+
export interface ErrorAlertProps {
|
|
4
|
+
/**
|
|
5
|
+
* The error to display.
|
|
6
|
+
*
|
|
7
|
+
* This can be an API error, JavaScript error, an error message string. If the passed value evaluates to `false`,
|
|
8
|
+
* no error message is displayed.
|
|
9
|
+
*/
|
|
10
|
+
error: Partial<ProblemJson> | Error | string | any;
|
|
11
|
+
}
|
|
12
|
+
export declare const ErrorAlert: React.ForwardRefExoticComponent<ErrorAlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { Alert, AlertTitle, Typography } from "@mui/material";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { ApiError } from "./fetch";
|
|
15
|
+
import { ErrorIcon } from "./icons";
|
|
16
|
+
export const ErrorAlert = React.forwardRef(({ error }, ref) => {
|
|
17
|
+
if (!error) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const _a = normalizeError(error), { title, status, detail, type, instance, stack } = _a, rest = __rest(_a, ["title", "status", "detail", "type", "instance", "stack"]);
|
|
21
|
+
return (React.createElement(Alert, { ref: ref, severity: "error", icon: React.createElement(ErrorIcon, null) },
|
|
22
|
+
React.createElement(AlertTitle, null, title),
|
|
23
|
+
detail,
|
|
24
|
+
status && React.createElement(Typography, { component: "div", variant: "caption" },
|
|
25
|
+
"Status: ",
|
|
26
|
+
status),
|
|
27
|
+
instance && React.createElement(Typography, { component: "div", variant: "caption" },
|
|
28
|
+
"Instance: ",
|
|
29
|
+
instance),
|
|
30
|
+
type && type != "about:blank" && (React.createElement(Typography, { component: "div", variant: "caption" },
|
|
31
|
+
"Type: ",
|
|
32
|
+
type)),
|
|
33
|
+
Object.entries(rest).map(([key, value]) => (React.createElement(Typography, { component: "div", variant: "caption", key: key },
|
|
34
|
+
key,
|
|
35
|
+
": ",
|
|
36
|
+
value)))));
|
|
37
|
+
});
|
|
38
|
+
function normalizeError(error) {
|
|
39
|
+
if (typeof error == "string") {
|
|
40
|
+
return {
|
|
41
|
+
title: error,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (error instanceof ApiError) {
|
|
45
|
+
return error;
|
|
46
|
+
}
|
|
47
|
+
if (error instanceof Error) {
|
|
48
|
+
return {
|
|
49
|
+
title: error.message,
|
|
50
|
+
type: error.name,
|
|
51
|
+
stack: error.stack,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (typeof error.title != "undefined") {
|
|
55
|
+
return error;
|
|
56
|
+
}
|
|
57
|
+
return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AAK,EAAC,OAAO,EAAC,SAAS;;YAAQ,IAAI,CAAc,CACvE;QACA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC3C,oBAAC,UAAU,IAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAC,GAAG,EAAE,GAAG;YAAG,GAAG;;YAAI,KAAK,CAAc,CACnF,CAAC,CACK,CACR,CAAC;AACH,CAAC,CACD,CAAC;AAUF,SAAS,cAAc,CAAC,KAAU;IACjC,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC9B,OAAO;YACN,KAAK,EAAE,KAAK;SACZ,CAAC;IACH,CAAC;IACD,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO;YACN,KAAK,EAAE,KAAK,CAAC,OAAO;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;SAClB,CAAC;IACH,CAAC;IACD,IAAI,OAAO,KAAK,CAAC,KAAK,IAAI,WAAW,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO;QACN,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;KACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ActionMenuItem {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface ActionsMenuProps {
|
|
7
|
+
actions: ActionMenuItem[];
|
|
8
|
+
}
|
|
9
|
+
export declare function ActionsMenu(props: ActionsMenuProps): JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Button, ButtonGroup, Menu, MenuItem } from "@mui/material";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { ExpandMore } from "@mui/icons-material";
|
|
5
|
+
export function ActionsMenu(props) {
|
|
6
|
+
const { actions } = props;
|
|
7
|
+
if (actions.length == 0) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (actions.length == 1) {
|
|
11
|
+
return React.createElement(SimpleButton, { label: actions[0].label, onClick: actions[0].onClick });
|
|
12
|
+
}
|
|
13
|
+
return (React.createElement(PushButtonWithMenu, { label: actions[0].label, onClick: actions[0].onClick }, actions.slice(1).map((action, index) => (React.createElement(MenuItem, { key: index, onClick: action.onClick }, action.label)))));
|
|
14
|
+
}
|
|
15
|
+
function SimpleButton({ label, onClick, primary, size, loading }) {
|
|
16
|
+
return (React.createElement(Button, { color: primary ? "primary" : undefined, variant: primary ? "contained" : "outlined", size: size, disabled: loading, onClick: onClick }, label));
|
|
17
|
+
}
|
|
18
|
+
function PushButtonWithMenu(props) {
|
|
19
|
+
const { label, onClick, disabled, size, children } = props;
|
|
20
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
21
|
+
return (React.createElement(React.Fragment, null,
|
|
22
|
+
React.createElement(ButtonGroup, { size: size },
|
|
23
|
+
React.createElement(Button, { variant: "outlined", disabled: disabled, onClick: onClick }, label),
|
|
24
|
+
React.createElement(Button, { variant: "outlined", disabled: disabled, size: "small", onClick: (e) => setAnchorEl(e.currentTarget) },
|
|
25
|
+
React.createElement(ExpandMore, null))),
|
|
26
|
+
children
|
|
27
|
+
&& (React.createElement(Menu, { open: Boolean(anchorEl), anchorEl: anchorEl, onClose: () => setAnchorEl(null), keepMounted: true, onClick: () => setAnchorEl(null), anchorOrigin: { vertical: "bottom", horizontal: "center" }, transformOrigin: { vertical: "top", horizontal: "center" } }, children))));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ActionsMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AE,QAAQ,EAAC,IAEvD,QAAQ,CACJ,CACR,CACY,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CheckboxProps as MuiCheckboxProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export type CheckboxProps = Omit<MuiCheckboxProps, "onChange" | "value"> & {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
value?: boolean;
|
|
6
|
+
onChange?: (checked: boolean) => any;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const Checkbox: ({ label, value, onChange, disabled, className, color, ...props }: CheckboxProps) => JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { Checkbox as MuiCheckbox, FormControlLabel } from "@mui/material";
|
|
13
|
+
import React, { useCallback } from "react";
|
|
14
|
+
export const Checkbox = (_a) => {
|
|
15
|
+
var { label, value, onChange, disabled, className, color } = _a, props = __rest(_a, ["label", "value", "onChange", "disabled", "className", "color"]);
|
|
16
|
+
const handleChange = useCallback((e) => {
|
|
17
|
+
if (onChange) {
|
|
18
|
+
onChange(e.target.checked);
|
|
19
|
+
}
|
|
20
|
+
}, [onChange]);
|
|
21
|
+
return (React.createElement(FormControlLabel, { control: React.createElement(MuiCheckbox, Object.assign({ checked: value, onChange: handleChange, disabled: disabled }, props)), label: label, disabled: disabled, className: className }));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/Input/Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAC,QAAQ,IAAI,WAAW,EAAqC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC3G,OAAO,KAAK,EAAE,EAAY,WAAW,EAAC,MAAM,OAAO,CAAC;AASpD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAA6E,EAAE,EAAE;QAAjF,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,OAA0B,EAArB,KAAK,cAA7D,gEAA8D,CAAD;IACrF,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAsC,EAAE,EAAE;QAC3E,IAAI,QAAQ,EAAE,CAAC;YACd,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC;IACF,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACN,oBAAC,gBAAgB,IAChB,OAAO,EACN,oBAAC,WAAW,kBACX,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,IACd,KAAK,EACR,EAEH,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,GACnB,CACF,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TextFieldProps } from "./TextField";
|
|
3
|
+
export type EmailSenderFieldProps = Omit<TextFieldProps, "onChange"> & {
|
|
4
|
+
onChange?: (value: string, e: React.ChangeEvent<HTMLInputElement>) => any;
|
|
5
|
+
updateValidity?: (valid: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function EmailSenderField({ onChange, validate, onBlur, helperText, select, SelectProps, error, updateValidity, ...props }: EmailSenderFieldProps): JSX.Element;
|
|
8
|
+
export declare function isEmail(email: string): boolean;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import * as React from "react";
|
|
22
|
+
import { TextField } from "./TextField";
|
|
23
|
+
import { useState } from "react";
|
|
24
|
+
export function EmailSenderField(_a) {
|
|
25
|
+
var { onChange, validate, onBlur, helperText, select, SelectProps, error, updateValidity } = _a, props = __rest(_a, ["onChange", "validate", "onBlur", "helperText", "select", "SelectProps", "error", "updateValidity"]);
|
|
26
|
+
const [valid, setValid] = useState(false);
|
|
27
|
+
function validateEmailSender(value) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
let valid = false;
|
|
30
|
+
if (isEmail(value)) {
|
|
31
|
+
const response = yield fetch("https://28pdqh9qy3.execute-api.eu-west-1.amazonaws.com/dev/validate-email-sender", {
|
|
32
|
+
method: "POST",
|
|
33
|
+
body: JSON.stringify({
|
|
34
|
+
"email": value
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
if (response.ok) {
|
|
38
|
+
const json = yield response.json();
|
|
39
|
+
valid = json.valid;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
setValid(valid);
|
|
43
|
+
if (updateValidity) {
|
|
44
|
+
updateValidity(valid);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function handleChange(value, e) {
|
|
49
|
+
if (onChange) {
|
|
50
|
+
onChange(value, e);
|
|
51
|
+
}
|
|
52
|
+
validateEmailSender(value);
|
|
53
|
+
}
|
|
54
|
+
function handleBlur(e) {
|
|
55
|
+
var _a;
|
|
56
|
+
const value = ((_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.value) || e.target.value;
|
|
57
|
+
if (onBlur) {
|
|
58
|
+
onBlur(e);
|
|
59
|
+
}
|
|
60
|
+
validateEmailSender(value);
|
|
61
|
+
}
|
|
62
|
+
return (React.createElement(TextField, Object.assign({}, props, { onChange: handleChange, onBlur: handleBlur, error: error || !valid })));
|
|
63
|
+
}
|
|
64
|
+
export function isEmail(email) {
|
|
65
|
+
if (!email) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
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,}))$/;
|
|
69
|
+
return re.test(email.toLowerCase());
|
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KAAa,EAAE,CAAsC;QACvE,IAAI,QAAQ,EAAE,CAAC;YACX,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,CAAC;QACD,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS,UAAU,CAAC,CAAqC;;QACrD,MAAM,KAAK,GAAG,CAAA,MAAA,CAAC,CAAC,aAAa,0CAAE,KAAK,KAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QACvD,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;QACD,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CACH,oBAAC,SAAS,oBACF,KAAK,IACT,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,KAAK,IAAI,CAAC,KAAK,IACxB,CACL,CAAC;AACN,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,KAAa;IACjC,IAAG,CAAC,KAAK,EAAE,CAAC;QACR,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,EAAE,GAAG,yJAAyJ,CAAC;IACrK,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextFieldProps } from "@mui/material/TextField/TextField";
|
|
3
|
+
export declare const IntegerNumberFormat: Intl.NumberFormat;
|
|
4
|
+
export type NumberFieldProps = TextFieldProps & {
|
|
5
|
+
numberFormat: Intl.NumberFormat;
|
|
6
|
+
numberValue: number | null;
|
|
7
|
+
onChangeNumber: (value: number | null) => void;
|
|
8
|
+
invalidMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function NumberField({ numberValue, onChangeNumber, onChange, onFocus, onBlur, onKeyPress, numberFormat, invalidMessage, helperText, ...props }: NumberFieldProps): JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { TextField } from "@mui/material";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
15
|
+
export const IntegerNumberFormat = new Intl.NumberFormat("en-US", {
|
|
16
|
+
minimumFractionDigits: 0,
|
|
17
|
+
maximumFractionDigits: 0,
|
|
18
|
+
useGrouping: false,
|
|
19
|
+
});
|
|
20
|
+
export function NumberField(_a) {
|
|
21
|
+
var { numberValue, onChangeNumber, onChange, onFocus, onBlur, onKeyPress, numberFormat, invalidMessage, helperText } = _a, props = __rest(_a, ["numberValue", "onChangeNumber", "onChange", "onFocus", "onBlur", "onKeyPress", "numberFormat", "invalidMessage", "helperText"]);
|
|
22
|
+
const [strValue, setStrValue] = useState("");
|
|
23
|
+
const [error, setError] = useState("");
|
|
24
|
+
const [focus, setFocus] = useState(false);
|
|
25
|
+
const input = useRef(null);
|
|
26
|
+
// find out decimal separator
|
|
27
|
+
const decimalSeparator = useMemo(() => {
|
|
28
|
+
return numberFormat.format(1.1).replace(/[01]/g, "");
|
|
29
|
+
}, [numberFormat]);
|
|
30
|
+
// find out thousands separator
|
|
31
|
+
const thousandSeparator = useMemo(() => {
|
|
32
|
+
return numberFormat.format(1111).replace(/[01]/g, "").replace(decimalSeparator, "");
|
|
33
|
+
}, [numberFormat, decimalSeparator]);
|
|
34
|
+
// restrict key press to chars that can be part of a number
|
|
35
|
+
const handleKeyPress = useCallback((e) => {
|
|
36
|
+
const keyValue = String.fromCharCode(e.charCode);
|
|
37
|
+
if (!keyValue.match(/[\-0-9]/g) && keyValue !== thousandSeparator && keyValue !== decimalSeparator) {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
onKeyPress && onKeyPress(e);
|
|
42
|
+
}
|
|
43
|
+
}, [onKeyPress, thousandSeparator, decimalSeparator]);
|
|
44
|
+
// set controlled string value and call onChange with numeric value
|
|
45
|
+
const handleChange = useCallback((e) => {
|
|
46
|
+
const { value } = e.currentTarget;
|
|
47
|
+
setStrValue(value);
|
|
48
|
+
onChangeNumber(value ? parseNumber(value, thousandSeparator, decimalSeparator) : null);
|
|
49
|
+
onChange && onChange(e);
|
|
50
|
+
}, [thousandSeparator, decimalSeparator, onChangeNumber, onChange]);
|
|
51
|
+
// remember focus
|
|
52
|
+
const handleFocus = useCallback(e => {
|
|
53
|
+
setFocus(true);
|
|
54
|
+
onFocus && onFocus(e);
|
|
55
|
+
}, [onFocus]);
|
|
56
|
+
// format on blur
|
|
57
|
+
const handleBlur = useCallback((e) => {
|
|
58
|
+
setFocus(false);
|
|
59
|
+
onBlur && onBlur(e);
|
|
60
|
+
}, [onBlur, numberFormat, numberValue]);
|
|
61
|
+
// format when number value changes and user is not editing
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!focus) {
|
|
64
|
+
if (numberValue !== null && Number.isFinite(numberValue)) {
|
|
65
|
+
setStrValue(numberFormat.format(numberValue));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, [focus, numberValue]);
|
|
69
|
+
// set error message when user entered a string that is NaN
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
const valid = (numberValue === null || Number.isFinite(numberValue));
|
|
72
|
+
setError(valid ? "" : (invalidMessage || "Invalid number"));
|
|
73
|
+
}, [numberValue, invalidMessage]);
|
|
74
|
+
// apply error to HTML5 form validation
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (input.current) {
|
|
77
|
+
input.current.setCustomValidity(error);
|
|
78
|
+
}
|
|
79
|
+
}, [error]);
|
|
80
|
+
return (React.createElement(TextField, Object.assign({}, props, { value: strValue, inputRef: input, error: !!error, helperText: error || helperText, onFocus: handleFocus, onBlur: handleBlur, onKeyPress: handleKeyPress, onChange: handleChange })));
|
|
81
|
+
}
|
|
82
|
+
function parseNumber(value, thousandSeparator, decimalSeparator) {
|
|
83
|
+
if (thousandSeparator) {
|
|
84
|
+
value = replaceAll(value, thousandSeparator, "");
|
|
85
|
+
}
|
|
86
|
+
if (decimalSeparator) {
|
|
87
|
+
value = replaceAll(value, decimalSeparator, ".");
|
|
88
|
+
}
|
|
89
|
+
return Number.parseFloat(value);
|
|
90
|
+
}
|
|
91
|
+
function replaceAll(str, search, replacement) {
|
|
92
|
+
return str.split(search).join(replacement);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=NumberField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberField.js","sourceRoot":"","sources":["../../src/Input/NumberField.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAExE,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IACjE,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;IACxB,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC;AASH,MAAM,UAAU,WAAW,CAC1B,EAWmB;QAXnB,EACC,WAAW,EACX,cAAc,EACd,QAAQ,EACR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AAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,UAAU,CAAC,GAAW,EAAE,MAAc,EAAE,WAAmB;IACnE,OAAO,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RadioGroupProps as MuiRadioGroupProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
interface RadioGroupProps<T extends string> extends Omit<MuiRadioGroupProps, "value" | "onChange" | "children"> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
value: T | undefined;
|
|
6
|
+
onChange: (value: T) => any;
|
|
7
|
+
options: ReadonlyArray<T>;
|
|
8
|
+
renderLabel?: (option: T) => ReactNode;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function RadioGroup<T extends string>(props: Readonly<RadioGroupProps<T>>): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { FormControl, FormControlLabel, FormLabel, Radio, RadioGroup as MuiRadioGroup, } from "@mui/material";
|
|
13
|
+
import React from "react";
|
|
14
|
+
export function RadioGroup(props) {
|
|
15
|
+
const { label, value, onChange, options, renderLabel, required } = props, radioGroupProps = __rest(props, ["label", "value", "onChange", "options", "renderLabel", "required"]);
|
|
16
|
+
return (React.createElement(FormControl, { required: required },
|
|
17
|
+
label && React.createElement(FormLabel, null, label),
|
|
18
|
+
React.createElement(MuiRadioGroup, Object.assign({ value: value, onChange: (_, value) => onChange(value) }, radioGroupProps), options.map(option => (React.createElement(FormControlLabel, { key: option, control: React.createElement(Radio, { required: required, value: option }), label: renderLabel ? renderLabel(option) : option }))))));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../src/Input/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,UAAU,IAAI,aAAa,GAE3B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAkB,MAAM,OAAO,CAAC;AAWvC,MAAM,UAAU,UAAU,CAAmB,KAAmC;IAC/E,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,KAAwB,KAAK,EAAxB,eAAe,UAAI,KAAK,EAApF,oEAA4E,CAAQ,CAAC;IAE3F,OAAO,CACN,oBAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ;QAC7B,KAAK,IAAI,oBAAC,SAAS,QAAE,KAAK,CAAa;QACxC,oBAAC,aAAa,kBAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAU,CAAC,IAAM,eAAe,GAC5F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACtB,oBAAC,gBAAgB,IAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,oBAAC,KAAK,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAI,EACrD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,GAChD,CACF,CAAC,CACa,CACH,CACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { TextFieldProps } from "./TextField";
|
|
3
|
+
interface SelectProps<T extends string | number> extends Omit<TextFieldProps, "value" | "onChange" | "children"> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
value: T | undefined;
|
|
6
|
+
onChange: (value: T) => any;
|
|
7
|
+
options: ReadonlyArray<T>;
|
|
8
|
+
renderLabel?: (option: T) => ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function Select<T extends string>(props: Readonly<SelectProps<T>>): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { MenuItem } from "@mui/material";
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { TextField } from "./TextField";
|
|
15
|
+
export function Select(props) {
|
|
16
|
+
const { label, value, onChange, options, renderLabel } = props, rest = __rest(props, ["label", "value", "onChange", "options", "renderLabel"]);
|
|
17
|
+
return (React.createElement(TextField, Object.assign({ select: true, label: label, value: value, onChange: (value) => onChange(value) }, rest), options.map(option => (React.createElement(MenuItem, { key: option, value: option }, renderLabel ? renderLabel(option) : option)))));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/Input/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,SAAS,EAAiB,MAAM,aAAa,CAAC;AAUtD,MAAM,UAAU,MAAM,CAAmB,KAA+B;IACvE,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,KAAa,KAAK,EAAb,IAAI,UAAI,KAAK,EAA/D,wDAAuD,CAAQ,CAAC;IACtE,OAAO,CACN,oBAAC,SAAS,kBACT,MAAM,QACN,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAU,CAAC,IACrC,IAAI,GAEP,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACtB,oBAAC,QAAQ,IACR,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,IAEZ,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CACjC,CACX,CAAC,CACS,CACZ,CAAC;AACH,CAAC"}
|