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 • 10.4 kB
JavaScript
var __awaiter=this&&this.__awaiter||function(t,o,r,i){function e(t){return t instanceof r?t:new r((function(o){o(t)}))}return new(r||(r=Promise))((function(r,n){function l(t){try{a(i.next(t))}catch(o){n(o)}}function s(t){try{a(i["throw"](t))}catch(o){n(o)}}function a(t){t.done?r(t.value):e(t.value).then(l,s)}a((i=i.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,e,n,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(t){return function(o){return a([t,o])}}function a(l){if(i)throw new TypeError("Generator is already executing.");while(r)try{if(i=1,e&&(n=l[0]&2?e["return"]:l[0]?e["throw"]||((n=e["return"])&&n.call(e),0):e.next)&&!(n=n.call(e,l[1])).done)return n;if(e=0,n)l=[l[0]&2,n.value];switch(l[0]){case 0:case 1:n=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;e=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){r.label=l[1];break}if(l[0]===6&&r.label<n[1]){r.label=n[1];n=l;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(l);break}if(n[2])r.ops.pop();r.trys.pop();continue}l=o.call(t,r)}catch(s){l=[6,s];e=0}finally{i=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-901cf683.system.js","./p-efec1ef9.system.js","./p-babd758f.system.js"],(function(t){"use strict";var o,r,i,e,n,l,s,a,c,u,f,p;return{setters:[function(t){o=t.r;r=t.d;i=t.i;e=t.f;n=t.h;l=t.H;s=t.e},function(t){a=t.g;c=t.i;u=t.c},function(t){f=t.c;p=t.h}],execute:function(){var h=':host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;-ms-flex:1;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.outer-content){--background:var(--ion-color-step-50, #f2f2f2)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.inner-scroll{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;will-change:scroll-position}.scroll-y{-ms-touch-action:pan-y;touch-action:pan-y;overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{-ms-touch-action:pan-x;touch-action:pan-x;overflow-x:var(--overflow);overscroll-behavior-x:contain}.scroll-x.scroll-y{-ms-touch-action:auto;touch-action:auto}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:""}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){contain:none}:host(.content-sizing) .inner-scroll{position:relative}.transition-effect{display:none;position:absolute;left:-100%;width:100%;height:100%;opacity:0;pointer-events:none}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;right:0;width:10px;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTE3MDgzRkQ5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTE3MDgzRkU5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMTcwODNGQjlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMTcwODNGQzlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmePEuQAAABNSURBVHjaYvz//z8DIxAwMDAwATGMhmFmPDQuOSZks0AMmoJBaQHjkPfB0Lfg/2gQjVow+HPy/yHvg9GiYjQfjMbBqAWjFgy/4hogwADYqwdzxy5BuwAAAABJRU5ErkJggg==);background-repeat:repeat-y;background-size:10px 16px}::slotted([slot=fixed]){position:absolute}';var d=t("ion_content",function(){function t(t){o(this,t);this.isScrolling=false;this.lastScroll=0;this.queued=false;this.cTop=-1;this.cBottom=-1;this.detail={scrollTop:0,scrollLeft:0,type:"scroll",event:undefined,startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,data:undefined,isScrolling:true};this.fullscreen=false;this.scrollX=false;this.scrollY=true;this.scrollEvents=false;this.ionScrollStart=r(this,"ionScrollStart",7);this.ionScroll=r(this,"ionScroll",7);this.ionScrollEnd=r(this,"ionScrollEnd",7)}t.prototype.disconnectedCallback=function(){this.onScrollEnd()};t.prototype.onAppLoad=function(){this.resize()};t.prototype.onClick=function(t){if(this.isScrolling){t.preventDefault();t.stopPropagation()}};t.prototype.shouldForceOverscroll=function(){var t=this.forceOverscroll;var o=a(this);return t===undefined?o==="ios"&&c("ios"):t};t.prototype.resize=function(){var t=this;if(this.fullscreen){i((function(){return t.readDimensions()}))}else if(this.cTop!==0||this.cBottom!==0){this.cTop=this.cBottom=0;e(this)}};t.prototype.readDimensions=function(){var t=g(this.el);var o=Math.max(this.el.offsetTop,0);var r=Math.max(t.offsetHeight-o-this.el.offsetHeight,0);var i=o!==this.cTop||r!==this.cBottom;if(i){this.cTop=o;this.cBottom=r;e(this)}};t.prototype.onScroll=function(t){var o=this;var r=Date.now();var e=!this.isScrolling;this.lastScroll=r;if(e){this.onScrollStart()}if(!this.queued&&this.scrollEvents){this.queued=true;i((function(r){o.queued=false;o.detail.event=t;b(o.detail,o.scrollEl,r,e);o.ionScroll.emit(o.detail)}))}};t.prototype.getScrollElement=function(){return Promise.resolve(this.scrollEl)};t.prototype.scrollToTop=function(t){if(t===void 0){t=0}return this.scrollToPoint(undefined,0,t)};t.prototype.scrollToBottom=function(t){if(t===void 0){t=0}var o=this.scrollEl.scrollHeight-this.scrollEl.clientHeight;return this.scrollToPoint(undefined,o,t)};t.prototype.scrollByPoint=function(t,o,r){return this.scrollToPoint(t+this.scrollEl.scrollLeft,o+this.scrollEl.scrollTop,r)};t.prototype.scrollToPoint=function(t,o,r){if(r===void 0){r=0}return __awaiter(this,void 0,void 0,(function(){var i,e,n,l,s,a,c,u,f;return __generator(this,(function(p){i=this.scrollEl;if(r<32){if(o!=null){i.scrollTop=o}if(t!=null){i.scrollLeft=t}return[2]}n=0;l=new Promise((function(t){return e=t}));s=i.scrollTop;a=i.scrollLeft;c=o!=null?o-s:0;u=t!=null?t-a:0;f=function(t){var o=Math.min(1,(t-n)/r)-1;var l=Math.pow(o,3)+1;if(c!==0){i.scrollTop=Math.floor(l*c+s)}if(u!==0){i.scrollLeft=Math.floor(l*u+a)}if(l<1){requestAnimationFrame(f)}else{e()}};requestAnimationFrame((function(t){n=t;f(t)}));return[2,l]}))}))};t.prototype.onScrollStart=function(){var t=this;this.isScrolling=true;this.ionScrollStart.emit({isScrolling:true});if(this.watchDog){clearInterval(this.watchDog)}this.watchDog=setInterval((function(){if(t.lastScroll<Date.now()-120){t.onScrollEnd()}}),100)};t.prototype.onScrollEnd=function(){clearInterval(this.watchDog);this.watchDog=null;if(this.isScrolling){this.isScrolling=false;this.ionScrollEnd.emit({isScrolling:false})}};t.prototype.render=function(){var t;var o=this;var r=this,i=r.scrollX,e=r.scrollY;var s=a(this);var c=this.shouldForceOverscroll();var h=s==="ios"&&u.getBoolean("experimentalTransitionShadow",true);this.resize();return n(l,{class:Object.assign(Object.assign({},f(this.color)),(t={},t[s]=true,t["content-sizing"]=p("ion-popover",this.el),t["overscroll"]=c,t)),style:{"--offset-top":this.cTop+"px","--offset-bottom":this.cBottom+"px"}},n("div",{id:"background-content",part:"background"}),n("main",{class:{"inner-scroll":true,"scroll-x":i,"scroll-y":e,overscroll:(i||e)&&c},ref:function(t){return o.scrollEl=t},onScroll:this.scrollEvents?function(t){return o.onScroll(t)}:undefined,part:"scroll"},n("slot",null)),h?n("div",{class:"transition-effect"},n("div",{class:"transition-cover"}),n("div",{class:"transition-shadow"})):null,n("slot",{name:"fixed"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:true,configurable:true});return t}());var v=function(t){if(t.parentElement){return t.parentElement}if(t.parentNode&&t.parentNode.host){return t.parentNode.host}return null};var g=function(t){var o=t.closest("ion-tabs");if(o){return o}var r=t.closest("ion-app,ion-page,.ion-page,page-inner");if(r){return r}return v(t)};var b=function(t,o,r,i){var e=t.currentX;var n=t.currentY;var l=t.currentTime;var s=o.scrollLeft;var a=o.scrollTop;var c=r-l;if(i){t.startTime=r;t.startX=s;t.startY=a;t.velocityX=t.velocityY=0}t.currentTime=r;t.currentX=t.scrollLeft=s;t.currentY=t.scrollTop=a;t.deltaX=s-t.startX;t.deltaY=a-t.startY;if(c>0&&c<100){var u=(s-e)/c;var f=(a-n)/c;t.velocityX=u*.7+t.velocityX*.3;t.velocityY=f*.7+t.velocityY*.3}};d.style=h}}}));