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.

VTimePickerTitle.js 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. require('../../../src/stylus/components/_time-picker-title.styl');
  6. var _pickerButton = require('../../mixins/picker-button');
  7. var _pickerButton2 = _interopRequireDefault(_pickerButton);
  8. var _util = require('../VDatePicker/util');
  9. var _mixins = require('../../util/mixins');
  10. var _mixins2 = _interopRequireDefault(_mixins);
  11. var _VTimePicker = require('./VTimePicker');
  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-time-picker-title',
  18. props: {
  19. ampm: Boolean,
  20. disabled: Boolean,
  21. hour: Number,
  22. minute: Number,
  23. second: Number,
  24. period: {
  25. type: String,
  26. validator: function validator(period) {
  27. return period === 'am' || period === 'pm';
  28. }
  29. },
  30. readonly: Boolean,
  31. useSeconds: Boolean,
  32. selecting: Number
  33. },
  34. methods: {
  35. genTime: function genTime() {
  36. var hour = this.hour;
  37. if (this.ampm) {
  38. hour = hour ? (hour - 1) % 12 + 1 : 12;
  39. }
  40. var displayedHour = this.hour == null ? '--' : this.ampm ? String(hour) : (0, _util.pad)(hour);
  41. var displayedMinute = this.minute == null ? '--' : (0, _util.pad)(this.minute);
  42. var titleContent = [this.genPickerButton('selecting', _VTimePicker.selectingTimes.hour, displayedHour, this.disabled), this.$createElement('span', ':'), this.genPickerButton('selecting', _VTimePicker.selectingTimes.minute, displayedMinute, this.disabled)];
  43. if (this.useSeconds) {
  44. var displayedSecond = this.second == null ? '--' : (0, _util.pad)(this.second);
  45. titleContent.push(this.$createElement('span', ':'));
  46. titleContent.push(this.genPickerButton('selecting', _VTimePicker.selectingTimes.second, displayedSecond, this.disabled));
  47. }
  48. return this.$createElement('div', {
  49. 'class': 'v-time-picker-title__time'
  50. }, titleContent);
  51. },
  52. genAmPm: function genAmPm() {
  53. return this.$createElement('div', {
  54. staticClass: 'v-time-picker-title__ampm'
  55. }, [this.genPickerButton('period', 'am', 'am', this.disabled || this.readonly), this.genPickerButton('period', 'pm', 'pm', this.disabled || this.readonly)]);
  56. }
  57. },
  58. render: function render(h) {
  59. var children = [this.genTime()];
  60. this.ampm && children.push(this.genAmPm());
  61. return h('div', {
  62. staticClass: 'v-time-picker-title'
  63. }, children);
  64. }
  65. });
  66. // Utils
  67. //# sourceMappingURL=VTimePickerTitle.js.map