@vendure/dashboard 3.3.6-master-202507041203 → 3.4.0-minor-202506250934
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/README.md +4 -41
- package/dist/plugin/utils/config-loader.d.ts +1 -70
- package/dist/plugin/utils/config-loader.js +9 -33
- package/dist/plugin/vite-plugin-config-loader.js +1 -6
- package/dist/plugin/vite-plugin-config.js +7 -6
- package/dist/plugin/vite-plugin-dashboard-metadata.d.ts +3 -1
- package/dist/plugin/vite-plugin-dashboard-metadata.js +8 -1
- package/dist/plugin/vite-plugin-vendure-dashboard.d.ts +0 -41
- package/dist/plugin/vite-plugin-vendure-dashboard.js +2 -5
- package/package.json +131 -131
- package/src/app/app-providers.tsx +6 -6
- package/src/app/main.tsx +9 -9
- package/src/app/routes/__root.tsx +2 -1
- package/src/app/routes/_authenticated/_administrators/administrators.graphql.ts +1 -10
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +8 -15
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +12 -16
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +16 -16
- package/src/app/routes/_authenticated/_assets/assets.graphql.ts +2 -13
- package/src/app/routes/_authenticated/_assets/assets.tsx +4 -16
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +38 -52
- package/src/app/routes/_authenticated/_channels/channels.graphql.ts +1 -10
- package/src/app/routes/_authenticated/_channels/channels.tsx +10 -17
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +17 -21
- package/src/app/routes/_authenticated/_collections/collections.graphql.ts +3 -60
- package/src/app/routes/_authenticated/_collections/collections.tsx +124 -168
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +16 -20
- package/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx +8 -7
- package/src/app/routes/_authenticated/_collections/components/collection-contents-sheet.tsx +5 -9
- package/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx +9 -10
- package/src/app/routes/_authenticated/_collections/components/collection-filters-selector.tsx +7 -7
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +2 -11
- package/src/app/routes/_authenticated/_countries/countries.tsx +6 -13
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +17 -21
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-sheet.tsx +5 -12
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +17 -22
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.graphql.ts +2 -11
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +6 -13
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +15 -18
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +19 -19
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +10 -10
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +5 -5
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history.tsx +7 -11
- package/src/app/routes/_authenticated/_customers/components/customer-history/use-customer-history.ts +4 -4
- package/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx +73 -75
- package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +4 -4
- package/src/app/routes/_authenticated/_customers/customers.graphql.ts +2 -10
- package/src/app/routes/_authenticated/_customers/customers.tsx +6 -13
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +15 -19
- package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +9 -9
- package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +4 -4
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +11 -15
- package/src/app/routes/_authenticated/_facets/facets.graphql.ts +1 -31
- package/src/app/routes/_authenticated/_facets/facets.tsx +7 -31
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +13 -17
- package/src/app/routes/_authenticated/_global-settings/global-settings.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +13 -13
- package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +14 -11
- package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +55 -93
- package/src/app/routes/_authenticated/_orders/components/money-gross-net.tsx +9 -11
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +6 -5
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +62 -67
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history.tsx +6 -11
- package/src/app/routes/_authenticated/_orders/components/order-history/use-order-history.ts +5 -9
- package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +7 -11
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +22 -39
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +4 -4
- package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +36 -37
- package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +33 -18
- package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +44 -43
- package/src/app/routes/_authenticated/_orders/orders.graphql.ts +3 -101
- package/src/app/routes/_authenticated/_orders/orders.tsx +20 -21
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +16 -72
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +90 -188
- package/src/app/routes/_authenticated/_payment-methods/components/payment-eligibility-checker-selector.tsx +7 -10
- package/src/app/routes/_authenticated/_payment-methods/components/payment-handler-selector.tsx +11 -11
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.graphql.ts +2 -29
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +14 -36
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +15 -22
- package/src/app/routes/_authenticated/_product-variants/components/variant-price-detail.tsx +6 -7
- package/src/app/routes/_authenticated/_product-variants/product-variants.graphql.ts +3 -64
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +9 -39
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +22 -33
- package/src/app/routes/_authenticated/_products/components/add-product-variant-dialog.tsx +10 -10
- package/src/app/routes/_authenticated/_products/components/create-product-options-dialog.tsx +41 -57
- package/src/app/routes/_authenticated/_products/components/create-product-variants-dialog.tsx +11 -11
- package/src/app/routes/_authenticated/_products/components/create-product-variants.tsx +14 -18
- package/src/app/routes/_authenticated/_products/components/option-value-input.tsx +15 -21
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +34 -28
- package/src/app/routes/_authenticated/_products/components/product-variants-table.tsx +53 -84
- package/src/app/routes/_authenticated/_products/products.graphql.ts +2 -70
- package/src/app/routes/_authenticated/_products/products.tsx +7 -36
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +24 -33
- package/src/app/routes/_authenticated/_profile/profile.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_profile/profile.tsx +8 -8
- package/src/app/routes/_authenticated/_promotions/components/promotion-actions-selector.tsx +11 -14
- package/src/app/routes/_authenticated/_promotions/components/promotion-conditions-selector.tsx +11 -14
- package/src/app/routes/_authenticated/_promotions/promotions.graphql.ts +2 -27
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +7 -31
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +16 -20
- package/src/app/routes/_authenticated/_roles/components/expandable-permissions.tsx +5 -5
- package/src/app/routes/_authenticated/_roles/components/permissions-grid.tsx +17 -21
- package/src/app/routes/_authenticated/_roles/roles.graphql.ts +1 -10
- package/src/app/routes/_authenticated/_roles/roles.tsx +10 -17
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +12 -16
- package/src/app/routes/_authenticated/_sellers/sellers.graphql.ts +1 -10
- package/src/app/routes/_authenticated/_sellers/sellers.tsx +6 -13
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +13 -17
- package/src/app/routes/_authenticated/_shipping-methods/components/fulfillment-handler-selector.tsx +6 -6
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-calculator-selector.tsx +21 -23
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-eligibility-checker-selector.tsx +21 -25
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-method-dialog.tsx +3 -3
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.graphql.ts +2 -29
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +6 -25
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +13 -17
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.graphql.ts +1 -26
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +6 -25
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +12 -16
- package/src/app/routes/_authenticated/_system/components/payload-dialog.tsx +4 -4
- package/src/app/routes/_authenticated/_system/healthchecks.tsx +4 -4
- package/src/app/routes/_authenticated/_system/job-queue.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_system/job-queue.tsx +6 -10
- package/src/app/routes/_authenticated/_system/scheduled-tasks.tsx +28 -34
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +2 -11
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +7 -14
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +16 -20
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.graphql.ts +2 -11
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +8 -15
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +18 -22
- package/src/app/routes/_authenticated/_zones/components/zone-countries-sheet.tsx +4 -4
- package/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx +8 -12
- package/src/app/routes/_authenticated/_zones/zones.graphql.ts +2 -11
- package/src/app/routes/_authenticated/_zones/zones.tsx +6 -13
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +14 -18
- package/src/app/routes/_authenticated/index.tsx +4 -4
- package/src/app/routes/_authenticated.tsx +3 -3
- package/src/app/routes/login.tsx +2 -2
- package/src/app/styles.css +1 -4
- package/src/lib/components/data-display/boolean.tsx +1 -1
- package/src/lib/components/data-display/date-time.tsx +2 -2
- package/src/lib/components/data-display/json.tsx +1 -1
- package/src/lib/components/data-display/money.tsx +3 -2
- package/src/lib/components/data-input/affixed-input.tsx +8 -3
- package/src/lib/components/data-input/customer-group-input.tsx +2 -2
- package/src/lib/components/data-input/datetime-input.tsx +146 -129
- package/src/lib/components/data-input/facet-value-input.tsx +22 -30
- package/src/lib/components/data-input/money-input.tsx +12 -5
- package/src/lib/components/data-input/{rich-text-input.tsx → richt-text-input.tsx} +1 -1
- package/src/lib/components/data-table/add-filter-menu.tsx +18 -9
- package/src/lib/components/data-table/data-table-column-header.tsx +22 -4
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +8 -8
- package/src/lib/components/data-table/data-table-filter-badge.tsx +8 -16
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +8 -8
- package/src/lib/components/data-table/data-table-pagination.tsx +4 -4
- package/src/lib/components/data-table/data-table-view-options.tsx +21 -25
- package/src/lib/components/data-table/data-table.tsx +41 -85
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +8 -11
- package/src/lib/components/data-table/filters/data-table-datetime-filter.tsx +23 -14
- package/src/lib/components/data-table/filters/data-table-id-filter.tsx +10 -15
- package/src/lib/components/data-table/filters/data-table-number-filter.tsx +17 -18
- package/src/lib/components/data-table/filters/data-table-string-filter.tsx +12 -29
- package/src/lib/components/data-table/human-readable-operator.tsx +3 -3
- package/src/lib/components/data-table/refresh-button.tsx +15 -30
- package/src/lib/components/layout/app-layout.tsx +8 -8
- package/src/lib/components/layout/app-sidebar.tsx +5 -5
- package/src/lib/components/layout/channel-switcher.tsx +8 -8
- package/src/lib/components/layout/content-language-selector.tsx +10 -16
- package/src/lib/components/layout/generated-breadcrumbs.tsx +1 -1
- package/src/lib/components/layout/language-dialog.tsx +11 -5
- package/src/lib/components/layout/nav-main.tsx +4 -4
- package/src/lib/components/layout/nav-projects.tsx +2 -2
- package/src/lib/components/layout/nav-user.tsx +7 -7
- package/src/lib/components/layout/prerelease-popup.tsx +1 -1
- package/src/lib/components/login/login-form.tsx +5 -5
- package/src/lib/components/shared/alerts.tsx +3 -3
- package/src/lib/components/shared/animated-number.tsx +2 -2
- package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +19 -29
- package/src/lib/components/shared/asset/asset-gallery.tsx +18 -23
- package/src/lib/components/shared/asset/asset-picker-dialog.tsx +66 -63
- package/src/lib/components/shared/asset/asset-preview-dialog.tsx +7 -3
- package/src/lib/components/shared/asset/asset-preview-selector.tsx +6 -4
- package/src/lib/components/shared/asset/asset-preview.tsx +15 -7
- package/src/lib/components/shared/asset/asset-properties.tsx +9 -7
- package/src/lib/components/shared/asset/focal-point-control.tsx +13 -5
- package/src/lib/components/shared/assigned-facet-values.tsx +5 -1
- package/src/lib/components/shared/channel-code-label.tsx +4 -3
- package/src/lib/components/shared/channel-selector.tsx +6 -6
- package/src/lib/components/shared/configurable-operation-arg-input.tsx +2 -2
- package/src/lib/components/shared/configurable-operation-input.tsx +16 -15
- package/src/lib/components/shared/confirmation-dialog.tsx +2 -2
- package/src/lib/components/shared/copyable-text.tsx +3 -2
- package/src/lib/components/shared/country-selector.tsx +18 -21
- package/src/lib/components/shared/currency-selector.tsx +5 -5
- package/src/lib/components/shared/custom-fields-form.tsx +51 -253
- package/src/lib/components/shared/customer-address-form.tsx +13 -18
- package/src/lib/components/shared/customer-group-selector.tsx +6 -6
- package/src/lib/components/shared/customer-selector.tsx +18 -24
- package/src/lib/components/shared/detail-page-button.tsx +1 -3
- package/src/lib/components/shared/entity-assets.tsx +34 -33
- package/src/lib/components/shared/error-page.tsx +6 -6
- package/src/lib/components/shared/facet-value-chip.tsx +5 -12
- package/src/lib/components/shared/facet-value-selector.tsx +63 -64
- package/src/lib/components/shared/form-field-wrapper.tsx +13 -22
- package/src/lib/components/shared/history-timeline/history-entry.tsx +6 -12
- package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +3 -3
- package/src/lib/components/shared/history-timeline/history-note-editor.tsx +4 -4
- package/src/lib/components/shared/history-timeline/history-note-input.tsx +3 -3
- package/src/lib/components/shared/history-timeline/history-timeline.tsx +8 -15
- package/src/lib/components/shared/language-selector.tsx +5 -5
- package/src/lib/components/shared/logo-mark.tsx +2 -2
- package/src/lib/components/shared/multi-select.tsx +5 -5
- package/src/lib/components/shared/navigation-confirmation.tsx +9 -24
- package/src/lib/components/shared/option-value-input.tsx +15 -17
- package/src/lib/components/shared/paginated-list-data-table.tsx +24 -100
- package/src/lib/components/shared/permission-guard.tsx +4 -4
- package/src/lib/components/shared/product-variant-selector.tsx +31 -32
- package/src/lib/components/shared/role-code-label.tsx +6 -10
- package/src/lib/components/shared/role-selector.tsx +4 -4
- package/src/lib/components/shared/seller-selector.tsx +17 -21
- package/src/lib/components/shared/stock-level-label.tsx +5 -5
- package/src/lib/components/shared/tax-category-selector.tsx +5 -5
- package/src/lib/components/shared/translatable-form-field.tsx +10 -5
- package/src/lib/components/shared/vendure-image.tsx +2 -31
- package/src/lib/components/shared/zone-selector.tsx +6 -5
- package/src/lib/components/ui/accordion.tsx +3 -3
- package/src/lib/components/ui/alert-dialog.tsx +10 -10
- package/src/lib/components/ui/alert.tsx +3 -3
- package/src/lib/components/ui/badge.tsx +2 -2
- package/src/lib/components/ui/breadcrumb.tsx +4 -4
- package/src/lib/components/ui/button.tsx +3 -10
- package/src/lib/components/ui/calendar.tsx +459 -392
- package/src/lib/components/ui/card.tsx +2 -2
- package/src/lib/components/ui/checkbox.tsx +2 -2
- package/src/lib/components/ui/command.tsx +6 -12
- package/src/lib/components/ui/dialog.tsx +2 -2
- package/src/lib/components/ui/dropdown-menu.tsx +7 -7
- package/src/lib/components/ui/form.tsx +4 -4
- package/src/lib/components/ui/hover-card.tsx +3 -3
- package/src/lib/components/ui/input.tsx +1 -1
- package/src/lib/components/ui/label.tsx +2 -2
- package/src/lib/components/ui/pagination.tsx +108 -87
- package/src/lib/components/ui/popover.tsx +3 -3
- package/src/lib/components/ui/scroll-area.tsx +2 -2
- package/src/lib/components/ui/select.tsx +129 -151
- package/src/lib/components/ui/separator.tsx +2 -2
- package/src/lib/components/ui/sheet.tsx +5 -5
- package/src/lib/components/ui/sidebar.tsx +10 -10
- package/src/lib/components/ui/skeleton.tsx +1 -1
- package/src/lib/components/ui/switch.tsx +2 -2
- package/src/lib/components/ui/table.tsx +2 -2
- package/src/lib/components/ui/tabs.tsx +3 -3
- package/src/lib/components/ui/textarea.tsx +1 -1
- package/src/lib/components/ui/tooltip.tsx +3 -3
- package/src/lib/framework/alert/alert-extensions.tsx +3 -2
- package/src/lib/framework/alert/alert-item.tsx +3 -5
- package/src/lib/framework/alert/types.ts +13 -0
- package/src/lib/framework/component-registry/component-registry.tsx +47 -33
- package/src/lib/framework/dashboard-widget/base-widget.tsx +13 -5
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +8 -8
- package/src/lib/framework/dashboard-widget/latest-orders-widget/latest-orders-widget.graphql.ts +1 -1
- package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +7 -6
- package/src/lib/framework/dashboard-widget/metrics-widget/metrics-widget.graphql.ts +1 -1
- package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +6 -7
- package/src/lib/framework/dashboard-widget/orders-summary/order-summary-widget.graphql.ts +1 -1
- package/src/lib/framework/dashboard-widget/types.ts +22 -0
- package/src/lib/framework/dashboard-widget/widget-extensions.tsx +1 -1
- package/src/lib/framework/defaults.ts +1 -1
- package/src/lib/framework/document-introspection/add-custom-fields.ts +2 -50
- package/src/lib/framework/document-introspection/get-document-structure.ts +10 -43
- package/src/lib/framework/document-introspection/hooks.ts +1 -4
- package/src/lib/framework/extension-api/define-dashboard-extension.ts +49 -31
- package/src/lib/framework/extension-api/extension-api-types.ts +98 -25
- package/src/lib/framework/extension-api/use-dashboard-extensions.ts +1 -2
- package/src/lib/framework/form-engine/form-schema-tools.ts +1 -1
- package/src/lib/framework/form-engine/use-generated-form.tsx +18 -57
- package/src/lib/framework/layout-engine/location-wrapper.tsx +8 -11
- package/src/lib/framework/layout-engine/page-layout.tsx +48 -66
- package/src/lib/framework/page/detail-page-route-loader.tsx +7 -26
- package/src/lib/framework/page/detail-page.tsx +37 -122
- package/src/lib/framework/page/list-page.tsx +11 -9
- package/src/lib/framework/page/use-detail-page.ts +7 -38
- package/src/lib/framework/page/use-extended-router.tsx +5 -4
- package/src/lib/framework/registry/registry-types.ts +5 -15
- package/src/lib/graphql/{fragments.ts → fragments.tsx} +2 -1
- package/src/lib/graphql/graphql-env.d.ts +13 -16
- package/src/lib/hooks/use-auth.tsx +1 -1
- package/src/lib/hooks/use-channel.ts +1 -1
- package/src/lib/hooks/use-grouped-permissions.ts +2 -3
- package/src/lib/hooks/use-page.tsx +2 -2
- package/src/lib/hooks/use-permissions.ts +2 -3
- package/src/lib/hooks/use-server-config.ts +1 -1
- package/src/lib/hooks/use-theme.ts +1 -1
- package/src/lib/hooks/use-user-settings.tsx +1 -1
- package/src/lib/index.ts +6 -65
- package/src/lib/lib/trans.tsx +3 -3
- package/src/lib/lib/utils.ts +0 -49
- package/src/lib/providers/auth.tsx +14 -37
- package/src/lib/providers/channel-provider.tsx +4 -4
- package/src/lib/providers/server-config.tsx +11 -13
- package/src/lib/providers/theme-provider.tsx +3 -2
- package/vite/utils/config-loader.ts +10 -120
- package/vite/vite-plugin-config-loader.ts +1 -6
- package/vite/vite-plugin-config.ts +7 -6
- package/vite/vite-plugin-dashboard-metadata.ts +9 -1
- package/vite/vite-plugin-vendure-dashboard.ts +4 -48
- package/dist/plugin/tests/barrel-exports/my-plugin/index.d.ts +0 -1
- package/dist/plugin/tests/barrel-exports/my-plugin/index.js +0 -17
- package/dist/plugin/tests/barrel-exports/my-plugin/src/my.plugin.d.ts +0 -2
- package/dist/plugin/tests/barrel-exports/my-plugin/src/my.plugin.js +0 -20
- package/dist/plugin/tests/barrel-exports/vendure-config.d.ts +0 -2
- package/dist/plugin/tests/barrel-exports/vendure-config.js +0 -19
- package/dist/plugin/tests/barrel-exports.spec.d.ts +0 -1
- package/dist/plugin/tests/barrel-exports.spec.js +0 -14
- package/dist/plugin/vite-plugin-tailwind-source.d.ts +0 -7
- package/dist/plugin/vite-plugin-tailwind-source.js +0 -49
- package/src/app/common/delete-bulk-action.tsx +0 -148
- package/src/app/common/duplicate-bulk-action.tsx +0 -134
- package/src/app/routes/_authenticated/_administrators/components/administrator-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +0 -45
- package/src/app/routes/_authenticated/_channels/components/channel-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +0 -123
- package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +0 -430
- package/src/app/routes/_authenticated/_collections/components/move-single-collection.tsx +0 -33
- package/src/app/routes/_authenticated/_countries/components/country-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_customers/components/customer-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +0 -104
- package/src/app/routes/_authenticated/_orders/components/add-manual-payment-dialog.tsx +0 -191
- package/src/app/routes/_authenticated/_orders/components/fulfill-order-dialog.tsx +0 -320
- package/src/app/routes/_authenticated/_orders/components/fulfillment-details.tsx +0 -173
- package/src/app/routes/_authenticated/_orders/utils/order-types.ts +0 -7
- package/src/app/routes/_authenticated/_orders/utils/order-utils.ts +0 -77
- package/src/app/routes/_authenticated/_payment-methods/components/payment-method-bulk-actions.tsx +0 -58
- package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +0 -110
- package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +0 -281
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +0 -123
- package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +0 -82
- package/src/app/routes/_authenticated/_roles/components/role-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_sellers/components/seller-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-bulk-actions.tsx +0 -61
- package/src/app/routes/_authenticated/_stock-locations/components/stock-location-bulk-actions.tsx +0 -58
- package/src/app/routes/_authenticated/_tax-categories/components/tax-category-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_tax-rates/components/tax-rate-bulk-actions.tsx +0 -15
- package/src/app/routes/_authenticated/_zones/components/zone-bulk-actions.tsx +0 -15
- package/src/lib/components/data-input/index.ts +0 -11
- package/src/lib/components/data-input/relation-input.tsx +0 -153
- package/src/lib/components/data-input/relation-selector.tsx +0 -468
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +0 -101
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +0 -95
- package/src/lib/components/labeled-data.tsx +0 -21
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +0 -94
- package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +0 -71
- package/src/lib/components/shared/assign-to-channel-dialog.tsx +0 -155
- package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +0 -90
- package/src/lib/framework/data-table/data-table-extensions.ts +0 -35
- package/src/lib/framework/document-extension/extend-detail-form-query.ts +0 -50
- package/src/lib/framework/document-extension/extend-document.spec.ts +0 -884
- package/src/lib/framework/document-extension/extend-document.ts +0 -159
- package/src/lib/framework/extension-api/display-component-extensions.tsx +0 -69
- package/src/lib/framework/extension-api/input-component-extensions.tsx +0 -69
- package/src/lib/framework/extension-api/logic/alerts.ts +0 -10
- package/src/lib/framework/extension-api/logic/data-table.ts +0 -60
- package/src/lib/framework/extension-api/logic/detail-forms.ts +0 -48
- package/src/lib/framework/extension-api/logic/form-components.ts +0 -13
- package/src/lib/framework/extension-api/logic/index.ts +0 -8
- package/src/lib/framework/extension-api/logic/layout.ts +0 -22
- package/src/lib/framework/extension-api/logic/navigation.ts +0 -37
- package/src/lib/framework/extension-api/logic/widgets.ts +0 -10
- package/src/lib/framework/extension-api/types/alerts.ts +0 -54
- package/src/lib/framework/extension-api/types/data-table.ts +0 -87
- package/src/lib/framework/extension-api/types/detail-forms.ts +0 -81
- package/src/lib/framework/extension-api/types/form-components.ts +0 -32
- package/src/lib/framework/extension-api/types/index.ts +0 -8
- package/src/lib/framework/extension-api/types/layout.ts +0 -78
- package/src/lib/framework/extension-api/types/navigation.ts +0 -19
- package/src/lib/framework/extension-api/types/widgets.ts +0 -97
- package/src/lib/framework/form-engine/custom-form-component-extensions.ts +0 -38
- package/src/lib/framework/form-engine/custom-form-component.tsx +0 -33
- package/src/lib/framework/form-engine/utils.ts +0 -58
- package/src/lib/framework/layout-engine/page-block-provider.tsx +0 -6
- package/src/lib/graphql/common-operations.ts +0 -18
- package/src/lib/hooks/use-extended-detail-query.ts +0 -37
- package/src/lib/hooks/use-extended-list-query.ts +0 -73
- package/src/lib/hooks/use-page-block.tsx +0 -10
- package/vite/tests/barrel-exports/my-plugin/index.ts +0 -1
- package/vite/tests/barrel-exports/my-plugin/src/my.plugin.ts +0 -8
- package/vite/tests/barrel-exports/package.json +0 -6
- package/vite/tests/barrel-exports/vendure-config.ts +0 -19
- package/vite/tests/barrel-exports.spec.ts +0 -21
- package/vite/vite-plugin-tailwind-source.ts +0 -65
- /package/src/lib/components/data-table/{types.ts → data-table-types.ts} +0 -0
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { Trans } from '@/
|
|
1
|
+
import { Trans } from '@/lib/trans.js';
|
|
2
2
|
import { useBlocker } from '@tanstack/react-router';
|
|
3
3
|
import { UseFormReturn } from 'react-hook-form';
|
|
4
4
|
|
|
5
5
|
import { Button } from '../ui/button.js';
|
|
6
|
-
import {
|
|
7
|
-
Dialog,
|
|
8
|
-
DialogContent,
|
|
9
|
-
DialogDescription,
|
|
10
|
-
DialogFooter,
|
|
11
|
-
DialogHeader,
|
|
12
|
-
DialogTitle,
|
|
13
|
-
} from '../ui/dialog.js';
|
|
6
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '../ui/dialog.js';
|
|
14
7
|
|
|
15
8
|
export interface NavigationConfirmationProps {
|
|
16
9
|
form: UseFormReturn<any>;
|
|
@@ -21,13 +14,11 @@ export interface NavigationConfirmationProps {
|
|
|
21
14
|
*/
|
|
22
15
|
export function NavigationConfirmation(props: Readonly<NavigationConfirmationProps>) {
|
|
23
16
|
const { proceed, reset, status } = useBlocker({
|
|
24
|
-
shouldBlockFn: args => {
|
|
17
|
+
shouldBlockFn: (args) => {
|
|
25
18
|
// When a new entity is being created, we don't want to block navigation
|
|
26
19
|
// to the newly-created entity page.
|
|
27
|
-
const isNavigatingToNewlyCreatedEntity =
|
|
28
|
-
args.current.
|
|
29
|
-
args.current.params.id === 'new' &&
|
|
30
|
-
args.next.params.id !== 'new';
|
|
20
|
+
const isNavigatingToNewlyCreatedEntity = args.current.fullPath === args.next.fullPath
|
|
21
|
+
&& args.current.params.id === 'new' && args.next.params.id !== 'new'
|
|
31
22
|
if (isNavigatingToNewlyCreatedEntity) {
|
|
32
23
|
return false;
|
|
33
24
|
}
|
|
@@ -40,20 +31,14 @@ export function NavigationConfirmation(props: Readonly<NavigationConfirmationPro
|
|
|
40
31
|
<Dialog open={status === 'blocked'} onOpenChange={reset}>
|
|
41
32
|
<DialogContent className="sm:max-w-[425px]">
|
|
42
33
|
<DialogHeader>
|
|
43
|
-
<DialogTitle>
|
|
44
|
-
<Trans>Confirm navigation</Trans>
|
|
45
|
-
</DialogTitle>
|
|
34
|
+
<DialogTitle><Trans>Confirm navigation</Trans></DialogTitle>
|
|
46
35
|
<DialogDescription>
|
|
47
|
-
<Trans>
|
|
48
|
-
|
|
49
|
-
lost.
|
|
50
|
-
</Trans>
|
|
36
|
+
<Trans>Are you sure you want to navigate away from this page? Any unsaved changes will be
|
|
37
|
+
lost.</Trans>
|
|
51
38
|
</DialogDescription>
|
|
52
39
|
</DialogHeader>
|
|
53
40
|
<DialogFooter>
|
|
54
|
-
<Button variant="outline" onClick={reset}>
|
|
55
|
-
<Trans>Cancel</Trans>
|
|
56
|
-
</Button>
|
|
41
|
+
<Button variant="outline" onClick={reset}><Trans>Cancel</Trans></Button>
|
|
57
42
|
<Button type="button" onClick={proceed}>
|
|
58
43
|
<Trans>Confirm</Trans>
|
|
59
44
|
</Button>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { useFieldArray } from "react-hook-form";
|
|
2
|
+
import { useFormContext } from "react-hook-form";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Input } from "@/components/ui/input.js";
|
|
5
|
+
import { Button } from "@/components/ui/button.js";
|
|
6
|
+
import { Badge } from "@/components/ui/badge.js";
|
|
7
|
+
import { Plus, X } from "lucide-react";
|
|
7
8
|
|
|
8
9
|
interface OptionValue {
|
|
9
10
|
value: string;
|
|
@@ -15,15 +16,12 @@ interface FormValues {
|
|
|
15
16
|
name: string;
|
|
16
17
|
values: OptionValue[];
|
|
17
18
|
}[];
|
|
18
|
-
variants: Record<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
stock: string;
|
|
25
|
-
}
|
|
26
|
-
>;
|
|
19
|
+
variants: Record<string, {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
sku: string;
|
|
22
|
+
price: string;
|
|
23
|
+
stock: string;
|
|
24
|
+
}>;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
interface OptionValueInputProps {
|
|
@@ -31,7 +29,7 @@ interface OptionValueInputProps {
|
|
|
31
29
|
disabled?: boolean;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
export function OptionValueInput({ groupIndex, disabled = false }:
|
|
32
|
+
export function OptionValueInput({ groupIndex, disabled = false }: OptionValueInputProps) {
|
|
35
33
|
const { control, watch } = useFormContext<FormValues>();
|
|
36
34
|
const { fields, append, remove } = useFieldArray({
|
|
37
35
|
control,
|
|
@@ -94,4 +92,4 @@ export function OptionValueInput({ groupIndex, disabled = false }: Readonly<Opti
|
|
|
94
92
|
</div>
|
|
95
93
|
</div>
|
|
96
94
|
);
|
|
97
|
-
}
|
|
95
|
+
}
|
|
@@ -1,38 +1,26 @@
|
|
|
1
|
-
import { DataTableColumnHeader } from '@/
|
|
2
|
-
import { DataTable, FacetedFilter } from '@/
|
|
1
|
+
import { DataTableColumnHeader } from '@/components/data-table/data-table-column-header.js';
|
|
2
|
+
import { DataTable, FacetedFilter } from '@/components/data-table/data-table.js';
|
|
3
3
|
import {
|
|
4
4
|
FieldInfo,
|
|
5
5
|
getObjectPathToPaginatedList,
|
|
6
6
|
getTypeFieldInfo,
|
|
7
|
-
} from '@/
|
|
8
|
-
import { useListQueryFields } from '@/
|
|
9
|
-
import { api } from '@/
|
|
10
|
-
import {
|
|
7
|
+
} from '@/framework/document-introspection/get-document-structure.js';
|
|
8
|
+
import { useListQueryFields } from '@/framework/document-introspection/hooks.js';
|
|
9
|
+
import { api } from '@/graphql/api.js';
|
|
10
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
11
11
|
import { useDebounce } from '@uidotdev/usehooks';
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
AlertDialog,
|
|
15
|
-
AlertDialogAction,
|
|
16
|
-
AlertDialogCancel,
|
|
17
|
-
AlertDialogContent,
|
|
18
|
-
AlertDialogDescription,
|
|
19
|
-
AlertDialogFooter,
|
|
20
|
-
AlertDialogHeader,
|
|
21
|
-
AlertDialogTitle,
|
|
22
|
-
AlertDialogTrigger,
|
|
23
|
-
} from '@/vdb/components/ui/alert-dialog.js';
|
|
24
13
|
import {
|
|
25
14
|
DropdownMenu,
|
|
26
15
|
DropdownMenuContent,
|
|
27
16
|
DropdownMenuItem,
|
|
28
17
|
DropdownMenuTrigger,
|
|
29
|
-
} from '@/
|
|
30
|
-
import { DisplayComponent } from '@/
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import { useExtendedListQuery } from '@/vdb/hooks/use-extended-list-query.js';
|
|
34
|
-
import { Trans, useLingui } from '@/vdb/lib/trans.js';
|
|
18
|
+
} from '@/components/ui/dropdown-menu.js';
|
|
19
|
+
import { DisplayComponent } from '@/framework/component-registry/dynamic-component.js';
|
|
20
|
+
import { ResultOf } from '@/graphql/graphql.js';
|
|
21
|
+
import { Trans, useLingui } from '@/lib/trans.js';
|
|
35
22
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
23
|
+
import { useQuery } from '@tanstack/react-query';
|
|
36
24
|
import {
|
|
37
25
|
ColumnFiltersState,
|
|
38
26
|
ColumnSort,
|
|
@@ -45,7 +33,6 @@ import { EllipsisIcon, TrashIcon } from 'lucide-react';
|
|
|
45
33
|
import React, { useMemo } from 'react';
|
|
46
34
|
import { toast } from 'sonner';
|
|
47
35
|
import { Button } from '../ui/button.js';
|
|
48
|
-
import { Checkbox } from '../ui/checkbox.js';
|
|
49
36
|
|
|
50
37
|
// Type that identifies a paginated list structure (has items array and totalItems)
|
|
51
38
|
type IsPaginatedList<T> = T extends { items: any[]; totalItems: number } ? true : false;
|
|
@@ -229,7 +216,6 @@ export interface PaginatedListDataTableProps<
|
|
|
229
216
|
onColumnVisibilityChange?: (table: Table<any>, columnVisibility: VisibilityState) => void;
|
|
230
217
|
facetedFilters?: FacetedFilterConfig<T>;
|
|
231
218
|
rowActions?: RowAction<PaginatedListItemFields<T>>[];
|
|
232
|
-
bulkActions?: BulkAction[];
|
|
233
219
|
disableViewOptions?: boolean;
|
|
234
220
|
transformData?: (data: PaginatedListItemFields<T>[]) => PaginatedListItemFields<T>[];
|
|
235
221
|
setTableOptions?: (table: TableOptions<any>) => TableOptions<any>;
|
|
@@ -268,16 +254,14 @@ export function PaginatedListDataTable<
|
|
|
268
254
|
onColumnVisibilityChange,
|
|
269
255
|
facetedFilters,
|
|
270
256
|
rowActions,
|
|
271
|
-
bulkActions,
|
|
272
257
|
disableViewOptions,
|
|
273
258
|
setTableOptions,
|
|
274
259
|
transformData,
|
|
275
260
|
registerRefresher,
|
|
276
|
-
}:
|
|
261
|
+
}: PaginatedListDataTableProps<T, U, V, AC>) {
|
|
277
262
|
const [searchTerm, setSearchTerm] = React.useState<string>('');
|
|
278
263
|
const debouncedSearchTerm = useDebounce(searchTerm, 500);
|
|
279
264
|
const queryClient = useQueryClient();
|
|
280
|
-
const extendedListQuery = useExtendedListQuery(listQuery);
|
|
281
265
|
|
|
282
266
|
const sort = sorting?.reduce((acc: any, sort: ColumnSort) => {
|
|
283
267
|
const direction = sort.desc ? 'DESC' : 'ASC';
|
|
@@ -302,7 +286,7 @@ export function PaginatedListDataTable<
|
|
|
302
286
|
|
|
303
287
|
const defaultQueryKey = [
|
|
304
288
|
PaginatedListDataTableKey,
|
|
305
|
-
|
|
289
|
+
listQuery,
|
|
306
290
|
page,
|
|
307
291
|
itemsPerPage,
|
|
308
292
|
sorting,
|
|
@@ -314,10 +298,9 @@ export function PaginatedListDataTable<
|
|
|
314
298
|
function refetchPaginatedList() {
|
|
315
299
|
queryClient.invalidateQueries({ queryKey });
|
|
316
300
|
}
|
|
317
|
-
|
|
318
301
|
registerRefresher?.(refetchPaginatedList);
|
|
319
302
|
|
|
320
|
-
const { data
|
|
303
|
+
const { data } = useQuery({
|
|
321
304
|
queryFn: () => {
|
|
322
305
|
const searchFilter = onSearchTermChange ? onSearchTermChange(debouncedSearchTerm) : {};
|
|
323
306
|
const mergedFilter = { ...filter, ...searchFilter };
|
|
@@ -331,14 +314,13 @@ export function PaginatedListDataTable<
|
|
|
331
314
|
} as V;
|
|
332
315
|
|
|
333
316
|
const transformedVariables = transformVariables ? transformVariables(variables) : variables;
|
|
334
|
-
return api.query(
|
|
317
|
+
return api.query(listQuery, transformedVariables);
|
|
335
318
|
},
|
|
336
319
|
queryKey,
|
|
337
|
-
placeholderData: keepPreviousData,
|
|
338
320
|
});
|
|
339
321
|
|
|
340
|
-
const fields = useListQueryFields(
|
|
341
|
-
const paginatedListObjectPath = getObjectPathToPaginatedList(
|
|
322
|
+
const fields = useListQueryFields(listQuery);
|
|
323
|
+
const paginatedListObjectPath = getObjectPathToPaginatedList(listQuery);
|
|
342
324
|
|
|
343
325
|
let listData = data as any;
|
|
344
326
|
for (const path of paginatedListObjectPath) {
|
|
@@ -434,10 +416,7 @@ export function PaginatedListDataTable<
|
|
|
434
416
|
// existing order
|
|
435
417
|
const orderedColumns = finalColumns
|
|
436
418
|
.filter(column => column.id && defaultColumnOrder.includes(column.id as any))
|
|
437
|
-
.sort(
|
|
438
|
-
(a, b) =>
|
|
439
|
-
defaultColumnOrder.indexOf(a.id as any) - defaultColumnOrder.indexOf(b.id as any),
|
|
440
|
-
);
|
|
419
|
+
.sort((a, b) => defaultColumnOrder.indexOf(a.id as any) - defaultColumnOrder.indexOf(b.id as any));
|
|
441
420
|
const remainingColumns = finalColumns.filter(
|
|
442
421
|
column => !column.id || !defaultColumnOrder.includes(column.id as any),
|
|
443
422
|
);
|
|
@@ -451,31 +430,6 @@ export function PaginatedListDataTable<
|
|
|
451
430
|
}
|
|
452
431
|
}
|
|
453
432
|
|
|
454
|
-
// Add the row selection column
|
|
455
|
-
finalColumns.unshift({
|
|
456
|
-
id: 'selection',
|
|
457
|
-
accessorKey: 'selection',
|
|
458
|
-
header: ({ table }) => (
|
|
459
|
-
<Checkbox
|
|
460
|
-
className="mx-1"
|
|
461
|
-
checked={table.getIsAllRowsSelected()}
|
|
462
|
-
onCheckedChange={checked =>
|
|
463
|
-
table.toggleAllRowsSelected(checked === 'indeterminate' ? undefined : checked)
|
|
464
|
-
}
|
|
465
|
-
/>
|
|
466
|
-
),
|
|
467
|
-
enableColumnFilter: false,
|
|
468
|
-
cell: ({ row }) => {
|
|
469
|
-
return (
|
|
470
|
-
<Checkbox
|
|
471
|
-
className="mx-1"
|
|
472
|
-
checked={row.getIsSelected()}
|
|
473
|
-
onCheckedChange={row.getToggleSelectedHandler()}
|
|
474
|
-
/>
|
|
475
|
-
);
|
|
476
|
-
},
|
|
477
|
-
});
|
|
478
|
-
|
|
479
433
|
return { columns: finalColumns, customFieldColumnNames };
|
|
480
434
|
}, [fields, customizeColumns, rowActions]);
|
|
481
435
|
|
|
@@ -487,7 +441,6 @@ export function PaginatedListDataTable<
|
|
|
487
441
|
<DataTable
|
|
488
442
|
columns={columns}
|
|
489
443
|
data={transformedData}
|
|
490
|
-
isLoading={isFetching}
|
|
491
444
|
page={page}
|
|
492
445
|
itemsPerPage={itemsPerPage}
|
|
493
446
|
sorting={sorting}
|
|
@@ -501,7 +454,6 @@ export function PaginatedListDataTable<
|
|
|
501
454
|
defaultColumnVisibility={columnVisibility}
|
|
502
455
|
facetedFilters={facetedFilters}
|
|
503
456
|
disableViewOptions={disableViewOptions}
|
|
504
|
-
bulkActions={bulkActions}
|
|
505
457
|
setTableOptions={setTableOptions}
|
|
506
458
|
onRefresh={refetchPaginatedList}
|
|
507
459
|
/>
|
|
@@ -571,42 +523,14 @@ function DeleteMutationRowAction({
|
|
|
571
523
|
},
|
|
572
524
|
});
|
|
573
525
|
return (
|
|
574
|
-
<
|
|
575
|
-
<
|
|
576
|
-
<
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
</div>
|
|
581
|
-
</DropdownMenuItem>
|
|
582
|
-
</AlertDialogTrigger>
|
|
583
|
-
<AlertDialogContent>
|
|
584
|
-
<AlertDialogHeader>
|
|
585
|
-
<AlertDialogTitle>
|
|
586
|
-
<Trans>Confirm deletion</Trans>
|
|
587
|
-
</AlertDialogTitle>
|
|
588
|
-
<AlertDialogDescription>
|
|
589
|
-
<Trans>
|
|
590
|
-
Are you sure you want to delete this item? This action cannot be undone.
|
|
591
|
-
</Trans>
|
|
592
|
-
</AlertDialogDescription>
|
|
593
|
-
</AlertDialogHeader>
|
|
594
|
-
<AlertDialogFooter>
|
|
595
|
-
<AlertDialogCancel>
|
|
596
|
-
<Trans>Cancel</Trans>
|
|
597
|
-
</AlertDialogCancel>
|
|
598
|
-
<AlertDialogAction
|
|
599
|
-
onClick={() => deleteMutationFn({ id: row.original.id })}
|
|
600
|
-
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
|
|
601
|
-
>
|
|
602
|
-
<Trans>Delete</Trans>
|
|
603
|
-
</AlertDialogAction>
|
|
604
|
-
</AlertDialogFooter>
|
|
605
|
-
</AlertDialogContent>
|
|
606
|
-
</AlertDialog>
|
|
526
|
+
<DropdownMenuItem onClick={() => deleteMutationFn({ id: row.original.id })}>
|
|
527
|
+
<div className="flex items-center gap-2 text-destructive">
|
|
528
|
+
<TrashIcon className="w-4 h-4 text-destructive" />
|
|
529
|
+
<Trans>Delete</Trans>
|
|
530
|
+
</div>
|
|
531
|
+
</DropdownMenuItem>
|
|
607
532
|
);
|
|
608
533
|
}
|
|
609
|
-
|
|
610
534
|
/**
|
|
611
535
|
* Returns the default column visibility configuration.
|
|
612
536
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { usePermissions } from
|
|
2
|
-
import { Permission } from
|
|
1
|
+
import { usePermissions } from "@/hooks/use-permissions.js";
|
|
2
|
+
import { Permission } from "@vendure/common/lib/generated-types";
|
|
3
3
|
|
|
4
4
|
export interface PermissionGuardProps {
|
|
5
5
|
requires: Permission | string | string[] | Permission[];
|
|
@@ -11,11 +11,11 @@ export interface PermissionGuardProps {
|
|
|
11
11
|
* This component is used to protect a route from unauthorized access.
|
|
12
12
|
* It will render the children if the user has the required permissions.
|
|
13
13
|
*/
|
|
14
|
-
export function PermissionGuard({ requires, children }:
|
|
14
|
+
export function PermissionGuard({ requires, children }: PermissionGuardProps ) {
|
|
15
15
|
const { hasPermissions } = usePermissions();
|
|
16
16
|
const permissions = Array.isArray(requires) ? requires : [requires];
|
|
17
17
|
if (!hasPermissions(permissions)) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
return children;
|
|
21
|
-
}
|
|
21
|
+
}
|
|
@@ -1,46 +1,41 @@
|
|
|
1
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '@/components/ui/command.js';
|
|
1
2
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '@/
|
|
9
|
-
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
10
|
-
import { api } from '@/vdb/graphql/api.js';
|
|
11
|
-
import { assetFragment } from '@/vdb/graphql/fragments.js';
|
|
12
|
-
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
3
|
+
Popover,
|
|
4
|
+
PopoverContent,
|
|
5
|
+
PopoverTrigger,
|
|
6
|
+
} from "@/components/ui/popover.js";
|
|
7
|
+
import { api } from '@/graphql/api.js';
|
|
8
|
+
import { graphql } from '@/graphql/graphql.js';
|
|
9
|
+
import { cn } from '@/lib/utils.js';
|
|
13
10
|
import { useQuery } from '@tanstack/react-query';
|
|
14
11
|
import { useDebounce } from '@uidotdev/usehooks';
|
|
15
|
-
import { Plus } from 'lucide-react';
|
|
12
|
+
import { ChevronsUpDown, Plus } from 'lucide-react';
|
|
16
13
|
import { useState } from 'react';
|
|
17
14
|
import { Button } from '../ui/button.js';
|
|
15
|
+
import { assetFragment } from '@/graphql/fragments.js';
|
|
18
16
|
import { VendureImage } from './vendure-image.js';
|
|
19
17
|
|
|
20
|
-
const productVariantListDocument = graphql(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...Asset
|
|
30
|
-
}
|
|
18
|
+
const productVariantListDocument = graphql(`
|
|
19
|
+
query ProductVariantList($options: ProductVariantListOptions) {
|
|
20
|
+
productVariants(options: $options) {
|
|
21
|
+
items {
|
|
22
|
+
id
|
|
23
|
+
name
|
|
24
|
+
sku
|
|
25
|
+
featuredAsset {
|
|
26
|
+
...Asset
|
|
31
27
|
}
|
|
32
|
-
totalItems
|
|
33
28
|
}
|
|
29
|
+
totalItems
|
|
34
30
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
);
|
|
31
|
+
}
|
|
32
|
+
`, [assetFragment]);
|
|
38
33
|
|
|
39
34
|
export interface ProductVariantSelectorProps {
|
|
40
35
|
onProductVariantIdChange: (productVariantId: string) => void;
|
|
41
36
|
}
|
|
42
37
|
|
|
43
|
-
export function ProductVariantSelector({ onProductVariantIdChange }:
|
|
38
|
+
export function ProductVariantSelector({ onProductVariantIdChange }: ProductVariantSelectorProps) {
|
|
44
39
|
const [search, setSearch] = useState('');
|
|
45
40
|
const [open, setOpen] = useState(false);
|
|
46
41
|
const debouncedSearch = useDebounce(search, 500);
|
|
@@ -65,7 +60,11 @@ export function ProductVariantSelector({ onProductVariantIdChange }: Readonly<Pr
|
|
|
65
60
|
return (
|
|
66
61
|
<Popover open={open} onOpenChange={setOpen}>
|
|
67
62
|
<PopoverTrigger asChild>
|
|
68
|
-
<Button
|
|
63
|
+
<Button
|
|
64
|
+
variant="outline"
|
|
65
|
+
role="combobox"
|
|
66
|
+
className="w-full"
|
|
67
|
+
>
|
|
69
68
|
Add item to order
|
|
70
69
|
<Plus className="opacity-50" />
|
|
71
70
|
</Button>
|
|
@@ -75,12 +74,12 @@ export function ProductVariantSelector({ onProductVariantIdChange }: Readonly<Pr
|
|
|
75
74
|
<CommandInput
|
|
76
75
|
placeholder="Add item to order..."
|
|
77
76
|
className="h-9"
|
|
78
|
-
|
|
77
|
+
onValueChange={(value) => setSearch(value)}
|
|
79
78
|
/>
|
|
80
79
|
<CommandList>
|
|
81
80
|
<CommandEmpty>No products found.</CommandEmpty>
|
|
82
81
|
<CommandGroup>
|
|
83
|
-
{data?.productVariants.items.map(variant => (
|
|
82
|
+
{data?.productVariants.items.map((variant) => (
|
|
84
83
|
<CommandItem
|
|
85
84
|
key={variant.id}
|
|
86
85
|
value={variant.id}
|
|
@@ -109,4 +108,4 @@ export function ProductVariantSelector({ onProductVariantIdChange }: Readonly<Pr
|
|
|
109
108
|
</PopoverContent>
|
|
110
109
|
</Popover>
|
|
111
110
|
);
|
|
112
|
-
}
|
|
111
|
+
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { CUSTOMER_ROLE_CODE, SUPER_ADMIN_ROLE_CODE } from '@/
|
|
2
|
-
import { Trans } from '@/
|
|
1
|
+
import { CUSTOMER_ROLE_CODE, SUPER_ADMIN_ROLE_CODE } from '@/constants.js';
|
|
2
|
+
import { Trans } from '@/lib/trans.js';
|
|
3
3
|
|
|
4
|
-
export function RoleCodeLabel({ code }:
|
|
5
|
-
return code === SUPER_ADMIN_ROLE_CODE ?
|
|
6
|
-
|
|
7
|
-
) : code === CUSTOMER_ROLE_CODE ? (
|
|
8
|
-
<Trans>Customer</Trans>
|
|
9
|
-
) : (
|
|
10
|
-
code
|
|
11
|
-
);
|
|
4
|
+
export function RoleCodeLabel({ code }: { code: string } | { code: undefined }) {
|
|
5
|
+
return code === SUPER_ADMIN_ROLE_CODE ? <Trans>Super Admin</Trans> :
|
|
6
|
+
code === CUSTOMER_ROLE_CODE ? <Trans>Customer</Trans> : code;
|
|
12
7
|
}
|
|
8
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { api } from '@/
|
|
2
|
-
import { graphql } from '@/
|
|
3
|
-
import { useLingui } from '@/vdb/lib/trans.js';
|
|
1
|
+
import { api } from '@/graphql/api.js';
|
|
2
|
+
import { graphql } from '@/graphql/graphql.js';
|
|
4
3
|
import { useQuery } from '@tanstack/react-query';
|
|
5
4
|
import { MultiSelect } from './multi-select.js';
|
|
5
|
+
import { useLingui } from '@/lib/trans.js';
|
|
6
6
|
|
|
7
7
|
const rolesDocument = graphql(`
|
|
8
8
|
query Roles($options: RoleListOptions) {
|
|
@@ -40,7 +40,7 @@ export function RoleSelector<T extends boolean>(props: RoleSelectorProps<T>) {
|
|
|
40
40
|
const items = (data ?? []).map(role => ({
|
|
41
41
|
value: role.id,
|
|
42
42
|
label: role.code,
|
|
43
|
-
display: role.description ? role.description : role.code
|
|
43
|
+
display: role.description ? role.description : role.code
|
|
44
44
|
}));
|
|
45
45
|
|
|
46
46
|
return (
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { Button } from '@/
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
CommandList,
|
|
8
|
-
} from '@/vdb/components/ui/command.js';
|
|
9
|
-
import { Popover, PopoverContent, PopoverTrigger } from '@/vdb/components/ui/popover.js';
|
|
10
|
-
import { api } from '@/vdb/graphql/api.js';
|
|
11
|
-
import { graphql } from '@/vdb/graphql/graphql.js';
|
|
12
|
-
import { Trans } from '@/vdb/lib/trans.js';
|
|
1
|
+
import { Button } from '@/components/ui/button.js';
|
|
2
|
+
import { Command, CommandEmpty, CommandInput, CommandItem, CommandList } from '@/components/ui/command.js';
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover.js';
|
|
4
|
+
import { api } from '@/graphql/api.js';
|
|
5
|
+
import { graphql } from '@/graphql/graphql.js';
|
|
6
|
+
import { Trans } from '@/lib/trans.js';
|
|
13
7
|
import { useQuery } from '@tanstack/react-query';
|
|
14
|
-
import { Plus } from 'lucide-react';
|
|
8
|
+
import { Plus, Search } from 'lucide-react';
|
|
15
9
|
import { useState } from 'react';
|
|
16
10
|
|
|
17
11
|
const sellerListDocument = graphql(`
|
|
@@ -48,11 +42,9 @@ export function SellerSelector(props: SellerSelectorProps) {
|
|
|
48
42
|
api.query(sellerListDocument, {
|
|
49
43
|
options: {
|
|
50
44
|
sort: { name: 'ASC' },
|
|
51
|
-
filter: searchTerm
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
: undefined,
|
|
45
|
+
filter: searchTerm ? {
|
|
46
|
+
name: { contains: searchTerm },
|
|
47
|
+
} : undefined,
|
|
56
48
|
},
|
|
57
49
|
}),
|
|
58
50
|
staleTime: 1000 * 60, // 1 minute
|
|
@@ -81,15 +73,19 @@ export function SellerSelector(props: SellerSelectorProps) {
|
|
|
81
73
|
<PopoverContent className="p-0 w-[350px]" align="start">
|
|
82
74
|
<Command shouldFilter={false}>
|
|
83
75
|
<div className="flex items-center border-b px-3">
|
|
84
|
-
<CommandInput
|
|
85
|
-
placeholder="Search sellers..."
|
|
76
|
+
<CommandInput
|
|
77
|
+
placeholder="Search sellers..."
|
|
86
78
|
onValueChange={handleSearch}
|
|
87
79
|
className="h-10 flex-1 bg-transparent outline-none placeholder:text-muted-foreground"
|
|
88
80
|
/>
|
|
89
81
|
</div>
|
|
90
82
|
<CommandList>
|
|
91
83
|
<CommandEmpty>
|
|
92
|
-
{isLoading ?
|
|
84
|
+
{isLoading ? (
|
|
85
|
+
<Trans>Loading...</Trans>
|
|
86
|
+
) : (
|
|
87
|
+
<Trans>No sellers found</Trans>
|
|
88
|
+
)}
|
|
93
89
|
</CommandEmpty>
|
|
94
90
|
{data?.sellers.items.map(seller => (
|
|
95
91
|
<CommandItem
|
|
@@ -5,20 +5,20 @@ export type StockLevel = {
|
|
|
5
5
|
stockAllocated: number;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
export function StockLevelLabel({ stockLevels }:
|
|
8
|
+
export function StockLevelLabel({ stockLevels }: { stockLevels: StockLevel[] }) {
|
|
9
9
|
const { i18n } = useLingui();
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
if (!Array.isArray(stockLevels)) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
const totalOnHand = stockLevels.reduce((acc, curr) => acc + curr.stockOnHand, 0);
|
|
15
15
|
const totalAllocated = stockLevels.reduce((acc, curr) => acc + curr.stockAllocated, 0);
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
return (
|
|
18
|
-
<span
|
|
18
|
+
<span
|
|
19
19
|
title={`${i18n.t('Stock on hand')}: ${totalOnHand}, ${i18n.t('Stock allocated')}: ${totalAllocated}`}
|
|
20
20
|
>
|
|
21
21
|
{totalOnHand} <span className="text-muted-foreground">/ {totalAllocated}</span>
|
|
22
22
|
</span>
|
|
23
23
|
);
|
|
24
|
-
}
|
|
24
|
+
}
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
SelectItem,
|
|
6
6
|
SelectTrigger,
|
|
7
7
|
SelectValue,
|
|
8
|
-
} from '@/
|
|
9
|
-
import { api } from '@/
|
|
10
|
-
import { graphql } from '@/
|
|
11
|
-
import { Trans } from '@/
|
|
8
|
+
} from '@/components/ui/select.js';
|
|
9
|
+
import { api } from '@/graphql/api.js';
|
|
10
|
+
import { graphql } from '@/graphql/graphql.js';
|
|
11
|
+
import { Trans } from '@/lib/trans.js';
|
|
12
12
|
import { useQuery } from '@tanstack/react-query';
|
|
13
13
|
import { Skeleton } from '../ui/skeleton.js';
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ export interface TaxCategorySelectorProps {
|
|
|
29
29
|
onChange: (value: string) => void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export function TaxCategorySelector({ value, onChange }:
|
|
32
|
+
export function TaxCategorySelector({ value, onChange }: TaxCategorySelectorProps) {
|
|
33
33
|
const { data, isLoading, isPending, status } = useQuery({
|
|
34
34
|
queryKey: ['taxCategories'],
|
|
35
35
|
staleTime: 1000 * 60 * 5,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Controller } from 'react-hook-form';
|
|
2
|
+
import { FieldPath } from 'react-hook-form';
|
|
3
|
+
import { useUserSettings } from '@/hooks/use-user-settings.js';
|
|
4
|
+
import { ControllerProps } from 'react-hook-form';
|
|
5
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
6
|
import { FormFieldWrapper } from './form-field-wrapper.js';
|
|
7
|
+
import { FormMessage } from '../ui/form.js';
|
|
8
|
+
import { FormControl } from '../ui/form.js';
|
|
9
|
+
import { FormItem } from '../ui/form.js';
|
|
10
|
+
import { FormDescription, FormField, FormLabel } from '../ui/form.js';
|
|
5
11
|
|
|
6
12
|
export type TranslatableEntity = FieldValues & {
|
|
7
13
|
translations?: Array<{ languageCode: string }> | null;
|
|
@@ -49,7 +55,6 @@ export const TranslatableFormFieldWrapper = <
|
|
|
49
55
|
label,
|
|
50
56
|
description,
|
|
51
57
|
render,
|
|
52
|
-
renderFormControl,
|
|
53
58
|
...props
|
|
54
59
|
}: TranslatableFormFieldWrapperProps<TFieldValues>) => {
|
|
55
60
|
return (
|
|
@@ -59,7 +64,7 @@ export const TranslatableFormFieldWrapper = <
|
|
|
59
64
|
render={renderArgs => (
|
|
60
65
|
<FormItem>
|
|
61
66
|
{label && <FormLabel>{label}</FormLabel>}
|
|
62
|
-
|
|
67
|
+
<FormControl>{render(renderArgs)}</FormControl>
|
|
63
68
|
{description && <FormDescription>{description}</FormDescription>}
|
|
64
69
|
<FormMessage />
|
|
65
70
|
</FormItem>
|