@progress/kendo-react-gauges 6.1.1 → 7.0.0-develop.2

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.
Files changed (194) hide show
  1. package/{dist/npm/ArcCenter.d.ts → ArcCenter.d.ts} +4 -0
  2. package/{dist/npm/ArcGauge.d.ts → ArcGauge.d.ts} +4 -0
  3. package/{dist/es/ArcGaugeProps.d.ts → ArcGaugeProps.d.ts} +4 -1
  4. package/{dist/npm/BaseGauge.d.ts → BaseGauge.d.ts} +4 -0
  5. package/{dist/es/BaseGaugeProps.d.ts → BaseGaugeProps.d.ts} +4 -1
  6. package/CircularGauge.d.ts +10 -0
  7. package/{dist/es/CircularGaugeProps.d.ts → CircularGaugeProps.d.ts} +4 -0
  8. package/GaugeContext.d.ts +16 -0
  9. package/LICENSE.md +1 -1
  10. package/{dist/es/LinearGauge.d.ts → LinearGauge.d.ts} +4 -0
  11. package/{dist/npm/LinearGaugeProps.d.ts → LinearGaugeProps.d.ts} +4 -0
  12. package/{dist/es/RadialGauge.d.ts → RadialGauge.d.ts} +4 -0
  13. package/{dist/npm/RadialGaugeProps.d.ts → RadialGaugeProps.d.ts} +4 -0
  14. package/common/gauges.d.ts +9 -0
  15. package/dist/cdn/js/kendo-react-gauges.js +9 -1
  16. package/index.d.ts +15 -0
  17. package/index.js +9 -0
  18. package/index.mjs +502 -0
  19. package/package-metadata.d.ts +9 -0
  20. package/package.json +30 -44
  21. package/{dist/npm/store → store}/reducer.d.ts +4 -0
  22. package/{dist/es/store → store}/store.d.ts +4 -0
  23. package/theming/theme-service.d.ts +10 -0
  24. package/{dist/npm/types → types}/arc-scale.interface.d.ts +4 -0
  25. package/{dist/es/types → types}/border.interface.d.ts +4 -0
  26. package/types/cap.interface.d.ts +17 -0
  27. package/types/circular-scale.interface.d.ts +14 -0
  28. package/{dist/npm/types → types}/color-range.interface.d.ts +4 -0
  29. package/types/dash-type.interface.d.ts +8 -0
  30. package/{dist/npm/types → types}/gauge-area.interface.d.ts +4 -0
  31. package/{dist/npm/types → types}/labels.interface.d.ts +4 -0
  32. package/types/line-cap.d.ts +8 -0
  33. package/{dist/npm/types → types}/line.interface.d.ts +4 -0
  34. package/types/linear-pointer-shape.d.ts +8 -0
  35. package/{dist/es/types → types}/linear-pointer.interface.d.ts +4 -0
  36. package/{dist/npm/types → types}/linear-scale.interface.d.ts +4 -0
  37. package/{dist/es/types → types}/margin.interface.d.ts +4 -0
  38. package/{dist/es/types → types}/padding.interface.d.ts +4 -0
  39. package/types/radial-label-position.d.ts +8 -0
  40. package/types/radial-labels.interface.d.ts +12 -0
  41. package/{dist/es/types → types}/radial-pointer.interface.d.ts +4 -0
  42. package/{dist/npm/types → types}/radial-scale.interface.d.ts +4 -0
  43. package/{dist/es/types → types}/range.interface.d.ts +4 -0
  44. package/{dist/npm/types → types}/scale.interface.d.ts +4 -0
  45. package/{dist/es/types → types}/ticks.interface.d.ts +4 -0
  46. package/types.d.ts +25 -0
  47. package/utils/common.d.ts +5 -0
  48. package/about.md +0 -3
  49. package/dist/es/ArcCenter.d.ts +0 -36
  50. package/dist/es/ArcCenter.js +0 -76
  51. package/dist/es/ArcGauge.d.ts +0 -33
  52. package/dist/es/ArcGauge.js +0 -128
  53. package/dist/es/ArcGaugeProps.js +0 -1
  54. package/dist/es/BaseGauge.d.ts +0 -89
  55. package/dist/es/BaseGauge.js +0 -247
  56. package/dist/es/BaseGaugeProps.js +0 -2
  57. package/dist/es/CircularGauge.d.ts +0 -6
  58. package/dist/es/CircularGauge.js +0 -27
  59. package/dist/es/CircularGaugeProps.js +0 -1
  60. package/dist/es/GaugeContext.d.ts +0 -12
  61. package/dist/es/GaugeContext.js +0 -6
  62. package/dist/es/LinearGauge.js +0 -121
  63. package/dist/es/LinearGaugeProps.d.ts +0 -15
  64. package/dist/es/LinearGaugeProps.js +0 -1
  65. package/dist/es/RadialGauge.js +0 -121
  66. package/dist/es/RadialGaugeProps.d.ts +0 -15
  67. package/dist/es/RadialGaugeProps.js +0 -1
  68. package/dist/es/common/gauges.d.ts +0 -5
  69. package/dist/es/common/gauges.js +0 -1
  70. package/dist/es/main.d.ts +0 -11
  71. package/dist/es/main.js +0 -7
  72. package/dist/es/package-metadata.d.ts +0 -5
  73. package/dist/es/package-metadata.js +0 -11
  74. package/dist/es/store/reducer.d.ts +0 -14
  75. package/dist/es/store/reducer.js +0 -102
  76. package/dist/es/store/store.js +0 -28
  77. package/dist/es/theming/theme-service.d.ts +0 -6
  78. package/dist/es/theming/theme-service.js +0 -53
  79. package/dist/es/types/arc-scale.interface.d.ts +0 -28
  80. package/dist/es/types/arc-scale.interface.js +0 -2
  81. package/dist/es/types/border.interface.js +0 -1
  82. package/dist/es/types/cap.interface.d.ts +0 -13
  83. package/dist/es/types/cap.interface.js +0 -1
  84. package/dist/es/types/circular-scale.interface.d.ts +0 -10
  85. package/dist/es/types/circular-scale.interface.js +0 -1
  86. package/dist/es/types/color-range.interface.d.ts +0 -21
  87. package/dist/es/types/color-range.interface.js +0 -1
  88. package/dist/es/types/dash-type.interface.d.ts +0 -4
  89. package/dist/es/types/dash-type.interface.js +0 -1
  90. package/dist/es/types/gauge-area.interface.d.ts +0 -27
  91. package/dist/es/types/gauge-area.interface.js +0 -1
  92. package/dist/es/types/labels.interface.d.ts +0 -47
  93. package/dist/es/types/labels.interface.js +0 -2
  94. package/dist/es/types/line-cap.d.ts +0 -4
  95. package/dist/es/types/line-cap.js +0 -1
  96. package/dist/es/types/line.interface.d.ts +0 -22
  97. package/dist/es/types/line.interface.js +0 -1
  98. package/dist/es/types/linear-pointer-shape.d.ts +0 -4
  99. package/dist/es/types/linear-pointer-shape.js +0 -1
  100. package/dist/es/types/linear-pointer.interface.js +0 -1
  101. package/dist/es/types/linear-scale.interface.d.ts +0 -26
  102. package/dist/es/types/linear-scale.interface.js +0 -2
  103. package/dist/es/types/margin.interface.js +0 -1
  104. package/dist/es/types/padding.interface.js +0 -1
  105. package/dist/es/types/radial-label-position.d.ts +0 -4
  106. package/dist/es/types/radial-label-position.js +0 -1
  107. package/dist/es/types/radial-labels.interface.d.ts +0 -8
  108. package/dist/es/types/radial-labels.interface.js +0 -1
  109. package/dist/es/types/radial-pointer.interface.js +0 -2
  110. package/dist/es/types/radial-scale.interface.d.ts +0 -28
  111. package/dist/es/types/radial-scale.interface.js +0 -2
  112. package/dist/es/types/range.interface.js +0 -1
  113. package/dist/es/types/scale.interface.d.ts +0 -47
  114. package/dist/es/types/scale.interface.js +0 -1
  115. package/dist/es/types/ticks.interface.js +0 -2
  116. package/dist/es/types.d.ts +0 -21
  117. package/dist/es/types.js +0 -1
  118. package/dist/es/utils/common.d.ts +0 -1
  119. package/dist/es/utils/common.js +0 -36
  120. package/dist/npm/ArcCenter.js +0 -79
  121. package/dist/npm/ArcGauge.js +0 -131
  122. package/dist/npm/ArcGaugeProps.d.ts +0 -40
  123. package/dist/npm/ArcGaugeProps.js +0 -2
  124. package/dist/npm/BaseGauge.js +0 -250
  125. package/dist/npm/BaseGaugeProps.d.ts +0 -52
  126. package/dist/npm/BaseGaugeProps.js +0 -3
  127. package/dist/npm/CircularGauge.d.ts +0 -6
  128. package/dist/npm/CircularGauge.js +0 -30
  129. package/dist/npm/CircularGaugeProps.d.ts +0 -17
  130. package/dist/npm/CircularGaugeProps.js +0 -2
  131. package/dist/npm/GaugeContext.d.ts +0 -12
  132. package/dist/npm/GaugeContext.js +0 -9
  133. package/dist/npm/LinearGauge.d.ts +0 -32
  134. package/dist/npm/LinearGauge.js +0 -124
  135. package/dist/npm/LinearGaugeProps.js +0 -2
  136. package/dist/npm/RadialGauge.d.ts +0 -32
  137. package/dist/npm/RadialGauge.js +0 -124
  138. package/dist/npm/RadialGaugeProps.js +0 -2
  139. package/dist/npm/common/gauges.d.ts +0 -5
  140. package/dist/npm/common/gauges.js +0 -2
  141. package/dist/npm/main.d.ts +0 -11
  142. package/dist/npm/main.js +0 -27
  143. package/dist/npm/package-metadata.d.ts +0 -5
  144. package/dist/npm/package-metadata.js +0 -14
  145. package/dist/npm/store/reducer.js +0 -107
  146. package/dist/npm/store/store.d.ts +0 -26
  147. package/dist/npm/store/store.js +0 -31
  148. package/dist/npm/theming/theme-service.d.ts +0 -6
  149. package/dist/npm/theming/theme-service.js +0 -56
  150. package/dist/npm/types/arc-scale.interface.js +0 -3
  151. package/dist/npm/types/border.interface.d.ts +0 -18
  152. package/dist/npm/types/border.interface.js +0 -2
  153. package/dist/npm/types/cap.interface.d.ts +0 -13
  154. package/dist/npm/types/cap.interface.js +0 -2
  155. package/dist/npm/types/circular-scale.interface.d.ts +0 -10
  156. package/dist/npm/types/circular-scale.interface.js +0 -2
  157. package/dist/npm/types/color-range.interface.js +0 -2
  158. package/dist/npm/types/dash-type.interface.d.ts +0 -4
  159. package/dist/npm/types/dash-type.interface.js +0 -2
  160. package/dist/npm/types/gauge-area.interface.js +0 -2
  161. package/dist/npm/types/labels.interface.js +0 -3
  162. package/dist/npm/types/line-cap.d.ts +0 -4
  163. package/dist/npm/types/line-cap.js +0 -2
  164. package/dist/npm/types/line.interface.js +0 -2
  165. package/dist/npm/types/linear-pointer-shape.d.ts +0 -4
  166. package/dist/npm/types/linear-pointer-shape.js +0 -2
  167. package/dist/npm/types/linear-pointer.interface.d.ts +0 -36
  168. package/dist/npm/types/linear-pointer.interface.js +0 -2
  169. package/dist/npm/types/linear-scale.interface.js +0 -3
  170. package/dist/npm/types/margin.interface.d.ts +0 -21
  171. package/dist/npm/types/margin.interface.js +0 -2
  172. package/dist/npm/types/padding.interface.d.ts +0 -21
  173. package/dist/npm/types/padding.interface.js +0 -2
  174. package/dist/npm/types/radial-label-position.d.ts +0 -4
  175. package/dist/npm/types/radial-label-position.js +0 -2
  176. package/dist/npm/types/radial-labels.interface.d.ts +0 -8
  177. package/dist/npm/types/radial-labels.interface.js +0 -2
  178. package/dist/npm/types/radial-pointer.interface.d.ts +0 -22
  179. package/dist/npm/types/radial-pointer.interface.js +0 -3
  180. package/dist/npm/types/radial-scale.interface.js +0 -3
  181. package/dist/npm/types/range.interface.d.ts +0 -21
  182. package/dist/npm/types/range.interface.js +0 -2
  183. package/dist/npm/types/scale.interface.js +0 -2
  184. package/dist/npm/types/ticks.interface.d.ts +0 -21
  185. package/dist/npm/types/ticks.interface.js +0 -3
  186. package/dist/npm/types.d.ts +0 -21
  187. package/dist/npm/types.js +0 -2
  188. package/dist/npm/utils/common.d.ts +0 -1
  189. package/dist/npm/utils/common.js +0 -40
  190. package/dist/systemjs/kendo-react-gauges.js +0 -1
  191. package/e2e-next/arcgauge.basic.tests.ts +0 -24
  192. package/e2e-next/circulargauge.basic.tests.ts +0 -24
  193. package/e2e-next/lineargauge.basic.tests.ts +0 -24
  194. package/e2e-next/radialgauge.basic.tests.ts +0 -24
@@ -1,79 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ArcCenter = void 0;
19
- var React = require("react");
20
- var kendo_charts_1 = require("@progress/kendo-charts");
21
- var GaugeContext_1 = require("./GaugeContext");
22
- /**
23
- * @hidden
24
- */
25
- var ArcCenter = /** @class */ (function (_super) {
26
- __extends(ArcCenter, _super);
27
- function ArcCenter(props, context) {
28
- var _this = _super.call(this, props, context) || this;
29
- _this.state = {
30
- arcCenterStyles: null,
31
- arcCenterValue: {
32
- value: 0,
33
- color: ''
34
- }
35
- };
36
- _this._element = null;
37
- _this.gaugeObserver = new kendo_charts_1.InstanceObserver(_this, {
38
- render: 'onRender'
39
- });
40
- context.observersStore.dispatch({
41
- type: 'add',
42
- payload: _this.gaugeObserver
43
- });
44
- return _this;
45
- }
46
- ArcCenter.prototype.render = function () {
47
- var _this = this;
48
- var render = this.props.render;
49
- var _a = this.state, arcCenterStyles = _a.arcCenterStyles, arcCenterValue = _a.arcCenterValue;
50
- var divStyle = arcCenterStyles ? arcCenterStyles : { zIndex: -1 };
51
- var renderer = null;
52
- if (render) {
53
- renderer = (React.createElement("div", { className: "k-arcgauge-label", ref: function (element) { return _this._element = element; }, style: divStyle }, render(arcCenterValue.value, arcCenterValue.color)));
54
- }
55
- return renderer;
56
- };
57
- ArcCenter.prototype.onRender = function (e) {
58
- if (!this._element) {
59
- return;
60
- }
61
- var gaugeInstance = e.sender.gaugeInstance;
62
- var width = this._element.offsetWidth;
63
- var height = this._element.offsetHeight;
64
- var position = gaugeInstance.centerLabelPosition(width, height);
65
- this.setState({
66
- arcCenterStyles: {
67
- left: position.left,
68
- top: position.top
69
- },
70
- arcCenterValue: {
71
- value: gaugeInstance.value(),
72
- color: gaugeInstance.currentColor()
73
- }
74
- });
75
- };
76
- ArcCenter.contextType = GaugeContext_1.GaugeContext;
77
- return ArcCenter;
78
- }(React.Component));
79
- exports.ArcCenter = ArcCenter;
@@ -1,131 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- var __rest = (this && this.__rest) || function (s, e) {
29
- var t = {};
30
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
31
- t[p] = s[p];
32
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
33
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
34
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
35
- t[p[i]] = s[p[i]];
36
- }
37
- return t;
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.ArcGauge = void 0;
41
- var React = require("react");
42
- var BaseGauge_1 = require("./BaseGauge");
43
- var kendo_charts_1 = require("@progress/kendo-charts");
44
- var ArcCenter_1 = require("./ArcCenter");
45
- var kendo_drawing_1 = require("@progress/kendo-drawing");
46
- var kendo_react_common_1 = require("@progress/kendo-react-common");
47
- var ArcGauge = /** @class */ (function (_super) {
48
- __extends(ArcGauge, _super);
49
- function ArcGauge() {
50
- var _this = _super !== null && _super.apply(this, arguments) || this;
51
- _this._baseGauge = null;
52
- _this.gaugeType = kendo_charts_1.ArcGauge;
53
- _this.getTarget = function () {
54
- return _this;
55
- };
56
- _this.deriveOptionsFromParent = function (options) {
57
- var _a = _this.props, value = _a.value, color = _a.color, colors = _a.colors, opacity = _a.opacity, scale = _a.scale;
58
- return Object.assign({}, options, {
59
- value: value,
60
- color: color,
61
- colors: colors,
62
- opacity: opacity,
63
- scale: scale
64
- });
65
- };
66
- return _this;
67
- }
68
- Object.defineProperty(ArcGauge.prototype, "gaugeInstance", {
69
- /**
70
- * @hidden
71
- */
72
- get: function () {
73
- if (this._baseGauge) {
74
- return this._baseGauge.gaugeInstance;
75
- }
76
- return null;
77
- },
78
- enumerable: false,
79
- configurable: true
80
- });
81
- Object.defineProperty(ArcGauge.prototype, "surface", {
82
- /**
83
- * The Drawing `Surface` of the Gauge.
84
- */
85
- get: function () {
86
- if (this._baseGauge) {
87
- return this._baseGauge.surface;
88
- }
89
- return null;
90
- },
91
- enumerable: false,
92
- configurable: true
93
- });
94
- Object.defineProperty(ArcGauge.prototype, "element", {
95
- /**
96
- * The DOM element of the Gauge.
97
- */
98
- get: function () {
99
- if (this._baseGauge) {
100
- return this._baseGauge.element;
101
- }
102
- return null;
103
- },
104
- enumerable: false,
105
- configurable: true
106
- });
107
- /**
108
- * @hidden
109
- */
110
- ArcGauge.prototype.render = function () {
111
- var _this = this;
112
- var _a = this.props, children = _a.children, arcCenterRender = _a.arcCenterRender, centerRender = _a.centerRender, className = _a.className, baseGaugeProps = __rest(_a, ["children", "arcCenterRender", "centerRender", "className"]);
113
- return (React.createElement(BaseGauge_1.BaseGauge, __assign({}, baseGaugeProps, { deriveOptionsFromParent: this.deriveOptionsFromParent, ref: function (baseGauge) { return _this._baseGauge = baseGauge; }, gaugeConstructor: this.gaugeType, getTarget: this.getTarget, className: (0, kendo_react_common_1.classNames)('k-gauge k-arcgauge', className) }),
114
- children,
115
- React.createElement(ArcCenter_1.ArcCenter, { render: centerRender || arcCenterRender })));
116
- };
117
- /**
118
- * Exports a Gauge component as a Drawing `Scene`.
119
- *
120
- * @param {any} options - The parameters for the export operation.
121
- * @returns {Promise<Group>} - A promise that returns the root `Group` of the scene.
122
- */
123
- ArcGauge.prototype.exportVisual = function (options) {
124
- if (this.gaugeInstance !== null && this.element) {
125
- return (0, kendo_drawing_1.drawDOM)(this.element, options);
126
- }
127
- return Promise.resolve(new kendo_drawing_1.Group());
128
- };
129
- return ArcGauge;
130
- }(React.Component));
131
- exports.ArcGauge = ArcGauge;
@@ -1,40 +0,0 @@
1
- /// <reference types="react" />
2
- import { BaseGaugeProps } from './BaseGaugeProps';
3
- import { ArcScale, ColorRange } from './types';
4
- /**
5
- * Represents the props of the [KendoReact ArcGauge component]({% slug overview_arcgauge_gauges %}).
6
- */
7
- export interface ArcGaugeProps extends BaseGaugeProps {
8
- /**
9
- * The value of the Gauge.
10
- */
11
- value: number;
12
- /**
13
- * The color of the value pointer. Accepts a valid CSS color string, including hex and rgb.
14
- */
15
- color?: string;
16
- /**
17
- * The color ranges of the value pointer
18
- * ([see example]({% slug colorranges_arcgauge %})).
19
- */
20
- colors?: ColorRange[];
21
- /**
22
- * The opacity of the value pointer.
23
- */
24
- opacity?: number;
25
- /**
26
- * The scale options of the ArcGauge.
27
- */
28
- scale?: ArcScale;
29
- /**
30
- * @hidden
31
- *
32
- * Alias for backwards compatbility.
33
- */
34
- arcCenterRender?: (value: number, color: string) => React.ReactElement<any>;
35
- /**
36
- *
37
- * A function that renders the center template of the Gauge.
38
- */
39
- centerRender?: (value: number, color: string) => React.ReactElement<any>;
40
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,250 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __rest = (this && this.__rest) || function (s, e) {
18
- var t = {};
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
- t[p] = s[p];
21
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
- t[p[i]] = s[p[i]];
25
- }
26
- return t;
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.BaseGauge = void 0;
30
- var React = require("react");
31
- var PropTypes = require("prop-types");
32
- var kendo_react_intl_1 = require("@progress/kendo-react-intl");
33
- var theme_service_1 = require("./theming/theme-service");
34
- var store_1 = require("./store/store");
35
- var reducer_1 = require("./store/reducer");
36
- var common_1 = require("./utils/common");
37
- var kendo_react_common_1 = require("@progress/kendo-react-common");
38
- var GaugeContext_1 = require("./GaugeContext");
39
- var kendo_react_common_2 = require("@progress/kendo-react-common");
40
- var package_metadata_1 = require("./package-metadata");
41
- /**
42
- * @hidden
43
- */
44
- var BaseGauge = /** @class */ (function (_super) {
45
- __extends(BaseGauge, _super);
46
- function BaseGauge(props) {
47
- var _this = _super.call(this, props) || this;
48
- /**
49
- * @hidden
50
- */
51
- _this.gaugeInstance = null;
52
- /**
53
- * @hidden
54
- */
55
- _this.surface = null;
56
- _this._element = null;
57
- _this.themeStore = {};
58
- _this.themeUnsubscriber = Function.prototype;
59
- _this.observersStore = {};
60
- /* DOM event handlers */
61
- /**
62
- * @hidden
63
- */
64
- _this.onWindowResize = function () {
65
- if (_this.gaugeInstance !== null) {
66
- _this.gaugeInstance.resize();
67
- _this.trigger('render', { sender: _this });
68
- }
69
- };
70
- (0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
71
- _this.themeStore = (0, store_1.default)(reducer_1.themeReducer);
72
- _this.observersStore = (0, store_1.default)(reducer_1.observersReducer);
73
- _this.contextValue = {
74
- observersStore: _this.observersStore
75
- };
76
- return _this;
77
- }
78
- Object.defineProperty(BaseGauge.prototype, "element", {
79
- /**
80
- * @hidden
81
- */
82
- get: function () {
83
- return this._element;
84
- },
85
- enumerable: false,
86
- configurable: true
87
- });
88
- /**
89
- * @hidden
90
- */
91
- BaseGauge.prototype.componentDidMount = function () {
92
- var _a;
93
- var doc = ((_a = this._element) === null || _a === void 0 ? void 0 : _a.ownerDocument) || document;
94
- (0, theme_service_1.loadTheme)(this.themeStore, this.instantiateCoreGauge.bind(this), doc);
95
- this.themeUnsubscriber = this.themeStore.subscribe(this.refresh.bind(this));
96
- window.addEventListener('resize', this.onWindowResize);
97
- this.trigger('render', { sender: this });
98
- };
99
- /**
100
- * @hidden
101
- */
102
- BaseGauge.prototype.componentDidUpdate = function (prevProps) {
103
- var _a = this.props, dir = _a.dir, children = _a.children, deriveOptionsFromParent = _a.deriveOptionsFromParent, getTarget = _a.getTarget, gaugeConstructor = _a.gaugeConstructor, className = _a.className, renderAs = _a.renderAs, currentOthers = __rest(_a, ["dir", "children", "deriveOptionsFromParent", "getTarget", "gaugeConstructor", "className", "renderAs"]);
104
- var prevDir = prevProps.dir, prevChildren = prevProps.children, prevDeriveOptionsFromParent = prevProps.deriveOptionsFromParent, prevGetTarget = prevProps.getTarget, prevGaugeConstructor = prevProps.gaugeConstructor, prevClassName = prevProps.className, prevRenderAs = prevProps.renderAs, prevOthers = __rest(prevProps, ["dir", "children", "deriveOptionsFromParent", "getTarget", "gaugeConstructor", "className", "renderAs"]);
105
- if (this.gaugeInstance !== null) {
106
- var currentIntlService = (0, kendo_react_intl_1.provideIntlService)(this);
107
- var gaugeService = this.gaugeInstance.contextService;
108
- var localeChanged = currentIntlService.locale !== gaugeService._intlService.locale;
109
- var optionsChanged = (0, common_1.isOptionsChanged)(prevOthers, currentOthers);
110
- var typedCurrentOthers = currentOthers;
111
- if (localeChanged) {
112
- this.gaugeInstance.contextService._intlService = currentIntlService;
113
- this.gaugeInstance.contextService.format._intlService = currentIntlService;
114
- if (!optionsChanged) {
115
- this.gaugeInstance.noTransitionsRedraw();
116
- }
117
- }
118
- if (optionsChanged ||
119
- (renderAs || 'svg') !== (prevRenderAs || 'svg')) {
120
- this.refresh();
121
- }
122
- else {
123
- if (Object.keys(currentOthers).indexOf('pointer') > -1) {
124
- var isPointerArray = Array.isArray(typedCurrentOthers.pointer);
125
- if (isPointerArray) {
126
- this.refreshAllValues(typedCurrentOthers.pointer.map(function (item) { return item.value; }));
127
- }
128
- else {
129
- this.refreshValue((typedCurrentOthers.pointer || {}).value);
130
- }
131
- }
132
- else {
133
- this.refreshValue(typedCurrentOthers.value);
134
- }
135
- }
136
- if (prevProps.dir !== dir) {
137
- this.gaugeInstance.setDirection(this.getDirection(dir));
138
- }
139
- this.trigger('render', { sender: this });
140
- }
141
- };
142
- /**
143
- * @hidden
144
- */
145
- BaseGauge.prototype.componentWillUnmount = function () {
146
- this.themeUnsubscriber();
147
- var surfaceElement = this.gaugeInstance && this.gaugeInstance.surfaceElement;
148
- if (surfaceElement && surfaceElement.parentNode) {
149
- surfaceElement.parentNode.removeChild(surfaceElement);
150
- }
151
- if (this.gaugeInstance !== null) {
152
- this.gaugeInstance.destroy();
153
- this.gaugeInstance = null;
154
- }
155
- window.removeEventListener('resize', this.onWindowResize);
156
- };
157
- /**
158
- * @hidden
159
- */
160
- BaseGauge.prototype.render = function () {
161
- var _this = this;
162
- var _a = this.props, _b = _a.style, style = _b === void 0 ? {} : _b, className = _a.className, children = _a.children;
163
- var gaugeStyles = Object.assign({}, style, { position: 'relative' });
164
- return (React.createElement(GaugeContext_1.GaugeContext.Provider, { value: this.contextValue },
165
- React.createElement("div", { style: gaugeStyles, ref: function (el) { return _this._element = el; }, className: className }, children)));
166
- };
167
- /**
168
- * @hidden
169
- */
170
- BaseGauge.prototype.instantiateCoreGauge = function () {
171
- var _a = this.props, dir = _a.dir, gaugeConstructor = _a.gaugeConstructor;
172
- var gaugeOptions = this.getGaugeOptions();
173
- this.gaugeInstance = new gaugeConstructor(this.element, gaugeOptions, this.themeStore.getState(), {
174
- rtl: this.getDirection(dir),
175
- intlService: (0, kendo_react_intl_1.provideIntlService)(this),
176
- sender: this
177
- });
178
- };
179
- /**
180
- * @hidden
181
- */
182
- BaseGauge.prototype.refresh = function () {
183
- if (this.gaugeInstance !== null) {
184
- var themeOptions = this.themeStore.getState();
185
- var gaugeOptions = this.getGaugeOptions();
186
- this.gaugeInstance.setOptions(gaugeOptions, themeOptions);
187
- }
188
- };
189
- /**
190
- * @hidden
191
- */
192
- BaseGauge.prototype.refreshValue = function (value) {
193
- this.gaugeInstance.value(value);
194
- };
195
- /**
196
- * @hidden
197
- */
198
- BaseGauge.prototype.refreshAllValues = function (values) {
199
- this.gaugeInstance.allValues(values);
200
- };
201
- /**
202
- * @hidden
203
- */
204
- BaseGauge.prototype.getDirection = function (dir) {
205
- var _this = this;
206
- var directionFromWindow = function () { return kendo_react_common_1.canUseDOM && window.getComputedStyle(_this.element).direction; };
207
- var direction = dir !== undefined ? dir : (directionFromWindow() || 'ltr');
208
- return direction === 'rtl';
209
- };
210
- /**
211
- * @hidden
212
- */
213
- BaseGauge.prototype.getGaugeOptions = function () {
214
- var _a = this.props, renderAs = _a.renderAs, transitions = _a.transitions, deriveOptionsFromParent = _a.deriveOptionsFromParent;
215
- var gaugeOptions = Object.assign({
216
- renderAs: renderAs,
217
- transitions: transitions
218
- });
219
- if (deriveOptionsFromParent) {
220
- // Add options from parent - required by TS
221
- gaugeOptions = deriveOptionsFromParent(gaugeOptions);
222
- }
223
- return gaugeOptions;
224
- };
225
- /**
226
- * @hidden
227
- */
228
- BaseGauge.prototype.trigger = function (name, e) {
229
- var observers = this.observersStore.getState();
230
- for (var idx = 0; idx < observers.length; idx++) {
231
- observers[idx].trigger(name, e);
232
- }
233
- };
234
- /**
235
- * @hidden
236
- */
237
- BaseGauge.propTypes = {
238
- dir: PropTypes.string,
239
- renderAs: PropTypes.oneOf(['svg', 'canvas'])
240
- };
241
- /**
242
- * @hidden
243
- */
244
- BaseGauge.defaultProps = {
245
- renderAs: 'svg'
246
- };
247
- return BaseGauge;
248
- }(React.Component));
249
- exports.BaseGauge = BaseGauge;
250
- (0, kendo_react_intl_1.registerForIntl)(BaseGauge);
@@ -1,52 +0,0 @@
1
- /// <reference types="react" />
2
- import { Gauges } from './common/gauges';
3
- /**
4
- * @hidden
5
- */
6
- export interface BaseGaugePrivateProps extends BaseGaugeProps {
7
- /**
8
- * @hidden
9
- */
10
- deriveOptionsFromParent?: (options: any) => any;
11
- /**
12
- * @hidden
13
- */
14
- gaugeConstructor: any;
15
- /**
16
- * @hidden
17
- */
18
- getTarget: () => Gauges;
19
- }
20
- /**
21
- * @hidden
22
- */
23
- export interface BaseGaugeProps {
24
- /**
25
- * Determines the children nodes.
26
- */
27
- children?: React.ReactNode;
28
- /**
29
- * Represents the `dir` HTML attribute.
30
- */
31
- dir?: string;
32
- /**
33
- * The styles that are applied to the component.
34
- */
35
- style?: React.CSSProperties;
36
- /**
37
- * Sets additional CSS classes to the component.
38
- */
39
- className?: string;
40
- /**
41
- * Sets the preferred rendering engine. If not supported by the browser, the Gauge switches to the first available mode.
42
- *
43
- * The supported values are:
44
- * - `"svg"`&mdash;If available, renders the component as an inline `.svg` file.
45
- * - `"canvas"`&mdash;If available, renders the component as a `canvas` element.
46
- */
47
- renderAs?: 'svg' | 'canvas';
48
- /**
49
- * If set to `true`, the Gauge plays animations when it displays the series. By default, animations are enabled.
50
- */
51
- transitions?: boolean;
52
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // tslint:enable:max-line-length
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import { CircularGaugeProps } from './CircularGaugeProps';
3
- import { ArcGauge } from './ArcGauge';
4
- export declare class CircularGauge extends ArcGauge implements React.Component<CircularGaugeProps, {}> {
5
- protected gaugeType: any;
6
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.CircularGauge = void 0;
19
- var ArcGauge_1 = require("./ArcGauge");
20
- var kendo_charts_1 = require("@progress/kendo-charts");
21
- var CircularGauge = /** @class */ (function (_super) {
22
- __extends(CircularGauge, _super);
23
- function CircularGauge() {
24
- var _this = _super !== null && _super.apply(this, arguments) || this;
25
- _this.gaugeType = kendo_charts_1.CircularGauge;
26
- return _this;
27
- }
28
- return CircularGauge;
29
- }(ArcGauge_1.ArcGauge));
30
- exports.CircularGauge = CircularGauge;
@@ -1,17 +0,0 @@
1
- import { ArcGaugeProps } from './ArcGaugeProps';
2
- import { CircularScale } from './types/circular-scale.interface';
3
- import { ColorRange } from './types/color-range.interface';
4
- /**
5
- * Represents the props of the [KendoReact CircularGauge component]({% slug overview_circulargauge_gauges %}).
6
- */
7
- export interface CircularGaugeProps extends ArcGaugeProps {
8
- /**
9
- * The color ranges of the value pointer
10
- * ([see example]({% slug colorranges_circulargauge %})).
11
- */
12
- colors?: ColorRange[];
13
- /**
14
- * The scale options of the CircularGauge.
15
- */
16
- scale?: CircularScale;
17
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import { Store } from './store/store';
3
- /**
4
- * @hidden
5
- */
6
- export interface GaugeContextType {
7
- observersStore: Store;
8
- }
9
- /**
10
- * @hidden
11
- */
12
- export declare const GaugeContext: React.Context<GaugeContextType | null>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GaugeContext = void 0;
4
- var React = require("react");
5
- /**
6
- * @hidden
7
- */
8
- exports.GaugeContext = React.createContext(null);
9
- exports.GaugeContext.displayName = 'GaugeContext';
@@ -1,32 +0,0 @@
1
- import * as React from 'react';
2
- import { LinearGaugeProps } from './LinearGaugeProps';
3
- import { Surface } from '@progress/kendo-drawing';
4
- import { Group } from '@progress/kendo-drawing';
5
- export declare class LinearGauge extends React.Component<LinearGaugeProps, {}> {
6
- private _baseGauge;
7
- /**
8
- * @hidden
9
- */
10
- get gaugeInstance(): any;
11
- /**
12
- * The Drawing `Surface` of the Gauge.
13
- */
14
- get surface(): Surface | null;
15
- /**
16
- * The DOM element of the Gauge.
17
- */
18
- get element(): HTMLDivElement | null;
19
- /**
20
- * @hidden
21
- */
22
- render(): any;
23
- /**
24
- * Exports a Gauge component as a Drawing `Scene`.
25
- *
26
- * @param {any} options - The parameters for the export operation.
27
- * @returns {Promise<Group>} - A promise that returns the root `Group` of the scene.
28
- */
29
- exportVisual(options?: any): Promise<Group>;
30
- private getTarget;
31
- private deriveOptionsFromParent;
32
- }