fix(core): update
This commit is contained in:
parent
86366d86b9
commit
0d5dc9a82f
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-document',
|
||||
version: '1.0.96',
|
||||
version: '1.0.97',
|
||||
description: 'a catalog for creating documents like invoices'
|
||||
}
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-document',
|
||||
version: '1.0.96',
|
||||
version: '1.0.97',
|
||||
description: 'a catalog for creating documents like invoices'
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ export class DePage extends DeesElement {
|
||||
@property({
|
||||
type: Object,
|
||||
})
|
||||
public letterData: tsclass.business.ILetter = shared.demoLetter;
|
||||
public letterData: tsclass.business.ILetter = null;
|
||||
|
||||
@property({
|
||||
type: Boolean,
|
||||
@ -109,42 +109,48 @@ export class DePage extends DeesElement {
|
||||
return html`
|
||||
<div id="scaleWrapper">
|
||||
<dedocument-pagecontainer .printMode=${this.printMode}>
|
||||
<dedocument-pageheader
|
||||
.letterData=${this.letterData}
|
||||
.pageNumber="${this.pageNumber}"
|
||||
.pageTotalNumber="${this.pageTotalNumber}"
|
||||
></dedocument-pageheader>
|
||||
${this.pageNumber === 1
|
||||
${this.letterData
|
||||
? html`
|
||||
<dedocument-letterheader
|
||||
.pageNumber="${this.pageNumber}"
|
||||
<dedocument-pageheader
|
||||
.letterData=${this.letterData}
|
||||
.pageNumber="${this.pageNumber}"
|
||||
.pageTotalNumber="${this.pageTotalNumber}"
|
||||
></dedocument-letterheader>
|
||||
></dedocument-pageheader>
|
||||
${this.pageNumber === 1
|
||||
? html`
|
||||
<dedocument-letterheader
|
||||
.pageNumber="${this.pageNumber}"
|
||||
.letterData=${this.letterData}
|
||||
.pageTotalNumber="${this.pageTotalNumber}"
|
||||
></dedocument-letterheader>
|
||||
`
|
||||
: html``}
|
||||
<dedocument-pagecontent
|
||||
.pageNumber="${this.pageNumber}"
|
||||
.pageTotalNumber="${this.pageTotalNumber}"
|
||||
.letterData=${this.letterData}
|
||||
><slot></slot
|
||||
></dedocument-pagecontent>
|
||||
<dedocument-pagefooter
|
||||
.letterData=${this.letterData}
|
||||
.pageNumber="${this.pageNumber}"
|
||||
.pageTotalNumber="${this.pageTotalNumber}"
|
||||
></dedocument-pagefooter>
|
||||
<div class="versionOverlay">
|
||||
${this.letterData.versionInfo.type === 'draft'
|
||||
? html`
|
||||
<div class="topInfo">
|
||||
Please note: THIS IS A DRAFT ONLY. NO RIGHTS CAN BE DERIVED FROM THIS.<br />
|
||||
-> Revision/Document version: ${this.letterData.versionInfo.version}
|
||||
</div>
|
||||
<div class="bigDraftText">DRAFT</div>
|
||||
`
|
||||
: html``}
|
||||
</div>
|
||||
`
|
||||
: html``}
|
||||
<dedocument-pagecontent
|
||||
.pageNumber="${this.pageNumber}"
|
||||
.pageTotalNumber="${this.pageTotalNumber}"
|
||||
.letterData=${this.letterData}
|
||||
><slot></slot
|
||||
></dedocument-pagecontent>
|
||||
<dedocument-pagefooter
|
||||
.letterData=${this.letterData}
|
||||
.pageNumber="${this.pageNumber}"
|
||||
.pageTotalNumber="${this.pageTotalNumber}"
|
||||
></dedocument-pagefooter>
|
||||
<div class="versionOverlay">
|
||||
${this.letterData.versionInfo.type === 'draft'
|
||||
? html`
|
||||
<div class="topInfo">
|
||||
Please note: THIS IS A DRAFT ONLY. NO RIGHTS CAN BE DERIVED FROM THIS.<br />
|
||||
-> Revision/Document version: ${this.letterData.versionInfo.version}
|
||||
</div>
|
||||
<div class="bigDraftText">DRAFT</div>
|
||||
`
|
||||
: html``}
|
||||
</div>
|
||||
: html`
|
||||
<slot></slot>
|
||||
`}
|
||||
</dedocument-pagecontainer>
|
||||
</div>
|
||||
`;
|
||||
@ -158,17 +164,17 @@ export class DePage extends DeesElement {
|
||||
|
||||
updated(changedProperties: Map<string | number | symbol, unknown>): void {
|
||||
super.updated(changedProperties);
|
||||
if (changedProperties.has("viewHeight") || changedProperties.has("viewWidth")) {
|
||||
if (changedProperties.has('viewHeight') || changedProperties.has('viewWidth')) {
|
||||
this.adjustScaling();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private adjustScaling() {
|
||||
console.log('page scale adjustment triggered.')
|
||||
const scaleWrapper: HTMLDivElement = this.shadowRoot.querySelector("#scaleWrapper");
|
||||
|
||||
console.log('page scale adjustment triggered.');
|
||||
const scaleWrapper: HTMLDivElement = this.shadowRoot.querySelector('#scaleWrapper');
|
||||
|
||||
if (!scaleWrapper) return;
|
||||
|
||||
|
||||
let scale = 1;
|
||||
if (this.viewHeight) {
|
||||
scale = this.viewHeight / shared.a4Height;
|
||||
@ -177,9 +183,9 @@ export class DePage extends DeesElement {
|
||||
}
|
||||
console.log(`new scale is ${scale}`);
|
||||
scaleWrapper.style.transform = `scale(${scale})`;
|
||||
|
||||
|
||||
// Adjust the outer dimensions so they match the scaled content
|
||||
|
||||
|
||||
// this.style.width = `${shared.a4Width * scale}px`;
|
||||
this.style.height = `${shared.a4Height * scale}px`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user