utils
#
Grid UtilsmergeConfig
covertPrefixToList
function convertPropsToList(props,config=_media__WEBPACK_IMPORTED_MODULE_0__/* .defaultConfig */ .u_){const prefix=props.map(([key,val])=>[(0,_media__WEBPACK_IMPORTED_MODULE_0__/* .convertObjToStr */ .bV)(key,config),(0,_media__WEBPACK_IMPORTED_MODULE_0__/* .convertNumToPix */ .mr)(val,config)]);return convertPrefixToList(prefix,config);}
convertPropsToList
function convertPropsToList(props,config=_media__WEBPACK_IMPORTED_MODULE_0__/* .defaultConfig */ .u_){const prefix=props.map(([key,val])=>[(0,_media__WEBPACK_IMPORTED_MODULE_0__/* .convertObjToStr */ .bV)(key,config),(0,_media__WEBPACK_IMPORTED_MODULE_0__/* .convertNumToPix */ .mr)(val,config)]);return convertPrefixToList(prefix,config);}
convertFuncionToList
function convertFuncionToList(props){const list=props.map(p=>p instanceof Array?p:Object.entries(p));return list[0].map(p=>p[0]).map(key=>[key,list.map(p=>p.find(v=>v[0]===key)[1])]);}
#
Media UtilsdefaultMedia
:MediaString
defaultConfig
:Config
convertNumToPix
function convertNumToPix(value,config=defaultConfig){let target=config.widthRef;if(target&&'current'in target)target=target.current;let width=target?target.clientWidth:config.width||0;// todo window.innerWidth
if(_helpers__WEBPACK_IMPORTED_MODULE_0__.is.num(value)&&value**2<1)return value<0?width*(Number(value)+1)<<0:width*Number(value)<<0;if(value instanceof Array&&value.every(v=>_helpers__WEBPACK_IMPORTED_MODULE_0__.is.num(v))){const border=value.filter(v=>v>0).map(v=>v<1?width*Number(v):v);const margin=width-(border.length?border.reduce((a,b)=>a+b):0);return value.map(v=>v===0?0:v<0?v>-1?~~(margin*Number(-v)):v:v<1?~~(width*Number(v)):v);}return value;}
#
Helpersis