@bookmypuja-tech/bmp-pdf 0.3.20 → 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 +61 -6
- 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
|
@@ -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";
|
|
@@ -3592,6 +3592,58 @@ var A4Invoice = ({ data }) => {
|
|
|
3592
3592
|
};
|
|
3593
3593
|
var A4Invoice_default = A4Invoice;
|
|
3594
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
|
+
|
|
3595
3647
|
// src/index.tsx
|
|
3596
3648
|
var getPrintBlob = ({
|
|
3597
3649
|
size,
|
|
@@ -3599,15 +3651,15 @@ var getPrintBlob = ({
|
|
|
3599
3651
|
dates
|
|
3600
3652
|
}) => {
|
|
3601
3653
|
if (size === "A4") {
|
|
3602
|
-
const blob = pdf(/* @__PURE__ */
|
|
3654
|
+
const blob = pdf(/* @__PURE__ */ React19.createElement(A4Print_default, { data, dates })).toBlob();
|
|
3603
3655
|
return blob;
|
|
3604
3656
|
} else {
|
|
3605
|
-
const blob = pdf(/* @__PURE__ */
|
|
3657
|
+
const blob = pdf(/* @__PURE__ */ React19.createElement(T2Inch_default, { data, dates })).toBlob();
|
|
3606
3658
|
return blob;
|
|
3607
3659
|
}
|
|
3608
3660
|
};
|
|
3609
3661
|
var getA4SummaryBlob = async () => {
|
|
3610
|
-
const blob = await pdf(/* @__PURE__ */
|
|
3662
|
+
const blob = await pdf(/* @__PURE__ */ React19.createElement(A4Print_default, { data: [], dates: ["", ""] })).toBlob();
|
|
3611
3663
|
return blob;
|
|
3612
3664
|
};
|
|
3613
3665
|
var printDevoteeReceipt2Inch = async (data) => {
|
|
@@ -3664,6 +3716,9 @@ var options = {
|
|
|
3664
3716
|
},
|
|
3665
3717
|
"invoice": {
|
|
3666
3718
|
A4: A4Invoice_default
|
|
3719
|
+
},
|
|
3720
|
+
"postal-report": {
|
|
3721
|
+
A4: A4PostalReport_default
|
|
3667
3722
|
}
|
|
3668
3723
|
};
|
|
3669
3724
|
var reportPrinter = class {
|
|
@@ -3878,7 +3933,7 @@ var reportPrinter = class {
|
|
|
3878
3933
|
}
|
|
3879
3934
|
async print(data) {
|
|
3880
3935
|
const ReportComponent = options[this.option][this.size];
|
|
3881
|
-
const document = /* @__PURE__ */
|
|
3936
|
+
const document = /* @__PURE__ */ React19.createElement(ReportComponent, { ...data });
|
|
3882
3937
|
const blob = pdf(document).toBlob();
|
|
3883
3938
|
blob.then((blob2) => {
|
|
3884
3939
|
var blobURL = URL.createObjectURL(blob2);
|
|
@@ -3893,7 +3948,7 @@ var reportPrinter = class {
|
|
|
3893
3948
|
}
|
|
3894
3949
|
async getBlob(data) {
|
|
3895
3950
|
const ReportComponent = options[this.option][this.size];
|
|
3896
|
-
const document = /* @__PURE__ */
|
|
3951
|
+
const document = /* @__PURE__ */ React19.createElement(ReportComponent, { ...data });
|
|
3897
3952
|
const blob = pdf(document).toBlob();
|
|
3898
3953
|
return blob;
|
|
3899
3954
|
}
|
package/package.json
CHANGED