@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,338 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
Checkbox,
|
|
4
|
+
Paper,
|
|
5
|
+
SortDirection,
|
|
6
|
+
Table,
|
|
7
|
+
TableBody,
|
|
8
|
+
TableCell,
|
|
9
|
+
TableCellProps,
|
|
10
|
+
TableContainer,
|
|
11
|
+
TableHead,
|
|
12
|
+
TablePagination,
|
|
13
|
+
TableRow,
|
|
14
|
+
TableSortLabel,
|
|
15
|
+
useTheme,
|
|
16
|
+
} from "@mui/material";
|
|
17
|
+
import React, {ChangeEvent, FC, Fragment, Key, ReactElement, ReactNode, useCallback, useEffect, useState} from "react";
|
|
18
|
+
import {UndrawEmpty} from "../content-table/UndrawEmpty";
|
|
19
|
+
import {ErrorAlert} from "../ErrorAlert";
|
|
20
|
+
|
|
21
|
+
export type LabelFunc<T> = (field: keyof T) => string;
|
|
22
|
+
|
|
23
|
+
export interface DataTableColumn<T> {
|
|
24
|
+
field: string;
|
|
25
|
+
label: string | LabelFunc<T>;
|
|
26
|
+
width?: string;
|
|
27
|
+
align?: TableCellProps["align"];
|
|
28
|
+
sortable?: boolean;
|
|
29
|
+
component?: FC<DataTableCellProps<T>>;
|
|
30
|
+
group?: string;
|
|
31
|
+
default?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface DataTableCellProps<T> {
|
|
35
|
+
row: T;
|
|
36
|
+
field: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DataTablePage {
|
|
40
|
+
/** The total number of elements. */
|
|
41
|
+
totalElements: number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The zero-based index of the current page.
|
|
45
|
+
*/
|
|
46
|
+
pageIndex: number;
|
|
47
|
+
|
|
48
|
+
/** The current page size. */
|
|
49
|
+
pageSize: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface DataTableProps<T> {
|
|
53
|
+
/** The columns to display. */
|
|
54
|
+
columns: ReadonlyArray<DataTableColumn<T>>;
|
|
55
|
+
|
|
56
|
+
/** The rows to display. */
|
|
57
|
+
rows: ReadonlyArray<T>;
|
|
58
|
+
|
|
59
|
+
/** The field by which the rows are currently sorted. */
|
|
60
|
+
sortField?: string;
|
|
61
|
+
|
|
62
|
+
/** The direction by which the rows are currently sorted. */
|
|
63
|
+
sortDirection?: SortDirection;
|
|
64
|
+
|
|
65
|
+
/** Callback that is invoked when the user wants to sort by a specific field. */
|
|
66
|
+
onSort?: (field: string) => any;
|
|
67
|
+
|
|
68
|
+
/** Whether the data is currently loading. */
|
|
69
|
+
loading?: boolean;
|
|
70
|
+
|
|
71
|
+
/** Whether an error has occured. */
|
|
72
|
+
error?: any;
|
|
73
|
+
|
|
74
|
+
/** The property that uniquely identifies a row (default: "id"). */
|
|
75
|
+
rowId?: string;
|
|
76
|
+
|
|
77
|
+
/** Information about the current page. Enables pagination if set. */
|
|
78
|
+
page?: DataTablePage;
|
|
79
|
+
|
|
80
|
+
/** Callback that is invoked when the user changes pages. */
|
|
81
|
+
onPageChange?: (page: DataTablePage) => void;
|
|
82
|
+
|
|
83
|
+
/** The available page sizes. */
|
|
84
|
+
pageSizes?: number[];
|
|
85
|
+
|
|
86
|
+
/** An element that is rendered when the table is empty. */
|
|
87
|
+
empty?: ReactElement;
|
|
88
|
+
|
|
89
|
+
/** A header that is rendered above the table. */
|
|
90
|
+
header?: ReactNode;
|
|
91
|
+
|
|
92
|
+
/** A toolbar that is rendered below the table. */
|
|
93
|
+
toolbar?: ReactNode;
|
|
94
|
+
|
|
95
|
+
/** The currently selected rows. */
|
|
96
|
+
selected?: ReadonlyArray<T>;
|
|
97
|
+
|
|
98
|
+
/** Callback that is invoked when a row is selected or unselected. */
|
|
99
|
+
onSelectedChange?: (selected: T[]) => any;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const defaultPageSizes = [10, 25, 50, 100];
|
|
103
|
+
|
|
104
|
+
function getId<T>(row: T, rowId: string) {
|
|
105
|
+
return row[rowId as keyof T] as any as Key;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function DataTable<T>(props: Readonly<DataTableProps<T>>) {
|
|
109
|
+
const {
|
|
110
|
+
columns,
|
|
111
|
+
rows,
|
|
112
|
+
onSort,
|
|
113
|
+
sortDirection,
|
|
114
|
+
sortField,
|
|
115
|
+
loading,
|
|
116
|
+
error,
|
|
117
|
+
rowId = "id",
|
|
118
|
+
empty = <UndrawEmpty height="100%" width="auto" />,
|
|
119
|
+
page,
|
|
120
|
+
onPageChange,
|
|
121
|
+
pageSizes = defaultPageSizes,
|
|
122
|
+
header,
|
|
123
|
+
toolbar,
|
|
124
|
+
selected,
|
|
125
|
+
onSelectedChange,
|
|
126
|
+
} = props;
|
|
127
|
+
|
|
128
|
+
const theme = useTheme();
|
|
129
|
+
const hasSelection = Boolean(onSelectedChange) && typeof selected !== "undefined";
|
|
130
|
+
const columnCount = columns.length + (hasSelection ? 1 : 0);
|
|
131
|
+
|
|
132
|
+
// reset page index to `0` if it is out of bounds
|
|
133
|
+
// this can happen when a filter changes and the result set becomes smaller
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (page && onPageChange) {
|
|
136
|
+
const {pageIndex, pageSize, totalElements} = page;
|
|
137
|
+
const totalPages = Math.ceil(totalElements / pageSize);
|
|
138
|
+
if (pageIndex >= totalPages) {
|
|
139
|
+
onPageChange({...page, pageIndex: 0});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, [page, onPageChange]);
|
|
143
|
+
|
|
144
|
+
// Reset selection when the rows change.
|
|
145
|
+
// In the future, we might add a mode where a selection can span across multiple pages
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (onSelectedChange) {
|
|
148
|
+
onSelectedChange([]);
|
|
149
|
+
}
|
|
150
|
+
}, [onSelectedChange, rows]);
|
|
151
|
+
|
|
152
|
+
// When loading
|
|
153
|
+
const [displayRows, setDisplayRows] = useState(rows);
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
if (!loading || rows.length > 0) {
|
|
156
|
+
setDisplayRows(rows);
|
|
157
|
+
}
|
|
158
|
+
}, [rows, loading]);
|
|
159
|
+
|
|
160
|
+
function handlePageChange(event: React.MouseEvent<HTMLButtonElement> | null, pageIndex: number) {
|
|
161
|
+
if (page && onPageChange) {
|
|
162
|
+
onPageChange({...page, pageIndex});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function handleRowsPerPageChange(event: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) {
|
|
167
|
+
const pageSize = Number.parseInt(event.target.value);
|
|
168
|
+
if (page && onPageChange) {
|
|
169
|
+
onPageChange({...page, pageSize});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function handleSelectAll(e: ChangeEvent<HTMLInputElement>) {
|
|
174
|
+
if (onSelectedChange) {
|
|
175
|
+
if (e.currentTarget.checked) {
|
|
176
|
+
onSelectedChange([...rows]);
|
|
177
|
+
} else {
|
|
178
|
+
onSelectedChange([]);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function handleSelect(row: T, checked: boolean) {
|
|
184
|
+
if (onSelectedChange && selected) {
|
|
185
|
+
if (checked) {
|
|
186
|
+
onSelectedChange([...selected, row]);
|
|
187
|
+
} else {
|
|
188
|
+
onSelectedChange([...selected].filter(s => getId(s, rowId) != getId(row, rowId)));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const pagination = page && (
|
|
194
|
+
<TablePagination
|
|
195
|
+
component="div"
|
|
196
|
+
rowsPerPageOptions={pageSizes}
|
|
197
|
+
count={page.totalElements}
|
|
198
|
+
rowsPerPage={page.pageSize}
|
|
199
|
+
page={page.pageIndex}
|
|
200
|
+
onPageChange={handlePageChange}
|
|
201
|
+
onRowsPerPageChange={handleRowsPerPageChange}
|
|
202
|
+
/>
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<Paper>
|
|
207
|
+
{header}
|
|
208
|
+
<TableContainer>
|
|
209
|
+
<Table>
|
|
210
|
+
<TableHead>
|
|
211
|
+
<TableRow>
|
|
212
|
+
{hasSelection && (
|
|
213
|
+
<TableCell padding="checkbox">
|
|
214
|
+
<Checkbox
|
|
215
|
+
indeterminate={selected?.length > 0 && selected?.length < rows.length}
|
|
216
|
+
checked={rows.length > 0 && selected?.length == rows.length}
|
|
217
|
+
onChange={handleSelectAll}
|
|
218
|
+
/>
|
|
219
|
+
</TableCell>
|
|
220
|
+
)}
|
|
221
|
+
{columns.map(column => (
|
|
222
|
+
<DataTableHeaderCell
|
|
223
|
+
key={column.field}
|
|
224
|
+
column={column}
|
|
225
|
+
sortField={sortField}
|
|
226
|
+
sortDirection={sortDirection}
|
|
227
|
+
onSort={onSort}
|
|
228
|
+
/>
|
|
229
|
+
))}
|
|
230
|
+
</TableRow>
|
|
231
|
+
</TableHead>
|
|
232
|
+
<TableBody sx={{minHeight: "100px", opacity: loading ? 0.5 : undefined}}>
|
|
233
|
+
{error && (
|
|
234
|
+
<TableRow>
|
|
235
|
+
<TableCell colSpan={columnCount}>
|
|
236
|
+
<ErrorAlert error={error} />
|
|
237
|
+
</TableCell>
|
|
238
|
+
</TableRow>
|
|
239
|
+
)}
|
|
240
|
+
{!error && !loading && rows.length == 0 && (
|
|
241
|
+
<TableRow>
|
|
242
|
+
<TableCell colSpan={columnCount}>
|
|
243
|
+
<Box
|
|
244
|
+
display="flex"
|
|
245
|
+
flexDirection="column"
|
|
246
|
+
justifyContent="center"
|
|
247
|
+
alignItems="center"
|
|
248
|
+
p={3}
|
|
249
|
+
>
|
|
250
|
+
<Box
|
|
251
|
+
sx={{
|
|
252
|
+
height: 300,
|
|
253
|
+
[theme.breakpoints.down("md")]: {
|
|
254
|
+
height: 150,
|
|
255
|
+
},
|
|
256
|
+
}}
|
|
257
|
+
>
|
|
258
|
+
{empty}
|
|
259
|
+
</Box>
|
|
260
|
+
</Box>
|
|
261
|
+
</TableCell>
|
|
262
|
+
</TableRow>
|
|
263
|
+
)}
|
|
264
|
+
{displayRows.map(row => {
|
|
265
|
+
const id = getId(row, rowId);
|
|
266
|
+
return (
|
|
267
|
+
<TableRow key={id} selected={selected?.includes(row)}>
|
|
268
|
+
{hasSelection && (
|
|
269
|
+
<TableCell padding="checkbox">
|
|
270
|
+
<Checkbox
|
|
271
|
+
checked={Boolean(selected?.find(s => getId(s, rowId) == id))}
|
|
272
|
+
onChange={e => handleSelect(row, e.currentTarget.checked)}
|
|
273
|
+
/>
|
|
274
|
+
</TableCell>
|
|
275
|
+
)}
|
|
276
|
+
{columns.map(({field, component, align}) => {
|
|
277
|
+
const Component = component ?? DefaultDataTableCell;
|
|
278
|
+
|
|
279
|
+
return (
|
|
280
|
+
<TableCell key={field} align={align}>
|
|
281
|
+
<Component row={row} field={field} />
|
|
282
|
+
</TableCell>
|
|
283
|
+
);
|
|
284
|
+
})}
|
|
285
|
+
</TableRow>
|
|
286
|
+
);
|
|
287
|
+
})}
|
|
288
|
+
</TableBody>
|
|
289
|
+
</Table>
|
|
290
|
+
</TableContainer>
|
|
291
|
+
{toolbar && pagination && (
|
|
292
|
+
<Box display="flex" justifyContent="space-between">
|
|
293
|
+
{toolbar}
|
|
294
|
+
{pagination}
|
|
295
|
+
</Box>
|
|
296
|
+
)}
|
|
297
|
+
{!pagination && toolbar}
|
|
298
|
+
{!toolbar && pagination}
|
|
299
|
+
</Paper>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export function DefaultDataTableCell<T>({row, field}: DataTableCellProps<T>) {
|
|
304
|
+
const value = row[field as keyof T];
|
|
305
|
+
if (typeof value == "string" || typeof value == "number") {
|
|
306
|
+
return <Fragment>{value}</Fragment>;
|
|
307
|
+
}
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
interface DataTableHeaderCellProps<T> {
|
|
312
|
+
column: DataTableColumn<T>;
|
|
313
|
+
sortField?: string;
|
|
314
|
+
sortDirection?: SortDirection;
|
|
315
|
+
onSort?: (field: string) => void;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function DataTableHeaderCell<T>(props: DataTableHeaderCellProps<T>) {
|
|
319
|
+
const {column, sortField, sortDirection, onSort} = props;
|
|
320
|
+
|
|
321
|
+
const handleClick = useCallback(() => column.sortable && onSort && onSort(column.field), [onSort, column]);
|
|
322
|
+
|
|
323
|
+
return (
|
|
324
|
+
<TableCell style={{width: column.width}} align={column.align}>
|
|
325
|
+
{column.sortable
|
|
326
|
+
? (
|
|
327
|
+
<TableSortLabel
|
|
328
|
+
active={sortField == column.field}
|
|
329
|
+
direction={sortDirection || undefined}
|
|
330
|
+
onClick={handleClick}
|
|
331
|
+
>
|
|
332
|
+
{column.label}
|
|
333
|
+
</TableSortLabel>
|
|
334
|
+
)
|
|
335
|
+
: column.label}
|
|
336
|
+
</TableCell>
|
|
337
|
+
);
|
|
338
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {DataTableColumn} from "./DataTable";
|
|
2
|
+
import React, {Fragment, useState} from "react";
|
|
3
|
+
import {
|
|
4
|
+
Avatar,
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogActions,
|
|
7
|
+
DialogTitle,
|
|
8
|
+
IconButton,
|
|
9
|
+
List,
|
|
10
|
+
ListItemAvatar,
|
|
11
|
+
ListItemButton,
|
|
12
|
+
ListItemText,
|
|
13
|
+
ListSubheader,
|
|
14
|
+
Menu,
|
|
15
|
+
Stack,
|
|
16
|
+
} from "@mui/material";
|
|
17
|
+
import {AddCircleIcon, CloseIcon, MoveDownCircleIcon, MoveUpCircleIcon, RemoveCircleIcon, TuningIcon} from "../icons";
|
|
18
|
+
import {useFlag} from "../utils";
|
|
19
|
+
import {Labels} from "../localization";
|
|
20
|
+
|
|
21
|
+
export interface DataTableColumnButtonProps<T> {
|
|
22
|
+
columns: ReadonlyArray<DataTableColumn<T>>;
|
|
23
|
+
selected: ReadonlyArray<DataTableColumn<T>>;
|
|
24
|
+
onChange: (selected: ReadonlyArray<DataTableColumn<T>>) => any;
|
|
25
|
+
labels: Labels<"title" | "close" | "add" | "remove" | "moveUp" | "moveDown">;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function groupColumns<T>(available: ReadonlyArray<DataTableColumn<T>>) {
|
|
29
|
+
const groups: Record<string, Array<DataTableColumn<T>>> = {};
|
|
30
|
+
const other: Array<DataTableColumn<T>> = [];
|
|
31
|
+
for (const column of available) {
|
|
32
|
+
const group = column.group;
|
|
33
|
+
if (group) {
|
|
34
|
+
if (!groups[group]) {
|
|
35
|
+
groups[group] = [column]
|
|
36
|
+
} else {
|
|
37
|
+
groups[group].push(column);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
other.push(column);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return {groups, other};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function DataTableColumnSettings<T>(props: DataTableColumnButtonProps<T>) {
|
|
47
|
+
const {
|
|
48
|
+
columns,
|
|
49
|
+
selected,
|
|
50
|
+
onChange,
|
|
51
|
+
labels,
|
|
52
|
+
} = props;
|
|
53
|
+
|
|
54
|
+
const [open, setOpen, clearOpen] = useFlag(false);
|
|
55
|
+
const [focus, setFocus] = useState<string>();
|
|
56
|
+
const [addMenu, setAddMenu, clearAddMenu] = useFlag(false);
|
|
57
|
+
const [addAnchor, setAddAnchor] = useState<HTMLElement | null>(null);
|
|
58
|
+
|
|
59
|
+
const available = columns.filter(column => !selected.find(s => s.field == column.field));
|
|
60
|
+
const {groups, other} = groupColumns(available);
|
|
61
|
+
|
|
62
|
+
function move(sourceIndex: number, targetIndex: number) {
|
|
63
|
+
const newSelected = [...selected];
|
|
64
|
+
const temp = newSelected[targetIndex];
|
|
65
|
+
newSelected[targetIndex] = newSelected[sourceIndex];
|
|
66
|
+
newSelected[sourceIndex] = temp;
|
|
67
|
+
onChange(newSelected);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function moveUp() {
|
|
71
|
+
const index = selected.findIndex(s => s.field == focus);
|
|
72
|
+
if (index >= 1) {
|
|
73
|
+
move(index, index - 1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function moveDown() {
|
|
78
|
+
const index = selected.findIndex(s => s.field == focus);
|
|
79
|
+
if (index >= 0 && index + 1 < selected.length) {
|
|
80
|
+
move(index, index + 1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function remove() {
|
|
85
|
+
onChange(selected.filter(c => c.field != focus));
|
|
86
|
+
setFocus(undefined);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function add(column: DataTableColumn<T>) {
|
|
90
|
+
onChange([...selected, column]);
|
|
91
|
+
clearAddMenu();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function changeFocus(column: DataTableColumn<T>) {
|
|
95
|
+
setFocus(focus != column.field ? column.field : undefined)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function renderSelectListItems(columns: ReadonlyArray<DataTableColumn<T>>) {
|
|
99
|
+
return columns.map(column => (
|
|
100
|
+
<ListItemButton key={column.field} onClick={() => add(column)}>
|
|
101
|
+
<ListItemText primary={column.label}/>
|
|
102
|
+
</ListItemButton>
|
|
103
|
+
));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<Fragment>
|
|
108
|
+
<IconButton onClick={setOpen} title={labels("title")}>
|
|
109
|
+
<TuningIcon/>
|
|
110
|
+
</IconButton>
|
|
111
|
+
<Dialog open={open} onClose={clearOpen} fullWidth maxWidth="xs">
|
|
112
|
+
<DialogTitle>
|
|
113
|
+
{labels("title")}
|
|
114
|
+
</DialogTitle>
|
|
115
|
+
<IconButton
|
|
116
|
+
aria-label={labels("close")}
|
|
117
|
+
title={labels("close")}
|
|
118
|
+
onClick={clearOpen}
|
|
119
|
+
sx={{
|
|
120
|
+
position: 'absolute',
|
|
121
|
+
right: 8,
|
|
122
|
+
top: 8,
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
<CloseIcon/>
|
|
126
|
+
</IconButton>
|
|
127
|
+
<List sx={{flex: 1, overflowY: "scroll"}}>
|
|
128
|
+
{selected.map((column, index) => (
|
|
129
|
+
<ListItemButton
|
|
130
|
+
key={column.field}
|
|
131
|
+
onClick={() => changeFocus(column)}
|
|
132
|
+
selected={focus == column.field}
|
|
133
|
+
>
|
|
134
|
+
<ListItemAvatar>
|
|
135
|
+
<Avatar>{index + 1}</Avatar>
|
|
136
|
+
</ListItemAvatar>
|
|
137
|
+
<ListItemText
|
|
138
|
+
primary={column.label}
|
|
139
|
+
secondary={column.group}
|
|
140
|
+
/>
|
|
141
|
+
</ListItemButton>
|
|
142
|
+
))}
|
|
143
|
+
</List>
|
|
144
|
+
<DialogActions>
|
|
145
|
+
<Stack spacing={2} direction="row" justifyContent="space-between" flex={1}>
|
|
146
|
+
<IconButton
|
|
147
|
+
onClick={setAddMenu}
|
|
148
|
+
ref={setAddAnchor}
|
|
149
|
+
disabled={available.length == 0}
|
|
150
|
+
color="primary"
|
|
151
|
+
title={labels("add")}
|
|
152
|
+
size="large"
|
|
153
|
+
>
|
|
154
|
+
<AddCircleIcon fontSize="large"/>
|
|
155
|
+
</IconButton>
|
|
156
|
+
<Stack spacing={2} direction="row" justifyContent="center">
|
|
157
|
+
<IconButton
|
|
158
|
+
onClick={moveUp}
|
|
159
|
+
disabled={!focus}
|
|
160
|
+
color="secondary"
|
|
161
|
+
title={labels("moveUp")}
|
|
162
|
+
size="large"
|
|
163
|
+
>
|
|
164
|
+
<MoveUpCircleIcon fontSize="large"/>
|
|
165
|
+
</IconButton>
|
|
166
|
+
<IconButton
|
|
167
|
+
onClick={moveDown}
|
|
168
|
+
disabled={!focus}
|
|
169
|
+
color="secondary"
|
|
170
|
+
title={labels("moveDown")}
|
|
171
|
+
size="large"
|
|
172
|
+
>
|
|
173
|
+
<MoveDownCircleIcon fontSize="large"/>
|
|
174
|
+
</IconButton>
|
|
175
|
+
</Stack>
|
|
176
|
+
<IconButton
|
|
177
|
+
onClick={remove}
|
|
178
|
+
disabled={!focus}
|
|
179
|
+
color="error"
|
|
180
|
+
title={labels("remove")}
|
|
181
|
+
size="large"
|
|
182
|
+
>
|
|
183
|
+
<RemoveCircleIcon fontSize="large"/>
|
|
184
|
+
</IconButton>
|
|
185
|
+
</Stack>
|
|
186
|
+
</DialogActions>
|
|
187
|
+
|
|
188
|
+
<Menu
|
|
189
|
+
open={addMenu}
|
|
190
|
+
anchorEl={addAnchor}
|
|
191
|
+
onClose={clearAddMenu}
|
|
192
|
+
>
|
|
193
|
+
{Object.entries(groups).map(([group, columns]) => (
|
|
194
|
+
<Fragment>
|
|
195
|
+
<ListSubheader>{group}</ListSubheader>
|
|
196
|
+
{renderSelectListItems(columns)}
|
|
197
|
+
</Fragment>
|
|
198
|
+
))}
|
|
199
|
+
{renderSelectListItems(other)}
|
|
200
|
+
</Menu>
|
|
201
|
+
</Dialog>
|
|
202
|
+
</Fragment>
|
|
203
|
+
)
|
|
204
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, {PropsWithChildren} from "react";
|
|
2
|
+
import {Stack} from "@mui/material";
|
|
3
|
+
|
|
4
|
+
export function DataTableToolbar({children}: PropsWithChildren<{}>) {
|
|
5
|
+
return (
|
|
6
|
+
<Stack spacing={1} pl={1} minHeight="52px" direction="row" alignItems="center">
|
|
7
|
+
{children}
|
|
8
|
+
</Stack>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./DataTable";
|
|
2
|
+
export * from "./useDataTableStorage";
|
|
3
|
+
export * from "./useDataTableColumnStorage";
|
|
4
|
+
export * from "./useSpringPageable";
|
|
5
|
+
export * from "./useSpringPage";
|
|
6
|
+
export * from "./DataTableColumnSettings";
|
|
7
|
+
export * from "./DataTableHeader";
|
|
8
|
+
export * from "./DataTableToolbar";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {useStorage} from "../storage";
|
|
2
|
+
import {useCallback, useMemo} from "react";
|
|
3
|
+
import {DataTableColumn} from "./DataTable";
|
|
4
|
+
import {defined} from "../utils";
|
|
5
|
+
|
|
6
|
+
export function useDataTableColumnStorage<T>(key: string, availableColumns: ReadonlyArray<DataTableColumn<T>>) {
|
|
7
|
+
|
|
8
|
+
const defaultColumns = useMemo(() => availableColumns
|
|
9
|
+
.filter(c => c.default)
|
|
10
|
+
.map(c => c.field), [availableColumns]);
|
|
11
|
+
|
|
12
|
+
const [storage, setStorage] = useStorage(key, defaultColumns);
|
|
13
|
+
|
|
14
|
+
const columns = storage
|
|
15
|
+
.map(c => availableColumns.find(a => a.field == c))
|
|
16
|
+
.filter(defined);
|
|
17
|
+
|
|
18
|
+
const setColumns = useCallback((columns: ReadonlyArray<DataTableColumn<T>>) => {
|
|
19
|
+
setStorage(columns.map(c => c.field));
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
columns,
|
|
24
|
+
setColumns
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {useStorage} from "../storage";
|
|
2
|
+
import {SortDirection} from "@mui/material";
|
|
3
|
+
import {useCallback} from "react";
|
|
4
|
+
import {DataTablePage} from "./DataTable";
|
|
5
|
+
|
|
6
|
+
export interface DataTableStorage {
|
|
7
|
+
pageIndex?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
sortField?: string;
|
|
10
|
+
sortDirection?: SortDirection;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function useDataTableStorage(key: string, defaults?: DataTableStorage) {
|
|
14
|
+
const [storage, setStorage] = useStorage<DataTableStorage>(key, {
|
|
15
|
+
pageIndex: 0,
|
|
16
|
+
pageSize: 10,
|
|
17
|
+
sortDirection: "asc",
|
|
18
|
+
...defaults,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const onPageChange = useCallback(({pageSize, pageIndex}: DataTablePage) => {
|
|
22
|
+
setStorage({...storage, pageSize, pageIndex});
|
|
23
|
+
}, [storage]);
|
|
24
|
+
|
|
25
|
+
const onSort = useCallback((field: string) => {
|
|
26
|
+
if (storage.sortField == field) {
|
|
27
|
+
setStorage({...storage, sortDirection: storage.sortDirection == "desc" ? "asc" : "desc" });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
setStorage({
|
|
31
|
+
...storage,
|
|
32
|
+
sortDirection: "asc",
|
|
33
|
+
sortField: field,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}, [storage]);
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
...storage,
|
|
40
|
+
onPageChange,
|
|
41
|
+
onSort,
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {useEffect, useState} from "react";
|
|
2
|
+
import {SpringPage} from "../spring";
|
|
3
|
+
import {DataTablePage} from "./DataTable";
|
|
4
|
+
|
|
5
|
+
export function useSpringPage<T>(springPage: SpringPage<T> | undefined) {
|
|
6
|
+
const [rows, setRows] = useState<T[]>([]);
|
|
7
|
+
const [page, setPage] = useState<DataTablePage>();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (springPage) {
|
|
11
|
+
setRows(springPage.content ?? []);
|
|
12
|
+
setPage({
|
|
13
|
+
totalElements: springPage.totalElements ?? 0,
|
|
14
|
+
pageSize: springPage.size ?? 0,
|
|
15
|
+
pageIndex: springPage.number ?? 0,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}, [springPage]);
|
|
19
|
+
|
|
20
|
+
return {rows, page} as const;
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {SortDirection} from "@mui/material";
|
|
2
|
+
import {useMemo} from "react";
|
|
3
|
+
import {SpringPageable} from "../spring";
|
|
4
|
+
|
|
5
|
+
export interface SpringPagingOptions {
|
|
6
|
+
pageIndex?: number;
|
|
7
|
+
pageSize?: number;
|
|
8
|
+
sortField?: string;
|
|
9
|
+
sortDirection?: SortDirection;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function useSpringPageable(options: SpringPagingOptions): SpringPageable {
|
|
13
|
+
const {
|
|
14
|
+
pageIndex,
|
|
15
|
+
pageSize,
|
|
16
|
+
sortField,
|
|
17
|
+
sortDirection,
|
|
18
|
+
} = options;
|
|
19
|
+
|
|
20
|
+
return useMemo(() => ({
|
|
21
|
+
size: pageSize ?? 10,
|
|
22
|
+
sort: sortField ? [`${sortField},${sortDirection || "asc"}`] : undefined,
|
|
23
|
+
page: pageIndex ?? 0,
|
|
24
|
+
}), [pageIndex, pageSize, sortField, sortDirection]);
|
|
25
|
+
}
|