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.

VDatePickerMonthTable.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _datePickerTable = require('./mixins/date-picker-table');
  6. var _datePickerTable2 = _interopRequireDefault(_datePickerTable);
  7. var _util = require('./util');
  8. var _mixins = require('../../util/mixins');
  9. var _mixins2 = _interopRequireDefault(_mixins);
  10. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11. // Utils
  12. exports.default = (0, _mixins2.default)(_datePickerTable2.default
  13. /* @vue/component */
  14. ).extend({
  15. name: 'v-date-picker-month-table',
  16. computed: {
  17. formatter: function formatter() {
  18. return this.format || (0, _util.createNativeLocaleFormatter)(this.locale, { month: 'short', timeZone: 'UTC' }, { start: 5, length: 2 });
  19. }
  20. },
  21. methods: {
  22. calculateTableDate: function calculateTableDate(delta) {
  23. return '' + (parseInt(this.tableDate, 10) + Math.sign(delta || 1));
  24. },
  25. genTBody: function genTBody() {
  26. var _this = this;
  27. var children = [];
  28. var cols = Array(3).fill(null);
  29. var rows = 12 / cols.length;
  30. var _loop = function _loop(row) {
  31. var tds = cols.map(function (_, col) {
  32. var month = row * cols.length + col;
  33. var date = _this.displayedYear + '-' + (0, _util.pad)(month + 1);
  34. return _this.$createElement('td', {
  35. key: month
  36. }, [_this.genButton(date, false, 'month', _this.formatter)]);
  37. });
  38. children.push(_this.$createElement('tr', {
  39. key: row
  40. }, tds));
  41. };
  42. for (var row = 0; row < rows; row++) {
  43. _loop(row);
  44. }
  45. return this.$createElement('tbody', children);
  46. }
  47. },
  48. render: function render() {
  49. return this.genTable('v-date-picker-table v-date-picker-table--month', [this.genTBody()], this.calculateTableDate);
  50. }
  51. }); // Mixins
  52. //# sourceMappingURL=VDatePickerMonthTable.js.map