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.4KB

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