pdf-factory 0.8.11 → 0.8.13
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/README.md +2 -1
- package/dist/parser.cjs +11 -11
- package/dist/parser.cjs.map +1 -1
- package/dist/parser.js +372 -380
- package/dist/parser.js.map +1 -1
- package/dist/pdf-factory.cjs +3 -3
- package/dist/pdf-factory.cjs.map +1 -1
- package/dist/pdf-factory.js +51 -51
- package/dist/pdf-factory.js.map +1 -1
- package/dist/{rolldown-runtime-C6qsp3rV.cjs → rolldown-runtime-CYJQrBu7.cjs} +1 -1
- package/package.json +10 -6
package/dist/pdf-factory.js
CHANGED
|
@@ -1720,7 +1720,7 @@ function Ct(e, t, n, r) {
|
|
|
1720
1720
|
e.setDrawColor(0), e.setLineWidth(.5), e.line(10, o, i - 10, o), o += 4, z(e, L.SMALL, I.BOLD), e.text("Score:", 10, o);
|
|
1721
1721
|
for (let t = 0; t < 5; t++) {
|
|
1722
1722
|
let n = 28 + t * 15;
|
|
1723
|
-
e.rect(n, o - 4, 12, 8), z(e, L.TINY, I.NORMAL), e.setTextColor(150), e.text(`Set ${t + 1}`, n +
|
|
1723
|
+
e.rect(n, o - 4, 12, 8), z(e, L.TINY, I.NORMAL), e.setTextColor(150), e.text(`Set ${t + 1}`, n + 6, o - 5, { align: "center" }), e.setTextColor(0);
|
|
1724
1724
|
}
|
|
1725
1725
|
o += 14, z(e, L.SMALL, I.NORMAL), e.text("Umpire:", 10, o), e.setDrawColor(150), e.setLineWidth(.3), e.line(30, o, 90, o), e.text("Signature:", i - 10 - 70, o), e.line(i - 10 - 40, o, i - 10, o);
|
|
1726
1726
|
}
|
|
@@ -2595,13 +2595,13 @@ function Fn(e, t, n, r) {
|
|
|
2595
2595
|
};
|
|
2596
2596
|
J(e, t.losersBracket, n, d);
|
|
2597
2597
|
let f = i.left + c + 8, p = r.contentY + a / 2;
|
|
2598
|
-
if (z(e, L.SMALL, I.BOLD), e.text("Decider", f +
|
|
2598
|
+
if (z(e, L.SMALL, I.BOLD), e.text("Decider", f + 14, p - 14 - 4, { align: "center" }), e.setDrawColor(60), e.setLineWidth(.5), e.rect(f, p - 14 - 1, 28, 14), e.setLineWidth(.2), e.line(f, p - 7 - 1, f + 28, p - 7 - 1), t.deciderMatch?.matchUps?.length) {
|
|
2599
2599
|
let n = t.deciderMatch.matchUps[0], r = new Map(t.deciderMatch.slots.map((e) => [e.drawPosition, e]));
|
|
2600
2600
|
if (n.drawPositions[0]) {
|
|
2601
2601
|
let t = r.get(n.drawPositions[0]);
|
|
2602
2602
|
if (t?.participantName) {
|
|
2603
2603
|
let r = n.winningSide === 1;
|
|
2604
|
-
z(e, L.TINY, r ? I.BOLD : I.NORMAL), e.text(t.participantName, f + 1, p -
|
|
2604
|
+
z(e, L.TINY, r ? I.BOLD : I.NORMAL), e.text(t.participantName, f + 1, p - 7 - 3, { maxWidth: 26 });
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
2607
|
if (n.drawPositions[1]) {
|
|
@@ -2651,12 +2651,12 @@ function Vn(e, t, n, r, i, a, o, s) {
|
|
|
2651
2651
|
let u = t.drawPositions[0] ? n.get(t.drawPositions[0]) : void 0;
|
|
2652
2652
|
if (u) {
|
|
2653
2653
|
let n = Ot(u, r);
|
|
2654
|
-
z(e, c, t.winningSide === 1 ? I.BOLD : I.NORMAL), e.text(n, i + Ln, l - c * .15, { maxWidth: o - 2
|
|
2654
|
+
z(e, c, t.winningSide === 1 ? I.BOLD : I.NORMAL), e.text(n, i + Ln, l - c * .15, { maxWidth: o - 2 });
|
|
2655
2655
|
}
|
|
2656
2656
|
let d = t.drawPositions[1] ? n.get(t.drawPositions[1]) : void 0;
|
|
2657
2657
|
if (d) {
|
|
2658
2658
|
let n = Ot(d, r);
|
|
2659
|
-
z(e, c, t.winningSide === 2 ? I.BOLD : I.NORMAL), e.text(n, i + Ln, l + c * .55, { maxWidth: o - 2
|
|
2659
|
+
z(e, c, t.winningSide === 2 ? I.BOLD : I.NORMAL), e.text(n, i + Ln, l + c * .55, { maxWidth: o - 2 });
|
|
2660
2660
|
}
|
|
2661
2661
|
if (t.score) {
|
|
2662
2662
|
let n = q(t.score, r);
|
|
@@ -3796,20 +3796,20 @@ function Kr(e, t, n, r) {
|
|
|
3796
3796
|
//#endregion
|
|
3797
3797
|
//#region src/generators/drawSheet.ts
|
|
3798
3798
|
function qr(t, n = {}) {
|
|
3799
|
-
let { header: r, includeSeedings: i = !0, includeScores: a = !0 } = n, o = new e({
|
|
3800
|
-
orientation:
|
|
3799
|
+
let { header: r, includeSeedings: i = !0, includeScores: a = !0 } = n, o = t.drawSize >= 32, s = new e({
|
|
3800
|
+
orientation: o ? "landscape" : "portrait",
|
|
3801
3801
|
format: "a4"
|
|
3802
3802
|
});
|
|
3803
|
-
R(
|
|
3804
|
-
let
|
|
3803
|
+
R(s);
|
|
3804
|
+
let c = 15;
|
|
3805
3805
|
if (r) {
|
|
3806
3806
|
let e = `${t.drawName} - ${t.drawType.replace(/_/g, " ")} (${t.drawSize})`;
|
|
3807
|
-
|
|
3807
|
+
c = gt(s, {
|
|
3808
3808
|
...r,
|
|
3809
3809
|
subtitle: e
|
|
3810
3810
|
});
|
|
3811
3811
|
}
|
|
3812
|
-
return
|
|
3812
|
+
return c = t.drawSize <= 64 && t.drawSize > 0 ? Jr(s, t, c, a) : Yr(s, t, c), i && t.seedAssignments.length > 0 && Xr(s, t, c + 8), G(s, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`), s;
|
|
3813
3813
|
}
|
|
3814
3814
|
function Jr(e, t, n, r) {
|
|
3815
3815
|
let i = e.internal.pageSize.getWidth(), a = e.internal.pageSize.getHeight(), o = i - 30, s = a - n - 30, c = t.totalRounds, l = Math.min(90, (o - c * 10) / c), u = Math.min(14, s / t.drawSize), d = {
|
|
@@ -3943,56 +3943,56 @@ function Xr(e, n, r) {
|
|
|
3943
3943
|
//#endregion
|
|
3944
3944
|
//#region src/generators/schedule.ts
|
|
3945
3945
|
function Zr(n, r = {}) {
|
|
3946
|
-
let { header: i, fullCourtNames: a = !0, notes: o } = r, s = new e({
|
|
3947
|
-
orientation:
|
|
3946
|
+
let { header: i, fullCourtNames: a = !0, notes: o } = r, s = (r.landscape === "auto" ? n.courts.length >= 5 : r.landscape) ? "landscape" : "portrait", c = new e({
|
|
3947
|
+
orientation: s,
|
|
3948
3948
|
format: "a4"
|
|
3949
3949
|
});
|
|
3950
|
-
R(
|
|
3951
|
-
let
|
|
3950
|
+
R(c);
|
|
3951
|
+
let l = 15;
|
|
3952
3952
|
if (i) {
|
|
3953
3953
|
let e = n.scheduledDate ? `Order of Play - ${n.scheduledDate}` : "Order of Play";
|
|
3954
|
-
|
|
3954
|
+
l = gt(c, {
|
|
3955
3955
|
...i,
|
|
3956
3956
|
subtitle: e
|
|
3957
3957
|
});
|
|
3958
3958
|
}
|
|
3959
|
-
let
|
|
3959
|
+
let u = n.courts, d = a ? u : u.map($r);
|
|
3960
3960
|
for (let e of n.timeSlots) {
|
|
3961
|
-
z(
|
|
3962
|
-
let n =
|
|
3961
|
+
z(c, L.BODY, I.BOLD), c.setTextColor(30, 60, 120), c.text(e.label, 15, l), c.setTextColor(0), l += 4;
|
|
3962
|
+
let n = d.map((e) => ({
|
|
3963
3963
|
header: e,
|
|
3964
3964
|
dataKey: e
|
|
3965
3965
|
})), r = /* @__PURE__ */ new Map();
|
|
3966
|
-
|
|
3966
|
+
u.forEach((e) => r.set(e, []));
|
|
3967
3967
|
for (let t of e.matches) {
|
|
3968
3968
|
let e = Qr(t), n = r.get(t.courtName) || [];
|
|
3969
3969
|
n.push(e), r.set(t.courtName, n);
|
|
3970
3970
|
}
|
|
3971
|
-
let o = Math.max(1, ...Array.from(r.values()).map((e) => e.length)),
|
|
3971
|
+
let o = Math.max(1, ...Array.from(r.values()).map((e) => e.length)), s = [];
|
|
3972
3972
|
for (let e = 0; e < o; e++) {
|
|
3973
3973
|
let t = {};
|
|
3974
|
-
|
|
3975
|
-
let o = r.get(n) || [], s = a ? n :
|
|
3974
|
+
u.forEach((n, i) => {
|
|
3975
|
+
let o = r.get(n) || [], s = a ? n : d[i];
|
|
3976
3976
|
t[s] = o[e] || "";
|
|
3977
|
-
}),
|
|
3977
|
+
}), s.push(t);
|
|
3978
3978
|
}
|
|
3979
|
-
t(
|
|
3979
|
+
t(c, {
|
|
3980
3980
|
..._t.schedule,
|
|
3981
|
-
startY:
|
|
3981
|
+
startY: l,
|
|
3982
3982
|
columns: n,
|
|
3983
|
-
body:
|
|
3983
|
+
body: s,
|
|
3984
3984
|
tableWidth: "auto",
|
|
3985
3985
|
didDrawPage: (e) => {
|
|
3986
|
-
G(
|
|
3986
|
+
G(c, i?.tournamentName || "", e.pageNumber);
|
|
3987
3987
|
}
|
|
3988
|
-
}),
|
|
3988
|
+
}), l = c.lastAutoTable?.finalY + 6 || l + 20;
|
|
3989
3989
|
}
|
|
3990
3990
|
if (o?.length) {
|
|
3991
|
-
|
|
3992
|
-
for (let e of o)
|
|
3993
|
-
|
|
3991
|
+
l += 4, z(c, L.SMALL, I.ITALIC), c.setTextColor(80);
|
|
3992
|
+
for (let e of o) c.text(e, 15, l), l += 4;
|
|
3993
|
+
c.setTextColor(0);
|
|
3994
3994
|
}
|
|
3995
|
-
return
|
|
3995
|
+
return c;
|
|
3996
3996
|
}
|
|
3997
3997
|
function Qr(e) {
|
|
3998
3998
|
let t = [];
|
|
@@ -4014,7 +4014,7 @@ function ni(e, t) {
|
|
|
4014
4014
|
let r = t[e];
|
|
4015
4015
|
if (r === void 0) continue;
|
|
4016
4016
|
let i = n[e];
|
|
4017
|
-
ri(i) && ri(r) ?
|
|
4017
|
+
n[e] = ri(i) && ri(r) ? ni(i, r) : r;
|
|
4018
4018
|
}
|
|
4019
4019
|
return n;
|
|
4020
4020
|
}
|
|
@@ -4105,37 +4105,37 @@ function pi(e) {
|
|
|
4105
4105
|
return t;
|
|
4106
4106
|
}
|
|
4107
4107
|
function mi(n, r, i = {}) {
|
|
4108
|
-
let a = new e({
|
|
4109
|
-
orientation:
|
|
4108
|
+
let a = i.orientation || "landscape", o = new e({
|
|
4109
|
+
orientation: a,
|
|
4110
4110
|
format: "a4"
|
|
4111
4111
|
});
|
|
4112
|
-
R(
|
|
4113
|
-
let
|
|
4114
|
-
if (i.header ?
|
|
4112
|
+
R(o);
|
|
4113
|
+
let s = 15;
|
|
4114
|
+
if (i.header ? s = gt(o, {
|
|
4115
4115
|
...i.header,
|
|
4116
4116
|
subtitle: i.header.subtitle || i.title
|
|
4117
|
-
}) : i.title && (z(
|
|
4118
|
-
let
|
|
4117
|
+
}) : i.title && (z(o, L.SUBTITLE, I.BOLD), o.text(i.title, 15, s), s += 8), n.length === 0) return z(o, L.BODY, I.ITALIC), o.text("No columns defined", 15, s), G(o, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, 1), o;
|
|
4118
|
+
let c = n.map((e) => ({
|
|
4119
4119
|
header: e.title,
|
|
4120
4120
|
dataKey: e.key
|
|
4121
|
-
})),
|
|
4121
|
+
})), l = r.map((e) => {
|
|
4122
4122
|
let t = {};
|
|
4123
4123
|
for (let r of n) {
|
|
4124
4124
|
let n = e[r.key];
|
|
4125
4125
|
t[r.key] = n == null ? "" : String(n);
|
|
4126
4126
|
}
|
|
4127
4127
|
return t;
|
|
4128
|
-
}),
|
|
4129
|
-
return t(
|
|
4128
|
+
}), u = pi(n);
|
|
4129
|
+
return t(o, {
|
|
4130
4130
|
..._t.report,
|
|
4131
|
-
startY:
|
|
4132
|
-
columns:
|
|
4133
|
-
body:
|
|
4134
|
-
columnStyles:
|
|
4131
|
+
startY: s,
|
|
4132
|
+
columns: c,
|
|
4133
|
+
body: l,
|
|
4134
|
+
columnStyles: u,
|
|
4135
4135
|
didDrawPage: (e) => {
|
|
4136
|
-
G(
|
|
4136
|
+
G(o, `Generated ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`, e.pageNumber);
|
|
4137
4137
|
}
|
|
4138
|
-
}),
|
|
4138
|
+
}), o;
|
|
4139
4139
|
}
|
|
4140
4140
|
//#endregion
|
|
4141
4141
|
//#region src/generators/factSheet.ts
|
|
@@ -4164,7 +4164,7 @@ function Q(e, t, n) {
|
|
|
4164
4164
|
}
|
|
4165
4165
|
function gi(e, t, n, r) {
|
|
4166
4166
|
z(e, L.BODY, I.NORMAL);
|
|
4167
|
-
let i = r || e.internal.pageSize.getWidth() -
|
|
4167
|
+
let i = r || e.internal.pageSize.getWidth() - 30, a = e.splitTextToSize(t, i);
|
|
4168
4168
|
return e.text(a, Z, n), n + a.length * 3.2;
|
|
4169
4169
|
}
|
|
4170
4170
|
function $(e, t, n) {
|