@progress/kendo-vue-gauges
Version:
99 lines (98 loc) • 2.6 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as s, createVNode as i, isVNode as u } from "vue";
import { BaseGauge as o } from "./BaseGauge.mjs";
import { RadialGauge as l } from "@progress/kendo-charts";
import { Group as g } from "@progress/kendo-drawing";
import { getDefaultSlots as c } from "@progress/kendo-vue-common";
function d(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !u(e);
}
const G = /* @__PURE__ */ s({
name: "KendoRadialGauge",
props: {
dir: String,
renderAs: {
type: String,
default: "svg",
validator: function(e) {
return ["svg", "canvas"].includes(e);
}
},
gaugeConstructor: [Object, Function],
pointer: {
type: [Object, Array],
default: void 0
},
scale: {
type: Object,
default: void 0
},
transitions: {
type: Boolean,
default: void 0
}
},
mounted() {
this._baseGauge = this.baseGaugeRef;
},
updated() {
this._baseGauge = this.baseGaugeRef;
},
render() {
const e = c(this), {
pointer: t,
scale: r,
transitions: a
} = this.$props;
return i(o, {
transitions: a,
scale: r,
pointer: t,
deriveOptionsFromParent: this.deriveOptionsFromParent,
ref: (n) => {
this.baseGaugeRef = n;
},
gaugeConstructor: l,
getTarget: this.getTarget,
class: "k-gauge"
}, d(e) ? e : {
default: () => [e]
});
},
methods: {
gaugeInstance() {
return this._baseGauge !== null ? this._baseGauge.gaugeInstance : null;
},
surface() {
return this._baseGauge !== null ? this._baseGauge.surface : null;
},
element() {
return this._baseGauge !== null ? this._baseGauge.element : null;
},
exportVisual(e) {
return this.gaugeInstance() !== null ? Promise.resolve(this.gaugeInstance().exportVisual(e)) : Promise.resolve(new g());
},
getTarget() {
return this;
},
deriveOptionsFromParent(e) {
const {
pointer: t,
scale: r
} = this.$props;
return Object.assign({}, e, {
pointer: t,
scale: r
});
}
}
});
export {
G as RadialGauge
};