@finsweet/attributes-cmsselect
Advanced tools
Comparing version 1.4.4 to 1.4.5
@@ -1,1 +0,1 @@ | ||
(()=>{var U=Object.defineProperty;var B=(e,t,o)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var C=(e,t,o)=>(B(e,typeof t!="symbol"?t+"":t,o),o);var h="@finsweet/attributes-cmscore";var u=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,o){if(this.alertsActivated&&window.alert(t),o==="error")throw new Error(t)}};C(u,"alertsActivated",!1);var L={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var y=e=>{let t=e.split("-"),o=parseInt(t[t.length-1]);if(!isNaN(o))return o};var N=(e,t)=>{let o=e.getAttribute(t);return o?y(o):void 0};var G=`https://cdn.jsdelivr.net/npm/${h}@1/cmscore.js`,w=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let o=import(G);return t.coreImport=o,o.then(n=>{n&&(t.coreVersion||(t.coreVersion=n.version))}),o}catch(o){u.alert(`${o}`,"error");return}};var f="fs-attributes";var Y=`${f}-support`,j="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",v=async()=>{let{fsAttributes:e,location:t}=window,{host:o,searchParams:n}=new URL(t.href);if(!o.includes("webflow.io")||!n.has(Y))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((s,r)=>{let i=document.createElement("script");i.src=j,i.onload=()=>s(!0),i.onerror=r,document.head.append(i)})}catch(s){return!1}return e.supportImport};var m=e=>t=>`${e}${t?`-${t}`:""}`,E=e=>{let t=(n,s,r)=>{let i=e[n],{key:a,values:c}=i,p;if(!s)return`[${a}]`;let b=c==null?void 0:c[s];typeof b=="string"?p=b:p=b(r&&"instanceIndex"in r?r.instanceIndex:void 0);let d=r&&"caseInsensitive"in r&&r.caseInsensitive?"i":"";if(!(r!=null&&r.operator))return`[${a}="${p}"${d}]`;switch(r.operator){case"prefixed":return`[${a}^="${p}"${d}]`;case"suffixed":return`[${a}$="${p}"${d}]`;case"contains":return`[${a}*="${p}"${d}]`}};function o(n,s){let r=t("element",n,s),i=(s==null?void 0:s.scope)||document;return s!=null&&s.all?i.querySelectorAll(r):i.querySelector(r)}return[t,o]};var A={preventLoad:{key:`${f}-preventload`},debugMode:{key:`${f}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${f}-dev`}},[T,zt]=E(A);var k=()=>{let{currentScript:e}=document,{preventLoad:t,debugMode:o}=A,n=typeof(e==null?void 0:e.getAttribute(t.key))=="string";return typeof(e==null?void 0:e.getAttribute(o.key))=="string"&&u.activateAlerts(),{preventsLoad:n}};var M=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var o,n;for(let[s,r]of t)(n=(o=this[s])==null?void 0:o.loading)==null||n.then(r)}};H(e),q(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,v()},H=e=>{let t=T("src","finsweet",{operator:"contains"}),o=T("dev"),s=[...document.querySelectorAll(`script${t}, script${o}`)].reduce((r,i)=>{var c;let a=i.getAttribute(A.dev.key)||((c=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:c[0]);return a&&!r.includes(a)&&r.push(a),r},[]);for(let r of s){e[r]={};let i=e[r];i.loading=new Promise(a=>{i.resolve=c=>{a(c),delete i.resolve}})}},q=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var R="1.4.4";var S="cmsselect",X=`fs-${S}`,Q="text-value",z="select",g={element:{key:`${X}-element`,values:{textValue:m(Q),select:z}}},[x,me]=E(g);var I="cmsload",l=`fs-${I}`,J="list",Z="loader",tt="items-count",et="visible-count",ot="scroll-anchor",rt="page-button",st="page-dots",nt="empty",it="mode",at={loadUnder:"load-under",renderAll:"render-all",pagination:"pagination",infinite:"infinite"},ct="threshold",pt="pagesiblings",lt="pageboundary",mt="animation",ut="easing",dt="duration",ft="stagger",Et="resetix",St={true:"true"},bt="showquery",wt={true:"true"},At={element:{key:`${l}-element`,values:{list:m(J),loader:m(Z),itemsCount:m(tt),visibleCount:m(et),scrollAnchor:m(ot),empty:m(nt),pageButton:rt,pageDots:st}},mode:{key:`${l}-${it}`,values:at},threshold:{key:`${l}-${ct}`},pageSiblings:{key:`${l}-${pt}`},pageBoundary:{key:`${l}-${lt}`},animation:{key:`${l}-${mt}`},easing:{key:`${l}-${ut}`},duration:{key:`${l}-${dt}`},stagger:{key:`${l}-${ft}`},resetIx:{key:`${l}-${Et}`,values:St},showQuery:{key:`${l}-${bt}`,values:wt}},[fe,Ee]=E(At);var P=(e,t)=>{var i;let o=N(e,g.element.key),n=$(o),s=new Set,r=new Set;for(let a of n){O(e,a,r);let c=a.closest(`.${L.wrapper}`);if(!c)continue;let p=(i=t.createCMSListInstance)==null?void 0:i.call(t,c);!p||s.add(p)}for(let a of s)a.on("additems",c=>{for(let{element:p}of c){let b=$(o,p);for(let d of b)O(e,d,r)}});return[...s]},$=(e,t=document)=>[...t.querySelectorAll(x("element","textValue",{instanceIndex:e}))],O=(e,{innerText:t},o)=>{if(!t||o.has(t))return;let n=new Option(t,t);e.options.add(n),o.add(t)};var _=async()=>{var s,r,i;let e=await w();if(!e)return[];let t=[...document.querySelectorAll(x("element","select",{operator:"prefixed"}))],o=new Set;for(let a of t){if(!(a instanceof HTMLSelectElement))continue;let c=P(a,e);for(let p of c)o.add(p)}let n=[...o];return await((s=window.fsAttributes[I])==null?void 0:s.loading),(i=(r=window.fsAttributes[S]).resolve)==null||i.call(r,n),n};M();w();var V,K;(V=window.fsAttributes)[K=S]||(V[K]={});var{preventsLoad:xt}=k(),D=window.fsAttributes[S];D.version=R;xt?D.init=_:(window.Webflow||(window.Webflow=[]),window.Webflow.push(_));})(); | ||
(()=>{var D=Object.defineProperty;var K=(e,t,o)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var y=(e,t,o)=>(K(e,typeof t!="symbol"?t+"":t,o),o);var C="@finsweet/attributes-cmscore";var l=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,o){if(this.alertsActivated&&window.alert(t),o==="error")throw new Error(t)}};y(l,"alertsActivated",!1);var _={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var E=e=>{let t=e.split("-"),o=parseInt(t[t.length-1]);if(!isNaN(o))return o};var g=(e,t)=>{let o=e.getAttribute(t);return o?E(o):void 0};var F=`https://cdn.jsdelivr.net/npm/${C}@1/cmscore.js`,S=async()=>{let{fsAttributes:e}=window;e.cms||(e.cms={});let{cms:t}=e;if(t.coreImport)return t.coreImport;try{let o=import(F);return t.coreImport=o,o.then(n=>{n&&(t.coreVersion||(t.coreVersion=n.version))}),o}catch(o){l.alert(`${o}`,"error");return}};var d="fs-attributes";var R="cmsload";var m="cmsselect";var j=`${d}-support`,H="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",h=async()=>{let{fsAttributes:e,location:t}=window,{host:o,searchParams:n}=new URL(t.href);if(!o.includes("webflow.io")||!n.has(j))return!1;if(e.supportImport)return e.supportImport;try{e.supportImport=new Promise((s,r)=>{let i=document.createElement("script");i.src=H,i.onload=()=>s(!0),i.onerror=r,document.head.append(i)})}catch(s){return!1}return e.supportImport};var L=e=>t=>`${e}${t?`-${t}`:""}`,T=e=>{let t=(n,s,r)=>{let i=e[n],{key:c,values:a}=i,p;if(!s)return`[${c}]`;let f=a==null?void 0:a[s];typeof f=="string"?p=f:p=f(r&&"instanceIndex"in r?r.instanceIndex:void 0);let u=r&&"caseInsensitive"in r&&r.caseInsensitive?"i":"";if(!(r!=null&&r.operator))return`[${c}="${p}"${u}]`;switch(r.operator){case"prefixed":return`[${c}^="${p}"${u}]`;case"suffixed":return`[${c}$="${p}"${u}]`;case"contains":return`[${c}*="${p}"${u}]`}};function o(n,s){let r=t("element",n,s),i=(s==null?void 0:s.scope)||document;return s!=null&&s.all?i.querySelectorAll(r):i.querySelector(r)}return[t,o]};var b={preventLoad:{key:`${d}-preventload`},debugMode:{key:`${d}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${d}-dev`}},[A,ht]=T(b);var M=()=>{let{currentScript:e}=document,{preventLoad:t,debugMode:o}=b,n=typeof(e==null?void 0:e.getAttribute(t.key))=="string";return typeof(e==null?void 0:e.getAttribute(o.key))=="string"&&l.activateAlerts(),{preventsLoad:n}};var v=()=>{if(window.fsAttributes&&!Array.isArray(window.fsAttributes))return;let e={cms:{},push(...t){var o,n;for(let[s,r]of t)(n=(o=this[s])==null?void 0:o.loading)==null||n.then(r)}};q(e),X(e),window.fsAttributes=e,window.FsAttributes=window.fsAttributes,h()},q=e=>{let t=A("src","finsweet",{operator:"contains"}),o=A("dev"),s=[...document.querySelectorAll(`script${t}, script${o}`)].reduce((r,i)=>{var a;let c=i.getAttribute(b.dev.key)||((a=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:a[0]);return c&&!r.includes(c)&&r.push(c),r},[]);for(let r of s){e[r]={};let i=e[r];i.loading=new Promise(c=>{i.resolve=a=>{c(a),delete i.resolve}})}},X=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var U="1.4.5";var G=`fs-${m}`,Y="text-value",Q="select",x={element:{key:`${G}-element`,values:{textValue:L(Y),select:Q}}},[w,jt]=T(x);var O=(e,t)=>{var i;let o=g(e,x.element.key),n=k(o),s=new Set,r=new Set;for(let c of n){B(e,c,r);let a=c.closest(`.${_.wrapper}`);if(!a)continue;let p=(i=t.createCMSListInstance)==null?void 0:i.call(t,a);!p||s.add(p)}for(let c of s)c.on("additems",a=>{for(let{element:p}of a){let f=k(o,p);for(let u of f)B(e,u,r)}});return[...s]},k=(e,t=document)=>[...t.querySelectorAll(w("element","textValue",{instanceIndex:e}))],B=(e,{innerText:t},o)=>{if(!t||o.has(t))return;let n=new Option(t,t);e.options.add(n),o.add(t)};var I=async()=>{var s,r,i;let e=await S();if(!e)return[];let t=[...document.querySelectorAll(w("element","select",{operator:"prefixed"}))],o=new Set;for(let c of t){if(!(c instanceof HTMLSelectElement))continue;let a=O(c,e);for(let p of a)o.add(p)}let n=[...o];return await((s=window.fsAttributes[R])==null?void 0:s.loading),(i=(r=window.fsAttributes[m]).resolve)==null||i.call(r,n),n};v();S();var V,P;(V=window.fsAttributes)[P=m]||(V[P]={});var{preventsLoad:z}=M(),N=window.fsAttributes[m];N.version=U;z?N.init=I:(window.Webflow||(window.Webflow=[]),window.Webflow.push(I));})(); |
{ | ||
"name": "@finsweet/attributes-cmsselect", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "Populate Select elements based on a CMS source.", | ||
@@ -37,6 +37,5 @@ "homepage": "https://www.finsweet.com/attributes", | ||
"dependencies": { | ||
"@finsweet/attributes-cmscore": "1.6.7", | ||
"@finsweet/attributes-cmsload": "1.7.5", | ||
"@global/constants": "1.0.0", | ||
"@global/factory": "1.1.1", | ||
"@finsweet/attributes-cmscore": "1.6.8", | ||
"@global/constants": "1.0.1", | ||
"@global/factory": "1.1.2", | ||
"@global/helpers": "1.0.0", | ||
@@ -43,0 +42,0 @@ "@finsweet/ts-utils": "^0.33.1" |
5
9258
18
+ Added@finsweet/attributes-cmscore@1.6.8(transitive)
+ Addedemittery@0.11.0(transitive)
- Removed@finsweet/attributes-cmsload@1.7.5
- Removed@finsweet/attributes-cmscore@1.6.7(transitive)
- Removed@finsweet/attributes-cmsload@1.7.5(transitive)
- Removedjust-debounce@1.1.0(transitive)
- Removedjust-throttle@4.2.0(transitive)
Updated@global/constants@1.0.1
Updated@global/factory@1.1.2