UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

5 lines (4 loc) 705 B
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details. v3.2.1 */ var r=["date","datetime-local","month","number","range","time","week"],x=["email","password","search","tel","text","url"],u=["email","password","search","tel","text","textarea","url"];function a(e,n,t,c){let s=t.toLowerCase(),i=e[t];c&&i!=null?n.setAttribute(s,`${i}`):n.removeAttribute(s)}function m(e,n,t){t.type=e==="textarea"?"text":e;let c=r.includes(e),s=n;a(s,t,"min",c),a(s,t,"max",c),a(s,t,"step",c);let i=u.includes(e),o=n;a(o,t,"minLength",i),a(o,t,"maxLength",i);let l=x.includes(e);a(o,t,"pattern",l)}export{m as a};