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.5KB

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