@ni/spright-components 6.0.2 → 6.0.3
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){
|
|
875
|
-
|
|
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}}
|
|
@@ -5337,8 +5336,8 @@ return new Uy(t,n,i)}}function qy(t,e,n){let{index:i,offset:s}=t.findIndex(e),o=
|
|
|
5337
5336
|
if(s==e||o.isText){if(a!=n&&!t.child(r).isText)throw new RangeError("Removing non-flat range")
|
|
5338
5337
|
return t.cut(0,e).append(t.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range")
|
|
5339
5338
|
return t.replaceChild(i,o.copy(qy(o.content,e-s-1,n-s-1)))}function jy(t,e,n,i){let{index:s,offset:o}=t.findIndex(e),r=t.maybeChild(s)
|
|
5340
|
-
if(o==e||r.isText)return t.cut(0,e).append(n).append(t.cut(e))
|
|
5341
|
-
let a=jy(r.content,e-o-1,n)
|
|
5339
|
+
if(o==e||r.isText)return i&&!i.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e))
|
|
5340
|
+
let a=jy(r.content,e-o-1,n,r)
|
|
5342
5341
|
return a&&t.replaceChild(s,r.copy(a))}function Wy(t,e,n){if(n.openStart>t.depth)throw new Hy("Inserted content deeper than insertion position")
|
|
5343
5342
|
if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Hy("Inconsistent open depths")
|
|
5344
5343
|
return Gy(t,e,n,0)}function Gy(t,e,n,i){let s=t.index(i),o=t.node(i)
|