vuetify eingebunden + erster Versuch Combobox
This commit is contained in:
1 parent
24642ca1a8
commit
56f4a3f940
1846 files changed
+219701
-53848
No files matched your search
+136
@@ -0,0 +1,136 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
require('../../../src/stylus/components/_progress-circular.styl');
|
||||
|
||||
var _colorable = require('../../mixins/colorable');
|
||||
|
||||
var _colorable2 = _interopRequireDefault(_colorable);
|
||||
|
||||
var _mixins = require('../../util/mixins');
|
||||
|
||||
var _mixins2 = _interopRequireDefault(_mixins);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* @vue/component */
|
||||
|
||||
// Mixins
|
||||
exports.default = (0, _mixins2.default)(_colorable2.default).extend({
|
||||
name: 'v-progress-circular',
|
||||
props: {
|
||||
button: Boolean,
|
||||
indeterminate: Boolean,
|
||||
rotate: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 32
|
||||
},
|
||||
width: {
|
||||
type: [Number, String],
|
||||
default: 4
|
||||
},
|
||||
value: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
calculatedSize: function calculatedSize() {
|
||||
return Number(this.size) + (this.button ? 8 : 0);
|
||||
},
|
||||
circumference: function circumference() {
|
||||
return 2 * Math.PI * this.radius;
|
||||
},
|
||||
classes: function classes() {
|
||||
return {
|
||||
'v-progress-circular--indeterminate': this.indeterminate,
|
||||
'v-progress-circular--button': this.button
|
||||
};
|
||||
},
|
||||
normalizedValue: function normalizedValue() {
|
||||
if (this.value < 0) {
|
||||
return 0;
|
||||
}
|
||||
if (this.value > 100) {
|
||||
return 100;
|
||||
}
|
||||
return parseFloat(this.value);
|
||||
},
|
||||
radius: function radius() {
|
||||
return 20;
|
||||
},
|
||||
strokeDashArray: function strokeDashArray() {
|
||||
return Math.round(this.circumference * 1000) / 1000;
|
||||
},
|
||||
strokeDashOffset: function strokeDashOffset() {
|
||||
return (100 - this.normalizedValue) / 100 * this.circumference + 'px';
|
||||
},
|
||||
strokeWidth: function strokeWidth() {
|
||||
return Number(this.width) / +this.size * this.viewBoxSize * 2;
|
||||
},
|
||||
styles: function styles() {
|
||||
return {
|
||||
height: this.calculatedSize + 'px',
|
||||
width: this.calculatedSize + 'px'
|
||||
};
|
||||
},
|
||||
svgStyles: function svgStyles() {
|
||||
return {
|
||||
transform: 'rotate(' + Number(this.rotate) + 'deg)'
|
||||
};
|
||||
},
|
||||
viewBoxSize: function viewBoxSize() {
|
||||
return this.radius / (1 - Number(this.width) / +this.size);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
genCircle: function genCircle(h, name, offset) {
|
||||
return h('circle', {
|
||||
class: 'v-progress-circular__' + name,
|
||||
attrs: {
|
||||
fill: 'transparent',
|
||||
cx: 2 * this.viewBoxSize,
|
||||
cy: 2 * this.viewBoxSize,
|
||||
r: this.radius,
|
||||
'stroke-width': this.strokeWidth,
|
||||
'stroke-dasharray': this.strokeDashArray,
|
||||
'stroke-dashoffset': offset
|
||||
}
|
||||
});
|
||||
},
|
||||
genSvg: function genSvg(h) {
|
||||
var children = [this.indeterminate || this.genCircle(h, 'underlay', 0), this.genCircle(h, 'overlay', this.strokeDashOffset)];
|
||||
return h('svg', {
|
||||
style: this.svgStyles,
|
||||
attrs: {
|
||||
xmlns: 'http://www.w3.org/2000/svg',
|
||||
viewBox: this.viewBoxSize + ' ' + this.viewBoxSize + ' ' + 2 * this.viewBoxSize + ' ' + 2 * this.viewBoxSize
|
||||
}
|
||||
}, children);
|
||||
}
|
||||
},
|
||||
render: function render(h) {
|
||||
var info = h('div', { staticClass: 'v-progress-circular__info' }, this.$slots.default);
|
||||
var svg = this.genSvg(h);
|
||||
return h('div', this.setTextColor(this.color, {
|
||||
staticClass: 'v-progress-circular',
|
||||
attrs: {
|
||||
'role': 'progressbar',
|
||||
'aria-valuemin': 0,
|
||||
'aria-valuemax': 100,
|
||||
'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue
|
||||
},
|
||||
class: this.classes,
|
||||
style: this.styles,
|
||||
on: this.$listeners
|
||||
}), [svg, info]);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=VProgressCircular.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/VProgressCircular/VProgressCircular.ts"],"names":[],"mappings":";;;;;;;;AAGA;;;;AACA;;;;;;AAKA;;AAPA;kBAQe,sBAAO,mBAAP,EAAkB,MAAlB,CAAyB;AACtC,UAAM,qBADgC;AAGtC,WAAO;AACL,gBAAQ,OADH;AAGL,uBAAe,OAHV;AAKL,gBAAQ;AACN,kBAAM,CAAC,MAAD,EAAS,MAAT,CADA;AAEN,qBAAS;AAFH,SALH;AAUL,cAAM;AACJ,kBAAM,CAAC,MAAD,EAAS,MAAT,CADF;AAEJ,qBAAS;AAFL,SAVD;AAeL,eAAO;AACL,kBAAM,CAAC,MAAD,EAAS,MAAT,CADD;AAEL,qBAAS;AAFJ,SAfF;AAoBL,eAAO;AACL,kBAAM,CAAC,MAAD,EAAS,MAAT,CADD;AAEL,qBAAS;AAFJ;AApBF,KAH+B;AA6BtC,cAAU;AACR,sBADQ,4BACM;AACZ,mBAAO,OAAO,KAAK,IAAZ,KAAqB,KAAK,MAAL,GAAc,CAAd,GAAkB,CAAvC,CAAP;AACD,SAHO;AAKR,qBALQ,2BAKK;AACX,mBAAO,IAAI,KAAK,EAAT,GAAc,KAAK,MAA1B;AACD,SAPO;AASR,eATQ,qBASD;AACL,mBAAO;AACL,sDAAsC,KAAK,aADtC;AAEL,+CAA+B,KAAK;AAF/B,aAAP;AAID,SAdO;AAgBR,uBAhBQ,6BAgBO;AACb,gBAAI,KAAK,KAAL,GAAa,CAAjB,EAAoB;AAClB,uBAAO,CAAP;AACD;AAED,gBAAI,KAAK,KAAL,GAAa,GAAjB,EAAsB;AAC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W,CACf,KAAK,aAAL,IAAsB,KAAK,SAAL,CAAe,CAAf,EAAkB,UAAlB,EAA8B,CAA9B,CADP,EAEf,KAAK,SAAL,CAAe,CAAf,EAAkB,SAAlB,EAA6B,KAAK,gBAAlC,CAFe,CAAjB;AAKA,mBAAO,EAAE,KAAF,EAAS;AACd,uBAAO,KAAK,SADE;AAEd,uBAAO;AACL,2BAAO,4BADF;AAEL,6BAAY,KAAK,WAAjB,SAAgC,KAAK,WAArC,SAAoD,IAAI,KAAK,WAA7D,SAA4E,IAAI,KAAK;AAFhF;AAFO,aAAT,EAMJ,QANI,CAAP;AAOD;AA5BM,KA3F6B;AA0HtC,UA1HsC,kBA0H9B,CA1H8B,EA0H7B;AACP,YAAM,OAAO,EAAE,KAAF,EAAS,EAAE,aAAa,2BAAf,EAAT,EAAuD,KAAK,MAAL,CAAY,OAAnE,CAAb;AACA,YAAM,MAAM,KAAK,MAAL,CAAY,CAAZ,CAAZ;AAEA,eAAO,EAAE,KAAF,EAAS,KAAK,YAAL,CAAkB,KAAK,KAAvB,EAA8B;AAC5C,yBAAa,qBAD+B;AAE5C,mBAAO;AACL,wBAAQ,aADH;AAEL,iCAAiB,CAFZ;AAGL,iCAAiB,GAHZ;AAIL,iCAAiB,KAAK,aAAL,GAAqB,SAArB,GAAiC,KAAK;AAJlD,aAFqC;AAQ5C,mBAAO,KAAK,OARgC;AAS5C,mBAAO,KAAK,MATgC;AAU5C,gBAAI,KAAK;AAVmC,SAA9B,CAAT,EAWH,CAAC,GAAD,EAAM,IAAN,CAXG,CAAP;AAYD;AA1IqC,CAAzB,C","sourcesContent":["import '../../stylus/components/_progress-circular.styl'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { CreateElement, VNode, VNodeChildrenArrayContents } from 'vue'\n\n/* @vue/component */\nexport default mixins(Colorable).extend({\n name: 'v-progress-circular',\n\n props: {\n button: Boolean,\n\n indeterminate: Boolean,\n\n rotate: {\n type: [Number, String],\n default: 0\n },\n\n size: {\n type: [Number, String],\n default: 32\n },\n\n width: {\n type: [Number, String],\n default: 4\n },\n\n value: {\n type: [Number, String],\n default: 0\n }\n },\n\n computed: {\n calculatedSize (): number {\n return Number(this.size) + (this.button ? 8 : 0)\n },\n\n circumference (): number {\n return 2 * Math.PI * this.radius\n },\n\n classes (): object {\n return {\n 'v-progress-circular--indeterminate': this.indeterminate,\n 'v-progress-circular--button': this.button\n }\n },\n\n normalizedValue (): number {\n if (this.value < 0) {\n return 0\n }\n\n if (this.value > 100) {\n return 100\n }\n\n return parseFloat(this.value)\n },\n\n radius (): number {\n return 20\n },\n\n strokeDashArray (): number {\n return Math.round(this.circumference * 1000) / 1000\n },\n\n strokeDashOffset (): string {\n return ((100 - this.normalizedValue) / 100) * this.circumference + 'px'\n },\n\n strokeWidth (): number {\n return Number(this.width) / +this.size * this.viewBoxSize * 2\n },\n\n styles (): object {\n return {\n height: `${this.calculatedSize}px`,\n width: `${this.calculatedSize}px`\n }\n },\n\n svgStyles (): object {\n return {\n transform: `rotate(${Number(this.rotate)}deg)`\n }\n },\n\n viewBoxSize (): number {\n return this.radius / (1 - Number(this.width) / +this.size)\n }\n },\n\n methods: {\n genCircle (h: CreateElement, name: string, offset: string | number): VNode {\n return h('circle', {\n class: `v-Line truncated
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.VProgressCircular = undefined;
|
||||
|
||||
var _VProgressCircular = require('./VProgressCircular');
|
||||
|
||||
var _VProgressCircular2 = _interopRequireDefault(_VProgressCircular);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
exports.VProgressCircular = _VProgressCircular2.default;
|
||||
exports.default = _VProgressCircular2.default;
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/components/VProgressCircular/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;QAES,iB,GAAA,2B;kBACM,2B","sourcesContent":["import VProgressCircular from './VProgressCircular'\n\nexport { VProgressCircular }\nexport default VProgressCircular\n"],"sourceRoot":""}
|
||||
Reference in new issue
Block a user