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.

VChip.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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; };
  6. // Components
  7. // Mixins
  8. require('../../../src/stylus/components/_chips.styl');
  9. var _mixins = require('../../util/mixins');
  10. var _mixins2 = _interopRequireDefault(_mixins);
  11. var _VIcon = require('../VIcon');
  12. var _VIcon2 = _interopRequireDefault(_VIcon);
  13. var _colorable = require('../../mixins/colorable');
  14. var _colorable2 = _interopRequireDefault(_colorable);
  15. var _themeable = require('../../mixins/themeable');
  16. var _themeable2 = _interopRequireDefault(_themeable);
  17. var _toggleable = require('../../mixins/toggleable');
  18. var _toggleable2 = _interopRequireDefault(_toggleable);
  19. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  20. /* @vue/component */
  21. exports.default = (0, _mixins2.default)(_colorable2.default, _themeable2.default, _toggleable2.default).extend({
  22. name: 'v-chip',
  23. props: {
  24. close: Boolean,
  25. disabled: Boolean,
  26. label: Boolean,
  27. outline: Boolean,
  28. // Used for selects/tagging
  29. selected: Boolean,
  30. small: Boolean,
  31. textColor: String,
  32. value: {
  33. type: Boolean,
  34. default: true
  35. }
  36. },
  37. computed: {
  38. classes: function classes() {
  39. return _extends({
  40. 'v-chip--disabled': this.disabled,
  41. 'v-chip--selected': this.selected && !this.disabled,
  42. 'v-chip--label': this.label,
  43. 'v-chip--outline': this.outline,
  44. 'v-chip--small': this.small,
  45. 'v-chip--removable': this.close
  46. }, this.themeClasses);
  47. }
  48. },
  49. methods: {
  50. genClose: function genClose(h) {
  51. var _this = this;
  52. var data = {
  53. staticClass: 'v-chip__close',
  54. on: {
  55. click: function click(e) {
  56. e.stopPropagation();
  57. _this.$emit('input', false);
  58. }
  59. }
  60. };
  61. return h('div', data, [h(_VIcon2.default, '$vuetify.icons.delete')]);
  62. },
  63. genContent: function genContent(h) {
  64. return h('span', {
  65. staticClass: 'v-chip__content'
  66. }, [this.$slots.default, this.close && this.genClose(h)]);
  67. }
  68. },
  69. render: function render(h) {
  70. var data = this.setBackgroundColor(this.color, {
  71. staticClass: 'v-chip',
  72. 'class': this.classes,
  73. attrs: { tabindex: this.disabled ? -1 : 0 },
  74. directives: [{
  75. name: 'show',
  76. value: this.isActive
  77. }],
  78. on: this.$listeners
  79. });
  80. var color = this.textColor || this.outline && this.color;
  81. return h('span', this.setTextColor(color, data), [this.genContent(h)]);
  82. }
  83. });
  84. //# sourceMappingURL=VChip.js.map