/*!
 *
 * carbon-angular v0.0.7 | timepicker.component.js
 *
 * Copyright 2014, 2019 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * 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, Input, Output, EventEmitter, HostBinding, TemplateRef } from "@angular/core";
/**
 * [See demo](../../?path=/story/time-picker--simple)
 *
 * <example-url>../../iframe.html?id=time-picker--simple</example-url>
 */
var TimePicker = /** @class */ (function () {
    function TimePicker() {
        this.timePicker = true;
        this.placeholder = "hh:mm";
        this.pattern = "(1[012]|[0-9]):[0-5][0-9]";
        this.id = "timepicker-" + TimePicker.timePickerCount++;
        this.disabled = false;
        /**
         * Set to true for a loading select.
         */
        this.skeleton = false;
        /**
         * `light` or `dark` select theme
         */
        this.theme = "dark";
        this.valueChange = new EventEmitter();
    }
    TimePicker.prototype.onChange = function (event) {
        this.valueChange.emit(event.target.value);
    };
    TimePicker.prototype.isTemplate = function (value) {
        return value instanceof TemplateRef;
    };
    /**
     * Tracks the total number of selects instantiated. Used to generate unique IDs
     */
    TimePicker.timePickerCount = 0;
    TimePicker.decorators = [
        { type: Component, args: [{
                    selector: "ibm-timepicker",
                    template: "\n\t\t\t<div class=\"bx--time-picker__input\">\n\t\t\t\t<label *ngIf=\"!skeleton && label\" [for]=\"id\" class=\"bx--label\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<input\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'bx--text-input--light': theme === 'light',\n\t\t\t\t\t\t'bx--skeleton': skeleton\n\t\t\t\t\t}\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"pattern\"\n\t\t\t\t\t[attr.id]=\"id\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\tmaxlength=\"5\"\n\t\t\t\t\t(change)=\"onChange($event)\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tclass=\"bx--time-picker__input-field bx--text-input\">\n\t\t\t</div>\n\t\t\t<ng-content></ng-content>\n\t"
                },] },
    ];
    TimePicker.propDecorators = {
        timePicker: [{ type: HostBinding, args: ["class.bx--time-picker",] }],
        label: [{ type: Input }],
        placeholder: [{ type: Input }],
        pattern: [{ type: Input }],
        id: [{ type: Input }],
        disabled: [{ type: Input }],
        value: [{ type: Input }],
        skeleton: [{ type: Input }],
        theme: [{ type: Input }],
        valueChange: [{ type: Output }]
    };
    return TimePicker;
}());
export { TimePicker };
//# sourceMappingURL=timepicker.component.js.map