@vendure/dashboard 3.3.6-master-202507030648 → 3.3.6-master-202507030835
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/dist/plugin/vite-plugin-vendure-dashboard.js +1 -1
- package/package.json +40 -27
- package/src/app/routes/_authenticated/_collections/collections.graphql.ts +32 -0
- package/src/app/routes/_authenticated/_collections/collections.tsx +153 -133
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +34 -1
- package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +430 -0
- package/src/app/routes/_authenticated/_collections/components/move-single-collection.tsx +33 -0
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +8 -3
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +1 -1
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +1 -1
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +1 -1
- package/src/lib/components/data-input/money-input.tsx +2 -9
- package/src/lib/components/data-table/data-table.tsx +1 -1
- package/src/lib/components/shared/form-field-wrapper.tsx +22 -13
- package/src/lib/components/shared/paginated-list-data-table.tsx +1 -1
- package/src/lib/components/ui/accordion.tsx +50 -45
- package/src/lib/components/ui/alert-dialog.tsx +122 -93
- package/src/lib/components/ui/alert.tsx +54 -48
- package/src/lib/components/ui/aspect-ratio.tsx +9 -0
- package/src/lib/components/ui/avatar.tsx +53 -0
- package/src/lib/components/ui/badge.tsx +37 -29
- package/src/lib/components/ui/breadcrumb.tsx +89 -82
- package/src/lib/components/ui/button.tsx +52 -51
- package/src/lib/components/ui/calendar.tsx +196 -435
- package/src/lib/components/ui/card.tsx +78 -33
- package/src/lib/components/ui/carousel.tsx +241 -0
- package/src/lib/components/ui/chart.tsx +351 -0
- package/src/lib/components/ui/checkbox.tsx +28 -23
- package/src/lib/components/ui/collapsible.tsx +0 -2
- package/src/lib/components/ui/command.tsx +159 -114
- package/src/lib/components/ui/context-menu.tsx +252 -0
- package/src/lib/components/ui/dialog.tsx +115 -90
- package/src/lib/components/ui/drawer.tsx +133 -0
- package/src/lib/components/ui/dropdown-menu.tsx +207 -170
- package/src/lib/components/ui/form.tsx +138 -114
- package/src/lib/components/ui/hover-card.tsx +32 -26
- package/src/lib/components/ui/input-otp.tsx +77 -0
- package/src/lib/components/ui/input.tsx +17 -15
- package/src/lib/components/ui/label.tsx +19 -16
- package/src/lib/components/ui/menubar.tsx +274 -0
- package/src/lib/components/ui/navigation-menu.tsx +168 -0
- package/src/lib/components/ui/pagination.tsx +108 -87
- package/src/lib/components/ui/popover.tsx +36 -28
- package/src/lib/components/ui/progress.tsx +29 -0
- package/src/lib/components/ui/radio-group.tsx +45 -0
- package/src/lib/components/ui/resizable.tsx +54 -0
- package/src/lib/components/ui/scroll-area.tsx +48 -40
- package/src/lib/components/ui/select.tsx +151 -129
- package/src/lib/components/ui/separator.tsx +22 -20
- package/src/lib/components/ui/sheet.tsx +110 -91
- package/src/lib/components/ui/sidebar.tsx +652 -622
- package/src/lib/components/ui/skeleton.tsx +10 -10
- package/src/lib/components/ui/slider.tsx +63 -0
- package/src/lib/components/ui/sonner.tsx +7 -11
- package/src/lib/components/ui/switch.tsx +27 -22
- package/src/lib/components/ui/table.tsx +96 -64
- package/src/lib/components/ui/tabs.tsx +56 -38
- package/src/lib/components/ui/textarea.tsx +14 -14
- package/src/lib/components/ui/toggle-group.tsx +73 -0
- package/src/lib/components/ui/toggle.tsx +45 -0
- package/src/lib/components/ui/tooltip.tsx +45 -37
- package/src/lib/framework/component-registry/component-registry.tsx +5 -3
- package/src/lib/framework/page/detail-page.tsx +28 -17
- package/src/lib/framework/page/list-page.tsx +1 -1
- package/src/lib/index.ts +5 -6
- package/vite/vite-plugin-vendure-dashboard.ts +1 -1
|
@@ -1,51 +1,59 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from "@/vdb/lib/utils"
|
|
5
5
|
|
|
6
6
|
function TooltipProvider({
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
delayDuration = 0,
|
|
8
|
+
...props
|
|
9
9
|
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
return (
|
|
11
|
+
<TooltipPrimitive.Provider
|
|
12
|
+
data-slot="tooltip-provider"
|
|
13
|
+
delayDuration={delayDuration}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
13
17
|
}
|
|
14
18
|
|
|
15
|
-
function Tooltip({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
function Tooltip({
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
22
|
+
return (
|
|
23
|
+
<TooltipProvider>
|
|
24
|
+
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
25
|
+
</TooltipProvider>
|
|
26
|
+
)
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
function TooltipTrigger({
|
|
24
|
-
|
|
29
|
+
function TooltipTrigger({
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
32
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
25
33
|
}
|
|
26
34
|
|
|
27
35
|
function TooltipContent({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
className,
|
|
37
|
+
sideOffset = 0,
|
|
38
|
+
children,
|
|
39
|
+
...props
|
|
32
40
|
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
return (
|
|
42
|
+
<TooltipPrimitive.Portal>
|
|
43
|
+
<TooltipPrimitive.Content
|
|
44
|
+
data-slot="tooltip-content"
|
|
45
|
+
sideOffset={sideOffset}
|
|
46
|
+
className={cn(
|
|
47
|
+
"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
<TooltipPrimitive.Arrow className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
54
|
+
</TooltipPrimitive.Content>
|
|
55
|
+
</TooltipPrimitive.Portal>
|
|
56
|
+
)
|
|
49
57
|
}
|
|
50
58
|
|
|
51
|
-
export { Tooltip, TooltipContent, TooltipProvider
|
|
59
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ControllerRenderProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
2
3
|
import { addDisplayComponent, getDisplayComponent } from '../extension-api/display-component-extensions.js';
|
|
3
4
|
import { addInputComponent, getInputComponent } from '../extension-api/input-component-extensions.js';
|
|
4
5
|
|
|
@@ -13,9 +14,10 @@ export interface DataDisplayComponentProps {
|
|
|
13
14
|
[key: string]: any;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export interface DataInputComponentProps
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
export interface DataInputComponentProps<
|
|
18
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
19
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
20
|
+
> extends ControllerRenderProps<TFieldValues, TName> {
|
|
19
21
|
[key: string]: any;
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from '../document-introspection/get-document-structure.js';
|
|
18
18
|
|
|
19
19
|
import { TranslatableFormFieldWrapper } from '@/vdb/components/shared/translatable-form-field.js';
|
|
20
|
+
import { FormControl } from '@/vdb/components/ui/form.js';
|
|
20
21
|
import { ControllerRenderProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
21
22
|
import { useComponentRegistry } from '../component-registry/component-registry.js';
|
|
22
23
|
import { generateInputComponentKey } from '../extension-api/input-component-extensions.js';
|
|
@@ -120,23 +121,31 @@ function FieldInputRenderer<
|
|
|
120
121
|
return <InputComponent {...field} />;
|
|
121
122
|
}
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
124
|
+
const DefaultComponent = () => {
|
|
125
|
+
switch (fieldInfo.type) {
|
|
126
|
+
case 'Int':
|
|
127
|
+
case 'Float':
|
|
128
|
+
return (
|
|
129
|
+
<Input
|
|
130
|
+
type="number"
|
|
131
|
+
value={field.value}
|
|
132
|
+
onChange={e => field.onChange(e.target.valueAsNumber)}
|
|
133
|
+
/>
|
|
134
|
+
);
|
|
135
|
+
case 'DateTime':
|
|
136
|
+
return <DateTimeInput {...field} />;
|
|
137
|
+
case 'Boolean':
|
|
138
|
+
return <Checkbox value={field.value} onCheckedChange={field.onChange} />;
|
|
139
|
+
default:
|
|
140
|
+
return <Input {...field} />;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<FormControl>
|
|
146
|
+
<DefaultComponent />
|
|
147
|
+
</FormControl>
|
|
148
|
+
);
|
|
140
149
|
}
|
|
141
150
|
|
|
142
151
|
/**
|
|
@@ -227,6 +236,7 @@ export function DetailPage<
|
|
|
227
236
|
control={form.control}
|
|
228
237
|
name={fieldInfo.name as never}
|
|
229
238
|
label={fieldInfo.name}
|
|
239
|
+
renderFormControl={false}
|
|
230
240
|
render={({ field }) => (
|
|
231
241
|
<FieldInputRenderer
|
|
232
242
|
fieldInfo={fieldInfo}
|
|
@@ -249,6 +259,7 @@ export function DetailPage<
|
|
|
249
259
|
control={form.control}
|
|
250
260
|
name={fieldInfo.name as never}
|
|
251
261
|
label={fieldInfo.name}
|
|
262
|
+
renderFormControl={false}
|
|
252
263
|
render={({ field }) => (
|
|
253
264
|
<FieldInputRenderer
|
|
254
265
|
fieldInfo={fieldInfo}
|
|
@@ -90,7 +90,7 @@ export function ListPage<
|
|
|
90
90
|
transformData,
|
|
91
91
|
setTableOptions,
|
|
92
92
|
bulkActions,
|
|
93
|
-
}: ListPageProps<T, U, V, AC
|
|
93
|
+
}: Readonly<ListPageProps<T, U, V, AC>>) {
|
|
94
94
|
const route = typeof routeOrFn === 'function' ? routeOrFn() : routeOrFn;
|
|
95
95
|
const routeSearch = route.useSearch();
|
|
96
96
|
const navigate = useNavigate<AnyRouter>({ from: route.fullPath });
|
package/src/lib/index.ts
CHANGED
|
@@ -8,11 +8,10 @@ export * from './components/data-input/affixed-input.js';
|
|
|
8
8
|
export * from './components/data-input/customer-group-input.js';
|
|
9
9
|
export * from './components/data-input/datetime-input.js';
|
|
10
10
|
export * from './components/data-input/facet-value-input.js';
|
|
11
|
-
export * from './components/data-input/index.js';
|
|
12
11
|
export * from './components/data-input/money-input.js';
|
|
13
12
|
export * from './components/data-input/relation-input.js';
|
|
14
13
|
export * from './components/data-input/relation-selector.js';
|
|
15
|
-
export * from './components/data-input/
|
|
14
|
+
export * from './components/data-input/rich-text-input.js';
|
|
16
15
|
export * from './components/data-table/add-filter-menu.js';
|
|
17
16
|
export * from './components/data-table/data-table-bulk-action-item.js';
|
|
18
17
|
export * from './components/data-table/data-table-bulk-actions.js';
|
|
@@ -187,6 +186,10 @@ export * from './framework/page/use-detail-page.js';
|
|
|
187
186
|
export * from './framework/page/use-extended-router.js';
|
|
188
187
|
export * from './framework/registry/global-registry.js';
|
|
189
188
|
export * from './framework/registry/registry-types.js';
|
|
189
|
+
export * from './graphql/api.js';
|
|
190
|
+
export * from './graphql/common-operations.js';
|
|
191
|
+
export * from './graphql/fragments.js';
|
|
192
|
+
export * from './graphql/graphql.js';
|
|
190
193
|
export * from './hooks/use-auth.js';
|
|
191
194
|
export * from './hooks/use-channel.js';
|
|
192
195
|
export * from './hooks/use-custom-field-config.js';
|
|
@@ -203,7 +206,3 @@ export * from './hooks/use-theme.js';
|
|
|
203
206
|
export * from './hooks/use-user-settings.js';
|
|
204
207
|
export * from './lib/trans.js';
|
|
205
208
|
export * from './lib/utils.js';
|
|
206
|
-
export * from './graphql/api.js';
|
|
207
|
-
export * from './graphql/common-operations.js';
|
|
208
|
-
export * from './graphql/fragments.js';
|
|
209
|
-
export * from './graphql/graphql.js';
|
|
@@ -111,7 +111,7 @@ export function vendureDashboardPlugin(options: VitePluginVendureDashboardOption
|
|
|
111
111
|
: [
|
|
112
112
|
TanStackRouterVite({
|
|
113
113
|
autoCodeSplitting: true,
|
|
114
|
-
routeFileIgnorePattern: '.graphql.ts|components',
|
|
114
|
+
routeFileIgnorePattern: '.graphql.ts|components|hooks',
|
|
115
115
|
routesDirectory: path.join(packageRoot, 'src/app/routes'),
|
|
116
116
|
generatedRouteTree: path.join(packageRoot, 'src/app/routeTree.gen.ts'),
|
|
117
117
|
}),
|