/*
 * Copyright 2015-2024 Ritense BV, the Netherlands.
 *
 * Licensed under EUPL, Version 1.2 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../searchable-dropdown/searchable-dropdown.component";
export class SearchableDropdownSelectComponent {
    constructor() {
        this.width = 250;
        this.hasPermission = true;
        this.showClearSelection = true;
        this.itemSelected = new EventEmitter();
        this.clearSelection = new EventEmitter();
    }
    onSelect(id) {
        this.itemSelected.emit(id);
    }
    onClearSelection() {
        this.clearSelection.emit();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchableDropdownSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: { style: "style", items: "items", buttonText: "buttonText", searchText: "searchText", noResultsText: "noResultsText", disabled: "disabled", selectedText: "selectedText", selectedTextValue: "selectedTextValue", clearSelectionButtonTitle: "clearSelectionButtonTitle", hasSelection: "hasSelection", width: "width", hasPermission: "hasPermission", showClearSelection: "showClearSelection" }, outputs: { itemSelected: "itemSelected", clearSelection: "clearSelection" }, ngImport: i0, template: "<!--\n  ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n  ~\n  ~ Licensed under EUPL, Version 1.2 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" basis,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<ng-container *ngIf=\"!hasSelection; else selection\">\n  <valtimo-searchable-dropdown\n    *ngIf=\"hasPermission\"\n    [buttonText]=\"buttonText\"\n    [disabled]=\"disabled\"\n    [items]=\"items\"\n    [noResultsText]=\"noResultsText\"\n    [searchText]=\"searchText\"\n    [style]=\"style\"\n    [width]=\"width\"\n    (itemSelected)=\"onSelect($event)\"\n  >\n  </valtimo-searchable-dropdown>\n</ng-container>\n\n<ng-template #selection>\n  <div\n    class=\"d-flex flex-row align-items-center\"\n    [style.height.px]=\"style === 'button' ? 34 : null\"\n  >\n    <h5 class=\"selected-text\">\n      {{ selectedText }} <b>{{ selectedTextValue }}</b>\n    </h5>\n    <button\n      *ngIf=\"hasPermission && showClearSelection\"\n      [title]=\"clearSelectionButtonTitle\"\n      (click)=\"onClearSelection()\"\n      aria-label=\"Close\"\n      class=\"close p-0 m-0 ml-2 text-danger\"\n      type=\"button\"\n    >\n      <i class=\"clear-icon mdi mdi-close text-danger\"></i>\n    </button>\n  </div>\n</ng-template>\n", styles: [".selected-text{margin:0}.clear-icon{font-size:16px}.close{display:flex}\n/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.SearchableDropdownComponent, selector: "valtimo-searchable-dropdown", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "width"], outputs: ["itemSelected"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchableDropdownSelectComponent, decorators: [{
            type: Component,
            args: [{ selector: 'valtimo-searchable-dropdown-select', template: "<!--\n  ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n  ~\n  ~ Licensed under EUPL, Version 1.2 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" basis,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<ng-container *ngIf=\"!hasSelection; else selection\">\n  <valtimo-searchable-dropdown\n    *ngIf=\"hasPermission\"\n    [buttonText]=\"buttonText\"\n    [disabled]=\"disabled\"\n    [items]=\"items\"\n    [noResultsText]=\"noResultsText\"\n    [searchText]=\"searchText\"\n    [style]=\"style\"\n    [width]=\"width\"\n    (itemSelected)=\"onSelect($event)\"\n  >\n  </valtimo-searchable-dropdown>\n</ng-container>\n\n<ng-template #selection>\n  <div\n    class=\"d-flex flex-row align-items-center\"\n    [style.height.px]=\"style === 'button' ? 34 : null\"\n  >\n    <h5 class=\"selected-text\">\n      {{ selectedText }} <b>{{ selectedTextValue }}</b>\n    </h5>\n    <button\n      *ngIf=\"hasPermission && showClearSelection\"\n      [title]=\"clearSelectionButtonTitle\"\n      (click)=\"onClearSelection()\"\n      aria-label=\"Close\"\n      class=\"close p-0 m-0 ml-2 text-danger\"\n      type=\"button\"\n    >\n      <i class=\"clear-icon mdi mdi-close text-danger\"></i>\n    </button>\n  </div>\n</ng-template>\n", styles: [".selected-text{margin:0}.clear-icon{font-size:16px}.close{display:flex}\n/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
        }], propDecorators: { style: [{
                type: Input
            }], items: [{
                type: Input
            }], buttonText: [{
                type: Input
            }], searchText: [{
                type: Input
            }], noResultsText: [{
                type: Input
            }], disabled: [{
                type: Input
            }], selectedText: [{
                type: Input
            }], selectedTextValue: [{
                type: Input
            }], clearSelectionButtonTitle: [{
                type: Input
            }], hasSelection: [{
                type: Input
            }], width: [{
                type: Input
            }], hasPermission: [{
                type: Input
            }], showClearSelection: [{
                type: Input
            }], itemSelected: [{
                type: Output
            }], clearSelection: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 