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;AACzB,4BAAQ,IAAR,CAAa,MAAb;AACA,yBAAK,KAAL,CAAW,WAAX,IAA0B,YAA1B;AACA,yBAAK,KAAL,CAAW,YAAX,KAA4B,kDAA5B,CAHyB,CAGsD;AAChF,iBAJD,MAIO;AACL,4BAAQ,IAAR,CAAa,KAAb;AACA,yBAAK,KAAL,CAAW,WAAX,IAA0B,WAA1B;AACA,yBAAK,KAAL,CAAW,YAAX,KAA4B,kDAA5B,CAHK,CAG0E;AAChF;AACF,aAXD,MAWO;AACL,qBAAK,KAAL,CAAW,YAAX,KAA4B,2CAA5B,CADK,CACmE;AACzE;AACF;AAzHM;AARI,CAAf","sourcesContent":["import { consoleWarn } from '../../../util/console'\n\nimport VCheckbox from '../../VCheckbox'\nimport VIcon from '../../VIcon'\n\n/* @vue/component */\nexport default {\n props: {\n sortIcon: {\n type: String,\n default: '$vuetify.icons.sort'\n }\n },\n\n methods: {\n genTHead () {\n if (this.hideHeaders) return // Exit Early since no headers are needed.\n\n let children = []\n\n if (this.$scopedSlots.headers) {\n const row = this.$scopedSlots.headers({\n headers: this.headers,\n indeterminate: this.indeterminate,\n all: this.everyItem\n })\n\n children = [this.hasTag(row, 'th') ? this.genTR(row) : row, this.genTProgress()]\n } else {\n const row = this.headers.map((o, i) => this.genHeader(o, this.headerKey ? o[this.headerKey] : i))\n const checkbox = this.$createElement(VCheckbox, {\n props: {\n dark: this.dark,\n light: this.light,\n color: this.selectAll === true ? '' : this.selectAll,\n hideDetails: true,\n inputValue: this.everyItem,\n indeterminate: this.indeterminate\n },\n on: { change: this.toggle }\n })\n\n this.hasSelectAll && row.unshift(this.$createElement('th', [checkbox]))\n\n children = [this.genTR(row), this.genTProgress()]\n }\n\n return this.$createElement('thead', [children])\n },\n genHeader (header, key) {\n const array = [\n this.$scopedSlots.headerCell\n ? this.$scopedSlots.headerCell({ header })\n : header[this.headerText]\n ]\n\n return this.$createElement('th', ...this.genHeaderData(header, array, key))\n },\n genHeaderData (header, children, key) {\n const classes = ['column']\n const data = {\n key,\n attrs: {\n role: 'columnheader',\n scope: 'col',\n width: header.width || null,\n 'aria-label': header[this.headerText] || '',\n 'aria-sort': 'none'\n }\n }\n\n if (header.sortable == null || header.sortable) {\n this.genHeaderSortingData(header, children, data, classes)\n } else {\n data.attrs['aria-label'] += ': Not sorted.' // TODO: Localization\n }\n\n classes.push(`text-xs-${header.align || 'left'}`)\n if (Array.isArray(header.class)) {\n classes.push(...header.class)\n } else if (header.class) {\n classes.push(header.class)\n }\n data.class = classes\n\n return [data, children]\n },\n genHeaderSortingData (header, children, data, classes) {\n if (!('value' in header)) {\n consoleWarn('Headers must have a value property that corresponds to a value in the v-model array', this)\n }\n\n data.attrs.tabIndex = 0\n data.on = {\n click: () => {\n this.expanded = {}\n this.sort(header.value)\n },\n keydown: e => {\n // check for space\n if (e.keyCode === 32) {\n e.preventDefault()\n this.sort(header.value)\n }\n }\n }\n\n classes.push('sortable')\n const icon = this.$createElement(VIcon, {\n props: {\n small: true\n }\n }, this.sortIcon)\n if (!header.align || header.align === 'left') {\n children.push(icon)\n } else {\n children.unshift(icon)\n }\n\n const pagination = this.computedPagination\n const beingSorted = pagination.sortBy === header.value\n if (beingSorted) {\n classes.push('active')\n if (pagination.descending) {\n classes.push('desc')\n data.attrs['aria-sort'] = 'descending'\n data.attrs['aria-label'] += ': Sorted descending. Activate to remove sorting.' // TODO: Localization\n } else {\n classes.push('asc')\n data.attrs['aria-sort'] = 'ascending'\n data.attrs['aria-label'] += ': Sorted ascending. Activate to sort descending.' // TODO: Localization\n }\n } else {\n data.attrs['aria-label'] += ': Not sorted. Activate to sort ascending.' // TODO: Localization\n }\n }\n }\n}\n"],"sourceRoot":""}
|