import { r as registerInstance, c as createEvent, h, a as getElement } from './index-PqnYwNKt.js';
import { d as detectFramework, t as trackComponent } from './framework-detection-DcmcuUOA.js';
import { i as isNestedInIfxComponent } from './dom-utils-Bw2fh5LT.js';

const treeViewCss = ":host{display:block}.tree-view{font-family:var(--ifx-font-family, sans-serif);font-size:14px;color:var(--ifx-color-text, #1a1a1a);display:flex;flex-wrap:wrap;flex-direction:column;overflow-x:auto;overflow-y:hidden}.tree-view__label{font:600 1.125rem/1.625rem \"Source Sans 3\";margin-bottom:8px}";

const TreeView = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.ifxTreeViewExpandAllChange = createEvent(this, "ifxTreeViewExpandAllChange", 7);
        this.ifxTreeViewDisableAllChange = createEvent(this, "ifxTreeViewDisableAllChange", 7);
        this.disableAllItems = false;
        this.expandAllItems = false;
        this.handleSlotRef = (el) => {
            if (el) {
                if (this.disableAllItems) {
                    el.setAttribute('data-disable-all-items', 'true');
                }
                else {
                    el.removeAttribute('data-disable-all-items');
                }
                if (this.expandAllItems) {
                    el.setAttribute('data-expand-all-items', 'true');
                }
                else {
                    el.removeAttribute('data-expand-all-items');
                }
            }
        };
    }
    handleExpandAllItemsChange(newValue) {
        this.ifxTreeViewExpandAllChange.emit(newValue);
    }
    handleDisableAllItemsChange(newValue) {
        this.ifxTreeViewDisableAllChange.emit(newValue);
    }
    async componentDidLoad() {
        if (!isNestedInIfxComponent(this.el)) {
            const framework = detectFramework();
            trackComponent('ifx-tree-view', await framework);
        }
    }
    render() {
        return (h("div", { key: 'a169184b27839fcb6f960eeb4794d5928a00344b', class: `tree-view ${this.disableAllItems ? ' tree-view--disabled' : ''}`, role: "tree", "aria-label": this.ariaLabel }, this.label && this.label.trim() !== '' && h("div", { key: 'ba814b0b23bf8126f84e104f6b2a60a1de289b0b', class: "tree-view__label" }, this.label), h("slot", { key: 'e86880fa26b576d1dc023afa08fbbe5d06501bde', ref: this.handleSlotRef })));
    }
    get el() { return getElement(this); }
    static get watchers() { return {
        "expandAllItems": ["handleExpandAllItemsChange"],
        "disableAllItems": ["handleDisableAllItemsChange"]
    }; }
};
TreeView.style = treeViewCss;

export { TreeView as ifx_tree_view };
//# sourceMappingURL=ifx-tree-view.entry.js.map

//# sourceMappingURL=ifx-tree-view.entry.js.map