@ni/nimble-components 34.1.1 → 34.1.2

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.
@@ -871,9 +871,8 @@ const i=Math.min(this.min,this.max)
871
871
  void 0!==this.min&&this.min!==i&&(this.min=i),this.value=this.getValidValue(this.value)}minChanged(t,e){var n
872
872
  this.min=Math.min(e,null!==(n=this.max)&&void 0!==n?n:e)
873
873
  const i=Math.max(this.min,this.max)
874
- void 0!==this.max&&this.max!==i&&(this.max=i),this.value=this.getValidValue(this.value)}get valueAsNumber(){return parseFloat(super.value)}set valueAsNumber(t){this.value=t.toString()}valueChanged(t,e){this.value=this.getValidValue(e),e===this.value&&(this.control&&!this.isUserInput&&this.syncValueToInnerControl(),super.valueChanged(t,this.value),void 0===t||this.isUserInput||(this.$emit("input"),this.$emit("change")),this.isUserInput=!1)}validate(){super.validate(this.control)}getValidValue(t){var e,n
875
- let i=parseFloat(parseFloat(t).toPrecision(15))
876
- return isNaN(i)?i="":(i=Math.min(i,null!==(e=this.max)&&void 0!==e?e:i),i=Math.max(i,null!==(n=this.min)&&void 0!==n?n:i).toString()),i}stepUp(){const t=parseFloat(this.value),e=isNaN(t)?this.min>0?this.min:this.max<0?this.max:this.min?0:this.step:t+this.step
874
+ void 0!==this.max&&this.max!==i&&(this.max=i),this.value=this.getValidValue(this.value)}get valueAsNumber(){return parseFloat(super.value)}set valueAsNumber(t){this.value=t.toString()}valueChanged(t,e){this.value=this.getValidValue(e),e===this.value&&(this.control&&!this.isUserInput&&this.syncValueToInnerControl(),super.valueChanged(t,this.value),void 0===t||this.isUserInput||(this.$emit("input"),this.$emit("change")),this.isUserInput=!1)}validate(){super.validate(this.control)}limitPrecision(t){return parseFloat(t.toPrecision(15))}getValidValue(t){let e=this.limitPrecision(parseFloat(t))
875
+ return isNaN(e)?"":(void 0!==this.max&&(e=Math.min(e,this.limitPrecision(this.max))),void 0!==this.min&&(e=Math.max(e,this.limitPrecision(this.min))),e.toString())}stepUp(){const t=parseFloat(this.value),e=isNaN(t)?this.min>0?this.min:this.max<0?this.max:this.min?0:this.step:t+this.step
877
876
  this.value=e.toString()}stepDown(){const t=parseFloat(this.value),e=isNaN(t)?this.min>0?this.min:this.max<0?this.max:this.min?0:0-this.step:t-this.step
878
877
  this.value=e.toString()}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type","number"),this.validate(),this.syncValueToInnerControl(),this.autofocus&&b.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.control.value=this.sanitizeInput(this.control.value),this.isUserInput=!0,this.syncValueFromInnerControl()}handleChange(){this.$emit("change")}handleKeyDown(t){switch(t.key){case cn:return this.stepUp(),!1
879
878
  case rn:return this.stepDown(),!1}return!0}handleBlur(){this.syncValueToInnerControl()}sanitizeInput(t){return t.replace(/[^0-9\-+e.]/g,"")}syncValueFromInnerControl(){this.value=this.control.value}syncValueToInnerControl(){this.control.value=this.value}}
@@ -5334,8 +5333,8 @@ return new Py(t,n,i)}}function Vy(t,e,n){let{index:i,offset:s}=t.findIndex(e),o=
5334
5333
  if(s==e||o.isText){if(a!=n&&!t.child(r).isText)throw new RangeError("Removing non-flat range")
5335
5334
  return t.cut(0,e).append(t.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range")
5336
5335
  return t.replaceChild(i,o.copy(Vy(o.content,e-s-1,n-s-1)))}function zy(t,e,n,i){let{index:s,offset:o}=t.findIndex(e),r=t.maybeChild(s)
5337
- if(o==e||r.isText)return t.cut(0,e).append(n).append(t.cut(e))
5338
- let a=zy(r.content,e-o-1,n)
5336
+ if(o==e||r.isText)return i&&!i.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e))
5337
+ let a=zy(r.content,e-o-1,n,r)
5339
5338
  return a&&t.replaceChild(s,r.copy(a))}function Hy(t,e,n){if(n.openStart>t.depth)throw new By("Inserted content deeper than insertion position")
5340
5339
  if(t.depth-n.openStart!=e.depth-n.openEnd)throw new By("Inconsistent open depths")
5341
5340
  return Uy(t,e,n,0)}function Uy(t,e,n,i){let s=t.index(i),o=t.node(i)