@progress/kendo-react-gauges 7.2.4-develop.2 → 7.2.4-develop.4
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/ArcCenter.js +8 -0
- package/ArcCenter.mjs +60 -0
- package/ArcGauge.js +8 -0
- package/ArcGauge.mjs +77 -0
- package/BaseGauge.js +8 -0
- package/BaseGauge.mjs +171 -0
- package/CircularGauge.js +8 -0
- package/CircularGauge.mjs +18 -0
- package/GaugeContext.js +8 -0
- package/GaugeContext.mjs +14 -0
- package/LinearGauge.js +8 -0
- package/LinearGauge.mjs +72 -0
- package/RadialGauge.js +8 -0
- package/RadialGauge.mjs +72 -0
- package/dist/cdn/js/kendo-react-gauges.js +8 -9
- package/index.d.mts +672 -5
- package/index.d.ts +672 -15
- package/index.js +8 -9
- package/index.mjs +15 -500
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +3 -3
- package/store/reducer.js +8 -0
- package/store/reducer.mjs +58 -0
- package/store/store.js +8 -0
- package/store/store.mjs +20 -0
- package/theming/theme-service.js +12 -0
- package/theming/theme-service.mjs +49 -0
- package/utils/common.js +8 -0
- package/utils/common.mjs +29 -0
- package/ArcCenter.d.ts +0 -40
- package/ArcGauge.d.ts +0 -37
- package/ArcGaugeProps.d.ts +0 -43
- package/BaseGauge.d.ts +0 -93
- package/BaseGaugeProps.d.ts +0 -55
- package/CircularGauge.d.ts +0 -10
- package/CircularGaugeProps.d.ts +0 -21
- package/GaugeContext.d.ts +0 -16
- package/LinearGauge.d.ts +0 -36
- package/LinearGaugeProps.d.ts +0 -19
- package/RadialGauge.d.ts +0 -36
- package/RadialGaugeProps.d.ts +0 -19
- package/common/gauges.d.ts +0 -9
- package/package-metadata.d.ts +0 -9
- package/store/reducer.d.ts +0 -18
- package/store/store.d.ts +0 -30
- package/theming/theme-service.d.ts +0 -10
- package/types/arc-scale.interface.d.ts +0 -32
- package/types/border.interface.d.ts +0 -22
- package/types/cap.interface.d.ts +0 -17
- package/types/circular-scale.interface.d.ts +0 -14
- package/types/color-range.interface.d.ts +0 -25
- package/types/dash-type.interface.d.ts +0 -8
- package/types/gauge-area.interface.d.ts +0 -31
- package/types/labels.interface.d.ts +0 -51
- package/types/line-cap.d.ts +0 -8
- package/types/line.interface.d.ts +0 -26
- package/types/linear-pointer-shape.d.ts +0 -8
- package/types/linear-pointer.interface.d.ts +0 -40
- package/types/linear-scale.interface.d.ts +0 -30
- package/types/margin.interface.d.ts +0 -25
- package/types/padding.interface.d.ts +0 -25
- package/types/radial-label-position.d.ts +0 -8
- package/types/radial-labels.interface.d.ts +0 -12
- package/types/radial-pointer.interface.d.ts +0 -26
- package/types/radial-scale.interface.d.ts +0 -32
- package/types/range.interface.d.ts +0 -25
- package/types/scale.interface.d.ts +0 -51
- package/types/ticks.interface.d.ts +0 -25
- package/types.d.ts +0 -25
- package/utils/common.d.ts +0 -5
package/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
`;class D{constructor(e){this.store=e}setStyle(e,t){this.store.dispatch({type:"set",payload:{field:e,value:t}})}setColors(){this.mapColor("pointer.color","gauge-pointer"),this.mapColor("scale.rangePlaceholderColor","gauge-track"),this.mapColor("scale.labels.color","normal-text-color"),this.mapColor("scale.minorTicks.color","normal-text-color"),this.mapColor("scale.majorTicks.color","normal-text-color"),this.mapColor("scale.line.color","normal-text-color")}mapColor(e,t){this.setStyle(e,this.queryStyle(t).backgroundColor)}queryStyle(e){const t=this.element;return window.getComputedStyle(t.querySelector(`.k-var--${e}`))}}const E=(s,e,t)=>{const r=new D(s);if(typeof t=="undefined"){s.dispatch({type:"push",payload:u.chartBaseTheme()});return}const n=r.element=t.createElement("div");n.style.display="none",n.innerHTML=j,t.body.appendChild(n);try{s.dispatch({type:"push",payload:u.chartBaseTheme()}),r.setColors()}finally{t.body.removeChild(r.element),delete r.element,e()}},V=1e3/60,A=s=>{let e,t,r=[];const n=()=>e,a=l=>{e=s(e,l),c.canUseDOM&&(window.clearTimeout(t),t=window.setTimeout(()=>r.forEach(h=>h()),V))},i=l=>(r.push(l),()=>r=r.filter(h=>h!==l));return a({}),{getState:n,dispatch:a,subscribe:i}},O=A,F=(s,e)=>{if(e.type)switch(e.type){case"set":return U.themeItem(s,e);case"push":return Object.assign(s,e.payload);default:return s}else return{}},M=(s,e)=>{if(e.type)switch(e.type){case"add":return[...s,e.payload];case"remove":return s.filter(t=>t!==e.payload);default:return s}else return[]},U={configurationItem(s,e){return Object.assign(s,{[e.gaugeKey]:e.payload})},collectionConfigurationItem(s,e){let t=!1;const[r,n]=e.gaugeCollectionIdxKey.split("_"),a=s[r].map((i,l)=>parseInt(n,10)===l?(t=!0,e.payload):i);return t===!1&&a.splice(parseInt(n,10),0,e.payload),Object.assign(s,{[r]:a})},themeItem(s,e){let t={},r=Object.assign(t,s);const{field:n,value:a}=e.payload,i=n.split(".");let l=i.shift();for(;i.length>0;)t=t[l]=t[l]||{},l=i.shift();return t[l]=a,r}},G=s=>typeof s=="object",I=(s,e)=>{if(Object.keys(s).length!==Object.keys(e).length)return!0;for(let t in s)if(t!=="value"&&s.hasOwnProperty(t)){const r=s[t],n=e[t];if(G(r)&&G(n)?I(r,n):r!==n)return!0}return!1},q=(s,e)=>{if(!s||!e||(s=[].concat(s),e=[].concat(e),s.length!==e.length))return!0;for(let t=0;t<s.length;t++)if(I(s[t],e[t]))return!0;return!1},b=o.createContext(null);b.displayName="GaugeContext";const L={name:"@progress/kendo-react-gauges",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};class g extends o.Component{constructor(e){super(e),this.gaugeInstance=null,this.surface=null,this._element=null,this.themeStore={},this.themeUnsubscriber=Function.prototype,this.observersStore={},this.onWindowResize=()=>{this.gaugeInstance!==null&&(this.gaugeInstance.resize(),this.trigger("render",{sender:this}))},c.validatePackage(L),this.themeStore=O(F),this.observersStore=O(M),this.contextValue={observersStore:this.observersStore}}get element(){return this._element}componentDidMount(){var t;const e=((t=this._element)==null?void 0:t.ownerDocument)||document;E(this.themeStore,this.instantiateCoreGauge.bind(this),e),this.themeUnsubscriber=this.themeStore.subscribe(this.refresh.bind(this)),window.addEventListener("resize",this.onWindowResize),this.trigger("render",{sender:this})}componentDidUpdate(e){const{dir:t,children:r,deriveOptionsFromParent:n,getTarget:a,gaugeConstructor:i,className:l,renderAs:h,...m}=this.props,{dir:B,children:H,deriveOptionsFromParent:$,getTarget:J,gaugeConstructor:Q,className:X,renderAs:w,...T}=e;if(this.gaugeInstance!==null){const f=v.provideIntlService(this),P=this.gaugeInstance.contextService,x=f.locale!==P._intlService.locale,y=q(T,m),d=m;x&&(this.gaugeInstance.contextService._intlService=f,this.gaugeInstance.contextService.format._intlService=f,y||this.gaugeInstance.noTransitionsRedraw()),y||(h||"svg")!==(w||"svg")?this.refresh():Object.keys(m).indexOf("pointer")>-1?Array.isArray(d.pointer)?this.refreshAllValues(d.pointer.map(k=>k.value)):this.refreshValue((d.pointer||{}).value):this.refreshValue(d.value),e.dir!==t&&this.gaugeInstance.setDirection(this.getDirection(t)),this.trigger("render",{sender:this})}}componentWillUnmount(){this.themeUnsubscriber();const e=this.gaugeInstance&&this.gaugeInstance.surfaceElement;e&&e.parentNode&&e.parentNode.removeChild(e),this.gaugeInstance!==null&&(this.gaugeInstance.destroy(),this.gaugeInstance=null),window.removeEventListener("resize",this.onWindowResize)}render(){const{style:e={},className:t,children:r}=this.props,n=Object.assign({},e,{position:"relative"});return o.createElement(b.Provider,{value:this.contextValue},o.createElement("div",{style:n,ref:a=>this._element=a,className:t},r))}instantiateCoreGauge(){const{dir:e,gaugeConstructor:t}=this.props,r=this.getGaugeOptions();this.gaugeInstance=new t(this.element,r,this.themeStore.getState(),{rtl:this.getDirection(e),intlService:v.provideIntlService(this),sender:this})}refresh(){if(this.gaugeInstance!==null){const e=this.themeStore.getState(),t=this.getGaugeOptions();this.gaugeInstance.setOptions(t,e)}}refreshValue(e){this.gaugeInstance.value(e)}refreshAllValues(e){this.gaugeInstance.allValues(e)}getDirection(e){return(e!==void 0?e:(()=>c.canUseDOM&&window.getComputedStyle(this.element).direction)()||"ltr")==="rtl"}getGaugeOptions(){const{renderAs:e,transitions:t,deriveOptionsFromParent:r}=this.props;let n=Object.assign({renderAs:e,transitions:t});return r&&(n=r(n)),n}trigger(e,t){const r=this.observersStore.getState();for(let n=0;n<r.length;n++)r[n].trigger(e,t)}}g.propTypes={dir:C.string,renderAs:C.oneOf(["svg","canvas"])};g.defaultProps={renderAs:"svg"};v.registerForIntl(g);class S extends o.Component{constructor(e,t){super(e,t),this.state={arcCenterStyles:null,arcCenterValue:{value:0,color:""}},this._element=null,this.gaugeObserver=new u.InstanceObserver(this,{render:"onRender"}),t.observersStore.dispatch({type:"add",payload:this.gaugeObserver})}render(){const{render:e}=this.props,{arcCenterStyles:t,arcCenterValue:r}=this.state,n=t||{zIndex:-1};let a=null;return e&&(a=o.createElement("div",{className:"k-arcgauge-label",ref:i=>this._element=i,style:n},e(r.value,r.color))),a}onRender(e){if(!this._element)return;const t=e.sender.gaugeInstance,r=this._element.offsetWidth,n=this._element.offsetHeight,a=t.centerLabelPosition(r,n);this.setState({arcCenterStyles:{left:a.left,top:a.top},arcCenterValue:{value:t.value(),color:t.currentColor()}})}}S.contextType=b;class _ extends o.Component{constructor(){super(...arguments),this._baseGauge=null,this.gaugeType=u.ArcGauge,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>{const{value:t,color:r,colors:n,opacity:a,scale:i}=this.props;return Object.assign({},e,{value:t,color:r,colors:n,opacity:a,scale:i})}}get gaugeInstance(){return this._baseGauge?this._baseGauge.gaugeInstance:null}get surface(){return this._baseGauge?this._baseGauge.surface:null}get element(){return this._baseGauge?this._baseGauge.element:null}render(){const{children:e,arcCenterRender:t,centerRender:r,className:n,...a}=this.props;return o.createElement(g,{...a,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:i=>this._baseGauge=i,gaugeConstructor:this.gaugeType,getTarget:this.getTarget,className:c.classNames("k-gauge k-arcgauge",n)},e,o.createElement(S,{render:r||t}))}exportVisual(e){return this.gaugeInstance!==null&&this.element?p.drawDOM(this.element,e):Promise.resolve(new p.Group)}}class z extends _{constructor(){super(...arguments),this.gaugeType=u.CircularGauge}}class W extends o.Component{constructor(){super(...arguments),this._baseGauge=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>{const{pointer:t,scale:r}=this.props;return Object.assign({},e,{pointer:t,scale:r})}}get gaugeInstance(){return this._baseGauge!==null?this._baseGauge.gaugeInstance:null}get surface(){return this._baseGauge!==null?this._baseGauge.surface:null}get element(){return this._baseGauge!==null?this._baseGauge.element:null}render(){const{children:e,className:t,...r}=this.props;return o.createElement(g,{...r,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseGauge=n,gaugeConstructor:u.LinearGauge,getTarget:this.getTarget,className:c.classNames("k-gauge",t)},e)}exportVisual(e){return this.gaugeInstance!==null?Promise.resolve(this.gaugeInstance.exportVisual(e)):Promise.resolve(new p.Group)}}class K extends o.Component{constructor(){super(...arguments),this._baseGauge=null,this.getTarget=()=>this,this.deriveOptionsFromParent=e=>{const{pointer:t,scale:r}=this.props;return Object.assign({},e,{pointer:t,scale:r})}}get gaugeInstance(){return this._baseGauge!==null?this._baseGauge.gaugeInstance:null}get surface(){return this._baseGauge!==null?this._baseGauge.surface:null}get element(){return this._baseGauge!==null?this._baseGauge.element:null}render(){const{children:e,className:t,...r}=this.props;return o.createElement(g,{...r,deriveOptionsFromParent:this.deriveOptionsFromParent,ref:n=>this._baseGauge=n,gaugeConstructor:u.RadialGauge,getTarget:this.getTarget,className:c.classNames("k-gauge",t)},e)}exportVisual(e){return this.gaugeInstance!==null?Promise.resolve(this.gaugeInstance.exportVisual(e)):Promise.resolve(new p.Group)}}exports.ArcGauge=_;exports.CircularGauge=z;exports.LinearGauge=W;exports.RadialGauge=K;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ArcGauge.js"),a=require("./CircularGauge.js"),r=require("./LinearGauge.js"),u=require("./RadialGauge.js");exports.ArcGauge=e.ArcGauge;exports.CircularGauge=a.CircularGauge;exports.LinearGauge=r.LinearGauge;exports.RadialGauge=u.RadialGauge;
|
package/index.mjs
CHANGED
|
@@ -1,503 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
5
8
|
"use client";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { canUseDOM as I, validatePackage as j, classNames as d } from "@progress/kendo-react-common";
|
|
11
|
-
import { drawDOM as D, Group as m } from "@progress/kendo-drawing";
|
|
12
|
-
const L = `
|
|
13
|
-
<div class="k-var--gauge-pointer"></div>
|
|
14
|
-
<div class="k-var--gauge-track"></div>
|
|
15
|
-
<div class="k-var--normal-text-color"></div>
|
|
16
|
-
`;
|
|
17
|
-
class U {
|
|
18
|
-
constructor(e) {
|
|
19
|
-
this.store = e;
|
|
20
|
-
}
|
|
21
|
-
setStyle(e, t) {
|
|
22
|
-
this.store.dispatch({ type: "set", payload: { field: e, value: t } });
|
|
23
|
-
}
|
|
24
|
-
setColors() {
|
|
25
|
-
this.mapColor("pointer.color", "gauge-pointer"), this.mapColor("scale.rangePlaceholderColor", "gauge-track"), this.mapColor("scale.labels.color", "normal-text-color"), this.mapColor("scale.minorTicks.color", "normal-text-color"), this.mapColor("scale.majorTicks.color", "normal-text-color"), this.mapColor("scale.line.color", "normal-text-color");
|
|
26
|
-
}
|
|
27
|
-
mapColor(e, t) {
|
|
28
|
-
this.setStyle(e, this.queryStyle(t).backgroundColor);
|
|
29
|
-
}
|
|
30
|
-
queryStyle(e) {
|
|
31
|
-
const t = this.element;
|
|
32
|
-
return window.getComputedStyle(t.querySelector(`.k-var--${e}`));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
const z = (r, e, t) => {
|
|
36
|
-
const s = new U(r);
|
|
37
|
-
if (typeof t == "undefined") {
|
|
38
|
-
r.dispatch({ type: "push", payload: C() });
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const n = s.element = t.createElement("div");
|
|
42
|
-
n.style.display = "none", n.innerHTML = L, t.body.appendChild(n);
|
|
43
|
-
try {
|
|
44
|
-
r.dispatch({ type: "push", payload: C() }), s.setColors();
|
|
45
|
-
} finally {
|
|
46
|
-
t.body.removeChild(s.element), delete s.element, e();
|
|
47
|
-
}
|
|
48
|
-
}, M = 1e3 / 60, W = (r) => {
|
|
49
|
-
let e, t, s = [];
|
|
50
|
-
const n = () => e, a = (l) => {
|
|
51
|
-
e = r(e, l), I && (window.clearTimeout(t), t = window.setTimeout(() => s.forEach((c) => c()), M));
|
|
52
|
-
}, i = (l) => (s.push(l), () => s = s.filter((c) => c !== l));
|
|
53
|
-
return a({}), { getState: n, dispatch: a, subscribe: i };
|
|
54
|
-
}, O = W, $ = (r, e) => {
|
|
55
|
-
if (e.type)
|
|
56
|
-
switch (e.type) {
|
|
57
|
-
case "set":
|
|
58
|
-
return q.themeItem(r, e);
|
|
59
|
-
case "push":
|
|
60
|
-
return Object.assign(r, e.payload);
|
|
61
|
-
default:
|
|
62
|
-
return r;
|
|
63
|
-
}
|
|
64
|
-
else
|
|
65
|
-
return {};
|
|
66
|
-
}, K = (r, e) => {
|
|
67
|
-
if (e.type)
|
|
68
|
-
switch (e.type) {
|
|
69
|
-
case "add":
|
|
70
|
-
return [...r, e.payload];
|
|
71
|
-
case "remove":
|
|
72
|
-
return r.filter((t) => t !== e.payload);
|
|
73
|
-
default:
|
|
74
|
-
return r;
|
|
75
|
-
}
|
|
76
|
-
else
|
|
77
|
-
return [];
|
|
78
|
-
}, q = {
|
|
79
|
-
configurationItem(r, e) {
|
|
80
|
-
return Object.assign(r, {
|
|
81
|
-
[e.gaugeKey]: e.payload
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
collectionConfigurationItem(r, e) {
|
|
85
|
-
let t = !1;
|
|
86
|
-
const [s, n] = e.gaugeCollectionIdxKey.split("_"), a = r[s].map((i, l) => parseInt(n, 10) === l ? (t = !0, e.payload) : i);
|
|
87
|
-
return t === !1 && a.splice(parseInt(n, 10), 0, e.payload), Object.assign(r, {
|
|
88
|
-
[s]: a
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
themeItem(r, e) {
|
|
92
|
-
let t = {}, s = Object.assign(t, r);
|
|
93
|
-
const { field: n, value: a } = e.payload, i = n.split(".");
|
|
94
|
-
let l = i.shift();
|
|
95
|
-
for (; i.length > 0; )
|
|
96
|
-
t = t[l] = t[l] || {}, l = i.shift();
|
|
97
|
-
return t[l] = a, s;
|
|
98
|
-
}
|
|
99
|
-
}, G = (r) => typeof r == "object", S = (r, e) => {
|
|
100
|
-
if (Object.keys(r).length !== Object.keys(e).length)
|
|
101
|
-
return !0;
|
|
102
|
-
for (let t in r)
|
|
103
|
-
if (t !== "value" && r.hasOwnProperty(t)) {
|
|
104
|
-
const s = r[t], n = e[t];
|
|
105
|
-
if (G(s) && G(n) ? S(s, n) : s !== n)
|
|
106
|
-
return !0;
|
|
107
|
-
}
|
|
108
|
-
return !1;
|
|
109
|
-
}, H = (r, e) => {
|
|
110
|
-
if (!r || !e || (r = [].concat(r), e = [].concat(e), r.length !== e.length))
|
|
111
|
-
return !0;
|
|
112
|
-
for (let t = 0; t < r.length; t++)
|
|
113
|
-
if (S(r[t], e[t]))
|
|
114
|
-
return !0;
|
|
115
|
-
return !1;
|
|
116
|
-
}, f = o.createContext(null);
|
|
117
|
-
f.displayName = "GaugeContext";
|
|
118
|
-
const B = {
|
|
119
|
-
name: "@progress/kendo-react-gauges",
|
|
120
|
-
productName: "KendoReact",
|
|
121
|
-
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
122
|
-
publishDate: 1709198446,
|
|
123
|
-
version: "",
|
|
124
|
-
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
125
|
-
};
|
|
126
|
-
class u extends o.Component {
|
|
127
|
-
constructor(e) {
|
|
128
|
-
super(e), this.gaugeInstance = null, this.surface = null, this._element = null, this.themeStore = {}, this.themeUnsubscriber = Function.prototype, this.observersStore = {}, this.onWindowResize = () => {
|
|
129
|
-
this.gaugeInstance !== null && (this.gaugeInstance.resize(), this.trigger("render", { sender: this }));
|
|
130
|
-
}, j(B), this.themeStore = O($), this.observersStore = O(K), this.contextValue = {
|
|
131
|
-
observersStore: this.observersStore
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* @hidden
|
|
136
|
-
*/
|
|
137
|
-
get element() {
|
|
138
|
-
return this._element;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* @hidden
|
|
142
|
-
*/
|
|
143
|
-
componentDidMount() {
|
|
144
|
-
var t;
|
|
145
|
-
const e = ((t = this._element) == null ? void 0 : t.ownerDocument) || document;
|
|
146
|
-
z(this.themeStore, this.instantiateCoreGauge.bind(this), e), this.themeUnsubscriber = this.themeStore.subscribe(this.refresh.bind(this)), window.addEventListener("resize", this.onWindowResize), this.trigger("render", { sender: this });
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* @hidden
|
|
150
|
-
*/
|
|
151
|
-
componentDidUpdate(e) {
|
|
152
|
-
const {
|
|
153
|
-
dir: t,
|
|
154
|
-
children: s,
|
|
155
|
-
deriveOptionsFromParent: n,
|
|
156
|
-
getTarget: a,
|
|
157
|
-
gaugeConstructor: i,
|
|
158
|
-
className: l,
|
|
159
|
-
renderAs: c,
|
|
160
|
-
...h
|
|
161
|
-
} = this.props, {
|
|
162
|
-
dir: Q,
|
|
163
|
-
children: X,
|
|
164
|
-
deriveOptionsFromParent: Y,
|
|
165
|
-
getTarget: Z,
|
|
166
|
-
gaugeConstructor: ee,
|
|
167
|
-
className: te,
|
|
168
|
-
renderAs: w,
|
|
169
|
-
...x
|
|
170
|
-
} = e;
|
|
171
|
-
if (this.gaugeInstance !== null) {
|
|
172
|
-
const p = y(this), T = this.gaugeInstance.contextService, P = p.locale !== T._intlService.locale, v = H(x, h), g = h;
|
|
173
|
-
P && (this.gaugeInstance.contextService._intlService = p, this.gaugeInstance.contextService.format._intlService = p, v || this.gaugeInstance.noTransitionsRedraw()), v || (c || "svg") !== (w || "svg") ? this.refresh() : Object.keys(h).indexOf("pointer") > -1 ? Array.isArray(g.pointer) ? this.refreshAllValues(g.pointer.map((k) => k.value)) : this.refreshValue((g.pointer || {}).value) : this.refreshValue(g.value), e.dir !== t && this.gaugeInstance.setDirection(this.getDirection(t)), this.trigger("render", { sender: this });
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* @hidden
|
|
178
|
-
*/
|
|
179
|
-
componentWillUnmount() {
|
|
180
|
-
this.themeUnsubscriber();
|
|
181
|
-
const e = this.gaugeInstance && this.gaugeInstance.surfaceElement;
|
|
182
|
-
e && e.parentNode && e.parentNode.removeChild(e), this.gaugeInstance !== null && (this.gaugeInstance.destroy(), this.gaugeInstance = null), window.removeEventListener("resize", this.onWindowResize);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* @hidden
|
|
186
|
-
*/
|
|
187
|
-
render() {
|
|
188
|
-
const { style: e = {}, className: t, children: s } = this.props, n = Object.assign({}, e, { position: "relative" });
|
|
189
|
-
return /* @__PURE__ */ o.createElement(f.Provider, { value: this.contextValue }, /* @__PURE__ */ o.createElement(
|
|
190
|
-
"div",
|
|
191
|
-
{
|
|
192
|
-
style: n,
|
|
193
|
-
ref: (a) => this._element = a,
|
|
194
|
-
className: t
|
|
195
|
-
},
|
|
196
|
-
s
|
|
197
|
-
));
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* @hidden
|
|
201
|
-
*/
|
|
202
|
-
instantiateCoreGauge() {
|
|
203
|
-
const { dir: e, gaugeConstructor: t } = this.props, s = this.getGaugeOptions();
|
|
204
|
-
this.gaugeInstance = new t(
|
|
205
|
-
this.element,
|
|
206
|
-
s,
|
|
207
|
-
this.themeStore.getState(),
|
|
208
|
-
{
|
|
209
|
-
rtl: this.getDirection(e),
|
|
210
|
-
intlService: y(this),
|
|
211
|
-
sender: this
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* @hidden
|
|
217
|
-
*/
|
|
218
|
-
refresh() {
|
|
219
|
-
if (this.gaugeInstance !== null) {
|
|
220
|
-
const e = this.themeStore.getState(), t = this.getGaugeOptions();
|
|
221
|
-
this.gaugeInstance.setOptions(t, e);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* @hidden
|
|
226
|
-
*/
|
|
227
|
-
refreshValue(e) {
|
|
228
|
-
this.gaugeInstance.value(e);
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* @hidden
|
|
232
|
-
*/
|
|
233
|
-
refreshAllValues(e) {
|
|
234
|
-
this.gaugeInstance.allValues(e);
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* @hidden
|
|
238
|
-
*/
|
|
239
|
-
getDirection(e) {
|
|
240
|
-
return (e !== void 0 ? e : (() => I && window.getComputedStyle(this.element).direction)() || "ltr") === "rtl";
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* @hidden
|
|
244
|
-
*/
|
|
245
|
-
getGaugeOptions() {
|
|
246
|
-
const {
|
|
247
|
-
renderAs: e,
|
|
248
|
-
transitions: t,
|
|
249
|
-
deriveOptionsFromParent: s
|
|
250
|
-
} = this.props;
|
|
251
|
-
let n = Object.assign(
|
|
252
|
-
{
|
|
253
|
-
renderAs: e,
|
|
254
|
-
transitions: t
|
|
255
|
-
}
|
|
256
|
-
);
|
|
257
|
-
return s && (n = s(n)), n;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* @hidden
|
|
261
|
-
*/
|
|
262
|
-
trigger(e, t) {
|
|
263
|
-
const s = this.observersStore.getState();
|
|
264
|
-
for (let n = 0; n < s.length; n++)
|
|
265
|
-
s[n].trigger(e, t);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
u.propTypes = {
|
|
269
|
-
dir: b.string,
|
|
270
|
-
renderAs: b.oneOf(["svg", "canvas"])
|
|
271
|
-
};
|
|
272
|
-
u.defaultProps = {
|
|
273
|
-
renderAs: "svg"
|
|
274
|
-
};
|
|
275
|
-
E(u);
|
|
276
|
-
class _ extends o.Component {
|
|
277
|
-
constructor(e, t) {
|
|
278
|
-
super(e, t), this.state = {
|
|
279
|
-
arcCenterStyles: null,
|
|
280
|
-
arcCenterValue: {
|
|
281
|
-
value: 0,
|
|
282
|
-
color: ""
|
|
283
|
-
}
|
|
284
|
-
}, this._element = null, this.gaugeObserver = new N(this, {
|
|
285
|
-
render: "onRender"
|
|
286
|
-
}), t.observersStore.dispatch({
|
|
287
|
-
type: "add",
|
|
288
|
-
payload: this.gaugeObserver
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
render() {
|
|
292
|
-
const { render: e } = this.props, { arcCenterStyles: t, arcCenterValue: s } = this.state, n = t || { zIndex: -1 };
|
|
293
|
-
let a = null;
|
|
294
|
-
return e && (a = /* @__PURE__ */ o.createElement(
|
|
295
|
-
"div",
|
|
296
|
-
{
|
|
297
|
-
className: "k-arcgauge-label",
|
|
298
|
-
ref: (i) => this._element = i,
|
|
299
|
-
style: n
|
|
300
|
-
},
|
|
301
|
-
e(s.value, s.color)
|
|
302
|
-
)), a;
|
|
303
|
-
}
|
|
304
|
-
onRender(e) {
|
|
305
|
-
if (!this._element)
|
|
306
|
-
return;
|
|
307
|
-
const t = e.sender.gaugeInstance, s = this._element.offsetWidth, n = this._element.offsetHeight, a = t.centerLabelPosition(s, n);
|
|
308
|
-
this.setState({
|
|
309
|
-
arcCenterStyles: {
|
|
310
|
-
left: a.left,
|
|
311
|
-
top: a.top
|
|
312
|
-
},
|
|
313
|
-
arcCenterValue: {
|
|
314
|
-
value: t.value(),
|
|
315
|
-
color: t.currentColor()
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
_.contextType = f;
|
|
321
|
-
class J extends o.Component {
|
|
322
|
-
constructor() {
|
|
323
|
-
super(...arguments), this._baseGauge = null, this.gaugeType = R, this.getTarget = () => this, this.deriveOptionsFromParent = (e) => {
|
|
324
|
-
const { value: t, color: s, colors: n, opacity: a, scale: i } = this.props;
|
|
325
|
-
return Object.assign({}, e, {
|
|
326
|
-
value: t,
|
|
327
|
-
color: s,
|
|
328
|
-
colors: n,
|
|
329
|
-
opacity: a,
|
|
330
|
-
scale: i
|
|
331
|
-
});
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* @hidden
|
|
336
|
-
*/
|
|
337
|
-
get gaugeInstance() {
|
|
338
|
-
return this._baseGauge ? this._baseGauge.gaugeInstance : null;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* The Drawing `Surface` of the Gauge.
|
|
342
|
-
*/
|
|
343
|
-
get surface() {
|
|
344
|
-
return this._baseGauge ? this._baseGauge.surface : null;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* The DOM element of the Gauge.
|
|
348
|
-
*/
|
|
349
|
-
get element() {
|
|
350
|
-
return this._baseGauge ? this._baseGauge.element : null;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* @hidden
|
|
354
|
-
*/
|
|
355
|
-
render() {
|
|
356
|
-
const { children: e, arcCenterRender: t, centerRender: s, className: n, ...a } = this.props;
|
|
357
|
-
return /* @__PURE__ */ o.createElement(
|
|
358
|
-
u,
|
|
359
|
-
{
|
|
360
|
-
...a,
|
|
361
|
-
deriveOptionsFromParent: this.deriveOptionsFromParent,
|
|
362
|
-
ref: (i) => this._baseGauge = i,
|
|
363
|
-
gaugeConstructor: this.gaugeType,
|
|
364
|
-
getTarget: this.getTarget,
|
|
365
|
-
className: d("k-gauge k-arcgauge", n)
|
|
366
|
-
},
|
|
367
|
-
e,
|
|
368
|
-
/* @__PURE__ */ o.createElement(_, { render: s || t })
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Exports a Gauge component as a Drawing `Scene`.
|
|
373
|
-
*
|
|
374
|
-
* @param {any} options - The parameters for the export operation.
|
|
375
|
-
* @returns {Promise<Group>} - A promise that returns the root `Group` of the scene.
|
|
376
|
-
*/
|
|
377
|
-
exportVisual(e) {
|
|
378
|
-
return this.gaugeInstance !== null && this.element ? D(this.element, e) : Promise.resolve(new m());
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
class le extends J {
|
|
382
|
-
constructor() {
|
|
383
|
-
super(...arguments), this.gaugeType = V;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
class ue extends o.Component {
|
|
387
|
-
constructor() {
|
|
388
|
-
super(...arguments), this._baseGauge = null, this.getTarget = () => this, this.deriveOptionsFromParent = (e) => {
|
|
389
|
-
const { pointer: t, scale: s } = this.props;
|
|
390
|
-
return Object.assign({}, e, {
|
|
391
|
-
pointer: t,
|
|
392
|
-
scale: s
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* @hidden
|
|
398
|
-
*/
|
|
399
|
-
get gaugeInstance() {
|
|
400
|
-
return this._baseGauge !== null ? this._baseGauge.gaugeInstance : null;
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* The Drawing `Surface` of the Gauge.
|
|
404
|
-
*/
|
|
405
|
-
get surface() {
|
|
406
|
-
return this._baseGauge !== null ? this._baseGauge.surface : null;
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* The DOM element of the Gauge.
|
|
410
|
-
*/
|
|
411
|
-
get element() {
|
|
412
|
-
return this._baseGauge !== null ? this._baseGauge.element : null;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* @hidden
|
|
416
|
-
*/
|
|
417
|
-
render() {
|
|
418
|
-
const { children: e, className: t, ...s } = this.props;
|
|
419
|
-
return /* @__PURE__ */ o.createElement(
|
|
420
|
-
u,
|
|
421
|
-
{
|
|
422
|
-
...s,
|
|
423
|
-
deriveOptionsFromParent: this.deriveOptionsFromParent,
|
|
424
|
-
ref: (n) => this._baseGauge = n,
|
|
425
|
-
gaugeConstructor: A,
|
|
426
|
-
getTarget: this.getTarget,
|
|
427
|
-
className: d("k-gauge", t)
|
|
428
|
-
},
|
|
429
|
-
e
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* Exports a Gauge component as a Drawing `Scene`.
|
|
434
|
-
*
|
|
435
|
-
* @param {any} options - The parameters for the export operation.
|
|
436
|
-
* @returns {Promise<Group>} - A promise that returns the root `Group` of the scene.
|
|
437
|
-
*/
|
|
438
|
-
exportVisual(e) {
|
|
439
|
-
return this.gaugeInstance !== null ? Promise.resolve(this.gaugeInstance.exportVisual(e)) : Promise.resolve(new m());
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
class ce extends o.Component {
|
|
443
|
-
constructor() {
|
|
444
|
-
super(...arguments), this._baseGauge = null, this.getTarget = () => this, this.deriveOptionsFromParent = (e) => {
|
|
445
|
-
const { pointer: t, scale: s } = this.props;
|
|
446
|
-
return Object.assign({}, e, {
|
|
447
|
-
pointer: t,
|
|
448
|
-
scale: s
|
|
449
|
-
});
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* @hidden
|
|
454
|
-
*/
|
|
455
|
-
get gaugeInstance() {
|
|
456
|
-
return this._baseGauge !== null ? this._baseGauge.gaugeInstance : null;
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* The Drawing `Surface` of the Gauge.
|
|
460
|
-
*/
|
|
461
|
-
get surface() {
|
|
462
|
-
return this._baseGauge !== null ? this._baseGauge.surface : null;
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* The DOM element of the Gauge.
|
|
466
|
-
*/
|
|
467
|
-
get element() {
|
|
468
|
-
return this._baseGauge !== null ? this._baseGauge.element : null;
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* @hidden
|
|
472
|
-
*/
|
|
473
|
-
render() {
|
|
474
|
-
const { children: e, className: t, ...s } = this.props;
|
|
475
|
-
return /* @__PURE__ */ o.createElement(
|
|
476
|
-
u,
|
|
477
|
-
{
|
|
478
|
-
...s,
|
|
479
|
-
deriveOptionsFromParent: this.deriveOptionsFromParent,
|
|
480
|
-
ref: (n) => this._baseGauge = n,
|
|
481
|
-
gaugeConstructor: F,
|
|
482
|
-
getTarget: this.getTarget,
|
|
483
|
-
className: d("k-gauge", t)
|
|
484
|
-
},
|
|
485
|
-
e
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Exports a Gauge component as a Drawing `Scene`.
|
|
490
|
-
*
|
|
491
|
-
* @param {any} options - The parameters for the export operation.
|
|
492
|
-
* @returns {Promise<Group>} - A promise that returns the root `Group` of the scene.
|
|
493
|
-
*/
|
|
494
|
-
exportVisual(e) {
|
|
495
|
-
return this.gaugeInstance !== null ? Promise.resolve(this.gaugeInstance.exportVisual(e)) : Promise.resolve(new m());
|
|
496
|
-
}
|
|
497
|
-
}
|
|
9
|
+
import { ArcGauge as a } from "./ArcGauge.mjs";
|
|
10
|
+
import { CircularGauge as u } from "./CircularGauge.mjs";
|
|
11
|
+
import { LinearGauge as f } from "./LinearGauge.mjs";
|
|
12
|
+
import { RadialGauge as i } from "./RadialGauge.mjs";
|
|
498
13
|
export {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
14
|
+
a as ArcGauge,
|
|
15
|
+
u as CircularGauge,
|
|
16
|
+
f as LinearGauge,
|
|
17
|
+
i as RadialGauge
|
|
503
18
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-gauges",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const e = {
|
|
10
|
+
name: "@progress/kendo-react-gauges",
|
|
11
|
+
productName: "KendoReact",
|
|
12
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
+
publishDate: 1709714559,
|
|
14
|
+
version: "",
|
|
15
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as packageMetadata
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-gauges",
|
|
3
|
-
"version": "7.2.4-develop.
|
|
3
|
+
"version": "7.2.4-develop.4",
|
|
4
4
|
"description": "React Gauges provide a set of React components for building beautiful and customizable gauges. KendoReact Gauges package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-drawing": "^1.19.0",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-common": "7.2.4-develop.
|
|
28
|
-
"@progress/kendo-react-intl": "7.2.4-develop.
|
|
27
|
+
"@progress/kendo-react-common": "7.2.4-develop.4",
|
|
28
|
+
"@progress/kendo-react-intl": "7.2.4-develop.4",
|
|
29
29
|
"hammerjs": "^2.0.0",
|
|
30
30
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
31
31
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/store/reducer.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(t,e)=>{if(e.type)switch(e.type){case"set":return c.themeItem(t,e);case"push":return Object.assign(t,e.payload);default:return t}else return{}},i=(t,e)=>{if(e.type)switch(e.type){case"add":return[...t,e.payload];case"remove":return t.filter(s=>s!==e.payload);default:return t}else return[]},c={configurationItem(t,e){return Object.assign(t,{[e.gaugeKey]:e.payload})},collectionConfigurationItem(t,e){let s=!1;const[o,n]=e.gaugeCollectionIdxKey.split("_"),u=t[o].map((r,l)=>parseInt(n,10)===l?(s=!0,e.payload):r);return s===!1&&u.splice(parseInt(n,10),0,e.payload),Object.assign(t,{[o]:u})},themeItem(t,e){let s={},o=Object.assign(s,t);const{field:n,value:u}=e.payload,r=n.split(".");let l=r.shift();for(;r.length>0;)s=s[l]=s[l]||{},l=r.shift();return s[l]=u,o}};exports.observersReducer=i;exports.themeReducer=a;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const u = (t, e) => {
|
|
10
|
+
if (e.type)
|
|
11
|
+
switch (e.type) {
|
|
12
|
+
case "set":
|
|
13
|
+
return i.themeItem(t, e);
|
|
14
|
+
case "push":
|
|
15
|
+
return Object.assign(t, e.payload);
|
|
16
|
+
default:
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
else
|
|
20
|
+
return {};
|
|
21
|
+
}, p = (t, e) => {
|
|
22
|
+
if (e.type)
|
|
23
|
+
switch (e.type) {
|
|
24
|
+
case "add":
|
|
25
|
+
return [...t, e.payload];
|
|
26
|
+
case "remove":
|
|
27
|
+
return t.filter((s) => s !== e.payload);
|
|
28
|
+
default:
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
else
|
|
32
|
+
return [];
|
|
33
|
+
}, i = {
|
|
34
|
+
configurationItem(t, e) {
|
|
35
|
+
return Object.assign(t, {
|
|
36
|
+
[e.gaugeKey]: e.payload
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
collectionConfigurationItem(t, e) {
|
|
40
|
+
let s = !1;
|
|
41
|
+
const [n, o] = e.gaugeCollectionIdxKey.split("_"), a = t[n].map((r, l) => parseInt(o, 10) === l ? (s = !0, e.payload) : r);
|
|
42
|
+
return s === !1 && a.splice(parseInt(o, 10), 0, e.payload), Object.assign(t, {
|
|
43
|
+
[n]: a
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
themeItem(t, e) {
|
|
47
|
+
let s = {}, n = Object.assign(s, t);
|
|
48
|
+
const { field: o, value: a } = e.payload, r = o.split(".");
|
|
49
|
+
let l = r.shift();
|
|
50
|
+
for (; r.length > 0; )
|
|
51
|
+
s = s[l] = s[l] || {}, l = r.shift();
|
|
52
|
+
return s[l] = a, n;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
p as observersReducer,
|
|
57
|
+
u as themeReducer
|
|
58
|
+
};
|
package/store/store.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@progress/kendo-react-common"),n=1e3/60,d=i=>{let o,r,e=[];const u=()=>o,c=t=>{o=i(o,t),l.canUseDOM&&(window.clearTimeout(r),r=window.setTimeout(()=>e.forEach(s=>s()),n))},a=t=>(e.push(t),()=>e=e.filter(s=>s!==t));return c({}),{getState:u,dispatch:c,subscribe:a}};exports.THROTTLE_MS=n;exports.default=d;
|