@vertesia/ui 0.67.0 → 0.68.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/lib/esm/core/components/Badge.js +1 -1
- package/lib/esm/core/components/Badge.js.map +1 -1
- package/lib/esm/core/components/FormItem.js +2 -2
- package/lib/esm/core/components/FormItem.js.map +1 -1
- package/lib/esm/core/components/InputList.js +2 -2
- package/lib/esm/core/components/InputList.js.map +1 -1
- package/lib/esm/core/components/shadcn/checkbox.js +1 -1
- package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
- package/lib/esm/core/components/shadcn/command.js +1 -1
- package/lib/esm/core/components/shadcn/command.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +6 -6
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js +129 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js +46 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js +23 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js +28 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js +5 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js +101 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/{stringListFilter.js → filter/StringListFilter.js} +3 -3
- package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/{textFilter.js → filter/TextFilter.js} +4 -4
- package/lib/esm/core/components/shadcn/filters/filter/TextFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js +161 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js +88 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filterBar.js +128 -87
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filters.js +7 -6
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/index.js +1 -1
- package/lib/esm/core/components/shadcn/filters/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/types.js.map +1 -1
- package/lib/esm/core/components/toast/NotificationPanel.js +24 -18
- package/lib/esm/core/components/toast/NotificationPanel.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +47 -27
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +9 -3
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +7 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +12 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +2 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +10 -4
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
- package/lib/esm/features/facets/DocumentsFacetsNav.js +133 -0
- package/lib/esm/features/facets/DocumentsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/RunsFacetsNav.js +125 -0
- package/lib/esm/features/facets/RunsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/VFacetsNav.js +4 -113
- package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/VStringFacet.js +6 -4
- package/lib/esm/features/facets/VStringFacet.js.map +1 -1
- package/lib/esm/features/facets/VTypeFacet.js +4 -5
- package/lib/esm/features/facets/VTypeFacet.js.map +1 -1
- package/lib/esm/features/facets/VUserFacet.js +1 -1
- package/lib/esm/features/facets/VUserFacet.js.map +1 -1
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js +98 -0
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/index.js +3 -2
- package/lib/esm/features/facets/index.js.map +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +10 -9
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js +10 -9
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js +0 -1
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +37 -2
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +0 -2
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocument.js +2 -2
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +16 -4
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +72 -37
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +15 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +8 -8
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/router/HistoryNavigator.js +2 -2
- package/lib/esm/router/HistoryNavigator.js.map +1 -1
- package/lib/esm/shell/SplashScreen.js +19 -0
- package/lib/esm/shell/SplashScreen.js.map +1 -0
- package/lib/esm/shell/VertesiaShell.js +10 -0
- package/lib/esm/shell/VertesiaShell.js.map +1 -0
- package/lib/esm/shell/index.js +7 -0
- package/lib/esm/shell/index.js.map +1 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js +81 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js.map +1 -0
- package/lib/esm/shell/login/GitHubSignInButton.js +24 -0
- package/lib/esm/shell/login/GitHubSignInButton.js.map +1 -0
- package/lib/esm/shell/login/GoogleSignInButton.js +25 -0
- package/lib/esm/shell/login/GoogleSignInButton.js.map +1 -0
- package/lib/esm/shell/login/InviteAcceptModal.js +45 -0
- package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js +19 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js.map +1 -0
- package/lib/esm/shell/login/PreviewIcon.js +23 -0
- package/lib/esm/shell/login/PreviewIcon.js.map +1 -0
- package/lib/esm/shell/login/SignInModal.js +9 -0
- package/lib/esm/shell/login/SignInModal.js.map +1 -0
- package/lib/esm/shell/login/SigninScreen.js +64 -0
- package/lib/esm/shell/login/SigninScreen.js.map +1 -0
- package/lib/esm/shell/login/SignupForm.js +91 -0
- package/lib/esm/shell/login/SignupForm.js.map +1 -0
- package/lib/esm/shell/login/TerminalLogin.js +179 -0
- package/lib/esm/shell/login/TerminalLogin.js.map +1 -0
- package/lib/esm/shell/login/UserInfo.js +40 -0
- package/lib/esm/shell/login/UserInfo.js.map +1 -0
- package/lib/esm/shell/login/UserSessionMenu.js +31 -0
- package/lib/esm/shell/login/UserSessionMenu.js.map +1 -0
- package/lib/esm/shell/utils.js +6 -0
- package/lib/esm/shell/utils.js.map +1 -0
- package/lib/esm/widgets/SvgIcon.js +36 -0
- package/lib/esm/widgets/SvgIcon.js.map +1 -0
- package/lib/esm/widgets/index.js +7 -6
- package/lib/esm/widgets/index.js.map +1 -1
- package/lib/esm/widgets/upload/UploadSummary.js +1 -1
- package/lib/esm/widgets/upload/UploadSummary.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/FormItem.d.ts +2 -1
- package/lib/types/core/components/shadcn/dialog.d.ts +2 -1
- package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +1 -1
- package/lib/types/core/components/shadcn/filters/comboBox/DateCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/SelectCombobox.d.ts +8 -0
- package/lib/types/core/components/shadcn/filters/comboBox/StringListCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/TextCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/comboBox.d.ts +4 -0
- package/lib/types/core/components/shadcn/filters/{selectFilter.d.ts → filter/SelectFilter.d.ts} +2 -2
- package/lib/types/core/components/shadcn/filters/{stringListFilter.d.ts → filter/StringListFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/{textFilter.d.ts → filter/TextFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/{dateFilter.d.ts → filter/dateFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/filter-styles.d.ts +1 -0
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts +14 -4
- package/lib/types/core/components/shadcn/filters/index.d.ts +1 -1
- package/lib/types/core/components/shadcn/filters/types.d.ts +2 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +17 -8
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +2 -1
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts +16 -0
- package/lib/types/features/facets/RunsFacetsNav.d.ts +18 -0
- package/lib/types/features/facets/VFacetsNav.d.ts +1 -1
- package/lib/types/features/facets/VStringFacet.d.ts +6 -2
- package/lib/types/features/facets/VTypeFacet.d.ts +3 -1
- package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts +13 -0
- package/lib/types/features/facets/index.d.ts +3 -2
- package/lib/types/shell/SplashScreen.d.ts +4 -0
- package/lib/types/shell/VertesiaShell.d.ts +7 -0
- package/lib/types/shell/index.d.ts +6 -0
- package/lib/types/shell/login/EnterpriseSigninButton.d.ts +5 -0
- package/lib/types/shell/login/GitHubSignInButton.d.ts +5 -0
- package/lib/types/shell/login/GoogleSignInButton.d.ts +5 -0
- package/lib/types/shell/login/InviteAcceptModal.d.ts +1 -0
- package/lib/types/shell/login/MicrosoftSigninButton.d.ts +5 -0
- package/lib/types/shell/login/PreviewIcon.d.ts +5 -0
- package/lib/types/shell/login/SignInModal.d.ts +6 -0
- package/lib/types/shell/login/SigninScreen.d.ts +8 -0
- package/lib/types/shell/login/SignupForm.d.ts +7 -0
- package/lib/types/shell/login/TerminalLogin.d.ts +1 -0
- package/lib/types/shell/login/UserInfo.d.ts +5 -0
- package/lib/types/shell/login/UserSessionMenu.d.ts +8 -0
- package/lib/types/shell/utils.d.ts +1 -0
- package/lib/types/widgets/SvgIcon.d.ts +6 -0
- package/lib/types/widgets/index.d.ts +7 -6
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-shell.js +2 -0
- package/lib/vertesia-ui-shell.js.map +1 -0
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +14 -6
- package/src/core/components/Badge.tsx +12 -8
- package/src/core/components/FormItem.tsx +4 -3
- package/src/core/components/InputList.tsx +21 -17
- package/src/core/components/shadcn/checkbox.tsx +2 -2
- package/src/core/components/shadcn/command.tsx +1 -1
- package/src/core/components/shadcn/dialog.tsx +18 -9
- package/src/core/components/shadcn/filters/DynamicLabel.tsx +1 -2
- package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +211 -0
- package/src/core/components/shadcn/filters/{comboBox.tsx → comboBox/SelectCombobox.tsx} +8 -192
- package/src/core/components/shadcn/filters/comboBox/StringListCombobox.tsx +76 -0
- package/src/core/components/shadcn/filters/comboBox/TextCombobox.tsx +81 -0
- package/src/core/components/shadcn/filters/comboBox/comboBox.tsx +4 -0
- package/src/core/components/shadcn/filters/filter/SelectFilter.tsx +161 -0
- package/src/core/components/shadcn/filters/{stringListFilter.tsx → filter/StringListFilter.tsx} +7 -7
- package/src/core/components/shadcn/filters/{textFilter.tsx → filter/TextFilter.tsx} +17 -11
- package/src/core/components/shadcn/filters/filter/dateFilter.tsx +256 -0
- package/src/core/components/shadcn/filters/filter-styles.ts +87 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +208 -152
- package/src/core/components/shadcn/filters/filters.tsx +7 -5
- package/src/core/components/shadcn/filters/index.ts +1 -1
- package/src/core/components/shadcn/filters/types.ts +2 -0
- package/src/core/components/toast/NotificationPanel.tsx +38 -22
- package/src/features/agent/PayloadBuilder.tsx +56 -31
- package/src/features/agent/chat/ModernAgentConversation.tsx +10 -4
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +7 -6
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +12 -1
- package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +2 -1
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +12 -4
- package/src/features/facets/DocumentsFacetsNav.tsx +171 -0
- package/src/features/facets/RunsFacetsNav.tsx +166 -0
- package/src/features/facets/VFacetsNav.tsx +10 -126
- package/src/features/facets/VStringFacet.tsx +10 -4
- package/src/features/facets/VTypeFacet.tsx +6 -5
- package/src/features/facets/VUserFacet.tsx +5 -3
- package/src/features/facets/WorkflowExecutionsFacetsNav.tsx +132 -0
- package/src/features/facets/index.ts +5 -2
- package/src/features/store/collections/CollectionsTable.tsx +3 -2
- package/src/features/store/collections/CreateCollection.tsx +17 -15
- package/src/features/store/collections/EditCollectionView.tsx +19 -16
- package/src/features/store/collections/SelectCollection.tsx +1 -1
- package/src/features/store/objects/DocumentPreviewPanel.tsx +0 -1
- package/src/features/store/objects/DocumentSearchResults.tsx +80 -11
- package/src/features/store/objects/components/ContentOverview.tsx +0 -2
- package/src/features/store/objects/components/SelectDocument.tsx +2 -2
- package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +40 -19
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +160 -214
- package/src/features/store/types/ObjectSchemaEditor.tsx +15 -0
- package/src/features/user/UserInfo.tsx +17 -14
- package/src/router/HistoryNavigator.ts +2 -2
- package/src/shell/SplashScreen.tsx +41 -0
- package/src/shell/VertesiaShell.tsx +27 -0
- package/src/shell/index.tsx +6 -0
- package/src/shell/login/EnterpriseSigninButton.tsx +106 -0
- package/src/shell/login/GitHubSignInButton.tsx +40 -0
- package/src/shell/login/GoogleSignInButton.tsx +36 -0
- package/src/shell/login/InviteAcceptModal.tsx +78 -0
- package/src/shell/login/MicrosoftSigninButton.tsx +30 -0
- package/src/shell/login/PreviewIcon.tsx +29 -0
- package/src/shell/login/SignInModal.tsx +28 -0
- package/src/shell/login/SigninScreen.tsx +162 -0
- package/src/shell/login/SignupForm.tsx +178 -0
- package/src/shell/login/TerminalLogin.tsx +299 -0
- package/src/shell/login/UserInfo.tsx +76 -0
- package/src/shell/login/UserSessionMenu.tsx +81 -0
- package/src/shell/utils.tsx +7 -0
- package/src/widgets/SvgIcon.tsx +44 -0
- package/src/widgets/index.ts +7 -6
- package/src/widgets/upload/UploadSummary.tsx +3 -4
- package/lib/esm/core/components/shadcn/filters/comboBox.js +0 -101
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/dateFilter.js +0 -36
- package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +0 -67
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +0 -1
- package/lib/esm/features/facets/InteractionFacet.js +0 -39
- package/lib/esm/features/facets/InteractionFacet.js.map +0 -1
- package/lib/esm/features/facets/TypeOptions.js +0 -19
- package/lib/esm/features/facets/TypeOptions.js.map +0 -1
- package/lib/esm/features/facets/UserFacet.js +0 -33
- package/lib/esm/features/facets/UserFacet.js.map +0 -1
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +0 -22
- package/lib/types/features/facets/InteractionFacet.d.ts +0 -9
- package/lib/types/features/facets/TypeOptions.d.ts +0 -3
- package/lib/types/features/facets/UserFacet.d.ts +0 -11
- package/src/core/components/shadcn/filters/dateFilter.tsx +0 -82
- package/src/core/components/shadcn/filters/selectFilter.tsx +0 -110
- package/src/features/facets/InteractionFacet.tsx +0 -53
- package/src/features/facets/TypeOptions.tsx +0 -22
- package/src/features/facets/UserFacet.tsx +0 -61
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { useRef, useState } from "react";
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../command";
|
|
9
|
-
import { Input } from "../input";
|
|
10
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../popover";
|
|
11
|
-
import { AnimateChangeInHeight } from "./animateChangeInHeight";
|
|
12
|
-
import { FilterGroupOption, FilterOption } from "./types";
|
|
13
|
-
import { DynamicLabel } from "./DynamicLabel";
|
|
14
|
-
import { InputList } from "../../index";
|
|
15
|
-
|
|
2
|
+
import { Checkbox } from "../../checkbox";
|
|
3
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../../command";
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover";
|
|
5
|
+
import { AnimateChangeInHeight } from "../animateChangeInHeight";
|
|
6
|
+
import { FilterGroupOption, FilterOption } from "../types";
|
|
7
|
+
import { DynamicLabel } from "../DynamicLabel";
|
|
16
8
|
|
|
17
9
|
export const SelectionCombobox = ({
|
|
18
10
|
filterType,
|
|
@@ -33,6 +25,7 @@ export const SelectionCombobox = ({
|
|
|
33
25
|
const nonSelectedFilterValues = options?.filter(
|
|
34
26
|
(option) => !filterValues.some(filter => filter.value === option.value)
|
|
35
27
|
);
|
|
28
|
+
|
|
36
29
|
return (
|
|
37
30
|
<Popover
|
|
38
31
|
_open={open}
|
|
@@ -93,7 +86,7 @@ export const SelectionCombobox = ({
|
|
|
93
86
|
setOpen(false);
|
|
94
87
|
}}
|
|
95
88
|
>
|
|
96
|
-
<
|
|
89
|
+
<input type="checkbox" checked={true} onChange={() => {}} />
|
|
97
90
|
<DynamicLabel
|
|
98
91
|
value={value.value || ''}
|
|
99
92
|
labelRenderer={labelRenderer}
|
|
@@ -149,181 +142,4 @@ export const SelectionCombobox = ({
|
|
|
149
142
|
</PopoverContent>
|
|
150
143
|
</Popover>
|
|
151
144
|
);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export const DateCombobox = ({
|
|
155
|
-
filterValues,
|
|
156
|
-
setFilterValues,
|
|
157
|
-
}: {
|
|
158
|
-
filterValues: string[];
|
|
159
|
-
setFilterValues: (values: string[]) => void;
|
|
160
|
-
}) => {
|
|
161
|
-
const [open, setOpen] = useState(false);
|
|
162
|
-
const selectedDate = filterValues[0] ? new Date(filterValues[0]) : undefined;
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
<Popover _open={open} onOpenChange={setOpen}>
|
|
166
|
-
<PopoverTrigger
|
|
167
|
-
className="rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition"
|
|
168
|
-
>
|
|
169
|
-
<div className="flex gap-1.5 items-center">
|
|
170
|
-
{selectedDate ? (
|
|
171
|
-
dayjs(selectedDate).format("MMM D, YYYY")
|
|
172
|
-
) : (
|
|
173
|
-
<span>Pick a date</span>
|
|
174
|
-
)}
|
|
175
|
-
</div>
|
|
176
|
-
</PopoverTrigger>
|
|
177
|
-
<PopoverContent className="w-auto p-0" align="start">
|
|
178
|
-
<Calendar
|
|
179
|
-
className="p-0"
|
|
180
|
-
value={selectedDate}
|
|
181
|
-
onChange={(date) => {
|
|
182
|
-
if (date) {
|
|
183
|
-
const actualDate = Array.isArray(date) ? date[0] : date;
|
|
184
|
-
if (actualDate) {
|
|
185
|
-
setFilterValues([dayjs(actualDate).format("YYYY-MM-DD")]);
|
|
186
|
-
setOpen(false);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}}
|
|
190
|
-
/>
|
|
191
|
-
</PopoverContent>
|
|
192
|
-
</Popover>
|
|
193
|
-
);
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
export const TextCombobox = ({
|
|
197
|
-
filterType,
|
|
198
|
-
filterValue,
|
|
199
|
-
setFilterValue,
|
|
200
|
-
}: {
|
|
201
|
-
filterType: string;
|
|
202
|
-
filterValue: string;
|
|
203
|
-
setFilterValue: (value: string) => void;
|
|
204
|
-
}) => {
|
|
205
|
-
const [open, setOpen] = useState(false);
|
|
206
|
-
const [inputValue, setInputValue] = useState(filterValue);
|
|
207
|
-
|
|
208
|
-
const handleKeyDown = (event: React.KeyboardEvent) => {
|
|
209
|
-
if (event.key === "Enter") {
|
|
210
|
-
setFilterValue(inputValue);
|
|
211
|
-
setOpen(false);
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
return (
|
|
216
|
-
<Popover
|
|
217
|
-
_open={open}
|
|
218
|
-
onOpenChange={(open) => {
|
|
219
|
-
setOpen(open);
|
|
220
|
-
if (!open && inputValue !== filterValue) {
|
|
221
|
-
setInputValue(filterValue);
|
|
222
|
-
}
|
|
223
|
-
}}
|
|
224
|
-
>
|
|
225
|
-
<PopoverTrigger
|
|
226
|
-
className="rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition"
|
|
227
|
-
>
|
|
228
|
-
<div className="flex gap-1.5 items-center">
|
|
229
|
-
{filterValue || "Enter text..."}
|
|
230
|
-
</div>
|
|
231
|
-
</PopoverTrigger>
|
|
232
|
-
<PopoverContent className="w-[300px] p-3">
|
|
233
|
-
<div className="flex flex-col gap-1">
|
|
234
|
-
<div className="flex items-center p-1.5 text-xs text-muted">
|
|
235
|
-
<span>{filterType}</span>
|
|
236
|
-
</div>
|
|
237
|
-
<Input autoFocus
|
|
238
|
-
type="text" size={"sm"}
|
|
239
|
-
value={inputValue}
|
|
240
|
-
onChange={setInputValue}
|
|
241
|
-
onKeyDown={handleKeyDown}
|
|
242
|
-
placeholder="Enter text..."
|
|
243
|
-
/>
|
|
244
|
-
<Button
|
|
245
|
-
size="sm" variant={"outline"}
|
|
246
|
-
onClick={() => {
|
|
247
|
-
setFilterValue(inputValue);
|
|
248
|
-
setOpen(false);
|
|
249
|
-
}}
|
|
250
|
-
>
|
|
251
|
-
Apply
|
|
252
|
-
</Button>
|
|
253
|
-
</div>
|
|
254
|
-
</PopoverContent>
|
|
255
|
-
</Popover>
|
|
256
|
-
);
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
export const StringListCombobox = ({
|
|
260
|
-
filterType,
|
|
261
|
-
filterValues,
|
|
262
|
-
setFilterValues,
|
|
263
|
-
}: {
|
|
264
|
-
filterType: string;
|
|
265
|
-
filterValues: string[];
|
|
266
|
-
setFilterValues: (values: string[]) => void;
|
|
267
|
-
}) => {
|
|
268
|
-
const [open, setOpen] = useState(false);
|
|
269
|
-
const [tags, setTags] = useState<string[]>(filterValues);
|
|
270
|
-
|
|
271
|
-
const handleApply = () => {
|
|
272
|
-
setFilterValues(tags);
|
|
273
|
-
setOpen(false);
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
return (
|
|
277
|
-
<Popover
|
|
278
|
-
_open={open}
|
|
279
|
-
onOpenChange={(open) => {
|
|
280
|
-
setOpen(open);
|
|
281
|
-
if (!open && JSON.stringify(tags) !== JSON.stringify(filterValues)) {
|
|
282
|
-
setTags(filterValues);
|
|
283
|
-
}
|
|
284
|
-
}}
|
|
285
|
-
>
|
|
286
|
-
<PopoverTrigger
|
|
287
|
-
className="rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition"
|
|
288
|
-
>
|
|
289
|
-
<div className="flex gap-1.5 items-center">
|
|
290
|
-
{filterValues.length > 0 ? (
|
|
291
|
-
filterValues.length === 1 ? filterValues[0] : `${filterValues.length} tags`
|
|
292
|
-
) : (
|
|
293
|
-
"Add tags..."
|
|
294
|
-
)}
|
|
295
|
-
</div>
|
|
296
|
-
</PopoverTrigger>
|
|
297
|
-
<PopoverContent className="w-[300px] p-3">
|
|
298
|
-
<div className="flex flex-col gap-3">
|
|
299
|
-
<div className="flex items-center p-1.5 text-xs text-muted">
|
|
300
|
-
<span>{filterType}</span>
|
|
301
|
-
</div>
|
|
302
|
-
<InputList
|
|
303
|
-
value={tags}
|
|
304
|
-
onChange={setTags}
|
|
305
|
-
placeholder={`Add ${filterType.toLowerCase()}...`}
|
|
306
|
-
/>
|
|
307
|
-
<div className="flex gap-2 justify-end">
|
|
308
|
-
<Button
|
|
309
|
-
size="sm"
|
|
310
|
-
variant="ghost"
|
|
311
|
-
onClick={() => {
|
|
312
|
-
setTags(filterValues);
|
|
313
|
-
setOpen(false);
|
|
314
|
-
}}
|
|
315
|
-
>
|
|
316
|
-
Cancel
|
|
317
|
-
</Button>
|
|
318
|
-
<Button
|
|
319
|
-
size="sm"
|
|
320
|
-
onClick={handleApply}
|
|
321
|
-
>
|
|
322
|
-
Apply
|
|
323
|
-
</Button>
|
|
324
|
-
</div>
|
|
325
|
-
</div>
|
|
326
|
-
</PopoverContent>
|
|
327
|
-
</Popover>
|
|
328
|
-
);
|
|
329
145
|
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover";
|
|
4
|
+
import { InputList } from "../../../index";
|
|
5
|
+
|
|
6
|
+
export const StringListCombobox = ({
|
|
7
|
+
filterType,
|
|
8
|
+
filterValues,
|
|
9
|
+
setFilterValues,
|
|
10
|
+
}: {
|
|
11
|
+
filterType: string;
|
|
12
|
+
filterValues: string[];
|
|
13
|
+
setFilterValues: (values: string[]) => void;
|
|
14
|
+
}) => {
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
16
|
+
const [tags, setTags] = useState<string[]>(filterValues);
|
|
17
|
+
|
|
18
|
+
const handleApply = () => {
|
|
19
|
+
setFilterValues(tags);
|
|
20
|
+
setOpen(false);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Popover
|
|
25
|
+
_open={open}
|
|
26
|
+
onOpenChange={(open) => {
|
|
27
|
+
setOpen(open);
|
|
28
|
+
if (!open && JSON.stringify(tags) !== JSON.stringify(filterValues)) {
|
|
29
|
+
setTags(filterValues);
|
|
30
|
+
}
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<PopoverTrigger
|
|
34
|
+
className="rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition"
|
|
35
|
+
>
|
|
36
|
+
<div className="flex gap-1.5 items-center">
|
|
37
|
+
{filterValues.length > 0 ? (
|
|
38
|
+
filterValues.length === 1 ? filterValues[0] : `${filterValues.length} tags`
|
|
39
|
+
) : (
|
|
40
|
+
"Add tags..."
|
|
41
|
+
)}
|
|
42
|
+
</div>
|
|
43
|
+
</PopoverTrigger>
|
|
44
|
+
<PopoverContent className="w-[300px] p-3">
|
|
45
|
+
<div className="flex flex-col gap-3">
|
|
46
|
+
<div className="flex items-center p-1.5 text-xs text-muted">
|
|
47
|
+
<span>{filterType}</span>
|
|
48
|
+
</div>
|
|
49
|
+
<InputList
|
|
50
|
+
value={tags}
|
|
51
|
+
onChange={setTags}
|
|
52
|
+
placeholder={`Add ${filterType.toLowerCase()}...`}
|
|
53
|
+
/>
|
|
54
|
+
<div className="flex gap-2 justify-end">
|
|
55
|
+
<Button
|
|
56
|
+
size="sm"
|
|
57
|
+
variant="ghost"
|
|
58
|
+
onClick={() => {
|
|
59
|
+
setTags(filterValues);
|
|
60
|
+
setOpen(false);
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
Cancel
|
|
64
|
+
</Button>
|
|
65
|
+
<Button
|
|
66
|
+
size="sm"
|
|
67
|
+
onClick={handleApply}
|
|
68
|
+
>
|
|
69
|
+
Apply
|
|
70
|
+
</Button>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</PopoverContent>
|
|
74
|
+
</Popover>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { Input } from "../../input";
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover";
|
|
5
|
+
|
|
6
|
+
export const TextCombobox = ({
|
|
7
|
+
filterType,
|
|
8
|
+
filterValue,
|
|
9
|
+
setFilterValue,
|
|
10
|
+
}: {
|
|
11
|
+
filterType: string;
|
|
12
|
+
filterValue: string;
|
|
13
|
+
setFilterValue: (value: string) => void;
|
|
14
|
+
}) => {
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
16
|
+
const [inputValue, setInputValue] = useState(filterValue);
|
|
17
|
+
|
|
18
|
+
const handleKeyDown = (event: React.KeyboardEvent) => {
|
|
19
|
+
if (event.key === "Enter") {
|
|
20
|
+
setFilterValue(inputValue);
|
|
21
|
+
setOpen(false);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Popover
|
|
27
|
+
_open={open}
|
|
28
|
+
onOpenChange={(open) => {
|
|
29
|
+
setOpen(open);
|
|
30
|
+
if (!open && inputValue !== filterValue) {
|
|
31
|
+
setInputValue(filterValue);
|
|
32
|
+
}
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<PopoverTrigger
|
|
36
|
+
className="rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition"
|
|
37
|
+
>
|
|
38
|
+
<div className="flex gap-1.5 items-center">
|
|
39
|
+
{filterValue || "Enter text..."}
|
|
40
|
+
</div>
|
|
41
|
+
</PopoverTrigger>
|
|
42
|
+
<PopoverContent className="w-[300px] p-3">
|
|
43
|
+
<div className="flex flex-col gap-1">
|
|
44
|
+
<div className="flex items-center p-1.5 text-xs text-muted">
|
|
45
|
+
<span>{filterType}</span>
|
|
46
|
+
</div>
|
|
47
|
+
<Input autoFocus
|
|
48
|
+
type="text" size={"sm"}
|
|
49
|
+
value={inputValue}
|
|
50
|
+
onChange={setInputValue}
|
|
51
|
+
onKeyDown={handleKeyDown}
|
|
52
|
+
placeholder="Enter text..."
|
|
53
|
+
/>
|
|
54
|
+
<div className="mt-2 p-2 border-t">
|
|
55
|
+
<div className="flex gap-2 justify-end">
|
|
56
|
+
<Button
|
|
57
|
+
variant="ghost"
|
|
58
|
+
size="sm"
|
|
59
|
+
onClick={() => {
|
|
60
|
+
setInputValue(filterValue);
|
|
61
|
+
setOpen(false);
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
Cancel
|
|
65
|
+
</Button>
|
|
66
|
+
<Button
|
|
67
|
+
size="sm"
|
|
68
|
+
onClick={() => {
|
|
69
|
+
setFilterValue(inputValue);
|
|
70
|
+
setOpen(false);
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
Apply
|
|
74
|
+
</Button>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</PopoverContent>
|
|
79
|
+
</Popover>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { CommandItem, CommandEmpty } from "../../command";
|
|
3
|
+
import { Button } from "../../button";
|
|
4
|
+
import { Filter, FilterGroup, FilterGroupOption, FilterOption } from "../types";
|
|
5
|
+
import { DynamicLabel } from "../DynamicLabel";
|
|
6
|
+
|
|
7
|
+
interface SelectFilterProps {
|
|
8
|
+
selectedView: string | null;
|
|
9
|
+
commandInput: string;
|
|
10
|
+
setFilters: React.Dispatch<React.SetStateAction<Filter[]>>;
|
|
11
|
+
handleClose: () => void;
|
|
12
|
+
filterGroups: FilterGroup[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function SelectFilter({
|
|
16
|
+
selectedView,
|
|
17
|
+
commandInput,
|
|
18
|
+
setFilters,
|
|
19
|
+
handleClose,
|
|
20
|
+
filterGroups,
|
|
21
|
+
}: Readonly<SelectFilterProps>) {
|
|
22
|
+
const [selectedOptions, setSelectedOptions] = useState<FilterOption[]>([]);
|
|
23
|
+
const getFilteredOptions = (groupName: string) => {
|
|
24
|
+
const group = filterGroups.find(g => g.name === groupName);
|
|
25
|
+
if (!group) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
let filteredOptions = group.options || [];
|
|
29
|
+
|
|
30
|
+
if (!commandInput.trim()) {
|
|
31
|
+
return filteredOptions;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (group.filterBy) {
|
|
35
|
+
const filterLc = commandInput.toLowerCase();
|
|
36
|
+
const results = filteredOptions.filter(option => {
|
|
37
|
+
if (option.value === undefined) return false;
|
|
38
|
+
return group.filterBy!(option.value, filterLc);
|
|
39
|
+
});
|
|
40
|
+
return results;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const filterLc = commandInput.toLowerCase();
|
|
44
|
+
return filteredOptions.filter(option => {
|
|
45
|
+
const optionValue = String(option.value || '').toLowerCase();
|
|
46
|
+
return optionValue.includes(filterLc);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
if (!selectedView) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const options = getFilteredOptions(selectedView);
|
|
55
|
+
const selectedGroup = filterGroups.find(g => g.name === selectedView);
|
|
56
|
+
|
|
57
|
+
if (options.length === 0) {
|
|
58
|
+
return <CommandEmpty>No matching options</CommandEmpty>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const groupTitle = selectedGroup?.placeholder || selectedGroup?.name;
|
|
62
|
+
|
|
63
|
+
const handleApply = () => {
|
|
64
|
+
if (selectedOptions.length > 0) {
|
|
65
|
+
setFilters(prev => [
|
|
66
|
+
...prev.filter(f => f.name !== selectedView),
|
|
67
|
+
{
|
|
68
|
+
name: selectedView || "",
|
|
69
|
+
placeholder: selectedGroup?.placeholder || "",
|
|
70
|
+
value: selectedOptions,
|
|
71
|
+
type: selectedGroup?.type || "select",
|
|
72
|
+
multiple: selectedGroup?.multiple || false,
|
|
73
|
+
}
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
handleClose();
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const handleOptionToggle = (option: FilterGroupOption) => {
|
|
80
|
+
const filterOption = {
|
|
81
|
+
value: option.value,
|
|
82
|
+
label: option.label
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
if (selectedGroup?.multiple) {
|
|
86
|
+
// For multiple selection, toggle the option
|
|
87
|
+
const isSelected = selectedOptions.some(opt => opt.value === option.value);
|
|
88
|
+
if (isSelected) {
|
|
89
|
+
setSelectedOptions(prev => prev.filter(opt => opt.value !== option.value));
|
|
90
|
+
} else {
|
|
91
|
+
setSelectedOptions(prev => [...prev, filterOption]);
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
// For single selection, apply immediately
|
|
95
|
+
setFilters((prev: Filter[]) => {
|
|
96
|
+
const existingFilterIndex = prev.findIndex(f => f.name === selectedView);
|
|
97
|
+
|
|
98
|
+
if (existingFilterIndex >= 0) {
|
|
99
|
+
const updatedFilters = [...prev];
|
|
100
|
+
updatedFilters[existingFilterIndex] = {
|
|
101
|
+
...updatedFilters[existingFilterIndex],
|
|
102
|
+
value: [filterOption]
|
|
103
|
+
};
|
|
104
|
+
return updatedFilters;
|
|
105
|
+
} else {
|
|
106
|
+
return [...prev, {
|
|
107
|
+
name: selectedView || "",
|
|
108
|
+
placeholder: selectedGroup?.placeholder || "",
|
|
109
|
+
value: [filterOption],
|
|
110
|
+
type: selectedGroup?.type || "select",
|
|
111
|
+
multiple: selectedGroup?.multiple || false,
|
|
112
|
+
}];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
handleClose();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
<div className="flex items-center p-1.5 text-xs text-muted">
|
|
122
|
+
<span>{groupTitle}</span>
|
|
123
|
+
</div>
|
|
124
|
+
<div className="max-h-50 overflow-y-auto">
|
|
125
|
+
{options.map((option: FilterGroupOption) => {
|
|
126
|
+
const isSelected = selectedOptions.some(opt => opt.value === option.value);
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<CommandItem
|
|
130
|
+
key={option.value || `option-${Math.random()}`}
|
|
131
|
+
className={`group flex gap-2 items-center w-full hover:bg-muted ${selectedGroup?.multiple && isSelected ? 'bg-muted' : ''
|
|
132
|
+
}`}
|
|
133
|
+
onSelect={() => handleOptionToggle(option)}
|
|
134
|
+
>
|
|
135
|
+
<DynamicLabel
|
|
136
|
+
value={option.value || ''}
|
|
137
|
+
labelRenderer={option.labelRenderer || selectedGroup?.labelRenderer}
|
|
138
|
+
fallbackLabel={option.label}
|
|
139
|
+
/>
|
|
140
|
+
{selectedGroup?.multiple && isSelected && (
|
|
141
|
+
<span className="ml-auto text-xs text-success">✓</span>
|
|
142
|
+
)}
|
|
143
|
+
</CommandItem>
|
|
144
|
+
);
|
|
145
|
+
})}
|
|
146
|
+
</div>
|
|
147
|
+
{selectedGroup?.multiple && (
|
|
148
|
+
<div className="p-2 border-t">
|
|
149
|
+
<div className="flex gap-2 justify-end">
|
|
150
|
+
<Button variant="ghost" size="sm" onClick={handleClose}>
|
|
151
|
+
Cancel
|
|
152
|
+
</Button>
|
|
153
|
+
<Button size="sm" onClick={handleApply} disabled={selectedOptions.length === 0}>
|
|
154
|
+
Apply
|
|
155
|
+
</Button>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
</>
|
|
160
|
+
);
|
|
161
|
+
}
|
package/src/core/components/shadcn/filters/{stringListFilter.tsx → filter/StringListFilter.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction, useState } from "react";
|
|
2
|
-
import { InputList } from "
|
|
3
|
-
import { Button } from "
|
|
4
|
-
import { Filter, FilterGroup } from "
|
|
2
|
+
import { InputList } from "../../../index";
|
|
3
|
+
import { Button } from "../../button";
|
|
4
|
+
import { Filter, FilterGroup } from "../types";
|
|
5
5
|
|
|
6
6
|
interface StringListFilterProps {
|
|
7
7
|
selectedView: string;
|
|
@@ -17,7 +17,7 @@ export default function StringListFilter({
|
|
|
17
17
|
filterGroups,
|
|
18
18
|
}: StringListFilterProps) {
|
|
19
19
|
const [tags, setTags] = useState<string[]>([]);
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
const selectedGroup = filterGroups.find(g => g.name === selectedView);
|
|
22
22
|
|
|
23
23
|
const handleApply = () => {
|
|
@@ -38,9 +38,9 @@ export default function StringListFilter({
|
|
|
38
38
|
return (
|
|
39
39
|
<div className="p-2 space-y-3">
|
|
40
40
|
<div className="space-y-2">
|
|
41
|
-
<InputList
|
|
42
|
-
value={tags}
|
|
43
|
-
onChange={setTags}
|
|
41
|
+
<InputList
|
|
42
|
+
value={tags}
|
|
43
|
+
onChange={setTags}
|
|
44
44
|
placeholder={selectedGroup?.placeholder || `Add ${selectedView}...`}
|
|
45
45
|
autoFocus
|
|
46
46
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Button } from "
|
|
3
|
-
import { Input } from "
|
|
4
|
-
import { Filter, FilterGroup } from "
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { Input } from "../../input";
|
|
4
|
+
import { Filter, FilterGroup } from "../types";
|
|
5
5
|
|
|
6
6
|
interface TextFilterProps {
|
|
7
7
|
selectedView: string | null;
|
|
@@ -50,14 +50,20 @@ export default function TextFilter({
|
|
|
50
50
|
onKeyDown={(e) => e.key === "Enter" && handleTextFilterAdd()}
|
|
51
51
|
placeholder="Enter text..."
|
|
52
52
|
/>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
<div className="mt-2 p-2 border-t">
|
|
54
|
+
<div className="flex gap-2 justify-end">
|
|
55
|
+
<Button variant="ghost" size="sm" onClick={handleClose}>
|
|
56
|
+
Cancel
|
|
57
|
+
</Button>
|
|
58
|
+
<Button
|
|
59
|
+
size="sm"
|
|
60
|
+
onClick={handleTextFilterAdd}
|
|
61
|
+
disabled={!textValue.trim()}
|
|
62
|
+
>
|
|
63
|
+
Apply
|
|
64
|
+
</Button>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
61
67
|
</div>
|
|
62
68
|
);
|
|
63
69
|
}
|