@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,87 @@
|
|
|
1
|
+
import { act, create } from "react-test-renderer";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Instant, PlainDate, PlainDateTime, PlainTime, ZonedDateTime } from "../temporal";
|
|
4
|
+
import { TemporalFormat } from "./TemporalFormat";
|
|
5
|
+
describe("TemporalFormat", () => {
|
|
6
|
+
test("PlainDate de-AT", () => {
|
|
7
|
+
let element;
|
|
8
|
+
act(() => {
|
|
9
|
+
element = create(React.createElement(TemporalFormat, { value: PlainDate.from("2022-06-22"), locale: "de-AT" }));
|
|
10
|
+
});
|
|
11
|
+
const value = element.root.children[0];
|
|
12
|
+
expect(value).toBe("22.6.2022");
|
|
13
|
+
});
|
|
14
|
+
test("PlainDate en-US", () => {
|
|
15
|
+
let element;
|
|
16
|
+
act(() => {
|
|
17
|
+
element = create(React.createElement(TemporalFormat, { value: PlainDate.from("2022-06-22"), locale: "en-US" }));
|
|
18
|
+
});
|
|
19
|
+
const value = element.root.children[0];
|
|
20
|
+
expect(value).toBe("6/22/2022");
|
|
21
|
+
});
|
|
22
|
+
test("PlainDateTime de-AT", () => {
|
|
23
|
+
let element;
|
|
24
|
+
act(() => {
|
|
25
|
+
element = create(React.createElement(TemporalFormat, { value: PlainDateTime.from("2022-06-22T14:22"), locale: "de-AT" }));
|
|
26
|
+
});
|
|
27
|
+
const value = element.root.children[0];
|
|
28
|
+
expect(value).toBe("22.6.2022, 14:22:00");
|
|
29
|
+
});
|
|
30
|
+
test("PlainDateTime en-US", () => {
|
|
31
|
+
let element;
|
|
32
|
+
act(() => {
|
|
33
|
+
element = create(React.createElement(TemporalFormat, { value: PlainDateTime.from("2022-06-22T14:22"), locale: "en-US" }));
|
|
34
|
+
});
|
|
35
|
+
const value = element.root.children[0];
|
|
36
|
+
expect(value).toBe("6/22/2022, 2:22:00 PM");
|
|
37
|
+
});
|
|
38
|
+
test("PlainTime de-AT", () => {
|
|
39
|
+
let element;
|
|
40
|
+
act(() => {
|
|
41
|
+
element = create(React.createElement(TemporalFormat, { value: PlainTime.from({ hour: 14, minute: 22 }), locale: "de-AT" }));
|
|
42
|
+
});
|
|
43
|
+
const value = element.root.children[0];
|
|
44
|
+
expect(value).toBe("14:22:00");
|
|
45
|
+
});
|
|
46
|
+
test("PlainTime en-US", () => {
|
|
47
|
+
let element;
|
|
48
|
+
act(() => {
|
|
49
|
+
element = create(React.createElement(TemporalFormat, { value: PlainTime.from({ hour: 14, minute: 22 }), locale: "en-US" }));
|
|
50
|
+
});
|
|
51
|
+
const value = element.root.children[0];
|
|
52
|
+
expect(value).toBe("2:22:00 PM");
|
|
53
|
+
});
|
|
54
|
+
test("ZonedDateTime de-AT", () => {
|
|
55
|
+
let element;
|
|
56
|
+
act(() => {
|
|
57
|
+
element = create(React.createElement(TemporalFormat, { value: ZonedDateTime.from("2022-06-22T14:22[MET]"), locale: "de-AT" }));
|
|
58
|
+
});
|
|
59
|
+
const value = element.root.children[0];
|
|
60
|
+
expect(value).toBe("22.6.2022, 14:22:00 GMT+2");
|
|
61
|
+
});
|
|
62
|
+
test("ZonedDateTime en-US", () => {
|
|
63
|
+
let element;
|
|
64
|
+
act(() => {
|
|
65
|
+
element = create(React.createElement(TemporalFormat, { value: ZonedDateTime.from("2022-06-22T14:22[MET]"), locale: "en-US" }));
|
|
66
|
+
});
|
|
67
|
+
const value = element.root.children[0];
|
|
68
|
+
expect(value).toBe("6/22/2022, 2:22:00 PM GMT+2");
|
|
69
|
+
});
|
|
70
|
+
test("Instant de-AT", () => {
|
|
71
|
+
let element;
|
|
72
|
+
act(() => {
|
|
73
|
+
element = create(React.createElement(TemporalFormat, { value: Instant.from("2022-06-22T14:22:11Z"), timeZone: "Europe/Vienna", locale: "de-AT" }));
|
|
74
|
+
});
|
|
75
|
+
const value = element.root.children[0];
|
|
76
|
+
expect(value).toBe("22.6.2022, 16:22:11");
|
|
77
|
+
});
|
|
78
|
+
test("Instant en-US", () => {
|
|
79
|
+
let element;
|
|
80
|
+
act(() => {
|
|
81
|
+
element = create(React.createElement(TemporalFormat, { value: Instant.from("2022-06-22T14:22:11Z"), locale: "en-US", timeZone: "UTC" }));
|
|
82
|
+
});
|
|
83
|
+
const value = element.root.children[0];
|
|
84
|
+
expect(value).toBe("6/22/2022, 2:22:11 PM");
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=TemporalFormat.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemporalFormat.spec.js","sourceRoot":"","sources":["../../src/formats/TemporalFormat.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,aAAa,CAAC;AACxF,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,QAAQ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C/B,GAAG,CAAC,GAAG,EAAE;YACL,OAAO,GAAG,MAAM,CACZ,oBAAC,cAAc,IACX,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAC3C,QAAQ,EAAC,eAAe,EACxB,MAAM,EAAC,OAAO,GAChB,CACL,CAAC;QACN,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,OAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,IAAI,OAA0B,CAAC;QAC/B,GAAG,CAAC,GAAG,EAAE;YACL,OAAO,GAAG,MAAM,CACZ,oBAAC,cAAc,IACX,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAC3C,MAAM,EAAC,OAAO,EACd,QAAQ,EAAC,KAAK,GAChB,CACL,CAAC;QACN,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,OAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Formattable } from "../temporal";
|
|
3
|
+
import { DateStyle, TimeStyle } from "./types";
|
|
4
|
+
export interface TemporalRangeFormatProps {
|
|
5
|
+
/**
|
|
6
|
+
* The beginning of the temporal range.
|
|
7
|
+
*/
|
|
8
|
+
from: Formattable;
|
|
9
|
+
/**
|
|
10
|
+
* The end of the temporal range.
|
|
11
|
+
*/
|
|
12
|
+
until: Formattable;
|
|
13
|
+
/**
|
|
14
|
+
* The style of the date format.
|
|
15
|
+
*/
|
|
16
|
+
dateStyle?: DateStyle | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The style of the time format.
|
|
19
|
+
*/
|
|
20
|
+
timeStyle?: TimeStyle | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Overrides the user's locale. Use for testing only.
|
|
23
|
+
*/
|
|
24
|
+
locale?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Overrides the user's time zone. Use for testing only.
|
|
27
|
+
*/
|
|
28
|
+
timeZone?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function TemporalRangeFormat(props: TemporalRangeFormatProps): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useDateTimeFormat } from "./useDateTimeFormat";
|
|
2
|
+
import { Fragment, useMemo } from "react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export function TemporalRangeFormat(props) {
|
|
5
|
+
const { from, until, dateStyle, timeStyle, locale, timeZone, } = props;
|
|
6
|
+
const options = useMemo(() => ({
|
|
7
|
+
dateStyle,
|
|
8
|
+
timeStyle,
|
|
9
|
+
timeZone,
|
|
10
|
+
}), [dateStyle, timeStyle]);
|
|
11
|
+
const dateTimeFormat = useDateTimeFormat(options, locale);
|
|
12
|
+
const str = useMemo(() => {
|
|
13
|
+
return dateTimeFormat.formatRange(from, until);
|
|
14
|
+
}, [dateTimeFormat, from, until]);
|
|
15
|
+
return React.createElement(Fragment, null, str);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=TemporalRangeFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemporalRangeFormat.js","sourceRoot":"","sources":["../../src/formats/TemporalRangeFormat.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmC/B,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IAC/D,MAAM,EACF,IAAI,EACJ,KAAK,EACL,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,GACX,GAAG,KAAK,CAAC;IAEV,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS;QACT,SAAS;QACT,QAAQ;KACX,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAE5B,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAE1D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;QACrB,OAAO,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAElC,OAAO,oBAAC,QAAQ,QAAE,GAAG,CAAY,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { act, create } from "react-test-renderer";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Instant, PlainDate, PlainDateTime, PlainTime, ZonedDateTime } from "../temporal";
|
|
4
|
+
import { TemporalRangeFormat } from "./TemporalRangeFormat";
|
|
5
|
+
describe("TemporalRangeFormat", () => {
|
|
6
|
+
test("PlainDate de-AT", () => {
|
|
7
|
+
let element;
|
|
8
|
+
act(() => {
|
|
9
|
+
element = create(React.createElement(TemporalRangeFormat, { from: PlainDate.from("2022-06-22"), until: PlainDate.from("2022-06-30"), locale: "de-AT" }));
|
|
10
|
+
});
|
|
11
|
+
const value = element.root.children[0];
|
|
12
|
+
expect(value).toBe("22.–30.06.2022");
|
|
13
|
+
});
|
|
14
|
+
test("PlainDate en-US", () => {
|
|
15
|
+
let element;
|
|
16
|
+
act(() => {
|
|
17
|
+
element = create(React.createElement(TemporalRangeFormat, { from: PlainDate.from("2022-06-22"), until: PlainDate.from("2022-06-30"), locale: "en-US" }));
|
|
18
|
+
});
|
|
19
|
+
const value = element.root.children[0];
|
|
20
|
+
expect(value).toBe("6/22/2022 – 6/30/2022");
|
|
21
|
+
});
|
|
22
|
+
test("PlainDateTime de-AT", () => {
|
|
23
|
+
let element;
|
|
24
|
+
act(() => {
|
|
25
|
+
element = create(React.createElement(TemporalRangeFormat, { from: PlainDateTime.from("2022-06-22T14:22"), until: PlainDateTime.from("2022-06-22T17:55"), locale: "de-AT" }));
|
|
26
|
+
});
|
|
27
|
+
const value = element.root.children[0];
|
|
28
|
+
expect(value).toBe("22.6.2022, 14:22:00 – 17:55:00");
|
|
29
|
+
});
|
|
30
|
+
test("PlainDateTime en-US", () => {
|
|
31
|
+
let element;
|
|
32
|
+
act(() => {
|
|
33
|
+
element = create(React.createElement(TemporalRangeFormat, { from: PlainDateTime.from("2022-06-22T14:22"), until: PlainDateTime.from("2022-06-22T17:55"), locale: "en-US" }));
|
|
34
|
+
});
|
|
35
|
+
const value = element.root.children[0];
|
|
36
|
+
expect(value).toBe("6/22/2022, 2:22:00 PM – 5:55:00 PM");
|
|
37
|
+
});
|
|
38
|
+
test("PlainTime de-AT", () => {
|
|
39
|
+
let element;
|
|
40
|
+
act(() => {
|
|
41
|
+
element = create(React.createElement(TemporalRangeFormat, { from: PlainTime.from({ hour: 14, minute: 22 }), until: PlainTime.from({ hour: 18, minute: 0, second: 3 }), locale: "de-AT" }));
|
|
42
|
+
});
|
|
43
|
+
const value = element.root.children[0];
|
|
44
|
+
expect(value).toBe("14:22:00 – 18:00:03");
|
|
45
|
+
});
|
|
46
|
+
test("PlainTime en-US", () => {
|
|
47
|
+
let element;
|
|
48
|
+
act(() => {
|
|
49
|
+
element = create(React.createElement(TemporalRangeFormat, { from: PlainTime.from({ hour: 14, minute: 22 }), until: PlainTime.from({ hour: 18, minute: 0, second: 3 }), locale: "en-US" }));
|
|
50
|
+
});
|
|
51
|
+
const value = element.root.children[0];
|
|
52
|
+
expect(value).toBe("2:22:00 PM – 6:00:03 PM");
|
|
53
|
+
});
|
|
54
|
+
test("ZonedDateTime de-AT", () => {
|
|
55
|
+
let element;
|
|
56
|
+
act(() => {
|
|
57
|
+
element = create(React.createElement(TemporalRangeFormat, { from: ZonedDateTime.from("2022-06-22T14:22[MET]"), until: ZonedDateTime.from("2022-06-22T19:22[MET]"), locale: "de-AT" }));
|
|
58
|
+
});
|
|
59
|
+
const value = element.root.children[0];
|
|
60
|
+
expect(value).toBe("22.6.2022, 14:22:00 GMT+2 – 19:22:00 GMT+2");
|
|
61
|
+
});
|
|
62
|
+
test("ZonedDateTime en-US", () => {
|
|
63
|
+
let element;
|
|
64
|
+
act(() => {
|
|
65
|
+
element = create(React.createElement(TemporalRangeFormat, { from: ZonedDateTime.from("2022-06-22T14:22[MET]"), until: ZonedDateTime.from("2022-06-22T19:22[MET]"), locale: "en-US" }));
|
|
66
|
+
});
|
|
67
|
+
const value = element.root.children[0];
|
|
68
|
+
expect(value).toBe("6/22/2022, 2:22:00 PM GMT+2 – 7:22:00 PM GMT+2");
|
|
69
|
+
});
|
|
70
|
+
test("Instant de-AT", () => {
|
|
71
|
+
let element;
|
|
72
|
+
act(() => {
|
|
73
|
+
element = create(React.createElement(TemporalRangeFormat, { from: Instant.from("2022-06-22T14:22:11Z"), until: Instant.from("2024-01-30T08:14:32Z"), timeZone: "Europe/Vienna", locale: "de-AT" }));
|
|
74
|
+
});
|
|
75
|
+
const value = element.root.children[0];
|
|
76
|
+
expect(value).toBe("22.6.2022, 16:22:11 – 30.1.2024, 09:14:32");
|
|
77
|
+
});
|
|
78
|
+
test("Instant en-US", () => {
|
|
79
|
+
let element;
|
|
80
|
+
act(() => {
|
|
81
|
+
element = create(React.createElement(TemporalRangeFormat, { from: Instant.from("2022-06-22T14:22:11Z"), until: Instant.from("2024-01-30T08:14:32Z"), locale: "en-US", timeZone: "UTC" }));
|
|
82
|
+
});
|
|
83
|
+
const value = element.root.children[0];
|
|
84
|
+
expect(value).toBe("6/22/2022, 2:22:11 PM – 1/30/2024, 8:14:32 AM");
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=TemporalRangeFormat.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemporalRangeFormat.spec.js","sourceRoot":"","sources":["../../src/formats/TemporalRangeFormat.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,aAAa,CAAC;AACxF,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAEjC,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,IAAI,OAA0B,CAAC;QAC/B,GAAG,CAAC,GAAG,EAAE;YACL,OAAO,GAAG,MAAM,CACZ,oBAAC,mBAAmB,IAChB,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,EAClC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,EACnC,MAAM,EAAC,OAAO,GAChB,CACL,CAAC;QACN,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,OAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,IAAI,OAA0B,CAAC;QAC/B,GAAG,CAAC,GAAG,EAAE;YACL,OAAO,GAAG,MAAM,CACZ,oBAAC,mBAAmB,IAChB,IAAI,EAAE,SAAS,C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AAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAC1C,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAC3C,QAAQ,EAAC,eAAe,EACxB,MAAM,EAAC,OAAO,GAChB,CACL,CAAC;QACN,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,OAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,IAAI,OAA0B,CAAC;QAC/B,GAAG,CAAC,GAAG,EAAE;YACL,OAAO,GAAG,MAAM,CACZ,oBAAC,mBAAmB,IAChB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAC1C,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAC3C,MAAM,EAAC,OAAO,EACd,QAAQ,EAAC,KAAK,GAChB,CACL,CAAC;QACN,CAAC,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,OAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./CompactFormat";
|
|
2
|
+
export * from "./CurrencyFormat";
|
|
3
|
+
export * from "./DecimalFormat";
|
|
4
|
+
export * from "./DurationFormat";
|
|
5
|
+
export * from "./RelativeTemporalFormat";
|
|
6
|
+
export * from "./SwitchableTemporalFormat";
|
|
7
|
+
export * from "./TemporalFormat";
|
|
8
|
+
export * from "./TemporalRangeFormat";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./CompactFormat";
|
|
2
|
+
export * from "./CurrencyFormat";
|
|
3
|
+
export * from "./DecimalFormat";
|
|
4
|
+
export * from "./DurationFormat";
|
|
5
|
+
export * from "./RelativeTemporalFormat";
|
|
6
|
+
export * from "./SwitchableTemporalFormat";
|
|
7
|
+
export * from "./TemporalFormat";
|
|
8
|
+
export * from "./TemporalRangeFormat";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formats/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/formats/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getSupportedFormatLocale } from "../getSupportedFormatLocale";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { DateTimeFormat } from "../temporal";
|
|
4
|
+
export function useDateTimeFormat(options, locale) {
|
|
5
|
+
return useMemo(() => new DateTimeFormat(locale !== null && locale !== void 0 ? locale : getSupportedFormatLocale("dateTime"), options), [options, locale]);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=useDateTimeFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDateTimeFormat.js","sourceRoot":"","sources":["../../src/formats/useDateTimeFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAwB,MAAM,aAAa,CAAC;AAElE,MAAM,UAAU,iBAAiB,CAAC,OAA+B,EAAE,MAAe;IAC9E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,cAAc,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,wBAAwB,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACzH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useNumberFormat(options?: Intl.NumberFormatOptions, locale?: string): Intl.NumberFormat;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getSupportedFormatLocale } from "../getSupportedFormatLocale";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
export function useNumberFormat(options, locale) {
|
|
4
|
+
return useMemo(() => new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : getSupportedFormatLocale("number"), options), [options]);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=useNumberFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNumberFormat.js","sourceRoot":"","sources":["../../src/formats/useNumberFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAE9B,MAAM,UAAU,eAAe,CAAC,OAAkC,EAAE,MAAe;IAC/E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,wBAAwB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAClH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRelativeTimeFormat(options?: Intl.RelativeTimeFormatOptions, locale?: string): Intl.RelativeTimeFormat;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getSupportedFormatLocale } from "../getSupportedFormatLocale";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
export function useRelativeTimeFormat(options, locale) {
|
|
4
|
+
return useMemo(() => new Intl.RelativeTimeFormat(locale !== null && locale !== void 0 ? locale : getSupportedFormatLocale("relativeTime"), options), [options]);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=useRelativeTimeFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRelativeTimeFormat.js","sourceRoot":"","sources":["../../src/formats/useRelativeTimeFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAE9B,MAAM,UAAU,qBAAqB,CAAC,OAAwC,EAAE,MAAe;IAC3F,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,wBAAwB,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9H,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CardContentProps as MuiCardContentProps, CardProps as MuiCardProps } from "@mui/material";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
import { Labels } from "../localization";
|
|
4
|
+
interface EditFormProps {
|
|
5
|
+
loading: boolean;
|
|
6
|
+
onSave: () => Promise<any>;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
CardProps?: MuiCardProps;
|
|
9
|
+
CardContentProps?: MuiCardContentProps;
|
|
10
|
+
labels: Labels<"save" | "cancel">;
|
|
11
|
+
}
|
|
12
|
+
export declare function EditForm({ children, loading, onSave, onCancel, CardProps, CardContentProps, labels }: PropsWithChildren<EditFormProps>): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Button, Card, CardContent, Stack, } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ErrorAlert } from "../ErrorAlert";
|
|
4
|
+
import { CloseIcon } from "../icons";
|
|
5
|
+
import { SubmitButton } from "./SubmitButton";
|
|
6
|
+
import { useFormSubmit } from "./useFormSubmit";
|
|
7
|
+
export function EditForm({ children, loading, onSave, onCancel, CardProps, CardContentProps, labels }) {
|
|
8
|
+
const { onSubmit, onChange, submitted, submitting, error } = useFormSubmit({
|
|
9
|
+
onSubmit: onSave,
|
|
10
|
+
});
|
|
11
|
+
const pending = loading || submitting;
|
|
12
|
+
return (React.createElement(Card, Object.assign({}, CardProps),
|
|
13
|
+
React.createElement("form", { onSubmit: onSubmit, onChange: onChange },
|
|
14
|
+
children,
|
|
15
|
+
error && (React.createElement(CardContent, Object.assign({}, CardContentProps),
|
|
16
|
+
React.createElement(ErrorAlert, { error: error }))),
|
|
17
|
+
React.createElement(CardContent, Object.assign({}, CardContentProps),
|
|
18
|
+
React.createElement(Stack, { direction: "row", spacing: 2 },
|
|
19
|
+
React.createElement(SubmitButton, { variant: "outlined", disabled: pending, submitted: submitted, submitting: submitting }, labels("save")),
|
|
20
|
+
onCancel && (React.createElement(Button, { variant: "outlined", color: "inherit", disabled: pending, startIcon: React.createElement(CloseIcon, null), onClick: onCancel }, labels("cancel"))))))));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=EditForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditForm.js","sourceRoot":"","sources":["../../src/forms/EditForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,IAAI,EACJ,WAAW,EAGX,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,KAA0B,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,C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+
import { TextFieldProps } from "../Input/TextField";
|
|
3
|
+
export type SearchFormProps = Omit<TextFieldProps, "value" | "onChange" | "InputProps"> & {
|
|
4
|
+
search?: string;
|
|
5
|
+
onSearch: (search: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function SearchForm(props: SearchFormProps): JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { IconButton, InputAdornment } from "@mui/material";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { useEffect, useState } from "react";
|
|
15
|
+
import { SearchIcon } from "../icons";
|
|
16
|
+
import { TextField } from "../Input/TextField";
|
|
17
|
+
export function SearchForm(props) {
|
|
18
|
+
const { search, onSearch } = props, rest = __rest(props, ["search", "onSearch"]);
|
|
19
|
+
const [value, setValue] = useState(search || "");
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (search) {
|
|
22
|
+
setValue(value);
|
|
23
|
+
}
|
|
24
|
+
}, [search]);
|
|
25
|
+
function handleSubmit(e) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
onSearch(value);
|
|
28
|
+
}
|
|
29
|
+
return (React.createElement("form", { onSubmit: handleSubmit },
|
|
30
|
+
React.createElement(TextField, Object.assign({ value: value, onChange: setValue, InputProps: {
|
|
31
|
+
endAdornment: (React.createElement(InputAdornment, { position: "end" },
|
|
32
|
+
React.createElement(IconButton, { type: "submit", size: "large" },
|
|
33
|
+
React.createElement(SearchIcon, null))))
|
|
34
|
+
} }, rest))));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=SearchForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchForm.js","sourceRoot":"","sources":["../../src/forms/SearchForm.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AACpC,OAAO,EAAC,SAAS,EAAiB,MAAM,oBAAoB,CAAC;AAO7D,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC7C,MAAM,EACF,MAAM,EACN,QAAQ,KAER,KAAK,EADF,IAAI,UACP,KAAK,EAJH,sBAIL,CAAQ,CAAC;IAGV,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,MAAM,EAAE,CAAC;YACT,QAAQ,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,SAAS,YAAY,CAAC,CAAY;QAC9B,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,CACH,8BAAM,QAAQ,EAAE,YAAY;QACxB,oBAAC,SAAS,kBACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE;gBACR,YAAY,EAAE,CACV,oBAAC,cAAc,IAAC,QAAQ,EAAC,KAAK;oBAC1B,oBAAC,UAAU,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO;wBAClC,oBAAC,UAAU,OAAE,CACJ,CACA,CACpB;aACJ,IACG,IAAI,EACV,CACC,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonProps } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
interface SubmitButtonProps extends Omit<ButtonProps, "startIcon" | "type"> {
|
|
4
|
+
submitting: boolean;
|
|
5
|
+
submitted: boolean;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function SubmitButton(props: SubmitButtonProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { Button, CircularProgress } from "@mui/material";
|
|
13
|
+
import React, { useMemo } from "react";
|
|
14
|
+
import { SaveIcon, SuccessIcon } from "../icons";
|
|
15
|
+
export function SubmitButton(props) {
|
|
16
|
+
const { icon, submitted, submitting, disabled } = props, rest = __rest(props, ["icon", "submitted", "submitting", "disabled"]);
|
|
17
|
+
const dynamicIcon = useMemo(() => {
|
|
18
|
+
if (submitting) {
|
|
19
|
+
return React.createElement(CircularProgress, { size: 16, sx: { mx: 0.25 } });
|
|
20
|
+
}
|
|
21
|
+
if (submitted) {
|
|
22
|
+
return React.createElement(SuccessIcon, { fontSize: "small" });
|
|
23
|
+
}
|
|
24
|
+
return icon !== null && icon !== void 0 ? icon : React.createElement(SaveIcon, null);
|
|
25
|
+
}, [submitting, submitted]);
|
|
26
|
+
return (React.createElement(Button, Object.assign({ type: "submit", variant: "outlined", startIcon: dynamicIcon, disabled: disabled || submitting, color: submitted ? "success" : "primary" }, rest)));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=SubmitButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","sourceRoot":"","sources":["../../src/forms/SubmitButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAe,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACpE,OAAO,KAAK,EAAE,EAAY,OAAO,EAAC,MAAM,OAAO,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAQ/C,MAAM,UAAU,YAAY,CAAC,KAAwB;IACpD,MAAM,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,KAAa,KAAK,EAAb,IAAI,UAAI,KAAK,EAAxD,+CAAgD,CAAQ,CAAC;IAE/D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,IAAI,UAAU,EAAE,CAAC;YAChB,OAAO,oBAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAAE,EAAE,IAAI,EAAC,GAAI,CAAC;QACvD,CAAC;QACD,IAAI,SAAS,EAAE,CAAC;YACf,OAAO,oBAAC,WAAW,IAAC,QAAQ,EAAC,OAAO,GAAG,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,oBAAC,QAAQ,OAAG,CAAC;IAC7B,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAE5B,OAAO,CACN,oBAAC,MAAM,kBACN,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,UAAU,EAClB,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,QAAQ,IAAI,UAAU,EAChC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IACpC,IAAI,EACP,CACF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface UseFormSubmitOptions {
|
|
3
|
+
onSubmit: () => Promise<any>;
|
|
4
|
+
}
|
|
5
|
+
export declare function useFormSubmit({ onSubmit }: UseFormSubmitOptions): {
|
|
6
|
+
submitting: boolean;
|
|
7
|
+
submitted: boolean;
|
|
8
|
+
error: Error | undefined;
|
|
9
|
+
onSubmit: (e: React.FormEvent<HTMLFormElement>) => Promise<void>;
|
|
10
|
+
onChange: () => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
import { useAsyncCallback } from "react-async-hook";
|
|
11
|
+
import { useFlag } from "../utils";
|
|
12
|
+
export function useFormSubmit({ onSubmit }) {
|
|
13
|
+
const [submitted, setSubmitted, clearSubmitted] = useFlag(false);
|
|
14
|
+
const { loading: submitting, error, execute: save } = useAsyncCallback((e) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
clearSubmitted();
|
|
17
|
+
yield onSubmit();
|
|
18
|
+
setSubmitted();
|
|
19
|
+
}));
|
|
20
|
+
return {
|
|
21
|
+
submitting,
|
|
22
|
+
submitted,
|
|
23
|
+
error,
|
|
24
|
+
onSubmit: save,
|
|
25
|
+
onChange: clearSubmitted,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useFormSubmit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormSubmit.js","sourceRoot":"","sources":["../../src/forms/useFormSubmit.tsx"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAMjC,MAAM,UAAU,aAAa,CAAC,EAAC,QAAQ,EAAuB;IAC7D,MAAM,CAAC,SAAS,EAAE,YAAY,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEjE,MAAM,EAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAC,GAAG,gBAAgB,CACnE,CAAO,CAAmC,EAAE,EAAE;QAC7C,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,cAAc,EAAE,CAAC;QACjB,MAAM,QAAQ,EAAE,CAAC;QACjB,YAAY,EAAE,CAAC;IAChB,CAAC,CAAA,CACD,CAAC;IAEF,OAAO;QACN,UAAU;QACV,SAAS;QACT,KAAK;QACL,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,cAAc;KACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the users preferred languages selected in the browser, or an empty array if not called in a browser context.
|
|
3
|
+
* @see navigator.languages
|
|
4
|
+
*/
|
|
5
|
+
export function getNavigatorLanguages() {
|
|
6
|
+
if (typeof navigator != "undefined") {
|
|
7
|
+
return navigator.languages || [navigator.language || navigator.userLanguage];
|
|
8
|
+
}
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=getNavigatorLanguages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNavigatorLanguages.js","sourceRoot":"","sources":["../src/getNavigatorLanguages.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACjC,IAAI,OAAO,SAAS,IAAI,WAAW,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAK,SAAiB,CAAC,YAAY,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const IntlFormats: {
|
|
2
|
+
readonly number: {
|
|
3
|
+
(locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat;
|
|
4
|
+
new (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat;
|
|
5
|
+
supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions | undefined): string[];
|
|
6
|
+
readonly prototype: Intl.NumberFormat;
|
|
7
|
+
};
|
|
8
|
+
readonly relativeTime: {
|
|
9
|
+
new (locales?: string | string[] | undefined, options?: Intl.RelativeTimeFormatOptions | undefined): Intl.RelativeTimeFormat;
|
|
10
|
+
supportedLocalesOf(locales?: string | string[] | undefined, options?: Intl.RelativeTimeFormatOptions | undefined): string[];
|
|
11
|
+
};
|
|
12
|
+
readonly dateTime: {
|
|
13
|
+
(locales?: string | string[] | undefined, options?: import("@js-temporal/polyfill").Intl.DateTimeFormatOptions | undefined): import("@js-temporal/polyfill").Intl.DateTimeFormat;
|
|
14
|
+
new (locales?: string | string[] | undefined, options?: import("@js-temporal/polyfill").Intl.DateTimeFormatOptions | undefined): import("@js-temporal/polyfill").Intl.DateTimeFormat;
|
|
15
|
+
supportedLocalesOf(locales: string | string[], options?: import("@js-temporal/polyfill").Intl.DateTimeFormatOptions | undefined): string[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type IntlFormat = keyof typeof IntlFormats;
|
|
19
|
+
export declare function getSupportedFormatLocale(format: IntlFormat): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getNavigatorLanguages } from "./getNavigatorLanguages";
|
|
2
|
+
import { DateTimeFormat } from "./temporal";
|
|
3
|
+
export const IntlFormats = {
|
|
4
|
+
"number": Intl.NumberFormat,
|
|
5
|
+
"relativeTime": Intl.RelativeTimeFormat,
|
|
6
|
+
"dateTime": DateTimeFormat,
|
|
7
|
+
};
|
|
8
|
+
const supportedLocaleCache = {};
|
|
9
|
+
export function getSupportedFormatLocale(format) {
|
|
10
|
+
var _a;
|
|
11
|
+
return (_a = supportedLocaleCache[format]) !== null && _a !== void 0 ? _a : findSupportedFormatLocale(format);
|
|
12
|
+
}
|
|
13
|
+
function findSupportedFormatLocale(format) {
|
|
14
|
+
var _a;
|
|
15
|
+
const formatCtor = IntlFormats[format];
|
|
16
|
+
const locale = (_a = getNavigatorLanguages()
|
|
17
|
+
.find(locale => locale == new formatCtor(locale).resolvedOptions().locale)) !== null && _a !== void 0 ? _a : "default";
|
|
18
|
+
supportedLocaleCache[format] = locale;
|
|
19
|
+
return locale;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=getSupportedFormatLocale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSupportedFormatLocale.js","sourceRoot":"","sources":["../src/getSupportedFormatLocale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAE1C,MAAM,CAAC,MAAM,WAAW,GAAG;IACvB,QAAQ,EAAE,IAAI,CAAC,YAAY;IAC3B,cAAc,EAAE,IAAI,CAAC,kBAAkB;IACvC,UAAU,EAAE,cAAc;CACpB,CAAC;AAIX,MAAM,oBAAoB,GAAG,EAAgC,CAAC;AAE9D,MAAM,UAAU,wBAAwB,CAAC,MAAkB;;IACvD,OAAO,MAAA,oBAAoB,CAAC,MAAM,CAAC,mCAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,yBAAyB,CAAC,MAAkB;;IACjD,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,MAAA,qBAAqB,EAAE;SACjC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,mCAAI,SAAS,CAAC;IAC5F,oBAAoB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACtC,OAAO,MAAM,CAAC;AAClB,CAAC"}
|