import * as i6 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Self, Optional, SkipSelf, Input, Output, HostBinding, ContentChild, ViewChild, ContentChildren, NgModule } from '@angular/core';
import * as i1 from '@angular/forms';
import { FormsModule } from '@angular/forms';
import * as i5 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import * as i8 from '@angular/material/input';
import { MatInputModule } from '@angular/material/input';
import * as i7 from '@deja-js/component/core';
import { Destroy, KeyCodes, DejaChildValidatorDirective, DejaChildValidatorModule } from '@deja-js/component/core';
import * as i2 from '@deja-js/component/v2/item-list';
import { ItemService, ItemComponent, ItemModule } from '@deja-js/component/v2/item-list';
import * as i4 from '@deja-js/component/v2/viewport';
import { ViewPortComponent, ViewPortModule } from '@deja-js/component/v2/viewport';
import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
import { BehaviorSubject, ReplaySubject, Subject, filter, switchMap, combineLatestWith, map, takeUntil, tap, withLatestFrom, delay, distinctUntilChanged, fromEvent, of, mergeWith, timer } from 'rxjs';
import * as i3 from '@angular/material/form-field';

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
/** Composant de liste évoluée avec gestion de viewport et templating */
class TreeListComponent extends Destroy {
    constructor(elementRef, control, localItemService, extendedItemService, changeDetectorRef) {
        super();
        this.elementRef = elementRef;
        this.control = control;
        this.changeDetectorRef = changeDetectorRef;
        /** Exécuté lorsque l'utilisateur sélectionne ou désélectionne une ligne. */
        this.selectedChange = new EventEmitter();
        /** Exécuté lorsque l'utilisateur collapse une ligne. */
        this.itemCollapse = new EventEmitter();
        /** Exécuté lorsque l'utilisateur étend une ligne. */
        this.itemExpand = new EventEmitter();
        /** Exécuté lorsque l'utilisateur tape enter sur une ligne. */
        this.itemEnter = new EventEmitter();
        /** Exécuté lorsque l'utilisateur a modifié le filtrage de la liste. */
        this.queryChange = new EventEmitter();
        this.debugMode = false;
        this._disabled = null;
        this.ngModelType$ = new BehaviorSubject('value');
        this._ngModelType = 'value';
        this.writeValue$ = new ReplaySubject(1);
        this.multiSelect$ = new BehaviorSubject(false);
        this._multiSelect = false;
        this.listElement$ = new ReplaySubject(1);
        this.inputElement$ = new ReplaySubject(1);
        this.raiseChangeCallback = false;
        this._pageSize = 0;
        this.filterExpression = '';
        this.viewPortComponent$ = new ReplaySubject(1);
        this._viewPortRowHeight = 40;
        this.keyboardStartIndex = undefined;
        this.collapseItem$ = new Subject();
        this._searchArea = false;
        this.reloadViewPort$ = new BehaviorSubject(undefined);
        // NgModel implementation
        this.onTouchedCallback = () => undefined;
        this.onChangeCallback = (_a) => undefined;
        this.itemService = extendedItemService || localItemService;
        this.listElementId = `listcontainer_${(1000000000 * Math.random()).toString().substr(10)}`;
        if (this.control) {
            this.control.valueAccessor = this;
        }
        const viewPort$ = this.viewPortComponent$.pipe(filter(viewPortComponent => !!viewPortComponent), switchMap(viewPortComponent => viewPortComponent.viewPort$));
        this.viewPort$ = viewPort$.pipe(combineLatestWith(this.reloadViewPort$), map(([viewPort]) => viewPort));
        this.viewPortComponent$.pipe(filter(viewPortComponent => !!viewPortComponent), switchMap(viewPortComponent => viewPortComponent.itemClass), takeUntil(this.destroyed$)).subscribe((itemClassEvent) => {
            const item = itemClassEvent.item;
            if (item === null || item === void 0 ? void 0 : item.selected) {
                itemClassEvent.classes.push('selected');
            }
            if (item === this.currentItem) {
                itemClassEvent.classes.push('current');
            }
            if (item.className) {
                itemClassEvent.classes.push(item.className);
            }
            if (item.collapsing || item.expanding) {
                itemClassEvent.classes.push('hide');
            }
            if (item.items) {
                itemClassEvent.classes.push('parent');
            }
            if (item.collapsed) {
                itemClassEvent.classes.push('collapsed');
            }
            if (!item.isSelectable) {
                itemClassEvent.classes.push('unselectable');
            }
            if (item.odd) {
                itemClassEvent.classes.push('odd');
            }
            if (item.depth) {
                itemClassEvent.classes.push(`depth${item.depth}`);
            }
        });
        this.itemService.selectedItems$.pipe(tap(selectedItems => {
            this._selectedItems = selectedItems;
            if (this.raiseChangeCallback) {
                this.onChangeCallback(this.value);
                this.onTouchedCallback();
                this.raiseChangeCallback = false;
                if (this.selectedChange.observed) {
                    const selectedModels = this.selectedModels;
                    this.selectedChange.next({
                        item: selectedItems[0],
                        model: selectedModels[0],
                        items: selectedItems,
                        models: selectedModels
                    });
                }
            }
        }), withLatestFrom(this.viewPortComponent$), filter(([_, viewPortComponent]) => !!viewPortComponent), delay(1), takeUntil(this.destroyed$)).subscribe(([_, viewPortComponent]) => {
            viewPortComponent.reloadViewPort();
        });
        this.itemService.query$.pipe(map(query => query || ''), distinctUntilChanged(), filter(query => typeof query === 'string'), takeUntil(this.destroyed$)).subscribe(query => {
            this._query = query;
            this.queryChange.emit(this._query);
        });
        const modelType$ = this.ngModelType$.pipe(tap(modelType => this._ngModelType = modelType));
        this.writeValue$.pipe(combineLatestWith(this.multiSelect$, modelType$), takeUntil(this.destroyed$)).subscribe(([value, multiSelect, modelType]) => {
            if (!value) {
                this.itemService.unselectAll();
            }
            else if (multiSelect) {
                switch (modelType) {
                    case 'item':
                        this.selectedItems = value;
                        break;
                    case 'model':
                        this.selectedModels = value;
                        break;
                    default:
                        this.selectedValues = value;
                }
            }
            else {
                switch (modelType) {
                    case 'item':
                        this.selectedItem = value;
                        break;
                    case 'model':
                        this.selectedModel = value;
                        break;
                    default:
                        this.selectedValue = value;
                }
            }
        });
        // Clear text selection on double-click
        this.listElement$.pipe(switchMap(element => fromEvent(element, 'dblclick')), takeUntil(this.destroyed$)).subscribe(() => window.getSelection().empty());
        this.listElement$.pipe(switchMap(element => fromEvent(element, 'mousedown').pipe(withLatestFrom(this.viewPort$, this.itemService.visibleItemList$), switchMap(([event, viewPort, visibleItemList]) => {
            if (this.disabled) {
                return of(null);
            }
            const target = event.target;
            const itemIndex = this.itemService.getItemIndexFromHtmlElement(target);
            if (itemIndex === undefined) {
                return of(null);
            }
            const isExpandButton = (el) => el.hasAttribute('expandbtn') || el.parentElement.hasAttribute('expandbtn');
            const clickedItem = viewPort.visibleItems[itemIndex - viewPort.startIndex];
            if ((!isExpandButton(target) || !clickedItem.isCollapsible) && clickedItem.isSelectable && (!event.ctrlKey || !this.multiSelect) && (event.button === 0 || !clickedItem.selected)) {
                if (event.shiftKey && this.multiSelect) {
                    // Select all from current to clicked
                    const startIndex = Math.max(visibleItemList.findIndex(item => this.currentItem === item), 0);
                    const rangeSelection = visibleItemList.slice(Math.min(startIndex, itemIndex), Math.max(startIndex, itemIndex) + 1).filter(item => item.isSelectable);
                    this.raiseChangeCallback = true;
                    this.itemService.setSelectedItems(rangeSelection);
                    this.viewPortComponent.reloadViewPort();
                    return of(null);
                }
                else if (!event.ctrlKey) {
                    if (!this.multiSelect && clickedItem.selected) {
                        return of(null);
                    }
                    else if (!this.multiSelect || !clickedItem.selected) {
                        this.raiseChangeCallback = true;
                        this.itemService.setSelectedItems([clickedItem]);
                        this.currentItem = clickedItem;
                        this.ensureItemVisible(clickedItem);
                        this.viewPortComponent.reloadViewPort();
                        this.lastClickedItem = clickedItem; // Keep for double-click
                        return of(clickedItem);
                    }
                }
            }
            return fromEvent(element, 'mouseup').pipe(filter(() => !this.disabled), tap(upevt => {
                const upTarget = upevt.target;
                const upIndex = this.itemService.getItemIndexFromHtmlElement(upTarget);
                if (upIndex === undefined) {
                    return;
                }
                const upItem = viewPort.visibleItems[upIndex - viewPort.startIndex];
                if (clickedItem && upItem !== clickedItem) {
                    return;
                }
                if (upevt.button !== 0) {
                    // Right click menu
                    return;
                }
                if (upItem.isCollapsible && (isExpandButton(upTarget) || !upItem.isSelectable || this.lastClickedItem === upItem)) {
                    this.collapseItem$.next(upItem);
                    this.ensureItemVisible(upItem);
                }
                else if (upItem.isSelectable) {
                    this.raiseChangeCallback = true;
                    if (upevt.ctrlKey && this.multiSelect) {
                        this.itemService.toggleSelect([upItem]);
                    }
                    else if (upevt.ctrlKey) {
                        if (upItem.selected) {
                            this.itemService.unselectAll();
                        }
                        else {
                            this.itemService.setSelectedItems([upItem]);
                        }
                    }
                    else {
                        this.itemService.setSelectedItems([upItem]);
                    }
                    this.keyboardStartIndex = undefined;
                    this.currentItem = upItem;
                    this.ensureItemVisible(upItem);
                    this.viewPortComponent.reloadViewPort();
                    this.lastClickedItem = upItem; // Keep for double-click
                }
                else {
                    this.lastClickedItem = upItem; // Keep for double-click
                }
            }), delay(300), tap(() => {
                this.lastClickedItem = undefined;
            }));
        }))), takeUntil(this.destroyed$)).subscribe();
        const inputKeyDownEvents$ = this.inputElement$.pipe(switchMap(inputElement => {
            if (inputElement) {
                return fromEvent(inputElement, 'keydown');
            }
            return of(null);
        }), filter(event => !!event));
        const listKeyDownEvent$ = this.listElement$.pipe(switchMap(listElement => fromEvent(listElement, 'keydown')));
        listKeyDownEvent$.pipe(mergeWith(inputKeyDownEvents$), filter(() => !this.disabled), filter(event => {
            const keyCode = event.code;
            return keyCode === KeyCodes.Home ||
                keyCode === KeyCodes.End ||
                keyCode === KeyCodes.PageUp ||
                keyCode === KeyCodes.PageDown ||
                keyCode === KeyCodes.UpArrow ||
                keyCode === KeyCodes.DownArrow ||
                keyCode === KeyCodes.Space ||
                keyCode === KeyCodes.Enter;
        }), withLatestFrom(this.viewPort$, this.itemService.visibleItemList$, this.listElement$), takeUntil(this.destroyed$)).subscribe(([event, viewPort, visibleItemList, listElement]) => {
            var _b, _c, _d, _e;
            let stopEvent = false;
            if ((listElement === null || listElement === void 0 ? void 0 : listElement.clientHeight) && this.viewPortRowHeight && this.pageSize === 0) {
                this.pageSize = Math.floor(listElement.clientHeight / +this.viewPortRowHeight);
            }
            // Set current item from index for keyboard features only
            const setCurrentIndex = (index) => {
                this.currentItem = viewPort.items[index];
                this.ensureItemVisible(this.currentItem);
                this.viewPortComponent.reloadViewPort();
            };
            const selectRange = (currentIndex, target) => {
                const rangeSelection = visibleItemList.slice(Math.min(currentIndex, target), Math.max(currentIndex, target) + 1).filter(item => item.isSelectable);
                this.raiseChangeCallback = true;
                this.itemService.setSelectedItems(rangeSelection);
            };
            const navigateToIndex = (nextIndex) => {
                if (this.multiSelect && event.shiftKey) {
                    selectRange(currentIndex, nextIndex);
                    this.ensureItemVisible(nextIndex);
                    this.viewPortComponent.reloadViewPort();
                }
                else if (!event.ctrlKey) {
                    this.raiseChangeCallback = true;
                    this.selectedItem = viewPort.items[nextIndex];
                    setCurrentIndex(nextIndex);
                }
                else {
                    setCurrentIndex(nextIndex);
                }
                this.keyboardStartIndex = nextIndex;
                stopEvent = true;
            };
            const currentIndex = visibleItemList.findIndex(item => this.currentItem === item);
            let target;
            switch (event.code) {
                case KeyCodes.Home:
                    if (this.multiSelect && event.shiftKey) {
                        // Select all from current to first élément
                        selectRange(currentIndex, 0);
                    }
                    else if (!event.ctrlKey) {
                        // Select first element
                        this.raiseChangeCallback = true;
                        this.selectedItem = viewPort.items[0];
                    }
                    setCurrentIndex(0);
                    this.keyboardStartIndex = 0;
                    stopEvent = true;
                    break;
                case KeyCodes.End:
                    if (this.multiSelect && event.shiftKey) {
                        // Select all from current to last élément
                        selectRange(currentIndex, visibleItemList.length - 1);
                    }
                    else if (!event.ctrlKey) {
                        // Select last element
                        this.raiseChangeCallback = true;
                        this.selectedItem = viewPort.items[viewPort.items.length - 1];
                    }
                    setCurrentIndex(viewPort.items.length - 1);
                    this.keyboardStartIndex = viewPort.items.length - 1;
                    stopEvent = true;
                    break;
                case KeyCodes.PageUp:
                    // Select previous page
                    navigateToIndex(Math.max(0, ((_b = this.keyboardStartIndex) !== null && _b !== void 0 ? _b : currentIndex) - this._pageSize));
                    break;
                case KeyCodes.PageDown:
                    // Select next page
                    navigateToIndex(Math.max(0, ((_c = this.keyboardStartIndex) !== null && _c !== void 0 ? _c : currentIndex) + this._pageSize));
                    break;
                case KeyCodes.UpArrow:
                    // Select previous element
                    navigateToIndex(Math.max(0, ((_d = this.keyboardStartIndex) !== null && _d !== void 0 ? _d : currentIndex) - 1));
                    break;
                case KeyCodes.DownArrow:
                    // Select next element
                    navigateToIndex(Math.min(viewPort.items.length - 1, ((_e = this.keyboardStartIndex) !== null && _e !== void 0 ? _e : currentIndex) + 1));
                    break;
                case KeyCodes.Space:
                    target = event.target;
                    if (target.tagName === 'INPUT' && !event.ctrlKey && !event.shiftKey) {
                        return;
                    }
                    if (this.currentItem) {
                        if (this.currentItem.isCollapsible) {
                            this.collapseItem$.next(this.currentItem);
                            this.ensureItemVisible(this.currentItem);
                        }
                        else {
                            this.raiseChangeCallback = true;
                            if (this.currentItem.selected || this.multiSelect && event.ctrlKey) {
                                this.itemService.toggleSelect([this.currentItem]);
                            }
                            else {
                                this.selectedItem = this.currentItem;
                            }
                            this.ensureItemVisible(this.currentItem);
                            this.viewPortComponent.reloadViewPort();
                        }
                    }
                    break;
                case KeyCodes.Enter:
                    if (this.currentItem) {
                        if (this.currentItem.isCollapsible) {
                            this.collapseItem$.next(this.currentItem);
                            this.ensureItemVisible(this.currentItem);
                        }
                        else if (this.currentItem.isSelectable) {
                            if (this.itemEnter.observed) {
                                this.itemEnter.next({
                                    item: this.currentItem,
                                    items: [this.currentItem],
                                    model: this.currentItem.model,
                                    models: this.currentItem.model && [this.currentItem.model]
                                });
                            }
                            else {
                                this.raiseChangeCallback = true;
                                this.selectedItem = this.currentItem;
                                this.ensureItemVisible(this.currentItem);
                                this.viewPortComponent.reloadViewPort();
                            }
                        }
                    }
                    break;
                default:
                    // eslint-disable-next-line no-debugger
                    debugger;
                    this.keyboardStartIndex = undefined;
            }
            if (stopEvent) {
                event.preventDefault();
                event.stopPropagation();
            }
        });
        const inputKeyboardEvents$ = this.inputElement$.pipe(switchMap(inputElement => {
            if (inputElement) {
                const inputKeyup$ = fromEvent(inputElement, 'keyup');
                const inputDrop$ = fromEvent(inputElement, 'drop');
                return inputKeyup$.pipe(mergeWith(inputDrop$));
            }
            return of(null);
        }), filter(event => !!event));
        const listKeyboardEvent$ = this.listElement$.pipe(switchMap(listElement => fromEvent(listElement, 'keyup')));
        listKeyboardEvent$.pipe(mergeWith(inputKeyboardEvents$), filter(() => !this.disabled), filter(event => {
            const keyCode = event.code;
            return keyCode >= KeyCodes.Key0 ||
                keyCode === KeyCodes.Backspace ||
                keyCode === KeyCodes.Space ||
                keyCode === KeyCodes.Delete;
        }), withLatestFrom(this.viewPort$), filter(([_, viewPort]) => { var _b; return ((_b = viewPort.items) === null || _b === void 0 ? void 0 : _b.length) > 0; }), switchMap(([event, viewPort]) => {
            if (!this.searchArea) {
                if ((/[a-zA-Z0-9]/).test(event.key)) {
                    // Valid char
                    const findNextMatch = () => {
                        const rg = new RegExp(`^${this.filterExpression}`, 'i');
                        const startIndex = Math.max(viewPort.items.findIndex(item => this.currentItem === item), 0);
                        let nextIndex = this.filterExpression.length > 1 ? startIndex : startIndex + 1;
                        // Just turn the number of items max
                        return viewPort.items.some(() => {
                            // That the real index and item in the loop
                            const item = viewPort.items[nextIndex];
                            if (item === null || item === void 0 ? void 0 : item.isSelectable) {
                                if (rg.test(item.label)) {
                                    // Found, set current item
                                    this.raiseChangeCallback = true;
                                    this.selectedItem = this.currentItem = item;
                                    this.ensureItemVisible(this.currentItem);
                                    this.viewPortComponent.reloadViewPort();
                                    return true; // Find, stop the loop
                                }
                            }
                            nextIndex++;
                            if (nextIndex >= viewPort.items.length) {
                                nextIndex = 0;
                            }
                            return false;
                        });
                    };
                    // Search next
                    this.filterExpression += event.key;
                    if (findNextMatch()) {
                        event.preventDefault();
                        event.stopPropagation();
                    }
                    else {
                        this.filterExpression = event.key;
                        if (findNextMatch()) {
                            event.preventDefault();
                            event.stopPropagation();
                        }
                    }
                }
            }
            else {
                // Autocomplete, filter the list
                // this.keyboardNavigation$.next();
            }
            // clear filterExpression after 1 second
            // Timer is automatically canceled by the switchmap if a second character is typed before 1 second
            return timer(1000);
        }), takeUntil(this.destroyed$)).subscribe(() => {
            this.filterExpression = '';
        });
        this.collapseItem$.pipe(switchMap(item => {
            if (!item.collapsed && this.collapsingItem) {
                return this.collapsingItem(item);
            }
            else if (this.expandingItem) {
                return this.expandingItem(item);
            }
            else {
                return of(item);
            }
        }), filter(item => !!item), takeUntil(this.destroyed$)).subscribe(item => {
            item.collapsed = !item.collapsed;
            this.itemService.refreshVisibleItemList$.next();
            const itemEvent = {
                item: item,
                model: item.model,
                items: [item],
                models: [item.model]
            };
            if (item.collapsed) {
                this.itemCollapse.emit(itemEvent);
            }
            else {
                this.itemExpand.emit(itemEvent);
            }
        });
        this.maxHeight = 0;
    }
    set viewPortComponent(viewPortComponent) {
        this.viewPortComponent$.next(viewPortComponent);
        this._viewPortComponent = viewPortComponent;
    }
    get viewPortComponent() {
        return this._viewPortComponent;
    }
    set options(value) {
        if (value === null || value === void 0 ? void 0 : value.length) {
            this.itemService.options$.next(value);
        }
    }
    /** Définit la hauteur d'une ligne pour le calcul du viewport. Le Viewport ne fonctionne qu'avec des hauteurs de lignes fixe.
     * Pour désactiver le viewport, mettre la hauteur de ligne à 0.
     * Attention, une désactivation du viewport dégrade considérablement les performances de la liste et ne doit pas être activée si la liste
     * est suceptible de contenir beaucoup d'éléments.
     * @param value Hauteur de ligne à utiliser pour le calcul du viewport.
     */
    set viewPortRowHeight(value) {
        this._viewPortRowHeight = coerceNumberProperty(value);
    }
    get viewPortRowHeight() {
        return this._viewPortRowHeight;
    }
    /** Définit la liste des éléments */
    set items(items) {
        delete this.hintLabel;
        this.itemService.items$.next(items);
    }
    /** Définit la liste des éléments (tout type d'objet métier) */
    set models(models) {
        this.itemService.models$.next(models);
    }
    /** Définit la liste des éléments sélectionnés en mode multiselect */
    set selectedItems(value) {
        this.itemService.setSelectedItems(value);
    }
    /** Retourne la liste des éléments sélectionnés en mode multiselect */
    get selectedItems() {
        return this._selectedItems;
    }
    /** Définit l'élément sélectionné en mode single select */
    set selectedItem(value) {
        this.itemService.setSelectedItems(value && [value]);
    }
    /** Retourne l'éléments sélectionné en mode single select */
    get selectedItem() {
        var _b;
        return (_b = this.selectedItems) === null || _b === void 0 ? void 0 : _b[0];
    }
    /** Définit le model sélectionné en mode single select */
    set selectedModel(value) {
        this.itemService.setSelectedModels(value && [value]);
    }
    /** Retourne le model sélectionné en mode single select */
    get selectedModel() {
        var _b;
        return (_b = this.selectedModels) === null || _b === void 0 ? void 0 : _b[0];
    }
    /** Définit la liste des models sélectionnés en mode multiselect */
    set selectedModels(value) {
        this.itemService.setSelectedModels(value);
    }
    /** Retourne la liste des models sélectionnés en mode multiselect */
    get selectedModels() {
        var _b;
        return (_b = this.selectedItems) === null || _b === void 0 ? void 0 : _b.map(itm => itm.model);
    }
    /** Définit le model sélectionné en mode single select */
    set selectedValue(value) {
        this.itemService.setSelectedValues(value && [value]);
    }
    /** Retourne le model sélectionné en mode single select */
    get selectedValue() {
        var _b;
        return (_b = this.selectedValues) === null || _b === void 0 ? void 0 : _b[0];
    }
    /** Définit la liste des models sélectionnés en mode multiselect */
    set selectedValues(value) {
        this.itemService.setSelectedValues(value);
    }
    /** Retourne la liste des models sélectionnés en mode multiselect */
    get selectedValues() {
        var _b;
        return (_b = this.selectedItems) === null || _b === void 0 ? void 0 : _b.map(itm => itm.id);
    }
    /** Définit une valeur indiquant si en reactive form le model renvoyé doit être un obeject oue une valeur */
    set ngModelType(value) {
        this.ngModelType$.next(value);
    }
    /** Définit une valeur indiquant si plusieurs lignes peuvent être sélectionnées. */
    set multiSelect(value) {
        this._multiSelect = coerceBooleanProperty(value);
        this.multiSelect$.next(this._multiSelect);
    }
    get multiSelect() {
        return this._multiSelect;
    }
    /** Correspond au ngModel du champ de filtrage ou recherche */
    set query(value) {
        this.itemService.query$.next(value);
    }
    get query() {
        return this._query;
    }
    set selectingItems(value) {
        this.itemService.selectingItems = value;
    }
    set unSelectingItems(value) {
        this.itemService.unSelectingItems = value;
    }
    set listElememtRef(elem) {
        this.listElement$.next(elem === null || elem === void 0 ? void 0 : elem.nativeElement);
    }
    set inputElememtRef(elem) {
        this.inputElement$.next(elem === null || elem === void 0 ? void 0 : elem.nativeElement);
    }
    /** Permet de désactiver la liste */
    set disabled(value) {
        const disabled = coerceBooleanProperty(value);
        this._disabled = disabled || null;
    }
    get disabled() {
        return this._disabled;
    }
    /** Définit le champ utilisé pour la liste des enfants d'un parent */
    set childrenField(value) {
        this.itemService.childrenField$.next(value);
    }
    /** Définit le champ à utiliser comme valeur d'affichage. */
    set textField(value) {
        this.itemService.textField$.next(value);
    }
    /** Définit le champ à utiliser comme valeur de comparaison. */
    set valueField(value) {
        this.itemService.valueField$.next(value);
    }
    /** Définit la ligne courant ou ligne active */
    set currentItem(item) {
        this._currentItem = item;
    }
    /** Retourne la ligne courant ou ligne active */
    get currentItem() {
        return this._currentItem;
    }
    set pageSize(value) {
        this._pageSize = coerceNumberProperty(value);
    }
    /** Retourne le nombre de lignes à sauter en cas de pression sur les touches PageUp ou PageDown */
    get pageSize() {
        return this._pageSize;
    }
    /** Définit la hauteur maximum avant que le composant affiche une scrollbar
     * spécifier une grande valeur pour ne jamais afficher de scrollbar
     * Spécifier 0 pour que le composant determine sa hauteur à partir du container
     */
    set maxHeight(value) {
        this._maxHeight = coerceNumberProperty(value);
    }
    /** Retourne la hauteur maximum avant que le composant affiche une scrollbar
     * spécifier une grande valeur pour ne jamais afficher de scrollbar
     * Spécifier 0 pour que le composant determine sa hauteur à partir du container
     */
    get maxHeight() {
        return this._maxHeight;
    }
    /** Affiche un barre de recherche au dessus de la liste. */
    set searchArea(value) {
        this._searchArea = coerceBooleanProperty(value);
    }
    get searchArea() {
        return this._searchArea;
    }
    /** Définit la longueur minimale de caractères dans le champ de recherche avant que la recherche ou le filtrage soient effectués */
    // eslint-disable-next-line @angular-eslint/no-input-rename
    set minSearchlength(value) {
        this.itemService.minSearchLength$.next(coerceNumberProperty(value));
    }
    /** Définit un texte de conseil en cas d'erreur de validation ou autre */
    set hintLabel(value) {
        this._hintLabel = value;
    }
    /** Retourne un texte de conseil en cas d'erreur de validation ou autre */
    get hintLabel() {
        return this._hintLabel;
    }
    /** Définit le champ à utiliser comme champ de recherche.
     * Ce champ peut indiquer, un champ contenant une valeur, un texte indexé, ou une fonction.
     */
    set searchField(value) {
        this.itemService.searchField$.next(value);
    }
    set inputValidatorDirective(value) {
        if (value) {
            value.parentControl = this.control;
        }
    }
    get itemTemplate() {
        return this.itemTemplateExternal || this.itemTemplateInternal;
    }
    get parentItemTemplate() {
        return this.parentItemTemplateExternal || this.parentItemTemplateInternal;
    }
    get headerTemplate() {
        return this.headerTemplateExternal || this.headerTemplateInternal;
    }
    get searchPrefixTemplate() {
        return this.searchPrefixTemplateExternal || this.searchPrefixTemplateInternal;
    }
    get searchSuffixTemplate() {
        return this.searchSuffixTemplateExternal || this.searchSuffixTemplateInternal;
    }
    // ************* ControlValueAccessor Implementation **************
    get value() {
        if (this._multiSelect) {
            switch (this._ngModelType) {
                case 'item':
                    return this.selectedItems;
                case 'model':
                    return this.selectedModels;
                default:
                    return this.selectedValues;
            }
        }
        else {
            switch (this._ngModelType) {
                case 'item':
                    return this.selectedItem;
                case 'model':
                    return this.selectedModel;
                default:
                    return this.selectedValue;
            }
        }
    }
    set value(val) {
        this.writeValue(val);
        this.onChangeCallback(val);
        this.onTouchedCallback();
    }
    writeValue(value) {
        this.writeValue$.next(value);
    }
    registerOnChange(fn) {
        this.onChangeCallback = fn;
    }
    registerOnTouched(fn) {
        this.onTouchedCallback = fn;
    }
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
    }
    // ************* End of ControlValueAccessor Implementation **************
    /** Positionne a scrollbar pour assurer que l'élément spécifié soit visible */
    ensureItemVisible(item) {
        if (this.viewPortComponent) {
            this.viewPortComponent.ensureVisible(item);
        }
    }
    /** Rebind le viewport */
    reloadViewPort() {
        if (this.viewPortComponent) {
            this.viewPortComponent.reloadViewPort();
        }
    }
    /** Recalcule le viewport. */
    refreshViewPort(clearMeasuredSize) {
        if (this.viewPortComponent) {
            this.viewPortComponent.refreshViewPort(clearMeasuredSize);
        }
    }
    /** Efface le viewport */
    clearViewPort() {
        if (this.viewPortComponent) {
            this.viewPortComponent.clearViewPort();
        }
    }
}
TreeListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TreeListComponent, deps: [{ token: i0.ElementRef }, { token: i1.NgControl, optional: true, self: true }, { token: i2.ItemService }, { token: i2.ItemService, optional: true, skipSelf: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
TreeListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: TreeListComponent, selector: "tree-list", inputs: { placeholder: "placeholder", viewPortMode: "viewPortMode", nodataholder: "nodataholder", itemTemplateExternal: "itemTemplateExternal", parentItemTemplateExternal: "parentItemTemplateExternal", headerTemplateExternal: "headerTemplateExternal", searchPrefixTemplateExternal: "searchPrefixTemplateExternal", searchSuffixTemplateExternal: "searchSuffixTemplateExternal", expandingItem: "expandingItem", collapsingItem: "collapsingItem", debugMode: "debugMode", viewPortRowHeight: "viewPortRowHeight", items: "items", models: "models", selectedItems: "selectedItems", selectedItem: "selectedItem", selectedModel: "selectedModel", selectedModels: "selectedModels", selectedValue: "selectedValue", selectedValues: "selectedValues", ngModelType: "ngModelType", multiSelect: "multiSelect", query: "query", selectingItems: "selectingItems", unSelectingItems: "unSelectingItems", disabled: "disabled", childrenField: "childrenField", textField: "textField", valueField: "valueField", currentItem: "currentItem", pageSize: "pageSize", maxHeight: "maxHeight", searchArea: "searchArea", minSearchlength: ["min-search-length", "minSearchlength"], hintLabel: "hintLabel", searchField: "searchField" }, outputs: { selectedChange: "selectedChange", itemCollapse: "itemCollapse", itemExpand: "itemExpand", itemEnter: "itemEnter", queryChange: "queryChange" }, host: { properties: { "attr.disabled": "this._disabled" } }, providers: [
        ItemService
    ], queries: [{ propertyName: "itemTemplateInternal", first: true, predicate: ["itemTemplate"], descendants: true }, { propertyName: "parentItemTemplateInternal", first: true, predicate: ["parentItemTemplate"], descendants: true }, { propertyName: "headerTemplateInternal", first: true, predicate: ["headerTemplate"], descendants: true }, { propertyName: "searchPrefixTemplateInternal", first: true, predicate: ["searchPrefixTemplate"], descendants: true }, { propertyName: "searchSuffixTemplateInternal", first: true, predicate: ["searchSuffixTemplate"], descendants: true }, { propertyName: "options", predicate: ItemComponent }], viewQueries: [{ propertyName: "viewPortComponent", first: true, predicate: ViewPortComponent, descendants: true }, { propertyName: "listElememtRef", first: true, predicate: ["listElement"], descendants: true, static: true }, { propertyName: "inputElememtRef", first: true, predicate: ["inputelement"], descendants: true }, { propertyName: "inputValidatorDirective", first: true, predicate: DejaChildValidatorDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div id=\"header\" *ngIf=\"searchArea || (itemService.minSearchLength$ | async)\">\n    <mat-form-field deja-child-validator id=\"input\">\n        <input #inputelement type=\"text\" matInput tabindex=\"0\" [ngModel]=\"itemService.query$ | async\" [placeholder]=\"placeholder\" [disabled]=\"disabled\" (input)=\"itemService.query$.next(model && model.value)\" #model=\"ngModel\">\n        <span *ngIf=\"searchPrefixTemplate\" matPrefix>\n            <ng-template [ngTemplateOutlet]=\"searchPrefixTemplate\"></ng-template>\n        </span>\n        <span *ngIf=\"searchSuffixTemplate\" matSuffix>\n            <ng-template [ngTemplateOutlet]=\"searchSuffixTemplate\"></ng-template>\n        </span>\n    </mat-form-field>\n</div>\n<div id=\"listheader\" *ngIf=\"headerTemplate\">\n    <ng-template [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\n</div>\n<div [id]=\"listElementId\" #listElement class=\"listcontainer\" [style.max-height.px]=\"maxHeight || null\" tabindex=\"1\" [class.hasheader]=\"headerTemplate\">\n    <div id=\"error-hint\" *ngIf=\"hintLabel\">{{ hintLabel }}</div>\n    <ng-container *ngIf=\"itemService.visibleItemList$ | async as itemList\">\n        <div id=\"nodata-holder\" *ngIf=\"!itemList.length\">{{ nodataholder }}</div>\n        <viewport *ngIf=\"itemList.length\" [items]=\"itemList\" [itemSize]=\"viewPortRowHeight\" [viewPortMode]=\"viewPortMode\" [debugMode]=\"debugMode\">\n            <ng-template #viewPortItemTemplate let-item let-size=\"size\" let-index=\"index\">\n                <span expandbtn>\n                    <mat-icon *ngIf=\"item.items?.length\">arrow_drop_down</mat-icon>\n                </span>\n                <ng-container *ngIf=\"(!item.items || !parentItemTemplate) && (item.items || !itemTemplate)\">{{ item.label }}</ng-container>\n                <ng-container *ngIf=\"item.items && parentItemTemplate\">\n                    <ng-template [ngTemplateOutlet]=\"parentItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item, query: query, flatindex: index }\"></ng-template>\n                </ng-container>\n                <ng-container *ngIf=\"!item.items && itemTemplate\">\n                    <ng-template [ngTemplateOutlet]=\"itemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item, query: query, flatindex: index }\"></ng-template>\n                </ng-container>\n            </ng-template>\n        </viewport>\n    </ng-container>\n</div>\n", styles: ["tree-list{display:flex;position:relative;flex-direction:column;align-content:stretch;overflow:hidden}tree-list.ng-invalid #input .mat-form-field-wrapper .mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:scaleY(1)}tree-list #input{outline:none}tree-list #header{flex:0 0 auto;align-items:center;display:flex}tree-list #header #input{flex:1 1 auto}tree-list #header button{flex:0 0 auto;margin:16px .5rem 16px 0}tree-list #listheader{flex:0 0 auto;overflow:hidden;box-sizing:border-box}tree-list .listcontainer{flex:1 1 auto;outline:none;overflow:auto;display:flex;flex-direction:column;padding:0;margin:0;position:relative}tree-list .listcontainer.hasheader{border-top:0}tree-list .listcontainer[valign=bottom]{border-top:none}tree-list .listcontainer #nodata-holder{margin:.5rem}tree-list .listcontainer #error-hint{margin:.5rem;flex:0 0 auto}tree-list .listcontainer viewport{flex:1 1 100%}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth0{padding-left:0rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth1{padding-left:1rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth2{padding-left:2rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth3{padding-left:3rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth4{padding-left:4rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth5{padding-left:5rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth6{padding-left:6rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth7{padding-left:7rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth8{padding-left:8rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth9{padding-left:9rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth10{padding-left:10rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth11{padding-left:11rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth12{padding-left:12rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth13{padding-left:13rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth14{padding-left:14rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth15{padding-left:15rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth16{padding-left:16rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth17{padding-left:17rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth18{padding-left:18rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth19{padding-left:19rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth20{padding-left:20rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth21{padding-left:21rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth22{padding-left:22rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth23{padding-left:23rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth24{padding-left:24rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth25{padding-left:25rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth26{padding-left:26rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth27{padding-left:27rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth28{padding-left:28rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth29{padding-left:29rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth30{padding-left:30rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth31{padding-left:31rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth32{padding-left:32rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth33{padding-left:33rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth34{padding-left:34rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth35{padding-left:35rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth36{padding-left:36rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth37{padding-left:37rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth38{padding-left:38rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth39{padding-left:39rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth40{padding-left:40rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth41{padding-left:41rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth42{padding-left:42rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth43{padding-left:43rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth44{padding-left:44rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth45{padding-left:45rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth46{padding-left:46rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth47{padding-left:47rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth48{padding-left:48rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth49{padding-left:49rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth50{padding-left:50rem}tree-list .listcontainer viewport div.listitem{opacity:1;margin:0;transition-timing-function:linear;transition-duration:.3s;transition-property:max-height,opacity;display:flex;align-items:center}tree-list .listcontainer viewport div.listitem.hide{opacity:0!important;max-height:0!important;transition-timing-function:ease-out}tree-list .listcontainer viewport div.listitem:not(.unselectable):hover{cursor:pointer}tree-list .listcontainer viewport div.listitem [expandbtn]{width:24px;cursor:pointer;opacity:.6;padding-top:2px}tree-list .listcontainer viewport div.listitem.parent.collapsed [expandbtn]>.mat-icon{transform:rotate(-90deg)}\n"], components: [{ type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4.ViewPortComponent, selector: "viewport", inputs: ["viewPortItemTemplateExternal", "buttonsStep", "models", "items", "scrollingStyle", "direction", "itemSize", "viewPortMode", "debugMode"], outputs: ["itemClass"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.DejaChildValidatorDirective, selector: "[deja-child-validator]" }, { type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl],      input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.MatPrefix, selector: "[matPrefix]" }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.MatSuffix, selector: "[matSuffix]" }], pipes: { "async": i6.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TreeListComponent, decorators: [{
            type: Component,
            args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
                        ItemService
                    ], selector: 'tree-list', template: "<div id=\"header\" *ngIf=\"searchArea || (itemService.minSearchLength$ | async)\">\n    <mat-form-field deja-child-validator id=\"input\">\n        <input #inputelement type=\"text\" matInput tabindex=\"0\" [ngModel]=\"itemService.query$ | async\" [placeholder]=\"placeholder\" [disabled]=\"disabled\" (input)=\"itemService.query$.next(model && model.value)\" #model=\"ngModel\">\n        <span *ngIf=\"searchPrefixTemplate\" matPrefix>\n            <ng-template [ngTemplateOutlet]=\"searchPrefixTemplate\"></ng-template>\n        </span>\n        <span *ngIf=\"searchSuffixTemplate\" matSuffix>\n            <ng-template [ngTemplateOutlet]=\"searchSuffixTemplate\"></ng-template>\n        </span>\n    </mat-form-field>\n</div>\n<div id=\"listheader\" *ngIf=\"headerTemplate\">\n    <ng-template [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\n</div>\n<div [id]=\"listElementId\" #listElement class=\"listcontainer\" [style.max-height.px]=\"maxHeight || null\" tabindex=\"1\" [class.hasheader]=\"headerTemplate\">\n    <div id=\"error-hint\" *ngIf=\"hintLabel\">{{ hintLabel }}</div>\n    <ng-container *ngIf=\"itemService.visibleItemList$ | async as itemList\">\n        <div id=\"nodata-holder\" *ngIf=\"!itemList.length\">{{ nodataholder }}</div>\n        <viewport *ngIf=\"itemList.length\" [items]=\"itemList\" [itemSize]=\"viewPortRowHeight\" [viewPortMode]=\"viewPortMode\" [debugMode]=\"debugMode\">\n            <ng-template #viewPortItemTemplate let-item let-size=\"size\" let-index=\"index\">\n                <span expandbtn>\n                    <mat-icon *ngIf=\"item.items?.length\">arrow_drop_down</mat-icon>\n                </span>\n                <ng-container *ngIf=\"(!item.items || !parentItemTemplate) && (item.items || !itemTemplate)\">{{ item.label }}</ng-container>\n                <ng-container *ngIf=\"item.items && parentItemTemplate\">\n                    <ng-template [ngTemplateOutlet]=\"parentItemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item, query: query, flatindex: index }\"></ng-template>\n                </ng-container>\n                <ng-container *ngIf=\"!item.items && itemTemplate\">\n                    <ng-template [ngTemplateOutlet]=\"itemTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item, query: query, flatindex: index }\"></ng-template>\n                </ng-container>\n            </ng-template>\n        </viewport>\n    </ng-container>\n</div>\n", styles: ["tree-list{display:flex;position:relative;flex-direction:column;align-content:stretch;overflow:hidden}tree-list.ng-invalid #input .mat-form-field-wrapper .mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:scaleY(1)}tree-list #input{outline:none}tree-list #header{flex:0 0 auto;align-items:center;display:flex}tree-list #header #input{flex:1 1 auto}tree-list #header button{flex:0 0 auto;margin:16px .5rem 16px 0}tree-list #listheader{flex:0 0 auto;overflow:hidden;box-sizing:border-box}tree-list .listcontainer{flex:1 1 auto;outline:none;overflow:auto;display:flex;flex-direction:column;padding:0;margin:0;position:relative}tree-list .listcontainer.hasheader{border-top:0}tree-list .listcontainer[valign=bottom]{border-top:none}tree-list .listcontainer #nodata-holder{margin:.5rem}tree-list .listcontainer #error-hint{margin:.5rem;flex:0 0 auto}tree-list .listcontainer viewport{flex:1 1 100%}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth0{padding-left:0rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth1{padding-left:1rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth2{padding-left:2rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth3{padding-left:3rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth4{padding-left:4rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth5{padding-left:5rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth6{padding-left:6rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth7{padding-left:7rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth8{padding-left:8rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth9{padding-left:9rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth10{padding-left:10rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth11{padding-left:11rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth12{padding-left:12rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth13{padding-left:13rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth14{padding-left:14rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth15{padding-left:15rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth16{padding-left:16rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth17{padding-left:17rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth18{padding-left:18rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth19{padding-left:19rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth20{padding-left:20rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth21{padding-left:21rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth22{padding-left:22rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth23{padding-left:23rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth24{padding-left:24rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth25{padding-left:25rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth26{padding-left:26rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth27{padding-left:27rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth28{padding-left:28rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth29{padding-left:29rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth30{padding-left:30rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth31{padding-left:31rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth32{padding-left:32rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth33{padding-left:33rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth34{padding-left:34rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth35{padding-left:35rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth36{padding-left:36rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth37{padding-left:37rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth38{padding-left:38rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth39{padding-left:39rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth40{padding-left:40rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth41{padding-left:41rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth42{padding-left:42rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth43{padding-left:43rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth44{padding-left:44rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth45{padding-left:45rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth46{padding-left:46rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth47{padding-left:47rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth48{padding-left:48rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth49{padding-left:49rem}tree-list .listcontainer viewport div.viewport-wrapper div.listitem.depth50{padding-left:50rem}tree-list .listcontainer viewport div.listitem{opacity:1;margin:0;transition-timing-function:linear;transition-duration:.3s;transition-property:max-height,opacity;display:flex;align-items:center}tree-list .listcontainer viewport div.listitem.hide{opacity:0!important;max-height:0!important;transition-timing-function:ease-out}tree-list .listcontainer viewport div.listitem:not(.unselectable):hover{cursor:pointer}tree-list .listcontainer viewport div.listitem [expandbtn]{width:24px;cursor:pointer;opacity:.6;padding-top:2px}tree-list .listcontainer viewport div.listitem.parent.collapsed [expandbtn]>.mat-icon{transform:rotate(-90deg)}\n"] }]
        }], ctorParameters: function () {
        return [{ type: i0.ElementRef }, { type: i1.NgControl, decorators: [{
                        type: Self
                    }, {
                        type: Optional
                    }] }, { type: i2.ItemService }, { type: i2.ItemService, decorators: [{
                        type: SkipSelf
                    }, {
                        type: Optional
                    }] }, { type: i0.ChangeDetectorRef }];
    }, propDecorators: { placeholder: [{
                type: Input
            }], viewPortMode: [{
                type: Input
            }], nodataholder: [{
                type: Input
            }], itemTemplateExternal: [{
                type: Input
            }], parentItemTemplateExternal: [{
                type: Input
            }], headerTemplateExternal: [{
                type: Input
            }], searchPrefixTemplateExternal: [{
                type: Input
            }], searchSuffixTemplateExternal: [{
                type: Input
            }], selectedChange: [{
                type: Output
            }], itemCollapse: [{
                type: Output
            }], itemExpand: [{
                type: Output
            }], itemEnter: [{
                type: Output
            }], queryChange: [{
                type: Output
            }], expandingItem: [{
                type: Input
            }], collapsingItem: [{
                type: Input
            }], debugMode: [{
                type: Input
            }], _disabled: [{
                type: HostBinding,
                args: ['attr.disabled']
            }], itemTemplateInternal: [{
                type: ContentChild,
                args: ['itemTemplate']
            }], parentItemTemplateInternal: [{
                type: ContentChild,
                args: ['parentItemTemplate']
            }], headerTemplateInternal: [{
                type: ContentChild,
                args: ['headerTemplate']
            }], searchPrefixTemplateInternal: [{
                type: ContentChild,
                args: ['searchPrefixTemplate']
            }], searchSuffixTemplateInternal: [{
                type: ContentChild,
                args: ['searchSuffixTemplate']
            }], viewPortComponent: [{
                type: ViewChild,
                args: [ViewPortComponent]
            }], options: [{
                type: ContentChildren,
                args: [ItemComponent]
            }], viewPortRowHeight: [{
                type: Input
            }], items: [{
                type: Input
            }], models: [{
                type: Input
            }], selectedItems: [{
                type: Input
            }], selectedItem: [{
                type: Input
            }], selectedModel: [{
                type: Input
            }], selectedModels: [{
                type: Input
            }], selectedValue: [{
                type: Input
            }], selectedValues: [{
                type: Input
            }], ngModelType: [{
                type: Input
            }], multiSelect: [{
                type: Input
            }], query: [{
                type: Input
            }], selectingItems: [{
                type: Input
            }], unSelectingItems: [{
                type: Input
            }], listElememtRef: [{
                type: ViewChild,
                args: ['listElement', { static: true }]
            }], inputElememtRef: [{
                type: ViewChild,
                args: ['inputelement', { static: false }]
            }], disabled: [{
                type: Input
            }], childrenField: [{
                type: Input
            }], textField: [{
                type: Input
            }], valueField: [{
                type: Input
            }], currentItem: [{
                type: Input
            }], pageSize: [{
                type: Input
            }], maxHeight: [{
                type: Input
            }], searchArea: [{
                type: Input
            }], minSearchlength: [{
                type: Input,
                args: ['min-search-length']
            }], hintLabel: [{
                type: Input
            }], searchField: [{
                type: Input
            }], inputValidatorDirective: [{
                type: ViewChild,
                args: [DejaChildValidatorDirective]
            }] } });

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
class TreeListModule {
}
TreeListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TreeListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
TreeListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TreeListModule, declarations: [TreeListComponent], imports: [CommonModule,
        DejaChildValidatorModule,
        FormsModule,
        ItemModule,
        MatIconModule,
        MatInputModule,
        ViewPortModule], exports: [TreeListComponent] });
TreeListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TreeListModule, imports: [[
            CommonModule,
            DejaChildValidatorModule,
            FormsModule,
            ItemModule,
            MatIconModule,
            MatInputModule,
            ViewPortModule
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: TreeListModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        TreeListComponent
                    ],
                    exports: [
                        TreeListComponent
                    ],
                    imports: [
                        CommonModule,
                        DejaChildValidatorModule,
                        FormsModule,
                        ItemModule,
                        MatIconModule,
                        MatInputModule,
                        ViewPortModule
                    ]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { TreeListComponent, TreeListModule };
//# sourceMappingURL=deja-js-component-v2-tree-list.mjs.map
