This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/components/VDataTable/VVirtualTable.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
7.7 KiB
Text

{"version":3,"sources":["../../../src/components/VDataTable/VVirtualTable.ts"],"names":[],"mappings":"AAAA,OAAO,uDAAP,C,CAEA;;AACA,OAAO,YAAP,MAAyB,gBAAzB;AAKA,OAAO,MAAP,MAAmB,mBAAnB,C,CAEA;;AACA,SAAS,aAAT,EAAwB,QAAxB,QAAwC,oBAAxC,C,CAEA;;AACA,MAAM,UAAU,GAAG,MAAM,CAAC,YAAD,CAAzB;AASA,eAAe,UAAU,CAAC,MAAX,GAA6B,MAA7B,CAAoC;AACjD,EAAA,IAAI,EAAE,iBAD2C;AAGjD,EAAA,KAAK,EAAE;AACL,IAAA,SAAS,EAAE;AACT,MAAA,IAAI,EAAE,MADG;AAET,MAAA,OAAO,EAAE;AAFA,KADN;AAKL,IAAA,YAAY,EAAE;AACZ,MAAA,IAAI,EAAE,MADM;AAEZ,MAAA,OAAO,EAAE;AAFG,KALT;AASL,IAAA,KAAK,EAAE;AACL,MAAA,IAAI,EAAE,KADD;AAEL,MAAA,OAAO,EAAE,MAAO;AAFX,KATF;AAaL,IAAA,SAAS,EAAE;AACT,MAAA,IAAI,EAAE,MADG;AAET,MAAA,OAAO,EAAE;AAFA;AAbN,GAH0C;AAsBjD,EAAA,IAAI,EAAE,OAAO;AACX,IAAA,SAAS,EAAE,CADA;AAEX,IAAA,QAAQ,EAAE,CAFC;AAGX,IAAA,cAAc,EAAE,IAHL;AAIX,IAAA,eAAe,EAAE;AAJN,GAAP,CAtB2C;AA6BjD,EAAA,QAAQ,EAAE;AACR,IAAA,WAAW,GAAA;AACT,aAAO,KAAK,KAAL,CAAW,MAAlB;AACD,KAHO;;AAIR,IAAA,WAAW,GAAA;AACT,aAAQ,KAAK,WAAL,GAAmB,KAAK,SAAzB,GAAsC,KAAK,YA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CAAC,SAAxB;AACD,KAxBM;;AAyBP,IAAA,QAAQ,GAAA;AACN,aAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,QAAA,GAAG,EAAE,OAD2B;AAEhC,QAAA,WAAW,EAAE;AAFmB,OAA3B,EAGJ,CACD,KAAK,cAAL,CAAoB,OAApB,EAA6B,CAC3B,KAAK,MAAL,CAAY,aAAZ,CAD2B,EAE3B,KAAK,OAAL,EAF2B,EAG3B,KAAK,MAAL,CAAY,YAAZ,CAH2B,CAA7B,CADC,CAHI,CAAP;AAUD,KApCM;;AAqCP,IAAA,UAAU,GAAA;AACR,aAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,QAAA,WAAW,EAAE,0BADmB;AAEhC,QAAA,KAAK,EAAE;AACL,UAAA,MAAM,EAAE,aAAa,CAAC,KAAK,MAAN;AADhB;AAFyB,OAA3B,EAKJ,CACD,KAAK,QAAL,EADC,CALI,CAAP;AAQD;;AA9CM,GAhFwC;;AAiIjD,EAAA,MAAM,CAAE,CAAF,EAAG;AACP,WAAO,CAAC,CAAC,KAAD,EAAQ;AACd,MAAA,WAAW,EAAE,8BADC;AAEd,MAAA,KAAK,EAAE,KAAK;AAFE,KAAR,EAGL,CACD,KAAK,MAAL,CAAY,GADX,EAED,KAAK,UAAL,EAFC,EAGD,KAAK,MAAL,CAAY,MAHX,CAHK,CAAR;AAQD;;AA1IgD,CAApC,CAAf","sourcesContent":["import './VVirtualTable.sass'\n\n// Components\nimport VSimpleTable from './VSimpleTable'\n\n// Types\nimport { VNode, VNodeChildren } from 'vue'\nimport { PropValidator } from 'vue/types/options'\nimport mixins from '../../util/mixins'\n\n// Utiltiies\nimport { convertToUnit, debounce } from '../../util/helpers'\n\n// Types\nconst baseMixins = mixins(VSimpleTable)\n\ninterface options extends InstanceType<typeof baseMixins> {\n $refs: {\n table: HTMLElement\n }\n cachedItems: VNodeChildren\n}\n\nexport default baseMixins.extend<options>().extend({\n name: 'v-virtual-table',\n\n props: {\n chunkSize: {\n type: Number,\n default: 25,\n },\n headerHeight: {\n type: Number,\n default: 48,\n },\n items: {\n type: Array,\n default: () => ([]),\n } as PropValidator<any[]>,\n rowHeight: {\n type: Number,\n default: 48,\n },\n },\n\n data: () => ({\n scrollTop: 0,\n oldChunk: 0,\n scrollDebounce: null as any,\n invalidateCache: false,\n }),\n\n computed: {\n itemsLength (): number {\n return this.items.length\n },\n totalHeight (): number {\n return (this.itemsLength * this.rowHeight) + this.headerHeight\n },\n topIndex (): number {\n return Math.floor(this.scrollTop / this.rowHeight)\n },\n chunkIndex (): number {\n return Math.floor(this.topIndex / this.chunkSize)\n },\n startIndex (): number {\n return Math.max(0, (this.chunkIndex * this.chunkSize) - this.chunkSize)\n },\n offsetTop (): number {\n return Math.max(0, this.startIndex * this.rowHeight)\n },\n stopIndex (): number {\n return Math.min(this.startIndex + (this.chunkSize * 3), this.itemsLength)\n },\n offsetBottom (): number {\n return Math.max(0, (this.itemsLength - this.stopIndex - this.startIndex) * this.rowHeight)\n },\n },\n\n watch: {\n chunkIndex (newValue, oldValue) {\n this.oldChunk = oldValue\n },\n items () {\n this.cachedItems = null\n this.$refs.table.scrollTop = 0\n },\n },\n\n created () {\n this.cachedItems = null\n },\n\n mounted () {\n this.scrollDebounce = debounce(this.onScroll, 50)\n\n this.$refs.table.addEventListener('scroll', this.scrollDebounce, { passive: true })\n },\n\n beforeDestroy () {\n this.$refs.table.removeEventListener('scroll', this.scrollDebounce)\n },\n\n methods: {\n createStyleHeight (height: number) {\n return {\n height: `${height}px`,\n }\n },\n genBody () {\n if (this.cachedItems === null || this.chunkIndex !== this.oldChunk) {\n this.cachedItems = this.genItems()\n this.oldChunk = this.chunkIndex\n }\n\n return this.$createElement('tbody', [\n this.$createElement('tr', { style: this.createStyleHeight(this.offsetTop) }),\n this.cachedItems,\n this.$createElement('tr', { style: this.createStyleHeight(this.offsetBottom) }),\n ])\n },\n genItems () {\n return this.$scopedSlots.items!({ items: this.items.slice(this.startIndex, this.stopIndex) })\n },\n onScroll (e: Event) {\n const target = e.target as Element\n this.scrollTop = target.scrollTop\n },\n genTable () {\n return this.$createElement('div', {\n ref: 'table',\n staticClass: 'v-virtual-table__table',\n }, [\n this.$createElement('table', [\n this.$slots['body.before'],\n this.genBody(),\n this.$slots['body.after'],\n ]),\n ])\n },\n genWrapper () {\n return this.$createElement('div', {\n staticClass: 'v-virtual-table__wrapper',\n style: {\n height: convertToUnit(this.height),\n },\n }, [\n this.genTable(),\n ])\n },\n },\n\n render (h): VNode {\n return h('div', {\n staticClass: 'v-data-table v-virtual-table',\n class: this.classes,\n }, [\n this.$slots.top,\n this.genWrapper(),\n this.$slots.bottom,\n ])\n },\n})\n"],"sourceRoot":"","file":"VVirtualTable.js"}