@design.estate/dees-document 1.5.1 → 1.5.3
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 +55 -55
- package/dist_bundle/bundle.js.map +3 -3
- package/dist_ts/00_commitinfo_data.js +1 -1
- 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 +2 -2
- package/dist_ts/plugins.js +3 -3
- package/dist_ts_shared/demoletter.js +3 -3
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/viewer.js +19 -2
- package/dist_watch/bundle.js +40185 -0
- package/dist_watch/bundle.js.map +7 -0
- package/dist_watch/index.html +25 -0
- package/package.json +4 -4
- package/readme.md +32 -26
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.pdfservice.ts +3 -5
- package/ts/helpers.ts +1 -1
- package/ts/paths.ts +4 -1
- package/ts/plugins.ts +3 -12
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/viewer.ts +9 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<html lang="en">
|
|
2
|
+
<head>
|
|
3
|
+
<!--Lets set some basic meta tags-->
|
|
4
|
+
<meta
|
|
5
|
+
name="viewport"
|
|
6
|
+
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"
|
|
7
|
+
/>
|
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
9
|
+
|
|
10
|
+
<!--Lets load standard fonts-->
|
|
11
|
+
<link rel="preconnect" href="https://assetbroker.lossless.one/" crossorigin>
|
|
12
|
+
<link rel="stylesheet" href="https://assetbroker.lossless.one/fonts/fonts.css">
|
|
13
|
+
|
|
14
|
+
<style>
|
|
15
|
+
body {
|
|
16
|
+
margin: 0px;
|
|
17
|
+
background: #222222;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
|
|
21
|
+
<script type="module" src="/bundle.js"></script>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-document",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
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",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"type": "module",
|
|
56
56
|
"repository": {
|
|
57
57
|
"type": "git",
|
|
58
|
-
"url": "git+https://
|
|
58
|
+
"url": "git+https://code.foss.global/designestate/private/dedocument-catalog.git"
|
|
59
59
|
},
|
|
60
60
|
"bugs": {
|
|
61
|
-
"url": "https://
|
|
61
|
+
"url": "https://code.foss.global/designestate/private/dedocument-catalog/issues"
|
|
62
62
|
},
|
|
63
|
-
"homepage": "https://
|
|
63
|
+
"homepage": "https://code.foss.global/designestate/private/dedocument-catalog#readme",
|
|
64
64
|
"keywords": [
|
|
65
65
|
"document generation",
|
|
66
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.5.
|
|
6
|
+
version: '1.5.3',
|
|
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,9 +1,7 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
2
|
import * as helpers from './helpers.js';
|
|
3
3
|
|
|
4
|
-
export interface IPdfServiceConstructorOptions {
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
export interface IPdfServiceConstructorOptions {}
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* a pdf service for generating pdfs
|
|
@@ -44,8 +42,8 @@ export class PdfService {
|
|
|
44
42
|
* creates an letter
|
|
45
43
|
*/
|
|
46
44
|
public async createPdfFromLetterObject(optionsArg: {
|
|
47
|
-
letterData: plugins.tsclass.business.ILetter
|
|
48
|
-
documentSettings: plugins.shared.interfaces.IDocumentSettings
|
|
45
|
+
letterData: plugins.tsclass.business.ILetter;
|
|
46
|
+
documentSettings: plugins.shared.interfaces.IDocumentSettings;
|
|
49
47
|
}) {
|
|
50
48
|
const html = `
|
|
51
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,7 @@
|
|
|
1
1
|
// node native
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
|
|
4
|
-
export {
|
|
5
|
-
path
|
|
6
|
-
}
|
|
4
|
+
export { path };
|
|
7
5
|
|
|
8
6
|
// dees-document scope
|
|
9
7
|
import * as shared from '../dist_ts_shared/index.js';
|
|
@@ -16,16 +14,9 @@ import * as smartjson from '@push.rocks/smartjson';
|
|
|
16
14
|
import * as smartpath from '@push.rocks/smartpath';
|
|
17
15
|
import * as smartpdf from '@push.rocks/smartpdf';
|
|
18
16
|
|
|
19
|
-
export {
|
|
20
|
-
smartfile,
|
|
21
|
-
smartpath,
|
|
22
|
-
smartjson,
|
|
23
|
-
smartpdf,
|
|
24
|
-
}
|
|
17
|
+
export { smartfile, smartpath, smartjson, smartpdf };
|
|
25
18
|
|
|
26
19
|
// @tsclass scope
|
|
27
20
|
import * as tsclass from '@tsclass/tsclass';
|
|
28
21
|
|
|
29
|
-
export {
|
|
30
|
-
tsclass,
|
|
31
|
-
}
|
|
22
|
+
export { tsclass };
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-document',
|
|
6
|
-
version: '1.5.
|
|
6
|
+
version: '1.5.3',
|
|
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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
|
|
3
|
-
import { DeesElement, css, cssManager, customElement, html } from '@design.estate/dees-element';
|
|
3
|
+
import { DeesElement, css, cssManager, customElement, html, property } from '@design.estate/dees-element';
|
|
4
4
|
import { demoFunc } from './viewer.demo.js';
|
|
5
5
|
|
|
6
6
|
declare global {
|
|
@@ -15,8 +15,16 @@ export class DeDocumentViewer extends DeesElement {
|
|
|
15
15
|
public static demo = demoFunc;
|
|
16
16
|
|
|
17
17
|
// INSTANCE
|
|
18
|
+
@property({
|
|
19
|
+
type: Object,
|
|
20
|
+
reflect: true,
|
|
21
|
+
})
|
|
18
22
|
public letterData: plugins.tsclass.business.ILetter = null;
|
|
19
23
|
|
|
24
|
+
@property({
|
|
25
|
+
type: Object,
|
|
26
|
+
reflect: true,
|
|
27
|
+
})
|
|
20
28
|
public documentSettings: plugins.shared.interfaces.IDocumentSettings;
|
|
21
29
|
|
|
22
30
|
public static styles = [
|