@getspot/spot-widget 4.4.1 → 4.4.2
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.
- package/CHANGELOG.md +7 -0
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [4.4.2](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.4.1...@getspot/spot-widget@4.4.2) (2026-08-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **core:** stop the covered-items toggle submitting the host form ([273fe9a](https://gitlab.com/getspot/spot-widget/commit/273fe9a5349bd0382efc581b99405b90a5618597))
|
|
7
|
+
|
|
1
8
|
## [4.4.1](https://gitlab.com/getspot/spot-widget/compare/@getspot/spot-widget@4.4.0...@getspot/spot-widget@4.4.1) (2026-07-22)
|
|
2
9
|
|
|
3
10
|
|
package/dist/index.es.js
CHANGED
|
@@ -431,7 +431,7 @@ function U(d, t = [], r) {
|
|
|
431
431
|
className: "spot-covered-items__toggle",
|
|
432
432
|
parent: o
|
|
433
433
|
});
|
|
434
|
-
n("span", {
|
|
434
|
+
p.type = "button", n("span", {
|
|
435
435
|
className: "spot-covered-items__title",
|
|
436
436
|
text: `Items Covered in Your Cart (${t.length})`,
|
|
437
437
|
parent: p
|
|
@@ -462,7 +462,7 @@ function U(d, t = [], r) {
|
|
|
462
462
|
});
|
|
463
463
|
let l = !1;
|
|
464
464
|
v.style.display = "none", p.addEventListener("click", (u) => {
|
|
465
|
-
u.stopPropagation(), l = !l, v.style.display = l ? "block" : "none", f.innerHTML = l ? "▲" : "▼", p.setAttribute("aria-expanded", l.toString());
|
|
465
|
+
u.stopPropagation(), u.preventDefault(), l = !l, v.style.display = l ? "block" : "none", f.innerHTML = l ? "▲" : "▼", p.setAttribute("aria-expanded", l.toString());
|
|
466
466
|
}), p.setAttribute("aria-expanded", "false"), p.setAttribute("aria-controls", "covered-items-list"), v.setAttribute("id", "covered-items-list");
|
|
467
467
|
}
|
|
468
468
|
const Z = {
|
package/dist/index.umd.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" class="spot-bullets__checkmark">
|
|
3
3
|
<path d="M11.6666 3.5L5.24998 9.91667L2.33331 7"
|
|
4
4
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
-
</svg>`,a("span",{text:s,parent:i})})}function Q(d,t=[]){if(!t||t.length===0)return;const r=a("div",{className:"spot-qualifying-reasons__container",parent:d}),s=[...t].sort((o,p)=>o.rank-p.rank),i=a("div",{className:"spot-qualifying-reasons__grid",parent:r}),n={"Accident & Illness":"cross.svg","Family Emergencies":"users.svg",Layoffs:"building.svg","Jury Duty":"scale.svg","Work Travel Conflict":"briefcase.svg","Severe Weather":"umbrella.svg","Travel Interruption":"plane.svg","Military Duty":"medal.svg"};let e;try{const o=document.currentScript;if(o!=null&&o.src){const p=new URL(o.src);e=p.origin+p.pathname.replace(/\/[^/]*$/,"/")}else e=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");e+="assets/"}catch{e="./assets/"}s.forEach(o=>{var v,h,l;const p=a("div",{className:"spot-qualifying-reasons__item",parent:i}),m=a("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:p}),f=n[((v=o.benefitType)==null?void 0:v.name)||""]||n[o.name||""];if(f){const u=a("img",{parent:m});u.src=e+f,u.alt=((h=o.benefitType)==null?void 0:h.name)||o.name||"",u.className="spot-qualifying-reasons__icon"}a("span",{className:"spot-qualifying-reasons__label",text:((l=o.benefitType)==null?void 0:l.name)||o.name||"",parent:p})})}function Z(d,t=[],r){if(t.length===0||!r||r<=1)return;const s=new Map;t.forEach(u=>{s.set(u,(s.get(u)||0)+1)});const n=Array.from(s.entries()).map(([u,c])=>({item:u,count:c,displayText:c>1?`${c} x ${u}`:u})).sort((u,c)=>{const _=u.item.charAt(0),w=c.item.charAt(0),q=/[a-zA-Z]/.test(_),g=/[a-zA-Z]/.test(w);return!q&&g?-1:q&&!g?1:u.item.localeCompare(c.item,void 0,{sensitivity:"base"})}),e=a("div",{className:"spot-covered-items__container",parent:d}),o=a("div",{className:"spot-covered-items__header",parent:e}),p=a("button",{className:"spot-covered-items__toggle",parent:o});a("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:p});const m=a("div",{className:"spot-covered-items__right-section",parent:p});a("span",{className:"spot-covered-items__view-all",text:"View All",parent:m});const f=a("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:m}),v=a("div",{className:"spot-covered-items__content",parent:e}),h=a("ul",{className:"spot-covered-items__list",parent:v});n.forEach(({displayText:u})=>{const c=a("li",{parent:h});a("span",{text:u,parent:c})});let l=!1;v.style.display="none",p.addEventListener("click",u=>{u.stopPropagation(),l=!l,v.style.display=l?"block":"none",f.innerHTML=l?"▲":"▼",p.setAttribute("aria-expanded",l.toString())}),p.setAttribute("aria-expanded","false"),p.setAttribute("aria-controls","covered-items-list"),v.setAttribute("id","covered-items-list")}const B={USD:"$",CAD:"CAD $",AUD:"AUD $",NZD:"NZD $",MXN:"MXN $",EUR:"EUR €",GBP:"GBP £",AED:"AED ",MAD:"MAD ",SAR:"SAR ",BGN:"BGN лв",BRL:"BRL R$",CHF:"CHF ",DKK:"DKK kr",INR:"INR ₹",JPY:"JPY ¥",MYR:"MYR RM",NOK:"NOK kr",PLN:"PLN zł",SEK:"SEK kr",SGD:"SGD $",THB:"THB ฿",ZAR:"ZAR R"};function j(d,t=[],r="USD"){const s=B[r]??`${r} `,i=a("div",{className:"spot-table__container",parent:d}),n=a("table",{className:"spot-refund__table spot-table--dynamic",parent:i}),e=a("thead",{parent:n}),o=a("tr",{parent:e});a("th",{text:"When you cancel",parent:o}),a("th",{text:"You will receive",parent:o});const p=a("tbody",{parent:n});t.forEach(({text:m,percent:f,amount:v})=>{const h=a("tr",{parent:p});a("td",{text:m,parent:h});const l=f==="Not eligible for refund"?"Not eligible for a refund":`${s}${v} refund`;a("td",{text:l,parent:h})})}function F(d,t){const r=a("div",{className:"spot-state-dropdown__wrapper",parent:d});a("label",{className:"spot-state-dropdown__label",text:"State of Residence",parent:r});const s=a("select",{className:"spot-state-dropdown__select",parent:r});s.setAttribute("aria-label","State of Residence");const i=a("option",{text:"Select a state...",parent:s});i.value="",i.selected=!t,S.forEach(({value:e,label:o})=>{const p=a("option",{text:o,parent:s});p.value=e,e===t&&(p.selected=!0)});const n=a("option",{text:"Not a US Resident",parent:s});return n.value=E,t===E&&(n.selected=!0),a("div",{className:"spot-state-dropdown__error",text:A,parent:r}),s}function W(d,t,r,s=!1){const i=a("div",{className:`spot-selection__options${s?" spot-selection__options--disabled":""}`,parent:d}),n=a("label",{className:`spot-selection__option ${t===b.YES?"selected":""}`,parent:i}),e=a("input",{parent:n});e.type="radio",e.name="selection",e.value=b.YES,t===b.YES&&(e.checked=!0),s&&(e.disabled=!0),a("strong",{text:r.yesOptionText,parent:n}),a("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:n});const o=a("label",{className:`spot-selection__option ${t===b.NO?"selected":""}`,parent:i}),p=a("input",{parent:o});return p.type="radio",p.name="selection",p.value=b.NO,t===b.NO&&(p.checked=!0),s&&(p.disabled=!0),a("span",{text:r.noOptionText,parent:o}),i}function I(d,t){var s;const r=(s=t.communication)==null?void 0:s.paymentTerms;if(r){const i=a("div",{className:"spot-payment-terms",parent:d});return a("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:i}),a("div",{className:"spot-payment-terms__body",text:r||"",parent:i}),i}}function Y(d,t,r="bottom-right"){if(r==="top-right"){const o=a("div",{className:"spot-logo__top-right",parent:d});o.innerHTML=`
|
|
5
|
+
</svg>`,a("span",{text:s,parent:i})})}function Q(d,t=[]){if(!t||t.length===0)return;const r=a("div",{className:"spot-qualifying-reasons__container",parent:d}),s=[...t].sort((o,p)=>o.rank-p.rank),i=a("div",{className:"spot-qualifying-reasons__grid",parent:r}),n={"Accident & Illness":"cross.svg","Family Emergencies":"users.svg",Layoffs:"building.svg","Jury Duty":"scale.svg","Work Travel Conflict":"briefcase.svg","Severe Weather":"umbrella.svg","Travel Interruption":"plane.svg","Military Duty":"medal.svg"};let e;try{const o=document.currentScript;if(o!=null&&o.src){const p=new URL(o.src);e=p.origin+p.pathname.replace(/\/[^/]*$/,"/")}else e=window.location.origin+window.location.pathname.replace(/\/[^/]*$/,"/");e+="assets/"}catch{e="./assets/"}s.forEach(o=>{var v,h,l;const p=a("div",{className:"spot-qualifying-reasons__item",parent:i}),m=a("div",{className:"spot-qualifying-reasons__icon-wrapper",parent:p}),f=n[((v=o.benefitType)==null?void 0:v.name)||""]||n[o.name||""];if(f){const u=a("img",{parent:m});u.src=e+f,u.alt=((h=o.benefitType)==null?void 0:h.name)||o.name||"",u.className="spot-qualifying-reasons__icon"}a("span",{className:"spot-qualifying-reasons__label",text:((l=o.benefitType)==null?void 0:l.name)||o.name||"",parent:p})})}function Z(d,t=[],r){if(t.length===0||!r||r<=1)return;const s=new Map;t.forEach(u=>{s.set(u,(s.get(u)||0)+1)});const n=Array.from(s.entries()).map(([u,c])=>({item:u,count:c,displayText:c>1?`${c} x ${u}`:u})).sort((u,c)=>{const _=u.item.charAt(0),w=c.item.charAt(0),q=/[a-zA-Z]/.test(_),g=/[a-zA-Z]/.test(w);return!q&&g?-1:q&&!g?1:u.item.localeCompare(c.item,void 0,{sensitivity:"base"})}),e=a("div",{className:"spot-covered-items__container",parent:d}),o=a("div",{className:"spot-covered-items__header",parent:e}),p=a("button",{className:"spot-covered-items__toggle",parent:o});p.type="button",a("span",{className:"spot-covered-items__title",text:`Items Covered in Your Cart (${t.length})`,parent:p});const m=a("div",{className:"spot-covered-items__right-section",parent:p});a("span",{className:"spot-covered-items__view-all",text:"View All",parent:m});const f=a("span",{className:"spot-covered-items__arrow",innerHTML:"▼",parent:m}),v=a("div",{className:"spot-covered-items__content",parent:e}),h=a("ul",{className:"spot-covered-items__list",parent:v});n.forEach(({displayText:u})=>{const c=a("li",{parent:h});a("span",{text:u,parent:c})});let l=!1;v.style.display="none",p.addEventListener("click",u=>{u.stopPropagation(),u.preventDefault(),l=!l,v.style.display=l?"block":"none",f.innerHTML=l?"▲":"▼",p.setAttribute("aria-expanded",l.toString())}),p.setAttribute("aria-expanded","false"),p.setAttribute("aria-controls","covered-items-list"),v.setAttribute("id","covered-items-list")}const B={USD:"$",CAD:"CAD $",AUD:"AUD $",NZD:"NZD $",MXN:"MXN $",EUR:"EUR €",GBP:"GBP £",AED:"AED ",MAD:"MAD ",SAR:"SAR ",BGN:"BGN лв",BRL:"BRL R$",CHF:"CHF ",DKK:"DKK kr",INR:"INR ₹",JPY:"JPY ¥",MYR:"MYR RM",NOK:"NOK kr",PLN:"PLN zł",SEK:"SEK kr",SGD:"SGD $",THB:"THB ฿",ZAR:"ZAR R"};function j(d,t=[],r="USD"){const s=B[r]??`${r} `,i=a("div",{className:"spot-table__container",parent:d}),n=a("table",{className:"spot-refund__table spot-table--dynamic",parent:i}),e=a("thead",{parent:n}),o=a("tr",{parent:e});a("th",{text:"When you cancel",parent:o}),a("th",{text:"You will receive",parent:o});const p=a("tbody",{parent:n});t.forEach(({text:m,percent:f,amount:v})=>{const h=a("tr",{parent:p});a("td",{text:m,parent:h});const l=f==="Not eligible for refund"?"Not eligible for a refund":`${s}${v} refund`;a("td",{text:l,parent:h})})}function F(d,t){const r=a("div",{className:"spot-state-dropdown__wrapper",parent:d});a("label",{className:"spot-state-dropdown__label",text:"State of Residence",parent:r});const s=a("select",{className:"spot-state-dropdown__select",parent:r});s.setAttribute("aria-label","State of Residence");const i=a("option",{text:"Select a state...",parent:s});i.value="",i.selected=!t,S.forEach(({value:e,label:o})=>{const p=a("option",{text:o,parent:s});p.value=e,e===t&&(p.selected=!0)});const n=a("option",{text:"Not a US Resident",parent:s});return n.value=E,t===E&&(n.selected=!0),a("div",{className:"spot-state-dropdown__error",text:A,parent:r}),s}function W(d,t,r,s=!1){const i=a("div",{className:`spot-selection__options${s?" spot-selection__options--disabled":""}`,parent:d}),n=a("label",{className:`spot-selection__option ${t===b.YES?"selected":""}`,parent:i}),e=a("input",{parent:n});e.type="radio",e.name="selection",e.value=b.YES,t===b.YES&&(e.checked=!0),s&&(e.disabled=!0),a("strong",{text:r.yesOptionText,parent:n}),a("span",{className:"spot-selection__recommended-tag",text:"Recommended",parent:n});const o=a("label",{className:`spot-selection__option ${t===b.NO?"selected":""}`,parent:i}),p=a("input",{parent:o});return p.type="radio",p.name="selection",p.value=b.NO,t===b.NO&&(p.checked=!0),s&&(p.disabled=!0),a("span",{text:r.noOptionText,parent:o}),i}function I(d,t){var s;const r=(s=t.communication)==null?void 0:s.paymentTerms;if(r){const i=a("div",{className:"spot-payment-terms",parent:d});return a("div",{className:"spot-payment-terms__header",text:"PAYMENT TERMS",parent:i}),a("div",{className:"spot-payment-terms__body",text:r||"",parent:i}),i}}function Y(d,t,r="bottom-right"){if(r==="top-right"){const o=a("div",{className:"spot-logo__top-right",parent:d});o.innerHTML=`
|
|
6
6
|
<svg width="145" height="28" viewBox="0 0 145 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
7
|
<rect width="145" height="28"/>
|
|
8
8
|
<rect x="-655" y="-270" width="819" height="325" rx="10"/>
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAA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