@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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {Now, PlainDate, PlainDateTime} from "../temporal";
|
|
2
|
+
import {Unit} from "@date-io/core/IUtils";
|
|
3
|
+
import {durationToUnit, TemporalAdapter} from "./TemporalAdapter";
|
|
4
|
+
|
|
5
|
+
export class PlainAdapterCommon<T extends PlainDate | PlainDateTime> extends TemporalAdapter<T> {
|
|
6
|
+
|
|
7
|
+
startOfYear(value: T): T {
|
|
8
|
+
return value.with({day: 1, month: 1}) as T;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
endOfYear(value: T): T {
|
|
12
|
+
return value.with({day: 31, month: 12}) as T;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
startOfMonth(value: T): T {
|
|
16
|
+
return value.with({day: 1}) as T;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
endOfMonth(value: T): T {
|
|
20
|
+
return value.add({months: 1})
|
|
21
|
+
.with({day: 1})
|
|
22
|
+
.subtract({days: 1}) as T;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
startOfWeek(value: T): T {
|
|
26
|
+
return value.subtract({days: value.dayOfWeek - 1}) as T;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
endOfWeek(value: T): T {
|
|
30
|
+
return value.add({days: 7 - value.dayOfWeek}) as T;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getNextMonth(value: T): T {
|
|
34
|
+
return value.add({months: 1}) as T;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
getPreviousMonth(value: T): T {
|
|
38
|
+
return value.subtract({months: 1}) as T;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
isBefore(value: T, comparing: T): boolean {
|
|
42
|
+
return PlainDateTime.compare(value, comparing) < 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
isAfter(value: T, comparing: T): boolean {
|
|
46
|
+
return PlainDateTime.compare(value, comparing) > 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
isSameDay(value: T, comparing: T): boolean {
|
|
50
|
+
return PlainDate.compare(value, comparing) == 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
isSameMonth(value: T, comparing: T): boolean {
|
|
54
|
+
return value.toPlainYearMonth().equals(comparing.toPlainYearMonth());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
isSameYear(value: T, comparing: T): boolean {
|
|
58
|
+
return value.year == comparing.year;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
isWithinRange(value: T, [start, end]: [T, T]): boolean {
|
|
62
|
+
return !this.isBefore(value, start) && !this.isAfter(value, end);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
isBeforeDay(value: T, comparing: T): boolean {
|
|
66
|
+
return PlainDate.compare(value, comparing) < 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
isAfterDay(value: T, comparing: T): boolean {
|
|
70
|
+
return PlainDate.compare(value, comparing) > 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
isBeforeYear(value: T, comparing: T): boolean {
|
|
74
|
+
return value.year < comparing.year;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
isAfterYear(value: T, comparing: T): boolean {
|
|
78
|
+
return value.year > comparing.year;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getMonth(value: T): number {
|
|
82
|
+
return value.month;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
getDaysInMonth(value: T): number {
|
|
86
|
+
return value.daysInMonth;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
getYear(value: T): number {
|
|
90
|
+
return value.year;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
getWeekdays(): string[] {
|
|
94
|
+
const today = Now.plainDateISO();
|
|
95
|
+
const startOfWeek = today.subtract({days: today.dayOfWeek - 1});
|
|
96
|
+
return [...Array(7).keys()]
|
|
97
|
+
.map(index => this.formats.weekday.format(startOfWeek.add({days: index})));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
getMonthArray(value: T): T[] {
|
|
101
|
+
return [...Array(12).keys()]
|
|
102
|
+
.map(index => value.with({day: 1, month: index + 1}) as T);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
getWeekArray(date: T): T[][] {
|
|
106
|
+
const start = this.startOfWeek(this.startOfMonth(date));
|
|
107
|
+
const end = this.endOfWeek(this.endOfMonth(date));
|
|
108
|
+
const weeks = (start.until(end).total("days") + 1) / 7;
|
|
109
|
+
return [...Array(weeks).keys()].map(weekIndex => {
|
|
110
|
+
const weekStart = start.add({weeks: weekIndex});
|
|
111
|
+
return [...Array(7).keys()]
|
|
112
|
+
.map(index => weekStart.add({days: index}) as T);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
getYearRange(start: T, end: T): T[] {
|
|
117
|
+
return [...Array(end.year - start.year).keys()]
|
|
118
|
+
.map(yearIndex => start.add({years: yearIndex}) as T);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
getDiff(value: T, comparing: T | string, unit?: Unit) {
|
|
122
|
+
return durationToUnit(value.until(comparing), unit);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {PlainDate} from "../temporal";
|
|
2
|
+
import {PlainDateAdapter} from "./PlainDateAdapter";
|
|
3
|
+
|
|
4
|
+
describe("PlainDateAdapter", () => {
|
|
5
|
+
|
|
6
|
+
const adapter = new PlainDateAdapter({locale: "de"});
|
|
7
|
+
|
|
8
|
+
test("isSameDay", () => {
|
|
9
|
+
expect(adapter.isSameDay(new PlainDate(2022, 5, 30), new PlainDate(2022, 5, 30))).toBe(true);
|
|
10
|
+
expect(adapter.isSameDay(new PlainDate(2022, 4, 30), new PlainDate(2022, 5, 30))).toBe(false);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test("isSameYear", () => {
|
|
14
|
+
expect(adapter.isSameYear(new PlainDate(2022, 5, 30), new PlainDate(2022, 5, 30))).toBe(true);
|
|
15
|
+
expect(adapter.isSameYear(new PlainDate(2022, 4, 30), new PlainDate(2022, 5, 30))).toBe(true);
|
|
16
|
+
expect(adapter.isSameYear(new PlainDate(2020, 4, 30), new PlainDate(2022, 5, 30))).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("startOfWeek", () => {
|
|
20
|
+
const startOfWeek = adapter.startOfWeek(new PlainDate(2022, 5, 31));
|
|
21
|
+
expect(startOfWeek.year).toBe(2022);
|
|
22
|
+
expect(startOfWeek.month).toBe(5);
|
|
23
|
+
expect(startOfWeek.day).toBe(30);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("endOfWeek", () => {
|
|
27
|
+
const startOfWeek = adapter.endOfWeek(new PlainDate(2022, 5, 31));
|
|
28
|
+
expect(startOfWeek.year).toBe(2022);
|
|
29
|
+
expect(startOfWeek.month).toBe(6);
|
|
30
|
+
expect(startOfWeek.day).toBe(5);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("getYearRange", () => {
|
|
34
|
+
const range = adapter.getYearRange(PlainDate.from("2020-05-05"), PlainDate.from("2025-05-05"));
|
|
35
|
+
expect(range).toHaveLength(5);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test("getWeekArray", () => {
|
|
39
|
+
const weekArray = adapter.getWeekArray(new PlainDate(2022, 5, 30));
|
|
40
|
+
expect(weekArray).toHaveLength(6);
|
|
41
|
+
expect(weekArray[0][0].toString()).toBe("2022-04-25"); // monday of first week
|
|
42
|
+
expect(weekArray[5][6].toString()).toBe("2022-06-05"); // sunday of last week
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("getYearRange", () => {
|
|
46
|
+
const yearRange = adapter.getYearRange(new PlainDate(1995, 1, 1), new PlainDate(2020, 1, 1));
|
|
47
|
+
expect(yearRange).toHaveLength(25);
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {MuiPickersAdapter} from "@mui/x-date-pickers/internals";
|
|
2
|
+
import {DateTimeFormat, Now, PlainDate} from "../temporal";
|
|
3
|
+
import {parsePlainDate} from "./parse";
|
|
4
|
+
import {PlainAdapterCommon} from "./PlainAdapterCommon";
|
|
5
|
+
|
|
6
|
+
export class PlainDateAdapter extends PlainAdapterCommon<PlainDate> implements MuiPickersAdapter<PlainDate> {
|
|
7
|
+
lib = "PlainDateAdapter";
|
|
8
|
+
|
|
9
|
+
date(value?: any): PlainDate | null {
|
|
10
|
+
if (value === null) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
if (value === undefined) {
|
|
14
|
+
return Now.plainDateISO();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (value instanceof PlainDate) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (typeof value === "string") {
|
|
22
|
+
try {
|
|
23
|
+
return PlainDate.from(value, {overflow: "reject"});
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return this.parse(value, this.formats.shortDate);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.error("Unexpected value", value);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
toJsDate(value: PlainDate): Date {
|
|
35
|
+
return new Date(value.year, value.month-1, value.day);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
parseISO(isString: string): PlainDate {
|
|
39
|
+
return PlainDate.from(isString);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
parse(value: string, format: string | DateTimeFormat): PlainDate | null {
|
|
43
|
+
try {
|
|
44
|
+
return parsePlainDate(value, format as any as DateTimeFormat);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.warn("Could not parse", {value, format});
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
isValid(value: any): boolean {
|
|
53
|
+
return this.date(value) != null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
isEqual(value: any, comparing: any): boolean {
|
|
57
|
+
const first = this.date(value);
|
|
58
|
+
const second = this.date(comparing);
|
|
59
|
+
if (first === second) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if (!first || !second) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return first.equals(second);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
isSameHour(value: PlainDate, comparing: PlainDate): boolean {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
addSeconds(value: PlainDate, count: number): PlainDate {
|
|
73
|
+
return value.add({seconds: count});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
addMinutes(value: PlainDate, count: number): PlainDate {
|
|
77
|
+
return value.add({minutes: count});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
addHours(value: PlainDate, count: number): PlainDate {
|
|
81
|
+
return value.add({hours: count});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
addDays(value: PlainDate, count: number): PlainDate {
|
|
85
|
+
return value.add({days: count});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
addWeeks(value: PlainDate, count: number): PlainDate {
|
|
89
|
+
return value.add({weeks: count});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
addMonths(value: PlainDate, count: number): PlainDate {
|
|
93
|
+
return value.add({months: count});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
startOfDay(value: PlainDate): PlainDate {
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
endOfDay(value: PlainDate): PlainDate {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
getHours(value: PlainDate): number {
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setHours(value: PlainDate, count: number): PlainDate {
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
getMinutes(value: PlainDate): number {
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
setMinutes(value: PlainDate, count: number): PlainDate {
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
getSeconds(value: PlainDate): number {
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setSeconds(value: PlainDate, count: number): PlainDate {
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
setMonth(value: PlainDate, count: number): PlainDate {
|
|
129
|
+
return value.with({month: count});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
setYear(value: PlainDate, count: number): PlainDate {
|
|
133
|
+
return value.with({year: count});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
mergeDateAndTime(date: PlainDate, time: PlainDate): PlainDate {
|
|
137
|
+
return date;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {PlainDate} from "../temporal";
|
|
2
|
+
import {PlainDatePicker} from "./PlainDatePicker";
|
|
3
|
+
import {act, create, ReactTestRenderer} from "react-test-renderer";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
describe("PlainDatePicker", () => {
|
|
7
|
+
|
|
8
|
+
test("render", () => {
|
|
9
|
+
let element: ReactTestRenderer;
|
|
10
|
+
act(() => {
|
|
11
|
+
element = create(
|
|
12
|
+
<PlainDatePicker
|
|
13
|
+
locale="de"
|
|
14
|
+
value={new PlainDate(2022, 5, 30)}
|
|
15
|
+
onChange={() => {}}
|
|
16
|
+
/>);
|
|
17
|
+
})
|
|
18
|
+
const {value} = element!.root.findByType("input").props;
|
|
19
|
+
expect(value).toBe("30.05.2022");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {DatePicker, LocalizationProvider, PickersDay} from "@mui/x-date-pickers";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import {PlainDate} from "../temporal";
|
|
4
|
+
import {PlainDateAdapter} from "./PlainDateAdapter";
|
|
5
|
+
import {useRenderInput, UseRenderInputProps} from "./useRenderInput";
|
|
6
|
+
import {useLocale} from "./useLocale";
|
|
7
|
+
|
|
8
|
+
interface PlainDatePickerProps {
|
|
9
|
+
value: PlainDate | null;
|
|
10
|
+
onChange: (value: PlainDate | null) => any;
|
|
11
|
+
label?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
|
|
15
|
+
disablePast?: boolean;
|
|
16
|
+
minDate?: PlainDate;
|
|
17
|
+
maxDate?: PlainDate;
|
|
18
|
+
renderDay?: (day: PlainDate, selectedDays: PlainDate[]) => JSX.Element;
|
|
19
|
+
|
|
20
|
+
defaultCalendarMonth?: PlainDate;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Allows overriding the locale. Only use for testing.
|
|
24
|
+
*/
|
|
25
|
+
locale?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function PlainDatePicker(props: PlainDatePickerProps & UseRenderInputProps) {
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
value,
|
|
32
|
+
onChange,
|
|
33
|
+
label,
|
|
34
|
+
disabled,
|
|
35
|
+
disablePast,
|
|
36
|
+
minDate,
|
|
37
|
+
maxDate,
|
|
38
|
+
renderDay,
|
|
39
|
+
defaultCalendarMonth,
|
|
40
|
+
locale: suppliedLocale,
|
|
41
|
+
...renderInputProps
|
|
42
|
+
} = props;
|
|
43
|
+
|
|
44
|
+
const locale = useLocale(suppliedLocale);
|
|
45
|
+
|
|
46
|
+
const renderInput = useRenderInput(renderInputProps);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<LocalizationProvider dateAdapter={PlainDateAdapter} adapterLocale={locale}>
|
|
50
|
+
<DatePicker
|
|
51
|
+
label={label}
|
|
52
|
+
value={value}
|
|
53
|
+
disableMaskedInput
|
|
54
|
+
onChange={onChange}
|
|
55
|
+
disabled={disabled}
|
|
56
|
+
renderInput={renderInput}
|
|
57
|
+
disablePast={disablePast}
|
|
58
|
+
defaultCalendarMonth={defaultCalendarMonth}
|
|
59
|
+
minDate={minDate}
|
|
60
|
+
maxDate={maxDate}
|
|
61
|
+
renderDay={renderDay !== undefined
|
|
62
|
+
? (day, selectedDays, pickersDayProps) => (
|
|
63
|
+
<PickersDay {...pickersDayProps}>
|
|
64
|
+
{renderDay(day, selectedDays)}
|
|
65
|
+
</PickersDay>
|
|
66
|
+
)
|
|
67
|
+
: undefined
|
|
68
|
+
}
|
|
69
|
+
/>
|
|
70
|
+
</LocalizationProvider>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {PlainDateTime} from "../temporal";
|
|
2
|
+
import {PlainDateTimeAdapter} from "./PlainDateTimeAdapter";
|
|
3
|
+
|
|
4
|
+
describe("PlainDateTimeAdapter", () => {
|
|
5
|
+
|
|
6
|
+
const adapter = new PlainDateTimeAdapter({locale: "de"});
|
|
7
|
+
|
|
8
|
+
test("isSameDay", () => {
|
|
9
|
+
expect(adapter.isSameDay(new PlainDateTime(2022, 5, 30), new PlainDateTime(2022, 5, 30))).toBe(true);
|
|
10
|
+
expect(adapter.isSameDay(new PlainDateTime(2022, 4, 30), new PlainDateTime(2022, 5, 30))).toBe(false);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test("isSameYear", () => {
|
|
14
|
+
expect(adapter.isSameYear(new PlainDateTime(2022, 5, 30), new PlainDateTime(2022, 5, 30))).toBe(true);
|
|
15
|
+
expect(adapter.isSameYear(new PlainDateTime(2022, 4, 30), new PlainDateTime(2022, 5, 30))).toBe(true);
|
|
16
|
+
expect(adapter.isSameYear(new PlainDateTime(2020, 4, 30), new PlainDateTime(2022, 5, 30))).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("startOfWeek", () => {
|
|
20
|
+
const startOfWeek = adapter.startOfWeek(new PlainDateTime(2022, 5, 31));
|
|
21
|
+
expect(startOfWeek.year).toBe(2022);
|
|
22
|
+
expect(startOfWeek.month).toBe(5);
|
|
23
|
+
expect(startOfWeek.day).toBe(30);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("endOfWeek", () => {
|
|
27
|
+
const startOfWeek = adapter.endOfWeek(new PlainDateTime(2022, 5, 31));
|
|
28
|
+
expect(startOfWeek.year).toBe(2022);
|
|
29
|
+
expect(startOfWeek.month).toBe(6);
|
|
30
|
+
expect(startOfWeek.day).toBe(5);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("getYearRange", () => {
|
|
34
|
+
const range = adapter.getYearRange(PlainDateTime.from("2020-05-05"), PlainDateTime.from("2025-05-05"));
|
|
35
|
+
expect(range).toHaveLength(5);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test("getWeekArray", () => {
|
|
39
|
+
const weekArray = adapter.getWeekArray(new PlainDateTime(2022, 5, 30));
|
|
40
|
+
expect(weekArray).toHaveLength(6);
|
|
41
|
+
expect(weekArray[0][0].toString()).toBe("2022-04-25T00:00:00"); // monday of first week
|
|
42
|
+
expect(weekArray[5][6].toString()).toBe("2022-06-05T00:00:00"); // sunday of last week
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("getYearRange", () => {
|
|
46
|
+
const yearRange = adapter.getYearRange(new PlainDateTime(1995, 1, 1), new PlainDateTime(2020, 1, 1));
|
|
47
|
+
expect(yearRange).toHaveLength(25);
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
});
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {MuiPickersAdapter} from "@mui/x-date-pickers/internals";
|
|
2
|
+
import {DateTimeFormat, Now, PlainDateTime} from "../temporal";
|
|
3
|
+
import {parsePlainDateTime} from "./parse";
|
|
4
|
+
import {PlainAdapterCommon} from "./PlainAdapterCommon";
|
|
5
|
+
|
|
6
|
+
export class PlainDateTimeAdapter extends PlainAdapterCommon<PlainDateTime> implements MuiPickersAdapter<PlainDateTime> {
|
|
7
|
+
lib = "PlainDateTimeAdapter";
|
|
8
|
+
|
|
9
|
+
date(value?: any): PlainDateTime | null {
|
|
10
|
+
if (value === null) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
if (value === undefined) {
|
|
14
|
+
return Now.plainDateTimeISO();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (value instanceof PlainDateTime) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (typeof value === "string") {
|
|
22
|
+
try {
|
|
23
|
+
return PlainDateTime.from(value, {overflow: "reject"});
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return this.parse(value, this.formats.shortDate);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.error("Unexpected value", value);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
toJsDate(value: PlainDateTime): Date {
|
|
35
|
+
return new Date(value.year, value.month-1, value.day, value.hour, value.minute, value.second, value.millisecond);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
parseISO(isString: string): PlainDateTime {
|
|
39
|
+
return PlainDateTime.from(isString);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
parse(value: string, format: string | DateTimeFormat): PlainDateTime | null {
|
|
43
|
+
try {
|
|
44
|
+
return parsePlainDateTime(value, format as any as DateTimeFormat);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.warn("Could not parse", {value, format});
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
isValid(value: any): boolean {
|
|
53
|
+
return this.date(value) != null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
isEqual(value: any, comparing: any): boolean {
|
|
57
|
+
const first = this.date(value);
|
|
58
|
+
const second = this.date(comparing);
|
|
59
|
+
if (first === second) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if (!first || !second) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return first.equals(second);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
isSameHour(value: PlainDateTime, comparing: PlainDateTime): boolean {
|
|
69
|
+
return this.isSameDay(value, comparing) && value.hour == comparing.hour;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
startOfDay(value: PlainDateTime): PlainDateTime {
|
|
73
|
+
return value.toPlainDate().toPlainDateTime({hour: 0});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
endOfDay(value: PlainDateTime): PlainDateTime {
|
|
77
|
+
return value.toPlainDate().toPlainDateTime({hour: 23, minute: 59, second: 59});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
getHours(value: PlainDateTime): number {
|
|
81
|
+
return value.hour;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
setHours(value: PlainDateTime, count: number): PlainDateTime {
|
|
85
|
+
return value.with({hour: count});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
getMinutes(value: PlainDateTime): number {
|
|
89
|
+
return value.minute;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
setMinutes(value: PlainDateTime, count: number): PlainDateTime {
|
|
93
|
+
return value.with({minute: count});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
getSeconds(value: PlainDateTime): number {
|
|
97
|
+
return value.second;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
setSeconds(value: PlainDateTime, count: number): PlainDateTime {
|
|
101
|
+
return value.with({second: count});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
setMonth(value: PlainDateTime, count: number): PlainDateTime {
|
|
105
|
+
return value.with({month: count});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setYear(value: PlainDateTime, count: number): PlainDateTime {
|
|
109
|
+
return value.with({year: count});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
mergeDateAndTime(date: PlainDateTime, time: PlainDateTime): PlainDateTime {
|
|
113
|
+
return date.toPlainDate().toPlainDateTime(time);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
addSeconds(value: PlainDateTime, count: number): PlainDateTime {
|
|
117
|
+
return value.add({seconds: count});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
addMinutes(value: PlainDateTime, count: number): PlainDateTime {
|
|
121
|
+
return value.add({minutes: count});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
addHours(value: PlainDateTime, count: number): PlainDateTime {
|
|
125
|
+
return value.add({hours: count});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
addDays(value: PlainDateTime, count: number): PlainDateTime {
|
|
129
|
+
return value.add({days: count});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
addWeeks(value: PlainDateTime, count: number): PlainDateTime {
|
|
133
|
+
return value.add({weeks: count});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
addMonths(value: PlainDateTime, count: number): PlainDateTime {
|
|
137
|
+
return value.add({months: count});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {PlainDateTime} from "../temporal";
|
|
2
|
+
import {act, create, ReactTestRenderer} from "react-test-renderer";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {PlainDateTimePicker} from "./PlainDateTimePicker";
|
|
5
|
+
|
|
6
|
+
describe("PlainDateTimePicker", () => {
|
|
7
|
+
|
|
8
|
+
test("render", () => {
|
|
9
|
+
let element: ReactTestRenderer;
|
|
10
|
+
act(() => {
|
|
11
|
+
element = create(
|
|
12
|
+
<PlainDateTimePicker
|
|
13
|
+
locale="de"
|
|
14
|
+
value={new PlainDateTime(2022, 5, 30, 22, 33)}
|
|
15
|
+
onChange={() => {}}
|
|
16
|
+
/>);
|
|
17
|
+
})
|
|
18
|
+
const {value} = element!.root.findByType("input").props;
|
|
19
|
+
expect(value).toBe("30.05.2022, 22:33");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {PlainDateTime} from "../temporal";
|
|
2
|
+
import {useLocale} from "./useLocale";
|
|
3
|
+
import {useRenderInput, UseRenderInputProps} from "./useRenderInput";
|
|
4
|
+
import {DateTimePicker, LocalizationProvider, PickersDay} from "@mui/x-date-pickers";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import {PlainDateTimeAdapter} from "./PlainDateTimeAdapter";
|
|
7
|
+
|
|
8
|
+
interface PlainDateTimePickerProps {
|
|
9
|
+
value: PlainDateTime | null;
|
|
10
|
+
onChange: (value: PlainDateTime | null) => any;
|
|
11
|
+
label?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
|
|
15
|
+
disablePast?: boolean;
|
|
16
|
+
minDateTime?: PlainDateTime;
|
|
17
|
+
maxDateTime?: PlainDateTime;
|
|
18
|
+
renderDay?: (day: PlainDateTime, selectedDays: PlainDateTime[]) => JSX.Element;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Allows overriding the locale. Only use for testing.
|
|
22
|
+
*/
|
|
23
|
+
locale?: string;
|
|
24
|
+
}
|
|
25
|
+
export function PlainDateTimePicker(props: PlainDateTimePickerProps & UseRenderInputProps) {
|
|
26
|
+
const {
|
|
27
|
+
value,
|
|
28
|
+
onChange,
|
|
29
|
+
label,
|
|
30
|
+
disabled,
|
|
31
|
+
disablePast,
|
|
32
|
+
minDateTime,
|
|
33
|
+
maxDateTime,
|
|
34
|
+
renderDay,
|
|
35
|
+
locale: suppliedLocale,
|
|
36
|
+
...renderInputProps
|
|
37
|
+
} = props;
|
|
38
|
+
|
|
39
|
+
const locale = useLocale(suppliedLocale);
|
|
40
|
+
const renderInput = useRenderInput(renderInputProps);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<LocalizationProvider dateAdapter={PlainDateTimeAdapter} adapterLocale={locale}>
|
|
44
|
+
<DateTimePicker
|
|
45
|
+
label={label}
|
|
46
|
+
value={value}
|
|
47
|
+
disableMaskedInput
|
|
48
|
+
onChange={onChange}
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
renderInput={renderInput}
|
|
51
|
+
disablePast={disablePast}
|
|
52
|
+
minDateTime={minDateTime}
|
|
53
|
+
maxDateTime={maxDateTime}
|
|
54
|
+
renderDay={renderDay !== undefined
|
|
55
|
+
? (day, selectedDays, pickersDayProps) => (
|
|
56
|
+
<PickersDay {...pickersDayProps}>
|
|
57
|
+
{renderDay(day, selectedDays)}
|
|
58
|
+
</PickersDay>
|
|
59
|
+
)
|
|
60
|
+
: undefined
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
</LocalizationProvider>
|
|
64
|
+
);
|
|
65
|
+
}
|