@bookmypuja-tech/bmp-pdf 0.3.19 → 0.3.21
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/index.d.ts +16 -2
- package/dist/index.js +80 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -233,6 +233,19 @@ interface IInvoiceProps {
|
|
|
233
233
|
data: IInvoiceData;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
+
interface IPostalItem {
|
|
237
|
+
id: string;
|
|
238
|
+
name: string;
|
|
239
|
+
pujaDetails: string;
|
|
240
|
+
phone: string;
|
|
241
|
+
address: string;
|
|
242
|
+
}
|
|
243
|
+
interface IPostalReportProps {
|
|
244
|
+
date: Date;
|
|
245
|
+
templeName: string;
|
|
246
|
+
data?: IPostalItem[];
|
|
247
|
+
}
|
|
248
|
+
|
|
236
249
|
type sizeOptions = "A4" | "2Inch";
|
|
237
250
|
declare const getPrintBlob: ({ size, data, dates, }: {
|
|
238
251
|
size: sizeOptions;
|
|
@@ -244,7 +257,7 @@ declare const printDevoteeReceipt2Inch: (data: IPujaReceipt) => Promise<void>;
|
|
|
244
257
|
declare const printTotalReceipt2Inch: (data: ITotalReceipt) => Promise<void>;
|
|
245
258
|
declare const printePujaReport2Inch: (data: IPujaReport) => Promise<void>;
|
|
246
259
|
declare const printQuickPrintReceipt2Inch: (data: IQuickReport) => Promise<void>;
|
|
247
|
-
type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report" | "multi-temple-payment" | "settlements-report" | "invoice";
|
|
260
|
+
type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report" | "multi-temple-payment" | "settlements-report" | "invoice" | "postal-report";
|
|
248
261
|
type IReportSize = "A4";
|
|
249
262
|
type ReportDataTypes = {
|
|
250
263
|
kitchen: KitchenReportProps;
|
|
@@ -257,6 +270,7 @@ type ReportDataTypes = {
|
|
|
257
270
|
"multi-temple-payment": IMultiTemplePaymentReport;
|
|
258
271
|
"settlements-report": ISettlementsReport;
|
|
259
272
|
"invoice": IInvoiceProps;
|
|
273
|
+
"postal-report": IPostalReportProps;
|
|
260
274
|
};
|
|
261
275
|
declare class reportPrinter<T extends IReportOptions> {
|
|
262
276
|
option: T;
|
|
@@ -266,4 +280,4 @@ declare class reportPrinter<T extends IReportOptions> {
|
|
|
266
280
|
getBlob(data: ReportDataTypes[T]): Promise<Blob>;
|
|
267
281
|
}
|
|
268
282
|
|
|
269
|
-
export { A4Print, type IInvoiceData, type IInvoiceProps, type KitchenReportProps as IKitchenReport, type IMultiTemplePaymentReport, type IPrasadDelivery, type IPrasadReport, type IPrintablePuja, type IPujaReceipt, type IPujaList as IPujaReport, type ISettlementRow, type ISettlementsReport, type ISummaryPujaList as ISummaryPujaReport, type ITransactionReport, T2Inch, getA4SummaryBlob, getPrintBlob, printDevoteeReceipt2Inch, printQuickPrintReceipt2Inch, printTotalReceipt2Inch, printePujaReport2Inch, reportPrinter };
|
|
283
|
+
export { A4Print, type IInvoiceData, type IInvoiceProps, type KitchenReportProps as IKitchenReport, type IMultiTemplePaymentReport, type IPostalReportProps, type IPrasadDelivery, type IPrasadReport, type IPrintablePuja, type IPujaReceipt, type IPujaList as IPujaReport, type ISettlementRow, type ISettlementsReport, type ISummaryPujaList as ISummaryPujaReport, type ITransactionReport, T2Inch, getA4SummaryBlob, getPrintBlob, printDevoteeReceipt2Inch, printQuickPrintReceipt2Inch, printTotalReceipt2Inch, printePujaReport2Inch, reportPrinter };
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var notoSansRegular = "https://res.cloudinary.com/dpaigt2bx/raw/upload/v17434209
|
|
|
34
34
|
var notoSansBold = "https://res.cloudinary.com/dpaigt2bx/raw/upload/v1743431605/NotoSans-Bold_kagtvd.ttf";
|
|
35
35
|
var notoSansSemiBold = "https://res.cloudinary.com/dpaigt2bx/raw/upload/v1743431765/NotoSans-SemiBold_o96oas.ttf";
|
|
36
36
|
var bmpLogo2 = "https://res.cloudinary.com/dpaigt2bx/image/upload/v1752653165/BookMyPuja_1_1_bd1xa0.png";
|
|
37
|
-
var paidIcon = "https://res.cloudinary.com/dpaigt2bx/image/upload/
|
|
37
|
+
var paidIcon = "https://res.cloudinary.com/dpaigt2bx/image/upload/v1752669810/paid-5025785_1280_afg4ob_gcacmg.png";
|
|
38
38
|
|
|
39
39
|
// src/sizes/A4Print.tsx
|
|
40
40
|
Font.register({
|
|
@@ -218,7 +218,7 @@ var A4Print = ({
|
|
|
218
218
|
var A4Print_default = A4Print;
|
|
219
219
|
|
|
220
220
|
// src/index.tsx
|
|
221
|
-
import
|
|
221
|
+
import React19 from "react";
|
|
222
222
|
|
|
223
223
|
// src/sizes/T2Inch.tsx
|
|
224
224
|
import React2 from "react";
|
|
@@ -3066,17 +3066,18 @@ var A4Invoice = ({ data }) => {
|
|
|
3066
3066
|
display: "flex",
|
|
3067
3067
|
flexDirection: "row",
|
|
3068
3068
|
gap: 5,
|
|
3069
|
-
marginTop: 10
|
|
3069
|
+
marginTop: 10,
|
|
3070
|
+
alignItems: "center"
|
|
3070
3071
|
}
|
|
3071
3072
|
},
|
|
3072
|
-
/* @__PURE__ */ React17.createElement(Text_default, { style: { fontSize: 10 } }, "Powered by"),
|
|
3073
|
+
/* @__PURE__ */ React17.createElement(Text_default, { style: { fontSize: 10, marginTop: -5 } }, "Powered by"),
|
|
3073
3074
|
/* @__PURE__ */ React17.createElement(
|
|
3074
3075
|
Image14,
|
|
3075
3076
|
{
|
|
3076
3077
|
style: {
|
|
3077
|
-
height:
|
|
3078
|
-
width:
|
|
3079
|
-
marginBottom: 5,
|
|
3078
|
+
height: 25,
|
|
3079
|
+
width: 95,
|
|
3080
|
+
// marginBottom: 5,
|
|
3080
3081
|
objectFit: "contain"
|
|
3081
3082
|
},
|
|
3082
3083
|
src: bmpLogo2
|
|
@@ -3098,8 +3099,8 @@ var A4Invoice = ({ data }) => {
|
|
|
3098
3099
|
Image14,
|
|
3099
3100
|
{
|
|
3100
3101
|
style: {
|
|
3101
|
-
height:
|
|
3102
|
-
width:
|
|
3102
|
+
height: 85,
|
|
3103
|
+
width: 85,
|
|
3103
3104
|
marginBottom: 5,
|
|
3104
3105
|
objectFit: "contain",
|
|
3105
3106
|
position: "absolute",
|
|
@@ -3230,6 +3231,16 @@ var A4Invoice = ({ data }) => {
|
|
|
3230
3231
|
},
|
|
3231
3232
|
item.devoteesName
|
|
3232
3233
|
) : null,
|
|
3234
|
+
item.pujaDate ? /* @__PURE__ */ React17.createElement(
|
|
3235
|
+
Text_default,
|
|
3236
|
+
{
|
|
3237
|
+
style: {
|
|
3238
|
+
fontSize: 9,
|
|
3239
|
+
color: "#333333"
|
|
3240
|
+
}
|
|
3241
|
+
},
|
|
3242
|
+
item.pujaDate
|
|
3243
|
+
) : null,
|
|
3233
3244
|
item.repeatEndDate && item.repeatStartDate ? /* @__PURE__ */ React17.createElement(
|
|
3234
3245
|
Text_default,
|
|
3235
3246
|
{
|
|
@@ -3581,6 +3592,58 @@ var A4Invoice = ({ data }) => {
|
|
|
3581
3592
|
};
|
|
3582
3593
|
var A4Invoice_default = A4Invoice;
|
|
3583
3594
|
|
|
3595
|
+
// src/sizes/a4/A4PostalReport.tsx
|
|
3596
|
+
import { Document as Document14, Image as Image15, Page as Page14, View as View13 } from "@react-pdf/renderer";
|
|
3597
|
+
import React18 from "react";
|
|
3598
|
+
var A4PostalReport = ({ date, templeName, data }) => {
|
|
3599
|
+
return /* @__PURE__ */ React18.createElement(Document14, null, /* @__PURE__ */ React18.createElement(Page14, { size: "A4", style: { padding: 30, fontFamily: "Noto Sans" } }, /* @__PURE__ */ React18.createElement(
|
|
3600
|
+
Image15,
|
|
3601
|
+
{
|
|
3602
|
+
fixed: true,
|
|
3603
|
+
style: {
|
|
3604
|
+
height: 15,
|
|
3605
|
+
width: 75,
|
|
3606
|
+
marginBottom: 10
|
|
3607
|
+
},
|
|
3608
|
+
src: bmpLogo
|
|
3609
|
+
}
|
|
3610
|
+
), /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 11, marginTop: 5, textAlign: "right" } }, "Date: ", date.toDateString()), /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 14, fontWeight: "bold" } }, "Prasad Delivery Postal Report"), /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 12 } }, `${templeName}`), /* @__PURE__ */ React18.createElement(
|
|
3611
|
+
View13,
|
|
3612
|
+
{
|
|
3613
|
+
style: {
|
|
3614
|
+
display: "flex",
|
|
3615
|
+
flexDirection: "row",
|
|
3616
|
+
marginTop: 20,
|
|
3617
|
+
width: "100%",
|
|
3618
|
+
gap: 20,
|
|
3619
|
+
flexWrap: "wrap"
|
|
3620
|
+
}
|
|
3621
|
+
},
|
|
3622
|
+
data && data.map((item) => {
|
|
3623
|
+
return /* @__PURE__ */ React18.createElement(
|
|
3624
|
+
View13,
|
|
3625
|
+
{
|
|
3626
|
+
key: item.id,
|
|
3627
|
+
style: {
|
|
3628
|
+
width: "46%",
|
|
3629
|
+
display: "flex",
|
|
3630
|
+
flexDirection: "column",
|
|
3631
|
+
border: "1px solid black",
|
|
3632
|
+
borderStyle: "dotted",
|
|
3633
|
+
borderWidth: 1.5,
|
|
3634
|
+
padding: 6
|
|
3635
|
+
}
|
|
3636
|
+
},
|
|
3637
|
+
/* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 10, fontWeight: "bold" } }, item.name),
|
|
3638
|
+
/* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 9 } }, item.pujaDetails),
|
|
3639
|
+
/* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 10, marginTop: 3 } }, item.phone),
|
|
3640
|
+
/* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 10 } }, item.address)
|
|
3641
|
+
);
|
|
3642
|
+
})
|
|
3643
|
+
)));
|
|
3644
|
+
};
|
|
3645
|
+
var A4PostalReport_default = A4PostalReport;
|
|
3646
|
+
|
|
3584
3647
|
// src/index.tsx
|
|
3585
3648
|
var getPrintBlob = ({
|
|
3586
3649
|
size,
|
|
@@ -3588,15 +3651,15 @@ var getPrintBlob = ({
|
|
|
3588
3651
|
dates
|
|
3589
3652
|
}) => {
|
|
3590
3653
|
if (size === "A4") {
|
|
3591
|
-
const blob = pdf(/* @__PURE__ */
|
|
3654
|
+
const blob = pdf(/* @__PURE__ */ React19.createElement(A4Print_default, { data, dates })).toBlob();
|
|
3592
3655
|
return blob;
|
|
3593
3656
|
} else {
|
|
3594
|
-
const blob = pdf(/* @__PURE__ */
|
|
3657
|
+
const blob = pdf(/* @__PURE__ */ React19.createElement(T2Inch_default, { data, dates })).toBlob();
|
|
3595
3658
|
return blob;
|
|
3596
3659
|
}
|
|
3597
3660
|
};
|
|
3598
3661
|
var getA4SummaryBlob = async () => {
|
|
3599
|
-
const blob = await pdf(/* @__PURE__ */
|
|
3662
|
+
const blob = await pdf(/* @__PURE__ */ React19.createElement(A4Print_default, { data: [], dates: ["", ""] })).toBlob();
|
|
3600
3663
|
return blob;
|
|
3601
3664
|
};
|
|
3602
3665
|
var printDevoteeReceipt2Inch = async (data) => {
|
|
@@ -3653,6 +3716,9 @@ var options = {
|
|
|
3653
3716
|
},
|
|
3654
3717
|
"invoice": {
|
|
3655
3718
|
A4: A4Invoice_default
|
|
3719
|
+
},
|
|
3720
|
+
"postal-report": {
|
|
3721
|
+
A4: A4PostalReport_default
|
|
3656
3722
|
}
|
|
3657
3723
|
};
|
|
3658
3724
|
var reportPrinter = class {
|
|
@@ -3867,7 +3933,7 @@ var reportPrinter = class {
|
|
|
3867
3933
|
}
|
|
3868
3934
|
async print(data) {
|
|
3869
3935
|
const ReportComponent = options[this.option][this.size];
|
|
3870
|
-
const document = /* @__PURE__ */
|
|
3936
|
+
const document = /* @__PURE__ */ React19.createElement(ReportComponent, { ...data });
|
|
3871
3937
|
const blob = pdf(document).toBlob();
|
|
3872
3938
|
blob.then((blob2) => {
|
|
3873
3939
|
var blobURL = URL.createObjectURL(blob2);
|
|
@@ -3882,7 +3948,7 @@ var reportPrinter = class {
|
|
|
3882
3948
|
}
|
|
3883
3949
|
async getBlob(data) {
|
|
3884
3950
|
const ReportComponent = options[this.option][this.size];
|
|
3885
|
-
const document = /* @__PURE__ */
|
|
3951
|
+
const document = /* @__PURE__ */ React19.createElement(ReportComponent, { ...data });
|
|
3886
3952
|
const blob = pdf(document).toBlob();
|
|
3887
3953
|
return blob;
|
|
3888
3954
|
}
|
package/package.json
CHANGED