@pdfme/ui 6.1.12-dev.14 → 6.1.12-dev.16

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.
package/dist/index.js CHANGED
@@ -46116,7 +46116,10 @@ var evaluatePlaceholders = (arg) => {
46116
46116
  resultContent += content.slice(startIndex, endIndex);
46117
46117
  }
46118
46118
  index = endIndex;
46119
- } else throw new Error("Invalid placeholder");
46119
+ } else {
46120
+ resultContent += content.slice(startIndex);
46121
+ break;
46122
+ }
46120
46123
  }
46121
46124
  return resultContent;
46122
46125
  };
@@ -73786,6 +73789,10 @@ var getBoxInsets = (schema) => ({
73786
73789
  borderWidth: normalizeBoxDimension(schema.borderWidth),
73787
73790
  padding: normalizeBoxDimension(schema.padding)
73788
73791
  });
73792
+ var getBoxVerticalInset = (schema) => {
73793
+ const { borderWidth, padding } = getBoxInsets(schema);
73794
+ return borderWidth.top + borderWidth.bottom + padding.top + padding.bottom;
73795
+ };
73789
73796
  var getBoxContentArea = (schema) => {
73790
73797
  const { borderWidth, padding } = getBoxInsets(schema);
73791
73798
  const leftInset = borderWidth.left + padding.left;
@@ -74759,7 +74766,7 @@ var getRichTextLineHeight = (line, fontSize) => {
74759
74766
  return Math.max(...line.runs.map((run) => heightOfFontAtSize(run.fontKitFont, fontSize)));
74760
74767
  };
74761
74768
  //#endregion
74762
- //#region ../schemas/dist/dynamicTemplate-Bs3HHtDw.js
74769
+ //#region ../schemas/dist/dynamicTemplate-CnK0nlnj.js
74763
74770
  function _typeof$17(o) {
74764
74771
  "@babel/helpers - typeof";
74765
74772
  return _typeof$17 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -74812,16 +74819,17 @@ var Cell$1 = class {
74812
74819
  this.text = raw.split(splitRegex);
74813
74820
  }
74814
74821
  getContentHeight() {
74815
- const lineCount = Array.isArray(this.text) ? this.text.length : 1;
74816
- const lineHeight = pt2mm(this.styles.fontSize) * this.styles.lineHeight;
74817
- const vPadding = this.padding("top") + this.padding("bottom");
74818
- const height = lineCount * lineHeight + vPadding;
74822
+ const height = (Array.isArray(this.text) ? this.text.length : 1) * (pt2mm(this.styles.fontSize) * this.styles.lineHeight) + getBoxVerticalInset(getCellBoxStyle(this));
74819
74823
  return Math.max(height, this.styles.minCellHeight);
74820
74824
  }
74821
74825
  padding(name) {
74822
74826
  return this.styles.cellPadding[name];
74823
74827
  }
74824
74828
  };
74829
+ var getCellBoxStyle = (cell) => ({
74830
+ padding: cell.styles.cellPadding,
74831
+ borderWidth: cell.styles.lineWidth
74832
+ });
74825
74833
  var Column$2 = class {
74826
74834
  constructor(index) {
74827
74835
  _defineProperty$12(this, "index", void 0);
@@ -74989,10 +74997,19 @@ async function fitContent(table, getFontKitFontByFontName) {
74989
74997
  const cell = row.cells[column.index];
74990
74998
  if (!cell) continue;
74991
74999
  const fontKitFont = await getFontKitFontByFontName(cell.styles.fontName);
75000
+ const contentArea = getBoxContentArea({
75001
+ position: {
75002
+ x: 0,
75003
+ y: 0
75004
+ },
75005
+ width: cell.width,
75006
+ height: cell.height,
75007
+ ...getCellBoxStyle(cell)
75008
+ });
74992
75009
  cell.text = splitTextToSize({
74993
75010
  value: cell.raw,
74994
75011
  characterSpacing: cell.styles.characterSpacing,
74995
- boxWidthInPt: mm2pt(cell.width),
75012
+ boxWidthInPt: mm2pt(contentArea.width),
74996
75013
  fontSize: cell.styles.fontSize,
74997
75014
  fontKitFont
74998
75015
  });
@@ -75326,7 +75343,7 @@ var getDynamicLayoutForTable = async (value, args) => {
75326
75343
  };
75327
75344
  };
75328
75345
  //#endregion
75329
- //#region ../schemas/dist/utils-DK3W81o_.js
75346
+ //#region ../schemas/dist/utils-D_sFXK0U.js
75330
75347
  var convertForPdfLayoutProps = ({ schema, pageHeight, applyRotateTranslate = true }) => {
75331
75348
  const { width: mmWidth, height: mmHeight, position, rotate, opacity } = schema;
75332
75349
  const { x: mmX, y: mmY } = position;
@@ -75616,7 +75633,7 @@ var Underline = [["path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }], ["line", {
75616
75633
  y2: "20"
75617
75634
  }]];
75618
75635
  //#endregion
75619
- //#region ../schemas/dist/builtins-DZAw3Nhr.js
75636
+ //#region ../schemas/dist/builtins-8En4EIAG.js
75620
75637
  var addUriLinkAnnotation = (arg) => {
75621
75638
  const { pdfDoc, page, uri, rect, borderWidth = 0 } = arg;
75622
75639
  const safeUri = normalizeSafeLinkUri(uri);