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.

VPicker.js 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2. import '../../../src/stylus/components/_pickers.styl';
  3. import '../../../src/stylus/components/_cards.styl';
  4. // Mixins
  5. import Colorable from '../../mixins/colorable';
  6. import Themeable from '../../mixins/themeable';
  7. // Helpers
  8. import { convertToUnit } from '../../util/helpers';
  9. import mixins from '../../util/mixins';
  10. /* @vue/component */
  11. export default mixins(Colorable, Themeable).extend({
  12. name: 'v-picker',
  13. props: {
  14. fullWidth: Boolean,
  15. landscape: Boolean,
  16. transition: {
  17. type: String,
  18. default: 'fade-transition'
  19. },
  20. width: {
  21. type: [Number, String],
  22. default: 290
  23. }
  24. },
  25. computed: {
  26. computedTitleColor: function computedTitleColor() {
  27. var defaultTitleColor = this.isDark ? false : this.color || 'primary';
  28. return this.color || defaultTitleColor;
  29. }
  30. },
  31. methods: {
  32. genTitle: function genTitle() {
  33. return this.$createElement('div', this.setBackgroundColor(this.computedTitleColor, {
  34. staticClass: 'v-picker__title',
  35. 'class': {
  36. 'v-picker__title--landscape': this.landscape
  37. }
  38. }), this.$slots.title);
  39. },
  40. genBodyTransition: function genBodyTransition() {
  41. return this.$createElement('transition', {
  42. props: {
  43. name: this.transition
  44. }
  45. }, this.$slots.default);
  46. },
  47. genBody: function genBody() {
  48. return this.$createElement('div', {
  49. staticClass: 'v-picker__body',
  50. 'class': this.themeClasses,
  51. style: this.fullWidth ? undefined : {
  52. width: convertToUnit(this.width)
  53. }
  54. }, [this.genBodyTransition()]);
  55. },
  56. genActions: function genActions() {
  57. return this.$createElement('div', {
  58. staticClass: 'v-picker__actions v-card__actions'
  59. }, this.$slots.actions);
  60. }
  61. },
  62. render: function render(h) {
  63. return h('div', {
  64. staticClass: 'v-picker v-card',
  65. 'class': _extends({
  66. 'v-picker--landscape': this.landscape,
  67. 'v-picker--full-width': this.fullWidth
  68. }, this.themeClasses)
  69. }, [this.$slots.title ? this.genTitle() : null, this.genBody(), this.$slots.actions ? this.genActions() : null]);
  70. }
  71. });
  72. //# sourceMappingURL=VPicker.js.map