@design.estate/dees-document 1.0.101 → 1.1.0

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.
@@ -1998,343 +1998,11 @@ var require_es_define_property = __commonJS({
1998
1998
  }
1999
1999
  });
2000
2000
 
2001
- // node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js
2002
- var require_has_proto2 = __commonJS({
2003
- "node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js"(exports, module) {
2004
- "use strict";
2005
- var test = {
2006
- foo: {}
2007
- };
2008
- var $Object = Object;
2009
- module.exports = function hasProto() {
2010
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
2011
- };
2012
- }
2013
- });
2014
-
2015
- // node_modules/.pnpm/hasown@2.0.0/node_modules/hasown/index.js
2016
- var require_hasown2 = __commonJS({
2017
- "node_modules/.pnpm/hasown@2.0.0/node_modules/hasown/index.js"(exports, module) {
2018
- "use strict";
2019
- var call = Function.prototype.call;
2020
- var $hasOwn = Object.prototype.hasOwnProperty;
2021
- var bind2 = require_function_bind();
2022
- module.exports = bind2.call(call, $hasOwn);
2023
- }
2024
- });
2025
-
2026
- // node_modules/.pnpm/get-intrinsic@1.2.2/node_modules/get-intrinsic/index.js
2027
- var require_get_intrinsic2 = __commonJS({
2028
- "node_modules/.pnpm/get-intrinsic@1.2.2/node_modules/get-intrinsic/index.js"(exports, module) {
2029
- "use strict";
2030
- var undefined2;
2031
- var $SyntaxError = SyntaxError;
2032
- var $Function = Function;
2033
- var $TypeError = TypeError;
2034
- var getEvalledConstructor = function(expressionSyntax) {
2035
- try {
2036
- return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
2037
- } catch (e8) {
2038
- }
2039
- };
2040
- var $gOPD = Object.getOwnPropertyDescriptor;
2041
- if ($gOPD) {
2042
- try {
2043
- $gOPD({}, "");
2044
- } catch (e8) {
2045
- $gOPD = null;
2046
- }
2047
- }
2048
- var throwTypeError = function() {
2049
- throw new $TypeError();
2050
- };
2051
- var ThrowTypeError = $gOPD ? function() {
2052
- try {
2053
- arguments.callee;
2054
- return throwTypeError;
2055
- } catch (calleeThrows) {
2056
- try {
2057
- return $gOPD(arguments, "callee").get;
2058
- } catch (gOPDthrows) {
2059
- return throwTypeError;
2060
- }
2061
- }
2062
- }() : throwTypeError;
2063
- var hasSymbols = require_has_symbols()();
2064
- var hasProto = require_has_proto2()();
2065
- var getProto = Object.getPrototypeOf || (hasProto ? function(x2) {
2066
- return x2.__proto__;
2067
- } : null);
2068
- var needsEval = {};
2069
- var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array);
2070
- var INTRINSICS = {
2071
- "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError,
2072
- "%Array%": Array,
2073
- "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer,
2074
- "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2,
2075
- "%AsyncFromSyncIteratorPrototype%": undefined2,
2076
- "%AsyncFunction%": needsEval,
2077
- "%AsyncGenerator%": needsEval,
2078
- "%AsyncGeneratorFunction%": needsEval,
2079
- "%AsyncIteratorPrototype%": needsEval,
2080
- "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics,
2081
- "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt,
2082
- "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array,
2083
- "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array,
2084
- "%Boolean%": Boolean,
2085
- "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView,
2086
- "%Date%": Date,
2087
- "%decodeURI%": decodeURI,
2088
- "%decodeURIComponent%": decodeURIComponent,
2089
- "%encodeURI%": encodeURI,
2090
- "%encodeURIComponent%": encodeURIComponent,
2091
- "%Error%": Error,
2092
- "%eval%": eval,
2093
- // eslint-disable-line no-eval
2094
- "%EvalError%": EvalError,
2095
- "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
2096
- "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
2097
- "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
2098
- "%Function%": $Function,
2099
- "%GeneratorFunction%": needsEval,
2100
- "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
2101
- "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
2102
- "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array,
2103
- "%isFinite%": isFinite,
2104
- "%isNaN%": isNaN,
2105
- "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2,
2106
- "%JSON%": typeof JSON === "object" ? JSON : undefined2,
2107
- "%Map%": typeof Map === "undefined" ? undefined2 : Map,
2108
- "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
2109
- "%Math%": Math,
2110
- "%Number%": Number,
2111
- "%Object%": Object,
2112
- "%parseFloat%": parseFloat,
2113
- "%parseInt%": parseInt,
2114
- "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise,
2115
- "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy,
2116
- "%RangeError%": RangeError,
2117
- "%ReferenceError%": ReferenceError,
2118
- "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect,
2119
- "%RegExp%": RegExp,
2120
- "%Set%": typeof Set === "undefined" ? undefined2 : Set,
2121
- "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
2122
- "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer,
2123
- "%String%": String,
2124
- "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2,
2125
- "%Symbol%": hasSymbols ? Symbol : undefined2,
2126
- "%SyntaxError%": $SyntaxError,
2127
- "%ThrowTypeError%": ThrowTypeError,
2128
- "%TypedArray%": TypedArray,
2129
- "%TypeError%": $TypeError,
2130
- "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array,
2131
- "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray,
2132
- "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array,
2133
- "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array,
2134
- "%URIError%": URIError,
2135
- "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap,
2136
- "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef,
2137
- "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet
2138
- };
2139
- if (getProto) {
2140
- try {
2141
- null.error;
2142
- } catch (e8) {
2143
- errorProto = getProto(getProto(e8));
2144
- INTRINSICS["%Error.prototype%"] = errorProto;
2145
- }
2146
- }
2147
- var errorProto;
2148
- var doEval = function doEval2(name) {
2149
- var value2;
2150
- if (name === "%AsyncFunction%") {
2151
- value2 = getEvalledConstructor("async function () {}");
2152
- } else if (name === "%GeneratorFunction%") {
2153
- value2 = getEvalledConstructor("function* () {}");
2154
- } else if (name === "%AsyncGeneratorFunction%") {
2155
- value2 = getEvalledConstructor("async function* () {}");
2156
- } else if (name === "%AsyncGenerator%") {
2157
- var fn = doEval2("%AsyncGeneratorFunction%");
2158
- if (fn) {
2159
- value2 = fn.prototype;
2160
- }
2161
- } else if (name === "%AsyncIteratorPrototype%") {
2162
- var gen = doEval2("%AsyncGenerator%");
2163
- if (gen && getProto) {
2164
- value2 = getProto(gen.prototype);
2165
- }
2166
- }
2167
- INTRINSICS[name] = value2;
2168
- return value2;
2169
- };
2170
- var LEGACY_ALIASES = {
2171
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
2172
- "%ArrayPrototype%": ["Array", "prototype"],
2173
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
2174
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
2175
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
2176
- "%ArrayProto_values%": ["Array", "prototype", "values"],
2177
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
2178
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
2179
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
2180
- "%BooleanPrototype%": ["Boolean", "prototype"],
2181
- "%DataViewPrototype%": ["DataView", "prototype"],
2182
- "%DatePrototype%": ["Date", "prototype"],
2183
- "%ErrorPrototype%": ["Error", "prototype"],
2184
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
2185
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
2186
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
2187
- "%FunctionPrototype%": ["Function", "prototype"],
2188
- "%Generator%": ["GeneratorFunction", "prototype"],
2189
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
2190
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
2191
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
2192
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
2193
- "%JSONParse%": ["JSON", "parse"],
2194
- "%JSONStringify%": ["JSON", "stringify"],
2195
- "%MapPrototype%": ["Map", "prototype"],
2196
- "%NumberPrototype%": ["Number", "prototype"],
2197
- "%ObjectPrototype%": ["Object", "prototype"],
2198
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
2199
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
2200
- "%PromisePrototype%": ["Promise", "prototype"],
2201
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
2202
- "%Promise_all%": ["Promise", "all"],
2203
- "%Promise_reject%": ["Promise", "reject"],
2204
- "%Promise_resolve%": ["Promise", "resolve"],
2205
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
2206
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
2207
- "%RegExpPrototype%": ["RegExp", "prototype"],
2208
- "%SetPrototype%": ["Set", "prototype"],
2209
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
2210
- "%StringPrototype%": ["String", "prototype"],
2211
- "%SymbolPrototype%": ["Symbol", "prototype"],
2212
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
2213
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
2214
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
2215
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
2216
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
2217
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
2218
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
2219
- "%URIErrorPrototype%": ["URIError", "prototype"],
2220
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
2221
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
2222
- };
2223
- var bind2 = require_function_bind();
2224
- var hasOwn = require_hasown2();
2225
- var $concat = bind2.call(Function.call, Array.prototype.concat);
2226
- var $spliceApply = bind2.call(Function.apply, Array.prototype.splice);
2227
- var $replace = bind2.call(Function.call, String.prototype.replace);
2228
- var $strSlice = bind2.call(Function.call, String.prototype.slice);
2229
- var $exec = bind2.call(Function.call, RegExp.prototype.exec);
2230
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
2231
- var reEscapeChar = /\\(\\)?/g;
2232
- var stringToPath = function stringToPath2(string3) {
2233
- var first = $strSlice(string3, 0, 1);
2234
- var last2 = $strSlice(string3, -1);
2235
- if (first === "%" && last2 !== "%") {
2236
- throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
2237
- } else if (last2 === "%" && first !== "%") {
2238
- throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
2239
- }
2240
- var result = [];
2241
- $replace(string3, rePropName, function(match, number2, quote, subString) {
2242
- result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number2 || match;
2243
- });
2244
- return result;
2245
- };
2246
- var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
2247
- var intrinsicName = name;
2248
- var alias;
2249
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
2250
- alias = LEGACY_ALIASES[intrinsicName];
2251
- intrinsicName = "%" + alias[0] + "%";
2252
- }
2253
- if (hasOwn(INTRINSICS, intrinsicName)) {
2254
- var value2 = INTRINSICS[intrinsicName];
2255
- if (value2 === needsEval) {
2256
- value2 = doEval(intrinsicName);
2257
- }
2258
- if (typeof value2 === "undefined" && !allowMissing) {
2259
- throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
2260
- }
2261
- return {
2262
- alias,
2263
- name: intrinsicName,
2264
- value: value2
2265
- };
2266
- }
2267
- throw new $SyntaxError("intrinsic " + name + " does not exist!");
2268
- };
2269
- module.exports = function GetIntrinsic(name, allowMissing) {
2270
- if (typeof name !== "string" || name.length === 0) {
2271
- throw new $TypeError("intrinsic name must be a non-empty string");
2272
- }
2273
- if (arguments.length > 1 && typeof allowMissing !== "boolean") {
2274
- throw new $TypeError('"allowMissing" argument must be a boolean');
2275
- }
2276
- if ($exec(/^%?[^%]*%?$/, name) === null) {
2277
- throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
2278
- }
2279
- var parts = stringToPath(name);
2280
- var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
2281
- var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
2282
- var intrinsicRealName = intrinsic.name;
2283
- var value2 = intrinsic.value;
2284
- var skipFurtherCaching = false;
2285
- var alias = intrinsic.alias;
2286
- if (alias) {
2287
- intrinsicBaseName = alias[0];
2288
- $spliceApply(parts, $concat([0, 1], alias));
2289
- }
2290
- for (var i8 = 1, isOwn = true; i8 < parts.length; i8 += 1) {
2291
- var part = parts[i8];
2292
- var first = $strSlice(part, 0, 1);
2293
- var last2 = $strSlice(part, -1);
2294
- if ((first === '"' || first === "'" || first === "`" || (last2 === '"' || last2 === "'" || last2 === "`")) && first !== last2) {
2295
- throw new $SyntaxError("property names with quotes must have matching quotes");
2296
- }
2297
- if (part === "constructor" || !isOwn) {
2298
- skipFurtherCaching = true;
2299
- }
2300
- intrinsicBaseName += "." + part;
2301
- intrinsicRealName = "%" + intrinsicBaseName + "%";
2302
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
2303
- value2 = INTRINSICS[intrinsicRealName];
2304
- } else if (value2 != null) {
2305
- if (!(part in value2)) {
2306
- if (!allowMissing) {
2307
- throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
2308
- }
2309
- return void 0;
2310
- }
2311
- if ($gOPD && i8 + 1 >= parts.length) {
2312
- var desc = $gOPD(value2, part);
2313
- isOwn = !!desc;
2314
- if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
2315
- value2 = desc.get;
2316
- } else {
2317
- value2 = value2[part];
2318
- }
2319
- } else {
2320
- isOwn = hasOwn(value2, part);
2321
- value2 = value2[part];
2322
- }
2323
- if (isOwn && !skipFurtherCaching) {
2324
- INTRINSICS[intrinsicRealName] = value2;
2325
- }
2326
- }
2327
- }
2328
- return value2;
2329
- };
2330
- }
2331
- });
2332
-
2333
- // node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js
2001
+ // node_modules/.pnpm/gopd@1.1.0/node_modules/gopd/index.js
2334
2002
  var require_gopd = __commonJS({
2335
- "node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js"(exports, module) {
2003
+ "node_modules/.pnpm/gopd@1.1.0/node_modules/gopd/index.js"(exports, module) {
2336
2004
  "use strict";
2337
- var GetIntrinsic = require_get_intrinsic2();
2005
+ var GetIntrinsic = require_get_intrinsic();
2338
2006
  var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
2339
2007
  if ($gOPD) {
2340
2008
  try {
@@ -38614,14 +38282,45 @@ __export(elements_exports, {
38614
38282
  DePageHeader: () => DePageHeader,
38615
38283
  a4Height: () => a4Height,
38616
38284
  a4Width: () => a4Width,
38285
+ defaultDocumentSettings: () => defaultDocumentSettings,
38617
38286
  demoLetter: () => demoLetter,
38618
38287
  leftMargin: () => leftMargin,
38619
- rightMargin: () => rightMargin
38288
+ rightMargin: () => rightMargin,
38289
+ translation: () => translation_exports
38620
38290
  });
38621
38291
 
38622
38292
  // ts_web/plugins.ts
38623
38293
  var qrcode = __toESM(require_browser2(), 1);
38624
38294
 
38295
+ // ts_web/elements/shared/translation.ts
38296
+ var translation_exports = {};
38297
+ __export(translation_exports, {
38298
+ DE_translations: () => DE_translations,
38299
+ EN_translations: () => EN_translations,
38300
+ languageCodeMap: () => languageCodeMap,
38301
+ translate: () => translate
38302
+ });
38303
+ var EN_translations = {
38304
+ invoice: "Invoice",
38305
+ quantity: "Quantity"
38306
+ };
38307
+ var DE_translations = {
38308
+ invoice: "Rechnung",
38309
+ quantity: "Anzahl"
38310
+ };
38311
+ var languageCodeMap = {
38312
+ "DE": DE_translations,
38313
+ "EN": EN_translations
38314
+ };
38315
+ var translate = (languageCode, key2, defaultValue) => {
38316
+ const translations = languageCodeMap[languageCode] || EN_translations;
38317
+ if (translations && translations[key2]) {
38318
+ return translations[key2];
38319
+ } else {
38320
+ return defaultValue;
38321
+ }
38322
+ };
38323
+
38625
38324
  // ts_web/elements/shared/demoletter.ts
38626
38325
  var fromContact = {
38627
38326
  name: "Awesome From Company",
@@ -38680,18 +38379,21 @@ var demoLetter = {
38680
38379
  deliveryDate: (/* @__PURE__ */ new Date()).getTime(),
38681
38380
  periodOfPerformance: null,
38682
38381
  printResult: null,
38382
+ currency: "EUR",
38383
+ notes: [],
38384
+ type: "debitnote",
38683
38385
  items: [
38684
38386
  {
38685
38387
  name: "Item with 19% VAT",
38686
- unitQuantity: 1,
38388
+ unitQuantity: 2,
38687
38389
  unitNetPrice: 100,
38688
38390
  unitType: "hours",
38689
38391
  vatPercentage: 19,
38690
- currency: "EUR"
38392
+ position: 0
38691
38393
  },
38692
38394
  {
38693
38395
  name: "Item with 7% VAT",
38694
- unitQuantity: 1,
38396
+ unitQuantity: 4,
38695
38397
  unitNetPrice: 100,
38696
38398
  unitType: "hours",
38697
38399
  vatPercentage: 7,
@@ -38699,7 +38401,7 @@ var demoLetter = {
38699
38401
  },
38700
38402
  {
38701
38403
  name: "Item with 7% VAT",
38702
- unitQuantity: 1,
38404
+ unitQuantity: 3,
38703
38405
  unitNetPrice: 230,
38704
38406
  unitType: "hours",
38705
38407
  vatPercentage: 7,
@@ -38715,7 +38417,7 @@ var demoLetter = {
38715
38417
  },
38716
38418
  {
38717
38419
  name: "Item with 0% VAT",
38718
- unitQuantity: 1,
38420
+ unitQuantity: 6,
38719
38421
  unitNetPrice: 230,
38720
38422
  unitType: "hours",
38721
38423
  vatPercentage: 0,
@@ -38723,7 +38425,7 @@ var demoLetter = {
38723
38425
  },
38724
38426
  {
38725
38427
  name: "Item with 19% VAT",
38726
- unitQuantity: 1,
38428
+ unitQuantity: 8,
38727
38429
  unitNetPrice: 100,
38728
38430
  unitType: "hours",
38729
38431
  vatPercentage: 19,
@@ -38731,27 +38433,67 @@ var demoLetter = {
38731
38433
  },
38732
38434
  {
38733
38435
  name: "Item with 7% VAT",
38734
- unitQuantity: 1,
38436
+ unitQuantity: 9,
38735
38437
  unitNetPrice: 100,
38736
38438
  unitType: "hours",
38737
38439
  vatPercentage: 7,
38738
- currency: "EUR"
38440
+ position: 6
38739
38441
  },
38740
38442
  {
38741
38443
  name: "Item with 7% VAT",
38742
- unitQuantity: 1,
38444
+ unitQuantity: 4,
38743
38445
  unitNetPrice: 230,
38744
38446
  unitType: "hours",
38745
38447
  vatPercentage: 7,
38746
- currency: "EUR"
38448
+ position: 8
38747
38449
  },
38748
38450
  {
38749
38451
  name: "Item with 21% VAT",
38750
- unitQuantity: 1,
38452
+ unitQuantity: 3,
38751
38453
  unitNetPrice: 230,
38752
38454
  unitType: "hours",
38753
38455
  vatPercentage: 21,
38754
- currency: "EUR"
38456
+ position: 9
38457
+ },
38458
+ {
38459
+ name: "Item with 0% VAT",
38460
+ unitQuantity: 1,
38461
+ unitNetPrice: 230,
38462
+ unitType: "hours",
38463
+ vatPercentage: 0,
38464
+ position: 10
38465
+ },
38466
+ {
38467
+ name: "Item with 0% VAT",
38468
+ unitQuantity: 1,
38469
+ unitNetPrice: 230,
38470
+ unitType: "hours",
38471
+ vatPercentage: 0,
38472
+ position: 10
38473
+ },
38474
+ {
38475
+ name: "Item with 0% VAT",
38476
+ unitQuantity: 1,
38477
+ unitNetPrice: 230,
38478
+ unitType: "hours",
38479
+ vatPercentage: 0,
38480
+ position: 10
38481
+ },
38482
+ {
38483
+ name: "Item with 0% VAT",
38484
+ unitQuantity: 1,
38485
+ unitNetPrice: 230,
38486
+ unitType: "hours",
38487
+ vatPercentage: 0,
38488
+ position: 10
38489
+ },
38490
+ {
38491
+ name: "Item with 0% VAT",
38492
+ unitQuantity: 1,
38493
+ unitNetPrice: 230,
38494
+ unitType: "hours",
38495
+ vatPercentage: 0,
38496
+ position: 10
38755
38497
  },
38756
38498
  {
38757
38499
  name: "Item with 0% VAT",
@@ -38759,7 +38501,15 @@ var demoLetter = {
38759
38501
  unitNetPrice: 230,
38760
38502
  unitType: "hours",
38761
38503
  vatPercentage: 0,
38762
- currency: "EUR"
38504
+ position: 10
38505
+ },
38506
+ {
38507
+ name: "Item with 0% VAT",
38508
+ unitQuantity: 1,
38509
+ unitNetPrice: 230,
38510
+ unitType: "hours",
38511
+ vatPercentage: 0,
38512
+ position: 10
38763
38513
  }
38764
38514
  ]
38765
38515
  }
@@ -38834,7 +38584,7 @@ var DeContentInvoice = class extends DeesElement {
38834
38584
  }
38835
38585
  return vatGroups;
38836
38586
  };
38837
- DomTools.setupDomTools();
38587
+ dist_ts_exports27.DomTools.setupDomTools();
38838
38588
  }
38839
38589
  render() {
38840
38590
  return x`
@@ -38972,8 +38722,8 @@ var DeContentInvoice = class extends DeesElement {
38972
38722
  <div>We hereby invoice products and services provided to you by Lossless GmbH:</div>
38973
38723
  <div class="grid topLine dataHeader">
38974
38724
  <div class="lineItem">Item Pos.</div>
38975
- <div class="lineItem">Description</div>
38976
- <div class="lineItem">Quantity</div>
38725
+ <div class="lineItem">${translation_exports.translate("DE", "description", "Description")}</div>
38726
+ <div class="lineItem">${translation_exports.translate("DE", "quantity", "Quantity")}</div>
38977
38727
  <div class="lineItem">Unit Type</div>
38978
38728
  <div class="lineItem">Unit Net Price</div>
38979
38729
  <div class="lineItem">Total Net Price</div>
@@ -38987,9 +38737,9 @@ var DeContentInvoice = class extends DeesElement {
38987
38737
  <div class="lineItem">${invoiceItem.name}</div>
38988
38738
  <div class="lineItem">${invoiceItem.unitQuantity}</div>
38989
38739
  <div class="lineItem">${invoiceItem.unitType}</div>
38990
- <div class="lineItem">${invoiceItem.unitNetPrice} ${invoiceItem.currency}</div>
38740
+ <div class="lineItem">${invoiceItem.unitNetPrice} ${this.letterData?.content.invoiceData.currency}</div>
38991
38741
  <div class="lineItem">
38992
- ${invoiceItem.unitQuantity * invoiceItem.unitNetPrice} ${invoiceItem.currency}
38742
+ ${invoiceItem.unitQuantity * invoiceItem.unitNetPrice} ${this.letterData?.content.invoiceData.currency}
38993
38743
  </div>
38994
38744
  </div>
38995
38745
  `
@@ -39036,7 +38786,7 @@ var DeContentInvoice = class extends DeesElement {
39036
38786
  IBAN: ${this.letterData?.from?.sepaConnection?.iban}<br />
39037
38787
  BIC: ${this.letterData?.from?.sepaConnection?.bic}<br />
39038
38788
  Description: ${this.letterData?.content.invoiceData?.id}<br />
39039
- Amount: ${this.getTotalGross()} ${this.letterData?.content.invoiceData.items[0].currency}
38789
+ Amount: ${this.getTotalGross()} ${this.letterData?.content.invoiceData.currency}
39040
38790
  </div>
39041
38791
  ${this.letterData?.content?.contractData?.contractDate ? x`
39042
38792
  <div class="infoBox">
@@ -39086,7 +38836,7 @@ DeContentInvoice.demo = () => x`
39086
38836
  </div>
39087
38837
  `;
39088
38838
  DeContentInvoice.styles = [
39089
- domtools_elementbasic_exports.staticStyles,
38839
+ dist_ts_exports27.elementBasic.staticStyles,
39090
38840
  i`
39091
38841
  :host {
39092
38842
  color: #333;
@@ -39121,18 +38871,21 @@ var DePage = class extends DeesElement {
39121
38871
  this.pageTotalNumber = 1;
39122
38872
  this.letterData = null;
39123
38873
  this.printMode = false;
39124
- DomTools.setupDomTools();
38874
+ this.documentSettings = defaultDocumentSettings;
38875
+ dist_ts_exports27.DomTools.setupDomTools();
39125
38876
  }
39126
38877
  render() {
39127
38878
  return x`
39128
38879
  <div id="scaleWrapper">
39129
38880
  <dedocument-pagecontainer .printMode=${this.printMode}>
39130
38881
  ${this.letterData ? x`
39131
- <dedocument-pageheader
39132
- .letterData=${this.letterData}
39133
- .pageNumber="${this.pageNumber}"
39134
- .pageTotalNumber="${this.pageTotalNumber}"
39135
- ></dedocument-pageheader>
38882
+ ${this.documentSettings.enableDefaultHeader ? x`
38883
+ <dedocument-pageheader
38884
+ .letterData=${this.letterData}
38885
+ .pageNumber="${this.pageNumber}"
38886
+ .pageTotalNumber="${this.pageTotalNumber}"
38887
+ ></dedocument-pageheader>
38888
+ ` : ``}
39136
38889
  ${this.pageNumber === 1 ? x`
39137
38890
  <dedocument-letterheader
39138
38891
  .pageNumber="${this.pageNumber}"
@@ -39146,23 +38899,26 @@ var DePage = class extends DeesElement {
39146
38899
  .letterData=${this.letterData}
39147
38900
  ><slot></slot
39148
38901
  ></dedocument-pagecontent>
39149
- <dedocument-pagefooter
39150
- .letterData=${this.letterData}
39151
- .pageNumber="${this.pageNumber}"
39152
- .pageTotalNumber="${this.pageTotalNumber}"
39153
- ></dedocument-pagefooter>
38902
+ ${this.documentSettings.enableDefaultFooter ? x`
38903
+ <dedocument-pagefooter
38904
+ .letterData=${this.letterData}
38905
+ .pageNumber="${this.pageNumber}"
38906
+ .pageTotalNumber="${this.pageTotalNumber}"
38907
+ ></dedocument-pagefooter>
38908
+ ` : ``}
39154
38909
  <div class="versionOverlay">
39155
38910
  ${this.letterData.versionInfo.type === "draft" ? x`
39156
- <div class="topInfo">
39157
- Please note: THIS IS A DRAFT ONLY. NO RIGHTS CAN BE DERIVED FROM THIS.<br />
39158
- -> Revision/Document version: ${this.letterData.versionInfo.version}
39159
- </div>
38911
+ ${this.documentSettings.enableTopDraftText ? x`
38912
+ <div class="topInfo">
38913
+ Please note: THIS IS A DRAFT ONLY. NO RIGHTS CAN BE DERIVED FROM
38914
+ THIS.<br />
38915
+ -> Revision/Document version: ${this.letterData.versionInfo.version}
38916
+ </div>
38917
+ ` : ``}
39160
38918
  <div class="bigDraftText">DRAFT</div>
39161
38919
  ` : x``}
39162
38920
  </div>
39163
- ` : x`
39164
- <slot></slot>
39165
- `}
38921
+ ` : x` <slot></slot> `}
39166
38922
  </dedocument-pagecontainer>
39167
38923
  </div>
39168
38924
  `;
@@ -39195,7 +38951,7 @@ var DePage = class extends DeesElement {
39195
38951
  };
39196
38952
  DePage.demo = () => x` <dedocument-page .format="${"a4"}"></dedocument-page> `;
39197
38953
  DePage.styles = [
39198
- domtools_elementbasic_exports.staticStyles,
38954
+ dist_ts_exports27.elementBasic.staticStyles,
39199
38955
  i`
39200
38956
  :host {
39201
38957
  display: block;
@@ -39237,10 +38993,14 @@ DePage.styles = [
39237
38993
  `
39238
38994
  ];
39239
38995
  __decorateClass([
39240
- n4()
38996
+ n4({
38997
+ type: Number
38998
+ })
39241
38999
  ], DePage.prototype, "viewWidth", 2);
39242
39000
  __decorateClass([
39243
- n4()
39001
+ n4({
39002
+ type: Number
39003
+ })
39244
39004
  ], DePage.prototype, "viewHeight", 2);
39245
39005
  __decorateClass([
39246
39006
  n4({
@@ -39268,6 +39028,12 @@ __decorateClass([
39268
39028
  reflect: true
39269
39029
  })
39270
39030
  ], DePage.prototype, "printMode", 2);
39031
+ __decorateClass([
39032
+ n4({
39033
+ type: Object,
39034
+ reflect: true
39035
+ })
39036
+ ], DePage.prototype, "documentSettings", 2);
39271
39037
  DePage = __decorateClass([
39272
39038
  t4("dedocument-page")
39273
39039
  ], DePage);
@@ -39278,6 +39044,11 @@ var demoFunc = () => x`
39278
39044
  `;
39279
39045
 
39280
39046
  // ts_web/elements/document.ts
39047
+ var defaultDocumentSettings = {
39048
+ enableTopDraftText: true,
39049
+ enableDefaultHeader: true,
39050
+ enableDefaultFooter: true
39051
+ };
39281
39052
  var DeDocument = class extends DeesElement {
39282
39053
  constructor() {
39283
39054
  super();
@@ -39285,6 +39056,7 @@ var DeDocument = class extends DeesElement {
39285
39056
  this.viewWidth = null;
39286
39057
  this.viewHeight = null;
39287
39058
  this.printMode = false;
39059
+ this.documentSettings = defaultDocumentSettings;
39288
39060
  this.latestRenderedLetterData = null;
39289
39061
  dist_ts_exports27.DomTools.setupDomTools();
39290
39062
  }
@@ -39305,21 +39077,15 @@ var DeDocument = class extends DeesElement {
39305
39077
  this.registerGarbageFunction(() => {
39306
39078
  resizeObserver.disconnect();
39307
39079
  });
39308
- if (this.letterDataUrl) {
39309
- const response = await fetch(this.letterDataUrl);
39310
- this.letterData = await response.json();
39311
- }
39312
- this.renderDocument();
39313
39080
  }
39314
39081
  async renderDocument() {
39315
39082
  const domtools = await this.domtoolsPromise;
39316
- const documentContainer = this.shadowRoot.querySelector(".documentContainer");
39083
+ const documentBuildContainer = document.createElement("div");
39084
+ document.body.appendChild(documentBuildContainer);
39317
39085
  let pages = [];
39318
39086
  let pageCounter = 0;
39319
39087
  let complete = false;
39320
- const content3 = document.createElement(
39321
- "dedocument-contentinvoice"
39322
- );
39088
+ const content3 = new DeContentInvoice();
39323
39089
  content3.letterData = this.letterData;
39324
39090
  document.body.appendChild(content3);
39325
39091
  await domtools.convenience.smartdelay.delayFor(0);
@@ -39336,12 +39102,7 @@ var DeDocument = class extends DeesElement {
39336
39102
  newPage.pageNumber = pageCounter;
39337
39103
  newPage.append(currentContent);
39338
39104
  newPage.pageTotalNumber = pageCounter;
39339
- documentContainer.append(newPage);
39340
- if (!this.printMode) {
39341
- const betweenPagesSpacerDiv = document.createElement("div");
39342
- betweenPagesSpacerDiv.classList.add("betweenPagesSpacer");
39343
- documentContainer.append(betweenPagesSpacerDiv);
39344
- }
39105
+ documentBuildContainer.append(newPage);
39345
39106
  await currentContent.elementDomReady;
39346
39107
  await currentContent.trimStartToOffset(overallContentOffset);
39347
39108
  let newPageOverflows = await newPage.checkOverflow();
@@ -39359,8 +39120,20 @@ var DeDocument = class extends DeesElement {
39359
39120
  console.log(currentContentOffset);
39360
39121
  }
39361
39122
  document.body.removeChild(content3);
39123
+ document.body.removeChild(documentBuildContainer);
39124
+ const documentContainer = this.shadowRoot.querySelector(".documentContainer");
39125
+ if (documentContainer) {
39126
+ const children2 = Array.from(documentContainer.children);
39127
+ children2.forEach((child) => documentContainer.removeChild(child));
39128
+ }
39362
39129
  for (const page of pages) {
39363
39130
  page.pageTotalNumber = pageCounter;
39131
+ documentContainer.append(page);
39132
+ if (!this.printMode) {
39133
+ const betweenPagesSpacerDiv = document.createElement("div");
39134
+ betweenPagesSpacerDiv.classList.add("betweenPagesSpacer");
39135
+ documentContainer.appendChild(betweenPagesSpacerDiv);
39136
+ }
39364
39137
  }
39365
39138
  this.adjustDePageScaling();
39366
39139
  this.latestRenderedLetterData = this.letterData;
@@ -39448,9 +39221,17 @@ __decorateClass([
39448
39221
  ], DeDocument.prototype, "letterData", 2);
39449
39222
  __decorateClass([
39450
39223
  n4({
39451
- type: String
39224
+ type: Object,
39225
+ reflect: true,
39226
+ converter: (valueArg) => {
39227
+ if (typeof valueArg === "string") {
39228
+ return dist_ts_exports11.parseBase64(valueArg);
39229
+ } else {
39230
+ return valueArg;
39231
+ }
39232
+ }
39452
39233
  })
39453
- ], DeDocument.prototype, "letterDataUrl", 2);
39234
+ ], DeDocument.prototype, "documentSettings", 2);
39454
39235
  DeDocument = __decorateClass([
39455
39236
  t4("dedocument-dedocument")
39456
39237
  ], DeDocument);
@@ -39863,7 +39644,9 @@ var DePageHeader = class extends DeesElement {
39863
39644
  render() {
39864
39645
  return x`
39865
39646
  <div class="topstripe">
39866
- <img src="https://assetbroker.lossless.one/brandfiles/lossless/svg-minimal-bright.svg" />
39647
+ <div class="logo">
39648
+ No logo set!
39649
+ </div>
39867
39650
  </div>
39868
39651
  <div class="topstripe2">${this.letterData?.from?.description || "[no letterData.from.description set]"}</div>
39869
39652
  `;
@@ -39901,13 +39684,17 @@ DePageHeader.styles = [
39901
39684
  color: #333;
39902
39685
  font-size: 10px;
39903
39686
  }
39904
- .topstripe img {
39905
- filter: invert(1);
39687
+ .topstripe .logo {
39906
39688
  position: absolute;
39907
39689
  bottom: 10px;
39908
39690
  height: 25px;
39909
39691
  left: auto;
39910
39692
  right: ${r(rightMargin + "px")};
39693
+ font-family: 'Courier New', Courier, monospace;
39694
+ }
39695
+ .topstripe .logo img {
39696
+ position: relative;
39697
+ height: 25px;
39911
39698
  }
39912
39699
  `
39913
39700
  ];