6 lines
No EOL
14 KiB
JavaScript
6 lines
No EOL
14 KiB
JavaScript
/*! For license information please see 7198.dgpqhU33dNE.js.LICENSE.txt */
|
|
export const id=7198;export const ids=[7198];export const modules={92295:(e,t,i)=>{var o=i(309),a=i(14271),l=i(5095),n=i(95260),d=i(3712);(0,o.Z)([(0,n.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[d.W,l.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}`]}]}}),a.z)},9828:(e,t,i)=>{i.d(t,{i:()=>u});var o=i(309),a=i(34541),l=i(47838),n=i(87762),d=i(91632),s=i(5095),r=i(95260),c=i(60625);i(54371);const h=["button","ha-list-item"],u=(e,t)=>{var i;return s.dy` <div class="header_title"> <span>${t}</span> <ha-icon-button .label="${null!==(i=null==e?void 0:e.localize("ui.dialogs.generic.close"))&&void 0!==i?i:"Close"}" .path="${"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}" dialogAction="close" class="header_button"></ha-icon-button> </div> `};(0,o.Z)([(0,r.Mo)("ha-dialog")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:c.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,t){var i;null===(i=this.contentElement)||void 0===i||i.scrollTo(e,t)}},{kind:"method",key:"renderHeading",value:function(){return s.dy`<slot name="heading"> ${(0,a.Z)((0,l.Z)(i.prototype),"renderHeading",this).call(this)} </slot>`}},{kind:"method",key:"firstUpdated",value:function(){var e;(0,a.Z)((0,l.Z)(i.prototype),"firstUpdated",this).call(this),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,h].join(", "),this._updateScrolledAttribute(),null===(e=this.contentElement)||void 0===e||e.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)((0,l.Z)(i.prototype),"disconnectedCallback",this).call(this),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value:()=>[d.W,s.iv`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var(
|
|
--dialog-scroll-divider-color,
|
|
var(--divider-color)
|
|
);z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--dialog-backdrop-filter,none);backdrop-filter:var(--dialog-backdrop-filter,none);--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px)}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{position:relative;padding-right:40px;padding-inline-end:40px;padding-inline-start:initial;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.header_button{position:absolute;right:-8px;top:-8px;text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-8px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`]}]}}),n.M)},42308:(e,t,i)=>{var o=i(309),a=i(34541),l=i(47838),n=i(5095),d=i(95260),s=i(18394);(0,o.Z)([(0,d.Mo)("ha-sortable")],(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",key:"_sortable",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"path",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,attribute:"no-style"})],key:"noStyle",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:String,attribute:"draggable-selector"})],key:"draggableSelector",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:String,attribute:"handle-selector"})],key:"handleSelector",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:String,attribute:"group"})],key:"group",value:void 0},{kind:"method",key:"updated",value:function(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}},{kind:"field",key:"_shouldBeDestroy",value:()=>!1},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)((0,l.Z)(o.prototype),"disconnectedCallback",this).call(this),this._shouldBeDestroy=!0,setTimeout((()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)}),1)}},{kind:"method",key:"connectedCallback",value:function(){(0,a.Z)((0,l.Z)(o.prototype),"connectedCallback",this).call(this),this._shouldBeDestroy=!1}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.noStyle?n.Ld:n.dy` <style>.sortable-fallback{display:none;opacity:0}.sortable-ghost{border:2px solid var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:4px;opacity:.4}.sortable-drag{border-radius:4px;opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}},{kind:"method",key:"_createSortable",value:async function(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([i.e(6087),i.e(8697)]).then(i.bind(i,48697))).default,o={animation:150,swapThreshold:.75,onChoose:this._handleChoose,onEnd:this._handleEnd};this.draggableSelector&&(o.draggable=this.draggableSelector),this.handleSelector&&(o.handle=this.handleSelector),this.draggableSelector&&(o.draggable=this.draggableSelector),this.group&&(o.group=this.group),this._sortable=new t(e,o)}},{kind:"field",key:"_handleEnd",value(){return async e=>{e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder);const t=e.oldIndex,i=e.from.parentElement.path,o=e.newIndex,a=e.to.parentElement.path;void 0===t||void 0===o||t===o&&(null==i?void 0:i.join("."))===(null==a?void 0:a.join("."))||(0,s.B)(this,"item-moved",{oldIndex:t,newIndex:o,oldPath:i,newPath:a})}}},{kind:"field",key:"_handleChoose",value:()=>e=>{e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder)}},{kind:"method",key:"_destroySortable",value:function(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}}]}}),n.oi)},97477:(e,t,i)=>{i.d(t,{a:()=>c,Lo:()=>r,sG:()=>s});var o=i(28858),a=i(72881),l=i(72218);const n=e=>e.sendMessagePromise({type:"config/area_registry/list"}).then((e=>e.sort(((e,t)=>(0,o.$)(e.name,t.name))))),d=(e,t)=>e.subscribeEvents((0,l.D)((()=>n(e).then((e=>t.setState(e,!0)))),500,!0),"area_registry_updated"),s=(e,t)=>(0,a.B)("_areaRegistry",n,d,e,t),r=(e,t)=>e.callWS({type:"config/area_registry/create",...t}),c=(e,t)=>(i,a)=>{const l=t?t.indexOf(i):-1,n=t?t.indexOf(a):-1;if(-1===l&&-1===n){var d,s,r,c;const t=null!==(d=null==e||null===(s=e[i])||void 0===s?void 0:s.name)&&void 0!==d?d:i,l=null!==(r=null==e||null===(c=e[a])||void 0===c?void 0:c.name)&&void 0!==r?r:a;return(0,o.$)(t,l)}return-1===l?1:-1===n?-1:l-n}},77198:(e,t,i)=>{i.r(t),i.d(t,{DialogAreaFilter:()=>h});var o=i(309),a=(i(63436),i(5095)),l=i(95260),n=i(53180),d=i(99266),s=i(18394),r=(i(92295),i(9828),i(54371),i(90532),i(42308),i(97477)),c=i(29950);let h=(0,o.Z)([(0,l.Mo)("dialog-area-filter")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_dialogParams",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_hidden",value:()=>[]},{kind:"field",decorators:[(0,l.SB)()],key:"_areas",value:()=>[]},{kind:"method",key:"showDialog",value:function(e){var t,i,o,a;this._dialogParams=e,this._hidden=null!==(t=null===(i=e.initialValue)||void 0===i?void 0:i.hidden)&&void 0!==t?t:[];const l=null!==(o=null===(a=e.initialValue)||void 0===a?void 0:a.order)&&void 0!==o?o:[],n=Object.keys(this.hass.areas);this._areas=n.concat().sort((0,r.a)(this.hass.areas,l))}},{kind:"method",key:"closeDialog",value:function(){this._dialogParams=void 0,this._hidden=[],this._areas=[],(0,s.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"_submit",value:function(){var e,t;const i=this._areas.filter((e=>!this._hidden.includes(e))),o={hidden:this._hidden,order:i};null===(e=this._dialogParams)||void 0===e||null===(t=e.submit)||void 0===t||t.call(e,o),this.closeDialog()}},{kind:"method",key:"_cancel",value:function(){var e,t;null===(e=this._dialogParams)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),this.closeDialog()}},{kind:"method",key:"_areaMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,o=this._areas.concat(),a=o.splice(t,1)[0];o.splice(i,0,a),this._areas=o}},{kind:"method",key:"render",value:function(){var e;if(!this._dialogParams||!this.hass)return a.Ld;const t=this._areas;return a.dy` <ha-dialog open @closed="${this._cancel}" .heading="${null!==(e=this._dialogParams.title)&&void 0!==e?e:this.hass.localize("ui.components.area-filter.title")}"> <ha-sortable draggable-selector=".draggable" handle-selector=".handle" @item-moved="${this._areaMoved}"> <mwc-list class="areas"> ${(0,d.r)(t,(e=>e),((e,t)=>{var i;const o=!this._hidden.includes(e),l=(null===(i=this.hass.areas[e])||void 0===i?void 0:i.name)||e;return a.dy` <ha-list-item class="${(0,n.$)({hidden:!o,draggable:o})}" hasMeta graphic="icon" noninteractive> ${o?a.dy`<ha-svg-icon class="handle" .path="${"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z"}" slot="graphic"></ha-svg-icon>`:a.Ld} ${l} <ha-icon-button tabindex="0" class="action" .path="${o?"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z":"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z"}" slot="meta" .label="${this.hass.localize("ui.components.area-filter."+(o?"hide":"show"),{area:l})}" .area="${e}" @click="${this._toggle}"></ha-icon-button> </ha-list-item> `}))} </mwc-list> </ha-sortable> <ha-button slot="secondaryAction" dialogAction="cancel"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button @click="${this._submit}" slot="primaryAction"> ${this.hass.localize("ui.common.submit")} </ha-button> </ha-dialog> `}},{kind:"method",key:"_toggle",value:function(e){var t;const i=e.target.area,o=[...null!==(t=this._hidden)&&void 0!==t?t:[]];o.includes(i)?o.splice(o.indexOf(i),1):o.push(i),this._hidden=o;const a=this._areas.filter((e=>!this._hidden.includes(e))),l=this._areas.filter((e=>this._hidden.includes(e)));this._areas=[...a,...l]}},{kind:"get",static:!0,key:"styles",value:function(){return[c.yu,a.iv`ha-dialog{--dialog-z-index:104;--dialog-content-padding:0}ha-list-item{overflow:visible}.hidden{color:var(--disabled-text-color)}.handle{cursor:move;cursor:grab}.actions{display:flex;flex-direction:row}ha-icon-button{display:block;margin:-12px}`]}}]}}),a.oi)},99266:(e,t,i)=>{i.d(t,{r:()=>d});var o=i(32982),a=i(16616),l=i(41005);const n=(e,t,i)=>{const o=new Map;for(let a=t;a<=i;a++)o.set(e[a],a);return o},d=(0,a.XM)(class extends a.Xe{constructor(e){if(super(e),e.type!==a.pX.CHILD)throw Error("repeat() can only be used in text expressions")}ct(e,t,i){let o;void 0===i?i=t:void 0!==t&&(o=t);const a=[],l=[];let n=0;for(const t of e)a[n]=o?o(t,n):n,l[n]=i(t,n),n++;return{values:l,keys:a}}render(e,t,i){return this.ct(e,t,i).values}update(e,[t,i,a]){var d;const s=(0,l.i9)(e),{values:r,keys:c}=this.ct(t,i,a);if(!Array.isArray(s))return this.ut=c,r;const h=null!==(d=this.ut)&&void 0!==d?d:this.ut=[],u=[];let v,p,g=0,m=s.length-1,b=0,f=r.length-1;for(;g<=m&&b<=f;)if(null===s[g])g++;else if(null===s[m])m--;else if(h[g]===c[b])u[b]=(0,l.fk)(s[g],r[b]),g++,b++;else if(h[m]===c[f])u[f]=(0,l.fk)(s[m],r[f]),m--,f--;else if(h[g]===c[f])u[f]=(0,l.fk)(s[g],r[f]),(0,l._Y)(e,u[f+1],s[g]),g++,f--;else if(h[m]===c[b])u[b]=(0,l.fk)(s[m],r[b]),(0,l._Y)(e,s[g],s[m]),m--,b++;else if(void 0===v&&(v=n(c,b,f),p=n(h,g,m)),v.has(h[g]))if(v.has(h[m])){const t=p.get(c[b]),i=void 0!==t?s[t]:null;if(null===i){const t=(0,l._Y)(e,s[g]);(0,l.fk)(t,r[b]),u[b]=t}else u[b]=(0,l.fk)(i,r[b]),(0,l._Y)(e,s[g],i),s[t]=null;b++}else(0,l.ws)(s[m]),m--;else(0,l.ws)(s[g]),g++;for(;b<=f;){const t=(0,l._Y)(e,u[f+1]);(0,l.fk)(t,r[b]),u[b++]=t}for(;g<=m;){const e=s[g++];null!==e&&(0,l.ws)(e)}return this.ut=c,(0,l.hl)(e,u),o.Jb}})}};
|
|
//# sourceMappingURL=7198.dgpqhU33dNE.js.map
|