UNPKG

3.34 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var core_1 = require("@angular/core");
4var forms_1 = require("@angular/forms");
5var infra_1 = require("@soushians/infra");
6var ProfileEditComponent = /** @class */ (function () {
7 function ProfileEditComponent(utilityService) {
8 this.utilityService = utilityService;
9 this.submited = new core_1.EventEmitter();
10 }
11 ProfileEditComponent.prototype.ngOnInit = function () { };
12 ProfileEditComponent.prototype.editProfile = function () {
13 if (!this.formGroup.valid)
14 return;
15 this.submited.emit(this.formGroup.value);
16 };
17 ProfileEditComponent.decorators = [
18 { type: core_1.Component, args: [{
19 selector: 'profile-edit',
20 template: "<div fxFlex=\"450px\"> <form [formGroup]=\"formGroup\" (ngSubmit)=\"editProfile()\" fxLayout=\"column\"> <mat-card> <mat-card-content> <mat-form-field fxFlexFill> <input type=\"text\" matInput placeholder=\"\u067E\u0633\u062A \u0627\u0644\u06A9\u062A\u0631\u0648\u0646\u06CC\u06A9\u06CC\" formControlName=\"Email\"> </mat-form-field> <mat-form-field> <mat-select placeholder=\"Roles\" formControlName=\"Roles\" multiple> <mat-select-trigger> {{formGroup.controls.Roles.value ? formGroup.controls.Roles.value[0] : ''}} <span *ngIf=\"formGroup.controls.Roles.value?.length > 1\"> (+{{formGroup.controls.Roles.value.length - 1}} others) </span> </mat-select-trigger> <mat-option *ngFor=\"let item of roles\" [value]=\"item\">{{item}}</mat-option> </mat-select> </mat-form-field> <mat-form-field> <mat-select placeholder=\"Groups\" formControlName=\"Groups\" multiple> <mat-select-trigger> {{formGroup.controls.Groups.value ? formGroup.controls.Groups.value[0] : ''}} <span *ngIf=\"formGroup.controls.Groups.value?.length > 1\"> (+{{formGroup.controls.Groups.value.length - 1}} others) </span> </mat-select-trigger> <mat-option *ngFor=\"let item of groups\" [value]=\"item\">{{item}}</mat-option> </mat-select> </mat-form-field> </mat-card-content> <mat-card-actions fxLayoutAlign=\"center center\"> <button fxFlex=\"nogrow\" type=\"submit\" mat-raised-button color=\"primary\">\u0648\u06CC\u0631\u0627\u06CC\u0634</button> <button fxFlex=\"nogrow\" type=\"button\" routerLink=\"/user/panel/profile\" mat-raised-button>\u0628\u0627\u0632\u06AF\u0634\u062A</button> </mat-card-actions> </mat-card> </form> </div>"
21 },] },
22 ];
23 /** @nocollapse */
24 ProfileEditComponent.ctorParameters = function () { return [
25 { type: infra_1.UtilityService, },
26 ]; };
27 ProfileEditComponent.propDecorators = {
28 "submited": [{ type: core_1.Output },],
29 "formGroup": [{ type: core_1.Input },],
30 "roles": [{ type: core_1.Input },],
31 "groups": [{ type: core_1.Input },],
32 };
33 return ProfileEditComponent;
34}());
35exports.ProfileEditComponent = ProfileEditComponent;
36//# sourceMappingURL=profile-edit.component.js.map
\No newline at end of file