Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@finsweet/attributes-cmsselect

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@finsweet/attributes-cmsselect - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

2

changesets.json

@@ -1,1 +0,1 @@

[{"version":"1.6.0","markdown":"- e4b3b680: Created new `window.fsAttributes.destroy()` method to support SPA environments.\n This new method allows users to destroy all Attributes instances, cleaning up event listeners, observers, states, global variables, etc.\n\n Websites that use a client-side router that simulates an SPA environment like [barba.js](https://barba.js.org/) or [Swup](https://swup.js.org/) can now properly init and destroy Attributes.\n After destroying, Attributes can be manually re-initted by calling `window.fsAttribute[ATTRIBUTE_KEY].init()`.\n\n Updated changesets system, now all updates will be correctly reflected in [the official updates page](https://www.finsweet.com/attributes/updates)."},{"version":"1.5.1","markdown":"- Updated dependencies [4792998a]\n- Updated dependencies [4792998a]\n - @global/constants@1.2.0\n - @finsweet/attributes-cmscore@1.8.0\n - @global/factory@1.1.5"},{"version":"1.5.0","markdown":"- 07f32375: Created `fs-cmsattribute` Attribute- Updated dependencies [07f32375]\n - @global/constants@1.1.0\n - @global/factory@1.1.4\n - @finsweet/attributes-cmscore@1.7.2"},{"version":"1.4.9","markdown":"- Updated dependencies [d8a4bf6f]\n - @finsweet/attributes-cmscore@1.7.1"},{"version":"1.4.8","markdown":"- Updated dependencies [ef56d454]\n - @finsweet/attributes-cmscore@1.7.0"},{"version":"1.4.7","markdown":"- Updated dependencies [299fd136]\n - @finsweet/attributes-cmscore@1.6.10"},{"version":"1.4.6","markdown":"- Updated dependencies [7542dcdb]\n - @global/constants@1.0.2\n - @global/factory@1.1.3\n - @finsweet/attributes-cmscore@1.6.9"},{"version":"1.4.5","markdown":"- Updated dependencies [bdd1a78]\n - @global/constants@1.0.1\n - @global/factory@1.1.2\n - @finsweet/attributes-cmscore@1.6.8"},{"version":"1.4.4","markdown":"- Updated dependencies [13c3e23]\n - @global/factory@1.1.1\n - @finsweet/attributes-cmsload@1.7.5\n - @finsweet/attributes-cmscore@1.6.7"},{"version":"1.4.3","markdown":"- Updated dependencies [627bf25]\n - @global/factory@1.1.0\n - @finsweet/attributes-cmsload@1.7.4\n - @finsweet/attributes-cmscore@1.6.7"},{"version":"1.4.2","markdown":"- Updated dependencies [8f9d08d]\n - @finsweet/attributes-cmsload@1.7.3"},{"version":"1.4.1","markdown":"- Updated dependencies [7f509db]\n - @finsweet/attributes-cmsload@1.7.2"},{"version":"1.4.0","markdown":"Added support to use `cmsselect` + `cmsload` (all modes are supported) together.\n\nNow when a user adds `cmsload` to the parent `Collection List` of a `fs-cmsselect-element=\"text-value\"` element, `cmsselect` will populate the new options as soon they are loaded.\n\nAll `cmsload` modes are supported and will trigger adding all items as options.\nFor instance, if the `Collection List` uses `pagination` mode, all items will be added as `<select>` options even if the user doesn't click on the `Next` button.\n\nAlso, `cmsselect` will now make sure that the added options are unique and not repeated.\nThis means that now users can set the `fs-cmsselect-element=\"text-value\"` to any `Collection List Item` inside a `cmsfilter` setup to populate a `<select>` dropdown in the filters form."},{"version":"1.3.0","markdown":"- Added support wizard and publishing new schema version"},{"version":"1.2.0","markdown":"Included a new `window.fsAttributes.push()` method in the developer API that provides a standarized way to safely access any Attribute internals once it has fully loaded.\nIt can be used like:\n\n```html\n<script>\n window.fsAttributes = window.fsAttributes || [];\n window.fsAttributes.push([\n 'cmsselect',\n (elements) => {\n console.log('Attribute has successfully loaded!');\n console.log(elements);\n },\n ]);\n</script>\n```"},{"version":"1.1.0","markdown":"- Created `changesets.json` API."},{"version":"1.0.4","markdown":"- Fixed `examples.json` not being available on NPM."},{"version":"1.0.3","markdown":"- Updated package description."},{"version":"1.0.2","markdown":"- Breaking change: renamed `fs-cmsselect-element=\"source\"` as `fs-cmsselect-element=\"text-value\"`.\n- Breaking change: renamed `fs-cmsselect-element=\"target\"` as `fs-cmsselect-element=\"select\"`."},{"version":"1.0.1","markdown":"- Added `initAttributes` call to make sure `window.fsAttributes` exists."},{"version":"1.0.0","markdown":"- Created the attribute package."}]
[{"version":"1.7.0","markdown":"- 24fb1c75: Added support to use any regular element as a CMS element, essentially allowing users to do things like:\n\n - Filtering a list of static elements.\n - Sorting a list of static elements.\n - Creating Tabs from static elements.\n - Creating Slides from static elements.\n - etc...\n\n Users can now do this is by adding the following Attributes to any element:\n\n - `fs-cms-element=\"wrapper\"`\n - `fs-cms-element=\"list\"`\n - `fs-cms-element=\"item\"`\n - `fs-cms-element=\"pagination-wrapper\"`\n - `fs-cms-element=\"pagination-next\"`\n - `fs-cms-element=\"pagination-previous\"`\n - `fs-cms-element=\"page-count\"`\n - `fs-cms-element=\"empty\"`\n\n This essentially tells Attributes to not only look for the native Webflow elements (Collection List Wrapper, Collection List, etc...), but to also look for these Attributes.\n\n In order to make static systems work, users have to replicate the same exact structure of the Webflow native CMS. So for example, to create a static list, users have to define elements using the same architecture:\n\n ```\n |_ Collection List Wrapper (fs-cms-element=\"wrapper\")\n |_ Collection List (fs-cms-element=\"list\")\n |_ Collection List Item (fs-cms-element=\"item\")\n ```"},{"version":"1.6.0","markdown":"- e4b3b680: Created new `window.fsAttributes.destroy()` method to support SPA environments.\n This new method allows users to destroy all Attributes instances, cleaning up event listeners, observers, states, global variables, etc.\n\n Websites that use a client-side router that simulates an SPA environment like [barba.js](https://barba.js.org/) or [Swup](https://swup.js.org/) can now properly init and destroy Attributes.\n After destroying, Attributes can be manually re-initted by calling `window.fsAttribute[ATTRIBUTE_KEY].init()`.\n\n Updated changesets system, now all updates will be correctly reflected in [the official updates page](https://www.finsweet.com/attributes/updates)."},{"version":"1.5.1","markdown":"- Updated dependencies [4792998a]\n- Updated dependencies [4792998a]\n - @global/constants@1.2.0\n - @finsweet/attributes-cmscore@1.8.0\n - @global/factory@1.1.5"},{"version":"1.5.0","markdown":"- 07f32375: Created `fs-cmsattribute` Attribute- Updated dependencies [07f32375]\n - @global/constants@1.1.0\n - @global/factory@1.1.4\n - @finsweet/attributes-cmscore@1.7.2"},{"version":"1.4.9","markdown":"- Updated dependencies [d8a4bf6f]\n - @finsweet/attributes-cmscore@1.7.1"},{"version":"1.4.8","markdown":"- Updated dependencies [ef56d454]\n - @finsweet/attributes-cmscore@1.7.0"},{"version":"1.4.7","markdown":"- Updated dependencies [299fd136]\n - @finsweet/attributes-cmscore@1.6.10"},{"version":"1.4.6","markdown":"- Updated dependencies [7542dcdb]\n - @global/constants@1.0.2\n - @global/factory@1.1.3\n - @finsweet/attributes-cmscore@1.6.9"},{"version":"1.4.5","markdown":"- Updated dependencies [bdd1a78]\n - @global/constants@1.0.1\n - @global/factory@1.1.2\n - @finsweet/attributes-cmscore@1.6.8"},{"version":"1.4.4","markdown":"- Updated dependencies [13c3e23]\n - @global/factory@1.1.1\n - @finsweet/attributes-cmsload@1.7.5\n - @finsweet/attributes-cmscore@1.6.7"},{"version":"1.4.3","markdown":"- Updated dependencies [627bf25]\n - @global/factory@1.1.0\n - @finsweet/attributes-cmsload@1.7.4\n - @finsweet/attributes-cmscore@1.6.7"},{"version":"1.4.2","markdown":"- Updated dependencies [8f9d08d]\n - @finsweet/attributes-cmsload@1.7.3"},{"version":"1.4.1","markdown":"- Updated dependencies [7f509db]\n - @finsweet/attributes-cmsload@1.7.2"},{"version":"1.4.0","markdown":"Added support to use `cmsselect` + `cmsload` (all modes are supported) together.\n\nNow when a user adds `cmsload` to the parent `Collection List` of a `fs-cmsselect-element=\"text-value\"` element, `cmsselect` will populate the new options as soon they are loaded.\n\nAll `cmsload` modes are supported and will trigger adding all items as options.\nFor instance, if the `Collection List` uses `pagination` mode, all items will be added as `<select>` options even if the user doesn't click on the `Next` button.\n\nAlso, `cmsselect` will now make sure that the added options are unique and not repeated.\nThis means that now users can set the `fs-cmsselect-element=\"text-value\"` to any `Collection List Item` inside a `cmsfilter` setup to populate a `<select>` dropdown in the filters form."},{"version":"1.3.0","markdown":"- Added support wizard and publishing new schema version"},{"version":"1.2.0","markdown":"Included a new `window.fsAttributes.push()` method in the developer API that provides a standarized way to safely access any Attribute internals once it has fully loaded.\nIt can be used like:\n\n```html\n<script>\n window.fsAttributes = window.fsAttributes || [];\n window.fsAttributes.push([\n 'cmsselect',\n (elements) => {\n console.log('Attribute has successfully loaded!');\n console.log(elements);\n },\n ]);\n</script>\n```"},{"version":"1.1.0","markdown":"- Created `changesets.json` API."},{"version":"1.0.4","markdown":"- Fixed `examples.json` not being available on NPM."},{"version":"1.0.3","markdown":"- Updated package description."},{"version":"1.0.2","markdown":"- Breaking change: renamed `fs-cmsselect-element=\"source\"` as `fs-cmsselect-element=\"text-value\"`.\n- Breaking change: renamed `fs-cmsselect-element=\"target\"` as `fs-cmsselect-element=\"select\"`."},{"version":"1.0.1","markdown":"- Added `initAttributes` call to make sure `window.fsAttributes` exists."},{"version":"1.0.0","markdown":"- Created the attribute package."}]

@@ -1,1 +0,1 @@

"use strict";(()=>{var F=Object.create;var E=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var X=(e,t,r)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var W=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Y=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of j(t))!G.call(e,o)&&o!==r&&E(e,o,{get:()=>t[o],enumerable:!(s=H(t,o))||s.enumerable});return e};var z=(e,t,r)=>(r=e!=null?F(q(e)):{},Y(t||!e||!e.__esModule?E(r,"default",{value:e,enumerable:!0}):r,e));var y=(e,t,r)=>(X(e,typeof t!="symbol"?t+"":t,r),r);var u="fs-attributes";var I="cmsattribute";var R="cmsload";var p="cmsselect";var f=async(...e)=>{var r;let t=[];for(let s of e){let o=await((r=window.fsAttributes[s])==null?void 0:r.loading);t.push(o)}return t};var m=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,r){if(this.alertsActivated&&window.alert(t),r==="error")throw new Error(t)}};y(m,"alertsActivated",!1);var b=()=>{};var C={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 x=e=>{let t=e.split("-"),r=parseInt(t[t.length-1]);if(!isNaN(r))return r};function g(e,t,r){var o;let s=window.fsAttributes[e];return s.destroy=r||b,(o=s.resolve)==null||o.call(s,t),t}var L=async()=>{let{fsAttributes:e}=window;e.cmscore||(e.cmscore={});let{cmscore:t}=e;if(t.import)return t.import;try{return t.import=import("https://cdn.jsdelivr.net/npm/@finsweet/attributes-cmscore@1/cmscore.js"),t.import.then(r=>{r&&(t.version||(t.version=r.version))}),t.import}catch(r){m.alert(`${r}`,"error");return}};var Q=`${u}-support`,J="https://cdn.jsdelivr.net/npm/@finsweet/attributes-support@1/support.js",U=async()=>{let{fsAttributes:e,location:t}=window,{host:r,searchParams:s}=new URL(t.href);e.support||(e.support={});let{support:o}=e;if(!r.includes("webflow.io")||!s.has(Q))return!1;if(o.import)return o.import;try{o.import=new Promise((n,i)=>{let c=document.createElement("script");c.src=J,c.onload=()=>n(!0),c.onerror=i,document.head.append(c)})}catch(n){return!1}return o.import};var v=e=>t=>`${e}${t?`-${t}`:""}`,A=e=>{let t=(s,o,n)=>{let i=e[s],{key:c,values:a}=i,l;if(!o)return`[${c}]`;let d=a==null?void 0:a[o];typeof d=="string"?l=d:l=d(n&&"instanceIndex"in n?n.instanceIndex:void 0);let S=n&&"caseInsensitive"in n&&n.caseInsensitive?"i":"";if(!(n!=null&&n.operator))return`[${c}="${l}"${S}]`;switch(n.operator){case"prefixed":return`[${c}^="${l}"${S}]`;case"suffixed":return`[${c}$="${l}"${S}]`;case"contains":return`[${c}*="${l}"${S}]`}};function r(s,o){let n=t("element",s,o),i=(o==null?void 0:o.scope)||document;return o!=null&&o.all?[...i.querySelectorAll(n)]:i.querySelector(n)}return[t,r]};var T={preventLoad:{key:`${u}-preventload`},debugMode:{key:`${u}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${u}-dev`}},[w,Lt]=A(T);var B=e=>{let{currentScript:t}=document,r={};if(!t)return{attributes:r,preventsLoad:!1};let o={preventsLoad:typeof t.getAttribute(T.preventLoad.key)=="string",attributes:r};for(let n in e){let i=t.getAttribute(e[n]);o.attributes[n]=i}return o};var h=({scriptAttributes:e,attributeKey:t,version:r,init:s})=>{var c;Z(),(c=window.fsAttributes)[t]||(c[t]={});let{preventsLoad:o,attributes:n}=B(e),i=window.fsAttributes[t];i.version=r,i.init=s,o||(window.Webflow||(window.Webflow=[]),window.Webflow.push(()=>s(n)))},Z=()=>{let e=tt();if(window.fsAttributes&&!Array.isArray(window.fsAttributes)){M(window.fsAttributes,e);return}let t={cms:{},push(...r){var s,o;for(let[n,i]of r)(o=(s=this[n])==null?void 0:s.loading)==null||o.then(i)},destroy(){var r,s;for(let o of e)(s=(r=window.fsAttributes[o])==null?void 0:r.destroy)==null||s.call(r)}};M(t,e),et(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,U()},tt=()=>{let e=w("src","finsweet",{operator:"contains"}),t=w("dev");return[...document.querySelectorAll(`script${e}, script${t}`)].reduce((o,n)=>{var c;let i=n.getAttribute(T.dev.key)||((c=n.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:c[0]);return i&&!o.includes(i)&&o.push(i),o},[])},M=(e,t)=>{for(let r of t){if(e[r])continue;e[r]={};let s=e[r];s.loading=new Promise(o=>{s.resolve=n=>{o(n),delete s.resolve}})}},et=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var V="1.6.0";var ot=`fs-${p}`,st="text-value",nt="select",_={element:{key:`${ot}-element`,values:{textValue:v(st),select:nt}}},[O,P]=A(_);var k=(e,t)=>{let r=e.getAttribute(t);return r?x(r):void 0};var D=(e,t)=>{let r=k(e,_.element.key),s=K(r),o=new Set,n=new Set;for(let i of s){N(e,i,n);let c=i.closest(`.${C.wrapper}`);if(!c)continue;let a=t.createCMSListInstance(c);!a||o.add(a)}for(let i of o)i.on("additems",c=>{for(let{element:a}of c){let l=K(r,a);for(let d of l)N(e,d,n)}});return[...o]},K=(e,t=document)=>[...t.querySelectorAll(O("element","textValue",{instanceIndex:e}))],N=(e,{innerText:t},r)=>{if(!t||r.has(t))return;let s=new Option(t,t);e.options.add(s),r.add(t)};var $=async()=>{let e=await L();if(!e)return[];await f(I);let t=P("select",{operator:"prefixed",all:!0}),r=new Set;for(let o of t){if(!(o instanceof HTMLSelectElement))continue;let n=D(o,e);for(let i of n)r.add(i)}let s=[...r];return await f(R),g(p,s,()=>{var o;for(let n of s)(o=n.destroy)==null||o.call(n)})};h({init:$,version:V,attributeKey:p});})();
"use strict";(()=>{var X=Object.defineProperty;var Y=(e,t,o)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var R=(e,t,o)=>(Y(e,typeof t!="symbol"?t+"":t,o),o);var p="fs-attributes";var L="cmsattribute";var U="cmscore";var M="cmsload";var u="cmsselect";var x="support";var C=async(...e)=>{var o;let t=[];for(let s of e){let n=await((o=window.fsAttributes[s])==null?void 0:o.loading);t.push(n)}return t};var m=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,o){if(this.alertsActivated&&window.alert(t),o==="error")throw new Error(t)}};R(m,"alertsActivated",!1);var g=()=>{};var B={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 v=e=>e instanceof HTMLSelectElement;var f=e=>typeof e=="string";var y=e=>{let t=e.split("-"),o=parseInt(t[t.length-1]);if(!isNaN(o))return o};function O(e,t,o){var n;let s=window.fsAttributes[e];return s.destroy=o||g,(n=s.resolve)==null||n.call(s,t),t}var S=(e,t="1",o="iife")=>{let n=`${e}${o==="esm"?".esm":""}.js`;return`https://cdn.jsdelivr.net/npm/@finsweet/attributes-${e}@${t}/${n}`};var z=S(U,"1"),h=async()=>{let{fsAttributes:e}=window;e.cmscore||(e.cmscore={});let{cmscore:t}=e;if(t.import)return t.import;try{return t.import=import(z),t.import.then(o=>{o&&(t.version||(t.version=o.version))}),t.import}catch(o){m.alert(`${o}`,"error");return}};var Q=`${p}-${x}`,P=async()=>{var n;let{fsAttributes:e,location:t}=window,{host:o,searchParams:s}=new URL(t.href);return!o.includes("webflow.io")||!s.has(Q)?!1:(n=e.import)==null?void 0:n.call(e,x,"1")};var N=e=>t=>`${e}${t?`-${t}`:""}`,A=e=>{let t=(n,i,r)=>{let c=e[n],{key:l,values:E}=c,a;if(!i)return`[${l}]`;let b=E==null?void 0:E[i];f(b)?a=b:a=b(r&&"instanceIndex"in r?r.instanceIndex:void 0);let d=r&&"caseInsensitive"in r&&r.caseInsensitive?"i":"";if(!(r!=null&&r.operator))return`[${l}="${a}"${d}]`;switch(r.operator){case"prefixed":return`[${l}^="${a}"${d}]`;case"suffixed":return`[${l}$="${a}"${d}]`;case"contains":return`[${l}*="${a}"${d}]`}};function o(n,i){let r=t("element",n,i),c=(i==null?void 0:i.scope)||document;return i!=null&&i.all?[...c.querySelectorAll(r)]:c.querySelector(r)}return[t,o,(n,i)=>{let r=e[i];return r?n.getAttribute(r.key):null}]};var T={preventLoad:{key:`${p}-preventload`},debugMode:{key:`${p}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${p}-dev`}},[_,Nt]=A(T);var V=e=>{let{currentScript:t}=document,o={};if(!t)return{attributes:o,preventsLoad:!1};let n={preventsLoad:f(t.getAttribute(T.preventLoad.key)),attributes:o};for(let i in e){let r=t.getAttribute(e[i]);n.attributes[i]=r}return n};var $=({scriptAttributes:e,attributeKey:t,version:o,init:s})=>{var c;J(),(c=window.fsAttributes)[t]||(c[t]={});let{preventsLoad:n,attributes:i}=V(e),r=window.fsAttributes[t];r.version=o,r.init=s,n||(window.Webflow||(window.Webflow=[]),window.Webflow.push(()=>s(i)))},J=()=>{let e=tt();if(window.fsAttributes&&!Array.isArray(window.fsAttributes)){I(window.fsAttributes,e);return}let t=Z(e);I(t,e),et(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,P()},Z=e=>{let t={cms:{},push(...o){var s,n;for(let[i,r]of o)(n=(s=this[i])==null?void 0:s.loading)==null||n.then(r)},async import(o,s){let n=t[o];return n||new Promise(i=>{let r=document.createElement("script");r.src=S(o,s),r.async=!0,r.onload=()=>{let[c]=I(t,[o]);i(c)},document.head.append(r)})},destroy(){var o,s;for(let n of e)(s=(o=window.fsAttributes[n])==null?void 0:o.destroy)==null||s.call(o)}};return t},tt=()=>{let e=_("src","finsweet",{operator:"contains"}),t=_("dev");return[...document.querySelectorAll(`script${e}, script${t}`)].reduce((n,i)=>{var c;let r=i.getAttribute(T.dev.key)||((c=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:c[0]);return r&&!n.includes(r)&&n.push(r),n},[])},I=(e,t)=>t.map(s=>{let n=e[s];return n||(e[s]={},n=e[s],n.loading=new Promise(i=>{n.resolve=r=>{i(r),delete n.resolve}}),n)}),et=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var D="1.7.0";var nt=`fs-${u}`,rt="text-value",st="select",w={element:{key:`${nt}-element`,values:{textValue:N(rt),select:st}}},[k,K]=A(w);var it="fs-cms-element",ct={wrapper:"wrapper",list:"list",item:"item",paginationWrapper:"pagination-wrapper",paginationNext:"pagination-next",paginationPrevious:"pagination-previous",pageCount:"page-count",emptyState:"empty"},H=e=>{let t=`.${B[e]}`,o=`[${it}="${ct[e]}"]`;return`:is(${t}, ${o})`};var F=(e,t)=>{let o=e.getAttribute(t);return o?y(o):void 0};var j=(e,t)=>{let o=F(e,w.element.key),s=W(o),n=new Set,i=new Set;for(let r of s){q(e,r,i);let c=r.closest(H("wrapper"));if(!c)continue;let l=t.createCMSListInstance(c);!l||n.add(l)}for(let r of n)r.on("additems",c=>{for(let{element:l}of c){let E=W(o,l);for(let a of E)q(e,a,i)}});return[...n]},W=(e,t=document)=>[...t.querySelectorAll(k("element","textValue",{instanceIndex:e}))],q=(e,{innerText:t},o)=>{if(!t||o.has(t))return;let s=new Option(t,t);e.options.add(s),o.add(t)};var G=async()=>{let e=await h();if(!e)return[];await C(L);let t=K("select",{operator:"prefixed",all:!0}),o=new Set;for(let n of t){if(!v(n))continue;let i=j(n,e);for(let r of i)o.add(r)}let s=[...o];return await C(M),O(u,s,()=>{var n;for(let i of s)(n=i.destroy)==null||n.call(i)})};$({init:G,version:D,attributeKey:u});})();
{
"name": "@finsweet/attributes-cmsselect",
"version": "1.6.0",
"version": "1.7.0",
"description": "Populate Select elements based on a CMS source.",

@@ -5,0 +5,0 @@ "homepage": "https://www.finsweet.com/attributes",

@@ -1,1 +0,1 @@

{"elements":[{"key":"text-value","description":"Defines the elements as the source to populate the target.","appliedTo":[{"label":"Text Element","selectors":["p","span","div"]}],"conditions":[{"condition":"isChildOf","type":"selector","selector":[{"label":"Collection Item","selectors":[".w-dyn-item"]}]}],"multiplesInInstance":true,"required":true,"requiresInstance":true},{"key":"select","description":"Defines the element as the target to be populated.","appliedTo":[{"label":"Select","selectors":["select.w-select"]}],"conditions":[{"condition":"exists","type":"element","element":"text-value"}],"multiplesInInstance":false,"required":true,"requiresInstance":true}],"settings":[]}
{"elements":[{"key":"text-value","description":"Defines the elements as the source to populate the target.","appliedTo":[{"label":"Text Element","selectors":["p","span","div"]}],"conditions":[{"condition":"isChildOf","type":"selector","selector":[{"label":"Collection Item","selectors":[":is(.w-dyn-item, [fs-cms-element=\"item\"])"]}]}],"multiplesInInstance":true,"required":true,"requiresInstance":true},{"key":"select","description":"Defines the element as the target to be populated.","appliedTo":[{"label":"Select","selectors":["select.w-select"]}],"conditions":[{"condition":"exists","type":"element","element":"text-value"}],"multiplesInInstance":false,"required":true,"requiresInstance":true}],"settings":[]}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc