@vendure/admin-ui 2.1.0-next.4 → 2.1.0-next.5
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/catalog/components/product-list/product-list.component.d.ts +1 -1
- package/catalog/components/product-variant-list/product-variant-list-bulk-actions.d.ts +1 -2
- package/catalog/components/product-variant-list/product-variant-list.component.d.ts +1 -1
- package/catalog/components/stock-location-list/stock-location-list.component.d.ts +1 -1
- package/catalog/providers/product-detail/product-detail.service.d.ts +1 -1
- package/core/common/base-detail.component.d.ts +2 -2
- package/core/common/base-entity-resolver.d.ts +1 -1
- package/core/common/version.d.ts +1 -1
- package/core/components/base-nav/base-nav.component.d.ts +4 -2
- package/core/data/providers/data.service.d.ts +3 -3
- package/core/data/query-result.d.ts +1 -1
- package/core/extension/add-action-bar-item.d.ts +8 -15
- package/core/extension/add-nav-menu-item.d.ts +15 -23
- package/core/extension/register-bulk-action.d.ts +24 -28
- package/core/extension/register-custom-detail-component.d.ts +45 -0
- package/core/extension/register-data-table-component.d.ts +3 -2
- package/core/extension/register-form-input-component.d.ts +14 -13
- package/core/extension/register-history-entry-component.d.ts +55 -0
- package/core/extension/register-page-tab.d.ts +23 -0
- package/core/extension/register-route-component.d.ts +49 -3
- package/core/providers/bulk-action-registry/bulk-action-types.d.ts +2 -2
- package/core/providers/modal/modal.service.d.ts +1 -1
- package/core/providers/modal/modal.types.d.ts +3 -3
- package/core/providers/nav-builder/nav-builder-types.d.ts +29 -4
- package/core/providers/nav-builder/nav-builder.service.d.ts +3 -2
- package/core/providers/notification/notification.service.d.ts +4 -4
- package/core/providers/page/page.service.d.ts +1 -23
- package/core/public_api.d.ts +1 -0
- package/core/shared/components/action-bar-items/action-bar-items.component.d.ts +8 -3
- package/core/shared/components/asset-picker-dialog/asset-picker-dialog.component.d.ts +1 -1
- package/core/shared/components/asset-preview/asset-preview.component.d.ts +9 -1
- package/core/shared/components/asset-preview-dialog/asset-preview-dialog.component.d.ts +2 -0
- package/core/shared/components/data-table-2/data-table2.component.d.ts +1 -1
- package/core/shared/components/extension-host/host-external-frame.d.ts +1 -1
- package/core/shared/components/facet-value-selector/facet-value-selector.component.d.ts +1 -1
- package/core/shared/components/order-state-label/order-state-label.component.d.ts +1 -1
- package/core/shared/dynamic-form-inputs/default-form-inputs.d.ts +1 -1
- package/core/shared/pipes/duration.pipe.d.ts +1 -1
- package/core/shared/pipes/file-size.pipe.d.ts +1 -1
- package/esm2022/catalog/components/asset-detail/asset-detail.component.mjs +1 -1
- package/esm2022/catalog/components/assets/assets.component.mjs +2 -2
- package/esm2022/catalog/components/product-variant-list/product-variant-list-bulk-actions.mjs +1 -1
- package/esm2022/core/common/base-detail.component.mjs +3 -3
- package/esm2022/core/common/base-entity-resolver.mjs +3 -3
- package/esm2022/core/common/utilities/custom-field-default-value.mjs +3 -3
- package/esm2022/core/common/version.mjs +2 -2
- package/esm2022/core/components/base-nav/base-nav.component.mjs +17 -5
- package/esm2022/core/data/providers/data.service.mjs +4 -4
- package/esm2022/core/data/query-result.mjs +2 -2
- package/esm2022/core/extension/add-action-bar-item.mjs +9 -16
- package/esm2022/core/extension/add-nav-menu-item.mjs +16 -24
- package/esm2022/core/extension/register-bulk-action.mjs +25 -29
- package/esm2022/core/extension/register-custom-detail-component.mjs +46 -1
- package/esm2022/core/extension/register-data-table-component.mjs +4 -3
- package/esm2022/core/extension/register-form-input-component.mjs +15 -14
- package/esm2022/core/extension/register-history-entry-component.mjs +56 -1
- package/esm2022/core/extension/register-page-tab.mjs +36 -0
- package/esm2022/core/extension/register-route-component.mjs +44 -3
- package/esm2022/core/providers/bulk-action-registry/bulk-action-types.mjs +1 -1
- package/esm2022/core/providers/modal/modal.service.mjs +2 -2
- package/esm2022/core/providers/modal/modal.types.mjs +1 -1
- package/esm2022/core/providers/nav-builder/nav-builder-types.mjs +1 -1
- package/esm2022/core/providers/nav-builder/nav-builder.service.mjs +3 -3
- package/esm2022/core/providers/notification/notification.service.mjs +3 -3
- package/esm2022/core/providers/page/page.service.mjs +2 -36
- package/esm2022/core/public_api.mjs +2 -1
- package/esm2022/core/shared/components/action-bar/action-bar.component.mjs +2 -2
- package/esm2022/core/shared/components/action-bar-items/action-bar-items.component.mjs +32 -15
- package/esm2022/core/shared/components/asset-gallery/asset-gallery.component.mjs +2 -2
- package/esm2022/core/shared/components/asset-picker-dialog/asset-picker-dialog.component.mjs +2 -2
- package/esm2022/core/shared/components/asset-preview/asset-preview.component.mjs +36 -3
- package/esm2022/core/shared/components/asset-preview-dialog/asset-preview-dialog.component.mjs +4 -3
- package/esm2022/core/shared/components/data-table-2/data-table2.component.mjs +2 -2
- package/esm2022/core/shared/components/extension-host/host-external-frame.mjs +2 -2
- package/esm2022/core/shared/components/facet-value-selector/facet-value-selector.component.mjs +2 -2
- package/esm2022/core/shared/components/form-field/form-field.component.mjs +2 -2
- package/esm2022/core/shared/components/page-detail-layout/page-detail-layout.component.mjs +2 -2
- package/esm2022/core/shared/pipes/duration.pipe.mjs +2 -2
- package/esm2022/core/shared/pipes/file-size.pipe.mjs +2 -2
- package/esm2022/react/components/react-custom-column.component.mjs +3 -3
- package/esm2022/react/components/react-custom-detail.component.mjs +3 -3
- package/esm2022/react/components/react-form-input.component.mjs +3 -3
- package/esm2022/react/components/react-route.component.mjs +3 -3
- package/esm2022/react/public_api.mjs +7 -1
- package/esm2022/react/react-components/ActionBar.mjs +26 -0
- package/esm2022/react/react-components/CdsIcon.mjs +30 -0
- package/esm2022/react/react-components/FormField.mjs +28 -0
- package/esm2022/react/react-components/PageBlock.mjs +24 -0
- package/esm2022/react/react-components/PageDetailLayout.mjs +26 -0
- package/esm2022/react/react-hooks/use-detail-component-data.mjs +1 -1
- package/esm2022/react/react-hooks/use-route-params.mjs +39 -0
- package/esm2022/react/register-react-data-table-component.mjs +3 -1
- package/esm2022/react/register-react-route-component.mjs +1 -1
- package/esm2022/settings/components/tax-category-list/tax-category-list-bulk-actions.mjs +1 -1
- package/fesm2022/vendure-admin-ui-catalog.mjs +2 -2
- package/fesm2022/vendure-admin-ui-catalog.mjs.map +1 -1
- package/fesm2022/vendure-admin-ui-core.mjs +350 -164
- package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
- package/fesm2022/vendure-admin-ui-react.mjs +178 -11
- package/fesm2022/vendure-admin-ui-react.mjs.map +1 -1
- package/fesm2022/vendure-admin-ui-settings.mjs.map +1 -1
- package/package.json +14 -14
- package/react/public_api.d.ts +6 -0
- package/react/react-components/ActionBar.d.ts +23 -0
- package/react/react-components/CdsIcon.d.ts +45 -0
- package/react/react-components/FormField.d.ts +27 -0
- package/react/react-components/PageBlock.d.ts +21 -0
- package/react/react-components/PageDetailLayout.d.ts +23 -0
- package/react/react-hooks/use-detail-component-data.d.ts +2 -2
- package/react/react-hooks/use-route-params.d.ts +22 -0
- package/react/register-react-data-table-component.d.ts +2 -0
- package/react/register-react-route-component.d.ts +6 -0
|
@@ -9,7 +9,7 @@ export declare class ProductListComponent extends TypedBaseListComponent<typeof
|
|
|
9
9
|
pendingSearchIndexUpdates: number;
|
|
10
10
|
readonly customFields: import("@vendure/admin-ui/core").CustomFieldConfig[];
|
|
11
11
|
readonly filters: import("@vendure/admin-ui/core").DataTableFilterCollection<import("@vendure/admin-ui/core").ProductFilterParameter>;
|
|
12
|
-
readonly sorts: import("@vendure/admin-ui/core").DataTableSortCollection<import("@vendure/admin-ui/core").ProductSortParameter, ["name" | "
|
|
12
|
+
readonly sorts: import("@vendure/admin-ui/core").DataTableSortCollection<import("@vendure/admin-ui/core").ProductSortParameter, ["name" | "id" | "createdAt" | "updatedAt" | "slug"]>;
|
|
13
13
|
constructor(dataService: DataService, modalService: ModalService, notificationService: NotificationService, jobQueueService: JobQueueService);
|
|
14
14
|
rebuildSearchIndex(): void;
|
|
15
15
|
deleteProduct(productId: string): void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BulkAction, GetProductVariantListQuery, ItemOf } from '@vendure/admin-ui/core';
|
|
2
|
-
import { ProductVariant } from 'package/core';
|
|
1
|
+
import { BulkAction, GetProductVariantListQuery, ItemOf, ProductVariant } from '@vendure/admin-ui/core';
|
|
3
2
|
import { ProductVariantListComponent } from './product-variant-list.component';
|
|
4
3
|
export declare const assignProductVariantsToChannelBulkAction: BulkAction<ItemOf<GetProductVariantListQuery, 'productVariants'>, ProductVariantListComponent>;
|
|
5
4
|
export declare const removeProductVariantsFromChannelBulkAction: BulkAction<any, import("@vendure/admin-ui/core").BaseListComponent<any, any, any>>;
|
|
@@ -6,7 +6,7 @@ export declare class ProductVariantListComponent extends TypedBaseListComponent<
|
|
|
6
6
|
hideLanguageSelect: boolean;
|
|
7
7
|
readonly customFields: import("@vendure/admin-ui/core").CustomFieldConfig[];
|
|
8
8
|
readonly filters: import("@vendure/admin-ui/core").DataTableFilterCollection<import("@vendure/admin-ui/core").ProductVariantFilterParameter>;
|
|
9
|
-
readonly sorts: import("@vendure/admin-ui/core").DataTableSortCollection<import("@vendure/admin-ui/core").ProductVariantSortParameter, ["name" | "
|
|
9
|
+
readonly sorts: import("@vendure/admin-ui/core").DataTableSortCollection<import("@vendure/admin-ui/core").ProductVariantSortParameter, ["name" | "price" | "sku" | "id" | "createdAt" | "updatedAt" | "priceWithTax"]>;
|
|
10
10
|
constructor();
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProductVariantListComponent, never>;
|
|
12
12
|
static ɵcmp: i0.ɵɵComponentDeclaration<ProductVariantListComponent, "vdr-product-variant-list", never, { "productId": { "alias": "productId"; "required": false; }; "hideLanguageSelect": { "alias": "hideLanguageSelect"; "required": false; }; }, {}, never, never, false, never>;
|
|
@@ -5,7 +5,7 @@ export declare const GET_STOCK_LOCATION_LIST: import("apollo-angular").TypedDocu
|
|
|
5
5
|
export declare class StockLocationListComponent extends TypedBaseListComponent<typeof GetStockLocationListDocument, 'stockLocations'> implements OnInit {
|
|
6
6
|
readonly customFields: import("@vendure/admin-ui/core").CustomFieldConfig[];
|
|
7
7
|
readonly filters: import("@vendure/admin-ui/core").DataTableFilterCollection<import("@vendure/admin-ui/core").StockLocationFilterParameter>;
|
|
8
|
-
readonly sorts: import("@vendure/admin-ui/core").DataTableSortCollection<import("@vendure/admin-ui/core").StockLocationSortParameter, ["name" | "
|
|
8
|
+
readonly sorts: import("@vendure/admin-ui/core").DataTableSortCollection<import("@vendure/admin-ui/core").StockLocationSortParameter, ["name" | "id" | "createdAt" | "updatedAt" | "description"]>;
|
|
9
9
|
constructor();
|
|
10
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<StockLocationListComponent, never>;
|
|
11
11
|
static ɵcmp: i0.ɵɵComponentDeclaration<StockLocationListComponent, "vdr-stock-location-list", never, {}, {}, never, never, false, never>;
|
|
@@ -278,7 +278,7 @@ export declare class ProductDetailService {
|
|
|
278
278
|
autoUpdate: boolean;
|
|
279
279
|
productInput?: UpdateProductInput;
|
|
280
280
|
variantsInput?: UpdateProductVariantInput[];
|
|
281
|
-
}): Observable<(
|
|
281
|
+
}): Observable<(UpdateProductMutation | UpdateProductVariantsMutation)[]>;
|
|
282
282
|
updateProductOption(input: UpdateProductOptionInput & {
|
|
283
283
|
autoUpdate: boolean;
|
|
284
284
|
}, product: NonNullable<GetProductDetailQuery['product']>, languageCode: LanguageCode): Observable<any>;
|
|
@@ -15,7 +15,7 @@ import { TranslationOf } from './utilities/find-translation';
|
|
|
15
15
|
* {@link BaseEntityResolver}.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
|
-
* ```
|
|
18
|
+
* ```ts
|
|
19
19
|
* \@Component({
|
|
20
20
|
* selector: 'app-my-entity',
|
|
21
21
|
* templateUrl: './my-entity.component.html',
|
|
@@ -95,7 +95,7 @@ export declare abstract class TypedBaseDetailComponent<T extends TypedDocumentNo
|
|
|
95
95
|
* correct resolved detail data.
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
|
-
* ```
|
|
98
|
+
* ```ts
|
|
99
99
|
* \@NgModule({
|
|
100
100
|
* imports: [ReviewsSharedModule],
|
|
101
101
|
* declarations: [/* ... *\/],
|
package/core/common/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ADMIN_UI_VERSION = "2.1.0-next.
|
|
1
|
+
export declare const ADMIN_UI_VERSION = "2.1.0-next.5";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
3
|
import { DataService } from '../../data/providers/data.service';
|
|
4
4
|
import { HealthCheckService } from '../../providers/health-check/health-check.service';
|
|
@@ -13,7 +13,8 @@ export declare class BaseNavComponent implements OnInit, OnDestroy {
|
|
|
13
13
|
protected healthCheckService: HealthCheckService;
|
|
14
14
|
protected jobQueueService: JobQueueService;
|
|
15
15
|
protected dataService: DataService;
|
|
16
|
-
|
|
16
|
+
protected injector: Injector;
|
|
17
|
+
constructor(route: ActivatedRoute, router: Router, navBuilderService: NavBuilderService, healthCheckService: HealthCheckService, jobQueueService: JobQueueService, dataService: DataService, injector: Injector);
|
|
17
18
|
private userPermissions;
|
|
18
19
|
private subscription;
|
|
19
20
|
shouldDisplayLink(menuItem: Pick<NavMenuItem, 'requiresPermission'>): boolean | undefined;
|
|
@@ -21,6 +22,7 @@ export declare class BaseNavComponent implements OnInit, OnDestroy {
|
|
|
21
22
|
ngOnDestroy(): void;
|
|
22
23
|
getRouterLink(item: NavMenuItem): string[] | null;
|
|
23
24
|
private defineNavMenu;
|
|
25
|
+
private createContext;
|
|
24
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseNavComponent, never>;
|
|
25
27
|
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseNavComponent, "[vdrBaseNav]", never, {}, {}, never, never, false, never>;
|
|
26
28
|
}
|
|
@@ -23,7 +23,7 @@ import * as i0 from "@angular/core";
|
|
|
23
23
|
* advisable to always select the `id` field of any entity, which will allow the returned data
|
|
24
24
|
* to be effectively cached.
|
|
25
25
|
*
|
|
26
|
-
* @docsCategory
|
|
26
|
+
* @docsCategory services
|
|
27
27
|
* @docsPage DataService
|
|
28
28
|
* @docsWeight 0
|
|
29
29
|
*/
|
|
@@ -48,7 +48,7 @@ export declare class DataService {
|
|
|
48
48
|
* they type of result returned, e.g. stream of values, single value etc.
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
|
-
* ```
|
|
51
|
+
* ```ts
|
|
52
52
|
* const result$ = this.dataService.query(gql`
|
|
53
53
|
* query MyQuery($id: ID!) {
|
|
54
54
|
* product(id: $id) {
|
|
@@ -67,7 +67,7 @@ export declare class DataService {
|
|
|
67
67
|
* Perform a GraphQL mutation.
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
|
-
* ```
|
|
70
|
+
* ```ts
|
|
71
71
|
* const result$ = this.dataService.mutate(gql`
|
|
72
72
|
* mutation MyMutation($Codegen.UpdateEntityInput!) {
|
|
73
73
|
* updateEntity(input: $input) {
|
|
@@ -5,7 +5,7 @@ import { Observable, Subject } from 'rxjs';
|
|
|
5
5
|
* This class wraps the Apollo Angular QueryRef object and exposes some getters
|
|
6
6
|
* for convenience.
|
|
7
7
|
*
|
|
8
|
-
* @docsCategory
|
|
8
|
+
* @docsCategory services
|
|
9
9
|
* @docsPage DataService
|
|
10
10
|
*/
|
|
11
11
|
export declare class QueryResult<T, V extends Record<string, any> = Record<string, any>> {
|
|
@@ -3,25 +3,18 @@ import { ActionBarItem } from '../providers/nav-builder/nav-builder-types';
|
|
|
3
3
|
/**
|
|
4
4
|
* @description
|
|
5
5
|
* Adds a button to the ActionBar at the top right of each list or detail view. The locationId can
|
|
6
|
-
* be determined by
|
|
7
|
-
* `data-location-id` attribute.
|
|
8
|
-
*
|
|
9
|
-
* This should be used in the NgModule `providers` array of your ui extension module.
|
|
6
|
+
* be determined by pressing `ctrl + u` when running the Admin UI in dev mode.
|
|
10
7
|
*
|
|
11
8
|
* @example
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* imports: [SharedModule],
|
|
15
|
-
* providers: [
|
|
9
|
+
* ```ts title="providers.ts"
|
|
10
|
+
* export default [
|
|
16
11
|
* addActionBarItem({
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
12
|
+
* id: 'print-invoice',
|
|
13
|
+
* label: 'Print Invoice',
|
|
14
|
+
* locationId: 'order-detail',
|
|
15
|
+
* routerLink: ['/extensions/invoicing'],
|
|
21
16
|
* }),
|
|
22
|
-
*
|
|
23
|
-
* })
|
|
24
|
-
* export class MyUiExtensionModule {}
|
|
17
|
+
* ];
|
|
25
18
|
* ```
|
|
26
19
|
* @docsCategory action-bar
|
|
27
20
|
*/
|
|
@@ -9,21 +9,17 @@ import { NavMenuItem, NavMenuSection } from '../providers/nav-builder/nav-builde
|
|
|
9
9
|
* This should be used in the NgModule `providers` array of your ui extension module.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* imports: [SharedModule],
|
|
15
|
-
* providers: [
|
|
12
|
+
* ```ts title="providers.ts"
|
|
13
|
+
* export default [
|
|
16
14
|
* addNavMenuSection({
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
15
|
+
* id: 'reports',
|
|
16
|
+
* label: 'Reports',
|
|
17
|
+
* items: [{
|
|
18
|
+
* // ...
|
|
19
|
+
* }],
|
|
22
20
|
* },
|
|
23
21
|
* 'settings'),
|
|
24
|
-
*
|
|
25
|
-
* })
|
|
26
|
-
* export class MyUiExtensionModule {}
|
|
22
|
+
* ];
|
|
27
23
|
* ```
|
|
28
24
|
* @docsCategory nav-menu
|
|
29
25
|
*/
|
|
@@ -39,20 +35,16 @@ export declare function addNavMenuSection(config: NavMenuSection, before?: strin
|
|
|
39
35
|
* This should be used in the NgModule `providers` array of your ui extension module.
|
|
40
36
|
*
|
|
41
37
|
* @example
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* imports: [SharedModule],
|
|
45
|
-
* providers: [
|
|
38
|
+
* ```ts title="providers.ts"
|
|
39
|
+
* export default [
|
|
46
40
|
* addNavMenuItem({
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
41
|
+
* id: 'reviews',
|
|
42
|
+
* label: 'Product Reviews',
|
|
43
|
+
* routerLink: ['/extensions/reviews'],
|
|
44
|
+
* icon: 'star',
|
|
51
45
|
* },
|
|
52
46
|
* 'marketing'),
|
|
53
|
-
*
|
|
54
|
-
* })
|
|
55
|
-
* export class MyUiExtensionModule {}
|
|
47
|
+
* ];
|
|
56
48
|
* ``
|
|
57
49
|
*
|
|
58
50
|
* @docsCategory nav-menu
|
|
@@ -13,39 +13,35 @@ import { BulkAction } from '../providers/bulk-action-registry/bulk-action-types'
|
|
|
13
13
|
* translation via a custom service which integrates with the translation service's API.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
|
-
* ```
|
|
17
|
-
* import { NgModule } from '\@angular/core';
|
|
16
|
+
* ```ts title="providers.ts"
|
|
18
17
|
* import { ModalService, registerBulkAction, SharedModule } from '\@vendure/admin-ui/core';
|
|
18
|
+
* import { ProductDataTranslationService } from './product-data-translation.service';
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* imports: [SharedModule],
|
|
22
|
-
* providers: [
|
|
20
|
+
* export default [
|
|
23
21
|
* ProductDataTranslationService,
|
|
24
22
|
* registerBulkAction({
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
23
|
+
* location: 'product-list',
|
|
24
|
+
* label: 'Send to translation service',
|
|
25
|
+
* icon: 'language',
|
|
26
|
+
* onClick: ({ injector, selection }) => {
|
|
27
|
+
* const modalService = injector.get(ModalService);
|
|
28
|
+
* const translationService = injector.get(ProductDataTranslationService);
|
|
29
|
+
* modalService
|
|
30
|
+
* .dialog({
|
|
31
|
+
* title: `Send ${selection.length} products for translation?`,
|
|
32
|
+
* buttons: [
|
|
33
|
+
* { type: 'secondary', label: 'cancel' },
|
|
34
|
+
* { type: 'primary', label: 'send', returnValue: true },
|
|
35
|
+
* ],
|
|
36
|
+
* })
|
|
37
|
+
* .subscribe(response => {
|
|
38
|
+
* if (response) {
|
|
39
|
+
* translationService.sendForTranslation(selection.map(item => item.productId));
|
|
40
|
+
* }
|
|
41
|
+
* });
|
|
42
|
+
* },
|
|
45
43
|
* }),
|
|
46
|
-
*
|
|
47
|
-
* })
|
|
48
|
-
* export class MyUiExtensionModule {}
|
|
44
|
+
* ];
|
|
49
45
|
* ```
|
|
50
46
|
* @since 1.8.0
|
|
51
47
|
* @docsCategory bulk-actions
|
|
@@ -5,6 +5,51 @@ import { CustomDetailComponentConfig } from '../providers/custom-detail-componen
|
|
|
5
5
|
* Registers a {@link CustomDetailComponent} to be placed in a given location. This allows you
|
|
6
6
|
* to embed any type of custom Angular component in the entity detail pages of the Admin UI.
|
|
7
7
|
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { Component, OnInit } from '\@angular/core';
|
|
11
|
+
* import { switchMap } from 'rxjs';
|
|
12
|
+
* import { FormGroup } from '\@angular/forms';
|
|
13
|
+
* import { CustomFieldConfig } from '\@vendure/common/lib/generated-types';
|
|
14
|
+
* import {
|
|
15
|
+
* DataService,
|
|
16
|
+
* SharedModule,
|
|
17
|
+
* CustomDetailComponent,
|
|
18
|
+
* registerCustomDetailComponent,
|
|
19
|
+
* GetProductWithVariants
|
|
20
|
+
* } from '\@vendure/admin-ui/core';
|
|
21
|
+
*
|
|
22
|
+
* \@Component({
|
|
23
|
+
* template: `{{ extraInfo$ | async | json }}`,
|
|
24
|
+
* standalone: true,
|
|
25
|
+
* imports: [SharedModule],
|
|
26
|
+
* })
|
|
27
|
+
* export class ProductInfoComponent implements CustomDetailComponent, OnInit {
|
|
28
|
+
* // These two properties are provided by Vendure and will vary
|
|
29
|
+
* // depending on the particular detail page you are embedding this
|
|
30
|
+
* // component into.
|
|
31
|
+
* entity$: Observable<GetProductWithVariants.Product>
|
|
32
|
+
* detailForm: FormGroup;
|
|
33
|
+
*
|
|
34
|
+
* extraInfo$: Observable<any>;
|
|
35
|
+
*
|
|
36
|
+
* constructor(private cmsDataService: CmsDataService) {}
|
|
37
|
+
*
|
|
38
|
+
* ngOnInit() {
|
|
39
|
+
* this.extraInfo$ = this.entity$.pipe(
|
|
40
|
+
* switchMap(entity => this.cmsDataService.getDataFor(entity.id))
|
|
41
|
+
* );
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* export default [
|
|
46
|
+
* registerCustomDetailComponent({
|
|
47
|
+
* locationId: 'product-detail',
|
|
48
|
+
* component: ProductInfoComponent,
|
|
49
|
+
* }),
|
|
50
|
+
* ];
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
8
53
|
* @docsCategory custom-detail-components
|
|
9
54
|
*/
|
|
10
55
|
export declare function registerCustomDetailComponent(config: CustomDetailComponentConfig): Provider;
|
|
@@ -2,14 +2,15 @@ import { DataTableComponentConfig, DataTableCustomComponentService } from '../sh
|
|
|
2
2
|
/**
|
|
3
3
|
* @description
|
|
4
4
|
* Allows you to override the default component used to render the data of a particular column in a DataTable.
|
|
5
|
-
* The component should implement the {@link CustomDataTableColumnComponent} interface.
|
|
5
|
+
* The component should implement the {@link CustomDataTableColumnComponent} interface. The tableId and columnId can
|
|
6
|
+
* be determined by pressing `ctrl + u` when running the Admin UI in dev mode.
|
|
6
7
|
*
|
|
7
8
|
* @example
|
|
8
9
|
* ```ts title="components/custom-table.component.ts"
|
|
9
10
|
* import { Component, Input } from '\@angular/core';
|
|
10
11
|
* import { CustomColumnComponent } from '\@vendure/admin-ui/core';
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
+
* \@Component({
|
|
13
14
|
* selector: 'custom-slug-component',
|
|
14
15
|
* template: `
|
|
15
16
|
* <a [href]="'https://example.com/products/' + rowItem.slug" target="_blank">{{ rowItem.slug }}</a>
|
|
@@ -3,32 +3,33 @@ import { FormInputComponent } from '../common/component-registry-types';
|
|
|
3
3
|
/**
|
|
4
4
|
* @description
|
|
5
5
|
* Registers a custom FormInputComponent which can be used to control the argument inputs
|
|
6
|
-
* of a {@link ConfigurableOperationDef} (e.g. CollectionFilter, ShippingMethod etc) or for
|
|
6
|
+
* of a {@link ConfigurableOperationDef} (e.g. CollectionFilter, ShippingMethod etc.) or for
|
|
7
7
|
* a custom field.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* ```
|
|
11
|
-
* \@
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* })
|
|
18
|
-
* export class MyUiExtensionModule {}
|
|
10
|
+
* ```ts title="providers.ts"
|
|
11
|
+
* import { registerFormInputComponent } from '\@vendure/admin-ui/core';
|
|
12
|
+
*
|
|
13
|
+
* export default [
|
|
14
|
+
* // highlight-next-line
|
|
15
|
+
* registerFormInputComponent('my-custom-input', MyCustomFieldControl),
|
|
16
|
+
* ];
|
|
19
17
|
* ```
|
|
20
18
|
*
|
|
21
19
|
* This input component can then be used in a custom field:
|
|
22
20
|
*
|
|
23
21
|
* @example
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
22
|
+
* ```ts title="src/vendure-config.ts"
|
|
23
|
+
* import { VendureConfig } from '\@vendure/core';
|
|
24
|
+
*
|
|
25
|
+
* const config: VendureConfig = {
|
|
26
26
|
* // ...
|
|
27
27
|
* customFields: {
|
|
28
28
|
* ProductVariant: [
|
|
29
29
|
* {
|
|
30
30
|
* name: 'rrp',
|
|
31
31
|
* type: 'int',
|
|
32
|
+
* // highlight-next-line
|
|
32
33
|
* ui: { component: 'my-custom-input' },
|
|
33
34
|
* },
|
|
34
35
|
* ]
|
|
@@ -39,7 +40,7 @@ import { FormInputComponent } from '../common/component-registry-types';
|
|
|
39
40
|
* or with an argument of a {@link ConfigurableOperationDef}:
|
|
40
41
|
*
|
|
41
42
|
* @example
|
|
42
|
-
* ```
|
|
43
|
+
* ```ts
|
|
43
44
|
* args: {
|
|
44
45
|
* rrp: { type: 'int', ui: { component: 'my-custom-input' } },
|
|
45
46
|
* }
|
|
@@ -5,6 +5,61 @@ import { HistoryEntryConfig } from '../providers/custom-history-entry-component/
|
|
|
5
5
|
* Registers a {@link HistoryEntryComponent} for displaying history entries in the Order/Customer
|
|
6
6
|
* history timeline.
|
|
7
7
|
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { Component } from '\@angular/core';
|
|
11
|
+
* import {
|
|
12
|
+
* CustomerFragment,
|
|
13
|
+
* CustomerHistoryEntryComponent,
|
|
14
|
+
* registerHistoryEntryComponent,
|
|
15
|
+
* SharedModule,
|
|
16
|
+
* TimelineDisplayType,
|
|
17
|
+
* TimelineHistoryEntry,
|
|
18
|
+
* } from '\@vendure/admin-ui/core';
|
|
19
|
+
*
|
|
20
|
+
* \@Component({
|
|
21
|
+
* selector: 'tax-id-verification-component',
|
|
22
|
+
* template: `
|
|
23
|
+
* <div *ngIf="entry.data.valid">
|
|
24
|
+
* Tax ID <strong>{{ entry.data.taxId }}</strong> was verified
|
|
25
|
+
* <vdr-history-entry-detail *ngIf="entry.data">
|
|
26
|
+
* <vdr-object-tree [value]="entry.data"></vdr-object-tree>
|
|
27
|
+
* </vdr-history-entry-detail>
|
|
28
|
+
* </div>
|
|
29
|
+
* <div *ngIf="entry.data.valid">Tax ID {{ entry.data.taxId }} could not be verified</div>
|
|
30
|
+
* `,
|
|
31
|
+
* standalone: true,
|
|
32
|
+
* imports: [SharedModule],
|
|
33
|
+
* })
|
|
34
|
+
* class TaxIdHistoryEntryComponent implements CustomerHistoryEntryComponent {
|
|
35
|
+
* entry: TimelineHistoryEntry;
|
|
36
|
+
* customer: CustomerFragment;
|
|
37
|
+
*
|
|
38
|
+
* getDisplayType(entry: TimelineHistoryEntry): TimelineDisplayType {
|
|
39
|
+
* return entry.data.valid ? 'success' : 'error';
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* getName(entry: TimelineHistoryEntry): string {
|
|
43
|
+
* return 'Tax ID Verification Plugin';
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* isFeatured(entry: TimelineHistoryEntry): boolean {
|
|
47
|
+
* return true;
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* getIconShape(entry: TimelineHistoryEntry) {
|
|
51
|
+
* return entry.data.valid ? 'check-circle' : 'exclamation-circle';
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
*
|
|
55
|
+
* export default [
|
|
56
|
+
* registerHistoryEntryComponent({
|
|
57
|
+
* type: 'CUSTOMER_TAX_ID_VERIFICATION',
|
|
58
|
+
* component: TaxIdHistoryEntryComponent,
|
|
59
|
+
* }),
|
|
60
|
+
* ];
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
8
63
|
* @since 1.9.0
|
|
9
64
|
* @docsCategory custom-history-entry-components
|
|
10
65
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Provider } from '@angular/core';
|
|
2
|
+
import { PageTabConfig } from '../providers/page/page.service';
|
|
3
|
+
/**
|
|
4
|
+
* @description
|
|
5
|
+
* Add a tab to an existing list or detail page.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts title="providers.ts"
|
|
9
|
+
* import { registerPageTab } from '@vendure/admin-ui/core';
|
|
10
|
+
* import { DeletedProductListComponent } from './components/deleted-product-list/deleted-product-list.component';
|
|
11
|
+
*
|
|
12
|
+
* export default [
|
|
13
|
+
* registerPageTab({
|
|
14
|
+
* location: 'product-list',
|
|
15
|
+
* tab: 'Deleted Products',
|
|
16
|
+
* route: 'deleted',
|
|
17
|
+
* component: DeletedProductListComponent,
|
|
18
|
+
* }),
|
|
19
|
+
* ];
|
|
20
|
+
* ```
|
|
21
|
+
* @docsCategory tabs
|
|
22
|
+
*/
|
|
23
|
+
export declare function registerPageTab(config: PageTabConfig): Provider;
|
|
@@ -5,7 +5,13 @@ import { DocumentNode } from 'graphql';
|
|
|
5
5
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
6
6
|
import { BaseDetailComponent } from '../common/base-detail.component';
|
|
7
7
|
import { BreadcrumbValue } from '../providers/breadcrumb/breadcrumb.service';
|
|
8
|
-
import {
|
|
8
|
+
import { AngularRouteComponent } from './components/angular-route.component';
|
|
9
|
+
/**
|
|
10
|
+
* @description
|
|
11
|
+
* Configuration for a route component.
|
|
12
|
+
*
|
|
13
|
+
* @docsCategory routes
|
|
14
|
+
*/
|
|
9
15
|
export type RegisterRouteComponentOptions<Component extends any | BaseDetailComponent<Entity>, Entity extends {
|
|
10
16
|
id: string;
|
|
11
17
|
updatedAt?: string;
|
|
@@ -24,6 +30,46 @@ export type RegisterRouteComponentOptions<Component extends any | BaseDetailComp
|
|
|
24
30
|
} & (Component extends BaseDetailComponent<Entity> ? {
|
|
25
31
|
entityKey: R;
|
|
26
32
|
} : unknown);
|
|
33
|
+
/**
|
|
34
|
+
* @description
|
|
35
|
+
* Registers an Angular standalone component to be rendered in a route.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts title="routes.ts"
|
|
39
|
+
* import { registerRouteComponent } from '\@vendure/admin-ui/core';
|
|
40
|
+
* import { registerReactRouteComponent } from '\@vendure/admin-ui/react';
|
|
41
|
+
*
|
|
42
|
+
* import { ProductReviewDetailComponent } from './components/product-review-detail/product-review-detail.component';
|
|
43
|
+
* import { AllProductReviewsList } from './components/all-product-reviews-list/all-product-reviews-list.component';
|
|
44
|
+
* import { GetReviewDetailDocument } from './generated-types';
|
|
45
|
+
*
|
|
46
|
+
* export default [
|
|
47
|
+
* registerRouteComponent({
|
|
48
|
+
* path: '',
|
|
49
|
+
* component: AllProductReviewsList,
|
|
50
|
+
* breadcrumb: 'Product reviews',
|
|
51
|
+
* }),
|
|
52
|
+
* registerRouteComponent({
|
|
53
|
+
* path: ':id',
|
|
54
|
+
* component: ProductReviewDetailComponent,
|
|
55
|
+
* query: GetReviewDetailDocument,
|
|
56
|
+
* entityKey: 'productReview',
|
|
57
|
+
* getBreadcrumbs: entity => [
|
|
58
|
+
* {
|
|
59
|
+
* label: 'Product reviews',
|
|
60
|
+
* link: ['/extensions', 'product-reviews'],
|
|
61
|
+
* },
|
|
62
|
+
* {
|
|
63
|
+
* label: `#${entity?.id} (${entity?.product.name})`,
|
|
64
|
+
* link: [],
|
|
65
|
+
* },
|
|
66
|
+
* ],
|
|
67
|
+
* }),
|
|
68
|
+
* ];
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @docsCategory routes
|
|
72
|
+
*/
|
|
27
73
|
export declare function registerRouteComponent<Component extends any | BaseDetailComponent<Entity>, Entity extends {
|
|
28
74
|
id: string;
|
|
29
75
|
updatedAt?: string;
|
|
@@ -39,10 +85,10 @@ export declare function registerRouteComponent<Component extends any | BaseDetai
|
|
|
39
85
|
data: {
|
|
40
86
|
breadcrumb: BehaviorSubject<BreadcrumbValue> | ((data: any) => any);
|
|
41
87
|
};
|
|
42
|
-
component: typeof
|
|
88
|
+
component: typeof AngularRouteComponent;
|
|
43
89
|
title?: string | Type<import("@angular/router").Resolve<string>> | ResolveFn<string> | undefined;
|
|
44
90
|
path: string;
|
|
45
|
-
pathMatch?: "
|
|
91
|
+
pathMatch?: "prefix" | "full" | undefined;
|
|
46
92
|
matcher?: import("@angular/router").UrlMatcher | undefined;
|
|
47
93
|
loadComponent?: (() => Type<unknown> | Observable<Type<unknown> | import("@angular/router").DefaultExport<Type<unknown>>> | Promise<Type<unknown> | import("@angular/router").DefaultExport<Type<unknown>>>) | undefined;
|
|
48
94
|
redirectTo?: string | undefined;
|
|
@@ -111,7 +111,7 @@ export interface BulkAction<ItemType = any, ComponentType = any> {
|
|
|
111
111
|
* running here.
|
|
112
112
|
*
|
|
113
113
|
* @example
|
|
114
|
-
* ```
|
|
114
|
+
* ```ts
|
|
115
115
|
* import { registerBulkAction, DataService } from '\@vendure/admin-ui/core';
|
|
116
116
|
*
|
|
117
117
|
* registerBulkAction({
|
|
@@ -132,7 +132,7 @@ export interface BulkAction<ItemType = any, ComponentType = any> {
|
|
|
132
132
|
* Control the display of this item based on the user permissions.
|
|
133
133
|
*
|
|
134
134
|
* @example
|
|
135
|
-
* ```
|
|
135
|
+
* ```ts
|
|
136
136
|
* registerBulkAction({
|
|
137
137
|
* // Can be specified as a simple string
|
|
138
138
|
* requiresPermission: Permission.UpdateProduct,
|
|
@@ -8,7 +8,7 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
* This service is responsible for instantiating a ModalDialog component and
|
|
9
9
|
* embedding the specified component within.
|
|
10
10
|
*
|
|
11
|
-
* @docsCategory
|
|
11
|
+
* @docsCategory services
|
|
12
12
|
* @docsPage ModalService
|
|
13
13
|
* @docsWeight 0
|
|
14
14
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Any component intended to be used with the ModalService.fromComponent() method must implement
|
|
4
4
|
* this interface.
|
|
5
5
|
*
|
|
6
|
-
* @docsCategory
|
|
6
|
+
* @docsCategory services
|
|
7
7
|
* @docsPage ModalService
|
|
8
8
|
*/
|
|
9
9
|
export interface Dialog<R = any> {
|
|
@@ -25,7 +25,7 @@ export interface DialogButtonConfig<T> {
|
|
|
25
25
|
* @description
|
|
26
26
|
* Configures a generic modal dialog.
|
|
27
27
|
*
|
|
28
|
-
* @docsCategory
|
|
28
|
+
* @docsCategory services
|
|
29
29
|
* @docsPage ModalService
|
|
30
30
|
*/
|
|
31
31
|
export interface DialogConfig<T> {
|
|
@@ -41,7 +41,7 @@ export interface DialogConfig<T> {
|
|
|
41
41
|
* @description
|
|
42
42
|
* Options to configure the behaviour of the modal.
|
|
43
43
|
*
|
|
44
|
-
* @docsCategory
|
|
44
|
+
* @docsCategory services
|
|
45
45
|
* @docsPage ModalService
|
|
46
46
|
*/
|
|
47
47
|
export interface ModalOptions<T> {
|