UNPKG

@zoff-tech/zt-bottom-drawer

Version:
1,261 lines (1,260 loc) 37.6 kB
import { h, Host } from '@stencil/core'; import { createGesture, createAnimation } from '@ionic/core'; export class ZTBottomDrawer { constructor() { this.navegando = false; this.deltaChangeSate = 5; this.enTouchMove = false; this.cancelMove = false; this.windowh = -1; this.ultimoValuePosY = 0; this.positionName = undefined; this.hideOnPositionZero = false; this.fixCurrentPosition = false; this.disableGesture = false; this.allowScroll = true; this.positions = "close-b-10,bottom-b-200,middle-b-450,top-t-60"; this.hidden = false; this.coefAnimationTime = 40; this.safeAreaTop = undefined; this.safeAreaBottom = undefined; } setDisableGesture(value) { if (!value && !this.gesture && this._htmlElements.gestureTarget) { this.gesture = createGesture({ el: this._htmlElements.gestureTarget, threshold: 0, gestureName: 'drawer-drag', disableScroll: true, passive: true, direction: "y", onStart: ev => this.onStart(ev), onMove: (ev) => { this.onMove(ev); }, onEnd: (ev) => { this.onEnd(ev); } }); } if (this.gesture) this.gesture.enable(!value); } setAllowScroll(value) { if (this.ionContent) { this.ionContent.scrollY = value; this.ionContent.scrollEvents = value; } } async getNav() { return this.nav; } async goBack(amountBack, opts, done) { if (amountBack) { amountBack = amountBack - 1; const cantidadHijos = this.el.firstChild.childNodes.length; if (amountBack < cantidadHijos) { await this.nav.removeIndex(cantidadHijos - amountBack - 1, amountBack); } else { return await this.nav.popToRoot(); } } return this.nav.pop(opts, done); } async goBackToRoot(opts, done) { return this.nav.popToRoot(opts, done); } async goBackToIndex(index, opts, done) { return this.nav.popTo(index, opts, done); } async getNavActive() { return this.nav.getActive(); } async getNavCurrentComponent() { return this.currentComponent; } isElement(o) { return (typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"); } async saveStateInActiveComponent() { let contentActive = await this.nav.getActive(); contentActive.component.__zt_navDrawer.options.allowScroll = this.allowScroll; contentActive.component.__zt_navDrawer.options.disableGesture = this.disableGesture; contentActive.component.__zt_navDrawer.options.positionName = this.positionName; contentActive.component.__zt_navDrawer.options.positions = this.positions; contentActive.component.__zt_navDrawer.options.fixCurrentPosition = this.fixCurrentPosition; } async pushNav(component, propsComponent, options) { if (this.navegando) throw new Error("The Bottom Drawer is navigating, wait after call again. Please use the promise."); if (!options) { options = {}; } if (!options.positions && !this.positions) throw new Error("The position by default or in the options are required."); this.navegando = true; await new Promise(async (resolve, reject) => { if (options && !options.selectorContent) { options.selectorContent = "ion-content"; } if (typeof (component) == "string") component = document.createElement(component); if (this.isElement(component)) { component.__zt_navDrawer = { resolve: resolve, reject: reject, options: options }; console.log(options); this.nav.push(component, propsComponent); } }); this.navegando = false; this.setHeightContainer("CONTENT"); return true; } async getActiveComponentTagName() { return this._tagNameComponetActive; } async getCurrentIndex() { return this.el.firstChild.childNodes.length; } async navDidChange() { let contentActive = await this.nav.getActive(); this._tagNameComponetActive = contentActive.component.tagName; const opts = contentActive.component.__zt_navDrawer.options; if (opts.allowScroll != undefined) this.allowScroll = opts.allowScroll; if (opts.disableGesture != undefined) this.disableGesture = opts.disableGesture; await Promise.all([this.initActiveContentNav(contentActive), new Promise(async (resolve) => { if (opts.positions) { this.setPositions(opts.positions); } if (opts.positionName) { await this.setPositionByName(opts.positionName, true); } if (opts.fixCurrentPosition != undefined) this.fixCurrentPosition = opts.fixCurrentPosition; resolve(); })]); contentActive.component.__zt_navDrawer.resolve(true); this.ztNavDidChange.emit(contentActive); } async initActiveContentNav(contentActive) { if (contentActive) { const opts = contentActive.component.__zt_navDrawer.options; this.currentComponent = contentActive.element; this._htmlElements.content = this.currentComponent.querySelector(opts.selectorContent); if (!this._htmlElements.content) throw new Error(`Bottom Drawer - Error - The selector ${opts.selectorContent} not found any element`); let gestureTarget = contentActive.element; if (opts.selectorGesture) gestureTarget = contentActive.element.querySelector(opts.selectorGesture); this.addGesture(gestureTarget); if (this._htmlElements && this._htmlElements.content && this._htmlElements.content.nodeName == "ION-CONTENT") { this.ionContent = this._htmlElements.content; this.ionContent.scrollY = this.allowScroll; this.ionContent.scrollEvents = this.allowScroll; } else { this.ionContent = this._htmlElements.content; } } } async componentDidLoad() { var _a, _b; this._htmlElements = { drawer: null, gestureTarget: null, content: null }; this._htmlElements.drawer = this.el; this.safeAreaTop = Number(((_a = getComputedStyle(this.el).getPropertyValue("--zt-sat")) !== null && _a !== void 0 ? _a : "0").replace("px", "")); this.safeAreaBottom = Number(((_b = getComputedStyle(this.el).getPropertyValue("--zt-sab")) !== null && _b !== void 0 ? _b : "0").replace("px", "")); this.el.style.setProperty("height", (this.getWHWindow().height) + "px"); this.setPositions(this.positions); this.setAnimation(); } addGesture(target) { if (this.gesture) { this.gesture.destroy(); } this.gesture = createGesture({ el: target, threshold: 0, gestureName: 'drawer-drag', disableScroll: true, passive: false, direction: "y", onStart: ev => { this.onStart(ev); }, onMove: (ev) => { this.onMove(ev); }, onEnd: (ev) => { this.onEnd(ev); } }); if (this.gesture) this.gesture.enable(!this.disableGesture); } setPositions(newPositions) { let positions = []; let index = 1; let splitPositions = newPositions.toLowerCase().split(","); let dimensionesWin = this.getWHWindow(); let previous; splitPositions.forEach(positionCadena => { var _a, _b; let splitPosition = positionCadena.split("-"); if (splitPosition.length === 3) { try { let position = { index: index, name: splitPosition[0], distanceTo: (splitPosition[1].toLowerCase() === "t" ? "TOP" : "BOTTOM"), distance: Number.parseInt(splitPosition[2]), distanceToTop: 0, previousPosition: null, nextPosition: null }; if (position.distanceTo === "TOP") { position.distanceToTop = position.distance + ((_a = this.safeAreaTop) !== null && _a !== void 0 ? _a : 0); } else { position.distanceToTop = dimensionesWin.height - ((_b = this.safeAreaBottom) !== null && _b !== void 0 ? _b : 0) - position.distance; } if (previous) { position.previousPosition = previous; previous.nextPosition = position; } previous = position; index = index + 1; positions.push(position); } catch (err) { throw Error("ZTBottomDrawer - Positions is invalid : " + positionCadena + " must be name:string-[t|b]:string-distance:number "); } } }); positions.forEach((position) => { if (!position.nextPosition) { this.maxTop = position.distanceToTop; } }); this._positions = positions; } async setAnimation() { this.animation = createAnimation() .addElement(this.el); this.animation .duration(1000) .fromTo('transform', `translateY(${this.getWHWindow().height}px)`, `translateY(0px)`); this.animation.progressStart(true, .1); if (this._position) { this.animation.progressStep(1 - this._position.distanceToTop / this.getWHWindow().height); } } async getCurrrentPositionDto() { return Object.assign({}, this._position); } async getPositionByName(name) { return this._positions.find((value) => { return value.name == name; }); } async getPositionByIndex(index) { let positionFind = this._positions.find((value) => { return value.index == index; }); return positionFind; } async hide() { this.gesture.enable(false); this.hidden = true; let hidePos = this.getWHWindow().height + 10; await this.setTranslateY(hidePos, true); this.el.style.setProperty("display", "none"); } async show(positionName) { if (!positionName) { return; } this.el.style.setProperty("display", "inline"); let positionToShow = await this.getPositionByName(positionName); if (!positionToShow) { return; } await this.setPosition(positionToShow); this.hidden = false; } getPositionByPosY(posY, direccion) { let result = { newPosition: null, close: false }; result.newPosition = this._positions.find((position) => { if (direccion === "UP") { if (position.previousPosition && posY < position.previousPosition.distanceToTop + this.deltaChangeSate && (!position.nextPosition || (position.nextPosition && posY > position.distanceToTop - this.deltaChangeSate))) return position; if (!position.previousPosition && posY > position.distanceToTop - this.deltaChangeSate) return position; } if (direccion === "DOWN") { if (position.nextPosition && posY > position.nextPosition.distanceToTop + this.deltaChangeSate && (!position.previousPosition || (position.previousPosition && posY < position.distanceToTop + this.deltaChangeSate))) return position; if (!position.nextPosition && posY < position.distanceToTop + this.deltaChangeSate) return position; } }); if (posY > this.getWHWindow().height) { result.close = true; return result; } return result; } onStart(ev) { if (this.fixCurrentPosition) { this.cancelMove = true; return; } if (ev.event.path) { let elementos = ev.event.path; let eleContent = elementos.find((el) => { return el === this._htmlElements.content; }); if (eleContent) { this.cancelMove = true; return; } } this.cancelMove = false; if (this.ionContent) { this.ionContent.scrollToTop(0); if (this.allowScroll) { this.ionContent.scrollY = false; this.ionContent.scrollEvents = false; } } this.setHeightContainer("MAX"); this.startPosTopMove = this._htmlElements.drawer.getBoundingClientRect().top; this.lastPositionY = this.startPosTopMove; } async onMove(ev) { if (this.cancelMove) return; if (this.moveFastAnimationProgress) await this.moveFastAnimationProgress; this.lastCalc = this.startPosTopMove + ev.deltaY; if (this.lastCalc < this.maxTop) this.lastCalc = this.maxTop; this.previusPositionY = this.lastPositionY; this.lastPositionY = ev.currentY; this.setTranslateY(this.lastCalc); } async onEnd(ev) { if (this.cancelMove) return; this.moveFast = false; this.gesture.enable(false); if (this.ionContent && this.allowScroll) { this.ionContent.scrollY = true; this.ionContent.scrollEvents = true; } this.changeStateByGesture(ev); this.startPosTopMove = 0; this.setDisableGesture(this.disableGesture); return true; } getDirectionGesture() { let deltaY = this.lastPositionY - this.previusPositionY; if (deltaY / Math.abs(deltaY) * -1 > 0) return "UP"; else return "DOWN"; } async changeStateByGesture(ev) { if (Math.abs(ev.deltaY) == 0) { let posY = this._position.distanceToTop; await this.setTranslateY(posY); this.setHeightContainer("CONTENT"); return; } if (this.gesture) this.gesture.enable(false); let calculatePosition = this._position; let calc = this.startPosTopMove + ev.deltaY; let result = this.getPositionByPosY(calc, this.getDirectionGesture()); if (result.close) { if (this.hideOnPositionZero) { this.ztHideEvent.emit(); return this.hide(); } } if (result.newPosition) { calculatePosition = result.newPosition; } if (calculatePosition != this._position) { await this.setPosition(calculatePosition); return; } await this.setTranslateY(this._position.distanceToTop, true); this.setDisableGesture(this.disableGesture); this.setHeightContainer("CONTENT"); } getWHWindow(ignoreCache = false) { let result = this.windowh; if (ignoreCache) { result = window._zt_wh || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; } if (result === -1) { result = this.windowh = window._zt_wh || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; } return { height: result, width: window._zt_wh || window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth }; } async setPositionByName(name, force = false) { if (this.fixCurrentPosition && !force) throw new Error("The CurentPosition of the bottom drawer is fixed"); let newPosition = await this.getPositionByName(name); if (newPosition && (force || (!this._position || (this._position && this._position.name !== newPosition.name)))) { return await this.setPosition(newPosition, force); } } async setPosition(value, force = false) { if (!value) return; if (this.fixCurrentPosition && !force) throw new Error("The CurentPosition of the bottom drawer is fixed"); if (this.gesture) this.gesture.enable(false); const lastPosition = this._position ? this._position.name : undefined; if (!this._position || force || (this._position && value.name !== this._position.name)) { this._position = value; this.positionName = this._position.name; this.ztChangePositionEvent.emit({ positionName: this.positionName, lastPositionName: lastPosition, htmlElements: this._htmlElements }); } if (!value.distanceToTop) { let dimensionesWin = this.getWHWindow(); if (value.distanceTo === "TOP") { value.distanceToTop = value.distance; } else { value.distanceToTop = dimensionesWin.height - value.distance; } } this.setHeightContainer("MAX"); if (this.ionContent) { this.ionContent.scrollToTop(0); } await this.setTranslateY(value.distanceToTop, true); this.setHeightContainer("CONTENT"); this.setDisableGesture(this.disableGesture); } getDuration(delta) { let duration = (delta / 1000) * this.coefAnimationTime; return duration; } async animateRolo(initialY, finalY) { if (this.animateRoloPromise) return this.animateRoloPromise; const delta = Math.abs(initialY - finalY); const paso = delta / this.getDuration(delta); const signo = initialY > finalY ? -1 : 1; this.posyAnimate = initialY; this.animateRoloPromise = new Promise((resolve) => { this.intervalAnimation = setInterval(() => { this.posyAnimate = this.posyAnimate + paso * signo; this.animation.progressStep(1 - this.posyAnimate / this.getWHWindow().height); if ((signo > 0 && this.posyAnimate > finalY) || (signo < 0 && this.posyAnimate < finalY)) { this.animation.progressStep(1 - finalY / this.getWHWindow().height); clearInterval(this.intervalAnimation); resolve(); } }, this.getDuration(delta)); }); await this.animateRoloPromise; this.animateRoloPromise = undefined; } async setTranslateY(posY, applyAnimation = false) { return new Promise(async (resolve) => { if (this.ultimoValuePosY === posY) { return resolve(); } if (!this.ultimoValuePosY) { this.animation.progressStep(1 - posY / this.getWHWindow().height); } else { if (applyAnimation) await this.animateRolo(this.ultimoValuePosY, posY); else { this.animation.progressStep(1 - posY / this.getWHWindow().height); } } this.ultimoValuePosY = posY; resolve(); }); } setHeightContainer(heightOf, ignorarCacheWindowHeight = false) { const h = this.getWHWindow(ignorarCacheWindowHeight).height; let value = h; if (heightOf === "MAX") { value = value - this.maxTop; } else { if (!this.ionContent || this.navegando) return; const brContent = this.ionContent.getBoundingClientRect(); const topcontent = brContent.top; const topParent = this.el.getBoundingClientRect().top; if (h > topcontent) { value = value - topParent; } } this.nav.style.setProperty("height", (value - this.safeAreaBottom) + "px"); } async refreshSizeContent() { return this.setHeightContainer("CONTENT", true); } async setScrollToTop(duration = 200) { if (this.ionContent) { return this.ionContent.scrollToTop(duration); } } render() { return (h(Host, null, h("ion-nav", { onIonNavWillChange: () => { this.navWillchange(); }, onIonNavDidChange: () => { this.navDidChange(); }, ref: elNsv => this.nav = elNsv }))); } navWillchange() { this.ztNavWillChange.emit(); } static get is() { return "zt-bottom-drawer"; } static get originalStyleUrls() { return { "$": ["zt-bottom-drawer.css"] }; } static get styleUrls() { return { "$": ["zt-bottom-drawer.css"] }; } static get properties() { return { "positionName": { "type": "string", "mutable": true, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "position-name", "reflect": true }, "hideOnPositionZero": { "type": "boolean", "mutable": true, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "hide-on-position-zero", "reflect": true, "defaultValue": "false" }, "fixCurrentPosition": { "type": "boolean", "mutable": true, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "fix-current-position", "reflect": true, "defaultValue": "false" }, "disableGesture": { "type": "boolean", "mutable": true, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "disable-gesture", "reflect": true, "defaultValue": "false" }, "allowScroll": { "type": "boolean", "mutable": true, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "allow-scroll", "reflect": true, "defaultValue": "true" }, "positions": { "type": "string", "mutable": true, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "positions", "reflect": true, "defaultValue": "\"close-b-10,bottom-b-200,middle-b-450,top-t-60\"" }, "hidden": { "type": "boolean", "mutable": true, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "hidden", "reflect": true, "defaultValue": "false" }, "coefAnimationTime": { "type": "number", "mutable": true, "complexType": { "original": "number", "resolved": "number", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "coef-animation-time", "reflect": true, "defaultValue": "40" }, "safeAreaTop": { "type": "number", "mutable": true, "complexType": { "original": "number", "resolved": "number", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "safe-area-top", "reflect": true }, "safeAreaBottom": { "type": "number", "mutable": true, "complexType": { "original": "number", "resolved": "number", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "safe-area-bottom", "reflect": true } }; } static get events() { return [{ "method": "ztChangePositionEvent", "name": "ztChangePositionEvent", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "{ positionName: string, lastPositionName: string, htmlElements: ZTHTMLElementsDrawer }", "resolved": "{ positionName: string; lastPositionName: string; htmlElements: ZTHTMLElementsDrawer; }", "references": { "ZTHTMLElementsDrawer": { "location": "local", "path": "C:/dev/zoff-tech/zt-bottom-drawer/src/components/zt-bottom-drawer/zt-bottom-drawer.tsx" } } } }, { "method": "ztHideEvent", "name": "ztHideEvent", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "ZTHTMLElementsDrawer", "resolved": "{ drawer: HTMLElement; gestureTarget: HTMLElement; content: HTMLElement; }", "references": { "ZTHTMLElementsDrawer": { "location": "local", "path": "C:/dev/zoff-tech/zt-bottom-drawer/src/components/zt-bottom-drawer/zt-bottom-drawer.tsx" } } } }, { "method": "ztNavDidChange", "name": "ztNavDidChange", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "any", "resolved": "any", "references": {} } }, { "method": "ztNavWillChange", "name": "ztNavWillChange", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "any", "resolved": "any", "references": {} } }]; } static get methods() { return { "getNav": { "complexType": { "signature": "() => Promise<HTMLIonNavElement>", "parameters": [], "references": { "Promise": { "location": "global" }, "HTMLIonNavElement": { "location": "global" } }, "return": "Promise<HTMLIonNavElement>" }, "docs": { "text": "", "tags": [] } }, "goBack": { "complexType": { "signature": "(amountBack?: number, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<Boolean>", "parameters": [{ "tags": [], "text": "" }, { "tags": [], "text": "" }, { "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "Boolean": { "location": "global" }, "NavOptions": { "location": "import", "path": "@ionic/core" }, "TransitionDoneFn": { "location": "import", "path": "@ionic/core" } }, "return": "Promise<Boolean>" }, "docs": { "text": "", "tags": [] } }, "goBackToRoot": { "complexType": { "signature": "(opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<Boolean>", "parameters": [{ "tags": [], "text": "" }, { "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "Boolean": { "location": "global" }, "NavOptions": { "location": "import", "path": "@ionic/core" }, "TransitionDoneFn": { "location": "import", "path": "@ionic/core" } }, "return": "Promise<Boolean>" }, "docs": { "text": "", "tags": [] } }, "goBackToIndex": { "complexType": { "signature": "(index: number, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<Boolean>", "parameters": [{ "tags": [], "text": "" }, { "tags": [], "text": "" }, { "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "Boolean": { "location": "global" }, "NavOptions": { "location": "import", "path": "@ionic/core" }, "TransitionDoneFn": { "location": "import", "path": "@ionic/core" } }, "return": "Promise<Boolean>" }, "docs": { "text": "", "tags": [] } }, "getNavActive": { "complexType": { "signature": "() => Promise<ViewController>", "parameters": [], "references": { "Promise": { "location": "global" }, "ViewController": { "location": "import", "path": "@ionic/core" } }, "return": "Promise<ViewController>" }, "docs": { "text": "", "tags": [] } }, "getNavCurrentComponent": { "complexType": { "signature": "() => Promise<any>", "parameters": [], "references": { "Promise": { "location": "global" } }, "return": "Promise<any>" }, "docs": { "text": "", "tags": [] } }, "saveStateInActiveComponent": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global" }, "ActiveComponent": { "location": "import", "path": "./zt-bottom-dawer" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "pushNav": { "complexType": { "signature": "(component: string | HTMLElement, propsComponent: any, options: PushNavOptions) => Promise<boolean>", "parameters": [{ "tags": [], "text": "" }, { "tags": [], "text": "" }, { "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "HTMLElement": { "location": "global" }, "PushNavOptions": { "location": "import", "path": "./zt-bottom-dawer" } }, "return": "Promise<boolean>" }, "docs": { "text": "", "tags": [] } }, "getActiveComponentTagName": { "complexType": { "signature": "() => Promise<string>", "parameters": [], "references": { "Promise": { "location": "global" } }, "return": "Promise<string>" }, "docs": { "text": "", "tags": [] } }, "getCurrentIndex": { "complexType": { "signature": "() => Promise<number>", "parameters": [], "references": { "Promise": { "location": "global" } }, "return": "Promise<number>" }, "docs": { "text": "", "tags": [] } }, "getCurrrentPositionDto": { "complexType": { "signature": "() => Promise<ZTPositionDrawer>", "parameters": [], "references": { "Promise": { "location": "global" }, "ZTPositionDrawer": { "location": "local", "path": "C:/dev/zoff-tech/zt-bottom-drawer/src/components/zt-bottom-drawer/zt-bottom-drawer.tsx" } }, "return": "Promise<ZTPositionDrawer>" }, "docs": { "text": "", "tags": [] } }, "getPositionByName": { "complexType": { "signature": "(name: string) => Promise<ZTPositionDrawer>", "parameters": [{ "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "ZTPositionDrawer": { "location": "local", "path": "C:/dev/zoff-tech/zt-bottom-drawer/src/components/zt-bottom-drawer/zt-bottom-drawer.tsx" } }, "return": "Promise<ZTPositionDrawer>" }, "docs": { "text": "", "tags": [] } }, "getPositionByIndex": { "complexType": { "signature": "(index: number) => Promise<ZTPositionDrawer>", "parameters": [{ "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "ZTPositionDrawer": { "location": "local", "path": "C:/dev/zoff-tech/zt-bottom-drawer/src/components/zt-bottom-drawer/zt-bottom-drawer.tsx" } }, "return": "Promise<ZTPositionDrawer>" }, "docs": { "text": "", "tags": [] } }, "hide": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "show": { "complexType": { "signature": "(positionName: string) => Promise<void>", "parameters": [{ "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "ZTPositionDrawer": { "location": "local", "path": "C:/dev/zoff-tech/zt-bottom-drawer/src/components/zt-bottom-drawer/zt-bottom-drawer.tsx" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "setPositionByName": { "complexType": { "signature": "(name: string, force?: boolean) => Promise<void>", "parameters": [{ "tags": [], "text": "" }, { "tags": [], "text": "" }], "references": { "Promise": { "location": "global" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "setPosition": { "complexType": { "signature": "(value: ZTPositionDrawer, force?: boolean) => Promise<void>", "parameters": [{ "tags": [], "text": "" }, { "tags": [], "text": "" }], "references": { "Promise": { "location": "global" }, "ZTPositionDrawer": { "location": "local", "path": "C:/dev/zoff-tech/zt-bottom-drawer/src/components/zt-bottom-drawer/zt-bottom-drawer.tsx" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "setTranslateY": { "complexType": { "signature": "(posY: number, applyAnimation?: boolean) => Promise<void>", "parameters": [{ "tags": [], "text": "" }, { "tags": [], "text": "" }], "references": { "Promise": { "location": "global" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "refreshSizeContent": { "complexType": { "signature": "() => Promise<void>", "parameters": [], "references": { "Promise": { "location": "global" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } }, "setScrollToTop": { "complexType": { "signature": "(duration?: number) => Promise<void>", "parameters": [{ "tags": [], "text": "" }], "references": { "Promise": { "location": "global" } }, "return": "Promise<void>" }, "docs": { "text": "", "tags": [] } } }; } static get elementRef() { return "el"; } static get watchers() { return [{ "propName": "disableGesture", "methodName": "setDisableGesture" }, { "propName": "allowScroll", "methodName": "setAllowScroll" }, { "propName": "positions", "methodName": "setPositions" }]; } } //# sourceMappingURL=zt-bottom-drawer.js.map