import { h } from "@stencil/core";
import { createClickOutsideHandler } from "../../utils/click-outside";
/**
 * Cascader 级联选择器组件
 * 当一个数据集合有清晰的层级结构时，可通过级联选择器逐级查看并选择
 */
export class Cascader {
    el;
    /**
     * 选中项绑定值
     */
    modelValue;
    /**
     * 可选项数据源
     */
    options = [];
    /**
     * 输入框占位文本
     */
    placeholder = '请选择';
    /**
     * 是否禁用
     * @default false
     */
    disabled = false;
    /**
     * 输入框尺寸
     */
    size = 'default';
    /**
     * 是否可清空
     * @default false
     */
    clearable = false;
    /**
     * 是否显示完整路径
     * @default true
     */
    showAllLevels = true;
    /**
     * 输入框的原生属性
     */
    name;
    /**
     * 输入框的原生属性
     */
    inputId;
    /**
     * 分隔符
     * @default ' / '
     */
    separator = ' / ';
    /**
     * 是否动态加载子节点
     * @default true
     */
    emitPath = true;
    /**
     * 是否可搜索（filterable）
     * 开启后下拉顶部渲染搜索输入框，输入时按 label（含所有子级）扁平化过滤，
     * 匹配项以完整路径展示，点击即选中其完整路径。
     * @default false
     */
    filterable = false;
    /**
     * 是否开启动态加载（lazy load）。开启后，展开含 children=undefined 的节点时，
     * 调用 load(node) 获取其子级并填充进 options，加载中显示 loading 态。
     * @default false
     */
    lazy = false;
    /**
     * 动态加载子节点的函数（仅在 lazy=true 时生效）。
     * 接收被展开的节点，返回其子节点数组（Promise）。
     * 加载结果会以不可变方式合并进 options 树（替换该节点 children）。
     */
    load;
    isOpen = false;
    inputValue = '';
    searchValue = '';
    /**
     * 正在动态加载子级的节点 value 集合（用于渲染 loading 态）。
     */
    loadingKeys = new Set();
    /**
     * 扁平化搜索结果：每一项是一个从根到匹配节点的完整路径（用于点击选中）。
     * 仅在 filterable 且 searchValue 非空时使用。
     */
    filteredPaths = [];
    activePath = [];
    /**
     * 值改变事件
     */
    hbChange;
    /**
     * 展开节点发生变化时触发
     */
    hbExpandChange;
    clickOutside = createClickOutsideHandler({
        host: null,
        isOpen: () => this.isOpen,
        onClose: () => { this.closeAndClearSearch(); },
    });
    componentDidLoad() {
        this.clickOutside = createClickOutsideHandler({
            host: this.el,
            isOpen: () => this.isOpen,
            onClose: () => { this.closeAndClearSearch(); },
        });
        this.clickOutside.connect();
        this.updateInputValue();
    }
    /** 关闭下拉并清空搜索态（filterable 模式下避免重开时残留搜索结果） */
    closeAndClearSearch() {
        this.isOpen = false;
        this.searchValue = '';
        this.filteredPaths = [];
    }
    disconnectedCallback() {
        this.clickOutside.disconnect();
    }
    handleValueChange() {
        this.updateInputValue();
    }
    updateInputValue() {
        if (!this.modelValue || this.modelValue.length === 0) {
            this.inputValue = '';
            return;
        }
        if (!this.showAllLevels) {
            const lastValue = this.modelValue[this.modelValue.length - 1];
            const option = this.findOptionByValue(this.options, lastValue);
            this.inputValue = option ? option.label : '';
            return;
        }
        const labels = [];
        let currentOptions = this.options;
        for (const value of this.modelValue) {
            const option = currentOptions.find(opt => opt.value === value);
            if (option) {
                labels.push(option.label);
                currentOptions = option.children || [];
            }
            else {
                break;
            }
        }
        this.inputValue = labels.join(this.separator);
    }
    findOptionByValue(options, value) {
        for (const option of options) {
            if (option.value === value) {
                return option;
            }
            if (option.children) {
                const found = this.findOptionByValue(option.children, value);
                if (found)
                    return found;
            }
        }
        return null;
    }
    handleInputClick = () => {
        if (this.disabled)
            return;
        if (this.isOpen) {
            // 关闭时清空搜索态
            this.closeAndClearSearch();
        }
        else {
            this.isOpen = true;
        }
    };
    /** 搜索输入：仅更新 searchValue，过滤在 render 前的 @State 派生 */
    handleSearchInput = (e) => {
        const target = e.target;
        this.searchValue = target.value;
        this.filteredPaths = this.collectFilteredPaths(this.searchValue);
    };
    /**
     * 扁平化全树搜索：把 options 深度遍历，收集所有「节点 label 含关键字」的完整路径。
     * 一个节点的完整路径 = 从根到该节点（含自身）的 CascaderOption 数组。
     * 关键字为空时返回空数组（交由正常级联视图渲染）。
     *
     * 注意：这里按 label 子串匹配（大小写不敏感），匹配任意层级的节点，
     * 并保留其祖先链以便点击时还原完整路径。
     */
    collectFilteredPaths(keyword) {
        const trimmed = keyword.trim().toLowerCase();
        if (!trimmed)
            return [];
        const results = [];
        const walk = (opts, ancestors) => {
            for (const opt of opts) {
                const currentPath = [...ancestors, opt];
                if (opt.label.toLowerCase().includes(trimmed)) {
                    results.push(currentPath);
                }
                if (opt.children && opt.children.length > 0) {
                    walk(opt.children, currentPath);
                }
            }
        };
        walk(this.options, []);
        return results;
    }
    /** 从扁平搜索结果路径中点击叶子（或非叶子）项：直接以该路径的 value 数组作为选中值 */
    handleSearchSelect = (path) => {
        const valuePath = path.map((opt) => opt.value);
        const last = path[path.length - 1];
        const isLeaf = !last.children || last.children.length === 0 || last.leaf;
        this.searchValue = '';
        this.filteredPaths = [];
        if (isLeaf) {
            // 叶子：选中并关闭
            this.modelValue = valuePath;
            this.updateInputValue();
            this.hbChange.emit(valuePath);
            this.isOpen = false;
            this.activePath = [];
        }
        else {
            // 非叶子：进入该路径的级联展开（便于继续选下级）
            this.activePath = valuePath;
            this.hbExpandChange.emit(valuePath);
        }
    };
    handleClear = (e) => {
        e.stopPropagation();
        this.modelValue = undefined;
        this.inputValue = '';
        this.isOpen = false;
        this.hbChange.emit(undefined);
    };
    handleSelect = (value, path) => {
        const newPath = [...path, value];
        // Find the selected option
        let currentOptions = this.options;
        let selectedOption = null;
        for (const pathValue of newPath) {
            selectedOption = currentOptions.find(opt => opt.value === pathValue) || null;
            if (!selectedOption)
                break;
            currentOptions = selectedOption.children || [];
        }
        // lazy + load：节点 children 尚未加载（children === undefined 且 leaf 未声明）→ 触发加载
        if (this.lazy &&
            this.load &&
            selectedOption &&
            selectedOption.children === undefined &&
            !selectedOption.leaf) {
            // 先展开该路径（显示 loading 态的下一级面板占位），再异步填充
            this.activePath = newPath;
            this.hbExpandChange.emit(newPath);
            void this.loadChildren(selectedOption, newPath);
            return;
        }
        // Check if it's a leaf node
        if (!selectedOption || !selectedOption.children || selectedOption.children.length === 0 || selectedOption.leaf) {
            // Leaf node - select and close
            this.modelValue = newPath;
            this.updateInputValue();
            this.hbChange.emit(newPath);
            this.isOpen = false;
            this.activePath = [];
        }
        else {
            // Has children - expand to next level
            this.activePath = newPath;
            this.hbExpandChange.emit(newPath);
        }
    };
    /**
     * 动态加载某节点的子级。不可变地合并进 options 树（替换该节点 children）。
     * 加载中：把节点 value 加入 loadingKeys（渲染 loading 态）；
     * 加载完成：写入 children（新数组，触发 @Watch/重渲染），移出 loadingKeys。
     * 若 load 返回空数组，把 children 设为 [] 以标记该节点为叶子（避免重复加载）。
     */
    async loadChildren(node, path) {
        if (!this.load)
            return;
        // 标记 loading
        this.loadingKeys = new Set([...this.loadingKeys, node.value]);
        try {
            const children = await this.load(node);
            // 不可变合并：重建 options 树，仅替换目标节点的 children。
            this.options = this.replaceOptionChildren(this.options, node.value, children);
        }
        catch (err) {
            // 加载失败：回退 activePath，避免卡在 loading；保持 options 不变。
            // eslint-disable-next-line no-console
            console.error('[hb-cascader] lazy load failed:', err);
            this.activePath = this.activePath.slice(0, this.activePath.indexOf(node.value) + 1);
        }
        finally {
            const next = new Set(this.loadingKeys);
            next.delete(node.value);
            this.loadingKeys = next;
        }
        // 重新校验该路径是否还能继续展开（叶子情况则收起下一级面板）
        void path;
        void node;
    }
    /**
     * 不可变地替换 options 树中 value===targetValue 节点的 children 字段。
     * 返回一棵全新的 options 树（不修改原数组与原节点对象）。
     */
    replaceOptionChildren(options, targetValue, newChildren) {
        return options.map((opt) => {
            if (opt.value === targetValue) {
                return { ...opt, children: newChildren };
            }
            if (opt.children && opt.children.length > 0) {
                return { ...opt, children: this.replaceOptionChildren(opt.children, targetValue, newChildren) };
            }
            return opt;
        });
    }
    render() {
        return (h("div", { key: 'c842622737b0464fca8807b2e6e673de26e66f6c', class: {
                'hb-cascader': true,
                'hb-cascader--open': this.isOpen,
                'hb-cascader--disabled': this.disabled,
                [`hb-cascader--${this.size}`]: true,
            } }, h("div", { key: '23279bca07ba9263b6b7daa87fcc6ecf89cfa707', class: "hb-cascader__input-wrapper", onClick: this.handleInputClick }, h("input", { key: '56253203d0684b374ee755d669ce1ef61eebb2e2', type: "text", id: this.inputId, name: this.name, class: "hb-cascader__input", placeholder: this.placeholder, value: this.inputValue, disabled: this.disabled, readonly: true, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? 'true' : 'false' }), h("span", { key: '27eb1713ab7eabc760652d60d48960685dfdb0ce', class: "hb-cascader__suffix" }, this.clearable && this.modelValue && this.modelValue.length > 0 && (h("span", { key: '26c75b651d82806019f514e9dc030df394419e46', class: "hb-cascader__clear", role: "button", "aria-label": "\u6E05\u7A7A", onClick: this.handleClear }, "\u00D7")), h("span", { key: '01cc98144fa2cf70fcc7588efadd7bbeea17738b', class: "hb-cascader__arrow" }, "\u25BC"))), this.isOpen && (h("div", { key: '23a6230933ffaf0ee98c2c70a8dc9a8444be0555', class: "hb-cascader__dropdown" }, this.filterable && (h("div", { key: '628a293edf4d2f22975801e2e9155f46a5cf90fa', class: "hb-cascader__search" }, h("input", { key: 'bedac6a61a99b8a64d27eaf95880ff4891c33f04', type: "text", class: "hb-cascader__search-input", placeholder: "\u641C\u7D22", value: this.searchValue, onInput: this.handleSearchInput, "aria-label": "\u641C\u7D22\u9009\u9879" }))), this.filterable && this.searchValue.trim() !== '' ? (this.renderSearchResults()) : (h("div", { class: "hb-cascader__menus", role: "listbox", "aria-multiselectable": "false" }, this.renderCascaderMenus()))))));
    }
    renderCascaderMenus() {
        const menus = [];
        let currentOptions = this.options;
        let currentPath = [];
        // Render first level
        menus.push(this.renderMenu(currentOptions, currentPath));
        // Render active path levels
        for (let i = 0; i < this.activePath.length; i++) {
            const pathValue = this.activePath[i];
            const option = currentOptions.find(opt => opt.value === pathValue);
            if (!option)
                break;
            // lazy 加载中：节点 children 尚未填充 → 渲染 loading 面板
            if (option.children === undefined && this.loadingKeys.has(option.value)) {
                menus.push(this.renderLoadingMenu());
                break;
            }
            if (option.children && option.children.length > 0) {
                currentPath = [...currentPath, pathValue];
                currentOptions = option.children;
                menus.push(this.renderMenu(currentOptions, currentPath));
            }
            else {
                break;
            }
        }
        return menus;
    }
    /** lazy 加载中渲染的面板：一个 loading 占位提示 */
    renderLoadingMenu() {
        return (h("ul", { class: "hb-cascader__menu-list hb-cascader__menu-list--loading", role: "status", "aria-live": "polite" }, h("li", { class: "hb-cascader__menu-item hb-cascader__menu-item--loading" }, h("span", { class: "hb-cascader__menu-item-label" }, "\u52A0\u8F7D\u4E2D\u2026"))));
    }
    /**
     * 渲染扁平化搜索结果：每一项展示完整路径（label 用 separator 连接），点击选中完整路径。
     * 无匹配时渲染空状态。
     */
    renderSearchResults() {
        if (this.filteredPaths.length === 0) {
            return (h("div", { class: "hb-cascader__search-empty", role: "status" }, "\u65E0\u5339\u914D\u6570\u636E"));
        }
        return (h("div", { class: "hb-cascader__search-results", role: "listbox", "aria-label": "\u641C\u7D22\u7ED3\u679C" }, this.filteredPaths.map((path) => {
            const labelPath = path.map((opt) => opt.label).join(this.separator);
            const valuePath = path.map((opt) => opt.value);
            const last = path[path.length - 1];
            const disabled = !!last.disabled;
            // 当前选中判断：路径 value 与 modelValue 完全一致
            const selected = !!this.modelValue &&
                this.modelValue.length === valuePath.length &&
                valuePath.every((v, idx) => this.modelValue && this.modelValue[idx] === v);
            return (h("div", { class: {
                    'hb-cascader__search-item': true,
                    'hb-cascader__search-item--selected': selected,
                    'hb-cascader__search-item--disabled': disabled,
                }, role: "option", "aria-selected": selected ? 'true' : 'false', "aria-disabled": disabled ? 'true' : undefined, onClick: () => !disabled && this.handleSearchSelect(path) }, labelPath));
        })));
    }
    renderMenu(options, path) {
        if (!options || options.length === 0) {
            return null;
        }
        return (h("ul", { class: "hb-cascader__menu-list", role: "group" }, options.map((option) => {
            const isSelected = path.length > 0 && path[path.length - 1] === option.value;
            const isInPath = this.modelValue && path.length > 0 &&
                path.every((val, idx) => this.modelValue && this.modelValue[idx] === val) &&
                this.modelValue.length === path.length + 1 &&
                this.modelValue[path.length] === option.value;
            return (h("li", { class: {
                    'hb-cascader__menu-item': true,
                    'hb-cascader__menu-item--selected': isSelected || isInPath,
                    'hb-cascader__menu-item--disabled': option.disabled,
                }, role: "option", "aria-selected": (isSelected || isInPath) ? 'true' : 'false', "aria-disabled": option.disabled ? 'true' : undefined, onClick: () => !option.disabled && this.handleSelect(option.value, path) }, h("span", { class: "hb-cascader__menu-item-label" }, option.label), this.loadingKeys.has(option.value) ? (h("span", { class: "hb-cascader__menu-item-loading", "aria-hidden": "true" }, "\u27F3")) : (option.children && option.children.length > 0) || (this.lazy && option.children === undefined && !option.leaf) ? (h("span", { class: "hb-cascader__menu-item-arrow" }, "\u25B6")) : null));
        })));
    }
    static get is() { return "hb-cascader"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["cascader.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["cascader.css"]
        };
    }
    static get properties() {
        return {
            "modelValue": {
                "type": "unknown",
                "mutable": true,
                "complexType": {
                    "original": "(string | number)[]",
                    "resolved": "(string | number)[]",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u9009\u4E2D\u9879\u7ED1\u5B9A\u503C"
                },
                "getter": false,
                "setter": false
            },
            "options": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "CascaderOption[]",
                    "resolved": "CascaderOption[]",
                    "references": {
                        "CascaderOption": {
                            "location": "local",
                            "path": "/Users/vscoderwhy/Desktop/product/web-common/huibo-ui/src/components/Cascader/Cascader.tsx",
                            "id": "src/components/Cascader/Cascader.tsx::CascaderOption"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u53EF\u9009\u9879\u6570\u636E\u6E90"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u8F93\u5165\u6846\u5360\u4F4D\u6587\u672C"
                },
                "getter": false,
                "setter": false,
                "attribute": "placeholder",
                "reflect": false,
                "defaultValue": "'\u8BF7\u9009\u62E9'"
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u7981\u7528"
                },
                "getter": false,
                "setter": false,
                "attribute": "disabled",
                "reflect": false,
                "defaultValue": "false"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'large' | 'default' | 'small'",
                    "resolved": "\"default\" | \"large\" | \"small\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u8F93\u5165\u6846\u5C3A\u5BF8"
                },
                "getter": false,
                "setter": false,
                "attribute": "size",
                "reflect": false,
                "defaultValue": "'default'"
            },
            "clearable": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u53EF\u6E05\u7A7A"
                },
                "getter": false,
                "setter": false,
                "attribute": "clearable",
                "reflect": false,
                "defaultValue": "false"
            },
            "showAllLevels": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "true"
                        }],
                    "text": "\u662F\u5426\u663E\u793A\u5B8C\u6574\u8DEF\u5F84"
                },
                "getter": false,
                "setter": false,
                "attribute": "show-all-levels",
                "reflect": false,
                "defaultValue": "true"
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u8F93\u5165\u6846\u7684\u539F\u751F\u5C5E\u6027"
                },
                "getter": false,
                "setter": false,
                "attribute": "name",
                "reflect": false
            },
            "inputId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u8F93\u5165\u6846\u7684\u539F\u751F\u5C5E\u6027"
                },
                "getter": false,
                "setter": false,
                "attribute": "input-id",
                "reflect": false
            },
            "separator": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "' / '"
                        }],
                    "text": "\u5206\u9694\u7B26"
                },
                "getter": false,
                "setter": false,
                "attribute": "separator",
                "reflect": false,
                "defaultValue": "' / '"
            },
            "emitPath": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "true"
                        }],
                    "text": "\u662F\u5426\u52A8\u6001\u52A0\u8F7D\u5B50\u8282\u70B9"
                },
                "getter": false,
                "setter": false,
                "attribute": "emit-path",
                "reflect": false,
                "defaultValue": "true"
            },
            "filterable": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u53EF\u641C\u7D22\uFF08filterable\uFF09\n\u5F00\u542F\u540E\u4E0B\u62C9\u9876\u90E8\u6E32\u67D3\u641C\u7D22\u8F93\u5165\u6846\uFF0C\u8F93\u5165\u65F6\u6309 label\uFF08\u542B\u6240\u6709\u5B50\u7EA7\uFF09\u6241\u5E73\u5316\u8FC7\u6EE4\uFF0C\n\u5339\u914D\u9879\u4EE5\u5B8C\u6574\u8DEF\u5F84\u5C55\u793A\uFF0C\u70B9\u51FB\u5373\u9009\u4E2D\u5176\u5B8C\u6574\u8DEF\u5F84\u3002"
                },
                "getter": false,
                "setter": false,
                "attribute": "filterable",
                "reflect": false,
                "defaultValue": "false"
            },
            "lazy": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u5F00\u542F\u52A8\u6001\u52A0\u8F7D\uFF08lazy load\uFF09\u3002\u5F00\u542F\u540E\uFF0C\u5C55\u5F00\u542B children=undefined \u7684\u8282\u70B9\u65F6\uFF0C\n\u8C03\u7528 load(node) \u83B7\u53D6\u5176\u5B50\u7EA7\u5E76\u586B\u5145\u8FDB options\uFF0C\u52A0\u8F7D\u4E2D\u663E\u793A loading \u6001\u3002"
                },
                "getter": false,
                "setter": false,
                "attribute": "lazy",
                "reflect": false,
                "defaultValue": "false"
            },
            "load": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "(node: CascaderOption) => Promise<CascaderOption[]>",
                    "resolved": "(node: CascaderOption) => Promise<CascaderOption[]>",
                    "references": {
                        "CascaderOption": {
                            "location": "local",
                            "path": "/Users/vscoderwhy/Desktop/product/web-common/huibo-ui/src/components/Cascader/Cascader.tsx",
                            "id": "src/components/Cascader/Cascader.tsx::CascaderOption"
                        },
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u52A8\u6001\u52A0\u8F7D\u5B50\u8282\u70B9\u7684\u51FD\u6570\uFF08\u4EC5\u5728 lazy=true \u65F6\u751F\u6548\uFF09\u3002\n\u63A5\u6536\u88AB\u5C55\u5F00\u7684\u8282\u70B9\uFF0C\u8FD4\u56DE\u5176\u5B50\u8282\u70B9\u6570\u7EC4\uFF08Promise\uFF09\u3002\n\u52A0\u8F7D\u7ED3\u679C\u4F1A\u4EE5\u4E0D\u53EF\u53D8\u65B9\u5F0F\u5408\u5E76\u8FDB options \u6811\uFF08\u66FF\u6362\u8BE5\u8282\u70B9 children\uFF09\u3002"
                },
                "getter": false,
                "setter": false
            }
        };
    }
    static get states() {
        return {
            "isOpen": {},
            "inputValue": {},
            "searchValue": {},
            "loadingKeys": {},
            "filteredPaths": {},
            "activePath": {}
        };
    }
    static get events() {
        return [{
                "method": "hbChange",
                "name": "hbChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u503C\u6539\u53D8\u4E8B\u4EF6"
                },
                "complexType": {
                    "original": "(string | number)[] | undefined",
                    "resolved": "(string | number)[]",
                    "references": {}
                }
            }, {
                "method": "hbExpandChange",
                "name": "hbExpandChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u5C55\u5F00\u8282\u70B9\u53D1\u751F\u53D8\u5316\u65F6\u89E6\u53D1"
                },
                "complexType": {
                    "original": "(string | number)[]",
                    "resolved": "(string | number)[]",
                    "references": {}
                }
            }];
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "modelValue",
                "methodName": "handleValueChange"
            }];
    }
}
//# sourceMappingURL=Cascader.js.map
