1
mirror of https://github.com/home-assistant/supervisor synced 2024-09-27 19:03:30 +02:00
ha-supervisor/supervisor/api/panel/frontend_es5/5066-h69HK51HAgQ.js
2023-07-04 10:21:32 +02:00

2 lines
13 KiB
JavaScript

"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[5066],{65810:function(e,t,i){i.d(t,{y:function(){return r}});var a=i(14516),n=i(66477),r=(0,a.Z)((function(e){if(e.time_format===n.zt.language||e.time_format===n.zt.system){var t=e.time_format===n.zt.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===n.zt.am_pm}))},32594:function(e,t,i){i.d(t,{U:function(){return a}});var a=function(e){return e.stopPropagation()}},12545:function(e,t,i){var a,n,r,d,l,o,s,u,c=i(88962),h=i(33368),f=i(71650),m=i(82390),p=i(69205),v=i(70906),y=i(91808),b=(i(44577),i(68144)),k=i(79932),g=i(30153),x=i(47181),Z=i(32594);i(86630),i(16235),(0,y.Z)([(0,k.Mo)("ha-base-time-input")],(function(e,t){var i=function(t){(0,p.Z)(a,t);var i=(0,v.Z)(a);function a(){var t;(0,f.Z)(this,a);for(var n=arguments.length,r=new Array(n),d=0;d<n;d++)r[d]=arguments[d];return t=i.call.apply(i,[this].concat(r)),e((0,m.Z)(t)),t}return(0,h.Z)(a)}(t);return{F:i,d:[{kind:"field",decorators:[(0,k.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,k.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"autoValidate",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"required",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Number})],key:"format",value:function(){return 12}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Number})],key:"days",value:function(){return 0}},{kind:"field",decorators:[(0,k.Cb)({type:Number})],key:"hours",value:function(){return 0}},{kind:"field",decorators:[(0,k.Cb)({type:Number})],key:"minutes",value:function(){return 0}},{kind:"field",decorators:[(0,k.Cb)({type:Number})],key:"seconds",value:function(){return 0}},{kind:"field",decorators:[(0,k.Cb)({type:Number})],key:"milliseconds",value:function(){return 0}},{kind:"field",decorators:[(0,k.Cb)()],key:"dayLabel",value:function(){return""}},{kind:"field",decorators:[(0,k.Cb)()],key:"hourLabel",value:function(){return""}},{kind:"field",decorators:[(0,k.Cb)()],key:"minLabel",value:function(){return""}},{kind:"field",decorators:[(0,k.Cb)()],key:"secLabel",value:function(){return""}},{kind:"field",decorators:[(0,k.Cb)()],key:"millisecLabel",value:function(){return""}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"enableSecond",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"enableMillisecond",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"enableDay",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"noHoursLimit",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)()],key:"amPm",value:function(){return"AM"}},{kind:"method",key:"render",value:function(){return(0,b.dy)(a||(a=(0,c.Z)([" ",' <div class="time-input-wrap"> ',' <ha-textfield id="hour" type="number" inputmode="numeric" .value="','" .label="','" name="hours" @change="','" @focusin="','" no-spinner .required="','" .autoValidate="','" maxlength="2" max="','" min="0" .disabled="','" suffix=":" class="hasSuffix"> </ha-textfield> <ha-textfield id="min" type="number" inputmode="numeric" .value="','" .label="','" @change="','" @focusin="','" name="minutes" no-spinner .required="','" .autoValidate="','" maxlength="2" max="59" min="0" .disabled="','" .suffix="','" class="','"> </ha-textfield> '," "," "," </div> "," "])),this.label?(0,b.dy)(n||(n=(0,c.Z)(["<label>","","</label>"])),this.label,this.required?" *":""):"",this.enableDay?(0,b.dy)(r||(r=(0,c.Z)([' <ha-textfield id="day" type="number" inputmode="numeric" .value="','" .label="','" name="days" @change="','" @focusin="','" no-spinner .required="','" .autoValidate="','" min="0" .disabled="','" suffix=":" class="hasSuffix"> </ha-textfield> '])),this.days.toFixed(),this.dayLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):"",this.hours.toFixed(),this.hourLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,(0,g.o)(this._hourMax),this.disabled,this._formatValue(this.minutes),this.minLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableSecond?":":"",this.enableSecond?"has-suffix":"",this.enableSecond?(0,b.dy)(d||(d=(0,c.Z)(['<ha-textfield id="sec" type="number" inputmode="numeric" .value="','" .label="','" @change="','" @focusin="','" name="seconds" no-spinner .required="','" .autoValidate="','" maxlength="2" max="59" min="0" .disabled="','" .suffix="','" class="','"> </ha-textfield>'])),this._formatValue(this.seconds),this.secLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableMillisecond?":":"",this.enableMillisecond?"has-suffix":""):"",this.enableMillisecond?(0,b.dy)(l||(l=(0,c.Z)(['<ha-textfield id="millisec" type="number" .value="','" .label="','" @change="','" @focusin="','" name="milliseconds" no-spinner .required="','" .autoValidate="','" maxlength="3" max="999" min="0" .disabled="','"> </ha-textfield>'])),this._formatValue(this.milliseconds,3),this.millisecLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):"",24===this.format?"":(0,b.dy)(o||(o=(0,c.Z)(['<ha-select .required="','" .value="','" .disabled="','" name="amPm" naturalMenuWidth fixedMenuPosition @selected="','" @closed="','"> <mwc-list-item value="AM">AM</mwc-list-item> <mwc-list-item value="PM">PM</mwc-list-item> </ha-select>'])),this.required,this.amPm,this.disabled,this._valueChanged,Z.U),this.helper?(0,b.dy)(s||(s=(0,c.Z)(["<ha-input-helper-text>","</ha-input-helper-text>"])),this.helper):"")}},{kind:"method",key:"_valueChanged",value:function(e){var t=e.currentTarget;this[t.name]="amPm"===t.name?t.value:Number(t.value);var i={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(i.days=this.days),12===this.format&&(i.amPm=this.amPm),(0,x.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_onFocus",value:function(e){e.currentTarget.select()}},{kind:"method",key:"_formatValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e.toString().padStart(t,"0")}},{kind:"get",key:"_hourMax",value:function(){if(!this.noHoursLimit)return 12===this.format?12:23}},{kind:"field",static:!0,key:"styles",value:function(){return(0,b.iv)(u||(u=(0,c.Z)([":host{display:block}.time-input-wrap{display:flex;border-radius:var(--mdc-shape-small,4px) var(--mdc-shape-small,4px) 0 0;overflow:hidden;position:relative;direction:ltr}ha-textfield{width:40px;text-align:center;--mdc-shape-small:0;--text-field-appearance:none;--text-field-padding:0 4px;--text-field-suffix-padding-left:2px;--text-field-suffix-padding-right:0;--text-field-text-align:center}ha-textfield.hasSuffix{--text-field-padding:0 0 0 4px}ha-textfield:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-textfield:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-select{--mdc-shape-small:0;width:85px}label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mdc-typography-body2-font-family,var(--mdc-typography-font-family,Roboto,sans-serif));font-size:var(--mdc-typography-body2-font-size,.875rem);line-height:var(--mdc-typography-body2-line-height,1.25rem);font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:var(--mdc-typography-body2-letter-spacing,.0178571429em);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px}"])))}}]}}),b.oi)},16235:function(e,t,i){var a,n,r=i(88962),d=i(33368),l=i(71650),o=i(82390),s=i(69205),u=i(70906),c=i(91808),h=i(68144),f=i(79932);(0,c.Z)([(0,f.Mo)("ha-input-helper-text")],(function(e,t){var i=function(t){(0,s.Z)(a,t);var i=(0,u.Z)(a);function a(){var t;(0,l.Z)(this,a);for(var n=arguments.length,r=new Array(n),d=0;d<n;d++)r[d]=arguments[d];return t=i.call.apply(i,[this].concat(r)),e((0,o.Z)(t)),t}return(0,d.Z)(a)}(t);return{F:i,d:[{kind:"method",key:"render",value:function(){return(0,h.dy)(a||(a=(0,r.Z)(["<slot></slot>"])))}},{kind:"field",static:!0,key:"styles",value:function(){return(0,h.iv)(n||(n=(0,r.Z)([":host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px}"])))}}]}}),h.oi)},86630:function(e,t,i){var a,n,r=i(99312),d=i(81043),l=i(88962),o=i(33368),s=i(71650),u=i(82390),c=i(69205),h=i(70906),f=i(91808),m=i(34541),p=i(47838),v=i(49412),y=i(3762),b=i(68144),k=i(79932),g=i(38346),x=i(96151);(0,f.Z)([(0,k.Mo)("ha-select")],(function(e,t){var i=function(t){(0,c.Z)(a,t);var i=(0,h.Z)(a);function a(){var t;(0,s.Z)(this,a);for(var n=arguments.length,r=new Array(n),d=0;d<n;d++)r[d]=arguments[d];return t=i.call.apply(i,[this].concat(r)),e((0,u.Z)(t)),t}return(0,o.Z)(a)}(t);return{F:i,d:[{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"icon",value:void 0},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?(0,b.dy)(a||(a=(0,l.Z)(['<span class="mdc-select__icon"><slot name="icon"></slot></span>']))):b.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,m.Z)((0,p.Z)(i.prototype),"connectedCallback",this).call(this),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"disconnectedCallback",value:function(){(0,m.Z)((0,p.Z)(i.prototype),"disconnectedCallback",this).call(this),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"field",key:"_translationsUpdated",value:function(){var e=this;return(0,g.D)((0,d.Z)((0,r.Z)().mark((function t(){return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,x.y)();case 2:e.layoutOptions();case 3:case"end":return t.stop()}}),t)}))),500)}},{kind:"field",static:!0,key:"styles",value:function(){return[y.W,(0,b.iv)(n||(n=(0,l.Z)([".mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}"])))]}}]}}),v.K)},85066:function(e,t,i){var a,n=i(88962),r=i(33368),d=i(71650),l=i(82390),o=i(69205),s=i(70906),u=i(91808),c=i(68144),h=i(79932),f=i(65810),m=i(47181);i(12545),(0,u.Z)([(0,h.Mo)("ha-time-input")],(function(e,t){var i=function(t){(0,o.Z)(a,t);var i=(0,s.Z)(a);function a(){var t;(0,d.Z)(this,a);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=i.call.apply(i,[this].concat(r)),e((0,l.Z)(t)),t}return(0,r.Z)(a)}(t);return{F:i,d:[{kind:"field",decorators:[(0,h.Cb)({attribute:!1})],key:"locale",value:void 0},{kind:"field",decorators:[(0,h.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,h.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,h.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,h.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,h.Cb)({type:Boolean})],key:"required",value:function(){return!1}},{kind:"field",decorators:[(0,h.Cb)({type:Boolean,attribute:"enable-second"})],key:"enableSecond",value:function(){return!1}},{kind:"method",key:"render",value:function(){var e,t=(0,f.y)(this.locale),i=(null===(e=this.value)||void 0===e?void 0:e.split(":"))||[],r=i[0],d=Number(i[0]);return d&&t&&d>12&&d<24&&(r=String(d-12).padStart(2,"0")),t&&0===d&&(r="12"),(0,c.dy)(a||(a=(0,n.Z)([' <ha-base-time-input .label="','" .hours="','" .minutes="','" .seconds="','" .format="','" .amPm="','" .disabled="','" @value-changed="','" .enableSecond="','" .required="','" .helper="','"></ha-base-time-input> '])),this.label,Number(r),Number(i[1]),Number(i[2]),t?12:24,t&&d>=12?"PM":"AM",this.disabled,this._timeChanged,this.enableSecond,this.required,this.helper)}},{kind:"method",key:"_timeChanged",value:function(e){e.stopPropagation();var t,i=e.detail.value,a=(0,f.y)(this.locale);if(!isNaN(i.hours)||!isNaN(i.minutes)||!isNaN(i.seconds)){var n=i.hours||0;i&&a&&("PM"===i.amPm&&n<12&&(n+=12),"AM"===i.amPm&&12===n&&(n=0)),t="".concat(n.toString().padStart(2,"0"),":").concat(i.minutes?i.minutes.toString().padStart(2,"0"):"00",":").concat(i.seconds?i.seconds.toString().padStart(2,"0"):"00")}t!==this.value&&(this.value=t,(0,m.B)(this,"change"),(0,m.B)(this,"value-changed",{value:t}))}}]}}),c.oi)}}]);
//# sourceMappingURL=5066-h69HK51HAgQ.js.map