You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.4 KiB

{"version":3,"file":"validators.mjs","sources":["../../../../packages/utils/validators.ts"],"sourcesContent":["import { isNumber } from './util'\n\nexport const isValidWidthUnit = (val: string | number): boolean => {\n if (isNumber(val)) {\n return true\n }\n return (\n ['px', 'rem', 'em', 'vw', '%', 'vmin', 'vmax'].some((unit) =>\n val.endsWith(unit)\n ) || val.startsWith('calc')\n )\n}\n\nexport const isValidComponentSize = (val: string) =>\n ['', 'large', 'default', 'small'].includes(val)\n\nexport const isValidDatePickType = (val: string) =>\n [\n 'year',\n 'month',\n 'date',\n 'dates',\n 'week',\n 'datetime',\n 'datetimerange',\n 'daterange',\n 'monthrange',\n ].includes(val)\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG,CAAC,GAAG,KAAK;AACzC,EAAE,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;AACrB,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACrH,EAAE;AACU,MAAC,oBAAoB,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE;AACjF,MAAC,mBAAmB,GAAG,CAAC,GAAG,KAAK;AAC5C,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,eAAe;AACjB,EAAE,WAAW;AACb,EAAE,YAAY;AACd,CAAC,CAAC,QAAQ,CAAC,GAAG;;;;"}