@internetarchive/donation-monthly-portal 3.0.0 → 3.0.1
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.
|
@@ -57,7 +57,7 @@ let MonthlyGivingCircle = class MonthlyGivingCircle extends LitElement {
|
|
|
57
57
|
class="link slim"
|
|
58
58
|
id="close-receipts"
|
|
59
59
|
.clickHandler=${async () => {
|
|
60
|
-
this.viewToDisplay = 'welcome';
|
|
60
|
+
this.viewToDisplay = this.plans.length ? 'plans' : 'welcome';
|
|
61
61
|
this.dispatchEvent(new CustomEvent('ShowWelcome'));
|
|
62
62
|
this.updates = [];
|
|
63
63
|
await this.updateComplete;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-giving-circle.js","sourceRoot":"","sources":["../../src/monthly-giving-circle.ts"],"names":[],"mappings":"AAAA,gCAAgC;;AAEhC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,OAAO,EAAkB,MAAM,KAAK,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,mBAAmB,CAAC;AAC3B,OAAO,SAAS,CAAC;AACjB,OAAO,4BAA4B,CAAC;AACpC,OAAO,YAAY,CAAC;AAEpB,OAAO,4BAA4B,CAAC;AASpC,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,UAAU;IAAnD;;QAC8B,eAAU,GAAW,EAAE,CAAC;QAEzB,aAAQ,GAAG,EAAE,CAAC;QAEd,YAAO,GAAe,EAAE,CAAC;QAEzB,UAAK,GAAG,EAAE,CAAC;QAEK,kBAAa,GAG1C,SAAS,CAAC;IA8G1B,CAAC;IA5GW,gBAAgB;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,OAAuB;QAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC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AC;CACF,CAAA;AAzH6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAyB;AAEzB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAe;AAEd;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oDAA0B;AAEzB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAY;AAEK;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAGlB;AAZb,mBAAmB;IAD/B,aAAa,CAAC,0BAA0B,CAAC;GAC7B,mBAAmB,CA0H/B;SA1HY,mBAAmB","sourcesContent":["/* eslint-disable no-debugger */\n\nimport { LitElement, html, TemplateResult, nothing, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport './welcome-message';\nimport './plans';\nimport './presentational/mgc-title';\nimport './receipts';\nimport type { IauxMgcReceipts } from './receipts';\nimport './presentational/ia-button';\n\nexport type AnUpdate = {\n message: string;\n status: 'success' | 'fail';\n donationId: string;\n};\n\n@customElement('ia-monthly-giving-circle')\nexport class MonthlyGivingCircle extends LitElement {\n @property({ type: String }) patronName: string = '';\n\n @property({ type: Array }) receipts = [];\n\n @property({ type: Array }) updates: AnUpdate[] = [];\n\n @property({ type: Array }) plans = [];\n\n @property({ type: String, reflect: true }) viewToDisplay:\n | 'welcome'\n | 'receipts'\n | 'plans' = 'welcome';\n\n protected createRenderRoot() {\n return this;\n }\n\n updated(changed: PropertyValues) {\n if (changed.has('plans')) {\n this.viewToDisplay = this.plans.length ? 'plans' : 'welcome';\n }\n }\n\n get receiptListElement(): IauxMgcReceipts {\n return this.querySelector('ia-mgc-receipts') as IauxMgcReceipts;\n }\n\n updateReceived(update: AnUpdate) {\n this.receiptListElement.emailSent({\n id: update.donationId,\n emailStatus: update.status,\n });\n this.updates.unshift(update);\n }\n\n get showReceiptsCTA(): TemplateResult {\n return html`\n <ia-button\n class=\"link slim\"\n .clickHandler=${() => {\n this.viewToDisplay = 'receipts';\n this.dispatchEvent(new CustomEvent('ShowReceipts'));\n }}\n >\n View recent donation history\n </ia-button>\n `;\n }\n\n get headerSection(): TemplateResult {\n if (this.viewToDisplay === 'receipts') {\n return html`\n <ia-mgc-title titleStyle=\"default\">\n <span slot=\"title\">Recent donations</span>\n <span slot=\"action\">\n <ia-button\n class=\"link slim\"\n id=\"close-receipts\"\n .clickHandler=${async () => {\n this.viewToDisplay = this.plans.length ? 'plans' : 'welcome';\n this.dispatchEvent(new CustomEvent('ShowWelcome'));\n this.updates = [];\n await this.updateComplete;\n }}\n >\n Back to account settings\n </ia-button>\n </span>\n </ia-mgc-title>\n `;\n }\n\n if (this.plans.length) {\n return html`\n <ia-mgc-title titleStyle=\"heart\">\n <span slot=\"title\">Monthly Giving Circle</span>\n <span slot=\"action\"\n >${this.receipts.length ? this.showReceiptsCTA : nothing}</span\n >\n </ia-mgc-title>\n `;\n }\n\n return html`\n <ia-mgc-title titleStyle=\"heart\">\n <span slot=\"title\">Monthly Giving Circle</span>\n <span slot=\"action\"\n >${this.receipts.length ? this.showReceiptsCTA : nothing}</span\n >\n </ia-mgc-title>\n `;\n }\n\n protected render() {\n return html`\n ${this.headerSection}\n ${this.viewToDisplay === 'receipts'\n ? html`\n <ia-mgc-receipts\n .receipts=${this.receipts}\n @EmailReceiptRequest=${(event: CustomEvent) => {\n console.log('EmailReceiptRequest', event.detail);\n this.dispatchEvent(\n new CustomEvent('EmailReceiptRequest', {\n detail: { ...event.detail },\n })\n );\n }}\n ></ia-mgc-receipts>\n `\n : nothing}\n ${this.viewToDisplay === 'plans'\n ? html` <ia-mgc-plans .plans=${this.plans}></ia-mgc-plans> `\n : nothing}\n ${this.viewToDisplay === 'welcome'\n ? html`\n <ia-mgc-welcome .patronName=${this.patronName}></ia-mgc-welcome>\n `\n : nothing}\n `;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -77,7 +77,7 @@ export class MonthlyGivingCircle extends LitElement {
|
|
|
77
77
|
class="link slim"
|
|
78
78
|
id="close-receipts"
|
|
79
79
|
.clickHandler=${async () => {
|
|
80
|
-
this.viewToDisplay = 'welcome';
|
|
80
|
+
this.viewToDisplay = this.plans.length ? 'plans' : 'welcome';
|
|
81
81
|
this.dispatchEvent(new CustomEvent('ShowWelcome'));
|
|
82
82
|
this.updates = [];
|
|
83
83
|
await this.updateComplete;
|