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.

VBreadcrumbs.js 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. 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; }; // Styles
  6. // Components
  7. // Mixins
  8. // Utils
  9. require('../../../src/stylus/components/_breadcrumbs.styl');
  10. var _ = require('.');
  11. var _themeable = require('../../mixins/themeable');
  12. var _themeable2 = _interopRequireDefault(_themeable);
  13. var _console = require('../../util/console');
  14. var _mixins = require('../../util/mixins');
  15. var _mixins2 = _interopRequireDefault(_mixins);
  16. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  17. exports.default = (0, _mixins2.default)(_themeable2.default
  18. /* @vue/component */
  19. ).extend({
  20. name: 'v-breadcrumbs',
  21. props: {
  22. divider: {
  23. type: String,
  24. default: '/'
  25. },
  26. items: {
  27. type: Array,
  28. default: function _default() {
  29. return [];
  30. }
  31. },
  32. large: Boolean,
  33. justifyCenter: Boolean,
  34. justifyEnd: Boolean
  35. },
  36. computed: {
  37. classes: function classes() {
  38. return _extends({
  39. 'v-breadcrumbs--large': this.large,
  40. 'justify-center': this.justifyCenter,
  41. 'justify-end': this.justifyEnd
  42. }, this.themeClasses);
  43. }
  44. },
  45. mounted: function mounted() {
  46. if (this.justifyCenter) (0, _console.deprecate)('justify-center', 'class="justify-center"', this);
  47. if (this.justifyEnd) (0, _console.deprecate)('justify-end', 'class="justify-end"', this);
  48. if (this.$slots.default) (0, _console.deprecate)('default slot', ':items and scoped slot "item"', this);
  49. },
  50. methods: {
  51. /* @deprecated */
  52. genChildren /* istanbul ignore next */: function genChildren() {
  53. if (!this.$slots.default) return undefined;
  54. var children = [];
  55. var createDividers = false;
  56. for (var i = 0; i < this.$slots.default.length; i++) {
  57. var elm = this.$slots.default[i];
  58. if (!elm.componentOptions || elm.componentOptions.Ctor.options.name !== 'v-breadcrumbs-item') {
  59. children.push(elm);
  60. } else {
  61. if (createDividers) {
  62. children.push(this.genDivider());
  63. }
  64. children.push(elm);
  65. createDividers = true;
  66. }
  67. }
  68. return children;
  69. },
  70. genDivider: function genDivider() {
  71. return this.$createElement(_.VBreadcrumbsDivider, this.$slots.divider ? this.$slots.divider : this.divider);
  72. },
  73. genItems: function genItems() {
  74. var items = [];
  75. var hasSlot = !!this.$scopedSlots.item;
  76. var keys = [];
  77. for (var i = 0; i < this.items.length; i++) {
  78. var item = this.items[i];
  79. keys.push(item.text);
  80. if (hasSlot) items.push(this.$scopedSlots.item({ item: item }));else items.push(this.$createElement(_.VBreadcrumbsItem, { key: keys.join('.'), props: item }, [item.text]));
  81. if (i < this.items.length - 1) items.push(this.genDivider());
  82. }
  83. return items;
  84. }
  85. },
  86. render: function render(h) {
  87. var children = this.$slots.default ? this.genChildren() : this.genItems();
  88. return h('ul', {
  89. staticClass: 'v-breadcrumbs',
  90. 'class': this.classes
  91. }, children);
  92. }
  93. });
  94. //# sourceMappingURL=VBreadcrumbs.js.map