@design.estate/dees-document 1.4.0 → 1.5.2
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_bundle/bundle.js +164 -164
- package/dist_bundle/bundle.js.map +4 -4
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.pdfservice.d.ts +1 -2
- package/dist_ts/classes.pdfservice.js +1 -1
- package/dist_ts/helpers.js +1 -1
- package/dist_ts/paths.js +1 -1
- package/dist_ts/plugins.d.ts +4 -2
- package/dist_ts/plugins.js +6 -3
- package/dist_ts_shared/demoletter.d.ts +4 -0
- package/{dist_ts/shared → dist_ts_shared}/demoletter.js +3 -3
- package/{dist_ts/shared → dist_ts_shared}/index.d.ts +2 -0
- package/dist_ts_shared/index.js +10 -0
- package/{dist_ts → dist_ts_shared}/interfaces/document.d.ts +2 -2
- package/dist_ts_shared/interfaces/document.js +2 -0
- package/{dist_ts_web/ts → dist_ts_shared}/interfaces/index.js +1 -1
- package/{dist_ts → dist_ts_shared}/interfaces/translation.js +1 -1
- package/dist_ts_shared/plugins.d.ts +2 -0
- package/dist_ts_shared/plugins.js +4 -0
- package/{dist_ts/shared → dist_ts_shared}/translation.d.ts +1 -1
- package/{dist_ts/shared → dist_ts_shared}/translation.js +2 -2
- package/dist_ts_web/{ts_web/00_commitinfo_data.js → 00_commitinfo_data.js} +2 -2
- package/dist_ts_web/{ts_web/elements → elements}/contentinvoice.d.ts +1 -2
- package/dist_ts_web/{ts_web/elements → elements}/contentinvoice.js +8 -10
- package/dist_ts_web/{ts_web/elements → elements}/document.d.ts +2 -3
- package/dist_ts_web/elements/document.demo.js +6 -0
- package/dist_ts_web/{ts_web/elements → elements}/document.js +1 -3
- package/dist_ts_web/{ts_web/elements → elements}/index.d.ts +0 -1
- package/dist_ts_web/{ts_web/elements → elements}/index.js +1 -2
- package/dist_ts_web/{ts_web/elements → elements}/letterheader.d.ts +2 -2
- package/dist_ts_web/{ts_web/elements → elements}/letterheader.js +7 -9
- package/dist_ts_web/{ts_web/elements → elements}/page.d.ts +2 -2
- package/dist_ts_web/{ts_web/elements → elements}/page.js +5 -6
- package/dist_ts_web/{ts_web/elements → elements}/pagecontainer.js +4 -4
- package/dist_ts_web/{ts_web/elements → elements}/pagecontent.d.ts +2 -2
- package/dist_ts_web/{ts_web/elements → elements}/pagecontent.js +5 -7
- package/dist_ts_web/{ts_web/elements → elements}/pagefooter.d.ts +3 -4
- package/dist_ts_web/{ts_web/elements → elements}/pagefooter.js +9 -11
- package/dist_ts_web/{ts_web/elements → elements}/pageheader.d.ts +3 -4
- package/dist_ts_web/{ts_web/elements → elements}/pageheader.js +4 -6
- package/dist_ts_web/{ts_web/elements → elements}/viewer.d.ts +1 -2
- package/dist_ts_web/elements/viewer.demo.js +6 -0
- package/dist_ts_web/{ts_web/elements → elements}/viewer.js +1 -2
- package/dist_ts_web/{ts_web/index.js → index.js} +1 -1
- package/dist_ts_web/{ts_web/pages → pages}/index.js +1 -1
- package/dist_ts_web/pages/page1.js +17 -0
- package/dist_ts_web/{ts_web/pages → pages}/page2.js +1 -1
- package/dist_ts_web/{ts_web/plugins.d.ts → plugins.d.ts} +2 -0
- package/dist_ts_web/plugins.js +14 -0
- package/dist_watch/bundle.js +40174 -0
- package/dist_watch/bundle.js.map +7 -0
- package/dist_watch/index.html +28 -0
- package/package.json +9 -6
- package/readme.md +32 -26
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.pdfservice.ts +3 -6
- package/ts/helpers.ts +1 -1
- package/ts/paths.ts +4 -1
- package/ts/plugins.ts +8 -12
- package/ts/tspublish.json +3 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/contentinvoice.ts +8 -10
- package/ts_web/elements/document.demo.ts +3 -2
- package/ts_web/elements/document.ts +2 -5
- package/ts_web/elements/index.ts +0 -2
- package/ts_web/elements/letterheader.ts +7 -8
- package/ts_web/elements/page.ts +5 -7
- package/ts_web/elements/pagecontainer.ts +3 -3
- package/ts_web/elements/pagecontent.ts +5 -6
- package/ts_web/elements/pagefooter.ts +10 -13
- package/ts_web/elements/pageheader.ts +5 -8
- package/ts_web/elements/viewer.demo.ts +2 -2
- package/ts_web/elements/viewer.ts +1 -2
- package/ts_web/pages/page1.ts +3 -4
- package/ts_web/plugins.ts +5 -0
- package/ts_web/tspublish.json +3 -0
- package/dist_ts/interfaces/document.js +0 -2
- package/dist_ts/interfaces/index.js +0 -3
- package/dist_ts/shared/demoletter.d.ts +0 -4
- package/dist_ts/shared/index.js +0 -8
- package/dist_ts_web/ts/interfaces/document.d.ts +0 -7
- package/dist_ts_web/ts/interfaces/document.js +0 -2
- package/dist_ts_web/ts/interfaces/index.d.ts +0 -2
- package/dist_ts_web/ts/interfaces/translation.d.ts +0 -19
- package/dist_ts_web/ts/interfaces/translation.js +0 -2
- package/dist_ts_web/ts/shared/demoletter.d.ts +0 -4
- package/dist_ts_web/ts/shared/demoletter.js +0 -214
- package/dist_ts_web/ts/shared/index.d.ts +0 -7
- package/dist_ts_web/ts/shared/index.js +0 -8
- package/dist_ts_web/ts/shared/translation.d.ts +0 -19
- package/dist_ts_web/ts/shared/translation.js +0 -113
- package/dist_ts_web/ts_web/elements/document.demo.js +0 -6
- package/dist_ts_web/ts_web/elements/viewer.demo.js +0 -6
- package/dist_ts_web/ts_web/pages/page1.js +0 -18
- package/dist_ts_web/ts_web/plugins.js +0 -11
- package/ts/interfaces/document.ts +0 -8
- package/ts/interfaces/index.ts +0 -2
- package/ts/interfaces/translation.ts +0 -19
- package/ts/shared/demoletter.ts +0 -219
- package/ts/shared/index.ts +0 -9
- package/ts/shared/translation.ts +0 -124
- /package/{dist_ts → dist_ts_shared}/interfaces/index.d.ts +0 -0
- /package/{dist_ts → dist_ts_shared}/interfaces/translation.d.ts +0 -0
- /package/dist_ts_web/{ts_web/00_commitinfo_data.d.ts → 00_commitinfo_data.d.ts} +0 -0
- /package/dist_ts_web/{ts_web/elements → elements}/document.demo.d.ts +0 -0
- /package/dist_ts_web/{ts_web/elements → elements}/pagecontainer.d.ts +0 -0
- /package/dist_ts_web/{ts_web/elements → elements}/viewer.demo.d.ts +0 -0
- /package/dist_ts_web/{ts_web/index.d.ts → index.d.ts} +0 -0
- /package/dist_ts_web/{ts_web/pages → pages}/index.d.ts +0 -0
- /package/dist_ts_web/{ts_web/pages → pages}/page1.d.ts +0 -0
- /package/dist_ts_web/{ts_web/pages → pages}/page2.d.ts +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!--gitzone element-->
|
|
2
|
+
<!-- made by Task Venture Capital GmbH -->
|
|
3
|
+
<!-- checkout https://maintainedby.lossless.com for awesome OpenSource projects -->
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<!--Lets set some basic meta tags-->
|
|
7
|
+
<meta
|
|
8
|
+
name="viewport"
|
|
9
|
+
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"
|
|
10
|
+
/>
|
|
11
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
12
|
+
|
|
13
|
+
<!--Lets load standard fonts-->
|
|
14
|
+
<link rel="preconnect" href="https://assetbroker.lossless.one/" crossorigin>
|
|
15
|
+
<link rel="stylesheet" href="https://assetbroker.lossless.one/fonts/fonts.css">
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
body {
|
|
19
|
+
margin: 0px;
|
|
20
|
+
background: #222222;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
|
|
24
|
+
<script type="module" src="/bundle.js"></script>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-document",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.",
|
|
6
6
|
"main": "dist_ts_web/index.js",
|
|
7
7
|
"typings": "dist_ts_web/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
"./
|
|
9
|
+
".": "./dist_ts/index.js",
|
|
10
|
+
"./node": "./dist_ts/index.js",
|
|
11
|
+
"./web": "./dist_ts_web/index.js",
|
|
12
|
+
"./shared": "./dist_ts_shared/index.js",
|
|
13
|
+
"./interfaces": "./dist_ts_shared/interfaces/index.js"
|
|
11
14
|
},
|
|
12
15
|
"author": "Lossless GmbH",
|
|
13
16
|
"license": "MIT",
|
|
@@ -52,12 +55,12 @@
|
|
|
52
55
|
"type": "module",
|
|
53
56
|
"repository": {
|
|
54
57
|
"type": "git",
|
|
55
|
-
"url": "git+https://
|
|
58
|
+
"url": "git+https://code.foss.global/designestate/private/dedocument-catalog.git"
|
|
56
59
|
},
|
|
57
60
|
"bugs": {
|
|
58
|
-
"url": "https://
|
|
61
|
+
"url": "https://code.foss.global/designestate/private/dedocument-catalog/issues"
|
|
59
62
|
},
|
|
60
|
-
"homepage": "https://
|
|
63
|
+
"homepage": "https://code.foss.global/designestate/private/dedocument-catalog#readme",
|
|
61
64
|
"keywords": [
|
|
62
65
|
"document generation",
|
|
63
66
|
"invoice automation",
|
package/readme.md
CHANGED
|
@@ -16,7 +16,7 @@ This command will install the package and add it to your project's dependencies,
|
|
|
16
16
|
|
|
17
17
|
The `@design.estate/dees-document` package serves as a robust framework to facilitate the generation of business documents, such as invoices, contracts, and reports. Leveraging modern web technologies, this package integrates seamlessly with TypeScript and ES modules, offering a type-safe environment conducive to efficient, dynamic document creation.
|
|
18
18
|
|
|
19
|
-
Below, we provide a detailed guide for utilizing this package, from initializing your environment to generating complete PDF documents.
|
|
19
|
+
Below, we provide a detailed guide for utilizing this package, from initializing your environment to generating complete PDF documents.
|
|
20
20
|
|
|
21
21
|
### Setting Up the Environment
|
|
22
22
|
|
|
@@ -47,48 +47,48 @@ import { ILetter } from '@design.estate/dees-document';
|
|
|
47
47
|
|
|
48
48
|
const invoiceTemplate: ILetter = {
|
|
49
49
|
from: {
|
|
50
|
-
name:
|
|
50
|
+
name: 'Your Company Name',
|
|
51
51
|
address: {
|
|
52
|
-
streetName:
|
|
53
|
-
houseNumber:
|
|
54
|
-
city:
|
|
55
|
-
country:
|
|
56
|
-
postalCode:
|
|
52
|
+
streetName: 'Your Street',
|
|
53
|
+
houseNumber: '123',
|
|
54
|
+
city: 'Your City',
|
|
55
|
+
country: 'Your Country',
|
|
56
|
+
postalCode: '12345',
|
|
57
57
|
},
|
|
58
|
-
email:
|
|
59
|
-
phone:
|
|
58
|
+
email: 'your-email@example.com',
|
|
59
|
+
phone: '123-456-7890',
|
|
60
60
|
},
|
|
61
61
|
to: {
|
|
62
|
-
name:
|
|
62
|
+
name: 'Recipient Company Name',
|
|
63
63
|
address: {
|
|
64
|
-
streetName:
|
|
65
|
-
houseNumber:
|
|
66
|
-
city:
|
|
67
|
-
country:
|
|
68
|
-
postalCode:
|
|
64
|
+
streetName: 'Recipient Street',
|
|
65
|
+
houseNumber: '456',
|
|
66
|
+
city: 'Recipient City',
|
|
67
|
+
country: 'Recipient Country',
|
|
68
|
+
postalCode: '67890',
|
|
69
69
|
},
|
|
70
|
-
email:
|
|
71
|
-
phone:
|
|
70
|
+
email: 'recipient-email@example.com',
|
|
71
|
+
phone: '098-765-4321',
|
|
72
72
|
},
|
|
73
73
|
content: {
|
|
74
74
|
invoiceData: {
|
|
75
75
|
items: [
|
|
76
76
|
{
|
|
77
|
-
name:
|
|
77
|
+
name: 'Service or Product Name',
|
|
78
78
|
unitQuantity: 2,
|
|
79
|
-
unitNetPrice: 100.
|
|
79
|
+
unitNetPrice: 100.0,
|
|
80
80
|
unitType: 'service',
|
|
81
81
|
vatPercentage: 19,
|
|
82
82
|
currency: 'EUR',
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
}
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
86
|
},
|
|
87
|
-
subject:
|
|
87
|
+
subject: 'Invoice for Services Rendered',
|
|
88
88
|
date: new Date().getTime(),
|
|
89
89
|
versionInfo: {
|
|
90
|
-
type:
|
|
91
|
-
version:
|
|
90
|
+
type: 'final',
|
|
91
|
+
version: '1.0.0',
|
|
92
92
|
},
|
|
93
93
|
};
|
|
94
94
|
```
|
|
@@ -133,22 +133,28 @@ This script encompasses initializing services and generating a PDF in a streamli
|
|
|
133
133
|
`@design.estate/dees-document` provides several advanced functionalities, enabling rich document creation:
|
|
134
134
|
|
|
135
135
|
1. **Custom Templates & Styling**
|
|
136
|
+
|
|
136
137
|
- Customize the styling through CSS or using inline styles in TypeScript.
|
|
137
138
|
- Templates can be adjusted to present different document types (e.g., contracts, reports).
|
|
138
139
|
|
|
139
140
|
2. **Modular Components and Reuse**
|
|
141
|
+
|
|
140
142
|
- Utilize modular components to create reusable parts across different documents, enhancing maintainability and reducing redundancy.
|
|
141
143
|
|
|
142
144
|
3. **Interactive Documents**
|
|
145
|
+
|
|
143
146
|
- Integrate interactivities like forms, buttons, and interactive charts within your documents.
|
|
144
147
|
|
|
145
148
|
4. **Localization Support**
|
|
149
|
+
|
|
146
150
|
- Documents can be localized to support multiple languages, enhancing accessibility and usability.
|
|
147
151
|
|
|
148
152
|
5. **Responsive and Adaptive Designs**
|
|
153
|
+
|
|
149
154
|
- Create documents that adjust layout dynamically depending on print or digital medium, maintaining consistency across platforms.
|
|
150
155
|
|
|
151
156
|
6. **Security Features**
|
|
157
|
+
|
|
152
158
|
- Apply digital signatures and encrypt sensitive documents to ensure secure and authentic document distribution.
|
|
153
159
|
|
|
154
160
|
7. **Complex Business Logic**
|
|
@@ -175,7 +181,7 @@ From custom templates to localization and advanced security features, this modul
|
|
|
175
181
|
|
|
176
182
|
## License and Legal Information
|
|
177
183
|
|
|
178
|
-
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
184
|
+
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
179
185
|
|
|
180
186
|
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
181
187
|
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-document',
|
|
6
|
-
version: '1.
|
|
6
|
+
version: '1.5.2',
|
|
7
7
|
description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.'
|
|
8
8
|
}
|
package/ts/classes.pdfservice.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
2
|
import * as helpers from './helpers.js';
|
|
3
|
-
import type { IDocumentSettings} from '../ts/interfaces/index.js';
|
|
4
3
|
|
|
5
|
-
export interface IPdfServiceConstructorOptions {
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
export interface IPdfServiceConstructorOptions {}
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* a pdf service for generating pdfs
|
|
@@ -45,8 +42,8 @@ export class PdfService {
|
|
|
45
42
|
* creates an letter
|
|
46
43
|
*/
|
|
47
44
|
public async createPdfFromLetterObject(optionsArg: {
|
|
48
|
-
letterData: plugins.tsclass.business.ILetter
|
|
49
|
-
documentSettings: IDocumentSettings
|
|
45
|
+
letterData: plugins.tsclass.business.ILetter;
|
|
46
|
+
documentSettings: plugins.shared.interfaces.IDocumentSettings;
|
|
50
47
|
}) {
|
|
51
48
|
const html = `
|
|
52
49
|
<script type="module">
|
package/ts/helpers.ts
CHANGED
package/ts/paths.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
2
|
|
|
3
|
-
export const packageDir = plugins.path.join(
|
|
3
|
+
export const packageDir = plugins.path.join(
|
|
4
|
+
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
|
5
|
+
'../',
|
|
6
|
+
);
|
|
4
7
|
|
|
5
8
|
export const nogitDir = plugins.path.join(packageDir, '.nogit/');
|
|
6
9
|
plugins.smartfile.fs.ensureDirSync(nogitDir);
|
package/ts/plugins.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// node native
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export { path };
|
|
5
|
+
|
|
6
|
+
// dees-document scope
|
|
7
|
+
import * as shared from '../dist_ts_shared/index.js';
|
|
8
|
+
|
|
9
|
+
export { shared };
|
|
7
10
|
|
|
8
11
|
// @push.rocks/scope
|
|
9
12
|
import * as smartfile from '@push.rocks/smartfile';
|
|
@@ -11,16 +14,9 @@ import * as smartjson from '@push.rocks/smartjson';
|
|
|
11
14
|
import * as smartpath from '@push.rocks/smartpath';
|
|
12
15
|
import * as smartpdf from '@push.rocks/smartpdf';
|
|
13
16
|
|
|
14
|
-
export {
|
|
15
|
-
smartfile,
|
|
16
|
-
smartpath,
|
|
17
|
-
smartjson,
|
|
18
|
-
smartpdf,
|
|
19
|
-
}
|
|
17
|
+
export { smartfile, smartpath, smartjson, smartpdf };
|
|
20
18
|
|
|
21
19
|
// @tsclass scope
|
|
22
20
|
import * as tsclass from '@tsclass/tsclass';
|
|
23
21
|
|
|
24
|
-
export {
|
|
25
|
-
tsclass,
|
|
26
|
-
}
|
|
22
|
+
export { tsclass };
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-document',
|
|
6
|
-
version: '1.
|
|
6
|
+
version: '1.5.2',
|
|
7
7
|
description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.'
|
|
8
8
|
}
|
|
@@ -15,8 +15,6 @@ import {
|
|
|
15
15
|
domtools,
|
|
16
16
|
} from '@design.estate/dees-element';
|
|
17
17
|
import * as plugins from '../plugins.js';
|
|
18
|
-
import * as shared from '../../ts/shared/index.js';
|
|
19
|
-
import * as interfaces from '../../ts/interfaces/index.js';
|
|
20
18
|
|
|
21
19
|
|
|
22
20
|
declare global {
|
|
@@ -49,7 +47,7 @@ export class DeContentInvoice extends DeesElement {
|
|
|
49
47
|
type: Object,
|
|
50
48
|
reflect: true,
|
|
51
49
|
})
|
|
52
|
-
public documentSettings: interfaces.IDocumentSettings;
|
|
50
|
+
public documentSettings: plugins.shared.interfaces.IDocumentSettings;
|
|
53
51
|
|
|
54
52
|
constructor() {
|
|
55
53
|
super();
|
|
@@ -281,12 +279,12 @@ export class DeContentInvoice extends DeesElement {
|
|
|
281
279
|
</style>
|
|
282
280
|
<div>We hereby invoice products and services provided to you by Lossless GmbH:</div>
|
|
283
281
|
<div class="grid topLine dataHeader">
|
|
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>
|
|
282
|
+
<div class="lineItem">${plugins.shared.translation.translate(this.documentSettings.languageCode, 'itemPos', 'Item Pos.')}</div>
|
|
283
|
+
<div class="lineItem">${plugins.shared.translation.translate(this.documentSettings.languageCode, 'description', 'Description')}</div>
|
|
284
|
+
<div class="lineItem">${plugins.shared.translation.translate(this.documentSettings.languageCode, 'quantity', 'Quantity')}</div>
|
|
285
|
+
<div class="lineItem">${plugins.shared.translation.translate(this.documentSettings.languageCode, 'unitType', 'Unit Type')}</div>
|
|
286
|
+
<div class="lineItem">${plugins.shared.translation.translate(this.documentSettings.languageCode, 'unitNetPrice', 'Unit Net Price')}</div>
|
|
287
|
+
<div class="lineItem">${plugins.shared.translation.translate(this.documentSettings.languageCode, 'totalNetPrice', 'Total Net Price')}</div>
|
|
290
288
|
</div>
|
|
291
289
|
${(() => {
|
|
292
290
|
let counter = 1;
|
|
@@ -335,7 +333,7 @@ export class DeContentInvoice extends DeesElement {
|
|
|
335
333
|
${this.letterData?.content.invoiceData.reverseCharge
|
|
336
334
|
? html`
|
|
337
335
|
<div class="taxNote">
|
|
338
|
-
${shared.translation.translate(this.documentSettings.languageCode, 'reverseVatNote', 'VAT arises on a reverse charge basis and is payable by the customer.')}
|
|
336
|
+
${plugins.shared.translation.translate(this.documentSettings.languageCode, 'reverseVatNote', 'VAT arises on a reverse charge basis and is payable by the customer.')}
|
|
339
337
|
</div>
|
|
340
338
|
`
|
|
341
339
|
: ``}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
2
3
|
import { html } from '@design.estate/dees-element';
|
|
3
4
|
|
|
4
5
|
export const demoFunc = () => html`
|
|
5
|
-
<dedocument-dedocument .format="${'a4'}" .letterData=${shared.demoLetter}></dedocument-dedocument>
|
|
6
|
+
<dedocument-dedocument .format="${'a4'}" .letterData=${plugins.shared.demoLetter}></dedocument-dedocument>
|
|
6
7
|
`;
|
|
@@ -10,11 +10,9 @@ import {
|
|
|
10
10
|
unsafeCSS,
|
|
11
11
|
domtools,
|
|
12
12
|
} from '@design.estate/dees-element';
|
|
13
|
-
|
|
14
|
-
import * as interfaces from '../../ts/interfaces/index.js';
|
|
15
13
|
import * as plugins from '../plugins.js';
|
|
16
14
|
|
|
17
|
-
export const defaultDocumentSettings: interfaces.IDocumentSettings = {
|
|
15
|
+
export const defaultDocumentSettings: plugins.shared.interfaces.IDocumentSettings = {
|
|
18
16
|
enableTopDraftText: true,
|
|
19
17
|
enableDefaultHeader: true,
|
|
20
18
|
enableDefaultFooter: true,
|
|
@@ -24,7 +22,6 @@ export const defaultDocumentSettings: interfaces.IDocumentSettings = {
|
|
|
24
22
|
import { DePage } from './page.js';
|
|
25
23
|
import { DeContentInvoice } from './contentinvoice.js';
|
|
26
24
|
|
|
27
|
-
import * as shared from '../../ts/shared/index.js';
|
|
28
25
|
import { demoFunc } from './document.demo.js';
|
|
29
26
|
|
|
30
27
|
declare global {
|
|
@@ -85,7 +82,7 @@ export class DeDocument extends DeesElement {
|
|
|
85
82
|
}
|
|
86
83
|
},
|
|
87
84
|
})
|
|
88
|
-
public documentSettings: interfaces.IDocumentSettings = defaultDocumentSettings;
|
|
85
|
+
public documentSettings: plugins.shared.interfaces.IDocumentSettings = defaultDocumentSettings;
|
|
89
86
|
|
|
90
87
|
constructor() {
|
|
91
88
|
super();
|
package/ts_web/elements/index.ts
CHANGED
|
@@ -7,11 +7,10 @@ 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
|
|
14
|
-
import * as tsclass from '@tsclass/tsclass';
|
|
13
|
+
import * as plugins from '../plugins.js';
|
|
15
14
|
|
|
16
15
|
declare global {
|
|
17
16
|
interface HTMLElementTagNameMap {
|
|
@@ -22,14 +21,14 @@ declare global {
|
|
|
22
21
|
@customElement('dedocument-letterheader')
|
|
23
22
|
export class DeLetterHeader extends DeesElement {
|
|
24
23
|
public static demo = () => html`
|
|
25
|
-
<dedocument-letterheader .format="${'a4'}" .letterData=${shared.demoLetter}></dedocument-letterheader>
|
|
24
|
+
<dedocument-letterheader .format="${'a4'}" .letterData=${plugins.shared.demoLetter}></dedocument-letterheader>
|
|
26
25
|
`;
|
|
27
26
|
|
|
28
27
|
@property({
|
|
29
28
|
type: Object,
|
|
30
29
|
reflect: true
|
|
31
30
|
})
|
|
32
|
-
public letterData: tsclass.business.ILetter;
|
|
31
|
+
public letterData: plugins.tsclass.business.ILetter;
|
|
33
32
|
|
|
34
33
|
@property({
|
|
35
34
|
type: Number,
|
|
@@ -60,7 +59,7 @@ export class DeLetterHeader extends DeesElement {
|
|
|
60
59
|
display: block;
|
|
61
60
|
overflow: hidden;
|
|
62
61
|
top: 200px;
|
|
63
|
-
right: ${unsafeCSS(shared.rightMargin + 'px')};
|
|
62
|
+
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
|
64
63
|
width: 200px;
|
|
65
64
|
text-align: right;
|
|
66
65
|
}
|
|
@@ -74,14 +73,14 @@ export class DeLetterHeader extends DeesElement {
|
|
|
74
73
|
.date {
|
|
75
74
|
position: absolute;
|
|
76
75
|
top: 180px;
|
|
77
|
-
right: ${unsafeCSS(shared.rightMargin + 'px')};
|
|
76
|
+
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
|
78
77
|
text-align: right;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
.address {
|
|
82
81
|
position: absolute;
|
|
83
82
|
top: 180px;
|
|
84
|
-
left: ${unsafeCSS(shared.leftMargin + 'px')};
|
|
83
|
+
left: ${unsafeCSS(plugins.shared.leftMargin + 'px')};
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
.address .from {
|
package/ts_web/elements/page.ts
CHANGED
|
@@ -11,12 +11,10 @@ import {
|
|
|
11
11
|
domtools,
|
|
12
12
|
} from '@design.estate/dees-element';
|
|
13
13
|
|
|
14
|
-
import * as
|
|
14
|
+
import * as plugins from '../plugins.js';
|
|
15
15
|
|
|
16
16
|
import { defaultDocumentSettings } from './document.js';
|
|
17
17
|
|
|
18
|
-
import * as shared from '../../ts/shared/index.js';
|
|
19
|
-
|
|
20
18
|
declare global {
|
|
21
19
|
interface HTMLElementTagNameMap {
|
|
22
20
|
'dedocument-page': DePage;
|
|
@@ -67,7 +65,7 @@ export class DePage extends DeesElement {
|
|
|
67
65
|
type: Object,
|
|
68
66
|
reflect: true,
|
|
69
67
|
})
|
|
70
|
-
public documentSettings: interfaces.IDocumentSettings = defaultDocumentSettings;
|
|
68
|
+
public documentSettings: plugins.shared.interfaces.IDocumentSettings = defaultDocumentSettings;
|
|
71
69
|
|
|
72
70
|
constructor() {
|
|
73
71
|
super();
|
|
@@ -204,9 +202,9 @@ export class DePage extends DeesElement {
|
|
|
204
202
|
|
|
205
203
|
let scale = 1;
|
|
206
204
|
if (this.viewHeight) {
|
|
207
|
-
scale = this.viewHeight / shared.a4Height;
|
|
205
|
+
scale = this.viewHeight / plugins.shared.a4Height;
|
|
208
206
|
} else if (this.viewWidth) {
|
|
209
|
-
scale = this.viewWidth / shared.a4Width;
|
|
207
|
+
scale = this.viewWidth / plugins.shared.a4Width;
|
|
210
208
|
}
|
|
211
209
|
console.log(`new scale is ${scale}`);
|
|
212
210
|
scaleWrapper.style.transform = `scale(${scale})`;
|
|
@@ -214,6 +212,6 @@ export class DePage extends DeesElement {
|
|
|
214
212
|
// Adjust the outer dimensions so they match the scaled content
|
|
215
213
|
|
|
216
214
|
// this.style.width = `${shared.a4Width * scale}px`;
|
|
217
|
-
this.style.height = `${shared.a4Height * scale}px`;
|
|
215
|
+
this.style.height = `${plugins.shared.a4Height * scale}px`;
|
|
218
216
|
}
|
|
219
217
|
}
|
|
@@ -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
|
|
13
|
+
import * as plugins from '../plugins.js';
|
|
14
14
|
|
|
15
15
|
declare global {
|
|
16
16
|
interface HTMLElementTagNameMap {
|
|
@@ -47,8 +47,8 @@ export class DePageContainer extends DeesElement {
|
|
|
47
47
|
background: white;
|
|
48
48
|
color: #333;
|
|
49
49
|
padding: 0px;
|
|
50
|
-
width: ${unsafeCSS(shared.a4Width + 'px')};
|
|
51
|
-
height: ${unsafeCSS(shared.a4Height + 'px')};
|
|
50
|
+
width: ${unsafeCSS(plugins.shared.a4Width + 'px')};
|
|
51
|
+
height: ${unsafeCSS(plugins.shared.a4Height + 'px')};
|
|
52
52
|
position: relative;
|
|
53
53
|
border-radius: 3px;
|
|
54
54
|
overflow: hidden;
|
|
@@ -7,11 +7,10 @@ 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
|
|
14
|
-
import * as tsclass from '@tsclass/tsclass';
|
|
13
|
+
import * as plugins from '../plugins.js';
|
|
15
14
|
|
|
16
15
|
declare global {
|
|
17
16
|
interface HTMLElementTagNameMap {
|
|
@@ -28,7 +27,7 @@ export class DePageContent extends DeesElement {
|
|
|
28
27
|
@property({
|
|
29
28
|
type: Number,
|
|
30
29
|
})
|
|
31
|
-
public letterData: tsclass.business.ILetter;
|
|
30
|
+
public letterData: plugins.tsclass.business.ILetter;
|
|
32
31
|
|
|
33
32
|
@property({
|
|
34
33
|
type: Number,
|
|
@@ -55,8 +54,8 @@ export class DePageContent extends DeesElement {
|
|
|
55
54
|
.content {
|
|
56
55
|
position: absolute;
|
|
57
56
|
|
|
58
|
-
left: ${unsafeCSS(shared.leftMargin + 'px')};
|
|
59
|
-
right: ${unsafeCSS(shared.rightMargin + 'px')};
|
|
57
|
+
left: ${unsafeCSS(plugins.shared.leftMargin + 'px')};
|
|
58
|
+
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
|
60
59
|
bottom: 170px;
|
|
61
60
|
overflow: visible;
|
|
62
61
|
}
|
|
@@ -10,10 +10,7 @@ import {
|
|
|
10
10
|
domtools,
|
|
11
11
|
} from '@design.estate/dees-element';
|
|
12
12
|
|
|
13
|
-
import * as
|
|
14
|
-
|
|
15
|
-
import * as shared from '../../ts/shared/index.js';
|
|
16
|
-
import * as tsclass from '@tsclass/tsclass';
|
|
13
|
+
import * as plugins from '../plugins.js';
|
|
17
14
|
|
|
18
15
|
declare global {
|
|
19
16
|
interface HTMLElementTagNameMap {
|
|
@@ -30,13 +27,13 @@ export class DePageFooter extends DeesElement {
|
|
|
30
27
|
@property({
|
|
31
28
|
type: Object,
|
|
32
29
|
})
|
|
33
|
-
letterData: tsclass.business.ILetter;
|
|
30
|
+
letterData: plugins.tsclass.business.ILetter;
|
|
34
31
|
|
|
35
32
|
@property({
|
|
36
33
|
type: Object,
|
|
37
34
|
reflect: true,
|
|
38
35
|
})
|
|
39
|
-
documentSettings: interfaces.IDocumentSettings;
|
|
36
|
+
documentSettings: plugins.shared.interfaces.IDocumentSettings;
|
|
40
37
|
|
|
41
38
|
@property({
|
|
42
39
|
type: Number
|
|
@@ -69,7 +66,7 @@ export class DePageFooter extends DeesElement {
|
|
|
69
66
|
right: 0px;
|
|
70
67
|
height: 130px;
|
|
71
68
|
content: '';
|
|
72
|
-
padding: 30px ${unsafeCSS(shared.rightMargin + 'px')} 10px ${unsafeCSS(shared.leftMargin + 'px')};
|
|
69
|
+
padding: 30px ${unsafeCSS(plugins.shared.rightMargin + 'px')} 10px ${unsafeCSS(plugins.shared.leftMargin + 'px')};
|
|
73
70
|
grid-template-columns: calc(100% / 4) calc(100% / 4) calc(100% / 4) calc(100% / 4);
|
|
74
71
|
grid-gap: 5px;
|
|
75
72
|
border-top: 2px solid #e4002b;
|
|
@@ -78,7 +75,7 @@ export class DePageFooter extends DeesElement {
|
|
|
78
75
|
.bottomstripe .pageNumber {
|
|
79
76
|
position: absolute;
|
|
80
77
|
top: 0px;
|
|
81
|
-
right: ${unsafeCSS(shared.rightMargin + 'px')};
|
|
78
|
+
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
|
82
79
|
background: #e4002b;
|
|
83
80
|
padding: 3px;
|
|
84
81
|
font-size: 9px;
|
|
@@ -89,7 +86,7 @@ export class DePageFooter extends DeesElement {
|
|
|
89
86
|
.bottomstripe .documentTitle {
|
|
90
87
|
position: absolute;
|
|
91
88
|
top: -18px;
|
|
92
|
-
right: ${unsafeCSS(shared.rightMargin + 'px')};
|
|
89
|
+
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
|
93
90
|
background: #dddddd;
|
|
94
91
|
padding: 3px;
|
|
95
92
|
font-size: 9px;
|
|
@@ -104,26 +101,26 @@ export class DePageFooter extends DeesElement {
|
|
|
104
101
|
return html`
|
|
105
102
|
<div class="bottomstripe">
|
|
106
103
|
<div>
|
|
107
|
-
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'address', 'Address')}:</strong><br />
|
|
104
|
+
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'address', 'Address')}:</strong><br />
|
|
108
105
|
${this.letterData.from.name}<br />
|
|
109
106
|
${this.letterData.from.address.streetName} ${this.letterData.from.address.houseNumber}<br />
|
|
110
107
|
${this.letterData.from.address.postalCode} ${this.letterData.from.address.city}<br />
|
|
111
108
|
${this.letterData.from.address.country}
|
|
112
109
|
</div>
|
|
113
110
|
<div>
|
|
114
|
-
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'registrationInfo', 'Registration Info')}:</strong><br />
|
|
111
|
+
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'registrationInfo', 'Registration Info')}:</strong><br />
|
|
115
112
|
Amtsgericht Bremen<br />
|
|
116
113
|
<i>reg-#:</i> HRB 35230 HB<br />
|
|
117
114
|
<i>vat-id:</i> ${this.letterData.from.vatId}
|
|
118
115
|
</div>
|
|
119
116
|
<div>
|
|
120
|
-
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'contactInfo', 'Contact Info')}:</strong><br />
|
|
117
|
+
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'contactInfo', 'Contact Info')}:</strong><br />
|
|
121
118
|
<i>email:</i> ${this.letterData.from.email}<br />
|
|
122
119
|
<i>phone:</i> ${this.letterData.from.phone}<br />
|
|
123
120
|
<i>fax:</i> ${this.letterData.from.fax}
|
|
124
121
|
</div>
|
|
125
122
|
<div>
|
|
126
|
-
<strong>${shared.translation.translate(this.documentSettings.languageCode, 'bankConnection', 'Bank Connection')}:</strong><br />
|
|
123
|
+
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'bankConnection', 'Bank Connection')}:</strong><br />
|
|
127
124
|
<i>beneficiary:</i> ${this.letterData?.from?.name}<br />
|
|
128
125
|
<i>institution:</i> ${this.letterData?.from?.sepaConnection?.institution}<br />
|
|
129
126
|
<i>iban:</i> ${this.letterData?.from?.sepaConnection?.iban}<br />
|