@bookipi/htmlgenerator 1.1.23-alpha13 → 1.1.23-alpha15

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.
@@ -1650,71 +1650,8 @@ var FormatCurrencyDetails = function FormatCurrencyDetails(value, currency, lang
1650
1650
  formattedValue = format.format.replace("###", formattedValue);
1651
1651
  formattedValue = formattedValue.replace("$$", symbol);
1652
1652
  var currencySplit = formattedValue.split(format.decimal);
1653
- var format2 = numberFormat[numberFormatObj];
1654
- var startFromSymbol = format2.format.startsWith("$$");
1655
- var currencySplitFormatedArr = format2.format.replace("###", "|###|").replace("$$", "|$$$$|").split("|").filter(function (v) {
1656
- return v !== "";
1657
- }).map(function (section) {
1658
- if (section === "###") {
1659
- var decimalArr = formatMoney(parseFloat(value), decimal, format2.decimal, format2.group, true).split(format.decimal);
1660
-
1661
- if (decimalArr.length > 0) {
1662
- decimalArr[0] = {
1663
- type: "int",
1664
- val: decimalArr[0]
1665
- };
1666
- }
1667
-
1668
- if (decimalArr.length > 1) {
1669
- decimalArr.push({
1670
- type: "decimal",
1671
- val: decimalArr[1]
1672
- });
1673
- decimalArr[1] = {
1674
- type: "decimalSeperator",
1675
- val: format.decimal
1676
- };
1677
- }
1678
-
1679
- if (!startFromSymbol) {
1680
- decimalArr = [{
1681
- type: "negative",
1682
- val: value < 0 ? "-" : ""
1683
- }].concat(decimalArr);
1684
- }
1685
-
1686
- if (rtl && currencies[currencyName].rtl) {
1687
- decimalArr = decimalArr.reverse();
1688
- }
1689
-
1690
- return decimalArr;
1691
- } else if (section === "$$") {
1692
- if (startFromSymbol) {
1693
- return [{
1694
- type: "negative",
1695
- val: value < 0 ? "-" : ""
1696
- }, {
1697
- type: "symbol",
1698
- val: symbol
1699
- }];
1700
- } else {
1701
- return [{
1702
- type: "symbol",
1703
- val: symbol
1704
- }];
1705
- }
1706
- } else {
1707
- return [{
1708
- type: "text",
1709
- val: section
1710
- }];
1711
- }
1712
- }).reduce(function (a, b) {
1713
- return a.concat(b);
1714
- });
1715
1653
  return {
1716
1654
  currencySplit: currencySplit,
1717
- currencySplitFormatedArr: currencySplitFormatedArr,
1718
1655
  format: format,
1719
1656
  str: (value < 0 ? "-" : "") + formattedValue,
1720
1657
  symbol: symbol
@@ -9416,7 +9353,72 @@ function sanitize(obj) {
9416
9353
  var val = objarr[1];
9417
9354
 
9418
9355
  if (typeof val === "string" || val instanceof String) {
9419
- return [objarr[0], sanitizeHtml(objarr[1])];
9356
+ return [objarr[0], sanitizeHtml(objarr[1], {
9357
+ allowedAttributes: {
9358
+ "*": ["style"]
9359
+ },
9360
+ allowedStyles: {
9361
+ "*": {
9362
+ color: [/^.*$/],
9363
+ direction: [/^.*$/],
9364
+ "letter-spacing": [/^.*$/],
9365
+ "line-height": [/^.*$/],
9366
+ "text-align": [/^.*$/],
9367
+ "text-decoration": [/^.*$/],
9368
+ "text-indent": [/^.*$/],
9369
+ "text-shadow": [/^.*$/],
9370
+ "text-transform": [/^.*$/],
9371
+ "text-overflow": [/^.*$/],
9372
+ "vertical-align": [/^.*$/],
9373
+ "word-spacing": [/^.*$/],
9374
+ font: [/^.*$/],
9375
+ "font-family": [/^.*$/],
9376
+ "font-size": [/^\d.*$/],
9377
+ "font-style": [/^.*$/],
9378
+ "font-variant": [/^.*$/],
9379
+ "font-weight": [/^.*$/],
9380
+ "list-style-type": [/^.*$/],
9381
+ height: [/^.*$/],
9382
+ width: [/^.*$/],
9383
+ margin: [/^.*$/],
9384
+ "margin-top": [/^.*$/],
9385
+ "margin-right": [/^.*$/],
9386
+ "margin-bottom": [/^.*$/],
9387
+ "margin-left": [/^.*$/],
9388
+ padding: [/^.*$/],
9389
+ "padding-top": [/^.*$/],
9390
+ "padding-right": [/^.*$/],
9391
+ "padding-bottom": [/^.*$/],
9392
+ "padding-left": [/^.*$/],
9393
+ border: [/^.*$/],
9394
+ "border-color": [/^.*$/],
9395
+ "border-style": [/^.*$/],
9396
+ "border-width": [/^.*$/],
9397
+ "border-radius": [/^.*$/],
9398
+ "border-bottom": [/^.*$/],
9399
+ "border-bottom-color": [/^.*$/],
9400
+ "border-bottom-style": [/^.*$/],
9401
+ "border-bottom-width": [/^.*$/],
9402
+ "border-left": [/^.*$/],
9403
+ "border-left-color": [/^.*$/],
9404
+ "border-left-style": [/^.*$/],
9405
+ "border-left-width": [/^.*$/],
9406
+ "border-right": [/^.*$/],
9407
+ "border-right-color": [/^.*$/],
9408
+ "border-right-style": [/^.*$/],
9409
+ "border-right-width": [/^.*$/],
9410
+ "border-top": [/^.*$/],
9411
+ "border-top-color": [/^.*$/],
9412
+ "border-top-style": [/^.*$/],
9413
+ "border-top-width": [/^.*$/],
9414
+ outline: [/^.*$/],
9415
+ "outline-color": [/^.*$/],
9416
+ "outline-offset": [/^.*$/],
9417
+ "outline-style": [/^.*$/],
9418
+ "outline-width": [/^.*$/]
9419
+ }
9420
+ }
9421
+ })];
9420
9422
  } else if (typeof val === "object") {
9421
9423
  return [objarr[0], sanitize(objarr[1])];
9422
9424
  } else {
@@ -9749,7 +9751,7 @@ var DocumentDefinitionCompat = function DocumentDefinitionCompat(dd) {
9749
9751
 
9750
9752
  var CompanyCompat = function CompanyCompat(doc) {
9751
9753
  if (doc == null) return null;
9752
- var mapping = new Map([["dateFormat", "df"], ["timeZone", "tz"], ["language", "la"], ["TFN", "tfn"], ["paymentInstruction1", "p1"], ["paymentInstruction2", "p2"], ["paymentInstruction3", "p3"], ["invoiceColor", "ct"], ["taxPercentage", "tp"], ["taxDeductible", "t1d"], ["taxInclusive", "ti"], ["taxName", "tn"], ["twoTaxes", "ttx"], ["taxName2", "tn2"], ["taxPercentage2", "tp2"], ["taxDeductible2", "t2d"], ["name", "c"], ["hasPaymentInstruction", "pi"], ["additionalInfo", "ai"], ["phoneNumber", "ph"], ["displayEmail", "de"], ["email", "e"], ["logoExists", "lg"], ["currency", "cr"], ["hasSignature", "sg"], ["currencyFormat", "cf"]]);
9754
+ var mapping = new Map([["dateFormat", "df"], ["timeZone", "tz"], ["language", "la"], ["businessNumber", "tfn"], ["abbrBusinessNumber", "bn"], ["paymentInstruction1", "p1"], ["paymentInstruction2", "p2"], ["paymentInstruction3", "p3"], ["invoiceColor", "ct"], ["taxPercentage", "tp"], ["taxDeductible", "t1d"], ["taxInclusive", "ti"], ["taxName", "tn"], ["twoTaxes", "ttx"], ["taxName2", "tn2"], ["taxPercentage2", "tp2"], ["taxDeductible2", "t2d"], ["name", "c"], ["hasPaymentInstruction", "pi"], ["additionalInfo", "ai"], ["phoneNumber", "ph"], ["displayEmail", "de"], ["email", "e"], ["logoExists", "lg"], ["currency", "cr"], ["hasSignature", "sg"], ["currencyFormat", "cf"]]);
9753
9755
  var rootMapping = new Map([["template", TemplateCompat], ["documentDefinitions", DocumentDefinitionCompat]]);
9754
9756
  var newCompany = Object.fromEntries(Object.entries(doc).map(function (_ref6) {
9755
9757
  var k = _ref6[0],