/*!
 * Copyright 2021 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "@clr/angular";
/**
 * A grid column renderer that shows a rights dropdown to select rights for an entity.
 * If `shouldShowDropdown` is false, displays the current right as simple text.
 */
export class RightsDropdownRendererComponent {
}
/** @nocollapse */ RightsDropdownRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RightsDropdownRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ RightsDropdownRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.4", type: RightsDropdownRendererComponent, selector: "vcd-rights-dropdown-renderer", inputs: { config: "config" }, ngImport: i0, template: `
        <div *ngIf="!config.shouldShowDropdown; else notOwner" class="cell-content">Owner</div>
        <ng-template #notOwner>
            <select
                clrSelect
                name="options"
                [ngModel]="config.entity.accessRight.value"
                (ngModelChange)="config.rightsChangedCallback(config.entity, $event)"
                class="cell-content"
            >
                <option *ngFor="let option of config.rightsOptions" value="{{ option.value }}">
                    {{ option.display }}
                </option>
            </select>
        </ng-template>
    `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ClrSelect, selector: "[clrSelect]" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: RightsDropdownRendererComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'vcd-rights-dropdown-renderer',
                    template: `
        <div *ngIf="!config.shouldShowDropdown; else notOwner" class="cell-content">Owner</div>
        <ng-template #notOwner>
            <select
                clrSelect
                name="options"
                [ngModel]="config.entity.accessRight.value"
                (ngModelChange)="config.rightsChangedCallback(config.entity, $event)"
                class="cell-content"
            >
                <option *ngFor="let option of config.rightsOptions" value="{{ option.value }}">
                    {{ option.display }}
                </option>
            </select>
        </ng-template>
    `,
                }]
        }], propDecorators: { config: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmlnaHRzLWRyb3Bkb3duLXJlbmRlcmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29tcG9uZW50cy9zcmMvc2hhcmluZy1tb2RhbC9yZW5kZXJlcnMvcmlnaHRzLWRyb3Bkb3duLXJlbmRlcmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVILE9BQU8sRUFBRSxTQUFTLEVBQWdCLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQzs7Ozs7QUFZL0Q7OztHQUdHO0FBb0JILE1BQU0sT0FBTywrQkFBK0I7OytJQUEvQiwrQkFBK0I7bUlBQS9CLCtCQUErQixrR0FqQjlCOzs7Ozs7Ozs7Ozs7Ozs7S0FlVDsyRkFFUSwrQkFBK0I7a0JBbkIzQyxTQUFTO21CQUFDO29CQUNQLFF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