@nxgt/material 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/{_Uint8Array-BlYETJ93.js → _Uint8Array-BDK6FjpM.js} +20 -20
- package/dist/{abnfDiagram-O67JEVCF-UBHbDvRt.js → abnfDiagram-O67JEVCF-C7NxOWqd.js} +8 -8
- package/dist/architecture-7GRP2DOG-CMg7-eYj.js +3 -0
- package/dist/{architectureDiagram-NJMV4G6O-YUaZEFrZ.js → architectureDiagram-NJMV4G6O-BIvwyzEh.js} +12 -12
- package/dist/{blockDiagram-BEXU5L5S-LYb2ZWFy.js → blockDiagram-BEXU5L5S-C8q-lXgt.js} +18 -18
- package/dist/{c4Diagram-YGBWAQC7-C-2N38iN.js → c4Diagram-YGBWAQC7-WgqlRIL5.js} +10 -10
- package/dist/channel-Ba8pEAWx.js +5 -0
- package/dist/{chunk-2Q5K7J3B-kzxEEeTu.js → chunk-2Q5K7J3B-C1pX24ft.js} +2 -2
- package/dist/{chunk-3FUC2YCW-uD4dp-_M.js → chunk-3FUC2YCW-BGpNbruY.js} +11 -11
- package/dist/{chunk-5DYCD2WN-B2Jnu3zk.js → chunk-5DYCD2WN-Bqi3iL5i.js} +5 -5
- package/dist/{chunk-5VM5RSS4-Cr17nBXp.js → chunk-5VM5RSS4-BFskf6Qk.js} +2 -2
- package/dist/{chunk-6AEJRKK7-C9kihZu8.js → chunk-6AEJRKK7-DDXoGWDs.js} +4 -4
- package/dist/{chunk-742MDFTN-C8SK_MEU.js → chunk-742MDFTN-nG_ROTnT.js} +14 -14
- package/dist/{chunk-7INBJB4K-CyUOVm3_.js → chunk-7INBJB4K-Dg64CbhT.js} +10 -10
- package/dist/{chunk-7M6MHVWA-stRISv0F.js → chunk-7M6MHVWA-_-i4Sb1c.js} +14 -14
- package/dist/{chunk-7PRAP22T-DSh07ASj.js → chunk-7PRAP22T-DIiYRAce.js} +3 -3
- package/dist/{chunk-DUW6YSOI-BdOla2G8.js → chunk-DUW6YSOI-9R-v-IIp.js} +2 -2
- package/dist/{chunk-FOHPRMQF-Crq0JMf2.js → chunk-FOHPRMQF-DBc3Omt0.js} +1 -1
- package/dist/{chunk-GNY47TPC-CNRH-hmN.js → chunk-GNY47TPC-BJperC1X.js} +14 -14
- package/dist/{chunk-GTNCS2PH-Dd-9mUKz.js → chunk-GTNCS2PH-CzDYTYNy.js} +5 -5
- package/dist/{chunk-GWA4HPMP-LeZ8CTY7.js → chunk-GWA4HPMP-CmsxMX3A.js} +5 -5
- package/dist/{chunk-J5ZVWO5B-CYzz6Pq8.js → chunk-J5ZVWO5B-DmRRmhon.js} +2 -2
- package/dist/{chunk-JWPE2WC7-Ccb0QaC8.js → chunk-JWPE2WC7-BGVSGRTC.js} +2 -2
- package/dist/{chunk-LNGE3PJU-CiGrDO_F.js → chunk-LNGE3PJU-DJjGTS7O.js} +2 -2
- package/dist/{chunk-MBY4JIJT-efJLM0ZL.js → chunk-MBY4JIJT-IA2XBafa.js} +8 -8
- package/dist/{chunk-NETBCI7D-Dh3LtOKr.js → chunk-NETBCI7D-D0kbMnm0.js} +3 -3
- package/dist/{chunk-O7XYJQB3-CocGKgmL.js → chunk-O7XYJQB3-C87zK8E5.js} +5 -5
- package/dist/{chunk-UA2S7LBM-C81eiQ4_.js → chunk-UA2S7LBM-B0LGFGu3.js} +10 -10
- package/dist/{chunk-WEXAMYUT-Dt2jrFYj.js → chunk-WEXAMYUT-C-QP0DFq.js} +4 -4
- package/dist/{chunk-XXDRQBXY-mQqOBHO_.js → chunk-XXDRQBXY-Bq4sFnO2.js} +3 -3
- package/dist/{chunk-Y2CYZVJY-i11wjrBe.js → chunk-Y2CYZVJY-BAad7w_K.js} +1 -1
- package/dist/{chunk-Z7XXMR3K-D00WQ1MY.js → chunk-Z7XXMR3K-CJmPL4k9.js} +12 -12
- package/dist/{chunk-ZIGJFQKS-Dqo-x9kg.js → chunk-ZIGJFQKS-HDJ6e6OJ.js} +29 -29
- package/dist/{classDiagram-v2-NBCMYWYE-C4ucYlr1.js → classDiagram-v2-NBCMYWYE-DRoCWiaP.js} +18 -18
- package/dist/{client-only.utils-ojMUdy5B.js → client-only.utils-qMX_CMiw.js} +25 -25
- package/dist/{components-DqMrnRRo.js → components-CRrswCsD.js} +33211 -26822
- package/dist/components.js +6 -7
- package/dist/{cose-bilkent-JH36ORCC-BgR2hiLh.js → cose-bilkent-JH36ORCC-11-T1rfk.js} +5 -5
- package/dist/cynefin-OW5HDTMX-BGe4AjUw.js +3 -0
- package/dist/{cynefinDiagram-VND7K2PF-wsthSZGu.js → cynefinDiagram-VND7K2PF-1kHi2rGa.js} +8 -8
- package/dist/{cytoscape.esm-_jXi1N4y.js → cytoscape.esm-DXVRLXF3.js} +1 -1
- package/dist/{dagre-6A5THRUB-D9hh4vCU.js → dagre-6A5THRUB-B11jdkPL.js} +104 -104
- package/dist/{diagram-22UHCM2B-Bu26TJjA.js → diagram-22UHCM2B-CAVrn_uY.js} +20 -20
- package/dist/diagram-3UASUU5V-uO9-gtWR.js +525 -0
- package/dist/{diagram-ATOU4E4O-DNtxHPVW.js → diagram-ATOU4E4O-Clju_0RY.js} +8 -8
- package/dist/{diagram-CDSNMT55-BrwCxgMX.js → diagram-CDSNMT55-w7kkJ6MU.js} +10 -10
- package/dist/{diagram-MLGK6HIB-Bk26pSvC.js → diagram-MLGK6HIB-mUOtRVmm.js} +8 -8
- package/dist/{diagram-MPIPVDR6-Bl3F8b-U.js → diagram-MPIPVDR6-DEUw58dq.js} +8 -8
- package/dist/{dist-C-0DUGrt.js → dist-CeHNxLJG.js} +30 -30
- package/dist/{dist-CZn89tDX.js → dist-gYpAi-su.js} +2 -2
- package/dist/dnd.js +1 -1
- package/dist/{ebnfDiagram-ZINNZB2B-C7vCu85A.js → ebnfDiagram-ZINNZB2B-BYfatie5.js} +8 -8
- package/dist/{elk-276RUBZZ-ChJLevem.js → elk-276RUBZZ-BALenDhN.js} +16 -16
- package/dist/{erDiagram-OPXOYQCR-DLzDCh2a.js → erDiagram-OPXOYQCR-FtFHGu-P.js} +17 -17
- package/dist/eventmodeling-NTZA5JFV-38h1xeNf.js +3 -0
- package/dist/{field-blur-CtjbtCDw.js → field-blur-DkydMwaN.js} +614 -643
- package/dist/flowDiagram-KWPJA3E3-DZwUgKQu.js +17 -0
- package/dist/{ganttDiagram-FUAMR5RP-35sd5PoK.js → ganttDiagram-FUAMR5RP-CmMpH0CG.js} +436 -1117
- package/dist/gitGraph-4MIJSDKK-C-5NH3Jx.js +3 -0
- package/dist/{gitGraphDiagram-X574FWY7-Z7zhlcB8.js → gitGraphDiagram-X574FWY7-DcGaPSwy.js} +8 -8
- package/dist/{graphlib-DlxAzBTD.js → graphlib-DovxbouT.js} +43 -43
- package/dist/hooks.js +15 -15
- package/dist/i18n.js +4 -4
- package/dist/{icon-button-38As1vrs.js → icon-button-Dl9PDYCE.js} +15 -15
- package/dist/info-A6RAGUB7-DTwpNebQ.js +3 -0
- package/dist/{infoDiagram-VRGFBTTK-BwoHwPPX.js → infoDiagram-VRGFBTTK-Cvj167dl.js} +6 -6
- package/dist/{init-Buj1GKRa.js → init-B-aM8wRX.js} +1 -1
- package/dist/{isArrayLikeObject-DsRXN32g.js → isArrayLikeObject-D0u9Q9Yg.js} +11 -11
- package/dist/{ishikawaDiagram-OU5B5YK6-C-aWtSta.js → ishikawaDiagram-OU5B5YK6-ChBwjCfr.js} +7 -7
- package/dist/{journeyDiagram-ZHPQQLJL-vXvTzJwE.js → journeyDiagram-ZHPQQLJL-DVxTOFQu.js} +7 -7
- package/dist/{kanban-definition-PNTS6WVX-Co0CvKcV.js → kanban-definition-PNTS6WVX-BRoa-Yp5.js} +14 -14
- package/dist/{katex-BMQ6LGsM.js → katex-BLTzjTha.js} +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/index.d.ts +3 -3
- package/dist/lib/components/ui/media/pdf-viewer/pdf-page-list.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/pdf-reader-body.d.ts +2 -2
- package/dist/lib/components/ui/media/pdf-viewer/pdf-reader.reducer.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/pdf-sidebar.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/pdf-thumbnail-sidebar.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/types.d.ts +3 -3
- package/dist/lib/components/ui/media/pdf-viewer/use-pdf-document-search.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/use-pdf-file-actions.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/use-pdf-page-area.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/use-pdf-reader.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/use-pdf-search-hits.d.ts +1 -2
- package/dist/lib/components/ui/media/pdf-viewer/use-pdf-source.d.ts +1 -1
- package/dist/lib/hooks/use-formatters.d.ts +1 -1
- package/dist/lib/lib/index.d.ts +1 -1
- package/dist/lib/print/components/print-data-table/print-data-table.d.ts +1 -1
- package/dist/lib/print/components/print-data-table/print-key-value.d.ts +2 -2
- package/dist/lib/print/components/print-data-table/print-metric.d.ts +2 -2
- package/dist/lib/print/components/print-document/print-document.d.ts +1 -1
- package/dist/lib/print/components/print-document/print-render-context.d.ts +1 -1
- package/dist/lib/print/components/print-header.d.ts +1 -1
- package/dist/lib/print/index.d.ts +4 -4
- package/dist/lib/print/output/index.d.ts +2 -2
- package/dist/lib/print/output/pdf-response.d.ts +1 -1
- package/dist/lib/print/output/types.d.ts +3 -3
- package/dist/lib/print/output/use-pdf-file.d.ts +1 -1
- package/dist/lib/vite/index.d.ts +5 -64
- package/dist/{lib-uF8iIfvP.js → lib-B_cBmfz5.js} +70 -69
- package/dist/lib.js +5 -6
- package/dist/main.js +17 -19
- package/dist/map.js +4 -4
- package/dist/{math-C5EhTgJw.js → math-D0ky-xWd.js} +1 -1
- package/dist/{merge-Z2oE4ahJ.js → merge-DQLOWMVN.js} +24 -24
- package/dist/{mermaid-parser.core-Cz-MfB4Z.js → mermaid-parser.core-BXD_TD1T.js} +32 -32
- package/dist/{mermaid.core-6Yzht5pQ.js → mermaid.core-CQ6lUhgC.js} +59 -59
- package/dist/{mindmap-definition-NLK3R4M7-AxpMaPtm.js → mindmap-definition-NLK3R4M7-DyB5NgHM.js} +18 -18
- package/dist/{number.utils-CRFiOD5c.js → number.utils-BiBN2hWJ.js} +48 -48
- package/dist/{ordinal-DuP05kVQ.js → ordinal-DwxdXP1t.js} +3 -3
- package/dist/packet-AYTQ26CC-Cc2sGaDY.js +3 -0
- package/dist/{path-Cjou0lUh.js → path-Cxq8zobN.js} +3 -3
- package/dist/{pdf.worker.min-DRpqlnXj.js → pdf.worker.min-ByGJNiUH.js} +1 -1
- package/dist/{pegDiagram-GJSIUBJH-DjilqSgv.js → pegDiagram-GJSIUBJH-Dcm3LCQX.js} +8 -8
- package/dist/pie-WAS4IAKB-Qm7ZL20Y.js +3 -0
- package/dist/{pieDiagram-5QR66LMP-H8rVCHkC.js → pieDiagram-5QR66LMP-DCdDWF2H.js} +16 -16
- package/dist/print.js +164 -1113
- package/dist/{quadrantDiagram-O4NWA36T-CEDIjm-K.js → quadrantDiagram-O4NWA36T-BMfcGUfy.js} +5 -5
- package/dist/radar-RG4KPBEZ-TQ0zaqCR.js +3 -0
- package/dist/railroad-74A4TZTK-bk-BYNub.js +3 -0
- package/dist/railroad-abnf-HS5TGJTU-Bdw25bd-.js +3 -0
- package/dist/railroad-ebnf-LZEXJU2U-DiFjNUyt.js +3 -0
- package/dist/railroad-peg-WCYAUIDC-xf3JLr_Y.js +3 -0
- package/dist/{railroadDiagram-XR7U4H2S-BxR9jg9Y.js → railroadDiagram-XR7U4H2S-CzOJlTUA.js} +8 -8
- package/dist/{requirementDiagram-PLB6GJNP-DAuKYcHc.js → requirementDiagram-PLB6GJNP-Bg-uQlZj.js} +16 -16
- package/dist/{rough.esm-rcMoXTJj.js → rough.esm-Cvc79rxE.js} +1 -1
- package/dist/{sankeyDiagram-IPEJSGJF-C3JJqzLE.js → sankeyDiagram-IPEJSGJF-E-o_7bq2.js} +18 -18
- package/dist/{sequenceDiagram-PO4LG4MO-Cs8x9lRY.js → sequenceDiagram-PO4LG4MO-DMLeIQ03.js} +9 -9
- package/dist/{sizeCapture-INFHLROL-CHXIsPO_.js → sizeCapture-INFHLROL-C_032szM.js} +2 -2
- package/dist/{sortable-provider-DalccwHj.js → sortable-provider-NE74zkmo.js} +7 -7
- package/dist/{src-BIbdeDuO.js → src-CJ8DNrI1.js} +82 -82
- package/dist/{stateDiagram-v2-GCMORJYK-PpP0APmW.js → stateDiagram-v2-GCMORJYK-BDB4K1Fw.js} +17 -17
- package/dist/{step-B6KjpKgN.js → step-Dt43c9X4.js} +17 -17
- package/dist/{string-B-ZWXCs2.js → string-BqyOfyFV.js} +8 -8
- package/dist/{swimlanes-2SLR337P-BmqILJTV.js → swimlanes-2SLR337P-C406S8ui.js} +14 -14
- package/dist/swimlanesDiagram-TC7HE7FX-BstKZ--K.js +28 -0
- package/dist/{timeline-definition-EJHVYXUP-CEOIzkcq.js → timeline-definition-EJHVYXUP-BmhxT0qo.js} +8 -8
- package/dist/{translate-material-BO32ZDCi.js → translate-material-CRxs5aS3.js} +1 -1
- package/dist/{translator-CiPgm2s3.js → translator-BfyVF7Ej.js} +88 -88
- package/dist/treeView-Q6P3EWNA-Dyk8HSag.js +3 -0
- package/dist/treemap-WGGIJYW6-CHrhBv7m.js +3 -0
- package/dist/{use-heading-spy-DSs5Coe-.js → use-heading-spy-BiLosksJ.js} +2 -2
- package/dist/{use-material-translation-RhoPY_RC.js → use-material-translation-D3HwtYDm.js} +1 -1
- package/dist/{usecaseDiagram-POWQR4AR-CMvboR6A.js → usecaseDiagram-POWQR4AR-cHGV1E_T.js} +403 -403
- package/dist/{utils-Brj-Qb2N.js → utils-UBn-46YY.js} +2 -2
- package/dist/{vennDiagram-UO4OBE2U-xN_G4DeI.js → vennDiagram-UO4OBE2U-Aql8mhcy.js} +8 -8
- package/dist/vite.js +1 -17
- package/dist/wardley-WFR3VGLG-DnLHjx6k.js +3 -0
- package/dist/{wardleyDiagram-VNRHLVJA-C0B-kQ2b.js → wardleyDiagram-VNRHLVJA-tknlhG_t.js} +8 -8
- package/dist/{xychartDiagram-PMCCYNJV-Crmi6_s-.js → xychartDiagram-PMCCYNJV-ixeD_kO0.js} +24 -24
- package/docs/components/rich-widgets.md +2 -0
- package/docs/getting-started.md +20 -0
- package/docs/guides/printing.md +6 -2
- package/docs/guides/ssr.md +8 -2
- package/docs/roadmap.md +9 -0
- package/docs/troubleshooting.md +57 -2
- package/package.json +30 -33
- package/dist/architecture-7GRP2DOG-DDr0RGVC.js +0 -3
- package/dist/channel-CUIVvEUM.js +0 -5
- package/dist/cynefin-OW5HDTMX-B8HVdZhp.js +0 -3
- package/dist/diagram-3UASUU5V-BEydDExL.js +0 -724
- package/dist/eventmodeling-NTZA5JFV-C1CEo-26.js +0 -3
- package/dist/flowDiagram-KWPJA3E3-uiZryqlC.js +0 -17
- package/dist/gitGraph-4MIJSDKK-BTeCS_5q.js +0 -3
- package/dist/info-A6RAGUB7-BvtuPd9C.js +0 -3
- package/dist/lib/components/ui/fields/currency-field/currency-digits.d.ts +0 -7
- package/dist/lib/components/ui/forms/field-blur-layers.d.ts +0 -34
- package/dist/lib/components/ui/media/pdf-viewer/pdf-document-search.d.ts +0 -44
- package/dist/lib/components/ui/media/pdf-viewer/pdf-escape.d.ts +0 -6
- package/dist/lib/components/ui/media/pdf-viewer/pdf-page-geometry.d.ts +0 -57
- package/dist/lib/components/ui/media/pdf-viewer/pdf-page-sizes.d.ts +0 -37
- package/dist/lib/components/ui/media/pdf-viewer/pdf-scroll-spy.d.ts +0 -42
- package/dist/lib/components/ui/media/pdf-viewer/pdf-text-search.d.ts +0 -25
- package/dist/lib/lib/pdf-download.d.ts +0 -35
- package/dist/lib/lib/pdf-file-name.d.ts +0 -9
- package/dist/lib/lib/pdf-source.d.ts +0 -57
- package/dist/lib/lib/print-format.utils.d.ts +0 -59
- package/dist/lib/lib/print-fraction-digits.d.ts +0 -12
- package/dist/lib/lib/print-table.utils.d.ts +0 -60
- package/dist/lib/lib/print-value.utils.d.ts +0 -40
- package/dist/lib/pdf-core/file-loader.d.ts +0 -18
- package/dist/lib/pdf-core/http.d.ts +0 -22
- package/dist/lib/pdf-core/index.d.ts +0 -11
- package/dist/lib/pdf-core/model/builders.d.ts +0 -54
- package/dist/lib/pdf-core/model/data-table.d.ts +0 -24
- package/dist/lib/pdf-core/model/index.d.ts +0 -4
- package/dist/lib/pdf-core/model/nodes.d.ts +0 -133
- package/dist/lib/pdf-core/model/theme.d.ts +0 -16
- package/dist/lib/pdf-core/model/types.d.ts +0 -108
- package/dist/lib/pdf-core/render/context.d.ts +0 -50
- package/dist/lib/pdf-core/render/document.d.ts +0 -21
- package/dist/lib/pdf-core/render/index.d.ts +0 -5
- package/dist/lib/pdf-core/render/nodes/blocks.d.ts +0 -19
- package/dist/lib/pdf-core/render/nodes/header.d.ts +0 -14
- package/dist/lib/pdf-core/render/nodes/layout.d.ts +0 -44
- package/dist/lib/pdf-core/render/nodes/table.d.ts +0 -14
- package/dist/lib/pdf-core/render/page.d.ts +0 -30
- package/dist/lib/pdf-core/render/render-node.d.ts +0 -10
- package/dist/lib/pdf-core/render/styles.d.ts +0 -303
- package/dist/packet-AYTQ26CC-CshIswP8.js +0 -3
- package/dist/pdf-download-hrKrI5_6.js +0 -153
- package/dist/pie-WAS4IAKB-CYs22y4X.js +0 -3
- package/dist/print-format.utils-B7K9qvuo.js +0 -53
- package/dist/print-fraction-digits-WtEBeztr.js +0 -5
- package/dist/radar-RG4KPBEZ-BOJKjbGv.js +0 -3
- package/dist/railroad-74A4TZTK-Dt1BmUkI.js +0 -3
- package/dist/railroad-abnf-HS5TGJTU-Cs9GMUMY.js +0 -3
- package/dist/railroad-ebnf-LZEXJU2U-D4y0fXoW.js +0 -3
- package/dist/railroad-peg-WCYAUIDC-D2f_ZNR5.js +0 -3
- package/dist/swimlanesDiagram-TC7HE7FX-DO3BxSlE.js +0 -28
- package/dist/treeView-Q6P3EWNA-BrJylG9N.js +0 -3
- package/dist/treemap-WGGIJYW6-DpIZuqbj.js +0 -3
- package/dist/wardley-WFR3VGLG-CbwdAAbH.js +0 -3
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { PdfDocument, PdfInline, PdfNode, PdfPage, PrintValue } from './types';
|
|
2
|
-
type NodeOf<T extends PdfNode['type']> = Extract<PdfNode, {
|
|
3
|
-
type: T;
|
|
4
|
-
}>;
|
|
5
|
-
type Options<T extends PdfNode['type'], K extends string = never> = Omit<NodeOf<T>, 'type' | K>;
|
|
6
|
-
export declare const text: (content: string | PdfInline[], options?: Omit<Options<"text">, "content">) => NodeOf<"text">;
|
|
7
|
-
export declare const heading: (text: string, level?: 1 | 2 | 3) => NodeOf<"heading">;
|
|
8
|
-
export declare const stack: (children: PdfNode[], options?: Omit<Options<"stack">, "children">) => NodeOf<"stack">;
|
|
9
|
-
export declare const row: (children: PdfNode[], options?: Omit<Options<"row">, "children">) => NodeOf<"row">;
|
|
10
|
-
export declare const section: (title: string, children: PdfNode[]) => NodeOf<"section">;
|
|
11
|
-
export declare const image: (src: string, options?: Omit<Options<"image">, "src">) => NodeOf<"image">;
|
|
12
|
-
export declare const link: (href: string, text: string) => NodeOf<"link">;
|
|
13
|
-
export declare const spacer: (size: number) => NodeOf<"spacer">;
|
|
14
|
-
export declare const divider: () => NodeOf<"divider">;
|
|
15
|
-
export declare const pageBreak: () => NodeOf<"pageBreak">;
|
|
16
|
-
export declare const table: (options: Options<"table">) => NodeOf<"table">;
|
|
17
|
-
export declare const keyValue: (items: {
|
|
18
|
-
label: string;
|
|
19
|
-
value: PrintValue;
|
|
20
|
-
}[], options?: Omit<Options<"keyValue">, "items">) => NodeOf<"keyValue">;
|
|
21
|
-
export declare const totals: (rows: NodeOf<"totals">["rows"]) => NodeOf<"totals">;
|
|
22
|
-
export declare const metric: (options: Options<"metric">) => NodeOf<"metric">;
|
|
23
|
-
export declare const badge: (text: string, color?: string) => NodeOf<"badge">;
|
|
24
|
-
export declare const header: (options: Options<"header">) => NodeOf<"header">;
|
|
25
|
-
export declare const pageNumber: (options?: Options<"pageNumber">) => NodeOf<"pageNumber">;
|
|
26
|
-
export declare const page: (options: PdfPage) => PdfPage;
|
|
27
|
-
/** A whole document; `version` is stamped for you. */
|
|
28
|
-
export declare const pdfDocument: (options: Omit<PdfDocument, "version">) => PdfDocument;
|
|
29
|
-
/**
|
|
30
|
-
* What `definePdfDocument` accepts: a function from your data (and more
|
|
31
|
-
* parameters, if you like) to a document without its `version`. A method
|
|
32
|
-
* signature, so that its parameters are checked both ways: an annotated
|
|
33
|
-
* `(inv: Invoice)` fits, while an unannotated first parameter is typed
|
|
34
|
-
* `unknown` (use it only after narrowing) and a later one with a default
|
|
35
|
-
* (`language = 'en'`) takes its type from the default.
|
|
36
|
-
*/
|
|
37
|
-
type PdfTemplate = {
|
|
38
|
-
build(data: unknown, ...rest: never[]): Omit<PdfDocument, 'version'>;
|
|
39
|
-
}['build'];
|
|
40
|
-
/**
|
|
41
|
-
* Types a template: a function from your data to a document. It returns the
|
|
42
|
-
* function unchanged, stamping `version` on what it builds. Annotate the
|
|
43
|
-
* data parameter; the others may have defaults (`language = 'en'`). Left
|
|
44
|
-
* unannotated, the data is `unknown`, so reading a property of it fails to
|
|
45
|
-
* compile in the template rather than where the template is called.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* const invoicePdf = definePdfDocument((inv: Invoice, language = 'en') => ({
|
|
49
|
-
* language,
|
|
50
|
-
* pages: [page({ pageNumbers: true, body: [heading(inv.number)] })],
|
|
51
|
-
* }));
|
|
52
|
-
*/
|
|
53
|
-
export declare function definePdfDocument<F extends PdfTemplate>(build: F): (...args: Parameters<F>) => PdfDocument;
|
|
54
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PrintColumn, PrintTableOptions } from '../../lib/print-table.utils';
|
|
2
|
-
import { PdfNode } from './types';
|
|
3
|
-
type TableNode = Extract<PdfNode, {
|
|
4
|
-
type: 'table';
|
|
5
|
-
}>;
|
|
6
|
-
type KeyValueNode = Extract<PdfNode, {
|
|
7
|
-
type: 'keyValue';
|
|
8
|
-
}>;
|
|
9
|
-
export type DataTableOptions = PrintTableOptions & Pick<TableNode, 'striped' | 'repeatHeader' | 'keepRowsWhole' | 'emptyText' | 'hideWhenEmpty'>;
|
|
10
|
-
/**
|
|
11
|
-
* A `table` node from column definitions and plain rows — the model twin of
|
|
12
|
-
* `PrintDataTable`. Without `totalLabel`, the totals row reads "Total" in the
|
|
13
|
-
* document's language.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* dataTable(definePrintColumns<Line>([
|
|
17
|
-
* { key: 'item', label: 'Item', flex: 3 },
|
|
18
|
-
* { key: 'amount', label: 'Amount', format: 'amount', total: 'sum' },
|
|
19
|
-
* ]), invoice.lines, { currency: 'EUR' })
|
|
20
|
-
*/
|
|
21
|
-
export declare function dataTable<T>(columns: PrintColumn<T>[], rows: T[], options?: DataTableOptions): TableNode;
|
|
22
|
-
/** A `keyValue` node from one row, read through column definitions. */
|
|
23
|
-
export declare function keyValueOf<T>(fields: PrintColumn<T>[], data: T, options?: Pick<PrintTableOptions, 'currency'> & Pick<KeyValueNode, 'columns' | 'keepEmpty'>): KeyValueNode;
|
|
24
|
-
export {};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { PdfAlign, PdfColor, PdfJsonValue, PdfStyle, PrintValue } from './types';
|
|
2
|
-
export type PdfInline = string | {
|
|
3
|
-
text: string;
|
|
4
|
-
bold?: boolean;
|
|
5
|
-
italic?: boolean;
|
|
6
|
-
color?: PdfColor;
|
|
7
|
-
href?: string;
|
|
8
|
-
};
|
|
9
|
-
export type PdfTableColumn = {
|
|
10
|
-
label: string;
|
|
11
|
-
align?: PdfAlign;
|
|
12
|
-
/** Points, or a percentage of the table (`'25%'`); otherwise it flexes. */
|
|
13
|
-
width?: number | `${number}%`;
|
|
14
|
-
/** Share of the remaining width; 1 by default. */
|
|
15
|
-
flex?: number;
|
|
16
|
-
};
|
|
17
|
-
export type PdfNode = {
|
|
18
|
-
type: 'stack';
|
|
19
|
-
children: PdfNode[];
|
|
20
|
-
gap?: number;
|
|
21
|
-
style?: PdfStyle;
|
|
22
|
-
} | {
|
|
23
|
-
type: 'row';
|
|
24
|
-
children: PdfNode[];
|
|
25
|
-
gap?: number;
|
|
26
|
-
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
27
|
-
justify?: 'start' | 'center' | 'end' | 'between';
|
|
28
|
-
style?: PdfStyle;
|
|
29
|
-
} | {
|
|
30
|
-
type: 'text';
|
|
31
|
-
content: string | PdfInline[];
|
|
32
|
-
variant?: 'body' | 'muted' | 'caption' | 'label';
|
|
33
|
-
style?: PdfStyle;
|
|
34
|
-
} | {
|
|
35
|
-
type: 'heading';
|
|
36
|
-
text: string;
|
|
37
|
-
level?: 1 | 2 | 3;
|
|
38
|
-
} | {
|
|
39
|
-
type: 'section';
|
|
40
|
-
title: string;
|
|
41
|
-
children: PdfNode[];
|
|
42
|
-
} | {
|
|
43
|
-
type: 'image';
|
|
44
|
-
/** A URL or a data URL; PNG or JPEG. */
|
|
45
|
-
src: string;
|
|
46
|
-
width?: number;
|
|
47
|
-
height?: number;
|
|
48
|
-
fit?: 'contain' | 'cover';
|
|
49
|
-
} | {
|
|
50
|
-
type: 'link';
|
|
51
|
-
href: string;
|
|
52
|
-
text: string;
|
|
53
|
-
} | {
|
|
54
|
-
type: 'spacer';
|
|
55
|
-
size: number;
|
|
56
|
-
} | {
|
|
57
|
-
type: 'divider';
|
|
58
|
-
} | {
|
|
59
|
-
type: 'pageBreak';
|
|
60
|
-
} | {
|
|
61
|
-
type: 'table';
|
|
62
|
-
columns: PdfTableColumn[];
|
|
63
|
-
rows: PrintValue[][];
|
|
64
|
-
/** Rows after the body, such as totals; kept together. */
|
|
65
|
-
footer?: PrintValue[][];
|
|
66
|
-
/** An empty first cell of a footer row reads "Total", translated. */
|
|
67
|
-
labelTotals?: boolean;
|
|
68
|
-
/** Zebra rows; `true` by default. */
|
|
69
|
-
striped?: boolean;
|
|
70
|
-
/** The header again at the top of each page; `true` by default. */
|
|
71
|
-
repeatHeader?: boolean;
|
|
72
|
-
/** A row never splits across pages; `true` by default. */
|
|
73
|
-
keepRowsWhole?: boolean;
|
|
74
|
-
/** Shown in one muted row when there are no rows. */
|
|
75
|
-
emptyText?: string;
|
|
76
|
-
/** Render nothing, not even the header, when there are no rows. */
|
|
77
|
-
hideWhenEmpty?: boolean;
|
|
78
|
-
} | {
|
|
79
|
-
type: 'keyValue';
|
|
80
|
-
items: {
|
|
81
|
-
label: string;
|
|
82
|
-
value: PrintValue;
|
|
83
|
-
}[];
|
|
84
|
-
/** 1 or 2 columns of pairs; 1 by default. */
|
|
85
|
-
columns?: 1 | 2;
|
|
86
|
-
/** Print a pair whose value is empty, as `'—'`. */
|
|
87
|
-
keepEmpty?: boolean;
|
|
88
|
-
} | {
|
|
89
|
-
type: 'totals';
|
|
90
|
-
rows: {
|
|
91
|
-
label: string;
|
|
92
|
-
value: PrintValue;
|
|
93
|
-
emphasis?: boolean;
|
|
94
|
-
}[];
|
|
95
|
-
} | {
|
|
96
|
-
type: 'metric';
|
|
97
|
-
label: string;
|
|
98
|
-
value: PrintValue;
|
|
99
|
-
hint?: string;
|
|
100
|
-
/** A change in percent, shown as `+4%` or `-2%`. */
|
|
101
|
-
delta?: number;
|
|
102
|
-
} | {
|
|
103
|
-
type: 'badge';
|
|
104
|
-
text: string;
|
|
105
|
-
color?: PdfColor;
|
|
106
|
-
} | {
|
|
107
|
-
type: 'header';
|
|
108
|
-
title: string;
|
|
109
|
-
subtitle?: string;
|
|
110
|
-
reference?: string;
|
|
111
|
-
/** Printed before `reference`; `'#'` by default. */
|
|
112
|
-
referencePrefix?: string;
|
|
113
|
-
/** A URL or a data URL, PNG or JPEG. */
|
|
114
|
-
logo?: string | {
|
|
115
|
-
src: string;
|
|
116
|
-
width?: number;
|
|
117
|
-
height?: number;
|
|
118
|
-
};
|
|
119
|
-
/** Shown in the logo box when there is no `logo`. */
|
|
120
|
-
logoText?: string;
|
|
121
|
-
/** A QR code already rendered as a PNG data URL. */
|
|
122
|
-
qrDataUrl?: string | null;
|
|
123
|
-
} | {
|
|
124
|
-
type: 'pageNumber';
|
|
125
|
-
format?: 'page-of' | 'page';
|
|
126
|
-
align?: PdfAlign;
|
|
127
|
-
} | {
|
|
128
|
-
type: 'custom';
|
|
129
|
-
/** The renderer's name in the `custom` option. */
|
|
130
|
-
name: string;
|
|
131
|
-
props?: Record<string, PdfJsonValue>;
|
|
132
|
-
};
|
|
133
|
-
export type PdfNodeType = PdfNode['type'];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PdfColor, PdfThemeColor, PdfThemeOverrides } from './types';
|
|
2
|
-
export type PdfTheme = {
|
|
3
|
-
colors: Record<PdfThemeColor, string>;
|
|
4
|
-
fonts: Record<'sans' | 'serif' | 'mono', string>;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* The light screen theme, in colours react-pdf reads (it takes no oklch):
|
|
8
|
-
* `primary`, `secondary`, `muted`, `border` and `qrBg` are the screen's
|
|
9
|
-
* `--primary`, `--secondary`, `--muted-foreground`, `--border` and `--muted`.
|
|
10
|
-
* Fonts are PDF standard fonts, so nothing has to be registered.
|
|
11
|
-
*/
|
|
12
|
-
export declare const defaultPdfTheme: PdfTheme;
|
|
13
|
-
/** The default theme with `overrides` applied. */
|
|
14
|
-
export declare function resolvePdfTheme(overrides?: PdfThemeOverrides): PdfTheme;
|
|
15
|
-
/** A theme colour name resolved to its value; any other colour as it is. */
|
|
16
|
-
export declare function resolvePdfColor(color: PdfColor | undefined, theme: PdfTheme): string | undefined;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { PrintValue } from '../../lib/print-value.utils';
|
|
2
|
-
import { PdfNode } from './nodes';
|
|
3
|
-
export type * from './nodes';
|
|
4
|
-
export type { PrintValue };
|
|
5
|
-
/** A theme colour name (`'primary'`, `'muted'`, …) or a CSS colour (`'#0b7a4b'`). */
|
|
6
|
-
export type PdfColor = PdfThemeColor | (string & {});
|
|
7
|
-
/** A JSON value: what a document may carry, so it survives `JSON.stringify`. */
|
|
8
|
-
export type PdfJsonValue = string | number | boolean | null | PdfJsonValue[] | {
|
|
9
|
-
[key: string]: PdfJsonValue;
|
|
10
|
-
};
|
|
11
|
-
/** A JSON-safe subset of react-pdf's style: numbers are points. */
|
|
12
|
-
export type PdfStyle = {
|
|
13
|
-
margin?: number;
|
|
14
|
-
marginTop?: number;
|
|
15
|
-
marginRight?: number;
|
|
16
|
-
marginBottom?: number;
|
|
17
|
-
marginLeft?: number;
|
|
18
|
-
padding?: number;
|
|
19
|
-
paddingTop?: number;
|
|
20
|
-
paddingRight?: number;
|
|
21
|
-
paddingBottom?: number;
|
|
22
|
-
paddingLeft?: number;
|
|
23
|
-
width?: number | string;
|
|
24
|
-
height?: number | string;
|
|
25
|
-
flex?: number;
|
|
26
|
-
gap?: number;
|
|
27
|
-
/** One of the theme's fonts; `'sans'` by default. */
|
|
28
|
-
fontFamily?: 'sans' | 'serif' | 'mono';
|
|
29
|
-
fontSize?: number;
|
|
30
|
-
fontWeight?: 'normal' | 'bold';
|
|
31
|
-
fontStyle?: 'normal' | 'italic';
|
|
32
|
-
textAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
33
|
-
color?: PdfColor;
|
|
34
|
-
backgroundColor?: PdfColor;
|
|
35
|
-
borderWidth?: number;
|
|
36
|
-
borderColor?: PdfColor;
|
|
37
|
-
borderRadius?: number;
|
|
38
|
-
};
|
|
39
|
-
/** Points on each side; `x` and `y` set both sides of an axis. */
|
|
40
|
-
export type PdfBox = {
|
|
41
|
-
top?: number;
|
|
42
|
-
right?: number;
|
|
43
|
-
bottom?: number;
|
|
44
|
-
left?: number;
|
|
45
|
-
x?: number;
|
|
46
|
-
y?: number;
|
|
47
|
-
};
|
|
48
|
-
export type PdfPageSize = 'A3' | 'A4' | 'A5' | 'LETTER' | 'LEGAL' | [number, number];
|
|
49
|
-
export type PdfAlign = 'left' | 'center' | 'right';
|
|
50
|
-
/** `true` prints "Page 2 of 5" centred at the bottom of every page. */
|
|
51
|
-
export type PdfPageNumbers = boolean | {
|
|
52
|
-
align?: PdfAlign;
|
|
53
|
-
format?: 'page-of' | 'page';
|
|
54
|
-
};
|
|
55
|
-
export type PdfWatermark = string | {
|
|
56
|
-
text: string;
|
|
57
|
-
/** 0 to 1; 0.08 by default. */
|
|
58
|
-
opacity?: number;
|
|
59
|
-
/** Degrees, counter-clockwise; 35 by default. */
|
|
60
|
-
angle?: number;
|
|
61
|
-
color?: PdfColor;
|
|
62
|
-
/** Points; 72 by default. */
|
|
63
|
-
fontSize?: number;
|
|
64
|
-
};
|
|
65
|
-
/** Document information, as PDF readers show it. */
|
|
66
|
-
export type PdfMeta = {
|
|
67
|
-
title?: string;
|
|
68
|
-
author?: string;
|
|
69
|
-
subject?: string;
|
|
70
|
-
keywords?: string;
|
|
71
|
-
creator?: string;
|
|
72
|
-
producer?: string;
|
|
73
|
-
};
|
|
74
|
-
/** Colours and fonts; every field is optional and falls back to the default. */
|
|
75
|
-
export type PdfThemeOverrides = {
|
|
76
|
-
colors?: Partial<Record<PdfThemeColor, string>>;
|
|
77
|
-
fonts?: Partial<Record<'sans' | 'serif' | 'mono', string>>;
|
|
78
|
-
};
|
|
79
|
-
export type PdfThemeColor = 'primary' | 'secondary' | 'text' | 'muted' | 'border' | 'headerBg' | 'headerText' | 'rowAlt' | 'logoBg' | 'qrBg' | 'success' | 'error';
|
|
80
|
-
/** The page shell: size, margins and what repeats on every page. */
|
|
81
|
-
export type PdfPageOptions = {
|
|
82
|
-
size?: PdfPageSize;
|
|
83
|
-
orientation?: 'portrait' | 'landscape';
|
|
84
|
-
/** Points; a number for every side. */
|
|
85
|
-
margins?: number | PdfBox;
|
|
86
|
-
/** Space kept at the bottom for the footer and page numbers; 24 by default. */
|
|
87
|
-
footerHeight?: number;
|
|
88
|
-
pageNumbers?: PdfPageNumbers;
|
|
89
|
-
watermark?: PdfWatermark;
|
|
90
|
-
};
|
|
91
|
-
export type PdfPage = PdfPageOptions & {
|
|
92
|
-
/** Repeated at the top of every page, in the flow. */
|
|
93
|
-
header?: PdfNode[];
|
|
94
|
-
/** Repeated at the bottom of every page. */
|
|
95
|
-
footer?: PdfNode[];
|
|
96
|
-
body: PdfNode[];
|
|
97
|
-
};
|
|
98
|
-
export type PdfDocument = {
|
|
99
|
-
version: 1;
|
|
100
|
-
meta?: PdfMeta;
|
|
101
|
-
/** Picks the built-in strings (`'en'`, `'fr'`) and the PDF's language. */
|
|
102
|
-
language?: string;
|
|
103
|
-
/** Formats amounts, dates and numbers; defaults to `language`. */
|
|
104
|
-
locale?: string;
|
|
105
|
-
timeZone?: string;
|
|
106
|
-
theme?: PdfThemeOverrides;
|
|
107
|
-
pages: PdfPage[];
|
|
108
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { PrintValue, PrintValueOptions } from '../../lib/print-value.utils';
|
|
3
|
-
import { PdfTheme } from '../model/theme';
|
|
4
|
-
import { PdfNode, PdfThemeOverrides } from '../model/types';
|
|
5
|
-
import { PdfStyles } from './styles';
|
|
6
|
-
/** Translates a built-in string: its key, English fallback and values. */
|
|
7
|
-
export type PdfTranslate = (key: string, fallback: string, values?: Record<string, string | number>) => string;
|
|
8
|
-
/** Renders a `{ type: 'custom' }` node registered under its `name`. */
|
|
9
|
-
export type PdfCustomRenderer = (props: Record<string, unknown>, context: PdfRenderContext) => ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
* Everything a node renderer needs, resolved once per document. It is plain
|
|
12
|
-
* data and functions — never a hook — because react-pdf calls the `render`
|
|
13
|
-
* callbacks of page numbers and fixed elements at layout time, outside React,
|
|
14
|
-
* where a hook throws.
|
|
15
|
-
*/
|
|
16
|
-
export type PdfRenderContext = {
|
|
17
|
-
language: string;
|
|
18
|
-
locale?: string;
|
|
19
|
-
timeZone?: string;
|
|
20
|
-
theme: PdfTheme;
|
|
21
|
-
styles: PdfStyles;
|
|
22
|
-
t: PdfTranslate;
|
|
23
|
-
/**
|
|
24
|
-
* Formats a value with the document's locale and time zone, as text the
|
|
25
|
-
* standard fonts can print ({@link toPdfText}).
|
|
26
|
-
*/
|
|
27
|
-
format: (value: PrintValue, options?: Pick<PrintValueOptions, 'empty'>) => string;
|
|
28
|
-
/** Renders child nodes; set by `createPdfRenderContext`. */
|
|
29
|
-
renderNodes: (nodes: PdfNode[] | undefined) => ReactNode[];
|
|
30
|
-
custom: Record<string, PdfCustomRenderer>;
|
|
31
|
-
};
|
|
32
|
-
export type PdfRenderOptions = {
|
|
33
|
-
/** `'en'` or `'fr'` pick the built-in strings; `'en'` by default. */
|
|
34
|
-
language?: string;
|
|
35
|
-
/** Formats amounts and dates; defaults to `language`. */
|
|
36
|
-
locale?: string;
|
|
37
|
-
timeZone?: string;
|
|
38
|
-
theme?: PdfThemeOverrides;
|
|
39
|
-
/**
|
|
40
|
-
* Translates the built-in strings (`material.print.*` keys); without it,
|
|
41
|
-
* the English fallbacks are printed.
|
|
42
|
-
*/
|
|
43
|
-
translate?: PdfTranslate;
|
|
44
|
-
/** Renderers for `{ type: 'custom', name }` nodes. */
|
|
45
|
-
custom?: Record<string, PdfCustomRenderer>;
|
|
46
|
-
};
|
|
47
|
-
export declare const DEFAULT_PDF_LANGUAGE = "en";
|
|
48
|
-
/** Text with the characters the standard fonts lack replaced by ones they have. */
|
|
49
|
-
export declare function toPdfText(text: string): string;
|
|
50
|
-
export declare function createPdfRenderContext(options: PdfRenderOptions, renderNodes: (nodes: PdfNode[] | undefined, context: PdfRenderContext) => ReactNode[]): PdfRenderContext;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DocumentProps } from '@react-pdf/renderer';
|
|
2
|
-
import { ReactElement, ReactNode } from 'react';
|
|
3
|
-
import { PdfDocument, PdfMeta } from '../model/types';
|
|
4
|
-
import { PdfRenderContext, PdfRenderOptions } from './context';
|
|
5
|
-
/** A render context for a document, or for blocks outside of one. */
|
|
6
|
-
export declare function createPdfContext(options?: PdfRenderOptions): PdfRenderContext;
|
|
7
|
-
export type PdfDocumentShellOptions = PdfMeta & {
|
|
8
|
-
/** Written to the PDF as its language, such as `'fr'`. */
|
|
9
|
-
language?: string;
|
|
10
|
-
};
|
|
11
|
-
/** The react-pdf `Document`: metadata and the pages. */
|
|
12
|
-
export declare function renderPdfDocumentShell(options: PdfDocumentShellOptions, pages: ReactNode[]): ReactElement<DocumentProps>;
|
|
13
|
-
export type RenderPdfElementOptions = Pick<PdfRenderOptions, 'translate' | 'custom'> & {
|
|
14
|
-
/** `creator` and `producer` when the document's `meta` names none. */
|
|
15
|
-
defaultCreator?: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Turns a model document into the react-pdf element tree that `pdf()`,
|
|
19
|
-
* `renderToBuffer()` or `PDFViewer` take.
|
|
20
|
-
*/
|
|
21
|
-
export declare function renderPdfElement(doc: PdfDocument, options?: RenderPdfElementOptions): ReactElement<DocumentProps>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Text, View } from '@react-pdf/renderer';
|
|
2
|
-
import { PdfNode } from '../../model/types';
|
|
3
|
-
import { PdfRenderContext } from '../context';
|
|
4
|
-
type NodeOf<T extends PdfNode['type']> = Extract<PdfNode, {
|
|
5
|
-
type: T;
|
|
6
|
-
}>;
|
|
7
|
-
/** Label and value pairs, in one or two columns; empty values are skipped. */
|
|
8
|
-
export declare function renderKeyValue(node: NodeOf<'keyValue'>, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View> | null;
|
|
9
|
-
/** A right-aligned box of totals; an `emphasis` row is the dark last row. */
|
|
10
|
-
export declare function renderTotals(node: NodeOf<'totals'>, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
11
|
-
/** One figure with its label, an optional hint and change. */
|
|
12
|
-
export declare function renderMetric(node: NodeOf<'metric'>, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
13
|
-
export declare function renderBadge(node: NodeOf<'badge'>, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
14
|
-
/**
|
|
15
|
-
* "Page 2 of 5" (or "Page 2"), translated. react-pdf calls `render` at layout
|
|
16
|
-
* time, outside React, so it only uses what the context already resolved.
|
|
17
|
-
*/
|
|
18
|
-
export declare function renderPageNumber(node: NodeOf<'pageNumber'>, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').TextProps> | import('@react-pdf/renderer').SVGTextProps, Text>;
|
|
19
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { View } from '@react-pdf/renderer';
|
|
2
|
-
import { PdfNode } from '../../model/types';
|
|
3
|
-
import { PdfRenderContext } from '../context';
|
|
4
|
-
type HeaderNode = Extract<PdfNode, {
|
|
5
|
-
type: 'header';
|
|
6
|
-
}>;
|
|
7
|
-
/**
|
|
8
|
-
* The title block: logo (an image, or `logoText` in a box) on the left, the
|
|
9
|
-
* title, subtitle and reference centred, a QR code on the right. A side with
|
|
10
|
-
* nothing to show keeps an empty box of the other side's width, so the title
|
|
11
|
-
* stays centred; with neither, the title is centred on the page.
|
|
12
|
-
*/
|
|
13
|
-
export declare function renderHeader(node: HeaderNode, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
14
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Image, Text, View } from '@react-pdf/renderer';
|
|
2
|
-
import { PdfNode, PdfStyle } from '../../model/types';
|
|
3
|
-
import { PdfRenderContext } from '../context';
|
|
4
|
-
type NodeOf<T extends PdfNode['type']> = Extract<PdfNode, {
|
|
5
|
-
type: T;
|
|
6
|
-
}>;
|
|
7
|
-
/** A model style with its theme colours and font resolved. */
|
|
8
|
-
export declare function toStyle(style: PdfStyle | undefined, ctx: PdfRenderContext): {
|
|
9
|
-
borderColor?: string | undefined;
|
|
10
|
-
backgroundColor?: string | undefined;
|
|
11
|
-
color?: string | undefined;
|
|
12
|
-
fontFamily?: string | undefined;
|
|
13
|
-
margin?: number;
|
|
14
|
-
marginTop?: number;
|
|
15
|
-
marginRight?: number;
|
|
16
|
-
marginBottom?: number;
|
|
17
|
-
marginLeft?: number;
|
|
18
|
-
padding?: number;
|
|
19
|
-
paddingTop?: number;
|
|
20
|
-
paddingRight?: number;
|
|
21
|
-
paddingBottom?: number;
|
|
22
|
-
paddingLeft?: number;
|
|
23
|
-
width?: number | string;
|
|
24
|
-
height?: number | string;
|
|
25
|
-
flex?: number;
|
|
26
|
-
gap?: number;
|
|
27
|
-
fontSize?: number;
|
|
28
|
-
fontWeight?: "normal" | "bold";
|
|
29
|
-
fontStyle?: "normal" | "italic";
|
|
30
|
-
textAlign?: "left" | "center" | "right" | "justify";
|
|
31
|
-
borderWidth?: number;
|
|
32
|
-
borderRadius?: number;
|
|
33
|
-
};
|
|
34
|
-
export declare const renderStack: (node: NodeOf<"stack">, ctx: PdfRenderContext) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
35
|
-
export declare const renderRow: (node: NodeOf<"row">, ctx: PdfRenderContext) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
36
|
-
export declare const renderText: (node: NodeOf<"text">, ctx: PdfRenderContext) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').TextProps> | import('@react-pdf/renderer').SVGTextProps, Text>;
|
|
37
|
-
export declare const renderHeading: (node: NodeOf<"heading">, ctx: PdfRenderContext) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').TextProps> | import('@react-pdf/renderer').SVGTextProps, Text>;
|
|
38
|
-
export declare const renderSection: (node: NodeOf<"section">, ctx: PdfRenderContext) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
39
|
-
export declare const renderImage: (node: NodeOf<"image">) => import('react').CElement<import('@react-pdf/renderer').ImageProps, Image>;
|
|
40
|
-
export declare const renderLink: (node: NodeOf<"link">, ctx: PdfRenderContext) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').TextProps> | import('@react-pdf/renderer').SVGTextProps, Text>;
|
|
41
|
-
export declare const renderSpacer: (node: NodeOf<"spacer">) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
42
|
-
export declare const renderDivider: (_node: NodeOf<"divider">, ctx: PdfRenderContext) => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
43
|
-
export declare const renderPageBreak: () => import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View>;
|
|
44
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { View } from '@react-pdf/renderer';
|
|
2
|
-
import { PdfNode } from '../../model/types';
|
|
3
|
-
import { PdfRenderContext } from '../context';
|
|
4
|
-
type TableNode = Extract<PdfNode, {
|
|
5
|
-
type: 'table';
|
|
6
|
-
}>;
|
|
7
|
-
/**
|
|
8
|
-
* A table: a header row that repeats at the top of each page the table
|
|
9
|
-
* crosses, body rows that never split (and stripe), then footer rows (totals)
|
|
10
|
-
* kept together. With no rows, the header and one muted row, or nothing with
|
|
11
|
-
* `hideWhenEmpty`.
|
|
12
|
-
*/
|
|
13
|
-
export declare function renderTable(node: TableNode, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').ViewProps>, View> | null;
|
|
14
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Page } from '@react-pdf/renderer';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { PdfBox, PdfPageOptions } from '../model/types';
|
|
4
|
-
import { PdfRenderContext } from './context';
|
|
5
|
-
export declare const DEFAULT_PDF_MARGINS: {
|
|
6
|
-
top: number;
|
|
7
|
-
right: number;
|
|
8
|
-
bottom: number;
|
|
9
|
-
left: number;
|
|
10
|
-
};
|
|
11
|
-
export declare const DEFAULT_FOOTER_HEIGHT = 24;
|
|
12
|
-
export type PdfMargins = typeof DEFAULT_PDF_MARGINS;
|
|
13
|
-
/**
|
|
14
|
-
* Margins in points from a number or a box: a side wins over its axis
|
|
15
|
-
* (`x`, `y`), which wins over the default.
|
|
16
|
-
*/
|
|
17
|
-
export declare function resolvePdfMargins(margins?: number | PdfBox): PdfMargins;
|
|
18
|
-
export type PdfPageParts = {
|
|
19
|
-
/** Repeated at the top of every page, in the flow. */
|
|
20
|
-
header?: ReactNode;
|
|
21
|
-
/** Repeated at the bottom of every page, in the space kept for it. */
|
|
22
|
-
footer?: ReactNode;
|
|
23
|
-
body: ReactNode[];
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* One react-pdf `Page`: size, orientation and margins, the header fixed at
|
|
27
|
-
* the top of each page, the footer and page number fixed in the space kept
|
|
28
|
-
* at the bottom, and the watermark behind everything.
|
|
29
|
-
*/
|
|
30
|
-
export declare function renderPdfPage(options: PdfPageOptions, parts: PdfPageParts, ctx: PdfRenderContext): import('react').CElement<import('react').PropsWithChildren<import('@react-pdf/renderer').PageProps>, Page>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { PdfNode } from '../model/types';
|
|
3
|
-
import { PdfRenderContext } from './context';
|
|
4
|
-
/**
|
|
5
|
-
* Renders one model node as react-pdf elements. An unknown `type` throws: a
|
|
6
|
-
* document from a newer version, or a typo in hand-written JSON.
|
|
7
|
-
*/
|
|
8
|
-
export declare function renderPdfNode(node: PdfNode, context: PdfRenderContext): ReactNode;
|
|
9
|
-
/** Renders a list of nodes, each under its index as key. */
|
|
10
|
-
export declare function renderPdfNodes(nodes: PdfNode[] | undefined, context: PdfRenderContext): ReactNode[];
|