How to use the primeng/dom.DomHandler.zindex function in primeng

To help you get started, we’ve selected a few primeng examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github primefaces / primeng / src / app / components / confirmdialog / confirmdialog.ts View on Github external
this.documentEscapeListener = this.renderer.listen('document', 'keydown', (event) => {
                if (event.which == 27 && (this.closeOnEscape && this.closable)) {
                    if (parseInt(this.container.style.zIndex) === (DomHandler.zindex + this.baseZIndex) && this.visible) {
                        this.close(event);
                    }
                }

                if(event.which === 9 && this.focusTrap) {
                    event.preventDefault();
                    
                    let focusableElements = DomHandler.getFocusableElements(this.container);
    
                    if (focusableElements && focusableElements.length > 0) {
                        if (!document.activeElement) {
                            focusableElements[0].focus();
                        }
                        else {
                            let focusedIndex = focusableElements.indexOf(document.activeElement);
github primefaces / primeng / src / app / components / confirmdialog / confirmdialog.ts View on Github external
moveOnTop() {
        if (this.autoZIndex) {
            this.container.style.zIndex = String(this.baseZIndex + (++DomHandler.zindex));
        }
    }
github primefaces / primeng / src / app / components / colorpicker / colorpicker.ts View on Github external
onOverlayAnimationStart(event: AnimationEvent) {
        switch(event.toState) {
            case 'visible':
                if (!this.inline) {
                    this.overlay = event.element;
                    this.appendOverlay();
                    if (this.autoZIndex) {
                        this.overlay.style.zIndex = String(this.baseZIndex + (++DomHandler.zindex));
                    }
                    this.alignOverlay();
                    this.bindDocumentClickListener();

                    this.updateColorSelector();
                    this.updateUI();
                }
            break;

            case 'void':
                this.onOverlayHide();
            break;
        }
    }
github primefaces / primeng / src / app / components / password / password.ts View on Github external
onFocus(e) {
        if (this.feedback) {
            if (!this.panel) {
                this.createPanel();
            }
    
            this.panel.style.zIndex = String(++DomHandler.zindex);
            this.zone.runOutsideAngular(() => {
                setTimeout(() => {
                    DomHandler.addClass(this.panel, 'ui-password-panel-visible');
                    DomHandler.removeClass(this.panel, 'ui-password-panel-hidden');
                }, 1);
                DomHandler.absolutePosition(this.panel, this.el.nativeElement);
            });
        }
    }
github primefaces / primeng / src / app / components / dropdown / dropdown.ts View on Github external
onOverlayAnimationStart(event: AnimationEvent) {
        switch (event.toState) {
            case 'visible':
                this.overlay = event.element;
                let itemsWrapperSelector = this.virtualScroll ? '.cdk-virtual-scroll-viewport' : '.ui-dropdown-items-wrapper';
                this.itemsWrapper = DomHandler.findSingle(this.overlay, itemsWrapperSelector);
                this.appendOverlay();
                if (this.autoZIndex) {
                    this.overlay.style.zIndex = String(this.baseZIndex + (++DomHandler.zindex));
                }
                this.alignOverlay();
                this.bindDocumentClickListener();
                this.bindDocumentResizeListener();

                if (this.options && this.options.length) {
                    if(!this.virtualScroll) {
                        let selectedListItem = DomHandler.findSingle(this.itemsWrapper, '.ui-dropdown-item.ui-state-highlight');
                        if (selectedListItem) {
                            DomHandler.scrollInView(this.itemsWrapper, selectedListItem);
                        }
                    }
                }

                if (this.filterViewChild && this.filterViewChild.nativeElement) {
                    this.filterViewChild.nativeElement.focus();