realreport-designer 1.10.8 → 1.10.9

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * RealReport Designer v1.10.8 (build: 16e1400)
2
+ * RealReport Designer v1.10.9 (build: 8af1bc1)
3
3
  * Copyright (C) 2013-2025 WooriTech Inc.
4
4
  * All Rights Reserved.
5
5
  */
@@ -105380,7 +105380,7 @@ class zF extends Ai {
105380
105380
  // constructor
105381
105381
  //-------------------------------------------------------------------------
105382
105382
  constructor(e, t, i) {
105383
- super(), this._report = e, this.elementCreator = i, this._imageLoader = new NT(), this._domConverter = new d2(), this._pages = this.$_build(t);
105383
+ super(), this._font = "", this._fontBold = "", this._report = e, this.elementCreator = i, this._imageLoader = new NT(), this._domConverter = new d2(), this._pages = this.$_build(t), this._fontMap = /* @__PURE__ */ new Map();
105384
105384
  }
105385
105385
  _doDispose() {
105386
105386
  super._doDispose();
@@ -105482,23 +105482,34 @@ class zF extends Ai {
105482
105482
  async prepare() {
105483
105483
  await Promise.all([this._imageLoader.loadImages(), this._domConverter.loadToImage()]);
105484
105484
  }
105485
- write(e, t, i) {
105486
- this._doc = e, this._font = t, this._fontBold = i;
105487
- for (let r = 0; r < this._pages.length; r++) {
105488
- const s = this._pages[r];
105489
- if (this._offsetX = s.offsetX, this._offsetY = s.offsetY, s.write(this), r < this._pages.length - 1) {
105490
- const n = this._pages[r + 1].pageOrientation;
105485
+ write(e, t) {
105486
+ this._doc = e, t.forEach((i) => {
105487
+ const r = this._fontMap.get(i.name);
105488
+ r ? r.push({
105489
+ style: i.style,
105490
+ weight: i.weight
105491
+ }) : this._fontMap.set(i.name, [
105492
+ {
105493
+ style: i.style,
105494
+ weight: i.weight
105495
+ }
105496
+ ]), i.weight === "normal" && this._font === "" && (this._font = `${i.name}-${i.weight}`), i.weight === "bold" && this._fontBold === "" && (this._fontBold = `${i.name}-${i.weight}`);
105497
+ });
105498
+ for (let i = 0; i < this._pages.length; i++) {
105499
+ const r = this._pages[i];
105500
+ if (this._offsetX = r.offsetX, this._offsetY = r.offsetY, r.write(this), i < this._pages.length - 1) {
105501
+ const s = this._pages[i + 1].pageOrientation;
105491
105502
  if (ee.isArray(this.report)) {
105492
- const o = this.report[this._pages[r + 1].reportIndex].paper, l = o.getPageSize(null), h = Math.round(gm(l.width)), c = Math.round(gm(l.height));
105503
+ const n = this.report[this._pages[i + 1].reportIndex].paper, o = n.getPageSize(null), l = Math.round(gm(o.width)), h = Math.round(gm(o.height));
105493
105504
  e.addPage({
105494
105505
  ...e.options,
105495
- size: o.orientation === dl.LANDSCAPE ? [c, h] : [h, c],
105496
- layout: n
105506
+ size: n.orientation === dl.LANDSCAPE ? [h, l] : [l, h],
105507
+ layout: s
105497
105508
  });
105498
105509
  } else
105499
105510
  e.addPage({
105500
105511
  ...e.options,
105501
- layout: n
105512
+ layout: s
105502
105513
  });
105503
105514
  }
105504
105515
  }
@@ -105547,30 +105558,30 @@ class zF extends Ai {
105547
105558
  return this;
105548
105559
  const s = this._doc;
105549
105560
  s.save(), this.rotate(r, i);
105550
- const n = X.getTextOneLineHeight(e) * ar, o = this.$_css(t), { textAlign: l } = o;
105551
- return Xo.setFontSize(o, this), new D1().parseLinesFromDom(e).forEach((c) => {
105552
- let d = 0;
105561
+ const n = X.getTextOneLineHeight(e) * ar, o = this.$_css(t), { textAlign: l, fontFamily: h } = o;
105562
+ return Xo.setFontSize(o, this), new D1().parseLinesFromDom(e).forEach((d) => {
105563
+ let u = 0;
105553
105564
  switch (l) {
105554
105565
  case "start":
105555
105566
  case "left":
105556
- d = i.x;
105567
+ u = i.x;
105557
105568
  break;
105558
105569
  case "end":
105559
105570
  case "right":
105560
- d = i.x + (i.width - this.$_getLinesTextWidth(c.nodes));
105571
+ u = i.x + (i.width - this.$_getLinesTextWidth(d.nodes));
105561
105572
  break;
105562
105573
  default:
105563
- d = i.x + (i.width - this.$_getLinesTextWidth(c.nodes)) / 2;
105574
+ u = i.x + (i.width - this.$_getLinesTextWidth(d.nodes)) / 2;
105564
105575
  break;
105565
105576
  }
105566
- c.nodes.forEach((u, A) => {
105567
- if (u.type === "text") {
105568
- const { color: f } = this.$_getPdfColor(u.color), p = s.widthOfString(u.text), g = c.line - 1;
105569
- u.bold ? this.setFontBold() : this.setFont(), A === 0 ? s.fillColor(f).text(u.text, d, i.y + n * g, {
105570
- underline: u.underline
105571
- }) : s.fillColor(f).text(u.text, d, i.y + n * g, {
105572
- underline: u.underline
105573
- }), d += p;
105577
+ d.nodes.forEach((A, f) => {
105578
+ if (A.type === "text") {
105579
+ const { color: p } = this.$_getPdfColor(A.color), g = s.widthOfString(A.text), _ = d.line - 1;
105580
+ A.bold ? this.setFontBold(h) : this.setFont(h), f === 0 ? s.fillColor(p).text(A.text, u, i.y + n * _, {
105581
+ underline: A.underline
105582
+ }) : s.fillColor(p).text(A.text, u, i.y + n * _, {
105583
+ underline: A.underline
105584
+ }), u += g;
105574
105585
  }
105575
105586
  });
105576
105587
  }), s.restore(), this;
@@ -105592,14 +105603,22 @@ class zF extends Ai {
105592
105603
  });
105593
105604
  }), this;
105594
105605
  }
105606
+ isFontExist(e = "", t, i) {
105607
+ if (e === "")
105608
+ return !1;
105609
+ const r = this._fontMap.get(e);
105610
+ return r ? !!r.find((n) => n.style === t && n.weight === i) : !1;
105611
+ }
105595
105612
  setFontSize(e) {
105596
105613
  return this._doc.fontSize(e), this;
105597
105614
  }
105598
- setFont(e) {
105599
- return this._doc.font(this._font, "sans-serif"), this;
105615
+ setFont(e = "") {
105616
+ const t = e.replace(/"/g, "");
105617
+ return this.isFontExist(t, "normal", "normal") ? this._doc.font(`${t}-normal`, "sans-serif") : (console.warn(`일치하는 폰트가 없어 ${this._font} 폰트를 사용합니다.`), this._doc.font(this._font, "sans-serif")), this;
105600
105618
  }
105601
- setFontBold(e) {
105602
- return this._doc.font(this._fontBold, "sans-serif"), this;
105619
+ setFontBold(e = "") {
105620
+ const t = e.replace(/"/g, "");
105621
+ return this.isFontExist(t, "normal", "bold") ? this._doc.font(`${t}-bold`, "sans-serif") : (console.warn(`일치하는 폰트가 없어 ${this._fontBold} 폰트를 사용합니다.`), this._doc.font(this._fontBold, "sans-serif")), this;
105603
105622
  }
105604
105623
  getMaxWidthOfString(e, t, i = !1) {
105605
105624
  let r = 0;
@@ -108194,32 +108213,29 @@ class lN extends Ai {
108194
108213
  // internal members
108195
108214
  //-------------------------------------------------------------------------
108196
108215
  $_export(e, t, i) {
108197
- var r;
108198
- let s;
108199
- ee.isArray(e.report) ? s = e.report[0].paper : s = e.report.paper;
108200
- const n = s.getPageSize(null), o = Math.round(gm(n.width)), l = Math.round(gm(n.height)), h = s.getMargins(), c = e.getOrientation(0), d = new window.PDFDocument({
108201
- size: s.orientation === dl.LANDSCAPE ? [l, o] : [o, l],
108202
- layout: c,
108216
+ let r;
108217
+ ee.isArray(e.report) ? r = e.report[0].paper : r = e.report.paper;
108218
+ const s = r.getPageSize(null), n = Math.round(gm(s.width)), o = Math.round(gm(s.height)), l = r.getMargins(), h = e.getOrientation(0), c = new window.PDFDocument({
108219
+ size: r.orientation === dl.LANDSCAPE ? [o, n] : [n, o],
108220
+ layout: h,
108203
108221
  margins: {
108204
- left: gm(h.left),
108205
- top: gm(h.top),
108206
- right: gm(h.right),
108207
- bottom: gm(h.bottom)
108222
+ left: gm(l.left),
108223
+ top: gm(l.top),
108224
+ right: gm(l.right),
108225
+ bottom: gm(l.bottom)
108208
108226
  },
108209
108227
  margin: 0,
108210
108228
  ...i
108211
- }), u = d.pipe(new window.blobStream());
108212
- let A, f;
108213
- if (t && t.length > 0) {
108214
- for (let p of t)
108215
- p.content && d.registerFont(p.name, this._base64ToArrayBuffer(p.content));
108216
- A = t[0].name, f = ((r = t[1]) === null || r === void 0 ? void 0 : r.name) || A;
108217
- } else
108229
+ }), d = c.pipe(new window.blobStream());
108230
+ if (t && t.length > 0)
108231
+ for (let u of t)
108232
+ u.content && c.registerFont(`${u.name}-${u.weight}`, this._base64ToArrayBuffer(u.content));
108233
+ else
108218
108234
  throw new Error("Pdf 출력용 폰트가 설정돼야 합니다.");
108219
- e.write(d, A, f);
108220
- for (let p of this._svgs)
108221
- p.removeChild(p.firstElementChild);
108222
- return d.end(), u;
108235
+ e.write(c, t);
108236
+ for (let u of this._svgs)
108237
+ u.removeChild(u.firstElementChild);
108238
+ return c.end(), d;
108223
108239
  }
108224
108240
  }
108225
108241
  var G$ = { exports: {} };
@@ -133489,7 +133505,7 @@ class GC extends vz {
133489
133505
  }
133490
133506
  }
133491
133507
  var eRe = `/*
133492
- RealReport v1.10.8
133508
+ RealReport v1.10.9
133493
133509
  Copyright (C) 2013-2025 WooriTech Inc.
133494
133510
  All Rights Reserved.
133495
133511
  */
@@ -150313,7 +150329,7 @@ let yLe = class extends uy {
150313
150329
  t.appendChild(X.createSpan(e, null, {
150314
150330
  fontSize: "20px",
150315
150331
  marginTop: "20px"
150316
- }, "RealReport Web Designer")), t.appendChild(X.createSpan(e, null, null, "Application version: 1.10.8")), t.appendChild(X.createSpan(e, null, null, "©Wooritech Inc. All rights reserved."));
150332
+ }, "RealReport Web Designer")), t.appendChild(X.createSpan(e, null, null, "Application version: 1.10.9")), t.appendChild(X.createSpan(e, null, null, "©Wooritech Inc. All rights reserved."));
150317
150333
  }
150318
150334
  _doInitStyles(e) {
150319
150335
  X.setStyles(e, {