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 2.9KB

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