@firecms/core 3.0.1 → 3.1.0-canary.02232f4
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 +1 -1
- package/dist/components/AIIcon.d.ts +16 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +7 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +14 -0
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +6 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +5 -4
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +6 -0
- package/dist/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +2 -2
- package/dist/components/EntityCollectionView/Board.d.ts +2 -0
- package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
- package/dist/components/EntityCollectionView/CollectionDataErrorBanner.d.ts +4 -0
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +26 -0
- package/dist/components/EntityCollectionView/EntityCard.d.ts +19 -0
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +20 -0
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +31 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -2
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +7 -3
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +14 -0
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +44 -0
- package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
- package/dist/components/EntityCollectionView/useBoardDataController.d.ts +60 -0
- package/dist/components/ErrorBoundary.d.ts +4 -2
- package/dist/components/HomePage/DefaultHomePage.d.ts +0 -1
- package/dist/components/LanguageToggle.d.ts +1 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +5 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/UnsavedChangesDialog.d.ts +1 -0
- package/dist/components/VirtualTable/VirtualTableCell.d.ts +6 -0
- package/dist/components/VirtualTable/VirtualTableHeader.d.ts +4 -1
- package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +17 -1
- package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +1 -0
- package/dist/components/VirtualTable/types.d.ts +3 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/contexts/index.d.ts +10 -0
- package/dist/core/DrawerNavigationGroup.d.ts +45 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/editor/components/SlashCommandMenu.d.ts +6 -0
- package/dist/editor/components/editor-bubble-item.d.ts +8 -0
- package/dist/editor/components/editor-bubble.d.ts +8 -0
- package/dist/editor/components/image-bubble.d.ts +5 -0
- package/dist/editor/components/index.d.ts +16 -0
- package/dist/editor/components/table-bubble.d.ts +5 -0
- package/dist/editor/editor.d.ts +30 -0
- package/dist/editor/extensions/HighlightDecorationExtension.d.ts +24 -0
- package/dist/editor/extensions/Image/index.d.ts +6 -0
- package/dist/editor/extensions/Image.d.ts +6 -0
- package/dist/editor/extensions/TextLoadingDecorationExtension.d.ts +16 -0
- package/dist/editor/extensions/clipboard.d.ts +7 -0
- package/dist/editor/extensions/custom-keymap.d.ts +1 -0
- package/dist/editor/extensions/drag-and-drop.d.ts +9 -0
- package/dist/editor/hooks/useProseMirror.d.ts +13 -0
- package/dist/editor/hooks/useProseMirrorContext.d.ts +9 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/markdown.d.ts +5 -0
- package/dist/editor/nodeViews/ImageComponent.d.ts +3 -0
- package/dist/editor/nodeViews/ReactNodeView.d.ts +29 -0
- package/dist/editor/nodeViews/TaskItemComponent.d.ts +3 -0
- package/dist/editor/nodeViews/index.d.ts +6 -0
- package/dist/editor/plugins/index.d.ts +2 -0
- package/dist/editor/plugins/inputrules.d.ts +6 -0
- package/dist/editor/plugins/placeholderPlugin.d.ts +3 -0
- package/dist/editor/plugins/slashCommandPlugin.d.ts +12 -0
- package/dist/editor/schema.d.ts +2 -0
- package/dist/editor/selectors/ai-selector.d.ts +0 -0
- package/dist/editor/selectors/color-selector.d.ts +10 -0
- package/dist/editor/selectors/link-selector.d.ts +8 -0
- package/dist/editor/selectors/node-selector.d.ts +15 -0
- package/dist/editor/selectors/text-buttons.d.ts +1 -0
- package/dist/editor/types.d.ts +5 -0
- package/dist/editor/useProseMirror.d.ts +16 -0
- package/dist/editor/utils/prosemirror-utils.d.ts +6 -0
- package/dist/editor/utils/remove_classes.d.ts +1 -0
- package/dist/editor/utils/useDebouncedCallback.d.ts +1 -0
- package/dist/form/components/ErrorFocus.d.ts +1 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
- package/dist/form/validation.d.ts +3 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useBreadcrumbsController.d.ts +16 -0
- package/dist/hooks/useBuildNavigationController.d.ts +0 -1
- package/dist/hooks/useCollapsedGroups.d.ts +6 -3
- package/dist/hooks/useTranslation.d.ts +17 -0
- package/dist/i18n/FireCMSi18nProvider.d.ts +33 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +30146 -15178
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +30032 -15085
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useRestoreScroll.d.ts +1 -1
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/en.d.ts +10 -0
- package/dist/locales/es.d.ts +10 -0
- package/dist/locales/fr.d.ts +2 -0
- package/dist/locales/hi.d.ts +2 -0
- package/dist/locales/it.d.ts +2 -0
- package/dist/locales/pt.d.ts +7 -0
- package/dist/preview/PropertyPreviewProps.d.ts +5 -0
- package/dist/preview/components/DatePreview.d.ts +13 -3
- package/dist/preview/components/ImagePreview.d.ts +5 -1
- package/dist/preview/components/StorageThumbnail.d.ts +2 -1
- package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +1 -1
- package/dist/types/analytics.d.ts +1 -1
- package/dist/types/collections.d.ts +88 -2
- package/dist/types/customization_controller.d.ts +2 -1
- package/dist/types/datasource.d.ts +0 -1
- package/dist/types/firecms.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/navigation.d.ts +2 -2
- package/dist/types/plugins.d.ts +69 -1
- package/dist/types/properties.d.ts +268 -12
- package/dist/types/storage.d.ts +1 -0
- package/dist/types/translations.d.ts +669 -0
- package/dist/util/__tests__/conditions.test.d.ts +1 -0
- package/dist/util/__tests__/objects.test.d.ts +1 -0
- package/dist/util/conditions.d.ts +26 -0
- package/dist/util/entities.d.ts +2 -3
- package/dist/util/index.d.ts +3 -1
- package/dist/util/lazy_eager.d.ts +7 -0
- package/dist/util/objects.d.ts +1 -0
- package/dist/util/property_utils.d.ts +2 -1
- package/dist/util/resolutions.d.ts +3 -3
- package/dist/util/useStorageUploadController.d.ts +10 -1
- package/package.json +51 -12
- package/src/app/Scaffold.tsx +20 -19
- package/src/components/AIIcon.tsx +41 -0
- package/src/components/ArrayContainer.tsx +7 -8
- package/src/components/ClearFilterSortButton.tsx +25 -19
- package/src/components/ConfirmationDialog.tsx +4 -4
- package/src/components/DeleteEntityDialog.tsx +12 -11
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +82 -43
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +130 -79
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +121 -104
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +132 -103
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +6 -3
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +24 -44
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +90 -49
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +3 -2
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +11 -11
- package/src/components/EntityCollectionView/Board.tsx +324 -0
- package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
- package/src/components/EntityCollectionView/BoardSortableList.tsx +174 -0
- package/src/components/EntityCollectionView/CollectionDataErrorBanner.tsx +43 -0
- package/src/components/EntityCollectionView/EntityBoardCard.tsx +212 -0
- package/src/components/EntityCollectionView/EntityCard.tsx +235 -0
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +706 -0
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +236 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +531 -209
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +35 -22
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +86 -15
- package/src/components/EntityCollectionView/FiltersDialog.tsx +252 -0
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +202 -0
- package/src/components/EntityCollectionView/board_types.ts +113 -0
- package/src/components/EntityCollectionView/useBoardDataController.tsx +490 -0
- package/src/components/EntityJsonPreview.tsx +2 -1
- package/src/components/EntityView.tsx +3 -2
- package/src/components/ErrorBoundary.tsx +27 -15
- package/src/components/ErrorTooltip.tsx +2 -1
- package/src/components/HomePage/DefaultHomePage.tsx +65 -22
- package/src/components/HomePage/HomePageDnD.tsx +59 -42
- package/src/components/HomePage/NavigationCard.tsx +20 -18
- package/src/components/HomePage/NavigationGroup.tsx +20 -17
- package/src/components/HomePage/RenameGroupDialog.tsx +15 -15
- package/src/components/HomePage/SmallNavigationCard.tsx +10 -9
- package/src/components/LanguageToggle.tsx +66 -0
- package/src/components/NotFoundPage.tsx +5 -3
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +12 -17
- package/src/components/ReferenceWidget.tsx +5 -6
- package/src/components/SearchIconsView.tsx +3 -1
- package/src/components/SelectableTable/SelectableTable.tsx +75 -67
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +7 -6
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +50 -40
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +53 -40
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +60 -58
- package/src/components/UnsavedChangesDialog.tsx +6 -6
- package/src/components/UserDisplay.tsx +4 -4
- package/src/components/VirtualTable/VirtualTable.performance.test.tsx +1 -0
- package/src/components/VirtualTable/VirtualTable.tsx +275 -119
- package/src/components/VirtualTable/VirtualTableCell.tsx +18 -2
- package/src/components/VirtualTable/VirtualTableHeader.tsx +76 -64
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +163 -42
- package/src/components/VirtualTable/VirtualTableProps.tsx +21 -2
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +3 -0
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +19 -6
- package/src/components/VirtualTable/types.tsx +3 -0
- package/src/components/common/default_entity_actions.tsx +4 -0
- package/src/components/common/useColumnsIds.tsx +95 -3
- package/src/components/common/useDataSourceTableController.tsx +12 -4
- package/src/components/index.tsx +5 -0
- package/src/contexts/BreacrumbsContext.tsx +15 -8
- package/src/contexts/index.ts +10 -0
- package/src/core/DefaultAppBar.tsx +49 -32
- package/src/core/DefaultDrawer.tsx +49 -57
- package/src/core/DrawerNavigationGroup.tsx +120 -0
- package/src/core/DrawerNavigationItem.tsx +4 -3
- package/src/core/EntityEditView.tsx +94 -50
- package/src/core/EntityEditViewFormActions.tsx +24 -17
- package/src/core/EntitySidePanel.tsx +34 -30
- package/src/core/FireCMS.tsx +33 -6
- package/src/core/SideDialogs.tsx +4 -2
- package/src/core/field_configs.tsx +18 -11
- package/src/core/index.tsx +1 -0
- package/src/editor/components/SlashCommandMenu.tsx +516 -0
- package/src/editor/components/editor-bubble-item.tsx +32 -0
- package/src/editor/components/editor-bubble.tsx +118 -0
- package/src/editor/components/image-bubble.tsx +156 -0
- package/src/editor/components/index.ts +14 -0
- package/src/editor/components/table-bubble.tsx +165 -0
- package/src/editor/editor.tsx +455 -0
- package/src/editor/extensions/HighlightDecorationExtension.ts +114 -0
- package/src/editor/extensions/Image/index.ts +133 -0
- package/src/editor/extensions/Image.ts +159 -0
- package/src/editor/extensions/TextLoadingDecorationExtension.tsx +107 -0
- package/src/editor/extensions/clipboard.ts +72 -0
- package/src/editor/extensions/custom-keymap.ts +24 -0
- package/src/editor/extensions/drag-and-drop.tsx +480 -0
- package/src/editor/hooks/useProseMirror.ts +124 -0
- package/src/editor/hooks/useProseMirrorContext.ts +15 -0
- package/src/editor/index.ts +2 -0
- package/src/editor/markdown.ts +172 -0
- package/src/editor/nodeViews/ImageComponent.tsx +20 -0
- package/src/editor/nodeViews/ReactNodeView.tsx +89 -0
- package/src/editor/nodeViews/TaskItemComponent.tsx +29 -0
- package/src/editor/nodeViews/index.ts +35 -0
- package/src/editor/plugins/index.ts +58 -0
- package/src/editor/plugins/inputrules.ts +82 -0
- package/src/editor/plugins/placeholderPlugin.ts +55 -0
- package/src/editor/plugins/slashCommandPlugin.ts +61 -0
- package/src/editor/schema.ts +240 -0
- package/src/editor/selectors/ai-selector.tsx +111 -0
- package/src/editor/selectors/color-selector.tsx +200 -0
- package/src/editor/selectors/link-selector.tsx +118 -0
- package/src/editor/selectors/node-selector.tsx +157 -0
- package/src/editor/selectors/text-buttons.tsx +86 -0
- package/src/editor/types.ts +6 -0
- package/src/editor/useProseMirror.ts +126 -0
- package/src/editor/utils/prosemirror-utils.ts +108 -0
- package/src/editor/utils/remove_classes.ts +17 -0
- package/src/editor/utils/useDebouncedCallback.ts +25 -0
- package/src/form/EntityForm.tsx +149 -67
- package/src/form/EntityFormActions.tsx +19 -12
- package/src/form/PropertyFieldBinding.tsx +68 -51
- package/src/form/components/ErrorFocus.tsx +3 -3
- package/src/form/components/LocalChangesMenu.tsx +13 -13
- package/src/form/components/StorageItemPreview.tsx +5 -3
- package/src/form/components/StorageUploadProgress.tsx +18 -3
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +18 -5
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +22 -10
- package/src/form/field_bindings/BlockFieldBinding.tsx +26 -9
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +18 -17
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +46 -25
- package/src/form/field_bindings/MapFieldBinding.tsx +88 -70
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +93 -52
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +15 -1
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +25 -11
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +25 -11
- package/src/form/field_bindings/RepeatFieldBinding.tsx +21 -6
- package/src/form/field_bindings/SelectFieldBinding.tsx +7 -5
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +110 -92
- package/src/form/field_bindings/SwitchFieldBinding.tsx +31 -14
- package/src/form/field_bindings/TextFieldBinding.tsx +77 -38
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +7 -5
- package/src/form/validation.ts +245 -160
- package/src/hooks/index.tsx +1 -0
- package/src/hooks/useBreadcrumbsController.tsx +18 -0
- package/src/hooks/useBuildNavigationController.tsx +91 -41
- package/src/hooks/useCollapsedGroups.ts +18 -9
- package/src/hooks/useTranslation.ts +31 -0
- package/src/hooks/useValidateAuthenticator.tsx +1 -1
- package/src/i18n/FireCMSi18nProvider.tsx +160 -0
- package/src/index.ts +5 -0
- package/src/internal/useBuildDataSource.ts +68 -34
- package/src/internal/useBuildSideDialogsController.tsx +11 -8
- package/src/internal/useBuildSideEntityController.tsx +24 -24
- package/src/internal/useRestoreScroll.tsx +26 -14
- package/src/locales/de.ts +718 -0
- package/src/locales/en.ts +730 -0
- package/src/locales/es.ts +730 -0
- package/src/locales/fr.ts +718 -0
- package/src/locales/hi.ts +718 -0
- package/src/locales/it.ts +718 -0
- package/src/locales/pt.ts +727 -0
- package/src/preview/PropertyPreview.tsx +43 -33
- package/src/preview/PropertyPreviewProps.tsx +6 -0
- package/src/preview/components/DatePreview.tsx +72 -4
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +37 -21
- package/src/preview/components/ReferencePreview.tsx +2 -1
- package/src/preview/components/StorageThumbnail.tsx +16 -12
- package/src/preview/components/UrlComponentPreview.tsx +32 -27
- package/src/preview/components/UserPreview.tsx +3 -1
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +9 -7
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +11 -9
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +26 -24
- package/src/preview/property_previews/MapPropertyPreview.tsx +49 -27
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +61 -56
- package/src/routes/CustomCMSRoute.tsx +1 -0
- package/src/routes/FireCMSRoute.tsx +87 -65
- package/src/types/analytics.ts +10 -0
- package/src/types/collections.ts +97 -3
- package/src/types/customization_controller.tsx +2 -1
- package/src/types/datasource.ts +54 -56
- package/src/types/firecms.tsx +2 -1
- package/src/types/index.ts +1 -0
- package/src/types/navigation.ts +2 -2
- package/src/types/plugins.tsx +77 -1
- package/src/types/properties.ts +359 -37
- package/src/types/storage.ts +2 -1
- package/src/types/translations.ts +752 -0
- package/src/util/__tests__/conditions.test.ts +506 -0
- package/src/util/__tests__/objects.test.ts +196 -0
- package/src/util/callbacks.ts +6 -3
- package/src/util/collections.ts +51 -6
- package/src/util/conditions.ts +339 -0
- package/src/util/entities.ts +29 -30
- package/src/util/entity_cache.ts +2 -1
- package/src/util/index.ts +3 -1
- package/src/util/join_collections.ts +10 -8
- package/src/util/lazy_eager.tsx +33 -0
- package/src/util/objects.ts +46 -13
- package/src/util/{references.ts → previews.ts} +16 -2
- package/src/util/property_utils.tsx +37 -11
- package/src/util/resolutions.ts +62 -58
- package/src/util/useStorageUploadController.tsx +23 -29
- /package/dist/util/{references.d.ts → previews.d.ts} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, TextField } from "@firecms/ui";
|
|
3
|
+
import { useTranslation } from "../../hooks/useTranslation";
|
|
3
4
|
|
|
4
5
|
interface RenameGroupDialogProps {
|
|
5
6
|
open: boolean;
|
|
@@ -18,7 +19,8 @@ export function RenameGroupDialog({
|
|
|
18
19
|
}: RenameGroupDialogProps) {
|
|
19
20
|
const [name, setName] = useState(initialName);
|
|
20
21
|
const [error, setError] = useState<string | null>(null);
|
|
21
|
-
const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);
|
|
22
|
+
const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);
|
|
23
|
+
const { t } = useTranslation();
|
|
22
24
|
|
|
23
25
|
useEffect(() => {
|
|
24
26
|
if (open) {
|
|
@@ -38,9 +40,9 @@ export function RenameGroupDialog({
|
|
|
38
40
|
const newName = event.target.value;
|
|
39
41
|
setName(newName);
|
|
40
42
|
if (!newName.trim()) {
|
|
41
|
-
setError("
|
|
43
|
+
setError(t("group_name_empty_error"));
|
|
42
44
|
} else if (existingGroupNames.includes(newName.trim())) {
|
|
43
|
-
setError("
|
|
45
|
+
setError(t("group_name_exists_error"));
|
|
44
46
|
} else {
|
|
45
47
|
setError(null);
|
|
46
48
|
}
|
|
@@ -49,11 +51,11 @@ export function RenameGroupDialog({
|
|
|
49
51
|
const handleSave = () => {
|
|
50
52
|
const trimmedName = name.trim();
|
|
51
53
|
if (!trimmedName) {
|
|
52
|
-
setError("
|
|
54
|
+
setError(t("group_name_empty_error"));
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
57
|
if (existingGroupNames.includes(trimmedName)) {
|
|
56
|
-
setError("
|
|
58
|
+
setError(t("group_name_exists_error"));
|
|
57
59
|
return;
|
|
58
60
|
}
|
|
59
61
|
if (!error) {
|
|
@@ -70,9 +72,9 @@ export function RenameGroupDialog({
|
|
|
70
72
|
// because the error state might not have updated if the user types and immediately hits enter.
|
|
71
73
|
let currentError = null;
|
|
72
74
|
if (!trimmedName) {
|
|
73
|
-
currentError = "
|
|
75
|
+
currentError = t("group_name_empty_error");
|
|
74
76
|
} else if (existingGroupNames.includes(trimmedName)) {
|
|
75
|
-
currentError = "
|
|
77
|
+
currentError = t("group_name_exists_error");
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
if (!currentError && trimmedName) {
|
|
@@ -93,14 +95,14 @@ export function RenameGroupDialog({
|
|
|
93
95
|
|
|
94
96
|
return (
|
|
95
97
|
<Dialog open={open}>
|
|
96
|
-
<DialogTitle>
|
|
98
|
+
<DialogTitle>{t("rename_group")}</DialogTitle>
|
|
97
99
|
<DialogContent>
|
|
98
100
|
<TextField
|
|
99
|
-
inputRef={inputRef}
|
|
100
|
-
label="
|
|
101
|
+
inputRef={inputRef}
|
|
102
|
+
label={t("group_name_label")}
|
|
101
103
|
value={name}
|
|
102
104
|
onChange={handleNameChange}
|
|
103
|
-
onKeyDown={handleKeyDown}
|
|
105
|
+
onKeyDown={handleKeyDown}
|
|
104
106
|
error={!!error}
|
|
105
107
|
aria-describedby={error ? "group-name-error" : undefined}
|
|
106
108
|
/>
|
|
@@ -108,14 +110,12 @@ export function RenameGroupDialog({
|
|
|
108
110
|
</DialogContent>
|
|
109
111
|
<DialogActions>
|
|
110
112
|
<Button onClick={onClose}
|
|
111
|
-
color={"primary"}
|
|
112
113
|
variant="text">
|
|
113
|
-
|
|
114
|
+
{t("cancel")}
|
|
114
115
|
</Button>
|
|
115
116
|
<Button onClick={handleSave}
|
|
116
|
-
color={"primary"}
|
|
117
117
|
disabled={!!error || !name.trim()}>
|
|
118
|
-
|
|
118
|
+
{t("save")}
|
|
119
119
|
</Button>
|
|
120
120
|
</DialogActions>
|
|
121
121
|
</Dialog>
|
|
@@ -9,10 +9,10 @@ export type SmallNavigationCardProps = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export function SmallNavigationCard({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
name,
|
|
13
|
+
url,
|
|
14
|
+
icon,
|
|
15
|
+
}: SmallNavigationCardProps) {
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
@@ -28,17 +28,18 @@ export function SmallNavigationCard({
|
|
|
28
28
|
<div className="flex flex-row items-center flex-grow gap-2 ">
|
|
29
29
|
{icon}
|
|
30
30
|
|
|
31
|
-
<Typography gutterBottom variant="
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<Typography gutterBottom variant="subtitle1"
|
|
32
|
+
component="h2"
|
|
33
|
+
className="mb-0 ml-3 font-medium">
|
|
34
34
|
{name}
|
|
35
35
|
</Typography>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
|
-
<div className={"p-
|
|
39
|
-
<ArrowForwardIcon color="primary"/>
|
|
38
|
+
<div className={"p-2"}>
|
|
39
|
+
<ArrowForwardIcon color="primary" size={"small"} />
|
|
40
40
|
</div>
|
|
41
41
|
</Link>
|
|
42
42
|
|
|
43
43
|
</>);
|
|
44
44
|
}
|
|
45
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CheckIcon, IconButton, Menu, MenuItem, TranslateIcon, Typography } from "@firecms/ui";
|
|
3
|
+
import { useTranslation } from "../hooks";
|
|
4
|
+
|
|
5
|
+
export function LanguageToggle() {
|
|
6
|
+
const { i18n } = useTranslation();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Menu
|
|
10
|
+
trigger={<IconButton
|
|
11
|
+
color="inherit"
|
|
12
|
+
aria-label="Change language">
|
|
13
|
+
<TranslateIcon size="small" />
|
|
14
|
+
</IconButton>}>
|
|
15
|
+
<MenuItem onClick={() => i18n.changeLanguage("en")}>
|
|
16
|
+
<div className="flex w-full items-center justify-between gap-4">
|
|
17
|
+
{/* eslint-disable-next-line i18next/no-literal-string */}
|
|
18
|
+
<Typography variant="body2" className={i18n.language === "en" ? "font-bold" : ""}>English</Typography>
|
|
19
|
+
{i18n.language === "en" && <CheckIcon size="small" />}
|
|
20
|
+
</div>
|
|
21
|
+
</MenuItem>
|
|
22
|
+
<MenuItem onClick={() => i18n.changeLanguage("es")}>
|
|
23
|
+
<div className="flex w-full items-center justify-between gap-4">
|
|
24
|
+
{/* eslint-disable-next-line i18next/no-literal-string */}
|
|
25
|
+
<Typography variant="body2" className={i18n.language === "es" ? "font-bold" : ""}>Español</Typography>
|
|
26
|
+
{i18n.language === "es" && <CheckIcon size="small" />}
|
|
27
|
+
</div>
|
|
28
|
+
</MenuItem>
|
|
29
|
+
<MenuItem onClick={() => i18n.changeLanguage("de")}>
|
|
30
|
+
<div className="flex w-full items-center justify-between gap-4">
|
|
31
|
+
{/* eslint-disable-next-line i18next/no-literal-string */}
|
|
32
|
+
<Typography variant="body2" className={i18n.language === "de" ? "font-bold" : ""}>Deutsch</Typography>
|
|
33
|
+
{i18n.language === "de" && <CheckIcon size="small" />}
|
|
34
|
+
</div>
|
|
35
|
+
</MenuItem>
|
|
36
|
+
<MenuItem onClick={() => i18n.changeLanguage("fr")}>
|
|
37
|
+
<div className="flex w-full items-center justify-between gap-4">
|
|
38
|
+
{/* eslint-disable-next-line i18next/no-literal-string */}
|
|
39
|
+
<Typography variant="body2" className={i18n.language === "fr" ? "font-bold" : ""}>Français</Typography>
|
|
40
|
+
{i18n.language === "fr" && <CheckIcon size="small" />}
|
|
41
|
+
</div>
|
|
42
|
+
</MenuItem>
|
|
43
|
+
<MenuItem onClick={() => i18n.changeLanguage("it")}>
|
|
44
|
+
<div className="flex w-full items-center justify-between gap-4">
|
|
45
|
+
{/* eslint-disable-next-line i18next/no-literal-string */}
|
|
46
|
+
<Typography variant="body2" className={i18n.language === "it" ? "font-bold" : ""}>Italiano</Typography>
|
|
47
|
+
{i18n.language === "it" && <CheckIcon size="small" />}
|
|
48
|
+
</div>
|
|
49
|
+
</MenuItem>
|
|
50
|
+
<MenuItem onClick={() => i18n.changeLanguage("hi")}>
|
|
51
|
+
<div className="flex w-full items-center justify-between gap-4">
|
|
52
|
+
{/* eslint-disable-next-line i18next/no-literal-string */}
|
|
53
|
+
<Typography variant="body2" className={i18n.language === "hi" ? "font-bold" : ""}>हिन्दी</Typography>
|
|
54
|
+
{i18n.language === "hi" && <CheckIcon size="small" />}
|
|
55
|
+
</div>
|
|
56
|
+
</MenuItem>
|
|
57
|
+
<MenuItem onClick={() => i18n.changeLanguage("pt")}>
|
|
58
|
+
<div className="flex w-full items-center justify-between gap-4">
|
|
59
|
+
{/* eslint-disable-next-line i18next/no-literal-string */}
|
|
60
|
+
<Typography variant="body2" className={i18n.language === "pt" ? "font-bold" : ""}>Português</Typography>
|
|
61
|
+
{i18n.language === "pt" && <CheckIcon size="small" />}
|
|
62
|
+
</div>
|
|
63
|
+
</MenuItem>
|
|
64
|
+
</Menu>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Link } from "react-router-dom";
|
|
3
3
|
import { Button, Typography } from "@firecms/ui";
|
|
4
|
+
import { useTranslation } from "../hooks/useTranslation";
|
|
4
5
|
|
|
5
6
|
export function NotFoundPage() {
|
|
7
|
+
const { t } = useTranslation();
|
|
6
8
|
|
|
7
9
|
return (
|
|
8
10
|
<div className="flex w-full h-full">
|
|
@@ -10,15 +12,15 @@ export function NotFoundPage() {
|
|
|
10
12
|
>
|
|
11
13
|
<Typography variant={"h4"} align={"center"}
|
|
12
14
|
gutterBottom={true}>
|
|
13
|
-
|
|
15
|
+
{t("page_not_found")}
|
|
14
16
|
</Typography>
|
|
15
17
|
<Typography align={"center"} gutterBottom={true}>
|
|
16
|
-
|
|
18
|
+
{t("page_not_found_body")}
|
|
17
19
|
</Typography>
|
|
18
20
|
<Button
|
|
19
21
|
variant={"text"}
|
|
20
22
|
component={Link}
|
|
21
|
-
to={"/"}>
|
|
23
|
+
to={"/"}>{t("back_to_home")}</Button>
|
|
22
24
|
</div>
|
|
23
25
|
</div>
|
|
24
26
|
);
|
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
useDataSource,
|
|
13
13
|
useLargeLayout,
|
|
14
14
|
useNavigationController,
|
|
15
|
-
useSideEntityController
|
|
15
|
+
useSideEntityController,
|
|
16
|
+
useTranslation
|
|
16
17
|
} from "../../hooks";
|
|
17
18
|
import { ErrorView } from "../ErrorView";
|
|
18
19
|
import { AddIcon, Button, DialogActions, Typography } from "@firecms/ui";
|
|
@@ -101,6 +102,7 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
|
|
|
101
102
|
maxSelection,
|
|
102
103
|
}: ReferenceSelectionInnerProps<M>) {
|
|
103
104
|
|
|
105
|
+
const { t } = useTranslation();
|
|
104
106
|
const authController = useAuthController();
|
|
105
107
|
const sideDialogContext = useSideDialogContext();
|
|
106
108
|
const sideEntityController = useSideEntityController();
|
|
@@ -302,8 +304,8 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
|
|
|
302
304
|
collectionOrView={collection}
|
|
303
305
|
className={"text-surface-300 dark:text-surface-600"}/>
|
|
304
306
|
{collection.singularName
|
|
305
|
-
?
|
|
306
|
-
:
|
|
307
|
+
? t("select_specific", { name: collection.singularName })
|
|
308
|
+
: t("select_from", { name: collection.name })}
|
|
307
309
|
</Typography>}
|
|
308
310
|
defaultSize={collection.defaultSize}
|
|
309
311
|
properties={resolvedCollection.properties}
|
|
@@ -326,9 +328,8 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
|
|
|
326
328
|
</Typography>}
|
|
327
329
|
<Button
|
|
328
330
|
onClick={onDone}
|
|
329
|
-
color="primary"
|
|
330
331
|
variant="filled">
|
|
331
|
-
|
|
332
|
+
{t("done")}
|
|
332
333
|
</Button>
|
|
333
334
|
</DialogActions>
|
|
334
335
|
</div>
|
|
@@ -348,7 +349,7 @@ function ReferenceDialogActions({
|
|
|
348
349
|
onClear: () => void,
|
|
349
350
|
onNewClick: () => void
|
|
350
351
|
}) {
|
|
351
|
-
|
|
352
|
+
const { t } = useTranslation();
|
|
352
353
|
const authController = useAuthController();
|
|
353
354
|
|
|
354
355
|
const largeLayout = useLargeLayout();
|
|
@@ -363,25 +364,19 @@ function ReferenceDialogActions({
|
|
|
363
364
|
onClick && (largeLayout
|
|
364
365
|
? <Button
|
|
365
366
|
onClick={onClick}
|
|
366
|
-
startIcon={<AddIcon/>}
|
|
367
|
-
|
|
368
|
-
color="primary">
|
|
369
|
-
Add {collection.singularName ?? collection.name}
|
|
367
|
+
startIcon={<AddIcon/>}>
|
|
368
|
+
{t("add_specific", { name: collection.singularName ?? collection.name })}
|
|
370
369
|
</Button>
|
|
371
370
|
: <Button
|
|
372
|
-
onClick={onClick}
|
|
373
|
-
variant="outlined"
|
|
374
|
-
color="primary"
|
|
375
|
-
>
|
|
371
|
+
onClick={onClick}>
|
|
376
372
|
<AddIcon/>
|
|
377
373
|
</Button>);
|
|
378
374
|
|
|
379
375
|
return (
|
|
380
376
|
<>
|
|
381
377
|
<Button onClick={onClear}
|
|
382
|
-
variant={"text"}
|
|
383
|
-
|
|
384
|
-
Clear
|
|
378
|
+
variant={"text"}>
|
|
379
|
+
{t("clear")}
|
|
385
380
|
</Button>
|
|
386
381
|
{addButton}
|
|
387
382
|
</>
|
|
@@ -3,7 +3,7 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { Entity, EntityCollection, EntityReference, FilterValues } from "../types";
|
|
4
4
|
import { getReferenceFrom } from "../util";
|
|
5
5
|
import { PreviewSize, ReferencePreview } from "../preview";
|
|
6
|
-
import { useNavigationController, useReferenceDialog } from "../hooks";
|
|
6
|
+
import { useNavigationController, useReferenceDialog, useTranslation } from "../hooks";
|
|
7
7
|
import { Button, cls } from "@firecms/ui";
|
|
8
8
|
|
|
9
9
|
export type ReferenceWidgetProps<M extends Record<string, any>> = {
|
|
@@ -50,6 +50,7 @@ export function ReferenceWidget<M extends Record<string, any>>({
|
|
|
50
50
|
includeEntityLink
|
|
51
51
|
}: ReferenceWidgetProps<M>) {
|
|
52
52
|
|
|
53
|
+
const { t } = useTranslation();
|
|
53
54
|
const navigationController = useNavigationController();
|
|
54
55
|
|
|
55
56
|
const collection: EntityCollection | undefined = useMemo(() => {
|
|
@@ -136,18 +137,16 @@ export function ReferenceWidget<M extends Record<string, any>>({
|
|
|
136
137
|
"min-w-80 flex flex-col gap-4",
|
|
137
138
|
"relative transition-colors duration-200 ease-in rounded font-medium",
|
|
138
139
|
disabled ? "bg-opacity-50" : "hover:bg-opacity-75",
|
|
139
|
-
"text-opacity-50 dark:text-white dark:text-opacity-50",
|
|
140
|
+
"text-opacity-50 text-text-primary/50 dark:text-white dark:text-opacity-50 dark:text-white/50",
|
|
140
141
|
className
|
|
141
142
|
)}
|
|
142
143
|
>
|
|
143
144
|
|
|
144
145
|
{child}
|
|
145
146
|
{!value && <div className="justify-center text-left">
|
|
146
|
-
<Button
|
|
147
|
-
color="primary"
|
|
148
|
-
disabled={disabled}
|
|
147
|
+
<Button disabled={disabled}
|
|
149
148
|
onClick={onEntryClick}>
|
|
150
|
-
|
|
149
|
+
{t("edit_name", { name: name ?? "" })}
|
|
151
150
|
</Button>
|
|
152
151
|
</div>}
|
|
153
152
|
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { coolIconKeys, debounce, Icon, IconButton, iconKeys, SearchBar, Tooltip } from "@firecms/ui";
|
|
4
4
|
import { iconSynonyms, iconsSearch } from "../util";
|
|
5
|
+
import { useTranslation } from "../hooks/useTranslation";
|
|
5
6
|
|
|
6
7
|
const UPDATE_SEARCH_INDEX_WAIT_MS = 220;
|
|
7
8
|
|
|
@@ -22,6 +23,7 @@ export function SearchIconsView({
|
|
|
22
23
|
selectedIcon = "",
|
|
23
24
|
onIconSelected
|
|
24
25
|
}: SearchIconsProps) {
|
|
26
|
+
const { t } = useTranslation();
|
|
25
27
|
const [keys, setKeys] = React.useState<string[] | null>(null);
|
|
26
28
|
const [query, setQuery] = React.useState<string>("");
|
|
27
29
|
|
|
@@ -53,7 +55,7 @@ export function SearchIconsView({
|
|
|
53
55
|
autoFocus={false}
|
|
54
56
|
innerClassName={"w-full sticky top-0 z-10"}
|
|
55
57
|
onTextSearch={(value?: string) => setQuery(value ?? "")}
|
|
56
|
-
placeholder="
|
|
58
|
+
placeholder={t("search_for_more_icons")}
|
|
57
59
|
/>
|
|
58
60
|
|
|
59
61
|
<div className={"flex max-w-full flex-wrap mt-4"}>
|
|
@@ -93,6 +93,11 @@ export type SelectableTableProps<M extends Record<string, any>> = {
|
|
|
93
93
|
endAdornment?: React.ReactNode;
|
|
94
94
|
|
|
95
95
|
AddColumnComponent?: React.ComponentType;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Callback when columns are reordered via drag-and-drop
|
|
99
|
+
*/
|
|
100
|
+
onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
/**
|
|
@@ -120,41 +125,42 @@ export type SelectableTableProps<M extends Record<string, any>> = {
|
|
|
120
125
|
* @group Components
|
|
121
126
|
*/
|
|
122
127
|
export const SelectableTable = function SelectableTable<M extends Record<string, any>>
|
|
123
|
-
({
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
128
|
+
({
|
|
129
|
+
onValueChange,
|
|
130
|
+
cellRenderer,
|
|
131
|
+
onEntityClick,
|
|
132
|
+
onColumnResize,
|
|
133
|
+
hoverRow = true,
|
|
134
|
+
size = "m",
|
|
135
|
+
inlineEditing = false,
|
|
136
|
+
tableController:
|
|
137
|
+
{
|
|
138
|
+
data,
|
|
139
|
+
dataLoading,
|
|
140
|
+
noMoreToLoad,
|
|
141
|
+
dataLoadingError,
|
|
142
|
+
filterValues,
|
|
143
|
+
setFilterValues,
|
|
144
|
+
sortBy,
|
|
145
|
+
setSortBy,
|
|
146
|
+
itemCount,
|
|
147
|
+
setItemCount,
|
|
148
|
+
pageSize = 50,
|
|
149
|
+
paginationEnabled,
|
|
150
|
+
checkFilterCombination,
|
|
151
|
+
setPopupCell
|
|
152
|
+
},
|
|
153
|
+
filterable = true,
|
|
154
|
+
onScroll,
|
|
155
|
+
initialScroll,
|
|
156
|
+
emptyComponent,
|
|
157
|
+
columns,
|
|
158
|
+
forceFilter,
|
|
159
|
+
highlightedRow,
|
|
160
|
+
endAdornment,
|
|
161
|
+
AddColumnComponent,
|
|
162
|
+
onColumnsOrderChange
|
|
163
|
+
}: SelectableTableProps<M>) {
|
|
158
164
|
|
|
159
165
|
const ref = useRef<HTMLDivElement>(null);
|
|
160
166
|
|
|
@@ -224,7 +230,7 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
|
|
|
224
230
|
<SelectableTableContext.Provider
|
|
225
231
|
value={contextValue}>
|
|
226
232
|
<div className="h-full w-full flex flex-col bg-white dark:bg-surface-950"
|
|
227
|
-
|
|
233
|
+
ref={ref}>
|
|
228
234
|
|
|
229
235
|
<VirtualTable
|
|
230
236
|
data={data}
|
|
@@ -247,12 +253,13 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
|
|
|
247
253
|
checkFilterCombination={checkFilterCombination}
|
|
248
254
|
createFilterField={filterable ? createFilterField : undefined}
|
|
249
255
|
rowClassName={useCallback((entity: Entity<M>) => {
|
|
250
|
-
return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
|
|
256
|
+
return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 bg-surface-100/75 dark:bg-surface-800 dark:bg-opacity-75 dark:bg-surface-800/75" : "";
|
|
251
257
|
}, [highlightedRow])}
|
|
252
258
|
className="flex-grow"
|
|
253
259
|
emptyComponent={emptyComponent}
|
|
254
260
|
endAdornment={endAdornment}
|
|
255
261
|
AddColumnComponent={AddColumnComponent}
|
|
262
|
+
onColumnsOrderChange={onColumnsOrderChange}
|
|
256
263
|
/>
|
|
257
264
|
|
|
258
265
|
</div>
|
|
@@ -262,13 +269,13 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
|
|
|
262
269
|
};
|
|
263
270
|
|
|
264
271
|
function createFilterField({
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
+
id,
|
|
273
|
+
filterValue,
|
|
274
|
+
setFilterValue,
|
|
275
|
+
column,
|
|
276
|
+
hidden,
|
|
277
|
+
setHidden
|
|
278
|
+
}: FilterFormFieldProps<{
|
|
272
279
|
resolvedProperty: ResolvedProperty,
|
|
273
280
|
disabled: boolean,
|
|
274
281
|
}>): React.ReactNode {
|
|
@@ -286,40 +293,41 @@ function createFilterField({
|
|
|
286
293
|
}
|
|
287
294
|
if (baseProperty.dataType === "reference") {
|
|
288
295
|
return <ReferenceFilterField value={filterValue}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
setValue={setFilterValue}
|
|
297
|
+
name={id as string}
|
|
298
|
+
isArray={isArray}
|
|
299
|
+
path={baseProperty.path}
|
|
300
|
+
title={resolvedProperty?.name}
|
|
301
|
+
includeId={baseProperty.includeId}
|
|
302
|
+
previewProperties={baseProperty?.previewProperties}
|
|
303
|
+
hidden={hidden}
|
|
304
|
+
setHidden={setHidden} />;
|
|
298
305
|
} else if (baseProperty.dataType === "number" || baseProperty.dataType === "string") {
|
|
299
306
|
const name = baseProperty.name;
|
|
300
307
|
const enumValues = baseProperty.enumValues ? enumToObjectEntries(baseProperty.enumValues) : undefined;
|
|
301
308
|
return <StringNumberFilterField value={filterValue}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
309
|
+
setValue={setFilterValue}
|
|
310
|
+
name={id as string}
|
|
311
|
+
dataType={baseProperty.dataType}
|
|
312
|
+
isArray={isArray}
|
|
313
|
+
enumValues={enumValues}
|
|
314
|
+
title={name} />;
|
|
308
315
|
} else if (baseProperty.dataType === "boolean") {
|
|
309
316
|
const name = baseProperty.name;
|
|
310
317
|
return <BooleanFilterField value={filterValue}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
318
|
+
setValue={setFilterValue}
|
|
319
|
+
name={id as string}
|
|
320
|
+
title={name} />;
|
|
314
321
|
|
|
315
322
|
} else if (baseProperty.dataType === "date") {
|
|
316
323
|
const title = baseProperty.name;
|
|
317
324
|
return <DateTimeFilterField value={filterValue}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
325
|
+
setValue={setFilterValue}
|
|
326
|
+
name={id as string}
|
|
327
|
+
mode={baseProperty.mode}
|
|
328
|
+
isArray={isArray}
|
|
329
|
+
timezone={baseProperty.timezone}
|
|
330
|
+
title={title} />;
|
|
323
331
|
}
|
|
324
332
|
|
|
325
333
|
return (
|
|
@@ -10,11 +10,11 @@ interface BooleanFieldProps {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function BooleanFilterField({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
name,
|
|
14
|
+
title,
|
|
15
|
+
value,
|
|
16
|
+
setValue
|
|
17
|
+
}: BooleanFieldProps) {
|
|
18
18
|
|
|
19
19
|
function updateFilter(val?: boolean) {
|
|
20
20
|
if (val !== undefined) {
|
|
@@ -32,8 +32,9 @@ export function BooleanFilterField({
|
|
|
32
32
|
const valueSet = !!value;
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<div className="w-
|
|
35
|
+
<div className="w-full">
|
|
36
36
|
<BooleanSwitchWithLabel
|
|
37
|
+
size={"medium"}
|
|
37
38
|
value={valueSetToTrue}
|
|
38
39
|
allowIndeterminate={true}
|
|
39
40
|
onValueChange={(v: boolean | null) => updateFilter(v === null ? undefined : v)}
|