UNPKG

@progress/kendo-react-gauges

Version:

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

9 lines (8 loc) 2.33 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 f=e=>typeof e!="string"?!1:e.startsWith("--")||e.startsWith("var(")&&e.endsWith(")"),a=(e,s)=>{if(!f(e))return e;const r=s||document.documentElement,u=getComputedStyle(r);let l;if(e.startsWith("var(")&&e.endsWith(")")){l=e.slice(4,-1).trim();const i=l.indexOf(",");i>-1&&(l=l.substring(0,i).trim())}else if(e.startsWith("--"))l=e;else return e;return u.getPropertyValue(l).trim()||e},o=(e,s)=>{if(!e||typeof e!="object")return e;const r={...e};return typeof e.color=="string"&&(r.color=a(e.color,s)),r},c=(e,s)=>Array.isArray(e)?e.map(r=>o(r,s)):e,t=(e,s)=>{if(!e||typeof e!="object")return e;const r={...e};return typeof e.color=="string"&&(r.color=a(e.color,s)),r},b=(e,s)=>e&&(Array.isArray(e)?e.map(r=>t(r,s)):t(e,s)),y=(e,s)=>{if(!e||typeof e!="object")return e;const r={...e};return typeof e.color=="string"&&(r.color=a(e.color,s)),Array.isArray(e.colors)&&(r.colors=c(e.colors,s)),e.pointer&&(r.pointer=b(e.pointer,s)),e.scale&&typeof e.scale=="object"&&(r.scale={...e.scale},Array.isArray(e.scale.ranges)&&(r.scale.ranges=c(e.scale.ranges,s)),e.scale.labels&&typeof e.scale.labels=="object"&&(r.scale.labels={...e.scale.labels},typeof e.scale.labels.color=="string"&&(r.scale.labels.color=a(e.scale.labels.color,s))),e.scale.majorTicks&&typeof e.scale.majorTicks=="object"&&(r.scale.majorTicks={...e.scale.majorTicks},typeof e.scale.majorTicks.color=="string"&&(r.scale.majorTicks.color=a(e.scale.majorTicks.color,s))),e.scale.minorTicks&&typeof e.scale.minorTicks=="object"&&(r.scale.minorTicks={...e.scale.minorTicks},typeof e.scale.minorTicks.color=="string"&&(r.scale.minorTicks.color=a(e.scale.minorTicks.color,s)))),r};exports.isCssVariable=f;exports.resolveColorRangeVariables=o;exports.resolveColorsArray=c;exports.resolveCssVariable=a;exports.resolveGaugeColorsVariables=y;exports.resolvePointerColorsVariables=b;exports.resolvePointerVariables=t;