UNPKG

@progress/kendo-react-gauges

Version:

React Gauges provide a set of React components for building beautiful and customizable gauges. KendoReact Gauges package

58 lines (57 loc) 1.55 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ const p = (t, e) => { if (e.type) switch (e.type) { case "set": return i.themeItem(t, e); case "push": return Object.assign(t, e.payload); default: return t; } else return {}; }, u = (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 []; }, i = { configurationItem(t, e) { return Object.assign(t, { [e.gaugeKey]: e.payload }); }, collectionConfigurationItem(t, e) { let s = !1; const [o, n] = e.gaugeCollectionIdxKey.split("_"), a = t[o].map((r, l) => parseInt(n, 10) === l ? (s = !0, e.payload) : r); return s === !1 && a.splice(parseInt(n, 10), 0, e.payload), Object.assign(t, { [o]: a }); }, themeItem(t, e) { let s = {}; const o = Object.assign(s, t), { field: n, value: a } = e.payload, r = n.split("."); let l = r.shift(); for (; r.length > 0; ) s = s[l] = s[l] || {}, l = r.shift(); return s[l] = a, o; } }; export { u as observersReducer, p as themeReducer };