UNPKG

@progress/kendo-react-form

Version:

React Form is a small and fast package for form state management with zero dependencies. KendoReact Form package

9 lines (8 loc) 2.69 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 a=" ";function p(r){let e=r.clientWidth;const n=getComputedStyle(r);return e-=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.borderLeftWidth)||0),e-=(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderRightWidth)||0),e}function o(r,e){var n,l;if(!(r!=null&&r.length)||e==null)return"";for(const[s,t]of r.entries()){const i=s>0&&r[s-1].maxWidth!==void 0?r[s-1].maxWidth:void 0,c=s<r.length-1&&r[s+1].minWidth!==void 0?r[s+1].minWidth:void 0,f=(n=t.minWidth)!=null?n:i!==void 0?i+1:0,d=(l=t.maxWidth)!=null?l:c!==void 0?c-1:1/0;if(e>=f&&e<=d)return t.value}return""}const u=r=>{if(typeof r=="number")return`${r}px`;if(typeof r=="string"){const e=r.trim(),n=parseInt(e,10);return!isNaN(n)&&Number.isFinite(n)?n.toString()===e?`${n}px`:r:null}return null},y=(r,e)=>{if(!r)return null;if(Array.isArray(r)&&r.length>0){const n=o(r,e)||null;return typeof n=="string"?parseInt(n,10):n}else if(typeof r=="number")return r;return null},m=r=>r&&r>0?`k-grid-cols-${r}`:"",C=(r,e)=>{if(!r)return null;if(typeof r=="number")return r;if(Array.isArray(r)&&r.length>0){const n=o(r,e)||null;return typeof n=="string"?parseInt(n,10):n}return null},h=r=>r?`k-col-span-${r}`:"",w=(r,e)=>{if(!r)return null;if(typeof r=="number")return{cols:r,rows:r};if(typeof r=="string"){if(!r.includes(a))return{cols:r,rows:r};const n=r.split(a);return{cols:n[1],rows:n[0]}}else if(Array.isArray(r)){const n=o(r,e)||null;return n!==null?{cols:n,rows:n}:null}else if(typeof r=="object"){const n=r,l={rows:null,cols:null};return n.cols!==void 0&&n.cols!==null?typeof n.cols=="number"||typeof n.cols=="string"?l.cols=n.cols:Array.isArray(n.cols)&&(l.cols=o(n.cols,e)||null):l.cols=null,n.rows!==void 0?typeof n.rows=="number"||typeof n.rows=="string"?l.rows=n.rows:Array.isArray(n.rows)&&(l.rows=o(n.rows,e)||null):l.rows=null,l}return null},A=(r,e)=>{var s,t,i,c;const n=u((t=(s=r==null?void 0:r.rows)!=null?s:e.rows)!=null?t:"0px"),l=u((c=(i=r==null?void 0:r.cols)!=null?i:e.cols)!=null?c:"32px");return`${n} ${l}`};exports.calculateColSpan=C;exports.calculateColumns=y;exports.calculateGutters=w;exports.generateColSpanClass=h;exports.generateColumnClass=m;exports.generateGuttersStyling=A;exports.innerWidth=p;exports.processBreakpoints=o;exports.processCssValue=u;