@vertesia/ui 0.64.0 → 0.66.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/EmptyCollection.js +2 -2
- package/lib/esm/core/components/EmptyCollection.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/SidePanel.js +1 -1
- package/lib/esm/core/components/SidePanel.js.map +1 -1
- package/lib/esm/core/components/Switch.js +2 -2
- package/lib/esm/core/components/Switch.js.map +1 -1
- package/lib/esm/core/components/shadcn/calendar.js +0 -1
- package/lib/esm/core/components/shadcn/calendar.js.map +1 -1
- package/lib/esm/core/components/shadcn/checkbox.js +0 -1
- package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
- package/lib/esm/core/components/shadcn/command.js +0 -1
- package/lib/esm/core/components/shadcn/command.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +0 -1
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/comboBox.js +18 -0
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +38 -17
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filters.js +11 -5
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +1 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/stringListFilter.js +24 -0
- package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/textFilter.js +2 -1
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/label.js +0 -1
- package/lib/esm/core/components/shadcn/label.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/env/index.js +4 -1
- package/lib/esm/env/index.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +56 -16
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +2 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +2 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/esm/features/facets/VEnvironmentFacet.js +24 -0
- package/lib/esm/features/facets/VEnvironmentFacet.js.map +1 -0
- package/lib/esm/features/facets/VFacetsNav.js +69 -26
- package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/VInteractionFacet.js +45 -0
- package/lib/esm/features/facets/VInteractionFacet.js.map +1 -0
- package/lib/esm/features/facets/VStringFacet.js +6 -5
- package/lib/esm/features/facets/VStringFacet.js.map +1 -1
- package/lib/esm/features/facets/VUserFacet.js +6 -6
- package/lib/esm/features/facets/VUserFacet.js.map +1 -1
- package/lib/esm/features/layout/GenericPageNavHeader.js +1 -1
- package/lib/esm/features/magic-pdf/PdfPageProvider.js +3 -3
- package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +1 -1
- package/lib/esm/features/magic-pdf/TextPageView.js +1 -2
- package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js +9 -5
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
- package/lib/esm/features/store/collections/{CollectionsView.js → CreateCollection.js} +6 -14
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -0
- package/lib/esm/features/store/collections/EditCollectionView.js +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +24 -0
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -0
- package/lib/esm/features/store/collections/index.js +2 -2
- package/lib/esm/features/store/collections/index.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +6 -3
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +14 -14
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/DocumentIcon.js +7 -10
- package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
- package/lib/esm/features/store/objects/components/DocumentInput.js +1 -2
- package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -1
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +4 -2
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +1 -2
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocument.js +9 -3
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js +2 -2
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -1
- package/lib/esm/features/store/objects/layout/documentLayout.js +2 -2
- package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +4 -2
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
- package/lib/esm/features/store/objects/selection/SelectionActions.js +1 -1
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +7 -10
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +1 -1
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +2 -2
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +1 -1
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +1 -1
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -1
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js +2 -3
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -1
- package/lib/esm/features/store/types/ContentObjectTypesTable.js +1 -1
- package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +2 -2
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +2 -3
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/store/types/TableLayoutEditor.js +1 -1
- package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
- package/lib/esm/features/store/types/index.js +0 -2
- package/lib/esm/features/store/types/index.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +1 -2
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/features/utils/rendition.js +22 -2
- package/lib/esm/features/utils/rendition.js.map +1 -1
- package/lib/esm/session/UserSession.js +2 -2
- package/lib/esm/session/UserSession.js.map +1 -1
- package/lib/esm/session/auth/composable.js +1 -1
- package/lib/esm/session/auth/composable.js.map +1 -1
- package/lib/esm/session/constants.js +3 -0
- package/lib/esm/session/constants.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +2 -2
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/esm/widgets/properties/PropertiesView.js +4 -2
- package/lib/esm/widgets/properties/PropertiesView.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +1 -1
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/InputList.d.ts +2 -1
- package/lib/types/core/components/Switch.d.ts +2 -1
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/stringListFilter.d.ts +10 -0
- package/lib/types/core/components/shadcn/filters/types.d.ts +3 -3
- package/lib/types/env/index.d.ts +1 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +12 -2
- package/lib/types/features/facets/VEnvironmentFacet.d.ts +11 -0
- package/lib/types/features/facets/VFacetsNav.d.ts +9 -1
- package/lib/types/features/facets/VInteractionFacet.d.ts +14 -0
- package/lib/types/features/facets/VStringFacet.d.ts +3 -2
- package/lib/types/features/facets/VUserFacet.d.ts +3 -2
- package/lib/types/features/store/collections/{CollectionsView.d.ts → CreateCollection.d.ts} +5 -3
- package/lib/types/features/store/collections/SelectCollection.d.ts +14 -0
- package/lib/types/features/store/collections/index.d.ts +2 -2
- package/lib/types/features/store/objects/components/ContentOverview.d.ts +2 -1
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts +2 -1
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +2 -1
- package/lib/types/features/store/objects/layout/documentLayout.d.ts +1 -1
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +3 -2
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +2 -1
- package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +2 -1
- package/lib/types/features/store/types/index.d.ts +0 -2
- package/lib/types/features/utils/rendition.d.ts +1 -1
- package/lib/types/session/UserSession.d.ts +2 -2
- package/lib/types/session/constants.d.ts +2 -0
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-env.js +1 -1
- package/lib/vertesia-ui-env.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-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +6 -4
- package/src/core/components/EmptyCollection.tsx +26 -24
- package/src/core/components/InputList.tsx +3 -1
- package/src/core/components/SidePanel.tsx +2 -2
- package/src/core/components/Switch.tsx +4 -3
- package/src/core/components/shadcn/calendar.tsx +0 -2
- package/src/core/components/shadcn/checkbox.tsx +0 -2
- package/src/core/components/shadcn/command.tsx +0 -2
- package/src/core/components/shadcn/dialog.tsx +0 -2
- package/src/core/components/shadcn/filters/comboBox.tsx +73 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +41 -17
- package/src/core/components/shadcn/filters/filters.tsx +30 -14
- package/src/core/components/shadcn/filters/selectFilter.tsx +3 -3
- package/src/core/components/shadcn/filters/stringListFilter.tsx +58 -0
- package/src/core/components/shadcn/filters/textFilter.tsx +2 -1
- package/src/core/components/shadcn/filters/types.ts +3 -3
- package/src/core/components/shadcn/label.tsx +0 -2
- package/src/core/components/shadcn/selectBox.tsx +1 -1
- package/src/env/index.ts +5 -1
- package/src/features/agent/PayloadBuilder.tsx +66 -16
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +0 -11
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +11 -12
- package/src/features/facets/VEnvironmentFacet.tsx +42 -0
- package/src/features/facets/VFacetsNav.tsx +87 -29
- package/src/features/facets/VInteractionFacet.tsx +73 -0
- package/src/features/facets/VStringFacet.tsx +7 -6
- package/src/features/facets/VUserFacet.tsx +7 -6
- package/src/features/layout/GenericPageNavHeader.tsx +1 -1
- package/src/features/magic-pdf/PdfPageProvider.tsx +3 -3
- package/src/features/magic-pdf/TextPageView.tsx +1 -2
- package/src/features/store/collections/CollectionsTable.tsx +49 -40
- package/src/features/store/collections/{CollectionsView.tsx → CreateCollection.tsx} +15 -42
- package/src/features/store/collections/EditCollectionView.tsx +1 -1
- package/src/features/store/collections/SelectCollection.tsx +46 -0
- package/src/features/store/collections/index.ts +2 -2
- package/src/features/store/objects/DocumentSearchResults.tsx +6 -3
- package/src/features/store/objects/components/ContentOverview.tsx +33 -95
- package/src/features/store/objects/components/DocumentIcon.tsx +27 -14
- package/src/features/store/objects/components/DocumentInput.tsx +1 -2
- package/src/features/store/objects/components/PropertiesEditorModal.tsx +7 -3
- package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +2 -2
- package/src/features/store/objects/components/SelectDocument.tsx +18 -3
- package/src/features/store/objects/components/SelectDocumentModal.tsx +6 -6
- package/src/features/store/objects/layout/documentLayout.tsx +2 -2
- package/src/features/store/objects/search/DocumentSearchContext.ts +6 -3
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +1 -1
- package/src/features/store/objects/selection/SelectionActions.tsx +0 -1
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +10 -21
- package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +1 -1
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +2 -2
- package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +1 -1
- package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +1 -1
- package/src/features/store/types/ContentObjectTypesSearch.tsx +3 -4
- package/src/features/store/types/ContentObjectTypesTable.tsx +3 -1
- package/src/features/store/types/CreateOrUpdateTypeModal.tsx +2 -9
- package/src/features/store/types/ObjectSchemaEditor.tsx +4 -5
- package/src/features/store/types/TableLayoutEditor.tsx +4 -4
- package/src/features/store/types/index.ts +0 -2
- package/src/features/user/UserInfo.tsx +1 -2
- package/src/features/utils/rendition.ts +23 -1
- package/src/session/UserSession.ts +2 -2
- package/src/session/auth/composable.ts +1 -1
- package/src/session/constants.ts +2 -0
- package/src/widgets/codemirror/CodeMirrorEditor.tsx +2 -2
- package/src/widgets/properties/PropertiesView.tsx +10 -2
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +1 -1
- package/lib/esm/features/store/collections/CollectionView.js +0 -53
- package/lib/esm/features/store/collections/CollectionView.js.map +0 -1
- package/lib/esm/features/store/collections/CollectionsView.js.map +0 -1
- package/lib/esm/features/store/types/ContentObjectTypeView.js +0 -158
- package/lib/esm/features/store/types/ContentObjectTypeView.js.map +0 -1
- package/lib/esm/features/store/types/ContentObjectTypesView.js +0 -55
- package/lib/esm/features/store/types/ContentObjectTypesView.js.map +0 -1
- package/lib/types/features/store/collections/CollectionView.d.ts +0 -5
- package/lib/types/features/store/types/ContentObjectTypeView.d.ts +0 -5
- package/lib/types/features/store/types/ContentObjectTypesView.d.ts +0 -8
- package/src/features/store/collections/CollectionView.tsx +0 -94
- package/src/features/store/types/ContentObjectTypeView.tsx +0 -244
- package/src/features/store/types/ContentObjectTypesView.tsx +0 -71
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"description": "Vertesia UI components and and hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -55,9 +55,10 @@
|
|
|
55
55
|
"remark-gfm": "^4.0.1",
|
|
56
56
|
"tailwind-merge": "^3.3.0",
|
|
57
57
|
"ts-md5": "^1.3.1",
|
|
58
|
-
"
|
|
59
|
-
"@vertesia/
|
|
60
|
-
"@vertesia/
|
|
58
|
+
"json-schema": "^0.4.0",
|
|
59
|
+
"@vertesia/client": "0.66.0",
|
|
60
|
+
"@vertesia/common": "0.66.0",
|
|
61
|
+
"@vertesia/json": "0.66.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@eslint/js": "^9.27.0",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"@types/node": "^22.15.21",
|
|
69
70
|
"@types/react": "^19.1.0",
|
|
70
71
|
"@types/react-dom": "^19.1.1",
|
|
72
|
+
"@types/json-schema": "^7.0.15",
|
|
71
73
|
"eslint": "^9.27.0",
|
|
72
74
|
"eslint-import-resolver-typescript": "^4.3.5",
|
|
73
75
|
"eslint-plugin-import": "^2.31.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plus } from "lucide-react";
|
|
2
|
-
import { Button } from "
|
|
2
|
+
import { Button } from "@vertesia/ui/core";
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
interface EmptyInteractionsProps {
|
|
@@ -10,29 +10,31 @@ interface EmptyInteractionsProps {
|
|
|
10
10
|
}
|
|
11
11
|
export function EmptyCollection({ buttonLabel, title, children, onClick }: EmptyInteractionsProps) {
|
|
12
12
|
return (
|
|
13
|
-
<div className="
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
13
|
+
<div className="flex items-center justify-center h-full text-center">
|
|
14
|
+
<div className="py-12">
|
|
15
|
+
<svg
|
|
16
|
+
className="mx-auto size-12"
|
|
17
|
+
fill="none"
|
|
18
|
+
viewBox="0 0 24 24"
|
|
19
|
+
stroke="currentColor"
|
|
20
|
+
aria-hidden="true"
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
vectorEffect="non-scaling-stroke"
|
|
24
|
+
strokeLinecap="round"
|
|
25
|
+
strokeLinejoin="round"
|
|
26
|
+
strokeWidth={2}
|
|
27
|
+
d="M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"
|
|
28
|
+
/>
|
|
29
|
+
</svg>
|
|
30
|
+
<h3 className="mt-2 text-sm font-semibold">{title}</h3>
|
|
31
|
+
<p className="mt-1 text-sm text-muted">{children}</p>
|
|
32
|
+
<div className="mt-6">
|
|
33
|
+
<Button onClick={onClick}>
|
|
34
|
+
<Plus className="-ml-0.5 mr-1.5 size-5" aria-hidden="true" />
|
|
35
|
+
{buttonLabel}
|
|
36
|
+
</Button>
|
|
37
|
+
</div>
|
|
36
38
|
</div>
|
|
37
39
|
</div>
|
|
38
40
|
)
|
|
@@ -12,8 +12,9 @@ interface InputListProps {
|
|
|
12
12
|
allowSpaces?: boolean;
|
|
13
13
|
delimiters?: string; // space and , by default
|
|
14
14
|
placeholder?: string;
|
|
15
|
+
autoFocus?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export function InputList({ value = [], onChange, className, delimiters = ", ", placeholder }: InputListProps) {
|
|
17
|
+
export function InputList({ value = [], onChange, className, delimiters = ", ", placeholder, autoFocus }: InputListProps) {
|
|
17
18
|
const [text, setText] = useState<string>('');
|
|
18
19
|
|
|
19
20
|
const onBlur = (ev: any) => {
|
|
@@ -69,6 +70,7 @@ export function InputList({ value = [], onChange, className, delimiters = ", ",
|
|
|
69
70
|
onKeyDown={onKeyDown}
|
|
70
71
|
onChange={setText}
|
|
71
72
|
placeholder={!value || value.length === 0 ? placeholder : ''}
|
|
73
|
+
autoFocus={autoFocus}
|
|
72
74
|
/>
|
|
73
75
|
</div>
|
|
74
76
|
</div>
|
|
@@ -42,8 +42,8 @@ export function SidePanel({ isOpen, title, onClose, children }: SidePanelProps)
|
|
|
42
42
|
return (
|
|
43
43
|
<Transition show={isOpen} as={Fragment}>
|
|
44
44
|
<Dialog as="div" className="relative z-10" onClose={onClose}>
|
|
45
|
-
<div className="fixed inset-0" />
|
|
46
|
-
<div className="fixed inset-0 overflow-hidden">
|
|
45
|
+
<div className="fixed inset-y-0 right-0" />
|
|
46
|
+
<div className="fixed inset-y-0 right-0 overflow-hidden">
|
|
47
47
|
<div className="absolute inset-0 overflow-hidden">
|
|
48
48
|
<div className="pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16">
|
|
49
49
|
<TransitionChild
|
|
@@ -12,12 +12,13 @@ interface SwitchProps {
|
|
|
12
12
|
onChange: (value: boolean) => void;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
className?: string;
|
|
15
|
+
disabled?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export function Switch({ value, onChange, size = 'md', children, className }: SwitchProps) {
|
|
17
|
+
export function Switch({ value, onChange, size = 'md', children, className, disabled }: SwitchProps) {
|
|
17
18
|
const sizeClass = sizes[size];
|
|
18
19
|
return (
|
|
19
|
-
<UISwitch checked={value} onChange={() => onChange(!value)} className={`flex items-center ${className} hover:cursor-pointer`}>
|
|
20
|
-
<div className={`${value ? 'bg-primary' : 'bg-muted'} relative inline-flex ${sizeClass[0]} items-center rounded-full`}>
|
|
20
|
+
<UISwitch checked={value} onChange={() => onChange(!value)} className={`flex items-center ${className} ${disabled ? 'cursor-not-allowed opacity-50' : 'hover:cursor-pointer'}`}>
|
|
21
|
+
<div className={`${value ? 'bg-primary' : 'bg-muted/50'} relative inline-flex ${sizeClass[0]} items-center rounded-full border-1`}>
|
|
21
22
|
<span
|
|
22
23
|
className={`${value ? sizeClass[2] : 'translate-x-1'
|
|
23
24
|
} inline-block ${sizeClass[1]} transform rounded-full bg-white transition`}
|
|
@@ -11,6 +11,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "../popover";
|
|
|
11
11
|
import { AnimateChangeInHeight } from "./animateChangeInHeight";
|
|
12
12
|
import { FilterGroupOption, FilterOption } from "./types";
|
|
13
13
|
import { DynamicLabel } from "./DynamicLabel";
|
|
14
|
+
import { InputList } from "../../index";
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
export const SelectionCombobox = ({
|
|
@@ -253,4 +254,76 @@ export const TextCombobox = ({
|
|
|
253
254
|
</PopoverContent>
|
|
254
255
|
</Popover>
|
|
255
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
|
+
);
|
|
256
329
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { Dispatch, SetStateAction, useEffect } from "react";
|
|
2
2
|
import { cn } from "../../libs/utils";
|
|
3
|
-
import { Button
|
|
3
|
+
import { Button } from "../button";
|
|
4
|
+
import { Popover, PopoverTrigger, PopoverContent } from "../popover";
|
|
5
|
+
import { Command, CommandInput, CommandList, CommandGroup, CommandItem, CommandEmpty } from "../command";
|
|
4
6
|
import { ListFilter } from "lucide-react";
|
|
5
7
|
|
|
6
8
|
import { Filter, FilterGroup } from "./types";
|
|
@@ -9,6 +11,7 @@ import Filters from "./filters";
|
|
|
9
11
|
import TextFilter from "./textFilter";
|
|
10
12
|
import DateFilter from "./dateFilter";
|
|
11
13
|
import SelectFilter from "./selectFilter";
|
|
14
|
+
import StringListFilter from "./stringListFilter";
|
|
12
15
|
|
|
13
16
|
interface FilterBarProps {
|
|
14
17
|
filters: Filter[];
|
|
@@ -39,13 +42,16 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
|
|
|
39
42
|
return filter.name === group.name;
|
|
40
43
|
}
|
|
41
44
|
return filter.name === group.name &&
|
|
42
|
-
filter.value
|
|
45
|
+
(Array.isArray(filter.value) && typeof filter.value[0] === 'string'
|
|
46
|
+
? filter.value.some(val => val === option.value)
|
|
47
|
+
: filter.value.some(val => (val as any).value === option.value));
|
|
43
48
|
})
|
|
44
49
|
)
|
|
45
50
|
})).filter(group =>
|
|
46
51
|
((group.options ?? []).length > 0) ||
|
|
47
52
|
(group.type === "date" && !filters.some(filter => filter.name === group.name)) ||
|
|
48
|
-
(group.type === "text" && !filters.some(filter => filter.name === group.name))
|
|
53
|
+
(group.type === "text" && !filters.some(filter => filter.name === group.name)) ||
|
|
54
|
+
(group.type === "stringList" && !filters.some(filter => filter.name === group.name))
|
|
49
55
|
);
|
|
50
56
|
|
|
51
57
|
if (options.length === 0) {
|
|
@@ -127,6 +133,15 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
|
|
|
127
133
|
filterGroups={filterGroups}
|
|
128
134
|
/>
|
|
129
135
|
);
|
|
136
|
+
case "stringList":
|
|
137
|
+
return (
|
|
138
|
+
<StringListFilter
|
|
139
|
+
selectedView={selectedView}
|
|
140
|
+
setFilters={setFilters}
|
|
141
|
+
handleClose={handleClose}
|
|
142
|
+
filterGroups={filterGroups}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
130
145
|
default:
|
|
131
146
|
return (
|
|
132
147
|
<SelectFilter
|
|
@@ -148,9 +163,16 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
|
|
|
148
163
|
if (filters.length > 0) {
|
|
149
164
|
// Convert filters to simple format with URL-safe encoding: filterName:value,value;filterName2:value
|
|
150
165
|
const filterString = filters.map(filter => {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
166
|
+
let values;
|
|
167
|
+
if (filter.type === 'stringList' && Array.isArray(filter.value) && typeof filter.value[0] === 'string') {
|
|
168
|
+
// Handle stringList with direct string array
|
|
169
|
+
values = (filter.value as string[]).map(item => encodeURIComponent(item)).join(',');
|
|
170
|
+
} else if (Array.isArray(filter.value)) {
|
|
171
|
+
// Handle other types with FilterOption array
|
|
172
|
+
values = filter.value.map((item: any) => encodeURIComponent(item.value || '')).join(',');
|
|
173
|
+
} else {
|
|
174
|
+
values = encodeURIComponent(filter.value || '');
|
|
175
|
+
}
|
|
154
176
|
return `${encodeURIComponent(filter.name)}:${values}`;
|
|
155
177
|
}).join(';');
|
|
156
178
|
params.set('filters', filterString);
|
|
@@ -177,13 +199,17 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
|
|
|
177
199
|
const values = valuesString.split(',').map(encodedValue => decodeURIComponent(encodedValue));
|
|
178
200
|
|
|
179
201
|
const group = filterGroups.find(g => g.name === name);
|
|
180
|
-
|
|
202
|
+
let filterValue;
|
|
181
203
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
204
|
+
if (group?.type === 'stringList') {
|
|
205
|
+
// For stringList, return direct string array
|
|
206
|
+
filterValue = values;
|
|
207
|
+
} else if (group?.type === 'text') {
|
|
208
|
+
// For text, return FilterOption array
|
|
209
|
+
filterValue = values.map(value => ({ value, label: value }));
|
|
210
|
+
} else {
|
|
211
|
+
// For other types, find options with labels
|
|
212
|
+
filterValue = values.map(value => {
|
|
187
213
|
const matchingOption = group?.options?.find(opt => opt.value === value);
|
|
188
214
|
let label = value;
|
|
189
215
|
|
|
@@ -199,16 +225,14 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
|
|
|
199
225
|
value,
|
|
200
226
|
label
|
|
201
227
|
};
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
console.log("valuesWithLabels", filterOptions);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
206
230
|
|
|
207
231
|
return {
|
|
208
232
|
name,
|
|
209
233
|
type: group?.type || 'select',
|
|
210
234
|
placeholder: group?.placeholder,
|
|
211
|
-
value:
|
|
235
|
+
value: filterValue
|
|
212
236
|
};
|
|
213
237
|
});
|
|
214
238
|
|
|
@@ -2,8 +2,8 @@ import { X } from "lucide-react";
|
|
|
2
2
|
import { Dispatch, SetStateAction } from "react";
|
|
3
3
|
import { Button } from "../button";
|
|
4
4
|
|
|
5
|
-
import { DateCombobox, SelectionCombobox, TextCombobox } from "./comboBox";
|
|
6
|
-
import { Filter, FilterGroup } from "./types";
|
|
5
|
+
import { DateCombobox, SelectionCombobox, TextCombobox, StringListCombobox } from "./comboBox";
|
|
6
|
+
import { Filter, FilterGroup, FilterOption } from "./types";
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
8
|
|
|
9
9
|
interface FiltersProps {
|
|
@@ -21,7 +21,7 @@ function generateComboboxOptions(
|
|
|
21
21
|
case "date":
|
|
22
22
|
return (
|
|
23
23
|
<DateCombobox
|
|
24
|
-
filterValues={filter.value.map(v => v.value || '')}
|
|
24
|
+
filterValues={Array.isArray(filter.value) && typeof filter.value[0] === 'object' ? filter.value.map((v: any) => v.value || '') : []}
|
|
25
25
|
setFilterValues={(filterValues) => {
|
|
26
26
|
setFilters((prev) =>
|
|
27
27
|
prev.map((f) =>
|
|
@@ -41,20 +41,36 @@ function generateComboboxOptions(
|
|
|
41
41
|
return (
|
|
42
42
|
<TextCombobox
|
|
43
43
|
filterType={filter.placeholder || filter.name}
|
|
44
|
-
filterValue={filter.value[0]
|
|
44
|
+
filterValue={Array.isArray(filter.value) && filter.value[0] && typeof filter.value[0] === 'object' ? filter.value[0].value || "" : ""}
|
|
45
45
|
setFilterValue={(textValue) => {
|
|
46
46
|
setFilters((prev) =>
|
|
47
47
|
prev.map((f) =>
|
|
48
48
|
f === filter
|
|
49
49
|
? {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
...f,
|
|
51
|
+
value: [
|
|
52
|
+
{
|
|
53
|
+
value: textValue,
|
|
54
|
+
label: textValue,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
: f,
|
|
59
|
+
),
|
|
60
|
+
);
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
case "stringList":
|
|
65
|
+
return (
|
|
66
|
+
<StringListCombobox
|
|
67
|
+
filterType={filter.placeholder || filter.name}
|
|
68
|
+
filterValues={Array.isArray(filter.value) && typeof filter.value[0] === 'string' ? filter.value as string[] : []}
|
|
69
|
+
setFilterValues={(values) => {
|
|
70
|
+
setFilters((prev) =>
|
|
71
|
+
prev.map((f) =>
|
|
72
|
+
f === filter
|
|
73
|
+
? { ...f, value: values }
|
|
58
74
|
: f,
|
|
59
75
|
),
|
|
60
76
|
);
|
|
@@ -67,7 +83,7 @@ function generateComboboxOptions(
|
|
|
67
83
|
return (
|
|
68
84
|
<SelectionCombobox
|
|
69
85
|
filterType={filter.placeholder || filter.name}
|
|
70
|
-
filterValues={filter.value}
|
|
86
|
+
filterValues={Array.isArray(filter.value) && typeof filter.value[0] === 'object' ? filter.value as FilterOption[] : []}
|
|
71
87
|
setFilterValues={(filterValues) => {
|
|
72
88
|
setFilters((prev) =>
|
|
73
89
|
prev.map((f) =>
|
|
@@ -95,7 +111,7 @@ export default function Filters({
|
|
|
95
111
|
{filters
|
|
96
112
|
.filter((filter) => filter.value?.length > 0)
|
|
97
113
|
.map((filter) => (
|
|
98
|
-
<div className="flex gap-[1px] items-center text-sm" key={filter.name + '-' + (filter.type == 'date' ? 'date' : filter.value.map(v => v.value).join(','))}>
|
|
114
|
+
<div className="flex gap-[1px] items-center text-sm" key={filter.name + '-' + (filter.type == 'date' ? 'date' : filter.type === 'stringList' && typeof filter.value[0] === 'string' ? (filter.value as string[]).join(',') : Array.isArray(filter.value) ? filter.value.map((v: any) => v.value).join(',') : '')}>
|
|
99
115
|
<div className="flex gap-1.5 shrink-0 rounded-l bg-muted p-1.5 h-8 items-center">
|
|
100
116
|
{filter.placeholder || filter.name}
|
|
101
117
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CommandItem, CommandEmpty } from "../
|
|
3
|
-
import { Filter, FilterGroup, FilterGroupOption } from "./types";
|
|
2
|
+
import { CommandItem, CommandEmpty } from "../command";
|
|
3
|
+
import { Filter, FilterGroup, FilterGroupOption, FilterOption } from "./types";
|
|
4
4
|
import { DynamicLabel } from "./DynamicLabel";
|
|
5
5
|
|
|
6
6
|
interface SelectFilterProps {
|
|
@@ -81,7 +81,7 @@ export default function SelectFilter({
|
|
|
81
81
|
const updatedFilters = [...prev];
|
|
82
82
|
updatedFilters[existingFilterIndex] = {
|
|
83
83
|
...updatedFilters[existingFilterIndex],
|
|
84
|
-
value: [...updatedFilters[existingFilterIndex].value, filterOption]
|
|
84
|
+
value: [...(updatedFilters[existingFilterIndex].value as FilterOption[]), filterOption]
|
|
85
85
|
};
|
|
86
86
|
return updatedFilters;
|
|
87
87
|
} else {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction, useState } from "react";
|
|
2
|
+
import { InputList } from "../../index";
|
|
3
|
+
import { Button } from "../button";
|
|
4
|
+
import { Filter, FilterGroup } from "./types";
|
|
5
|
+
|
|
6
|
+
interface StringListFilterProps {
|
|
7
|
+
selectedView: string;
|
|
8
|
+
setFilters: Dispatch<SetStateAction<Filter[]>>;
|
|
9
|
+
handleClose: () => void;
|
|
10
|
+
filterGroups: FilterGroup[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function StringListFilter({
|
|
14
|
+
selectedView,
|
|
15
|
+
setFilters,
|
|
16
|
+
handleClose,
|
|
17
|
+
filterGroups,
|
|
18
|
+
}: StringListFilterProps) {
|
|
19
|
+
const [tags, setTags] = useState<string[]>([]);
|
|
20
|
+
|
|
21
|
+
const selectedGroup = filterGroups.find(g => g.name === selectedView);
|
|
22
|
+
|
|
23
|
+
const handleApply = () => {
|
|
24
|
+
if (tags.length > 0) {
|
|
25
|
+
setFilters(prev => [
|
|
26
|
+
...prev.filter(f => f.name !== selectedView),
|
|
27
|
+
{
|
|
28
|
+
name: selectedView,
|
|
29
|
+
placeholder: selectedGroup?.placeholder,
|
|
30
|
+
value: tags,
|
|
31
|
+
type: "stringList" as const
|
|
32
|
+
}
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
handleClose();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="p-2 space-y-3">
|
|
40
|
+
<div className="space-y-2">
|
|
41
|
+
<InputList
|
|
42
|
+
value={tags}
|
|
43
|
+
onChange={setTags}
|
|
44
|
+
placeholder={selectedGroup?.placeholder || `Add ${selectedView}...`}
|
|
45
|
+
autoFocus
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
<div className="flex gap-2 justify-end">
|
|
49
|
+
<Button variant="ghost" size="sm" onClick={handleClose}>
|
|
50
|
+
Cancel
|
|
51
|
+
</Button>
|
|
52
|
+
<Button size="sm" onClick={handleApply} disabled={tags.length === 0}>
|
|
53
|
+
Apply
|
|
54
|
+
</Button>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -12,7 +12,7 @@ export interface FilterGroupOption {
|
|
|
12
12
|
export interface FilterGroup {
|
|
13
13
|
name: string;
|
|
14
14
|
placeholder?: string;
|
|
15
|
-
type?: "select" | "date" | "text";
|
|
15
|
+
type?: "select" | "date" | "text" | "stringList";
|
|
16
16
|
options?: FilterGroupOption[];
|
|
17
17
|
allowCreate?: boolean;
|
|
18
18
|
filterBy?: (value: string, searchText: string) => boolean;
|
|
@@ -22,8 +22,8 @@ export interface FilterGroup {
|
|
|
22
22
|
export interface Filter {
|
|
23
23
|
name: string;
|
|
24
24
|
placeholder?: string;
|
|
25
|
-
value: FilterOption[];
|
|
26
|
-
type?: "select" | "date" | "text";
|
|
25
|
+
value: FilterOption[] | string[];
|
|
26
|
+
type?: "select" | "date" | "text" | "stringList";
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export enum FilterOperator {
|
|
@@ -179,7 +179,7 @@ export function VSelectBox<T = any>({ options, optionLabel, value, onChange, add
|
|
|
179
179
|
className,
|
|
180
180
|
border && 'border border-border',
|
|
181
181
|
'flex flex-row gap-2 items-center justify-between p-2 rounded-md group relative',
|
|
182
|
-
!disabled
|
|
182
|
+
!disabled ? "cursor-pointer hover:bg-muted" : "cursor-not-allowed text-muted",
|
|
183
183
|
)}
|
|
184
184
|
>
|
|
185
185
|
<div
|
package/src/env/index.ts
CHANGED
|
@@ -64,8 +64,12 @@ export class VertesiaEnvironment implements Readonly<EnvProps> {
|
|
|
64
64
|
return this.type === "production";
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
get isStable() {
|
|
68
|
+
return this.type === "production" || this.type === "preview" || this.type === "dr";
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
get isDev() {
|
|
68
|
-
return !this.
|
|
72
|
+
return !this.isStable;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
get isPreview() {
|