123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- require('../../../src/stylus/components/_date-picker-title.styl');
-
- var _VIcon = require('../VIcon');
-
- var _VIcon2 = _interopRequireDefault(_VIcon);
-
- var _pickerButton = require('../../mixins/picker-button');
-
- var _pickerButton2 = _interopRequireDefault(_pickerButton);
-
- var _mixins = require('../../util/mixins');
-
- var _mixins2 = _interopRequireDefault(_mixins);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- // Mixins
- exports.default = (0, _mixins2.default)(_pickerButton2.default
- /* @vue/component */
- ).extend({
- name: 'v-date-picker-title',
- props: {
- date: {
- type: String,
- default: ''
- },
- disabled: Boolean,
- readonly: Boolean,
- selectingYear: Boolean,
- value: {
- type: String
- },
- year: {
- type: [Number, String],
- default: ''
- },
- yearIcon: {
- type: String
- }
- },
- data: function data() {
- return {
- isReversing: false
- };
- },
- computed: {
- computedTransition: function computedTransition() {
- return this.isReversing ? 'picker-reverse-transition' : 'picker-transition';
- }
- },
- watch: {
- value: function value(val, prev) {
- this.isReversing = val < prev;
- }
- },
- methods: {
- genYearIcon: function genYearIcon() {
- return this.$createElement(_VIcon2.default, {
- props: {
- dark: true
- }
- }, this.yearIcon);
- },
- getYearBtn: function getYearBtn() {
- return this.genPickerButton('selectingYear', true, [String(this.year), this.yearIcon ? this.genYearIcon() : null], false, 'v-date-picker-title__year');
- },
- genTitleText: function genTitleText() {
- return this.$createElement('transition', {
- props: {
- name: this.computedTransition
- }
- }, [this.$createElement('div', {
- domProps: { innerHTML: this.date || ' ' },
- key: this.value
- })]);
- },
- genTitleDate: function genTitleDate() {
- return this.genPickerButton('selectingYear', false, [this.genTitleText()], false, 'v-date-picker-title__date');
- }
- },
- render: function render(h) {
- return h('div', {
- staticClass: 'v-date-picker-title',
- 'class': {
- 'v-date-picker-title--disabled': this.disabled
- }
- }, [this.getYearBtn(), this.genTitleDate()]);
- }
- });
- // Utils
-
- // Components
- //# sourceMappingURL=VDatePickerTitle.js.map
|