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.

VTimelineItem.js 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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; }; // Types
  6. // Components
  7. // Mixins
  8. var _mixins = require('../../util/mixins');
  9. var _mixins2 = _interopRequireDefault(_mixins);
  10. var _VIcon = require('../VIcon');
  11. var _VIcon2 = _interopRequireDefault(_VIcon);
  12. var _themeable = require('../../mixins/themeable');
  13. var _themeable2 = _interopRequireDefault(_themeable);
  14. var _colorable = require('../../mixins/colorable');
  15. var _colorable2 = _interopRequireDefault(_colorable);
  16. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  17. exports.default = (0, _mixins2.default)(_colorable2.default, _themeable2.default
  18. /* @vue/component */
  19. ).extend({
  20. name: 'v-timeline-item',
  21. props: {
  22. color: {
  23. type: String,
  24. default: 'primary'
  25. },
  26. fillDot: Boolean,
  27. hideDot: Boolean,
  28. icon: String,
  29. iconColor: String,
  30. large: Boolean,
  31. left: Boolean,
  32. right: Boolean,
  33. small: Boolean
  34. },
  35. computed: {
  36. hasIcon: function hasIcon() {
  37. return !!this.icon || !!this.$slots.icon;
  38. }
  39. },
  40. methods: {
  41. genBody: function genBody() {
  42. return this.$createElement('div', {
  43. staticClass: 'v-timeline-item__body'
  44. }, this.$slots.default);
  45. },
  46. genIcon: function genIcon() {
  47. if (this.$slots.icon) {
  48. return this.$slots.icon;
  49. }
  50. return this.$createElement(_VIcon2.default, {
  51. props: {
  52. color: this.iconColor,
  53. dark: !this.theme.isDark,
  54. small: this.small
  55. }
  56. }, this.icon);
  57. },
  58. genInnerDot: function genInnerDot() {
  59. var data = this.setBackgroundColor(this.color);
  60. return this.$createElement('div', _extends({
  61. staticClass: 'v-timeline-item__inner-dot'
  62. }, data), [this.hasIcon && this.genIcon()]);
  63. },
  64. genDot: function genDot() {
  65. return this.$createElement('div', {
  66. staticClass: 'v-timeline-item__dot',
  67. class: {
  68. 'v-timeline-item__dot--small': this.small,
  69. 'v-timeline-item__dot--large': this.large
  70. }
  71. }, [this.genInnerDot()]);
  72. },
  73. genOpposite: function genOpposite() {
  74. return this.$createElement('div', {
  75. staticClass: 'v-timeline-item__opposite'
  76. }, this.$slots.opposite);
  77. }
  78. },
  79. render: function render(h) {
  80. var children = [this.genBody()];
  81. if (!this.hideDot) children.unshift(this.genDot());
  82. if (this.$slots.opposite) children.push(this.genOpposite());
  83. return h('div', {
  84. staticClass: 'v-timeline-item',
  85. class: _extends({
  86. 'v-timeline-item--fill-dot': this.fillDot,
  87. 'v-timeline-item--left': this.left,
  88. 'v-timeline-item--right': this.right
  89. }, this.themeClasses)
  90. }, children);
  91. }
  92. });
  93. //# sourceMappingURL=VTimelineItem.js.map