All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.vscode-scrollable.vscode-scrollable.js.map Maven / Gradle / Ivy

The newest version!
{"version":3,"file":"vscode-scrollable.js","sourceRoot":"","sources":["../../src/vscode-scrollable/vscode-scrollable.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAClD,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAEnD;;;;;;GAMG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QAIL,WAAM,GAAG,IAAI,CAAC;QAGd,aAAQ,GAAG,KAAK,CAAC;QAwBT,gBAAW,GAAG,KAAK,CAAC;QAGpB,iBAAY,GAAG,CAAC,CAAC;QAGjB,YAAO,GAAG,CAAC,CAAC;QAGZ,kBAAa,GAAG,KAAK,CAAC;QAGtB,eAAU,GAAG,KAAK,CAAC;QAGnB,iBAAY,GAAG,KAAK,CAAC;QAerB,uBAAkB,GAAG,CAAC,CAAC;QACvB,iBAAY,GAAG,CAAC,CAAC;QACjB,sBAAiB,GAAG,IAAI,CAAC;QACzB,qBAAgB,GAAG,CAAC,CAAC;QAqCrB,iCAA4B,GAClC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QA4ElC,iCAA4B,GAClC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAsBlC,+BAA0B,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,C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ACmB;AAGrC;IADP,KAAK,CAAC,uBAAuB,CAAC;8DACe;AAGtC;IADP,qBAAqB,EAAE;2DACa;AA1D1B,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAkR5B","sourcesContent":["import {html, nothing, TemplateResult} from 'lit';\nimport {\n  customElement,\n  property,\n  query,\n  queryAssignedElements,\n  state,\n} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {VscElement} from '../includes/VscElement.js';\nimport styles from './vscode-scrollable.styles.js';\n\n/**\n * @cssprop [--min-thumb-height=20px] - Scrollbar thumb minimum height\n * @cssprop --vscode-scrollbar-shadow\n * @cssprop --vscode-scrollbarSlider-background\n * @cssprop --vscode-scrollbarSlider-hoverBackground\n * @cssprop --vscode-scrollbarSlider-activeBackground\n */\n@customElement('vscode-scrollable')\nexport class VscodeScrollable extends VscElement {\n  static styles = styles;\n\n  @property({type: Boolean, reflect: true})\n  shadow = true;\n\n  @property({type: Boolean, reflect: true})\n  scrolled = false;\n\n  @property({type: Number, attribute: 'scroll-pos'})\n  set scrollPos(val: number) {\n    this._scrollableContainer.scrollTop = val;\n  }\n  get scrollPos(): number {\n    if (!this._scrollableContainer) {\n      return 0;\n    }\n\n    return this._scrollableContainer.scrollTop;\n  }\n\n  @property({type: Number, attribute: 'scroll-max'})\n  get scrollMax(): number {\n    if (!this._scrollableContainer) {\n      return 0;\n    }\n\n    return this._scrollableContainer.scrollHeight;\n  }\n\n  @state()\n  private _isDragging = false;\n\n  @state()\n  private _thumbHeight = 0;\n\n  @state()\n  private _thumbY = 0;\n\n  @state()\n  private _thumbVisible = false;\n\n  @state()\n  private _thumbFade = false;\n\n  @state()\n  private _thumbActive = false;\n\n  @query('.content')\n  private _contentElement!: HTMLDivElement;\n\n  @query('.scrollbar-thumb')\n  private _scrollThumbElement!: HTMLDivElement;\n\n  @query('.scrollable-container')\n  private _scrollableContainer!: HTMLDivElement;\n\n  @queryAssignedElements()\n  private _assignedElements!: NodeList;\n\n  private _resizeObserver!: ResizeObserver;\n  private _scrollThumbStartY = 0;\n  private _mouseStartY = 0;\n  private _scrollbarVisible = true;\n  private _scrollbarTrackZ = 0;\n\n  connectedCallback(): void {\n    super.connectedCallback();\n\n    this._resizeObserver = new ResizeObserver(\n      this._resizeObserverCallbackBound\n    );\n\n    this.requestUpdate();\n\n    this.updateComplete.then(() => {\n      this._scrollableContainer.addEventListener(\n        'scroll',\n        this._onScrollableContainerScroll.bind(this)\n      );\n      this._resizeObserver.observe(this._contentElement);\n    });\n\n    this.addEventListener('mouseover', this._onComponentMouseOverBound);\n    this.addEventListener('mouseout', this._onComponentMouseOutBound);\n  }\n\n  disconnectedCallback(): void {\n    super.disconnectedCallback();\n\n    this._resizeObserver.unobserve(this);\n    this._resizeObserver.disconnect();\n\n    this.removeEventListener('mouseover', this._onComponentMouseOverBound);\n    this.removeEventListener('mouseout', this._onComponentMouseOutBound);\n  }\n\n  private _resizeObserverCallback() {\n    this._updateScrollbar();\n  }\n\n  private _resizeObserverCallbackBound =\n    this._resizeObserverCallback.bind(this);\n\n  private _updateScrollbar() {\n    const compCr = this.getBoundingClientRect();\n    const contentCr = this._contentElement.getBoundingClientRect();\n\n    if (compCr.height >= contentCr.height) {\n      this._scrollbarVisible = false;\n    } else {\n      this._scrollbarVisible = true;\n      this._thumbHeight = compCr.height * (compCr.height / contentCr.height);\n    }\n\n    this.requestUpdate();\n  }\n\n  private _zIndexFix() {\n    let highestZ = 0;\n\n    this._assignedElements.forEach((n) => {\n      if ('style' in n) {\n        const computedZIndex = window.getComputedStyle(n as HTMLElement).zIndex;\n        const isNumber = /([0-9-])+/g.test(computedZIndex);\n\n        if (isNumber) {\n          highestZ =\n            Number(computedZIndex) > highestZ\n              ? Number(computedZIndex)\n              : highestZ;\n        }\n      }\n    });\n\n    this._scrollbarTrackZ = highestZ + 1;\n    this.requestUpdate();\n  }\n\n  private _onSlotChange() {\n    this._updateScrollbar();\n    this._zIndexFix();\n  }\n\n  private _onScrollThumbMouseDown(event: MouseEvent) {\n    const cmpCr = this.getBoundingClientRect();\n    const thCr = this._scrollThumbElement.getBoundingClientRect();\n\n    this._mouseStartY = event.screenY;\n    this._scrollThumbStartY = thCr.top - cmpCr.top;\n    this._isDragging = true;\n    this._thumbActive = true;\n\n    document.addEventListener('mousemove', this._onScrollThumbMouseMoveBound);\n    document.addEventListener('mouseup', this._onScrollThumbMouseUpBound);\n  }\n\n  private _onScrollThumbMouseMove(event: MouseEvent) {\n    const predictedPos =\n      this._scrollThumbStartY + (event.screenY - this._mouseStartY);\n    let nextPos = 0;\n    const cmpH = this.getBoundingClientRect().height;\n    const thumbH = this._scrollThumbElement.getBoundingClientRect().height;\n    const contentH = this._contentElement.getBoundingClientRect().height;\n\n    if (predictedPos < 0) {\n      nextPos = 0;\n    } else if (predictedPos > cmpH - thumbH) {\n      nextPos = cmpH - thumbH;\n    } else {\n      nextPos = predictedPos;\n    }\n\n    this._thumbY = nextPos;\n    this._scrollableContainer.scrollTop =\n      (nextPos / (cmpH - thumbH)) * (contentH - cmpH);\n  }\n\n  private _onScrollThumbMouseMoveBound =\n    this._onScrollThumbMouseMove.bind(this);\n\n  private _onScrollThumbMouseUp(event: MouseEvent) {\n    this._isDragging = false;\n    this._thumbActive = false;\n\n    const cr = this.getBoundingClientRect();\n    const {x, y, width, height} = cr;\n    const {pageX, pageY} = event;\n\n    if (pageX > x + width || pageX < x || pageY > y + height || pageY < y) {\n      this._thumbFade = true;\n      this._thumbVisible = false;\n    }\n\n    document.removeEventListener(\n      'mousemove',\n      this._onScrollThumbMouseMoveBound\n    );\n    document.removeEventListener('mouseup', this._onScrollThumbMouseUpBound);\n  }\n\n  private _onScrollThumbMouseUpBound = this._onScrollThumbMouseUp.bind(this);\n\n  private _onScrollableContainerScroll() {\n    const scrollTop = this._scrollableContainer.scrollTop;\n    this.scrolled = scrollTop > 0;\n\n    const cmpH = this.getBoundingClientRect().height;\n    const thumbH = this._scrollThumbElement.getBoundingClientRect().height;\n    const contentH = this._contentElement.getBoundingClientRect().height;\n\n    const overflown = contentH - cmpH;\n    const ratio = scrollTop / overflown;\n\n    this._thumbY = ratio * (cmpH - thumbH);\n  }\n\n  private _onComponentMouseOver() {\n    this._thumbVisible = true;\n    this._thumbFade = false;\n  }\n\n  private _onComponentMouseOverBound = this._onComponentMouseOver.bind(this);\n\n  private _onComponentMouseOut() {\n    if (!this._thumbActive) {\n      this._thumbVisible = false;\n      this._thumbFade = true;\n    }\n  }\n\n  private _onComponentMouseOutBound = this._onComponentMouseOut.bind(this);\n\n  render(): TemplateResult {\n    return html`\n      \n        
\n ${this._isDragging\n ? html`
`\n : nothing}\n \n
\n \n
\n \n
\n \n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-scrollable': VscodeScrollable;\n }\n}\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy