@vendure/dashboard 3.5.2-master-202512040233 → 3.5.2-master-202512180239

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.
Files changed (69) hide show
  1. package/dist/plugin/constants.js +2 -2
  2. package/dist/plugin/dashboard.plugin.js +1 -1
  3. package/dist/vite/constants.js +1 -0
  4. package/lingui.config.js +1 -0
  5. package/package.json +7 -7
  6. package/src/app/routeTree.gen.ts +1221 -0
  7. package/src/app/routes/_authenticated/_collections/collections.graphql.ts +1 -0
  8. package/src/app/routes/_authenticated/_collections/collections.tsx +249 -167
  9. package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +8 -0
  10. package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +4 -0
  11. package/src/app/routes/_authenticated/_customers/components/customer-history/index.ts +0 -1
  12. package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +1 -1
  13. package/src/app/routes/_authenticated/_orders/components/add-surcharge-form.tsx +139 -0
  14. package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +3 -0
  15. package/src/app/routes/_authenticated/_orders/components/order-address.tsx +3 -3
  16. package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +49 -11
  17. package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +9 -0
  18. package/src/app/routes/_authenticated/_orders/utils/use-modify-order.ts +23 -0
  19. package/src/app/routes/_authenticated/_product-variants/components/add-currency-dropdown.tsx +3 -3
  20. package/src/app/routes/_authenticated/_product-variants/components/add-stock-location-dropdown.tsx +2 -2
  21. package/src/app/routes/_authenticated/_products/products.graphql.ts +1 -0
  22. package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +2 -9
  23. package/src/i18n/locales/bg.po +3436 -0
  24. package/src/lib/components/data-input/datetime-input.tsx +1 -1
  25. package/src/lib/components/data-input/number-input.tsx +24 -5
  26. package/src/lib/components/data-input/relation-selector.tsx +1 -1
  27. package/src/lib/components/data-input/struct-form-input.tsx +175 -174
  28. package/src/lib/components/data-table/data-table-utils.ts +241 -1
  29. package/src/lib/components/data-table/data-table.tsx +190 -60
  30. package/src/lib/components/layout/manage-languages-dialog.tsx +2 -25
  31. package/src/lib/components/shared/custom-fields-form.tsx +13 -8
  32. package/src/lib/components/shared/paginated-list-data-table.tsx +19 -0
  33. package/src/lib/components/ui/alert.tsx +1 -1
  34. package/src/lib/components/ui/carousel.tsx +2 -2
  35. package/src/lib/components/ui/chart.tsx +1 -1
  36. package/src/lib/components/ui/context-menu.tsx +1 -1
  37. package/src/lib/components/ui/drawer.tsx +1 -1
  38. package/src/lib/components/ui/grid-layout.tsx +1 -1
  39. package/src/lib/components/ui/input-group.tsx +1 -0
  40. package/src/lib/components/ui/input-otp.tsx +1 -1
  41. package/src/lib/components/ui/menubar.tsx +1 -1
  42. package/src/lib/components/ui/navigation-menu.tsx +1 -1
  43. package/src/lib/components/ui/progress.tsx +1 -1
  44. package/src/lib/components/ui/radio-group.tsx +1 -1
  45. package/src/lib/components/ui/resizable.tsx +1 -1
  46. package/src/lib/components/ui/select.tsx +1 -1
  47. package/src/lib/components/ui/slider.tsx +1 -1
  48. package/src/lib/components/ui/toggle-group.tsx +2 -2
  49. package/src/lib/components/ui/toggle.tsx +1 -1
  50. package/src/lib/framework/component-registry/component-registry.tsx +2 -6
  51. package/src/lib/framework/extension-api/display-component-extensions.tsx +4 -3
  52. package/src/lib/framework/extension-api/logic/detail-forms.ts +0 -13
  53. package/src/lib/framework/extension-api/types/data-table.ts +4 -2
  54. package/src/lib/framework/extension-api/types/navigation.ts +2 -2
  55. package/src/lib/framework/form-engine/use-generated-form.tsx +7 -1
  56. package/src/lib/framework/layout-engine/page-layout.tsx +1 -1
  57. package/src/lib/framework/nav-menu/nav-menu-extensions.ts +1 -1
  58. package/src/lib/framework/page/detail-page-route-loader.tsx +1 -1
  59. package/src/lib/framework/page/list-page.tsx +62 -38
  60. package/src/lib/framework/page/page-api.ts +1 -1
  61. package/src/lib/framework/page/use-detail-page.ts +4 -2
  62. package/src/lib/framework/page/use-extended-router.tsx +20 -16
  63. package/src/lib/framework/registry/registry-types.ts +2 -1
  64. package/src/lib/graphql/graphql-env.d.ts +8 -12
  65. package/src/lib/hooks/use-drag-and-drop.ts +86 -0
  66. package/src/lib/providers/channel-provider.tsx +11 -7
  67. package/LICENSE.md +0 -42
  68. package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +0 -129
  69. /package/src/{app/routes/_authenticated/_global-settings → lib}/utils/global-languages.ts +0 -0
@@ -1,129 +0,0 @@
1
- import { usePaginatedList } from '@/vdb/components/shared/paginated-list-data-table.js';
2
- import { Button } from '@/vdb/components/ui/button.js';
3
- import { Form, FormControl, FormItem, FormLabel, FormMessage } from '@/vdb/components/ui/form.js';
4
- import { Input } from '@/vdb/components/ui/input.js';
5
- import { api } from '@/vdb/graphql/api.js';
6
- import { graphql } from '@/vdb/graphql/graphql.js';
7
- import { useUserSettings } from '@/vdb/hooks/use-user-settings.js';
8
- import { Trans } from '@lingui/react/macro';
9
- import { useMutation, useQuery } from '@tanstack/react-query';
10
- import { useForm } from 'react-hook-form';
11
-
12
- const facetValuesDocument = graphql(`
13
- query FacetValue($options: FacetValueListOptions) {
14
- facetValues(options: $options) {
15
- items {
16
- id
17
- name
18
- code
19
- customFields
20
- translations {
21
- id
22
- languageCode
23
- name
24
- }
25
- }
26
- }
27
- }
28
- `);
29
-
30
- const updateFacetValueDocument = graphql(`
31
- mutation UpdateFacetValue($input: [UpdateFacetValueInput!]!) {
32
- updateFacetValues(input: $input) {
33
- id
34
- }
35
- }
36
- `);
37
-
38
- export interface EditFacetValueProps {
39
- facetValueId: string;
40
- onSuccess?: () => void;
41
- }
42
-
43
- export function EditFacetValue({ facetValueId, onSuccess }: Readonly<EditFacetValueProps>) {
44
- const {
45
- settings: { contentLanguage },
46
- } = useUserSettings();
47
- const { refetchPaginatedList } = usePaginatedList();
48
- const { data: facetValues } = useQuery({
49
- queryKey: ['facetValues', facetValueId],
50
- queryFn: () => api.query(facetValuesDocument, { options: { filter: { id: { eq: facetValueId } } } }),
51
- });
52
- const { mutate: updateFacetValue } = useMutation({
53
- mutationFn: api.mutate(updateFacetValueDocument),
54
- onSuccess: () => {
55
- refetchPaginatedList();
56
- onSuccess?.();
57
- },
58
- });
59
- const facetValue = facetValues?.facetValues.items[0];
60
-
61
- const form = useForm({
62
- values: {
63
- name: facetValue?.name ?? '',
64
- code: facetValue?.code ?? '',
65
- },
66
- });
67
-
68
- if (!facetValue) {
69
- return <div>Facet value not found</div>;
70
- }
71
-
72
- const handleSave = (values: { name: string; code: string }) => {
73
- const translations = facetValue.translations.map(translation => {
74
- if (translation.languageCode === contentLanguage) {
75
- return {
76
- id: translation.id,
77
- languageCode: translation.languageCode,
78
- name: values.name,
79
- };
80
- }
81
- return translation;
82
- });
83
- updateFacetValue({
84
- input: [
85
- {
86
- id: facetValue.id,
87
- translations,
88
- code: values.code,
89
- },
90
- ],
91
- });
92
- };
93
-
94
- return (
95
- <div className="grid gap-4">
96
- <div className="space-y-2">
97
- <h4 className="font-medium leading-none">Edit Facet Value</h4>
98
- <p className="text-sm text-muted-foreground">Update the name and code of this facet value.</p>
99
- </div>
100
- <Form {...form}>
101
- <form onSubmit={form.handleSubmit(handleSave)} className="grid gap-2">
102
- <FormItem>
103
- <FormLabel>
104
- <Trans>Name</Trans>
105
- </FormLabel>
106
- <FormControl>
107
- <Input placeholder="" {...form.register('name')} />
108
- </FormControl>
109
- <FormMessage />
110
- </FormItem>
111
- <FormItem>
112
- <FormLabel>
113
- <Trans>Code</Trans>
114
- </FormLabel>
115
- <FormControl>
116
- <Input placeholder="" {...form.register('code')} />
117
- </FormControl>
118
- <FormMessage />
119
- </FormItem>
120
- <div className="flex justify-end">
121
- <Button type="submit" size="sm">
122
- <Trans>Save changes</Trans>
123
- </Button>
124
- </div>
125
- </form>
126
- </Form>
127
- </div>
128
- );
129
- }