@design.estate/dees-document 1.5.3 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38339,8 +38339,8 @@ var DE_translations = {
38339
38339
  quantity: "Anzahl",
38340
38340
  registrationInfo: "HRA/HRB Info",
38341
38341
  reverseVatNote: "Umkehr der Umsatzsteuerpflicht: Der Rechnungsempf\xE4nger ist f\xFCr die korrekte Abrechnung der Umsatzsteuer zust\xE4ndig.",
38342
- totalNetPrice: "Nettopreis Summe",
38343
- unitNetPrice: "Nettopreis",
38342
+ totalNetPrice: "Summe netto",
38343
+ unitNetPrice: "Einheit netto",
38344
38344
  unitType: "Einheit",
38345
38345
  yourCustomerId: "Ihre Kundennummer:",
38346
38346
  yourVatId: "Ihre Umsatzsteuer-ID:",
@@ -38406,19 +38406,15 @@ var IT_translations = {
38406
38406
  page: "Pagina"
38407
38407
  };
38408
38408
  var languageCodeMap = {
38409
- "DE": DE_translations,
38410
- "EN": EN_translations,
38411
- "ES": ES_translations,
38412
- "FR": FR_translations,
38413
- "IT": IT_translations
38409
+ EN: EN_translations,
38410
+ DE: DE_translations,
38411
+ ES: ES_translations,
38412
+ FR: FR_translations,
38413
+ IT: IT_translations
38414
38414
  };
38415
38415
  var translate = (languageCode, key2, defaultValue) => {
38416
38416
  const translations = languageCodeMap[languageCode] || EN_translations;
38417
- if (translations && translations[key2]) {
38418
- return translations[key2];
38419
- } else {
38420
- return defaultValue;
38421
- }
38417
+ return translations[key2] || defaultValue;
38422
38418
  };
38423
38419
 
38424
38420
  // dist_ts_shared/demoletter.js
@@ -38630,8 +38626,8 @@ var demoLetter = {
38630
38626
  };
38631
38627
  var demoDocumentSettings = {
38632
38628
  enableTopDraftText: true,
38633
- enableDefaultHeader: false,
38634
- enableDefaultFooter: false,
38629
+ enableDefaultHeader: true,
38630
+ enableDefaultFooter: true,
38635
38631
  languageCode: "DE"
38636
38632
  };
38637
38633
 
@@ -38755,7 +38751,7 @@ var DeContentInvoice = class extends DeesElement {
38755
38751
  <style>
38756
38752
  .grid {
38757
38753
  display: grid;
38758
- grid-template-columns: 40px auto 80px 80px 90px 90px;
38754
+ grid-template-columns: 40px auto 60px 60px 84px 84px 46px;
38759
38755
  }
38760
38756
  .topLine {
38761
38757
  margin-top: 5px;
@@ -38765,6 +38761,12 @@ var DeContentInvoice = class extends DeesElement {
38765
38761
  .lineItem {
38766
38762
  font-size: 12px;
38767
38763
  padding: 5px;
38764
+ font-family: 'Dees Code', monospace;
38765
+ border-right: 1px dashed #ccc;
38766
+ }
38767
+
38768
+ .lineItem.rightAlign {
38769
+ text-align: right;
38768
38770
  }
38769
38771
 
38770
38772
  .invoiceLine {
@@ -38775,6 +38777,7 @@ var DeContentInvoice = class extends DeesElement {
38775
38777
  margin-top: 5px;
38776
38778
  font-size: 12px;
38777
38779
  padding-left: 50%;
38780
+ font-family: 'Dees Code', monospace;
38778
38781
  }
38779
38782
 
38780
38783
  .sums .sumline {
@@ -38830,26 +38833,30 @@ var DeContentInvoice = class extends DeesElement {
38830
38833
  </style>
38831
38834
  <div>We hereby invoice products and services provided to you by Lossless GmbH:</div>
38832
38835
  <div class="grid topLine dataHeader">
38833
- <div class="lineItem">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "itemPos", "Item Pos.")}</div>
38836
+ <div class="lineItem rightAlign">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "itemPos", "Item Pos.")}</div>
38834
38837
  <div class="lineItem">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "description", "Description")}</div>
38835
- <div class="lineItem">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "quantity", "Quantity")}</div>
38838
+ <div class="lineItem rightAlign">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "quantity", "Quantity")}</div>
38836
38839
  <div class="lineItem">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "unitType", "Unit Type")}</div>
38837
- <div class="lineItem">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "unitNetPrice", "Unit Net Price")}</div>
38838
- <div class="lineItem">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "totalNetPrice", "Total Net Price")}</div>
38840
+ <div class="lineItem rightAlign">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "unitNetPrice", "Unit Net Price")}</div>
38841
+ <div class="lineItem rightAlign">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "totalNetPrice", "Total Net Price")}</div>
38842
+ <div class="lineItem rightAlign">${dist_ts_shared_exports.translation.translate(this.documentSettings.languageCode, "vatShort", "VAT")}</div>
38839
38843
  </div>
38840
38844
  ${(() => {
38841
38845
  let counter = 1;
38842
38846
  return this.letterData?.content.invoiceData?.items?.map(
38843
38847
  (invoiceItem) => x`
38844
38848
  <div class="grid invoiceLine needsDataHeader">
38845
- <div class="lineItem">${counter++}</div>
38849
+ <div class="lineItem rightAlign">${counter++}</div>
38846
38850
  <div class="lineItem">${invoiceItem.name}</div>
38847
- <div class="lineItem">${invoiceItem.unitQuantity}</div>
38851
+ <div class="lineItem rightAlign">${invoiceItem.unitQuantity}</div>
38848
38852
  <div class="lineItem">${invoiceItem.unitType}</div>
38849
- <div class="lineItem">${invoiceItem.unitNetPrice} ${this.letterData?.content.invoiceData.currency}</div>
38850
- <div class="lineItem">
38853
+ <div class="lineItem rightAlign">${invoiceItem.unitNetPrice} ${this.letterData?.content.invoiceData.currency}</div>
38854
+ <div class="lineItem rightAlign">
38851
38855
  ${invoiceItem.unitQuantity * invoiceItem.unitNetPrice} ${this.letterData?.content.invoiceData.currency}
38852
38856
  </div>
38857
+ <div class="lineItem rightAlign">
38858
+ ${invoiceItem.vatPercentage}%
38859
+ </div>
38853
38860
  </div>
38854
38861
  `
38855
38862
  );
@@ -38868,8 +38875,10 @@ var DeContentInvoice = class extends DeesElement {
38868
38875
  return x`
38869
38876
  <div class="sumline">
38870
38877
  <div class="label">
38871
- Vat ${vatGroupArg.vatPercentage}%<br />
38872
- <span style="font-weight: normal">(on item positions: ${itemNumbers})</span>
38878
+ Vat ${vatGroupArg.vatPercentage}%
38879
+ ${this.documentSettings.vatGroupPositions ? x`
38880
+ <br /><span style="font-weight: normal">(on item positions: ${itemNumbers})</span>
38881
+ ` : x``}
38873
38882
  </div>
38874
38883
  <div class="value">${vatGroupArg.vatAmountSum} EUR</div>
38875
38884
  </div>
@@ -38949,6 +38958,7 @@ DeContentInvoice.styles = [
38949
38958
  i`
38950
38959
  :host {
38951
38960
  color: #333;
38961
+ font-family: inherit;
38952
38962
  }
38953
38963
 
38954
38964
  .trimmedContent {
@@ -39074,6 +39084,7 @@ DePage.styles = [
39074
39084
  i`
39075
39085
  :host {
39076
39086
  display: block;
39087
+ font-family: inherit;
39077
39088
  }
39078
39089
 
39079
39090
  #scaleWrapper {
@@ -39166,7 +39177,9 @@ var demoFunc = () => x`
39166
39177
  var defaultDocumentSettings = {
39167
39178
  enableTopDraftText: true,
39168
39179
  enableDefaultHeader: true,
39169
- enableDefaultFooter: true
39180
+ enableDefaultFooter: true,
39181
+ languageCode: "EN",
39182
+ vatGroupPositions: true
39170
39183
  };
39171
39184
  var DeDocument = class extends DeesElement {
39172
39185
  constructor() {
@@ -39176,6 +39189,7 @@ var DeDocument = class extends DeesElement {
39176
39189
  this.viewHeight = null;
39177
39190
  this.printMode = false;
39178
39191
  this.documentSettings = defaultDocumentSettings;
39192
+ this.latestDocumentSettings = null;
39179
39193
  this.latestRenderedLetterData = null;
39180
39194
  dist_ts_exports27.DomTools.setupDomTools();
39181
39195
  }
@@ -39185,6 +39199,12 @@ var DeDocument = class extends DeesElement {
39185
39199
  `;
39186
39200
  }
39187
39201
  async firstUpdated(_changedProperties) {
39202
+ dist_ts_exports27.plugins.smartdelay.delayFor(0).then(() => {
39203
+ this.documentSettings = {
39204
+ ...defaultDocumentSettings,
39205
+ ...this.documentSettings
39206
+ };
39207
+ });
39188
39208
  const resizeObserver = new ResizeObserver((entries) => {
39189
39209
  for (const entry of entries) {
39190
39210
  const width = entry.contentRect.width;
@@ -39198,6 +39218,10 @@ var DeDocument = class extends DeesElement {
39198
39218
  });
39199
39219
  }
39200
39220
  async renderDocument() {
39221
+ this.latestDocumentSettings = this.documentSettings;
39222
+ this.latestRenderedLetterData = this.letterData;
39223
+ console.log(`rendering with settings:`);
39224
+ console.log(this.latestDocumentSettings);
39201
39225
  const domtools = await this.domtoolsPromise;
39202
39226
  const documentBuildContainer = document.createElement("div");
39203
39227
  document.body.appendChild(documentBuildContainer);
@@ -39257,12 +39281,11 @@ var DeDocument = class extends DeesElement {
39257
39281
  }
39258
39282
  }
39259
39283
  this.adjustDePageScaling();
39260
- this.latestRenderedLetterData = this.letterData;
39261
39284
  }
39262
39285
  async updated(changedProperties) {
39263
39286
  super.updated(changedProperties);
39264
39287
  const domtools = await this.domtoolsPromise;
39265
- const renderedDocIsUpToDate = domtools.convenience.smartjson.deepEqualObjects(this.letterData, this.latestRenderedLetterData);
39288
+ let renderedDocIsUpToDate = domtools.convenience.smartjson.deepEqualObjects(this.letterData, this.latestRenderedLetterData) && domtools.convenience.smartjson.deepEqualObjects(this.documentSettings, this.latestDocumentSettings);
39266
39289
  if (!renderedDocIsUpToDate) {
39267
39290
  this.renderDocument();
39268
39291
  }
@@ -39296,6 +39319,7 @@ DeDocument.styles = [
39296
39319
  color: #333;
39297
39320
  padding: 0px;
39298
39321
  position: relative;
39322
+ font-family: 'Dees Sans', sans-serif;
39299
39323
  }
39300
39324
 
39301
39325
  .betweenPagesSpacer {
@@ -39566,6 +39590,7 @@ DePageContent.styles = [
39566
39590
  i`
39567
39591
  :host {
39568
39592
  color: #333;
39593
+ font-family: inherit;
39569
39594
  }
39570
39595
 
39571
39596
  .content {