@design.estate/dees-document 1.1.0 → 1.3.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.
Files changed (38) hide show
  1. package/dist_bundle/bundle.js +148 -144
  2. package/dist_bundle/bundle.js.map +4 -4
  3. package/dist_ts/00_commitinfo_data.js +3 -3
  4. package/dist_ts/interfaces/document.d.ts +2 -0
  5. package/dist_ts/interfaces/document.js +2 -2
  6. package/dist_ts/interfaces/translation.d.ts +17 -2
  7. package/dist_ts/shared/demoletter.d.ts +4 -0
  8. package/dist_ts/shared/demoletter.js +214 -0
  9. package/dist_ts/shared/index.d.ts +7 -0
  10. package/dist_ts/shared/index.js +8 -0
  11. package/dist_ts/shared/translation.d.ts +15 -0
  12. package/dist_ts/shared/translation.js +73 -0
  13. package/dist_watch/bundle.js +106 -24
  14. package/dist_watch/bundle.js.map +4 -4
  15. package/npmextra.json +9 -12
  16. package/package.json +11 -13
  17. package/readme.md +30 -27
  18. package/ts/00_commitinfo_data.ts +2 -2
  19. package/ts/interfaces/document.ts +3 -0
  20. package/ts/interfaces/translation.ts +17 -2
  21. package/{ts_web/elements → ts}/shared/demoletter.ts +10 -1
  22. package/{ts_web/elements → ts}/shared/index.ts +1 -1
  23. package/ts/shared/translation.ts +82 -0
  24. package/ts_web/00_commitinfo_data.ts +2 -2
  25. package/ts_web/elements/contentinvoice.ts +15 -9
  26. package/ts_web/elements/document.demo.ts +1 -1
  27. package/ts_web/elements/document.ts +3 -1
  28. package/ts_web/elements/index.ts +1 -1
  29. package/ts_web/elements/letterheader.ts +1 -1
  30. package/ts_web/elements/page.ts +6 -2
  31. package/ts_web/elements/pagecontainer.ts +1 -1
  32. package/ts_web/elements/pagecontent.ts +1 -1
  33. package/ts_web/elements/pagefooter.ts +14 -6
  34. package/ts_web/elements/pageheader.ts +10 -2
  35. package/ts_web/elements/viewer.demo.ts +2 -2
  36. package/ts_web/elements/viewer.ts +4 -1
  37. package/ts_web/pages/page1.ts +1 -1
  38. package/ts_web/elements/shared/translation.ts +0 -31
package/npmextra.json CHANGED
@@ -5,29 +5,26 @@
5
5
  "githost": "code.foss.global",
6
6
  "gitscope": "designestate/private",
7
7
  "gitrepo": "dedocument-catalog",
8
- "description": "A versatile tool for dynamically generating and rendering business documents, such as invoices, using modern web technologies and elements.",
8
+ "description": "A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.",
9
9
  "npmPackagename": "@designestate_private/dedocument-catalog",
10
10
  "license": "MIT",
11
11
  "projectDomain": "design.estate",
12
12
  "shortDescription": "undefined variable",
13
13
  "keywords": [
14
14
  "document generation",
15
- "invoices",
15
+ "invoice automation",
16
+ "business documentation",
17
+ "dynamic rendering",
16
18
  "PDF creation",
17
- "TypeScript",
18
19
  "web components",
20
+ "Node.js",
21
+ "TypeScript",
19
22
  "templating",
20
- "dynamic rendering",
23
+ "modern web technologies",
21
24
  "responsive design",
22
- "business documentation",
23
- "automated workflows",
24
- "modular architecture",
25
- "smart contracts",
26
- "javascript",
27
25
  "QR code",
28
- "custom elements",
29
- "nodejs",
30
- "data-driven"
26
+ "modular architecture",
27
+ "automated workflows"
31
28
  ]
32
29
  }
33
30
  },
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@design.estate/dees-document",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "private": false,
5
- "description": "A versatile tool for dynamically generating and rendering business documents, such as invoices, using modern web technologies and elements.",
5
+ "description": "A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.",
6
6
  "main": "dist_ts_web/index.js",
7
7
  "typings": "dist_ts_web/index.d.ts",
8
8
  "exports": {
@@ -22,6 +22,7 @@
22
22
  "@push.rocks/smartpdf": "^3.1.8",
23
23
  "@push.rocks/smarttime": "^4.0.8",
24
24
  "@tsclass/tsclass": "^4.1.2",
25
+ "@types/node": "^22.10.1",
25
26
  "@types/qrcode": "^1.5.5",
26
27
  "qrcode": "^1.5.4"
27
28
  },
@@ -59,22 +60,19 @@
59
60
  "homepage": "https://gitlab.com/designestate/private/dedocument-catalog#readme",
60
61
  "keywords": [
61
62
  "document generation",
62
- "invoices",
63
+ "invoice automation",
64
+ "business documentation",
65
+ "dynamic rendering",
63
66
  "PDF creation",
64
- "TypeScript",
65
67
  "web components",
68
+ "Node.js",
69
+ "TypeScript",
66
70
  "templating",
67
- "dynamic rendering",
71
+ "modern web technologies",
68
72
  "responsive design",
69
- "business documentation",
70
- "automated workflows",
71
- "modular architecture",
72
- "smart contracts",
73
- "javascript",
74
73
  "QR code",
75
- "custom elements",
76
- "nodejs",
77
- "data-driven"
74
+ "modular architecture",
75
+ "automated workflows"
78
76
  ],
79
77
  "scripts": {
80
78
  "test": "npm run build && tstest test/",
package/readme.md CHANGED
@@ -1,31 +1,32 @@
1
+ ```markdown
1
2
  # @design.estate/dees-document
2
3
 
3
- A comprehensive solution for generating documents like invoices, integrating elements, templates, and services to streamline document creation.
4
+ A versatile tool for dynamically generating and rendering business documents, such as invoices, using modern web technologies and elements.
4
5
 
5
6
  ## Install
6
7
 
7
- To add `@design.estate/dees-document` to your project, run the following command in your terminal:
8
+ To incorporate `@design.estate/dees-document` into your project, execute the following command in your terminal:
8
9
 
9
10
  ```shell
10
11
  npm install @design.estate/dees-document --save
11
12
  ```
12
13
 
13
- This will install the package and add it to your project's dependencies, ensuring all required modules are available in your `node_modules` directory.
14
+ This command will install the package and add it to your project's dependencies, thus making all the necessary modules available within your `node_modules` directory.
14
15
 
15
16
  ## Usage
16
17
 
17
- The `@design.estate/dees-document` package provides a robust framework for creating documents including invoices, contracts, and various other business-related documents. It is built on modern web technologies including TypeScript and ES modules to ensure a type-safe and easy-to-integrate experience. Below, we will guide you through the comprehensive usage of this package, from setting up your environment to generating PDF documents.
18
+ The `@design.estate/dees-document` package serves as a robust framework to facilitate the generation of business documents, such as invoices and contracts. Leveraging modern web technologies, this package integrates seamlessly with TypeScript and ES modules, offering a type-safe environment conducive to efficient, dynamic document creation. Presented here is a comprehensive guide to utilizing this package, ranging from initializing your environment to generating complete PDF documents.
18
19
 
19
20
  ### Getting Started
20
21
 
21
- Before creating documents, initialize the document service which is central to this package. This is typically done at the beginning of your application.
22
+ To embark on a document creation journey, initiate the document service. This service constitutes the core of this package and is typically started at the application's outset.
22
23
 
23
24
  ```typescript
24
25
  import { PdfService, IPdfServiceConstructorOptions } from '@design.estate/dees-document';
25
26
 
26
27
  async function setupPdfService() {
27
28
  const options: IPdfServiceConstructorOptions = {
28
- // Add necessary configuration here
29
+ // configure your options here
29
30
  };
30
31
 
31
32
  const pdfService = await PdfService.createAndStart(options);
@@ -34,15 +35,15 @@ async function setupPdfService() {
34
35
  }
35
36
  ```
36
37
 
37
- This script initializes `PdfService`. Modify the options to tailor the service to your needs.
38
+ The above code initializes the `PdfService`. Tailor the configuration options to suit your specific requirements.
38
39
 
39
40
  ### Creating Documents
40
41
 
41
- With the PDF service ready, you can proceed to generate documents. The following section provides a detailed example of creating an invoice. This example is applicable to various document types with necessary adjustments.
42
+ With the PDF service initialized, you can now proceed to generate your documents. In the following section, you will find a detailed walkthrough for creating an invoice. This method can be adapted to other document types with necessary modifications.
42
43
 
43
44
  #### Step-by-Step: Create an Invoice
44
45
 
45
- 1. **Define the Data Structure**: Describe the invoice details. This includes sender and recipient information, the items being invoiced, and more.
46
+ 1. **Define the Data Structure**: Construct the details of the invoice, including the sender, recipient information, and the details of the items being invoiced.
46
47
 
47
48
  ```typescript
48
49
  import { ILetter } from '@design.estate/dees-document';
@@ -95,22 +96,22 @@ With the PDF service ready, you can proceed to generate documents. The following
95
96
  };
96
97
  ```
97
98
 
98
- Here, `ILetter` interface details all components of an invoice including sender (`from`) and recipient (`to`) information, as well as the invoiced items.
99
+ The `ILetter` interface captures all the components of an invoice, including both the sender (`from`) and recipient (`to`) information, alongside the details of the invoiced items.
99
100
 
100
- 2. **Generate the PDF**: Transform the invoice details into a PDF.
101
+ 2. **Generate the PDF**: Convert the invoice details into a PDF file.
101
102
 
102
103
  ```typescript
103
104
  async function generateInvoice(pdfService: PdfService, invoiceData: ILetter) {
104
105
  const pdfBuffer = await pdfService.createPdfFromLetterObject(invoiceData);
105
106
  console.log('Invoice PDF generated successfully.');
106
107
 
107
- // Save the PDF, send it via email, etc.
108
+ // Here you could save the PDF to your filesystem, send it via email, etc.
108
109
  }
109
110
  ```
110
111
 
111
- The function `createPdfFromLetterObject` returns a `Buffer` containing the generated PDF. From here, you can save this PDF to a file, send it to clients, or archive it.
112
+ The `createPdfFromLetterObject` function returns a `Buffer` that contains the generated PDF, enabling you to save it to a file, send it to clients, or store it for record-keeping.
112
113
 
113
- 3. **Integrate It All**: Here's how everything ties together into a complete script for generating an invoice:
114
+ 3. **Integrate It All**: The following script ties together the PDF service and generates the invoice with the described data.
114
115
 
115
116
  ```typescript
116
117
  async function main() {
@@ -121,15 +122,15 @@ With the PDF service ready, you can proceed to generate documents. The following
121
122
  main().then(() => console.log('Invoice generation process completed.'));
122
123
  ```
123
124
 
124
- This script initiates the PDF service and generates the invoice PDF with the provided information.
125
+ This example initiates the PDF service and utilizes it to generate a PDF invoice with specified parameters.
125
126
 
126
127
  ### Advanced Document Features
127
128
 
128
- The package is designed to create not only invoices but a wide range of document types. Leverage its modular architecture to build and customize documents to fit specific needs.
129
+ The package is designed to create a broad range of documents, far beyond simple invoices. Utilize the modular architecture to customize documents to your specific business requirements.
129
130
 
130
131
  #### Advanced Scenarios
131
132
 
132
- 1. **Custom Styling**: Customize the appearance of elements within your documents, such as headers, footers, and more.
133
+ 1. **Custom Styling**: Alter the visual styles of various elements within your documents, like headers, footers, and more through CSS or inline styles.
133
134
 
134
135
  ```typescript
135
136
  import { DeDocumentViewer } from '@design.estate/dees-element';
@@ -139,31 +140,33 @@ The package is designed to create not only invoices but a wide range of document
139
140
  document.body.appendChild(customStyledViewer);
140
141
  ```
141
142
 
142
- Customize via CSS or dynamically through TypeScript where necessary.
143
+ Adjust styles either with standard CSS or via dynamic TypeScript changes.
143
144
 
144
- 2. **Interactive Document Elements**: Incorporate UI components like buttons, input fields, or visualizations tailored for your document needs.
145
+ 2. **Interactive Document Elements**: Integrate interactive UI components, like buttons or input fields, fitting seamlessly into your documents.
145
146
 
146
- 3. **Multi-page Document Generation**: Handle overflow of content and automatic page generation while maintaining headers and footers.
147
+ 3. **Multi-page Document Generation**: Handle content overflow elegantly through automatic page creation, keeping headers and footers intact.
147
148
 
148
149
  ```typescript
149
150
  pdfService.adjustDePageScaling();
150
151
  ```
151
152
 
152
- Toggle between print and digital formats and handle scaling.
153
+ Adapt between print and digital formats, managing scaling effectively.
153
154
 
154
- 4. **Embedding Images and Logos**: Add company logos, graphics, or auxiliary content to enhance document presentation.
155
+ 4. **Embedding Images and Logos**: Enhance your document's appearance with company logos, graphics, and other auxiliary content.
155
156
 
156
157
  ### Additional Capabilities
157
158
 
158
- Beyond these examples, delve deeper into advanced functionalities such as:
159
+ Beyond basic functionality, this package offers a range of advanced features:
159
160
 
160
- - **Document Management**: Manage multiple document templates, manage versions, and add annotations or notes.
161
- - **Dynamic Rendering**: Use templating for dynamic content rendering based on variable inputs.
162
- - **Responsive Design for Digital Documents**: Ensure documents are displayed correctly across devices.
161
+ - **Document Management**: Manage multiple document templates, maintain version control, and append annotations or notes.
162
+ - **Dynamic Rendering**: Utilize templating engines to render dynamic content based on input variables.
163
+ - **Responsive Design for Digital Documents**: Ensure your documents are consistently displayed across various devices.
163
164
 
164
165
  ### Concluding Remarks
165
166
 
166
- The `@design.estate/dees-document` package is an essential tool in the modern document generation ecosystem. Its expansive capabilities, from basic invoices to complex document templates, make it a versatile solution for businesses of all scales. Implementing this service broadly simplifies document management workflows and enhances document presentation precision and quality. For further depth, consult the package's documentation or explore the examples included in the module.
167
+ The `@design.estate/dees-document` package presents a powerful solution within the modern document generation realm. From basic invoices to intricate templates, this package provides the essential tools for businesses to streamline their document workflows and enhance their presentation quality and accuracy. Explore further depth by consulting the package’s detailed documentation or by reviewing the examples included within the module.
168
+ ```
169
+
167
170
 
168
171
  ## License and Legal Information
169
172
 
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-document',
6
- version: '1.1.0',
7
- description: 'A versatile tool for dynamically generating and rendering business documents, such as invoices, using modern web technologies and elements.'
6
+ version: '1.3.0',
7
+ description: 'A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.'
8
8
  }
@@ -1,5 +1,8 @@
1
+ import * as shared from '../shared/index.js';
2
+
1
3
  export interface IDocumentSettings {
2
4
  enableTopDraftText?: boolean;
3
5
  enableDefaultHeader?: boolean;
4
6
  enableDefaultFooter?: boolean;
7
+ languageCode?: shared.translation.TLanguageCode;
5
8
  }
@@ -1,4 +1,19 @@
1
1
  export interface IDeDocumentTranslations {
2
- "invoice": string;
3
- "quantity": string;
2
+ address: string;
3
+ bankConnection: string;
4
+ contactInfo: string;
5
+ description: string;
6
+ invoice: string;
7
+ itemPos: string;
8
+ quantity: string;
9
+ registrationInfo: string;
10
+ reverseVatNote: string;
11
+ totalNetPrice: string;
12
+ unitNetPrice: string;
13
+ unitType: string;
14
+ yourCustomerId: string;
15
+ yourVatId: string;
16
+ continuesOnPage: string;
17
+ finalPageStatement: string;
18
+ page: string;
4
19
  }
@@ -1,4 +1,6 @@
1
1
  import * as tsclass from '@tsclass/tsclass';
2
+ import * as interfaces from '../interfaces/index.js';
3
+
2
4
  const fromContact: tsclass.business.IContact = {
3
5
  name: 'Awesome From Company',
4
6
  type: 'company',
@@ -207,4 +209,11 @@ export const demoLetter: tsclass.business.ILetter = {
207
209
  logoUrl: null,
208
210
  pdfAttachments: null,
209
211
  subject: 'Invoice: LL-INV-48765',
210
- }
212
+ }
213
+
214
+ export const demoDocumentSettings: interfaces.IDocumentSettings = {
215
+ enableTopDraftText: true,
216
+ enableDefaultHeader: true,
217
+ enableDefaultFooter: true,
218
+ languageCode: 'DE',
219
+ };
@@ -6,4 +6,4 @@ export const leftMargin = 90;
6
6
  import * as translation from './translation.js';
7
7
  export { translation };
8
8
 
9
- export * from './demoletter.js';
9
+ export * from './demoletter.js';
@@ -0,0 +1,82 @@
1
+ import * as interfaces from '../interfaces/index.js';
2
+
3
+ type TTranslationImplementation = {
4
+ [key in keyof interfaces.IDeDocumentTranslations]: string;
5
+ }
6
+
7
+ export const EN_translations: TTranslationImplementation = {
8
+ address: 'Address',
9
+ bankConnection: 'Bank Connection',
10
+ contactInfo: 'Contact Info',
11
+ description: 'Description',
12
+ invoice: 'Invoice',
13
+ itemPos: 'Item Pos.',
14
+ quantity: 'Quantity',
15
+ registrationInfo: 'Registration Info',
16
+ reverseVatNote: 'VAT arises on a reverse charge basis and is payable by the customer.',
17
+ totalNetPrice: 'Total Net Price',
18
+ unitNetPrice: 'Unit Net Price',
19
+ unitType: 'Unit Type',
20
+ yourCustomerId: 'Your Customer ID:',
21
+ yourVatId: 'Your vat id on file:',
22
+ continuesOnPage: 'Continues on page',
23
+ finalPageStatement: 'This is the final page of this document.',
24
+ page: 'Page',
25
+ };
26
+
27
+ export const DE_translations: TTranslationImplementation = {
28
+ address: 'Adresse',
29
+ bankConnection: 'Bankverbindung',
30
+ contactInfo: 'Kontaktinformationen',
31
+ description: 'Beschreibung',
32
+ invoice: 'Rechnung',
33
+ itemPos: 'Pos.',
34
+ quantity: 'Anzahl',
35
+ registrationInfo: 'HRA/HRB Info',
36
+ reverseVatNote: 'Umkehr der Umsatzsteuerpflicht: Der Rechnungsempfänger ist für die korrekte Abrechnung der Umsatzsteuer zuständig.',
37
+ totalNetPrice: 'Nettopreis Summe',
38
+ unitNetPrice: 'Nettopreis',
39
+ unitType: 'Einheit',
40
+ yourCustomerId: 'Ihre Kundennummer:',
41
+ yourVatId: 'Ihre Umsatzsteuer-ID:',
42
+ continuesOnPage: 'Fortsetzung auf Seite',
43
+ finalPageStatement: 'Diese ist die letzte Seite einer Dokumente.',
44
+ page: 'Seite',
45
+ };
46
+
47
+ export const ES_translations: TTranslationImplementation = {
48
+ address: 'Dirección',
49
+ bankConnection: 'Conexión bancaria',
50
+ contactInfo: 'Información de contacto',
51
+ description: 'Descripción',
52
+ invoice: 'Factura',
53
+ itemPos: 'Pos.',
54
+ quantity: 'Cantidad',
55
+ registrationInfo: 'Información de registro',
56
+ reverseVatNote: 'La declaración de IVA se aplica en base a la factura de venta, y se paga por el cliente.',
57
+ totalNetPrice: 'Precio total neto',
58
+ unitNetPrice: 'Precio unitario neto',
59
+ unitType: 'Tipo de unidad',
60
+ yourCustomerId: 'Su número de cliente:',
61
+ yourVatId: 'Su ID de IVA:',
62
+ continuesOnPage: 'Continues on page',
63
+ finalPageStatement: 'This is the final page of this document.',
64
+ page: 'Page',
65
+ };
66
+
67
+ export const languageCodeMap = {
68
+ 'DE': DE_translations,
69
+ 'EN': EN_translations,
70
+ 'ES': ES_translations,
71
+ };
72
+
73
+ export type TLanguageCode = keyof typeof languageCodeMap;
74
+
75
+ export const translate = (languageCode: TLanguageCode, key: string, defaultValue: string) => {
76
+ const translations = languageCodeMap[languageCode] || EN_translations;
77
+ if (translations && translations[key]) {
78
+ return translations[key];
79
+ } else {
80
+ return defaultValue;
81
+ }
82
+ };
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-document',
6
- version: '1.1.0',
7
- description: 'A versatile tool for dynamically generating and rendering business documents, such as invoices, using modern web technologies and elements.'
6
+ version: '1.3.0',
7
+ description: 'A comprehensive tool for dynamically generating and rendering business documents like invoices using modern web technologies.'
8
8
  }
@@ -15,8 +15,8 @@ import {
15
15
  domtools,
16
16
  } from '@design.estate/dees-element';
17
17
  import * as plugins from '../plugins.js';
18
- import * as shared from './shared/index.js';
19
-
18
+ import * as shared from '../../ts/shared/index.js';
19
+ import * as interfaces from '../../ts/interfaces/index.js';
20
20
 
21
21
 
22
22
  declare global {
@@ -45,6 +45,12 @@ export class DeContentInvoice extends DeesElement {
45
45
  })
46
46
  public letterData: plugins.tsclass.business.ILetter;
47
47
 
48
+ @property({
49
+ type: Object,
50
+ reflect: true,
51
+ })
52
+ public documentSettings: interfaces.IDocumentSettings;
53
+
48
54
  constructor() {
49
55
  super();
50
56
  domtools.DomTools.setupDomTools();
@@ -275,12 +281,12 @@ export class DeContentInvoice extends DeesElement {
275
281
  </style>
276
282
  <div>We hereby invoice products and services provided to you by Lossless GmbH:</div>
277
283
  <div class="grid topLine dataHeader">
278
- <div class="lineItem">Item Pos.</div>
279
- <div class="lineItem">${shared.translation.translate('DE', 'description', 'Description')}</div>
280
- <div class="lineItem">${shared.translation.translate('DE', 'quantity', 'Quantity')}</div>
281
- <div class="lineItem">Unit Type</div>
282
- <div class="lineItem">Unit Net Price</div>
283
- <div class="lineItem">Total Net Price</div>
284
+ <div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'itemPos', 'Item Pos.')}</div>
285
+ <div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'description', 'Description')}</div>
286
+ <div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'quantity', 'Quantity')}</div>
287
+ <div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'unitType', 'Unit Type')}</div>
288
+ <div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'unitNetPrice', 'Unit Net Price')}</div>
289
+ <div class="lineItem">${shared.translation.translate(this.documentSettings.languageCode, 'totalNetPrice', 'Total Net Price')}</div>
284
290
  </div>
285
291
  ${(() => {
286
292
  let counter = 1;
@@ -329,7 +335,7 @@ export class DeContentInvoice extends DeesElement {
329
335
  ${this.letterData?.content.invoiceData.reverseCharge
330
336
  ? html`
331
337
  <div class="taxNote">
332
- VAT arises on a reverse charge basis and is payable by the customer.
338
+ ${shared.translation.translate(this.documentSettings.languageCode, 'reverseVatNote', 'VAT arises on a reverse charge basis and is payable by the customer.')}
333
339
  </div>
334
340
  `
335
341
  : ``}
@@ -1,4 +1,4 @@
1
- import * as shared from './shared/index.js';
1
+ import * as shared from '../../ts/shared/index.js';
2
2
  import { html } from '@design.estate/dees-element';
3
3
 
4
4
  export const demoFunc = () => html`
@@ -24,7 +24,7 @@ export const defaultDocumentSettings: interfaces.IDocumentSettings = {
24
24
  import { DePage } from './page.js';
25
25
  import { DeContentInvoice } from './contentinvoice.js';
26
26
 
27
- import * as shared from './shared/index.js';
27
+ import * as shared from '../../ts/shared/index.js';
28
28
  import { demoFunc } from './document.demo.js';
29
29
 
30
30
  declare global {
@@ -146,6 +146,7 @@ export class DeDocument extends DeesElement {
146
146
  // lets append the content
147
147
  const content: DeContentInvoice = new DeContentInvoice();
148
148
  content.letterData = this.letterData;
149
+ content.documentSettings = this.documentSettings;
149
150
  document.body.appendChild(content);
150
151
 
151
152
  await domtools.convenience.smartdelay.delayFor(0);
@@ -158,6 +159,7 @@ export class DeDocument extends DeesElement {
158
159
  const newPage = new DePage();
159
160
  newPage.printMode = this.printMode;
160
161
  newPage.letterData = this.letterData;
162
+ newPage.documentSettings = this.documentSettings;
161
163
  pages.push(newPage);
162
164
  newPage.pageNumber = pageCounter;
163
165
  newPage.append(currentContent);
@@ -8,4 +8,4 @@ export * from './pagefooter.js';
8
8
  export * from './pageheader.js';
9
9
  export * from './viewer.js';
10
10
 
11
- export * from './shared/index.js';
11
+ export * from '../../ts/shared/index.js';
@@ -10,7 +10,7 @@ import {
10
10
  } from '@design.estate/dees-element';
11
11
  import * as domtools from '@design.estate/dees-domtools';
12
12
 
13
- import * as shared from './shared/index.js';
13
+ import * as shared from '../../ts/shared/index.js';
14
14
  import * as tsclass from '@tsclass/tsclass';
15
15
 
16
16
  declare global {
@@ -15,7 +15,7 @@ import * as interfaces from '../../ts/interfaces/index.js';
15
15
 
16
16
  import { defaultDocumentSettings } from './document.js';
17
17
 
18
- import * as shared from './shared/index.js';
18
+ import * as shared from '../../ts/shared/index.js';
19
19
 
20
20
  declare global {
21
21
  interface HTMLElementTagNameMap {
@@ -127,6 +127,7 @@ export class DePage extends DeesElement {
127
127
  ? html`
128
128
  <dedocument-pageheader
129
129
  .letterData=${this.letterData}
130
+ .documentSettings=${this.documentSettings}
130
131
  .pageNumber="${this.pageNumber}"
131
132
  .pageTotalNumber="${this.pageTotalNumber}"
132
133
  ></dedocument-pageheader>
@@ -137,20 +138,23 @@ export class DePage extends DeesElement {
137
138
  <dedocument-letterheader
138
139
  .pageNumber="${this.pageNumber}"
139
140
  .letterData=${this.letterData}
141
+ .documentSettings=${this.documentSettings}
140
142
  .pageTotalNumber="${this.pageTotalNumber}"
141
143
  ></dedocument-letterheader>
142
144
  `
143
145
  : html``}
144
146
  <dedocument-pagecontent
147
+ .letterData=${this.letterData}
148
+ .documentSettings=${this.documentSettings}
145
149
  .pageNumber="${this.pageNumber}"
146
150
  .pageTotalNumber="${this.pageTotalNumber}"
147
- .letterData=${this.letterData}
148
151
  ><slot></slot
149
152
  ></dedocument-pagecontent>
150
153
  ${this.documentSettings.enableDefaultFooter
151
154
  ? html`
152
155
  <dedocument-pagefooter
153
156
  .letterData=${this.letterData}
157
+ .documentSettings=${this.documentSettings}
154
158
  .pageNumber="${this.pageNumber}"
155
159
  .pageTotalNumber="${this.pageTotalNumber}"
156
160
  ></dedocument-pagefooter>
@@ -10,7 +10,7 @@ import {
10
10
  } from '@design.estate/dees-element';
11
11
  import * as domtools from '@design.estate/dees-domtools';
12
12
 
13
- import * as shared from './shared/index.js';
13
+ import * as shared from '../../ts/shared/index.js';
14
14
 
15
15
  declare global {
16
16
  interface HTMLElementTagNameMap {
@@ -10,7 +10,7 @@ import {
10
10
  } from '@design.estate/dees-element';
11
11
  import * as domtools from '@design.estate/dees-domtools';
12
12
 
13
- import * as shared from './shared/index.js';
13
+ import * as shared from '../../ts/shared/index.js';
14
14
  import * as tsclass from '@tsclass/tsclass';
15
15
 
16
16
  declare global {
@@ -7,10 +7,12 @@ import {
7
7
  css,
8
8
  cssManager,
9
9
  unsafeCSS,
10
+ domtools,
10
11
  } from '@design.estate/dees-element';
11
- import * as domtools from '@design.estate/dees-domtools';
12
12
 
13
- import * as shared from './shared/index.js';
13
+ import * as interfaces from '../../ts/interfaces/index.js';
14
+
15
+ import * as shared from '../../ts/shared/index.js';
14
16
  import * as tsclass from '@tsclass/tsclass';
15
17
 
16
18
  declare global {
@@ -30,6 +32,12 @@ export class DePageFooter extends DeesElement {
30
32
  })
31
33
  letterData: tsclass.business.ILetter;
32
34
 
35
+ @property({
36
+ type: Object,
37
+ reflect: true,
38
+ })
39
+ documentSettings: interfaces.IDocumentSettings;
40
+
33
41
  @property({
34
42
  type: Number
35
43
  })
@@ -96,26 +104,26 @@ export class DePageFooter extends DeesElement {
96
104
  return html`
97
105
  <div class="bottomstripe">
98
106
  <div>
99
- <strong>Address:</strong><br />
107
+ <strong>${shared.translation.translate(this.documentSettings.languageCode, 'address', 'Address')}:</strong><br />
100
108
  ${this.letterData.from.name}<br />
101
109
  ${this.letterData.from.address.streetName} ${this.letterData.from.address.houseNumber}<br />
102
110
  ${this.letterData.from.address.postalCode} ${this.letterData.from.address.city}<br />
103
111
  ${this.letterData.from.address.country}
104
112
  </div>
105
113
  <div>
106
- <strong>Registration Info:</strong><br />
114
+ <strong>${shared.translation.translate(this.documentSettings.languageCode, 'registrationInfo', 'Registration Info')}:</strong><br />
107
115
  Amtsgericht Bremen<br />
108
116
  <i>reg-#:</i> HRB 35230 HB<br />
109
117
  <i>vat-id:</i> ${this.letterData.from.vatId}
110
118
  </div>
111
119
  <div>
112
- <strong>Contact Info:</strong><br />
120
+ <strong>${shared.translation.translate(this.documentSettings.languageCode, 'contactInfo', 'Contact Info')}:</strong><br />
113
121
  <i>email:</i> ${this.letterData.from.email}<br />
114
122
  <i>phone:</i> ${this.letterData.from.phone}<br />
115
123
  <i>fax:</i> ${this.letterData.from.fax}
116
124
  </div>
117
125
  <div>
118
- <strong>Bank Connection:</strong><br />
126
+ <strong>${shared.translation.translate(this.documentSettings.languageCode, 'bankConnection', 'Bank Connection')}:</strong><br />
119
127
  <i>beneficiary:</i> ${this.letterData?.from?.name}<br />
120
128
  <i>institution:</i> ${this.letterData?.from?.sepaConnection?.institution}<br />
121
129
  <i>iban:</i> ${this.letterData?.from?.sepaConnection?.iban}<br />