@progress/kendo-vue-gauges 3.5.0 → 3.5.1-dev.202208150613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cdn/js/kendo-vue-gauges.js +1 -1
- package/dist/es/ArcGaugeProps.js +1 -0
- package/dist/es/BaseGaugeProps.js +1 -1
- package/dist/es/CircularGaugeProps.js +1 -0
- package/dist/es/LinearGaugeProps.js +1 -0
- package/dist/es/RadialGaugeProps.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/store/reducer.js +9 -7
- package/dist/es/theming/theme-service.js +1 -1
- package/dist/es/types/arc-scale.interface.js +1 -0
- package/dist/es/types/border.interface.js +1 -0
- package/dist/es/types/cap.interface.js +1 -0
- package/dist/es/types/circular-scale.interface.js +1 -0
- package/dist/es/types/color-range.interface.js +1 -0
- package/dist/es/types/dash-type.interface.js +1 -0
- package/dist/es/types/gauge-area.interface.js +1 -0
- package/dist/es/types/labels.interface.js +1 -0
- package/dist/es/types/line-cap.js +1 -0
- package/dist/es/types/line.interface.js +1 -0
- package/dist/es/types/linear-pointer-shape.js +1 -0
- package/dist/es/types/linear-pointer.interface.js +1 -0
- package/dist/es/types/linear-scale.interface.js +1 -0
- package/dist/es/types/margin.interface.js +1 -0
- package/dist/es/types/padding.interface.js +1 -0
- package/dist/es/types/radial-label-position.js +1 -0
- package/dist/es/types/radial-labels.interface.js +1 -0
- package/dist/es/types/radial-pointer.interface.js +1 -0
- package/dist/es/types/radial-scale.interface.js +1 -0
- package/dist/es/types/range.interface.js +1 -0
- package/dist/es/types/scale.interface.js +1 -0
- package/dist/es/types/ticks.interface.js +1 -0
- package/dist/es/types.js +1 -0
- package/dist/esm/ArcCenter.d.ts +53 -0
- package/dist/esm/ArcCenter.js +86 -0
- package/dist/esm/ArcGauge.d.ts +48 -0
- package/dist/esm/ArcGauge.js +217 -0
- package/dist/esm/ArcGaugeProps.d.ts +33 -0
- package/dist/esm/ArcGaugeProps.js +1 -0
- package/dist/esm/BaseGauge.d.ts +47 -0
- package/dist/esm/BaseGauge.js +231 -0
- package/dist/esm/BaseGaugeProps.d.ts +44 -0
- package/dist/esm/BaseGaugeProps.js +1 -0
- package/dist/esm/CircularGauge.d.ts +43 -0
- package/dist/esm/CircularGauge.js +41 -0
- package/dist/esm/CircularGaugeProps.d.ts +17 -0
- package/dist/esm/CircularGaugeProps.js +1 -0
- package/dist/esm/LinearGauge.d.ts +43 -0
- package/dist/esm/LinearGauge.js +131 -0
- package/dist/esm/LinearGaugeProps.d.ts +15 -0
- package/dist/esm/LinearGaugeProps.js +1 -0
- package/dist/esm/RadialGauge.d.ts +43 -0
- package/dist/esm/RadialGauge.js +135 -0
- package/dist/esm/RadialGaugeProps.d.ts +15 -0
- package/dist/esm/RadialGaugeProps.js +1 -0
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/main.d.ts +10 -0
- package/dist/esm/main.js +6 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/store/reducer.d.ts +14 -0
- package/dist/esm/store/reducer.js +102 -0
- package/dist/esm/store/store.d.ts +26 -0
- package/dist/esm/store/store.js +28 -0
- package/dist/esm/theming/theme-service.d.ts +6 -0
- package/dist/esm/theming/theme-service.js +53 -0
- package/dist/esm/types/arc-scale.interface.d.ts +28 -0
- package/dist/esm/types/arc-scale.interface.js +2 -0
- package/dist/esm/types/border.interface.d.ts +18 -0
- package/dist/esm/types/border.interface.js +1 -0
- package/dist/esm/types/cap.interface.d.ts +13 -0
- package/dist/esm/types/cap.interface.js +1 -0
- package/dist/esm/types/circular-scale.interface.d.ts +10 -0
- package/dist/esm/types/circular-scale.interface.js +1 -0
- package/dist/esm/types/color-range.interface.d.ts +21 -0
- package/dist/esm/types/color-range.interface.js +1 -0
- package/dist/esm/types/dash-type.interface.d.ts +4 -0
- package/dist/esm/types/dash-type.interface.js +1 -0
- package/dist/esm/types/gauge-area.interface.d.ts +27 -0
- package/dist/esm/types/gauge-area.interface.js +1 -0
- package/dist/esm/types/labels.interface.d.ts +47 -0
- package/dist/esm/types/labels.interface.js +2 -0
- package/dist/esm/types/line-cap.d.ts +4 -0
- package/dist/esm/types/line-cap.js +1 -0
- package/dist/esm/types/line.interface.d.ts +22 -0
- package/dist/esm/types/line.interface.js +1 -0
- package/dist/esm/types/linear-pointer-shape.d.ts +4 -0
- package/dist/esm/types/linear-pointer-shape.js +1 -0
- package/dist/esm/types/linear-pointer.interface.d.ts +36 -0
- package/dist/esm/types/linear-pointer.interface.js +1 -0
- package/dist/esm/types/linear-scale.interface.d.ts +26 -0
- package/dist/esm/types/linear-scale.interface.js +2 -0
- package/dist/esm/types/margin.interface.d.ts +21 -0
- package/dist/esm/types/margin.interface.js +1 -0
- package/dist/esm/types/padding.interface.d.ts +21 -0
- package/dist/esm/types/padding.interface.js +1 -0
- package/dist/esm/types/radial-label-position.d.ts +4 -0
- package/dist/esm/types/radial-label-position.js +1 -0
- package/dist/esm/types/radial-labels.interface.d.ts +8 -0
- package/dist/esm/types/radial-labels.interface.js +1 -0
- package/dist/esm/types/radial-pointer.interface.d.ts +22 -0
- package/dist/esm/types/radial-pointer.interface.js +2 -0
- package/dist/esm/types/radial-scale.interface.d.ts +28 -0
- package/dist/esm/types/radial-scale.interface.js +2 -0
- package/dist/esm/types/range.interface.d.ts +21 -0
- package/dist/esm/types/range.interface.js +1 -0
- package/dist/esm/types/scale.interface.d.ts +47 -0
- package/dist/esm/types/scale.interface.js +1 -0
- package/dist/esm/types/ticks.interface.d.ts +21 -0
- package/dist/esm/types/ticks.interface.js +2 -0
- package/dist/esm/types.d.ts +21 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils/common.d.ts +4 -0
- package/dist/esm/utils/common.js +39 -0
- package/dist/npm/ArcGauge.js +3 -3
- package/dist/npm/BaseGauge.js +5 -5
- package/dist/npm/LinearGauge.js +1 -1
- package/dist/npm/RadialGauge.js +1 -1
- package/dist/npm/main.js +6 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/store/reducer.js +9 -7
- package/dist/npm/theming/theme-service.js +3 -3
- package/dist/npm/utils/common.js +2 -1
- package/package.json +12 -6
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as Vue from 'vue';
|
|
3
|
+
var allVue = Vue;
|
|
4
|
+
var gh = allVue.h;
|
|
5
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
6
|
+
import { BaseGauge } from './BaseGauge.js';
|
|
7
|
+
import { RadialGauge as KendoRadialGauge } from '@progress/kendo-charts';
|
|
8
|
+
import { Group } from '@progress/kendo-drawing';
|
|
9
|
+
import { getDefaultSlots } from '@progress/kendo-vue-common';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var RadialGaugeVue2 = {
|
|
15
|
+
name: 'KendoRadialGauge',
|
|
16
|
+
props: {
|
|
17
|
+
dir: String,
|
|
18
|
+
renderAs: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'svg',
|
|
21
|
+
validator: function validator(value) {
|
|
22
|
+
return ['svg', 'canvas'].includes(value);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
gaugeConstructor: [Object, Function],
|
|
26
|
+
pointer: {
|
|
27
|
+
type: [Object, Array],
|
|
28
|
+
default: undefined
|
|
29
|
+
},
|
|
30
|
+
scale: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: undefined
|
|
33
|
+
},
|
|
34
|
+
transitions: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: undefined
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
mounted: function mounted() {
|
|
40
|
+
this._baseGauge = this.v3 ? this.baseGaugeRef : this.$refs.baseGauge;
|
|
41
|
+
},
|
|
42
|
+
updated: function updated() {
|
|
43
|
+
this._baseGauge = this.v3 ? this.baseGaugeRef : this.$refs.baseGauge;
|
|
44
|
+
},
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
setup: !isV3 ? undefined : function () {
|
|
47
|
+
var v3 = !!isV3;
|
|
48
|
+
return {
|
|
49
|
+
v3: v3
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
render: function render(createElement) {
|
|
54
|
+
var _this = this;
|
|
55
|
+
|
|
56
|
+
var h = gh || createElement;
|
|
57
|
+
var defaultSlots = getDefaultSlots(this);
|
|
58
|
+
var _a = this.$props,
|
|
59
|
+
pointer = _a.pointer,
|
|
60
|
+
scale = _a.scale,
|
|
61
|
+
transitions = _a.transitions;
|
|
62
|
+
return (// @ts-ignore function children
|
|
63
|
+
h(BaseGauge, {
|
|
64
|
+
transitions: transitions,
|
|
65
|
+
attrs: this.v3 ? undefined : {
|
|
66
|
+
transitions: transitions,
|
|
67
|
+
scale: scale,
|
|
68
|
+
pointer: pointer,
|
|
69
|
+
deriveOptionsFromParent: this.deriveOptionsFromParent,
|
|
70
|
+
gaugeConstructor: KendoRadialGauge,
|
|
71
|
+
getTarget: this.getTarget
|
|
72
|
+
},
|
|
73
|
+
scale: scale,
|
|
74
|
+
pointer: pointer,
|
|
75
|
+
deriveOptionsFromParent: this.deriveOptionsFromParent,
|
|
76
|
+
ref: this.v3 ? function (el) {
|
|
77
|
+
_this.baseGaugeRef = el;
|
|
78
|
+
} : 'baseGauge',
|
|
79
|
+
gaugeConstructor: KendoRadialGauge,
|
|
80
|
+
getTarget: this.getTarget,
|
|
81
|
+
"class": 'k-gauge'
|
|
82
|
+
}, this.v3 ? function () {
|
|
83
|
+
return [defaultSlots];
|
|
84
|
+
} : [defaultSlots])
|
|
85
|
+
);
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
gaugeInstance: function gaugeInstance() {
|
|
89
|
+
if (this._baseGauge !== null) {
|
|
90
|
+
return this._baseGauge.gaugeInstance;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return null;
|
|
94
|
+
},
|
|
95
|
+
surface: function surface() {
|
|
96
|
+
if (this._baseGauge !== null) {
|
|
97
|
+
return this._baseGauge.surface;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return null;
|
|
101
|
+
},
|
|
102
|
+
element: function element() {
|
|
103
|
+
if (this._baseGauge !== null) {
|
|
104
|
+
return this._baseGauge.element;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return null;
|
|
108
|
+
},
|
|
109
|
+
exportVisual: function exportVisual(options) {
|
|
110
|
+
if (this.gaugeInstance() !== null) {
|
|
111
|
+
return Promise.resolve(this.gaugeInstance().exportVisual(options));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return Promise.resolve(new Group());
|
|
115
|
+
},
|
|
116
|
+
getTarget: function getTarget() {
|
|
117
|
+
return this;
|
|
118
|
+
},
|
|
119
|
+
deriveOptionsFromParent: function deriveOptionsFromParent(options) {
|
|
120
|
+
var _a = this.$props,
|
|
121
|
+
pointer = _a.pointer,
|
|
122
|
+
scale = _a.scale;
|
|
123
|
+
return Object.assign({}, options, {
|
|
124
|
+
pointer: pointer,
|
|
125
|
+
scale: scale
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @hidden
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
var RadialGauge = RadialGaugeVue2;
|
|
135
|
+
export { RadialGauge, RadialGaugeVue2 };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseGaugeProps } from './BaseGaugeProps';
|
|
2
|
+
import { RadialPointer, RadialScale } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the [Kendo UI for Vue RadialGauge component]({% slug overview_radialgauge_gauges %}).
|
|
5
|
+
*/
|
|
6
|
+
export interface RadialGaugeProps extends BaseGaugeProps {
|
|
7
|
+
/**
|
|
8
|
+
* The configuration of the pointers ([see example]({% slug multiplepointers_radialgauge %})).
|
|
9
|
+
*/
|
|
10
|
+
pointer: RadialPointer | RadialPointer[];
|
|
11
|
+
/**
|
|
12
|
+
* The configuration of the scale.
|
|
13
|
+
*/
|
|
14
|
+
scale?: RadialScale;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import * as Vue from 'vue';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
type Vue2type = Vue.default;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
export { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ArcGauge, ArcGaugeVue2 } from './ArcGauge';
|
|
2
|
+
import { ArcGaugeProps } from './ArcGaugeProps';
|
|
3
|
+
import { CircularGauge, CircularGaugeVue2 } from './CircularGauge';
|
|
4
|
+
import { CircularGaugeProps } from './CircularGaugeProps';
|
|
5
|
+
import { LinearGauge, LinearGaugeVue2 } from './LinearGauge';
|
|
6
|
+
import { LinearGaugeProps } from './LinearGaugeProps';
|
|
7
|
+
import { RadialGauge, RadialGaugeVue2 } from './RadialGauge';
|
|
8
|
+
import { RadialGaugeProps } from './RadialGaugeProps';
|
|
9
|
+
export * from './types';
|
|
10
|
+
export { ArcGauge, ArcGaugeVue2, ArcGaugeProps, CircularGauge, CircularGaugeVue2, CircularGaugeProps, LinearGauge, LinearGaugeVue2, LinearGaugeProps, RadialGauge, RadialGaugeVue2, RadialGaugeProps };
|
package/dist/esm/main.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ArcGauge, ArcGaugeVue2 } from './ArcGauge.js';
|
|
2
|
+
import { CircularGauge, CircularGaugeVue2 } from './CircularGauge.js';
|
|
3
|
+
import { LinearGauge, LinearGaugeVue2 } from './LinearGauge.js';
|
|
4
|
+
import { RadialGauge, RadialGaugeVue2 } from './RadialGauge.js';
|
|
5
|
+
export * from './types.js';
|
|
6
|
+
export { ArcGauge, ArcGaugeVue2, CircularGauge, CircularGaugeVue2, LinearGauge, LinearGaugeVue2, RadialGauge, RadialGaugeVue2 };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export var packageMetadata = {
|
|
5
|
+
name: '@progress/kendo-vue-gauges',
|
|
6
|
+
productName: 'Kendo UI for Vue',
|
|
7
|
+
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
+
publishDate: 1660543472,
|
|
9
|
+
version: '',
|
|
10
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoreAction } from './store';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
declare const optionsReducer: (currentState: any, action: StoreAction) => object;
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
declare const themeReducer: (currentState: any, action: StoreAction) => any;
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
declare const observersReducer: (currentState: any, action: StoreAction) => any;
|
|
14
|
+
export { optionsReducer, themeReducer, observersReducer };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
var optionsReducer = function (currentState, action) {
|
|
14
|
+
if (action.gaugeCollectionIdxKey) {
|
|
15
|
+
return reducers.collectionConfigurationItem(currentState, action);
|
|
16
|
+
}
|
|
17
|
+
else if (action.gaugeKey) {
|
|
18
|
+
return reducers.configurationItem(currentState, action);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
var themeReducer = function (currentState, action) {
|
|
28
|
+
if (action.type) {
|
|
29
|
+
switch (action.type) {
|
|
30
|
+
case 'set':
|
|
31
|
+
return reducers.themeItem(currentState, action);
|
|
32
|
+
case 'push':
|
|
33
|
+
return Object.assign(currentState, action.payload);
|
|
34
|
+
default:
|
|
35
|
+
return currentState;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
var observersReducer = function (currentState, action) {
|
|
46
|
+
if (action.type) {
|
|
47
|
+
switch (action.type) {
|
|
48
|
+
case 'add':
|
|
49
|
+
return __spreadArray(__spreadArray([], currentState, true), [action.payload], false);
|
|
50
|
+
case 'remove':
|
|
51
|
+
return currentState.filter(function (element) { return element !== action.payload; });
|
|
52
|
+
default:
|
|
53
|
+
return currentState;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*/
|
|
63
|
+
var reducers = {
|
|
64
|
+
configurationItem: function (currentState, action) {
|
|
65
|
+
var _a;
|
|
66
|
+
return Object.assign(currentState, (_a = {},
|
|
67
|
+
_a[action.gaugeKey] = action.payload,
|
|
68
|
+
_a));
|
|
69
|
+
},
|
|
70
|
+
collectionConfigurationItem: function (currentState, action) {
|
|
71
|
+
var _a;
|
|
72
|
+
var inCollection = false;
|
|
73
|
+
var _b = action.gaugeCollectionIdxKey.split('_'), collectionName = _b[0], collectionIdx = _b[1];
|
|
74
|
+
var collection = currentState[collectionName].map(function (item, index) {
|
|
75
|
+
if (parseInt(collectionIdx, 10) === index) {
|
|
76
|
+
inCollection = true;
|
|
77
|
+
return action.payload;
|
|
78
|
+
}
|
|
79
|
+
return item;
|
|
80
|
+
});
|
|
81
|
+
if (inCollection === false) {
|
|
82
|
+
collection.splice(parseInt(collectionIdx, 10), 0, action.payload);
|
|
83
|
+
}
|
|
84
|
+
return Object.assign(currentState, (_a = {},
|
|
85
|
+
_a[collectionName] = collection,
|
|
86
|
+
_a));
|
|
87
|
+
},
|
|
88
|
+
themeItem: function (currentState, action) {
|
|
89
|
+
var store = {};
|
|
90
|
+
var nextStore = Object.assign(store, currentState);
|
|
91
|
+
var _a = action.payload, field = _a.field, value = _a.value;
|
|
92
|
+
var parts = field.split('.');
|
|
93
|
+
var key = parts.shift();
|
|
94
|
+
while (parts.length > 0) {
|
|
95
|
+
store = store[key] = store[key] || {};
|
|
96
|
+
key = parts.shift();
|
|
97
|
+
}
|
|
98
|
+
store[key] = value;
|
|
99
|
+
return nextStore;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
export { optionsReducer, themeReducer, observersReducer };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export declare const THROTTLE_MS: number;
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export interface StoreAction {
|
|
9
|
+
gaugeKey?: string;
|
|
10
|
+
gaugeCollectionIdxKey?: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
payload: any;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export interface Store {
|
|
18
|
+
getState(): any;
|
|
19
|
+
dispatch(action: StoreAction | object): void;
|
|
20
|
+
subscribe(f: Function): Function;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
declare const createStore: (reducer: any) => Store;
|
|
26
|
+
export default createStore;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { canUseDOM } from '@progress/kendo-vue-common';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
export var THROTTLE_MS = 1000 / 60;
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
var createStore = function (reducer) {
|
|
10
|
+
var state;
|
|
11
|
+
var timerId;
|
|
12
|
+
var listeners = [];
|
|
13
|
+
var getState = function () { return state; };
|
|
14
|
+
var dispatch = function (action) {
|
|
15
|
+
state = reducer(state, action);
|
|
16
|
+
if (canUseDOM) {
|
|
17
|
+
window.clearTimeout(timerId);
|
|
18
|
+
timerId = window.setTimeout(function () { return listeners.forEach(function (l) { return l(); }); }, THROTTLE_MS);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var subscribe = function (listener) {
|
|
22
|
+
listeners.push(listener);
|
|
23
|
+
return function () { return listeners = listeners.filter(function (l) { return l !== listener; }); };
|
|
24
|
+
};
|
|
25
|
+
dispatch({});
|
|
26
|
+
return { getState: getState, dispatch: dispatch, subscribe: subscribe };
|
|
27
|
+
};
|
|
28
|
+
export default createStore;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { chartBaseTheme } from '@progress/kendo-charts';
|
|
2
|
+
var template = "\n <div class=\"k-var--gauge-pointer\"></div>\n <div class=\"k-var--gauge-track\"></div>\n <div class=\"k-var--normal-text-color\"></div>\n";
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
var ThemeService = /** @class */ (function () {
|
|
7
|
+
function ThemeService(store) {
|
|
8
|
+
this.store = store;
|
|
9
|
+
}
|
|
10
|
+
ThemeService.prototype.setStyle = function (field, value) {
|
|
11
|
+
this.store.dispatch({ type: 'set', payload: { field: field, value: value } });
|
|
12
|
+
};
|
|
13
|
+
ThemeService.prototype.setColors = function () {
|
|
14
|
+
this.mapColor('pointer.color', 'gauge-pointer');
|
|
15
|
+
this.mapColor('scale.rangePlaceholderColor', 'gauge-track');
|
|
16
|
+
this.mapColor('scale.labels.color', 'normal-text-color');
|
|
17
|
+
this.mapColor('scale.minorTicks.color', 'normal-text-color');
|
|
18
|
+
this.mapColor('scale.majorTicks.color', 'normal-text-color');
|
|
19
|
+
this.mapColor('scale.line.color', 'normal-text-color');
|
|
20
|
+
};
|
|
21
|
+
ThemeService.prototype.mapColor = function (key, varName) {
|
|
22
|
+
this.setStyle(key, this.queryStyle(varName).backgroundColor);
|
|
23
|
+
};
|
|
24
|
+
ThemeService.prototype.queryStyle = function (varName) {
|
|
25
|
+
var element = this.element;
|
|
26
|
+
return window.getComputedStyle(element === null || element === void 0 ? void 0 : element.querySelector(".k-var--".concat(varName)));
|
|
27
|
+
};
|
|
28
|
+
return ThemeService;
|
|
29
|
+
}());
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
var loadTheme = function (store, done) {
|
|
34
|
+
var service = new ThemeService(store);
|
|
35
|
+
if (typeof document === 'undefined') {
|
|
36
|
+
store.dispatch({ type: 'push', payload: chartBaseTheme() });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var container = service.element = document.createElement('div');
|
|
40
|
+
container.style.display = 'none';
|
|
41
|
+
container.innerHTML = template;
|
|
42
|
+
document.body.appendChild(container);
|
|
43
|
+
try {
|
|
44
|
+
store.dispatch({ type: 'push', payload: chartBaseTheme() });
|
|
45
|
+
service.setColors();
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
document.body.removeChild(service.element);
|
|
49
|
+
delete service.element;
|
|
50
|
+
done();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export { loadTheme };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RadialLabels } from './radial-labels.interface';
|
|
2
|
+
import { Scale } from './scale.interface';
|
|
3
|
+
import { LineCap } from './line-cap';
|
|
4
|
+
/**
|
|
5
|
+
* The scale options of the Gauge.
|
|
6
|
+
*/
|
|
7
|
+
export interface ArcScale extends Scale {
|
|
8
|
+
/**
|
|
9
|
+
* Configures the scale labels.
|
|
10
|
+
*/
|
|
11
|
+
labels?: RadialLabels;
|
|
12
|
+
/**
|
|
13
|
+
* The distance between the range indicators and the ticks.
|
|
14
|
+
*/
|
|
15
|
+
rangeDistance?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The `lineCap` style of the ranges.
|
|
18
|
+
*/
|
|
19
|
+
rangeLineCap?: LineCap;
|
|
20
|
+
/**
|
|
21
|
+
* The starting angle of the Gauge. The Gauge is rendered clockwise (0 degrees equal 180 degrees in the polar coordinate system).
|
|
22
|
+
*/
|
|
23
|
+
startAngle?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The ending angle of the Gauge. The Gauge is rendered clockwise (0 degrees equals 180 degrees in the polar coordinate system).
|
|
26
|
+
*/
|
|
27
|
+
endAngle?: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DashType } from './dash-type.interface';
|
|
2
|
+
/**
|
|
3
|
+
* The appearance settings for the border lines.
|
|
4
|
+
*/
|
|
5
|
+
export interface Border {
|
|
6
|
+
/**
|
|
7
|
+
* The color of the border line. Accepts valid CSS color strings, including hex and rgb.
|
|
8
|
+
*/
|
|
9
|
+
color?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The dash type of the border line.
|
|
12
|
+
*/
|
|
13
|
+
dashType?: DashType;
|
|
14
|
+
/**
|
|
15
|
+
* The width of the border line in pixels.
|
|
16
|
+
*/
|
|
17
|
+
width?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The configuration options for the RadialGauge pointer cap.
|
|
3
|
+
*/
|
|
4
|
+
export interface Cap {
|
|
5
|
+
/**
|
|
6
|
+
* The color of the cap. Accepts valid CSS color strings, including hex and rgb.
|
|
7
|
+
*/
|
|
8
|
+
color?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The size of the cap in percent (from 0 to 1).
|
|
11
|
+
*/
|
|
12
|
+
size?: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The color range configuration.
|
|
3
|
+
*/
|
|
4
|
+
export interface ColorRange {
|
|
5
|
+
/**
|
|
6
|
+
* The color of the range. Accepts valid CSS color strings, including hex and rgb.
|
|
7
|
+
*/
|
|
8
|
+
color?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The opacity of the range.
|
|
11
|
+
*/
|
|
12
|
+
opacity?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The range start value.
|
|
15
|
+
*/
|
|
16
|
+
from?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The range end value.
|
|
19
|
+
*/
|
|
20
|
+
to?: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Border } from './border.interface';
|
|
2
|
+
import { Margin } from './margin.interface';
|
|
3
|
+
/**
|
|
4
|
+
* The configuration options for the Gauge area. Represents the entire visible area of the Gauge.
|
|
5
|
+
*/
|
|
6
|
+
export interface GaugeArea {
|
|
7
|
+
/**
|
|
8
|
+
* The background of the Gauge area. Accepts valid CSS color strings, including hex and rgb.
|
|
9
|
+
*/
|
|
10
|
+
background?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The border of the Gauge area.
|
|
13
|
+
*/
|
|
14
|
+
border?: Border;
|
|
15
|
+
/**
|
|
16
|
+
* The height of the Gauge area.
|
|
17
|
+
*/
|
|
18
|
+
height?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The margin of the Gauge area.
|
|
21
|
+
*/
|
|
22
|
+
margin?: number | Margin;
|
|
23
|
+
/**
|
|
24
|
+
* The height of the Gauge area.
|
|
25
|
+
*/
|
|
26
|
+
width?: number;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Border } from './border.interface';
|
|
2
|
+
import { Margin } from './margin.interface';
|
|
3
|
+
import { Padding } from './padding.interface';
|
|
4
|
+
/**
|
|
5
|
+
* The configuration of the scale labels.
|
|
6
|
+
*/
|
|
7
|
+
export interface Labels {
|
|
8
|
+
/**
|
|
9
|
+
* The background of the labels. Accepts valid CSS color strings, including hex and rgb.
|
|
10
|
+
*/
|
|
11
|
+
background?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The border of the labels.
|
|
14
|
+
*/
|
|
15
|
+
border?: Border;
|
|
16
|
+
/**
|
|
17
|
+
* The color of the labels. Accepts valid CSS color strings, including hex and rgb.
|
|
18
|
+
*/
|
|
19
|
+
color?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The font of the labels.
|
|
22
|
+
*/
|
|
23
|
+
font?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The format that is used to display the labels. Uses the IntlService [`format`]({% slug api_intl_intlservice %}#toc-format) method.
|
|
26
|
+
*/
|
|
27
|
+
format?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The margin of the labels.
|
|
30
|
+
*/
|
|
31
|
+
margin?: number | Margin;
|
|
32
|
+
/**
|
|
33
|
+
* The padding of the labels.
|
|
34
|
+
*/
|
|
35
|
+
padding?: number | Padding;
|
|
36
|
+
/**
|
|
37
|
+
* The function which returns the label content.
|
|
38
|
+
*
|
|
39
|
+
* The available fields in the function argument are:
|
|
40
|
+
* - `value`—The value of the label.
|
|
41
|
+
*/
|
|
42
|
+
content?: (e: any) => string;
|
|
43
|
+
/**
|
|
44
|
+
* The visibility of the labels.
|
|
45
|
+
*/
|
|
46
|
+
visible?: boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|