Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

body.js 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _expandTransition = require('../../transitions/expand-transition');
  6. var _expandTransition2 = _interopRequireDefault(_expandTransition);
  7. var _helpers = require('../../../util/helpers');
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9. /* @vue/component */
  10. exports.default = {
  11. methods: {
  12. genTBody: function genTBody() {
  13. var children = this.genItems();
  14. return this.$createElement('tbody', children);
  15. },
  16. genExpandedRow: function genExpandedRow(props) {
  17. var children = [];
  18. if (this.isExpanded(props.item)) {
  19. var expand = this.$createElement('div', {
  20. class: 'v-datatable__expand-content',
  21. key: (0, _helpers.getObjectValueByPath)(props.item, this.itemKey)
  22. }, [this.$scopedSlots.expand(props)]);
  23. children.push(expand);
  24. }
  25. var transition = this.$createElement('transition-group', {
  26. class: 'v-datatable__expand-col',
  27. attrs: { colspan: this.headerColumns },
  28. props: {
  29. tag: 'td'
  30. },
  31. on: (0, _expandTransition2.default)('v-datatable__expand-col--expanded')
  32. }, children);
  33. return this.genTR([transition], { class: 'v-datatable__expand-row' });
  34. },
  35. genFilteredItems: function genFilteredItems() {
  36. if (!this.$scopedSlots.items) {
  37. return null;
  38. }
  39. var rows = [];
  40. for (var index = 0, len = this.filteredItems.length; index < len; ++index) {
  41. var item = this.filteredItems[index];
  42. var props = this.createProps(item, index);
  43. var row = this.$scopedSlots.items(props);
  44. rows.push(this.hasTag(row, 'td') ? this.genTR(row, {
  45. key: this.itemKey ? (0, _helpers.getObjectValueByPath)(props.item, this.itemKey) : index,
  46. attrs: { active: this.isSelected(item) }
  47. }) : row);
  48. if (this.$scopedSlots.expand) {
  49. var expandRow = this.genExpandedRow(props);
  50. rows.push(expandRow);
  51. }
  52. }
  53. return rows;
  54. },
  55. genEmptyItems: function genEmptyItems(content) {
  56. if (this.hasTag(content, 'tr')) {
  57. return content;
  58. } else if (this.hasTag(content, 'td')) {
  59. return this.genTR(content);
  60. } else {
  61. return this.genTR([this.$createElement('td', {
  62. class: {
  63. 'text-xs-center': typeof content === 'string'
  64. },
  65. attrs: { colspan: this.headerColumns }
  66. }, content)]);
  67. }
  68. }
  69. }
  70. };
  71. //# sourceMappingURL=body.js.map