123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _datePickerTable = require('./mixins/date-picker-table');
-
- var _datePickerTable2 = _interopRequireDefault(_datePickerTable);
-
- var _util = require('./util');
-
- var _mixins = require('../../util/mixins');
-
- var _mixins2 = _interopRequireDefault(_mixins);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- // Utils
- exports.default = (0, _mixins2.default)(_datePickerTable2.default
- /* @vue/component */
- ).extend({
- name: 'v-date-picker-month-table',
- computed: {
- formatter: function formatter() {
- return this.format || (0, _util.createNativeLocaleFormatter)(this.locale, { month: 'short', timeZone: 'UTC' }, { start: 5, length: 2 });
- }
- },
- methods: {
- calculateTableDate: function calculateTableDate(delta) {
- return '' + (parseInt(this.tableDate, 10) + Math.sign(delta || 1));
- },
- genTBody: function genTBody() {
- var _this = this;
-
- var children = [];
- var cols = Array(3).fill(null);
- var rows = 12 / cols.length;
-
- var _loop = function _loop(row) {
- var tds = cols.map(function (_, col) {
- var month = row * cols.length + col;
- var date = _this.displayedYear + '-' + (0, _util.pad)(month + 1);
- return _this.$createElement('td', {
- key: month
- }, [_this.genButton(date, false, 'month', _this.formatter)]);
- });
- children.push(_this.$createElement('tr', {
- key: row
- }, tds));
- };
-
- for (var row = 0; row < rows; row++) {
- _loop(row);
- }
- return this.$createElement('tbody', children);
- }
- },
- render: function render() {
- return this.genTable('v-date-picker-table v-date-picker-table--month', [this.genTBody()], this.calculateTableDate);
- }
- }); // Mixins
- //# sourceMappingURL=VDatePickerMonthTable.js.map
|