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.

VCounter.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // Mixins
  7. require('../../../src/stylus/components/_counters.styl');
  8. var _themeable = require('../../mixins/themeable');
  9. var _themeable2 = _interopRequireDefault(_themeable);
  10. var _mixins = require('../../util/mixins');
  11. var _mixins2 = _interopRequireDefault(_mixins);
  12. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13. /* @vue/component */
  14. exports.default = (0, _mixins2.default)(_themeable2.default).extend({
  15. name: 'v-counter',
  16. functional: true,
  17. props: {
  18. value: {
  19. type: [Number, String],
  20. default: ''
  21. },
  22. max: [Number, String]
  23. },
  24. render: function render(h, ctx) {
  25. var props = ctx.props;
  26. var max = parseInt(props.max, 10);
  27. var value = parseInt(props.value, 10);
  28. var content = max ? value + ' / ' + max : String(props.value);
  29. var isGreater = max && value > max;
  30. return h('div', {
  31. staticClass: 'v-counter',
  32. class: _extends({
  33. 'error--text': isGreater
  34. }, (0, _themeable.functionalThemeClasses)(ctx))
  35. }, content);
  36. }
  37. });
  38. //# sourceMappingURL=VCounter.js.map