@worm-vue3-print/common 1.4.0 → 1.4.1
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 -2
- package/dist/browser-bundle.d.ts +1 -1
- package/dist/common.js +49 -42
- package/dist/core/default-template.d.ts +1 -1
- package/dist/core/format.d.ts +1 -1
- package/dist/core/h.d.ts +1 -1
- package/dist/core/icons.d.ts +1 -1
- package/dist/core/store.d.ts +1 -1
- package/dist/index.cjs +8 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +390 -383
- package/dist/print-designer.d.ts +1 -1
- package/dist/shell/binding.d.ts +1 -1
- package/dist/shell/canvas.d.ts +1 -1
- package/dist/shell/code.d.ts +1 -1
- package/dist/shell/color-picker.d.ts +1 -1
- package/dist/shell/controls.d.ts +1 -1
- package/dist/shell/crop-anchor.d.ts +1 -1
- package/dist/shell/elements.d.ts +1 -1
- package/dist/shell/expression-editor.d.ts +1 -1
- package/dist/shell/flow-list.d.ts +1 -1
- package/dist/shell/font-select.d.ts +1 -1
- package/dist/shell/format-bar.d.ts +1 -1
- package/dist/shell/help-content/changelog.d.ts +1 -1
- package/dist/shell/help-content/faq.d.ts +1 -1
- package/dist/shell/help-content/features.d.ts +1 -1
- package/dist/shell/help-content/getting-started.d.ts +1 -1
- package/dist/shell/help-content/index.d.ts +1 -1
- package/dist/shell/help-content/shortcuts.d.ts +1 -1
- package/dist/shell/help-modal.d.ts +1 -1
- package/dist/shell/page-extras.d.ts +1 -1
- package/dist/shell/panels.d.ts +1 -1
- package/dist/shell/prop-group.d.ts +1 -1
- package/dist/shell/property-panel.d.ts +1 -1
- package/dist/shell/property-search.d.ts +1 -1
- package/dist/shell/ruler.d.ts +1 -1
- package/dist/shell/table-props.d.ts +1 -1
- package/dist/shell/table.d.ts +1 -1
- package/dist/shell/toolbar-overflow.d.ts +1 -1
- package/dist/shell/toolbar.d.ts +1 -1
- package/dist/shell/watermark.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useAlign as
|
|
2
|
-
import { resolveCanvasFontFamily as
|
|
3
|
-
import { browserCodeRenderer as
|
|
4
|
-
import
|
|
1
|
+
import { useAlign as Sa, useGroup as ka, generateId as Ft, createRuntimeElement as Ta, createFieldElement as Ea, zoneFromPaperPoint as Ca, ZONE_ALLOWED_TYPES as Aa, getZoneRects as Da, clampToZone as Ma, finalizeElementZone as _a, syncTableElementSize as $t, generateGroupId as za, MIN_SCALE_PERCENT as Jo, getPaperDimensions as xt, normalizeTemplateUnits as Pa, resolveCellGroupMode as bi, resolveCellBorderDisplay as rr, applyElementBorderPreset as ar, applyBorderPreset as sr, setCellBorderEdge as lr, elementVisibleBorders as Ra, setElementBorderEdgeVisible as ei, ELEMENT_BORDER_SIDES as dr, acceptsElementBorder as ti, resolveBorderEdgeStates as cr, barcodeUnitsPerModule as pr, barcodeQuietZoneModules as ur, layoutBarcodeSize as hr, barcodeAvailableBoxMm as fo, resolveBarcodeDesignValue as xi, BARCODE_MARGIN_BOTTOM_MODULES as fr, BARCODE_TEXT_FONT_SIZE_MODULES as mr, canMergeReason as gr, setRowType as vi, resolveCellBorderCss as io, normalizeSelection as Ia, cellImageBoxMm as Fa, cropStyleDeclarations as br, resolveShrinkMinFontSize as xr, clampResizedColumnWidth as La, cellFitCapMm as vr, cellFitWidthMm as yr, evaluateTemplate as Ot, DEFAULT_DEMO_DATA as Ge, resolveCellTextFit as wr, splitCells as Sr, mergeCells as kr, deleteCol as Oa, insertCol as on, deleteRow as Na, insertRow as nn, resolveFlowColumns as po, resolveFlowGapX as oi, resolveFlowRowHeight as ii, detectFlowListKey as ni, RESIZE_POINTS as $a, resolveElementBorder as Ba, resolveElementTextFit as yi, resolveElementNowrap as Ha, resolveElementWhiteSpace as Wa, resolveElementRotation as Ua, PRESET_COLORS as Tr, resolveOverlayPlacement as Ga, PAPER_PRESETS as St, groupFields as Er, isContinuousPaperSize as Cr, PROPERTY_REGISTRY as qa, searchProperties as ja, getTableCellBindings as Ya, getElementBindings as Ka, parseCropAnchor as Va, resolveCropPreview as Xa, resolveCropTravel as Za, cropWindow as Qa, cropPresetOptions as Ja, buildCropAnchor as rn, propertyTip as he, CROP_SCALE_LABEL as es, CROP_SCALE_MAX as ts, CROP_SCALE_MIN as an, cropAxisFields as os, cropAxisNote as is, CROP_SAMPLE_NOTE as ns, findMainCell as Ar, DEFAULT_BORDER as no, resolveSharedCellType as rs, barcodeBarWidthRecommendText as Dr, resolveDesignImageSrc as Mr, BORDER_LINE_STYLES as ri, createDefaultOptions as _r, collectWritableCells as as, setHeaderRepeat as ss, IMAGE_FIT_OPTIONS as ai, CELL_BORDER_APPLY_HINT_MULTI as ls, CELL_BORDER_APPLY_HINT_MIXED as ds, CELL_BORDER_APPLY_HINT as cs, normalizeRotationAngle as sn, isFreeAngleEditable as ps, isRotationExcludedType as us, collectFollowMemberIds as hs, resolveFlowMaxSpan as Oo, suggestFlowColumns as fs, resolveElementBorderDisplay as ms, elementBorderEdgeVisible as ln, ELEMENT_BORDER_APPLY_HINT as gs, propertyDefault as bs, CODE_OBLIQUE_NOTE as xs, setElementBorderField as vs, effectiveElementBorderSpec as ys, filterGroups as ws, resolveToolbarOverflow as Ss, RULER_THICKNESS as No, mmToPx as gt, chooseMajorStepMM as ks, buildRulerTicks as Ts, pxToMm as ro, nextWheelScale as dn, computeFitScale as Es, FIT_SCALE_MIN_PERCENT as Cs, computeAdsorb as As, calcResizeRect as Ds } from "@worm-vue3-print/core/designer";
|
|
2
|
+
import { resolveCanvasFontFamily as wi, getPaperDimensions as Ms, mmToPx as cn, resolveWatermarkLayout as _s, collectFollowMemberIds as zs, normalizeFontCatalog as Ps, findFontOption as pn, fontOptionLabel as un, filterFontOptions as Rs, normalizeFontQuery as hn, TILE_DEFAULTS as $e, validateTiling as zr, computeMaxColumns as Pr, computeTileLayout as Is, resolveSheetMm as fn, WATERMARK_DEFAULTS as V, WATERMARK_DENSITY_PRESETS as Fs, resolveSystemVariables as Ls, buildFontFaceCss as Os, normalizeTemplate as Ns, collectPrintWarnings as $s } from "@worm-vue3-print/core";
|
|
3
|
+
import { browserCodeRenderer as Rr, fitTextNode as Bs } from "@worm-vue3-print/core/browser";
|
|
4
|
+
import Ir from "jsbarcode";
|
|
5
5
|
function a(o, e = {}, t = []) {
|
|
6
6
|
return { tag: o, props: e, children: t };
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const Fr = "http://www.w3.org/2000/svg", Hs = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]), Ws = /* @__PURE__ */ new Set(["indeterminate"]);
|
|
9
9
|
function Us(o) {
|
|
10
10
|
return o === "svg" || o === "path" || o === "circle" || o === "rect" || o === "line" || o === "g";
|
|
11
11
|
}
|
|
@@ -16,7 +16,7 @@ function fe(o, e) {
|
|
|
16
16
|
}
|
|
17
17
|
if (o instanceof Node)
|
|
18
18
|
return e.appendChild(o), o;
|
|
19
|
-
const { tag: t, props: i, children: n } = o, r = Us(t) ? document.createElementNS(
|
|
19
|
+
const { tag: t, props: i, children: n } = o, r = Us(t) ? document.createElementNS(Fr, t) : document.createElement(t);
|
|
20
20
|
for (const [s, l] of Object.entries(i))
|
|
21
21
|
if (!(l == null || l === !1))
|
|
22
22
|
if (s === "class") r.setAttribute("class", String(l));
|
|
@@ -32,10 +32,10 @@ function fe(o, e) {
|
|
|
32
32
|
for (const s of n) fe(s, r);
|
|
33
33
|
return e.appendChild(r), r;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Lr(o) {
|
|
36
36
|
for (; o.firstChild; ) o.removeChild(o.firstChild);
|
|
37
37
|
}
|
|
38
|
-
const Gs =
|
|
38
|
+
const Gs = Fr;
|
|
39
39
|
function mo() {
|
|
40
40
|
return {
|
|
41
41
|
paperSize: "A4",
|
|
@@ -48,8 +48,8 @@ function mo() {
|
|
|
48
48
|
watermark: {}
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
function
|
|
51
|
+
const mn = "开启拼版后只能有一个设计页面";
|
|
52
|
+
function Or(o) {
|
|
53
53
|
const e = (t, i) => (t ?? []).map((n) => {
|
|
54
54
|
const r = { ...n.options };
|
|
55
55
|
return (n.printElementType?.type ?? n.type) === "table" && $t(r), { id: n.id || Ft(), zone: i, options: r, printElementType: { ...n.printElementType } };
|
|
@@ -78,9 +78,9 @@ function qs(o) {
|
|
|
78
78
|
guides: [...o.guides ?? []]
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function gn(o) {
|
|
82
82
|
const e = (i, n) => {
|
|
83
|
-
const r =
|
|
83
|
+
const r = Or(Pa(i));
|
|
84
84
|
return r.name || (r.name = `页面 ${n + 1}`), r;
|
|
85
85
|
};
|
|
86
86
|
if (!o) return [e(mo(), 0)];
|
|
@@ -114,10 +114,10 @@ class js {
|
|
|
114
114
|
undoStack = [];
|
|
115
115
|
redoStack = [];
|
|
116
116
|
listeners = /* @__PURE__ */ new Set();
|
|
117
|
-
align =
|
|
118
|
-
group =
|
|
117
|
+
align = Sa();
|
|
118
|
+
group = ka();
|
|
119
119
|
constructor(e = {}) {
|
|
120
|
-
if (this.pages =
|
|
120
|
+
if (this.pages = gn(e.initialTemplate), this.fields = e.initialFields ?? [], e.initialElements?.length) {
|
|
121
121
|
const t = this.pages[0];
|
|
122
122
|
t.elements = [...t.elements, ...e.initialElements];
|
|
123
123
|
}
|
|
@@ -149,12 +149,12 @@ class js {
|
|
|
149
149
|
}
|
|
150
150
|
addPage() {
|
|
151
151
|
if (this.tilingEnabled) {
|
|
152
|
-
window.alert(
|
|
152
|
+
window.alert(mn);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
this.recordHistory();
|
|
156
156
|
const e = this.pages[this.activePageIndex] ?? mo();
|
|
157
|
-
this.pages.push(
|
|
157
|
+
this.pages.push(Or({
|
|
158
158
|
...mo(),
|
|
159
159
|
paperSize: e.paperSize,
|
|
160
160
|
orientation: e.orientation,
|
|
@@ -172,7 +172,7 @@ class js {
|
|
|
172
172
|
}
|
|
173
173
|
duplicatePage(e) {
|
|
174
174
|
if (this.tilingEnabled) {
|
|
175
|
-
window.alert(
|
|
175
|
+
window.alert(mn);
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
this.recordHistory();
|
|
@@ -261,11 +261,11 @@ class js {
|
|
|
261
261
|
}
|
|
262
262
|
// ─── 元素增删改 ───
|
|
263
263
|
addElement(e, t = {}, i) {
|
|
264
|
-
const n =
|
|
264
|
+
const n = Ta(e, t);
|
|
265
265
|
return i && !this.placeAtDropPoint(n, i) || (this.recordHistory(), this.templateData.elements.push(n), this.select(/* @__PURE__ */ new Set([n.id])), this.emit()), n;
|
|
266
266
|
}
|
|
267
267
|
addFieldElement(e, t = {}, i) {
|
|
268
|
-
const n =
|
|
268
|
+
const n = Ea(e);
|
|
269
269
|
return Object.assign(n.options, t), i && !this.placeAtDropPoint(n, i) || (this.recordHistory(), this.templateData.elements.push(n), this.select(/* @__PURE__ */ new Set([n.id])), this.emit()), n;
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
@@ -273,11 +273,11 @@ class js {
|
|
|
273
273
|
* dropPoint 为纸面 mm;页眉/页脚不允许的类型返回 false(调用方不加入元素)。
|
|
274
274
|
*/
|
|
275
275
|
placeAtDropPoint(e, t) {
|
|
276
|
-
const i = this.templateData, n =
|
|
277
|
-
if (n !== "content" && !
|
|
276
|
+
const i = this.templateData, n = Ca(i, t.x, t.y);
|
|
277
|
+
if (n !== "content" && !Aa.includes(e.printElementType.type))
|
|
278
278
|
return alert("该元素类型不能放入页眉/页脚"), !1;
|
|
279
|
-
const r =
|
|
280
|
-
return e.zone = n, e.options.left = t.x - r.left, e.options.top = t.y - r.top, n !== "content" &&
|
|
279
|
+
const r = Da(i)[n];
|
|
280
|
+
return e.zone = n, e.options.left = t.x - r.left, e.options.top = t.y - r.top, n !== "content" && Ma(e, r), !0;
|
|
281
281
|
}
|
|
282
282
|
deleteSelected() {
|
|
283
283
|
this.selectedIds.size && (this.recordHistory(), this.templateData.elements = this.templateData.elements.filter((e) => !this.selectedIds.has(e.id)), this.selectedIds = /* @__PURE__ */ new Set(), this.emit());
|
|
@@ -326,7 +326,7 @@ class js {
|
|
|
326
326
|
let t = !1;
|
|
327
327
|
for (const i of this.elements) {
|
|
328
328
|
const n = e.get(i.id);
|
|
329
|
-
!n || n === this.geoSig(i) ||
|
|
329
|
+
!n || n === this.geoSig(i) || _a(i, this.templateData).rejected && (t = !0);
|
|
330
330
|
}
|
|
331
331
|
t && alert("该元素类型不能放入页眉/页脚"), this.emit();
|
|
332
332
|
}
|
|
@@ -382,7 +382,7 @@ class js {
|
|
|
382
382
|
}
|
|
383
383
|
const i = /* @__PURE__ */ new Map();
|
|
384
384
|
for (const [r, s] of t)
|
|
385
|
-
i.set(r, s >= 2 ?
|
|
385
|
+
i.set(r, s >= 2 ? za() : void 0);
|
|
386
386
|
const n = this.templateData.elements;
|
|
387
387
|
for (const r of this.clipboard) {
|
|
388
388
|
const s = ht(r);
|
|
@@ -454,7 +454,7 @@ class js {
|
|
|
454
454
|
return JSON.stringify(t);
|
|
455
455
|
}
|
|
456
456
|
loadTemplate(e) {
|
|
457
|
-
this.pages =
|
|
457
|
+
this.pages = gn(e), this.activePageIndex = 0, this.resetSelection(), this.recordHistory(), this.emit();
|
|
458
458
|
}
|
|
459
459
|
/** 当前纸张尺寸(mm),视图层算坐标要用 */
|
|
460
460
|
get paperSize() {
|
|
@@ -462,8 +462,8 @@ class js {
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
const et = /* @__PURE__ */ Symbol("mixed"), $o = /* @__PURE__ */ new Set(["text", "longText"]), Ys = ["top", "right", "bottom", "left"], Ks = { on: !0, off: !1, mixed: et };
|
|
465
|
-
function
|
|
466
|
-
const e =
|
|
465
|
+
function bn(o) {
|
|
466
|
+
const e = cr(o), t = {};
|
|
467
467
|
for (const i of Ys) t[i] = Ks[e[i]];
|
|
468
468
|
return t;
|
|
469
469
|
}
|
|
@@ -639,7 +639,7 @@ class Xs {
|
|
|
639
639
|
this.borderStyle = "solid", this.borderWidth = 0.75, this.borderColor = "#333333", this.borderMixed = { style: !1, width: !1, color: !1 };
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
|
-
const n =
|
|
642
|
+
const n = rr(t, e);
|
|
643
643
|
if (n.style === void 0 && n.width === void 0 && n.color === void 0) {
|
|
644
644
|
this.borderMixed = { style: !1, width: !1, color: !1 }, this.borderStyle = null, this.borderWidth = 0, this.borderColor = "#333333";
|
|
645
645
|
return;
|
|
@@ -673,23 +673,23 @@ class Xs {
|
|
|
673
673
|
applyElementBorder(e, t) {
|
|
674
674
|
const i = this.selectedElements;
|
|
675
675
|
i.length && (i.forEach((n) => {
|
|
676
|
-
|
|
676
|
+
ar(n.options, e, t);
|
|
677
677
|
}), this.commit());
|
|
678
678
|
}
|
|
679
679
|
applyCellBorderPreset(e, t) {
|
|
680
680
|
const i = this.store.tableSelection, n = this.tableElement?.options.tableRows;
|
|
681
|
-
!i || !n || (
|
|
681
|
+
!i || !n || (sr(n, { r1: i.r1, c1: i.c1, r2: i.r2, c2: i.c2 }, e, t), this.commit());
|
|
682
682
|
}
|
|
683
683
|
applyCellBorderEdges(e, t, i) {
|
|
684
684
|
this.writeCells((n) => {
|
|
685
|
-
for (const r of e)
|
|
685
|
+
for (const r of e) lr(n, r, i ? t : null);
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
/** 单元格选区四边激活态(WPS 式单边按钮的按下态);非单元格上下文或选区为空为 null */
|
|
689
689
|
get cellEdges() {
|
|
690
690
|
if (this.context !== "cells") return null;
|
|
691
691
|
const e = this.targetCells;
|
|
692
|
-
return e.length ?
|
|
692
|
+
return e.length ? bn(e.map((t) => t.borders)) : null;
|
|
693
693
|
}
|
|
694
694
|
/** 单边切换:未全有则补齐该边,全有再点则移除该边(与 Word/WPS 一致) */
|
|
695
695
|
toggleCellEdge(e, t) {
|
|
@@ -700,7 +700,7 @@ class Xs {
|
|
|
700
700
|
get elementEdges() {
|
|
701
701
|
if (this.context !== "elements") return null;
|
|
702
702
|
const e = this.selectedElements;
|
|
703
|
-
return e.length ?
|
|
703
|
+
return e.length ? bn(e.map((t) => Ra(t.options))) : null;
|
|
704
704
|
}
|
|
705
705
|
/** 元素分边切换:勾上用面板草稿;整圈生效时撤一边会把其余三边展开成分边 */
|
|
706
706
|
toggleElementEdge(e, t) {
|
|
@@ -743,7 +743,7 @@ class Xs {
|
|
|
743
743
|
clonePainterBorders(e) {
|
|
744
744
|
if (!e) return;
|
|
745
745
|
const t = {};
|
|
746
|
-
for (const i of
|
|
746
|
+
for (const i of dr) {
|
|
747
747
|
const n = e[i];
|
|
748
748
|
n && (t[i] = { ...n });
|
|
749
749
|
}
|
|
@@ -790,7 +790,7 @@ class Xs {
|
|
|
790
790
|
t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || this.cancelPainter();
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function xn(o, e) {
|
|
794
794
|
(e == null || e > o.length) && (e = o.length);
|
|
795
795
|
for (var t = 0, i = Array(e); t < e; t++) i[t] = o[t];
|
|
796
796
|
return i;
|
|
@@ -825,13 +825,13 @@ function el(o, e) {
|
|
|
825
825
|
}
|
|
826
826
|
function tl(o, e) {
|
|
827
827
|
if (o) {
|
|
828
|
-
if (typeof o == "string") return
|
|
828
|
+
if (typeof o == "string") return xn(o, e);
|
|
829
829
|
var t = {}.toString.call(o).slice(8, -1);
|
|
830
|
-
return t === "Object" && o.constructor && (t = o.constructor.name), t === "Map" || t === "Set" ? Array.from(o) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ?
|
|
830
|
+
return t === "Object" && o.constructor && (t = o.constructor.name), t === "Map" || t === "Set" ? Array.from(o) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? xn(o, e) : void 0;
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
|
-
const
|
|
834
|
-
let ne = Object.freeze, ae = Object.seal, bt = Object.create,
|
|
833
|
+
const Nr = Object.entries, vn = Object.setPrototypeOf, ol = Object.isFrozen, il = Object.getPrototypeOf, nl = Object.getOwnPropertyDescriptor;
|
|
834
|
+
let ne = Object.freeze, ae = Object.seal, bt = Object.create, $r = typeof Reflect < "u" && Reflect, si = $r.apply, li = $r.construct;
|
|
835
835
|
ne || (ne = function(e) {
|
|
836
836
|
return e;
|
|
837
837
|
});
|
|
@@ -848,7 +848,7 @@ li || (li = function(e) {
|
|
|
848
848
|
i[n - 1] = arguments[n];
|
|
849
849
|
return new e(...i);
|
|
850
850
|
});
|
|
851
|
-
const Qe = oe(Array.prototype.forEach), rl = oe(Array.prototype.lastIndexOf),
|
|
851
|
+
const Qe = oe(Array.prototype.forEach), rl = oe(Array.prototype.lastIndexOf), yn = oe(Array.prototype.pop), Dt = oe(Array.prototype.push), al = oe(Array.prototype.splice), yt = Array.isArray, It = oe(String.prototype.toLowerCase), Bo = oe(String.prototype.toString), wn = oe(String.prototype.match), Mt = oe(String.prototype.replace), Sn = oe(String.prototype.indexOf), sl = oe(String.prototype.trim), ll = oe(Number.prototype.toString), dl = oe(Boolean.prototype.toString), kn = typeof BigInt > "u" ? null : oe(BigInt.prototype.toString), Tn = typeof Symbol > "u" ? null : oe(Symbol.prototype.toString), be = oe(Object.prototype.hasOwnProperty), _t = oe(Object.prototype.toString), se = oe(RegExp.prototype.test), Xe = cl(TypeError);
|
|
852
852
|
function oe(o) {
|
|
853
853
|
return function(e) {
|
|
854
854
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
@@ -866,7 +866,7 @@ function cl(o) {
|
|
|
866
866
|
}
|
|
867
867
|
function O(o, e) {
|
|
868
868
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : It;
|
|
869
|
-
if (
|
|
869
|
+
if (vn && vn(o, null), !yt(e))
|
|
870
870
|
return o;
|
|
871
871
|
let i = e.length;
|
|
872
872
|
for (; i--; ) {
|
|
@@ -886,7 +886,7 @@ function pl(o) {
|
|
|
886
886
|
}
|
|
887
887
|
function Ee(o) {
|
|
888
888
|
const e = bt(null);
|
|
889
|
-
for (const i of
|
|
889
|
+
for (const i of Nr(o)) {
|
|
890
890
|
var t = el(i, 2);
|
|
891
891
|
const n = t[0], r = t[1];
|
|
892
892
|
be(o, n) && (yt(r) ? e[n] = pl(r) : r && typeof r == "object" && r.constructor === Object ? e[n] = Ee(r) : e[n] = r);
|
|
@@ -902,9 +902,9 @@ function ul(o) {
|
|
|
902
902
|
case "boolean":
|
|
903
903
|
return dl(o);
|
|
904
904
|
case "bigint":
|
|
905
|
-
return
|
|
905
|
+
return kn ? kn(o) : "0";
|
|
906
906
|
case "symbol":
|
|
907
|
-
return
|
|
907
|
+
return Tn ? Tn(o) : "Symbol()";
|
|
908
908
|
case "undefined":
|
|
909
909
|
return _t(o);
|
|
910
910
|
case "function":
|
|
@@ -945,13 +945,13 @@ function hl(o) {
|
|
|
945
945
|
return !1;
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
|
-
const
|
|
948
|
+
const En = ne(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Ho = ne(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Wo = ne(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), fl = ne(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Uo = ne(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), ml = ne(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Cn = ne(["#text"]), An = ne(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Go = ne(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "pointer-events", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "vector-effect", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Dn = ne(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ao = ne(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), gl = ae(/{{[\w\W]*|^[\w\W]*}}/g), bl = ae(/<%[\w\W]*|^[\w\W]*%>/g), xl = ae(/\${[\w\W]*/g), vl = ae(/^data-[\-\w.\u00B7-\uFFFF]+$/), yl = ae(/^aria-[\-\w]+$/), Mn = ae(
|
|
949
949
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
950
950
|
// eslint-disable-line no-useless-escape
|
|
951
951
|
), wl = ae(/^(?:\w+script|data):/i), Sl = ae(
|
|
952
952
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
953
953
|
// eslint-disable-line no-control-regex
|
|
954
|
-
), kl = ae(/^html$/i), Tl = ae(/^[a-z][.\w]*(-[.\w]+)+$/i),
|
|
954
|
+
), kl = ae(/^html$/i), Tl = ae(/^[a-z][.\w]*(-[.\w]+)+$/i), _n = ae(/<[/\w!]/g), zn = ae(/<[/\w]/g), El = ae(/<\/no(script|embed|frames)/i), Cl = ae(/\/>/i), Te = {
|
|
955
955
|
element: 1,
|
|
956
956
|
attribute: 2,
|
|
957
957
|
text: 3,
|
|
@@ -967,9 +967,9 @@ const Tn = ne(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
967
967
|
documentFragment: 11,
|
|
968
968
|
notation: 12
|
|
969
969
|
// Deprecated
|
|
970
|
-
},
|
|
970
|
+
}, Br = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"], Al = ne(O({}, Br)), Dl = (function() {
|
|
971
971
|
const o = {};
|
|
972
|
-
return Qe(
|
|
972
|
+
return Qe(Br, (e) => {
|
|
973
973
|
o[e] = ae(new RegExp("</" + e + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
974
974
|
}), ne(o);
|
|
975
975
|
})(), Ml = function() {
|
|
@@ -993,7 +993,7 @@ const Tn = ne(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
993
993
|
} catch {
|
|
994
994
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
995
995
|
}
|
|
996
|
-
},
|
|
996
|
+
}, Pn = function() {
|
|
997
997
|
return {
|
|
998
998
|
afterSanitizeAttributes: [],
|
|
999
999
|
afterSanitizeElements: [],
|
|
@@ -1011,9 +1011,9 @@ const Tn = ne(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
1011
1011
|
const n = be(e, t) ? e[t] : void 0;
|
|
1012
1012
|
return n && typeof n == "object" ? Ee(n) : i();
|
|
1013
1013
|
};
|
|
1014
|
-
function
|
|
1014
|
+
function Hr() {
|
|
1015
1015
|
let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ml();
|
|
1016
|
-
const e = (k) =>
|
|
1016
|
+
const e = (k) => Hr(k);
|
|
1017
1017
|
if (e.version = "3.4.14", e.removed = [], !o || !o.document || o.document.nodeType !== Te.document || !o.Element)
|
|
1018
1018
|
return e.isSupported = !1, e;
|
|
1019
1019
|
let t = o.document;
|
|
@@ -1051,13 +1051,13 @@ function Br() {
|
|
|
1051
1051
|
}, Ie = function() {
|
|
1052
1052
|
return de || (Y = _l(f, n), de = !0), Y;
|
|
1053
1053
|
}, R = t, J = R.implementation, je = R.createNodeIterator, ce = R.createDocumentFragment, Ye = R.getElementsByTagName, nt = i.importNode;
|
|
1054
|
-
let H =
|
|
1055
|
-
e.isSupported = typeof
|
|
1054
|
+
let H = Pn();
|
|
1055
|
+
e.isSupported = typeof Nr == "function" && typeof T == "function" && J && J.createHTMLDocument !== void 0;
|
|
1056
1056
|
const ko = gl, Ht = bl, Wt = xl, To = vl, Ke = yl, we = wl, Se = Sl, Eo = Tl;
|
|
1057
|
-
let Ut =
|
|
1058
|
-
const kt = O({}, [...
|
|
1057
|
+
let Ut = Mn, U = null;
|
|
1058
|
+
const kt = O({}, [...En, ...Ho, ...Wo, ...Uo, ...Cn]);
|
|
1059
1059
|
let G = null;
|
|
1060
|
-
const rt = O({}, [...
|
|
1060
|
+
const rt = O({}, [...An, ...Go, ...Dn, ...ao]);
|
|
1061
1061
|
let pe = Object.seal(bt(null, {
|
|
1062
1062
|
tagNameCheck: {
|
|
1063
1063
|
writable: !0,
|
|
@@ -1092,10 +1092,10 @@ function Br() {
|
|
|
1092
1092
|
value: null
|
|
1093
1093
|
}
|
|
1094
1094
|
}));
|
|
1095
|
-
let Tt = !0, at = !0, b = !1, F = !0, Z = !1, ee = !0, De = !1, Et = !1, qt = null, jt = null, Co = !1, st = !1, Yt = !1, Kt = !1,
|
|
1096
|
-
const
|
|
1095
|
+
let Tt = !0, at = !0, b = !1, F = !0, Z = !1, ee = !0, De = !1, Et = !1, qt = null, jt = null, Co = !1, st = !1, Yt = !1, Kt = !1, Ri = !0, Ii = !1;
|
|
1096
|
+
const Fi = "user-content-";
|
|
1097
1097
|
let Ao = !0, Do = !1, lt = {}, dt = null;
|
|
1098
|
-
const
|
|
1098
|
+
const Li = O({}, [
|
|
1099
1099
|
"annotation-xml",
|
|
1100
1100
|
"audio",
|
|
1101
1101
|
"colgroup",
|
|
@@ -1132,57 +1132,57 @@ function Br() {
|
|
|
1132
1132
|
"video",
|
|
1133
1133
|
"xmp"
|
|
1134
1134
|
]);
|
|
1135
|
-
let
|
|
1136
|
-
const
|
|
1137
|
-
let
|
|
1138
|
-
const
|
|
1135
|
+
let Oi = null;
|
|
1136
|
+
const Ni = O({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
1137
|
+
let $i = null;
|
|
1138
|
+
const Bi = O({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Vt = "http://www.w3.org/1998/Math/MathML", Xt = "http://www.w3.org/2000/svg", ze = "http://www.w3.org/1999/xhtml";
|
|
1139
1139
|
let ct = ze, Mo = !1, _o = null;
|
|
1140
|
-
const
|
|
1141
|
-
let zo = O({},
|
|
1142
|
-
const
|
|
1143
|
-
let Po = O({},
|
|
1144
|
-
const
|
|
1140
|
+
const aa = O({}, [Vt, Xt, ze], Bo), Hi = ne(["mi", "mo", "mn", "ms", "mtext"]);
|
|
1141
|
+
let zo = O({}, Hi);
|
|
1142
|
+
const Wi = ne(["annotation-xml"]);
|
|
1143
|
+
let Po = O({}, Wi);
|
|
1144
|
+
const sa = O({}, ["title", "style", "font", "a", "script"]);
|
|
1145
1145
|
let Ct = null;
|
|
1146
|
-
const
|
|
1146
|
+
const la = ["application/xhtml+xml", "text/html"], da = "text/html";
|
|
1147
1147
|
let te = null, pt = null;
|
|
1148
|
-
const
|
|
1148
|
+
const ca = t.createElement("form"), Ui = function(d) {
|
|
1149
1149
|
return d instanceof RegExp || d instanceof Function;
|
|
1150
1150
|
}, Ro = function() {
|
|
1151
1151
|
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1152
1152
|
if (pt && pt === d)
|
|
1153
1153
|
return;
|
|
1154
1154
|
(!d || typeof d != "object") && (d = {}), d = Ee(d), Ct = // eslint-disable-next-line unicorn/prefer-includes
|
|
1155
|
-
|
|
1155
|
+
la.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? da : d.PARSER_MEDIA_TYPE, te = Ct === "application/xhtml+xml" ? Bo : It, U = Be(d, "ALLOWED_TAGS", kt, {
|
|
1156
1156
|
transform: te
|
|
1157
1157
|
}), G = Be(d, "ALLOWED_ATTR", rt, {
|
|
1158
1158
|
transform: te
|
|
1159
|
-
}), _o = Be(d, "ALLOWED_NAMESPACES",
|
|
1159
|
+
}), _o = Be(d, "ALLOWED_NAMESPACES", aa, {
|
|
1160
1160
|
transform: Bo
|
|
1161
|
-
}),
|
|
1161
|
+
}), $i = Be(d, "ADD_URI_SAFE_ATTR", Bi, {
|
|
1162
1162
|
transform: te,
|
|
1163
|
-
base:
|
|
1164
|
-
}),
|
|
1163
|
+
base: Bi
|
|
1164
|
+
}), Oi = Be(d, "ADD_DATA_URI_TAGS", Ni, {
|
|
1165
1165
|
transform: te,
|
|
1166
|
-
base:
|
|
1167
|
-
}), dt = Be(d, "FORBID_CONTENTS",
|
|
1166
|
+
base: Ni
|
|
1167
|
+
}), dt = Be(d, "FORBID_CONTENTS", Li, {
|
|
1168
1168
|
transform: te
|
|
1169
1169
|
}), ke = Be(d, "FORBID_TAGS", Ee({}), {
|
|
1170
1170
|
transform: te
|
|
1171
1171
|
}), Gt = Be(d, "FORBID_ATTR", Ee({}), {
|
|
1172
1172
|
transform: te
|
|
1173
|
-
}), lt = be(d, "USE_PROFILES") ? d.USE_PROFILES && typeof d.USE_PROFILES == "object" ? Ee(d.USE_PROFILES) : d.USE_PROFILES : !1, Tt = d.ALLOW_ARIA_ATTR !== !1, at = d.ALLOW_DATA_ATTR !== !1, b = d.ALLOW_UNKNOWN_PROTOCOLS || !1, F = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = d.SAFE_FOR_TEMPLATES || !1, ee = d.SAFE_FOR_XML !== !1, De = d.WHOLE_DOCUMENT || !1, st = d.RETURN_DOM || !1, Yt = d.RETURN_DOM_FRAGMENT || !1, Kt = d.RETURN_TRUSTED_TYPE || !1, Co = d.FORCE_BODY || !1,
|
|
1173
|
+
}), lt = be(d, "USE_PROFILES") ? d.USE_PROFILES && typeof d.USE_PROFILES == "object" ? Ee(d.USE_PROFILES) : d.USE_PROFILES : !1, Tt = d.ALLOW_ARIA_ATTR !== !1, at = d.ALLOW_DATA_ATTR !== !1, b = d.ALLOW_UNKNOWN_PROTOCOLS || !1, F = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = d.SAFE_FOR_TEMPLATES || !1, ee = d.SAFE_FOR_XML !== !1, De = d.WHOLE_DOCUMENT || !1, st = d.RETURN_DOM || !1, Yt = d.RETURN_DOM_FRAGMENT || !1, Kt = d.RETURN_TRUSTED_TYPE || !1, Co = d.FORCE_BODY || !1, Ri = d.SANITIZE_DOM !== !1, Ii = d.SANITIZE_NAMED_PROPS || !1, Ao = d.KEEP_CONTENT !== !1, Do = d.IN_PLACE || !1, Ut = hl(d.ALLOWED_URI_REGEXP) ? d.ALLOWED_URI_REGEXP : Mn, ct = typeof d.NAMESPACE == "string" ? d.NAMESPACE : ze, zo = qo(
|
|
1174
1174
|
d,
|
|
1175
1175
|
"MATHML_TEXT_INTEGRATION_POINTS",
|
|
1176
|
-
() => O({},
|
|
1176
|
+
() => O({}, Hi)
|
|
1177
1177
|
// Default built-in map
|
|
1178
1178
|
), Po = qo(
|
|
1179
1179
|
d,
|
|
1180
1180
|
"HTML_INTEGRATION_POINTS",
|
|
1181
|
-
() => O({},
|
|
1181
|
+
() => O({}, Wi)
|
|
1182
1182
|
// Default built-in map
|
|
1183
1183
|
);
|
|
1184
1184
|
const h = qo(d, "CUSTOM_ELEMENT_HANDLING", () => bt(null));
|
|
1185
|
-
if (pe = bt(null), be(h, "tagNameCheck") &&
|
|
1185
|
+
if (pe = bt(null), be(h, "tagNameCheck") && Ui(h.tagNameCheck) && (pe.tagNameCheck = h.tagNameCheck), be(h, "attributeNameCheck") && Ui(h.attributeNameCheck) && (pe.attributeNameCheck = h.attributeNameCheck), be(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (pe.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), ae(pe), Z && (at = !1), Yt && (st = !0), lt && (U = O({}, Cn), G = bt(null), lt.html === !0 && (O(U, En), O(G, An)), lt.svg === !0 && (O(U, Ho), O(G, Go), O(G, ao)), lt.svgFilters === !0 && (O(U, Wo), O(G, Go), O(G, ao)), lt.mathMl === !0 && (O(U, Uo), O(G, Dn), O(G, ao))), L.tagCheck = null, L.attributeCheck = null, be(d, "ADD_TAGS") && (typeof d.ADD_TAGS == "function" ? L.tagCheck = d.ADD_TAGS : yt(d.ADD_TAGS) && (U === kt && (U = Ee(U)), O(U, d.ADD_TAGS, te))), be(d, "ADD_ATTR") && (typeof d.ADD_ATTR == "function" ? L.attributeCheck = d.ADD_ATTR : yt(d.ADD_ATTR) && (G === rt && (G = Ee(G)), O(G, d.ADD_ATTR, te))), be(d, "ADD_FORBID_CONTENTS") && yt(d.ADD_FORBID_CONTENTS) && (dt === Li && (dt = Ee(dt)), O(dt, d.ADD_FORBID_CONTENTS, te)), Ao && (U["#text"] = !0), De && O(U, ["html", "head", "body"]), U.table && (O(U, ["tbody"]), delete ke.tbody), d.TRUSTED_TYPES_POLICY) {
|
|
1186
1186
|
if (typeof d.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
1187
1187
|
throw Xe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
1188
1188
|
if (typeof d.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -1196,20 +1196,20 @@ function Br() {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
} else d.TRUSTED_TYPES_POLICY === null ? (A = void 0, W = "") : (A === void 0 && (A = Ie()), A && typeof W == "string" && (W = $("")));
|
|
1198
1198
|
ne && ne(d), pt = d;
|
|
1199
|
-
},
|
|
1200
|
-
return h.namespaceURI === ze ? d === "svg" : h.namespaceURI === Vt ? d === "svg" && (w === "annotation-xml" || zo[w]) : !!
|
|
1201
|
-
}, pa = function(d, h, w) {
|
|
1202
|
-
return h.namespaceURI === ze ? d === "math" : h.namespaceURI === Xt ? d === "math" && Po[w] : !!Gi[d];
|
|
1199
|
+
}, Gi = O({}, [...Ho, ...Wo, ...fl]), qi = O({}, [...Uo, ...ml]), pa = function(d, h, w) {
|
|
1200
|
+
return h.namespaceURI === ze ? d === "svg" : h.namespaceURI === Vt ? d === "svg" && (w === "annotation-xml" || zo[w]) : !!Gi[d];
|
|
1203
1201
|
}, ua = function(d, h, w) {
|
|
1204
|
-
return h.namespaceURI ===
|
|
1205
|
-
}, ha = function(d) {
|
|
1202
|
+
return h.namespaceURI === ze ? d === "math" : h.namespaceURI === Xt ? d === "math" && Po[w] : !!qi[d];
|
|
1203
|
+
}, ha = function(d, h, w) {
|
|
1204
|
+
return h.namespaceURI === Xt && !Po[w] || h.namespaceURI === Vt && !zo[w] ? !1 : !qi[d] && (sa[d] || !Gi[d]);
|
|
1205
|
+
}, fa = function(d) {
|
|
1206
1206
|
let h = T(d);
|
|
1207
1207
|
(!h || !h.tagName) && (h = {
|
|
1208
1208
|
namespaceURI: ct,
|
|
1209
1209
|
tagName: "template"
|
|
1210
1210
|
});
|
|
1211
1211
|
const w = It(d.tagName), E = It(h.tagName);
|
|
1212
|
-
return _o[d.namespaceURI] ? d.namespaceURI === Xt ?
|
|
1212
|
+
return _o[d.namespaceURI] ? d.namespaceURI === Xt ? pa(w, h, E) : d.namespaceURI === Vt ? ua(w, h, E) : d.namespaceURI === ze ? ha(w, h, E) : !!(Ct === "application/xhtml+xml" && _o[d.namespaceURI]) : !1;
|
|
1213
1213
|
}, Ne = function(d) {
|
|
1214
1214
|
Dt(e.removed, {
|
|
1215
1215
|
element: d
|
|
@@ -1220,7 +1220,7 @@ function Br() {
|
|
|
1220
1220
|
if (g(d), !T(d))
|
|
1221
1221
|
throw Xe("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
1222
1222
|
}
|
|
1223
|
-
},
|
|
1223
|
+
}, ji = function(d, h, w) {
|
|
1224
1224
|
try {
|
|
1225
1225
|
d.removeAttributeNode(h);
|
|
1226
1226
|
} catch {
|
|
@@ -1247,7 +1247,7 @@ function Br() {
|
|
|
1247
1247
|
if (w)
|
|
1248
1248
|
for (let E = w.length - 1; E >= 0; --E) {
|
|
1249
1249
|
const C = w[E], M = C && C.name;
|
|
1250
|
-
typeof M == "string" &&
|
|
1250
|
+
typeof M == "string" && ji(d, C, M);
|
|
1251
1251
|
}
|
|
1252
1252
|
}, Ve = function(d, h, w) {
|
|
1253
1253
|
if (!w)
|
|
@@ -1279,32 +1279,32 @@ function Br() {
|
|
|
1279
1279
|
h.setAttribute(d, "");
|
|
1280
1280
|
} catch {
|
|
1281
1281
|
}
|
|
1282
|
-
},
|
|
1282
|
+
}, ma = function(d) {
|
|
1283
1283
|
const h = B(d);
|
|
1284
1284
|
if (h)
|
|
1285
1285
|
for (let w = h.length - 1; w >= 0; --w) {
|
|
1286
1286
|
const E = h[w], C = E && E.name;
|
|
1287
|
-
typeof C != "string" || G[te(C)] ||
|
|
1287
|
+
typeof C != "string" || G[te(C)] || ji(d, E, C);
|
|
1288
1288
|
}
|
|
1289
1289
|
}, Qt = function(d) {
|
|
1290
1290
|
const h = [d];
|
|
1291
1291
|
for (; h.length > 0; ) {
|
|
1292
1292
|
const w = h.pop();
|
|
1293
|
-
j(w) === Te.element &&
|
|
1293
|
+
j(w) === Te.element && ma(w);
|
|
1294
1294
|
const C = S(w);
|
|
1295
1295
|
if (C)
|
|
1296
1296
|
for (let M = C.length - 1; M >= 0; --M)
|
|
1297
1297
|
h.push(C[M]);
|
|
1298
1298
|
}
|
|
1299
|
-
},
|
|
1299
|
+
}, Yi = function(d, h) {
|
|
1300
1300
|
return ee ? d === "patchsrc" ? !0 : d === "for" && h !== "label" && h !== "output" : !1;
|
|
1301
|
-
},
|
|
1301
|
+
}, ga = function(d) {
|
|
1302
1302
|
if (!ee)
|
|
1303
1303
|
return;
|
|
1304
1304
|
const h = [d];
|
|
1305
1305
|
for (; h.length > 0; ) {
|
|
1306
1306
|
const w = h.pop(), E = j(w);
|
|
1307
|
-
if (E === Te.processingInstruction || E === Te.comment && se(
|
|
1307
|
+
if (E === Te.processingInstruction || E === Te.comment && se(zn, w.data)) {
|
|
1308
1308
|
try {
|
|
1309
1309
|
g(w);
|
|
1310
1310
|
} catch {
|
|
@@ -1314,7 +1314,7 @@ function Br() {
|
|
|
1314
1314
|
if (E === Te.element) {
|
|
1315
1315
|
const M = w, q = te(P(w));
|
|
1316
1316
|
try {
|
|
1317
|
-
M.hasAttribute && M.hasAttribute("patchsrc") && M.removeAttribute("patchsrc"), M.hasAttribute && M.hasAttribute("for") &&
|
|
1317
|
+
M.hasAttribute && M.hasAttribute("patchsrc") && M.removeAttribute("patchsrc"), M.hasAttribute && M.hasAttribute("for") && Yi("for", q) && M.removeAttribute("for");
|
|
1318
1318
|
} catch {
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
@@ -1323,12 +1323,12 @@ function Br() {
|
|
|
1323
1323
|
for (let M = C.length - 1; M >= 0; --M)
|
|
1324
1324
|
h.push(C[M]);
|
|
1325
1325
|
}
|
|
1326
|
-
},
|
|
1326
|
+
}, Ki = function(d) {
|
|
1327
1327
|
let h = null, w = null;
|
|
1328
1328
|
if (Co)
|
|
1329
1329
|
d = "<remove></remove>" + d;
|
|
1330
1330
|
else {
|
|
1331
|
-
const M =
|
|
1331
|
+
const M = wn(d, /^[\r\n\t ]+/);
|
|
1332
1332
|
w = M && M[0];
|
|
1333
1333
|
}
|
|
1334
1334
|
Ct === "application/xhtml+xml" && ct === ze && (d = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + d + "</body></html>");
|
|
@@ -1347,7 +1347,7 @@ function Br() {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
const C = h.body || h.documentElement;
|
|
1349
1349
|
return d && w && C.insertBefore(t.createTextNode(w), C.childNodes[0] || null), ct === ze ? Ye.call(h, De ? "html" : "body")[0] : De ? h.documentElement : C;
|
|
1350
|
-
},
|
|
1350
|
+
}, Vi = function(d) {
|
|
1351
1351
|
const h = ye ? ye(d) : d.ownerDocument;
|
|
1352
1352
|
return je.call(
|
|
1353
1353
|
h || d,
|
|
@@ -1423,8 +1423,8 @@ function Br() {
|
|
|
1423
1423
|
w.call(e, d, h, pt);
|
|
1424
1424
|
});
|
|
1425
1425
|
}
|
|
1426
|
-
const
|
|
1427
|
-
return !!(ee && d.hasChildNodes() && !At(d.firstElementChild) && se(
|
|
1426
|
+
const ba = function(d, h) {
|
|
1427
|
+
return !!(ee && d.hasChildNodes() && !At(d.firstElementChild) && se(_n, d.textContent) && se(_n, d.innerHTML) || ee && d.namespaceURI === ze && Al[h] && (At(d.firstElementChild) || typeof d.textContent == "string" && se(Dl[h], d.textContent)) || d.nodeType === Te.processingInstruction || ee && d.nodeType === Te.comment && se(zn, d.data));
|
|
1428
1428
|
}, to = function(d, h) {
|
|
1429
1429
|
if (d instanceof RegExp)
|
|
1430
1430
|
return se(d, h);
|
|
@@ -1434,8 +1434,8 @@ function Br() {
|
|
|
1434
1434
|
return !!d(h, ...E);
|
|
1435
1435
|
}
|
|
1436
1436
|
return !1;
|
|
1437
|
-
},
|
|
1438
|
-
if (!ke[h] &&
|
|
1437
|
+
}, xa = function(d, h, w) {
|
|
1438
|
+
if (!ke[h] && en(h) && to(pe.tagNameCheck, h))
|
|
1439
1439
|
return !1;
|
|
1440
1440
|
if (Ao && !dt[h]) {
|
|
1441
1441
|
const E = T(d), C = S(d);
|
|
@@ -1448,28 +1448,28 @@ function Br() {
|
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
1450
|
return Ne(d), !0;
|
|
1451
|
-
},
|
|
1451
|
+
}, Xi = function(d, h, w, E) {
|
|
1452
1452
|
return d.length === 0 ? h : h === w || h === E ? Ee(h) : h;
|
|
1453
|
-
}, Xi = function(d, h) {
|
|
1454
|
-
return d === h || T(d) !== null ? !1 : (Do && Qt(d), !0);
|
|
1455
1453
|
}, Zi = function(d, h) {
|
|
1456
|
-
|
|
1454
|
+
return d === h || T(d) !== null ? !1 : (Do && Qt(d), !0);
|
|
1455
|
+
}, Qi = function(d, h) {
|
|
1456
|
+
if (Pe(H.beforeSanitizeElements, d, null), Zi(d, h))
|
|
1457
1457
|
return !0;
|
|
1458
1458
|
if (eo(d))
|
|
1459
1459
|
return Ne(d), !0;
|
|
1460
1460
|
const w = te(P(d));
|
|
1461
|
-
if (U =
|
|
1461
|
+
if (U = Xi(H.uponSanitizeElement, U, kt, qt), Pe(H.uponSanitizeElement, d, {
|
|
1462
1462
|
tagName: w,
|
|
1463
1463
|
allowedTags: U
|
|
1464
|
-
}),
|
|
1464
|
+
}), Zi(d, h))
|
|
1465
1465
|
return !0;
|
|
1466
|
-
if (
|
|
1466
|
+
if (ba(d, w))
|
|
1467
1467
|
return Ne(d), !0;
|
|
1468
1468
|
if (ke[w] || !(L.tagCheck instanceof Function && L.tagCheck(w)) && !U[w]) {
|
|
1469
|
-
const C =
|
|
1469
|
+
const C = xa(d, w, h);
|
|
1470
1470
|
return C === !1 && Pe(H.afterSanitizeElements, d, null), C;
|
|
1471
1471
|
}
|
|
1472
|
-
if (j(d) === Te.element && !
|
|
1472
|
+
if (j(d) === Te.element && !fa(d) || (w === "noscript" || w === "noembed" || w === "noframes") && se(El, d.innerHTML))
|
|
1473
1473
|
return Ne(d), !0;
|
|
1474
1474
|
if (Z && d.nodeType === Te.text) {
|
|
1475
1475
|
const C = Jt(d.textContent);
|
|
@@ -1478,22 +1478,22 @@ function Br() {
|
|
|
1478
1478
|
}), d.textContent = C);
|
|
1479
1479
|
}
|
|
1480
1480
|
return Pe(H.afterSanitizeElements, d, null), !1;
|
|
1481
|
-
},
|
|
1482
|
-
if (Gt[h] ||
|
|
1481
|
+
}, Ji = function(d, h, w) {
|
|
1482
|
+
if (Gt[h] || Yi(h, d) || Ri && (h === "id" || h === "name") && (w in t || w in ca))
|
|
1483
1483
|
return !1;
|
|
1484
1484
|
const E = G[h] || L.attributeCheck instanceof Function && L.attributeCheck(h, d);
|
|
1485
|
-
return at && se(To, h) || Tt && se(Ke, h) ? !0 : E ?
|
|
1485
|
+
return at && se(To, h) || Tt && se(Ke, h) ? !0 : E ? $i[h] || se(Ut, Mt(w, Se, "")) || (h === "src" || h === "xlink:href" || h === "href") && d !== "script" && Sn(w, "data:") === 0 && Oi[d] || b && !se(we, Mt(w, Se, "")) ? !0 : !w : (
|
|
1486
1486
|
// Condition a) covers a basically valid custom element tag name whose
|
|
1487
1487
|
// tag passes the configured tagNameCheck and whose attribute name
|
|
1488
1488
|
// passes the configured attributeNameCheck ...
|
|
1489
|
-
|
|
1489
|
+
en(d) && to(pe.tagNameCheck, d) && to(pe.attributeNameCheck, h, d) || // Condition b) covers an `is` attribute whose value passes the
|
|
1490
1490
|
// configured tagNameCheck while customized built-in elements are
|
|
1491
1491
|
// allowed.
|
|
1492
1492
|
h === "is" && pe.allowCustomizedBuiltInElements && to(pe.tagNameCheck, w)
|
|
1493
1493
|
);
|
|
1494
|
-
},
|
|
1495
|
-
return !
|
|
1496
|
-
},
|
|
1494
|
+
}, va = O({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), en = function(d) {
|
|
1495
|
+
return !va[It(d)] && se(Eo, d);
|
|
1496
|
+
}, ya = function(d, h, w, E) {
|
|
1497
1497
|
if (A && typeof f == "object" && typeof f.getAttributeType == "function" && !w)
|
|
1498
1498
|
switch (f.getAttributeType(d, h)) {
|
|
1499
1499
|
case "TrustedHTML":
|
|
@@ -1502,18 +1502,18 @@ function Br() {
|
|
|
1502
1502
|
return re(E);
|
|
1503
1503
|
}
|
|
1504
1504
|
return E;
|
|
1505
|
-
},
|
|
1505
|
+
}, wa = function(d, h, w, E) {
|
|
1506
1506
|
try {
|
|
1507
|
-
w ? d.setAttributeNS(w, h, E) : d.setAttribute(h, E), eo(d) ? Ne(d) :
|
|
1507
|
+
w ? d.setAttributeNS(w, h, E) : d.setAttribute(h, E), eo(d) ? Ne(d) : yn(e.removed);
|
|
1508
1508
|
} catch {
|
|
1509
1509
|
Ve(h, d);
|
|
1510
1510
|
}
|
|
1511
|
-
},
|
|
1511
|
+
}, tn = function(d) {
|
|
1512
1512
|
Pe(H.beforeSanitizeAttributes, d, null);
|
|
1513
1513
|
const h = d.attributes;
|
|
1514
1514
|
if (!h || eo(d))
|
|
1515
1515
|
return;
|
|
1516
|
-
G =
|
|
1516
|
+
G = Xi(H.uponSanitizeAttribute, G, rt, jt);
|
|
1517
1517
|
const w = {
|
|
1518
1518
|
attrName: "",
|
|
1519
1519
|
attrValue: "",
|
|
@@ -1526,11 +1526,11 @@ function Br() {
|
|
|
1526
1526
|
for (; E--; ) {
|
|
1527
1527
|
const M = h[E], q = M.name, K = M.namespaceURI, me = M.value, ge = te(q), Lo = me;
|
|
1528
1528
|
let ue = q === "value" ? Lo : sl(Lo);
|
|
1529
|
-
if (w.attrName = ge, w.attrValue = ue, w.keepAttr = !0, w.forceKeepAttr = void 0, Pe(H.uponSanitizeAttribute, d, w), ue = w.attrValue,
|
|
1529
|
+
if (w.attrName = ge, w.attrValue = ue, w.keepAttr = !0, w.forceKeepAttr = void 0, Pe(H.uponSanitizeAttribute, d, w), ue = w.attrValue, Ii && (ge === "id" || ge === "name") && Sn(ue, Fi) !== 0 && (Ve(q, d, M), ue = Fi + ue), ee && se(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ue)) {
|
|
1530
1530
|
Ve(q, d, M);
|
|
1531
1531
|
continue;
|
|
1532
1532
|
}
|
|
1533
|
-
if (ge === "attributename" &&
|
|
1533
|
+
if (ge === "attributename" && wn(ue, "href")) {
|
|
1534
1534
|
Ve(q, d, M);
|
|
1535
1535
|
continue;
|
|
1536
1536
|
}
|
|
@@ -1543,19 +1543,19 @@ function Br() {
|
|
|
1543
1543
|
Ve(q, d, M);
|
|
1544
1544
|
continue;
|
|
1545
1545
|
}
|
|
1546
|
-
if (Z && (ue = Jt(ue)), !
|
|
1546
|
+
if (Z && (ue = Jt(ue)), !Ji(C, ge, ue)) {
|
|
1547
1547
|
Ve(q, d, M);
|
|
1548
1548
|
continue;
|
|
1549
1549
|
}
|
|
1550
|
-
ue =
|
|
1550
|
+
ue = ya(C, ge, K, ue), ue !== Lo && wa(d, q, K, ue);
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
1553
|
Pe(H.afterSanitizeAttributes, d, null);
|
|
1554
1554
|
}, oo = function(d) {
|
|
1555
1555
|
let h = null;
|
|
1556
|
-
const w =
|
|
1556
|
+
const w = Vi(d);
|
|
1557
1557
|
for (Pe(H.beforeSanitizeShadowDOM, d, null); h = w.nextNode(); )
|
|
1558
|
-
if (Pe(H.uponSanitizeShadowNode, h, null),
|
|
1558
|
+
if (Pe(H.uponSanitizeShadowNode, h, null), Qi(h, d), tn(h), ut(h.content) && oo(h.content), j(h) === Te.element) {
|
|
1559
1559
|
const E = _(h);
|
|
1560
1560
|
ut(E) && (Fo(E), oo(E));
|
|
1561
1561
|
}
|
|
@@ -1609,7 +1609,7 @@ function Br() {
|
|
|
1609
1609
|
Et ? (U = qt, G = jt) : Ro(d), (H.uponSanitizeElement.length > 0 || H.uponSanitizeAttribute.length > 0) && (U = Ee(U)), H.uponSanitizeAttribute.length > 0 && (G = Ee(G)), e.removed = [];
|
|
1610
1610
|
const M = Do && typeof k != "string" && At(k);
|
|
1611
1611
|
if (M) {
|
|
1612
|
-
|
|
1612
|
+
ga(k);
|
|
1613
1613
|
const me = P(k);
|
|
1614
1614
|
if (typeof me == "string") {
|
|
1615
1615
|
const ge = te(me);
|
|
@@ -1624,20 +1624,20 @@ function Br() {
|
|
|
1624
1624
|
throw Zt(k), ge;
|
|
1625
1625
|
}
|
|
1626
1626
|
} else if (At(k))
|
|
1627
|
-
h =
|
|
1627
|
+
h = Ki("<!---->"), w = h.ownerDocument.importNode(k, !0), w.nodeType === Te.element && w.nodeName === "BODY" || w.nodeName === "HTML" ? h = w : h.appendChild(w), Fo(w);
|
|
1628
1628
|
else {
|
|
1629
1629
|
if (!st && !Z && !De && // eslint-disable-next-line unicorn/prefer-includes
|
|
1630
1630
|
k.indexOf("<") === -1)
|
|
1631
1631
|
return A && Kt ? $(k) : k;
|
|
1632
|
-
if (h =
|
|
1632
|
+
if (h = Ki(k), !h)
|
|
1633
1633
|
return st ? null : Kt ? W : "";
|
|
1634
1634
|
}
|
|
1635
1635
|
h && Co && Ne(h.firstChild);
|
|
1636
1636
|
const q = M ? k : h;
|
|
1637
1637
|
try {
|
|
1638
|
-
const me =
|
|
1638
|
+
const me = Vi(q);
|
|
1639
1639
|
for (; E = me.nextNode(); )
|
|
1640
|
-
|
|
1640
|
+
Qi(E, q), tn(E), ut(E.content) && oo(E.content);
|
|
1641
1641
|
} catch (me) {
|
|
1642
1642
|
throw M && (Zt(k), Qe(e.removed, (ge) => {
|
|
1643
1643
|
ge.element && Qt(ge.element);
|
|
@@ -1666,7 +1666,7 @@ function Br() {
|
|
|
1666
1666
|
}, e.isValidAttribute = function(k, d, h) {
|
|
1667
1667
|
pt || Ro({});
|
|
1668
1668
|
const w = te(k), E = te(d);
|
|
1669
|
-
return
|
|
1669
|
+
return Ji(w, E, h);
|
|
1670
1670
|
}, e.addHook = function(k, d) {
|
|
1671
1671
|
typeof d == "function" && be(H, k) && Dt(H[k], d);
|
|
1672
1672
|
}, e.removeHook = function(k, d) {
|
|
@@ -1675,15 +1675,15 @@ function Br() {
|
|
|
1675
1675
|
const h = rl(H[k], d);
|
|
1676
1676
|
return h === -1 ? void 0 : al(H[k], h, 1)[0];
|
|
1677
1677
|
}
|
|
1678
|
-
return
|
|
1678
|
+
return yn(H[k]);
|
|
1679
1679
|
}
|
|
1680
1680
|
}, e.removeHooks = function(k) {
|
|
1681
1681
|
be(H, k) && (H[k] = []);
|
|
1682
1682
|
}, e.removeAllHooks = function() {
|
|
1683
|
-
H =
|
|
1683
|
+
H = Pn();
|
|
1684
1684
|
}, e;
|
|
1685
1685
|
}
|
|
1686
|
-
var zl =
|
|
1686
|
+
var zl = Hr();
|
|
1687
1687
|
const Pl = {
|
|
1688
1688
|
contain: "xMidYMid meet",
|
|
1689
1689
|
cover: "xMidYMid slice",
|
|
@@ -1693,7 +1693,7 @@ const Pl = {
|
|
|
1693
1693
|
};
|
|
1694
1694
|
function Rl(o) {
|
|
1695
1695
|
const e = o.options;
|
|
1696
|
-
return
|
|
1696
|
+
return xi(e.formatter, void 0, String(e.testData || e.title || "")) || "条码";
|
|
1697
1697
|
}
|
|
1698
1698
|
function Il(o) {
|
|
1699
1699
|
return a("div", {
|
|
@@ -1716,25 +1716,25 @@ function Ll(o) {
|
|
|
1716
1716
|
return e.length !== 4 || e.some((t) => !Number.isFinite(t)) ? null : { width: e[2], height: e[3] };
|
|
1717
1717
|
}
|
|
1718
1718
|
function Ol(o, e) {
|
|
1719
|
-
const t = o.options, i =
|
|
1720
|
-
|
|
1719
|
+
const t = o.options, i = pr(t.barWidth), n = ur(t.barQuietZone), r = (s) => {
|
|
1720
|
+
Ir(e, Rl(o), {
|
|
1721
1721
|
format: String(t.barcodeType || "CODE128"),
|
|
1722
1722
|
width: i,
|
|
1723
1723
|
height: s * i,
|
|
1724
1724
|
displayValue: !t.hideTitle,
|
|
1725
|
-
fontSize: (t.fontSize ??
|
|
1725
|
+
fontSize: (t.fontSize ?? mr) * i,
|
|
1726
1726
|
// 静区只留左右(与出图端同参):上下留白会白白吃掉元素高度
|
|
1727
1727
|
margin: 0,
|
|
1728
1728
|
marginLeft: n * i,
|
|
1729
1729
|
marginRight: n * i,
|
|
1730
1730
|
marginTop: 0,
|
|
1731
|
-
marginBottom:
|
|
1731
|
+
marginBottom: fr * i
|
|
1732
1732
|
});
|
|
1733
1733
|
const l = Ll(e);
|
|
1734
1734
|
return l ? { widthUnits: l.width, heightUnits: l.height } : null;
|
|
1735
1735
|
};
|
|
1736
1736
|
try {
|
|
1737
|
-
const s =
|
|
1737
|
+
const s = hr({
|
|
1738
1738
|
barHeightMm: t.barHeight,
|
|
1739
1739
|
boxWidthMm: fo(t.width, t.maxWidth),
|
|
1740
1740
|
boxHeightMm: fo(t.height, t.maxHeight),
|
|
@@ -1750,10 +1750,10 @@ function Ol(o, e) {
|
|
|
1750
1750
|
e.setAttribute("shape-rendering", "crispEdges");
|
|
1751
1751
|
}
|
|
1752
1752
|
function Nl(o, e) {
|
|
1753
|
-
const t = o.options, i =
|
|
1753
|
+
const t = o.options, i = xi(t.formatter, void 0, String(t.testData || t.title || "")) || "二维码";
|
|
1754
1754
|
e.replaceChildren();
|
|
1755
1755
|
try {
|
|
1756
|
-
const n =
|
|
1756
|
+
const n = Rr.render(i, "qrcode", {
|
|
1757
1757
|
qrCodeLevel: String(t.qrCodeLevel ?? "M"),
|
|
1758
1758
|
qrQuietZone: typeof t.qrQuietZone == "number" ? t.qrQuietZone : void 0
|
|
1759
1759
|
}), r = document.createElement("img");
|
|
@@ -1782,10 +1782,10 @@ const Bl = {
|
|
|
1782
1782
|
{ value: "data", label: "数据行" },
|
|
1783
1783
|
{ value: "subtotal", label: "小计行" },
|
|
1784
1784
|
{ value: "summary", label: "汇总行" }
|
|
1785
|
-
], uo = 3.7795275591, Wl = 0.1, di = (o) => JSON.parse(JSON.stringify(o)),
|
|
1785
|
+
], uo = 3.7795275591, Wl = 0.1, di = (o) => JSON.parse(JSON.stringify(o)), Rn = /* @__PURE__ */ new WeakMap();
|
|
1786
1786
|
function Oe(o) {
|
|
1787
|
-
let e =
|
|
1788
|
-
return e || (e = { menu: null, menuElId: null, anchor: null, layouts: /* @__PURE__ */ new Map() },
|
|
1787
|
+
let e = Rn.get(o);
|
|
1788
|
+
return e || (e = { menu: null, menuElId: null, anchor: null, layouts: /* @__PURE__ */ new Map() }, Rn.set(o, e)), e;
|
|
1789
1789
|
}
|
|
1790
1790
|
function Bt(o, e) {
|
|
1791
1791
|
return o.templateData.elements.find((t) => t.id === e) ?? null;
|
|
@@ -1794,7 +1794,7 @@ function Ul(o, e) {
|
|
|
1794
1794
|
const t = o.tableSelection;
|
|
1795
1795
|
return !t || t.elementId !== e.id ? null : o.selectedElement?.id !== e.id ? (o.tableSelection = null, null) : t;
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1797
|
+
function Wr(o, e, t) {
|
|
1798
1798
|
const i = Bt(o, t.id);
|
|
1799
1799
|
if (!i) return null;
|
|
1800
1800
|
const n = t.options;
|
|
@@ -1808,16 +1808,16 @@ function Hr(o, e, t) {
|
|
|
1808
1808
|
colWidths: n.tableColWidths ?? [],
|
|
1809
1809
|
isSelected: o.selectedIds.has(t.id),
|
|
1810
1810
|
selection: Ul(o, t),
|
|
1811
|
-
maxTableWidth:
|
|
1811
|
+
maxTableWidth: Ur(o)
|
|
1812
1812
|
};
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function Ur(o) {
|
|
1815
1815
|
return o.paperSize.width - o.templateData.margins.left - o.templateData.margins.right;
|
|
1816
1816
|
}
|
|
1817
|
-
function
|
|
1817
|
+
function Si(o) {
|
|
1818
1818
|
return o.options.tableDefaultFontSize ?? 10;
|
|
1819
1819
|
}
|
|
1820
|
-
function
|
|
1820
|
+
function Gr(o) {
|
|
1821
1821
|
return o.options.tableDefaultColor ?? "#333333";
|
|
1822
1822
|
}
|
|
1823
1823
|
function Gl(o, e) {
|
|
@@ -1837,23 +1837,23 @@ function Yl(o) {
|
|
|
1837
1837
|
for (const t of Object.values(Ge))
|
|
1838
1838
|
if (Array.isArray(t)) return t;
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function qr(o) {
|
|
1841
1841
|
return o.cellType === "barcode" || o.cellType === "qrcode";
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1844
|
-
return
|
|
1843
|
+
function jr(o, e) {
|
|
1844
|
+
return qr(e) ? xi(e.formatter, Yl(o)) : e.formatter || "";
|
|
1845
1845
|
}
|
|
1846
1846
|
function Kl(o, e) {
|
|
1847
1847
|
const t = { designMode: !0, showGhostBorder: o.store.showTableGhostBorder };
|
|
1848
1848
|
return {
|
|
1849
|
-
fontFamily:
|
|
1849
|
+
fontFamily: wi(e.fontFamily ?? o.options.tableDefaultFontFamily),
|
|
1850
1850
|
textAlign: e.align ?? "left",
|
|
1851
1851
|
// justify 不拉伸段落末行,单行单元格需显式声明才撑满列宽(与画布/出纸同策)
|
|
1852
1852
|
...e.align === "justify" ? { textAlignLast: "justify" } : {},
|
|
1853
1853
|
verticalAlign: e.valign ?? "middle",
|
|
1854
|
-
fontSize: (e.fontSize ??
|
|
1854
|
+
fontSize: (e.fontSize ?? Si(o)) + "pt",
|
|
1855
1855
|
fontWeight: e.fontWeight ?? "normal",
|
|
1856
|
-
color: e.color ??
|
|
1856
|
+
color: e.color ?? Gr(o),
|
|
1857
1857
|
backgroundColor: e.backgroundColor ?? "transparent",
|
|
1858
1858
|
borderTop: io(e.borders?.top, t),
|
|
1859
1859
|
borderRight: io(e.borders?.right, t),
|
|
@@ -1868,20 +1868,20 @@ function Vl(o, e, t) {
|
|
|
1868
1868
|
const i = o.selection;
|
|
1869
1869
|
return [!!i && e >= i.r1 && e <= i.r2 && t >= i.c1 && t <= i.c2 ? "cell-selected" : "", o.rows[e]?.type === "data" ? "row-data-bg" : ""].filter(Boolean).join(" ");
|
|
1870
1870
|
}
|
|
1871
|
-
function
|
|
1872
|
-
return
|
|
1871
|
+
function Yr(o) {
|
|
1872
|
+
return wr(o);
|
|
1873
1873
|
}
|
|
1874
1874
|
function Xl(o) {
|
|
1875
|
-
return
|
|
1875
|
+
return Yr(o) !== "autoHeight";
|
|
1876
1876
|
}
|
|
1877
1877
|
function Zl(o, e) {
|
|
1878
|
-
return e.fontSize ??
|
|
1878
|
+
return e.fontSize ?? Si(o);
|
|
1879
1879
|
}
|
|
1880
1880
|
function vo(o, e, t) {
|
|
1881
|
-
return
|
|
1881
|
+
return vr(o.rows, e, t, o.options.tableDefaultPadding ?? 1);
|
|
1882
1882
|
}
|
|
1883
1883
|
function Ql(o, e, t) {
|
|
1884
|
-
return
|
|
1884
|
+
return yr(o.colWidths, e, t, o.options.tableDefaultPadding ?? 1);
|
|
1885
1885
|
}
|
|
1886
1886
|
function Jl(o, e, t) {
|
|
1887
1887
|
return {
|
|
@@ -1893,10 +1893,10 @@ function Jl(o, e, t) {
|
|
|
1893
1893
|
function ed(o, e, t) {
|
|
1894
1894
|
const i = {
|
|
1895
1895
|
fitBase: String(Zl(o, e)),
|
|
1896
|
-
fitMin: String(
|
|
1896
|
+
fitMin: String(xr(e.shrinkMinFontSize)),
|
|
1897
1897
|
fitMm: String(vo(o, t, e))
|
|
1898
1898
|
};
|
|
1899
|
-
return
|
|
1899
|
+
return Yr(e) === "shrink" && (i.fit = "shrink"), i;
|
|
1900
1900
|
}
|
|
1901
1901
|
function td(o) {
|
|
1902
1902
|
const e = (o.getAttribute("viewBox") ?? "").trim().split(/[\s,]+/).map(Number);
|
|
@@ -1914,29 +1914,29 @@ function id(o, e, t, i) {
|
|
|
1914
1914
|
n.className = "cell-barcode";
|
|
1915
1915
|
const r = document.createElementNS(Gs, "svg");
|
|
1916
1916
|
n.appendChild(r);
|
|
1917
|
-
const s =
|
|
1917
|
+
const s = jr(o, i);
|
|
1918
1918
|
if (i.cellType === "barcode") {
|
|
1919
1919
|
r.setAttribute("preserveAspectRatio", od[i.fit || "contain"] ?? "xMidYMid meet");
|
|
1920
|
-
const l =
|
|
1921
|
-
|
|
1920
|
+
const l = pr(i.barWidth), c = ur(i.barQuietZone), p = (m) => {
|
|
1921
|
+
Ir(r, s, {
|
|
1922
1922
|
format: i.barcodeType || "CODE128",
|
|
1923
1923
|
width: l,
|
|
1924
1924
|
height: m * l,
|
|
1925
1925
|
displayValue: i.showBarcodeText !== !1,
|
|
1926
|
-
fontSize: (i.barFontSize ??
|
|
1926
|
+
fontSize: (i.barFontSize ?? mr) * l,
|
|
1927
1927
|
// 静区只留左右(与出图端同参):上下留白会白白吃掉单元格高度
|
|
1928
1928
|
margin: 0,
|
|
1929
1929
|
marginLeft: c * l,
|
|
1930
1930
|
marginRight: c * l,
|
|
1931
1931
|
marginTop: 0,
|
|
1932
|
-
marginBottom:
|
|
1932
|
+
marginBottom: fr * l
|
|
1933
1933
|
});
|
|
1934
1934
|
const x = td(r);
|
|
1935
1935
|
return x ? { widthUnits: x.width, heightUnits: x.height } : null;
|
|
1936
1936
|
};
|
|
1937
1937
|
let u = null;
|
|
1938
1938
|
try {
|
|
1939
|
-
u =
|
|
1939
|
+
u = hr({
|
|
1940
1940
|
barHeightMm: i.barHeight,
|
|
1941
1941
|
// 最大宽高并入可用框(与出图端同一助手),作为结算上限而非事后 CSS 缩放
|
|
1942
1942
|
boxWidthMm: fo(Ql(o, t, i), i.maxWidth),
|
|
@@ -1958,7 +1958,7 @@ function id(o, e, t, i) {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
if (r.style.display = "none", !s) return n;
|
|
1960
1960
|
try {
|
|
1961
|
-
const l =
|
|
1961
|
+
const l = Rr.render(s, "qrcode", {
|
|
1962
1962
|
qrCodeLevel: String(i.qrCodeLevel || "M"),
|
|
1963
1963
|
qrQuietZone: typeof i.qrQuietZone == "number" ? i.qrQuietZone : void 0
|
|
1964
1964
|
}), c = document.createElement("img");
|
|
@@ -1967,7 +1967,7 @@ function id(o, e, t, i) {
|
|
|
1967
1967
|
}
|
|
1968
1968
|
return n;
|
|
1969
1969
|
}
|
|
1970
|
-
function
|
|
1970
|
+
function In() {
|
|
1971
1971
|
const o = document.createElement("div");
|
|
1972
1972
|
return o.className = "image-placeholder", o.textContent = "图片", o;
|
|
1973
1973
|
}
|
|
@@ -1978,23 +1978,23 @@ function nd(o) {
|
|
|
1978
1978
|
function rd(o, e, t) {
|
|
1979
1979
|
const i = document.createElement("div");
|
|
1980
1980
|
i.className = "cell-image";
|
|
1981
|
-
const n =
|
|
1981
|
+
const n = Fa(t.fit, vo(o, e, t));
|
|
1982
1982
|
n !== void 0 && (i.style.height = `${n}mm`);
|
|
1983
1983
|
const r = nd(t);
|
|
1984
1984
|
if (!r)
|
|
1985
|
-
return i.appendChild(
|
|
1985
|
+
return i.appendChild(In()), i;
|
|
1986
1986
|
const s = document.createElement("img");
|
|
1987
1987
|
s.setAttribute("src", r), n !== void 0 && (s.style.width = "100%", s.style.height = "100%"), s.style.objectFit = t.fit || "contain";
|
|
1988
|
-
for (const [l, c] of Object.entries(
|
|
1988
|
+
for (const [l, c] of Object.entries(br(t.fit, t.fitScale, t.objectPosition)))
|
|
1989
1989
|
s.style[l] = c;
|
|
1990
1990
|
return s.style.maxWidth = t.maxWidth ? `${t.maxWidth}mm` : "100%", s.style.maxHeight = t.maxHeight ? `${t.maxHeight}mm` : "100%", s.addEventListener("error", () => {
|
|
1991
|
-
s.remove(), i.appendChild(
|
|
1991
|
+
s.remove(), i.appendChild(In());
|
|
1992
1992
|
}, { once: !0 }), i.appendChild(s), i;
|
|
1993
1993
|
}
|
|
1994
1994
|
function ad(o, e, t, i, n) {
|
|
1995
|
-
if (
|
|
1995
|
+
if (qr(n)) return id(o, t, i, n);
|
|
1996
1996
|
if (n.cellType === "image") return rd(o, t, n);
|
|
1997
|
-
const r =
|
|
1997
|
+
const r = jr(o, n), s = () => e.type === "data" ? a("span", { class: "data-placeholder", text: r }) : r;
|
|
1998
1998
|
return Xl(n) ? a("div", {
|
|
1999
1999
|
class: "cell-fit",
|
|
2000
2000
|
style: Jl(o, n, t),
|
|
@@ -2002,7 +2002,7 @@ function ad(o, e, t, i, n) {
|
|
|
2002
2002
|
}, [s()]) : s();
|
|
2003
2003
|
}
|
|
2004
2004
|
function go(o, e, t) {
|
|
2005
|
-
const i = { elementId: o.el.id, ...
|
|
2005
|
+
const i = { elementId: o.el.id, ...Ia(o.rows, e, t) };
|
|
2006
2006
|
o.store.setTableSelection(i), o.fire("table-selection-change", { elementId: o.el.id, selection: i });
|
|
2007
2007
|
}
|
|
2008
2008
|
function sd(o, e, t, i, n) {
|
|
@@ -2017,7 +2017,7 @@ function ld(o, e, t) {
|
|
|
2017
2017
|
const i = Oe(o.store).anchor;
|
|
2018
2018
|
i && go(o, i, { r: e, c: t });
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2020
|
+
function Kr(o, e) {
|
|
2021
2021
|
const t = Oe(o);
|
|
2022
2022
|
t.menu?.visible && (t.menu.visible = !1, e("table-menu-close", { elementId: t.menuElId }), o.emit(!1));
|
|
2023
2023
|
}
|
|
@@ -2026,9 +2026,9 @@ function dd(o, e, t, i) {
|
|
|
2026
2026
|
const n = o.selection;
|
|
2027
2027
|
n && e >= n.r1 && e <= n.r2 && t >= n.c1 && t <= n.c2 || go(o, { r: e, c: t }, { r: e, c: t });
|
|
2028
2028
|
const s = Oe(o.store);
|
|
2029
|
-
s.menuElId = o.el.id, s.menu && (s.menu.x = i.clientX, s.menu.y = i.clientY, s.menu.visible = !0), o.fire("table-cell-contextmenu", { elementId: o.el.id, r: e, c: t, clientX: i.clientX, clientY: i.clientY }), o.store.emit(!1), document.addEventListener("mousedown", () =>
|
|
2029
|
+
s.menuElId = o.el.id, s.menu && (s.menu.x = i.clientX, s.menu.y = i.clientY, s.menu.visible = !0), o.fire("table-cell-contextmenu", { elementId: o.el.id, r: e, c: t, clientX: i.clientX, clientY: i.clientY }), o.store.emit(!1), document.addEventListener("mousedown", () => Kr(o.store, o.fire), { once: !0 });
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function Fn(o, e, t) {
|
|
2032
2032
|
const i = o.reduce((n, r) => n + r, 0) + (o[e] ?? 0);
|
|
2033
2033
|
return i > t ? `插入后表格总宽 ${Math.round(i * 10) / 10}mm 超过打印范围宽度 ${t}mm,请先缩小列宽` : null;
|
|
2034
2034
|
}
|
|
@@ -2037,43 +2037,43 @@ function cd(o, e) {
|
|
|
2037
2037
|
return n ? (window.alert(n), !1) : (o.store.recordHistory(), e(t, i), o.store.setTableSelection(null), $t(o.real.options), o.store.emit(), !0);
|
|
2038
2038
|
}
|
|
2039
2039
|
function Fe(o, e, t) {
|
|
2040
|
-
|
|
2040
|
+
Kr(o.store, o.fire);
|
|
2041
2041
|
const i = o.selection;
|
|
2042
2042
|
if (!i) return;
|
|
2043
2043
|
let n = null;
|
|
2044
2044
|
switch (e) {
|
|
2045
2045
|
case "insert-row-above":
|
|
2046
|
-
n = (r) => (
|
|
2046
|
+
n = (r) => (nn(r, i.r1, "above"), null);
|
|
2047
2047
|
break;
|
|
2048
2048
|
case "insert-row-below":
|
|
2049
|
-
n = (r) => (
|
|
2049
|
+
n = (r) => (nn(r, i.r2, "below"), null);
|
|
2050
2050
|
break;
|
|
2051
2051
|
case "delete-row":
|
|
2052
2052
|
n = (r) => Na(r, i.r1);
|
|
2053
2053
|
break;
|
|
2054
2054
|
case "insert-col-left":
|
|
2055
2055
|
n = (r, s) => {
|
|
2056
|
-
const l =
|
|
2057
|
-
return l || (
|
|
2056
|
+
const l = Fn(s, i.c1, o.maxTableWidth);
|
|
2057
|
+
return l || (on(r, s, i.c1, "left"), null);
|
|
2058
2058
|
};
|
|
2059
2059
|
break;
|
|
2060
2060
|
case "insert-col-right":
|
|
2061
2061
|
n = (r, s) => {
|
|
2062
|
-
const l =
|
|
2063
|
-
return l || (
|
|
2062
|
+
const l = Fn(s, i.c2, o.maxTableWidth);
|
|
2063
|
+
return l || (on(r, s, i.c2, "right"), null);
|
|
2064
2064
|
};
|
|
2065
2065
|
break;
|
|
2066
2066
|
case "delete-col":
|
|
2067
2067
|
n = (r, s) => Oa(r, s, i.c1);
|
|
2068
2068
|
break;
|
|
2069
2069
|
case "merge":
|
|
2070
|
-
n = (r) => (
|
|
2070
|
+
n = (r) => (kr(r, i), null);
|
|
2071
2071
|
break;
|
|
2072
2072
|
case "split":
|
|
2073
|
-
n = (r) => (
|
|
2073
|
+
n = (r) => (Sr(r, i), null);
|
|
2074
2074
|
break;
|
|
2075
2075
|
case "set-row-type":
|
|
2076
|
-
n = (r) => t ?
|
|
2076
|
+
n = (r) => t ? vi(r, i.r1, t) : "未指定行类型";
|
|
2077
2077
|
break;
|
|
2078
2078
|
}
|
|
2079
2079
|
n && cd(o, n) && o.fire(`table-${e}`, { elementId: o.el.id, ...t ? { type: t } : {} });
|
|
@@ -2088,9 +2088,9 @@ function pd(o) {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
return !1;
|
|
2090
2090
|
}
|
|
2091
|
-
function
|
|
2091
|
+
function Ln(o, e) {
|
|
2092
2092
|
const t = o.selection;
|
|
2093
|
-
return t ? t.r1 !== t.r2 ? "行类型仅支持单行设置" :
|
|
2093
|
+
return t ? t.r1 !== t.r2 ? "行类型仅支持单行设置" : vi(di(o.rows), t.r1, e) : "未选择单元格";
|
|
2094
2094
|
}
|
|
2095
2095
|
function Le(o, e, t = {}) {
|
|
2096
2096
|
return a("div", {
|
|
@@ -2108,9 +2108,9 @@ function ud(o, e, t) {
|
|
|
2108
2108
|
if (i.menu = t, !t.visible || !i.menuElId) return "";
|
|
2109
2109
|
const n = Bt(o, i.menuElId);
|
|
2110
2110
|
if (!n || n.printElementType.type !== "table") return "";
|
|
2111
|
-
const r =
|
|
2111
|
+
const r = Wr(o, e, n);
|
|
2112
2112
|
if (!r) return "";
|
|
2113
|
-
const s = r.selection ?
|
|
2113
|
+
const s = r.selection ? gr(r.rows, r.selection) : "未选择单元格", l = r.selection ? r.rows[r.selection.r1]?.type ?? null : null;
|
|
2114
2114
|
return a("div", {
|
|
2115
2115
|
class: "table-ctx-menu",
|
|
2116
2116
|
style: { left: t.x + "px", top: t.y + "px" },
|
|
@@ -2129,15 +2129,15 @@ function ud(o, e, t) {
|
|
|
2129
2129
|
jo(),
|
|
2130
2130
|
a("div", { class: "menu-group-title", text: "行类型" }),
|
|
2131
2131
|
...Hl.map((c) => Le(c.label, () => Fe(r, "set-row-type", c.value), {
|
|
2132
|
-
disabled: !!
|
|
2133
|
-
title:
|
|
2132
|
+
disabled: !!Ln(r, c.value),
|
|
2133
|
+
title: Ln(r, c.value) || "",
|
|
2134
2134
|
active: l === c.value
|
|
2135
2135
|
}))
|
|
2136
2136
|
]);
|
|
2137
2137
|
}
|
|
2138
2138
|
let ot = null;
|
|
2139
|
-
function
|
|
2140
|
-
ot && (document.removeEventListener("mousemove",
|
|
2139
|
+
function Vr() {
|
|
2140
|
+
ot && (document.removeEventListener("mousemove", ki), document.removeEventListener("mouseup", Ti), ot.handle.classList.remove("dragging"), ot = null);
|
|
2141
2141
|
}
|
|
2142
2142
|
function hd(o, e) {
|
|
2143
2143
|
const t = o.closest(".hiprint-printPaper");
|
|
@@ -2147,7 +2147,7 @@ function fd(o, e, t) {
|
|
|
2147
2147
|
if (t.button !== 0) return;
|
|
2148
2148
|
const i = t.currentTarget, n = i.closest(".print-table");
|
|
2149
2149
|
if (!n) return;
|
|
2150
|
-
|
|
2150
|
+
Vr();
|
|
2151
2151
|
const r = o.real.options.tableColWidths ?? [];
|
|
2152
2152
|
ot = {
|
|
2153
2153
|
store: o.store,
|
|
@@ -2160,9 +2160,9 @@ function fd(o, e, t) {
|
|
|
2160
2160
|
root: n,
|
|
2161
2161
|
wrapper: i.closest(".print-element"),
|
|
2162
2162
|
handle: i
|
|
2163
|
-
}, i.classList.add("dragging"), o.store.recordHistory(), document.addEventListener("mousemove",
|
|
2163
|
+
}, i.classList.add("dragging"), o.store.recordHistory(), document.addEventListener("mousemove", ki), document.addEventListener("mouseup", Ti);
|
|
2164
2164
|
}
|
|
2165
|
-
function
|
|
2165
|
+
function ki(o) {
|
|
2166
2166
|
const e = ot;
|
|
2167
2167
|
if (!e) return;
|
|
2168
2168
|
const t = Bt(e.store, e.elId), i = t?.options.tableColWidths;
|
|
@@ -2172,7 +2172,7 @@ function Si(o) {
|
|
|
2172
2172
|
i,
|
|
2173
2173
|
r,
|
|
2174
2174
|
e.startWidth + n,
|
|
2175
|
-
|
|
2175
|
+
Ur(e.store)
|
|
2176
2176
|
), $t(t.options), i.forEach((s, l) => {
|
|
2177
2177
|
const c = e.root.querySelector(`colgroup col:nth-child(${l + 1})`);
|
|
2178
2178
|
c && (c.style.width = `${s}mm`);
|
|
@@ -2180,8 +2180,8 @@ function Si(o) {
|
|
|
2180
2180
|
s.style.left = `${i.slice(0, l + 1).reduce((c, p) => c + p, 0)}mm`;
|
|
2181
2181
|
}), e.wrapper && (e.wrapper.style.width = `${t.options.width}mm`, e.wrapper.style.height = `${t.options.height}mm`);
|
|
2182
2182
|
}
|
|
2183
|
-
function
|
|
2184
|
-
document.removeEventListener("mousemove",
|
|
2183
|
+
function Ti() {
|
|
2184
|
+
document.removeEventListener("mousemove", ki), document.removeEventListener("mouseup", Ti);
|
|
2185
2185
|
const o = ot;
|
|
2186
2186
|
if (!o) return;
|
|
2187
2187
|
ot = null, o.handle.classList.remove("dragging");
|
|
@@ -2228,10 +2228,10 @@ function yd(o, e) {
|
|
|
2228
2228
|
return o.colWidths.slice(0, e).reduce((t, i) => t + i, 0);
|
|
2229
2229
|
}
|
|
2230
2230
|
function wd(o, e, t) {
|
|
2231
|
-
const i =
|
|
2231
|
+
const i = Wr(e, t, o);
|
|
2232
2232
|
if (!i) return a("div", { class: "print-table" });
|
|
2233
2233
|
const n = [
|
|
2234
|
-
a("table", { style: { fontSize: `${
|
|
2234
|
+
a("table", { style: { fontSize: `${Si(i)}pt`, color: Gr(i) } }, [
|
|
2235
2235
|
a("colgroup", {}, i.colWidths.map((r) => a("col", { style: { width: r + "mm" } }))),
|
|
2236
2236
|
a("tbody", {}, i.rows.map((r, s) => a(
|
|
2237
2237
|
"tr",
|
|
@@ -2315,11 +2315,11 @@ function Ed(o, e) {
|
|
|
2315
2315
|
(l) => a("div", { class: "print-flow-cell", text: l })
|
|
2316
2316
|
));
|
|
2317
2317
|
}
|
|
2318
|
-
const
|
|
2318
|
+
const On = { top: "flex-start", middle: "center", bottom: "flex-end" }, Cd = { left: "flex-start", center: "center", right: "flex-end" };
|
|
2319
2319
|
function Ad(o, e) {
|
|
2320
2320
|
const t = o.options, i = Ba(o.printElementType.type, t), n = {};
|
|
2321
2321
|
if (i?.all && (n.border = `${i.all.borderWidth} ${i.all.borderStyle} ${i.all.borderColor}`), i)
|
|
2322
|
-
for (const r of
|
|
2322
|
+
for (const r of dr) {
|
|
2323
2323
|
const s = i.edges[r];
|
|
2324
2324
|
s && (n[`border${r.charAt(0).toUpperCase()}${r.slice(1)}`] = `${s.borderWidth} ${s.borderStyle} ${s.borderColor}`);
|
|
2325
2325
|
}
|
|
@@ -2340,11 +2340,11 @@ function Dd(o, e) {
|
|
|
2340
2340
|
const t = Ua(o.printElementType.type, o.options);
|
|
2341
2341
|
return t === void 0 ? {} : { rotate: `${t}deg` };
|
|
2342
2342
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const e = o.options, t = o.printElementType.type === "longText", i =
|
|
2343
|
+
function Nn(o) {
|
|
2344
|
+
const e = o.options, t = o.printElementType.type === "longText", i = yi(o.printElementType.type, e), n = e.fontSize || 12, r = i === "autoHeight", s = {
|
|
2345
2345
|
fontSize: `${n}pt`,
|
|
2346
2346
|
fontWeight: e.fontWeight || "normal",
|
|
2347
|
-
fontFamily:
|
|
2347
|
+
fontFamily: wi(e.fontFamily),
|
|
2348
2348
|
color: e.color || "#333",
|
|
2349
2349
|
backgroundColor: e.backgroundColor || "transparent",
|
|
2350
2350
|
textAlign: e.textAlign || "left",
|
|
@@ -2364,7 +2364,7 @@ function On(o) {
|
|
|
2364
2364
|
};
|
|
2365
2365
|
Ha(e) && (s.whiteSpace = "nowrap", s.textOverflow = "ellipsis");
|
|
2366
2366
|
const l = Wa(e);
|
|
2367
|
-
return l && (s.whiteSpace = l), e.verticalAlign && (s.display = "flex", e.textAlign === "justify" ? (s.flexDirection = "column", s.justifyContent =
|
|
2367
|
+
return l && (s.whiteSpace = l), e.verticalAlign && (s.display = "flex", e.textAlign === "justify" ? (s.flexDirection = "column", s.justifyContent = On[e.verticalAlign] ?? "flex-start") : (s.alignItems = On[e.verticalAlign] ?? "flex-start", s.justifyContent = Cd[e.textAlign || "left"] ?? "flex-start")), { style: s, fit: i };
|
|
2368
2368
|
}
|
|
2369
2369
|
function Md(o) {
|
|
2370
2370
|
const e = o.options, t = `${e.borderWidth || 0.75}pt`, i = e.borderStyle || "solid", n = e.borderColor || "#333";
|
|
@@ -2388,36 +2388,36 @@ function zd(o) {
|
|
|
2388
2388
|
return {
|
|
2389
2389
|
objectFit: e.fit || "contain",
|
|
2390
2390
|
// 取位与放大的判据与出纸同源(core crop-style):锚点即放大不动点,两端不许各拼一遍
|
|
2391
|
-
...
|
|
2391
|
+
...br(e.fit, e.fitScale, e.objectPosition),
|
|
2392
2392
|
maxWidth: e.maxWidth ? `${e.maxWidth}mm` : "100%",
|
|
2393
2393
|
maxHeight: e.maxHeight ? `${e.maxHeight}mm` : "100%"
|
|
2394
2394
|
};
|
|
2395
2395
|
}
|
|
2396
|
-
function
|
|
2396
|
+
function $n(o) {
|
|
2397
2397
|
const e = o.options, t = {
|
|
2398
2398
|
fitBase: String(e.fontSize || 12),
|
|
2399
|
-
fitMin: String(
|
|
2399
|
+
fitMin: String(xr(e.shrinkMinFontSize))
|
|
2400
2400
|
};
|
|
2401
|
-
return
|
|
2401
|
+
return yi(o.printElementType.type, e) === "shrink" && (t.fit = "shrink"), t;
|
|
2402
2402
|
}
|
|
2403
2403
|
function Pd(o, e, t) {
|
|
2404
2404
|
const i = o.printElementType.type, n = o.options;
|
|
2405
2405
|
switch (i) {
|
|
2406
2406
|
case "text": {
|
|
2407
|
-
const { style: r } =
|
|
2407
|
+
const { style: r } = Nn(o);
|
|
2408
2408
|
return a("div", {
|
|
2409
2409
|
class: "print-text",
|
|
2410
2410
|
style: r,
|
|
2411
|
-
dataset:
|
|
2411
|
+
dataset: $n(o),
|
|
2412
2412
|
text: String(n.testData || n.formatter || "") || "文本"
|
|
2413
2413
|
});
|
|
2414
2414
|
}
|
|
2415
2415
|
case "longText": {
|
|
2416
|
-
const { style: r } =
|
|
2416
|
+
const { style: r } = Nn(o);
|
|
2417
2417
|
return a("div", {
|
|
2418
2418
|
class: "print-longtext",
|
|
2419
2419
|
style: r,
|
|
2420
|
-
dataset:
|
|
2420
|
+
dataset: $n(o),
|
|
2421
2421
|
// canvas 的长文本设计态只看 formatter,占位文案是「长文本内容」
|
|
2422
2422
|
text: String(n.formatter || "") || "长文本内容"
|
|
2423
2423
|
});
|
|
@@ -2448,7 +2448,7 @@ function Pd(o, e, t) {
|
|
|
2448
2448
|
style: {
|
|
2449
2449
|
fontSize: `${n.fontSize || 12}pt`,
|
|
2450
2450
|
fontWeight: n.fontWeight || "normal",
|
|
2451
|
-
fontFamily:
|
|
2451
|
+
fontFamily: wi(n.fontFamily),
|
|
2452
2452
|
color: n.color || "#333",
|
|
2453
2453
|
textAlign: n.textAlign || "left",
|
|
2454
2454
|
...n.textAlign === "justify" ? { textAlignLast: "justify" } : {}
|
|
@@ -2463,7 +2463,7 @@ function Pd(o, e, t) {
|
|
|
2463
2463
|
return a("div", { text: i });
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
|
-
function
|
|
2466
|
+
function Xr(o) {
|
|
2467
2467
|
return `x:${Math.round(o.left)} y:${Math.round(o.top)} ${Math.round(o.width)}×${Math.round(o.height)}mm`;
|
|
2468
2468
|
}
|
|
2469
2469
|
function Rd(o, e, t) {
|
|
@@ -2473,7 +2473,7 @@ function Rd(o, e, t) {
|
|
|
2473
2473
|
dataset: { point: p, elId: e.id },
|
|
2474
2474
|
onMousedown: (u) => o.fire("resize-start", { event: u, id: e.id, point: p })
|
|
2475
2475
|
})))), c.push(a("div", { class: "selected-indicator" }, [
|
|
2476
|
-
a("div", { class: "position-label", text:
|
|
2476
|
+
a("div", { class: "position-label", text: Xr(s) })
|
|
2477
2477
|
]))), a("div", {
|
|
2478
2478
|
class: [
|
|
2479
2479
|
"print-element",
|
|
@@ -2514,7 +2514,7 @@ function pi(o, e) {
|
|
|
2514
2514
|
};
|
|
2515
2515
|
}
|
|
2516
2516
|
const Id = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 .5H20M.5 0V20" fill="none" stroke="rgba(0,0,0,0.08)" stroke-width="1" stroke-dasharray="4 4"/></svg>';
|
|
2517
|
-
function
|
|
2517
|
+
function Bn(o, e) {
|
|
2518
2518
|
return o.type === "vertical" ? {
|
|
2519
2519
|
left: `${o.position}mm`,
|
|
2520
2520
|
top: "0",
|
|
@@ -2602,11 +2602,11 @@ function Ld(o, e) {
|
|
|
2602
2602
|
Yo(o, e, "footer", s.footer, l("footer"), n),
|
|
2603
2603
|
...t.adsorbGuides.map((f) => a("div", {
|
|
2604
2604
|
class: `adsorb-guide guide-${f.type}`,
|
|
2605
|
-
style:
|
|
2605
|
+
style: Bn(f, n)
|
|
2606
2606
|
})),
|
|
2607
2607
|
...(i.guides ?? []).map((f) => a("div", {
|
|
2608
2608
|
class: `manual-guide guide-${f.type}`,
|
|
2609
|
-
style: {
|
|
2609
|
+
style: { ...Bn(f, n), "--guide-hit": `${8 / r}px` },
|
|
2610
2610
|
dataset: { guideId: String(f.id ?? "") },
|
|
2611
2611
|
onMousedown: (m) => o.fire("guide-mousedown", { event: m, id: f.id }),
|
|
2612
2612
|
onDblclick: (m) => {
|
|
@@ -2643,8 +2643,8 @@ function Ld(o, e) {
|
|
|
2643
2643
|
a("div", {
|
|
2644
2644
|
class: "paper-wrapper",
|
|
2645
2645
|
style: {
|
|
2646
|
-
width: `${
|
|
2647
|
-
height: `${
|
|
2646
|
+
width: `${cn(n.width) * r}px`,
|
|
2647
|
+
height: `${cn(n.height) * r}px`,
|
|
2648
2648
|
position: "relative"
|
|
2649
2649
|
}
|
|
2650
2650
|
}, [p])
|
|
@@ -2762,7 +2762,7 @@ function ve(o, e = 15, t) {
|
|
|
2762
2762
|
return i ? `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${e}"${t ? ` class="${t}"` : ""} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${i}</svg>` : "";
|
|
2763
2763
|
}
|
|
2764
2764
|
let tt = null;
|
|
2765
|
-
function
|
|
2765
|
+
function Ei(o) {
|
|
2766
2766
|
const e = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());
|
|
2767
2767
|
if (!e) return null;
|
|
2768
2768
|
const t = e[1], i = t.length === 3 ? t.split("").map((n) => n + n).join("") : t;
|
|
@@ -2772,11 +2772,11 @@ function Ti(o) {
|
|
|
2772
2772
|
b: Number.parseInt(i.slice(4, 6), 16)
|
|
2773
2773
|
};
|
|
2774
2774
|
}
|
|
2775
|
-
function
|
|
2776
|
-
const e =
|
|
2777
|
-
return e ?
|
|
2775
|
+
function Ci(o) {
|
|
2776
|
+
const e = Ei(o);
|
|
2777
|
+
return e ? Zr(e) : "#000000";
|
|
2778
2778
|
}
|
|
2779
|
-
function
|
|
2779
|
+
function Zr({ r: o, g: e, b: t }) {
|
|
2780
2780
|
return `#${[o, e, t].map((i) => Math.round(Nt(i / 255) * 255).toString(16).padStart(2, "0")).join("")}`;
|
|
2781
2781
|
}
|
|
2782
2782
|
function Nd(o, e, t) {
|
|
@@ -2844,7 +2844,7 @@ function Wd(o, e) {
|
|
|
2844
2844
|
items: [],
|
|
2845
2845
|
teardowns: []
|
|
2846
2846
|
};
|
|
2847
|
-
e.value &&
|
|
2847
|
+
e.value && Di(n, e.value) ? n.hexText = Ci(e.value).toUpperCase() : n.hexText = e.value ? String(e.value) : "", n.panel = fe(jd(n), i), n.current = n.panel.querySelector(".picker-current"), n.hex = n.panel.querySelector(".picker-hex"), n.area = n.panel.querySelector(".picker-area"), n.handle = n.panel.querySelector(".picker-handle"), n.hueRange = n.panel.querySelector(".picker-hue"), n.clearBtn = n.panel.querySelector(".picker-clear"), n.items = Array.from(n.panel.querySelectorAll(".preset-color-item")).map((r, s) => ({ el: r, color: Tr[s] })), yo(n), Ud(n), Gd(n), tt = n, o.setAttribute("aria-expanded", "true");
|
|
2848
2848
|
}
|
|
2849
2849
|
function Ud(o) {
|
|
2850
2850
|
const e = o.trigger.getBoundingClientRect(), t = 190, i = o.panel.offsetHeight || 216, n = 8, r = Math.max(n, Math.min(e.left, window.innerWidth - t - n)), s = e.bottom + 6, l = s + i > window.innerHeight - n ? Math.max(n, e.top - i - 6) : s;
|
|
@@ -2903,7 +2903,7 @@ function jd(o) {
|
|
|
2903
2903
|
step: 1,
|
|
2904
2904
|
"aria-label": "色相",
|
|
2905
2905
|
onInput: (e) => Zd(o, Number(e.target.value)),
|
|
2906
|
-
onChange: () =>
|
|
2906
|
+
onChange: () => Mi(o)
|
|
2907
2907
|
}),
|
|
2908
2908
|
a("div", { class: "picker-heading" }, [
|
|
2909
2909
|
a("span", { text: "常用颜色" }),
|
|
@@ -2925,7 +2925,7 @@ function jd(o) {
|
|
|
2925
2925
|
"清除"
|
|
2926
2926
|
]) : ""
|
|
2927
2927
|
].filter(Boolean)),
|
|
2928
|
-
a("div", { class: "preset-color-grid" },
|
|
2928
|
+
a("div", { class: "preset-color-grid" }, Tr.map((e) => a("button", {
|
|
2929
2929
|
type: "button",
|
|
2930
2930
|
class: "preset-color-item",
|
|
2931
2931
|
style: { background: e },
|
|
@@ -2935,35 +2935,35 @@ function jd(o) {
|
|
|
2935
2935
|
})))
|
|
2936
2936
|
]);
|
|
2937
2937
|
}
|
|
2938
|
-
function
|
|
2939
|
-
return
|
|
2938
|
+
function Ai(o) {
|
|
2939
|
+
return Zr($d(o.hue, o.saturation, o.value_));
|
|
2940
2940
|
}
|
|
2941
2941
|
function yo(o) {
|
|
2942
|
-
const e =
|
|
2942
|
+
const e = Ai(o);
|
|
2943
2943
|
o.hex.value !== o.hexText && (o.hex.value = o.hexText), o.current.className = o.model ? "picker-current" : "picker-current is-empty", o.model ? o.current.style.background = e : o.current.style.removeProperty("background"), o.area.style.setProperty("--picker-hue", `${Math.round(o.hue)}deg`), o.handle.style.left = `${o.saturation * 100}%`, o.handle.style.top = `${(1 - o.value_) * 100}%`, o.handle.style.background = e;
|
|
2944
2944
|
const t = String(Math.round(o.hue));
|
|
2945
2945
|
o.hueRange.value !== t && (o.hueRange.value = t), o.clearBtn && (o.clearBtn.disabled = !o.model);
|
|
2946
2946
|
for (const i of o.items)
|
|
2947
2947
|
i.el.className = o.model && i.color.toLowerCase() === o.model.toLowerCase() ? "preset-color-item active" : "preset-color-item";
|
|
2948
2948
|
}
|
|
2949
|
-
function
|
|
2950
|
-
const t =
|
|
2949
|
+
function Di(o, e) {
|
|
2950
|
+
const t = Ei(e);
|
|
2951
2951
|
if (!t) return !1;
|
|
2952
2952
|
const i = Nd(t.r, t.g, t.b);
|
|
2953
|
-
return o.hue = i.h, o.saturation = i.s, o.value_ = i.v, o.hexText =
|
|
2953
|
+
return o.hue = i.h, o.saturation = i.s, o.value_ = i.v, o.hexText = Ci(e).toUpperCase(), !0;
|
|
2954
2954
|
}
|
|
2955
2955
|
function vt(o, e, t, i) {
|
|
2956
|
-
o.hue = Bd(e), o.saturation = Nt(t), o.value_ = Nt(i), o.hexText =
|
|
2956
|
+
o.hue = Bd(e), o.saturation = Nt(t), o.value_ = Nt(i), o.hexText = Ai(o).toUpperCase(), yo(o);
|
|
2957
2957
|
}
|
|
2958
|
-
function
|
|
2959
|
-
const e =
|
|
2958
|
+
function Mi(o) {
|
|
2959
|
+
const e = Ai(o);
|
|
2960
2960
|
o.model = e, yo(o), o.onChange(e);
|
|
2961
2961
|
}
|
|
2962
2962
|
function bo(o, e) {
|
|
2963
2963
|
o.model = e, e || (o.hexText = ""), yo(o), o.onChange(e);
|
|
2964
2964
|
}
|
|
2965
2965
|
function Yd(o, e) {
|
|
2966
|
-
|
|
2966
|
+
Di(o, e), bo(o, e);
|
|
2967
2967
|
}
|
|
2968
2968
|
function Kd(o, e) {
|
|
2969
2969
|
const t = e.trim();
|
|
@@ -2971,18 +2971,18 @@ function Kd(o, e) {
|
|
|
2971
2971
|
o.clearable && bo(o, void 0);
|
|
2972
2972
|
return;
|
|
2973
2973
|
}
|
|
2974
|
-
|
|
2974
|
+
Ei(t) && (Di(o, t), bo(o, Ci(t)));
|
|
2975
2975
|
}
|
|
2976
2976
|
function Vd(o, e) {
|
|
2977
|
-
o.dragging = !0,
|
|
2977
|
+
o.dragging = !0, Hn(o, e);
|
|
2978
2978
|
const t = (n) => {
|
|
2979
|
-
o.dragging &&
|
|
2979
|
+
o.dragging && Hn(o, n);
|
|
2980
2980
|
}, i = () => {
|
|
2981
|
-
o.dragging && (o.dragging = !1, document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i),
|
|
2981
|
+
o.dragging && (o.dragging = !1, document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), Mi(o));
|
|
2982
2982
|
};
|
|
2983
2983
|
document.addEventListener("pointermove", t), document.addEventListener("pointerup", i), document.addEventListener("pointercancel", i);
|
|
2984
2984
|
}
|
|
2985
|
-
function
|
|
2985
|
+
function Hn(o, e) {
|
|
2986
2986
|
const t = o.area.getBoundingClientRect();
|
|
2987
2987
|
if (!t.width || !t.height) return;
|
|
2988
2988
|
const i = Nt((e.clientX - t.left) / t.width), n = Nt(1 - (e.clientY - t.top) / t.height);
|
|
@@ -2991,7 +2991,7 @@ function Bn(o, e) {
|
|
|
2991
2991
|
function Xd(o, e) {
|
|
2992
2992
|
const t = e.shiftKey ? 0.1 : 0.02;
|
|
2993
2993
|
let i = !0;
|
|
2994
|
-
e.key === "ArrowLeft" ? vt(o, o.hue, o.saturation - t, o.value_) : e.key === "ArrowRight" ? vt(o, o.hue, o.saturation + t, o.value_) : e.key === "ArrowUp" ? vt(o, o.hue, o.saturation, o.value_ + t) : e.key === "ArrowDown" ? vt(o, o.hue, o.saturation, o.value_ - t) : i = !1, i && (e.preventDefault(),
|
|
2994
|
+
e.key === "ArrowLeft" ? vt(o, o.hue, o.saturation - t, o.value_) : e.key === "ArrowRight" ? vt(o, o.hue, o.saturation + t, o.value_) : e.key === "ArrowUp" ? vt(o, o.hue, o.saturation, o.value_ + t) : e.key === "ArrowDown" ? vt(o, o.hue, o.saturation, o.value_ - t) : i = !1, i && (e.preventDefault(), Mi(o));
|
|
2995
2995
|
}
|
|
2996
2996
|
function Zd(o, e) {
|
|
2997
2997
|
vt(o, e, o.saturation, o.value_);
|
|
@@ -3126,7 +3126,7 @@ function qe(o, e, t, i, n = !1) {
|
|
|
3126
3126
|
a("span", { text: r.label })
|
|
3127
3127
|
])));
|
|
3128
3128
|
}
|
|
3129
|
-
function
|
|
3129
|
+
function Qr(o, e, t, i = {}) {
|
|
3130
3130
|
const n = document.createElement("select");
|
|
3131
3131
|
n.className = i.className ?? "pd-select", i.width && (n.style.width = i.width);
|
|
3132
3132
|
for (const r of e) {
|
|
@@ -3149,13 +3149,13 @@ function Qd(o) {
|
|
|
3149
3149
|
function wo(o) {
|
|
3150
3150
|
const e = Ps(o.fonts), t = o.placeholder ?? "默认", i = `font-select-list-${o.id}`, n = (P) => {
|
|
3151
3151
|
const A = P?.trim();
|
|
3152
|
-
return A ?
|
|
3152
|
+
return A ? pn(e, A)?.label ?? A : "";
|
|
3153
3153
|
}, r = (P) => {
|
|
3154
|
-
const A =
|
|
3155
|
-
return e.find((Y) => Y.label &&
|
|
3154
|
+
const A = hn(P);
|
|
3155
|
+
return e.find((Y) => Y.label && hn(Y.label) === A)?.family ?? P;
|
|
3156
3156
|
}, s = () => {
|
|
3157
3157
|
const P = o.value?.trim();
|
|
3158
|
-
return P ?
|
|
3158
|
+
return P ? pn(e, P) ? "" : P : "";
|
|
3159
3159
|
}, l = (P) => {
|
|
3160
3160
|
const A = (o.value ?? "").trim(), W = (X, v, $, re) => ({
|
|
3161
3161
|
kind: X,
|
|
@@ -3167,10 +3167,10 @@ function wo(o) {
|
|
|
3167
3167
|
if (!Y) {
|
|
3168
3168
|
const X = [W("clear", "__clear__", t)], v = s();
|
|
3169
3169
|
v && X.push(W("unknown", "__unknown__", `${v}(未知)`, v));
|
|
3170
|
-
for (const $ of e) X.push(W("font", $.family,
|
|
3170
|
+
for (const $ of e) X.push(W("font", $.family, un($), $.family));
|
|
3171
3171
|
return X;
|
|
3172
3172
|
}
|
|
3173
|
-
const de = Rs(e, Y).map((X) => W("font", X.family,
|
|
3173
|
+
const de = Rs(e, Y).map((X) => W("font", X.family, un(X), X.family));
|
|
3174
3174
|
if (!de.length) {
|
|
3175
3175
|
const X = r(Y);
|
|
3176
3176
|
de.push(W("free", "__free__", `使用「${X}」`, X));
|
|
@@ -3277,7 +3277,7 @@ function He(o, e, t, i, n = {}) {
|
|
|
3277
3277
|
html: `<svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true">${t}</svg>`
|
|
3278
3278
|
});
|
|
3279
3279
|
}
|
|
3280
|
-
const ft = '<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />',
|
|
3280
|
+
const ft = '<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />', Wn = '<rect class="g-solid" x="2.5" y="2.5" width="13" height="13" fill="none" />';
|
|
3281
3281
|
function tc(o) {
|
|
3282
3282
|
const e = o.format;
|
|
3283
3283
|
e.syncBorderDraft();
|
|
@@ -3285,8 +3285,8 @@ function tc(o) {
|
|
|
3285
3285
|
a("div", { class: "ft-border-panel", dataset: { test: "border-panel" } }, [
|
|
3286
3286
|
a("div", { class: "ft-border-grid" }, [
|
|
3287
3287
|
He("preset-none", "无边框", `${ft}<line class="g-solid" x1="4" y1="14" x2="14" y2="4" />`, () => e.applyBorderPreset("none")),
|
|
3288
|
-
He("preset-all", "所有边框", `${
|
|
3289
|
-
He("preset-outer", "外侧边框",
|
|
3288
|
+
He("preset-all", "所有边框", `${Wn}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`, () => e.applyBorderPreset("all")),
|
|
3289
|
+
He("preset-outer", "外侧边框", Wn, () => e.applyBorderPreset("outer")),
|
|
3290
3290
|
He(
|
|
3291
3291
|
"preset-inner",
|
|
3292
3292
|
s ? "内部边框" : "内部边框(仅表格单元格可用)",
|
|
@@ -3478,7 +3478,7 @@ function nc(o) {
|
|
|
3478
3478
|
if (e.leftCollapsed)
|
|
3479
3479
|
return a("div", { class: "left-panel collapsed" }, [
|
|
3480
3480
|
a("div", { class: "left-collapsed" }, [
|
|
3481
|
-
|
|
3481
|
+
Un("»", "展开素材台", () => {
|
|
3482
3482
|
e.leftCollapsed = !1, o.repaint();
|
|
3483
3483
|
}),
|
|
3484
3484
|
...[["elements", "元素", "▦"], ["fields", "字段", "⊛"], ["layers", "图层", "≡"]].map(([i, n, r]) => a("button", {
|
|
@@ -3500,7 +3500,7 @@ function nc(o) {
|
|
|
3500
3500
|
return a("div", { class: "left-panel" }, [
|
|
3501
3501
|
a("div", { class: "left-head" }, [
|
|
3502
3502
|
a("span", { class: "left-title", text: "素材台" }),
|
|
3503
|
-
|
|
3503
|
+
Un("«", "收起素材台", () => {
|
|
3504
3504
|
e.leftCollapsed = !0, o.repaint();
|
|
3505
3505
|
})
|
|
3506
3506
|
]),
|
|
@@ -3521,7 +3521,7 @@ function nc(o) {
|
|
|
3521
3521
|
])
|
|
3522
3522
|
]);
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3524
|
+
function Un(o, e, t) {
|
|
3525
3525
|
return a("button", { type: "button", class: "collapse-btn", title: e, text: o, onClick: t });
|
|
3526
3526
|
}
|
|
3527
3527
|
function rc() {
|
|
@@ -3539,7 +3539,7 @@ function rc() {
|
|
|
3539
3539
|
];
|
|
3540
3540
|
}
|
|
3541
3541
|
function ac(o) {
|
|
3542
|
-
const e = o.state, t =
|
|
3542
|
+
const e = o.state, t = Er(o.store.fields), i = (e.fieldSearch ?? "").trim().toLowerCase(), n = i ? t.map((r) => ({ ...r, fields: r.fields.filter((s) => `${s.fieldLabel}${s.fieldKey}`.toLowerCase().includes(i)) })).filter((r) => r.fields.length) : t;
|
|
3543
3543
|
return a("div", { class: "field-tree-panel" }, [
|
|
3544
3544
|
a("div", { class: "panel-title", text: "业务字段" }),
|
|
3545
3545
|
a("input", {
|
|
@@ -3776,7 +3776,7 @@ function hc(o) {
|
|
|
3776
3776
|
...i ?? {},
|
|
3777
3777
|
enabled: i?.enabled ?? !1,
|
|
3778
3778
|
sheetMargin: { ...$e.sheetMargin, ...i?.sheetMargin ?? {} }
|
|
3779
|
-
}, r =
|
|
3779
|
+
}, r = Cr(t.paperSize), s = (g) => e.updateTemplateData({ tiling: { ...n, ...g } }), l = (g) => it({
|
|
3780
3780
|
target: n,
|
|
3781
3781
|
base: $e,
|
|
3782
3782
|
propKey: g,
|
|
@@ -3786,11 +3786,11 @@ function hc(o) {
|
|
|
3786
3786
|
base: $e.sheetMargin,
|
|
3787
3787
|
propKey: g,
|
|
3788
3788
|
write: () => p(g, $e.sheetMargin[g])
|
|
3789
|
-
}), p = (g, y) => s({ sheetMargin: { ...n.sheetMargin, [g]: y ?? 0 } }), u = { ...t, tiling: n }, f =
|
|
3789
|
+
}), p = (g, y) => s({ sheetMargin: { ...n.sheetMargin, [g]: y ?? 0 } }), u = { ...t, tiling: n }, f = zr(u), m = Math.max(Pr(u), 1);
|
|
3790
3790
|
let x = "";
|
|
3791
3791
|
if (!f.length)
|
|
3792
3792
|
try {
|
|
3793
|
-
const g = Is(u), y =
|
|
3793
|
+
const g = Is(u), y = fn(u), S = n.sheetPaperSize === "CUSTOM" ? "自定义" : n.sheetPaperSize ?? "A4", T = n.sheetPaperSize === "CUSTOM" ? "" : n.sheetOrientation === "landscape" ? " 横向" : " 纵向";
|
|
3794
3794
|
x = `目标纸 ${S}${T} ${y.width}×${y.height}mm · ${g.columns} 列 × ${g.rows} 行 = 每张 ${g.perSheet} 格 · 每格 ${g.tile.width}×${g.tile.height}mm`;
|
|
3795
3795
|
} catch {
|
|
3796
3796
|
x = "";
|
|
@@ -3826,7 +3826,7 @@ function hc(o) {
|
|
|
3826
3826
|
s({ sheetPaperSize: y });
|
|
3827
3827
|
return;
|
|
3828
3828
|
}
|
|
3829
|
-
const S =
|
|
3829
|
+
const S = fn(u);
|
|
3830
3830
|
s({
|
|
3831
3831
|
sheetPaperSize: "CUSTOM",
|
|
3832
3832
|
sheetCustomWidth: n.sheetCustomWidth ?? S.width,
|
|
@@ -3865,48 +3865,48 @@ function hc(o) {
|
|
|
3865
3865
|
] : ""
|
|
3866
3866
|
].flat().filter(Boolean));
|
|
3867
3867
|
}
|
|
3868
|
-
const fc = new Set(qa.map((o) => o.group)), mc = { "table-settings": "content" },
|
|
3869
|
-
function
|
|
3868
|
+
const fc = new Set(qa.map((o) => o.group)), mc = { "table-settings": "content" }, Gn = /* @__PURE__ */ new Map();
|
|
3869
|
+
function _i(o) {
|
|
3870
3870
|
const e = o ?? "";
|
|
3871
|
-
let t =
|
|
3871
|
+
let t = Gn.get(e);
|
|
3872
3872
|
if (!t) {
|
|
3873
3873
|
const { groups: i, itemKeys: n } = ja(e);
|
|
3874
|
-
t = { groups: i, keys: n, searching: !!e.trim() },
|
|
3874
|
+
t = { groups: i, keys: n, searching: !!e.trim() }, Gn.set(e, t);
|
|
3875
3875
|
}
|
|
3876
3876
|
return t;
|
|
3877
3877
|
}
|
|
3878
|
-
function
|
|
3878
|
+
function zi(o) {
|
|
3879
3879
|
const e = mc[o] ?? o;
|
|
3880
3880
|
return fc.has(e) ? e : "";
|
|
3881
3881
|
}
|
|
3882
3882
|
function gc(o, e) {
|
|
3883
|
-
const t =
|
|
3883
|
+
const t = _i(o.state.propSearch);
|
|
3884
3884
|
if (!t.searching) return !0;
|
|
3885
|
-
const i =
|
|
3885
|
+
const i = zi(e);
|
|
3886
3886
|
return !i || t.groups.includes(i);
|
|
3887
3887
|
}
|
|
3888
3888
|
function bc(o, e) {
|
|
3889
|
-
const t =
|
|
3889
|
+
const t = _i(o.state.propSearch);
|
|
3890
3890
|
return !t.searching || t.keys.has(e);
|
|
3891
3891
|
}
|
|
3892
|
-
function
|
|
3892
|
+
function Jr(o, e) {
|
|
3893
3893
|
const t = o.props.style ?? {};
|
|
3894
3894
|
return o.props.style = { ...t, display: e ? "" : "none" }, o;
|
|
3895
3895
|
}
|
|
3896
3896
|
function D(o, e, t) {
|
|
3897
3897
|
const i = t.props.dataset ?? {};
|
|
3898
|
-
return t.props.dataset = { ...i, propKey: e },
|
|
3898
|
+
return t.props.dataset = { ...i, propKey: e }, Jr(t, bc(o, e));
|
|
3899
3899
|
}
|
|
3900
3900
|
function xc(o, e, t) {
|
|
3901
|
-
const i =
|
|
3901
|
+
const i = zi(e);
|
|
3902
3902
|
if (!i) return t;
|
|
3903
3903
|
const n = t.props.dataset ?? {};
|
|
3904
|
-
return t.props.dataset = { ...n, propGroup: i },
|
|
3904
|
+
return t.props.dataset = { ...n, propGroup: i }, Jr(t, gc(o, e));
|
|
3905
3905
|
}
|
|
3906
|
-
function
|
|
3907
|
-
const t =
|
|
3906
|
+
function ea(o, e) {
|
|
3907
|
+
const t = _i(e);
|
|
3908
3908
|
for (const i of Array.from(o.querySelectorAll("[data-prop-group]"))) {
|
|
3909
|
-
const n =
|
|
3909
|
+
const n = zi(i.dataset.propGroup ?? "");
|
|
3910
3910
|
i.style.display = !t.searching || !n || t.groups.includes(n) ? "" : "none";
|
|
3911
3911
|
}
|
|
3912
3912
|
for (const i of Array.from(o.querySelectorAll("[data-prop-key]")))
|
|
@@ -3922,7 +3922,7 @@ function vc(o) {
|
|
|
3922
3922
|
value: o.state.propSearch ?? "",
|
|
3923
3923
|
onInput: (e) => {
|
|
3924
3924
|
const t = e.target, i = t.value;
|
|
3925
|
-
o.state.propSearch = i,
|
|
3925
|
+
o.state.propSearch = i, ea(t.getRootNode(), i);
|
|
3926
3926
|
}
|
|
3927
3927
|
})
|
|
3928
3928
|
]);
|
|
@@ -3969,7 +3969,7 @@ function xe(o, e, t, i, n, r = !0) {
|
|
|
3969
3969
|
function So(o) {
|
|
3970
3970
|
return a("form", { class: "pd-form", onSubmit: (e) => e.preventDefault() }, o.filter(Boolean));
|
|
3971
3971
|
}
|
|
3972
|
-
function
|
|
3972
|
+
function ta(o) {
|
|
3973
3973
|
return o.split(".").flatMap((e) => {
|
|
3974
3974
|
const t = e.match(/^([^\[]+)((?:\[\d+\])*)$/);
|
|
3975
3975
|
if (!t) return [e];
|
|
@@ -3977,14 +3977,14 @@ function ea(o) {
|
|
|
3977
3977
|
return [i, ...n];
|
|
3978
3978
|
});
|
|
3979
3979
|
}
|
|
3980
|
-
function
|
|
3981
|
-
return
|
|
3980
|
+
function qn(o, e) {
|
|
3981
|
+
return ta(e).reduce(
|
|
3982
3982
|
(n, r) => n == null ? "" : n[r],
|
|
3983
3983
|
o
|
|
3984
3984
|
) ?? "";
|
|
3985
3985
|
}
|
|
3986
|
-
function
|
|
3987
|
-
const n =
|
|
3986
|
+
function Pi(o, e, t, i) {
|
|
3987
|
+
const n = ta(t), r = n.pop(), s = n.reduce(
|
|
3988
3988
|
(l, c) => ((l[c] === void 0 || l[c] === null) && (l[c] = {}), l[c]),
|
|
3989
3989
|
e
|
|
3990
3990
|
);
|
|
@@ -4023,7 +4023,7 @@ function Tc(o, e) {
|
|
|
4023
4023
|
r(!0), i.textContent = "上传中...";
|
|
4024
4024
|
try {
|
|
4025
4025
|
const u = await p(c);
|
|
4026
|
-
u ?
|
|
4026
|
+
u ? Pi(o.store, e, "options.src", u) : alert("图片上传失败");
|
|
4027
4027
|
} catch (u) {
|
|
4028
4028
|
alert(u instanceof Error ? u.message : "图片上传失败");
|
|
4029
4029
|
} finally {
|
|
@@ -4039,7 +4039,7 @@ function Ec(o, e) {
|
|
|
4039
4039
|
const t = (i) => o.fire("open-expression", {
|
|
4040
4040
|
elementId: e.id,
|
|
4041
4041
|
targetPath: i.targetPath,
|
|
4042
|
-
value:
|
|
4042
|
+
value: qn(e, i.targetPath)
|
|
4043
4043
|
});
|
|
4044
4044
|
return xe(o, "binding", "内容", "Document", [
|
|
4045
4045
|
...kc(o, e).map((i) => N(
|
|
@@ -4047,10 +4047,10 @@ function Ec(o, e) {
|
|
|
4047
4047
|
a("input", {
|
|
4048
4048
|
class: "pd-input",
|
|
4049
4049
|
type: "text",
|
|
4050
|
-
value:
|
|
4050
|
+
value: qn(e, i.targetPath),
|
|
4051
4051
|
placeholder: i.placeholder || "输入内容,支持 {字段} 表达式",
|
|
4052
4052
|
// canvas 用 @input 实时写回;本包整体重绘会打断输入,改为 change(提交时机不同,结果一致)
|
|
4053
|
-
onChange: (n) =>
|
|
4053
|
+
onChange: (n) => Pi(o.store, e, i.targetPath, n.target.value),
|
|
4054
4054
|
onDblclick: () => t(i)
|
|
4055
4055
|
})
|
|
4056
4056
|
)),
|
|
@@ -4061,7 +4061,7 @@ const zt = /* @__PURE__ */ new Map();
|
|
|
4061
4061
|
function so(o) {
|
|
4062
4062
|
return `${Math.round(o * 1e4) / 1e4}%`;
|
|
4063
4063
|
}
|
|
4064
|
-
function
|
|
4064
|
+
function oa(o, e) {
|
|
4065
4065
|
const t = Va(e.value), i = t.kind === "custom", n = t.kind === "axes" ? t.x : 50, r = t.kind === "axes" ? t.y : 50, s = Xa(e.src), l = zt.get(s.src), c = {
|
|
4066
4066
|
widthMm: e.widthMm,
|
|
4067
4067
|
heightMm: e.heightMm,
|
|
@@ -4082,7 +4082,7 @@ function ta(o, e) {
|
|
|
4082
4082
|
f.value = i ? "custom" : `${n},${r}`, f.selectedIndex < 0 && (f.selectedIndex = i ? f.options.length - 1 : 0), f.addEventListener("change", () => {
|
|
4083
4083
|
if (f.value === "custom") return;
|
|
4084
4084
|
const [y, S] = f.value.split(",").map(Number);
|
|
4085
|
-
e.onCommit(
|
|
4085
|
+
e.onCommit(rn(y, S));
|
|
4086
4086
|
});
|
|
4087
4087
|
const m = he(e.fieldKey), x = [a("div", { class: "pd-field", dataset: { field: e.fieldKey } }, [
|
|
4088
4088
|
a("span", { class: "pd-label" }, [a("span", { class: "pd-label-t" }, [e.label, ui(m)]), e.resetAnchor ?? ""].filter(Boolean)),
|
|
@@ -4092,11 +4092,11 @@ function ta(o, e) {
|
|
|
4092
4092
|
a("span", { class: "pd-label" }, [a("span", { class: "pd-label-t" }, [es, ui(he("ap-img-fit-scale"))]), e.resetScale ?? ""].filter(Boolean)),
|
|
4093
4093
|
I({
|
|
4094
4094
|
value: e.scale,
|
|
4095
|
-
min:
|
|
4095
|
+
min: an,
|
|
4096
4096
|
max: ts,
|
|
4097
4097
|
step: 5,
|
|
4098
4098
|
placeholder: "默认 100",
|
|
4099
|
-
onCommit: (y) => e.onScaleCommit(y >
|
|
4099
|
+
onCommit: (y) => e.onScaleCommit(y > an ? y : void 0)
|
|
4100
4100
|
})
|
|
4101
4101
|
]));
|
|
4102
4102
|
for (const y of os(p, n, r))
|
|
@@ -4107,7 +4107,7 @@ function ta(o, e) {
|
|
|
4107
4107
|
min: 0,
|
|
4108
4108
|
max: 100,
|
|
4109
4109
|
step: 1,
|
|
4110
|
-
onCommit: (S) => e.onCommit(
|
|
4110
|
+
onCommit: (S) => e.onCommit(rn(y.name === "horizontal" ? S : n, y.name === "vertical" ? S : r))
|
|
4111
4111
|
})
|
|
4112
4112
|
]));
|
|
4113
4113
|
const g = is(p, i);
|
|
@@ -4145,7 +4145,7 @@ function wt(o, e, t, i, n) {
|
|
|
4145
4145
|
})
|
|
4146
4146
|
]);
|
|
4147
4147
|
}
|
|
4148
|
-
function
|
|
4148
|
+
function ia(o, e, t, i, n = !1, r) {
|
|
4149
4149
|
return a("div", { class: "pd-field" }, [
|
|
4150
4150
|
a("span", { class: "pd-label" }, [a("span", { class: "pd-label-t", text: o }), ""].filter(Boolean)),
|
|
4151
4151
|
a("select", {
|
|
@@ -4158,7 +4158,7 @@ function oa(o, e, t, i, n = !1, r) {
|
|
|
4158
4158
|
function Pt(o, e, t, i, n = {}) {
|
|
4159
4159
|
return a("div", { class: "pd-field" }, [
|
|
4160
4160
|
a("span", { class: "pd-label" }, [a("span", { class: "pd-label-t", text: o }), n.reset ?? ""].filter(Boolean)),
|
|
4161
|
-
|
|
4161
|
+
Qr(e, t, i, {
|
|
4162
4162
|
className: "pd-select",
|
|
4163
4163
|
...n.full ? { width: "100%" } : {}
|
|
4164
4164
|
})
|
|
@@ -4192,8 +4192,8 @@ function Pc(o, e) {
|
|
|
4192
4192
|
const s = (l) => t.updateElement(e.id, l);
|
|
4193
4193
|
return xe(o, "table-row", "行属性", "Grid", [
|
|
4194
4194
|
So([
|
|
4195
|
-
|
|
4196
|
-
const c =
|
|
4195
|
+
ia("行类型", r.type, Ac, (l) => {
|
|
4196
|
+
const c = vi(n, i.r1, l);
|
|
4197
4197
|
if (c) {
|
|
4198
4198
|
window.alert(c);
|
|
4199
4199
|
return;
|
|
@@ -4219,7 +4219,7 @@ function Pc(o, e) {
|
|
|
4219
4219
|
]);
|
|
4220
4220
|
}
|
|
4221
4221
|
function Rc(o, e) {
|
|
4222
|
-
const t = o.store, i = e.options, n = (u) => t.updateElement(e.id, u), r = i.tableColWidths ?? [], s = t.paperSize.width - t.templateData.margins.left - t.templateData.margins.right, l = t.fields.filter((u) => u.fieldType === "list").map((u) => ({ value: u.fieldKey, label: u.fieldLabel })), c =
|
|
4222
|
+
const t = o.store, i = e.options, n = (u) => t.updateElement(e.id, u), r = i.tableColWidths ?? [], s = t.paperSize.width - t.templateData.margins.left - t.templateData.margins.right, l = t.fields.filter((u) => u.fieldType === "list").map((u) => ({ value: u.fieldKey, label: u.fieldLabel })), c = _r("table"), p = (u) => it({
|
|
4223
4223
|
target: i,
|
|
4224
4224
|
base: c,
|
|
4225
4225
|
propKey: u,
|
|
@@ -4227,7 +4227,7 @@ function Rc(o, e) {
|
|
|
4227
4227
|
});
|
|
4228
4228
|
return xe(o, "table-settings", "表格设置", "Grid", [
|
|
4229
4229
|
So([
|
|
4230
|
-
|
|
4230
|
+
ia("列表数据源字段", i.dataSource ?? "", l, (u) => n({ dataSource: u || void 0 }), !0),
|
|
4231
4231
|
a("div", { class: "pd-field" }, [
|
|
4232
4232
|
a("span", { class: "pd-label" }, [a("span", { class: "pd-label-t", text: "默认字体" }), p("tableDefaultFontFamily")]),
|
|
4233
4233
|
wo({
|
|
@@ -4309,7 +4309,7 @@ function Ic(o, e) {
|
|
|
4309
4309
|
}
|
|
4310
4310
|
return xe(o, "pagination", "分页配置", "Document", [So(s)], !1);
|
|
4311
4311
|
}
|
|
4312
|
-
const Ko = /* @__PURE__ */ new WeakMap(),
|
|
4312
|
+
const Ko = /* @__PURE__ */ new WeakMap(), jn = [
|
|
4313
4313
|
{ value: "top", label: "上" },
|
|
4314
4314
|
{ value: "right", label: "右" },
|
|
4315
4315
|
{ value: "bottom", label: "下" },
|
|
@@ -4318,7 +4318,7 @@ const Ko = /* @__PURE__ */ new WeakMap(), qn = [
|
|
|
4318
4318
|
function Fc(o, e) {
|
|
4319
4319
|
const t = o.store, i = t.tableSelection, n = e.options.tableRows ?? [];
|
|
4320
4320
|
if (!i) return xe(o, "table-cell", "单元格", "Menu", []);
|
|
4321
|
-
const r =
|
|
4321
|
+
const r = Ar(n, i.r1, i.c1), s = n[r.r]?.cells[r.c];
|
|
4322
4322
|
if (!s) return xe(o, "table-cell", "单元格", "Menu", []);
|
|
4323
4323
|
const l = () => as(n, i), c = bi(n, i), p = c.count, u = c.mode === "multi", f = `${e.id}:${i.r1}:${i.c1}:${i.r2}:${i.c2}`, m = Ko.get(t), x = m?.key === f ? m : { key: f, border: {}, values: {}, edges: {} };
|
|
4324
4324
|
m?.key !== f && Ko.set(t, x);
|
|
@@ -4337,7 +4337,7 @@ function Fc(o, e) {
|
|
|
4337
4337
|
S((Z) => {
|
|
4338
4338
|
Z[b] = F;
|
|
4339
4339
|
}, { [b]: F });
|
|
4340
|
-
}, _ = (b) => u ? x.values[b] : s[b], B = (b) => u && b in x.values, z = u ? { width: void 0, style: void 0, color: void 0 } :
|
|
4340
|
+
}, _ = (b) => u ? x.values[b] : s[b], B = (b) => u && b in x.values, z = u ? { width: void 0, style: void 0, color: void 0 } : rr(n, i), ie = !u && l().some((b) => !!b.borders && !!(b.borders.top || b.borders.right || b.borders.bottom || b.borders.left)), ye = !u && !ie, j = {
|
|
4341
4341
|
width: ye ? 0 : typeof z.width == "number" ? z.width : no.width,
|
|
4342
4342
|
style: ye ? "none" : typeof z.style == "string" && z.style !== "mixed" ? z.style : no.style,
|
|
4343
4343
|
color: typeof z.color == "string" && z.color !== "mixed" ? z.color : no.color,
|
|
@@ -4349,7 +4349,7 @@ function Fc(o, e) {
|
|
|
4349
4349
|
}, W = A.style && !("style" in x.border), Y = A.width && !("width" in x.border), de = A.color && !("color" in x.border), X = W || Y || de, v = W ? P : j.style, $ = Y ? void 0 : j.width, re = de ? void 0 : j.color, Ie = (b) => {
|
|
4350
4350
|
const F = { style: b };
|
|
4351
4351
|
b !== "none" && $ === 0 ? F.width = no.width : b === "none" && !ie && (F.width = 0), g({ border: { ...x.border, ...F } }), o.repaint();
|
|
4352
|
-
}, R = () => ({ ...j }), J = u ?
|
|
4352
|
+
}, R = () => ({ ...j }), J = u ? jn.reduce((b, F) => (b[F.value] = x.edges[F.value] ? "on" : "off", b), {}) : cr(l().map((b) => b.borders)), je = u ? "cellType" in x.values ? x.values.cellType ?? "text" : rs(n, i) : s.cellType ?? "text", ce = je === "barcode", Ye = je === "qrcode", nt = je === "image", H = je === "text", ko = ce && !!_("printerDpi"), Ht = Dr(_("printerDpi"), _("barWidth")), Wt = u ? x.values.textFit : wr(s), To = u ? "cellType" in x.values ? x.values.cellType ?? "text" : "" : s.cellType || "text", Ke = (b) => u ? [zc, ...b] : b, we = (b) => u ? "多选" : b, Se = (b, F) => u ? x.values[b] : F, Eo = u ? _("barcodeType") ?? "__multi__" : s.barcodeType || "CODE128", Ut = u ? B("printerDpi") ? _("printerDpi") ? String(_("printerDpi")) : "" : "__multi__" : s.printerDpi ? String(s.printerDpi) : "", U = u ? _("qrCodeLevel") ?? "__multi__" : s.qrCodeLevel || "M", kt = u ? _("fit") ?? "__multi__" : s.fit || "contain", G = Wt ?? "__multi__", rt = gr(n, i);
|
|
4353
4353
|
let pe = !1;
|
|
4354
4354
|
for (let b = i.r1; b <= i.r2 && !pe; b++)
|
|
4355
4355
|
for (let F = i.c1; F <= i.c2 && !pe; F++) {
|
|
@@ -4368,8 +4368,8 @@ function Fc(o, e) {
|
|
|
4368
4368
|
// 走 writeField 而非 write:多选时要同时清掉批写草稿,否则控件会继续显示重置前的值
|
|
4369
4369
|
write: () => T(b, void 0)
|
|
4370
4370
|
}), Tt = e.options.tableDefaultPadding ?? 1, at = {
|
|
4371
|
-
width:
|
|
4372
|
-
height:
|
|
4371
|
+
width: yr(e.options.tableColWidths ?? [], r.c, s, Tt),
|
|
4372
|
+
height: vr(n, r.r, s, Tt)
|
|
4373
4373
|
};
|
|
4374
4374
|
return xe(o, "table-cell", "单元格", "Menu", [
|
|
4375
4375
|
So([
|
|
@@ -4477,10 +4477,10 @@ function Fc(o, e) {
|
|
|
4477
4477
|
},
|
|
4478
4478
|
{ reset: L("fit") }
|
|
4479
4479
|
) : "",
|
|
4480
|
-
nt && !u && s.fit === "cover" ?
|
|
4480
|
+
nt && !u && s.fit === "cover" ? oa(o, {
|
|
4481
4481
|
fieldKey: "ap-img-object-position",
|
|
4482
4482
|
label: "裁剪锚点",
|
|
4483
|
-
src:
|
|
4483
|
+
src: Mr(s.formatter),
|
|
4484
4484
|
fit: s.fit,
|
|
4485
4485
|
containerClass: "pd-cell-anchor",
|
|
4486
4486
|
widthMm: at.width,
|
|
@@ -4588,7 +4588,7 @@ function Fc(o, e) {
|
|
|
4588
4588
|
Re("边框"),
|
|
4589
4589
|
a("div", { class: "border-style-row" }, [
|
|
4590
4590
|
// 裸下拉必须显式赋值当前值(只靠 <option selected> 在内核不一致时会回落到第二项)
|
|
4591
|
-
|
|
4591
|
+
Qr(
|
|
4592
4592
|
v,
|
|
4593
4593
|
[
|
|
4594
4594
|
...W ? [{ value: P, label: "混合", disabled: !0 }] : [],
|
|
@@ -4620,10 +4620,10 @@ function Fc(o, e) {
|
|
|
4620
4620
|
text: F,
|
|
4621
4621
|
// 线型=无 ⇒ 预设就是清边框(不写一条隐形的 none 边)
|
|
4622
4622
|
onClick: () => {
|
|
4623
|
-
|
|
4623
|
+
sr(n, i, j.style === "none" ? "none" : b, R()), t.updateElement(e.id, { tableRows: n });
|
|
4624
4624
|
}
|
|
4625
4625
|
}))),
|
|
4626
|
-
a("div", { class: "pd-checkbox-group" },
|
|
4626
|
+
a("div", { class: "pd-checkbox-group" }, jn.map((b) => a("label", { class: "pd-checkbox" }, [
|
|
4627
4627
|
a("input", {
|
|
4628
4628
|
type: "checkbox",
|
|
4629
4629
|
value: b.value,
|
|
@@ -4632,7 +4632,7 @@ function Fc(o, e) {
|
|
|
4632
4632
|
onChange: (F) => {
|
|
4633
4633
|
const ee = F.target.checked && j.style !== "none";
|
|
4634
4634
|
u && g({ edges: { ...x.edges, [b.value]: ee } }), S((De) => {
|
|
4635
|
-
|
|
4635
|
+
lr(De, b.value, ee ? R() : null);
|
|
4636
4636
|
});
|
|
4637
4637
|
}
|
|
4638
4638
|
}),
|
|
@@ -4677,7 +4677,7 @@ function Fc(o, e) {
|
|
|
4677
4677
|
disabled: !!rt,
|
|
4678
4678
|
title: rt || "",
|
|
4679
4679
|
onClick: () => {
|
|
4680
|
-
|
|
4680
|
+
kr(n, i), t.updateElement(e.id, { tableRows: n });
|
|
4681
4681
|
}
|
|
4682
4682
|
}),
|
|
4683
4683
|
a("button", {
|
|
@@ -4686,7 +4686,7 @@ function Fc(o, e) {
|
|
|
4686
4686
|
text: "拆分单元格",
|
|
4687
4687
|
disabled: !pe,
|
|
4688
4688
|
onClick: () => {
|
|
4689
|
-
|
|
4689
|
+
Sr(n, i), t.updateElement(e.id, { tableRows: n });
|
|
4690
4690
|
}
|
|
4691
4691
|
})
|
|
4692
4692
|
])
|
|
@@ -4882,7 +4882,7 @@ function Bc(o, e) {
|
|
|
4882
4882
|
])
|
|
4883
4883
|
])
|
|
4884
4884
|
]));
|
|
4885
|
-
const m =
|
|
4885
|
+
const m = _r(n), x = (v, $) => {
|
|
4886
4886
|
const re = bs($);
|
|
4887
4887
|
return it({
|
|
4888
4888
|
target: i,
|
|
@@ -4892,7 +4892,7 @@ function Bc(o, e) {
|
|
|
4892
4892
|
tipUnit: re?.unit,
|
|
4893
4893
|
write: () => r({ [v]: m[v] })
|
|
4894
4894
|
});
|
|
4895
|
-
}, g = typeof i.rotate == "number" && Number.isFinite(i.rotate) && i.rotate !== 0 ?
|
|
4895
|
+
}, g = typeof i.rotate == "number" && Number.isFinite(i.rotate) && i.rotate !== 0 ? sn(i.rotate) : void 0, y = (v) => r({ rotate: v === void 0 || v === 0 ? void 0 : sn(v) }), S = ps(n, i), T = us(n) || hs(t.elements).has(e.id), _ = T ? "" : D(o, "ap-rotate", Ce(
|
|
4896
4896
|
"旋转 (°)",
|
|
4897
4897
|
a("div", { class: "pd-rotate-row" }, [
|
|
4898
4898
|
a("button", {
|
|
@@ -4957,7 +4957,7 @@ function Bc(o, e) {
|
|
|
4957
4957
|
]),
|
|
4958
4958
|
D(o, "ap-line-height", le(o, "行高", i.lineHeight, (v) => r({ lineHeight: v || void 0 }), { min: 0, max: 100 }, x("lineHeight", "ap-line-height"))),
|
|
4959
4959
|
D(o, "ap-letter-spacing", le(o, "字间距", i.letterSpacing, (v) => r({ letterSpacing: v || void 0 }), { min: 0, max: 20, step: 0.5 }, x("letterSpacing", "ap-letter-spacing"))),
|
|
4960
|
-
D(o, "ap-text-fit", We(o, "文字溢出",
|
|
4960
|
+
D(o, "ap-text-fit", We(o, "文字溢出", yi(n, i), [
|
|
4961
4961
|
{ value: "clip", label: "截断" },
|
|
4962
4962
|
{ value: "shrink", label: "自动缩小" },
|
|
4963
4963
|
{ value: "autoHeight", label: "自适应行高" }
|
|
@@ -4987,10 +4987,10 @@ function Bc(o, e) {
|
|
|
4987
4987
|
x("fit", "ap-img-fit")
|
|
4988
4988
|
)) : "",
|
|
4989
4989
|
// 只有剪裁档有「被裁掉的那条边」可挪,其余档不出这一行(与 canvas AppearanceGroup、两端单元格台同一门禁)
|
|
4990
|
-
n === "image" && i.fit === "cover" ? D(o, "ap-img-object-position",
|
|
4990
|
+
n === "image" && i.fit === "cover" ? D(o, "ap-img-object-position", oa(o, {
|
|
4991
4991
|
fieldKey: "ap-img-object-position",
|
|
4992
4992
|
label: "裁剪锚点",
|
|
4993
|
-
src:
|
|
4993
|
+
src: Mr(i.src),
|
|
4994
4994
|
widthMm: Number(i.width) || 0,
|
|
4995
4995
|
heightMm: Number(i.height) || 0,
|
|
4996
4996
|
fit: i.fit,
|
|
@@ -5007,7 +5007,7 @@ function Bc(o, e) {
|
|
|
5007
5007
|
n === "flowList" ? a("p", { class: "pd-empty", text: "当前元素不支持外观设置" }) : ""
|
|
5008
5008
|
].filter(Boolean))
|
|
5009
5009
|
])), l) {
|
|
5010
|
-
const v = n === "barcode", $ = String(i.barcodeType || "CODE128").toUpperCase(), re = i.printerDpi ? String(i.printerDpi) : "", Ie =
|
|
5010
|
+
const v = n === "barcode", $ = String(i.barcodeType || "CODE128").toUpperCase(), re = i.printerDpi ? String(i.printerDpi) : "", Ie = Dr(i.printerDpi, i.barWidth);
|
|
5011
5011
|
f.push(xe(o, "code", "条码设置", "Postcard", [
|
|
5012
5012
|
a("form", { class: "pd-form", onSubmit: (R) => R.preventDefault() }, [
|
|
5013
5013
|
v ? [
|
|
@@ -5155,10 +5155,10 @@ function Bc(o, e) {
|
|
|
5155
5155
|
borders: i.borders
|
|
5156
5156
|
}), ie = (v) => {
|
|
5157
5157
|
const $ = z();
|
|
5158
|
-
|
|
5158
|
+
ar($, v, ys($)), r($);
|
|
5159
5159
|
}, ye = (v) => {
|
|
5160
5160
|
const $ = z();
|
|
5161
|
-
ei($, v, !
|
|
5161
|
+
ei($, v, !ln($, v)), r($);
|
|
5162
5162
|
}, j = ms(i), P = j.style === "mixed", A = typeof j.width == "number" ? j.width : void 0, W = P || j.style === void 0 ? "" : j.style, Y = typeof j.color == "string" ? j.color : void 0, de = (v, $) => {
|
|
5163
5163
|
const re = z();
|
|
5164
5164
|
vs(re, v, $), r(re);
|
|
@@ -5195,7 +5195,7 @@ function Bc(o, e) {
|
|
|
5195
5195
|
a("div", { class: "pd-checkbox-group" }, $c.map((v) => a("label", { class: "pd-checkbox" }, [
|
|
5196
5196
|
a("input", {
|
|
5197
5197
|
type: "checkbox",
|
|
5198
|
-
checked:
|
|
5198
|
+
checked: ln(i, v.value),
|
|
5199
5199
|
onChange: () => ye(v.value)
|
|
5200
5200
|
}),
|
|
5201
5201
|
a("span", { text: v.label })
|
|
@@ -5226,7 +5226,7 @@ function Hc(o) {
|
|
|
5226
5226
|
const e = o.store, t = e.templateData, i = (c) => e.updateTemplateData(c), n = (c) => {
|
|
5227
5227
|
const p = t.tiling, u = (f) => f === 90 || f === 270;
|
|
5228
5228
|
if (p?.enabled && u(c) !== u(t.outputRotation)) {
|
|
5229
|
-
const f =
|
|
5229
|
+
const f = Pr({ ...t, outputRotation: c });
|
|
5230
5230
|
i({ outputRotation: c, tiling: { ...p, columns: Math.max(f, 1) } });
|
|
5231
5231
|
return;
|
|
5232
5232
|
}
|
|
@@ -5237,7 +5237,7 @@ function Hc(o) {
|
|
|
5237
5237
|
let f = r.find((m) => m.group === u);
|
|
5238
5238
|
f || (f = { group: u, items: [] }, r.push(f)), f.items.push({ key: c, label: p.label ?? c });
|
|
5239
5239
|
}
|
|
5240
|
-
const s = !St[t.paperSize], l =
|
|
5240
|
+
const s = !St[t.paperSize], l = Cr(t.paperSize);
|
|
5241
5241
|
return a("form", { class: "pd-form", onSubmit: (c) => c.preventDefault() }, [
|
|
5242
5242
|
Re("纸张设置"),
|
|
5243
5243
|
N("纸张尺寸", a("select", {
|
|
@@ -5377,7 +5377,7 @@ const Xo = [
|
|
|
5377
5377
|
{ key: "field", text: "📁 字段" },
|
|
5378
5378
|
{ key: "variable", text: "🔧 变量" },
|
|
5379
5379
|
{ key: "function", text: "⚡ 函数" }
|
|
5380
|
-
],
|
|
5380
|
+
], Yn = {
|
|
5381
5381
|
field: "搜索字段...",
|
|
5382
5382
|
variable: "搜索变量...",
|
|
5383
5383
|
function: "搜索函数..."
|
|
@@ -5411,7 +5411,7 @@ const Xo = [
|
|
|
5411
5411
|
{ title: "数值运算", items: Gc },
|
|
5412
5412
|
{ title: "格式化函数", items: qc }
|
|
5413
5413
|
], Kc = "(输入表达式后预览)", Vc = "(无法计算)", mi = "(表达式错误)";
|
|
5414
|
-
function
|
|
5414
|
+
function Kn(o, e) {
|
|
5415
5415
|
if (!o.trim()) return Kc;
|
|
5416
5416
|
try {
|
|
5417
5417
|
const t = { ...Ge, ...e ?? {}, ...Ls() }, i = Ot(o, t);
|
|
@@ -5420,7 +5420,7 @@ function Yn(o, e) {
|
|
|
5420
5420
|
return mi;
|
|
5421
5421
|
}
|
|
5422
5422
|
}
|
|
5423
|
-
function
|
|
5423
|
+
function Vn(o, e) {
|
|
5424
5424
|
const t = e.trim().toLowerCase();
|
|
5425
5425
|
return t ? o.filter((i) => i.label.toLowerCase().includes(t) || i.name.toLowerCase().includes(t)) : o;
|
|
5426
5426
|
}
|
|
@@ -5496,11 +5496,11 @@ function Jc(o, e) {
|
|
|
5496
5496
|
}, i = (g, y) => g.querySelector(y), n = (g) => {
|
|
5497
5497
|
const y = i(g, ".ee-preview");
|
|
5498
5498
|
if (!y) return;
|
|
5499
|
-
const S =
|
|
5499
|
+
const S = Kn(t.expression, o.demoData);
|
|
5500
5500
|
y.textContent = S, y.classList.toggle("ee-preview-error", S === mi);
|
|
5501
5501
|
}, r = () => {
|
|
5502
5502
|
if (t.activeTab === "variable")
|
|
5503
|
-
return
|
|
5503
|
+
return Vn(jc, t.searchText).map((S) => a("div", {
|
|
5504
5504
|
class: "ee-list-item",
|
|
5505
5505
|
onDblclick: (T) => {
|
|
5506
5506
|
const { insideParens: _ } = l(T);
|
|
@@ -5510,7 +5510,7 @@ function Jc(o, e) {
|
|
|
5510
5510
|
if (t.activeTab === "function")
|
|
5511
5511
|
return Yc.map((S) => a("div", { class: "ee-func-group" }, [
|
|
5512
5512
|
a("div", { class: "ee-func-group-title", text: S.title }),
|
|
5513
|
-
...
|
|
5513
|
+
...Vn(S.items, t.searchText).map((T) => a("div", {
|
|
5514
5514
|
class: "ee-list-item",
|
|
5515
5515
|
onDblclick: (_) => {
|
|
5516
5516
|
const { insideBlock: B } = l(_), z = B ? T.template : `{${T.template}}`;
|
|
@@ -5518,7 +5518,7 @@ function Jc(o, e) {
|
|
|
5518
5518
|
}
|
|
5519
5519
|
}, [Zo(T.label, `${T.name}()`)]))
|
|
5520
5520
|
]));
|
|
5521
|
-
const g = ws(
|
|
5521
|
+
const g = ws(Er(o.fields ?? []), t.searchText);
|
|
5522
5522
|
if (!g.length) return [a("p", { class: "pd-empty", text: "暂无字段" })];
|
|
5523
5523
|
const y = [];
|
|
5524
5524
|
for (const S of g) {
|
|
@@ -5541,14 +5541,14 @@ function Jc(o, e) {
|
|
|
5541
5541
|
Array.from(g.querySelectorAll(".ee-nav-tab")).forEach((B, z) => B.classList.toggle("active", Xo[z]?.key === t.activeTab));
|
|
5542
5542
|
const S = i(g, ".ee-content-search .pd-input");
|
|
5543
5543
|
if (S) {
|
|
5544
|
-
const B =
|
|
5544
|
+
const B = Yn[t.activeTab];
|
|
5545
5545
|
S.placeholder !== B && (S.placeholder = B), S.value !== t.searchText && (S.value = t.searchText);
|
|
5546
5546
|
}
|
|
5547
5547
|
const T = i(g, ".ee-textarea");
|
|
5548
5548
|
T && T.value !== t.expression && (T.value = t.expression);
|
|
5549
5549
|
const _ = i(g, ".ee-content-list");
|
|
5550
5550
|
if (_) {
|
|
5551
|
-
|
|
5551
|
+
Lr(_);
|
|
5552
5552
|
for (const B of r()) fe(B, _);
|
|
5553
5553
|
}
|
|
5554
5554
|
n(g);
|
|
@@ -5586,14 +5586,14 @@ function Jc(o, e) {
|
|
|
5586
5586
|
a("div", { class: "ee-content-search" }, [
|
|
5587
5587
|
a("input", {
|
|
5588
5588
|
class: "pd-input",
|
|
5589
|
-
placeholder:
|
|
5589
|
+
placeholder: Yn[t.activeTab],
|
|
5590
5590
|
onInput: (g) => {
|
|
5591
5591
|
t.searchText = g.target.value, s(Ze(g));
|
|
5592
5592
|
}
|
|
5593
5593
|
})
|
|
5594
5594
|
]),
|
|
5595
5595
|
a("div", { class: "ee-content-list" }, r())
|
|
5596
|
-
]), m =
|
|
5596
|
+
]), m = Kn(t.expression, o.demoData), x = a("div", { class: "ee-editor" }, [
|
|
5597
5597
|
a("div", { class: "ee-editor-section" }, [
|
|
5598
5598
|
a("div", { class: "ee-editor-title", text: "表达式编辑" }),
|
|
5599
5599
|
a("textarea", {
|
|
@@ -6074,6 +6074,13 @@ const ep = {
|
|
|
6074
6074
|
id: "changelog",
|
|
6075
6075
|
title: "更新记录",
|
|
6076
6076
|
content: `
|
|
6077
|
+
<h2>V1.4.1<small>(2026-10-28)</small></h2>
|
|
6078
|
+
|
|
6079
|
+
<h3>修复</h3>
|
|
6080
|
+
<ul>
|
|
6081
|
+
<li><strong>条码 / 二维码设计态不再被示例码值遮住</strong>:新增条码/二维码时自带的示例码值此前排在「内容」之前,作者填了 {字段} 内容后画布仍然一直显示示例码。现在先按内容里的 {字段} 用示例数据求值(与表格单元格同口径),取不到值才显示预制示例码。只影响设计器里的展示,出纸不变。</li>
|
|
6082
|
+
</ul>
|
|
6083
|
+
|
|
6077
6084
|
<h2>V1.4.0<small>(2026-10-28)</small></h2>
|
|
6078
6085
|
|
|
6079
6086
|
<h3>新增</h3>
|
|
@@ -6420,18 +6427,18 @@ const ep = {
|
|
|
6420
6427
|
op,
|
|
6421
6428
|
ip,
|
|
6422
6429
|
np
|
|
6423
|
-
],
|
|
6424
|
-
function
|
|
6430
|
+
], na = "worm-print-help-tab", rp = "getting-started";
|
|
6431
|
+
function Xn(o) {
|
|
6425
6432
|
return ho.some((e) => e.id === o) ? String(o) : "";
|
|
6426
6433
|
}
|
|
6427
6434
|
function ap(o) {
|
|
6428
6435
|
let e = null;
|
|
6429
6436
|
try {
|
|
6430
|
-
e = window.localStorage.getItem(
|
|
6437
|
+
e = window.localStorage.getItem(na);
|
|
6431
6438
|
} catch {
|
|
6432
6439
|
e = null;
|
|
6433
6440
|
}
|
|
6434
|
-
return
|
|
6441
|
+
return Xn(e) || Xn(o) || rp;
|
|
6435
6442
|
}
|
|
6436
6443
|
function sp(o) {
|
|
6437
6444
|
const e = ap(o.initialTab), t = (i, n) => {
|
|
@@ -6442,7 +6449,7 @@ function sp(o) {
|
|
|
6442
6449
|
const l = s.querySelector(".help-content");
|
|
6443
6450
|
l && (l.innerHTML = ho.find((c) => c.id === n)?.content ?? "");
|
|
6444
6451
|
try {
|
|
6445
|
-
window.localStorage.setItem(
|
|
6452
|
+
window.localStorage.setItem(na, n);
|
|
6446
6453
|
} catch {
|
|
6447
6454
|
}
|
|
6448
6455
|
};
|
|
@@ -6539,17 +6546,17 @@ function pp(o) {
|
|
|
6539
6546
|
])
|
|
6540
6547
|
]);
|
|
6541
6548
|
}
|
|
6542
|
-
const
|
|
6543
|
-
function
|
|
6549
|
+
const Zn = /* @__PURE__ */ new WeakMap();
|
|
6550
|
+
function Qn(o) {
|
|
6544
6551
|
const e = o.querySelector(".designer-toolbar");
|
|
6545
6552
|
if (!e) return { movedIds: [], overflowRemains: !1 };
|
|
6546
6553
|
const t = getComputedStyle(e), i = Number.parseFloat(t.gap) || dp, n = Number.parseFloat(t.paddingLeft) || 0, r = Number.parseFloat(t.paddingRight) || 0, s = /* @__PURE__ */ new Map();
|
|
6547
6554
|
for (const y of Array.from(e.querySelectorAll(".tb-ou[data-unit]"))) {
|
|
6548
6555
|
const S = y.parentElement;
|
|
6549
|
-
S && !S.classList.contains("tb-more-slot") &&
|
|
6556
|
+
S && !S.classList.contains("tb-more-slot") && Zn.set(y, { parent: S, next: y.nextSibling }), s.set(y.dataset.unit, y);
|
|
6550
6557
|
}
|
|
6551
6558
|
for (const y of s.values()) {
|
|
6552
|
-
const S =
|
|
6559
|
+
const S = Zn.get(y);
|
|
6553
6560
|
!S || y.parentElement === S.parent || (S.next?.parentElement === S.parent ? S.parent.insertBefore(y, S.next) : S.parent.appendChild(y));
|
|
6554
6561
|
}
|
|
6555
6562
|
let l = 0;
|
|
@@ -6722,7 +6729,7 @@ function hp(o, e) {
|
|
|
6722
6729
|
pxPerMM: g,
|
|
6723
6730
|
paperLengthMM: e.paperLengthMM
|
|
6724
6731
|
}, S = -y.originPx / g, T = (l - y.originPx) / g, _ = ks(x), B = Ts(S, T, _);
|
|
6725
|
-
|
|
6732
|
+
Jn(y, B, f, !0), Jn(y, B, f, !1), er(y, 0, m), er(y, e.paperLengthMM, m);
|
|
6726
6733
|
const z = e.cursorPx ?? null;
|
|
6727
6734
|
if (z !== null && z >= 0 && z <= l) {
|
|
6728
6735
|
if (r.strokeStyle = m, r.lineWidth = 1.5, r.beginPath(), t) {
|
|
@@ -6735,21 +6742,21 @@ function hp(o, e) {
|
|
|
6735
6742
|
r.stroke();
|
|
6736
6743
|
}
|
|
6737
6744
|
}
|
|
6738
|
-
function
|
|
6745
|
+
function ra(o, e) {
|
|
6739
6746
|
return Math.round(o.originPx + e * o.pxPerMM) + 0.5;
|
|
6740
6747
|
}
|
|
6741
|
-
function
|
|
6748
|
+
function Jn(o, e, t, i) {
|
|
6742
6749
|
const { ctx: n, horizontal: r, paperLengthMM: s } = o;
|
|
6743
6750
|
n.strokeStyle = t, n.fillStyle = t, n.globalAlpha = i ? 0.32 : 1, n.lineWidth = 1, n.font = "9px ui-monospace, Menlo, monospace", n.textBaseline = "top";
|
|
6744
6751
|
for (const l of e) {
|
|
6745
6752
|
if ((l.mm < 0 || l.mm > s) !== i) continue;
|
|
6746
|
-
const p =
|
|
6753
|
+
const p = ra(o, l.mm), u = l.major ? 8 : 4;
|
|
6747
6754
|
n.beginPath(), r ? (n.moveTo(p, 0), n.lineTo(p, u)) : (n.moveTo(0, p), n.lineTo(u, p)), n.stroke(), l.major && l.label && (r ? n.fillText(l.label, p + 2, 11) : (n.save(), n.translate(11, p + 2), n.rotate(-Math.PI / 2), n.fillText(l.label, 0, 0), n.restore()));
|
|
6748
6755
|
}
|
|
6749
6756
|
n.globalAlpha = 1;
|
|
6750
6757
|
}
|
|
6751
|
-
function
|
|
6752
|
-
const { ctx: i, horizontal: n, thickness: r, viewportPx: s } = o, l =
|
|
6758
|
+
function er(o, e, t) {
|
|
6759
|
+
const { ctx: i, horizontal: n, thickness: r, viewportPx: s } = o, l = ra(o, e);
|
|
6753
6760
|
l <= 0 || l >= s || (i.strokeStyle = t, i.globalAlpha = 0.55, i.lineWidth = 1, i.beginPath(), n ? (i.moveTo(l, 0), i.lineTo(l, r)) : (i.moveTo(0, l), i.lineTo(r, l)), i.stroke(), i.globalAlpha = 1);
|
|
6754
6761
|
}
|
|
6755
6762
|
const fp = ':host{display:block;width:100%;height:100%}:host{--pd-bg: #f3f5f9;--pd-surface: #ffffff;--pd-field-bg: #f4f6fa;--pd-sidebar: #ffffff;--pd-sidebar-hover: #f0f3f9;--pd-canvas-bg: #e6e9f0;--pd-paper: #FFFFFF;--pd-accent: #165DFF;--pd-accent-2: #3D7BFF;--pd-accent-soft: rgba(22, 93, 255, .09);--pd-accent-secondary: #f56c6c;--pd-danger-soft: rgba(245, 108, 108, .1);--pd-ink-green: #67c23a;--pd-text: #2a2e37;--pd-text-muted: #8b909c;--pd-text-faint: #b4b9c4;--pd-border: #d9dde6;--pd-border-soft: #e9ecf2;--pd-input-bg: #ffffff;--pd-hover-tint: #ecf5ff;--pd-danger: #e53e3e;--pd-danger-bg: #fef2f2;--pd-danger-border: #fecaca;--pd-menu-text: #333;--pd-menu-hover: #f5f7fa;--pd-menu-border: #dcdfe6;--pd-menu-divider: #ebeef5;--pd-menu-muted: #909399;--pd-menu-disabled: #c0c4cc;--pd-scrollbar: rgba(23, 32, 60, .18);--pd-scrollbar-thumb: rgba(23, 32, 60, .16);--pd-scrollbar-thumb-hover: rgba(23, 32, 60, .3);--pd-help-field-bg: #f0f9ff;--pd-help-field-line: #bae6fd;--pd-help-field-ink: #0369a1;--pd-help-function-bg: #f0fdf4;--pd-help-function-line: #bbf7d0;--pd-help-function-ink: #166534;--pd-help-variable-bg: #fefce8;--pd-help-variable-line: #fde68a;--pd-help-variable-ink: #854d0e;--pd-help-conditional-bg: #fdf2f8;--pd-help-conditional-line: #fbcfe8;--pd-help-conditional-ink: #9d174d;--pd-handle: #165DFF;--pd-ruler: #9aa1af;--pd-ruler-bg: #f8f9fc;--pd-ruler-cursor: #165DFF;--pd-radius: 6px;--pd-shadow-sm: 0 1px 2px rgba(23, 32, 60, .05);--pd-shadow-md: 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07);--pd-shadow-paper: 0 0 0 1px rgba(23, 32, 60, .05), 0 1px 2px rgba(23, 32, 60, .06), 0 8px 20px rgba(23, 32, 60, .08), 0 26px 60px rgba(23, 32, 60, .15);height:100%;display:flex;flex-direction:column;background:var(--pd-bg)}.pd-form{display:flex;flex-direction:column;gap:10px;font-size:12px;color:var(--pd-text, #303133)}.pd-field{display:flex;flex-direction:column;gap:4px}.pd-label{font-size:11px;color:var(--pd-text-muted, #909399);display:inline-flex;align-items:center;position:relative;justify-content:space-between;gap:6px}.pd-label-t{display:inline-flex;align-items:center;gap:4px;min-width:0}.pd-reset-btn{flex:none;width:15px;height:15px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--pd-text-faint, #b4b9c4);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:color .14s ease,border-color .14s ease,background .14s ease}.pd-reset-btn.is-dirty{color:var(--pd-text, #2a2e37)}.pd-reset-btn:hover{color:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.pd-help{position:static;display:inline-flex;align-items:center;justify-content:center;flex:none;width:13px;height:13px;margin-left:4px;padding:0;border:1px solid var(--pd-border, #d9dde6);border-radius:50%;background:transparent;color:var(--pd-text-muted, #909399);font-size:9px;line-height:1;cursor:help}.pd-help:before{content:"?";font-weight:600}.pd-help:hover,.pd-help:focus-visible{border-color:var(--pd-accent, #165DFF);color:var(--pd-accent, #165DFF)}.pd-help:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);left:0;z-index:120;width:196px;padding:5px 7px;border-radius:4px;background:#1e2330e0;color:#fff;font-size:12px;font-weight:400;line-height:1.45;text-align:left;white-space:normal;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease}.pd-help:hover:after,.pd-help:focus:after{opacity:1;visibility:visible}.pd-hover-tip{position:fixed;z-index:9999;transform:translate(-50%);padding:4px 8px;border-radius:4px;background:#2a2e37eb;color:#fff;font-size:12px;line-height:1.4;width:max-content;max-width:calc(100vw - 16px);box-sizing:border-box;overflow-wrap:anywhere;pointer-events:none}.pd-input,.pd-select,textarea.pd-input{width:100%;height:26px;min-height:26px;padding:3px 6px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-input-bg, #fff);color:inherit;font:inherit;box-sizing:border-box;transition:border-color .14s ease,box-shadow .14s ease}.pd-input:hover,.pd-select:hover{border-color:var(--pd-text-faint, #b4b9c4)}textarea.pd-input{height:auto;min-height:48px;resize:vertical}.pd-input:focus,.pd-select:focus{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.pd-select{appearance:auto}.pd-switch{appearance:none;width:32px;height:18px;margin:0;border:1px solid var(--pd-border, #dcdfe6);border-radius:999px;background:#dcdfe6;position:relative;cursor:pointer;transition:background .2s,border-color .2s}.pd-switch:checked{background:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF)}.pd-switch:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:transform .2s}.pd-switch:checked:after{transform:translate(14px)}.pd-range{width:100%;accent-color:var(--pd-accent, #165DFF)}.pd-radio-group,.pd-checkbox-group{display:flex;flex-wrap:wrap;gap:6px}.pd-radio-group--2col{display:grid;grid-template-columns:1fr 1fr}.pd-radio-group--2col>.pd-radio{width:60%;justify-content:flex-start}.pd-radio,.pd-checkbox{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:0 7px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-input-bg, #fff);cursor:pointer;transition:border-color .14s ease,background .14s ease,color .14s ease}.pd-radio:has(input:checked),.pd-checkbox:has(input:checked){color:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);background:#165dff0f}.pd-button-group{display:inline-flex;gap:4px}.pd-button,.pd-tab{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:26px;padding:3px 8px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font:inherit;cursor:pointer;transition:background .14s ease,border-color .14s ease,color .14s ease}.pd-button:hover{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-button.primary{background:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);color:#fff}.pd-button.danger{background:#f56c6c;border-color:#f56c6c;color:#fff}.pd-button.small{min-height:22px;padding:1px 6px;font-size:11px}.pd-button:disabled{opacity:.55;cursor:not-allowed}.pd-tabs{display:flex;flex-direction:column;min-height:0}.pd-tab-bar{display:flex;gap:4px;padding:8px 12px 0;border-bottom:1px solid var(--pd-border-soft, #ebeef5)}.pd-tab{border:0;border-bottom:2px solid transparent;border-radius:5px 5px 0 0;background:transparent;transition:color .14s ease,background .14s ease}.pd-tab-bar .pd-tab:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.pd-tab.active{color:var(--pd-accent, #165DFF);border-bottom-color:var(--pd-accent, #165DFF);background:transparent;font-weight:600}.pd-tab-pane{min-height:0;overflow:auto}.pd-divider{margin:6px 0;font-size:11px;color:var(--pd-text-muted, #909399)}.pd-empty{margin:16px 0;color:var(--pd-text-muted, #909399);text-align:center}.pd-dialog-overlay{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:16px;background:#00000073}.pd-dialog{display:flex;flex-direction:column;width:min(950px,90vw);max-height:90vh;overflow:hidden;background:var(--pd-surface, #fff);border-radius:12px;box-shadow:var(--pd-shadow-md, 0 12px 40px rgba(23, 32, 60, .18))}.pd-dialog-large{width:min(950px,90vw)}.pd-dialog-header,.pd-dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px}.pd-dialog-header{border-bottom:1px solid var(--pd-border-soft, #ebeef5)}.pd-dialog-footer{justify-content:flex-end;border-top:1px solid var(--pd-border-soft, #ebeef5)}.pd-close{width:22px;height:22px;border:0;background:transparent;color:var(--pd-text-muted, #909399);font-size:16px;cursor:pointer}.pd-icon{display:inline-flex;width:14px;height:14px}.tb-more-panel{min-width:244px}.designer-container{scrollbar-width:thin;scrollbar-color:var(--pd-scrollbar, rgba(23, 32, 60, .18)) transparent}.designer-container ::-webkit-scrollbar{width:9px;height:9px}.designer-container ::-webkit-scrollbar-track{background:transparent}.designer-container ::-webkit-scrollbar-thumb{background:var(--pd-scrollbar-thumb, rgba(23, 32, 60, .16));border-radius:999px;border:2px solid transparent;background-clip:content-box}.designer-container ::-webkit-scrollbar-thumb:hover{background:var(--pd-scrollbar-thumb-hover, rgba(23, 32, 60, .3));border:2px solid transparent;background-clip:content-box}.designer-container ::-webkit-scrollbar-corner{background:transparent}.designer-container button:focus-visible,.designer-container [tabindex]:focus-visible,.designer-container .pd-tab:focus-visible{outline:2px solid var(--pd-accent, #165DFF);outline-offset:1px}@media(prefers-reduced-motion:reduce){.designer-container *,.designer-container *:before,.designer-container *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}.help-button{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:4px;background:transparent;cursor:pointer;transition:background-color .15s}.help-button:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.help-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--pd-accent, #165DFF);color:#fff;font-size:12px;font-weight:600;line-height:1}.tb-dd{position:relative;display:inline-flex}.tb-dd-trigger{height:28px;min-width:28px;padding:0 5px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:3px;font-size:12px;transition:background .14s ease,color .14s ease}.tb-dd-trigger:hover:not(:disabled){color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.tb-dd-trigger:disabled{opacity:.32;cursor:default}.tb-dd-trigger.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.tb-dd-arrow{opacity:.6;transition:transform .14s ease}.tb-dd-arrow.up{transform:rotate(180deg)}.tb-dd-trigger[data-tip]{position:relative}.tb-dd-trigger[data-tip]:after{content:attr(data-tip);position:absolute;top:34px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}.tb-dd-trigger[data-tip]:hover:after{opacity:1}.tb-dd-panel{position:absolute;top:34px;left:0;background:var(--pd-surface, #fff);border:1px solid var(--pd-border, #d9dde6);border-radius:8px;box-shadow:var(--pd-shadow-md, 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07));z-index:200}.tb-dd-panel.is-hidden{display:none}.tb-more-group{flex-shrink:0}.tb-more-menu{display:flex;flex-direction:column;gap:8px;padding:8px;max-height:min(70vh,520px)}.tb-more-item{display:flex;flex-direction:column;gap:4px}.tb-menu-label{font-size:11px;color:var(--pd-text-muted, #8b909c);padding-left:2px}.tb-more-slot{display:flex;align-items:center}.designer-toolbar{display:flex;align-items:center;gap:2px;padding:0 12px;height:50px;background:var(--pd-surface, #ffffff);border-bottom:1px solid var(--pd-border-soft, #e9ecf2);box-shadow:0 1px 2px #17203c0a,0 6px 16px -12px #17203c40;flex-shrink:0;position:relative;z-index:100}.tb-ou{flex-shrink:0}.designer-toolbar>*{flex-shrink:0}.designer-toolbar>.tb-brand{flex-shrink:1;min-width:0}.tb-title,.tb-title-name,.tb-title-sub,.tb-btn-text,.tb-zoom{white-space:nowrap}.designer-toolbar.is-tight .tb-title{min-width:0;overflow:hidden}.designer-toolbar.is-tight .tb-title-name,.designer-toolbar.is-tight .tb-title-sub{overflow:hidden;text-overflow:ellipsis}.tb-group{display:flex;align-items:center;gap:2px;padding:0 8px}.tb-group+.tb-group{border-left:1px solid var(--pd-border-soft, #e9ecf2)}.tb-btn{height:30px;min-width:30px;padding:0 8px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:5px;transition:background .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease}.tb-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.tb-btn:active{background:var(--pd-border-soft, #e9ecf2)}.tb-btn:disabled{opacity:.32;cursor:default;background:transparent;color:var(--pd-text-faint, #b4b9c4)}.tb-btn.danger:hover:not(:disabled){color:var(--pd-accent-secondary, #f56c6c);background:var(--pd-danger-soft, rgba(245, 108, 108, .1))}.tb-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));font-weight:600}.tb-btn .dot{width:6px;height:6px;border-radius:50%;background:var(--pd-text-faint, #b4b9c4);display:inline-block;transition:background .14s ease,box-shadow .14s ease}.tb-btn.on .dot{background:var(--pd-accent, #165DFF);box-shadow:0 0 0 3px #165dff1f}.tb-icon{font-size:15px;line-height:1}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;bottom:-32px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}[data-tip]:hover:after{opacity:1}.tb-mark{width:28px;height:28px;margin-right:2px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;color:#fff;background:linear-gradient(150deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF));box-shadow:0 3px 8px #165dff47,inset 0 1px #ffffff38;flex-shrink:0}.tb-mark svg{width:16px;height:16px}.tb-title{display:flex;flex-direction:column;line-height:1.2;padding-left:6px}.tb-title-name{font-size:13px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:.2px}.tb-title-sub{font-size:10px;color:var(--pd-text-muted, #8b909c);letter-spacing:.8px}.tb-zoom{font-size:12px;color:var(--pd-text, #2a2e37);font-variant-numeric:tabular-nums;min-width:46px;text-align:center}.tb-spacer{flex:1}.tb-group .tb-dd-trigger{height:30px;min-width:30px;padding:0 8px}.tb-btn-text{font-size:12px}.tb-menu{padding:8px;display:flex;flex-direction:column;gap:4px}.tb-menu-rows{width:148px}.tb-menu-label{padding:2px 4px;font-size:11px;color:var(--pd-text-muted, #8b909c)}.tb-menu-grid{display:grid;grid-template-columns:repeat(4,32px);gap:2px;margin-bottom:4px}.tb-menu-row{justify-content:flex-start;width:100%}.btn-primary,.btn-secondary{height:32px;padding:0 16px;border-radius:7px;font-size:13px;font-weight:600;cursor:pointer;transition:filter .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease}.btn-secondary{background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text-muted, #606266);border:1px solid var(--pd-border, #d9dde6)}.btn-secondary:hover{border-color:var(--pd-accent, #165DFF);color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .06))}.btn-primary{background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF));color:#fff;border:none;box-shadow:0 3px 10px #165dff47,inset 0 1px #ffffff2e}.btn-primary:hover{filter:brightness(1.07);box-shadow:0 5px 14px #165dff57,inset 0 1px #ffffff2e}.btn-primary:active{filter:brightness(.97)}.font-select{position:relative}.font-select-input{display:block;width:100%}.font-select-list{position:absolute;top:calc(100% + 4px);left:0;width:100%;min-width:150px;z-index:200;margin:0;max-height:200px;overflow-y:auto;padding:2px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-surface, #ffffff);box-shadow:var(--pd-shadow-md, 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07));list-style:none}.font-select-list.is-up{top:auto;bottom:calc(100% + 4px)}.font-select-option{padding:4px 6px;border-radius:4px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.font-select-option.is-active{background:var(--pd-sidebar-hover, #f0f3f9)}.font-select-option.is-muted{color:var(--pd-text-muted, #8b909c)}.pd-stepper{display:flex;align-items:center;width:100%}.pd-step-btn{width:26px;height:26px;flex-shrink:0;border:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .14s ease,border-color .14s ease,color .14s ease}.pd-step-btn:hover:not(:disabled){background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-step-btn:disabled{opacity:.45;cursor:not-allowed}.pd-step-minus{border-radius:6px 0 0 6px;border-right:none}.pd-step-plus{border-radius:0 6px 6px 0;border-left:none}.pd-step-input.pd-input{border-radius:0;min-width:0;flex:1;text-align:center;-moz-appearance:textfield}.pd-step-input.pd-input::-webkit-outer-spin-button,.pd-step-input.pd-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.preset-color-trigger{display:flex;align-items:center;width:100%;min-height:26px;padding:1px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-surface, #fff);cursor:pointer;transition:border-color .14s ease,box-shadow .14s ease}.preset-color-trigger:hover,.preset-color-trigger[aria-expanded=true]{border-color:var(--pd-accent, #165DFF)}.preset-color-trigger:focus-visible{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.preset-color-swatch{width:100%;height:22px;border-radius:4px;background-image:linear-gradient(45deg,#e9ecef 25%,transparent 25%,transparent 75%,#e9ecef 75%);background-size:8px 8px;background-position:0 0,4px 4px}.preset-color-panel{position:fixed;z-index:3000;width:190px;padding:10px;border:1px solid var(--pd-border, #d9dde6);border-radius:8px;background:var(--pd-surface, #fff);box-shadow:0 8px 24px #17203c29}.picker-preview{display:flex;align-items:center;gap:8px;margin-bottom:8px}.picker-current{flex:0 0 26px;height:24px;border:1px solid rgb(0 0 0 / 12%);border-radius:5px;background-image:linear-gradient(45deg,#e9ecef 25%,transparent 25%,transparent 75%,#e9ecef 75%);background-size:8px 8px;background-position:0 0,4px 4px}.picker-current.is-empty{position:relative;background-color:#fff}.picker-current.is-empty:after{content:"";position:absolute;inset:3px;background:linear-gradient(to top right,transparent calc(50% - .7px),#f53f3f calc(50% - .7px),#f53f3f calc(50% + .7px),transparent calc(50% + .7px));border-radius:3px}.picker-hex{flex:1;min-width:0;height:24px;padding:0 6px;border:1px solid var(--pd-border, #d9dde6);border-radius:5px;color:var(--pd-text, #303133);font:inherit;font-size:11px;text-transform:uppercase}.picker-hex:focus{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.picker-area{position:relative;height:100px;border:1px solid rgb(0 0 0 / 12%);border-radius:6px;overflow:hidden;cursor:crosshair;touch-action:none;background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,hsl(var(--picker-hue) 100% 50%))}.picker-handle{position:absolute;width:12px;height:12px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 3px #00000073;pointer-events:none}.picker-hue{width:100%;height:14px;margin:10px 0 0;appearance:none;border:1px solid rgb(0 0 0 / 12%);border-radius:999px;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);cursor:pointer}.picker-hue::-webkit-slider-thumb{appearance:none;width:12px;height:12px;border:2px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 3px #00000073}.picker-hue::-moz-range-thumb{width:8px;height:8px;border:2px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 3px #00000073}.picker-heading{display:flex;align-items:center;justify-content:space-between;margin-top:10px;margin-bottom:6px;font-size:11px;color:var(--pd-text-muted, #909399)}.picker-clear{display:inline-flex;align-items:center;gap:3px;padding:2px 6px;border:none;border-radius:4px;background:transparent;font-size:11px;line-height:1;color:var(--pd-text-muted, #909399);cursor:pointer}.picker-clear:hover:not(:disabled){background:#0000000f;color:var(--pd-danger, #f53f3f)}.picker-clear:disabled{opacity:.45;cursor:not-allowed}.preset-color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}.preset-color-item{width:22px;height:22px;padding:0;border:1px solid rgb(0 0 0 / 12%);border-radius:5px;cursor:pointer}.preset-color-item.active{box-shadow:0 0 0 2px #fff,0 0 0 3px var(--pd-accent, #165DFF)}.format-toolbar{display:flex;align-items:center;gap:2px;flex-shrink:0;min-width:0}.ft-group{display:flex;align-items:center;gap:2px;padding:0 8px;flex-shrink:0}.ft-group+.ft-group{border-left:1px solid var(--pd-border-soft, #e9ecf2)}.ft-btn{height:28px;min-width:28px;padding:0 5px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:4px;transition:background .14s ease,color .14s ease}.ft-btn:hover:not(:disabled){color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.ft-btn:disabled{opacity:.32;cursor:default}.ft-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.ft-btn-text{font-size:12px}.ft-btn[data-tip]{position:relative}.ft-btn[data-tip]:after{content:attr(data-tip);position:absolute;top:34px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}.ft-btn[data-tip]:hover:after{opacity:1}.ft-font{width:150px}.ft-size{width:96px}.ft-font .font-select-input,.ft-size .pd-input,.ft-size .pd-step-btn{font-size:12px}.ft-color-btn{position:relative;width:28px;height:28px;display:inline-flex;margin-left:2px}.ft-color-btn.dim{opacity:.35}.ft-color-btn .preset-color-trigger{width:100%;height:100%;min-height:0;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;align-items:flex-end;justify-content:center}.ft-color-btn .preset-color-trigger:hover,.ft-color-btn .preset-color-trigger[aria-expanded=true]{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-border-soft, #e9ecf2)}.ft-color-btn .preset-color-swatch{width:16px;height:4px;margin-bottom:3px;border-radius:1px;background-image:none;border-bottom:1px solid var(--pd-text-faint, #b4b9c4)}.ft-glyph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding-bottom:7px;font-size:13px;font-weight:700;color:var(--pd-text, #2a2e37);pointer-events:none}.ft-border-panel{width:196px;padding:10px;display:flex;flex-direction:column;gap:8px}.ft-align-panel{padding:6px;display:flex;flex-direction:column;gap:4px}.ft-align-row{display:grid;grid-template-columns:repeat(3,36px);gap:4px}.ft-border-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ft-cell-btn{height:30px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--pd-text, #2a2e37);cursor:pointer}.ft-cell-btn:hover:not(:disabled){background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-border-soft, #e9ecf2)}.ft-cell-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));border-color:#165dff59}.ft-cell-btn:disabled{opacity:.32;cursor:default}.ft-cell-btn .g-faint{fill:none;stroke:var(--pd-text-faint, #b4b9c4);stroke-width:1;stroke-dasharray:2 2}.ft-cell-btn .g-solid{stroke:currentColor;stroke-width:1.6}.ft-cell-btn[data-tip],.ft-style-btn[data-tip]{position:relative}.ft-cell-btn[data-tip]:after,.ft-style-btn[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 4px);left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;font-weight:400;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:210}.ft-cell-btn[data-tip]:hover:after,.ft-style-btn[data-tip]:hover:after{opacity:1}.ft-style-row{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ft-style-btn{height:22px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--pd-text, #2a2e37);cursor:pointer}.ft-style-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.ft-style-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));border-color:#165dff59}.ft-style-line{width:100%;height:0}.ft-border-style-row{display:flex;align-items:center;gap:6px}.ft-line-width{width:96px}.ft-edge-label{font-size:12px;color:var(--pd-text-muted, #8b909c);white-space:nowrap;flex-shrink:0}.layer-panel{border-top:1px solid var(--pd-border);padding:8px 12px;height:100%;box-sizing:border-box;overflow-y:auto}.panel-title{font-size:11px;color:var(--pd-text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}.layer-item{display:flex;align-items:center;gap:6px;padding:4px 6px;margin-bottom:2px;border-radius:4px;cursor:pointer;font-size:12px;transition:background .1s}.layer-item:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.layer-item.active{background:#165dff1a;color:var(--pd-accent, #165DFF);box-shadow:inset 2px 0 0 var(--pd-accent, #165DFF)}.layer-icon{width:18px;text-align:center;font-size:12px;color:var(--pd-text-muted, #909399)}.layer-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pd-text, #303133)}.layer-zone{flex-shrink:0;padding:0 4px;font-size:10px;line-height:14px;color:var(--pd-ink-green, #67c23a);background:#67c23a1a;border-radius:3px}.layer-zindex{font-size:10px;color:var(--pd-text-muted, #909399);font-variant-numeric:tabular-nums}.layer-actions{display:flex;gap:4px;margin-top:8px}.field-tree-panel{padding:0}.panel-title{font-size:11px;color:var(--pd-text-muted);text-transform:uppercase;letter-spacing:.5px;padding:4px 0 8px;margin-bottom:8px;border-bottom:1px solid var(--pd-border)}.search-input{margin-bottom:8px}.tree-container{overflow-y:auto;min-height:0}.field-group-header{display:flex;align-items:center;gap:4px;padding:5px 8px;border-radius:4px;font-size:13px;color:var(--pd-text, #303133);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .1s}.field-group-header:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.field-group-header.is-list{color:var(--pd-accent, #165DFF);font-weight:500}.expand-icon{width:12px;font-size:8px;flex-shrink:0;color:var(--pd-text-muted, #909399)}.field-row{display:flex;align-items:center;gap:4px;padding:5px 8px;border-radius:4px;font-size:13px;color:var(--pd-text, #303133);cursor:grab;-webkit-user-select:none;user-select:none;transition:background .1s}.field-row:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.node-icon{font-size:14px;flex-shrink:0;filter:saturate(.6);opacity:.9}.node-meta{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:center;column-gap:4px;row-gap:1px}.node-label{flex:1 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-key{flex:0 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--pd-text-muted, #909399)}.group-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.left-panel{width:224px;min-width:224px;background:var(--pd-sidebar, #ffffff);border-right:1px solid var(--pd-border-soft, #e9ecf2);display:flex;flex-direction:column;overflow:hidden;transition:width .18s ease}.left-panel.collapsed{width:36px;min-width:36px;border-right:1px solid var(--pd-border-soft, #e9ecf2)}.left-collapsed{display:flex;flex-direction:column;align-items:center;gap:8px;padding-top:12px;flex:1}.lc-btn{width:26px;height:26px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .14s ease}.lc-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.lc-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.left-head{display:flex;align-items:center;justify-content:space-between;height:42px;padding:0 12px;flex-shrink:0;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.left-title{font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:1.2px;display:inline-flex;align-items:center;gap:7px}.left-title:before{content:"";width:3px;height:12px;border-radius:2px;background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF))}.left-tabs{flex:1;display:flex;flex-direction:column;overflow:hidden}.left-tabs .pd-tab-pane{flex:1;min-height:0;overflow-y:auto;padding:12px}.panel-title{font-size:11px;color:var(--pd-text-muted, #8b909c);letter-spacing:.6px;padding:2px 2px 8px;margin-bottom:10px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.material-card{display:flex;align-items:center;gap:10px;padding:8px 10px;margin-bottom:7px;border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:8px;background:var(--pd-field-bg, #f4f6fa);cursor:grab;-webkit-user-select:none;user-select:none;transition:border-color .14s ease,background .14s ease,transform .14s ease,box-shadow .14s ease}.material-card:hover{border-color:#165dff73;background:var(--pd-surface, #ffffff);transform:translateY(-1px);box-shadow:var(--pd-shadow-sm, 0 1px 2px rgba(23, 32, 60, .05))}.material-card:active{cursor:grabbing;transform:translateY(0)}.material-icon{width:30px;height:24px;border:1px dashed var(--pd-border, #d9dde6);border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--pd-accent, #165DFF);background:var(--pd-surface, #ffffff);flex-shrink:0;transition:border-color .14s ease,background .14s ease}.material-card:hover .material-icon{border-style:solid;border-color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.material-label{font-size:12.5px;color:var(--pd-text, #2a2e37)}.print-image{width:100%;height:100%;overflow:hidden}.print-image img{width:100%;height:100%;display:block}.table-ctx-menu{position:fixed;z-index:3000;min-width:140px;padding:4px 0;background:var(--pd-surface, #fff);border:1px solid var(--pd-menu-border, #dcdfe6);border-radius:4px;box-shadow:0 2px 12px #00000026;font-size:13px}.menu-item{padding:5px 14px;cursor:pointer;color:var(--pd-menu-text, #333)}.menu-item:hover{background:var(--pd-menu-hover, #f5f7fa)}.menu-item.disabled{color:var(--pd-menu-disabled, #c0c4cc);cursor:not-allowed}.menu-item.active{color:var(--pd-accent, #165DFF)}.menu-divider{height:1px;margin:4px 0;background:var(--pd-menu-divider, #ebeef5)}.menu-group-title{padding:4px 14px;font-size:12px;color:var(--pd-menu-muted, #909399)}.cell-barcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.cell-barcode svg{max-width:100%;max-height:100%}.cell-barcode img{max-width:100%;max-height:100%}.cell-barcode-fallback{font-style:italic;opacity:.6}.cell-image{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.cell-image img{max-width:100%;max-height:100%;display:block}.image-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#bbb;font-size:12px;border:1px dashed #ddd;box-sizing:border-box}.print-table{position:relative;width:100%;height:100%}.print-table table{border-collapse:collapse;table-layout:fixed;width:100%}.print-table td{box-sizing:border-box;word-break:normal;overflow-wrap:break-word}.cell-selected{outline:2px solid #165DFF;outline-offset:-2px;background-color:#165dff14}.row-data-bg{background-image:repeating-linear-gradient(45deg,rgba(22,93,255,.04) 0 6px,transparent 6px 12px)}.data-placeholder{color:#909399;font-style:italic}.row-badges{position:absolute;left:-16px;top:0;width:14px}.row-badge{position:absolute;width:14px;display:flex;align-items:center;justify-content:center;font-size:10px;color:#909399;background:#f5f7fa;border-radius:2px}.col-resize-layer{position:absolute;inset:0;pointer-events:none;z-index:3}.col-resize-handle{position:absolute;top:0;bottom:0;width:6px;transform:translate(-50%);cursor:col-resize;pointer-events:auto}.col-resize-handle:after{content:"";position:absolute;top:0;bottom:0;left:50%;border-left:1px solid transparent}.col-resize-handle:hover:after,.col-resize-handle.dragging:after{border-left-color:var(--pd-accent, #165DFF)}.print-barcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.print-barcode svg{max-width:100%;max-height:100%}.print-qrcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.print-qrcode img{max-width:100%;max-height:100%}.print-html,.page-number-element{width:100%;height:100%;overflow:hidden}.print-element{box-sizing:border-box;cursor:pointer;-webkit-user-select:none;user-select:none}.print-element.design-mode{outline:1px dashed #C3C9D6}.print-element.design-mode.zone-header,.print-element.design-mode.zone-footer{outline:1px dashed var(--pd-ink-green, #67c23a)}.print-element.selected{outline:1.5px solid var(--pd-accent, #165DFF);background:#165dff0a}.print-element.previewed{outline:1.5px solid rgba(22,93,255,.5);background:#165dff1a}.print-element.design-mode:hover{outline:1px dashed var(--pd-accent, #165DFF)}.print-element.locked{cursor:not-allowed}.print-element.locked:not(.selected){outline:1.5px dashed #999}.print-element.hidden{opacity:.3;pointer-events:none}.print-element.drag-ghost{opacity:.4}.drag-preview{position:absolute;inset:0;border:2px dashed var(--pd-accent, #165DFF);pointer-events:none;z-index:1000;box-sizing:border-box}.selected-indicator{position:absolute;top:-18px;left:0;font-size:10px;white-space:nowrap;pointer-events:none;z-index:20}.position-label{background:var(--pd-accent, #165DFF);color:#fff;padding:1px 6px;border-radius:3px;font-family:ui-monospace,SF Mono,Menlo,monospace;font-size:10px;font-variant-numeric:tabular-nums;letter-spacing:0;box-shadow:0 2px 6px #00000026}.resize-handles{position:absolute;inset:0;pointer-events:none}.resize-handle{position:absolute;width:7px;height:7px;background:var(--pd-handle, #165DFF);border:1.5px solid #fff;border-radius:2px;box-sizing:border-box;transform:translate(-50%,-50%);box-shadow:0 1px 3px #0000002e;z-index:10;pointer-events:auto}.handle-nw{top:0;left:0;cursor:nw-resize}.handle-n{top:0;left:50%;cursor:n-resize}.handle-ne{top:0;left:100%;cursor:ne-resize}.handle-e{top:50%;left:100%;cursor:e-resize}.handle-se{top:100%;left:100%;cursor:se-resize}.handle-s{top:100%;left:50%;cursor:s-resize}.handle-sw{top:100%;left:0;cursor:sw-resize}.handle-w{top:50%;left:0;cursor:w-resize}.paper-wrapper{display:block}.hiprint-printPaper{transition:transform .15s ease-out}.zone-layer{box-sizing:border-box}.zone-layer.zone-header.design-mode,.zone-layer.zone-footer.design-mode{outline:1px dashed var(--pd-ink-green, #67c23a);background:#67c23a0a}.zone-layer.zone-content.design-mode{outline:1px dashed #C3C9D6}.zone-label{position:absolute;top:2px;right:4px;font-size:9px;color:#909399;pointer-events:none;-webkit-user-select:none;user-select:none}.zone-resize-handle{position:absolute;left:0;width:100%;height:6px;cursor:ns-resize;z-index:5}.zone-resize-handle.handle-bottom{bottom:-3px}.zone-resize-handle.handle-top{top:-3px}.zone-resize-handle:hover{background:#10b98140}.zone-height-tip{position:absolute;right:4px;top:-22px;padding:1px 6px;font-size:11px;color:#fff;background:#10b981;border-radius:3px;white-space:nowrap;pointer-events:none}.design-background{position:absolute;z-index:0;overflow:hidden;pointer-events:none}.design-background img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.grid-bg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:0}.snap-indicator{position:absolute;width:6px;height:6px;background:var(--pd-accent, #165DFF);border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:10;animation:snap-pulse-3160f418 .3s ease-out}@keyframes snap-pulse-3160f418{0%{transform:translate(-50%,-50%) scale(2);opacity:.5}to{transform:translate(-50%,-50%) scale(1);opacity:0}}.watermark-layer{position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;overflow:hidden;pointer-events:none}.watermark-tile{position:absolute;pointer-events:none}.adsorb-guide{position:absolute;pointer-events:none;z-index:9999}.adsorb-guide.guide-vertical{border-left:1px dashed var(--pd-accent-secondary, #f56c6c)}.adsorb-guide.guide-horizontal{border-top:1px dashed var(--pd-accent-secondary, #f56c6c)}.manual-guide{position:absolute;pointer-events:auto;z-index:9998;cursor:move}.manual-guide.guide-vertical{border-left:1px solid #3B82F6;width:0}.manual-guide.guide-horizontal{border-top:1px solid #3B82F6;height:0}.manual-guide:before{content:"";position:absolute;pointer-events:auto}.manual-guide.guide-vertical:before{top:0;bottom:0;left:50%;width:var(--guide-hit, 8px);transform:translate(-50%)}.manual-guide.guide-horizontal:before{left:0;right:0;top:50%;height:var(--guide-hit, 8px);transform:translateY(-50%)}.manual-guide:hover{border-color:#ef4444!important}.pd-ruler{position:absolute;display:block;pointer-events:auto;cursor:crosshair;z-index:1;background:var(--pd-ruler-bg, #f8f9fc)}.pd-ruler.is-horizontal{box-shadow:0 1px 0 var(--pd-border-soft, #e9ecf2)}.pd-ruler.is-vertical{box-shadow:1px 0 0 var(--pd-border-soft, #e9ecf2)}.canvas-area{flex:1;overflow-x:scroll;overflow-y:auto;scrollbar-gutter:stable;display:flex;background-color:var(--pd-canvas-bg, #e6e9f0);background-image:radial-gradient(circle,rgba(23,32,60,.13) 1px,transparent 1.2px);background-size:20px 20px;background-position:center;padding:44px 28px 32px 44px;position:relative}.canvas-scroll{display:flex;flex-direction:column;align-items:center;gap:20px;position:relative;flex:none;margin:auto;width:fit-content}.marquee-selection{position:fixed;border:1.5px solid rgba(22,93,255,.7);background:#165dff14;border-radius:2px;pointer-events:none;z-index:10000}.context-menu{position:fixed;background:var(--pd-surface, #ffffff);border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:8px;box-shadow:var(--pd-shadow-md, 0 10px 28px rgba(23, 32, 60, .12));padding:5px;z-index:10001;min-width:132px}.context-menu-item{padding:7px 12px;border-radius:5px;font-size:12.5px;cursor:pointer;color:var(--pd-text, #2a2e37);-webkit-user-select:none;user-select:none;transition:background .12s ease,color .12s ease}.context-menu-item:hover{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF)}.context-menu-item.disabled{color:var(--pd-text-faint, #b4b9c4);cursor:not-allowed}.context-menu-item.disabled:hover{background:transparent;color:var(--pd-text-faint, #b4b9c4)}.context-menu-sep{height:1px;background:var(--pd-border-soft, #e9ecf2);margin:5px 8px}.ruler-overlay{position:absolute;inset:0;pointer-events:none;z-index:60}.ruler-corner{position:absolute;top:0;left:0;width:22px;height:22px;background:var(--pd-ruler-bg, #f8f9fc);box-shadow:1px 1px 0 var(--pd-border-soft, #e9ecf2);z-index:2}.ruler-overlay .pd-ruler.is-horizontal{top:0;left:22px}.ruler-overlay .pd-ruler.is-vertical{top:22px;left:0}.ruler-guide-preview{position:fixed;pointer-events:none;z-index:9997}.ruler-guide-preview.guide-vertical{width:0;border-left:1px dashed var(--pd-accent, #165dff)}.ruler-guide-preview.guide-horizontal{height:0;border-top:1px dashed var(--pd-accent, #165dff)}.property-search{padding:0 0 10px;background:transparent}.property-group{border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:8px;margin-bottom:10px;background:var(--pd-surface, #ffffff);overflow:hidden;transition:border-color .14s ease,box-shadow .14s ease}.property-group:last-child{margin-bottom:2px}.property-group.is-expanded{border-color:var(--pd-border-soft, #e9ecf2)}.group-header{display:flex;align-items:center;padding:9px 12px;cursor:pointer;-webkit-user-select:none;user-select:none;background:var(--pd-field-bg, #f4f6fa);transition:background .14s ease}.group-header:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.property-group.is-expanded .group-header{border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.group-icon{margin-right:8px;color:var(--pd-accent, #165DFF)}.group-title{flex:1;font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:.3px}.expand-icon{color:var(--pd-text-muted, #8b909c);font-size:10px}.group-content{padding:10px 12px 12px;background:var(--pd-surface, #ffffff)}.position-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pd-crop-note{margin:0 0 8px;font-size:12px;line-height:1.5;color:var(--pd-text-faint, #6b7280)}.pd-crop-preview{position:relative;overflow:hidden;margin-bottom:8px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;line-height:0;width:fit-content;max-width:100%}.pd-crop-thumb{max-width:100%;max-height:96px;display:block}.pd-crop-win{position:absolute;border:1px solid #ff5a5a;box-shadow:0 0 0 999px #0000008c;pointer-events:none}.color-row{display:flex;gap:12px}.color-row>.pd-field{flex:1 1 0;min-width:0}.pd-rotate-row{display:flex;align-items:stretch;width:100%}.pd-rotate-btn{width:26px;flex-shrink:0;border:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font-size:14px;line-height:1;cursor:pointer;transition:background .14s ease,border-color .14s ease}.pd-rotate-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-rotate-btn:first-child{border-radius:6px 0 0 6px;border-right:none}.pd-rotate-btn:last-child{border-radius:0 6px 6px 0;border-left:none}.pd-rotate-stepper{flex:1;min-width:0}.pd-rotate-stepper .pd-step-minus,.pd-rotate-stepper .pd-step-plus{display:none}.pd-rotate-stepper .pd-step-input.pd-input{border-radius:0}.expression-editor{display:flex;height:450px;gap:0}.ee-nav{width:100px;background:var(--pd-sidebar);border-right:1px solid var(--pd-border);display:flex;flex-direction:column;flex-shrink:0}.ee-nav-title{padding:10px;border-bottom:1px solid var(--pd-border);font-weight:600;font-size:13px;color:var(--pd-text);text-align:center}.ee-nav-tabs{flex:1;display:flex;flex-direction:column;padding:6px;gap:4px}.ee-nav-tab{padding:8px 10px;border-radius:6px;cursor:pointer;font-size:12px;text-align:center;transition:all .2s}.ee-nav-tab.active{background:var(--pd-accent);color:#fff}.ee-nav-tab:not(.active){background:var(--pd-surface, white);border:1px solid var(--pd-border);color:var(--pd-text)}.ee-nav-tab:hover:not(.active){background:var(--pd-hover-tint, #ecf5ff);border-color:var(--pd-accent)}.ee-content{width:300px;display:flex;flex-direction:column;border-right:1px solid var(--pd-border);flex-shrink:0}.ee-content-search{padding:10px;border-bottom:1px solid var(--pd-border)}.ee-content-list{flex:1;padding:8px;overflow-y:auto;min-height:0}.ee-func-group{margin-bottom:12px}.ee-func-group-title{font-size:11px;font-weight:600;color:var(--pd-text-muted);padding:6px 10px;margin-bottom:2px;letter-spacing:.5px}.ee-field-group{display:flex;align-items:center;gap:4px;padding:6px 10px;font-size:12px;font-weight:600;color:var(--pd-text)}.ee-field-group.is-list{color:var(--pd-accent, #165DFF)}.ee-field-group-icon{font-size:13px;filter:saturate(.6)}.ee-list-item{padding:7px 10px;cursor:pointer;border-radius:4px;margin-bottom:2px;transition:background .15s}.ee-field-info{display:flex;flex-direction:column;gap:1px}.ee-field-info .ee-item-label{font-size:12px;color:var(--pd-text)}.ee-field-info .ee-item-key{font-size:10px;color:var(--pd-text-muted);font-family:monospace}.ee-list-item:hover{background:var(--pd-hover-tint, #ecf5ff)}.ee-editor{flex:1;display:flex;flex-direction:column;background:var(--pd-sidebar);min-width:0}.ee-editor-section{padding:12px;border-bottom:1px solid var(--pd-border)}.ee-editor-title{font-size:11px;color:var(--pd-text-muted);margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px}.ee-textarea{width:100%;border:1px solid var(--pd-border);border-radius:6px;padding:10px;font-family:monospace;font-size:13px;resize:vertical;box-sizing:border-box;min-height:100px}.ee-textarea:focus{outline:none;border-color:var(--pd-accent)}.ee-preview{padding:10px;background:var(--pd-bg);border:1px solid var(--pd-border);border-radius:6px;min-height:30px;font-size:13px;color:var(--pd-text);line-height:1.6;white-space:pre-wrap}.ee-preview-error{color:var(--pd-danger, #e53e3e);background:var(--pd-danger-bg, #fef2f2);border-color:var(--pd-danger-border, #fecaca)}.ee-help-section{flex:1;padding:12px;overflow-y:auto;min-height:0}.ee-help-title{font-size:11px;color:var(--pd-text-muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:.5px}.ee-help-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ee-help-card{border-radius:6px;padding:10px}.ee-help-card-title{font-size:12px;font-weight:600;margin-bottom:4px}.ee-help-card-content{font-size:11px;line-height:1.5;color:var(--pd-text)}.ee-help-field{background:var(--pd-help-field-bg, #f0f9ff);border:1px solid var(--pd-help-field-line, #bae6fd)}.ee-help-field .ee-help-card-title{color:var(--pd-help-field-ink, #0369a1)}.ee-help-function{background:var(--pd-help-function-bg, #f0fdf4);border:1px solid var(--pd-help-function-line, #bbf7d0)}.ee-help-function .ee-help-card-title{color:var(--pd-help-function-ink, #166534)}.ee-help-variable{background:var(--pd-help-variable-bg, #fefce8);border:1px solid var(--pd-help-variable-line, #fde68a)}.ee-help-variable .ee-help-card-title{color:var(--pd-help-variable-ink, #854d0e)}.ee-help-conditional{background:var(--pd-help-conditional-bg, #fdf2f8);border:1px solid var(--pd-help-conditional-line, #fbcfe8)}.ee-help-conditional .ee-help-card-title{color:var(--pd-help-conditional-ink, #9d174d)}.expression-editor{max-height:min(600px,80vh);overflow-y:auto;padding:16px}.col-width-row{display:flex;align-items:center;gap:8px;margin-bottom:4px;width:100%}.border-row{display:flex;gap:10px}.border-row .pd-field{flex:1;min-width:0}.advanced-row{display:flex;gap:16px}.image-content-upload{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-top:4px}.upload-tip{margin:0;font-size:11px;color:var(--pd-text-muted, #909399)}.cell-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}.cell-font-field{grid-column:1 / -1;padding-bottom:8px}.border-style-row{display:flex;gap:6px;margin-bottom:8px}.border-presets{margin-bottom:8px}.merge-btns{margin-top:8px;display:flex;gap:8px}.watermark-config{padding:0 4px}.pd-hint{margin-left:8px;font-size:12px;color:#909399;min-width:32px}.design-background-config{padding:0 4px}.design-background-tip{margin:2px 0 6px;font-size:11px;line-height:1.4;color:var(--pd-text-muted, #909399)}.design-background-path{margin-bottom:6px;padding:4px 6px;font-size:11px;color:var(--pd-text-regular, #606266);background:var(--pd-fill-light, #f5f7fa);border-radius:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-background-actions{display:flex;gap:6px}.upload-label{cursor:pointer}.upload-label.disabled{opacity:.6;cursor:not-allowed}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.tiling-config{padding:0 4px}.tiling-switch{display:flex;align-items:center;gap:6px;font-size:12px;cursor:pointer}.tiling-error{color:#f56c6c}.tiling-summary{color:var(--pd-text-regular, #606266)}.property-panel{width:280px;min-width:280px;background:var(--pd-sidebar, #ffffff);border-left:1px solid var(--pd-border-soft, #e9ecf2);display:flex;flex-direction:column;overflow:hidden;transition:width .18s ease}.property-panel.collapsed{width:36px;min-width:36px;border-left:1px solid var(--pd-border-soft, #e9ecf2)}.prop-collapsed{display:flex;flex-direction:column;align-items:center;gap:8px;padding-top:12px;flex:1}.pc-btn{width:26px;height:26px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .14s ease}.pc-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.pc-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.prop-head{display:flex;align-items:center;justify-content:space-between;height:42px;padding:0 12px;flex-shrink:0;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.prop-title{font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:1.2px;display:inline-flex;align-items:center;gap:7px}.prop-title:before{content:"";width:3px;height:12px;border-radius:2px;background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF))}.collapse-btn{border:none;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:14px;cursor:pointer;width:24px;height:24px;border-radius:5px;transition:all .14s ease}.collapse-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.prop-tabs{flex:1;display:flex;flex-direction:column;overflow:hidden}.prop-tabs .pd-tab-pane{flex:1;min-height:0;overflow-y:auto;padding:12px}.property-content{padding:0}.margin-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.custom-size-grid{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:4px;width:100%}.custom-size-x{color:var(--pd-text-muted, #8b909c);font-size:12px}.pd-hint{margin:2px 0 6px;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:1.4}.page-bg-row{display:flex;align-items:center;gap:8px}.page-bg-picker{flex:1;min-width:0}.status-bar{position:relative;display:flex;align-items:center;gap:20px;height:30px;padding:0 16px;background:var(--pd-surface, #ffffff);border-top:1px solid var(--pd-border-soft, #e9ecf2);box-shadow:0 -1px 2px #17203c08;font-size:11.5px;color:var(--pd-text-muted, #8b909c);-webkit-user-select:none;user-select:none;flex-shrink:0}.status-item{white-space:nowrap;font-variant-numeric:tabular-nums;display:inline-flex;align-items:center}.coord{font-variant-numeric:tabular-nums;color:var(--pd-text, #2a2e37)}.status-paper{margin-left:auto;font-variant-numeric:tabular-nums;color:var(--pd-accent, #165DFF);font-weight:600}.status-dirty{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;color:var(--pd-text-muted, #8b909c)}.status-dirty.on{color:var(--pd-accent-secondary, #f56c6c)}.dirty-dot{width:7px;height:7px;border-radius:50%;background:var(--pd-ink-green, #67c23a)}.status-dirty.on .dirty-dot{background:var(--pd-accent-secondary, #f56c6c);box-shadow:0 0 0 3px #f56c6c24;animation:dirty-pulse-a91952ff 1.6s ease-in-out infinite}@keyframes dirty-pulse-a91952ff{0%,to{box-shadow:0 0 0 2px #f56c6c1f}50%{box-shadow:0 0 0 4px #f56c6c0d}}@media(prefers-reduced-motion:reduce){.status-dirty.on .dirty-dot{animation:none}}.help-modal-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.help-modal{width:800px;max-width:90vw;height:600px;max-height:85vh;background:var(--pd-surface, #ffffff);border-radius:8px;box-shadow:0 4px 24px #00000026;display:flex;flex-direction:column;overflow:hidden}.help-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--pd-border, #d9dde6)}.help-modal-title{margin:0;font-size:16px;font-weight:600;color:var(--pd-text, #2a2e37)}.help-modal-title-wrap{display:flex;align-items:center;gap:10px}.help-modal-project{padding:2px 8px;border-radius:4px;background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF);font-size:12px;font-weight:500}.help-modal-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:4px;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:20px;cursor:pointer;transition:all .15s}.help-modal-close:hover{background:var(--pd-sidebar-hover, #f0f3f9);color:var(--pd-text, #2a2e37)}.help-modal-body{flex:1;display:flex;overflow:hidden}.help-modal-sidebar{width:160px;padding:12px;border-right:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);overflow-y:auto}.help-tab{display:block;width:100%;padding:10px 12px;margin-bottom:4px;border:none;border-radius:4px;background:transparent;color:var(--pd-text, #2a2e37);font-size:13px;text-align:left;cursor:pointer;transition:all .15s}.help-tab:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.help-tab.active{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF);font-weight:500}.help-modal-content{flex:1;padding:20px;overflow-y:auto}.help-content{font-size:14px;line-height:1.6;color:var(--pd-text, #2a2e37)}.help-content h2{margin:0 0 16px;padding-bottom:8px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2);font-size:18px;font-weight:600}.help-content h3{margin:20px 0 12px;font-size:15px;font-weight:600}.help-content p{margin:0 0 12px}.help-content ul,.help-content ol{margin:0 0 12px;padding-left:24px}.help-content li{margin-bottom:4px}.help-content code{padding:2px 6px;border-radius:3px;background:var(--pd-field-bg, #f4f6fa);font-family:SF Mono,Monaco,monospace;font-size:13px}.help-content pre{margin:0 0 12px;padding:12px;border-radius:4px;background:var(--pd-field-bg, #f4f6fa);overflow-x:auto}.help-content pre code{padding:0;background:transparent}.help-content table{width:100%;margin:0 0 12px;border-collapse:collapse}.help-content th,.help-content td{padding:8px 12px;border:1px solid var(--pd-border, #d9dde6);text-align:left}.help-content th{background:var(--pd-field-bg, #f4f6fa);font-weight:600}.help-content blockquote{margin:0 0 12px;padding:12px 16px;border-left:3px solid var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.help-modal-enter-active,.help-modal-leave-active{transition:opacity .2s ease}.help-modal-enter-active .help-modal,.help-modal-leave-active .help-modal{transition:transform .2s ease}.help-modal-enter-from,.help-modal-leave-to{opacity:0}.help-modal-enter-from .help-modal,.help-modal-leave-to .help-modal{transform:scale(.95)}.page-tabs{display:flex;align-items:center;gap:8px;padding:4px 12px;background:var(--pd-sidebar, #fff);border-bottom:1px solid var(--pd-border, #d9dde6);flex-shrink:0}.page-tabs-list{display:flex;gap:4px;overflow-x:auto;align-items:center}.page-tab{padding:4px 12px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;background:transparent;cursor:pointer;white-space:nowrap;color:var(--pd-text, #2a2e37);font-size:12px}.page-tab.active{background:var(--pd-accent, #165DFF);color:#fff}.page-tab-rename{padding:4px 8px;width:96px;border:1px solid var(--pd-accent, #165DFF);border-radius:4px;font-size:12px;color:var(--pd-text, #2a2e37);outline:none}.page-tabs-actions{display:flex;gap:4px;margin-left:auto}.page-tabs-actions button{padding:4px 8px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;background:transparent;cursor:pointer;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:1}.page-tabs-actions button:disabled{opacity:.4;cursor:not-allowed}.designer-container{--pd-bg: #f3f5f9;--pd-surface: #ffffff;--pd-field-bg: #f4f6fa;--pd-sidebar: #ffffff;--pd-sidebar-hover: #f0f3f9;--pd-canvas-bg: #e6e9f0;--pd-paper: #FFFFFF;--pd-accent: #165DFF;--pd-accent-2: #3D7BFF;--pd-accent-soft: rgba(22, 93, 255, .09);--pd-accent-secondary: #f56c6c;--pd-danger-soft: rgba(245, 108, 108, .1);--pd-ink-green: #67c23a;--pd-text: #2a2e37;--pd-text-muted: #8b909c;--pd-text-faint: #b4b9c4;--pd-border: #d9dde6;--pd-border-soft: #e9ecf2;--pd-input-bg: #ffffff;--pd-hover-tint: #ecf5ff;--pd-danger: #e53e3e;--pd-danger-bg: #fef2f2;--pd-danger-border: #fecaca;--pd-menu-text: #333;--pd-menu-hover: #f5f7fa;--pd-menu-border: #dcdfe6;--pd-menu-divider: #ebeef5;--pd-menu-muted: #909399;--pd-menu-disabled: #c0c4cc;--pd-scrollbar: rgba(23, 32, 60, .18);--pd-scrollbar-thumb: rgba(23, 32, 60, .16);--pd-scrollbar-thumb-hover: rgba(23, 32, 60, .3);--pd-help-field-bg: #f0f9ff;--pd-help-field-line: #bae6fd;--pd-help-field-ink: #0369a1;--pd-help-function-bg: #f0fdf4;--pd-help-function-line: #bbf7d0;--pd-help-function-ink: #166534;--pd-help-variable-bg: #fefce8;--pd-help-variable-line: #fde68a;--pd-help-variable-ink: #854d0e;--pd-help-conditional-bg: #fdf2f8;--pd-help-conditional-line: #fbcfe8;--pd-help-conditional-ink: #9d174d;--pd-handle: #165DFF;--pd-ruler: #9aa1af;--pd-ruler-bg: #f8f9fc;--pd-ruler-cursor: #165DFF;--pd-radius: 6px;--pd-shadow-sm: 0 1px 2px rgba(23, 32, 60, .05);--pd-shadow-md: 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07);--pd-shadow-paper: 0 0 0 1px rgba(23, 32, 60, .05), 0 1px 2px rgba(23, 32, 60, .06), 0 8px 20px rgba(23, 32, 60, .08), 0 26px 60px rgba(23, 32, 60, .15);height:100%;display:flex;flex-direction:column;background:var(--pd-bg)}.designer-body{flex:1;display:flex;overflow:hidden}.designer-container.format-painting .canvas-area,.designer-container.format-painting .canvas-area *{cursor:copy!important}.print-html-preview{width:100%;height:100%;position:relative;background:#e9ebee}.print-html-preview-iframe{width:100%;height:100%;border:0;background:#fff}.print-html-preview-loading,.print-html-preview-error{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#909399;font-size:14px}.print-html-preview-error{color:#f56c6c}.print-html-preview-warn{position:absolute;top:8px;left:12px;z-index:2;max-width:62%;padding:4px 8px;border:1px solid #e6a23c;border-radius:4px;background:#faecd1f0;color:#b88230;font-size:12px;line-height:1.5}.print-html-preview-zoom{position:absolute;top:8px;right:12px;z-index:2;display:flex;align-items:center;gap:4px;padding:3px 4px;border:1px solid var(--pd-border-soft, #ebeef5);border-radius:6px;background:#ffffffeb;box-shadow:0 1px 4px #00000014}.print-html-preview-zoom-btn{padding:2px 7px;border:0;border-radius:4px;background:transparent;color:var(--pd-text-muted, #909399);font-size:11px;line-height:18px;cursor:pointer;transition:color .14s ease,background .14s ease}.print-html-preview-zoom-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9);color:var(--pd-text, #2a2e37)}.print-html-preview-zoom-btn.active{background:var(--pd-accent, #165DFF);color:#fff;font-weight:600}.print-html-preview-zoom-note{padding-right:4px;color:var(--pd-text-muted, #909399);font-size:11px}.print-html-preview-zoom-hint{color:#b88230;font-size:11px}.tiling-config .margin-grid,.tiling-config .custom-size-grid{display:block;grid-template-columns:none;gap:normal}.tiling-config .custom-size-x{display:inline;min-width:0;color:inherit}.pd-hint{min-width:auto}.watermark-config .pd-hint{min-width:32px;margin-left:8px;color:#909399}.tiling-config .tiling-error{color:#f56c6c}.tiling-config .tiling-summary{color:var(--pd-text-regular, #606266)}.pd-help{position:static}.pd-help:after{top:calc(100% + 6px);bottom:auto;left:0;transform:none;padding:5px 7px;white-space:normal;z-index:120}.page-tabs [data-tip]:after,.field-tree-panel [data-tip]:after{content:none}', co = 20, mp = ".page-tabs, .field-tree-panel", gp = /* @__PURE__ */ new Set(["z", "y", "a", "c", "x", "v", "d", "g", "1", "l", "r", "e", "t", "b", "0"]), bp = {
|
|
@@ -6758,15 +6765,15 @@ const fp = ':host{display:block;width:100%;height:100%}:host{--pd-bg: #f3f5f9;--
|
|
|
6758
6765
|
barcode: "formatter",
|
|
6759
6766
|
qrcode: "formatter",
|
|
6760
6767
|
image: "src"
|
|
6761
|
-
},
|
|
6762
|
-
function
|
|
6768
|
+
}, tr = "print-studio:left", or = "print-studio:right";
|
|
6769
|
+
function ir(o) {
|
|
6763
6770
|
try {
|
|
6764
6771
|
return localStorage.getItem(o) === "1";
|
|
6765
6772
|
} catch {
|
|
6766
6773
|
return !1;
|
|
6767
6774
|
}
|
|
6768
6775
|
}
|
|
6769
|
-
function
|
|
6776
|
+
function nr(o, e) {
|
|
6770
6777
|
try {
|
|
6771
6778
|
localStorage.setItem(o, e ? "1" : "0");
|
|
6772
6779
|
} catch {
|
|
@@ -6890,14 +6897,14 @@ class Ue extends HTMLElement {
|
|
|
6890
6897
|
}
|
|
6891
6898
|
/** 面板折叠态:与 canvas 的 useStudioChrome 共用 localStorage 键,同一浏览器里两边偏好互通 */
|
|
6892
6899
|
readChrome() {
|
|
6893
|
-
this.state.leftCollapsed =
|
|
6900
|
+
this.state.leftCollapsed = ir(tr), this.state.propCollapsed = ir(or), this.chromeKey = `${this.state.leftCollapsed ? 1 : 0}|${this.state.propCollapsed ? 1 : 0}`;
|
|
6894
6901
|
}
|
|
6895
6902
|
persistChrome() {
|
|
6896
6903
|
const e = `${this.state.leftCollapsed ? 1 : 0}|${this.state.propCollapsed ? 1 : 0}`;
|
|
6897
|
-
e !== this.chromeKey && (this.chromeKey = e,
|
|
6904
|
+
e !== this.chromeKey && (this.chromeKey = e, nr(tr, this.state.leftCollapsed), nr(or, this.state.propCollapsed));
|
|
6898
6905
|
}
|
|
6899
6906
|
disconnectedCallback() {
|
|
6900
|
-
this.unsub?.(), this.unsub = null, this.detachDocKeys(), this.ro?.disconnect(), this.ro = null, this.roArea = null, this.toolbarRo?.disconnect(), this.toolbarRo = null, Ue.active === this && (Ue.active = null),
|
|
6907
|
+
this.unsub?.(), this.unsub = null, this.detachDocKeys(), this.ro?.disconnect(), this.ro = null, this.roArea = null, this.toolbarRo?.disconnect(), this.toolbarRo = null, Ue.active === this && (Ue.active = null), Vr(), this.unmountHelp?.(), this.unmountHelp = null, this.hideHoverTip(), this.snapTimer && (clearTimeout(this.snapTimer), this.snapTimer = null);
|
|
6901
6908
|
}
|
|
6902
6909
|
/**
|
|
6903
6910
|
* 注入 @font-face:既进 shadow root(画布文档内),也进宿主文档 head。
|
|
@@ -6953,7 +6960,7 @@ ${t.join(`
|
|
|
6953
6960
|
/** 拼版配置校验:getTemplateJson 是旁路,宿主导出/另存时需自行调用拦截 */
|
|
6954
6961
|
validateTemplate() {
|
|
6955
6962
|
const e = this.store.templateData;
|
|
6956
|
-
return e.tiling?.enabled === !0 ?
|
|
6963
|
+
return e.tiling?.enabled === !0 ? zr(e) : [];
|
|
6957
6964
|
}
|
|
6958
6965
|
/**
|
|
6959
6966
|
* 出纸裁切提示(旋转外接盒顶越页首、元素超出纸面左右缘),与 canvas 同名同口径。
|
|
@@ -7016,7 +7023,7 @@ ${t.join(`
|
|
|
7016
7023
|
if (n.startsWith("options.")) {
|
|
7017
7024
|
if (n.includes("[")) {
|
|
7018
7025
|
const s = this.store.elements.find((l) => l.id === e.elementId);
|
|
7019
|
-
s &&
|
|
7026
|
+
s && Pi(this.store, s, n, i);
|
|
7020
7027
|
return;
|
|
7021
7028
|
}
|
|
7022
7029
|
const r = { [n.slice(8)]: i || void 0 };
|
|
@@ -7043,7 +7050,7 @@ ${t.join(`
|
|
|
7043
7050
|
dblEditCell(e) {
|
|
7044
7051
|
const t = this.store.elements.find((l) => l.id === e.elementId);
|
|
7045
7052
|
if (!t || (this.store.selectOne(t.id), this.state.propTab = "element", t.options.locked)) return;
|
|
7046
|
-
const i = t.options.tableRows ?? [], n =
|
|
7053
|
+
const i = t.options.tableRows ?? [], n = Ar(i, e.r, e.c), s = i[n.r]?.cells[n.c];
|
|
7047
7054
|
s && this.openExpression({
|
|
7048
7055
|
elementId: t.id,
|
|
7049
7056
|
targetPath: `options.tableRows[${n.r}].cells[${n.c}].formatter`,
|
|
@@ -7087,15 +7094,15 @@ ${t.join(`
|
|
|
7087
7094
|
const e = [...this.store.selectedIds].join(",");
|
|
7088
7095
|
e !== this.lastSelKey && (this.lastSelKey = e, this.state.propTab = e ? "element" : "page");
|
|
7089
7096
|
const t = this.root.querySelector(".designer-container");
|
|
7090
|
-
t.classList.toggle("format-painting", this.format.painterActive),
|
|
7097
|
+
t.classList.toggle("format-painting", this.format.painterActive), Lr(t);
|
|
7091
7098
|
const i = this.ctx;
|
|
7092
7099
|
fe(up(i, tc(i)), t), fe(lc(i), t), fe(a("div", { class: "designer-body" }, [
|
|
7093
7100
|
nc(i),
|
|
7094
7101
|
Ld(i, this.canvasUi()),
|
|
7095
7102
|
Wc(i)
|
|
7096
|
-
]), t), fe(dc(i), t),
|
|
7103
|
+
]), t), fe(dc(i), t), Qn(t), !this.toolbarRo && typeof ResizeObserver < "u" && (this.toolbarRo = new ResizeObserver(() => Qn(t)), this.toolbarRo.observe(t));
|
|
7097
7104
|
const n = ud(this.store, (r, s) => this.fire(r, s), this.tableMenu);
|
|
7098
|
-
n && fe(n, t), $l(this.root, this.store.elements),
|
|
7105
|
+
n && fe(n, t), $l(this.root, this.store.elements), ea(this.root, this.state.propSearch), this.applyShrinkFit(), this.syncRulers(), this.persistChrome();
|
|
7099
7106
|
}
|
|
7100
7107
|
/**
|
|
7101
7108
|
* 自动缩小实测遍:与 canvas 的 useShrinkFit 同一算法(core/browser fitTextNode),
|
|
@@ -7151,7 +7158,7 @@ ${t.join(`
|
|
|
7151
7158
|
n && (n.style.left = `${i.options.left}mm`, n.style.top = `${i.options.top}mm`, n.style.width = `${i.options.width}mm`, n.style.height = `${i.options.height}mm`);
|
|
7152
7159
|
}
|
|
7153
7160
|
const e = this.root.querySelector(".position-label"), t = this.store.selectedElement;
|
|
7154
|
-
e && t && !this.drag && (e.textContent =
|
|
7161
|
+
e && t && !this.drag && (e.textContent = Xr(t.options));
|
|
7155
7162
|
}
|
|
7156
7163
|
// ─── 动作分发 ───
|
|
7157
7164
|
fire(e, t) {
|
|
@@ -7523,7 +7530,7 @@ ${t.join(`
|
|
|
7523
7530
|
zoomByStep(e) {
|
|
7524
7531
|
const t = this.root.querySelector(".canvas-area");
|
|
7525
7532
|
t && this.applyZoom(
|
|
7526
|
-
|
|
7533
|
+
dn(this.store.scale, e),
|
|
7527
7534
|
t.clientWidth / 2,
|
|
7528
7535
|
t.clientHeight / 2,
|
|
7529
7536
|
Jo
|
|
@@ -7546,7 +7553,7 @@ ${t.join(`
|
|
|
7546
7553
|
e.preventDefault();
|
|
7547
7554
|
const t = this.root.querySelector(".canvas-area");
|
|
7548
7555
|
if (!t) return;
|
|
7549
|
-
const i = Math.round(this.store.scale), n =
|
|
7556
|
+
const i = Math.round(this.store.scale), n = dn(i, e.deltaY > 0 ? -1 : 1);
|
|
7550
7557
|
if (n === i) return;
|
|
7551
7558
|
const r = t.getBoundingClientRect();
|
|
7552
7559
|
this.applyZoom(n, e.clientX - r.left, e.clientY - r.top, Jo);
|
|
@@ -7688,10 +7695,10 @@ function kp() {
|
|
|
7688
7695
|
export {
|
|
7689
7696
|
js as DesignerStore,
|
|
7690
7697
|
Ue as PrintDesignerElement,
|
|
7691
|
-
|
|
7698
|
+
mn as TILING_SINGLE_PAGE_TIP,
|
|
7692
7699
|
mo as createDefaultTemplate,
|
|
7693
7700
|
xp as definePrintDesigner,
|
|
7694
7701
|
kp as registerAll,
|
|
7695
7702
|
qs as serializePage,
|
|
7696
|
-
|
|
7703
|
+
Or as toRuntimePool
|
|
7697
7704
|
};
|