@saasquatch/mint-components 2.4.1 → 2.4.2-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/dist/cjs/{GenericTableView-be5648e4.js → GenericTableView-4c48c630.js} +46 -6
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +8 -3
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +8 -3
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +8 -3
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
- package/dist/cjs/{useReferralTable-6e9de0d5.js → useReferralTable-06887d9a.js} +10 -0
- package/dist/collection/components/sqm-invoice-table/sqm-invoice-table.js +7 -1
- package/dist/collection/components/sqm-referral-table/sqm-referral-table.js +7 -1
- package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +7 -1
- package/dist/collection/tables/GenericTableView.js +46 -6
- package/dist/collection/tables/plopTargets.js +8 -0
- package/dist/esm/{GenericTableView-8c72ac30.js → GenericTableView-471a9386.js} +46 -6
- package/dist/esm/sqm-banking-info-form_10.entry.js +8 -3
- package/dist/esm/sqm-referral-table_11.entry.js +8 -3
- package/dist/esm/sqm-rewards-table_9.entry.js +8 -3
- package/dist/esm/sqm-stencilbook.entry.js +1 -1
- package/dist/esm/{useReferralTable-03d32c6f.js → useReferralTable-3aa4b527.js} +10 -1
- package/dist/esm-es5/GenericTableView-471a9386.js +1 -0
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/useReferralTable-3aa4b527.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-1f48ffa2.system.entry.js +1 -0
- package/dist/mint-components/p-2972e950.system.entry.js +1 -0
- package/dist/mint-components/p-381af581.js +1 -0
- package/dist/mint-components/p-700d8950.system.js +1 -0
- package/dist/mint-components/p-83571aad.system.entry.js +1 -0
- package/dist/mint-components/{p-2e33148c.entry.js → p-8bdabf61.entry.js} +1 -1
- package/dist/mint-components/{p-bb0b5e4b.js → p-9944b514.js} +4 -4
- package/dist/mint-components/{p-2a2332a6.entry.js → p-9d671586.entry.js} +8 -8
- package/dist/mint-components/p-b69dbed8.system.js +1 -0
- package/dist/mint-components/p-bfb00685.system.js +1 -1
- package/dist/mint-components/p-cb3fbaff.entry.js +1 -0
- package/dist/mint-components/p-da357714.entry.js +148 -0
- package/dist/mint-components/{p-3784c92c.system.entry.js → p-ee6700a3.system.entry.js} +1 -1
- package/dist/types/tables/GenericTableView.d.ts +2 -0
- package/dist/types/tables/plopTargets.d.ts +3 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/GenericTableView-8c72ac30.js +0 -1
- package/dist/esm-es5/useReferralTable-03d32c6f.js +0 -1
- package/dist/mint-components/p-241e7226.system.entry.js +0 -1
- package/dist/mint-components/p-7c657e1f.entry.js +0 -1
- package/dist/mint-components/p-933bae53.system.entry.js +0 -1
- package/dist/mint-components/p-b1eb2a6a.js +0 -1
- package/dist/mint-components/p-d284ae70.system.js +0 -1
- package/dist/mint-components/p-d5eb601d.system.js +0 -1
- package/dist/mint-components/p-e2fb11af.entry.js +0 -148
- package/dist/mint-components/p-f7218609.system.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e}from"./p-083180bf.js";import{b as a,j as r,f as t}from"./p-a7fc1e02.js";import{d,J as l,H as o,L as n,w as s,R as i}from"./p-8a6531d2.js";import{u}from"./p-bf9ab2d3.js";import{u as c}from"./p-8ae8968c.js";const
|
|
1
|
+
import{h as e}from"./p-083180bf.js";import{b as a,j as r,f as t}from"./p-a7fc1e02.js";import{d,J as l,H as o,L as n,w as s,R as i}from"./p-8a6531d2.js";import{u}from"./p-bf9ab2d3.js";import{u as c}from"./p-8ae8968c.js";function m(e){return e.reduce(((e,a,r)=>"RAISINS-PLOP-TARGET"===a.tagName?[...e,r]:e),[])}const f=a("sq:useReferralTable"),p=d.gql`
|
|
2
2
|
query getReferrals(
|
|
3
3
|
$programId: ID
|
|
4
4
|
$rewardFilter: RewardFilterInput
|
|
@@ -69,7 +69,7 @@ import{h as e}from"./p-083180bf.js";import{b as a,j as r,f as t}from"./p-a7fc1e0
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
`,
|
|
72
|
+
`,g=d.gql`
|
|
73
73
|
query getReferrals(
|
|
74
74
|
$limit: Int!
|
|
75
75
|
$offset: Int!
|
|
@@ -208,7 +208,7 @@ import{h as e}from"./p-083180bf.js";import{b as a,j as r,f as t}from"./p-a7fc1e0
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
`,
|
|
211
|
+
`,v=d.gql`
|
|
212
212
|
query getImpactTax {
|
|
213
213
|
viewer {
|
|
214
214
|
... on User {
|
|
@@ -236,4 +236,4 @@ import{h as e}from"./p-083180bf.js";import{b as a,j as r,f as t}from"./p-a7fc1e0
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
`;function
|
|
239
|
+
`;function w(a,d,m){var f,w,y,h;const C=l(),I=o(),T=null!==(f=a.programId)&&void 0!==f?f:I,b="GLOBAL"===T?null:T,S=b?"classic"===b?{programId_exists:!1}:{programId_eq:b}:{},F={userId_eq:null==C?void 0:C.id,accountId_eq:null==C?void 0:C.accountId},[$,k]=r(((e,a)=>({...e,...a})),{columns:[],rows:[],loading:!1,page:0}),x=n(),{data:M,loading:P}=s(p,{programId:"classic"===b?null:b,rewardFilter:F,locale:x},!a.showReferrer||!(null==C?void 0:C.jwt)),E=null===(w=null==M?void 0:M.viewer)||void 0===w?void 0:w.referredByReferral,q=a.showReferrer&&!!(null==E?void 0:E.dateReferralStarted),{data:L,loading:U}=s(v,{},!(null==C?void 0:C.jwt)),N=null===(y=null==L?void 0:L.viewer)||void 0===y?void 0:y.impactConnection,{envelope:D,states:_,callbacks:j}=i(g,(e=>{var a;return null===(a=null==e?void 0:e.viewer)||void 0===a?void 0:a.referrals}),{limit:a.perPage,offset:0},{referralFilter:S,rewardFilter:F,locale:x},a.showReferrer&&P&&!M||!(null==C?void 0:C.jwt));t((()=>{0===_.currentPage&&q&&j.setLimit(a.perPage-1)}),[q]),t((()=>{a.showReferrer&&q?(j.setLimit(a.perPage-1),j.setCurrentPage(0)):(j.setLimit(a.perPage),j.setCurrentPage(0))}),[a.showReferrer]);const K=u(),A=null==D?void 0:D.data,G=c();t((()=>{k({loading:!0}),D&&async function(a){const r=a.filter((e=>"loading"!==e.slot&&"empty"!==e.slot)),t=null==r?void 0:r.map((async e=>R(e,(()=>e.renderLabel()))));let d;if(q&&0===_.currentPage){const a=null==r?void 0:r.map((async a=>R(a,(()=>a.renderReferrerCell(E,x,e)))));d=await Promise.all(a)}const l=null==A?void 0:A.map((async a=>{const t=null==r?void 0:r.map((async r=>R(r,(()=>r.renderCell(a,{locale:x,taxConnection:N},e)))));return await Promise.all(t)})),o=l&&[d,...await Promise.all(l)].filter((e=>e));k({rows:o});const n=t&&await Promise.all(t);k({columns:n,loading:!1,page:_.currentPage})}(G)}),[D,G,K]);const B=!(null===(h=null==$?void 0:$.rows)||void 0===h?void 0:h.length)&&!(null==A?void 0:A.length);return{states:{hasNext:_.currentPage<_.pageCount-1,hasPrev:_.currentPage>0,show:_.loading||$.loading||U?"loading":B?"empty":"rows",namespace:"sqm-referral-table"},data:{textOverrides:{showLabels:!a.hideLabels,prevLabel:a.prevLabel,moreLabel:a.moreLabel},hiddenColumns:a.hiddenColumns,smBreakpoint:a.smBreakpoint,mdBreakpoint:a.mdBreakpoint},elements:{columns:$.columns,rows:$.rows,emptyElement:d,loadingElement:m},callbacks:{nextPage:()=>{0===_.currentPage&&q&&j.setLimit(a.perPage),j.setCurrentPage(_.currentPage+1)},prevPage:()=>{1===_.currentPage&&q&&j.setLimit(a.perPage-1),j.setCurrentPage(_.currentPage-1)}}}}function y(e){try{return JSON.stringify(e)}catch(e){return"An unknown error"}}async function R(a,r){const t=a.tagName.toLowerCase();let d;await customElements.whenDefined(t);try{d=r()}catch(a){return"renderReferrerCell"===r.name?f("column does not have a renderReferrerCell method."):f("label promise failed",a),f("label promise failed",a),e("span",null)}try{return await d}catch(a){f("Error rendering label",a);const r=y(a);return e("details",null,e("summary",null,"Error"),r)}}export{m as d,y as g,R as t,w as u}
|