fix(document rendering): Fixed overflow issues in document and page elements

This commit is contained in:
Philipp Kunz 2024-12-07 14:22:42 +01:00
parent 76d829f5c7
commit 2e3739e765
5 changed files with 34 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 2024-12-07 - 1.6.7 - fix(document rendering)
Fixed overflow issues in document and page elements
- Ensured content overflow handling in document.ts
- Adjusted page element overflow settings in page.ts
## 2024-12-07 - 1.6.6 - fix(page-render) ## 2024-12-07 - 1.6.6 - fix(page-render)
Fix layout scaling adjustment for page component Fix layout scaling adjustment for page component

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@design.estate/dees-document', name: '@design.estate/dees-document',
version: '1.6.6', version: '1.6.7',
description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.' description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.'
} }

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@design.estate/dees-document', name: '@design.estate/dees-document',
version: '1.6.6', version: '1.6.7',
description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.' description: 'A sophisticated framework for dynamically generating and rendering business documents like invoices with modern web technologies, featuring PDF creation, templating, and automation.'
} }

View File

@ -115,11 +115,35 @@ export class DeDocument extends DeesElement {
} }
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) { public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
domtools.plugins.smartdelay.delayFor(0).then(() => { domtools.plugins.smartdelay.delayFor(0).then(async () => {
this.documentSettings = { this.documentSettings = {
...defaultDocumentSettings, ...defaultDocumentSettings,
...this.documentSettings, ...this.documentSettings,
} }
while (false) {
await domtools.plugins.smartdelay.delayFor(1000);
this.letterData = {
...this.letterData,
content: {
...this.letterData.content,
invoiceData: {
...this.letterData.content.invoiceData,
items: [
...this.letterData.content.invoiceData.items,
{
name: 'Test Item',
unitQuantity: 1,
unitNetPrice: 100,
unitType: 'hours',
vatPercentage: 19,
position: 1,
},
],
},
}
}
}
}); });
const resizeObserver = new ResizeObserver((entries) => { const resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) { for (const entry of entries) {

View File

@ -77,6 +77,7 @@ export class DePage extends DeesElement {
css` css`
:host { :host {
display: block; display: block;
overflow: hidden;
} }
#scaleWrapper { #scaleWrapper {
@ -211,7 +212,6 @@ export class DePage extends DeesElement {
// Adjust the outer dimensions so they match the scaled content // Adjust the outer dimensions so they match the scaled content
this.style.overflow = 'hidden';
this.style.width = `${plugins.shared.a4Width * scale}px`; this.style.width = `${plugins.shared.a4Width * scale}px`;
this.style.height = `${plugins.shared.a4Height * scale}px`; this.style.height = `${plugins.shared.a4Height * scale}px`;
} }