/*!
 *
 * carbon-angular v0.0.5 | list.directive.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 { Directive, ElementRef, HostBinding } from "@angular/core";
/**
 * Applies either ordered or unordered styling to the list container it is applied to.
 *
 * [See demo](../../?path=/story/list--basic)
 *
 * For `ul`s it will apply unordered list styles, and for `ol`s it will apply ordered list styles.
 *
 * If a `ul` or `ol` is nested within a `li` the directive will apply nested list styling.
 *
 * <example-url>../../iframe.html?id=list--basic</example-url>
 *
 * @export
 * @class List
 */
var List = /** @class */ (function () {
    function List(elementRef) {
        this.elementRef = elementRef;
    }
    Object.defineProperty(List.prototype, "ordered", {
        get: function () {
            if (this.nested) {
                return false;
            }
            return this.elementRef.nativeElement.tagName === "OL";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(List.prototype, "unordered", {
        get: function () {
            if (this.nested) {
                return false;
            }
            return this.elementRef.nativeElement.tagName === "UL";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(List.prototype, "nested", {
        get: function () {
            return this.elementRef.nativeElement.parentElement.tagName === "LI";
        },
        enumerable: true,
        configurable: true
    });
    List.decorators = [
        { type: Directive, args: [{
                    selector: "[ibmList]"
                },] },
    ];
    /** @nocollapse */
    List.ctorParameters = function () { return [
        { type: ElementRef }
    ]; };
    List.propDecorators = {
        ordered: [{ type: HostBinding, args: ["class.bx--list--ordered",] }],
        unordered: [{ type: HostBinding, args: ["class.bx--list--unordered",] }],
        nested: [{ type: HostBinding, args: ["class.bx--list--nested",] }]
    };
    return List;
}());
export { List };
//# sourceMappingURL=list.directive.js.map