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 • 9.76 kB
JavaScript
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(t){i(t)}}function l(e){try{s(o["throw"](e))}catch(t){i(t)}}function s(e){e.done?r(e.value):n(e.value).then(a,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,n&&(i=a[0]&2?n["return"]:a[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;if(n=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;n=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(l){a=[6,l];n=0}finally{o=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-901cf683.system.js","./p-efec1ef9.system.js","./p-43d2bece.system.js"],(function(e){"use strict";var t,r,o,n,i,a,l,s;return{setters:[function(e){t=e.i;r=e.w;o=e.r;n=e.h;i=e.H;a=e.e},function(e){l=e.g},function(e){s=e.c}],execute:function(){var c="all 0.2s ease-in-out";var d=function(e){var t=document.querySelector(e+".ion-cloned-element");if(t!==null){return t}var r=document.createElement(e);r.classList.add("ion-cloned-element");r.style.setProperty("display","none");document.body.appendChild(r);return r};var u=function(e){if(!e){return}var t=e.querySelectorAll("ion-toolbar");return{el:e,toolbars:Array.from(t).map((function(e){var t=e.querySelector("ion-title");return{el:e,background:e.shadowRoot.querySelector(".toolbar-background"),ionTitleEl:t,innerTitleEl:t?t.shadowRoot.querySelector(".toolbar-title"):null,ionButtonsEl:Array.from(e.querySelectorAll("ion-buttons"))||[]}}))||[]}};var h=function(e,o,n){t((function(){var t=e.scrollTop;var i=s(1,1+-t/500,1.1);var a=n.querySelector("ion-refresher.refresher-native");if(a===null){r((function(){y(o.toolbars,i)}))}}))};var p=function(e,t){if(t===undefined){e.background.style.removeProperty("--opacity")}else{e.background.style.setProperty("--opacity",t.toString())}};var f=function(e,t){if(!e[0].isIntersecting){return}var r=e[0].intersectionRatio>.9?0:(1-e[0].intersectionRatio)*100/75;t.toolbars.forEach((function(e){p(e,r===1?undefined:r)}))};var b=function(e,t,o){r((function(){f(e,t);var r=e[0];var n=r.intersectionRect;var i=n.width*n.height;var a=r.rootBounds.width*r.rootBounds.height;var l=i===0&&a===0;var s=Math.abs(n.left-r.boundingClientRect.left);var c=Math.abs(n.right-r.boundingClientRect.right);var d=i>0&&(s>=5||c>=5);if(l||d){return}if(r.isIntersecting){v(t,false);v(o)}else{var u=n.x===0&&n.y===0||n.width!==0&&n.height!==0;if(u){v(t);v(o,false);p(t.toolbars[0])}}}))};var v=function(e,t){if(t===void 0){t=true}if(t){e.el.classList.remove("header-collapse-condense-inactive")}else{e.el.classList.add("header-collapse-condense-inactive")}};var y=function(e,t,r){if(e===void 0){e=[]}if(t===void 0){t=1}if(r===void 0){r=false}e.forEach((function(e){var o=e.ionTitleEl;var n=e.innerTitleEl;if(!o||o.size!=="large"){return}n.style.transformOrigin="left center";n.style.transition=r?c:"";n.style.transform="scale3d("+t+", "+t+", 1)"}))};var g="ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:-webkit-sticky;position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:7px;z-index:1}.header-collapse-condense ion-toolbar{--background:var(--ion-background-color, #fff);z-index:0}.header-collapse-condense ion-toolbar ion-searchbar{height:48px;padding-top:0px;padding-bottom:13px}.header-collapse-main ion-toolbar.in-toolbar ion-title,.header-collapse-main ion-toolbar.in-toolbar ion-buttons{-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse{opacity:0;pointer-events:none}.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse{visibility:hidden}";var A='ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-md::after{left:0;bottom:-5px;background-position:left 0 top -2px;position:absolute;width:100%;height:5px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==);background-repeat:repeat-x;content:""}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{left:unset;right:unset;right:0}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{background-position:right 0 top -2px}.header-collapse-condense{display:none}.header-md.ion-no-border::after{display:none}';var m=e("ion_header",function(){function e(e){o(this,e);this.collapsibleHeaderInitialized=false;this.translucent=false}e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.checkCollapsibleHeader()];case 1:e.sent();return[2]}}))}))};e.prototype.componentDidUpdate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.checkCollapsibleHeader()];case 1:e.sent();return[2]}}))}))};e.prototype.componentDidUnload=function(){this.destroyCollapsibleHeader()};e.prototype.checkCollapsibleHeader=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o;return __generator(this,(function(n){switch(n.label){case 0:e=this.collapse==="condense";t=e&&l(this)==="ios"?e:false;if(!(!t&&this.collapsibleHeaderInitialized))return[3,1];this.destroyCollapsibleHeader();return[3,3];case 1:if(!(t&&!this.collapsibleHeaderInitialized))return[3,3];r=this.el.closest("ion-app,ion-page,.ion-page,page-inner");o=r?r.querySelector("ion-content"):null;return[4,this.setupCollapsibleHeader(o,r)];case 2:n.sent();n.label=3;case 3:return[2]}}))}))};e.prototype.destroyCollapsibleHeader=function(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=undefined}if(this.scrollEl&&this.contentScrollCallback){this.scrollEl.removeEventListener("scroll",this.contentScrollCallback);this.contentScrollCallback=undefined}if(this.collapsibleMainHeader){this.collapsibleMainHeader.classList.remove("header-collapse-main");this.collapsibleMainHeader=undefined}};e.prototype.setupCollapsibleHeader=function(e,t){return __awaiter(this,void 0,void 0,(function(){var o,n,i,a,l;var s=this;return __generator(this,(function(c){switch(c.label){case 0:if(!e||!t){console.error("ion-header requires a content to collapse, make sure there is an ion-content.");return[2]}o=this;return[4,e.getScrollElement()];case 1:o.scrollEl=c.sent();n=t.querySelectorAll("ion-header");this.collapsibleMainHeader=Array.from(n).find((function(e){return e.collapse!=="condense"}));if(!this.collapsibleMainHeader){return[2]}i=u(this.collapsibleMainHeader);a=u(this.el);if(!i||!a){return[2]}v(i,false);i.toolbars.forEach((function(e){p(e,0)}));l=function(e){b(e,i,a)};this.intersectionObserver=new IntersectionObserver(l,{root:e,threshold:[.25,.3,.4,.5,.6,.7,.8,.9,1]});this.intersectionObserver.observe(a.toolbars[a.toolbars.length-1].el);this.contentScrollCallback=function(){h(s.scrollEl,a,e)};this.scrollEl.addEventListener("scroll",this.contentScrollCallback);r((function(){var e=d("ion-title");e.size="large";d("ion-back-button");if(s.collapsibleMainHeader!==undefined){s.collapsibleMainHeader.classList.add("header-collapse-main")}}));this.collapsibleHeaderInitialized=true;return[2]}}))}))};e.prototype.render=function(){var e;var t=this.translucent;var r=l(this);var o=this.collapse||"none";return n(i,{role:"banner",class:(e={},e[r]=true,e["header-"+r]=true,e["header-translucent"]=this.translucent,e["header-collapse-"+o]=true,e["header-translucent-"+r]=this.translucent,e)},r==="ios"&&t&&n("div",{class:"header-background"}),n("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:true,configurable:true});return e}());m.style={md:A}}}}));