2023-10-16 16:28:12 +00:00
|
|
|
import {
|
|
|
|
DeesElement,
|
|
|
|
property,
|
|
|
|
html,
|
|
|
|
customElement,
|
|
|
|
type TemplateResult,
|
|
|
|
css,
|
|
|
|
cssManager,
|
|
|
|
unsafeCSS,
|
2024-12-02 11:46:28 +00:00
|
|
|
domtools,
|
2023-10-16 16:28:12 +00:00
|
|
|
} from '@design.estate/dees-element';
|
2024-12-02 11:46:28 +00:00
|
|
|
|
2024-12-02 15:04:58 +00:00
|
|
|
import * as plugins from '../plugins.js';
|
2024-12-05 19:20:29 +00:00
|
|
|
import { dedocumentSharedStyle } from '../style.js';
|
2023-10-16 16:28:12 +00:00
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface HTMLElementTagNameMap {
|
|
|
|
'dedocument-pagefooter': DePageFooter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@customElement('dedocument-pagefooter')
|
|
|
|
export class DePageFooter extends DeesElement {
|
|
|
|
public static demo = () => html`
|
|
|
|
<dedocument-pagefooter .format="${'a4'}"></dedocument-pagefooter>
|
|
|
|
`;
|
|
|
|
|
|
|
|
@property({
|
|
|
|
type: Object,
|
|
|
|
})
|
2024-12-02 15:04:58 +00:00
|
|
|
letterData: plugins.tsclass.business.ILetter;
|
2023-10-16 16:28:12 +00:00
|
|
|
|
2024-12-02 11:46:28 +00:00
|
|
|
@property({
|
|
|
|
type: Object,
|
|
|
|
reflect: true,
|
|
|
|
})
|
2024-12-02 15:04:58 +00:00
|
|
|
documentSettings: plugins.shared.interfaces.IDocumentSettings;
|
2024-12-02 11:46:28 +00:00
|
|
|
|
2023-10-16 16:28:12 +00:00
|
|
|
@property({
|
|
|
|
type: Number
|
|
|
|
})
|
|
|
|
public pageNumber: number = 1;
|
|
|
|
|
|
|
|
@property({
|
|
|
|
type: Number
|
|
|
|
})
|
|
|
|
public pageTotalNumber: number = 1;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
domtools.DomTools.setupDomTools();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static styles = [
|
|
|
|
domtools.elementBasic.staticStyles,
|
2024-12-05 19:20:29 +00:00
|
|
|
dedocumentSharedStyle,
|
2023-10-16 16:28:12 +00:00
|
|
|
css`
|
|
|
|
:host {
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
.bottomstripe {
|
|
|
|
position: absolute;
|
|
|
|
display: grid;
|
|
|
|
font-size: 11px;
|
|
|
|
overflow: visible;
|
|
|
|
bottom: 0px;
|
|
|
|
left: 0px;
|
|
|
|
right: 0px;
|
|
|
|
height: 130px;
|
|
|
|
content: '';
|
2024-12-02 15:04:58 +00:00
|
|
|
padding: 30px ${unsafeCSS(plugins.shared.rightMargin + 'px')} 10px ${unsafeCSS(plugins.shared.leftMargin + 'px')};
|
2023-10-16 16:28:12 +00:00
|
|
|
grid-template-columns: calc(100% / 4) calc(100% / 4) calc(100% / 4) calc(100% / 4);
|
|
|
|
grid-gap: 5px;
|
|
|
|
border-top: 2px solid #e4002b;
|
|
|
|
}
|
|
|
|
|
|
|
|
.bottomstripe .pageNumber {
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
2024-12-02 15:04:58 +00:00
|
|
|
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
2023-10-16 16:28:12 +00:00
|
|
|
background: #e4002b;
|
|
|
|
padding: 3px;
|
|
|
|
font-size: 9px;
|
|
|
|
color: #fff;
|
|
|
|
border-bottom-left-radius: 3px;
|
|
|
|
border-bottom-right-radius: 3px;
|
|
|
|
}
|
|
|
|
.bottomstripe .documentTitle {
|
|
|
|
position: absolute;
|
|
|
|
top: -18px;
|
2024-12-02 15:04:58 +00:00
|
|
|
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
2023-10-16 16:28:12 +00:00
|
|
|
background: #dddddd;
|
|
|
|
padding: 3px;
|
|
|
|
font-size: 9px;
|
|
|
|
color: #333;
|
|
|
|
border-top-left-radius: 3px;
|
|
|
|
border-top-right-radius: 3px;
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
];
|
|
|
|
|
|
|
|
public render(): TemplateResult {
|
|
|
|
return html`
|
|
|
|
<div class="bottomstripe">
|
|
|
|
<div>
|
2024-12-02 15:04:58 +00:00
|
|
|
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'address', 'Address')}:</strong><br />
|
2023-10-16 16:28:12 +00:00
|
|
|
${this.letterData.from.name}<br />
|
|
|
|
${this.letterData.from.address.streetName} ${this.letterData.from.address.houseNumber}<br />
|
|
|
|
${this.letterData.from.address.postalCode} ${this.letterData.from.address.city}<br />
|
|
|
|
${this.letterData.from.address.country}
|
|
|
|
</div>
|
|
|
|
<div>
|
2024-12-02 15:04:58 +00:00
|
|
|
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'registrationInfo', 'Registration Info')}:</strong><br />
|
2023-10-16 16:28:12 +00:00
|
|
|
Amtsgericht Bremen<br />
|
|
|
|
<i>reg-#:</i> HRB 35230 HB<br />
|
|
|
|
<i>vat-id:</i> ${this.letterData.from.vatId}
|
|
|
|
</div>
|
|
|
|
<div>
|
2024-12-02 15:04:58 +00:00
|
|
|
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'contactInfo', 'Contact Info')}:</strong><br />
|
2023-10-16 16:28:12 +00:00
|
|
|
<i>email:</i> ${this.letterData.from.email}<br />
|
|
|
|
<i>phone:</i> ${this.letterData.from.phone}<br />
|
|
|
|
<i>fax:</i> ${this.letterData.from.fax}
|
|
|
|
</div>
|
|
|
|
<div>
|
2024-12-02 15:04:58 +00:00
|
|
|
<strong>${plugins.shared.translation.translate(this.documentSettings.languageCode, 'bankConnection', 'Bank Connection')}:</strong><br />
|
2023-10-16 16:28:12 +00:00
|
|
|
<i>beneficiary:</i> ${this.letterData?.from?.name}<br />
|
|
|
|
<i>institution:</i> ${this.letterData?.from?.sepaConnection?.institution}<br />
|
|
|
|
<i>iban:</i> ${this.letterData?.from?.sepaConnection?.iban}<br />
|
|
|
|
<i>bic:</i> ${this.letterData?.from?.sepaConnection?.bic}<br />
|
|
|
|
</div>
|
|
|
|
<div class="documentTitle">Subject: <b>${this.letterData?.subject}</b>${(() => {
|
|
|
|
const uidString = html`/ Document-UID: <b>${html`<a href="https://uid.signature.digital/">https://uid.signature.digital/</a>`}</b>`;
|
|
|
|
return ``;
|
|
|
|
})()}</div>
|
|
|
|
<div class="pageNumber">page ${this.pageNumber} of ${this.pageTotalNumber}</div>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|