From 2e3739e7651993cccd5f6b661629702f1d7e7b3d Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sat, 7 Dec 2024 14:22:42 +0100 Subject: [PATCH] fix(document rendering): Fixed overflow issues in document and page elements --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts_web/00_commitinfo_data.ts | 2 +- ts_web/elements/document.ts | 26 +++++++++++++++++++++++++- ts_web/elements/page.ts | 2 +- 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 9a9bf98..08ee52b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # 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) Fix layout scaling adjustment for page component diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index f66a681..b5628af 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { 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.' } diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index f66a681..b5628af 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { 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.' } diff --git a/ts_web/elements/document.ts b/ts_web/elements/document.ts index 5f07993..dd16eeb 100644 --- a/ts_web/elements/document.ts +++ b/ts_web/elements/document.ts @@ -115,11 +115,35 @@ export class DeDocument extends DeesElement { } public async firstUpdated(_changedProperties: Map) { - domtools.plugins.smartdelay.delayFor(0).then(() => { + domtools.plugins.smartdelay.delayFor(0).then(async () => { this.documentSettings = { ...defaultDocumentSettings, ...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) => { for (const entry of entries) { diff --git a/ts_web/elements/page.ts b/ts_web/elements/page.ts index 5ba7622..2ec73c6 100644 --- a/ts_web/elements/page.ts +++ b/ts_web/elements/page.ts @@ -77,6 +77,7 @@ export class DePage extends DeesElement { css` :host { display: block; + overflow: hidden; } #scaleWrapper { @@ -211,7 +212,6 @@ export class DePage extends DeesElement { // Adjust the outer dimensions so they match the scaled content - this.style.overflow = 'hidden'; this.style.width = `${plugins.shared.a4Width * scale}px`; this.style.height = `${plugins.shared.a4Height * scale}px`; }