@netgrif/components
Version:
Netgrif Application Engine frontend Angular components
40 lines • 16 kB
JavaScript
import { Component, Inject } from '@angular/core';
import { AbstractUserAssignComponent, NAE_SIDE_MENU_CONTROL, UserListService, ImpersonationUserListService } from '@netgrif/components-core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ngbracket/ngx-layout";
import * as i3 from "@angular/material/button";
import * as i4 from "@angular/material/icon";
import * as i5 from "@angular/material/input";
import * as i6 from "@angular/material/form-field";
import * as i7 from "@angular/material/toolbar";
import * as i8 from "@angular/forms";
import * as i9 from "./admin-impersonate-list/admin-impersonate-list.component";
import * as i10 from "@ngx-translate/core";
import * as i11 from "@netgrif/components-core";
/**
* @deprecated
* Is the main - parent component of the entire user assignment in the side menu.
*
* Holds logic link of the [AdminImpersonateListComponent]{@link AdminImpersonateListComponent}
* along with searching, selecting, and then assigning to the user field.
*/
export class AdminImpersonateComponent extends AbstractUserAssignComponent {
constructor(sideMenuControl) {
super(sideMenuControl);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AdminImpersonateComponent, deps: [{ token: NAE_SIDE_MENU_CONTROL }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AdminImpersonateComponent, selector: "nc-admin-impersonate", providers: [{
provide: UserListService, useClass: ImpersonationUserListService
}], usesInheritance: true, ngImport: i0, template: "<div class=\"full-width full-height\" fxLayout=\"column\" fxLayoutAlign=\"start stretch\">\n <mat-toolbar color=\"primary\">{{ 'side-menu.impersonation.title' | translate | uppercase }}</mat-toolbar>\n <div class=\"user-assign-container side-menu-root\" fxLayout=\"column\" fxFlex>\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" class=\"netgrif-input netgrif-input-fix\">\n <mat-icon fxFlex class=\"search-icon\">search</mat-icon>\n <mat-form-field fxFlex=\"100\" class=\"user-assign-search\" color=\"primary\" appearance=\"outline\">\n <input matInput placeholder=\"{{ 'side-menu.user.choose' | translate }}\"\n [formControl]=\"searchUserControl\">\n <button mat-button *ngIf=\"searchUserControl.value\" matSuffix mat-icon-button\n (click)=\"searchUserControl.setValue('')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n\n <nc-admin-impersonate-list fxFlex\n [searchUserControl]=\"searchUserControl\"\n [roles]=\"roles\"\n [negativeRoles]=\"negativeRoles\"\n [initiallySelectedUser]=\"initiallySelectedUser\"\n (userSelected)=\"userWasSelected($event)\">\n </nc-admin-impersonate-list>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-raised-button color=\"primary\"\n (click)=\"assign()\">{{ 'side-menu.impersonation.submit' | translate | uppercase }}</button>\n </div>\n </div>\n</div>\n", styles: [".full-height{height:100%;min-height:100%}.full-width{width:100%;min-width:100%}.padding-default{padding:8px}.padding-half{padding:4px}.padding-x2{padding:16px}.margin-default{margin:8px}.margin-half{margin:4px}.margin-x2{margin:16px}.margin-top-default{margin-top:8px}.margin-top-half{margin-top:4px}.margin-top-x2{margin-top:16px}.margin-bottom-default{margin-bottom:8px}.margin-bottom-half{margin-bottom:4px}.margin-bottom-x2{margin-bottom:16px}.margin-left-default{margin-left:8px}.margin-left-half{margin-left:4px}.margin-left-x2{margin-left:16px}.margin-right-default{margin-right:8px}.margin-right-half{margin-right:4px}.margin-right-x2{margin-right:16px}.user-assign-container{padding:16px;position:relative}.user-assign-search{width:100%}.search-icon{margin-right:10px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i7.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i9.AdminImpersonateListComponent, selector: "nc-admin-impersonate-list" }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i10.TranslatePipe, name: "translate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AdminImpersonateComponent, decorators: [{
type: Component,
args: [{ selector: 'nc-admin-impersonate', providers: [{
provide: UserListService, useClass: ImpersonationUserListService
}], template: "<div class=\"full-width full-height\" fxLayout=\"column\" fxLayoutAlign=\"start stretch\">\n <mat-toolbar color=\"primary\">{{ 'side-menu.impersonation.title' | translate | uppercase }}</mat-toolbar>\n <div class=\"user-assign-container side-menu-root\" fxLayout=\"column\" fxFlex>\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" class=\"netgrif-input netgrif-input-fix\">\n <mat-icon fxFlex class=\"search-icon\">search</mat-icon>\n <mat-form-field fxFlex=\"100\" class=\"user-assign-search\" color=\"primary\" appearance=\"outline\">\n <input matInput placeholder=\"{{ 'side-menu.user.choose' | translate }}\"\n [formControl]=\"searchUserControl\">\n <button mat-button *ngIf=\"searchUserControl.value\" matSuffix mat-icon-button\n (click)=\"searchUserControl.setValue('')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n\n <nc-admin-impersonate-list fxFlex\n [searchUserControl]=\"searchUserControl\"\n [roles]=\"roles\"\n [negativeRoles]=\"negativeRoles\"\n [initiallySelectedUser]=\"initiallySelectedUser\"\n (userSelected)=\"userWasSelected($event)\">\n </nc-admin-impersonate-list>\n\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\">\n <button mat-raised-button color=\"primary\"\n (click)=\"assign()\">{{ 'side-menu.impersonation.submit' | translate | uppercase }}</button>\n </div>\n </div>\n</div>\n", styles: [".full-height{height:100%;min-height:100%}.full-width{width:100%;min-width:100%}.padding-default{padding:8px}.padding-half{padding:4px}.padding-x2{padding:16px}.margin-default{margin:8px}.margin-half{margin:4px}.margin-x2{margin:16px}.margin-top-default{margin-top:8px}.margin-top-half{margin-top:4px}.margin-top-x2{margin-top:16px}.margin-bottom-default{margin-bottom:8px}.margin-bottom-half{margin-bottom:4px}.margin-bottom-x2{margin-bottom:16px}.margin-left-default{margin-left:8px}.margin-left-half{margin-left:4px}.margin-left-x2{margin-left:16px}.margin-right-default{margin-right:8px}.margin-right-half{margin-right:4px}.margin-right-x2{margin-right:16px}.user-assign-container{padding:16px;position:relative}.user-assign-search{width:100%}.search-icon{margin-right:10px}\n"] }]
}], ctorParameters: () => [{ type: i11.SideMenuControl, decorators: [{
type: Inject,
args: [NAE_SIDE_MENU_CONTROL]
}] }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRtaW4taW1wZXJzb25hdGUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmV0Z3JpZi1jb21wb25lbnRzL3NyYy9saWIvc2lkZS1tZW51L2NvbnRlbnQtY29tcG9uZW50cy9hZG1pbi1pbXBlcnNvbmF0ZS9hZG1pbi1pbXBlcnNvbmF0ZS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZXRncmlmLWNvbXBvbmVudHMvc3JjL2xpYi9zaWRlLW1lbnUvY29udGVudC1jb21wb25lbnRzL2FkbWluLWltcGVyc29uYXRlL2FkbWluLWltcGVyc29uYXRlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ2hELE9BQU8sRUFBQywyQkFBMkIsRUFBRSxxQkFBcUIsRUFBbUIsZUFBZSxFQUFFLDRCQUE0QixFQUFDLE1BQU0sMEJBQTBCLENBQUM7Ozs7Ozs7Ozs7Ozs7QUFFNUo7Ozs7OztHQU1HO0FBU0gsTUFBTSxPQUFPLHlCQUEwQixTQUFRLDJCQUEyQjtJQUN0RSxZQUEyQyxlQUFnQztRQUN2RSxLQUFLLENBQUMsZUFBZSxDQUFDLENBQUM7SUFDM0IsQ0FBQzt3R0FIUSx5QkFBeUIsa0JBQ2QscUJBQXFCOzRGQURoQyx5QkFBeUIsK0NBSnZCLENBQUM7Z0JBQ1IsT0FBTyxFQUFFLGVBQWUsRUFBRSxRQUFRLE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ZWxkIGZ4RmxleD1cIjEwMFwiIGNsYXNzPVwidXNlci1hc3NpZ24tc2VhcmNoXCIgY29sb3I9XCJwcmltYXJ5XCIgYXBwZWFyYW5jZT1cIm91dGxpbmVcIj5cbiAgICAgICAgICAgICAgICA8aW5wdXQgbWF0SW5wdXQgcGxhY2Vob2xkZXI9XCJ7eyAnc2lkZS1tZW51LnVzZXIuY2hvb3NlJyB8IHRyYW5zbGF0ZSB9fVwiXG4gICAgICAgICAgICAgICAgICAgICAgIFtmb3JtQ29udHJvbF09XCJzZWFyY2hVc2VyQ29udHJvbFwiPlxuICAgICAgICAgICAgICAgIDxidXR0b24gbWF0LWJ1dHRvbiAqbmdJZj1cInNlYXJjaFVzZXJDb250cm9sLnZhbHVlXCIgbWF0U3VmZml4IG1hdC1pY29uLWJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgKGNsaWNrKT1cInNlYXJjaFVzZXJDb250cm9sLnNldFZhbHVlKCcnKVwiPlxuICAgICAgICAgICAgICAgICAgICA8bWF0LWljb24+Y2xvc2U8L21hdC1pY29uPlxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgPC9tYXQtZm9ybS1maWVsZD5cbiAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgPG5jLWFkbWluLWltcGVyc29uYXRlLWxpc3QgZnhGbGV4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtzZWFyY2hVc2VyQ29udHJvbF09XCJzZWFyY2hVc2VyQ29udHJvbFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtyb2xlc109XCJyb2xlc1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtuZWdhdGl2ZVJvbGVzXT1cIm5lZ2F0aXZlUm9sZXNcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbaW5pdGlhbGx5U2VsZWN0ZWRVc2VyXT1cImluaXRpYWxseVNlbGVjdGVkVXNlclwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1c2VyU2VsZWN0ZWQpPVwidXNlcldhc1NlbGVjdGVkKCRldmVudClcIj5cbiAgICAgICAgPC9uYy1hZG1pbi1pbXBlcnNvbmF0ZS1saXN0PlxuXG4gICAgICAgIDxkaXYgZnhMYXlvdXQ9XCJyb3dcIiBmeExheW91dEFsaWduPVwiZW5kIGNlbnRlclwiPlxuICAgICAgICAgICAgPGJ1dHRvbiBtYXQtcmFpc2VkLWJ1dHRvbiBjb2xvcj1cInByaW1hcnlcIlxuICAgICAgICAgICAgICAgICAgICAoY2xpY2spPVwiYXNzaWduKClcIj57eyAnc2lkZS1tZW51LmltcGVyc29uYXRpb24uc3VibWl0JyB8IHRyYW5zbGF0ZSB8IHVwcGVyY2FzZSB9fTwvYnV0dG9uPlxuICAgICAgICA8L2Rpdj5cbiAgICA8L2Rpdj5cbjwvZGl2PlxuIl19