@everymatrix/helper-filters 0.1.5 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -241,6 +241,12 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
241
241
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
242
242
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
243
243
  }
244
+ else if (memberName === 'ref') {
245
+ // minifier will clean this up
246
+ if (newValue) {
247
+ newValue(elm);
248
+ }
249
+ }
244
250
  else if ((!isProp ) &&
245
251
  memberName[0] === 'o' &&
246
252
  memberName[1] === 'n') {
@@ -397,6 +403,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
397
403
  for (; startIdx <= endIdx; ++startIdx) {
398
404
  if ((vnode = vnodes[startIdx])) {
399
405
  elm = vnode.$elm$;
406
+ callNodeRefs(vnode);
400
407
  // remove the vnode's element from the dom
401
408
  elm.remove();
402
409
  }
@@ -480,11 +487,14 @@ const patch = (oldVNode, newVNode) => {
480
487
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
481
488
  const oldChildren = oldVNode.$children$;
482
489
  const newChildren = newVNode.$children$;
490
+ const tag = newVNode.$tag$;
483
491
  const text = newVNode.$text$;
484
492
  if (text === null) {
485
493
  // element node
486
494
  {
487
- {
495
+ if (tag === 'slot')
496
+ ;
497
+ else {
488
498
  // either this is the first render of an element OR it's an update
489
499
  // AND we already know it's possible it could have changed
490
500
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -515,11 +525,22 @@ const patch = (oldVNode, newVNode) => {
515
525
  elm.data = text;
516
526
  }
517
527
  };
528
+ const callNodeRefs = (vNode) => {
529
+ {
530
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
531
+ vNode.$children$ && vNode.$children$.map(callNodeRefs);
532
+ }
533
+ };
518
534
  const renderVdom = (hostRef, renderFnResults) => {
519
535
  const hostElm = hostRef.$hostElement$;
536
+ const cmpMeta = hostRef.$cmpMeta$;
520
537
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
521
538
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
522
539
  hostTagName = hostElm.tagName;
540
+ if (cmpMeta.$attrsToReflect$) {
541
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
542
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
543
+ }
523
544
  rootVnode.$tag$ = null;
524
545
  rootVnode.$flags$ |= 4 /* isHost */;
525
546
  hostRef.$vnode$ = rootVnode;
@@ -870,6 +891,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
870
891
  .map(([propName, m]) => {
871
892
  const attrName = m[1] || propName;
872
893
  attrNameToPropName.set(attrName, propName);
894
+ if (m[0] & 512 /* ReflectAttr */) {
895
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
896
+ }
873
897
  return attrName;
874
898
  });
875
899
  }
@@ -1030,6 +1054,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1030
1054
  {
1031
1055
  cmpMeta.$listeners$ = compactMeta[3];
1032
1056
  }
1057
+ {
1058
+ cmpMeta.$attrsToReflect$ = [];
1059
+ }
1033
1060
  const tagName = cmpMeta.$tagName$;
1034
1061
  const HostElement = class extends HTMLElement {
1035
1062
  // StencilLazyHost
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-f5eea413.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-5f4ed338.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["helper-filters",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]]], options);
13
+ return bootstrapLazy([["helper-filters_2",[[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"quickFiltersActive":[4,"quick-filters-active"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32],"limitStylingAppends":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]],[1,"helper-modal",{"titleModal":[1,"title-modal"],"visible":[1540]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-645ae858.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-5018b398",[[1,"helper-filters",{showFilterId:[4,"show-filter-id"],activateTicketSearch:[4,"activate-ticket-search"],gameId:[1,"game-id"],playerId:[1,"player-id"],session:[1],postMessage:[4,"post-message"],language:[1],showFilterModal:[32],showClearButton:[32],filterData:[32],filterDataReset:[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]]],e)));
1
+ import{p as e,b as t}from"./p-6a46b66a.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-f41dd782",[[1,"helper-filters",{showFilterId:[4,"show-filter-id"],activateTicketSearch:[4,"activate-ticket-search"],gameId:[1,"game-id"],playerId:[1,"player-id"],session:[1],postMessage:[4,"post-message"],language:[1],quickFiltersActive:[4,"quick-filters-active"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],showFilterModal:[32],showClearButton:[32],filterData:[32],filterDataReset:[32],limitStylingAppends:[32]},[[0,"modalCloseEvent","modalCloseEvent"]]],[1,"helper-modal",{titleModal:[1,"title-modal"],visible:[1540]}]]]],e)));
@@ -0,0 +1 @@
1
+ let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=(e,t,n)=>{n&&n.map((([n,l,s])=>{const r=e,i=u(t,s),c=a(n);o.ael(r,l,i,c),(t.o=t.o||[]).push((()=>o.rel(r,l,i,c)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){I(e)}},a=e=>0!=(2&e),f=new WeakMap,h=e=>"sc-"+e.h,d={},$=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!$(l))&&(l+=""),s&&o?r[r.length-1].$+=l:r.push(s?m(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=m(e,null);return c.m=t,r.length>0&&(c.p=r),c},m=(e,t)=>({t:0,S:e,$:t,g:null,p:null,m:null}),p={},b=(e,t,n,s,r,i)=>{if(n!==s){let c=G(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("ref"===t)s&&s(e);else if(c||"o"!==t[0]||"n"!==t[1]){const l=$(s);if((c||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?c=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):G(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},w=/\s/,S=e=>e?e.split(w):[],g=(e,t,n,l)=>{const s=11===t.g.nodeType&&t.g.host?t.g.host:t.g,o=e&&e.m||d,r=t.m||d;for(l in o)l in r||b(s,l,o[l],void 0,n,t.t);for(l in r)b(s,l,o[l],r[l],n,t.t)},j=(t,n,l)=>{let o,r,i=n.p[l],c=0;if(null!==i.$)o=i.g=s.createTextNode(i.$);else if(o=i.g=s.createElement(i.S),g(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.p)for(c=0;c<i.p.length;++c)r=j(t,i,c),r&&o.appendChild(r);return o},v=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=j(null,l,o),i&&(s[o].g=i,c.insertBefore(i,n)))},M=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.g,O(l),s.remove())},k=(e,t)=>e.S===t.S,C=(e,t)=>{const n=t.g=e.g,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.S||g(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],h=l[a];for(;o<=i&&r<=a;)null==c?c=t[++o]:null==u?u=t[--i]:null==f?f=l[++r]:null==h?h=l[--a]:k(c,f)?(C(c,f),c=t[++o],f=l[++r]):k(u,h)?(C(u,h),u=t[--i],h=l[--a]):k(c,h)?(C(c,h),e.insertBefore(c.g,u.g.nextSibling),c=t[++o],h=l[--a]):k(u,f)?(C(u,f),e.insertBefore(u.g,c.g),u=t[--i],f=l[++r]):(s=j(t&&t[r],n,r),f=l[++r],s&&c.g.parentNode.insertBefore(s,c.g));o>i?v(e,null==l[a+1]?null:l[a+1].g,n,l,r,a):r>a&&M(t,o,i)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),v(n,null,t,s,0,s.length-1)):null!==l&&M(l,0,l.length-1)):e.$!==o&&(n.data=o)},O=e=>{e.m&&e.m.ref&&e.m.ref(null),e.p&&e.p.map(O)},P=(e,t,n)=>{const l=(e=>_(e).j)(e);return{emit:e=>x(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},x=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},E=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},N=(e,t)=>{if(e.t|=16,!(4&e.t))return E(e,e.M),le((()=>R(e,t)));e.t|=512},R=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>W(n,e,t))),e.u=null)),q(void 0,(()=>T(e,n,t)))},T=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.k,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=Q.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=f.get(e=e.head||e);o||f.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);A(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>L(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},A=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.k,r=n.C||m(null,null),i=(e=>e&&e.S===p)(l)?l:y(null,null,l);t=s.tagName,o.O&&(i.m=i.m||{},o.O.map((([e,t])=>i.m[t]=s[e]))),i.S=null,i.t|=4,n.C=i,i.g=r.g=s.shadowRoot||s,e=s["s-sc"],C(r,i)})(n,l)}catch(e){I(e,n.j)}return null},L=e=>{const t=e.j,n=e.M;W(e.i,"componentDidRender"),64&e.t||(e.t|=64,D(t),e.P(t),n||U()),e.v&&(e.v(),e.v=void 0),512&e.t&&ne((()=>N(e,!1))),e.t&=-517},U=()=>{D(s.documentElement),ne((()=>x(l,"appload",{detail:{namespace:"helper-filters"}})))},W=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){I(e)}},q=(e,t)=>e&&e.then?e.then(t):t(),D=e=>e.classList.add("hydrated"),F=(e,t,n)=>{if(t.N){const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>_(this).R.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=_(e),o=s.R.get(t),r=s.t,i=s.i;n=((e,t)=>null==e||$(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.N[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.R.set(t,n),i&&2==(18&r)&&N(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},H=(e,t={})=>{const n=[],r=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let y,m=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],N:t[2],T:t[3]};l.N=t[2],l.T=t[3],l.O=[];const s=l.h,a=class extends HTMLElement{constructor(e){super(e),B(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),m?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=_(e),n=t.k,l=()=>{};if(1&t.t)c(e,t,n.T);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){E(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=K(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(F(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){I(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=h(n);if(!Q.has(t)){const l=()=>{};((e,t,n)=>{let l=Q.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,Q.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,r=()=>N(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=_(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return _(this).A}};l.L=e[0],r.includes(s)||u.get(s)||(n.push(s),u.define(s,F(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),m=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>y=setTimeout(U,30)))},V=new WeakMap,_=e=>V.get(e),z=(e,t)=>V.set(t.i=e,t),B=(e,t)=>{const n={t:0,j:e,k:t,R:new Map};return n.A=new Promise((e=>n.P=e)),e["s-p"]=[],e["s-rc"]=[],c(e,n,t.T),V.set(e,n)},G=(e,t)=>t in e,I=(e,t)=>(0,console.error)(e,t),J=new Map,K=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=J.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(J.set(n,e),e[t])),I)},Q=new Map,X=[],Y=[],Z=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?ne(te):o.raf(te))},ee=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){I(e)}e.length=0},te=()=>{ee(X),ee(Y),(n=X.length>0)&&o.raf(te)},ne=e=>r().then(e),le=Z(Y,!0);export{H as b,P as c,y as h,r as p,z as r}