// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to
//  deal in the Software without restriction, including without limitation the
//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//  sell copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewEncapsulation, } from "@angular/core";
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
export class QuickPickerComponent {
    get presetKeys() {
        return this.presetKeysOrder || Object.keys(this.presets);
    }
    constructor(changeDetector) {
        this.changeDetector = changeDetector;
        this.presetsTitle = $localize `Quick picks`;
        /** callback to invoke on selecting specific preset */
        this.presetSelected = new EventEmitter();
    }
    selectPreset(key) {
        this.presetSelected.emit(key);
    }
    isPresetSelected(key) {
        return this.selectedPreset === key;
    }
}
QuickPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: QuickPickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
QuickPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: QuickPickerComponent, selector: "nui-quick-picker", inputs: { presets: "presets", pickerTitle: "pickerTitle", presetsTitle: "presetsTitle", selectedPreset: "selectedPreset", presetKeysOrder: "presetKeysOrder" }, outputs: { presetSelected: "presetSelected" }, ngImport: i0, template: "<div class=\"nui-quick-picker\">\n    <div class=\"nui-quick-picker__presets\">\n        <h4 class=\"nui-quick-picker-header nui-quick-picker__presets-header\">\n            {{ presetsTitle }}\n        </h4>\n        <div\n            *ngFor=\"let key of presetKeys\"\n            (click)=\"selectPreset(key)\"\n            [ngClass]=\"{\n                'nui-quick-picker__preset--selected': isPresetSelected(key)\n            }\"\n            class=\"nui-quick-picker__preset\"\n        >\n            {{ presets[key].name }}\n        </div>\n    </div>\n    <div class=\"nui-quick-picker__divider\"></div>\n    <div class=\"nui-quick-picker__picker\">\n        <h4 class=\"nui-quick-picker-header nui-quick-picker__picker-header\">\n            {{ pickerTitle }}\n        </h4>\n        <ng-content></ng-content>\n    </div>\n</div>\n", styles: [".nui-quick-picker{display:flex;flex-wrap:nowrap;padding:5px}.nui-quick-picker-header{margin:0}.nui-quick-picker-header:hover{cursor:default}.nui-quick-picker__presets-header{padding:8px 10px}.nui-quick-picker__preset{display:list-item;list-style-type:none;white-space:nowrap;margin-bottom:1px;font-size:13px;padding:5px 10px;cursor:pointer;color:var(--nui-color-text-default,#111)}.nui-quick-picker__preset:hover{color:var(--nui-color-text-default-hover,#000000);background-color:var(--nui-color-bg-light-hover,#f2f2f2)}.nui-quick-picker__preset--selected{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1));font-weight:600}.nui-quick-picker__preset--selected:hover{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2))}.nui-quick-picker__preset:not(.nui-quick-picker__preset--selected){color:var(--nui-color-text-link,#0079aa)}.nui-quick-picker__preset:hover{color:var(--nui-color-text-default-hover,#000000)}.nui-quick-picker__presets{min-width:125px;background-color:var(--nui-color-bg-secondary,#fafafa);padding:5px 0}.nui-quick-picker__divider{background-color:var(--nui-color-line-default,#d9d9d9);width:1px}.nui-quick-picker__picker{min-width:155px;padding:5px 10px;flex-grow:1}.nui-quick-picker__picker-header{padding:8px 0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: QuickPickerComponent, decorators: [{
            type: Component,
            args: [{ selector: "nui-quick-picker", encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"nui-quick-picker\">\n    <div class=\"nui-quick-picker__presets\">\n        <h4 class=\"nui-quick-picker-header nui-quick-picker__presets-header\">\n            {{ presetsTitle }}\n        </h4>\n        <div\n            *ngFor=\"let key of presetKeys\"\n            (click)=\"selectPreset(key)\"\n            [ngClass]=\"{\n                'nui-quick-picker__preset--selected': isPresetSelected(key)\n            }\"\n            class=\"nui-quick-picker__preset\"\n        >\n            {{ presets[key].name }}\n        </div>\n    </div>\n    <div class=\"nui-quick-picker__divider\"></div>\n    <div class=\"nui-quick-picker__picker\">\n        <h4 class=\"nui-quick-picker-header nui-quick-picker__picker-header\">\n            {{ pickerTitle }}\n        </h4>\n        <ng-content></ng-content>\n    </div>\n</div>\n", styles: [".nui-quick-picker{display:flex;flex-wrap:nowrap;padding:5px}.nui-quick-picker-header{margin:0}.nui-quick-picker-header:hover{cursor:default}.nui-quick-picker__presets-header{padding:8px 10px}.nui-quick-picker__preset{display:list-item;list-style-type:none;white-space:nowrap;margin-bottom:1px;font-size:13px;padding:5px 10px;cursor:pointer;color:var(--nui-color-text-default,#111)}.nui-quick-picker__preset:hover{color:var(--nui-color-text-default-hover,#000000);background-color:var(--nui-color-bg-light-hover,#f2f2f2)}.nui-quick-picker__preset--selected{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1));font-weight:600}.nui-quick-picker__preset--selected:hover{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2))}.nui-quick-picker__preset:not(.nui-quick-picker__preset--selected){color:var(--nui-color-text-link,#0079aa)}.nui-quick-picker__preset:hover{color:var(--nui-color-text-default-hover,#000000)}.nui-quick-picker__presets{min-width:125px;background-color:var(--nui-color-bg-secondary,#fafafa);padding:5px 0}.nui-quick-picker__divider{background-color:var(--nui-color-line-default,#d9d9d9);width:1px}.nui-quick-picker__picker{min-width:155px;padding:5px 10px;flex-grow:1}.nui-quick-picker__picker-header{padding:8px 0}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { presets: [{
                type: Input
            }], pickerTitle: [{
                type: Input
            }], presetsTitle: [{
                type: Input
            }], selectedPreset: [{
                type: Input
            }], presetKeysOrder: [{
                type: Input
            }], presetSelected: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 