@commmerce/ui 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cdn.js CHANGED
@@ -272,14 +272,15 @@ var Mg=o=>{throw TypeError(o)};var Hm=(o,n,e)=>n.has(o)||Mg("Cannot "+e);var r=(
272
272
  [role='option']:not([aria-disabled='true']):not([aria-selected='true']):active { background: color-mix(in srgb, var(--cm-bg-hover), var(--cm-text-default) 8%); }
273
273
  :host([size='small']) [role='option'] { min-height: var(--cm-control-height-sm, 32px); }
274
274
  @media (pointer: coarse) { [role='option'], :host([size='small']) [role='option'] { min-height: var(--cm-control-height-touch, 44px); } }
275
- `;var fd=!1,tp=!1,sf=!1,nf=()=>{fd||(fd=!0,setTimeout(()=>{fd=!1,tp=!1}))};function Wy(){sf||typeof document>"u"||(sf=!0,document.addEventListener("click",nf,!0),document.addEventListener("keydown",o=>{(o.key==="Enter"||o.ctrlKey||o.metaKey)&&nf()},!0))}var Ne,lr,La,Sa,bi,Lo,cr,So,ip,Do,bd,vd,ee=class{constructor(n,e,t){m(this,So);m(this,Ne);m(this,lr);m(this,La);m(this,Sa,!1);m(this,bi,!1);m(this,Lo,"");m(this,cr,!1);m(this,Do,()=>{g(this,Sa,!0)});m(this,bd,n=>{let e=n.relatedTarget;e&&(r(this,Ne).contains(e)||r(this,Ne).shadowRoot?.contains(e))||r(this,Ne).updateComplete.then(()=>{if(!r(this,Sa)||r(this,bi))return;let t=r(this,lr).validity;t.valid||t.valueMissing||(g(this,bi,!0),r(this,Ne).requestUpdate())})});m(this,vd,n=>{if(!(!fd&&!r(this,cr))){if(n.preventDefault(),g(this,bi,!0),r(this,Ne).requestUpdate(),r(this,cr)){r(this,La).call(this);return}tp||(tp=!0,r(this,La).call(this))}});g(this,Ne,n),g(this,lr,e),g(this,La,t??(()=>n.focus())),Wy(),n.addEventListener("invalid",r(this,vd)),n.addEventListener("input",r(this,Do),!0),n.addEventListener("change",r(this,Do),!0),n.addEventListener("focusout",r(this,bd))}get message(){return s(this,So,ip).call(this)}sync(){let n=s(this,So,ip).call(this);r(this,Ne).toggleAttribute("data-cm-invalid",!!n),n!==r(this,Lo)&&(g(this,Lo,n),queueMicrotask(()=>r(this,Ne).requestUpdate()))}reset(){g(this,Sa,g(this,bi,!1)),r(this,Ne).requestUpdate()}report(n){g(this,cr,!0);try{return n()}finally{g(this,cr,!1)}}};Ne=new WeakMap,lr=new WeakMap,La=new WeakMap,Sa=new WeakMap,bi=new WeakMap,Lo=new WeakMap,cr=new WeakMap,So=new WeakSet,ip=function(){return r(this,Ne).error?r(this,Ne).error:r(this,bi)?r(this,lr).validity.valid?"":r(this,lr).validationMessage:""},Do=new WeakMap,bd=new WeakMap,vd=new WeakMap;var a0=z("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time.",badEmail:"Enter an email address like name@example.com.",badUrl:"Enter a web address like https://example.com.",badNumber:"Enter a number.",pattern:"Enter a value in the requested format.",tooShort:"Enter at least {min} characters.",tooLong:"Enter {max} characters or fewer."}),oe,dr,qt,Ro,te,of,Ao,yd,lf,rp,ap,sp,vi=class extends T{constructor(){super(...arguments);m(this,te);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.size="default";this.patternMessage="";m(this,oe,this.attachInternals());m(this,dr,new ee(this,r(this,oe)));m(this,qt,R("cm-tf"));m(this,Ro,"")}connectedCallback(){super.connectedCallback(),g(this,Ro,this.value)}get form(){return r(this,oe).form}get validity(){return r(this,oe).validity}get validationMessage(){return r(this,oe).validationMessage}checkValidity(){return s(this,te,Ao).call(this),r(this,oe).checkValidity()}reportValidity(){return s(this,te,Ao).call(this),r(this,dr).report(()=>r(this,oe).reportValidity())}formResetCallback(){this.value=r(this,Ro),this.error="",r(this,dr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,oe).setFormValue(this.value),s(this,te,Ao).call(this)}render(){let e=r(this,dr).message,t=[e&&`${r(this,qt)}-err`,this.helpText&&`${r(this,qt)}-help`].filter(Boolean).join(" ")||h,i={id:r(this,qt),invalid:e?"true":h},a=this.minLength!=null&&this.minLength>0?this.minLength:h,l=this.maxLength!=null&&this.maxLength>=0?this.maxLength:h,d=this.multiline?c`<textarea class="input" part="input" id=${i.id} rows=${this.rows}
275
+ `;var fd=!1,tp=!1,sf=!1,nf=()=>{fd||(fd=!0,setTimeout(()=>{fd=!1,tp=!1}))};function Wy(){sf||typeof document>"u"||(sf=!0,document.addEventListener("click",nf,!0),document.addEventListener("keydown",o=>{(o.key==="Enter"||o.ctrlKey||o.metaKey)&&nf()},!0))}var Ne,lr,La,Sa,bi,Lo,cr,So,ip,Do,bd,vd,ee=class{constructor(n,e,t){m(this,So);m(this,Ne);m(this,lr);m(this,La);m(this,Sa,!1);m(this,bi,!1);m(this,Lo,"");m(this,cr,!1);m(this,Do,()=>{g(this,Sa,!0)});m(this,bd,n=>{let e=n.relatedTarget;e&&(r(this,Ne).contains(e)||r(this,Ne).shadowRoot?.contains(e))||r(this,Ne).updateComplete.then(()=>{if(!r(this,Sa)||r(this,bi))return;let t=r(this,lr).validity;t.valid||t.valueMissing||(g(this,bi,!0),r(this,Ne).requestUpdate())})});m(this,vd,n=>{if(!(!fd&&!r(this,cr))){if(n.preventDefault(),g(this,bi,!0),r(this,Ne).requestUpdate(),r(this,cr)){r(this,La).call(this);return}tp||(tp=!0,r(this,La).call(this))}});g(this,Ne,n),g(this,lr,e),g(this,La,t??(()=>n.focus())),Wy(),n.addEventListener("invalid",r(this,vd)),n.addEventListener("input",r(this,Do),!0),n.addEventListener("change",r(this,Do),!0),n.addEventListener("focusout",r(this,bd))}get message(){return s(this,So,ip).call(this)}sync(){let n=s(this,So,ip).call(this);r(this,Ne).toggleAttribute("data-cm-invalid",!!n),n!==r(this,Lo)&&(g(this,Lo,n),queueMicrotask(()=>r(this,Ne).requestUpdate()))}reset(){g(this,Sa,g(this,bi,!1)),r(this,Ne).requestUpdate()}report(n){g(this,cr,!0);try{return n()}finally{g(this,cr,!1)}}};Ne=new WeakMap,lr=new WeakMap,La=new WeakMap,Sa=new WeakMap,bi=new WeakMap,Lo=new WeakMap,cr=new WeakMap,So=new WeakSet,ip=function(){return r(this,Ne).error?r(this,Ne).error:r(this,bi)?r(this,lr).validity.valid?"":r(this,lr).validationMessage:""},Do=new WeakMap,bd=new WeakMap,vd=new WeakMap;var a0=z("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time.",badEmail:"Enter an email address like name@example.com.",badUrl:"Enter a web address like https://example.com.",badNumber:"Enter a number.",pattern:"Enter a value in the requested format.",tooShort:"Enter at least {min} characters.",tooLong:"Enter {max} characters or fewer."}),oe,dr,qt,Ro,te,of,Ao,yd,lf,rp,ap,sp,vi=class extends T{constructor(){super(...arguments);m(this,te);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.inputMode="";this.size="default";this.patternMessage="";m(this,oe,this.attachInternals());m(this,dr,new ee(this,r(this,oe)));m(this,qt,R("cm-tf"));m(this,Ro,"")}connectedCallback(){super.connectedCallback(),g(this,Ro,this.value)}get form(){return r(this,oe).form}get validity(){return r(this,oe).validity}get validationMessage(){return r(this,oe).validationMessage}checkValidity(){return s(this,te,Ao).call(this),r(this,oe).checkValidity()}reportValidity(){return s(this,te,Ao).call(this),r(this,dr).report(()=>r(this,oe).reportValidity())}formResetCallback(){this.value=r(this,Ro),this.error="",r(this,dr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,oe).setFormValue(this.value),s(this,te,Ao).call(this)}render(){let e=r(this,dr).message,t=[e&&`${r(this,qt)}-err`,this.helpText&&`${r(this,qt)}-help`].filter(Boolean).join(" ")||h,i={id:r(this,qt),invalid:e?"true":h},a=this.minLength!=null&&this.minLength>0?this.minLength:h,l=this.maxLength!=null&&this.maxLength>=0?this.maxLength:h,d=this.multiline?c`<textarea class="input" part="input" id=${i.id} rows=${this.rows}
276
276
  .value=${ce(this.value)} placeholder=${this.placeholder||h}
277
+ inputmode=${this.inputMode||h}
277
278
  minlength=${a} maxlength=${l}
278
279
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
279
280
  aria-invalid=${i.invalid} aria-describedby=${t}
280
281
  @input=${s(this,te,rp)} @change=${s(this,te,sp)} @blur=${s(this,te,ap)}></textarea>`:c`<input class="input" part="input" id=${i.id} type=${this.type}
281
282
  .value=${ce(this.value)} placeholder=${this.placeholder||h}
282
- autocomplete=${this.autocomplete??h}
283
+ autocomplete=${this.autocomplete??h} inputmode=${this.inputMode||h}
283
284
  min=${this.min||h} max=${this.max||h} step=${this.step||h}
284
285
  pattern=${this.pattern||h} minlength=${a} maxlength=${l}
285
286
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
@@ -289,7 +290,7 @@ var Mg=o=>{throw TypeError(o)};var Hm=(o,n,e)=>n.has(o)||Mg("Cannot "+e);var r=(
289
290
  ${d}
290
291
  ${e?c`<p class="error" id="${r(this,qt)}-err" role="alert">${e}</p>`:h}
291
292
  ${this.helpText?c`<p class="help" id="${r(this,qt)}-help">${this.helpText}</p>`:h}
292
- </div>`}};oe=new WeakMap,dr=new WeakMap,qt=new WeakMap,Ro=new WeakMap,te=new WeakSet,of=function(e){if(!this.pattern)return!0;for(let t of["v","u"])try{return new RegExp(`^(?:${this.pattern})$`,t).test(e)}catch{}return!0},Ao=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?r(this,oe).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?r(this,oe).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.type==="number"&&t?.badInput?r(this,oe).setValidity({badInput:!0},this.t("badNumber"),e??void 0):this.required&&!this.value?r(this,oe).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.typeMismatch?r(this,oe).setValidity({typeMismatch:!0},this.t(this.type==="url"?"badUrl":"badEmail"),e??void 0):this.value&&this.minLength!=null&&this.minLength>0&&this.value.length<this.minLength?r(this,oe).setValidity({tooShort:!0},this.t("tooShort",{min:this.minLength}),e??void 0):this.value&&this.maxLength!=null&&this.maxLength>=0&&this.value.length>this.maxLength?r(this,oe).setValidity({tooLong:!0},this.t("tooLong",{max:this.maxLength}),e??void 0):this.value&&!s(this,te,of).call(this,this.value)?r(this,oe).setValidity({patternMismatch:!0},this.patternMessage||this.t("pattern"),e??void 0):!this.multiline&&t?.rangeUnderflow?r(this,oe).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:s(this,te,yd).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?r(this,oe).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:s(this,te,yd).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?r(this,oe).setValidity({stepMismatch:!0},this.t("stepMismatch",s(this,te,lf).call(this,e)),e??void 0):r(this,oe).setValidity({}),r(this,dr).sync()},yd=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let l=/^(\d{2}):(\d{2})/.exec(e);return l?ne(new Date(2e3,0,1,+l[1],+l[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let a=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?ne(a,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):ne(a,{day:"numeric",month:"short",year:"numeric"},t)},lf=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),a=e.valueAsNumber,l=document.createElement("input");l.type=this.type,l.value=this.min??"";let d=Number.isFinite(l.valueAsNumber)?l.valueAsNumber:0,p=d+Math.floor((a-d)/i)*i,u=b=>{if(this.type==="number")return this.formatNumber(Number(b.toPrecision(12)));let x=new Date(b).toISOString();return s(this,te,yd).call(this,this.type==="time"?x.slice(11,16):this.type==="date"?x.slice(0,10):x.slice(0,16))};return{lower:u(p),upper:u(p+i)}},rp=function(e){this.value=e.target.value},ap=function(){s(this,te,Ao).call(this)},sp=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},vi.formAssociated=!0,vi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},vi.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},size:{reflect:!0},min:{},max:{},step:{},pattern:{},patternMessage:{attribute:"pattern-message"},minLength:{type:Number,attribute:"minlength"},maxLength:{type:Number,attribute:"maxlength"}},vi.styles=[E,rt,w`
293
+ </div>`}};oe=new WeakMap,dr=new WeakMap,qt=new WeakMap,Ro=new WeakMap,te=new WeakSet,of=function(e){if(!this.pattern)return!0;for(let t of["v","u"])try{return new RegExp(`^(?:${this.pattern})$`,t).test(e)}catch{}return!0},Ao=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?r(this,oe).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?r(this,oe).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.type==="number"&&t?.badInput?r(this,oe).setValidity({badInput:!0},this.t("badNumber"),e??void 0):this.required&&!this.value?r(this,oe).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.typeMismatch?r(this,oe).setValidity({typeMismatch:!0},this.t(this.type==="url"?"badUrl":"badEmail"),e??void 0):this.value&&this.minLength!=null&&this.minLength>0&&this.value.length<this.minLength?r(this,oe).setValidity({tooShort:!0},this.t("tooShort",{min:this.minLength}),e??void 0):this.value&&this.maxLength!=null&&this.maxLength>=0&&this.value.length>this.maxLength?r(this,oe).setValidity({tooLong:!0},this.t("tooLong",{max:this.maxLength}),e??void 0):this.value&&!s(this,te,of).call(this,this.value)?r(this,oe).setValidity({patternMismatch:!0},this.patternMessage||this.t("pattern"),e??void 0):!this.multiline&&t?.rangeUnderflow?r(this,oe).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:s(this,te,yd).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?r(this,oe).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:s(this,te,yd).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?r(this,oe).setValidity({stepMismatch:!0},this.t("stepMismatch",s(this,te,lf).call(this,e)),e??void 0):r(this,oe).setValidity({}),r(this,dr).sync()},yd=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let l=/^(\d{2}):(\d{2})/.exec(e);return l?ne(new Date(2e3,0,1,+l[1],+l[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let a=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?ne(a,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):ne(a,{day:"numeric",month:"short",year:"numeric"},t)},lf=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),a=e.valueAsNumber,l=document.createElement("input");l.type=this.type,l.value=this.min??"";let d=Number.isFinite(l.valueAsNumber)?l.valueAsNumber:0,p=d+Math.floor((a-d)/i)*i,u=b=>{if(this.type==="number")return this.formatNumber(Number(b.toPrecision(12)));let x=new Date(b).toISOString();return s(this,te,yd).call(this,this.type==="time"?x.slice(11,16):this.type==="date"?x.slice(0,10):x.slice(0,16))};return{lower:u(p),upper:u(p+i)}},rp=function(e){this.value=e.target.value},ap=function(){s(this,te,Ao).call(this)},sp=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},vi.formAssociated=!0,vi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},vi.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},inputMode:{attribute:"inputmode"},size:{reflect:!0},min:{},max:{},step:{},pattern:{},patternMessage:{attribute:"pattern-message"},minLength:{type:Number,attribute:"minlength"},maxLength:{type:Number,attribute:"maxlength"}},vi.styles=[E,rt,w`
293
294
  :host { display: block; }
294
295
  .input {
295
296
  width: 100%; height: var(--_cm-field-h); padding: 0 var(--_cm-field-pad);
@@ -85,6 +85,9 @@ export declare class CmTextField extends CmLocalizedElement {
85
85
  reflect: boolean;
86
86
  };
87
87
  autocomplete: {};
88
+ inputMode: {
89
+ attribute: string;
90
+ };
88
91
  size: {
89
92
  reflect: boolean;
90
93
  };
@@ -135,6 +138,12 @@ export declare class CmTextField extends CmLocalizedElement {
135
138
  readonly: boolean;
136
139
  /** Native autocomplete hint, e.g. `email`, `postal-code`. */
137
140
  autocomplete?: string;
141
+ /**
142
+ * Which on-screen keyboard phones open: `email`, `url`, `tel`, `numeric`, `decimal`, `search` or `text`, passed to the
143
+ * inner input. Use it with `type="text"` when your own check replaces the browser's (for example an email rule that
144
+ * matches your server), so the box still opens the right keyboard. Since 1.15.
145
+ */
146
+ inputMode: string;
138
147
  /** `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch screens both are 44px. */
139
148
  size: 'default' | 'medium' | 'small';
140
149
  /**
@@ -87,6 +87,12 @@ export class CmTextField extends CmLocalizedElement {
87
87
  this.disabled = false;
88
88
  /** Shows the value on the filled background; the value is still submitted. */
89
89
  this.readonly = false;
90
+ /**
91
+ * Which on-screen keyboard phones open: `email`, `url`, `tel`, `numeric`, `decimal`, `search` or `text`, passed to the
92
+ * inner input. Use it with `type="text"` when your own check replaces the browser's (for example an email rule that
93
+ * matches your server), so the box still opens the right keyboard. Since 1.15.
94
+ */
95
+ this.inputMode = '';
90
96
  /** `small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch screens both are 44px. */
91
97
  this.size = 'default';
92
98
  /** The message when the value doesn't match `pattern`, e.g. "Enter the 6-digit PIN.". Since 1.14. */
@@ -127,13 +133,14 @@ export class CmTextField extends CmLocalizedElement {
127
133
  const control = this.multiline
128
134
  ? html `<textarea class="input" part="input" id=${common.id} rows=${this.rows}
129
135
  .value=${live(this.value)} placeholder=${this.placeholder || nothing}
136
+ inputmode=${this.inputMode || nothing}
130
137
  minlength=${minLength} maxlength=${maxLength}
131
138
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
132
139
  aria-invalid=${common.invalid} aria-describedby=${describedBy}
133
140
  @input=${__classPrivateFieldGet(this, _CmTextField_instances, "m", _CmTextField_onInput)} @change=${__classPrivateFieldGet(this, _CmTextField_instances, "m", _CmTextField_onChange)} @blur=${__classPrivateFieldGet(this, _CmTextField_instances, "m", _CmTextField_onBlur)}></textarea>`
134
141
  : html `<input class="input" part="input" id=${common.id} type=${this.type}
135
142
  .value=${live(this.value)} placeholder=${this.placeholder || nothing}
136
- autocomplete=${this.autocomplete ?? nothing}
143
+ autocomplete=${this.autocomplete ?? nothing} inputmode=${this.inputMode || nothing}
137
144
  min=${this.min || nothing} max=${this.max || nothing} step=${this.step || nothing}
138
145
  pattern=${this.pattern || nothing} minlength=${minLength} maxlength=${maxLength}
139
146
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
@@ -251,6 +258,7 @@ CmTextField.properties = {
251
258
  disabled: { type: Boolean, reflect: true },
252
259
  readonly: { type: Boolean, reflect: true },
253
260
  autocomplete: {},
261
+ inputMode: { attribute: 'inputmode' },
254
262
  size: { reflect: true },
255
263
  min: {},
256
264
  max: {},
@@ -34321,6 +34321,17 @@
34321
34321
  "description": "Native autocomplete hint, e.g. `email`, `postal-code`.",
34322
34322
  "attribute": "autocomplete"
34323
34323
  },
34324
+ {
34325
+ "kind": "field",
34326
+ "name": "inputMode",
34327
+ "privacy": "public",
34328
+ "type": {
34329
+ "text": "string"
34330
+ },
34331
+ "default": "''",
34332
+ "description": "Which on-screen keyboard phones open: `email`, `url`, `tel`, `numeric`, `decimal`, `search` or `text`, passed to the\ninner input. Use it with `type=\"text\"` when your own check replaces the browser's (for example an email rule that\nmatches your server), so the box still opens the right keyboard. Since 1.15.",
34333
+ "attribute": "inputmode"
34334
+ },
34324
34335
  {
34325
34336
  "kind": "field",
34326
34337
  "name": "size",
@@ -34774,6 +34785,15 @@
34774
34785
  "description": "Native autocomplete hint, e.g. `email`, `postal-code`.",
34775
34786
  "fieldName": "autocomplete"
34776
34787
  },
34788
+ {
34789
+ "name": "inputmode",
34790
+ "type": {
34791
+ "text": "string"
34792
+ },
34793
+ "default": "''",
34794
+ "description": "Which on-screen keyboard phones open: `email`, `url`, `tel`, `numeric`, `decimal`, `search` or `text`, passed to the\ninner input. Use it with `type=\"text\"` when your own check replaces the browser's (for example an email rule that\nmatches your server), so the box still opens the right keyboard. Since 1.15.",
34795
+ "fieldName": "inputMode"
34796
+ },
34777
34797
  {
34778
34798
  "name": "size",
34779
34799
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commmerce/ui",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "Commmerce UI web components: build apps that feel native to the Commmerce admin. Works in plain HTML, React, Vue and server-rendered pages.",
5
5
  "keywords": [
6
6
  "web-components",
@@ -50,8 +50,8 @@
50
50
  "test": "vitest run"
51
51
  },
52
52
  "dependencies": {
53
- "@commmerce/icons": "1.14.0",
54
- "@commmerce/tokens": "1.14.0",
53
+ "@commmerce/icons": "1.15.0",
54
+ "@commmerce/tokens": "1.15.0",
55
55
  "lit": "3.2.1"
56
56
  },
57
57
  "devDependencies": {