@pdfme/ui 4.3.2-dev.1 → 4.3.2-dev.3
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.es.js +270 -203
- package/dist/index.umd.js +13 -13
- package/dist/types/helper.d.ts +0 -1
- package/package.json +1 -1
- package/src/Designer.tsx +1 -1
- package/src/class.ts +2 -1
- package/src/components/Designer/index.tsx +1 -1
- package/src/components/Preview.tsx +5 -8
- package/src/helper.ts +1 -2
- package/src/hooks.ts +1 -1
package/dist/index.es.js
CHANGED
@@ -9365,7 +9365,7 @@ const UIOptions = CommonOptions.extend({
|
|
9365
9365
|
}), HTMLElementSchema = z.any().refine((a) => a instanceof HTMLElement), UIProps = CommonProps.extend({
|
9366
9366
|
domContainer: HTMLElementSchema,
|
9367
9367
|
options: UIOptions.optional()
|
9368
|
-
}), PreviewProps = UIProps.extend({ inputs: Inputs }).strict(), DesignerProps = UIProps.extend({}).strict(), uniq = (a) => Array.from(new Set(a)), getFallbackFontName = (a) => {
|
9368
|
+
}), PreviewProps = UIProps.extend({ inputs: Inputs }).strict(), DesignerProps = UIProps.extend({}).strict(), cloneDeep$1 = (a) => JSON.parse(JSON.stringify(a)), uniq = (a) => Array.from(new Set(a)), getFallbackFontName = (a) => {
|
9369
9369
|
const s = "", $ = Object.entries(a).reduce((_, _e) => {
|
9370
9370
|
const [tt, nt] = _e;
|
9371
9371
|
return !_ && nt.fallback ? tt : _;
|
@@ -9428,55 +9428,163 @@ ${_e}`);
|
|
9428
9428
|
const { template: $, plugins: _ } = a;
|
9429
9429
|
_ && checkPlugins({ plugins: _, template: $ });
|
9430
9430
|
}
|
9431
|
-
}, checkInputs = (a) => checkProps(a, Inputs), checkUIOptions = (a) => checkProps(a, UIOptions), checkTemplate = (a) => checkProps(a, Template), checkUIProps = (a) => checkProps(a, UIProps), checkPreviewProps = (a) => checkProps(a, PreviewProps), checkDesignerProps = (a) => checkProps(a, DesignerProps)
|
9432
|
-
|
9433
|
-
|
9434
|
-
|
9435
|
-
|
9436
|
-
|
9437
|
-
|
9438
|
-
|
9439
|
-
|
9440
|
-
|
9441
|
-
|
9442
|
-
|
9443
|
-
|
9444
|
-
|
9445
|
-
|
9446
|
-
|
9447
|
-
|
9448
|
-
|
9449
|
-
|
9450
|
-
|
9451
|
-
|
9452
|
-
|
9453
|
-
|
9431
|
+
}, checkInputs = (a) => checkProps(a, Inputs), checkUIOptions = (a) => checkProps(a, UIOptions), checkTemplate = (a) => checkProps(a, Template), checkUIProps = (a) => checkProps(a, UIProps), checkPreviewProps = (a) => checkProps(a, PreviewProps), checkDesignerProps = (a) => checkProps(a, DesignerProps);
|
9432
|
+
class Node {
|
9433
|
+
constructor({ width: s = 0, height: $ = 0 } = {}) {
|
9434
|
+
Object.defineProperty(this, "index", {
|
9435
|
+
enumerable: !0,
|
9436
|
+
configurable: !0,
|
9437
|
+
writable: !0,
|
9438
|
+
value: 0
|
9439
|
+
}), Object.defineProperty(this, "key", {
|
9440
|
+
enumerable: !0,
|
9441
|
+
configurable: !0,
|
9442
|
+
writable: !0,
|
9443
|
+
value: void 0
|
9444
|
+
}), Object.defineProperty(this, "schema", {
|
9445
|
+
enumerable: !0,
|
9446
|
+
configurable: !0,
|
9447
|
+
writable: !0,
|
9448
|
+
value: void 0
|
9449
|
+
}), Object.defineProperty(this, "children", {
|
9450
|
+
enumerable: !0,
|
9451
|
+
configurable: !0,
|
9452
|
+
writable: !0,
|
9453
|
+
value: []
|
9454
|
+
}), Object.defineProperty(this, "width", {
|
9455
|
+
enumerable: !0,
|
9456
|
+
configurable: !0,
|
9457
|
+
writable: !0,
|
9458
|
+
value: 0
|
9459
|
+
}), Object.defineProperty(this, "height", {
|
9460
|
+
enumerable: !0,
|
9461
|
+
configurable: !0,
|
9462
|
+
writable: !0,
|
9463
|
+
value: 0
|
9464
|
+
}), Object.defineProperty(this, "padding", {
|
9465
|
+
enumerable: !0,
|
9466
|
+
configurable: !0,
|
9467
|
+
writable: !0,
|
9468
|
+
value: [0, 0, 0, 0]
|
9469
|
+
}), Object.defineProperty(this, "position", {
|
9470
|
+
enumerable: !0,
|
9471
|
+
configurable: !0,
|
9472
|
+
writable: !0,
|
9473
|
+
value: { x: 0, y: 0 }
|
9474
|
+
}), this.width = s, this.height = $;
|
9454
9475
|
}
|
9455
|
-
|
9456
|
-
|
9457
|
-
for (const it of lt) {
|
9458
|
-
const ft = at.get(it) + et;
|
9459
|
-
st.set(it + et, ft), et += ft;
|
9476
|
+
setIndex(s) {
|
9477
|
+
this.index = s;
|
9460
9478
|
}
|
9461
|
-
|
9462
|
-
|
9463
|
-
if (!isBlankPdf(a.basePdf) || s.size === 0)
|
9464
|
-
return a;
|
9465
|
-
const $ = { schemas: [{}], basePdf: a.basePdf }, _ = $.schemas, _e = a.basePdf.height, tt = a.basePdf.padding[0], nt = a.basePdf.padding[2];
|
9466
|
-
for (let at = 0; at < a.schemas.length; at += 1) {
|
9467
|
-
const ot = a.schemas[at];
|
9468
|
-
_[at] || (_[at] = {});
|
9469
|
-
for (const [rt, st] of Object.entries(ot)) {
|
9470
|
-
const { position: lt, height: et } = st;
|
9471
|
-
let it = lt.y, ut = at;
|
9472
|
-
for (const [ft, ht] of s)
|
9473
|
-
it > ft && (it += ht);
|
9474
|
-
for (; it + et >= _e - nt; )
|
9475
|
-
it = it + tt - (_e - nt) + tt, ut++;
|
9476
|
-
_[ut] || (_[ut] = {}), _[ut][rt] = { ...st, position: { ...lt, y: it } };
|
9477
|
-
}
|
9479
|
+
setKeyAndSchema(s, $) {
|
9480
|
+
this.key = s, this.schema = $;
|
9478
9481
|
}
|
9479
|
-
|
9482
|
+
setWidth(s) {
|
9483
|
+
this.width = s;
|
9484
|
+
}
|
9485
|
+
setHeight(s) {
|
9486
|
+
this.height = s;
|
9487
|
+
}
|
9488
|
+
setPadding(s) {
|
9489
|
+
this.padding = s;
|
9490
|
+
}
|
9491
|
+
setPosition(s) {
|
9492
|
+
this.position = s;
|
9493
|
+
}
|
9494
|
+
insertChild(s) {
|
9495
|
+
const $ = this.getChildCount();
|
9496
|
+
s.setIndex($), this.children.splice($, 0, s);
|
9497
|
+
}
|
9498
|
+
getChildCount() {
|
9499
|
+
return this.children.length;
|
9500
|
+
}
|
9501
|
+
getChild(s) {
|
9502
|
+
return this.children[s];
|
9503
|
+
}
|
9504
|
+
}
|
9505
|
+
function createPage(a) {
|
9506
|
+
const s = new Node({ ...a });
|
9507
|
+
return s.setPadding(a.padding), s;
|
9508
|
+
}
|
9509
|
+
function createNode(a) {
|
9510
|
+
const { position: s, width: $, height: _, key: _e, schema: tt } = a, nt = new Node({ width: $, height: _ });
|
9511
|
+
return nt.setPosition(s), nt.setKeyAndSchema(_e, tt), nt;
|
9512
|
+
}
|
9513
|
+
function resortChildren(a, s) {
|
9514
|
+
a.children = a.children.sort(($, _) => {
|
9515
|
+
const _e = s.get($.key), tt = s.get(_.key);
|
9516
|
+
if (_e === void 0 || tt === void 0)
|
9517
|
+
throw new Error("[@pdfme/common] order is not defined");
|
9518
|
+
return _e - tt;
|
9519
|
+
}).map(($, _) => ($.setIndex(_), $));
|
9520
|
+
}
|
9521
|
+
async function createOnePage(a) {
|
9522
|
+
const { basePdf: s, schemaObj: $, orderMap: _, input: _e, options: tt, _cache: nt, getDynamicHeights: at } = a, ot = createPage(s), rt = [], st = Object.entries($).sort((it, ut) => it[1].position.y - ut[1].position.y), lt = /* @__PURE__ */ new Map();
|
9523
|
+
for (const [it, ut] of st) {
|
9524
|
+
const { position: ft, width: ht } = ut, dt = { schema: ut, basePdf: s, options: tt, _cache: nt }, gt = await at((_e == null ? void 0 : _e[it]) || "", dt), pt = gt.reduce((ct, vt) => ct + vt, 0), mt = ut.height;
|
9525
|
+
pt !== mt && lt.set(ft.y + mt, pt - mt), gt.forEach((ct, vt) => {
|
9526
|
+
let At = ut.position.y + gt.reduce((bt, Et, St) => St < vt ? bt + Et : bt, 0);
|
9527
|
+
for (const [bt, Et] of lt.entries())
|
9528
|
+
bt <= ut.position.y && (At += Et);
|
9529
|
+
const xt = createNode({ key: it, schema: ut, position: { ...ft, y: At }, width: ht, height: ct });
|
9530
|
+
rt.push(At + ct + s.padding[2]), ot.insertChild(xt);
|
9531
|
+
});
|
9532
|
+
}
|
9533
|
+
const et = Math.max(...rt, s.height - s.padding[2]);
|
9534
|
+
return ot.setHeight(et), resortChildren(ot, _), ot;
|
9535
|
+
}
|
9536
|
+
function breakIntoPages(a) {
|
9537
|
+
const { longPage: s, orderMap: $, basePdf: _ } = a, _e = [createPage(_)], [tt, , nt] = _.padding, at = [], ot = (lt) => _.height - nt - (lt > 0 ? tt : 0), rt = (lt, et) => {
|
9538
|
+
var ut;
|
9539
|
+
const it = lt - et * (_.height - tt - nt);
|
9540
|
+
for (; _e.length <= et; )
|
9541
|
+
_e[et] || (_e.push(createPage(_)), at.push({ page: et, value: (it - tt) * -1 }));
|
9542
|
+
return it + (((ut = at.find((ft) => ft.page === et)) == null ? void 0 : ut.value) || 0);
|
9543
|
+
}, st = s.children.sort((lt, et) => lt.position.y - et.position.y);
|
9544
|
+
for (let lt = 0; lt < st.length; lt++) {
|
9545
|
+
const { key: et, schema: it, position: ut, height: ft, width: ht } = st[lt], { y: dt, x: gt } = ut;
|
9546
|
+
let pt = Math.floor(dt / ot(_e.length - 1)), mt = rt(dt, pt);
|
9547
|
+
if (mt + ft > _.height - nt && (pt++, mt = rt(dt, pt)), !et || !it)
|
9548
|
+
throw new Error("[@pdfme/common] key or schema is undefined");
|
9549
|
+
const ct = createNode({ key: et, schema: it, position: { x: gt, y: mt }, width: ht, height: ft });
|
9550
|
+
_e[pt].insertChild(ct);
|
9551
|
+
}
|
9552
|
+
return _e.forEach((lt) => resortChildren(lt, $)), _e;
|
9553
|
+
}
|
9554
|
+
function createNewTemplate(a, s) {
|
9555
|
+
const $ = {
|
9556
|
+
schemas: Array.from({ length: a.length }, () => ({})),
|
9557
|
+
basePdf: s
|
9558
|
+
}, _ = /* @__PURE__ */ new Map();
|
9559
|
+
return cloneDeep$1(a).forEach((_e, tt) => {
|
9560
|
+
_e.children.forEach((nt) => {
|
9561
|
+
const { key: at, schema: ot } = nt;
|
9562
|
+
if (!at || !ot)
|
9563
|
+
throw new Error("[@pdfme/common] key or schema is undefined");
|
9564
|
+
_.has(at) || _.set(at, []), _.get(at).push(nt);
|
9565
|
+
const rt = _e.children.filter((lt) => lt.key === at), st = _.get(at).length - rt.length;
|
9566
|
+
if (rt.length > 0) {
|
9567
|
+
if (!rt[0].schema)
|
9568
|
+
throw new Error("[@pdfme/common] schema is undefined");
|
9569
|
+
const lt = rt[0].schema, et = rt.reduce((ut, ft) => ut + ft.height, 0), it = rt[0].position;
|
9570
|
+
lt.__bodyRange = {
|
9571
|
+
start: Math.max(st - 1, 0),
|
9572
|
+
end: st + rt.length - 1
|
9573
|
+
}, $.schemas[tt][at] = Object.assign({}, lt, { position: it, height: et });
|
9574
|
+
}
|
9575
|
+
});
|
9576
|
+
}), $;
|
9577
|
+
}
|
9578
|
+
const getDynamicTemplate = async (a) => {
|
9579
|
+
const { template: s } = a;
|
9580
|
+
if (!isBlankPdf(s.basePdf))
|
9581
|
+
return s;
|
9582
|
+
const $ = s.basePdf, _ = [];
|
9583
|
+
for (const _e of s.schemas) {
|
9584
|
+
const tt = new Map(Object.keys(_e).map((ot, rt) => [ot, rt])), nt = await createOnePage({ basePdf: $, schemaObj: _e, orderMap: tt, ...a }), at = breakIntoPages({ longPage: nt, basePdf: $, orderMap: tt });
|
9585
|
+
_.push(...at);
|
9586
|
+
}
|
9587
|
+
return createNewTemplate(_, s.basePdf);
|
9480
9588
|
}, DEFAULT_LANG = "en", DESTROYED_ERR_MSG = "[@pdfme/ui] this instance is already destroyed", SELECTABLE_CLASSNAME = "selectable", RULER_HEIGHT = 30, PAGE_GAP = 10, RIGHT_SIDEBAR_WIDTH = 400, BACKGROUND_COLOR = "rgb(74, 74, 74)";
|
9481
9589
|
var pdf_worker_entry = {}, pdf_worker = { exports: {} };
|
9482
9590
|
(function(a, s) {
|
@@ -59762,7 +59870,7 @@ function getMods(a, s) {
|
|
59762
59870
|
$[_] = a[$[_].toLowerCase()];
|
59763
59871
|
return $;
|
59764
59872
|
}
|
59765
|
-
function getKeys$
|
59873
|
+
function getKeys$2(a) {
|
59766
59874
|
typeof a != "string" && (a = ""), a = a.replace(/\s/g, "");
|
59767
59875
|
const s = a.split(",");
|
59768
59876
|
let $ = s.lastIndexOf("");
|
@@ -59951,7 +60059,7 @@ const eachUnbind = (a) => {
|
|
59951
60059
|
method: _,
|
59952
60060
|
splitKey: _e = "+"
|
59953
60061
|
} = a;
|
59954
|
-
getKeys$
|
60062
|
+
getKeys$2(s).forEach((nt) => {
|
59955
60063
|
const at = nt.split(_e), ot = at.length, rt = at[ot - 1], st = rt === "*" ? "*" : code(rt);
|
59956
60064
|
if (!_handlers[st])
|
59957
60065
|
return;
|
@@ -60010,7 +60118,7 @@ function isElementBind(a) {
|
|
60010
60118
|
}
|
60011
60119
|
function hotkeys(a, s, $) {
|
60012
60120
|
_downKeys = [];
|
60013
|
-
const _ = getKeys$
|
60121
|
+
const _ = getKeys$2(a);
|
60014
60122
|
let _e = [], tt = "all", nt = document, at = 0, ot = !1, rt = !0, st = "+", lt = !1, et = !1;
|
60015
60123
|
for ($ === void 0 && typeof s == "function" && ($ = s), Object.prototype.toString.call(s) === "[object Object]" && (s.scope && (tt = s.scope), s.element && (nt = s.element), s.keyup && (ot = s.keyup), s.keydown !== void 0 && (rt = s.keydown), s.capture !== void 0 && (lt = s.capture), typeof s.splitKey == "string" && (st = s.splitKey), s.single === !0 && (et = !0)), typeof s == "string" && (tt = s), et && unbind(a, tt); at < _.length; at++)
|
60016
60124
|
a = _[at].split(st), _e = [], a.length > 1 && (_e = getMods(_modifier, a)), a = a[a.length - 1], a = a === "*" ? "*" : code(a), a in _handlers || (_handlers[a] = []), _handlers[a].push({
|
@@ -60088,7 +60196,7 @@ const uuid$6 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (a)
|
|
60088
60196
|
$ && (s = -s);
|
60089
60197
|
const _ = `${a}`.split("e");
|
60090
60198
|
return +`${_[0]}e${_[1] ? Number(_[1]) + s : s}`;
|
60091
|
-
}, round = (a, s) => shift(Math.round(shift(a, s, !1)), s, !0),
|
60199
|
+
}, round = (a, s) => shift(Math.round(shift(a, s, !1)), s, !0), flatten = (a) => [].concat(...a), up = "up", shiftUp = "shift+up", down = "down", shiftDown = "shift+down", left = "left", shiftLeft = "shift+left", right = "right", shiftRight = "shift+right", rmWin = "backspace", rmMac = "delete", esc = "esc", copyWin = "ctrl+c", copyMac = "command+c", pasteWin = "ctrl+v", pasteMac = "command+v", redoWin = "ctrl+y", redoMac = "shift+command+z", undoWin = "ctrl+z", undoMac = "command+z", saveWin = "ctrl+s", saveMac = "command+s", selectAllWin = "ctrl+a", selectAllMac = "command+a", keys$2 = [
|
60092
60200
|
up,
|
60093
60201
|
shiftUp,
|
60094
60202
|
down,
|
@@ -60195,7 +60303,7 @@ const uuid$6 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (a)
|
|
60195
60303
|
) : []
|
60196
60304
|
), _e), []);
|
60197
60305
|
}, template2SchemasList = async (a) => {
|
60198
|
-
const s = cloneDeep$
|
60306
|
+
const s = cloneDeep$1(a), { basePdf: $, schemas: _ } = s, _e = sortSchemasList(s);
|
60199
60307
|
let tt = [];
|
60200
60308
|
if (isBlankPdf($))
|
60201
60309
|
tt = _.map(() => ({
|
@@ -60207,7 +60315,7 @@ const uuid$6 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (a)
|
|
60207
60315
|
tt = await getPdfPageSizes(st);
|
60208
60316
|
}
|
60209
60317
|
const nt = _e.length, at = tt.length;
|
60210
|
-
return (nt < at ? _e.concat(new Array(at - nt).fill(cloneDeep$
|
60318
|
+
return (nt < at ? _e.concat(new Array(at - nt).fill(cloneDeep$1([]))) : _e.slice(0, tt.length)).map((rt, st) => (Object.values(rt).forEach((lt) => {
|
60211
60319
|
const { width: et, height: it } = tt[st], ut = lt.position.x + lt.width, ft = lt.position.y + lt.height;
|
60212
60320
|
if (et < ut) {
|
60213
60321
|
const ht = ut - et;
|
@@ -60219,7 +60327,7 @@ const uuid$6 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (a)
|
|
60219
60327
|
}
|
60220
60328
|
}), rt));
|
60221
60329
|
}, schemasList2template = (a, s) => ({
|
60222
|
-
schemas: cloneDeep$
|
60330
|
+
schemas: cloneDeep$1(a).map(
|
60223
60331
|
($) => $.reduce((_, _e) => {
|
60224
60332
|
const tt = _e.key;
|
60225
60333
|
return delete _e.id, delete _e.key, _[tt] = _e, _;
|
@@ -60288,7 +60396,7 @@ const uuid$6 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (a)
|
|
60288
60396
|
const { objs: s, schemas: $, basePdf: _, pluginsRegistry: _e, pageSize: tt, commitSchemas: nt } = a, at = s.reduce((ot, { key: rt, value: st, schemaId: lt }) => {
|
60289
60397
|
const et = ot.find((it) => it.id === lt);
|
60290
60398
|
return et && (set$2(et, rt, st), rt === "type" ? handleTypeChange(et, rt, st, _e) : ["position.x", "position.y", "width", "height"].includes(rt) && handlePositionSizeChange(et, rt, st, _, tt)), ot;
|
60291
|
-
}, cloneDeep$
|
60399
|
+
}, cloneDeep$1($));
|
60292
60400
|
nt(at);
|
60293
60401
|
}, DEFAULT_FONT_SIZE = 13, ALIGN_LEFT = "left", ALIGN_CENTER = "center", ALIGN_RIGHT = "right", DEFAULT_ALIGNMENT = ALIGN_LEFT, VERTICAL_ALIGN_TOP = "top", VERTICAL_ALIGN_MIDDLE = "middle", VERTICAL_ALIGN_BOTTOM = "bottom", DEFAULT_VERTICAL_ALIGNMENT = VERTICAL_ALIGN_TOP, DEFAULT_LINE_HEIGHT = 1, DEFAULT_CHARACTER_SPACING = 0, DEFAULT_FONT_COLOR = "#000000", PLACEHOLDER_FONT_COLOR = "#A0A0A0", DYNAMIC_FIT_VERTICAL = "vertical", DYNAMIC_FIT_HORIZONTAL = "horizontal", DEFAULT_DYNAMIC_FIT = DYNAMIC_FIT_VERTICAL, DEFAULT_DYNAMIC_MIN_FONT_SIZE = 4, DEFAULT_DYNAMIC_MAX_FONT_SIZE = 72, FONT_SIZE_ADJUSTMENT = 0.25, ENCODING_MAPPING = {
|
60294
60402
|
utf16le: "utf-16le",
|
@@ -81615,7 +81723,7 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81615
81723
|
const ot = 1 - Math.max(tt, nt, at), rt = tt === 0 ? 0 : (1 - tt - ot) / (1 - ot), st = nt === 0 ? 0 : (1 - nt - ot) / (1 - ot), lt = at === 0 ? 0 : (1 - at - ot) / (1 - ot);
|
81616
81724
|
return cmyk(rt, st, lt, ot);
|
81617
81725
|
}
|
81618
|
-
}, hex2PrintingColor = (a, s) => (s == null ? void 0 : s.toLocaleLowerCase()) == "cmyk" ? hex2CmykColor(a) : hex2RgbColor(a),
|
81726
|
+
}, hex2PrintingColor = (a, s) => (s == null ? void 0 : s.toLocaleLowerCase()) == "cmyk" ? hex2CmykColor(a) : hex2RgbColor(a), embedAndGetFontObj = async (a) => {
|
81619
81727
|
const { pdfDoc: s, font: $, _cache: _ } = a;
|
81620
81728
|
if (_.has(s))
|
81621
81729
|
return _.get(s);
|
@@ -82391,21 +82499,6 @@ function mapCellStyle(a) {
|
|
82391
82499
|
cellPadding: a.padding
|
82392
82500
|
};
|
82393
82501
|
}
|
82394
|
-
function createTableWithAvailableHeight(a, s, $) {
|
82395
|
-
let _ = s;
|
82396
|
-
const _e = [];
|
82397
|
-
let tt = 0;
|
82398
|
-
for (; _ > 0 && tt < a.length; ) {
|
82399
|
-
const nt = a.slice(0, tt + 1).pop();
|
82400
|
-
if (!nt)
|
82401
|
-
break;
|
82402
|
-
const at = nt.height;
|
82403
|
-
if (_ - at < 0)
|
82404
|
-
break;
|
82405
|
-
_e.push(nt.raw), _ -= at, tt++;
|
82406
|
-
}
|
82407
|
-
return createSingleTable(_e, $);
|
82408
|
-
}
|
82409
82502
|
function getTableOptions(a, s) {
|
82410
82503
|
const $ = a.headWidthPercentages.reduce((nt, at, ot) => ({ ...nt, [ot]: { cellWidth: a.width * (at / 100) } }), {}), _ = Object.entries(a.columnStyles.alignment || {}).reduce((nt, [at, ot]) => ({ ...nt, [at]: { alignment: ot } }), {}), _e = /* @__PURE__ */ new Set([
|
82411
82504
|
...Object.keys($).map(Number),
|
@@ -82466,74 +82559,21 @@ function createSingleTable(a, s) {
|
|
82466
82559
|
const { options: $, _cache: _, basePdf: _e } = s;
|
82467
82560
|
if (!isBlankPdf(_e))
|
82468
82561
|
throw new Error("[@pdfme/schema/table] Custom PDF is not supported");
|
82469
|
-
const tt =
|
82470
|
-
|
82471
|
-
|
82472
|
-
|
82473
|
-
const { basePdf: $, schema: _ } = s;
|
82474
|
-
if (!isBlankPdf($))
|
82475
|
-
throw new Error("[@pdfme/schema/table] Custom PDF is not supported");
|
82476
|
-
const _e = $.height, tt = $.padding[2], nt = $.padding[0];
|
82477
|
-
let at = _e - tt - _.position.y;
|
82478
|
-
const ot = await createSingleTable(a, s);
|
82479
|
-
let rt = ot.body;
|
82480
|
-
const st = [];
|
82481
|
-
for (; rt.length > 0; ) {
|
82482
|
-
const lt = st.length === 0 ? at - ot.getHeadHeight() : at - nt, et = await createTableWithAvailableHeight(rt, lt, s);
|
82483
|
-
if (st.push(et), rt = rt.slice(et.body.length), rt.length > 0) {
|
82484
|
-
const it = cloneDeep$1(_);
|
82485
|
-
it.showHead = !1, it.position.y = nt, s.schema = it, at = _e - nt - tt;
|
82486
|
-
}
|
82562
|
+
const tt = cloneDeep$1(s.schema), { start: nt } = tt.__bodyRange || { start: 0 };
|
82563
|
+
if (nt % 2 === 1) {
|
82564
|
+
const lt = tt.bodyStyles.alternateBackgroundColor;
|
82565
|
+
tt.bodyStyles.alternateBackgroundColor = tt.bodyStyles.backgroundColor, tt.bodyStyles.backgroundColor = lt;
|
82487
82566
|
}
|
82488
|
-
|
82567
|
+
tt.showHead = nt === 0;
|
82568
|
+
const at = parseInput(tt, a), ot = $.font || getDefaultFont(), rt = getFallbackFontName(ot), st = parseContent4Table(at, rt);
|
82569
|
+
return Table$3.create({ input: at, content: st, font: ot, _cache: _ });
|
82489
82570
|
}
|
82490
|
-
const
|
82491
|
-
const { template: s, input: $, options: _, _cache: _e } = a, tt = Object.assign(cloneDeep$1(s), { schemas: [] });
|
82492
|
-
let nt = 0;
|
82493
|
-
for (const at of s.schemas) {
|
82494
|
-
const ot = [];
|
82495
|
-
for (const [rt, st] of Object.entries(at))
|
82496
|
-
if (st.type === "table") {
|
82497
|
-
st.__bodyRange = void 0;
|
82498
|
-
const lt = getBody$1($ == null ? void 0 : $[rt]), et = await createMultiTables(lt, {
|
82499
|
-
schema: st,
|
82500
|
-
basePdf: tt.basePdf,
|
82501
|
-
options: _,
|
82502
|
-
_cache: _e
|
82503
|
-
});
|
82504
|
-
if (et.length > 1) {
|
82505
|
-
const it = et[0];
|
82506
|
-
st.__bodyRange = { start: 0, end: it.body.length };
|
82507
|
-
const ut = et.map((ht) => ht.body);
|
82508
|
-
et.slice(1).forEach((ht, dt) => {
|
82509
|
-
const gt = nt + dt + 1, pt = {
|
82510
|
-
[rt]: {
|
82511
|
-
...st,
|
82512
|
-
position: { x: st.position.x, y: ht.settings.startY },
|
82513
|
-
height: ht.getHeight(),
|
82514
|
-
showHead: !1,
|
82515
|
-
__bodyRange: {
|
82516
|
-
start: ut.slice(0, dt + 1).reduce((mt, ct) => mt + ct.length, 0),
|
82517
|
-
end: ut.slice(0, dt + 2).reduce((mt, ct) => mt + ct.length, 0)
|
82518
|
-
},
|
82519
|
-
content: typeof $[rt] != "string" ? JSON.stringify($[rt] || "[]") : $[rt]
|
82520
|
-
}
|
82521
|
-
};
|
82522
|
-
ot[gt] = pt;
|
82523
|
-
});
|
82524
|
-
}
|
82525
|
-
}
|
82526
|
-
tt.schemas.push(at), ot.forEach((rt, st) => {
|
82527
|
-
tt.schemas[st] ? tt.schemas[st] = { ...tt.schemas[st], ...rt } : tt.schemas[st] = rt;
|
82528
|
-
}), nt++;
|
82529
|
-
}
|
82530
|
-
return tt;
|
82531
|
-
}, getDynamicHeightForTable = async (a, s) => {
|
82571
|
+
const getDynamicHeightsForTable = async (a, s) => {
|
82532
82572
|
var tt;
|
82533
82573
|
if (s.schema.type !== "table")
|
82534
|
-
return Promise.resolve(s.schema.height);
|
82574
|
+
return Promise.resolve([s.schema.height]);
|
82535
82575
|
const $ = s.schema, _ = ((tt = $.__bodyRange) == null ? void 0 : tt.start) === 0 ? getBody$1(a) : getBodyWithRange(a, $.__bodyRange);
|
82536
|
-
return (await createSingleTable(_, s)).
|
82576
|
+
return (await createSingleTable(_, s)).allRows().map((nt) => nt.height);
|
82537
82577
|
}, builtInPlugins = { Text: text };
|
82538
82578
|
class BaseUIClass {
|
82539
82579
|
constructor(s) {
|
@@ -82546,7 +82586,7 @@ class BaseUIClass {
|
|
82546
82586
|
}, this.render();
|
82547
82587
|
}, 100), this.resizeObserver = new ResizeObserver(this.setSize), checkUIProps(s);
|
82548
82588
|
const { domContainer: $, template: _, options: _e = {}, plugins: tt = {} } = s;
|
82549
|
-
this.domContainer = $, this.template = cloneDeep$
|
82589
|
+
this.domContainer = $, this.template = cloneDeep$1(_), this.options = _e, this.size = {
|
82550
82590
|
height: this.domContainer.clientHeight || window.innerHeight,
|
82551
82591
|
width: this.domContainer.clientWidth || window.innerWidth
|
82552
82592
|
}, this.resizeObserver.observe(this.domContainer);
|
@@ -82573,7 +82613,7 @@ class BaseUIClass {
|
|
82573
82613
|
updateTemplate(s) {
|
82574
82614
|
if (checkTemplate(s), !this.domContainer)
|
82575
82615
|
throw Error(DESTROYED_ERR_MSG);
|
82576
|
-
this.template = cloneDeep$
|
82616
|
+
this.template = cloneDeep$1(s), this.render();
|
82577
82617
|
}
|
82578
82618
|
updateOptions(s) {
|
82579
82619
|
checkUIOptions(s);
|
@@ -82588,7 +82628,7 @@ class BaseUIClass {
|
|
82588
82628
|
}
|
82589
82629
|
class PreviewUI extends BaseUIClass {
|
82590
82630
|
constructor(s) {
|
82591
|
-
super(s), checkPreviewProps(s), this.inputs = convertToStingObjectArray(cloneDeep$
|
82631
|
+
super(s), checkPreviewProps(s), this.inputs = convertToStingObjectArray(cloneDeep$1(s.inputs));
|
82592
82632
|
}
|
82593
82633
|
getInputs() {
|
82594
82634
|
if (!this.domContainer)
|
@@ -87198,7 +87238,7 @@ var parseStyle = function a(s) {
|
|
87198
87238
|
function uniqueHash(a, s) {
|
87199
87239
|
return murmur2("".concat(a.join("%")).concat(s));
|
87200
87240
|
}
|
87201
|
-
function Empty$
|
87241
|
+
function Empty$3() {
|
87202
87242
|
return null;
|
87203
87243
|
}
|
87204
87244
|
var STYLE_PREFIX = "style";
|
@@ -87258,7 +87298,7 @@ function useStyleRegister(a, s) {
|
|
87258
87298
|
return function(St) {
|
87259
87299
|
var Bt;
|
87260
87300
|
if (!ft || ct || !et)
|
87261
|
-
Bt = /* @__PURE__ */ reactExports.createElement(Empty$
|
87301
|
+
Bt = /* @__PURE__ */ reactExports.createElement(Empty$3, null);
|
87262
87302
|
else {
|
87263
87303
|
var Ot;
|
87264
87304
|
Bt = /* @__PURE__ */ reactExports.createElement("style", _extends$2({}, (Ot = {}, _defineProperty$c(Ot, ATTR_TOKEN, bt), _defineProperty$c(Ot, ATTR_MARK, Et), Ot), {
|
@@ -99400,7 +99440,7 @@ function getStatusClassNames(a, s, $) {
|
|
99400
99440
|
[`${a}-has-feedback`]: $
|
99401
99441
|
});
|
99402
99442
|
}
|
99403
|
-
const getMergedStatus = (a, s) => s || a, Empty$
|
99443
|
+
const getMergedStatus = (a, s) => s || a, Empty$2 = () => {
|
99404
99444
|
const [, a] = useToken$1(), $ = new TinyColor(a.colorBgBase).toHsl().l < 0.5 ? {
|
99405
99445
|
opacity: 0.65
|
99406
99446
|
} : {};
|
@@ -99449,7 +99489,7 @@ const getMergedStatus = (a, s) => s || a, Empty$3 = () => {
|
|
99449
99489
|
}), /* @__PURE__ */ reactExports.createElement("path", {
|
99450
99490
|
d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
|
99451
99491
|
}))));
|
99452
|
-
}, DefaultEmptyImg = Empty$
|
99492
|
+
}, DefaultEmptyImg = Empty$2, Simple = () => {
|
99453
99493
|
const [, a] = useToken$1(), {
|
99454
99494
|
colorFill: s,
|
99455
99495
|
colorFillTertiary: $,
|
@@ -99565,7 +99605,7 @@ var __rest$X = function(a, s) {
|
|
99565
99605
|
s.indexOf(_[_e]) < 0 && Object.prototype.propertyIsEnumerable.call(a, _[_e]) && ($[_[_e]] = a[_[_e]]);
|
99566
99606
|
return $;
|
99567
99607
|
};
|
99568
|
-
const defaultEmptyImg = /* @__PURE__ */ reactExports.createElement(DefaultEmptyImg, null), simpleEmptyImg = /* @__PURE__ */ reactExports.createElement(SimpleEmptyImg, null), Empty
|
99608
|
+
const defaultEmptyImg = /* @__PURE__ */ reactExports.createElement(DefaultEmptyImg, null), simpleEmptyImg = /* @__PURE__ */ reactExports.createElement(SimpleEmptyImg, null), Empty = (a) => {
|
99569
99609
|
var {
|
99570
99610
|
className: s,
|
99571
99611
|
rootClassName: $,
|
@@ -99600,9 +99640,9 @@ const defaultEmptyImg = /* @__PURE__ */ reactExports.createElement(DefaultEmptyI
|
|
99600
99640
|
className: `${it}-footer`
|
99601
99641
|
}, nt)));
|
99602
99642
|
};
|
99603
|
-
Empty
|
99604
|
-
Empty
|
99605
|
-
const Empty$
|
99643
|
+
Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
|
99644
|
+
Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
|
99645
|
+
const Empty$1 = Empty, DefaultRenderEmpty = (a) => {
|
99606
99646
|
const {
|
99607
99647
|
componentName: s
|
99608
99648
|
} = a, {
|
@@ -99611,20 +99651,20 @@ const Empty$2 = Empty$1, DefaultRenderEmpty = (a) => {
|
|
99611
99651
|
switch (s) {
|
99612
99652
|
case "Table":
|
99613
99653
|
case "List":
|
99614
|
-
return /* @__PURE__ */ React$a.createElement(Empty$
|
99615
|
-
image: Empty$
|
99654
|
+
return /* @__PURE__ */ React$a.createElement(Empty$1, {
|
99655
|
+
image: Empty$1.PRESENTED_IMAGE_SIMPLE
|
99616
99656
|
});
|
99617
99657
|
case "Select":
|
99618
99658
|
case "TreeSelect":
|
99619
99659
|
case "Cascader":
|
99620
99660
|
case "Transfer":
|
99621
99661
|
case "Mentions":
|
99622
|
-
return /* @__PURE__ */ React$a.createElement(Empty$
|
99623
|
-
image: Empty$
|
99662
|
+
return /* @__PURE__ */ React$a.createElement(Empty$1, {
|
99663
|
+
image: Empty$1.PRESENTED_IMAGE_SIMPLE,
|
99624
99664
|
className: `${_}-small`
|
99625
99665
|
});
|
99626
99666
|
default:
|
99627
|
-
return /* @__PURE__ */ React$a.createElement(Empty$
|
99667
|
+
return /* @__PURE__ */ React$a.createElement(Empty$1, null);
|
99628
99668
|
}
|
99629
99669
|
}, DefaultRenderEmpty$1 = DefaultRenderEmpty, genItemStyle = (a) => {
|
99630
99670
|
const {
|
@@ -119255,10 +119295,10 @@ function getOffset$2(a) {
|
|
119255
119295
|
top: s.top + (window.pageYOffset || $.scrollTop) - ($.clientTop || document.body.clientTop || 0)
|
119256
119296
|
};
|
119257
119297
|
}
|
119258
|
-
var COMMON_PROPS = ["crossOrigin", "decoding", "draggable", "loading", "referrerPolicy", "sizes", "srcSet", "useMap", "alt"], PreviewGroupContext = /* @__PURE__ */ reactExports.createContext(null), uid$
|
119298
|
+
var COMMON_PROPS = ["crossOrigin", "decoding", "draggable", "loading", "referrerPolicy", "sizes", "srcSet", "useMap", "alt"], PreviewGroupContext = /* @__PURE__ */ reactExports.createContext(null), uid$3 = 0;
|
119259
119299
|
function useRegisterImage(a, s) {
|
119260
119300
|
var $ = reactExports.useState(function() {
|
119261
|
-
return uid$
|
119301
|
+
return uid$3 += 1, String(uid$3);
|
119262
119302
|
}), _ = _slicedToArray$e($, 1), _e = _[0], tt = reactExports.useContext(PreviewGroupContext), nt = {
|
119263
119303
|
data: s,
|
119264
119304
|
canPreview: a
|
@@ -129650,8 +129690,8 @@ function FilterDropdown(a) {
|
|
129650
129690
|
else if (tt.filterDropdown)
|
129651
129691
|
Vt = tt.filterDropdown;
|
129652
129692
|
else {
|
129653
|
-
const ar = Ot() || [], Jt = () => (tt.filters || []).length === 0 ? /* @__PURE__ */ reactExports.createElement(Empty$
|
129654
|
-
image: Empty$
|
129693
|
+
const ar = Ot() || [], Jt = () => (tt.filters || []).length === 0 ? /* @__PURE__ */ reactExports.createElement(Empty$1, {
|
129694
|
+
image: Empty$1.PRESENTED_IMAGE_SIMPLE,
|
129655
129695
|
description: it.filterEmptyText,
|
129656
129696
|
imageStyle: {
|
129657
129697
|
height: 24
|
@@ -133631,7 +133671,7 @@ function upload(a) {
|
|
133631
133671
|
};
|
133632
133672
|
}
|
133633
133673
|
var now$1 = +/* @__PURE__ */ new Date(), index$3 = 0;
|
133634
|
-
function uid$
|
133674
|
+
function uid$2() {
|
133635
133675
|
return "rc-upload-".concat(now$1, "-").concat(++index$3);
|
133636
133676
|
}
|
133637
133677
|
const attrAccept = function(a, s) {
|
@@ -133694,7 +133734,7 @@ var traverseFileTree = function a(s, $, _) {
|
|
133694
133734
|
for (var _e = arguments.length, tt = new Array(_e), nt = 0; nt < _e; nt++)
|
133695
133735
|
tt[nt] = arguments[nt];
|
133696
133736
|
return _ = s.call.apply(s, [this].concat(tt)), _.state = {
|
133697
|
-
uid: uid$
|
133737
|
+
uid: uid$2()
|
133698
133738
|
}, _.reqs = {}, _.fileInput = void 0, _._isMounted = void 0, _.onChange = function(at) {
|
133699
133739
|
var ot = _.props, rt = ot.accept, st = ot.directory, lt = at.target.files, et = _toConsumableArray$d(lt).filter(function(it) {
|
133700
133740
|
return !st || attrAccept(it, rt);
|
@@ -133727,7 +133767,7 @@ var traverseFileTree = function a(s, $, _) {
|
|
133727
133767
|
}
|
133728
133768
|
}, _.uploadFiles = function(at) {
|
133729
133769
|
var ot = _toConsumableArray$d(at), rt = ot.map(function(st) {
|
133730
|
-
return st.uid = uid$
|
133770
|
+
return st.uid = uid$2(), _.processFile(st, ot);
|
133731
133771
|
});
|
133732
133772
|
Promise.all(rt).then(function(st) {
|
133733
133773
|
var lt = _.props.onBatchStart;
|
@@ -133860,7 +133900,7 @@ var traverseFileTree = function a(s, $, _) {
|
|
133860
133900
|
key: "reset",
|
133861
133901
|
value: function() {
|
133862
133902
|
this.setState({
|
133863
|
-
uid: uid$
|
133903
|
+
uid: uid$2()
|
133864
133904
|
});
|
133865
133905
|
}
|
133866
133906
|
}, {
|
@@ -136500,8 +136540,8 @@ const { Text: Text$4 } = Typography$1, Item = React$a.memo(
|
|
136500
136540
|
const mt = pt === "undo", ct = mt ? rt : st;
|
136501
136541
|
if (ct.current.length <= 0)
|
136502
136542
|
return;
|
136503
|
-
(mt ? st : rt).current.push(cloneDeep$
|
136504
|
-
const vt = cloneDeep$
|
136543
|
+
(mt ? st : rt).current.push(cloneDeep$1(_e[a]));
|
136544
|
+
const vt = cloneDeep$1(_e);
|
136505
136545
|
vt[a] = ct.current.pop(), lt(vt);
|
136506
136546
|
};
|
136507
136547
|
initShortCuts({
|
@@ -136521,7 +136561,7 @@ const { Text: Text$4 } = Typography$1, Item = React$a.memo(
|
|
136521
136561
|
x: St.x + 10 > Bt.width - Et ? Bt.width - Et : St.x + 10,
|
136522
136562
|
y: St.y + 10 > Bt.height - bt ? Bt.height - bt : St.y + 10
|
136523
136563
|
};
|
136524
|
-
return Object.assign(cloneDeep$
|
136564
|
+
return Object.assign(cloneDeep$1(vt), { id: At, key: xt, position: Ot });
|
136525
136565
|
});
|
136526
136566
|
nt(_e[a].concat(ct)), et(ct.map((vt) => document.getElementById(vt.id))), ut.current = ct;
|
136527
136567
|
},
|
@@ -142413,11 +142453,11 @@ var _ie8DomDefine = !require_descriptors() && !require_fails()(function() {
|
|
142413
142453
|
if (s && typeof ($ = a.toString) == "function" && !isObject$4(_ = $.call(a)) || typeof ($ = a.valueOf) == "function" && !isObject$4(_ = $.call(a)) || !s && typeof ($ = a.toString) == "function" && !isObject$4(_ = $.call(a)))
|
142414
142454
|
return _;
|
142415
142455
|
throw TypeError("Can't convert object to primitive value");
|
142416
|
-
}, anObject$
|
142456
|
+
}, anObject$1 = _anObject, IE8_DOM_DEFINE$1 = _ie8DomDefine, toPrimitive$3 = _toPrimitive$5, dP$2 = Object.defineProperty;
|
142417
142457
|
_objectDp.f = require_descriptors() ? Object.defineProperty : function a(s, $, _) {
|
142418
|
-
if (anObject$
|
142458
|
+
if (anObject$1(s), $ = toPrimitive$3($, !0), anObject$1(_), IE8_DOM_DEFINE$1)
|
142419
142459
|
try {
|
142420
|
-
return dP$
|
142460
|
+
return dP$2(s, $, _);
|
142421
142461
|
} catch {
|
142422
142462
|
}
|
142423
142463
|
if ("get" in _ || "set" in _)
|
@@ -142431,14 +142471,14 @@ var _propertyDesc = function(a, s) {
|
|
142431
142471
|
writable: !(a & 4),
|
142432
142472
|
value: s
|
142433
142473
|
};
|
142434
|
-
}, dP$
|
142435
|
-
return dP$
|
142474
|
+
}, dP$1 = _objectDp, createDesc$2 = _propertyDesc, _hide = require_descriptors() ? function(a, s, $) {
|
142475
|
+
return dP$1.f(a, s, createDesc$2(1, $));
|
142436
142476
|
} : function(a, s, $) {
|
142437
142477
|
return a[s] = $, a;
|
142438
142478
|
}, hasOwnProperty = {}.hasOwnProperty, _has = function(a, s) {
|
142439
142479
|
return hasOwnProperty.call(a, s);
|
142440
|
-
}, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$4 = _has, PROTOTYPE$
|
142441
|
-
var _ = a & $export$5.F, _e = a & $export$5.G, tt = a & $export$5.S, nt = a & $export$5.P, at = a & $export$5.B, ot = a & $export$5.W, rt = _e ? core$2 : core$2[s] || (core$2[s] = {}), st = rt[PROTOTYPE$
|
142480
|
+
}, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$4 = _has, PROTOTYPE$1 = "prototype", $export$5 = function(a, s, $) {
|
142481
|
+
var _ = a & $export$5.F, _e = a & $export$5.G, tt = a & $export$5.S, nt = a & $export$5.P, at = a & $export$5.B, ot = a & $export$5.W, rt = _e ? core$2 : core$2[s] || (core$2[s] = {}), st = rt[PROTOTYPE$1], lt = _e ? global$4 : tt ? global$4[s] : (global$4[s] || {})[PROTOTYPE$1], et, it, ut;
|
142442
142482
|
_e && ($ = s);
|
142443
142483
|
for (et in $)
|
142444
142484
|
it = !_ && lt && lt[et] !== void 0, !(it && has$4(rt, et)) && (ut = it ? lt[et] : $[et], rt[et] = _e && typeof lt[et] != "function" ? $[et] : at && it ? ctx(ut, global$4) : ot && lt[et] == ut ? function(ft) {
|
@@ -142456,7 +142496,7 @@ var _propertyDesc = function(a, s) {
|
|
142456
142496
|
}
|
142457
142497
|
return ft.apply(this, arguments);
|
142458
142498
|
};
|
142459
|
-
return ht[PROTOTYPE$
|
142499
|
+
return ht[PROTOTYPE$1] = ft[PROTOTYPE$1], ht;
|
142460
142500
|
}(ut) : nt && typeof ut == "function" ? ctx(Function.call, ut) : ut, nt && ((rt.virtual || (rt.virtual = {}))[et] = ut, a & $export$5.R && st && !st[et] && hide$1(st, et, ut)));
|
142461
142501
|
};
|
142462
142502
|
$export$5.F = 1;
|
@@ -142550,14 +142590,22 @@ var _shared = { exports: {} }, _library = !0, core$1 = _coreExports, global$3 =
|
|
142550
142590
|
});
|
142551
142591
|
var _sharedExports = _shared.exports, id$1 = 0, px = Math.random(), _uid = function(a) {
|
142552
142592
|
return "Symbol(".concat(a === void 0 ? "" : a, ")_", (++id$1 + px).toString(36));
|
142553
|
-
},
|
142554
|
-
|
142555
|
-
|
142593
|
+
}, _sharedKey, hasRequired_sharedKey;
|
142594
|
+
function require_sharedKey() {
|
142595
|
+
if (hasRequired_sharedKey)
|
142596
|
+
return _sharedKey;
|
142597
|
+
hasRequired_sharedKey = 1;
|
142598
|
+
var a = _sharedExports("keys"), s = _uid;
|
142599
|
+
return _sharedKey = function($) {
|
142600
|
+
return a[$] || (a[$] = s($));
|
142601
|
+
}, _sharedKey;
|
142602
|
+
}
|
142603
|
+
var _objectKeysInternal, hasRequired_objectKeysInternal;
|
142556
142604
|
function require_objectKeysInternal() {
|
142557
142605
|
if (hasRequired_objectKeysInternal)
|
142558
142606
|
return _objectKeysInternal;
|
142559
142607
|
hasRequired_objectKeysInternal = 1;
|
142560
|
-
var a = _has, s = _toIobject, $ = require_arrayIncludes()(!1), _ =
|
142608
|
+
var a = _has, s = _toIobject, $ = require_arrayIncludes()(!1), _ = require_sharedKey()("IE_PROTO");
|
142561
142609
|
return _objectKeysInternal = function(_e, tt) {
|
142562
142610
|
var nt = s(_e), at = 0, ot = [], rt;
|
142563
142611
|
for (rt in nt)
|
@@ -142567,12 +142615,16 @@ function require_objectKeysInternal() {
|
|
142567
142615
|
return ot;
|
142568
142616
|
}, _objectKeysInternal;
|
142569
142617
|
}
|
142570
|
-
var _enumBugKeys
|
142618
|
+
var _enumBugKeys, hasRequired_enumBugKeys;
|
142619
|
+
function require_enumBugKeys() {
|
142620
|
+
return hasRequired_enumBugKeys || (hasRequired_enumBugKeys = 1, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")), _enumBugKeys;
|
142621
|
+
}
|
142622
|
+
var _objectKeys, hasRequired_objectKeys;
|
142571
142623
|
function require_objectKeys() {
|
142572
142624
|
if (hasRequired_objectKeys)
|
142573
142625
|
return _objectKeys;
|
142574
142626
|
hasRequired_objectKeys = 1;
|
142575
|
-
var a = require_objectKeysInternal(), s =
|
142627
|
+
var a = require_objectKeysInternal(), s = require_enumBugKeys();
|
142576
142628
|
return _objectKeys = Object.keys || function(_) {
|
142577
142629
|
return a(_, s);
|
142578
142630
|
}, _objectKeys;
|
@@ -143284,12 +143336,20 @@ var _default$f = /* @__PURE__ */ function() {
|
|
143284
143336
|
var _ = String(defined(s)), _e = toInteger($), tt = _.length, nt, at;
|
143285
143337
|
return _e < 0 || _e >= tt ? a ? "" : void 0 : (nt = _.charCodeAt(_e), nt < 55296 || nt > 56319 || _e + 1 === tt || (at = _.charCodeAt(_e + 1)) < 56320 || at > 57343 ? a ? _.charAt(_e) : nt : a ? _.slice(_e, _e + 2) : (nt - 55296 << 10) + (at - 56320) + 65536);
|
143286
143338
|
};
|
143287
|
-
}, _redefine = _hide, _iterators = {},
|
143288
|
-
|
143289
|
-
|
143290
|
-
|
143291
|
-
|
143292
|
-
|
143339
|
+
}, _redefine = _hide, _iterators = {}, _objectDps, hasRequired_objectDps;
|
143340
|
+
function require_objectDps() {
|
143341
|
+
if (hasRequired_objectDps)
|
143342
|
+
return _objectDps;
|
143343
|
+
hasRequired_objectDps = 1;
|
143344
|
+
var a = _objectDp, s = _anObject, $ = require_objectKeys();
|
143345
|
+
return _objectDps = require_descriptors() ? Object.defineProperties : function(_e, tt) {
|
143346
|
+
s(_e);
|
143347
|
+
for (var nt = $(tt), at = nt.length, ot = 0, rt; at > ot; )
|
143348
|
+
a.f(_e, rt = nt[ot++], tt[rt]);
|
143349
|
+
return _e;
|
143350
|
+
}, _objectDps;
|
143351
|
+
}
|
143352
|
+
var _html, hasRequired_html;
|
143293
143353
|
function require_html() {
|
143294
143354
|
if (hasRequired_html)
|
143295
143355
|
return _html;
|
@@ -143297,16 +143357,24 @@ function require_html() {
|
|
143297
143357
|
var a = _globalExports.document;
|
143298
143358
|
return _html = a && a.documentElement, _html;
|
143299
143359
|
}
|
143300
|
-
var
|
143301
|
-
|
143302
|
-
|
143303
|
-
|
143304
|
-
|
143305
|
-
|
143306
|
-
},
|
143307
|
-
|
143308
|
-
|
143309
|
-
|
143360
|
+
var _objectCreate, hasRequired_objectCreate;
|
143361
|
+
function require_objectCreate() {
|
143362
|
+
if (hasRequired_objectCreate)
|
143363
|
+
return _objectCreate;
|
143364
|
+
hasRequired_objectCreate = 1;
|
143365
|
+
var a = _anObject, s = require_objectDps(), $ = require_enumBugKeys(), _ = require_sharedKey()("IE_PROTO"), _e = function() {
|
143366
|
+
}, tt = "prototype", nt = function() {
|
143367
|
+
var at = require_domCreate()("iframe"), ot = $.length, rt = "<", st = ">", lt;
|
143368
|
+
for (at.style.display = "none", require_html().appendChild(at), at.src = "javascript:", lt = at.contentWindow.document, lt.open(), lt.write(rt + "script" + st + "document.F=Object" + rt + "/script" + st), lt.close(), nt = lt.F; ot--; )
|
143369
|
+
delete nt[tt][$[ot]];
|
143370
|
+
return nt();
|
143371
|
+
};
|
143372
|
+
return _objectCreate = Object.create || function(ot, rt) {
|
143373
|
+
var st;
|
143374
|
+
return ot !== null ? (_e[tt] = a(ot), st = new _e(), _e[tt] = null, st[_] = ot) : st = nt(), rt === void 0 ? st : s(st, rt);
|
143375
|
+
}, _objectCreate;
|
143376
|
+
}
|
143377
|
+
var _wks = { exports: {} }, store = _sharedExports("wks"), uid$1 = _uid, Symbol$1 = _globalExports.Symbol, USE_SYMBOL = typeof Symbol$1 == "function", $exports = _wks.exports = function(a) {
|
143310
143378
|
return store[a] || (store[a] = USE_SYMBOL && Symbol$1[a] || (USE_SYMBOL ? Symbol$1 : uid$1)("Symbol." + a));
|
143311
143379
|
};
|
143312
143380
|
$exports.store = store;
|
@@ -143317,7 +143385,7 @@ function require_iterCreate() {
|
|
143317
143385
|
if (hasRequired_iterCreate)
|
143318
143386
|
return _iterCreate;
|
143319
143387
|
hasRequired_iterCreate = 1;
|
143320
|
-
var a =
|
143388
|
+
var a = require_objectCreate(), s = _propertyDesc, $ = _setToStringTag, _ = {};
|
143321
143389
|
return _hide(_, _wksExports("iterator"), function() {
|
143322
143390
|
return this;
|
143323
143391
|
}), _iterCreate = function(_e, tt, nt) {
|
@@ -143329,7 +143397,7 @@ function require_objectGpo() {
|
|
143329
143397
|
if (hasRequired_objectGpo)
|
143330
143398
|
return _objectGpo;
|
143331
143399
|
hasRequired_objectGpo = 1;
|
143332
|
-
var a = _has, s = require_toObject(), $ =
|
143400
|
+
var a = _has, s = require_toObject(), $ = require_sharedKey()("IE_PROTO"), _ = Object.prototype;
|
143333
143401
|
return _objectGpo = Object.getPrototypeOf || function(_e) {
|
143334
143402
|
return _e = s(_e), a(_e, $) ? _e[$] : typeof _e.constructor == "function" && _e instanceof _e.constructor ? _e.constructor.prototype : _e instanceof Object ? _ : null;
|
143335
143403
|
}, _objectGpo;
|
@@ -143450,7 +143518,7 @@ var iterator$1 = _wksExt.f("iterator"), iterator = { default: iterator$1, __esMo
|
|
143450
143518
|
return s;
|
143451
143519
|
}, cof = require_cof(), _isArray = Array.isArray || function a(s) {
|
143452
143520
|
return cof(s) == "Array";
|
143453
|
-
}, _objectGopnExt = {}, _objectGopn = {}, $keys$1 = require_objectKeysInternal(), hiddenKeys =
|
143521
|
+
}, _objectGopnExt = {}, _objectGopn = {}, $keys$1 = require_objectKeysInternal(), hiddenKeys = require_enumBugKeys().concat("length", "prototype");
|
143454
143522
|
_objectGopn.f = Object.getOwnPropertyNames || function a(s) {
|
143455
143523
|
return $keys$1(s, hiddenKeys);
|
143456
143524
|
};
|
@@ -143474,7 +143542,7 @@ _objectGopd.f = require_descriptors() ? gOPD$1 : function a(s, $) {
|
|
143474
143542
|
if (has$1(s, $))
|
143475
143543
|
return createDesc$1(!pIE.f.call(s, $), s[$]);
|
143476
143544
|
};
|
143477
|
-
var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = require_fails(), shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray$1 = _isArray, anObject = _anObject, isObject$2 = _isObject, toObject = require_toObject(), toIObject = _toIobject, toPrimitive$1 = _toPrimitive$5, createDesc = _propertyDesc, _create$1 =
|
143545
|
+
var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = require_fails(), shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray$1 = _isArray, anObject = _anObject, isObject$2 = _isObject, toObject = require_toObject(), toIObject = _toIobject, toPrimitive$1 = _toPrimitive$5, createDesc = _propertyDesc, _create$1 = require_objectCreate(), gOPNExt = _objectGopnExt, $GOPD = _objectGopd, $GOPS = require_objectGops(), $DP = _objectDp, $keys = require_objectKeys(), gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global$1.Symbol, $JSON = global$1.JSON, _stringify = $JSON && $JSON.stringify, PROTOTYPE = "prototype", HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object[PROTOTYPE], USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f, QObject = global$1.QObject, setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
|
143478
143546
|
return _create$1(dP({}, "a", {
|
143479
143547
|
get: function() {
|
143480
143548
|
return dP(this, "a", { value: 7 }).a;
|
@@ -143649,7 +143717,7 @@ function require_setProto() {
|
|
143649
143717
|
var $export$1 = _export;
|
143650
143718
|
$export$1($export$1.S, "Object", { setPrototypeOf: require_setProto().set });
|
143651
143719
|
var setPrototypeOf$1 = _coreExports.Object.setPrototypeOf, setPrototypeOf = { default: setPrototypeOf$1, __esModule: !0 }, $export = _export;
|
143652
|
-
$export($export.S, "Object", { create:
|
143720
|
+
$export($export.S, "Object", { create: require_objectCreate() });
|
143653
143721
|
var $Object = _coreExports.Object, create$1 = function a(s, $) {
|
143654
143722
|
return $Object.create(s, $);
|
143655
143723
|
}, create = { default: create$1, __esModule: !0 }, _setPrototypeOf = setPrototypeOf, _setPrototypeOf2 = _interopRequireDefault$c(_setPrototypeOf), _create = create, _create2 = _interopRequireDefault$c(_create), _typeof2 = _typeof$j, _typeof3 = _interopRequireDefault$c(_typeof2);
|
@@ -162422,8 +162490,8 @@ const Guides$2 = Guides$1, guideStyle = (a, s, $, _) => ({
|
|
162422
162490
|
});
|
162423
162491
|
const It = reactExports.useCallback(
|
162424
162492
|
(Tt) => {
|
162425
|
-
nt.current = [], tt.current.push(cloneDeep$
|
162426
|
-
const Dt = cloneDeep$
|
162493
|
+
nt.current = [], tt.current.push(cloneDeep$1(ht[gt]));
|
162494
|
+
const Dt = cloneDeep$1(ht);
|
162427
162495
|
Dt[gt] = Tt, dt(Dt), _(schemasList2template(Dt, a.basePdf));
|
162428
162496
|
},
|
162429
162497
|
[a, ht, gt, _]
|
@@ -162499,10 +162567,10 @@ const Guides$2 = Guides$1, guideStyle = (a, s, $, _) => ({
|
|
162499
162567
|
}, Nt = () => {
|
162500
162568
|
if (gt === 0 || !window.confirm(rt("removePageConfirm")))
|
162501
162569
|
return;
|
162502
|
-
const Tt = cloneDeep$
|
162570
|
+
const Tt = cloneDeep$1(ht);
|
162503
162571
|
Tt.splice(gt, 1), _t(Tt, gt - 1);
|
162504
162572
|
}, Mt = () => {
|
162505
|
-
const Tt = cloneDeep$
|
162573
|
+
const Tt = cloneDeep$1(ht);
|
162506
162574
|
Tt.splice(gt + 1, 0, []), _t(Tt, gt + 1);
|
162507
162575
|
};
|
162508
162576
|
xt !== a && (bt(a), kt(a));
|
@@ -162635,7 +162703,7 @@ class Designer extends BaseUIClass {
|
|
162635
162703
|
updateTemplate(s) {
|
162636
162704
|
if (checkTemplate(s), !this.domContainer)
|
162637
162705
|
throw Error(DESTROYED_ERR_MSG);
|
162638
|
-
this.template = cloneDeep$
|
162706
|
+
this.template = cloneDeep$1(s), this.onChangeTemplateCallback && this.onChangeTemplateCallback(s), this.render();
|
162639
162707
|
}
|
162640
162708
|
onSaveTemplate(s) {
|
162641
162709
|
this.onSaveTemplateCallback = s;
|
@@ -162789,8 +162857,7 @@ const Designer$1 = Designer, { Text } = Typography$1, icons = {
|
|
162789
162857
|
input: vt,
|
162790
162858
|
options: { font: tt },
|
162791
162859
|
_cache,
|
162792
|
-
|
162793
|
-
getDynamicHeight: (St, Bt) => Bt.schema.type !== "table" ? Promise.resolve(Bt.schema.height) : getDynamicHeightForTable(St, Bt)
|
162860
|
+
getDynamicHeights: (St, Bt) => Bt.schema.type !== "table" ? Promise.resolve([Bt.schema.height]) : getDynamicHeightsForTable(St, Bt)
|
162794
162861
|
}).then(async (St) => {
|
162795
162862
|
const Bt = await template2SchemasList(St);
|
162796
162863
|
ft(Bt), await mt(St);
|