@vendure/dashboard 3.5.1-master-202511040232 → 3.5.1-master-202511060232
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/package.json +5 -4
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +3 -0
- package/src/lib/components/data-input/default-relation-input.tsx +1 -1
- package/src/lib/components/data-input/product-multi-selector-input.tsx +18 -21
- package/src/lib/components/data-input/relation-selector.tsx +3 -3
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +2 -1
- package/src/lib/components/shared/customer-address-form.tsx +3 -0
- package/dist/vite/utils/config-loader.d.ts +0 -1
- package/dist/vite/utils/config-loader.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/dashboard",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.5.1-master-
|
|
4
|
+
"version": "3.5.1-master-202511060232",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"@radix-ui/react-toggle": "^1.1.9",
|
|
92
92
|
"@radix-ui/react-toggle-group": "^1.1.10",
|
|
93
93
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
94
|
+
"@swc/core": "1.13.5",
|
|
94
95
|
"@tailwindcss/vite": "^4.1.5",
|
|
95
96
|
"@tanstack/eslint-plugin-query": "^5.66.1",
|
|
96
97
|
"@tanstack/react-query": "^5.66.7",
|
|
@@ -154,8 +155,8 @@
|
|
|
154
155
|
"@storybook/addon-vitest": "^10.0.0-beta.9",
|
|
155
156
|
"@storybook/react-vite": "^10.0.0-beta.9",
|
|
156
157
|
"@types/node": "^22.13.4",
|
|
157
|
-
"@vendure/common": "^3.5.1-master-
|
|
158
|
-
"@vendure/core": "^3.5.1-master-
|
|
158
|
+
"@vendure/common": "^3.5.1-master-202511060232",
|
|
159
|
+
"@vendure/core": "^3.5.1-master-202511060232",
|
|
159
160
|
"@vitest/browser": "^3.2.4",
|
|
160
161
|
"@vitest/coverage-v8": "^3.2.4",
|
|
161
162
|
"eslint": "^9.19.0",
|
|
@@ -172,5 +173,5 @@
|
|
|
172
173
|
"lightningcss-linux-arm64-musl": "^1.29.3",
|
|
173
174
|
"lightningcss-linux-x64-musl": "^1.29.1"
|
|
174
175
|
},
|
|
175
|
-
"gitHead": "
|
|
176
|
+
"gitHead": "e269d041561c3200b3626c61344645815a83c83b"
|
|
176
177
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CustomFieldsForm } from '@/vdb/components/shared/custom-fields-form.js';
|
|
1
2
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
3
|
import { Checkbox } from '@/vdb/components/ui/checkbox.js';
|
|
3
4
|
import {
|
|
@@ -284,6 +285,8 @@ export function CustomerAddressForm({ address, onSubmit, onCancel }: Readonly<Cu
|
|
|
284
285
|
/>
|
|
285
286
|
</div>
|
|
286
287
|
|
|
288
|
+
{/* Custom Fields */}
|
|
289
|
+
<CustomFieldsForm entityType="Address" control={form.control} />
|
|
287
290
|
{/* Default Address Checkboxes */}
|
|
288
291
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 pt-2">
|
|
289
292
|
<FormField
|
|
@@ -93,13 +93,13 @@ function EmptyState() {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
function ProductList({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
items,
|
|
97
|
+
mode,
|
|
98
|
+
selectedIds,
|
|
99
|
+
getItemId,
|
|
100
|
+
getItemName,
|
|
101
|
+
toggleSelection,
|
|
102
|
+
}: Readonly<{
|
|
103
103
|
items: SearchItem[];
|
|
104
104
|
mode: 'product' | 'variant';
|
|
105
105
|
selectedIds: Set<string>;
|
|
@@ -163,12 +163,12 @@ function ProductList({
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
function ProductMultiSelectorDialog({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
mode,
|
|
167
|
+
initialSelectionIds = [],
|
|
168
|
+
onSelectionChange,
|
|
169
|
+
open,
|
|
170
|
+
onOpenChange,
|
|
171
|
+
}: Readonly<ProductMultiSelectorProps>) {
|
|
172
172
|
const [searchTerm, setSearchTerm] = useState('');
|
|
173
173
|
const [selectedItems, setSelectedItems] = useState<SearchItem[]>([]);
|
|
174
174
|
const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set());
|
|
@@ -221,7 +221,7 @@ function ProductMultiSelectorDialog({
|
|
|
221
221
|
|
|
222
222
|
if (selectedIds.has(itemId)) {
|
|
223
223
|
newSelectedIds.delete(itemId);
|
|
224
|
-
const index =
|
|
224
|
+
const index = newSelectedItems.findIndex(selected => getItemId(selected) === itemId);
|
|
225
225
|
if (index >= 0) {
|
|
226
226
|
newSelectedItems.splice(index, 1);
|
|
227
227
|
}
|
|
@@ -363,7 +363,7 @@ function ProductMultiSelectorDialog({
|
|
|
363
363
|
<Button variant="outline" onClick={() => onOpenChange(false)}>
|
|
364
364
|
<Trans>Cancel</Trans>
|
|
365
365
|
</Button>
|
|
366
|
-
<Button onClick={handleSelect}
|
|
366
|
+
<Button onClick={handleSelect}>
|
|
367
367
|
<Trans>Select {selectedItems.length} Items</Trans>
|
|
368
368
|
</Button>
|
|
369
369
|
</DialogFooter>
|
|
@@ -374,20 +374,17 @@ function ProductMultiSelectorDialog({
|
|
|
374
374
|
|
|
375
375
|
export const ProductMultiInput: DashboardFormComponent = ({ value, onChange, ...props }) => {
|
|
376
376
|
const [open, setOpen] = useState(false);
|
|
377
|
-
// Parse the configuration from the field definition
|
|
378
377
|
const mode = props.fieldDef?.ui?.selectionMode === 'variant' ? 'variant' : 'product';
|
|
379
|
-
|
|
380
|
-
const selectedIds = value;
|
|
378
|
+
const selectedIds = value || [];
|
|
381
379
|
|
|
382
380
|
const handleSelectionChange = useCallback(
|
|
383
381
|
(newSelectedIds: string[]) => {
|
|
384
|
-
onChange(
|
|
382
|
+
onChange(newSelectedIds);
|
|
385
383
|
},
|
|
386
384
|
[onChange],
|
|
387
385
|
);
|
|
388
386
|
const itemType = mode === 'product' ? 'products' : 'variants';
|
|
389
|
-
const buttonText =
|
|
390
|
-
selectedIds.length > 0 ? `Selected ${selectedIds.length} ${itemType}` : `Select ${itemType}`;
|
|
387
|
+
const buttonText = selectedIds.length > 0 ? `Change selected ${itemType}` : `Select ${itemType}`;
|
|
391
388
|
return (
|
|
392
389
|
<>
|
|
393
390
|
<div className="space-y-2">
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
11
11
|
import { getQueryName } from '@/vdb/framework/document-introspection/get-document-structure.js';
|
|
12
12
|
import { api } from '@/vdb/graphql/api.js';
|
|
13
|
-
import { Trans } from '@lingui/react/macro';
|
|
14
13
|
import { cn } from '@/vdb/lib/utils.js';
|
|
14
|
+
import { Trans } from '@lingui/react/macro';
|
|
15
15
|
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
16
16
|
import { useDebounce } from '@uidotdev/usehooks';
|
|
17
17
|
import type { DocumentNode } from 'graphql';
|
|
@@ -48,7 +48,7 @@ export interface RelationSelectorProps<T = any> {
|
|
|
48
48
|
*/
|
|
49
49
|
selectorLabel?: React.ReactNode;
|
|
50
50
|
value?: string | string[];
|
|
51
|
-
onChange: (value: string | string[]) => void;
|
|
51
|
+
onChange: (value: string | string[] | undefined) => void;
|
|
52
52
|
disabled?: boolean;
|
|
53
53
|
className?: string;
|
|
54
54
|
}
|
|
@@ -344,7 +344,7 @@ export function RelationSelector<T>({
|
|
|
344
344
|
} else {
|
|
345
345
|
// Clear cache for single select
|
|
346
346
|
setSelectedItemsCache([]);
|
|
347
|
-
onChange(
|
|
347
|
+
onChange(undefined);
|
|
348
348
|
}
|
|
349
349
|
};
|
|
350
350
|
|
|
@@ -39,7 +39,8 @@ export interface DataTableBulkActionItemProps {
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```tsx
|
|
42
|
-
* import {
|
|
42
|
+
* import { Trans } from '@lingui/react/macro';
|
|
43
|
+
* import { DataTableBulkActionItem, BulkActionComponent } from '\@vendure/dashboard';
|
|
43
44
|
* import { Check } from 'lucide-react';
|
|
44
45
|
*
|
|
45
46
|
* export const MyBulkAction: BulkActionComponent<any> = ({ selection, table }) => {
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from '../ui/form.js';
|
|
19
19
|
import { Input } from '../ui/input.js';
|
|
20
20
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select.js';
|
|
21
|
+
import { CustomFieldsForm } from './custom-fields-form.js';
|
|
21
22
|
|
|
22
23
|
// Query document to fetch available countries
|
|
23
24
|
const getAvailableCountriesDocument = graphql(`
|
|
@@ -275,6 +276,8 @@ export function CustomerAddressForm<T>({
|
|
|
275
276
|
/>
|
|
276
277
|
</div>
|
|
277
278
|
|
|
279
|
+
{/* Custom Fields */}
|
|
280
|
+
<CustomFieldsForm entityType="Address" control={form.control} />
|
|
278
281
|
{/* Default Address Checkboxes */}
|
|
279
282
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 pt-2">
|
|
280
283
|
<FormField
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|