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.

VDatePickerTitle.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. require('../../../src/stylus/components/_date-picker-title.styl');
  6. var _VIcon = require('../VIcon');
  7. var _VIcon2 = _interopRequireDefault(_VIcon);
  8. var _pickerButton = require('../../mixins/picker-button');
  9. var _pickerButton2 = _interopRequireDefault(_pickerButton);
  10. var _mixins = require('../../util/mixins');
  11. var _mixins2 = _interopRequireDefault(_mixins);
  12. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13. // Mixins
  14. exports.default = (0, _mixins2.default)(_pickerButton2.default
  15. /* @vue/component */
  16. ).extend({
  17. name: 'v-date-picker-title',
  18. props: {
  19. date: {
  20. type: String,
  21. default: ''
  22. },
  23. disabled: Boolean,
  24. readonly: Boolean,
  25. selectingYear: Boolean,
  26. value: {
  27. type: String
  28. },
  29. year: {
  30. type: [Number, String],
  31. default: ''
  32. },
  33. yearIcon: {
  34. type: String
  35. }
  36. },
  37. data: function data() {
  38. return {
  39. isReversing: false
  40. };
  41. },
  42. computed: {
  43. computedTransition: function computedTransition() {
  44. return this.isReversing ? 'picker-reverse-transition' : 'picker-transition';
  45. }
  46. },
  47. watch: {
  48. value: function value(val, prev) {
  49. this.isReversing = val < prev;
  50. }
  51. },
  52. methods: {
  53. genYearIcon: function genYearIcon() {
  54. return this.$createElement(_VIcon2.default, {
  55. props: {
  56. dark: true
  57. }
  58. }, this.yearIcon);
  59. },
  60. getYearBtn: function getYearBtn() {
  61. return this.genPickerButton('selectingYear', true, [String(this.year), this.yearIcon ? this.genYearIcon() : null], false, 'v-date-picker-title__year');
  62. },
  63. genTitleText: function genTitleText() {
  64. return this.$createElement('transition', {
  65. props: {
  66. name: this.computedTransition
  67. }
  68. }, [this.$createElement('div', {
  69. domProps: { innerHTML: this.date || '&nbsp;' },
  70. key: this.value
  71. })]);
  72. },
  73. genTitleDate: function genTitleDate() {
  74. return this.genPickerButton('selectingYear', false, [this.genTitleText()], false, 'v-date-picker-title__date');
  75. }
  76. },
  77. render: function render(h) {
  78. return h('div', {
  79. staticClass: 'v-date-picker-title',
  80. 'class': {
  81. 'v-date-picker-title--disabled': this.disabled
  82. }
  83. }, [this.getYearBtn(), this.genTitleDate()]);
  84. }
  85. });
  86. // Utils
  87. // Components
  88. //# sourceMappingURL=VDatePickerTitle.js.map