@aibrains/pdf-renderer 0.4.0 → 0.5.0
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/core/i18n.d.ts +10 -5
- package/dist/core/i18n.d.ts.map +1 -1
- package/dist/core/i18n.js +9 -5
- package/dist/core/i18n.js.map +1 -1
- package/dist/descriptors/invoice.d.ts +19 -0
- package/dist/descriptors/invoice.d.ts.map +1 -0
- package/dist/descriptors/invoice.js +160 -0
- package/dist/descriptors/invoice.js.map +1 -0
- package/dist/documents/InvoicePdf.d.ts +74 -0
- package/dist/documents/InvoicePdf.d.ts.map +1 -0
- package/dist/documents/InvoicePdf.js +172 -0
- package/dist/documents/InvoicePdf.js.map +1 -0
- package/dist/i18n/en/invoice.json +31 -0
- package/dist/i18n/ne/invoice.json +31 -0
- package/dist/index.d.ts +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/i18n.d.ts
CHANGED
|
@@ -14,14 +14,19 @@
|
|
|
14
14
|
* Interpolation: simple `{var}` placeholders. Non-string values are coerced
|
|
15
15
|
* via String(value); undefined/null become empty string.
|
|
16
16
|
*
|
|
17
|
-
* V1
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* V1 languages: `'en'` + `'ne'`. Namespaces are added per-doc-type as their
|
|
18
|
+
* descriptors land:
|
|
19
|
+
* - `'common'` (Sprint C.0.2)
|
|
20
|
+
* - `'invoice'` (Sprint C.1.1)
|
|
21
|
+
* - future: `'receipt'` (C.1.2), `'report-card'` (C.3.1), `'admit-card'` (C.5.1)
|
|
20
22
|
*/
|
|
21
23
|
/** Supported document languages in V1. */
|
|
22
24
|
export type Lang = 'en' | 'ne';
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Supported translation namespaces in V1. New doc types append here AND
|
|
27
|
+
* add a bundle entry to BUNDLES below; the loader is otherwise additive.
|
|
28
|
+
*/
|
|
29
|
+
export type Namespace = 'common' | 'invoice';
|
|
25
30
|
/**
|
|
26
31
|
* Translate a key.
|
|
27
32
|
*
|
package/dist/core/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/core/i18n.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/core/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,0CAA0C;AAC1C,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAa7C;;;;;;;GAOG;AACH,wBAAgB,CAAC,CACf,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,IAAI,EACV,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GACxD,MAAM,CAYR;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CACnB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GACxD;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAKxC"}
|
package/dist/core/i18n.js
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
* Interpolation: simple `{var}` placeholders. Non-string values are coerced
|
|
16
16
|
* via String(value); undefined/null become empty string.
|
|
17
17
|
*
|
|
18
|
-
* V1
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* V1 languages: `'en'` + `'ne'`. Namespaces are added per-doc-type as their
|
|
19
|
+
* descriptors land:
|
|
20
|
+
* - `'common'` (Sprint C.0.2)
|
|
21
|
+
* - `'invoice'` (Sprint C.1.1)
|
|
22
|
+
* - future: `'receipt'` (C.1.2), `'report-card'` (C.3.1), `'admit-card'` (C.5.1)
|
|
21
23
|
*/
|
|
22
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -27,9 +29,11 @@ exports.t = t;
|
|
|
27
29
|
exports.tDual = tDual;
|
|
28
30
|
const common_json_1 = __importDefault(require("../i18n/en/common.json"));
|
|
29
31
|
const common_json_2 = __importDefault(require("../i18n/ne/common.json"));
|
|
32
|
+
const invoice_json_1 = __importDefault(require("../i18n/en/invoice.json"));
|
|
33
|
+
const invoice_json_2 = __importDefault(require("../i18n/ne/invoice.json"));
|
|
30
34
|
const BUNDLES = {
|
|
31
|
-
en: { common: common_json_1.default },
|
|
32
|
-
ne: { common: common_json_2.default },
|
|
35
|
+
en: { common: common_json_1.default, invoice: invoice_json_1.default },
|
|
36
|
+
ne: { common: common_json_2.default, invoice: invoice_json_2.default },
|
|
33
37
|
};
|
|
34
38
|
/** Default fallback language when target language is missing a key. */
|
|
35
39
|
const FALLBACK_LANG = 'en';
|
package/dist/core/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/core/i18n.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/core/i18n.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;AAmCH,cAiBC;AASD,sBAUC;AArED,yEAA8C;AAC9C,yEAA8C;AAC9C,2EAAgD;AAChD,2EAAgD;AAchD,MAAM,OAAO,GAA8B;IACzC,EAAE,EAAE,EAAE,MAAM,EAAE,qBAA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|
+
*
|
|
4
|
+
* The first concrete `TemplateDescriptor` registered with the library.
|
|
5
|
+
* Registers itself at module load via the top-level `registerDescriptor(...)`
|
|
6
|
+
* call below — importing this file is sufficient to make
|
|
7
|
+
* `getDescriptor('INVOICE')` work.
|
|
8
|
+
*
|
|
9
|
+
* Defaults are split between PABSON and GENERIC archetypes per the design
|
|
10
|
+
* doc §1: PABSON ⇒ BS+AD dual dates + EN+NE labels + south-asian numbers +
|
|
11
|
+
* NPR symbol; GENERIC ⇒ gregorian + EN-only + western + ISO-code currency.
|
|
12
|
+
*
|
|
13
|
+
* `configurableFields[]` is the operator-facing customization surface that
|
|
14
|
+
* the C.2.4 generic editor renders form sections from. 13 fields for V1.
|
|
15
|
+
*/
|
|
16
|
+
import { type InvoiceTemplateConfig, type InvoiceDocumentData } from '../documents/InvoicePdf';
|
|
17
|
+
import type { TemplateDescriptor } from './types';
|
|
18
|
+
export declare const invoiceDescriptor: TemplateDescriptor<InvoiceDocumentData, InvoiceTemplateConfig>;
|
|
19
|
+
//# sourceMappingURL=invoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.d.ts","sourceRoot":"","sources":["../../src/descriptors/invoice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAc,KAAK,qBAAqB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE3G,OAAO,KAAK,EAGV,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAoIjB,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,mBAAmB,EAAE,qBAAqB,CAO5F,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Invoice descriptor — Sprint C.1.1.
|
|
4
|
+
*
|
|
5
|
+
* The first concrete `TemplateDescriptor` registered with the library.
|
|
6
|
+
* Registers itself at module load via the top-level `registerDescriptor(...)`
|
|
7
|
+
* call below — importing this file is sufficient to make
|
|
8
|
+
* `getDescriptor('INVOICE')` work.
|
|
9
|
+
*
|
|
10
|
+
* Defaults are split between PABSON and GENERIC archetypes per the design
|
|
11
|
+
* doc §1: PABSON ⇒ BS+AD dual dates + EN+NE labels + south-asian numbers +
|
|
12
|
+
* NPR symbol; GENERIC ⇒ gregorian + EN-only + western + ISO-code currency.
|
|
13
|
+
*
|
|
14
|
+
* `configurableFields[]` is the operator-facing customization surface that
|
|
15
|
+
* the C.2.4 generic editor renders form sections from. 13 fields for V1.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.invoiceDescriptor = void 0;
|
|
19
|
+
const InvoicePdf_1 = require("../documents/InvoicePdf");
|
|
20
|
+
const registry_1 = require("./registry");
|
|
21
|
+
/**
|
|
22
|
+
* The default `InvoiceTemplateConfig` for a freshly-seeded template.
|
|
23
|
+
* Returns PABSON-flavor when the tenant archetype is `'PABSON'`, GENERIC
|
|
24
|
+
* for everything else. Reserved archetypes (`CBSE_IN`, `NAIS_US`,
|
|
25
|
+
* `GEMS_UAE`) fall through to GENERIC per the design doc § 1.
|
|
26
|
+
*/
|
|
27
|
+
function invoiceDefaults(archetype, _locale) {
|
|
28
|
+
const isPabson = archetype === 'PABSON';
|
|
29
|
+
return {
|
|
30
|
+
pageSize: 'A4',
|
|
31
|
+
orientation: 'portrait',
|
|
32
|
+
margins: { top: 15, right: 15, bottom: 15, left: 15 },
|
|
33
|
+
header: {
|
|
34
|
+
showLogo: true,
|
|
35
|
+
showSchoolName: true,
|
|
36
|
+
showSchoolAddress: true,
|
|
37
|
+
showContact: true,
|
|
38
|
+
tagline: isPabson ? 'Education for All' : undefined,
|
|
39
|
+
},
|
|
40
|
+
footer: {
|
|
41
|
+
text: undefined,
|
|
42
|
+
showPageNumbers: true,
|
|
43
|
+
showSignatureLine: true,
|
|
44
|
+
},
|
|
45
|
+
dateFormat: isPabson ? 'dual' : 'gregorian',
|
|
46
|
+
numberFormat: isPabson ? 'south-asian' : 'western',
|
|
47
|
+
currencyDisplay: 'iso-code',
|
|
48
|
+
labelLanguages: isPabson ? ['en', 'ne'] : ['en'],
|
|
49
|
+
lineItemColumns: {
|
|
50
|
+
description: true,
|
|
51
|
+
quantity: true,
|
|
52
|
+
amount: true,
|
|
53
|
+
discount: true,
|
|
54
|
+
taxRate: true,
|
|
55
|
+
taxAmount: true,
|
|
56
|
+
total: true,
|
|
57
|
+
},
|
|
58
|
+
totalsSection: {
|
|
59
|
+
showSubtotal: true,
|
|
60
|
+
showTaxTotal: true,
|
|
61
|
+
showDiscountTotal: true,
|
|
62
|
+
showAmountPaid: true,
|
|
63
|
+
showAmountDue: true,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sample data for the C.2.4 editor's "default mock" preview path. The shape
|
|
69
|
+
* mirrors a realistic Saraswati Q1 invoice — one tuition fee + one library fee,
|
|
70
|
+
* with a discount + VAT row to exercise every line-item column.
|
|
71
|
+
*/
|
|
72
|
+
function invoiceSampleData(archetype, _locale) {
|
|
73
|
+
const isPabson = archetype === 'PABSON';
|
|
74
|
+
return {
|
|
75
|
+
invoiceNumber: 'INV-2026-001234',
|
|
76
|
+
issuedDate: '2026-03-15',
|
|
77
|
+
dueDate: '2026-04-28',
|
|
78
|
+
academicYear: '2025-2026',
|
|
79
|
+
billingPeriod: isPabson ? 'चैत 2082' : 'Q1 2026',
|
|
80
|
+
studentName: isPabson ? 'सरस्वती शर्मा' : 'Saraswati Sharma',
|
|
81
|
+
studentId: 'STU-2025-0042',
|
|
82
|
+
gradeLevel: '8',
|
|
83
|
+
lineItems: [
|
|
84
|
+
{
|
|
85
|
+
description: isPabson ? 'ट्यूशन शुल्क — कक्षा ८' : 'Tuition Fee — Grade 8',
|
|
86
|
+
quantity: 1,
|
|
87
|
+
amount: 10000,
|
|
88
|
+
discount: 500,
|
|
89
|
+
taxRate: 13,
|
|
90
|
+
taxAmount: 1235,
|
|
91
|
+
total: 10735,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
description: isPabson ? 'पुस्तकालय शुल्क' : 'Library Fee',
|
|
95
|
+
quantity: 1,
|
|
96
|
+
amount: 500,
|
|
97
|
+
discount: 0,
|
|
98
|
+
taxRate: 0,
|
|
99
|
+
taxAmount: 0,
|
|
100
|
+
total: 500,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
subtotal: 10500,
|
|
104
|
+
taxTotal: 1235,
|
|
105
|
+
discountTotal: 500,
|
|
106
|
+
grandTotal: 11235,
|
|
107
|
+
amountPaid: 0,
|
|
108
|
+
amountDue: 11235,
|
|
109
|
+
currency: isPabson ? 'NPR' : 'USD',
|
|
110
|
+
status: 'issued',
|
|
111
|
+
notes: isPabson
|
|
112
|
+
? 'कृपया भुक्तानी मिति भित्र भुक्तानी गर्नुहोला।'
|
|
113
|
+
: 'Please pay by the due date to avoid late fees.',
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 13 configurable fields surfaced in the C.2.4 editor. Adding a field here =
|
|
118
|
+
* one more form section appears in the editor, no editor code change required.
|
|
119
|
+
*
|
|
120
|
+
* Field IDs are dot-paths into `InvoiceTemplateConfig`. Editor RHF Controllers
|
|
121
|
+
* register at exactly these paths so the form state shape matches the config
|
|
122
|
+
* shape — `Object.assign(template, formState)` is a one-line apply on save.
|
|
123
|
+
*/
|
|
124
|
+
const invoiceConfigurableFields = [
|
|
125
|
+
// Header (5 fields)
|
|
126
|
+
{ path: 'header.showLogo', type: 'toggle', labelKey: 'field.header.showLogo' },
|
|
127
|
+
{ path: 'header.showSchoolName', type: 'toggle', labelKey: 'field.header.showSchoolName' },
|
|
128
|
+
{ path: 'header.showSchoolAddress', type: 'toggle', labelKey: 'field.header.showSchoolAddress' },
|
|
129
|
+
{ path: 'header.showContact', type: 'toggle', labelKey: 'field.header.showContact' },
|
|
130
|
+
{ path: 'header.tagline', type: 'text', labelKey: 'field.header.tagline' },
|
|
131
|
+
// Line item columns (3 toggleable; description/amount/total always-on)
|
|
132
|
+
{ path: 'lineItemColumns.quantity', type: 'toggle', labelKey: 'field.lineItems.quantity' },
|
|
133
|
+
{ path: 'lineItemColumns.discount', type: 'toggle', labelKey: 'field.lineItems.discount' },
|
|
134
|
+
{ path: 'lineItemColumns.taxRate', type: 'toggle', labelKey: 'field.lineItems.taxRate' },
|
|
135
|
+
{ path: 'lineItemColumns.taxAmount', type: 'toggle', labelKey: 'field.lineItems.taxAmount' },
|
|
136
|
+
// Totals (3 toggleable)
|
|
137
|
+
{ path: 'totalsSection.showSubtotal', type: 'toggle', labelKey: 'field.totals.showSubtotal' },
|
|
138
|
+
{ path: 'totalsSection.showTaxTotal', type: 'toggle', labelKey: 'field.totals.showTaxTotal' },
|
|
139
|
+
{ path: 'totalsSection.showDiscountTotal', type: 'toggle', labelKey: 'field.totals.showDiscountTotal' },
|
|
140
|
+
// Localization (2)
|
|
141
|
+
{
|
|
142
|
+
path: 'dateFormat',
|
|
143
|
+
type: 'select',
|
|
144
|
+
labelKey: 'field.dateFormat',
|
|
145
|
+
options: ['gregorian', 'bikram_sambat', 'dual'],
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
exports.invoiceDescriptor = {
|
|
149
|
+
docType: 'INVOICE',
|
|
150
|
+
i18nNamespace: 'invoice',
|
|
151
|
+
Component: InvoicePdf_1.InvoicePdf,
|
|
152
|
+
defaults: invoiceDefaults,
|
|
153
|
+
sampleData: invoiceSampleData,
|
|
154
|
+
configurableFields: invoiceConfigurableFields,
|
|
155
|
+
};
|
|
156
|
+
// Self-register at module load. Consumers only need
|
|
157
|
+
// `import '@aibrains/pdf-renderer/descriptors/invoice'` (or transitive via
|
|
158
|
+
// the package index) for `getDescriptor('INVOICE')` to resolve.
|
|
159
|
+
(0, registry_1.registerDescriptor)(exports.invoiceDescriptor);
|
|
160
|
+
//# sourceMappingURL=invoice.js.map
|
|
@@ -0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Q,EAAE,QAAQ,EAAE,2BAA2B,EAAE;IAC7F,EAAE,IAAI,EAAE,iCAAiC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,gCAAgC,EAAE;IACvG,mBAAmB;IACnB;QACE,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,kBAAkB;QAC5B,OAAO,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,MAAM,CAAU;KACzD;CACF,CAAC;AAEW,QAAA,iBAAiB,GAAmE;IAC/F,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,uBAAU;IACrB,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,iBAAiB;IAC7B,kBAAkB,EAAE,yBAAyB;CAC9C,CAAC;AAEF,oDAAoD;AACpD,2EAA2E;AAC3E,gEAAgE;AAChE,IAAA,6BAAkB,EAAC,yBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<InvoicePdf>` — Sprint C.1.1 first document component for the renderer.
|
|
3
|
+
*
|
|
4
|
+
* Composes the C.0 primitives (Document + Page + BrandedHeader + BrandedFooter
|
|
5
|
+
* + Watermark) with the C.0 components (KeyValueTable + LineItemTable +
|
|
6
|
+
* TotalsBlock + SignatureLine). Zero new primitives — this whole document is
|
|
7
|
+
* a composition exercise.
|
|
8
|
+
*
|
|
9
|
+
* Dual-language label rendering: when `template.labelLanguages.length === 2`,
|
|
10
|
+
* each label renders STACKED VERTICALLY (primary in regular size, secondary
|
|
11
|
+
* at 80% size below). PABSON V1 default is `['en', 'ne']`. For single-language
|
|
12
|
+
* templates the secondary line is omitted entirely.
|
|
13
|
+
*
|
|
14
|
+
* Devanagari font selection is automatic via `pickFontFamily(text)` inside the
|
|
15
|
+
* primitive components — no work required by this document.
|
|
16
|
+
*/
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
import { type LineItem } from '../components/LineItemTable';
|
|
19
|
+
import type { DocumentComponentProps, PdfTemplateConfig } from '../descriptors/types';
|
|
20
|
+
/**
|
|
21
|
+
* Per-doc-type config for invoices. Extends the shared `PdfTemplateConfig`
|
|
22
|
+
* with line-item column visibility + totals-block visibility — both editor-
|
|
23
|
+
* configurable via `invoiceDescriptor.configurableFields`.
|
|
24
|
+
*/
|
|
25
|
+
export interface InvoiceTemplateConfig extends PdfTemplateConfig {
|
|
26
|
+
lineItemColumns: {
|
|
27
|
+
description: boolean;
|
|
28
|
+
quantity: boolean;
|
|
29
|
+
amount: boolean;
|
|
30
|
+
discount: boolean;
|
|
31
|
+
taxRate: boolean;
|
|
32
|
+
taxAmount: boolean;
|
|
33
|
+
total: boolean;
|
|
34
|
+
};
|
|
35
|
+
totalsSection: {
|
|
36
|
+
showSubtotal: boolean;
|
|
37
|
+
showTaxTotal: boolean;
|
|
38
|
+
showDiscountTotal: boolean;
|
|
39
|
+
showAmountPaid: boolean;
|
|
40
|
+
showAmountDue: boolean;
|
|
41
|
+
};
|
|
42
|
+
footer: PdfTemplateConfig['footer'] & {
|
|
43
|
+
showSignatureLine: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Invoice data shape the document component renders. This is the minimum
|
|
48
|
+
* surface the renderer needs — the actual @aibrains/shared-types Invoice
|
|
49
|
+
* has more fields (taxSummary, statusHistory, etc.) that the renderer
|
|
50
|
+
* ignores. Endpoint callers can pass the full Invoice; structural typing
|
|
51
|
+
* lets the extra fields through harmlessly.
|
|
52
|
+
*/
|
|
53
|
+
export interface InvoiceDocumentData {
|
|
54
|
+
invoiceNumber: string;
|
|
55
|
+
issuedDate: string;
|
|
56
|
+
dueDate: string;
|
|
57
|
+
academicYear?: string;
|
|
58
|
+
billingPeriod?: string;
|
|
59
|
+
studentName: string;
|
|
60
|
+
studentId?: string;
|
|
61
|
+
gradeLevel?: string;
|
|
62
|
+
lineItems: LineItem[];
|
|
63
|
+
subtotal: number;
|
|
64
|
+
taxTotal: number;
|
|
65
|
+
discountTotal: number;
|
|
66
|
+
grandTotal: number;
|
|
67
|
+
amountPaid: number;
|
|
68
|
+
amountDue: number;
|
|
69
|
+
currency: string;
|
|
70
|
+
status: 'draft' | 'issued' | 'partially_paid' | 'paid' | 'overdue' | 'cancelled' | 'written_off';
|
|
71
|
+
notes?: string;
|
|
72
|
+
}
|
|
73
|
+
export declare const InvoicePdf: React.FC<DocumentComponentProps<InvoiceDocumentData, InvoiceTemplateConfig>>;
|
|
74
|
+
//# sourceMappingURL=InvoicePdf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvoicePdf.d.ts","sourceRoot":"","sources":["../../src/documents/InvoicePdf.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAO3E,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,eAAe,EAAE;QACf,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,aAAa,EAAE;QACb,YAAY,EAAE,OAAO,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;QACtB,iBAAiB,EAAE,OAAO,CAAC;QAC3B,cAAc,EAAE,OAAO,CAAC;QACxB,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAAG;QACpC,iBAAiB,EAAE,OAAO,CAAC;KAC5B,CAAC;CACH;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkFD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,CAsKnG,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoicePdf = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const renderer_1 = require("@react-pdf/renderer");
|
|
6
|
+
const Document_1 = require("../primitives/Document");
|
|
7
|
+
const Page_1 = require("../primitives/Page");
|
|
8
|
+
const BrandedHeader_1 = require("../primitives/BrandedHeader");
|
|
9
|
+
const BrandedFooter_1 = require("../primitives/BrandedFooter");
|
|
10
|
+
const Watermark_1 = require("../primitives/Watermark");
|
|
11
|
+
const KeyValueTable_1 = require("../components/KeyValueTable");
|
|
12
|
+
const LineItemTable_1 = require("../components/LineItemTable");
|
|
13
|
+
const TotalsBlock_1 = require("../components/TotalsBlock");
|
|
14
|
+
const SignatureLine_1 = require("../components/SignatureLine");
|
|
15
|
+
const i18n_1 = require("../core/i18n");
|
|
16
|
+
const format_1 = require("../core/format");
|
|
17
|
+
const fonts_1 = require("../core/fonts");
|
|
18
|
+
const theme_1 = require("../core/theme");
|
|
19
|
+
const styles = renderer_1.StyleSheet.create({
|
|
20
|
+
metaBlock: {
|
|
21
|
+
marginTop: theme_1.DEFAULT_SPACING.md,
|
|
22
|
+
marginBottom: theme_1.DEFAULT_SPACING.md,
|
|
23
|
+
},
|
|
24
|
+
sectionTitle: {
|
|
25
|
+
fontSize: theme_1.DEFAULT_FONT_SIZE.md,
|
|
26
|
+
fontWeight: 700,
|
|
27
|
+
color: theme_1.DEFAULT_COLORS.text,
|
|
28
|
+
marginBottom: theme_1.DEFAULT_SPACING.xs,
|
|
29
|
+
},
|
|
30
|
+
sectionTitleSecondary: {
|
|
31
|
+
fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
|
|
32
|
+
color: theme_1.DEFAULT_COLORS.textMuted,
|
|
33
|
+
marginBottom: theme_1.DEFAULT_SPACING.sm,
|
|
34
|
+
},
|
|
35
|
+
notesBlock: {
|
|
36
|
+
marginTop: theme_1.DEFAULT_SPACING.md,
|
|
37
|
+
padding: theme_1.DEFAULT_SPACING.sm,
|
|
38
|
+
backgroundColor: '#F8F9FA',
|
|
39
|
+
borderLeftWidth: 3,
|
|
40
|
+
borderLeftColor: theme_1.DEFAULT_COLORS.border,
|
|
41
|
+
},
|
|
42
|
+
notesLabel: {
|
|
43
|
+
fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
|
|
44
|
+
fontWeight: 700,
|
|
45
|
+
color: theme_1.DEFAULT_COLORS.text,
|
|
46
|
+
marginBottom: theme_1.DEFAULT_SPACING.xs,
|
|
47
|
+
},
|
|
48
|
+
notesText: {
|
|
49
|
+
fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
|
|
50
|
+
color: theme_1.DEFAULT_COLORS.text,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Build a one-line label per the template's labelLanguages. Returns the
|
|
55
|
+
* primary translation; the caller renders the secondary (if present)
|
|
56
|
+
* separately via `buildSecondary`.
|
|
57
|
+
*/
|
|
58
|
+
function buildPrimary(key, langs) {
|
|
59
|
+
return (0, i18n_1.t)('invoice', key, langs[0]);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns the secondary-language label when the template is dual-language,
|
|
63
|
+
* else undefined. The caller renders it stacked below the primary at 80%
|
|
64
|
+
* size with the same family.
|
|
65
|
+
*/
|
|
66
|
+
function buildSecondary(key, langs) {
|
|
67
|
+
return langs.length >= 2 ? (0, i18n_1.t)('invoice', key, langs[1]) : undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Dual-language label for free-form labels (not for the table headers which
|
|
71
|
+
* use a single string and are themselves bilingual via Devanagari font run).
|
|
72
|
+
*/
|
|
73
|
+
const dualLabelStyles = renderer_1.StyleSheet.create({
|
|
74
|
+
primary: {
|
|
75
|
+
fontSize: theme_1.DEFAULT_FONT_SIZE.sm,
|
|
76
|
+
color: theme_1.DEFAULT_COLORS.text,
|
|
77
|
+
},
|
|
78
|
+
secondary: {
|
|
79
|
+
fontSize: theme_1.DEFAULT_FONT_SIZE.sm * 0.8,
|
|
80
|
+
color: theme_1.DEFAULT_COLORS.textMuted,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
/** Stacked dual-language label primitive (small enough to inline here). */
|
|
84
|
+
const DualLabel = ({ primary, secondary }) => ((0, jsx_runtime_1.jsxs)(renderer_1.View, { children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [dualLabelStyles.primary, { fontFamily: (0, fonts_1.pickFontFamily)(primary) }], children: primary }), secondary && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [dualLabelStyles.secondary, { fontFamily: (0, fonts_1.pickFontFamily)(secondary) }], children: secondary }))] }));
|
|
85
|
+
const InvoicePdf = ({ data, template, branding, settings, }) => {
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
87
|
+
const langs = template.labelLanguages;
|
|
88
|
+
const isDualLang = langs.length >= 2;
|
|
89
|
+
// Number + currency formatters bound once per render
|
|
90
|
+
const numberGrouping = template.numberFormat === 'auto-from-workspace'
|
|
91
|
+
? 'western'
|
|
92
|
+
: template.numberFormat;
|
|
93
|
+
const renderNumber = (v) => (0, format_1.formatNumber)(v !== null && v !== void 0 ? v : 0, numberGrouping);
|
|
94
|
+
// Currency display: shared-types `formatCurrency` exposes `showSymbol` only;
|
|
95
|
+
// map V1 `'symbol'` → showSymbol:true and `'iso-code'`/`'name'` → false (the
|
|
96
|
+
// ISO code prefix is added by the shared-types implementation as the
|
|
97
|
+
// fallback shape). When showSymbol is true the symbol/native symbol is used.
|
|
98
|
+
const renderCurrency = (v) => (0, format_1.formatCurrency)(v, data.currency, {
|
|
99
|
+
locale: settings.defaultLocale,
|
|
100
|
+
showSymbol: template.currencyDisplay === 'symbol',
|
|
101
|
+
});
|
|
102
|
+
// Header label resolution — uses BrandedHeader's own config shape
|
|
103
|
+
const headerConfig = {
|
|
104
|
+
showLogo: template.header.showLogo,
|
|
105
|
+
showSchoolName: template.header.showSchoolName,
|
|
106
|
+
showSchoolAddress: template.header.showSchoolAddress,
|
|
107
|
+
showContact: template.header.showContact,
|
|
108
|
+
tagline: template.header.tagline,
|
|
109
|
+
primaryColor: (_a = template.brandingOverrides) === null || _a === void 0 ? void 0 : _a.primaryColor,
|
|
110
|
+
};
|
|
111
|
+
const headerBranding = {
|
|
112
|
+
logoSrc: (_c = (_b = template.brandingOverrides) === null || _b === void 0 ? void 0 : _b.logoSrc) !== null && _c !== void 0 ? _c : branding.logoSrc,
|
|
113
|
+
schoolName: branding.schoolName,
|
|
114
|
+
addressLines: (_e = (_d = template.brandingOverrides) === null || _d === void 0 ? void 0 : _d.addressLines) !== null && _e !== void 0 ? _e : branding.addressLines,
|
|
115
|
+
phone: branding.phone,
|
|
116
|
+
email: branding.email,
|
|
117
|
+
};
|
|
118
|
+
// Watermark on draft / cancelled invoices
|
|
119
|
+
const watermarkLabel = data.status === 'draft'
|
|
120
|
+
? (0, i18n_1.t)('invoice', 'watermarkDraft', langs[0])
|
|
121
|
+
: data.status === 'cancelled'
|
|
122
|
+
? (0, i18n_1.t)('invoice', 'watermarkCancelled', langs[0])
|
|
123
|
+
: undefined;
|
|
124
|
+
// KeyValueTable expects pre-formatted strings; build them with dual-lang
|
|
125
|
+
// labels rendered ABOVE each value would require a custom row primitive,
|
|
126
|
+
// so V1 uses primary-language labels in the metadata table and emits
|
|
127
|
+
// a small bilingual title above it. Acceptable trade-off; the table
|
|
128
|
+
// itself stays in C.0's existing API.
|
|
129
|
+
const metadataEntries = [
|
|
130
|
+
{ label: buildPrimary('invoiceNumber', langs), value: data.invoiceNumber },
|
|
131
|
+
{ label: buildPrimary('issuedDate', langs), value: (0, format_1.formatDate)(data.issuedDate, template.dateFormat) },
|
|
132
|
+
{ label: buildPrimary('dueDate', langs), value: (0, format_1.formatDate)(data.dueDate, template.dateFormat) },
|
|
133
|
+
{ label: buildPrimary('studentName', langs), value: data.studentName },
|
|
134
|
+
{ label: buildPrimary('gradeLevel', langs), value: data.gradeLevel },
|
|
135
|
+
{ label: buildPrimary('academicYear', langs), value: data.academicYear },
|
|
136
|
+
{ label: buildPrimary('billingPeriod', langs), value: data.billingPeriod },
|
|
137
|
+
];
|
|
138
|
+
return ((0, jsx_runtime_1.jsx)(Document_1.Document, { title: `Invoice ${data.invoiceNumber}`, subject: "Invoice", children: (0, jsx_runtime_1.jsxs)(Page_1.Page, { size: template.pageSize, orientation: template.orientation, margins: template.margins, children: [watermarkLabel && (0, jsx_runtime_1.jsx)(Watermark_1.Watermark, { text: watermarkLabel }), (0, jsx_runtime_1.jsx)(BrandedHeader_1.BrandedHeader, { branding: headerBranding, config: headerConfig }), (0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.metaBlock, children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.sectionTitle, { fontFamily: (0, fonts_1.pickFontFamily)(buildPrimary('title', langs)) }], children: buildPrimary('title', langs) }), isDualLang && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [
|
|
139
|
+
styles.sectionTitleSecondary,
|
|
140
|
+
{ fontFamily: (0, fonts_1.pickFontFamily)((_f = buildSecondary('title', langs)) !== null && _f !== void 0 ? _f : '') },
|
|
141
|
+
], children: buildSecondary('title', langs) })), (0, jsx_runtime_1.jsx)(KeyValueTable_1.KeyValueTable, { entries: metadataEntries })] }), (0, jsx_runtime_1.jsx)(LineItemTable_1.LineItemTable, { items: data.lineItems, columns: template.lineItemColumns, headers: {
|
|
142
|
+
description: buildPrimary('description', langs),
|
|
143
|
+
quantity: buildPrimary('quantity', langs),
|
|
144
|
+
amount: buildPrimary('amount', langs),
|
|
145
|
+
discount: buildPrimary('discount', langs),
|
|
146
|
+
taxRate: buildPrimary('taxRate', langs),
|
|
147
|
+
taxAmount: buildPrimary('taxAmount', langs),
|
|
148
|
+
total: buildPrimary('total', langs),
|
|
149
|
+
}, renderNumber: renderNumber }), (0, jsx_runtime_1.jsx)(TotalsBlock_1.TotalsBlock, { entries: {
|
|
150
|
+
subtotal: data.subtotal,
|
|
151
|
+
taxTotal: data.taxTotal,
|
|
152
|
+
discountTotal: data.discountTotal,
|
|
153
|
+
grandTotal: data.grandTotal,
|
|
154
|
+
amountPaid: data.amountPaid,
|
|
155
|
+
amountDue: data.amountDue,
|
|
156
|
+
}, visibility: {
|
|
157
|
+
showSubtotal: template.totalsSection.showSubtotal,
|
|
158
|
+
showTaxTotal: template.totalsSection.showTaxTotal,
|
|
159
|
+
showDiscountTotal: template.totalsSection.showDiscountTotal,
|
|
160
|
+
showAmountPaid: template.totalsSection.showAmountPaid,
|
|
161
|
+
showAmountDue: template.totalsSection.showAmountDue,
|
|
162
|
+
}, labels: {
|
|
163
|
+
subtotal: buildPrimary('subtotal', langs),
|
|
164
|
+
taxTotal: buildPrimary('totalTax', langs),
|
|
165
|
+
discountTotal: buildPrimary('totalDiscount', langs),
|
|
166
|
+
grandTotal: buildPrimary('grandTotal', langs),
|
|
167
|
+
amountPaid: buildPrimary('amountPaid', langs),
|
|
168
|
+
amountDue: buildPrimary('amountDue', langs),
|
|
169
|
+
}, renderCurrency: renderCurrency }), data.notes && ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.notesBlock, children: [(0, jsx_runtime_1.jsx)(DualLabel, { primary: buildPrimary('notes', langs), secondary: buildSecondary('notes', langs) }), (0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.notesText, { fontFamily: (0, fonts_1.pickFontFamily)(data.notes) }], children: data.notes.length > 500 ? `${data.notes.slice(0, 500)}…` : data.notes })] })), template.footer.showSignatureLine && ((0, jsx_runtime_1.jsx)(SignatureLine_1.SignatureLine, { caption: (_h = (_g = branding.formalName) !== null && _g !== void 0 ? _g : branding.schoolName) !== null && _h !== void 0 ? _h : '', signatureSrc: branding.principalSignatureSrc, align: "right" })), (0, jsx_runtime_1.jsx)(BrandedFooter_1.BrandedFooter, { text: template.footer.text, showPageNumbers: template.footer.showPageNumbers, lang: langs[0] })] }) }));
|
|
170
|
+
};
|
|
171
|
+
exports.InvoicePdf = InvoicePdf;
|
|
172
|
+
//# sourceMappingURL=InvoicePdf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvoicePdf.js","sourceRoot":"","sources":["../../src/documents/InvoicePdf.tsx"],"names":[],"mappings":";;;;AAkBA,kDAA6D;AAC7D,qDAAkD;AAClD,6CAA0C;AAC1C,+DAA4D;AAC5D,+DAA4D;AAC5D,uDAAoD;AACpD,+DAAgF;AAChF,+DAA2E;A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AU,aAC5B,uBAAC,SAAS,IACR,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EACrC,SAAS,EAAE,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,GACzC,EACF,uBAAC,eAAI,IACH,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,UAAU,EAAE,IAAA,sBAAc,EAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAEpE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GACjE,IACF,CACR,EAEA,QAAQ,CAAC,MAAM,CAAC,iBAAiB,IAAI,CACpC,uBAAC,6BAAa,IACZ,OAAO,EAAE,MAAA,MAAA,QAAQ,CAAC,UAAU,mCAAI,QAAQ,CAAC,UAAU,mCAAI,EAAE,EACzD,YAAY,EAAE,QAAQ,CAAC,qBAAqB,EAC5C,KAAK,EAAC,OAAO,GACb,CACH,EAED,uBAAC,6BAAa,IACZ,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAC1B,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAChD,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,IACG,GACE,CACZ,CAAC;AACJ,CAAC,CAAC;AAtKW,QAAA,UAAU,cAsKrB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Invoice",
|
|
3
|
+
"invoiceNumber": "Invoice No.",
|
|
4
|
+
"issuedDate": "Issued",
|
|
5
|
+
"dueDate": "Due",
|
|
6
|
+
"academicYear": "Academic Year",
|
|
7
|
+
"billingPeriod": "Billing Period",
|
|
8
|
+
"billedTo": "Billed to",
|
|
9
|
+
"studentName": "Student",
|
|
10
|
+
"studentId": "Student ID",
|
|
11
|
+
"gradeLevel": "Grade",
|
|
12
|
+
"lineItems": "Line items",
|
|
13
|
+
"description": "Description",
|
|
14
|
+
"quantity": "Qty",
|
|
15
|
+
"amount": "Amount",
|
|
16
|
+
"discount": "Discount",
|
|
17
|
+
"taxRate": "Tax %",
|
|
18
|
+
"taxAmount": "Tax",
|
|
19
|
+
"total": "Total",
|
|
20
|
+
"subtotal": "Subtotal",
|
|
21
|
+
"totalTax": "Total tax",
|
|
22
|
+
"totalDiscount": "Total discount",
|
|
23
|
+
"grandTotal": "Grand total",
|
|
24
|
+
"amountPaid": "Paid",
|
|
25
|
+
"amountDue": "Due",
|
|
26
|
+
"status": "Status",
|
|
27
|
+
"notes": "Notes",
|
|
28
|
+
"footerThankYou": "Thank you for your payment.",
|
|
29
|
+
"watermarkDraft": "DRAFT",
|
|
30
|
+
"watermarkCancelled": "CANCELLED"
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "बिल",
|
|
3
|
+
"invoiceNumber": "बिल नं.",
|
|
4
|
+
"issuedDate": "जारी मिति",
|
|
5
|
+
"dueDate": "भुक्तानी मिति",
|
|
6
|
+
"academicYear": "शैक्षिक वर्ष",
|
|
7
|
+
"billingPeriod": "बिलिंग अवधि",
|
|
8
|
+
"billedTo": "बिल प्राप्तकर्ता",
|
|
9
|
+
"studentName": "विद्यार्थीको नाम",
|
|
10
|
+
"studentId": "विद्यार्थी आईडी",
|
|
11
|
+
"gradeLevel": "कक्षा",
|
|
12
|
+
"lineItems": "विवरण",
|
|
13
|
+
"description": "विवरण",
|
|
14
|
+
"quantity": "संख्या",
|
|
15
|
+
"amount": "रकम",
|
|
16
|
+
"discount": "छुट",
|
|
17
|
+
"taxRate": "कर %",
|
|
18
|
+
"taxAmount": "कर",
|
|
19
|
+
"total": "जम्मा",
|
|
20
|
+
"subtotal": "उप-योग",
|
|
21
|
+
"totalTax": "जम्मा कर",
|
|
22
|
+
"totalDiscount": "जम्मा छुट",
|
|
23
|
+
"grandTotal": "जम्मा रकम",
|
|
24
|
+
"amountPaid": "भुक्तानी",
|
|
25
|
+
"amountDue": "बाँकी",
|
|
26
|
+
"status": "स्थिति",
|
|
27
|
+
"notes": "टिप्पणी",
|
|
28
|
+
"footerThankYou": "तपाईंको भुक्तानीको लागि धन्यवाद।",
|
|
29
|
+
"watermarkDraft": "मस्यौदा",
|
|
30
|
+
"watermarkCancelled": "रद्द"
|
|
31
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,19 +4,23 @@
|
|
|
4
4
|
* Sprint C.0.2 ships core utilities (theme tokens, i18n helper, date/currency
|
|
5
5
|
* /number format helpers). Bikram Sambat support comes via `@aibrains/shared-types`.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* - C.0.
|
|
9
|
-
*
|
|
10
|
-
* + reusable components (KeyValueTable, LineItemTable, TotalsBlock,
|
|
11
|
-
* SignatureLine) + Devanagari snapshot tests
|
|
7
|
+
* Shipped:
|
|
8
|
+
* - C.0.2: core utilities (fonts + theme + i18n + format)
|
|
9
|
+
* - C.0.3: layout primitives + reusable components + Devanagari R45 canary
|
|
12
10
|
* - C.0.4: TemplateDescriptor<T> generic + per-docType registry
|
|
13
|
-
*
|
|
11
|
+
* - C.1.1: <InvoicePdf> document + invoice descriptor + invoice i18n
|
|
12
|
+
*
|
|
13
|
+
* Sprint C.1.2+: <ReceiptPdf>, <ReportCardPdf>, …
|
|
14
14
|
*
|
|
15
15
|
* Design source of truth: docs/pilot-greenlight/c-epic-pdf-generation-design.md
|
|
16
16
|
*/
|
|
17
|
-
export declare const PDF_RENDERER_PACKAGE_VERSION = "0.
|
|
17
|
+
export declare const PDF_RENDERER_PACKAGE_VERSION = "0.5.0";
|
|
18
18
|
export * from './core';
|
|
19
19
|
export * from './primitives';
|
|
20
20
|
export * from './components';
|
|
21
21
|
export * from './descriptors';
|
|
22
|
+
import './descriptors/invoice';
|
|
23
|
+
export { InvoicePdf } from './documents/InvoicePdf';
|
|
24
|
+
export type { InvoiceTemplateConfig, InvoiceDocumentData } from './documents/InvoicePdf';
|
|
25
|
+
export { invoiceDescriptor } from './descriptors/invoice';
|
|
22
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,4BAA4B,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,4BAA4B,UAAU,CAAC;AAGpD,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAM9B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* Sprint C.0.2 ships core utilities (theme tokens, i18n helper, date/currency
|
|
6
6
|
* /number format helpers). Bikram Sambat support comes via `@aibrains/shared-types`.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* - C.0.
|
|
10
|
-
*
|
|
11
|
-
* + reusable components (KeyValueTable, LineItemTable, TotalsBlock,
|
|
12
|
-
* SignatureLine) + Devanagari snapshot tests
|
|
8
|
+
* Shipped:
|
|
9
|
+
* - C.0.2: core utilities (fonts + theme + i18n + format)
|
|
10
|
+
* - C.0.3: layout primitives + reusable components + Devanagari R45 canary
|
|
13
11
|
* - C.0.4: TemplateDescriptor<T> generic + per-docType registry
|
|
14
|
-
*
|
|
12
|
+
* - C.1.1: <InvoicePdf> document + invoice descriptor + invoice i18n
|
|
13
|
+
*
|
|
14
|
+
* Sprint C.1.2+: <ReceiptPdf>, <ReportCardPdf>, …
|
|
15
15
|
*
|
|
16
16
|
* Design source of truth: docs/pilot-greenlight/c-epic-pdf-generation-design.md
|
|
17
17
|
*/
|
|
@@ -30,12 +30,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
30
30
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.PDF_RENDERER_PACKAGE_VERSION = void 0;
|
|
34
|
-
exports.PDF_RENDERER_PACKAGE_VERSION = '0.
|
|
35
|
-
//
|
|
36
|
-
// + C.0.4 descriptor registry.
|
|
33
|
+
exports.invoiceDescriptor = exports.InvoicePdf = exports.PDF_RENDERER_PACKAGE_VERSION = void 0;
|
|
34
|
+
exports.PDF_RENDERER_PACKAGE_VERSION = '0.5.0';
|
|
35
|
+
// Core + primitives + components + descriptor registry from Sprint C.0.
|
|
37
36
|
__exportStar(require("./core"), exports);
|
|
38
37
|
__exportStar(require("./primitives"), exports);
|
|
39
38
|
__exportStar(require("./components"), exports);
|
|
40
39
|
__exportStar(require("./descriptors"), exports);
|
|
40
|
+
// C.1.1 — first concrete document. Importing this module's descriptor file
|
|
41
|
+
// has the side-effect of self-registering it with the registry. Consumers
|
|
42
|
+
// that only `import '@aibrains/pdf-renderer'` (the package root) get
|
|
43
|
+
// `getDescriptor('INVOICE')` working transitively.
|
|
44
|
+
require("./descriptors/invoice");
|
|
45
|
+
var InvoicePdf_1 = require("./documents/InvoicePdf");
|
|
46
|
+
Object.defineProperty(exports, "InvoicePdf", { enumerable: true, get: function () { return InvoicePdf_1.InvoicePdf; } });
|
|
47
|
+
var invoice_1 = require("./descriptors/invoice");
|
|
48
|
+
Object.defineProperty(exports, "invoiceDescriptor", { enumerable: true, get: function () { return invoice_1.invoiceDescriptor; } });
|
|
41
49
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;AAEU,QAAA,4BAA4B,GAAG,OAAO,CAAC;AAEpD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;AAEU,QAAA,4BAA4B,GAAG,OAAO,CAAC;AAEpD,wEAAwE;AACxE,yCAAuB;AACvB,+CAA6B;AAC7B,+CAA6B;AAC7B,gDAA8B;AAE9B,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,mDAAmD;AACnD,iCAA+B;AAC/B,qDAAoD;AAA3C,wGAAA,UAAU,OAAA;AAEnB,iDAA0D;AAAjD,4GAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibrains/pdf-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "EdForge PDF rendering library. JSX-based document templates built on @react-pdf/renderer, with localization (EN + NE), Bikram Sambat date support, and a TemplateDescriptor registry for cross-domain doc types (invoice, receipt, report card, admit card, etc.).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|