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.

VCheckbox.js 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. 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; }; // Styles
  6. // Components
  7. // import { VFadeTransition } from '../transitions'
  8. // Mixins
  9. require('../../../src/stylus/components/_selection-controls.styl');
  10. var _VIcon = require('../VIcon');
  11. var _VIcon2 = _interopRequireDefault(_VIcon);
  12. var _selectable = require('../../mixins/selectable');
  13. var _selectable2 = _interopRequireDefault(_selectable);
  14. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15. /* @vue/component */
  16. exports.default = {
  17. name: 'v-checkbox',
  18. mixins: [_selectable2.default],
  19. props: {
  20. indeterminate: Boolean,
  21. indeterminateIcon: {
  22. type: String,
  23. default: '$vuetify.icons.checkboxIndeterminate'
  24. },
  25. onIcon: {
  26. type: String,
  27. default: '$vuetify.icons.checkboxOn'
  28. },
  29. offIcon: {
  30. type: String,
  31. default: '$vuetify.icons.checkboxOff'
  32. }
  33. },
  34. data: function data(vm) {
  35. return {
  36. inputIndeterminate: vm.indeterminate
  37. };
  38. },
  39. computed: {
  40. classes: function classes() {
  41. return {
  42. 'v-input--selection-controls': true,
  43. 'v-input--checkbox': true
  44. };
  45. },
  46. computedIcon: function computedIcon() {
  47. if (this.inputIndeterminate) {
  48. return this.indeterminateIcon;
  49. } else if (this.isActive) {
  50. return this.onIcon;
  51. } else {
  52. return this.offIcon;
  53. }
  54. }
  55. },
  56. watch: {
  57. indeterminate: function indeterminate(val) {
  58. this.inputIndeterminate = val;
  59. }
  60. },
  61. methods: {
  62. genCheckbox: function genCheckbox() {
  63. return this.$createElement('div', {
  64. staticClass: 'v-input--selection-controls__input'
  65. }, [this.genInput('checkbox', _extends({}, this.$attrs, {
  66. 'aria-checked': this.inputIndeterminate ? 'mixed' : this.isActive.toString()
  67. })), this.genRipple(this.setTextColor(this.computedColor)), this.$createElement(_VIcon2.default, this.setTextColor(this.computedColor, {
  68. props: {
  69. dark: this.dark,
  70. light: this.light
  71. }
  72. }), this.computedIcon)]);
  73. },
  74. genDefaultSlot: function genDefaultSlot() {
  75. return [this.genCheckbox(), this.genLabel()];
  76. }
  77. }
  78. };
  79. //# sourceMappingURL=VCheckbox.js.map