homeassistant/custom_components/hacs/hacs_frontend_experimental/frontend_latest/1985.72DZSwzGWo8.js

3 lines
21 KiB
JavaScript
Raw Permalink Normal View History

2025-01-10 21:08:35 -08:00
/*! For license information please see 1985.72DZSwzGWo8.js.LICENSE.txt */
export const id=1985;export const ids=[1985];export const modules={58417:(c,e,o)=>{o.d(e,{A:()=>k});var d=o(43204),r=(o(27763),o(38103)),a=o(18601),t=o(98734),i=o(5095),n=o(95260),m=o(53180),h=o(10694);class k extends a.Wg{constructor(){super(...arguments),this.checked=!1,this.indeterminate=!1,this.disabled=!1,this.name="",this.value="on",this.reducedTouchTarget=!1,this.animationClass="",this.shouldRenderRipple=!1,this.focused=!1,this.mdcFoundationClass=void 0,this.mdcFoundation=void 0,this.rippleElement=null,this.rippleHandlers=new t.A((()=>(this.shouldRenderRipple=!0,this.ripple.then((c=>this.rippleElement=c)),this.ripple)))}createAdapter(){return{}}update(c){const e=c.get("indeterminate"),o=c.get("checked"),d=c.get("disabled");if(void 0!==e||void 0!==o||void 0!==d){const c=this.calculateAnimationStateName(!!o,!!e,!!d),r=this.calculateAnimationStateName(this.checked,this.indeterminate,this.disabled);this.animationClass=`${c}-${r}`}super.update(c)}calculateAnimationStateName(c,e,o){return o?"disabled":e?"indeterminate":c?"checked":"unchecked"}renderRipple(){return this.shouldRenderRipple?this.renderRippleTemplate():""}renderRippleTemplate(){return i.dy`<mwc-ripple .disabled="${this.disabled}" unbounded></mwc-ripple>`}render(){const c=this.indeterminate||this.checked,e={"mdc-checkbox--disabled":this.disabled,"mdc-checkbox--selected":c,"mdc-checkbox--touch":!this.reducedTouchTarget,"mdc-ripple-upgraded--background-focused":this.focused,"mdc-checkbox--anim-checked-indeterminate":"checked-indeterminate"==this.animationClass,"mdc-checkbox--anim-checked-unchecked":"checked-unchecked"==this.animationClass,"mdc-checkbox--anim-indeterminate-checked":"indeterminate-checked"==this.animationClass,"mdc-checkbox--anim-indeterminate-unchecked":"indeterminate-unchecked"==this.animationClass,"mdc-checkbox--anim-unchecked-checked":"unchecked-checked"==this.animationClass,"mdc-checkbox--anim-unchecked-indeterminate":"unchecked-indeterminate"==this.animationClass},o=this.indeterminate?"mixed":void 0;return i.dy` <div class="mdc-checkbox mdc-checkbox--upgraded ${(0,m.$)(e)}"> <input type="checkbox" class="mdc-checkbox__native-control" name="${(0,h.o)(this.name)}" aria-checked="${(0,h.o)(o)}" aria-label="${(0,h.o)(this.ariaLabel)}" aria-labelledby="${(0,h.o)(this.ariaLabelledBy)}" aria-describedby="${(0,h.o)(this.ariaDescribedBy)}" data-indeterminate="${this.indeterminate?"true":"false"}" ?disabled="${this.disabled}" .indeterminate="${this.indeterminate}" .checked="${this.checked}" .value="${this.value}" @change="${this.handleChange}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" @mousedown="${this.handleRippleMouseDown}" @mouseenter="${this.handleRippleMouseEnter}" @mouseleave="${this.handleRippleMouseLeave}" @touchstart="${this.handleRippleTouchStart}" @touchend="${this.handleRippleDeactivate}" @touchcancel="${this.handleRippleDeactivate}"> <div class="mdc-checkbox__background" @animationend="${this.resetAnimationClass}"> <svg class="mdc-checkbox__checkmark" viewBox="0 0 24 24"> <path class="mdc-checkbox__checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path> </svg> <div class="mdc-checkbox__mixedmark"></div> </div> ${this.renderRipple()} </div>`}setFormData(c){this.name&&this.checked&&c.append(this.name,this.value)}handleFocus(){this.focused=!0,this.handleRippleFocus()}handleBlur(){this.focused=!1,this.handleRippleBlur()}handleRippleMouseDown(c){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(c)}handleRippleTouchStart(c){this.rippleHandlers.startPress(c)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}handleChange(){this.checked=this.formElement.checked,this.indeterminate=this.formElement.indeterminate}resetAnimationClass(){this.animationClass=""}get isRippleActive(){var c;return(null===
//# sourceMappingURL=1985.72DZSwzGWo8.js.map