@vendure/dashboard 3.3.6-master-202507020234 → 3.3.6-master-202507021511
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-config.js +2 -6
- package/package.json +4 -4
- package/src/app/app-providers.tsx +6 -6
- package/src/app/common/delete-bulk-action.tsx +4 -4
- package/src/app/common/duplicate-bulk-action.tsx +5 -5
- package/src/app/main.tsx +9 -9
- package/src/app/routes/__root.tsx +1 -2
- package/src/app/routes/_authenticated/_administrators/administrators.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +8 -8
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_administrators/components/administrator-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +15 -15
- package/src/app/routes/_authenticated/_assets/assets.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_assets/assets.tsx +12 -8
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +5 -5
- package/src/app/routes/_authenticated/_channels/channels.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_channels/channels.tsx +10 -10
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +16 -16
- package/src/app/routes/_authenticated/_channels/components/channel-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/collections.graphql.ts +3 -3
- package/src/app/routes/_authenticated/_collections/collections.tsx +7 -7
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +15 -15
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +5 -5
- package/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx +7 -8
- package/src/app/routes/_authenticated/_collections/components/collection-contents-sheet.tsx +9 -5
- package/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx +9 -8
- package/src/app/routes/_authenticated/_collections/components/collection-filters-selector.tsx +6 -6
- package/src/app/routes/_authenticated/_countries/components/country-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_countries/countries.tsx +6 -6
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +12 -12
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-sheet.tsx +12 -5
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +22 -17
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +6 -6
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +10 -10
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +19 -19
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +9 -9
- package/src/app/routes/_authenticated/_customers/components/customer-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +4 -4
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history.tsx +11 -7
- 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 +74 -72
- package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +3 -3
- package/src/app/routes/_authenticated/_customers/customers.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_customers/customers.tsx +6 -6
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +8 -8
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +7 -7
- package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +3 -3
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +14 -10
- package/src/app/routes/_authenticated/_facets/facets.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_facets/facets.tsx +7 -7
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +12 -12
- package/src/app/routes/_authenticated/_global-settings/global-settings.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +12 -12
- package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +10 -13
- package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +92 -54
- package/src/app/routes/_authenticated/_orders/components/money-gross-net.tsx +10 -8
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +2 -3
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +66 -61
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history.tsx +5 -5
- package/src/app/routes/_authenticated/_orders/components/order-history/use-order-history.ts +4 -4
- package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +10 -6
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +38 -18
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +3 -3
- package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +37 -35
- package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +3 -3
- package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +42 -43
- package/src/app/routes/_authenticated/_orders/orders.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_orders/orders.tsx +21 -20
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +9 -9
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +188 -90
- package/src/app/routes/_authenticated/_payment-methods/components/payment-eligibility-checker-selector.tsx +10 -7
- package/src/app/routes/_authenticated/_payment-methods/components/payment-handler-selector.tsx +11 -11
- package/src/app/routes/_authenticated/_payment-methods/components/payment-method-bulk-actions.tsx +5 -5
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +7 -7
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +13 -13
- package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +8 -8
- package/src/app/routes/_authenticated/_product-variants/components/variant-price-detail.tsx +7 -6
- package/src/app/routes/_authenticated/_product-variants/product-variants.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +6 -6
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +19 -19
- package/src/app/routes/_authenticated/_products/components/add-product-variant-dialog.tsx +10 -10
- package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +7 -7
- package/src/app/routes/_authenticated/_products/components/create-product-options-dialog.tsx +57 -41
- 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 -13
- package/src/app/routes/_authenticated/_products/components/option-value-input.tsx +16 -14
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +8 -8
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +22 -33
- package/src/app/routes/_authenticated/_products/components/product-variants-table.tsx +6 -6
- package/src/app/routes/_authenticated/_products/products.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_products/products.tsx +6 -6
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +16 -16
- 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 +13 -10
- package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +5 -5
- package/src/app/routes/_authenticated/_promotions/components/promotion-conditions-selector.tsx +13 -10
- package/src/app/routes/_authenticated/_promotions/promotions.graphql.ts +2 -2
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +7 -7
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_roles/components/expandable-permissions.tsx +4 -4
- package/src/app/routes/_authenticated/_roles/components/permissions-grid.tsx +20 -16
- package/src/app/routes/_authenticated/_roles/components/role-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_roles/roles.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_roles/roles.tsx +10 -10
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_sellers/components/seller-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_sellers/sellers.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_sellers/sellers.tsx +7 -7
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +10 -10
- package/src/app/routes/_authenticated/_shipping-methods/components/fulfillment-handler-selector.tsx +5 -5
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-calculator-selector.tsx +22 -20
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-eligibility-checker-selector.tsx +25 -21
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-bulk-actions.tsx +5 -5
- 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 -2
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +6 -6
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +12 -12
- package/src/app/routes/_authenticated/_stock-locations/components/stock-location-bulk-actions.tsx +5 -5
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +6 -6
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_system/components/payload-dialog.tsx +3 -3
- 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 +10 -6
- package/src/app/routes/_authenticated/_system/scheduled-tasks.tsx +34 -28
- package/src/app/routes/_authenticated/_tax-categories/components/tax-category-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +7 -7
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +11 -11
- package/src/app/routes/_authenticated/_tax-rates/components/tax-rate-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +8 -8
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +14 -14
- package/src/app/routes/_authenticated/_zones/components/zone-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_zones/components/zone-countries-sheet.tsx +3 -3
- package/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx +11 -7
- package/src/app/routes/_authenticated/_zones/zones.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_zones/zones.tsx +6 -6
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +10 -10
- 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/lib/components/data-display/date-time.tsx +1 -1
- package/src/lib/components/data-display/money.tsx +2 -3
- package/src/lib/components/data-input/affixed-input.tsx +2 -7
- package/src/lib/components/data-input/customer-group-input.tsx +2 -2
- package/src/lib/components/data-input/datetime-input.tsx +129 -146
- package/src/lib/components/data-input/facet-value-input.tsx +30 -22
- package/src/lib/components/data-input/money-input.tsx +3 -3
- package/src/lib/components/data-table/add-filter-menu.tsx +8 -17
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +3 -3
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +7 -7
- package/src/lib/components/data-table/data-table-column-header.tsx +3 -21
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +8 -8
- package/src/lib/components/data-table/data-table-filter-badge.tsx +1 -1
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +3 -3
- package/src/lib/components/data-table/data-table-pagination.tsx +2 -2
- package/src/lib/components/data-table/data-table-view-options.tsx +25 -21
- package/src/lib/components/data-table/data-table.tsx +8 -8
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +7 -7
- package/src/lib/components/data-table/filters/data-table-datetime-filter.tsx +10 -22
- package/src/lib/components/data-table/filters/data-table-id-filter.tsx +14 -9
- package/src/lib/components/data-table/filters/data-table-number-filter.tsx +13 -16
- package/src/lib/components/data-table/filters/data-table-string-filter.tsx +25 -11
- package/src/lib/components/data-table/human-readable-operator.tsx +1 -1
- package/src/lib/components/data-table/refresh-button.tsx +1 -1
- 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 +16 -10
- package/src/lib/components/layout/generated-breadcrumbs.tsx +1 -1
- package/src/lib/components/layout/language-dialog.tsx +5 -11
- package/src/lib/components/layout/nav-main.tsx +3 -3
- 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-bulk-actions.tsx +11 -7
- package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +29 -19
- package/src/lib/components/shared/asset/asset-gallery.tsx +12 -12
- package/src/lib/components/shared/asset/asset-picker-dialog.tsx +63 -66
- package/src/lib/components/shared/asset/asset-preview-dialog.tsx +3 -7
- package/src/lib/components/shared/asset/asset-preview-selector.tsx +3 -5
- package/src/lib/components/shared/asset/asset-preview.tsx +7 -15
- package/src/lib/components/shared/asset/asset-properties.tsx +6 -8
- package/src/lib/components/shared/asset/focal-point-control.tsx +5 -13
- package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +4 -4
- package/src/lib/components/shared/assign-to-channel-dialog.tsx +8 -8
- package/src/lib/components/shared/channel-code-label.tsx +2 -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 +15 -16
- package/src/lib/components/shared/confirmation-dialog.tsx +2 -2
- package/src/lib/components/shared/country-selector.tsx +21 -18
- package/src/lib/components/shared/currency-selector.tsx +5 -5
- package/src/lib/components/shared/custom-fields-form.tsx +8 -8
- package/src/lib/components/shared/customer-address-form.tsx +3 -3
- package/src/lib/components/shared/customer-group-selector.tsx +6 -6
- package/src/lib/components/shared/customer-selector.tsx +24 -18
- package/src/lib/components/shared/entity-assets.tsx +33 -34
- package/src/lib/components/shared/error-page.tsx +5 -5
- package/src/lib/components/shared/facet-value-chip.tsx +12 -5
- package/src/lib/components/shared/facet-value-selector.tsx +64 -63
- package/src/lib/components/shared/history-timeline/history-entry.tsx +5 -5
- package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +2 -2
- package/src/lib/components/shared/history-timeline/history-note-editor.tsx +4 -4
- package/src/lib/components/shared/history-timeline/history-note-input.tsx +2 -2
- package/src/lib/components/shared/history-timeline/history-timeline.tsx +14 -7
- package/src/lib/components/shared/language-selector.tsx +5 -5
- package/src/lib/components/shared/multi-select.tsx +5 -5
- package/src/lib/components/shared/navigation-confirmation.tsx +24 -9
- package/src/lib/components/shared/option-value-input.tsx +16 -14
- package/src/lib/components/shared/paginated-list-data-table.tsx +12 -12
- package/src/lib/components/shared/permission-guard.tsx +4 -4
- package/src/lib/components/shared/product-variant-selector.tsx +31 -30
- package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +4 -4
- package/src/lib/components/shared/role-code-label.tsx +9 -5
- package/src/lib/components/shared/role-selector.tsx +4 -4
- package/src/lib/components/shared/seller-selector.tsx +21 -17
- package/src/lib/components/shared/tax-category-selector.tsx +4 -4
- package/src/lib/components/shared/translatable-form-field.tsx +1 -1
- package/src/lib/components/shared/vendure-image.tsx +1 -1
- package/src/lib/components/shared/zone-selector.tsx +4 -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 +10 -3
- package/src/lib/components/ui/calendar.tsx +392 -459
- 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 +12 -6
- 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 +87 -108
- 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 +2 -2
- 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-item.tsx +3 -2
- package/src/lib/framework/component-registry/component-registry.tsx +31 -47
- package/src/lib/framework/dashboard-widget/base-widget.tsx +4 -4
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +7 -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 +6 -7
- 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 -6
- package/src/lib/framework/dashboard-widget/orders-summary/order-summary-widget.graphql.ts +1 -1
- package/src/lib/framework/data-table/data-table-extensions.ts +1 -1
- package/src/lib/framework/defaults.ts +1 -1
- package/src/lib/framework/document-extension/extend-detail-form-query.ts +2 -2
- package/src/lib/framework/document-extension/extend-document.spec.ts +1 -1
- package/src/lib/framework/document-extension/extend-document.ts +1 -1
- package/src/lib/framework/document-introspection/add-custom-fields.ts +2 -2
- package/src/lib/framework/document-introspection/hooks.ts +4 -1
- package/src/lib/framework/extension-api/define-dashboard-extension.ts +29 -95
- package/src/lib/framework/extension-api/display-component-extensions.tsx +69 -0
- package/src/lib/framework/extension-api/extension-api-types.ts +18 -160
- package/src/lib/framework/extension-api/input-component-extensions.tsx +69 -0
- package/src/lib/framework/extension-api/logic/alerts.ts +10 -0
- package/src/lib/framework/extension-api/logic/data-table.ts +60 -0
- package/src/lib/framework/extension-api/logic/detail-forms.ts +48 -0
- package/src/lib/framework/extension-api/logic/form-components.ts +13 -0
- package/src/lib/framework/extension-api/logic/index.ts +8 -0
- package/src/lib/framework/extension-api/logic/layout.ts +22 -0
- package/src/lib/framework/extension-api/logic/navigation.ts +37 -0
- package/src/lib/framework/extension-api/logic/widgets.ts +10 -0
- package/src/lib/framework/extension-api/types/alerts.ts +54 -0
- package/src/lib/framework/extension-api/types/data-table.ts +64 -0
- package/src/lib/framework/extension-api/types/detail-forms.ts +81 -0
- package/src/lib/framework/extension-api/types/form-components.ts +32 -0
- package/src/lib/framework/extension-api/types/index.ts +8 -0
- package/src/lib/framework/extension-api/types/layout.ts +78 -0
- package/src/lib/framework/extension-api/types/navigation.ts +19 -0
- package/src/lib/framework/extension-api/types/widgets.ts +94 -0
- package/src/lib/framework/form-engine/form-schema-tools.ts +1 -1
- package/src/lib/framework/layout-engine/location-wrapper.tsx +7 -7
- package/src/lib/framework/layout-engine/page-block-provider.tsx +1 -1
- package/src/lib/framework/layout-engine/page-layout.tsx +10 -10
- package/src/lib/framework/page/detail-page-route-loader.tsx +3 -3
- package/src/lib/framework/page/detail-page.tsx +57 -12
- package/src/lib/framework/page/list-page.tsx +10 -4
- package/src/lib/framework/page/use-detail-page.ts +1 -1
- package/src/lib/framework/registry/registry-types.ts +3 -0
- package/src/lib/graphql/graphql-env.d.ts +14 -31
- package/src/lib/hooks/use-auth.tsx +1 -1
- package/src/lib/hooks/use-channel.ts +1 -2
- package/src/lib/hooks/use-extended-detail-query.ts +2 -3
- package/src/lib/hooks/use-extended-list-query.ts +3 -4
- package/src/lib/hooks/use-grouped-permissions.ts +1 -2
- package/src/lib/hooks/use-page-block.tsx +1 -1
- package/src/lib/hooks/use-page.tsx +1 -1
- package/src/lib/hooks/use-server-config.ts +1 -2
- package/src/lib/hooks/use-theme.ts +1 -2
- package/src/lib/hooks/use-user-settings.tsx +1 -1
- package/src/lib/index.ts +28 -0
- package/src/lib/providers/auth.tsx +3 -3
- package/src/lib/providers/channel-provider.tsx +3 -3
- package/src/lib/providers/server-config.tsx +13 -11
- package/vite/vite-plugin-config.ts +3 -6
|
@@ -1,161 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { DocumentNode } from 'graphql';
|
|
4
|
-
import { LucideIcon } from 'lucide-react';
|
|
5
|
-
import type React from 'react';
|
|
1
|
+
// Import all domain-specific types
|
|
2
|
+
export * from './types/index.js';
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
export interface DashboardCustomFormComponent {
|
|
21
|
-
id: string;
|
|
22
|
-
component: React.FunctionComponent<CustomFormComponentInputProps>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface DashboardRouteDefinition {
|
|
26
|
-
component: (route: AnyRoute) => React.ReactNode;
|
|
27
|
-
path: string;
|
|
28
|
-
navMenuItem?: Partial<NavMenuItem> & { sectionId: string };
|
|
29
|
-
loader?: RouteOptions['loader'];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ActionBarButtonState {
|
|
33
|
-
disabled: boolean;
|
|
34
|
-
visible: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface DashboardNavSectionDefinition {
|
|
38
|
-
id: string;
|
|
39
|
-
title: string;
|
|
40
|
-
icon?: LucideIcon;
|
|
41
|
-
order?: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @description
|
|
46
|
-
* **Status: Developer Preview**
|
|
47
|
-
*
|
|
48
|
-
* Allows you to define custom action bar items for any page in the dashboard.
|
|
49
|
-
*
|
|
50
|
-
* @docsCategory extensions
|
|
51
|
-
* @since 3.3.0
|
|
52
|
-
*/
|
|
53
|
-
export interface DashboardActionBarItem {
|
|
54
|
-
/**
|
|
55
|
-
* @description
|
|
56
|
-
* The ID of the page where the action bar item should be displayed.
|
|
57
|
-
*/
|
|
58
|
-
pageId: string;
|
|
59
|
-
/**
|
|
60
|
-
* @description
|
|
61
|
-
* A React component that will be rendered in the action bar.
|
|
62
|
-
*/
|
|
63
|
-
component: React.FunctionComponent<{ context: PageContextValue }>;
|
|
64
|
-
/**
|
|
65
|
-
* @description
|
|
66
|
-
* Any permissions that are required to display this action bar item.
|
|
67
|
-
*/
|
|
68
|
-
requiresPermission?: string | string[];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface DashboardActionBarDropdownMenuItem {
|
|
72
|
-
locationId: string;
|
|
73
|
-
component: React.FunctionComponent<{ context: PageContextValue }>;
|
|
74
|
-
requiresPermission?: string | string[];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export type PageBlockPosition = { blockId: string; order: 'before' | 'after' | 'replace' };
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @description
|
|
81
|
-
* **Status: Developer Preview**
|
|
82
|
-
*
|
|
83
|
-
* The location of a page block in the dashboard. The location can be found by turning on
|
|
84
|
-
* "developer mode" in the dashboard user menu (bottom left corner) and then
|
|
85
|
-
* clicking the `< />` icon when hovering over a page block.
|
|
86
|
-
*
|
|
87
|
-
* @docsCategory extensions
|
|
88
|
-
* @since 3.3.0
|
|
89
|
-
*/
|
|
90
|
-
export type PageBlockLocation = {
|
|
91
|
-
pageId: string;
|
|
92
|
-
position: PageBlockPosition;
|
|
93
|
-
column: 'main' | 'side';
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* @description
|
|
98
|
-
* **Status: Developer Preview**
|
|
99
|
-
*
|
|
100
|
-
* This allows you to insert a custom component into a specific location
|
|
101
|
-
* on any page in the dashboard.
|
|
102
|
-
*
|
|
103
|
-
* @docsCategory extensions
|
|
104
|
-
* @since 3.3.0
|
|
105
|
-
*/
|
|
106
|
-
export interface DashboardPageBlockDefinition {
|
|
107
|
-
id: string;
|
|
108
|
-
title?: React.ReactNode;
|
|
109
|
-
location: PageBlockLocation;
|
|
110
|
-
component: React.FunctionComponent<{ context: PageContextValue }>;
|
|
111
|
-
requiresPermission?: string | string[];
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @description
|
|
116
|
-
* **Status: Developer Preview**
|
|
117
|
-
*
|
|
118
|
-
* This allows you to customize aspects of existing data tables in the dashboard.
|
|
119
|
-
*
|
|
120
|
-
* @docsCategory extensions
|
|
121
|
-
* @since 3.4.0
|
|
122
|
-
*/
|
|
123
|
-
export interface DashboardDataTableExtensionDefinition {
|
|
124
|
-
/**
|
|
125
|
-
* @description
|
|
126
|
-
* The ID of the page where the data table is located, e.g. `'product-list'`, `'order-list'`.
|
|
127
|
-
*/
|
|
128
|
-
pageId: string;
|
|
129
|
-
/**
|
|
130
|
-
* @description
|
|
131
|
-
* The ID of the data table block. Defaults to `'list-table'`, which is the default blockId
|
|
132
|
-
* for the standard list pages. However, some other pages may use a different blockId,
|
|
133
|
-
* such as `'product-variants-table'` on the `'product-detail'` page.
|
|
134
|
-
*/
|
|
135
|
-
blockId?: string;
|
|
136
|
-
/**
|
|
137
|
-
* @description
|
|
138
|
-
* An array of additional bulk actions that will be available on the data table.
|
|
139
|
-
*/
|
|
140
|
-
bulkActions?: BulkAction[];
|
|
141
|
-
/**
|
|
142
|
-
* @description
|
|
143
|
-
* Allows you to extend the list document for the data table.
|
|
144
|
-
*/
|
|
145
|
-
extendListDocument?: string | DocumentNode | (() => DocumentNode | string);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface DashboardDetailFormExtensionDefinition {
|
|
149
|
-
/**
|
|
150
|
-
* @description
|
|
151
|
-
* The ID of the page where the detail form is located, e.g. `'product-detail'`, `'order-detail'`.
|
|
152
|
-
*/
|
|
153
|
-
pageId: string;
|
|
154
|
-
/**
|
|
155
|
-
* @description
|
|
156
|
-
*/
|
|
157
|
-
extendDetailDocument?: string | DocumentNode | (() => DocumentNode | string);
|
|
158
|
-
}
|
|
4
|
+
// Import types for the main interface
|
|
5
|
+
import {
|
|
6
|
+
DashboardActionBarItem,
|
|
7
|
+
DashboardAlertDefinition,
|
|
8
|
+
DashboardCustomFormComponents,
|
|
9
|
+
DashboardDataTableExtensionDefinition,
|
|
10
|
+
DashboardDetailFormExtensionDefinition,
|
|
11
|
+
DashboardNavSectionDefinition,
|
|
12
|
+
DashboardPageBlockDefinition,
|
|
13
|
+
DashboardRouteDefinition,
|
|
14
|
+
DashboardWidgetDefinition,
|
|
15
|
+
} from './types/index.js';
|
|
159
16
|
|
|
160
17
|
/**
|
|
161
18
|
* @description
|
|
@@ -189,7 +46,7 @@ export interface DashboardExtension {
|
|
|
189
46
|
actionBarItems?: DashboardActionBarItem[];
|
|
190
47
|
/**
|
|
191
48
|
* @description
|
|
192
|
-
*
|
|
49
|
+
* Allows you to define custom alerts that can be displayed in the dashboard.
|
|
193
50
|
*/
|
|
194
51
|
alerts?: DashboardAlertDefinition[];
|
|
195
52
|
/**
|
|
@@ -200,9 +57,10 @@ export interface DashboardExtension {
|
|
|
200
57
|
widgets?: DashboardWidgetDefinition[];
|
|
201
58
|
/**
|
|
202
59
|
* @description
|
|
203
|
-
*
|
|
60
|
+
* Unified registration for custom form components including custom field components,
|
|
61
|
+
* input components, and display components.
|
|
204
62
|
*/
|
|
205
|
-
customFormComponents?:
|
|
63
|
+
customFormComponents?: DashboardCustomFormComponents;
|
|
206
64
|
/**
|
|
207
65
|
* @description
|
|
208
66
|
* Allows you to customize aspects of existing data tables in the dashboard.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DateTimeInput } from '@/vdb/components/data-input/datetime-input.js';
|
|
2
|
+
import { FacetValueInput } from '@/vdb/components/data-input/facet-value-input.js';
|
|
3
|
+
import { MoneyInput } from '@/vdb/components/data-input/money-input.js';
|
|
4
|
+
import { Checkbox } from '@/vdb/components/ui/checkbox.js';
|
|
5
|
+
import { Input } from '@/vdb/components/ui/input.js';
|
|
6
|
+
import { DataInputComponent } from '../component-registry/component-registry.js';
|
|
7
|
+
import { globalRegistry } from '../registry/global-registry.js';
|
|
8
|
+
|
|
9
|
+
globalRegistry.register('inputComponents', new Map<string, DataInputComponent>());
|
|
10
|
+
|
|
11
|
+
// Create component functions for built-in components
|
|
12
|
+
const TextInput: DataInputComponent = props => (
|
|
13
|
+
<Input {...props} onChange={e => props.onChange(e.target.value)} />
|
|
14
|
+
);
|
|
15
|
+
const NumberInput: DataInputComponent = props => (
|
|
16
|
+
<Input {...props} onChange={e => props.onChange(e.target.valueAsNumber)} type="number" />
|
|
17
|
+
);
|
|
18
|
+
const CheckboxInput: DataInputComponent = props => (
|
|
19
|
+
<Checkbox
|
|
20
|
+
{...props}
|
|
21
|
+
checked={props.value === 'true' || props.value === true}
|
|
22
|
+
onCheckedChange={value => props.onChange(value)}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// Register built-in input components
|
|
27
|
+
const inputComponents = globalRegistry.get('inputComponents');
|
|
28
|
+
inputComponents.set('vendure:moneyInput', MoneyInput);
|
|
29
|
+
inputComponents.set('vendure:textInput', TextInput);
|
|
30
|
+
inputComponents.set('vendure:numberInput', NumberInput);
|
|
31
|
+
inputComponents.set('vendure:dateTimeInput', DateTimeInput);
|
|
32
|
+
inputComponents.set('vendure:checkboxInput', CheckboxInput);
|
|
33
|
+
inputComponents.set('vendure:facetValueInput', FacetValueInput);
|
|
34
|
+
|
|
35
|
+
export function getInputComponent(id: string): DataInputComponent | undefined {
|
|
36
|
+
return globalRegistry.get('inputComponents').get(id);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @description
|
|
41
|
+
* Generates a component key based on the targeting properties.
|
|
42
|
+
* Follows the existing pattern: pageId_blockId_fieldName
|
|
43
|
+
*/
|
|
44
|
+
export function generateInputComponentKey(pageId: string, blockId: string, field: string): string {
|
|
45
|
+
return `${pageId}_${blockId}_${field}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function addInputComponent({
|
|
49
|
+
pageId,
|
|
50
|
+
blockId,
|
|
51
|
+
field,
|
|
52
|
+
component,
|
|
53
|
+
}: {
|
|
54
|
+
pageId: string;
|
|
55
|
+
blockId: string;
|
|
56
|
+
field: string;
|
|
57
|
+
component: React.ComponentType<{ value: any; onChange: (value: any) => void; [key: string]: any }>;
|
|
58
|
+
}) {
|
|
59
|
+
const inputComponents = globalRegistry.get('inputComponents');
|
|
60
|
+
|
|
61
|
+
// Generate the key using the helper function
|
|
62
|
+
const key = generateInputComponentKey(pageId, blockId, field);
|
|
63
|
+
|
|
64
|
+
if (inputComponents.has(key)) {
|
|
65
|
+
// eslint-disable-next-line no-console
|
|
66
|
+
console.warn(`Input component with key "${key}" is already registered and will be overwritten.`);
|
|
67
|
+
}
|
|
68
|
+
inputComponents.set(key, component);
|
|
69
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { globalRegistry } from '../../registry/global-registry.js';
|
|
2
|
+
import { DashboardAlertDefinition } from '../types/alerts.js';
|
|
3
|
+
|
|
4
|
+
export function registerAlertExtensions(alerts?: DashboardAlertDefinition[]) {
|
|
5
|
+
if (alerts) {
|
|
6
|
+
for (const alert of alerts) {
|
|
7
|
+
globalRegistry.get('dashboardAlertRegistry').set(alert.id, alert);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { parse } from 'graphql';
|
|
2
|
+
|
|
3
|
+
import { addBulkAction, addListQueryDocument } from '../../data-table/data-table-extensions.js';
|
|
4
|
+
import { addDisplayComponent } from '../display-component-extensions.js';
|
|
5
|
+
import { DashboardDataTableExtensionDefinition } from '../types/index.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Generates a data table display component key based on the pageId and column name.
|
|
10
|
+
* Uses the pattern: pageId_columnName
|
|
11
|
+
*/
|
|
12
|
+
export function generateDataTableDisplayComponentKey(pageId: string, column: string): string {
|
|
13
|
+
return `${pageId}_${column}`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* Adds a display component for a specific column in a data table.
|
|
19
|
+
*/
|
|
20
|
+
export function addDataTableDisplayComponent(
|
|
21
|
+
pageId: string,
|
|
22
|
+
column: string,
|
|
23
|
+
component: React.ComponentType<{ value: any; [key: string]: any }>,
|
|
24
|
+
) {
|
|
25
|
+
const key = generateDataTableDisplayComponentKey(pageId, column);
|
|
26
|
+
addDisplayComponent({ pageId, blockId: 'list-table', field: column, component });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function registerDataTableExtensions(dataTables?: DashboardDataTableExtensionDefinition[]) {
|
|
30
|
+
if (dataTables) {
|
|
31
|
+
for (const dataTable of dataTables) {
|
|
32
|
+
if (dataTable.bulkActions?.length) {
|
|
33
|
+
for (const action of dataTable.bulkActions) {
|
|
34
|
+
addBulkAction(dataTable.pageId, dataTable.blockId, action);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (dataTable.extendListDocument) {
|
|
38
|
+
const document =
|
|
39
|
+
typeof dataTable.extendListDocument === 'function'
|
|
40
|
+
? dataTable.extendListDocument()
|
|
41
|
+
: dataTable.extendListDocument;
|
|
42
|
+
|
|
43
|
+
addListQueryDocument(
|
|
44
|
+
dataTable.pageId,
|
|
45
|
+
dataTable.blockId,
|
|
46
|
+
typeof document === 'string' ? parse(document) : document,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
if (dataTable.displayComponents?.length) {
|
|
50
|
+
for (const displayComponent of dataTable.displayComponents) {
|
|
51
|
+
addDataTableDisplayComponent(
|
|
52
|
+
dataTable.pageId,
|
|
53
|
+
displayComponent.column,
|
|
54
|
+
displayComponent.component,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { addDetailQueryDocument } from '@/vdb/framework/form-engine/custom-form-component-extensions.js';
|
|
2
|
+
import { parse } from 'graphql';
|
|
3
|
+
|
|
4
|
+
import { addDisplayComponent } from '../display-component-extensions.js';
|
|
5
|
+
import { addInputComponent } from '../input-component-extensions.js';
|
|
6
|
+
import { DashboardDetailFormExtensionDefinition } from '../types/detail-forms.js';
|
|
7
|
+
|
|
8
|
+
export function registerDetailFormExtensions(detailForms?: DashboardDetailFormExtensionDefinition[]) {
|
|
9
|
+
if (detailForms) {
|
|
10
|
+
for (const detailForm of detailForms) {
|
|
11
|
+
if (detailForm.extendDetailDocument) {
|
|
12
|
+
const document =
|
|
13
|
+
typeof detailForm.extendDetailDocument === 'function'
|
|
14
|
+
? detailForm.extendDetailDocument()
|
|
15
|
+
: detailForm.extendDetailDocument;
|
|
16
|
+
|
|
17
|
+
addDetailQueryDocument(
|
|
18
|
+
detailForm.pageId,
|
|
19
|
+
typeof document === 'string' ? parse(document) : document,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Register input components for this detail form
|
|
24
|
+
if (detailForm.inputs) {
|
|
25
|
+
for (const inputComponent of detailForm.inputs) {
|
|
26
|
+
addInputComponent({
|
|
27
|
+
pageId: detailForm.pageId,
|
|
28
|
+
blockId: inputComponent.blockId,
|
|
29
|
+
field: inputComponent.field,
|
|
30
|
+
component: inputComponent.component,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Register display components for this detail form
|
|
36
|
+
if (detailForm.displays) {
|
|
37
|
+
for (const displayComponent of detailForm.displays) {
|
|
38
|
+
addDisplayComponent({
|
|
39
|
+
pageId: detailForm.pageId,
|
|
40
|
+
blockId: displayComponent.blockId,
|
|
41
|
+
field: displayComponent.field,
|
|
42
|
+
component: displayComponent.component,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { addCustomFormComponent } from '../../form-engine/custom-form-component-extensions.js';
|
|
2
|
+
import { DashboardCustomFormComponents } from '../types/form-components.js';
|
|
3
|
+
|
|
4
|
+
export function registerFormComponentExtensions(customFormComponents?: DashboardCustomFormComponents) {
|
|
5
|
+
if (customFormComponents) {
|
|
6
|
+
// Handle custom field components
|
|
7
|
+
if (customFormComponents.customFields) {
|
|
8
|
+
for (const component of customFormComponents.customFields) {
|
|
9
|
+
addCustomFormComponent(component);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Re-export all domain-specific logic functions
|
|
2
|
+
export * from './alerts.js';
|
|
3
|
+
export * from './data-table.js';
|
|
4
|
+
export * from './detail-forms.js';
|
|
5
|
+
export * from './form-components.js';
|
|
6
|
+
export * from './layout.js';
|
|
7
|
+
export * from './navigation.js';
|
|
8
|
+
export * from './widgets.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerDashboardActionBarItem,
|
|
3
|
+
registerDashboardPageBlock,
|
|
4
|
+
} from '../../layout-engine/layout-extensions.js';
|
|
5
|
+
import { DashboardActionBarItem, DashboardPageBlockDefinition } from '../types/layout.js';
|
|
6
|
+
|
|
7
|
+
export function registerLayoutExtensions(
|
|
8
|
+
actionBarItems?: DashboardActionBarItem[],
|
|
9
|
+
pageBlocks?: DashboardPageBlockDefinition[],
|
|
10
|
+
) {
|
|
11
|
+
if (actionBarItems) {
|
|
12
|
+
for (const item of actionBarItems) {
|
|
13
|
+
registerDashboardActionBarItem(item);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (pageBlocks) {
|
|
18
|
+
for (const block of pageBlocks) {
|
|
19
|
+
registerDashboardPageBlock(block);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { addNavMenuItem, addNavMenuSection, NavMenuItem } from '../../nav-menu/nav-menu-extensions.js';
|
|
2
|
+
import { registerRoute } from '../../page/page-api.js';
|
|
3
|
+
import { DashboardNavSectionDefinition, DashboardRouteDefinition } from '../types/navigation.js';
|
|
4
|
+
|
|
5
|
+
export function registerNavigationExtensions(
|
|
6
|
+
navSections?: DashboardNavSectionDefinition[],
|
|
7
|
+
routes?: DashboardRouteDefinition[],
|
|
8
|
+
) {
|
|
9
|
+
if (navSections) {
|
|
10
|
+
for (const section of navSections) {
|
|
11
|
+
addNavMenuSection({
|
|
12
|
+
...section,
|
|
13
|
+
placement: 'top',
|
|
14
|
+
order: section.order ?? 999,
|
|
15
|
+
items: [],
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (routes) {
|
|
21
|
+
for (const route of routes) {
|
|
22
|
+
if (route.navMenuItem) {
|
|
23
|
+
// Add the nav menu item
|
|
24
|
+
const item: NavMenuItem = {
|
|
25
|
+
url: route.navMenuItem.url ?? route.path,
|
|
26
|
+
id: route.navMenuItem.id ?? route.path,
|
|
27
|
+
title: route.navMenuItem.title ?? route.path,
|
|
28
|
+
};
|
|
29
|
+
addNavMenuItem(item, route.navMenuItem.sectionId);
|
|
30
|
+
}
|
|
31
|
+
if (route.path) {
|
|
32
|
+
// Configure a list page
|
|
33
|
+
registerRoute(route);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { registerDashboardWidget } from '../../dashboard-widget/widget-extensions.js';
|
|
2
|
+
import { DashboardWidgetDefinition } from '../types/index.js';
|
|
3
|
+
|
|
4
|
+
export function registerWidgetExtensions(widgets?: DashboardWidgetDefinition[]) {
|
|
5
|
+
if (widgets) {
|
|
6
|
+
for (const widget of widgets) {
|
|
7
|
+
registerDashboardWidget(widget);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* **Status: Developer Preview**
|
|
4
|
+
*
|
|
5
|
+
* Allows you to define custom alerts that can be displayed in the dashboard.
|
|
6
|
+
*
|
|
7
|
+
* @docsCategory extensions
|
|
8
|
+
* @since 3.3.0
|
|
9
|
+
*/
|
|
10
|
+
export interface DashboardAlertDefinition<TResponse = any> {
|
|
11
|
+
/**
|
|
12
|
+
* @description
|
|
13
|
+
* A unique identifier for the alert.
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* The title of the alert. Can be a string or a function that returns a string based on the response data.
|
|
19
|
+
*/
|
|
20
|
+
title: string | ((data: TResponse) => string);
|
|
21
|
+
/**
|
|
22
|
+
* @description
|
|
23
|
+
* The description of the alert. Can be a string or a function that returns a string based on the response data.
|
|
24
|
+
*/
|
|
25
|
+
description?: string | ((data: TResponse) => string);
|
|
26
|
+
/**
|
|
27
|
+
* @description
|
|
28
|
+
* The severity level of the alert.
|
|
29
|
+
*/
|
|
30
|
+
severity: 'info' | 'warning' | 'error';
|
|
31
|
+
/**
|
|
32
|
+
* @description
|
|
33
|
+
* A function that checks the condition and returns the response data.
|
|
34
|
+
*/
|
|
35
|
+
check: () => Promise<TResponse> | TResponse;
|
|
36
|
+
/**
|
|
37
|
+
* @description
|
|
38
|
+
* The interval in milliseconds to recheck the condition.
|
|
39
|
+
*/
|
|
40
|
+
recheckInterval?: number;
|
|
41
|
+
/**
|
|
42
|
+
* @description
|
|
43
|
+
* A function that determines whether the alert should be shown based on the response data.
|
|
44
|
+
*/
|
|
45
|
+
shouldShow?: (data: TResponse) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @description
|
|
48
|
+
* Optional actions that can be performed when the alert is shown.
|
|
49
|
+
*/
|
|
50
|
+
actions?: Array<{
|
|
51
|
+
label: string;
|
|
52
|
+
onClick: (data: TResponse) => void;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
|
+
|
|
3
|
+
import { BulkAction } from '../../data-table/data-table-types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* Allows you to define custom display components for specific columns in data tables.
|
|
8
|
+
* The pageId is already defined in the data table extension, so only the column name is needed.
|
|
9
|
+
*
|
|
10
|
+
* @docsCategory extensions
|
|
11
|
+
* @since 3.4.0
|
|
12
|
+
*/
|
|
13
|
+
export interface DashboardDataTableDisplayComponent {
|
|
14
|
+
/**
|
|
15
|
+
* @description
|
|
16
|
+
* The name of the column where this display component should be used.
|
|
17
|
+
*/
|
|
18
|
+
column: string;
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* The React component that will be rendered as the display.
|
|
22
|
+
* It should accept `value` and other standard display props.
|
|
23
|
+
*/
|
|
24
|
+
component: React.ComponentType<{ value: any; [key: string]: any }>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @description
|
|
29
|
+
* **Status: Developer Preview**
|
|
30
|
+
*
|
|
31
|
+
* This allows you to customize aspects of existing data tables in the dashboard.
|
|
32
|
+
*
|
|
33
|
+
* @docsCategory extensions
|
|
34
|
+
* @since 3.4.0
|
|
35
|
+
*/
|
|
36
|
+
export interface DashboardDataTableExtensionDefinition {
|
|
37
|
+
/**
|
|
38
|
+
* @description
|
|
39
|
+
* The ID of the page where the data table is located, e.g. `'product-list'`, `'order-list'`.
|
|
40
|
+
*/
|
|
41
|
+
pageId: string;
|
|
42
|
+
/**
|
|
43
|
+
* @description
|
|
44
|
+
* The ID of the data table block. Defaults to `'list-table'`, which is the default blockId
|
|
45
|
+
* for the standard list pages. However, some other pages may use a different blockId,
|
|
46
|
+
* such as `'product-variants-table'` on the `'product-detail'` page.
|
|
47
|
+
*/
|
|
48
|
+
blockId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* @description
|
|
51
|
+
* An array of additional bulk actions that will be available on the data table.
|
|
52
|
+
*/
|
|
53
|
+
bulkActions?: BulkAction[];
|
|
54
|
+
/**
|
|
55
|
+
* @description
|
|
56
|
+
* Allows you to extend the list document for the data table.
|
|
57
|
+
*/
|
|
58
|
+
extendListDocument?: string | DocumentNode | (() => DocumentNode | string);
|
|
59
|
+
/**
|
|
60
|
+
* @description
|
|
61
|
+
* Custom display components for specific columns in the data table.
|
|
62
|
+
*/
|
|
63
|
+
displayComponents?: DashboardDataTableDisplayComponent[];
|
|
64
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataDisplayComponent,
|
|
3
|
+
DataInputComponent,
|
|
4
|
+
} from '@/vdb/framework/component-registry/component-registry.js';
|
|
5
|
+
import { DocumentNode } from 'graphql';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Allows you to define custom input components for specific fields in detail forms.
|
|
10
|
+
* The pageId is already defined in the detail form extension, so only the blockId and field are needed.
|
|
11
|
+
*
|
|
12
|
+
* @docsCategory extensions
|
|
13
|
+
* @since 3.4.0
|
|
14
|
+
*/
|
|
15
|
+
export interface DashboardDetailFormInputComponent {
|
|
16
|
+
/**
|
|
17
|
+
* @description
|
|
18
|
+
* The ID of the block where this input component should be used.
|
|
19
|
+
*/
|
|
20
|
+
blockId: string;
|
|
21
|
+
/**
|
|
22
|
+
* @description
|
|
23
|
+
* The name of the field where this input component should be used.
|
|
24
|
+
*/
|
|
25
|
+
field: string;
|
|
26
|
+
/**
|
|
27
|
+
* @description
|
|
28
|
+
* The React component that will be rendered as the input.
|
|
29
|
+
* It should accept `value`, `onChange`, and other standard input props.
|
|
30
|
+
*/
|
|
31
|
+
component: DataInputComponent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @description
|
|
36
|
+
* Allows you to define custom display components for specific fields in detail forms.
|
|
37
|
+
* The pageId is already defined in the detail form extension, so only the blockId and field are needed.
|
|
38
|
+
*
|
|
39
|
+
* @docsCategory extensions
|
|
40
|
+
* @since 3.4.0
|
|
41
|
+
*/
|
|
42
|
+
export interface DashboardDetailFormDisplayComponent {
|
|
43
|
+
/**
|
|
44
|
+
* @description
|
|
45
|
+
* The ID of the block where this display component should be used.
|
|
46
|
+
*/
|
|
47
|
+
blockId: string;
|
|
48
|
+
/**
|
|
49
|
+
* @description
|
|
50
|
+
* The name of the field where this display component should be used.
|
|
51
|
+
*/
|
|
52
|
+
field: string;
|
|
53
|
+
/**
|
|
54
|
+
* @description
|
|
55
|
+
* The React component that will be rendered as the display.
|
|
56
|
+
* It should accept `value` and other standard display props.
|
|
57
|
+
*/
|
|
58
|
+
component: DataDisplayComponent;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface DashboardDetailFormExtensionDefinition {
|
|
62
|
+
/**
|
|
63
|
+
* @description
|
|
64
|
+
* The ID of the page where the detail form is located, e.g. `'product-detail'`, `'order-detail'`.
|
|
65
|
+
*/
|
|
66
|
+
pageId: string;
|
|
67
|
+
/**
|
|
68
|
+
* @description
|
|
69
|
+
*/
|
|
70
|
+
extendDetailDocument?: string | DocumentNode | (() => DocumentNode | string);
|
|
71
|
+
/**
|
|
72
|
+
* @description
|
|
73
|
+
* Custom input components for specific fields in the detail form.
|
|
74
|
+
*/
|
|
75
|
+
inputs?: DashboardDetailFormInputComponent[];
|
|
76
|
+
/**
|
|
77
|
+
* @description
|
|
78
|
+
* Custom display components for specific fields in the detail form.
|
|
79
|
+
*/
|
|
80
|
+
displays?: DashboardDetailFormDisplayComponent[];
|
|
81
|
+
}
|