UNPKG

@progress/kendo-react-map

Version:
9 lines (8 loc) 1.23 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=(t,e)=>e.mapCollectionIdxKey?a.collectionConfigurationItem(t,e):e.mapKey?a.configurationItem(t,e):{},u=(t,e)=>{if(e.type)switch(e.type){case"add":return[...t,e.payload];case"remove":return t.filter(o=>o!==e.payload);default:return t}else return[]},a={configurationItem(t,e){return Object.assign(t,{[e.mapKey]:e.payload})},collectionConfigurationItem(t,e){let o=!1;const[s,n]=e.mapCollectionIdxKey.split("_"),i=t[s].map((l,r)=>parseInt(n,10)===r?(o=!0,e.payload):l);return o===!1&&i.splice(parseInt(n,10),0,e.payload),Object.assign(t,{[s]:i})},themeItem(t,e){let o={};const s=Object.assign(o,t),{field:n,value:i}=e.payload,l=n.split(".");let r=l.shift();for(;l.length>0;)o=o[r]=o[r]||{},r=l.shift();return o[r]=i,s}};exports.observersReducer=u;exports.optionsReducer=c;