This repository has been archived by the owner on Feb 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
120.b1996789f70e1f7e97a0.js
1 lines (1 loc) · 13 KB
/
120.b1996789f70e1f7e97a0.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[120],{"ZoD+":function(e,n,t){"use strict";t.r(n),t.d(n,"IonRange",function(){return s});var r=t("B5Ai"),a=t("cBjU"),i=t("k5vO"),o=t("HHlg"),s=function(){function e(){this.noUpdate=!1,this.hasFocus=!1,this.ratioA=0,this.ratioB=0,this.debounce=0,this.name="",this.dualKnobs=!1,this.min=0,this.max=100,this.pin=!1,this.snaps=!1,this.step=1,this.disabled=!1,this.value=0}return e.prototype.debounceChanged=function(){this.ionChange=Object(i.e)(this.ionChange,this.debounce)},e.prototype.minChanged=function(){this.noUpdate||this.updateRatio()},e.prototype.maxChanged=function(){this.noUpdate||this.updateRatio()},e.prototype.disabledChanged=function(){this.gesture&&this.gesture.setDisabled(this.disabled),this.emitStyle()},e.prototype.valueChanged=function(e){this.noUpdate||this.updateRatio(),this.ionChange.emit({value:e})},e.prototype.componentWillLoad=function(){this.updateRatio(),this.debounceChanged(),this.emitStyle()},e.prototype.componentDidLoad=function(){return r.a(this,void 0,void 0,function(){var e,n=this;return r.c(this,function(r){switch(r.label){case 0:return e=this,[4,t.e(0).then(t.bind(null,"2jMD"))];case 1:return e.gesture=r.sent().createGesture({el:this.rangeSlider,queue:this.queue,gestureName:"range",gesturePriority:100,threshold:0,onStart:function(e){return n.onStart(e)},onMove:function(e){return n.onMove(e)},onEnd:function(e){return n.onEnd(e)}}),this.gesture.setDisabled(this.disabled),[2]}})})},e.prototype.keyChng=function(e){var n=this.step;n=n>0?n:1,n/=this.max-this.min,e.detail.isIncrease||(n*=-1),"A"===e.detail.knob?this.ratioA+=n:this.ratioB+=n,this.updateValue()},e.prototype.handleKeyboard=function(e,n){var t=this.step;t=t>0?t:1,t/=this.max-this.min,n||(t*=-1),"A"===e?this.ratioA+=t:this.ratioB+=t,this.updateValue()},e.prototype.getValue=function(){var e=this.value||0;return this.dualKnobs?"object"==typeof e?e:{lower:0,upper:e}:"object"==typeof e?e.upper:e},e.prototype.emitStyle=function(){this.ionStyle.emit({"interactive-disabled":this.disabled})},e.prototype.fireBlur=function(){this.hasFocus&&(this.hasFocus=!1,this.ionBlur.emit(),this.emitStyle())},e.prototype.fireFocus=function(){this.hasFocus||(this.hasFocus=!0,this.ionFocus.emit(),this.emitStyle())},e.prototype.onStart=function(e){this.fireFocus();var n=this.rect=this.rangeSlider.getBoundingClientRect(),t=e.currentX,r=Object(i.g)(0,(t-n.left)/n.width,1);this.pressedKnob=!this.dualKnobs||Math.abs(this.ratioA-r)<Math.abs(this.ratioB-r)?"A":"B",this.update(t)},e.prototype.onMove=function(e){this.update(e.currentX)},e.prototype.onEnd=function(e){this.update(e.currentX),this.pressedKnob=void 0,this.fireBlur()},e.prototype.update=function(e){var n=this.rect,t=Object(i.g)(0,(e-n.left)/n.width,1);this.snaps&&(t=b(d(t,this.min,this.max,this.step),this.min,this.max)),"A"===this.pressedKnob?this.ratioA=t:this.ratioB=t,this.updateValue()},Object.defineProperty(e.prototype,"valA",{get:function(){return d(this.ratioA,this.min,this.max,this.step)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valB",{get:function(){return d(this.ratioB,this.min,this.max,this.step)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ratioLower",{get:function(){return this.dualKnobs?Math.min(this.ratioA,this.ratioB):0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ratioUpper",{get:function(){return this.dualKnobs?Math.max(this.ratioA,this.ratioB):this.ratioA},enumerable:!0,configurable:!0}),e.prototype.updateRatio=function(){var e=this.getValue(),n=this.min,t=this.max;this.dualKnobs?(this.ratioA=b(e.lower,n,t),this.ratioB=b(e.upper,n,t)):this.ratioA=b(e,n,t)},e.prototype.updateValue=function(){this.noUpdate=!0;var e=this.valA,n=this.valB;this.value=this.dualKnobs?{lower:Math.min(e,n),upper:Math.max(e,n)}:e,this.noUpdate=!1},e.prototype.hostData=function(){return{class:Object.assign({},Object(o.h)(this.color),{"in-item":Object(o.j)("ion-item",this.el),"range-disabled":this.disabled,"range-pressed":void 0!==this.pressedKnob,"range-has-pin":this.pin})}},e.prototype.render=function(){var e=this,n=this,t=n.min,r=n.max,i=n.step,o=n.ratioLower,s=n.ratioUpper,d=100*o+"%",l=100-100*s+"%",h=[];if(this.snaps)for(var g=t;g<=r;g+=i){var u=b(g,t,r);h.push({ratio:u,active:u>=o&&u<=s,left:100*u+"%"})}return[Object(a.b)("slot",{name:"start"}),Object(a.b)("div",{class:"range-slider",ref:function(n){return e.rangeSlider=n}},h.map(function(e){return Object(a.b)("div",{style:{left:e.left},role:"presentation",class:{"range-tick":!0,"range-tick-active":e.active}})}),Object(a.b)("div",{class:"range-bar",role:"presentation"}),Object(a.b)("div",{class:"range-bar range-bar-active",role:"presentation",style:{left:d,right:l}}),c({knob:"A",pressed:"A"===this.pressedKnob,value:this.valA,ratio:this.ratioA,pin:this.pin,disabled:this.disabled,handleKeyboard:this.handleKeyboard.bind(this),min:t,max:r}),this.dualKnobs&&c({knob:"B",pressed:"B"===this.pressedKnob,value:this.valB,ratio:this.ratioB,pin:this.pin,disabled:this.disabled,handleKeyboard:this.handleKeyboard.bind(this),min:t,max:r})),Object(a.b)("slot",{name:"end"})]},Object.defineProperty(e,"is",{get:function(){return"ion-range"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{color:{type:String,attr:"color"},debounce:{type:Number,attr:"debounce",watchCallbacks:["debounceChanged"]},disabled:{type:Boolean,attr:"disabled",watchCallbacks:["disabledChanged"]},dualKnobs:{type:Boolean,attr:"dual-knobs"},el:{elementRef:!0},max:{type:Number,attr:"max",watchCallbacks:["maxChanged"]},min:{type:Number,attr:"min",watchCallbacks:["minChanged"]},mode:{type:String,attr:"mode"},name:{type:String,attr:"name"},pin:{type:Boolean,attr:"pin"},pressedKnob:{state:!0},queue:{context:"queue"},ratioA:{state:!0},ratioB:{state:!0},snaps:{type:Boolean,attr:"snaps"},step:{type:Number,attr:"step"},value:{type:Number,attr:"value",mutable:!0,watchCallbacks:["valueChanged"]}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"ionChange",method:"ionChange",bubbles:!0,cancelable:!0,composed:!0},{name:"ionStyle",method:"ionStyle",bubbles:!0,cancelable:!0,composed:!0},{name:"ionFocus",method:"ionFocus",bubbles:!0,cancelable:!0,composed:!0},{name:"ionBlur",method:"ionBlur",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"listeners",{get:function(){return[{name:"ionIncrease",method:"keyChng"},{name:"ionDecrease",method:"keyChng"}]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return'.sc-ion-range-md-h{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family,inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}.sc-ion-range-md-s > ion-label{-ms-flex:initial;flex:initial}.sc-ion-range-md-s > ion-icon[slot]{font-size:24px}.range-slider.sc-ion-range-md{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab}.range-pressed.sc-ion-range-md-h .range-slider.sc-ion-range-md{cursor:-webkit-grabbing;cursor:grabbing}.range-pin.sc-ion-range-md{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle.sc-ion-range-md{left:0;top:calc((var(--height) - var(--knob-handle-size)) / 2);margin-left:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}.range-knob-handle.sc-ion-range-md:active, .range-knob-handle.sc-ion-range-md:focus{outline:none}.range-bar.sc-ion-range-md{left:0;top:calc((var(--height) - var(--bar-height)) / 2);width:100%;height:var(--bar-height);background:var(--bar-background)}.range-bar.sc-ion-range-md, .range-knob.sc-ion-range-md{position:absolute;pointer-events:none}.range-knob.sc-ion-range-md{border-radius:var(--knob-border-radius);left:calc(50% - var(--knob-size) / 2);top:calc(50% - var(--knob-size) / 2);width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow)}.range-pressed.sc-ion-range-md-h .range-bar-active.sc-ion-range-md{will-change:left,right}.range-pressed.sc-ion-range-md-h .range-knob-handle.sc-ion-range-md{will-change:left}.in-item.sc-ion-range-md-h{width:100%}.sc-ion-range-md-h.in-item .sc-ion-range-md-s > ion-label{-ms-flex-item-align:center;align-self:center}.sc-ion-range-md-h{--knob-border-radius:50%;--knob-background:var(--bar-background-active);--knob-box-shadow:none;--knob-size:18px;--bar-height:2px;--bar-background:rgba(var(--ion-color-primary-rgb,56,128,255),0.26);--bar-background-active:var(--ion-color-primary,#3880ff);--height:42px;--pin-background:var(--ion-color-primary,#3880ff);--pin-color:var(--ion-color-primary-contrast,#fff);padding:8px;font-size:12px}.ion-color.sc-ion-range-md-h .range-bar-active.sc-ion-range-md, .ion-color.sc-ion-range-md-h .range-knob.sc-ion-range-md, .ion-color.sc-ion-range-md-h .range-pin.sc-ion-range-md, .ion-color.sc-ion-range-md-h .range-pin.sc-ion-range-md:before, .ion-color.sc-ion-range-md-h .range-tick.sc-ion-range-md{background:var(--ion-color-base);color:var(--ion-color-contrast)}.ion-color.sc-ion-range-md-h .range-bar.sc-ion-range-md{background:rgba(var(--ion-color-base-rgb),.26)}.range-has-pin.sc-ion-range-md-h{padding-top:28px}.range-bar-active.sc-ion-range-md{bottom:0;width:auto;background:var(--bar-background-active)}.range-knob.sc-ion-range-md{-webkit-transform:scale(.67);transform:scale(.67);-webkit-transition-duration:.12s;transition-duration:.12s;-webkit-transition-property:background-color,border,-webkit-transform;transition-property:background-color,border,-webkit-transform;transition-property:transform,background-color,border;transition-property:transform,background-color,border,-webkit-transform;-webkit-transition-timing-function:ease;transition-timing-function:ease;z-index:2}.range-tick.sc-ion-range-md{position:absolute;top:calc((var(--height) - var(--bar-height)) / 2);width:var(--bar-height);height:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick-active.sc-ion-range-md{background:transparent}.range-pin.sc-ion-range-md{padding:8px 0;border-radius:50%;-webkit-transform:translateZ(0) scale(.01);transform:translateZ(0) scale(.01);display:inline-block;position:relative;min-width:28px;height:28px;-webkit-transition:background .12s ease,-webkit-transform .12s ease;transition:background .12s ease,-webkit-transform .12s ease;transition:transform .12s ease,background .12s ease;transition:transform .12s ease,background .12s ease,-webkit-transform .12s ease;color:var(--pin-color);text-align:center}.range-pin.sc-ion-range-md, .range-pin.sc-ion-range-md:before{background:var(--pin-background)}.range-pin.sc-ion-range-md:before{left:50%;top:3px;border-top-left-radius:50%;border-top-right-radius:50%;border-bottom-right-radius:50%;border-bottom-left-radius:0;margin-left:-13px;position:absolute;width:26px;height:26px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transition:background .12s ease;transition:background .12s ease;content:"";z-index:-1}.range-knob-pressed.sc-ion-range-md .range-pin.sc-ion-range-md{-webkit-transform:translate3d(0,-24px,0) scale(1);transform:translate3d(0,-24px,0) scale(1)}.sc-ion-range-md-h:not(.range-has-pin) .range-knob-pressed.sc-ion-range-md .range-knob.sc-ion-range-md{-webkit-transform:scale(1);transform:scale(1)}.range-disabled.sc-ion-range-md-h .range-bar.sc-ion-range-md, .range-disabled.sc-ion-range-md-h .range-bar-active.sc-ion-range-md, .range-disabled.sc-ion-range-md-h .range-knob.sc-ion-range-md, .range-disabled.sc-ion-range-md-h .range-tick.sc-ion-range-md{background-color:var(--ion-background-color-step-250,#bfbfbf)}.range-disabled.sc-ion-range-md-h .range-knob.sc-ion-range-md{-webkit-transform:scale(.55);transform:scale(.55);outline:5px solid #fff}'},enumerable:!0,configurable:!0}),Object.defineProperty(e,"styleMode",{get:function(){return"md"},enumerable:!0,configurable:!0}),e}();function c(e){var n=e.knob,t=e.value,r=e.min,i=e.max,o=e.disabled,s=e.handleKeyboard;return Object(a.b)("div",{onKeyDown:function(e){var t=e.key;"ArrowLeft"===t||"ArrowDown"===t?(s(n,!1),e.preventDefault(),e.stopPropagation()):"ArrowRight"!==t&&"ArrowUp"!==t||(s(n,!0),e.preventDefault(),e.stopPropagation())},class:{"range-knob-handle":!0,"range-knob-pressed":e.pressed,"range-knob-min":t===r,"range-knob-max":t===i},style:{left:100*e.ratio+"%"},role:"slider",tabindex:o?-1:0,"aria-valuemin":r,"aria-valuemax":i,"aria-disabled":o?"true":null,"aria-valuenow":t},e.pin&&Object(a.b)("div",{class:"range-pin",role:"presentation"},Math.round(t)),Object(a.b)("div",{class:"range-knob",role:"presentation"}))}function d(e,n,t,r){var a=(t-n)*e;return r>0&&(a=Math.round(a/r)*r+n),Object(i.g)(n,a,t)}function b(e,n,t){return Object(i.g)(0,(e-n)/(t-n),1)}}}]);