@WidgetComponent
File
Implements
Metadata
selector |
nm-worklistexportpopup |
templateUrl |
./worklistexportpopup.component.html |
Index
Widget inputs
|
|
|
Widget outputs
|
|
|
Properties
|
|
Methods
|
|
Constructor
constructor(_exportService: WorklistexportService, _halService: HalService, _notificationService: NotificationsService, _appdataStore: AppdataStore, dialog: MatDialog, dialogRef: MatDialogRef, data: any)
|
|
|
Methods
Protected
configureWidget
|
configureWidget(configuration: WidgetConfig)
|
Decorators : WidgetConfigure
|
|
|
ngOnDestroy
|
ngOnDestroy()
|
|
|
Public
data
|
data: any
|
Type : any
|
Decorators : Inject
|
|
Public
dialog
|
dialog: MatDialog
|
Type : MatDialog
|
|
Public
formActionName
|
formActionName:
|
|
Public
href
|
href: Subject<String>
|
Type : Subject<String>
|
Default value : new ReplaySubject<String>(1)
|
|
Private
inputChannel
|
inputChannel: Subject<any>
|
Type : Subject<any>
|
Default value : new Subject<any>()
|
Decorators : WidgetInput
|
|
Private
reset
|
reset: Subject<any>
|
Type : Subject<any>
|
Decorators : WidgetOutput
|
|
Private
unsubscribe
|
unsubscribe:
|
Default value : NgUnsubscribe.create()
|
|
import { Component, OnDestroy, Input, Inject } from "@angular/core";
import { Subject, ReplaySubject, Observable } from "rxjs";
import { WorklistexportService } from "./worklistexport.service";
import { AppdataStore } from "../../../components/appdata/appdata.store";
import { HalService } from "../../../components/hal/hal.service";
import { FormGroup } from "@angular/forms";
import { WidgetConfig } from "../../widget.configuration";
import {
WidgetComponent,
WidgetId,
WidgetConfiguration,
WidgetConfigure,
WidgetInput,
WidgetOutput,
} from "../../widget.metadata";
import { NgUnsubscribe } from "../../../ng-unsubscribe";
import { NotificationsService } from "../../../components/notifications/services/notifications.service";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
@WidgetComponent("nm-worklistexportpopup")
@Component({
selector: "nm-worklistexportpopup",
templateUrl: "./worklistexportpopup.component.html",
})
export class WorklistexportComponentPopup implements OnDestroy {
@Input("visible") visible: boolean;
@Input("cartId") cartId: string = "";
@Input("formHref") formHref: string = "";
@WidgetConfiguration()
private configuration: WidgetConfig;
@WidgetOutput("reset")
private reset: Subject<any>;
@WidgetInput("messages-output")
private inputChannel: Subject<any> = new Subject<any>();
@WidgetId()
private _id: string;
public href: Subject<String> = new ReplaySubject<String>(1);
public formGroup: FormGroup;
public action;
public formActionName;
private unsubscribe = NgUnsubscribe.create();
constructor(
private _exportService: WorklistexportService,
private _halService: HalService,
private _notificationService: NotificationsService,
private _appdataStore: AppdataStore,
public dialog: MatDialog,
public dialogRef: MatDialogRef<WorklistexportComponentPopup>,
@Inject(MAT_DIALOG_DATA) public data: any
) {
this.formGroup = new FormGroup({});
this.action = this.data.action;
window.setTimeout(() => {
this.formGroup.patchValue({ productNumbers: this.data.productNumbers });
}, 1000);
}
@WidgetConfigure()
protected configureWidget(configuration: WidgetConfig) {}
ngOnDestroy(): void {
this.unsubscribe.destroy();
}
}
<nm-dialog [dialogRef]="dialogRef" class="nm-dialog nm-confirmation-dialog">
<ng-container slot="title">
{{ "worklist-export-title" | translate }}
</ng-container>
<ng-container slot="content">
<form>
<br />
<nm-form [action]="action" [form]="formGroup"></nm-form>
</form>
</ng-container>
<ng-container slot="actions">
<button type="button" mat-button (click)="dialogRef.close(false)">
{{ "button.cancel" | translate }}
</button>
<button
mat-raised-button
type="button"
color="primary"
(click)="dialogRef.close(true)"
[nm-action]="action"
[disabled]="!formGroup.valid"
action-name="createWorklist"
[action-payload]="formGroup.valueChanges | async"
>
{{ "worklist-export-save" | translate }}
</button>
</ng-container>
</nm-dialog>
Legend
Html element with directive