@progress/kendo-vue-gauges
Version:
9 lines (8 loc) • 1.1 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;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{}},c={configurationItem(t,e){return Object.assign(t,{[e.gaugeKey]:e.payload})},collectionConfigurationItem(t,e){let l=!1;const[n,o]=e.gaugeCollectionIdxKey.split("_"),i=t[n].map((r,s)=>parseInt(o,10)===s?(l=!0,e.payload):r);return l===!1&&i.splice(parseInt(o,10),0,e.payload),Object.assign(t,{[n]:i})},themeItem(t,e){let l={},n=Object.assign(l,t);const{field:o,value:i}=e.payload,r=o.split(".");let s=r.shift();for(;r.length>0;)l=l[s]=l[s]||{},s=r.shift();return l[s]=i,n}};exports.themeReducer=a;