import { h } from "@stencil/core";
import { COLUMN_CONTEXT_MENU } from '../column/column.renderer';
import Tunnel from '../../locale/i18n.provider';
export class ColumnPinner {
    constructor() {
        /**
         * Is pinning enabled
         */
        this.enabled = true;
        /**
         * Type of pinning not allows
         * Possible values are: `"left"`, `"right"`,  and `null` (both left and right pinning allowed). Defaults to null.
         */
        this.disallow = null;
    }
    render() {
        if (!this.enabled) {
            return undefined;
        }
        return COLUMN_CONTEXT_MENU.filter((o) => !this.disallow || o.value !== this.disallow)
            .map(o => h("anj-context-menu-item", { action: o.value }, this.translator(o.label)));
    }
    static get is() { return "anj-column-pinner"; }
    static get originalStyleUrls() { return {
        "$": ["column-pinner.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["column-pinner.css"]
    }; }
    static get properties() { return {
        "enabled": {
            "type": "boolean",
            "mutable": false,
            "complexType": {
                "original": "boolean",
                "resolved": "boolean",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Is pinning enabled"
            },
            "attribute": "enabled",
            "reflect": false,
            "defaultValue": "true"
        },
        "disallow": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "PinnedType",
                "resolved": "\"left\" | \"right\"",
                "references": {
                    "PinnedType": {
                        "location": "import",
                        "path": "../table.types"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": "Type of pinning not allows\nPossible values are: `\"left\"`, `\"right\"`,  and `null` (both left and right pinning allowed). Defaults to null."
            },
            "attribute": "disallow",
            "reflect": false,
            "defaultValue": "null"
        },
        "translator": {
            "type": "unknown",
            "mutable": false,
            "complexType": {
                "original": "IntlFormatFn",
                "resolved": "(value: any, variables?: any) => string",
                "references": {
                    "IntlFormatFn": {
                        "location": "import",
                        "path": "../../locale/i18n.provider"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [{
                        "text": undefined,
                        "name": "internal"
                    }],
                "text": ""
            }
        }
    }; }
    static get elementRef() { return "element"; }
}
Tunnel.injectProps(ColumnPinner, ['translator']);
