UNPKG

test-isc

Version:

An Ionic component similar to Ionic Select, that allows to search items, including async search, group, add, edit, delete items, and much more.

1 lines 7.67 kB
System.register([],(function(t){"use strict";return{execute:function(){var e=function(){function t(){this.gestureId=0;this.requestedStart=new Map;this.disabledGestures=new Map;this.disabledScroll=new Set}t.prototype.createGesture=function(t){return new r(this,this.newID(),t.name,t.priority||0,!!t.disableScroll)};t.prototype.createBlocker=function(t){if(t===void 0){t={}}return new i(this,this.newID(),t.disable,!!t.disableScroll)};t.prototype.start=function(t,e,r){if(!this.canStart(t)){this.requestedStart.delete(e);return false}this.requestedStart.set(e,r);return true};t.prototype.capture=function(t,e,r){if(!this.start(t,e,r)){return false}var i=this.requestedStart;var n=-1e4;i.forEach((function(t){n=Math.max(n,t)}));if(n===r){this.capturedId=e;i.clear();var a=new CustomEvent("ionGestureCaptured",{detail:{gestureName:t}});document.dispatchEvent(a);return true}i.delete(e);return false};t.prototype.release=function(t){this.requestedStart.delete(t);if(this.capturedId===t){this.capturedId=undefined}};t.prototype.disableGesture=function(t,e){var r=this.disabledGestures.get(t);if(r===undefined){r=new Set;this.disabledGestures.set(t,r)}r.add(e)};t.prototype.enableGesture=function(t,e){var r=this.disabledGestures.get(t);if(r!==undefined){r.delete(e)}};t.prototype.disableScroll=function(t){this.disabledScroll.add(t);if(this.disabledScroll.size===1){document.body.classList.add(n)}};t.prototype.enableScroll=function(t){this.disabledScroll.delete(t);if(this.disabledScroll.size===0){document.body.classList.remove(n)}};t.prototype.canStart=function(t){if(this.capturedId!==undefined){return false}if(this.isDisabled(t)){return false}return true};t.prototype.isCaptured=function(){return this.capturedId!==undefined};t.prototype.isScrollDisabled=function(){return this.disabledScroll.size>0};t.prototype.isDisabled=function(t){var e=this.disabledGestures.get(t);if(e&&e.size>0){return true}return false};t.prototype.newID=function(){this.gestureId++;return this.gestureId};return t}();var r=function(){function t(t,e,r,i,n){this.id=e;this.name=r;this.disableScroll=n;this.priority=i*1e6+e;this.ctrl=t}t.prototype.canStart=function(){if(!this.ctrl){return false}return this.ctrl.canStart(this.name)};t.prototype.start=function(){if(!this.ctrl){return false}return this.ctrl.start(this.name,this.id,this.priority)};t.prototype.capture=function(){if(!this.ctrl){return false}var t=this.ctrl.capture(this.name,this.id,this.priority);if(t&&this.disableScroll){this.ctrl.disableScroll(this.id)}return t};t.prototype.release=function(){if(this.ctrl){this.ctrl.release(this.id);if(this.disableScroll){this.ctrl.enableScroll(this.id)}}};t.prototype.destroy=function(){this.release();this.ctrl=undefined};return t}();var i=function(){function t(t,e,r,i){this.id=e;this.disable=r;this.disableScroll=i;this.ctrl=t}t.prototype.block=function(){if(!this.ctrl){return}if(this.disable){for(var t=0,e=this.disable;t<e.length;t++){var r=e[t];this.ctrl.disableGesture(r,this.id)}}if(this.disableScroll){this.ctrl.disableScroll(this.id)}};t.prototype.unblock=function(){if(!this.ctrl){return}if(this.disable){for(var t=0,e=this.disable;t<e.length;t++){var r=e[t];this.ctrl.enableGesture(r,this.id)}}if(this.disableScroll){this.ctrl.enableScroll(this.id)}};t.prototype.destroy=function(){this.unblock();this.ctrl=undefined};return t}();var n="backdrop-no-scroll";var a=t("GESTURE_CONTROLLER",new e);var s=function(t,e,r,i){var n=u(t)?{capture:!!i.capture,passive:!!i.passive}:!!i.capture;var a;var s;if(t["__zone_symbol__addEventListener"]){a="__zone_symbol__addEventListener";s="__zone_symbol__removeEventListener"}else{a="addEventListener";s="removeEventListener"}t[a](e,r,n);return function(){t[s](e,r,n)}};var u=function(t){if(o===undefined){try{var e=Object.defineProperty({},"passive",{get:function(){o=true}});t.addEventListener("optsTest",(function(){return}),e)}catch(r){o=false}}return!!o};var o;var l=2e3;var c=function(t,e,r,i,n){var a;var u;var o;var c;var d;var v;var h;var p=0;var b=function(i){p=Date.now()+l;if(!e(i)){return}if(!u&&r){u=s(t,"touchmove",r,n)}if(!o){o=s(t,"touchend",m,n)}if(!c){c=s(t,"touchcancel",m,n)}};var y=function(i){if(p>Date.now()){return}if(!e(i)){return}if(!v&&r){v=s(f(t),"mousemove",r,n)}if(!h){h=s(f(t),"mouseup",S,n)}};var m=function(t){g();if(i){i(t)}};var S=function(t){X();if(i){i(t)}};var g=function(){if(u){u()}if(o){o()}if(c){c()}u=o=c=undefined};var X=function(){if(v){v()}if(h){h()}v=h=undefined};var Y=function(){g();X()};var w=function(e){if(e===void 0){e=true}if(!e){if(a){a()}if(d){d()}a=d=undefined;Y()}else{if(!a){a=s(t,"touchstart",b,n)}if(!d){d=s(t,"mousedown",y,n)}}};var G=function(){w(false);i=r=e=undefined};return{enable:w,stop:Y,destroy:G}};var f=function(t){return t instanceof Document?t:t.ownerDocument};var d=function(t,e,r){var i=r*(Math.PI/180);var n=t==="x";var a=Math.cos(i);var s=e*e;var u=0;var o=0;var l=false;var c=0;return{start:function(t,e){u=t;o=e;c=0;l=true},detect:function(t,e){if(!l){return false}var r=t-u;var i=e-o;var f=r*r+i*i;if(f<s){return false}var d=Math.sqrt(f);var v=(n?r:i)/d;if(v>a){c=1}else if(v<-a){c=-1}else{c=0}l=false;return true},isGesture:function(){return c!==0},getDirection:function(){return c}}};var v=t("createGesture",(function(t){var e=false;var r=false;var i=true;var n=false;var s=Object.assign({disableScroll:false,direction:"x",gesturePriority:0,passive:true,maxAngle:40,threshold:10},t);var u=s.canStart;var o=s.onWillStart;var l=s.onStart;var f=s.onEnd;var v=s.notCaptured;var y=s.onMove;var m=s.threshold;var S=s.passive;var g=s.blurOnStart;var X={type:"pan",startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,event:undefined,data:undefined};var Y=d(s.direction,s.threshold,s.maxAngle);var w=a.createGesture({name:t.gestureName,priority:t.gesturePriority,disableScroll:t.disableScroll});var G=function(t){var e=b(t);if(r||!i){return false}p(t,X);X.startX=X.currentX;X.startY=X.currentY;X.startTime=X.currentTime=e;X.velocityX=X.velocityY=X.deltaX=X.deltaY=0;X.event=t;if(u&&u(X)===false){return false}w.release();if(!w.start()){return false}r=true;if(m===0){return D()}Y.start(X.startX,X.startY);return true};var _=function(t){if(e){if(!n&&i){n=true;h(X,t);requestAnimationFrame(E)}return}h(X,t);if(Y.detect(X.currentX,X.currentY)){if(!Y.isGesture()||!D()){M()}}};var E=function(){if(!e){return}n=false;if(y){y(X)}};var D=function(){if(w&&!w.capture()){return false}e=true;i=false;X.startX=X.currentX;X.startY=X.currentY;X.startTime=X.currentTime;if(o){o(X).then(T)}else{T()}return true};var I=function(){if(typeof document!=="undefined"){var t=document.activeElement;if(t!==null&&t.blur){t.blur()}}};var T=function(){if(g){I()}if(l){l(X)}i=true};var L=function(){e=false;r=false;n=false;i=true;w.release()};var q=function(t){var r=e;var n=i;L();if(!n){return}h(X,t);if(r){if(f){f(X)}return}if(v){v(X)}};var z=c(s.el,G,_,q,{capture:false,passive:S});var M=function(){L();z.stop();if(v){v(X)}};return{enable:function(t){if(t===void 0){t=true}if(!t){if(e){q(undefined)}L()}z.enable(t)},destroy:function(){w.destroy();z.destroy()}}}));var h=function(t,e){if(!e){return}var r=t.currentX;var i=t.currentY;var n=t.currentTime;p(e,t);var a=t.currentX;var s=t.currentY;var u=t.currentTime=b(e);var o=u-n;if(o>0&&o<100){var l=(a-r)/o;var c=(s-i)/o;t.velocityX=l*.7+t.velocityX*.3;t.velocityY=c*.7+t.velocityY*.3}t.deltaX=a-t.startX;t.deltaY=s-t.startY;t.event=e};var p=function(t,e){var r=0;var i=0;if(t){var n=t.changedTouches;if(n&&n.length>0){var a=n[0];r=a.clientX;i=a.clientY}else if(t.pageX!==undefined){r=t.pageX;i=t.pageY}}e.currentX=r;e.currentY=i};var b=function(t){return t.timeStamp||Date.now()}}}}));