-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path63.b1a1c27777150abff39b.js
1 lines (1 loc) · 6.8 KB
/
63.b1a1c27777150abff39b.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{IOpt:function(t,e,i){"use strict";i.r(e),i.d(e,"ion_radio",function(){return c}),i.d(e,"ion_radio_group",function(){return d});var n=i("9TBO"),o=i("VKG5"),r=(i("Ansa"),i("j5a+")),a=i("l1ru"),s=i("3z3p"),c=function(){function t(t){var e=this;Object(o.l)(this,t),this.inputId="ion-rb-"+l++,this.name=this.inputId,this.disabled=!1,this.checked=!1,this.onFocus=function(){e.ionFocus.emit()},this.onBlur=function(){e.ionBlur.emit()},this.onClick=function(){e.checked?e.ionDeselect.emit():e.checked=!0},this.ionStyle=Object(o.d)(this,"ionStyle",7),this.ionSelect=Object(o.d)(this,"ionSelect",7),this.ionDeselect=Object(o.d)(this,"ionDeselect",7),this.ionFocus=Object(o.d)(this,"ionFocus",7),this.ionBlur=Object(o.d)(this,"ionBlur",7)}return t.prototype.colorChanged=function(){this.emitStyle()},t.prototype.checkedChanged=function(t){t&&this.ionSelect.emit({checked:!0,value:this.value}),this.emitStyle()},t.prototype.disabledChanged=function(){this.emitStyle()},t.prototype.componentWillLoad=function(){void 0===this.value&&(this.value=this.inputId),this.emitStyle()},t.prototype.emitStyle=function(){this.ionStyle.emit({"radio-checked":this.checked,"interactive-disabled":this.disabled})},t.prototype.render=function(){var t,e=this,i=e.inputId,n=e.disabled,s=e.checked,c=e.color,l=e.el,d=Object(o.e)(this),u=i+"-lbl",h=Object(a.f)(l);return h&&(h.id=u),Object(o.i)(o.a,{onClick:this.onClick,role:"radio","aria-disabled":n?"true":null,"aria-checked":""+s,"aria-labelledby":u,class:Object.assign({},Object(r.a)(c),(t={},t[d]=!0,t["in-item"]=Object(r.c)("ion-item",l),t.interactive=!0,t["radio-checked"]=s,t["radio-disabled"]=n,t))},Object(o.i)("div",{class:"radio-icon"},Object(o.i)("div",{class:"radio-inner"})),Object(o.i)("button",{type:"button",onFocus:this.onFocus,onBlur:this.onBlur,disabled:n}))},Object.defineProperty(t.prototype,"el",{get:function(){return Object(o.f)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{color:["colorChanged"],checked:["checkedChanged"],disabled:["disabledChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return':host{display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;contain:layout size style}.radio-icon,button{width:100%;height:100%}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}:host-context([dir=rtl]) button,[dir=rtl] button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}:host{--color-checked:var(--ion-color-primary,#3880ff);width:15px;height:24px}:host(.ion-color.radio-checked) .radio-inner{border-color:var(--ion-color-base)}.item-radio.item-ios ion-label{margin-left:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.item-radio.item-ios ion-label{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.radio-inner{width:33%;height:50%}:host(.radio-checked) .radio-inner{-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--color-checked)}:host(.radio-disabled){opacity:.3}:host(.ion-focused) .radio-icon:after{border-radius:50%;left:-9px;top:-8px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint,#4c8dff);content:"";opacity:.2}:host-context([dir=rtl]).ion-focused .radio-icon:after,:host-context([dir=rtl]):host(.ion-focused) .radio-icon:after{left:unset;right:unset;right:-9px}:host(.in-item){margin-left:8px;margin-right:11px;margin-top:8px;margin-bottom:8px;display:block;position:static}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.in-item){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:11px;margin-inline-end:11px}}:host(.in-item[slot=start]){margin-left:3px;margin-right:21px;margin-top:8px;margin-bottom:8px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:3px;margin-inline-start:3px;-webkit-margin-end:21px;margin-inline-end:21px}}'},enumerable:!0,configurable:!0}),t}(),l=0,d=function(){function t(t){var e=this;Object(o.l)(this,t),this.inputId="ion-rg-"+u++,this.labelId=this.inputId+"-lbl",this.allowEmptySelection=!1,this.name=this.inputId,this.onSelect=function(t){var i=t.target;i&&(e.value=i.value)},this.onDeselect=function(t){var i=t.target;i&&(i.checked=!1,e.value=void 0)},this.ionChange=Object(o.d)(this,"ionChange",7)}return t.prototype.valueChanged=function(t){this.updateRadios(),this.ionChange.emit({value:t})},t.prototype.connectedCallback=function(){return n.a(this,void 0,void 0,function(){var t,e,i,o,r=this;return n.c(this,function(n){switch(n.label){case 0:return(e=(t=this.el).querySelector("ion-list-header")||t.querySelector("ion-item-divider"))&&(i=e.querySelector("ion-label"))&&(this.labelId=i.id=this.name+"-lbl"),void 0!==this.value?[3,2]:void 0===(o=Object(s.a)(t,"ion-radio"))?[3,2]:[4,o.componentOnReady()];case 1:n.sent(),void 0===this.value&&(this.value=o.value),n.label=2;case 2:return this.mutationO=Object(s.b)(t,"ion-radio",function(t){void 0!==t?t.componentOnReady().then(function(){r.value=t.value}):r.updateRadios()}),this.updateRadios(),[2]}})})},t.prototype.disconnectedCallback=function(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)},t.prototype.updateRadios=function(){return n.a(this,void 0,void 0,function(){var t,e,i,o,r,a;return n.c(this,function(n){switch(n.label){case 0:return t=this.value,[4,this.getRadios()];case 1:for(e=n.sent(),i=!1,o=0,r=e;o<r.length;o++)a=r[o],i||a.value!==t?a.checked=!1:(i=!0,a.checked=!0);return i||(this.value=void 0),[2]}})})},t.prototype.getRadios=function(){return Promise.all(Array.from(this.el.querySelectorAll("ion-radio")).map(function(t){return t.componentOnReady()}))},t.prototype.render=function(){return Object(o.i)(o.a,{role:"radiogroup","aria-labelledby":this.labelId,onIonSelect:this.onSelect,onIonDeselect:this.allowEmptySelection?this.onDeselect:void 0,class:Object(o.e)(this)})},Object.defineProperty(t.prototype,"el",{get:function(){return Object(o.f)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:!0,configurable:!0}),t}(),u=0}}]);