@dracoui/ember
Version:
Draco Design System for Ember
3 lines (2 loc) • 1.5 kB
JavaScript
import{b as e}from"../../../_rollupPluginBabelHelpers-CLoDr8uC.js";import{DracoInputSizeValues as t,DracoInputTypeValues as o,DracoInputIconPositionValues as r}from"./types.js";import{assert as s}from"@ember/debug";import"@ember/object";import i from"@glimmer/component";import{DracoLinkIconPositionValues as n}from"../link/types.js";import{precompileTemplate as m}from"@ember/template-compilation";import{setComponentTemplate as p}from"@ember/component";var a=m("<input\n class={{this.classNames}}\n placeholder={{this.placeholder}}\n ...attributes\n value={{@value}}\n type={{this.type}}\n/>");const l=o.Text,c=t.Medium,u=n.Leading,h=Object.values(o),d=Object.values(t),g=Object.values(r);class b extends i{constructor(t,o){super(t,o),e(this,"componentName","Draco::Input")}get placeholder(){return this.args.placeholder??void 0}get error(){return this.args.error??void 0}get size(){const{size:e=c}=this.args;return s(`@size for "${this.componentName}" must be one of the following: ${d.join(", ")}; received: ${e}`,d.includes(e)),e}get type(){const{type:e=l}=this.args;return s(`@type for "${this.componentName}" must be one of the following: ${h.join(", ")}; received: ${e}`,h.includes(e)),e}get classNames(){const e=["draco-input"];return e.push(`draco-input--size-${this.size}`),e.join(" ")}}p(a,b);export{g as AVAILABLE_ICON_POSITIONS,d as AVAILABLE_SIZES,h as AVAILABLE_TYPES,u as DEFAULT_ICON_POSITION,c as DEFAULT_SIZE,l as DEFAULT_TYPE,b as default};
//# sourceMappingURL=index.js.map