vuetify eingebunden + erster Versuch Combobox
This commit is contained in:
+132
@@ -0,0 +1,132 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
require('../../../src/stylus/components/_tables.styl');
|
||||
|
||||
require('../../../src/stylus/components/_data-table.styl');
|
||||
|
||||
var _dataIterable = require('../../mixins/data-iterable');
|
||||
|
||||
var _dataIterable2 = _interopRequireDefault(_dataIterable);
|
||||
|
||||
var _head = require('./mixins/head');
|
||||
|
||||
var _head2 = _interopRequireDefault(_head);
|
||||
|
||||
var _body = require('./mixins/body');
|
||||
|
||||
var _body2 = _interopRequireDefault(_body);
|
||||
|
||||
var _foot = require('./mixins/foot');
|
||||
|
||||
var _foot2 = _interopRequireDefault(_foot);
|
||||
|
||||
var _progress = require('./mixins/progress');
|
||||
|
||||
var _progress2 = _interopRequireDefault(_progress);
|
||||
|
||||
var _helpers = require('../../util/helpers');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
// Importing does not work properly
|
||||
var VTableOverflow = (0, _helpers.createSimpleFunctional)('v-table__overflow');
|
||||
/* @vue/component */
|
||||
exports.default = {
|
||||
name: 'v-data-table',
|
||||
mixins: [_dataIterable2.default, _head2.default, _body2.default, _foot2.default, _progress2.default],
|
||||
props: {
|
||||
headers: {
|
||||
type: Array,
|
||||
default: function _default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
headersLength: {
|
||||
type: Number
|
||||
},
|
||||
headerText: {
|
||||
type: String,
|
||||
default: 'text'
|
||||
},
|
||||
headerKey: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
hideHeaders: Boolean,
|
||||
rowsPerPageText: {
|
||||
type: String,
|
||||
default: '$vuetify.dataTable.rowsPerPageText'
|
||||
},
|
||||
customFilter: {
|
||||
type: Function,
|
||||
default: function _default(items, search, filter, headers) {
|
||||
search = search.toString().toLowerCase();
|
||||
if (search.trim() === '') return items;
|
||||
var props = headers.map(function (h) {
|
||||
return h.value;
|
||||
});
|
||||
return items.filter(function (item) {
|
||||
return props.some(function (prop) {
|
||||
return filter((0, _helpers.getObjectValueByPath)(item, prop, item[prop]), search);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
actionsClasses: 'v-datatable__actions',
|
||||
actionsRangeControlsClasses: 'v-datatable__actions__range-controls',
|
||||
actionsSelectClasses: 'v-datatable__actions__select',
|
||||
actionsPaginationClasses: 'v-datatable__actions__pagination'
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
classes: function classes() {
|
||||
return _extends({
|
||||
'v-datatable v-table': true,
|
||||
'v-datatable--select-all': this.selectAll !== false
|
||||
}, this.themeClasses);
|
||||
},
|
||||
filteredItems: function filteredItems() {
|
||||
return this.filteredItemsImpl(this.headers);
|
||||
},
|
||||
headerColumns: function headerColumns() {
|
||||
return this.headersLength || this.headers.length + (this.selectAll !== false);
|
||||
}
|
||||
},
|
||||
created: function created() {
|
||||
var firstSortable = this.headers.find(function (h) {
|
||||
return !('sortable' in h) || h.sortable;
|
||||
});
|
||||
this.defaultPagination.sortBy = !this.disableInitialSort && firstSortable ? firstSortable.value : null;
|
||||
this.initPagination();
|
||||
},
|
||||
|
||||
methods: {
|
||||
hasTag: function hasTag(elements, tag) {
|
||||
return Array.isArray(elements) && elements.find(function (e) {
|
||||
return e.tag === tag;
|
||||
});
|
||||
},
|
||||
genTR: function genTR(children) {
|
||||
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
return this.$createElement('tr', data, children);
|
||||
}
|
||||
},
|
||||
render: function render(h) {
|
||||
var tableOverflow = h(VTableOverflow, {}, [h('table', {
|
||||
'class': this.classes
|
||||
}, [this.genTHead(), this.genTBody(), this.genTFoot()])]);
|
||||
return h('div', [tableOverflow, this.genActionsFooter()]);
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=VDataTable.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+142
@@ -0,0 +1,142 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
require('../../../src/stylus/components/_small-dialog.styl');
|
||||
|
||||
var _returnable = require('../../mixins/returnable');
|
||||
|
||||
var _returnable2 = _interopRequireDefault(_returnable);
|
||||
|
||||
var _themeable = require('../../mixins/themeable');
|
||||
|
||||
var _themeable2 = _interopRequireDefault(_themeable);
|
||||
|
||||
var _helpers = require('../../util/helpers');
|
||||
|
||||
var _VBtn = require('../VBtn');
|
||||
|
||||
var _VBtn2 = _interopRequireDefault(_VBtn);
|
||||
|
||||
var _VMenu = require('../VMenu');
|
||||
|
||||
var _VMenu2 = _interopRequireDefault(_VMenu);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* @vue/component */
|
||||
exports.default = {
|
||||
name: 'v-edit-dialog',
|
||||
mixins: [_returnable2.default, _themeable2.default],
|
||||
props: {
|
||||
cancelText: {
|
||||
default: 'Cancel'
|
||||
},
|
||||
large: Boolean,
|
||||
lazy: Boolean,
|
||||
persistent: Boolean,
|
||||
saveText: {
|
||||
default: 'Save'
|
||||
},
|
||||
transition: {
|
||||
type: String,
|
||||
default: 'slide-x-reverse-transition'
|
||||
}
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
isActive: false
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
isActive: function isActive(val) {
|
||||
if (val) {
|
||||
this.$emit('open');
|
||||
setTimeout(this.focus, 50); // Give DOM time to paint
|
||||
} else {
|
||||
this.$emit('close');
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel: function cancel() {
|
||||
this.isActive = false;
|
||||
this.$emit('cancel');
|
||||
},
|
||||
focus: function focus() {
|
||||
var input = this.$refs.content.querySelector('input');
|
||||
input && input.focus();
|
||||
},
|
||||
genButton: function genButton(fn, text) {
|
||||
return this.$createElement(_VBtn2.default, {
|
||||
props: {
|
||||
flat: true,
|
||||
color: 'primary',
|
||||
light: true
|
||||
},
|
||||
on: { click: fn }
|
||||
}, text);
|
||||
},
|
||||
genActions: function genActions() {
|
||||
var _this = this;
|
||||
|
||||
return this.$createElement('div', {
|
||||
'class': 'v-small-dialog__actions'
|
||||
}, [this.genButton(this.cancel, this.cancelText), this.genButton(function () {
|
||||
_this.save(_this.returnValue);
|
||||
_this.$emit('save');
|
||||
}, this.saveText)]);
|
||||
},
|
||||
genContent: function genContent() {
|
||||
var _this2 = this;
|
||||
|
||||
return this.$createElement('div', {
|
||||
on: {
|
||||
keydown: function keydown(e) {
|
||||
var input = _this2.$refs.content.querySelector('input');
|
||||
e.keyCode === _helpers.keyCodes.esc && _this2.cancel();
|
||||
if (e.keyCode === _helpers.keyCodes.enter && input) {
|
||||
_this2.save(input.value);
|
||||
_this2.$emit('save');
|
||||
}
|
||||
}
|
||||
},
|
||||
ref: 'content'
|
||||
}, [this.$slots.input]);
|
||||
}
|
||||
},
|
||||
render: function render(h) {
|
||||
var _this3 = this;
|
||||
|
||||
return h(_VMenu2.default, {
|
||||
staticClass: 'v-small-dialog',
|
||||
class: this.themeClasses,
|
||||
props: {
|
||||
contentClass: 'v-small-dialog__content',
|
||||
transition: this.transition,
|
||||
origin: 'top right',
|
||||
right: true,
|
||||
value: this.isActive,
|
||||
closeOnClick: !this.persistent,
|
||||
closeOnContentClick: false,
|
||||
lazy: this.lazy,
|
||||
light: this.light,
|
||||
dark: this.dark
|
||||
},
|
||||
on: {
|
||||
input: function input(val) {
|
||||
return _this3.isActive = val;
|
||||
}
|
||||
}
|
||||
}, [h('a', {
|
||||
slot: 'activator'
|
||||
}, this.$slots.default), this.genContent(), this.large ? this.genActions() : null]);
|
||||
}
|
||||
};
|
||||
// Utils
|
||||
|
||||
// Mixins
|
||||
//# sourceMappingURL=VEditDialog.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+31
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.VTableOverflow = exports.VEditDialog = exports.VDataTable = undefined;
|
||||
|
||||
var _helpers = require('../../util/helpers');
|
||||
|
||||
var _VDataTable = require('./VDataTable');
|
||||
|
||||
var _VDataTable2 = _interopRequireDefault(_VDataTable);
|
||||
|
||||
var _VEditDialog = require('./VEditDialog');
|
||||
|
||||
var _VEditDialog2 = _interopRequireDefault(_VEditDialog);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var VTableOverflow = (0, _helpers.createSimpleFunctional)('v-table__overflow');
|
||||
exports.VDataTable = _VDataTable2.default;
|
||||
exports.VEditDialog = _VEditDialog2.default;
|
||||
exports.VTableOverflow = VTableOverflow;
|
||||
exports.default = {
|
||||
$_vuetify_subcomponents: {
|
||||
VDataTable: _VDataTable2.default,
|
||||
VEditDialog: _VEditDialog2.default,
|
||||
VTableOverflow: VTableOverflow
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/VDataTable/index.js"],"names":[],"mappings":";;;;;;;;;AAEA;;;;AACA;;;;;;AAEA,IAAM,iBAAiB,qCAAuB,mBAAvB,CAAvB;QAES,U,GAAA,oB;QAAY,W,GAAA,qB;QAAa,c,GAAA,c;kBAEnB;AACb,6BAAyB;AACvB,wCADuB;AAEvB,0CAFuB;AAGvB;AAHuB;AADZ,C","sourcesContent":["import { createSimpleFunctional } from '../../util/helpers'\n\nimport VDataTable from './VDataTable'\nimport VEditDialog from './VEditDialog'\n\nconst VTableOverflow = createSimpleFunctional('v-table__overflow')\n\nexport { VDataTable, VEditDialog, VTableOverflow }\n\nexport default {\n $_vuetify_subcomponents: {\n VDataTable,\n VEditDialog,\n VTableOverflow\n }\n}\n"],"sourceRoot":""}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _expandTransition = require('../../transitions/expand-transition');
|
||||
|
||||
var _expandTransition2 = _interopRequireDefault(_expandTransition);
|
||||
|
||||
var _helpers = require('../../../util/helpers');
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* @vue/component */
|
||||
exports.default = {
|
||||
methods: {
|
||||
genTBody: function genTBody() {
|
||||
var children = this.genItems();
|
||||
return this.$createElement('tbody', children);
|
||||
},
|
||||
genExpandedRow: function genExpandedRow(props) {
|
||||
var children = [];
|
||||
if (this.isExpanded(props.item)) {
|
||||
var expand = this.$createElement('div', {
|
||||
class: 'v-datatable__expand-content',
|
||||
key: (0, _helpers.getObjectValueByPath)(props.item, this.itemKey)
|
||||
}, [this.$scopedSlots.expand(props)]);
|
||||
children.push(expand);
|
||||
}
|
||||
var transition = this.$createElement('transition-group', {
|
||||
class: 'v-datatable__expand-col',
|
||||
attrs: { colspan: this.headerColumns },
|
||||
props: {
|
||||
tag: 'td'
|
||||
},
|
||||
on: (0, _expandTransition2.default)('v-datatable__expand-col--expanded')
|
||||
}, children);
|
||||
return this.genTR([transition], { class: 'v-datatable__expand-row' });
|
||||
},
|
||||
genFilteredItems: function genFilteredItems() {
|
||||
if (!this.$scopedSlots.items) {
|
||||
return null;
|
||||
}
|
||||
var rows = [];
|
||||
for (var index = 0, len = this.filteredItems.length; index < len; ++index) {
|
||||
var item = this.filteredItems[index];
|
||||
var props = this.createProps(item, index);
|
||||
var row = this.$scopedSlots.items(props);
|
||||
rows.push(this.hasTag(row, 'td') ? this.genTR(row, {
|
||||
key: this.itemKey ? (0, _helpers.getObjectValueByPath)(props.item, this.itemKey) : index,
|
||||
attrs: { active: this.isSelected(item) }
|
||||
}) : row);
|
||||
if (this.$scopedSlots.expand) {
|
||||
var expandRow = this.genExpandedRow(props);
|
||||
rows.push(expandRow);
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
},
|
||||
genEmptyItems: function genEmptyItems(content) {
|
||||
if (this.hasTag(content, 'tr')) {
|
||||
return content;
|
||||
} else if (this.hasTag(content, 'td')) {
|
||||
return this.genTR(content);
|
||||
} else {
|
||||
return this.genTR([this.$createElement('td', {
|
||||
class: {
|
||||
'text-xs-center': typeof content === 'string'
|
||||
},
|
||||
attrs: { colspan: this.headerColumns }
|
||||
}, content)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=body.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/components/VDataTable/mixins/body.js"],"names":[],"mappings":";;;;;;;;;;AAEA;;;;AAEA;kBACe;AACb,aAAS;AACP,gBADO,sBACC;AACN,gBAAM,WAAW,KAAK,QAAL,EAAjB;AAEA,mBAAO,KAAK,cAAL,CAAoB,OAApB,EAA6B,QAA7B,CAAP;AACD,SALM;AAMP,sBANO,0BAMS,KANT,EAMc;AACnB,gBAAM,WAAW,EAAjB;AAEA,gBAAI,KAAK,UAAL,CAAgB,MAAM,IAAtB,CAAJ,EAAiC;AAC/B,oBAAM,SAAS,KAAK,cAAL,CAAoB,KAApB,EAA2B;AACxC,2BAAO,6BADiC;AAExC,yBAAK,mCAAqB,MAAM,IAA3B,EAAiC,KAAK,OAAtC;AAFmC,iBAA3B,EAGZ,CAAC,KAAK,YAAL,CAAkB,MAAlB,CAAyB,KAAzB,CAAD,CAHY,CAAf;AAKA,yBAAS,IAAT,CAAc,MAAd;AACD;AAED,gBAAM,aAAa,KAAK,cAAL,CAAoB,kBAApB,EAAwC;AACzD,uBAAO,yBADkD;AAEzD,uBAAO,EAAE,SAAS,KAAK,aAAhB,EAFkD;AAGzD,uBAAO;AACL,yBAAK;AADA,iBAHkD;AAMzD,oBAAI,gCAA0B,mCAA1B;AANqD,aAAxC,EAOhB,QAPgB,CAAnB;AASA,mBAAO,KAAK,KAAL,CAAW,CAAC,UAAD,CAAX,EAAyB,EAAE,OAAO,yBAAT,EAAzB,CAAP;AACD,SA5BM;AA6BP,wBA7BO,8BA6BS;AACd,gBAAI,CAAC,KAAK,YAAL,CAAkB,KAAvB,EAA8B;AAC5B,uBAAO,IAAP;AACD;AAED,gBAAM,OAAO,EAAb;AACA,iBAAK,IAAI,QAAQ,CAAZ,EAAe,MAAM,KAAK,aAAL,CAAmB,MAA7C,EAAqD,QAAQ,GAA7D,EAAkE,EAAE,KAApE,EAA2E;AACzE,oBAAM,OAAO,KAAK,aAAL,CAAmB,KAAnB,CAAb;AACA,oBAAM,QAAQ,KAAK,WAAL,CAAiB,IAAjB,EAAuB,KAAvB,CAAd;AACA,oBAAM,MAAM,KAAK,YAAL,CAAkB,KAAlB,CAAwB,KAAxB,CAAZ;AAEA,qBAAK,IAAL,CAAU,KAAK,MAAL,CAAY,GAAZ,EAAiB,IAAjB,IACN,KAAK,KAAL,CAAW,GAAX,EAAgB;AAChB,yBAAK,KAAK,OAAL,GAAe,mCAAqB,MAAM,IAA3B,EAAiC,KAAK,OAAtC,CAAf,GAAgE,KADrD;AAEhB,2BAAO,EAAE,QAAQ,KAAK,UAAL,CAAgB,IAAhB,CAAV;AAFS,iBAAhB,CADM,GAKN,GALJ;AAOA,oBAAI,KAAK,YAAL,CAAkB,MAAtB,EAA8B;AAC5B,wBAAM,YAAY,KAAK,cAAL,CAAoB,KAApB,CAAlB;AACA,yBAAK,IAAL,CAAU,SAAV;AACD;AACF;AAED,mBAAO,IAAP;AACD,SAtDM;AAuDP,qBAvDO,yBAuDQ,OAvDR,EAuDe;AACpB,gBAAI,KAAK,MAAL,CAAY,OAAZ,EAAqB,IAArB,CAAJ,EAAgC;AAC9B,uBAAO,OAAP;AACD,aAFD,MAEO,IAAI,KAAK,MAAL,CAAY,OAAZ,EAAqB,IAArB,CAAJ,EAAgC;AACrC,uBAAO,KAAK,KAAL,CAAW,OAAX,CAAP;AACD,aAFM,MAEA;AACL,uBAAO,KAAK,KAAL,CAAW,CAAC,KAAK,cAAL,CAAoB,IAApB,EAA0B;AAC3C,2BAAO;AACL,0CAAkB,OAAO,OAAP,KAAmB;AADhC,qBADoC;AAI3C,2BAAO,EAAE,SAAS,KAAK,aAAhB;AAJoC,iBAA1B,EAKhB,OALgB,CAAD,CAAX,CAAP;AAMD;AACF;AApEM;AADI,C","sourcesContent":["import ExpandTransitionGenerator from '../../transitions/expand-transition'\n\nimport { getObjectValueByPath } from '../../../util/helpers'\n\n/* @vue/component */\nexport default {\n methods: {\n genTBody () {\n const children = this.genItems()\n\n return this.$createElement('tbody', children)\n },\n genExpandedRow (props) {\n const children = []\n\n if (this.isExpanded(props.item)) {\n const expand = this.$createElement('div', {\n class: 'v-datatable__expand-content',\n key: getObjectValueByPath(props.item, this.itemKey)\n }, [this.$scopedSlots.expand(props)])\n\n children.push(expand)\n }\n\n const transition = this.$createElement('transition-group', {\n class: 'v-datatable__expand-col',\n attrs: { colspan: this.headerColumns },\n props: {\n tag: 'td'\n },\n on: ExpandTransitionGenerator('v-datatable__expand-col--expanded')\n }, children)\n\n return this.genTR([transition], { class: 'v-datatable__expand-row' })\n },\n genFilteredItems () {\n if (!this.$scopedSlots.items) {\n return null\n }\n\n const rows = []\n for (let index = 0, len = this.filteredItems.length; index < len; ++index) {\n const item = this.filteredItems[index]\n const props = this.createProps(item, index)\n const row = this.$scopedSlots.items(props)\n\n rows.push(this.hasTag(row, 'td')\n ? this.genTR(row, {\n key: this.itemKey ? getObjectValueByPath(props.item, this.itemKey) : index,\n attrs: { active: this.isSelected(item) }\n })\n : row)\n\n if (this.$scopedSlots.expand) {\n const expandRow = this.genExpandedRow(props)\n rows.push(expandRow)\n }\n }\n\n return rows\n },\n genEmptyItems (content) {\n if (this.hasTag(content, 'tr')) {\n return content\n } else if (this.hasTag(content, 'td')) {\n return this.genTR(content)\n } else {\n return this.genTR([this.$createElement('td', {\n class: {\n 'text-xs-center': typeof content === 'string'\n },\n attrs: { colspan: this.headerColumns }\n }, content)])\n }\n }\n }\n}\n"],"sourceRoot":""}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
/* @vue/component */
|
||||
exports.default = {
|
||||
methods: {
|
||||
genTFoot: function genTFoot() {
|
||||
if (!this.$slots.footer) {
|
||||
return null;
|
||||
}
|
||||
var footer = this.$slots.footer;
|
||||
var row = this.hasTag(footer, 'td') ? this.genTR(footer) : footer;
|
||||
return this.$createElement('tfoot', [row]);
|
||||
},
|
||||
genActionsFooter: function genActionsFooter() {
|
||||
if (this.hideActions) {
|
||||
return null;
|
||||
}
|
||||
return this.$createElement('div', {
|
||||
'class': this.classes
|
||||
}, this.genActions());
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=foot.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/components/VDataTable/mixins/foot.js"],"names":[],"mappings":";;;;;;kBACe;AACb,aAAS;AACP,gBADO,sBACC;AACN,gBAAI,CAAC,KAAK,MAAL,CAAY,MAAjB,EAAyB;AACvB,uBAAO,IAAP;AACD;AAED,gBAAM,SAAS,KAAK,MAAL,CAAY,MAA3B;AACA,gBAAM,MAAM,KAAK,MAAL,CAAY,MAAZ,EAAoB,IAApB,IAA4B,KAAK,KAAL,CAAW,MAAX,CAA5B,GAAiD,MAA7D;AAEA,mBAAO,KAAK,cAAL,CAAoB,OAApB,EAA6B,CAAC,GAAD,CAA7B,CAAP;AACD,SAVM;AAWP,wBAXO,8BAWS;AACd,gBAAI,KAAK,WAAT,EAAsB;AACpB,uBAAO,IAAP;AACD;AAED,mBAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,yBAAS,KAAK;AADkB,aAA3B,EAEJ,KAAK,UAAL,EAFI,CAAP;AAGD;AAnBM;AADI,C","sourcesContent":["/* @vue/component */\nexport default {\n methods: {\n genTFoot () {\n if (!this.$slots.footer) {\n return null\n }\n\n const footer = this.$slots.footer\n const row = this.hasTag(footer, 'td') ? this.genTR(footer) : footer\n\n return this.$createElement('tfoot', [row])\n },\n genActionsFooter () {\n if (this.hideActions) {\n return null\n }\n\n return this.$createElement('div', {\n 'class': this.classes\n }, this.genActions())\n }\n }\n}\n"],"sourceRoot":""}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _console = require('../../../util/console');
|
||||
|
||||
var _VCheckbox = require('../../VCheckbox');
|
||||
|
||||
var _VCheckbox2 = _interopRequireDefault(_VCheckbox);
|
||||
|
||||
var _VIcon = require('../../VIcon');
|
||||
|
||||
var _VIcon2 = _interopRequireDefault(_VIcon);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
||||
|
||||
/* @vue/component */
|
||||
exports.default = {
|
||||
props: {
|
||||
sortIcon: {
|
||||
type: String,
|
||||
default: '$vuetify.icons.sort'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
genTHead: function genTHead() {
|
||||
var _this = this;
|
||||
|
||||
if (this.hideHeaders) return; // Exit Early since no headers are needed.
|
||||
var children = [];
|
||||
if (this.$scopedSlots.headers) {
|
||||
var row = this.$scopedSlots.headers({
|
||||
headers: this.headers,
|
||||
indeterminate: this.indeterminate,
|
||||
all: this.everyItem
|
||||
});
|
||||
children = [this.hasTag(row, 'th') ? this.genTR(row) : row, this.genTProgress()];
|
||||
} else {
|
||||
var _row = this.headers.map(function (o, i) {
|
||||
return _this.genHeader(o, _this.headerKey ? o[_this.headerKey] : i);
|
||||
});
|
||||
var checkbox = this.$createElement(_VCheckbox2.default, {
|
||||
props: {
|
||||
dark: this.dark,
|
||||
light: this.light,
|
||||
color: this.selectAll === true ? '' : this.selectAll,
|
||||
hideDetails: true,
|
||||
inputValue: this.everyItem,
|
||||
indeterminate: this.indeterminate
|
||||
},
|
||||
on: { change: this.toggle }
|
||||
});
|
||||
this.hasSelectAll && _row.unshift(this.$createElement('th', [checkbox]));
|
||||
children = [this.genTR(_row), this.genTProgress()];
|
||||
}
|
||||
return this.$createElement('thead', [children]);
|
||||
},
|
||||
genHeader: function genHeader(header, key) {
|
||||
var array = [this.$scopedSlots.headerCell ? this.$scopedSlots.headerCell({ header: header }) : header[this.headerText]];
|
||||
return this.$createElement.apply(this, ['th'].concat(_toConsumableArray(this.genHeaderData(header, array, key))));
|
||||
},
|
||||
genHeaderData: function genHeaderData(header, children, key) {
|
||||
var classes = ['column'];
|
||||
var data = {
|
||||
key: key,
|
||||
attrs: {
|
||||
role: 'columnheader',
|
||||
scope: 'col',
|
||||
width: header.width || null,
|
||||
'aria-label': header[this.headerText] || '',
|
||||
'aria-sort': 'none'
|
||||
}
|
||||
};
|
||||
if (header.sortable == null || header.sortable) {
|
||||
this.genHeaderSortingData(header, children, data, classes);
|
||||
} else {
|
||||
data.attrs['aria-label'] += ': Not sorted.'; // TODO: Localization
|
||||
}
|
||||
classes.push('text-xs-' + (header.align || 'left'));
|
||||
if (Array.isArray(header.class)) {
|
||||
classes.push.apply(classes, _toConsumableArray(header.class));
|
||||
} else if (header.class) {
|
||||
classes.push(header.class);
|
||||
}
|
||||
data.class = classes;
|
||||
return [data, children];
|
||||
},
|
||||
genHeaderSortingData: function genHeaderSortingData(header, children, data, classes) {
|
||||
var _this2 = this;
|
||||
|
||||
if (!('value' in header)) {
|
||||
(0, _console.consoleWarn)('Headers must have a value property that corresponds to a value in the v-model array', this);
|
||||
}
|
||||
data.attrs.tabIndex = 0;
|
||||
data.on = {
|
||||
click: function click() {
|
||||
_this2.expanded = {};
|
||||
_this2.sort(header.value);
|
||||
},
|
||||
keydown: function keydown(e) {
|
||||
// check for space
|
||||
if (e.keyCode === 32) {
|
||||
e.preventDefault();
|
||||
_this2.sort(header.value);
|
||||
}
|
||||
}
|
||||
};
|
||||
classes.push('sortable');
|
||||
var icon = this.$createElement(_VIcon2.default, {
|
||||
props: {
|
||||
small: true
|
||||
}
|
||||
}, this.sortIcon);
|
||||
if (!header.align || header.align === 'left') {
|
||||
children.push(icon);
|
||||
} else {
|
||||
children.unshift(icon);
|
||||
}
|
||||
var pagination = this.computedPagination;
|
||||
var beingSorted = pagination.sortBy === header.value;
|
||||
if (beingSorted) {
|
||||
classes.push('active');
|
||||
if (pagination.descending) {
|
||||
classes.push('desc');
|
||||
data.attrs['aria-sort'] = 'descending';
|
||||
data.attrs['aria-label'] += ': Sorted descending. Activate to remove sorting.'; // TODO: Localization
|
||||
} else {
|
||||
classes.push('asc');
|
||||
data.attrs['aria-sort'] = 'ascending';
|
||||
data.attrs['aria-label'] += ': Sorted ascending. Activate to sort descending.'; // TODO: Localization
|
||||
}
|
||||
} else {
|
||||
data.attrs['aria-label'] += ': Not sorted. Activate to sort ascending.'; // TODO: Localization
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=head.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+22
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
/* @vue/component */
|
||||
exports.default = {
|
||||
methods: {
|
||||
genTProgress: function genTProgress() {
|
||||
var col = this.$createElement('th', {
|
||||
staticClass: 'column',
|
||||
attrs: {
|
||||
colspan: this.headerColumns
|
||||
}
|
||||
}, [this.genProgress()]);
|
||||
return this.genTR([col], {
|
||||
staticClass: 'v-datatable__progress'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=progress.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/components/VDataTable/mixins/progress.js"],"names":[],"mappings":";;;;;;kBACe;AACb,aAAS;AACP,oBADO,0BACK;AACV,gBAAM,MAAM,KAAK,cAAL,CAAoB,IAApB,EAA0B;AACpC,6BAAa,QADuB;AAEpC,uBAAO;AACL,6BAAS,KAAK;AADT;AAF6B,aAA1B,EAKT,CAAC,KAAK,WAAL,EAAD,CALS,CAAZ;AAOA,mBAAO,KAAK,KAAL,CAAW,CAAC,GAAD,CAAX,EAAkB;AACvB,6BAAa;AADU,aAAlB,CAAP;AAGD;AAZM;AADI,C","sourcesContent":["/* @vue/component */\nexport default {\n methods: {\n genTProgress () {\n const col = this.$createElement('th', {\n staticClass: 'column',\n attrs: {\n colspan: this.headerColumns\n }\n }, [this.genProgress()])\n\n return this.genTR([col], {\n staticClass: 'v-datatable__progress'\n })\n }\n }\n}\n"],"sourceRoot":""}
|
||||
Reference in New Issue
Block a user