fix(core): update
This commit is contained in:
		| @@ -18,17 +18,17 @@ | ||||
|   "author": "Lossless GmbH", | ||||
|   "license": "MIT", | ||||
|   "dependencies": { | ||||
|     "@design.estate/dees-domtools": "^2.0.34", | ||||
|     "@design.estate/dees-element": "^2.0.23", | ||||
|     "@design.estate/dees-domtools": "^2.0.55", | ||||
|     "@design.estate/dees-element": "^2.0.32", | ||||
|     "@design.estate/dees-wcctools": "^1.0.76", | ||||
|     "@git.zone/tsrun": "^1.2.44", | ||||
|     "@push.rocks/smartfile": "^10.0.26", | ||||
|     "@push.rocks/smartjson": "^5.0.10", | ||||
|     "@push.rocks/smartpath": "^5.0.5", | ||||
|     "@push.rocks/smartpdf": "^3.0.16", | ||||
|     "@push.rocks/smarttime": "^4.0.1", | ||||
|     "@push.rocks/smarttime": "^4.0.6", | ||||
|     "@tsclass/tsclass": "^4.0.46", | ||||
|     "@types/qrcode": "^1.5.2", | ||||
|     "@types/qrcode": "^1.5.4", | ||||
|     "qrcode": "^1.5.3" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|   | ||||
							
								
								
									
										933
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										933
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@design.estate/dees-document', | ||||
|   version: '1.0.95', | ||||
|   version: '1.0.96', | ||||
|   description: 'a catalog for creating documents like invoices' | ||||
| } | ||||
|   | ||||
| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@design.estate/dees-document', | ||||
|   version: '1.0.95', | ||||
|   version: '1.0.96', | ||||
|   description: 'a catalog for creating documents like invoices' | ||||
| } | ||||
|   | ||||
							
								
								
									
										6
									
								
								ts_web/elements/document.demo.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								ts_web/elements/document.demo.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| import * as shared from './shared/index.js'; | ||||
| import { html } from '@design.estate/dees-element'; | ||||
|  | ||||
| export const demoFunc = () => html` | ||||
| <dedocument-dedocument .format="${'a4'}" .letterData=${shared.demoLetter}></dedocument-dedocument> | ||||
| `; | ||||
| @@ -18,6 +18,7 @@ import { DePage } from './page.js'; | ||||
| import { DeContentInvoice } from './contentinvoice.js'; | ||||
|  | ||||
| import * as shared from './shared/index.js'; | ||||
| import { demoFunc } from './document.demo.js'; | ||||
|  | ||||
| declare global { | ||||
|   interface HTMLElementTagNameMap { | ||||
| @@ -27,9 +28,7 @@ declare global { | ||||
|  | ||||
| @customElement('dedocument-dedocument') | ||||
| export class DeDocument extends DeesElement { | ||||
|   public static demo = () => html` | ||||
|     <dedocument-dedocument .format="${'a4'}" .letterData=${shared.demoLetter}></dedocument-dedocument> | ||||
|   `; | ||||
|   public static demo = demoFunc; | ||||
|  | ||||
|   @property({ | ||||
|     type: String, | ||||
| @@ -86,7 +85,7 @@ export class DeDocument extends DeesElement { | ||||
|       } | ||||
|  | ||||
|       .betweenPagesSpacer { | ||||
|         height: 20px; | ||||
|         height: 16px; | ||||
|       } | ||||
|     `, | ||||
|   ]; | ||||
| @@ -107,6 +106,10 @@ export class DeDocument extends DeesElement { | ||||
|       } | ||||
|     }); | ||||
|     resizeObserver.observe(this); | ||||
|     this.registerGarbageFunction(() => { | ||||
|       resizeObserver.disconnect(); | ||||
|     }) | ||||
|      | ||||
|     if (this.letterDataUrl) { | ||||
|       const response = await fetch(this.letterDataUrl); | ||||
|       this.letterData = await response.json(); | ||||
|   | ||||
| @@ -6,5 +6,6 @@ export * from './pagecontainer.js'; | ||||
| export * from './pagecontent.js'; | ||||
| export * from './pagefooter.js'; | ||||
| export * from './pageheader.js'; | ||||
| export * from './viewer.js'; | ||||
|  | ||||
| export * from './shared/index.js'; | ||||
| @@ -64,6 +64,9 @@ export class DePage extends DeesElement { | ||||
|     domtools.elementBasic.staticStyles, | ||||
|     css` | ||||
|       :host { | ||||
|         display: block; | ||||
|         max-height: ${shared.a4Height}px; | ||||
|         max-width: ${shared.a4Width}px; | ||||
|       } | ||||
|  | ||||
|       #scaleWrapper { | ||||
| @@ -177,7 +180,7 @@ export class DePage extends DeesElement { | ||||
|    | ||||
|     // Adjust the outer dimensions so they match the scaled content | ||||
|      | ||||
|     scaleWrapper.style.width = `${shared.a4Width * scale}px`; | ||||
|     scaleWrapper.style.height = `${shared.a4Height * scale}px`; | ||||
|     // this.style.width = `${shared.a4Width * scale}px`; | ||||
|     this.style.height = `${shared.a4Height * scale}px`; | ||||
|   } | ||||
| } | ||||
|   | ||||
							
								
								
									
										6
									
								
								ts_web/elements/viewer.demo.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								ts_web/elements/viewer.demo.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| import { html } from '@design.estate/dees-element'; | ||||
| import * as shared from './shared/index.js'; | ||||
|  | ||||
| export const demoFunc = () => html` | ||||
|   <dedocument-viewer .letterData=${shared.demoLetter}></dedocument-viewer> | ||||
| `; | ||||
							
								
								
									
										83
									
								
								ts_web/elements/viewer.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								ts_web/elements/viewer.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,83 @@ | ||||
| import * as plugins from '../plugins.js'; | ||||
|  | ||||
| import { DeesElement, css, cssManager, customElement, html } from '@design.estate/dees-element'; | ||||
| import { demoFunc } from './viewer.demo.js'; | ||||
|  | ||||
| declare global { | ||||
|   interface HTMLElementTagNameMap { | ||||
|     'dedocument-viewer': DeDocumentViewer; | ||||
|   } | ||||
| } | ||||
|  | ||||
| @customElement('dedocument-viewer') | ||||
| export class DeDocumentViewer extends DeesElement { | ||||
|   // DEMO | ||||
|   public static demo = demoFunc; | ||||
|  | ||||
|   // INSTANCE | ||||
|   public letterData: plugins.tsclass.business.ILetter = null; | ||||
|  | ||||
|   public static styles = [ | ||||
|     cssManager.defaultStyles, | ||||
|     css` | ||||
|       .maincontainer { | ||||
|         position: relative; | ||||
|         height: 100%; | ||||
|         width: 100%; | ||||
|         background: ${cssManager.bdTheme('#eeeeeb', '#111')}; | ||||
|       } | ||||
|       .controls { | ||||
|         top: 0px; | ||||
|         right: 0px; | ||||
|         left: 0px; | ||||
|         position: absolute; | ||||
|         height: 32px; | ||||
|         width: 100%; | ||||
|         background: ${cssManager.bdTheme('#eeeeeb', '#111111ee')}; | ||||
|         box-shadow: 0px 2px 8px 0px #000000; | ||||
|       } | ||||
|       .controlsShadow { | ||||
|         position: absolute; | ||||
|         top: 32px; | ||||
|         right: 0px; | ||||
|         left: 0px; | ||||
|         height: 16px; | ||||
|         width: 100%; | ||||
|         position: absolute; | ||||
|         background: linear-gradient(to bottom, #111111cc 0%, #11111100 100%); | ||||
|       } | ||||
|  | ||||
|       .viewport { | ||||
|         position: absolute; | ||||
|         padding: 16px; | ||||
|         padding-top: 48px; | ||||
|         padding-bottom: 0px; | ||||
|         top: 0px; | ||||
|         left: 0px; | ||||
|         right: 0px; | ||||
|         bottom: 0px; | ||||
|         overflow-y: scroll; | ||||
|         overscroll-behavior: contain; | ||||
|       } | ||||
|     `, | ||||
|   ]; | ||||
|  | ||||
|   public render = () => { | ||||
|     return html` | ||||
|       <div class="maincontainer"> | ||||
|         <div class="viewport"> | ||||
|           ${this.letterData | ||||
|             ? html` <dedocument-dedocument .letterData=${this.letterData}></dedocument-dedocument> ` | ||||
|             : html``} | ||||
|         </div> | ||||
|         <div class="controls"></div> | ||||
|       </div> | ||||
|     `; | ||||
|   }; | ||||
|  | ||||
|   public updated = (changedProperties: Map<string | number | symbol, unknown>) => { | ||||
|     super.updated(changedProperties); | ||||
|     if (changedProperties.has('letterData')) { | ||||
|     } | ||||
|   }; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user