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-pageheader': DePageHeader;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@customElement('dedocument-pageheader')
|
|
|
|
export class DePageHeader extends DeesElement {
|
|
|
|
public static demo = () => html`
|
|
|
|
<dedocument-pageheader .format="${'a4'}"></dedocument-pageheader>
|
|
|
|
`;
|
|
|
|
|
|
|
|
@property({
|
|
|
|
type: Object,
|
|
|
|
})
|
2024-12-02 15:04:58 +00:00
|
|
|
public letterData: plugins.tsclass.business.ILetter = null;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.topstripe {
|
|
|
|
position: absolute;
|
|
|
|
overflow: hidden;
|
|
|
|
top: 0px;
|
|
|
|
left: 0px;
|
|
|
|
right: 0px;
|
|
|
|
height: 130px;
|
|
|
|
color: #333;
|
|
|
|
text-align: center;
|
|
|
|
border-bottom: 2px solid #00000020;
|
|
|
|
}
|
|
|
|
.topstripe2 {
|
|
|
|
position: absolute;
|
|
|
|
overflow: hidden;
|
|
|
|
top: 130px;
|
|
|
|
left: auto;
|
2024-12-02 15:04:58 +00:00
|
|
|
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
2023-10-16 16:28:12 +00:00
|
|
|
height: 20px;
|
|
|
|
line-height: 20px;
|
|
|
|
color: #333;
|
|
|
|
font-size: 10px;
|
|
|
|
}
|
2024-11-30 19:54:15 +00:00
|
|
|
.topstripe .logo {
|
2023-10-16 16:28:12 +00:00
|
|
|
position: absolute;
|
|
|
|
bottom: 10px;
|
|
|
|
height: 25px;
|
|
|
|
left: auto;
|
2024-12-02 15:04:58 +00:00
|
|
|
right: ${unsafeCSS(plugins.shared.rightMargin + 'px')};
|
2024-11-30 19:54:15 +00:00
|
|
|
font-family: 'Courier New', Courier, monospace;
|
|
|
|
}
|
|
|
|
.topstripe .logo img {
|
|
|
|
position: relative;
|
|
|
|
height: 25px;
|
2023-10-16 16:28:12 +00:00
|
|
|
}
|
|
|
|
`,
|
|
|
|
];
|
|
|
|
|
|
|
|
public render(): TemplateResult {
|
|
|
|
return html`
|
|
|
|
<div class="topstripe">
|
2024-11-30 19:54:15 +00:00
|
|
|
<div class="logo">
|
|
|
|
No logo set!
|
|
|
|
</div>
|
2023-10-16 16:28:12 +00:00
|
|
|
</div>
|
|
|
|
<div class="topstripe2">${this.letterData?.from?.description || '[no letterData.from.description set]'}</div>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|