@churchapps/apphelper 0.4.9 → 0.4.11

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.
Files changed (66) hide show
  1. package/dist/components/ImageEditor.d.ts +0 -1
  2. package/dist/components/ImageEditor.d.ts.map +1 -1
  3. package/dist/components/ImageEditor.js +1 -1
  4. package/dist/components/ImageEditor.js.map +1 -1
  5. package/dist/donationComponents/components/BankForm.d.ts +14 -0
  6. package/dist/donationComponents/components/BankForm.d.ts.map +1 -0
  7. package/dist/donationComponents/components/BankForm.js +126 -0
  8. package/dist/donationComponents/components/BankForm.js.map +1 -0
  9. package/dist/donationComponents/components/CardForm.d.ts +13 -0
  10. package/dist/donationComponents/components/CardForm.d.ts.map +1 -0
  11. package/dist/donationComponents/components/CardForm.js +122 -0
  12. package/dist/donationComponents/components/CardForm.js.map +1 -0
  13. package/dist/donationComponents/components/DonationForm.d.ts +15 -0
  14. package/dist/donationComponents/components/DonationForm.d.ts.map +1 -0
  15. package/dist/donationComponents/components/DonationForm.js +199 -0
  16. package/dist/donationComponents/components/DonationForm.js.map +1 -0
  17. package/dist/donationComponents/components/FundDonation.d.ts +12 -0
  18. package/dist/donationComponents/components/FundDonation.d.ts.map +1 -0
  19. package/dist/donationComponents/components/FundDonation.js +32 -0
  20. package/dist/donationComponents/components/FundDonation.js.map +1 -0
  21. package/dist/donationComponents/components/FundDonations.d.ts +11 -0
  22. package/dist/donationComponents/components/FundDonations.d.ts.map +1 -0
  23. package/dist/donationComponents/components/FundDonations.js +33 -0
  24. package/dist/donationComponents/components/FundDonations.js.map +1 -0
  25. package/dist/donationComponents/components/PaymentMethods.d.ts +14 -0
  26. package/dist/donationComponents/components/PaymentMethods.d.ts.map +1 -0
  27. package/dist/donationComponents/components/PaymentMethods.js +84 -0
  28. package/dist/donationComponents/components/PaymentMethods.js.map +1 -0
  29. package/dist/donationComponents/components/RecurringDonations.d.ts +10 -0
  30. package/dist/donationComponents/components/RecurringDonations.d.ts.map +1 -0
  31. package/dist/donationComponents/components/RecurringDonations.js +93 -0
  32. package/dist/donationComponents/components/RecurringDonations.js.map +1 -0
  33. package/dist/donationComponents/components/RecurringDonationsEdit.d.ts +11 -0
  34. package/dist/donationComponents/components/RecurringDonationsEdit.d.ts.map +1 -0
  35. package/dist/donationComponents/components/RecurringDonationsEdit.js +66 -0
  36. package/dist/donationComponents/components/RecurringDonationsEdit.js.map +1 -0
  37. package/dist/donationComponents/components/index.d.ts +9 -0
  38. package/dist/donationComponents/components/index.d.ts.map +1 -0
  39. package/dist/donationComponents/components/index.js +20 -0
  40. package/dist/donationComponents/components/index.js.map +1 -0
  41. package/dist/donationComponents/index.d.ts +3 -0
  42. package/dist/donationComponents/index.d.ts.map +1 -0
  43. package/dist/donationComponents/index.js +21 -0
  44. package/dist/donationComponents/index.js.map +1 -0
  45. package/dist/donationComponents/modals/DonationPreviewModal.d.ts +15 -0
  46. package/dist/donationComponents/modals/DonationPreviewModal.d.ts.map +1 -0
  47. package/dist/donationComponents/modals/DonationPreviewModal.js +33 -0
  48. package/dist/donationComponents/modals/DonationPreviewModal.js.map +1 -0
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -0
  52. package/dist/index.js.map +1 -1
  53. package/package.json +21 -21
  54. package/src/components/ImageEditor.tsx +1 -1
  55. package/src/donationComponents/components/BankForm.tsx +163 -0
  56. package/src/donationComponents/components/CardForm.tsx +104 -0
  57. package/src/donationComponents/components/DonationForm.tsx +260 -0
  58. package/src/donationComponents/components/FundDonation.tsx +59 -0
  59. package/src/donationComponents/components/FundDonations.tsx +44 -0
  60. package/src/donationComponents/components/PaymentMethods.tsx +133 -0
  61. package/src/donationComponents/components/RecurringDonations.tsx +117 -0
  62. package/src/donationComponents/components/RecurringDonationsEdit.tsx +96 -0
  63. package/src/donationComponents/components/index.tsx +8 -0
  64. package/src/donationComponents/index.ts +2 -0
  65. package/src/donationComponents/modals/DonationPreviewModal.tsx +70 -0
  66. package/src/index.ts +1 -0
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { FundDonationInterface, FundInterface } from "@churchapps/helpers";
3
+ interface Props {
4
+ fundDonation: FundDonationInterface;
5
+ funds: FundInterface[];
6
+ index: number;
7
+ updatedFunction: (fundDonation: FundDonationInterface, index: number) => void;
8
+ params?: any;
9
+ }
10
+ export declare const FundDonation: React.FC<Props>;
11
+ export {};
12
+ //# sourceMappingURL=FundDonation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FundDonation.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/FundDonation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAK3E,UAAU,KAAK;IACb,YAAY,EAAE,qBAAqB,CAAC;IACpC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,CAAC,YAAY,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9E,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAyCxC,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.FundDonation = void 0;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const material_1 = require("@mui/material");
7
+ const helpers_1 = require("../../helpers");
8
+ const FundDonation = (props) => {
9
+ const getOptions = () => {
10
+ const result = [];
11
+ for (let i = 0; i < props.funds.length; i++) {
12
+ const getDisabled = (props?.params?.fundId && props.params.fundId !== "") ? props.params.fundId !== props.funds[i].id : false;
13
+ result.push((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: props.funds[i].id, disabled: getDisabled, children: props.funds[i].name }, i));
14
+ }
15
+ return result;
16
+ };
17
+ const handleChange = (e) => {
18
+ const fd = { ...props.fundDonation };
19
+ switch (e.target.name) {
20
+ case "amount":
21
+ fd.amount = parseFloat(e.target.value.replace("$", "").replace(",", ""));
22
+ break;
23
+ case "fund":
24
+ fd.fundId = e.target.value;
25
+ break;
26
+ }
27
+ props.updatedFunction(fd, props.index);
28
+ };
29
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 3, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, name: "amount", label: helpers_1.Locale.label("donation.fundDonations.amount"), type: "number", disabled: props.params?.amount && props.params.amount !== "", "aria-label": "amount", lang: "en-150", value: props.fundDonation.amount || "", onChange: handleChange }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: helpers_1.Locale.label("donation.fundDonations.fund") }), (0, jsx_runtime_1.jsx)(material_1.Select, { fullWidth: true, label: helpers_1.Locale.label("donation.fundDonations.fund"), name: "fund", "aria-label": "fund", value: props.fundDonation.fundId, onChange: handleChange, children: getOptions() })] }) })] }) }));
30
+ };
31
+ exports.FundDonation = FundDonation;
32
+ //# sourceMappingURL=FundDonation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FundDonation.js","sourceRoot":"","sources":["../../../src/donationComponents/components/FundDonation.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAIb,4CAA2F;AAE3F,2CAAuC;AAUhC,MAAM,YAAY,GAAoB,CAAC,KAAK,EAAE,EAAE;IAErD,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAA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AI,IAAC,SAAS,QAAC,OAAO,EAAE,CAAC,aACxB,uBAAC,eAAI,IAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,YAC3B,uBAAC,oBAAS,IAAC,SAAS,QAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,gBAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,EAAE,gBAAa,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,GAAI,GACpQ,EACP,uBAAC,eAAI,IAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,YAC3B,wBAAC,sBAAW,IAAC,SAAS,mBACpB,uBAAC,qBAAU,cAAE,gBAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,GAAc,EACtE,uBAAC,iBAAM,IAAC,SAAS,QAAC,KAAK,EAAE,gBAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,IAAI,EAAC,MAAM,gBAAY,MAAM,EAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,YACzJ,UAAU,EAAE,GACN,IACG,GACT,IACF,GACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,YAAY,gBAyCvB"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { FundDonationInterface, FundInterface } from "@churchapps/helpers";
3
+ interface Props {
4
+ fundDonations: FundDonationInterface[];
5
+ funds: FundInterface[];
6
+ params?: any;
7
+ updatedFunction: (fundDonations: FundDonationInterface[]) => void;
8
+ }
9
+ export declare const FundDonations: React.FC<Props>;
10
+ export {};
11
+ //# sourceMappingURL=FundDonations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FundDonations.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/FundDonations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG3E,UAAU,KAAK;IAAG,aAAa,EAAE,qBAAqB,EAAE,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC;IAAC,eAAe,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,KAAK,IAAI,CAAA;CAAE;AAEnK,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiCzC,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.FundDonations = void 0;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const _1 = require(".");
7
+ const helpers_1 = require("../../helpers");
8
+ const FundDonations = (props) => {
9
+ const handleUpdated = (fundDonation, index) => {
10
+ const fundDonations = [...props.fundDonations];
11
+ fundDonations[index] = fundDonation;
12
+ props.updatedFunction(fundDonations);
13
+ };
14
+ const addRow = (e) => {
15
+ e.preventDefault();
16
+ const fundDonations = [...props.fundDonations];
17
+ const fd = { fundId: props.funds[0].id };
18
+ fundDonations.push(fd);
19
+ props.updatedFunction(fundDonations);
20
+ };
21
+ const getRows = () => {
22
+ const result = [];
23
+ for (let i = 0; i < props.fundDonations.length; i++) {
24
+ const fd = props.fundDonations[i];
25
+ result.push((0, jsx_runtime_1.jsx)(_1.FundDonation, { fundDonation: fd, funds: props.funds, updatedFunction: handleUpdated, params: props?.params, index: i }, i));
26
+ }
27
+ return result;
28
+ };
29
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [getRows(), (!props?.params?.fundId || props?.params?.fundId === "") &&
30
+ (0, jsx_runtime_1.jsx)("a", { href: "about:blank", "aria-label": "add-fund-donation", className: "text-decoration", style: { display: "block", marginBottom: "15px" }, onClick: addRow, children: helpers_1.Locale.label("donation.fundDonations.addMore") })] }));
31
+ };
32
+ exports.FundDonations = FundDonations;
33
+ //# sourceMappingURL=FundDonations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FundDonations.js","sourceRoot":"","sources":["../../../src/donationComponents/components/FundDonations.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAGb,wBAAiC;AAEjC,2CAAuC;AAIhC,MAAM,aAAa,GAAoB,CAAC,KAAK,EAAE,EAAE;IACtD,MAAM,aAAa,GAAG,CAAC,YAAmC,EAAE,KAAa,EAAE,EAAE;QAC3E,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;QAC/C,aAAa,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC;QACpC,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,CAAmB,EAAE,EAAE;QACrC,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;QAC/C,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAA2B,CAAC;QAClE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvB,KAAK,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpD,MAAM,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAClC,MAAM,CAAC,IAAI,CAAC,uBAAC,eAAY,IAAC,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAU,KAAK,EAAE,CAAC,IAAX,CAAC,CAAc,CAAC,CAAC;QAC/I,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,CACL,6DACG,OAAO,EAAE,EACT,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,EAAE,CAAC;gBACvD,8BAAG,IAAI,EAAC,aAAa,gBAAY,mBAAmB,EAAC,SAAS,EAAC,iBAAiB,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,YAAG,gBAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,GAAK,IAE1M,CACJ,CAAC;AACJ,CAAC,CAAC;AAjCW,QAAA,aAAa,iBAiCxB"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import type { Stripe } from "@stripe/stripe-js";
3
+ import { PersonInterface, StripePaymentMethod } from "@churchapps/helpers";
4
+ interface Props {
5
+ person: PersonInterface;
6
+ customerId: string;
7
+ paymentMethods: StripePaymentMethod[];
8
+ stripePromise: Promise<Stripe>;
9
+ appName: string;
10
+ dataUpdate: (message?: string) => void;
11
+ }
12
+ export declare const PaymentMethods: React.FC<Props>;
13
+ export {};
14
+ //# sourceMappingURL=PaymentMethods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentMethods.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/PaymentMethods.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAe,MAAM,qBAAqB,CAAC;AAKxF,UAAU,KAAK;IAAG,MAAM,EAAE,eAAe,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,mBAAmB,EAAE,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE;AAE/L,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAqH1C,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use client";
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.PaymentMethods = void 0;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = __importDefault(require("react"));
10
+ const react_stripe_js_1 = require("@stripe/react-stripe-js");
11
+ const _1 = require(".");
12
+ const components_1 = require("../../components");
13
+ const helpers_1 = require("../../helpers");
14
+ const helpers_2 = require("@churchapps/helpers");
15
+ const material_1 = require("@mui/material");
16
+ const PaymentMethods = (props) => {
17
+ const [editPaymentMethod, setEditPaymentMethod] = react_1.default.useState(new helpers_2.StripePaymentMethod());
18
+ const [mode, setMode] = react_1.default.useState("display");
19
+ const [verify, setVerify] = react_1.default.useState(false);
20
+ const handleEdit = (pm, verifyAccount) => (e) => {
21
+ e.preventDefault();
22
+ setEditPaymentMethod(pm);
23
+ setVerify(verifyAccount);
24
+ setMode("edit");
25
+ };
26
+ const handleDelete = async () => {
27
+ const confirmed = window.confirm(helpers_1.Locale.label("donation.paymentMethods.confirmDelete"));
28
+ if (confirmed) {
29
+ helpers_1.ApiHelper.delete("/paymentmethods/" + editPaymentMethod.id + "/" + props.customerId, "GivingApi").then(() => {
30
+ setMode("display");
31
+ props.dataUpdate(helpers_1.Locale.label("donation.paymentMethods.deleted"));
32
+ });
33
+ }
34
+ };
35
+ const MenuIcon = () => {
36
+ const [anchorEl, setAnchorEl] = react_1.default.useState(null);
37
+ const open = Boolean(anchorEl);
38
+ const handleClick = (e) => {
39
+ setAnchorEl(e.currentTarget);
40
+ };
41
+ const handleClose = () => {
42
+ setAnchorEl(null);
43
+ };
44
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": "add-button", id: "addBtnGroup", "aria-controls": open ? "add-menu" : undefined, "aria-expanded": open ? "true" : undefined, "aria-haspopup": "true", onClick: handleClick, children: (0, jsx_runtime_1.jsx)(material_1.Icon, { color: "primary", children: "add" }) }), (0, jsx_runtime_1.jsxs)(material_1.Menu, { id: "add-menu", MenuListProps: { "aria-labelledby": "addBtnGroup" }, anchorEl: anchorEl, open: open, onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { "aria-label": "add-card", onClick: handleEdit(new helpers_2.StripePaymentMethod({ type: "card" })), children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { sx: { mr: "3px" }, children: "credit_card" }), " ", helpers_1.Locale.label("donation.paymentMethods.addCard")] }), (0, jsx_runtime_1.jsxs)(material_1.MenuItem, { "aria-label": "add-bank", onClick: handleEdit(new helpers_2.StripePaymentMethod({ type: "bank" })), children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { sx: { mr: "3px" }, children: "account_balance" }), " ", helpers_1.Locale.label("donation.paymentMethods.addBank")] })] })] }));
45
+ };
46
+ const getNewContent = () => {
47
+ if (!helpers_1.UserHelper.checkAccess(helpers_2.Permissions.givingApi.settings.edit) && props.appName !== "B1App")
48
+ return null;
49
+ return (0, jsx_runtime_1.jsx)(MenuIcon, {});
50
+ };
51
+ const getEditOptions = (pm) => {
52
+ if (!helpers_1.UserHelper.checkAccess(helpers_2.Permissions.givingApi.settings.edit) && props.appName !== "B1App")
53
+ return null;
54
+ return (0, jsx_runtime_1.jsx)("a", { "aria-label": "edit-button", onClick: handleEdit(pm), href: "about:blank", children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "edit" }) });
55
+ };
56
+ const getPMIcon = (type) => (type === "card" ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "credit_card" }) : (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "account_balance" }));
57
+ const getPaymentRows = () => {
58
+ const rows = [];
59
+ props.paymentMethods.forEach((method) => {
60
+ rows.push((0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { className: "capitalize", children: [getPMIcon(method.type), " ", method.name + " ****" + method.last4] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: method?.status === "new" && (0, jsx_runtime_1.jsx)("a", { href: "about:blank", "aria-label": "verify-account", onClick: handleEdit(method, true), children: helpers_1.Locale.label("donation.paymentMethods.verify") }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: getEditOptions(method) })] }, method.id));
61
+ });
62
+ return rows;
63
+ };
64
+ const PaymentMethodsTable = () => {
65
+ if (!props.paymentMethods)
66
+ return (0, jsx_runtime_1.jsx)(components_1.Loading, {});
67
+ if (props.paymentMethods.length) {
68
+ return ((0, jsx_runtime_1.jsx)(material_1.Table, { children: (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: getPaymentRows() }) }));
69
+ }
70
+ else
71
+ return (0, jsx_runtime_1.jsx)("div", { children: helpers_1.Locale.label("donation.paymentMethods.noMethod") });
72
+ };
73
+ const EditForm = () => ((0, jsx_runtime_1.jsxs)(react_stripe_js_1.Elements, { stripe: props.stripePromise, children: [editPaymentMethod.type === "card" && (0, jsx_runtime_1.jsx)(_1.CardForm, { card: editPaymentMethod, customerId: props.customerId, person: props.person, setMode: setMode, deletePayment: handleDelete, updateList: (message) => { props.dataUpdate(message); } }), editPaymentMethod.type === "bank" && (0, jsx_runtime_1.jsx)(_1.BankForm, { bank: editPaymentMethod, showVerifyForm: verify, customerId: props.customerId, person: props.person, setMode: setMode, deletePayment: handleDelete, updateList: (message) => { props.dataUpdate(message); } })] }));
74
+ const PaymentMethods = () => {
75
+ if (mode === "display") {
76
+ return ((0, jsx_runtime_1.jsx)(components_1.DisplayBox, { "aria-label": "payment-methods-box", headerIcon: "credit_card", headerText: "Payment Methods", editContent: getNewContent(), children: (0, jsx_runtime_1.jsx)(PaymentMethodsTable, {}) }));
77
+ }
78
+ else
79
+ return (0, jsx_runtime_1.jsx)(EditForm, {});
80
+ };
81
+ return props.stripePromise ? (0, jsx_runtime_1.jsx)(PaymentMethods, {}) : null;
82
+ };
83
+ exports.PaymentMethods = PaymentMethods;
84
+ //# sourceMappingURL=PaymentMethods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentMethods.js","sourceRoot":"","sources":["../../../src/donationComponents/components/PaymentMethods.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,kDAA0B;AAE1B,6DAAmD;AACnD,wBAAuC;AACvC,iDAAuD;AACvD,2CAA8D;AAC9D,iDAAwF;AACxF,4CAEuB;AAIhB,MAAM,cAAc,GAAoB,CAAC,KAAK,EAAE,EAAE;IACvD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAsB,IAAI,6BAAmB,EAAE,CAAC,CAAC;IACjH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE3D,MAAM,UAAU,GAAG,CAAC,EAAwB,EAAE,aAAuB,EAAE,EAAE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WAAW,EAAE,aAAa,EAAE,YAC7H,uBAAC,mBAAmB,KAAuB,GAChC,CACd,CAAC;QACJ,CAAC;;YAAM,OAAO,uBAAC,QAAQ,KAAY,CAAC;IACtC,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,uBAAC,cAAc,KAAkB,CAAC,CAAC,CAAC,IAAI,CAAC;AACxE,CAAC,CAAC;AArHW,QAAA,cAAc,kBAqHzB"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ interface Props {
3
+ customerId: string;
4
+ paymentMethods: any[];
5
+ appName: string;
6
+ dataUpdate: (message?: string) => void;
7
+ }
8
+ export declare const RecurringDonations: React.FC<Props>;
9
+ export {};
10
+ //# sourceMappingURL=RecurringDonations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecurringDonations.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/RecurringDonations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,KAAK;IAAG,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,GAAG,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAAE;AAEvH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAyG9C,CAAC"}
@@ -0,0 +1,93 @@
1
+ "use client";
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.RecurringDonations = void 0;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = __importDefault(require("react"));
10
+ const components_1 = require("../../components");
11
+ const helpers_1 = require("../../helpers");
12
+ const helpers_2 = require("@churchapps/helpers");
13
+ const _1 = require(".");
14
+ const material_1 = require("@mui/material");
15
+ ;
16
+ const RecurringDonations = (props) => {
17
+ const [subscriptions, setSubscriptions] = react_1.default.useState([]);
18
+ const [mode, setMode] = react_1.default.useState("display");
19
+ const [editSubscription, setEditSubscription] = react_1.default.useState();
20
+ const loadData = () => {
21
+ if (props.customerId) {
22
+ helpers_1.ApiHelper.get("/customers/" + props.customerId + "/subscriptions", "GivingApi").then(subResult => {
23
+ const subs = [];
24
+ const requests = subResult.data?.map((s) => helpers_1.ApiHelper.get("/subscriptionfunds?subscriptionId=" + s.id, "GivingApi").then(subFunds => {
25
+ s.funds = subFunds;
26
+ subs.push(s);
27
+ }));
28
+ return requests && Promise.all(requests).then(() => {
29
+ setSubscriptions(subs);
30
+ });
31
+ });
32
+ }
33
+ };
34
+ const handleUpdate = (message) => {
35
+ loadData();
36
+ setMode("display");
37
+ if (message)
38
+ props.dataUpdate(message);
39
+ };
40
+ const handleEdit = (sub) => (e) => {
41
+ e.preventDefault();
42
+ setEditSubscription(sub);
43
+ setMode("edit");
44
+ };
45
+ const getPaymentMethod = (sub) => {
46
+ const pm = props.paymentMethods.find((pm) => pm.id === (sub.default_payment_method || sub.default_source));
47
+ if (!pm)
48
+ return (0, jsx_runtime_1.jsx)("span", { style: { color: "red" }, children: helpers_1.Locale.label("donation.recurring.notFound") });
49
+ return `${pm.name} ****${pm.last4}`;
50
+ };
51
+ const getInterval = (subscription) => {
52
+ const interval = subscription.plan.interval_count + " " + subscription.plan.interval;
53
+ return subscription.plan.interval_count > 1 ? interval + "s" : interval;
54
+ };
55
+ const getFunds = (subscription) => {
56
+ const result = [];
57
+ subscription.funds.forEach((fund) => {
58
+ result.push((0, jsx_runtime_1.jsxs)("div", { children: [fund.name, " ", (0, jsx_runtime_1.jsx)("span", { style: { float: "right" }, children: helpers_1.CurrencyHelper.formatCurrency(fund.amount) })] }, subscription.id + fund.id));
59
+ });
60
+ const total = (subscription.plan.amount / 100);
61
+ result.push((0, jsx_runtime_1.jsxs)("div", { style: { borderTop: "solid #dee2e6 1px" }, children: ["Total ", (0, jsx_runtime_1.jsx)("span", { style: { float: "right" }, children: helpers_1.CurrencyHelper.formatCurrency(total) })] }, subscription.id + "-total"));
62
+ return result;
63
+ };
64
+ const getEditOptions = (sub) => {
65
+ if ((!helpers_1.UserHelper.checkAccess(helpers_2.Permissions.givingApi.settings.edit) && props.appName !== "B1App") || props?.paymentMethods?.length === 0)
66
+ return null;
67
+ return (0, jsx_runtime_1.jsx)("a", { "aria-label": "edit-button", onClick: handleEdit(sub), href: "about:blank", children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "edit" }) });
68
+ };
69
+ const getTableHeader = () => {
70
+ const result = [];
71
+ result.push((0, jsx_runtime_1.jsxs)(material_1.TableRow, { sx: { textAlign: "left" }, children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)("b", { children: helpers_1.Locale.label("donation.recurring.startDate") }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)("b", { children: helpers_1.Locale.label("donation.recurring.amount") }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)("b", { children: helpers_1.Locale.label("donation.recurring.interval") }) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)("b", { children: helpers_1.Locale.label("donation.recurring.paymentMethod") }) }), props?.paymentMethods?.length > 0 && (0, jsx_runtime_1.jsx)(material_1.TableCell, {})] }, "header"));
72
+ return result;
73
+ };
74
+ const getTableRows = () => {
75
+ const rows = [];
76
+ subscriptions.forEach((sub) => {
77
+ rows.push((0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsx)(material_1.TableCell, { children: helpers_1.DateHelper.prettyDate(new Date(sub.billing_cycle_anchor * 1000)) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: getFunds(sub) }), (0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.recurring.every"), " ", getInterval(sub)] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { className: "capitalize", children: getPaymentMethod(sub) }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { align: "right", children: getEditOptions(sub) })] }, sub.id));
78
+ });
79
+ return rows;
80
+ };
81
+ const getSubscriptionsTable = () => ((0, jsx_runtime_1.jsxs)(material_1.Table, { children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: getTableHeader() }), (0, jsx_runtime_1.jsx)(material_1.TableBody, { children: getTableRows() })] }));
82
+ react_1.default.useEffect(loadData, []); //eslint-disable-line
83
+ if (!subscriptions.length)
84
+ return null;
85
+ if (mode === "display") {
86
+ return ((0, jsx_runtime_1.jsx)(components_1.DisplayBox, { "data-testid": "recurring-donations", headerIcon: "restart_alt", headerText: "Recurring Donations", children: getSubscriptionsTable() }));
87
+ }
88
+ if (mode === "edit" && editSubscription) {
89
+ return ((0, jsx_runtime_1.jsx)(_1.RecurringDonationsEdit, { customerId: props.customerId, paymentMethods: props.paymentMethods, editSubscription: editSubscription, subscriptionUpdated: handleUpdate }));
90
+ }
91
+ };
92
+ exports.RecurringDonations = RecurringDonations;
93
+ //# sourceMappingURL=RecurringDonations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecurringDonations.js","sourceRoot":"","sources":["../../../src/donationComponents/components/RecurringDonations.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,kDAA0B;AAC1B,iDAA8C;AAC9C,2CAA0F;AAC1F,iDAAyE;AACzE,wBAA2C;AAC3C,4CAAuF;AAEgC,CAAC;AAEjH,MAAM,kBAAkB,GAAoB,CAAC,KAAK,EAAE,EAAE;IAC3D,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,eAAK,CAAC,QAAQ,CAA0B,EAAE,CAAC,CAAC;IACtF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,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,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,CACL,uBAAC,uBAAU,mBAAa,qBAAqB,EAAC,UAAU,EAAC,aAAa,EAAC,UAAU,EAAC,qBAAqB,YACpG,qBAAqB,EAAE,GACb,CACd,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,MAAM,IAAI,gBAAgB,EAAE,CAAC;QACxC,OAAO,CACL,uBAAC,yBAAsB,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,YAAY,GAAI,CACtK,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAzGW,QAAA,kBAAkB,sBAyG7B"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { StripePaymentMethod, SubscriptionInterface } from "@churchapps/helpers";
3
+ interface Props {
4
+ subscriptionUpdated: (message?: string) => void;
5
+ customerId: string;
6
+ paymentMethods: StripePaymentMethod[];
7
+ editSubscription: SubscriptionInterface;
8
+ }
9
+ export declare const RecurringDonationsEdit: React.FC<Props>;
10
+ export {};
11
+ //# sourceMappingURL=RecurringDonationsEdit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecurringDonationsEdit.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/RecurringDonationsEdit.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAKjF,UAAU,KAAK;IAAG,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,mBAAmB,EAAE,CAAC;IAAC,gBAAgB,EAAE,qBAAqB,CAAA;CAAE;AAEvK,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmFlD,CAAC"}
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.RecurringDonationsEdit = void 0;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = __importDefault(require("react"));
10
+ const helpers_1 = require("../../helpers");
11
+ const components_1 = require("../../components");
12
+ const material_1 = require("@mui/material");
13
+ const helpers_2 = require("../../helpers");
14
+ ;
15
+ const RecurringDonationsEdit = (props) => {
16
+ const [editSubscription, setEditSubscription] = react_1.default.useState(props.editSubscription);
17
+ const [interval, setInterval] = react_1.default.useState("one_month");
18
+ const handleCancel = () => { props.subscriptionUpdated(); };
19
+ const handleSave = () => {
20
+ const sub = { ...editSubscription };
21
+ const pmFound = props.paymentMethods.find((pm) => pm.id === sub.id);
22
+ if (!pmFound) {
23
+ const pm = props.paymentMethods[0];
24
+ sub.default_payment_method = pm.type === "card" ? pm.id : null;
25
+ sub.default_source = pm.type === "bank" ? pm.id : null;
26
+ }
27
+ helpers_1.ApiHelper.post("/subscriptions", [sub], "GivingApi").then(() => props.subscriptionUpdated(helpers_1.Locale.label("donation.donationForm.recurringUpdated")));
28
+ };
29
+ const handleDelete = () => {
30
+ const conf = window.confirm(helpers_1.Locale.label("donation.donationForm.confirmDelete"));
31
+ if (!conf)
32
+ return;
33
+ const promises = [];
34
+ promises.push(helpers_1.ApiHelper.delete("/subscriptions/" + props.editSubscription.id, "GivingApi"));
35
+ promises.push(helpers_1.ApiHelper.delete("/subscriptionfunds/subscription/" + props.editSubscription.id, "GivingApi"));
36
+ Promise.all(promises).then(() => props.subscriptionUpdated(helpers_1.Locale.label("donation.donationForm.cancelled")));
37
+ };
38
+ const handleChange = (e) => {
39
+ const sub = { ...editSubscription };
40
+ const value = e.target.value;
41
+ switch (e.target.name) {
42
+ case "method":
43
+ const pm = props.paymentMethods.find((pm) => pm.id === value);
44
+ sub.default_payment_method = pm.type === "card" ? value : null;
45
+ sub.default_source = pm.type === "bank" ? value : null;
46
+ break;
47
+ case "interval":
48
+ setInterval(value);
49
+ const inter = helpers_2.DonationHelper.getInterval(value);
50
+ sub.plan.interval_count = inter.interval_count;
51
+ sub.plan.interval = inter.interval;
52
+ break;
53
+ }
54
+ setEditSubscription(sub);
55
+ };
56
+ const getFields = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 3, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: helpers_1.Locale.label("donation.donationForm.method") }), (0, jsx_runtime_1.jsx)(material_1.Select, { label: helpers_1.Locale.label("donation.donationForm.method"), name: "method", "aria-label": "method", value: editSubscription.default_payment_method || editSubscription.default_source, className: "capitalize", onChange: handleChange, children: props.paymentMethods.map((paymentMethod, i) => (0, jsx_runtime_1.jsxs)(material_1.MenuItem, { value: paymentMethod.id, children: [paymentMethod.name, " ****", paymentMethod.last4] }, i)) })] }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { size: { xs: 12, md: 6 }, children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: helpers_1.Locale.label("donation.donationForm.frequency") }), (0, jsx_runtime_1.jsxs)(material_1.Select, { label: helpers_1.Locale.label("donation.donationForm.frequency"), name: "interval", "aria-label": "interval", value: interval, onChange: handleChange, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "one_week", children: helpers_1.Locale.label("donation.donationForm.weekly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "two_week", children: helpers_1.Locale.label("donation.donationForm.biWeekly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "one_month", children: helpers_1.Locale.label("donation.donationForm.monthly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "three_month", children: helpers_1.Locale.label("donation.donationForm.quarterly") }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "one_year", children: helpers_1.Locale.label("donation.donationForm.annually") })] })] }) })] }) }));
57
+ react_1.default.useEffect(() => {
58
+ if (props.editSubscription) {
59
+ const keyName = helpers_2.DonationHelper.getIntervalKeyName(props.editSubscription.plan.interval_count, props.editSubscription.plan.interval);
60
+ setInterval(keyName);
61
+ }
62
+ }, [props.editSubscription]);
63
+ return ((0, jsx_runtime_1.jsx)(components_1.InputBox, { "aria-label": "person-details-box", headerIcon: "person", headerText: helpers_1.Locale.label("donation.donationForm.editRecurring"), ariaLabelSave: "save-button", ariaLabelDelete: "delete-button", cancelFunction: handleCancel, deleteFunction: handleDelete, saveFunction: handleSave, children: getFields() }));
64
+ };
65
+ exports.RecurringDonationsEdit = RecurringDonationsEdit;
66
+ //# sourceMappingURL=RecurringDonationsEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecurringDonationsEdit.js","sourceRoot":"","sources":["../../../src/donationComponents/components/RecurringDonationsEdit.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,kDAA0B;AAC1B,2CAAkD;AAClD,iDAA4C;AAE5C,4CAA2F;AAE3F,2CAA+C;AAEwH,CAAC;AAEjK,MAAM,sBAAsB,GAAoB,CAAC,KAAK,EAAE,EAAE;IAC/D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAwB,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC9G,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE5D,MAAM,Y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} from "./BankForm";
2
+ export { CardForm } from "./CardForm";
3
+ export { DonationForm } from "./DonationForm";
4
+ export { FundDonation } from "./FundDonation";
5
+ export { FundDonations } from "./FundDonations";
6
+ export { PaymentMethods } from "./PaymentMethods";
7
+ export { RecurringDonations } from "./RecurringDonations";
8
+ export { RecurringDonationsEdit } from "./RecurringDonationsEdit";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecurringDonationsEdit = exports.RecurringDonations = exports.PaymentMethods = exports.FundDonations = exports.FundDonation = exports.DonationForm = exports.CardForm = exports.BankForm = void 0;
4
+ var BankForm_1 = require("./BankForm");
5
+ Object.defineProperty(exports, "BankForm", { enumerable: true, get: function () { return BankForm_1.BankForm; } });
6
+ var CardForm_1 = require("./CardForm");
7
+ Object.defineProperty(exports, "CardForm", { enumerable: true, get: function () { return CardForm_1.CardForm; } });
8
+ var DonationForm_1 = require("./DonationForm");
9
+ Object.defineProperty(exports, "DonationForm", { enumerable: true, get: function () { return DonationForm_1.DonationForm; } });
10
+ var FundDonation_1 = require("./FundDonation");
11
+ Object.defineProperty(exports, "FundDonation", { enumerable: true, get: function () { return FundDonation_1.FundDonation; } });
12
+ var FundDonations_1 = require("./FundDonations");
13
+ Object.defineProperty(exports, "FundDonations", { enumerable: true, get: function () { return FundDonations_1.FundDonations; } });
14
+ var PaymentMethods_1 = require("./PaymentMethods");
15
+ Object.defineProperty(exports, "PaymentMethods", { enumerable: true, get: function () { return PaymentMethods_1.PaymentMethods; } });
16
+ var RecurringDonations_1 = require("./RecurringDonations");
17
+ Object.defineProperty(exports, "RecurringDonations", { enumerable: true, get: function () { return RecurringDonations_1.RecurringDonations; } });
18
+ var RecurringDonationsEdit_1 = require("./RecurringDonationsEdit");
19
+ Object.defineProperty(exports, "RecurringDonationsEdit", { enumerable: true, get: function () { return RecurringDonationsEdit_1.RecurringDonationsEdit; } });
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/donationComponents/components/index.tsx"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./components";
2
+ export { DonationPreviewModal } from "./modals/DonationPreviewModal";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/donationComponents/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DonationPreviewModal = void 0;
18
+ __exportStar(require("./components"), exports);
19
+ var DonationPreviewModal_1 = require("./modals/DonationPreviewModal");
20
+ Object.defineProperty(exports, "DonationPreviewModal", { enumerable: true, get: function () { return DonationPreviewModal_1.DonationPreviewModal; } });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/donationComponents/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,sEAAqE;AAA5D,4HAAA,oBAAoB,OAAA"}
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { StripeDonationInterface } from "@churchapps/helpers";
3
+ interface Props {
4
+ show: boolean;
5
+ onHide: () => void;
6
+ handleDonate: (message: string) => void;
7
+ donation: StripeDonationInterface;
8
+ donationType: string;
9
+ paymentMethodName: string;
10
+ funds: any;
11
+ payFee: number;
12
+ }
13
+ export declare const DonationPreviewModal: React.FC<Props>;
14
+ export {};
15
+ //# sourceMappingURL=DonationPreviewModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DonationPreviewModal.d.ts","sourceRoot":"","sources":["../../../src/donationComponents/modals/DonationPreviewModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAK9D,UAAU,KAAK;IACb,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,uBAAuB,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiDhD,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DonationPreviewModal = void 0;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = __importDefault(require("react"));
10
+ const helpers_1 = require("../../helpers");
11
+ const material_1 = require("@mui/material");
12
+ const DonationPreviewModal = (props) => {
13
+ const donationType = { once: "One-time Donation", recurring: "Recurring Donation" };
14
+ const [isLoading, setLoading] = react_1.default.useState(false);
15
+ const handleClick = () => {
16
+ setLoading(true);
17
+ let message = "Thank you for your donation.";
18
+ if (props.donationType === "recurring")
19
+ message = "Recurring donation created. " + message;
20
+ props.handleDonate(message);
21
+ };
22
+ const formatInterval = () => {
23
+ const count = props.donation.interval.interval_count;
24
+ const interval = props.donation.interval.interval;
25
+ const result = `${count} ${interval}`;
26
+ return count > 1 ? result + "s" : result;
27
+ };
28
+ return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, { open: props.show, ...props, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: "Donation Preview" }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.Table, { children: (0, jsx_runtime_1.jsxs)(material_1.TableBody, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("person.name"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: props.donation.person.name })] }), (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.method"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { className: "capitalize", children: props.paymentMethodName })] }), (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.type"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: donationType[props.donationType] })] }), props.donationType === "once"
29
+ && (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.date"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: helpers_1.DateHelper.formatHtml5Date(new Date(props.donation.billing_cycle_anchor)) })] }), (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.weekly"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: props.donation.notes })] }), props.donationType === "recurring"
30
+ && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.startingOn"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: helpers_1.DateHelper.formatHtml5Date(new Date(props.donation.billing_cycle_anchor)) })] }), (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.every"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { className: "capitalize", children: formatInterval() })] })] }), (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.funds"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: props.donation.funds.map((fund, i) => (0, jsx_runtime_1.jsxs)("p", { children: [helpers_1.CurrencyHelper.formatCurrency(fund.amount), " - ", fund.name] }, i)) })] }), props.payFee > 0 && (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.fee"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: helpers_1.CurrencyHelper.formatCurrency(props.payFee) })] }), (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableCell, { children: [helpers_1.Locale.label("donation.preview.total"), ":"] }), (0, jsx_runtime_1.jsx)(material_1.TableCell, { children: (0, jsx_runtime_1.jsx)("h4", { children: helpers_1.CurrencyHelper.formatCurrency(props.donation.amount) }) })] })] }) }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: props.onHide, variant: "outlined", "aria-label": "cancel-button", children: helpers_1.Locale.label("donation.common.cancel") }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleClick, variant: "contained", "aria-label": "donate-button", disabled: isLoading, children: helpers_1.Locale.label("donation.preview.donate") })] })] }));
31
+ };
32
+ exports.DonationPreviewModal = DonationPreviewModal;
33
+ //# sourceMappingURL=DonationPreviewModal.js.map
@@ -0,0 +1 @@
1
+ {"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