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/VData/VData.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
20 KiB
Text

{"version":3,"sources":["../../../src/components/VData/VData.ts"],"names":[],"mappings":"AAAA;AACA,SAAS,WAAT,EAAsB,SAAtB,EAAiC,SAAjC,EAA4C,eAA5C,EAA6D,WAA7D,QAAgF,oBAAhF;AACA,OAAO,GAAP,MAAqC,KAArC;AAgCA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,QADkB;AAGxB,EAAA,YAAY,EAAE,KAHU;AAKxB,EAAA,KAAK,EAAE;AACL,IAAA,KAAK,EAAE;AACL,MAAA,IAAI,EAAE,KADD;AAEL,MAAA,OAAO,EAAE,MAAM;AAFV,KADF;AAKL,IAAA,OAAO,EAAE;AACP,MAAA,IAAI,EAAE,MADC;AAEP,MAAA,OAAO,EAAE,OAAO,EAAP;AAFF,KALJ;AASL,IAAA,MAAM,EAAE;AACN,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,KAAT,CADA;AAEN,MAAA,OAAO,EAAE,MAAM;AAFT,KATH;AAaL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE,CAAC,OAAD,EAAU,KAAV,CADE;AAER,MAAA,OAAO,EAAE,MAAM;AAFP,KAbL;AAiBL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,OAAO,EAAE;AAFC,KAjBP;AAqBL,IAAA,QAAQ,EAAE,OArBL;AAsBL,IAAA,SAAS,EAAE,OAtBN;AAuBL,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,MADF;AAEJ,MAAA,OAAO,EAAE;AAFL,KAvBD;AA2BL,IAAA,YAAY,EAAE;AACZ,MAAA,IAAI,EAAE,MADM;AAEZ,MAAA,OAAO,EAAE;AAFG,KA3BT;AA+BL,IAAA,OAAO,EAAE;AACP,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AAa,CAAE,KAAF,EAAc;AACzB;AACA;AACA,UAAI,KAAK,CAAC,MAAN,GAAe,KAAK,SAAxB,EAAmC,KAAK,eAAL,CAAqB,IAArB,GAA4B,CAA5B;AAEnC,aAAO,KAAK,CAAC,KAAN,CAAY,KAAK,SAAjB,EAA4B,KAAK,QAAjC,CAAP;AACD;;AAhFM,GAxOe;;AA2TxB,EAAA,MAAM,GAAA;AACJ,WAAO,KAAK,YAAL,CAAkB,OAAlB,IAA6B,KAAK,YAAL,CAAkB,OAAlB,CAA0B,KAAK,WAA/B,CAApC;AACD;;AA7TuB,CAAX,CAAf","sourcesContent":["// Helpers\nimport { wrapInArray, sortItems, deepEqual, groupByProperty, searchItems } from '../../util/helpers'\nimport Vue, { VNode, PropType } from 'vue'\n\nexport interface DataOptions {\n page: number\n itemsPerPage: number\n sortBy: string[]\n sortDesc: boolean[]\n groupBy: string[]\n groupDesc: boolean[]\n multiSort: boolean\n mustSort: boolean\n}\n\nexport interface DataPagination {\n page: number\n itemsPerPage: number\n pageStart: number\n pageStop: number\n pageCount: number\n itemsLength: number\n}\n\nexport interface DataProps {\n items: any[]\n pagination: DataPagination\n options: DataOptions\n updateOptions: (obj: any) => void\n sort: (value: string) => void\n group: (value: string) => void\n groupedItems: Record<string, any[]> | null\n}\n\nexport default Vue.extend({\n name: 'v-data',\n\n inheritAttrs: false,\n\n props: {\n items: {\n type: Array as PropType<any[]>,\n default: () => [],\n },\n options: {\n type: Object,\n default: () => ({}),\n },\n sortBy: {\n type: [String, Array] as PropType<string | string[]>,\n default: () => [],\n },\n sortDesc: {\n type: [Boolean, Array] as PropType<boolean | boolean[]>,\n default: () => [],\n },\n customSort: {\n type: Function as any as PropType<typeof sortItems>,\n default: sortItems,\n },\n mustSort: Boolean,\n multiSort: Boolean,\n page: {\n type: Number,\n default: 1,\n },\n itemsPerPage: {\n type: Number,\n default: 10,\n },\n groupBy: {\n type: [String, Array] as PropType<string | string[]>,\n default: () => [],\n },\n groupDesc: {\n type: [Boolean, Array] as PropType<boolean | boolean[]>,\n default: () => [],\n },\n locale: {\n type: String,\n default: 'en-US',\n },\n disableSort: Boolean,\n disablePagination: Boolean,\n disableFiltering: Boolean,\n search: String,\n customFilter: {\n type: Function as any as PropType<typeof searchItems>,\n default: searchItems,\n },\n serverItemsLength: {\n type: Number,\n default: -1,\n },\n },\n\n data () {\n return {\n internalOptions: {\n page: this.page,\n itemsPerPage: this.itemsPerPage,\n sortBy: wrapInArray(this.sortBy),\n sortDesc: wrapInArray(this.sortDesc),\n groupBy: wrapInArray(this.groupBy),\n groupDesc: wrapInArray(this.groupDesc),\n mustSort: this.mustSort,\n multiSort: this.multiSort,\n } as DataOptions,\n }\n },\n\n computed: {\n itemsLength (): number {\n return this.serverItemsLength >= 0 ? this.serverItemsLength : this.filteredItems.length\n },\n pageCount (): number {\n return this.internalOptions.itemsPerPage === -1\n ? 1\n : Math.ceil(this.itemsLength / this.internalOptions.itemsPerPage) // TODO: can't use items.length here\n },\n pageStart (): number {\n if (this.internalOptions.itemsPerPage === -1 || !this.items.length) return 0\n\n return (this.internalOptions.page - 1) * this.internalOptions.itemsPerPage\n },\n pageStop (): number {\n if (this.internalOptions.itemsPerPage === -1) return this.itemsLength\n if (!this.items.length) return 0\n\n return Math.min(this.itemsLength, this.internalOptions.page * this.internalOptions.itemsPerPage)\n },\n isGrouped (): boolean {\n return !!this.internalOptions.groupBy.length\n },\n pagination (): DataPagination {\n return {\n page: this.internalOptions.page,\n itemsPerPage: this.internalOptions.itemsPerPage,\n pageStart: this.pageStart,\n pageStop: this.pageStop,\n pageCount: this.pageCount,\n itemsLength: this.itemsLength,\n }\n },\n filteredItems (): any[] {\n let items = this.items.slice()\n\n if (!this.disableFiltering && this.serverItemsLength <= 0) {\n items = this.customFilter(items, this.search)\n }\n\n return items\n },\n computedItems (): any[] {\n let items = this.filteredItems.slice()\n\n if (!this.disableSort && this.serverItemsLength <= 0) {\n items = this.sortItems(items)\n }\n\n if (!this.disablePagination && this.serverItemsLength <= 0) {\n items = this.paginateItems(items)\n }\n\n return items\n },\n groupedItems (): Record<string, any[]> | null {\n return this.isGrouped ? groupByProperty(this.computedItems, this.internalOptions.groupBy[0]) : null\n },\n scopedProps (): DataProps {\n const props = {\n sort: this.sort,\n sortArray: this.sortArray,\n group: this.group,\n items: this.computedItems,\n options: this.internalOptions,\n updateOptions: this.updateOptions,\n pagination: this.pagination,\n groupedItems: this.groupedItems,\n }\n\n return props\n },\n },\n\n watch: {\n options: {\n handler (options: DataOptions, old: DataOptions) {\n if (deepEqual(options, old)) return\n\n this.updateOptions(options)\n },\n deep: true,\n immediate: true,\n },\n internalOptions: {\n handler (options: DataOptions, old: DataOptions) {\n if (deepEqual(options, old)) return\n this.$emit('update:options', options)\n this.$emit('pagination', this.pagination)\n },\n deep: true,\n immediate: true,\n },\n page (page: number) {\n this.updateOptions({ page })\n },\n 'internalOptions.page' (page: number) {\n this.$emit('update:page', page)\n },\n itemsPerPage (itemsPerPage: number) {\n this.updateOptions({ itemsPerPage })\n },\n 'internalOptions.itemsPerPage' (itemsPerPage: number) {\n this.$emit('update:items-per-page', itemsPerPage)\n },\n sortBy (sortBy: string | string[]) {\n this.updateOptions({ sortBy: wrapInArray(sortBy) })\n },\n 'internalOptions.sortBy' (sortBy: string[], old: string[]) {\n !deepEqual(sortBy, old) && this.$emit('update:sort-by', Array.isArray(this.sortBy) ? sortBy : sortBy[0])\n },\n sortDesc (sortDesc: boolean | boolean[]) {\n this.updateOptions({ sortDesc: wrapInArray(sortDesc) })\n },\n 'internalOptions.sortDesc' (sortDesc: boolean[], old: boolean[]) {\n !deepEqual(sortDesc, old) && this.$emit('update:sort-desc', Array.isArray(this.sortDesc) ? sortDesc : sortDesc[0])\n },\n groupBy (groupBy: string | string[]) {\n this.updateOptions({ groupBy: wrapInArray(groupBy) })\n },\n 'internalOptions.groupBy' (groupBy: string[], old: string[]) {\n !deepEqual(groupBy, old) && this.$emit('update:group-by', Array.isArray(this.groupBy) ? groupBy : groupBy[0])\n },\n groupDesc (groupDesc: boolean | boolean[]) {\n this.updateOptions({ groupDesc: wrapInArray(groupDesc) })\n },\n 'internalOptions.groupDesc' (groupDesc: boolean[], old: boolean[]) {\n !deepEqual(groupDesc, old) && this.$emit('update:group-desc', Array.isArray(this.groupDesc) ? groupDesc : groupDesc[0])\n },\n multiSort (multiSort: boolean) {\n this.updateOptions({ multiSort })\n },\n 'internalOptions.multiSort' (multiSort: boolean) {\n this.$emit('update:multi-sort', multiSort)\n },\n mustSort (mustSort: boolean) {\n this.updateOptions({ mustSort })\n },\n 'internalOptions.mustSort' (mustSort: boolean) {\n this.$emit('update:must-sort', mustSort)\n },\n pageCount: {\n handler (pageCount: number) {\n this.$emit('page-count', pageCount)\n },\n immediate: true,\n },\n computedItems: {\n handler (computedItems: any[]) {\n this.$emit('current-items', computedItems)\n },\n immediate: true,\n },\n },\n\n methods: {\n toggle (key: string, oldBy: string[], oldDesc: boolean[], page: number, mustSort: boolean, multiSort: boolean) {\n let by = oldBy.slice()\n let desc = oldDesc.slice()\n const byIndex = by.findIndex((k: string) => k === key)\n\n if (byIndex < 0) {\n if (!multiSort) {\n by = []\n desc = []\n }\n\n by.push(key)\n desc.push(false)\n } else if (byIndex >= 0 && !desc[byIndex]) {\n desc[byIndex] = true\n } else if (!mustSort) {\n by.splice(byIndex, 1)\n desc.splice(byIndex, 1)\n } else {\n desc[byIndex] = false\n }\n\n // Reset page to 1 if sortBy or sortDesc have changed\n if (!deepEqual(by, oldBy) || !deepEqual(desc, oldDesc)) {\n page = 1\n }\n\n return { by, desc, page }\n },\n group (key: string): void {\n const { by: groupBy, desc: groupDesc, page } = this.toggle(\n key,\n this.internalOptions.groupBy,\n this.internalOptions.groupDesc,\n this.internalOptions.page,\n true,\n false\n )\n this.updateOptions({ groupBy, groupDesc, page })\n },\n sort (key: string | string[]): void {\n if (Array.isArray(key)) return this.sortArray(key)\n\n const { by: sortBy, desc: sortDesc, page } = this.toggle(\n key,\n this.internalOptions.sortBy,\n this.internalOptions.sortDesc,\n this.internalOptions.page,\n this.mustSort,\n this.multiSort\n )\n this.updateOptions({ sortBy, sortDesc, page })\n },\n sortArray (sortBy: string[]) {\n const sortDesc = sortBy.map(s => {\n const i = this.internalOptions.sortBy.findIndex((k: string) => k === s)\n return i > -1 ? this.internalOptions.sortDesc[i] : false\n })\n\n this.updateOptions({ sortBy, sortDesc })\n },\n updateOptions (options: any) {\n this.internalOptions = {\n ...this.internalOptions,\n ...options,\n page: Math.max(1, Math.min(options.page || this.internalOptions.page, this.pageCount)),\n }\n },\n sortItems (items: any[]) {\n const sortBy = this.internalOptions.groupBy.concat(this.internalOptions.sortBy)\n const sortDesc = this.internalOptions.groupDesc.concat(this.internalOptions.sortDesc)\n return this.customSort(items, sortBy, sortDesc, this.locale)\n },\n paginateItems (items: any[]) {\n // Make sure we don't try to display non-existant page if items suddenly change\n // TODO: Could possibly move this to pageStart/pageStop?\n if (items.length < this.pageStart) this.internalOptions.page = 1\n\n return items.slice(this.pageStart, this.pageStop)\n },\n },\n\n render (): VNode {\n return this.$scopedSlots.default && this.$scopedSlots.default(this.scopedProps) as any\n },\n})\n"],"sourceRoot":"","file":"VData.js"}