"use strict";(self.webpackChunkknx_frontend=self.webpackChunkknx_frontend||[]).push([[2292],{82292:function(e,i,t){t.r(i),t.d(i,{HaFormFloat:function(){return f}});var n,a,d=t(6238),r=t(36683),o=t(89231),l=t(29864),u=t(83647),s=t(8364),h=(t(8485),t(98809),t(77052),t(86245),t(26777),t(3359),t(73842),t(98597)),c=t(196),v=t(33167),f=(t(59373),(0,s.A)([(0,c.EM)("ha-form-float")],(function(e,i){var t=function(i){function t(){var i;(0,o.A)(this,t);for(var n=arguments.length,a=new Array(n),d=0;d<n;d++)a[d]=arguments[d];return i=(0,l.A)(this,t,[].concat(a)),e(i),i}return(0,u.A)(t,i),(0,r.A)(t)}(i);return{F:t,d:[{kind:"field",decorators:[(0,c.MZ)({attribute:!1})],key:"localize",value:void 0},{kind:"field",decorators:[(0,c.MZ)({attribute:!1})],key:"schema",value:void 0},{kind:"field",decorators:[(0,c.MZ)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,c.MZ)()],key:"label",value:void 0},{kind:"field",decorators:[(0,c.MZ)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,c.MZ)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,c.P)("ha-textfield")],key:"_input",value:void 0},{kind:"method",key:"focus",value:function(){this._input&&this._input.focus()}},{kind:"method",key:"render",value:function(){var e,i;return(0,h.qy)(n||(n=(0,d.A)(['\n      <ha-textfield\n        type="numeric"\n        inputMode="decimal"\n        .label=',"\n        .helper=","\n        helperPersistent\n        .value=","\n        .disabled=","\n        .required=","\n        .autoValidate=","\n        .suffix=","\n        .validationMessage=","\n        @input=","\n      ></ha-textfield>\n    "])),this.label,this.helper,void 0!==this.data?this.data:"",this.disabled,this.schema.required,this.schema.required,null===(e=this.schema.description)||void 0===e?void 0:e.suffix,this.schema.required?null===(i=this.localize)||void 0===i?void 0:i.call(this,"ui.common.error_required"):void 0,this._valueChanged)}},{kind:"method",key:"updated",value:function(e){e.has("schema")&&this.toggleAttribute("own-margin",!!this.schema.required)}},{kind:"method",key:"_valueChanged",value:function(e){var i,t=e.target,n=t.value.replace(",",".");if(!n.endsWith(".")&&"-"!==n)if(""!==n&&(i=parseFloat(n),isNaN(i)&&(i=void 0)),this.data!==i)(0,v.r)(this,"value-changed",{value:i});else{var a=void 0===i?"":String(i);t.value!==a&&(t.value=a)}}},{kind:"field",static:!0,key:"styles",value:function(){return(0,h.AH)(a||(a=(0,d.A)(["\n    :host([own-margin]) {\n      margin-bottom: 5px;\n    }\n    ha-textfield {\n      display: block;\n    }\n  "])))}}]}}),h.WF))}}]);