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.

VLabel.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/_labels.styl';
  4. // Mixins
  5. import Colorable from '../../mixins/colorable';
  6. import Themeable, { functionalThemeClasses } from '../../mixins/themeable';
  7. import mixins from '../../util/mixins';
  8. // Helpers
  9. import { convertToUnit } from '../../util/helpers';
  10. /* @vue/component */
  11. export default mixins(Themeable).extend({
  12. name: 'v-label',
  13. functional: true,
  14. props: {
  15. absolute: Boolean,
  16. color: {
  17. type: String,
  18. default: 'primary'
  19. },
  20. disabled: Boolean,
  21. focused: Boolean,
  22. for: String,
  23. left: {
  24. type: [Number, String],
  25. default: 0
  26. },
  27. right: {
  28. type: [Number, String],
  29. default: 'auto'
  30. },
  31. value: Boolean
  32. },
  33. render: function render(h, ctx) {
  34. var children = ctx.children,
  35. listeners = ctx.listeners,
  36. props = ctx.props;
  37. var data = {
  38. staticClass: 'v-label',
  39. 'class': _extends({
  40. 'v-label--active': props.value,
  41. 'v-label--is-disabled': props.disabled
  42. }, functionalThemeClasses(ctx)),
  43. attrs: {
  44. for: props.for,
  45. 'aria-hidden': !props.for
  46. },
  47. on: listeners,
  48. style: {
  49. left: convertToUnit(props.left),
  50. right: convertToUnit(props.right),
  51. position: props.absolute ? 'absolute' : 'relative'
  52. }
  53. };
  54. return h('label', Colorable.options.methods.setTextColor(props.focused && props.color, data), children);
  55. }
  56. });
  57. //# sourceMappingURL=VLabel.js.map