@saasquatch/mint-components 1.16.0-17 → 1.16.0-19
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/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +3 -2
- package/dist/cjs/sqm-qr-code.cjs.entry.js +1 -13
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +1 -1
- package/dist/collection/components/sqm-qr-code/useQRCode.js +1 -13
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +3 -2
- package/dist/esm/sqm-banking-info-form_17.entry.js +3 -2
- package/dist/esm/sqm-qr-code.entry.js +1 -13
- package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/esm-es5/sqm-qr-code.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/p-8b584c46.system.entry.js +1 -0
- package/dist/mint-components/{p-cafb67b7.system.entry.js → p-9b6ac371.system.entry.js} +1 -1
- package/dist/mint-components/p-c9b08184.entry.js +17 -0
- package/dist/mint-components/{p-c10835fa.entry.js → p-f6d876c2.entry.js} +5 -5
- package/dist/types/components/sqm-name-fields/sqm-name-fields.d.ts +1 -1
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/package.json +1 -1
- package/dist/mint-components/p-0c78815e.system.entry.js +0 -1
- package/dist/mint-components/p-53730ffe.entry.js +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{r as e,h as o}from"./p-f708da7b.js";import{k as t,f as a,n as r}from"./p-cd651f81.js";import{d as n,H as i,J as d,F as s,w as c,$ as l,B as m,i as g}from"./p-94a876b9.js";import{c as p}from"./p-c1086930.js";import{g as u}from"./p-9ec99ced.js";import"./p-cef45012.js";import{a as h}from"./p-3f7b81b8.js";import"./p-9acb5038.js";import{Q as v}from"./p-f56bedd5.js";const w=n.gql`
|
|
2
|
+
query shareLink($programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
3
|
+
user: viewer {
|
|
4
|
+
... on User {
|
|
5
|
+
shareLink(
|
|
6
|
+
programId: $programId
|
|
7
|
+
engagementMedium: $engagementMedium
|
|
8
|
+
shareMedium: DIRECT
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`,f=n.gql`
|
|
14
|
+
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
15
|
+
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
16
|
+
}
|
|
17
|
+
`,C=class{constructor(o){e(this,o),this.titleText="Share your QR code",this.viewCodeText="View QR code",this.downloadCodeText="Download",this.printCodeText="Print",this.errorHeaderText="There was an error loading your QR code",this.errorDescriptionText="Please refresh this page and try again",this.hideTitle=!1,this.alignment="center",r(this)}disconnectedCallback(){}render(){const e=u(this),r=g()?function(e){const[o,a]=t(!1);return p({dialogIsOpen:o,hideTitle:e.hideTitle,showDialog:()=>a(!0),hideDialog:()=>a(!1),titleText:e.titleText,viewCodeText:e.viewCodeText,downloadCodeText:e.downloadCodeText,printCodeText:e.printCodeText,alignment:e.alignment,qrLink:"https://media.istockphoto.com/id/1251071788/vector/qr-code-bar-code-black-icon-digital-technology.jpg?s=612x612&w=0&k=20&c=maw4OqMSEegAdSo8Drm9HO7i1ddddvP2YaL1UuWbRig=",fireViewQrEvent:()=>{console.log("View QR Code clicked")},createDownloadable:async()=>{console.log("Download QR Code clicked")},createPrintable:async()=>{console.log("Print QR Code clicked")}},e.demoData||{},{arrayMerge:(e,o)=>o})}(e):function(e){var o;const r=i(),n=d(),g=m(),p=s(h),[u,v]=t(null),[C,R]=t(!1),[b,q]=t(!1),{data:y,loading:E}=c(w,{programId:r,engagementMedium:g},!(null==n?void 0:n.jwt)||void 0!==(null==p?void 0:p.shareLink)),[M]=l(f),k=null===(o=null==y?void 0:y.user)||void 0===o?void 0:o.shareLink,I=`${k}?qrCode`,j=E||b;a((()=>{k&&(async()=>{v(`${k}?qrCode&qrCodeImageFormat=svg&qrCodeQuietZoneSize=0`)})()}),[k]);const Q=async()=>{M({eventMeta:{programId:r,id:null==n?void 0:n.id,accountId:null==n?void 0:n.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:g,shareMedium:"DIRECT"}}})};return{...e,loading:j,qrLink:u,error:C,createDownloadable:async()=>{try{const e=await fetch(`${I}&qrCodeSize=800&qrCodeImageFormat=png`),o=await e.blob(),t=URL.createObjectURL(o);o&&Q();const a=document.createElement("a");a.href=t,a.download="qrCode.png",document.body.appendChild(a),a.click(),document.body.removeChild(a)}catch(e){console.error("Failed to fetch QR code:",e),R(!0)}},createPrintable:async()=>{try{const e=await fetch(`${I}&qrCodeSize=1000&qrCodeImageFormat=png&qrCodeErrorCorrectionLevel=H`),o=await e.blob(),t=URL.createObjectURL(o);o&&Q();const a=window.open("about:blank","_new"),r=a.document.createElement("img");r.src=t,r.onload=()=>{a.print(),a.close()},a.document.body.appendChild(r)}catch(e){console.error("Failed to fetch QR code: ",e),R(!0)}}}}(e);return o(v,Object.assign({},r))}};export{C as sqm_qr_code}
|