mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
|
|
!function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e,n,i,a,o,r){try{var l=t[o](r),d=l.value}catch(s){return void n(s)}l.done?e(d):Promise.resolve(d).then(i,a)}function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}(self.webpackChunkgabinete_digital=self.webpackChunkgabinete_digital||[]).push([[7110],{67110:function(i,a,o){"use strict";o.r(a),o.d(a,{ion_toggle:function(){return g}});var r=o(31667),l=o(36177),d=o(13772),s=o(52954),c=o(61269),g=function(){function i(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(0,r.r)(this,t),this.ionChange=(0,r.e)(this,"ionChange",7),this.ionFocus=(0,r.e)(this,"ionFocus",7),this.ionBlur=(0,r.e)(this,"ionBlur",7),this.ionStyle=(0,r.e)(this,"ionStyle",7),this.inputId="ion-tg-"+p++,this.lastDrag=0,this.activated=!1,this.name=this.inputId,this.checked=!1,this.disabled=!1,this.value="on",this.onClick=function(t){t.preventDefault(),e.lastDrag+300<Date.now()&&(e.checked=!e.checked)},this.onFocus=function(){e.ionFocus.emit()},this.onBlur=function(){e.ionBlur.emit()}}var a,g,u,b,m;return a=i,g=[{key:"checkedChanged",value:function(t){this.ionChange.emit({checked:t,value:this.value})}},{key:"disabledChanged",value:function(){this.emitStyle(),this.gesture&&this.gesture.enable(!this.disabled)}},{key:"connectedCallback",value:(b=regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.resolve().then(o.bind(o,97279));case 2:this.gesture=t.sent.createGesture({el:this.el,gestureName:"toggle",gesturePriority:100,threshold:5,passive:!1,onStart:function(){return e.onStart()},onMove:function(t){return e.onMove(t)},onEnd:function(t){return e.onEnd(t)}}),this.disabledChanged();case 4:case"end":return t.stop()}},t,this)}),m=function(){var t=this,n=arguments;return new Promise(function(i,a){var o=b.apply(t,n);function r(t){e(o,i,a,r,l,"next",t)}function l(t){e(o,i,a,r,l,"throw",t)}r(void 0)})},function(){return m.apply(this,arguments)})},{key:"disconnectedCallback",value:function(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}},{key:"componentWillLoad",value:function(){this.emitStyle()}},{key:"emitStyle",value:function(){this.ionStyle.emit({"interactive-disabled":this.disabled})}},{key:"onStart",value:function(){this.activated=!0,this.setFocus()}},{key:"onMove",value:function(t){h(document,this.checked,t.deltaX,-10)&&(this.checked=!this.checked,(0,s.c)())}},{key:"onEnd",value:function(t){this.activated=!1,this.lastDrag=Date.now(),t.event.preventDefault(),t.event.stopImmediatePropagation()}},{key:"getValue",value:function(){return this.value||""}},{key:"setFocus",value:function(){this.focusEl&&this.focusEl.focus()}},{key:"render",value:function(){var e,n=this,i=this.activated,a=this.color,o=this.checked,s=this.disabled,g=this.el,h=this.inputId,p=this.name,u=(0,l.b)(this),b=(0,d.c)(g,h),m=b.label,f=b.labelId,k=b.labelText,v=this.getValue();return(0,d.d)(!0,g,p,o?v:"",s),(0,r.h)(r.H,{onClick:this.onClick,"aria-labelledby":m?f:null,"aria-checked":"".concat(o),"aria-hidden":s?"true":null,role:"switch",class:(0,c.c)(a,(e={},t(e,u,!0),t(e,"in-item",(0,c.h)("ion-item",g)),t(e,"toggle-activated",i),t(e,"toggle-checked",o),t(e,"toggle-disabled",s),t(e,"interactive",!0),e))},(0,r.h)("div",{class:"toggle-icon",part:"track"},(0,r.h)("div",{class:"toggle-icon-wrapper"},(0,r.h)("div",{class:"toggle-inner",part:"handle"}))),(0,r.h)("label",{htmlFor:h},k),(0,r.h)("input",{type:"checkbox",role:"switch","aria-checked":"".concat(o),disabled:s,id:h,onFocus:function(){return n.onFocus()},onBlur:function(){return n.onBlur()},ref:function(t){return n.focusEl=t}}))}},{key:"el",get:function(){return(0,r.i)(this)}}],u=[{key:"watchers",get:function(){return{checked:["checkedChanged"],disabled:["disabledChanged"]}}}],g&&n(a.prototype,g),u&&n(a,u),i}(),h=function(t
|