How to use rdk - 2 common examples

To help you get started, we’ve selected a few rdk 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 rdkmaster / jigsaw / src / rdk / component / dropdown / dropdown.ts View on Github external
}

        const option: PopupOptions = {
            pos: this._elementRef,
            posType: PopupPositionType.absolute,
            posOffset: {
                top: this._elementRef.nativeElement.offsetHeight
            },
            size: {width: Number(this._elementRef.nativeElement.offsetWidth)}
        };
        const popupInfo: PopupInfo = this._popupService.popup(this._contentTemplateRef, option);
        this._popupElement = popupInfo.element;
        this._disposePopup = () => {
            popupInfo.dispose()
        };
        PopupService.setBackground(this._popupElement, this._render);

        if (this._openTrigger === DropDownTrigger.mouseover && this._popupElement) {
            this._removeMouseoverHandler = this._render.listen(this._popupElement, 'mouseover', () => {
                if (this._timeout) {
                    clearTimeout(this._timeout);
                    this._timeout = null;
                }
            });
        }
        if (this._closeTrigger === DropDownTrigger.mouseout && this._popupElement) {
            this._removeMouseoutHandler = this._render.listen(this._popupElement, 'mouseout', () => {
                if (!this._timeout) {
                    this._timeout = setTimeout(() => {
                        this._closeDropDown();
                    }, 400);
                }
github rdkmaster / jigsaw / src / rdk / component / dropdown / dropdown.ts View on Github external
private _openDropDown(): void {
        if (this.open) {
            return;
        }

        this._$opened = true; 

        //TODO 阻止click冒泡事件可以实现autoCloseDropDown这一属性
        if (this._closeTrigger === DropDownTrigger.click) {
            this._removeClickHandler = this._render.listen('window', 'click', () => this._closeDropDown());
        }

        const option: PopupOptions = {
            pos: this._elementRef,
            posType: PopupPositionType.absolute,
            posOffset: {
                top: this._elementRef.nativeElement.offsetHeight
            },
            size: {width: Number(this._elementRef.nativeElement.offsetWidth)}
        };
        const popupInfo: PopupInfo = this._popupService.popup(this._contentTemplateRef, option);
        this._popupElement = popupInfo.element;
        this._disposePopup = () => {
            popupInfo.dispose()
        };
        PopupService.setBackground(this._popupElement, this._render);

        if (this._openTrigger === DropDownTrigger.mouseover && this._popupElement) {
            this._removeMouseoverHandler = this._render.listen(this._popupElement, 'mouseover', () => {
                if (this._timeout) {
                    clearTimeout(this._timeout);

rdk

React Component Developer Kit

Apache-2.0
Latest version published 9 months ago

Package Health Score

45 / 100
Full package analysis