@nice2dev/ui-printing 1.1.10 → 1.2.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 +0 -6
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1312 -1295
- package/dist/types/printingTypes.d.ts +2 -2
- package/dist/ui-printing.css +1 -1
- package/package.json +3 -3
- package/src/__tests__/renders-empty.test.tsx +46 -0
- package/src/print-preview/NicePrintPreview.tsx +5 -1
- package/src/print-preview/PrintPreview.module.css +1 -1
- package/src/print-queue/NicePrintQueue.tsx +5 -1
- package/src/print-queue/PrintQueue.module.css +1 -1
- package/src/template-browser/NiceTemplateBrowser.tsx +5 -1
- package/src/template-editor/NiceTemplateEditor.tsx +52 -25
- package/src/template-editor/TemplateEditor.module.css +3 -3
- package/src/types/printingTypes.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as e, jsxs as a, Fragment as
|
|
2
|
-
import { useNiceTranslation as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as X, NiceAppShell as Ve, NiceIcon as S } from "@nice2dev/ui";
|
|
3
|
+
import Xe, { useReducer as Ke, useState as H, useCallback as E, useMemo as ue, useEffect as Se, useRef as Je } from "react";
|
|
4
4
|
import { createPortal as Qe } from "react-dom";
|
|
5
|
-
const Ze = "
|
|
5
|
+
const Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt = "_toolbarGroup_19f1m_75", at = "_toolbarBtn_19f1m_107", it = "_toolbarBtnActive_19f1m_171", st = "_toolbarBtnDanger_19f1m_195", rt = "_toolbarSelect_19f1m_207", ot = "_toolbarSep_19f1m_237", lt = "_insertWrapper_19f1m_263", ct = "_insertBtn_19f1m_271", dt = "_insertDropdown_19f1m_293", mt = "_insertCategory_19f1m_333", pt = "_insertItem_19f1m_351", ut = "_insertIcon_19f1m_395", ht = "_zoomSelect_19f1m_409", _t = "_saveBtn_19f1m_441", gt = "_editorBody_19f1m_477", bt = "_leftPanel_19f1m_493", yt = "_leftTabs_19f1m_523", ft = "_leftTab_19f1m_523", vt = "_leftTabActive_19f1m_601", Nt = "_leftTabIcon_19f1m_621", wt = "_leftTabLabel_19f1m_629", kt = "_leftContent_19f1m_639", St = "_panelHeader_19f1m_653", Ct = "_panelHeaderIcon_19f1m_677", Bt = "_panelHeaderName_19f1m_685", It = "_searchBox_19f1m_699", Lt = "_searchInput_19f1m_707", xt = "_fieldList_19f1m_753", zt = "_fieldItem_19f1m_763", Tt = "_fieldItemIcon_19f1m_807", $t = "_fieldItemInfo_19f1m_821", Dt = "_fieldItemLabel_19f1m_831", Rt = "_fieldItemPath_19f1m_847", At = "_fieldItemType_19f1m_863", Et = "_layerList_19f1m_883", Mt = "_layerItem_19f1m_895", Pt = "_layerItemSelected_19f1m_931", Ft = "_layerIcon_19f1m_949", Ht = "_layerName_19f1m_961", Gt = "_layerActions_19f1m_977", Ot = "_layerBtn_19f1m_999", qt = "_wmList_19f1m_1031", Wt = "_wmItem_19f1m_1039", Yt = "_wmRow_19f1m_1065", jt = "_wmLabel_19f1m_1079", Ut = "_wmInput_19f1m_1091", Vt = "_wmInputNum_19f1m_1123", Xt = "_wmSelect_19f1m_1143", Kt = "_wmSlider_19f1m_1175", Jt = "_wmValue_19f1m_1185", Qt = "_wmUnit_19f1m_1199", Zt = "_wmDelete_19f1m_1209", en = "_addBtn_19f1m_1241", tn = "_settingsForm_19f1m_1277", nn = "_settingsRow_19f1m_1285", an = "_settingsLabel_19f1m_1299", sn = "_settingsInput_19f1m_1311", rn = "_settingsInputNum_19f1m_1343", on = "_settingsTextarea_19f1m_1375", ln = "_settingsDivider_19f1m_1409", cn = "_settingsUnit_19f1m_1429", dn = "_emptyMsg_19f1m_1441", mn = "_canvasArea_19f1m_1459", pn = "_testDataBar_19f1m_1485", un = "_testDataLabel_19f1m_1517", hn = "_testDataSelect_19f1m_1527", _n = "_rulerWrapper_19f1m_1547", gn = "_rulerCorner_19f1m_1563", bn = "_ruler_19f1m_1547", yn = "_ruler_h_19f1m_1621", fn = "_ruler_v_19f1m_1631", vn = "_rulerTick_19f1m_1651", Nn = "_rulerTickMajor_19f1m_1691", wn = "_rulerLabel_19f1m_1711", kn = "_paperScroll_19f1m_1749", Sn = "_paperShadow_19f1m_1767", Cn = "_marginGuide_19f1m_1803", Bn = "_watermark_19f1m_1819", In = "_sectionCanvas_19f1m_1845", Ln = "_sectionCanvasOver_19f1m_1859", xn = "_sectionTypeChip_19f1m_1867", zn = "_sectionResizeBar_19f1m_1899", Tn = "_sectionResizeGrip_19f1m_1933", $n = "_fieldImagePlaceholder_19f1m_1949", Dn = "_fieldBarcodePlaceholder_19f1m_1971", Rn = "_fieldSignaturePlaceholder_19f1m_1999", An = "_resizeHandle_19f1m_2031", En = "_handle_n_19f1m_2051", Mn = "_handle_s_19f1m_2063", Pn = "_handle_e_19f1m_2075", Fn = "_handle_w_19f1m_2087", Hn = "_handle_ne_19f1m_2099", Gn = "_handle_nw_19f1m_2109", On = "_handle_se_19f1m_2119", qn = "_handle_sw_19f1m_2129", Wn = "_rightPanel_19f1m_2143", Yn = "_rightTabs_19f1m_2173", jn = "_rightTab_19f1m_2173", Un = "_rightTabActive_19f1m_2243", Vn = "_propsBody_19f1m_2255", Xn = "_propsEmpty_19f1m_2267", Kn = "_propsEmptyIcon_19f1m_2289", Jn = "_propsEmptyText_19f1m_2299", Qn = "_posGrid_19f1m_2311", Zn = "_posCell_19f1m_2325", ea = "_posLabel_19f1m_2337", ta = "_posInput_19f1m_2349", na = "_posUnit_19f1m_2391", aa = "_snapSection_19f1m_2403", ia = "_snapTitle_19f1m_2411", sa = "_snapRow_19f1m_2429", ra = "_snapBtn_19f1m_2439", oa = "_styleGroup_19f1m_2473", la = "_styleGroupTitle_19f1m_2481", ca = "_styleRow_19f1m_2511", da = "_styleLabel_19f1m_2525", ma = "_styleSelect_19f1m_2539", pa = "_styleSelectFull_19f1m_2569", ua = "_styleSelectSm_19f1m_2601", ha = "_styleSelectXs_19f1m_2621", _a = "_styleInput_19f1m_2653", ga = "_styleInputFull_19f1m_2685", ba = "_styleUnit_19f1m_2717", ya = "_styleValue_19f1m_2729", fa = "_toggleGroup_19f1m_2743", va = "_toggleBtn_19f1m_2753", Na = "_toggleBtnActive_19f1m_2787", wa = "_colorPicker_19f1m_2801", ka = "_colorHex_19f1m_2819", Sa = "_clearBtn_19f1m_2853", Ca = "_sliderInput_19f1m_2885", Ba = "_conditionalHint_19f1m_2897", Ia = "_clearConditionalBtn_19f1m_2929", La = "_shortcutGrid_19f1m_2961", xa = "_shortcutChip_19f1m_2975", za = "_shortcutKeys_19f1m_3007", Ta = "_shortcutLabel_19f1m_3027", t = {
|
|
6
6
|
root: Ze,
|
|
7
7
|
dark: et,
|
|
8
8
|
toolbar: tt,
|
|
@@ -11,21 +11,21 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
11
11
|
toolbarBtnActive: it,
|
|
12
12
|
toolbarBtnDanger: st,
|
|
13
13
|
toolbarSelect: rt,
|
|
14
|
-
toolbarSep:
|
|
15
|
-
insertWrapper:
|
|
14
|
+
toolbarSep: ot,
|
|
15
|
+
insertWrapper: lt,
|
|
16
16
|
insertBtn: ct,
|
|
17
17
|
insertDropdown: dt,
|
|
18
|
-
insertCategory:
|
|
19
|
-
insertItem:
|
|
20
|
-
insertIcon:
|
|
18
|
+
insertCategory: mt,
|
|
19
|
+
insertItem: pt,
|
|
20
|
+
insertIcon: ut,
|
|
21
21
|
zoomSelect: ht,
|
|
22
22
|
saveBtn: _t,
|
|
23
23
|
editorBody: gt,
|
|
24
24
|
leftPanel: bt,
|
|
25
25
|
leftTabs: yt,
|
|
26
|
-
leftTab:
|
|
27
|
-
leftTabActive:
|
|
28
|
-
leftTabIcon:
|
|
26
|
+
leftTab: ft,
|
|
27
|
+
leftTabActive: vt,
|
|
28
|
+
leftTabIcon: Nt,
|
|
29
29
|
leftTabLabel: wt,
|
|
30
30
|
leftContent: kt,
|
|
31
31
|
panelHeader: St,
|
|
@@ -36,25 +36,25 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
36
36
|
fieldList: xt,
|
|
37
37
|
fieldItem: zt,
|
|
38
38
|
fieldItemIcon: Tt,
|
|
39
|
-
fieldItemInfo:
|
|
40
|
-
fieldItemLabel:
|
|
39
|
+
fieldItemInfo: $t,
|
|
40
|
+
fieldItemLabel: Dt,
|
|
41
41
|
fieldItemPath: Rt,
|
|
42
42
|
fieldItemType: At,
|
|
43
|
-
layerList:
|
|
44
|
-
layerItem:
|
|
45
|
-
layerItemSelected:
|
|
43
|
+
layerList: Et,
|
|
44
|
+
layerItem: Mt,
|
|
45
|
+
layerItemSelected: Pt,
|
|
46
46
|
layerIcon: Ft,
|
|
47
47
|
layerName: Ht,
|
|
48
48
|
layerActions: Gt,
|
|
49
49
|
layerBtn: Ot,
|
|
50
50
|
wmList: qt,
|
|
51
51
|
wmItem: Wt,
|
|
52
|
-
wmRow:
|
|
53
|
-
wmLabel:
|
|
54
|
-
wmInput:
|
|
55
|
-
wmInputNum:
|
|
56
|
-
wmSelect:
|
|
57
|
-
wmSlider:
|
|
52
|
+
wmRow: Yt,
|
|
53
|
+
wmLabel: jt,
|
|
54
|
+
wmInput: Ut,
|
|
55
|
+
wmInputNum: Vt,
|
|
56
|
+
wmSelect: Xt,
|
|
57
|
+
wmSlider: Kt,
|
|
58
58
|
wmValue: Jt,
|
|
59
59
|
wmUnit: Qt,
|
|
60
60
|
wmDelete: Zt,
|
|
@@ -64,21 +64,21 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
64
64
|
settingsLabel: an,
|
|
65
65
|
settingsInput: sn,
|
|
66
66
|
settingsInputNum: rn,
|
|
67
|
-
settingsTextarea:
|
|
68
|
-
settingsDivider:
|
|
67
|
+
settingsTextarea: on,
|
|
68
|
+
settingsDivider: ln,
|
|
69
69
|
settingsUnit: cn,
|
|
70
70
|
emptyMsg: dn,
|
|
71
|
-
canvasArea:
|
|
72
|
-
testDataBar:
|
|
73
|
-
testDataLabel:
|
|
71
|
+
canvasArea: mn,
|
|
72
|
+
testDataBar: pn,
|
|
73
|
+
testDataLabel: un,
|
|
74
74
|
testDataSelect: hn,
|
|
75
75
|
rulerWrapper: _n,
|
|
76
76
|
rulerCorner: gn,
|
|
77
77
|
ruler: bn,
|
|
78
78
|
ruler_h: yn,
|
|
79
|
-
ruler_v:
|
|
80
|
-
rulerTick:
|
|
81
|
-
rulerTickMajor:
|
|
79
|
+
ruler_v: fn,
|
|
80
|
+
rulerTick: vn,
|
|
81
|
+
rulerTickMajor: Nn,
|
|
82
82
|
rulerLabel: wn,
|
|
83
83
|
paperScroll: kn,
|
|
84
84
|
paperShadow: Sn,
|
|
@@ -89,25 +89,25 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
89
89
|
sectionTypeChip: xn,
|
|
90
90
|
sectionResizeBar: zn,
|
|
91
91
|
sectionResizeGrip: Tn,
|
|
92
|
-
fieldImagePlaceholder:
|
|
93
|
-
fieldBarcodePlaceholder:
|
|
92
|
+
fieldImagePlaceholder: $n,
|
|
93
|
+
fieldBarcodePlaceholder: Dn,
|
|
94
94
|
fieldSignaturePlaceholder: Rn,
|
|
95
95
|
resizeHandle: An,
|
|
96
|
-
handle_n:
|
|
97
|
-
handle_s:
|
|
98
|
-
handle_e:
|
|
96
|
+
handle_n: En,
|
|
97
|
+
handle_s: Mn,
|
|
98
|
+
handle_e: Pn,
|
|
99
99
|
handle_w: Fn,
|
|
100
100
|
handle_ne: Hn,
|
|
101
101
|
handle_nw: Gn,
|
|
102
102
|
handle_se: On,
|
|
103
103
|
handle_sw: qn,
|
|
104
104
|
rightPanel: Wn,
|
|
105
|
-
rightTabs:
|
|
106
|
-
rightTab:
|
|
107
|
-
rightTabActive:
|
|
108
|
-
propsBody:
|
|
109
|
-
propsEmpty:
|
|
110
|
-
propsEmptyIcon:
|
|
105
|
+
rightTabs: Yn,
|
|
106
|
+
rightTab: jn,
|
|
107
|
+
rightTabActive: Un,
|
|
108
|
+
propsBody: Vn,
|
|
109
|
+
propsEmpty: Xn,
|
|
110
|
+
propsEmptyIcon: Kn,
|
|
111
111
|
propsEmptyText: Jn,
|
|
112
112
|
posGrid: Qn,
|
|
113
113
|
posCell: Zn,
|
|
@@ -118,21 +118,21 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
118
118
|
snapTitle: ia,
|
|
119
119
|
snapRow: sa,
|
|
120
120
|
snapBtn: ra,
|
|
121
|
-
styleGroup:
|
|
122
|
-
styleGroupTitle:
|
|
121
|
+
styleGroup: oa,
|
|
122
|
+
styleGroupTitle: la,
|
|
123
123
|
styleRow: ca,
|
|
124
124
|
styleLabel: da,
|
|
125
|
-
styleSelect:
|
|
126
|
-
styleSelectFull:
|
|
127
|
-
styleSelectSm:
|
|
125
|
+
styleSelect: ma,
|
|
126
|
+
styleSelectFull: pa,
|
|
127
|
+
styleSelectSm: ua,
|
|
128
128
|
styleSelectXs: ha,
|
|
129
129
|
styleInput: _a,
|
|
130
130
|
styleInputFull: ga,
|
|
131
131
|
styleUnit: ba,
|
|
132
132
|
styleValue: ya,
|
|
133
|
-
toggleGroup:
|
|
134
|
-
toggleBtn:
|
|
135
|
-
toggleBtnActive:
|
|
133
|
+
toggleGroup: fa,
|
|
134
|
+
toggleBtn: va,
|
|
135
|
+
toggleBtnActive: Na,
|
|
136
136
|
colorPicker: wa,
|
|
137
137
|
colorHex: ka,
|
|
138
138
|
clearBtn: Sa,
|
|
@@ -143,7 +143,7 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
143
143
|
shortcutChip: xa,
|
|
144
144
|
shortcutKeys: za,
|
|
145
145
|
shortcutLabel: Ta
|
|
146
|
-
},
|
|
146
|
+
}, W = 3.78, Le = {
|
|
147
147
|
A3: [297, 420],
|
|
148
148
|
A4: [210, 297],
|
|
149
149
|
A5: [148, 210],
|
|
@@ -152,7 +152,7 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
152
152
|
Legal: [216, 356],
|
|
153
153
|
Tabloid: [279, 432],
|
|
154
154
|
custom: [210, 297]
|
|
155
|
-
},
|
|
155
|
+
}, $a = [
|
|
156
156
|
"sans-serif",
|
|
157
157
|
"serif",
|
|
158
158
|
"monospace",
|
|
@@ -198,13 +198,13 @@ const Ze = "_root_lceud_3", et = "_dark_lceud_27", tt = "_toolbar_lceud_39", nt
|
|
|
198
198
|
page_number: "Page number",
|
|
199
199
|
total_pages: "Total pages",
|
|
200
200
|
print_date: "Print date"
|
|
201
|
-
}, we = (n,
|
|
202
|
-
function
|
|
203
|
-
switch (
|
|
201
|
+
}, we = (n, s) => _e[s] ? n(`printing.fieldType.${s}`, _e[s]) : s;
|
|
202
|
+
function Da(n, s) {
|
|
203
|
+
switch (s.type) {
|
|
204
204
|
case "UPDATE":
|
|
205
205
|
return {
|
|
206
206
|
past: [...n.past.slice(-50), n.present],
|
|
207
|
-
present:
|
|
207
|
+
present: s.payload,
|
|
208
208
|
future: []
|
|
209
209
|
};
|
|
210
210
|
case "UNDO":
|
|
@@ -227,13 +227,13 @@ const se = "#000000", ge = "#94a3b8";
|
|
|
227
227
|
function ce() {
|
|
228
228
|
return `f-${Date.now()}-${Math.floor(Math.random() * 1e3)}`;
|
|
229
229
|
}
|
|
230
|
-
function ze(n,
|
|
231
|
-
const
|
|
230
|
+
function ze(n, s) {
|
|
231
|
+
const m = {
|
|
232
232
|
id: ce(),
|
|
233
|
-
name: (
|
|
234
|
-
label: (
|
|
233
|
+
name: (s == null ? void 0 : s.label) ?? _e[n] ?? n,
|
|
234
|
+
label: (s == null ? void 0 : s.label) ?? _e[n] ?? n,
|
|
235
235
|
type: n,
|
|
236
|
-
dataPath: (
|
|
236
|
+
dataPath: (s == null ? void 0 : s.path) ?? "",
|
|
237
237
|
fallback: n === "static_text" ? "Static text" : void 0,
|
|
238
238
|
format: n === "date" || n === "datetime" ? "DD.MM.YYYY" : void 0,
|
|
239
239
|
position: {
|
|
@@ -244,45 +244,45 @@ function ze(n, l) {
|
|
|
244
244
|
},
|
|
245
245
|
style: { fontSize: 10, color: se, fontFamily: "sans-serif" }
|
|
246
246
|
};
|
|
247
|
-
return n === "rect" && (
|
|
248
|
-
...
|
|
247
|
+
return n === "rect" && (m.style.backgroundColor = "var(--nice-bg-secondary, #f1f5f9)"), n === "line" && (m.style = {
|
|
248
|
+
...m.style,
|
|
249
249
|
borderWidth: 0.5,
|
|
250
250
|
borderColor: se,
|
|
251
251
|
borderStyle: "solid"
|
|
252
|
-
}),
|
|
252
|
+
}), m;
|
|
253
253
|
}
|
|
254
254
|
const Te = ({
|
|
255
255
|
lengthMm: n,
|
|
256
|
-
zoom:
|
|
257
|
-
orientation:
|
|
256
|
+
zoom: s,
|
|
257
|
+
orientation: m
|
|
258
258
|
}) => {
|
|
259
|
-
const o = [],
|
|
260
|
-
for (let
|
|
261
|
-
const
|
|
259
|
+
const o = [], B = s < 0.6 ? 20 : s < 1 ? 10 : 5;
|
|
260
|
+
for (let N = 0; N <= n; N += B) {
|
|
261
|
+
const b = N * s * W, h = N % (B * 2) === 0;
|
|
262
262
|
o.push(
|
|
263
263
|
/* @__PURE__ */ e(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
266
|
-
className: `${t.rulerTick} ${
|
|
267
|
-
style:
|
|
268
|
-
children:
|
|
266
|
+
className: `${t.rulerTick} ${h ? t.rulerTickMajor : ""}`,
|
|
267
|
+
style: m === "h" ? { left: b } : { top: b },
|
|
268
|
+
children: h && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: N })
|
|
269
269
|
},
|
|
270
|
-
|
|
270
|
+
N
|
|
271
271
|
)
|
|
272
272
|
);
|
|
273
273
|
}
|
|
274
|
-
return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${
|
|
275
|
-
}, Ra = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Aa = ({ onResizeStart: n }) => /* @__PURE__ */ e(
|
|
274
|
+
return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${m}`]}`, children: o });
|
|
275
|
+
}, Ra = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Aa = ({ onResizeStart: n }) => /* @__PURE__ */ e(V, { children: Ra.map((s) => /* @__PURE__ */ e(
|
|
276
276
|
"div",
|
|
277
277
|
{
|
|
278
|
-
className: `${t.resizeHandle} ${t[`handle_${
|
|
279
|
-
onMouseDown: (
|
|
280
|
-
|
|
278
|
+
className: `${t.resizeHandle} ${t[`handle_${s}`]}`,
|
|
279
|
+
onMouseDown: (m) => {
|
|
280
|
+
m.stopPropagation(), n(s, m);
|
|
281
281
|
}
|
|
282
282
|
},
|
|
283
|
-
|
|
283
|
+
s
|
|
284
284
|
)) });
|
|
285
|
-
function
|
|
285
|
+
function Ea(n, s) {
|
|
286
286
|
if (n.type === "static_text")
|
|
287
287
|
return n.fallback ?? "Text";
|
|
288
288
|
if (n.type === "page_number")
|
|
@@ -291,92 +291,93 @@ function Ma(n, l) {
|
|
|
291
291
|
return "3";
|
|
292
292
|
if (n.type === "print_date")
|
|
293
293
|
return (/* @__PURE__ */ new Date()).toLocaleDateString("pl-PL");
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
(o,
|
|
297
|
-
|
|
294
|
+
if (s && n.dataPath) {
|
|
295
|
+
const m = n.dataPath.split(".").reduce(
|
|
296
|
+
(o, B) => o && typeof o == "object" ? o[B] : null,
|
|
297
|
+
s
|
|
298
298
|
);
|
|
299
|
-
if (
|
|
300
|
-
return String(
|
|
299
|
+
if (m != null)
|
|
300
|
+
return String(m);
|
|
301
301
|
}
|
|
302
302
|
return n.label ? `{${n.label}}` : `{${n.dataPath}}`;
|
|
303
303
|
}
|
|
304
|
-
const
|
|
304
|
+
const Ma = ({
|
|
305
305
|
field: n,
|
|
306
|
-
zoom:
|
|
307
|
-
selected:
|
|
306
|
+
zoom: s,
|
|
307
|
+
selected: m,
|
|
308
308
|
sampleData: o,
|
|
309
|
-
onClick:
|
|
310
|
-
onDragStart:
|
|
311
|
-
onResizeStart:
|
|
312
|
-
readOnly:
|
|
309
|
+
onClick: B,
|
|
310
|
+
onDragStart: N,
|
|
311
|
+
onResizeStart: b,
|
|
312
|
+
readOnly: h
|
|
313
313
|
}) => {
|
|
314
|
-
const
|
|
314
|
+
const g = n.position, _ = n.style, l = (i) => i * s * W, f = n.type === "line", C = n.type === "rect", z = n.type === "image" || n.type === "static_image", y = n.type === "barcode" || n.type === "qr", r = {
|
|
315
315
|
position: "absolute",
|
|
316
|
-
left:
|
|
317
|
-
top:
|
|
318
|
-
width:
|
|
319
|
-
height:
|
|
320
|
-
zIndex:
|
|
321
|
-
transform:
|
|
316
|
+
left: l(g.x),
|
|
317
|
+
top: l(g.y),
|
|
318
|
+
width: l(g.width),
|
|
319
|
+
height: l(g.height),
|
|
320
|
+
zIndex: g.zIndex ?? 1,
|
|
321
|
+
transform: _.rotation ? `rotate(${_.rotation}deg)` : void 0,
|
|
322
322
|
boxSizing: "border-box",
|
|
323
323
|
overflow: "hidden",
|
|
324
|
-
...!
|
|
325
|
-
fontSize: (
|
|
326
|
-
fontFamily:
|
|
327
|
-
fontWeight:
|
|
328
|
-
fontStyle:
|
|
329
|
-
color:
|
|
330
|
-
textAlign:
|
|
331
|
-
lineHeight:
|
|
332
|
-
letterSpacing:
|
|
333
|
-
padding:
|
|
324
|
+
...!f && !C ? {
|
|
325
|
+
fontSize: (_.fontSize ?? 10) * s,
|
|
326
|
+
fontFamily: _.fontFamily ?? "sans-serif",
|
|
327
|
+
fontWeight: _.fontWeight ?? "normal",
|
|
328
|
+
fontStyle: _.fontStyle ?? "normal",
|
|
329
|
+
color: _.color ?? se,
|
|
330
|
+
textAlign: _.textAlign ?? "left",
|
|
331
|
+
lineHeight: _.lineHeight ?? 1.4,
|
|
332
|
+
letterSpacing: _.letterSpacing ? `${_.letterSpacing}em` : void 0,
|
|
333
|
+
padding: _.padding ? l(_.padding) : 0
|
|
334
334
|
} : {},
|
|
335
|
-
backgroundColor:
|
|
336
|
-
borderWidth:
|
|
337
|
-
borderColor:
|
|
338
|
-
borderStyle:
|
|
339
|
-
borderRadius:
|
|
340
|
-
opacity:
|
|
341
|
-
outline:
|
|
335
|
+
backgroundColor: _.backgroundColor,
|
|
336
|
+
borderWidth: _.borderWidth ?? 0,
|
|
337
|
+
borderColor: _.borderColor ?? "transparent",
|
|
338
|
+
borderStyle: _.borderStyle ?? "solid",
|
|
339
|
+
borderRadius: _.borderRadius,
|
|
340
|
+
opacity: _.opacity,
|
|
341
|
+
outline: m ? "1.5px solid var(--nice-primary-hover, #2563eb)" : "1px dashed transparent",
|
|
342
342
|
outlineOffset: 1,
|
|
343
|
-
cursor:
|
|
343
|
+
cursor: h ? "default" : "move"
|
|
344
344
|
};
|
|
345
|
-
return /* @__PURE__ */ a("div", { style:
|
|
346
|
-
|
|
345
|
+
return /* @__PURE__ */ a("div", { style: r, onClick: B, onMouseDown: h ? void 0 : N, children: [
|
|
346
|
+
f ? /* @__PURE__ */ e(
|
|
347
347
|
"div",
|
|
348
348
|
{
|
|
349
349
|
style: {
|
|
350
350
|
width: "100%",
|
|
351
|
-
borderBottom: `${(
|
|
351
|
+
borderBottom: `${(_.borderWidth ?? 0.5) * s}px ${_.borderStyle ?? "solid"} ${_.borderColor ?? se}`
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
) :
|
|
355
|
-
/* @__PURE__ */ e(
|
|
354
|
+
) : C ? null : z ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: /* @__PURE__ */ e(S, { name: "image", size: 24 }) }) : y ? /* @__PURE__ */ a("div", { className: t.fieldBarcodePlaceholder, children: [
|
|
355
|
+
/* @__PURE__ */ e(S, { name: n.type === "qr" ? "qr-code" : "barcode", size: 14 }),
|
|
356
356
|
" ",
|
|
357
357
|
n.type === "qr" ? "QR" : "Barcode"
|
|
358
358
|
] }) : n.type === "signature" ? /* @__PURE__ */ a("div", { className: t.fieldSignaturePlaceholder, children: [
|
|
359
|
-
/* @__PURE__ */ e(
|
|
359
|
+
/* @__PURE__ */ e(S, { name: "pen", size: 14 }),
|
|
360
360
|
" ",
|
|
361
361
|
n.label
|
|
362
|
-
] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children:
|
|
363
|
-
|
|
362
|
+
] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: Ea(n, o) }),
|
|
363
|
+
m && !h && /* @__PURE__ */ e(Aa, { onResizeStart: b })
|
|
364
364
|
] });
|
|
365
|
-
},
|
|
365
|
+
}, Pa = ({
|
|
366
366
|
section: n,
|
|
367
|
-
zoom:
|
|
368
|
-
paperWidthMm:
|
|
367
|
+
zoom: s,
|
|
368
|
+
paperWidthMm: m,
|
|
369
369
|
selectedIds: o,
|
|
370
|
-
sampleData:
|
|
371
|
-
readOnly:
|
|
372
|
-
showGrid:
|
|
373
|
-
onFieldClick:
|
|
374
|
-
onFieldDragStart:
|
|
375
|
-
onResizeStart:
|
|
376
|
-
onSectionHeightChange:
|
|
377
|
-
onDropField:
|
|
370
|
+
sampleData: B,
|
|
371
|
+
readOnly: N,
|
|
372
|
+
showGrid: b,
|
|
373
|
+
onFieldClick: h,
|
|
374
|
+
onFieldDragStart: g,
|
|
375
|
+
onResizeStart: _,
|
|
376
|
+
onSectionHeightChange: l,
|
|
377
|
+
onDropField: f
|
|
378
378
|
}) => {
|
|
379
|
-
const
|
|
379
|
+
const C = (n.heightMm ?? (n.type === "body" ? 200 : 40)) * s * W, z = m * s * W, [y, r] = H(!1), i = {
|
|
380
|
+
// audit-allow: literal-color +3 — band tints on the white page - print colours
|
|
380
381
|
header: "rgba(219,234,254,0.35)",
|
|
381
382
|
footer: "rgba(220,252,231,0.35)",
|
|
382
383
|
background: "rgba(254,249,195,0.35)",
|
|
@@ -385,56 +386,56 @@ const Pa = ({
|
|
|
385
386
|
return /* @__PURE__ */ a(
|
|
386
387
|
"div",
|
|
387
388
|
{
|
|
388
|
-
className: `${t.sectionCanvas} ${
|
|
389
|
+
className: `${t.sectionCanvas} ${y ? t.sectionCanvasOver : ""}`,
|
|
389
390
|
style: {
|
|
390
|
-
width:
|
|
391
|
-
height:
|
|
391
|
+
width: z,
|
|
392
|
+
height: C,
|
|
392
393
|
position: "relative",
|
|
393
|
-
background:
|
|
394
|
-
backgroundImage:
|
|
395
|
-
repeating-linear-gradient(90deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 *
|
|
394
|
+
background: i[n.type] ?? "transparent",
|
|
395
|
+
backgroundImage: b ? `repeating-linear-gradient(0deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * s * W}px),
|
|
396
|
+
repeating-linear-gradient(90deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * s * W}px)` : void 0
|
|
396
397
|
},
|
|
397
|
-
onDragOver: (
|
|
398
|
-
|
|
398
|
+
onDragOver: (u) => {
|
|
399
|
+
u.preventDefault(), r(!0);
|
|
399
400
|
},
|
|
400
|
-
onDragLeave: () =>
|
|
401
|
-
onDrop: (
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
if (!
|
|
401
|
+
onDragLeave: () => r(!1),
|
|
402
|
+
onDrop: (u) => {
|
|
403
|
+
u.preventDefault(), r(!1);
|
|
404
|
+
const c = u.dataTransfer.getData("fieldPath");
|
|
405
|
+
if (!c)
|
|
405
406
|
return;
|
|
406
|
-
const
|
|
407
|
-
|
|
407
|
+
const F = u.currentTarget.getBoundingClientRect(), v = (u.clientX - F.left) / (s * W), D = (u.clientY - F.top) / (s * W);
|
|
408
|
+
f(n.id, c, Math.max(0, v), Math.max(0, D));
|
|
408
409
|
},
|
|
409
410
|
children: [
|
|
410
411
|
/* @__PURE__ */ e("div", { className: t.sectionTypeChip, children: n.type }),
|
|
411
|
-
n.fields.map((
|
|
412
|
-
|
|
412
|
+
n.fields.map((u) => /* @__PURE__ */ e(
|
|
413
|
+
Ma,
|
|
413
414
|
{
|
|
414
|
-
field:
|
|
415
|
-
zoom:
|
|
416
|
-
selected: o.has(
|
|
417
|
-
sampleData:
|
|
418
|
-
readOnly:
|
|
419
|
-
onClick: (
|
|
420
|
-
onDragStart: (
|
|
421
|
-
onResizeStart: (
|
|
415
|
+
field: u,
|
|
416
|
+
zoom: s,
|
|
417
|
+
selected: o.has(u.id),
|
|
418
|
+
sampleData: B,
|
|
419
|
+
readOnly: N,
|
|
420
|
+
onClick: (c) => h(u.id, c),
|
|
421
|
+
onDragStart: (c) => g(u.id, c),
|
|
422
|
+
onResizeStart: (c, F) => _(u.id, c, F)
|
|
422
423
|
},
|
|
423
|
-
|
|
424
|
+
u.id
|
|
424
425
|
)),
|
|
425
|
-
!
|
|
426
|
+
!N && n.type !== "body" && /* @__PURE__ */ e(
|
|
426
427
|
"div",
|
|
427
428
|
{
|
|
428
429
|
className: t.sectionResizeBar,
|
|
429
|
-
onMouseDown: (
|
|
430
|
-
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
},
|
|
435
|
-
document.removeEventListener("mousemove",
|
|
430
|
+
onMouseDown: (u) => {
|
|
431
|
+
u.preventDefault();
|
|
432
|
+
const c = u.clientY, F = n.heightMm ?? 40, v = (x) => {
|
|
433
|
+
const T = (x.clientY - c) / (s * W);
|
|
434
|
+
l(n.id, Math.max(10, F + T));
|
|
435
|
+
}, D = () => {
|
|
436
|
+
document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", D);
|
|
436
437
|
};
|
|
437
|
-
document.addEventListener("mousemove",
|
|
438
|
+
document.addEventListener("mousemove", v), document.addEventListener("mouseup", D);
|
|
438
439
|
},
|
|
439
440
|
children: /* @__PURE__ */ e("div", { className: t.sectionResizeGrip })
|
|
440
441
|
}
|
|
@@ -442,9 +443,9 @@ const Pa = ({
|
|
|
442
443
|
]
|
|
443
444
|
}
|
|
444
445
|
);
|
|
445
|
-
},
|
|
446
|
+
}, le = ({ keys: n, label: s }) => /* @__PURE__ */ a("div", { className: t.shortcutChip, children: [
|
|
446
447
|
/* @__PURE__ */ e("span", { className: t.shortcutKeys, children: n }),
|
|
447
|
-
/* @__PURE__ */ e("span", { className: t.shortcutLabel, children:
|
|
448
|
+
/* @__PURE__ */ e("span", { className: t.shortcutLabel, children: s })
|
|
448
449
|
] }), Fa = [
|
|
449
450
|
{ id: "fields", icon: "list", key: "printing.editor.tabFields", label: "Fields" },
|
|
450
451
|
{ id: "layers", icon: "layers", key: "printing.editor.tabLayers", label: "Layers" },
|
|
@@ -458,29 +459,29 @@ const Pa = ({
|
|
|
458
459
|
{ id: "conditional", key: "printing.editor.tabConditional", label: "Conditions" }
|
|
459
460
|
], Ga = ({
|
|
460
461
|
tpl: n,
|
|
461
|
-
zoom:
|
|
462
|
-
canUndo:
|
|
462
|
+
zoom: s,
|
|
463
|
+
canUndo: m,
|
|
463
464
|
canRedo: o,
|
|
464
|
-
showGrid:
|
|
465
|
-
showRulers:
|
|
466
|
-
readOnly:
|
|
467
|
-
selectedCount:
|
|
468
|
-
onPaperChange:
|
|
469
|
-
onZoom:
|
|
470
|
-
onUndo:
|
|
471
|
-
onRedo:
|
|
472
|
-
onToggleGrid:
|
|
473
|
-
onToggleRulers:
|
|
474
|
-
onInsert:
|
|
475
|
-
onDelete:
|
|
476
|
-
onDuplicate:
|
|
477
|
-
onAlignH:
|
|
478
|
-
onAlignV:
|
|
479
|
-
onBringForward:
|
|
480
|
-
onSendBackward:
|
|
481
|
-
onSave:
|
|
465
|
+
showGrid: B,
|
|
466
|
+
showRulers: N,
|
|
467
|
+
readOnly: b,
|
|
468
|
+
selectedCount: h,
|
|
469
|
+
onPaperChange: g,
|
|
470
|
+
onZoom: _,
|
|
471
|
+
onUndo: l,
|
|
472
|
+
onRedo: f,
|
|
473
|
+
onToggleGrid: C,
|
|
474
|
+
onToggleRulers: z,
|
|
475
|
+
onInsert: y,
|
|
476
|
+
onDelete: r,
|
|
477
|
+
onDuplicate: i,
|
|
478
|
+
onAlignH: u,
|
|
479
|
+
onAlignV: c,
|
|
480
|
+
onBringForward: F,
|
|
481
|
+
onSendBackward: v,
|
|
482
|
+
onSave: D
|
|
482
483
|
}) => {
|
|
483
|
-
const { t:
|
|
484
|
+
const { t: x } = X(), { t: T } = X(), [A, Y] = H(!1), Z = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
484
485
|
return /* @__PURE__ */ a("div", { className: t.toolbar, children: [
|
|
485
486
|
/* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
|
|
486
487
|
/* @__PURE__ */ e(
|
|
@@ -488,38 +489,38 @@ const Pa = ({
|
|
|
488
489
|
{
|
|
489
490
|
className: t.toolbarSelect,
|
|
490
491
|
value: n.paperSize,
|
|
491
|
-
onChange: (
|
|
492
|
-
children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((
|
|
492
|
+
onChange: (w) => g(w.target.value, n.orientation),
|
|
493
|
+
children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((w) => /* @__PURE__ */ e("option", { value: w, children: w }, w))
|
|
493
494
|
}
|
|
494
495
|
),
|
|
495
496
|
/* @__PURE__ */ e(
|
|
496
497
|
"button",
|
|
497
498
|
{
|
|
498
499
|
className: `${t.toolbarBtn} ${n.orientation === "portrait" ? t.toolbarBtnActive : ""}`,
|
|
499
|
-
onClick: () =>
|
|
500
|
-
title: "
|
|
501
|
-
children: /* @__PURE__ */ e(
|
|
500
|
+
onClick: () => g(n.paperSize, "portrait"),
|
|
501
|
+
title: x("templateEditor.portrait", "Portrait"),
|
|
502
|
+
children: /* @__PURE__ */ e(S, { name: "file", size: 14 })
|
|
502
503
|
}
|
|
503
504
|
),
|
|
504
505
|
/* @__PURE__ */ e(
|
|
505
506
|
"button",
|
|
506
507
|
{
|
|
507
508
|
className: `${t.toolbarBtn} ${n.orientation === "landscape" ? t.toolbarBtnActive : ""}`,
|
|
508
|
-
onClick: () =>
|
|
509
|
-
title: "
|
|
510
|
-
children: /* @__PURE__ */ e(
|
|
509
|
+
onClick: () => g(n.paperSize, "landscape"),
|
|
510
|
+
title: x("templateEditor.landscape", "Landscape"),
|
|
511
|
+
children: /* @__PURE__ */ e(S, { name: "file", size: 14, style: { transform: "rotate(90deg)" } })
|
|
511
512
|
}
|
|
512
513
|
)
|
|
513
514
|
] }),
|
|
514
|
-
!
|
|
515
|
+
!b && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
|
|
515
516
|
/* @__PURE__ */ e(
|
|
516
517
|
"button",
|
|
517
518
|
{
|
|
518
519
|
className: t.toolbarBtn,
|
|
519
|
-
disabled: !
|
|
520
|
-
onClick:
|
|
521
|
-
title: `${
|
|
522
|
-
children: /* @__PURE__ */ e(
|
|
520
|
+
disabled: !m,
|
|
521
|
+
onClick: l,
|
|
522
|
+
title: `${T("printing.editor.undo", "Undo")} (Ctrl+Z)`,
|
|
523
|
+
children: /* @__PURE__ */ e(S, { name: "undo", size: 14 })
|
|
523
524
|
}
|
|
524
525
|
),
|
|
525
526
|
/* @__PURE__ */ e(
|
|
@@ -527,44 +528,44 @@ const Pa = ({
|
|
|
527
528
|
{
|
|
528
529
|
className: t.toolbarBtn,
|
|
529
530
|
disabled: !o,
|
|
530
|
-
onClick:
|
|
531
|
-
title: `${
|
|
532
|
-
children: /* @__PURE__ */ e(
|
|
531
|
+
onClick: f,
|
|
532
|
+
title: `${T("printing.editor.redo", "Redo")} (Ctrl+Y)`,
|
|
533
|
+
children: /* @__PURE__ */ e(S, { name: "redo", size: 14 })
|
|
533
534
|
}
|
|
534
535
|
)
|
|
535
536
|
] }),
|
|
536
|
-
!
|
|
537
|
+
!b && /* @__PURE__ */ a("div", { className: t.insertWrapper, children: [
|
|
537
538
|
/* @__PURE__ */ a(
|
|
538
539
|
"button",
|
|
539
540
|
{
|
|
540
541
|
className: `${t.toolbarBtn} ${t.insertBtn}`,
|
|
541
|
-
onClick: () =>
|
|
542
|
+
onClick: () => Y((w) => !w),
|
|
542
543
|
children: [
|
|
543
|
-
/* @__PURE__ */ e(
|
|
544
|
+
/* @__PURE__ */ e(S, { name: "plus", size: 14 }),
|
|
544
545
|
" ",
|
|
545
|
-
|
|
546
|
+
T("printing.editor.insert", "Insert"),
|
|
546
547
|
" ",
|
|
547
|
-
/* @__PURE__ */ e(
|
|
548
|
+
/* @__PURE__ */ e(S, { name: "chevron-down", size: 12 })
|
|
548
549
|
]
|
|
549
550
|
}
|
|
550
551
|
),
|
|
551
|
-
|
|
552
|
-
/* @__PURE__ */ e("div", { className: t.insertCategory, children:
|
|
553
|
-
["text", "number", "currency", "date", "image", "barcode", "qr"].map((
|
|
552
|
+
A && /* @__PURE__ */ a("div", { className: t.insertDropdown, onMouseLeave: () => Y(!1), children: [
|
|
553
|
+
/* @__PURE__ */ e("div", { className: t.insertCategory, children: T("printing.editor.dataFields", "Data fields") }),
|
|
554
|
+
["text", "number", "currency", "date", "image", "barcode", "qr"].map((w) => /* @__PURE__ */ a(
|
|
554
555
|
"button",
|
|
555
556
|
{
|
|
556
557
|
className: t.insertItem,
|
|
557
558
|
onClick: () => {
|
|
558
|
-
|
|
559
|
+
y(w), Y(!1);
|
|
559
560
|
},
|
|
560
561
|
children: [
|
|
561
|
-
/* @__PURE__ */ e("span", { className: t.insertIcon, children: he[
|
|
562
|
-
we(
|
|
562
|
+
/* @__PURE__ */ e("span", { className: t.insertIcon, children: he[w] }),
|
|
563
|
+
we(T, w)
|
|
563
564
|
]
|
|
564
565
|
},
|
|
565
|
-
|
|
566
|
+
w
|
|
566
567
|
)),
|
|
567
|
-
/* @__PURE__ */ e("div", { className: t.insertCategory, children: "
|
|
568
|
+
/* @__PURE__ */ e("div", { className: t.insertCategory, children: x("templateEditor.staticElements", "Static elements") }),
|
|
568
569
|
[
|
|
569
570
|
"static_text",
|
|
570
571
|
"static_image",
|
|
@@ -573,31 +574,31 @@ const Pa = ({
|
|
|
573
574
|
"page_number",
|
|
574
575
|
"total_pages",
|
|
575
576
|
"print_date"
|
|
576
|
-
].map((
|
|
577
|
+
].map((w) => /* @__PURE__ */ a(
|
|
577
578
|
"button",
|
|
578
579
|
{
|
|
579
580
|
className: t.insertItem,
|
|
580
581
|
onClick: () => {
|
|
581
|
-
|
|
582
|
+
y(w), Y(!1);
|
|
582
583
|
},
|
|
583
584
|
children: [
|
|
584
|
-
/* @__PURE__ */ e("span", { className: t.insertIcon, children: he[
|
|
585
|
-
we(
|
|
585
|
+
/* @__PURE__ */ e("span", { className: t.insertIcon, children: he[w] }),
|
|
586
|
+
we(T, w)
|
|
586
587
|
]
|
|
587
588
|
},
|
|
588
|
-
|
|
589
|
+
w
|
|
589
590
|
)),
|
|
590
|
-
/* @__PURE__ */ e("div", { className: t.insertCategory, children: "
|
|
591
|
+
/* @__PURE__ */ e("div", { className: t.insertCategory, children: x("templateEditor.special", "Special") }),
|
|
591
592
|
/* @__PURE__ */ a(
|
|
592
593
|
"button",
|
|
593
594
|
{
|
|
594
595
|
className: t.insertItem,
|
|
595
596
|
onClick: () => {
|
|
596
|
-
|
|
597
|
+
y("watermark"), Y(!1);
|
|
597
598
|
},
|
|
598
599
|
children: [
|
|
599
|
-
/* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(
|
|
600
|
-
|
|
600
|
+
/* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(S, { name: "droplet", size: 14 }) }),
|
|
601
|
+
T("printing.editor.watermark", "Watermark")
|
|
601
602
|
]
|
|
602
603
|
}
|
|
603
604
|
),
|
|
@@ -606,33 +607,33 @@ const Pa = ({
|
|
|
606
607
|
{
|
|
607
608
|
className: t.insertItem,
|
|
608
609
|
onClick: () => {
|
|
609
|
-
|
|
610
|
+
y("signature"), Y(!1);
|
|
610
611
|
},
|
|
611
612
|
children: [
|
|
612
|
-
/* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(
|
|
613
|
-
|
|
613
|
+
/* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(S, { name: "pen", size: 14 }) }),
|
|
614
|
+
T("printing.editor.signature", "Signature")
|
|
614
615
|
]
|
|
615
616
|
}
|
|
616
617
|
)
|
|
617
618
|
] })
|
|
618
619
|
] }),
|
|
619
|
-
!
|
|
620
|
+
!b && h > 0 && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
|
|
620
621
|
/* @__PURE__ */ e(
|
|
621
622
|
"button",
|
|
622
623
|
{
|
|
623
624
|
className: t.toolbarBtn,
|
|
624
|
-
onClick:
|
|
625
|
-
title: `${
|
|
626
|
-
children: /* @__PURE__ */ e(
|
|
625
|
+
onClick: i,
|
|
626
|
+
title: `${T("printing.editor.duplicate", "Duplicate")} (Ctrl+D)`,
|
|
627
|
+
children: /* @__PURE__ */ e(S, { name: "copy", size: 14 })
|
|
627
628
|
}
|
|
628
629
|
),
|
|
629
630
|
/* @__PURE__ */ e(
|
|
630
631
|
"button",
|
|
631
632
|
{
|
|
632
633
|
className: `${t.toolbarBtn} ${t.toolbarBtnDanger}`,
|
|
633
|
-
onClick:
|
|
634
|
-
title: `${
|
|
635
|
-
children: /* @__PURE__ */ e(
|
|
634
|
+
onClick: r,
|
|
635
|
+
title: `${T("printing.action.remove", "Remove")} (Del)`,
|
|
636
|
+
children: /* @__PURE__ */ e(S, { name: "trash", size: 14 })
|
|
636
637
|
}
|
|
637
638
|
),
|
|
638
639
|
/* @__PURE__ */ e("span", { className: t.toolbarSep }),
|
|
@@ -640,35 +641,35 @@ const Pa = ({
|
|
|
640
641
|
"button",
|
|
641
642
|
{
|
|
642
643
|
className: t.toolbarBtn,
|
|
643
|
-
onClick: () =>
|
|
644
|
-
title:
|
|
645
|
-
children: /* @__PURE__ */ e(
|
|
644
|
+
onClick: () => u("left"),
|
|
645
|
+
title: T("printing.editor.alignLeft", "Align left"),
|
|
646
|
+
children: /* @__PURE__ */ e(S, { name: "align-left", size: 14 })
|
|
646
647
|
}
|
|
647
648
|
),
|
|
648
649
|
/* @__PURE__ */ e(
|
|
649
650
|
"button",
|
|
650
651
|
{
|
|
651
652
|
className: t.toolbarBtn,
|
|
652
|
-
onClick: () =>
|
|
653
|
-
title:
|
|
654
|
-
children: /* @__PURE__ */ e(
|
|
653
|
+
onClick: () => u("center"),
|
|
654
|
+
title: T("printing.editor.alignCenter", "Align centre"),
|
|
655
|
+
children: /* @__PURE__ */ e(S, { name: "align-center", size: 14 })
|
|
655
656
|
}
|
|
656
657
|
),
|
|
657
658
|
/* @__PURE__ */ e(
|
|
658
659
|
"button",
|
|
659
660
|
{
|
|
660
661
|
className: t.toolbarBtn,
|
|
661
|
-
onClick: () =>
|
|
662
|
-
title:
|
|
663
|
-
children: /* @__PURE__ */ e(
|
|
662
|
+
onClick: () => u("right"),
|
|
663
|
+
title: T("printing.editor.alignRight", "Align right"),
|
|
664
|
+
children: /* @__PURE__ */ e(S, { name: "align-right", size: 14 })
|
|
664
665
|
}
|
|
665
666
|
),
|
|
666
667
|
/* @__PURE__ */ e(
|
|
667
668
|
"button",
|
|
668
669
|
{
|
|
669
670
|
className: t.toolbarBtn,
|
|
670
|
-
onClick: () =>
|
|
671
|
-
title:
|
|
671
|
+
onClick: () => c("top"),
|
|
672
|
+
title: T("printing.editor.alignTop", "Align top"),
|
|
672
673
|
children: "⊤"
|
|
673
674
|
}
|
|
674
675
|
),
|
|
@@ -676,8 +677,8 @@ const Pa = ({
|
|
|
676
677
|
"button",
|
|
677
678
|
{
|
|
678
679
|
className: t.toolbarBtn,
|
|
679
|
-
onClick: () =>
|
|
680
|
-
title:
|
|
680
|
+
onClick: () => c("center"),
|
|
681
|
+
title: T("printing.editor.alignMiddle", "Align middle"),
|
|
681
682
|
children: "⊕"
|
|
682
683
|
}
|
|
683
684
|
),
|
|
@@ -685,20 +686,28 @@ const Pa = ({
|
|
|
685
686
|
"button",
|
|
686
687
|
{
|
|
687
688
|
className: t.toolbarBtn,
|
|
688
|
-
onClick: () =>
|
|
689
|
-
title:
|
|
689
|
+
onClick: () => c("bottom"),
|
|
690
|
+
title: T("printing.editor.alignBottom", "Align bottom"),
|
|
690
691
|
children: "⊥"
|
|
691
692
|
}
|
|
692
693
|
),
|
|
693
694
|
/* @__PURE__ */ e("span", { className: t.toolbarSep }),
|
|
694
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: H, title: "Do przodu", children: /* @__PURE__ */ e(N, { name: "arrow-up", size: 14 }) }),
|
|
695
695
|
/* @__PURE__ */ e(
|
|
696
696
|
"button",
|
|
697
697
|
{
|
|
698
698
|
className: t.toolbarBtn,
|
|
699
|
-
onClick:
|
|
700
|
-
title:
|
|
701
|
-
children: /* @__PURE__ */ e(
|
|
699
|
+
onClick: F,
|
|
700
|
+
title: x("templateEditor.bringForward", "Bring forward"),
|
|
701
|
+
children: /* @__PURE__ */ e(S, { name: "arrow-up", size: 14 })
|
|
702
|
+
}
|
|
703
|
+
),
|
|
704
|
+
/* @__PURE__ */ e(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
className: t.toolbarBtn,
|
|
708
|
+
onClick: v,
|
|
709
|
+
title: T("printing.editor.sendBackward", "Send backward"),
|
|
710
|
+
children: /* @__PURE__ */ e(S, { name: "arrow-down", size: 14 })
|
|
702
711
|
}
|
|
703
712
|
)
|
|
704
713
|
] }),
|
|
@@ -706,88 +715,88 @@ const Pa = ({
|
|
|
706
715
|
/* @__PURE__ */ e(
|
|
707
716
|
"button",
|
|
708
717
|
{
|
|
709
|
-
className: `${t.toolbarBtn} ${
|
|
710
|
-
onClick:
|
|
711
|
-
title:
|
|
718
|
+
className: `${t.toolbarBtn} ${B ? t.toolbarBtnActive : ""}`,
|
|
719
|
+
onClick: C,
|
|
720
|
+
title: T("printing.editor.grid", "Grid"),
|
|
712
721
|
children: "⊞"
|
|
713
722
|
}
|
|
714
723
|
),
|
|
715
724
|
/* @__PURE__ */ e(
|
|
716
725
|
"button",
|
|
717
726
|
{
|
|
718
|
-
className: `${t.toolbarBtn} ${
|
|
719
|
-
onClick:
|
|
720
|
-
title:
|
|
721
|
-
children: /* @__PURE__ */ e(
|
|
727
|
+
className: `${t.toolbarBtn} ${N ? t.toolbarBtnActive : ""}`,
|
|
728
|
+
onClick: z,
|
|
729
|
+
title: T("printing.editor.rulers", "Rulers"),
|
|
730
|
+
children: /* @__PURE__ */ e(S, { name: "ruler", size: 14 })
|
|
722
731
|
}
|
|
723
732
|
)
|
|
724
733
|
] }),
|
|
725
734
|
/* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
|
|
726
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
735
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => _(Math.max(0.25, s - 0.1)), children: "−" }),
|
|
727
736
|
/* @__PURE__ */ e(
|
|
728
737
|
"select",
|
|
729
738
|
{
|
|
730
739
|
className: t.zoomSelect,
|
|
731
|
-
value:
|
|
732
|
-
onChange: (
|
|
733
|
-
children:
|
|
734
|
-
Math.round(
|
|
740
|
+
value: Z.includes(s) ? s : "",
|
|
741
|
+
onChange: (w) => _(+w.target.value),
|
|
742
|
+
children: Z.map((w) => /* @__PURE__ */ a("option", { value: w, children: [
|
|
743
|
+
Math.round(w * 100),
|
|
735
744
|
"%"
|
|
736
|
-
] },
|
|
745
|
+
] }, w))
|
|
737
746
|
}
|
|
738
747
|
),
|
|
739
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
740
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
748
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => _(Math.min(3, s + 0.1)), children: "+" }),
|
|
749
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => _(1), title: "100%", children: "⊡" })
|
|
741
750
|
] }),
|
|
742
|
-
!
|
|
743
|
-
/* @__PURE__ */ e(
|
|
751
|
+
!b && D && /* @__PURE__ */ a("button", { className: t.saveBtn, onClick: D, children: [
|
|
752
|
+
/* @__PURE__ */ e(S, { name: "save", size: 14 }),
|
|
744
753
|
" ",
|
|
745
|
-
|
|
754
|
+
T("printing.editor.save", "Save")
|
|
746
755
|
] })
|
|
747
756
|
] });
|
|
748
757
|
}, Oa = ({
|
|
749
758
|
activeTab: n,
|
|
750
|
-
onTabChange:
|
|
751
|
-
schema:
|
|
759
|
+
onTabChange: s,
|
|
760
|
+
schema: m,
|
|
752
761
|
tpl: o,
|
|
753
|
-
allFields:
|
|
754
|
-
selectedIds:
|
|
755
|
-
onInsertSchemaField:
|
|
756
|
-
onSelectField:
|
|
757
|
-
onUpdateTpl:
|
|
758
|
-
onReorderField:
|
|
762
|
+
allFields: B,
|
|
763
|
+
selectedIds: N,
|
|
764
|
+
onInsertSchemaField: b,
|
|
765
|
+
onSelectField: h,
|
|
766
|
+
onUpdateTpl: g,
|
|
767
|
+
onReorderField: _
|
|
759
768
|
}) => {
|
|
760
|
-
const { t:
|
|
761
|
-
(r) => r.label.toLowerCase().includes(
|
|
769
|
+
const { t: l } = X(), { t: f } = X(), [C, z] = H(""), y = m == null ? void 0 : m.fields.filter(
|
|
770
|
+
(r) => r.label.toLowerCase().includes(C.toLowerCase()) || r.path.toLowerCase().includes(C.toLowerCase())
|
|
762
771
|
);
|
|
763
772
|
return /* @__PURE__ */ a("div", { className: t.leftPanel, children: [
|
|
764
773
|
/* @__PURE__ */ e("div", { className: t.leftTabs, children: Fa.map((r) => /* @__PURE__ */ a(
|
|
765
774
|
"button",
|
|
766
775
|
{
|
|
767
776
|
className: `${t.leftTab} ${n === r.id ? t.leftTabActive : ""}`,
|
|
768
|
-
onClick: () =>
|
|
769
|
-
title:
|
|
777
|
+
onClick: () => s(r.id),
|
|
778
|
+
title: f(r.key, r.label),
|
|
770
779
|
children: [
|
|
771
|
-
/* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(
|
|
772
|
-
/* @__PURE__ */ e("span", { className: t.leftTabLabel, children:
|
|
780
|
+
/* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(S, { name: r.icon, size: 16 }) }),
|
|
781
|
+
/* @__PURE__ */ e("span", { className: t.leftTabLabel, children: f(r.key, r.label) })
|
|
773
782
|
]
|
|
774
783
|
},
|
|
775
784
|
r.id
|
|
776
785
|
)) }),
|
|
777
786
|
/* @__PURE__ */ a("div", { className: t.leftContent, children: [
|
|
778
|
-
n === "fields" && /* @__PURE__ */ a(
|
|
779
|
-
/* @__PURE__ */ e("div", { className: t.panelHeader, children:
|
|
787
|
+
n === "fields" && /* @__PURE__ */ a(V, { children: [
|
|
788
|
+
/* @__PURE__ */ e("div", { className: t.panelHeader, children: f("printing.editor.dataFields", "Data fields") }),
|
|
780
789
|
/* @__PURE__ */ e("div", { className: t.searchBox, children: /* @__PURE__ */ e(
|
|
781
790
|
"input",
|
|
782
791
|
{
|
|
783
792
|
className: t.searchInput,
|
|
784
|
-
placeholder:
|
|
785
|
-
value:
|
|
786
|
-
onChange: (r) =>
|
|
793
|
+
placeholder: f("printing.editor.search", "Search…"),
|
|
794
|
+
value: C,
|
|
795
|
+
onChange: (r) => z(r.target.value)
|
|
787
796
|
}
|
|
788
797
|
) }),
|
|
789
|
-
|
|
790
|
-
(
|
|
798
|
+
m ? /* @__PURE__ */ a("div", { className: t.fieldList, children: [
|
|
799
|
+
(y ?? []).map((r) => /* @__PURE__ */ a(
|
|
791
800
|
"div",
|
|
792
801
|
{
|
|
793
802
|
className: t.fieldItem,
|
|
@@ -795,9 +804,9 @@ const Pa = ({
|
|
|
795
804
|
onDragStart: (i) => {
|
|
796
805
|
i.dataTransfer.setData("fieldPath", r.path), i.dataTransfer.setData("fieldLabel", r.label), i.dataTransfer.setData("fieldType", r.type);
|
|
797
806
|
},
|
|
798
|
-
onClick: () =>
|
|
807
|
+
onClick: () => b(r),
|
|
799
808
|
children: [
|
|
800
|
-
/* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: /* @__PURE__ */ e(
|
|
809
|
+
/* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: /* @__PURE__ */ e(S, { name: he[r.type] ?? "type", size: 14 }) }),
|
|
801
810
|
/* @__PURE__ */ a("div", { className: t.fieldItemInfo, children: [
|
|
802
811
|
/* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: r.label }),
|
|
803
812
|
/* @__PURE__ */ e("div", { className: t.fieldItemPath, children: r.path })
|
|
@@ -807,28 +816,28 @@ const Pa = ({
|
|
|
807
816
|
},
|
|
808
817
|
r.path
|
|
809
818
|
)),
|
|
810
|
-
(
|
|
811
|
-
] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children:
|
|
819
|
+
(y == null ? void 0 : y.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: f("printing.editor.noMatches", "No matches") })
|
|
820
|
+
] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: f(
|
|
812
821
|
"printing.editor.noSchema",
|
|
813
822
|
"No data schema. Assign an entity in the Settings tab."
|
|
814
823
|
) })
|
|
815
824
|
] }),
|
|
816
|
-
n === "layers" && /* @__PURE__ */ a(
|
|
825
|
+
n === "layers" && /* @__PURE__ */ a(V, { children: [
|
|
817
826
|
/* @__PURE__ */ a("div", { className: t.panelHeader, children: [
|
|
818
|
-
|
|
827
|
+
f("printing.editor.layers", "Layers"),
|
|
819
828
|
" (",
|
|
820
|
-
|
|
829
|
+
B.length,
|
|
821
830
|
")"
|
|
822
831
|
] }),
|
|
823
832
|
/* @__PURE__ */ a("div", { className: t.layerList, children: [
|
|
824
|
-
|
|
825
|
-
|
|
833
|
+
B.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: f("printing.editor.noElements", "No elements") }),
|
|
834
|
+
B.slice().reverse().map((r) => /* @__PURE__ */ a(
|
|
826
835
|
"div",
|
|
827
836
|
{
|
|
828
|
-
className: `${t.layerItem} ${
|
|
829
|
-
onClick: () =>
|
|
837
|
+
className: `${t.layerItem} ${N.has(r.id) ? t.layerItemSelected : ""}`,
|
|
838
|
+
onClick: () => h(r.id),
|
|
830
839
|
children: [
|
|
831
|
-
/* @__PURE__ */ e("span", { className: t.layerIcon, children: /* @__PURE__ */ e(
|
|
840
|
+
/* @__PURE__ */ e("span", { className: t.layerIcon, children: /* @__PURE__ */ e(S, { name: he[r.type] ?? "type", size: 14 }) }),
|
|
832
841
|
/* @__PURE__ */ e("span", { className: t.layerName, children: r.name || r.label }),
|
|
833
842
|
/* @__PURE__ */ a("div", { className: t.layerActions, children: [
|
|
834
843
|
/* @__PURE__ */ e(
|
|
@@ -836,10 +845,10 @@ const Pa = ({
|
|
|
836
845
|
{
|
|
837
846
|
className: t.layerBtn,
|
|
838
847
|
onClick: (i) => {
|
|
839
|
-
i.stopPropagation(),
|
|
848
|
+
i.stopPropagation(), _(r.id, -1);
|
|
840
849
|
},
|
|
841
|
-
title:
|
|
842
|
-
children: /* @__PURE__ */ e(
|
|
850
|
+
title: f("printing.editor.bringForward", "Bring forward"),
|
|
851
|
+
children: /* @__PURE__ */ e(S, { name: "arrow-up", size: 12 })
|
|
843
852
|
}
|
|
844
853
|
),
|
|
845
854
|
/* @__PURE__ */ e(
|
|
@@ -847,10 +856,10 @@ const Pa = ({
|
|
|
847
856
|
{
|
|
848
857
|
className: t.layerBtn,
|
|
849
858
|
onClick: (i) => {
|
|
850
|
-
i.stopPropagation(),
|
|
859
|
+
i.stopPropagation(), _(r.id, 1);
|
|
851
860
|
},
|
|
852
|
-
title:
|
|
853
|
-
children: /* @__PURE__ */ e(
|
|
861
|
+
title: f("printing.editor.sendBackward", "Send backward"),
|
|
862
|
+
children: /* @__PURE__ */ e(S, { name: "arrow-down", size: 12 })
|
|
854
863
|
}
|
|
855
864
|
)
|
|
856
865
|
] })
|
|
@@ -860,44 +869,44 @@ const Pa = ({
|
|
|
860
869
|
))
|
|
861
870
|
] })
|
|
862
871
|
] }),
|
|
863
|
-
n === "watermarks" && /* @__PURE__ */ a(
|
|
864
|
-
/* @__PURE__ */ e("div", { className: t.panelHeader, children: "
|
|
872
|
+
n === "watermarks" && /* @__PURE__ */ a(V, { children: [
|
|
873
|
+
/* @__PURE__ */ e("div", { className: t.panelHeader, children: l("templateEditor.watermarks", "Watermarks") }),
|
|
865
874
|
/* @__PURE__ */ a("div", { className: t.wmList, children: [
|
|
866
875
|
(o.watermarks ?? []).map((r) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
|
|
867
876
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
868
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
877
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.type", "Type") }),
|
|
869
878
|
/* @__PURE__ */ a(
|
|
870
879
|
"select",
|
|
871
880
|
{
|
|
872
881
|
className: t.wmSelect,
|
|
873
882
|
value: r.type,
|
|
874
883
|
onChange: (i) => {
|
|
875
|
-
var
|
|
876
|
-
return
|
|
877
|
-
watermarks: (
|
|
878
|
-
(
|
|
884
|
+
var u;
|
|
885
|
+
return g({
|
|
886
|
+
watermarks: (u = o.watermarks) == null ? void 0 : u.map(
|
|
887
|
+
(c) => c.id === r.id ? { ...c, type: i.target.value } : c
|
|
879
888
|
)
|
|
880
889
|
});
|
|
881
890
|
},
|
|
882
891
|
children: [
|
|
883
|
-
/* @__PURE__ */ e("option", { value: "text", children:
|
|
884
|
-
/* @__PURE__ */ e("option", { value: "image", children:
|
|
892
|
+
/* @__PURE__ */ e("option", { value: "text", children: f("printing.fieldType.text", "Text") }),
|
|
893
|
+
/* @__PURE__ */ e("option", { value: "image", children: f("printing.fieldType.image", "Image") })
|
|
885
894
|
]
|
|
886
895
|
}
|
|
887
896
|
)
|
|
888
897
|
] }),
|
|
889
898
|
r.type === "text" && /* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
890
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
899
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.fieldType.text", "Text") }),
|
|
891
900
|
/* @__PURE__ */ e(
|
|
892
901
|
"input",
|
|
893
902
|
{
|
|
894
903
|
className: t.wmInput,
|
|
895
904
|
value: r.text ?? "",
|
|
896
905
|
onChange: (i) => {
|
|
897
|
-
var
|
|
898
|
-
return
|
|
899
|
-
watermarks: (
|
|
900
|
-
(
|
|
906
|
+
var u;
|
|
907
|
+
return g({
|
|
908
|
+
watermarks: (u = o.watermarks) == null ? void 0 : u.map(
|
|
909
|
+
(c) => c.id === r.id ? { ...c, text: i.target.value } : c
|
|
901
910
|
)
|
|
902
911
|
});
|
|
903
912
|
}
|
|
@@ -905,7 +914,7 @@ const Pa = ({
|
|
|
905
914
|
)
|
|
906
915
|
] }),
|
|
907
916
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
908
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children: "
|
|
917
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: l("templateEditor.opacity", "Opacity") }),
|
|
909
918
|
/* @__PURE__ */ e(
|
|
910
919
|
"input",
|
|
911
920
|
{
|
|
@@ -916,10 +925,10 @@ const Pa = ({
|
|
|
916
925
|
className: t.wmSlider,
|
|
917
926
|
value: r.opacity,
|
|
918
927
|
onChange: (i) => {
|
|
919
|
-
var
|
|
920
|
-
return
|
|
921
|
-
watermarks: (
|
|
922
|
-
(
|
|
928
|
+
var u;
|
|
929
|
+
return g({
|
|
930
|
+
watermarks: (u = o.watermarks) == null ? void 0 : u.map(
|
|
931
|
+
(c) => c.id === r.id ? { ...c, opacity: +i.target.value } : c
|
|
923
932
|
)
|
|
924
933
|
});
|
|
925
934
|
}
|
|
@@ -931,7 +940,7 @@ const Pa = ({
|
|
|
931
940
|
] })
|
|
932
941
|
] }),
|
|
933
942
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
934
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
943
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.angle", "Angle") }),
|
|
935
944
|
/* @__PURE__ */ e(
|
|
936
945
|
"input",
|
|
937
946
|
{
|
|
@@ -942,10 +951,10 @@ const Pa = ({
|
|
|
942
951
|
className: t.wmSlider,
|
|
943
952
|
value: r.angle,
|
|
944
953
|
onChange: (i) => {
|
|
945
|
-
var
|
|
946
|
-
return
|
|
947
|
-
watermarks: (
|
|
948
|
-
(
|
|
954
|
+
var u;
|
|
955
|
+
return g({
|
|
956
|
+
watermarks: (u = o.watermarks) == null ? void 0 : u.map(
|
|
957
|
+
(c) => c.id === r.id ? { ...c, angle: +i.target.value } : c
|
|
949
958
|
)
|
|
950
959
|
});
|
|
951
960
|
}
|
|
@@ -957,7 +966,7 @@ const Pa = ({
|
|
|
957
966
|
] })
|
|
958
967
|
] }),
|
|
959
968
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
960
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
969
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.size", "Size") }),
|
|
961
970
|
/* @__PURE__ */ e(
|
|
962
971
|
"input",
|
|
963
972
|
{
|
|
@@ -967,10 +976,10 @@ const Pa = ({
|
|
|
967
976
|
className: t.wmInputNum,
|
|
968
977
|
value: r.fontSize ?? 48,
|
|
969
978
|
onChange: (i) => {
|
|
970
|
-
var
|
|
971
|
-
return
|
|
972
|
-
watermarks: (
|
|
973
|
-
(
|
|
979
|
+
var u;
|
|
980
|
+
return g({
|
|
981
|
+
watermarks: (u = o.watermarks) == null ? void 0 : u.map(
|
|
982
|
+
(c) => c.id === r.id ? { ...c, fontSize: +i.target.value } : c
|
|
974
983
|
)
|
|
975
984
|
});
|
|
976
985
|
}
|
|
@@ -979,7 +988,7 @@ const Pa = ({
|
|
|
979
988
|
/* @__PURE__ */ e("span", { className: t.wmUnit, children: "pt" })
|
|
980
989
|
] }),
|
|
981
990
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
982
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
991
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.colour", "Colour") }),
|
|
983
992
|
/* @__PURE__ */ e(
|
|
984
993
|
"input",
|
|
985
994
|
{
|
|
@@ -987,10 +996,10 @@ const Pa = ({
|
|
|
987
996
|
className: t.colorPicker,
|
|
988
997
|
value: r.color ?? ge,
|
|
989
998
|
onChange: (i) => {
|
|
990
|
-
var
|
|
991
|
-
return
|
|
992
|
-
watermarks: (
|
|
993
|
-
(
|
|
999
|
+
var u;
|
|
1000
|
+
return g({
|
|
1001
|
+
watermarks: (u = o.watermarks) == null ? void 0 : u.map(
|
|
1002
|
+
(c) => c.id === r.id ? { ...c, color: i.target.value } : c
|
|
994
1003
|
)
|
|
995
1004
|
});
|
|
996
1005
|
}
|
|
@@ -1003,9 +1012,9 @@ const Pa = ({
|
|
|
1003
1012
|
className: t.wmDelete,
|
|
1004
1013
|
onClick: () => {
|
|
1005
1014
|
var i;
|
|
1006
|
-
return
|
|
1015
|
+
return g({ watermarks: (i = o.watermarks) == null ? void 0 : i.filter((u) => u.id !== r.id) });
|
|
1007
1016
|
},
|
|
1008
|
-
children:
|
|
1017
|
+
children: f("printing.action.remove", "Remove")
|
|
1009
1018
|
}
|
|
1010
1019
|
)
|
|
1011
1020
|
] }, r.id)),
|
|
@@ -1013,7 +1022,7 @@ const Pa = ({
|
|
|
1013
1022
|
"button",
|
|
1014
1023
|
{
|
|
1015
1024
|
className: t.addBtn,
|
|
1016
|
-
onClick: () =>
|
|
1025
|
+
onClick: () => g({
|
|
1017
1026
|
watermarks: [
|
|
1018
1027
|
...o.watermarks ?? [],
|
|
1019
1028
|
{
|
|
@@ -1028,30 +1037,30 @@ const Pa = ({
|
|
|
1028
1037
|
]
|
|
1029
1038
|
}),
|
|
1030
1039
|
children: [
|
|
1031
|
-
/* @__PURE__ */ e(
|
|
1040
|
+
/* @__PURE__ */ e(S, { name: "plus", size: 12 }),
|
|
1032
1041
|
" ",
|
|
1033
|
-
|
|
1042
|
+
f("printing.editor.addWatermark", "Add watermark")
|
|
1034
1043
|
]
|
|
1035
1044
|
}
|
|
1036
1045
|
)
|
|
1037
1046
|
] })
|
|
1038
1047
|
] }),
|
|
1039
|
-
n === "signatures" && /* @__PURE__ */ a(
|
|
1040
|
-
/* @__PURE__ */ e("div", { className: t.panelHeader, children: "
|
|
1048
|
+
n === "signatures" && /* @__PURE__ */ a(V, { children: [
|
|
1049
|
+
/* @__PURE__ */ e("div", { className: t.panelHeader, children: l("templateEditor.signatures", "Signatures") }),
|
|
1041
1050
|
/* @__PURE__ */ a("div", { className: t.wmList, children: [
|
|
1042
1051
|
(o.signatures ?? []).map((r) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
|
|
1043
1052
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
1044
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children: "
|
|
1053
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: l("templateEditor.label", "Label") }),
|
|
1045
1054
|
/* @__PURE__ */ e(
|
|
1046
1055
|
"input",
|
|
1047
1056
|
{
|
|
1048
1057
|
className: t.wmInput,
|
|
1049
1058
|
value: r.label,
|
|
1050
1059
|
onChange: (i) => {
|
|
1051
|
-
var
|
|
1052
|
-
return
|
|
1053
|
-
signatures: (
|
|
1054
|
-
(
|
|
1060
|
+
var u;
|
|
1061
|
+
return g({
|
|
1062
|
+
signatures: (u = o.signatures) == null ? void 0 : u.map(
|
|
1063
|
+
(c) => c.id === r.id ? { ...c, label: i.target.value } : c
|
|
1055
1064
|
)
|
|
1056
1065
|
});
|
|
1057
1066
|
}
|
|
@@ -1059,17 +1068,17 @@ const Pa = ({
|
|
|
1059
1068
|
)
|
|
1060
1069
|
] }),
|
|
1061
1070
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
1062
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children: "
|
|
1071
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: l("templateEditor.signerName", "Name") }),
|
|
1063
1072
|
/* @__PURE__ */ e(
|
|
1064
1073
|
"input",
|
|
1065
1074
|
{
|
|
1066
1075
|
className: t.wmInput,
|
|
1067
1076
|
value: r.signerName ?? "",
|
|
1068
1077
|
onChange: (i) => {
|
|
1069
|
-
var
|
|
1070
|
-
return
|
|
1071
|
-
signatures: (
|
|
1072
|
-
(
|
|
1078
|
+
var u;
|
|
1079
|
+
return g({
|
|
1080
|
+
signatures: (u = o.signatures) == null ? void 0 : u.map(
|
|
1081
|
+
(c) => c.id === r.id ? { ...c, signerName: i.target.value } : c
|
|
1073
1082
|
)
|
|
1074
1083
|
});
|
|
1075
1084
|
}
|
|
@@ -1077,17 +1086,17 @@ const Pa = ({
|
|
|
1077
1086
|
)
|
|
1078
1087
|
] }),
|
|
1079
1088
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
1080
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
1089
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.fieldType.line", "Line") }),
|
|
1081
1090
|
/* @__PURE__ */ e(
|
|
1082
1091
|
"input",
|
|
1083
1092
|
{
|
|
1084
1093
|
type: "checkbox",
|
|
1085
1094
|
checked: r.showLine ?? !0,
|
|
1086
1095
|
onChange: (i) => {
|
|
1087
|
-
var
|
|
1088
|
-
return
|
|
1089
|
-
signatures: (
|
|
1090
|
-
(
|
|
1096
|
+
var u;
|
|
1097
|
+
return g({
|
|
1098
|
+
signatures: (u = o.signatures) == null ? void 0 : u.map(
|
|
1099
|
+
(c) => c.id === r.id ? { ...c, showLine: i.target.checked } : c
|
|
1091
1100
|
)
|
|
1092
1101
|
});
|
|
1093
1102
|
}
|
|
@@ -1095,17 +1104,17 @@ const Pa = ({
|
|
|
1095
1104
|
)
|
|
1096
1105
|
] }),
|
|
1097
1106
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
1098
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
1107
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.showDate", "Show date") }),
|
|
1099
1108
|
/* @__PURE__ */ e(
|
|
1100
1109
|
"input",
|
|
1101
1110
|
{
|
|
1102
1111
|
type: "checkbox",
|
|
1103
1112
|
checked: r.showDate ?? !1,
|
|
1104
1113
|
onChange: (i) => {
|
|
1105
|
-
var
|
|
1106
|
-
return
|
|
1107
|
-
signatures: (
|
|
1108
|
-
(
|
|
1114
|
+
var u;
|
|
1115
|
+
return g({
|
|
1116
|
+
signatures: (u = o.signatures) == null ? void 0 : u.map(
|
|
1117
|
+
(c) => c.id === r.id ? { ...c, showDate: i.target.checked } : c
|
|
1109
1118
|
)
|
|
1110
1119
|
});
|
|
1111
1120
|
}
|
|
@@ -1118,9 +1127,9 @@ const Pa = ({
|
|
|
1118
1127
|
className: t.wmDelete,
|
|
1119
1128
|
onClick: () => {
|
|
1120
1129
|
var i;
|
|
1121
|
-
return
|
|
1130
|
+
return g({ signatures: (i = o.signatures) == null ? void 0 : i.filter((u) => u.id !== r.id) });
|
|
1122
1131
|
},
|
|
1123
|
-
children:
|
|
1132
|
+
children: f("printing.action.remove", "Remove")
|
|
1124
1133
|
}
|
|
1125
1134
|
)
|
|
1126
1135
|
] }, r.id)),
|
|
@@ -1128,12 +1137,12 @@ const Pa = ({
|
|
|
1128
1137
|
"button",
|
|
1129
1138
|
{
|
|
1130
1139
|
className: t.addBtn,
|
|
1131
|
-
onClick: () =>
|
|
1140
|
+
onClick: () => g({
|
|
1132
1141
|
signatures: [
|
|
1133
1142
|
...o.signatures ?? [],
|
|
1134
1143
|
{
|
|
1135
1144
|
id: ce(),
|
|
1136
|
-
label:
|
|
1145
|
+
label: f("printing.editor.signature", "Signature"),
|
|
1137
1146
|
position: { x: 10, y: 5, width: 70, height: 22 },
|
|
1138
1147
|
showLine: !0,
|
|
1139
1148
|
showDate: !1
|
|
@@ -1141,54 +1150,54 @@ const Pa = ({
|
|
|
1141
1150
|
]
|
|
1142
1151
|
}),
|
|
1143
1152
|
children: [
|
|
1144
|
-
/* @__PURE__ */ e(
|
|
1153
|
+
/* @__PURE__ */ e(S, { name: "plus", size: 12 }),
|
|
1145
1154
|
" ",
|
|
1146
|
-
|
|
1155
|
+
f("printing.editor.addSignature", "Add signature")
|
|
1147
1156
|
]
|
|
1148
1157
|
}
|
|
1149
1158
|
)
|
|
1150
1159
|
] })
|
|
1151
1160
|
] }),
|
|
1152
|
-
n === "settings" && /* @__PURE__ */ a(
|
|
1153
|
-
/* @__PURE__ */ e("div", { className: t.panelHeader, children:
|
|
1161
|
+
n === "settings" && /* @__PURE__ */ a(V, { children: [
|
|
1162
|
+
/* @__PURE__ */ e("div", { className: t.panelHeader, children: f("printing.editor.templateSettings", "Template settings") }),
|
|
1154
1163
|
/* @__PURE__ */ a("div", { className: t.settingsForm, children: [
|
|
1155
1164
|
/* @__PURE__ */ a("div", { className: t.settingsRow, children: [
|
|
1156
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children:
|
|
1165
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: f("printing.editor.name", "Name") }),
|
|
1157
1166
|
/* @__PURE__ */ e(
|
|
1158
1167
|
"input",
|
|
1159
1168
|
{
|
|
1160
1169
|
className: t.settingsInput,
|
|
1161
1170
|
value: o.name,
|
|
1162
|
-
onChange: (r) =>
|
|
1171
|
+
onChange: (r) => g({ name: r.target.value })
|
|
1163
1172
|
}
|
|
1164
1173
|
)
|
|
1165
1174
|
] }),
|
|
1166
1175
|
/* @__PURE__ */ a("div", { className: t.settingsRow, children: [
|
|
1167
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children:
|
|
1176
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: f("printing.editor.description", "Description") }),
|
|
1168
1177
|
/* @__PURE__ */ e(
|
|
1169
1178
|
"textarea",
|
|
1170
1179
|
{
|
|
1171
1180
|
className: t.settingsTextarea,
|
|
1172
1181
|
value: o.description ?? "",
|
|
1173
|
-
onChange: (r) =>
|
|
1182
|
+
onChange: (r) => g({ description: r.target.value }),
|
|
1174
1183
|
rows: 2
|
|
1175
1184
|
}
|
|
1176
1185
|
)
|
|
1177
1186
|
] }),
|
|
1178
1187
|
/* @__PURE__ */ a("div", { className: t.settingsRow, children: [
|
|
1179
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: "
|
|
1188
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: l("templateEditor.category", "Category") }),
|
|
1180
1189
|
/* @__PURE__ */ e(
|
|
1181
1190
|
"input",
|
|
1182
1191
|
{
|
|
1183
1192
|
className: t.settingsInput,
|
|
1184
1193
|
value: o.category ?? "",
|
|
1185
|
-
onChange: (r) =>
|
|
1194
|
+
onChange: (r) => g({ category: r.target.value })
|
|
1186
1195
|
}
|
|
1187
1196
|
)
|
|
1188
1197
|
] }),
|
|
1189
|
-
/* @__PURE__ */ e("div", { className: t.settingsDivider, children:
|
|
1198
|
+
/* @__PURE__ */ e("div", { className: t.settingsDivider, children: f("printing.editor.margins", "Margins (mm)") }),
|
|
1190
1199
|
["top", "right", "bottom", "left"].map((r) => /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
|
|
1191
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: r === "top" ?
|
|
1200
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: r === "top" ? f("printing.editor.marginTop", "Top") : r === "right" ? f("printing.editor.marginRight", "Right") : r === "bottom" ? f("printing.editor.marginBottom", "Bottom") : f("printing.editor.marginLeft", "Left") }),
|
|
1192
1201
|
/* @__PURE__ */ e(
|
|
1193
1202
|
"input",
|
|
1194
1203
|
{
|
|
@@ -1198,7 +1207,7 @@ const Pa = ({
|
|
|
1198
1207
|
step: 1,
|
|
1199
1208
|
className: t.settingsInputNum,
|
|
1200
1209
|
value: o.margins[r],
|
|
1201
|
-
onChange: (i) =>
|
|
1210
|
+
onChange: (i) => g({ margins: { ...o.margins, [r]: +i.target.value } })
|
|
1202
1211
|
}
|
|
1203
1212
|
),
|
|
1204
1213
|
/* @__PURE__ */ e("span", { className: t.settingsUnit, children: "mm" })
|
|
@@ -1209,39 +1218,39 @@ const Pa = ({
|
|
|
1209
1218
|
] });
|
|
1210
1219
|
}, qa = ({
|
|
1211
1220
|
field: n,
|
|
1212
|
-
activeTab:
|
|
1213
|
-
onTabChange:
|
|
1221
|
+
activeTab: s,
|
|
1222
|
+
onTabChange: m,
|
|
1214
1223
|
onChange: o,
|
|
1215
|
-
paperWidthMm:
|
|
1216
|
-
paperHeightMm:
|
|
1224
|
+
paperWidthMm: B,
|
|
1225
|
+
paperHeightMm: N
|
|
1217
1226
|
}) => {
|
|
1218
|
-
var
|
|
1219
|
-
const { t:
|
|
1227
|
+
var C, z, y, r;
|
|
1228
|
+
const { t: b } = X(), { t: h } = X(), g = E(
|
|
1220
1229
|
(i) => n && o({ position: { ...n.position, ...i } }),
|
|
1221
1230
|
[n, o]
|
|
1222
|
-
),
|
|
1231
|
+
), _ = E(
|
|
1223
1232
|
(i) => n && o({ style: { ...(n == null ? void 0 : n.style) ?? {}, ...i } }),
|
|
1224
1233
|
[n, o]
|
|
1225
1234
|
);
|
|
1226
1235
|
if (!n)
|
|
1227
1236
|
return /* @__PURE__ */ a("div", { className: t.rightPanel, children: [
|
|
1228
|
-
/* @__PURE__ */ e("div", { className: t.panelHeader, children:
|
|
1237
|
+
/* @__PURE__ */ e("div", { className: t.panelHeader, children: h("printing.editor.properties", "Properties") }),
|
|
1229
1238
|
/* @__PURE__ */ a("div", { className: t.propsEmpty, children: [
|
|
1230
|
-
/* @__PURE__ */ e("div", { className: t.propsEmptyIcon, children: /* @__PURE__ */ e(
|
|
1231
|
-
/* @__PURE__ */ e("div", { className: t.propsEmptyText, children:
|
|
1239
|
+
/* @__PURE__ */ e("div", { className: t.propsEmptyIcon, children: /* @__PURE__ */ e(S, { name: "cursor", size: 28 }) }),
|
|
1240
|
+
/* @__PURE__ */ e("div", { className: t.propsEmptyText, children: h("printing.editor.selectElement", "Select an element on the template") }),
|
|
1232
1241
|
/* @__PURE__ */ a("div", { className: t.shortcutGrid, children: [
|
|
1233
|
-
/* @__PURE__ */ e(
|
|
1234
|
-
/* @__PURE__ */ e(
|
|
1235
|
-
/* @__PURE__ */ e(
|
|
1236
|
-
/* @__PURE__ */ e(
|
|
1237
|
-
/* @__PURE__ */ e(
|
|
1238
|
-
/* @__PURE__ */ e(
|
|
1242
|
+
/* @__PURE__ */ e(le, { keys: "Del", label: h("printing.action.remove", "Remove") }),
|
|
1243
|
+
/* @__PURE__ */ e(le, { keys: "Ctrl+D", label: h("printing.editor.duplicate", "Duplicate") }),
|
|
1244
|
+
/* @__PURE__ */ e(le, { keys: "↑↓←→", label: h("printing.editor.move", "Move") }),
|
|
1245
|
+
/* @__PURE__ */ e(le, { keys: "Ctrl+Z", label: h("printing.editor.undo", "Undo") }),
|
|
1246
|
+
/* @__PURE__ */ e(le, { keys: "Ctrl+A", label: h("printing.editor.selectAll", "Select all") }),
|
|
1247
|
+
/* @__PURE__ */ e(le, { keys: "Shift+↑", label: h("printing.editor.move5mm", "Move 5 mm") })
|
|
1239
1248
|
] })
|
|
1240
1249
|
] })
|
|
1241
1250
|
] });
|
|
1242
|
-
const
|
|
1251
|
+
const l = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
|
|
1243
1252
|
n.type
|
|
1244
|
-
),
|
|
1253
|
+
), f = ![
|
|
1245
1254
|
"static_text",
|
|
1246
1255
|
"static_image",
|
|
1247
1256
|
"line",
|
|
@@ -1255,25 +1264,25 @@ const Pa = ({
|
|
|
1255
1264
|
/* @__PURE__ */ e("span", { className: t.panelHeaderIcon, children: he[n.type] }),
|
|
1256
1265
|
/* @__PURE__ */ e("span", { className: t.panelHeaderName, children: n.name })
|
|
1257
1266
|
] }),
|
|
1258
|
-
/* @__PURE__ */ e("div", { className: t.rightTabs, children: Ha.map((i) => i.id === "data" && !
|
|
1267
|
+
/* @__PURE__ */ e("div", { className: t.rightTabs, children: Ha.map((i) => i.id === "data" && !f ? null : /* @__PURE__ */ e(
|
|
1259
1268
|
"button",
|
|
1260
1269
|
{
|
|
1261
|
-
className: `${t.rightTab} ${
|
|
1262
|
-
onClick: () =>
|
|
1263
|
-
children:
|
|
1270
|
+
className: `${t.rightTab} ${s === i.id ? t.rightTabActive : ""}`,
|
|
1271
|
+
onClick: () => m(i.id),
|
|
1272
|
+
children: h(i.key, i.label)
|
|
1264
1273
|
},
|
|
1265
1274
|
i.id
|
|
1266
1275
|
)) }),
|
|
1267
1276
|
/* @__PURE__ */ a("div", { className: t.propsBody, children: [
|
|
1268
|
-
|
|
1277
|
+
s === "position" && /* @__PURE__ */ a(V, { children: [
|
|
1269
1278
|
/* @__PURE__ */ a("div", { className: t.posGrid, children: [
|
|
1270
1279
|
[
|
|
1271
1280
|
{ key: "x", label: "X", unit: "mm" },
|
|
1272
1281
|
{ key: "y", label: "Y", unit: "mm" },
|
|
1273
1282
|
{ key: "width", label: "Szer.", unit: "mm" },
|
|
1274
1283
|
{ key: "height", label: "Wys.", unit: "mm" }
|
|
1275
|
-
].map(({ key: i, label:
|
|
1276
|
-
/* @__PURE__ */ e("label", { className: t.posLabel, children:
|
|
1284
|
+
].map(({ key: i, label: u, unit: c }) => /* @__PURE__ */ a("div", { className: t.posCell, children: [
|
|
1285
|
+
/* @__PURE__ */ e("label", { className: t.posLabel, children: u }),
|
|
1277
1286
|
/* @__PURE__ */ e(
|
|
1278
1287
|
"input",
|
|
1279
1288
|
{
|
|
@@ -1281,13 +1290,13 @@ const Pa = ({
|
|
|
1281
1290
|
step: 0.5,
|
|
1282
1291
|
className: t.posInput,
|
|
1283
1292
|
value: Math.round(n.position[i] * 10) / 10,
|
|
1284
|
-
onChange: (
|
|
1293
|
+
onChange: (F) => g({ [i]: +F.target.value })
|
|
1285
1294
|
}
|
|
1286
1295
|
),
|
|
1287
|
-
/* @__PURE__ */ e("span", { className: t.posUnit, children:
|
|
1296
|
+
/* @__PURE__ */ e("span", { className: t.posUnit, children: c })
|
|
1288
1297
|
] }, i)),
|
|
1289
1298
|
/* @__PURE__ */ a("div", { className: t.posCell, children: [
|
|
1290
|
-
/* @__PURE__ */ e("label", { className: t.posLabel, children:
|
|
1299
|
+
/* @__PURE__ */ e("label", { className: t.posLabel, children: h("printing.editor.rotation", "Rotation") }),
|
|
1291
1300
|
/* @__PURE__ */ e(
|
|
1292
1301
|
"input",
|
|
1293
1302
|
{
|
|
@@ -1295,13 +1304,13 @@ const Pa = ({
|
|
|
1295
1304
|
step: 5,
|
|
1296
1305
|
className: t.posInput,
|
|
1297
1306
|
value: n.style.rotation ?? 0,
|
|
1298
|
-
onChange: (i) =>
|
|
1307
|
+
onChange: (i) => _({ rotation: +i.target.value })
|
|
1299
1308
|
}
|
|
1300
1309
|
),
|
|
1301
1310
|
/* @__PURE__ */ e("span", { className: t.posUnit, children: "°" })
|
|
1302
1311
|
] }),
|
|
1303
1312
|
/* @__PURE__ */ a("div", { className: t.posCell, children: [
|
|
1304
|
-
/* @__PURE__ */ e("label", { className: t.posLabel, children: "Z-idx" }),
|
|
1313
|
+
/* @__PURE__ */ e("label", { className: t.posLabel, children: b("templateEditor.zIdx", "Z-idx") }),
|
|
1305
1314
|
/* @__PURE__ */ e(
|
|
1306
1315
|
"input",
|
|
1307
1316
|
{
|
|
@@ -1310,29 +1319,29 @@ const Pa = ({
|
|
|
1310
1319
|
min: 1,
|
|
1311
1320
|
className: t.posInput,
|
|
1312
1321
|
value: n.position.zIndex ?? 1,
|
|
1313
|
-
onChange: (i) =>
|
|
1322
|
+
onChange: (i) => g({ zIndex: +i.target.value })
|
|
1314
1323
|
}
|
|
1315
1324
|
)
|
|
1316
1325
|
] })
|
|
1317
1326
|
] }),
|
|
1318
1327
|
/* @__PURE__ */ a("div", { className: t.snapSection, children: [
|
|
1319
|
-
/* @__PURE__ */ e("div", { className: t.snapTitle, children:
|
|
1328
|
+
/* @__PURE__ */ e("div", { className: t.snapTitle, children: h("printing.editor.snapToPage", "Snap to page") }),
|
|
1320
1329
|
/* @__PURE__ */ a("div", { className: t.snapRow, children: [
|
|
1321
1330
|
/* @__PURE__ */ e(
|
|
1322
1331
|
"button",
|
|
1323
1332
|
{
|
|
1324
1333
|
className: t.snapBtn,
|
|
1325
|
-
onClick: () =>
|
|
1326
|
-
title:
|
|
1327
|
-
children: /* @__PURE__ */ e(
|
|
1334
|
+
onClick: () => g({ x: 0 }),
|
|
1335
|
+
title: h("printing.editor.leftEdge", "Left edge"),
|
|
1336
|
+
children: /* @__PURE__ */ e(S, { name: "align-left", size: 14 })
|
|
1328
1337
|
}
|
|
1329
1338
|
),
|
|
1330
1339
|
/* @__PURE__ */ e(
|
|
1331
1340
|
"button",
|
|
1332
1341
|
{
|
|
1333
1342
|
className: t.snapBtn,
|
|
1334
|
-
onClick: () =>
|
|
1335
|
-
title:
|
|
1343
|
+
onClick: () => g({ x: (B - n.position.width) / 2 }),
|
|
1344
|
+
title: h("printing.editor.horizontalCentre", "Horizontal centre"),
|
|
1336
1345
|
children: "⊕"
|
|
1337
1346
|
}
|
|
1338
1347
|
),
|
|
@@ -1340,37 +1349,37 @@ const Pa = ({
|
|
|
1340
1349
|
"button",
|
|
1341
1350
|
{
|
|
1342
1351
|
className: t.snapBtn,
|
|
1343
|
-
onClick: () =>
|
|
1344
|
-
title:
|
|
1345
|
-
children: /* @__PURE__ */ e(
|
|
1352
|
+
onClick: () => g({ x: B - n.position.width }),
|
|
1353
|
+
title: h("printing.editor.rightEdge", "Right edge"),
|
|
1354
|
+
children: /* @__PURE__ */ e(S, { name: "align-right", size: 14 })
|
|
1346
1355
|
}
|
|
1347
1356
|
)
|
|
1348
1357
|
] })
|
|
1349
1358
|
] })
|
|
1350
1359
|
] }),
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: "
|
|
1360
|
+
s === "style" && /* @__PURE__ */ a(V, { children: [
|
|
1361
|
+
l && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
|
|
1362
|
+
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: b("templateEditor.font", "Font") }),
|
|
1354
1363
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1355
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "
|
|
1364
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.fontFamily", "Family") }),
|
|
1356
1365
|
/* @__PURE__ */ e(
|
|
1357
1366
|
"select",
|
|
1358
1367
|
{
|
|
1359
1368
|
className: t.styleSelectFull,
|
|
1360
1369
|
value: n.style.fontFamily ?? "sans-serif",
|
|
1361
|
-
onChange: (i) =>
|
|
1362
|
-
children:
|
|
1370
|
+
onChange: (i) => _({ fontFamily: i.target.value }),
|
|
1371
|
+
children: $a.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
|
|
1363
1372
|
}
|
|
1364
1373
|
)
|
|
1365
1374
|
] }),
|
|
1366
1375
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1367
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1376
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.size", "Size") }),
|
|
1368
1377
|
/* @__PURE__ */ e(
|
|
1369
1378
|
"select",
|
|
1370
1379
|
{
|
|
1371
1380
|
className: t.styleSelectSm,
|
|
1372
1381
|
value: xe.includes(n.style.fontSize ?? 10) ? n.style.fontSize ?? 10 : "",
|
|
1373
|
-
onChange: (i) =>
|
|
1382
|
+
onChange: (i) => _({ fontSize: +i.target.value }),
|
|
1374
1383
|
children: xe.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
|
|
1375
1384
|
}
|
|
1376
1385
|
),
|
|
@@ -1383,20 +1392,20 @@ const Pa = ({
|
|
|
1383
1392
|
max: 200,
|
|
1384
1393
|
className: t.styleInput,
|
|
1385
1394
|
value: n.style.fontSize ?? 10,
|
|
1386
|
-
onChange: (i) =>
|
|
1395
|
+
onChange: (i) => _({ fontSize: +i.target.value })
|
|
1387
1396
|
}
|
|
1388
1397
|
),
|
|
1389
1398
|
/* @__PURE__ */ e("span", { className: t.styleUnit, children: "pt" })
|
|
1390
1399
|
] }),
|
|
1391
1400
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1392
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1401
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.colour", "Colour") }),
|
|
1393
1402
|
/* @__PURE__ */ e(
|
|
1394
1403
|
"input",
|
|
1395
1404
|
{
|
|
1396
1405
|
type: "color",
|
|
1397
1406
|
className: t.colorPicker,
|
|
1398
1407
|
value: n.style.color ?? se,
|
|
1399
|
-
onChange: (i) =>
|
|
1408
|
+
onChange: (i) => _({ color: i.target.value })
|
|
1400
1409
|
}
|
|
1401
1410
|
),
|
|
1402
1411
|
/* @__PURE__ */ e(
|
|
@@ -1404,19 +1413,19 @@ const Pa = ({
|
|
|
1404
1413
|
{
|
|
1405
1414
|
className: t.colorHex,
|
|
1406
1415
|
value: n.style.color ?? se,
|
|
1407
|
-
onChange: (i) =>
|
|
1416
|
+
onChange: (i) => _({ color: i.target.value }),
|
|
1408
1417
|
maxLength: 7
|
|
1409
1418
|
}
|
|
1410
1419
|
)
|
|
1411
1420
|
] }),
|
|
1412
1421
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1413
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1422
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.style", "Style") }),
|
|
1414
1423
|
/* @__PURE__ */ a("div", { className: t.toggleGroup, children: [
|
|
1415
1424
|
/* @__PURE__ */ e(
|
|
1416
1425
|
"button",
|
|
1417
1426
|
{
|
|
1418
1427
|
className: `${t.toggleBtn} ${n.style.fontWeight === "bold" ? t.toggleBtnActive : ""}`,
|
|
1419
|
-
onClick: () =>
|
|
1428
|
+
onClick: () => _({ fontWeight: n.style.fontWeight === "bold" ? "normal" : "bold" }),
|
|
1420
1429
|
children: /* @__PURE__ */ e("b", { children: "B" })
|
|
1421
1430
|
}
|
|
1422
1431
|
),
|
|
@@ -1424,27 +1433,27 @@ const Pa = ({
|
|
|
1424
1433
|
"button",
|
|
1425
1434
|
{
|
|
1426
1435
|
className: `${t.toggleBtn} ${n.style.fontStyle === "italic" ? t.toggleBtnActive : ""}`,
|
|
1427
|
-
onClick: () =>
|
|
1436
|
+
onClick: () => _({ fontStyle: n.style.fontStyle === "italic" ? "normal" : "italic" }),
|
|
1428
1437
|
children: /* @__PURE__ */ e("i", { children: "I" })
|
|
1429
1438
|
}
|
|
1430
1439
|
)
|
|
1431
1440
|
] })
|
|
1432
1441
|
] }),
|
|
1433
1442
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1434
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1443
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.align", "Align") }),
|
|
1435
1444
|
/* @__PURE__ */ e("div", { className: t.toggleGroup, children: ["left", "center", "right", "justify"].map((i) => /* @__PURE__ */ e(
|
|
1436
1445
|
"button",
|
|
1437
1446
|
{
|
|
1438
1447
|
title: i,
|
|
1439
1448
|
className: `${t.toggleBtn} ${(n.style.textAlign ?? "left") === i ? t.toggleBtnActive : ""}`,
|
|
1440
|
-
onClick: () =>
|
|
1449
|
+
onClick: () => _({ textAlign: i }),
|
|
1441
1450
|
children: i === "left" ? "≡L" : i === "center" ? "≡C" : i === "right" ? "≡R" : "≡J"
|
|
1442
1451
|
},
|
|
1443
1452
|
i
|
|
1444
1453
|
)) })
|
|
1445
1454
|
] }),
|
|
1446
1455
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1447
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "
|
|
1456
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.lineHeight", "Line h.") }),
|
|
1448
1457
|
/* @__PURE__ */ e(
|
|
1449
1458
|
"input",
|
|
1450
1459
|
{
|
|
@@ -1454,12 +1463,12 @@ const Pa = ({
|
|
|
1454
1463
|
max: 4,
|
|
1455
1464
|
className: t.styleInput,
|
|
1456
1465
|
value: n.style.lineHeight ?? 1.4,
|
|
1457
|
-
onChange: (i) =>
|
|
1466
|
+
onChange: (i) => _({ lineHeight: +i.target.value })
|
|
1458
1467
|
}
|
|
1459
1468
|
)
|
|
1460
1469
|
] }),
|
|
1461
1470
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1462
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1471
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.spacing", "Spacing") }),
|
|
1463
1472
|
/* @__PURE__ */ e(
|
|
1464
1473
|
"input",
|
|
1465
1474
|
{
|
|
@@ -1469,37 +1478,37 @@ const Pa = ({
|
|
|
1469
1478
|
max: 0.5,
|
|
1470
1479
|
className: t.styleInput,
|
|
1471
1480
|
value: n.style.letterSpacing ?? 0,
|
|
1472
|
-
onChange: (i) =>
|
|
1481
|
+
onChange: (i) => _({ letterSpacing: +i.target.value })
|
|
1473
1482
|
}
|
|
1474
1483
|
),
|
|
1475
1484
|
/* @__PURE__ */ e("span", { className: t.styleUnit, children: "em" })
|
|
1476
1485
|
] })
|
|
1477
1486
|
] }),
|
|
1478
1487
|
/* @__PURE__ */ a("div", { className: t.styleGroup, children: [
|
|
1479
|
-
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children:
|
|
1488
|
+
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: h("printing.editor.background", "Background and border") }),
|
|
1480
1489
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1481
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1490
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.fill", "Fill") }),
|
|
1482
1491
|
/* @__PURE__ */ e(
|
|
1483
1492
|
"input",
|
|
1484
1493
|
{
|
|
1485
1494
|
type: "color",
|
|
1486
1495
|
className: t.colorPicker,
|
|
1487
1496
|
value: n.style.backgroundColor ?? "var(--nice-bg, #fff)",
|
|
1488
|
-
onChange: (i) =>
|
|
1497
|
+
onChange: (i) => _({ backgroundColor: i.target.value })
|
|
1489
1498
|
}
|
|
1490
1499
|
),
|
|
1491
1500
|
/* @__PURE__ */ e(
|
|
1492
1501
|
"button",
|
|
1493
1502
|
{
|
|
1494
1503
|
className: t.clearBtn,
|
|
1495
|
-
onClick: () =>
|
|
1496
|
-
title:
|
|
1497
|
-
children: /* @__PURE__ */ e(
|
|
1504
|
+
onClick: () => _({ backgroundColor: void 0 }),
|
|
1505
|
+
title: h("printing.editor.clearFill", "Clear fill"),
|
|
1506
|
+
children: /* @__PURE__ */ e(S, { name: "close", size: 12 })
|
|
1498
1507
|
}
|
|
1499
1508
|
)
|
|
1500
1509
|
] }),
|
|
1501
1510
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1502
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "
|
|
1511
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.border", "Border") }),
|
|
1503
1512
|
/* @__PURE__ */ e(
|
|
1504
1513
|
"input",
|
|
1505
1514
|
{
|
|
@@ -1509,7 +1518,7 @@ const Pa = ({
|
|
|
1509
1518
|
max: 10,
|
|
1510
1519
|
className: t.styleInput,
|
|
1511
1520
|
value: n.style.borderWidth ?? 0,
|
|
1512
|
-
onChange: (i) =>
|
|
1521
|
+
onChange: (i) => _({ borderWidth: +i.target.value })
|
|
1513
1522
|
}
|
|
1514
1523
|
),
|
|
1515
1524
|
/* @__PURE__ */ e(
|
|
@@ -1518,7 +1527,7 @@ const Pa = ({
|
|
|
1518
1527
|
type: "color",
|
|
1519
1528
|
className: t.colorPicker,
|
|
1520
1529
|
value: n.style.borderColor ?? se,
|
|
1521
|
-
onChange: (i) =>
|
|
1530
|
+
onChange: (i) => _({ borderColor: i.target.value })
|
|
1522
1531
|
}
|
|
1523
1532
|
),
|
|
1524
1533
|
/* @__PURE__ */ a(
|
|
@@ -1526,7 +1535,7 @@ const Pa = ({
|
|
|
1526
1535
|
{
|
|
1527
1536
|
className: t.styleSelectXs,
|
|
1528
1537
|
value: n.style.borderStyle ?? "solid",
|
|
1529
|
-
onChange: (i) =>
|
|
1538
|
+
onChange: (i) => _({ borderStyle: i.target.value }),
|
|
1530
1539
|
children: [
|
|
1531
1540
|
/* @__PURE__ */ e("option", { value: "solid", children: "─" }),
|
|
1532
1541
|
/* @__PURE__ */ e("option", { value: "dashed", children: "- -" }),
|
|
@@ -1536,7 +1545,7 @@ const Pa = ({
|
|
|
1536
1545
|
)
|
|
1537
1546
|
] }),
|
|
1538
1547
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1539
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "
|
|
1548
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.radius", "Radius") }),
|
|
1540
1549
|
/* @__PURE__ */ e(
|
|
1541
1550
|
"input",
|
|
1542
1551
|
{
|
|
@@ -1546,13 +1555,13 @@ const Pa = ({
|
|
|
1546
1555
|
max: 50,
|
|
1547
1556
|
className: t.styleInput,
|
|
1548
1557
|
value: n.style.borderRadius ?? 0,
|
|
1549
|
-
onChange: (i) =>
|
|
1558
|
+
onChange: (i) => _({ borderRadius: +i.target.value })
|
|
1550
1559
|
}
|
|
1551
1560
|
),
|
|
1552
1561
|
/* @__PURE__ */ e("span", { className: t.styleUnit, children: "px" })
|
|
1553
1562
|
] }),
|
|
1554
1563
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1555
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "Padding" }),
|
|
1564
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.padding", "Padding") }),
|
|
1556
1565
|
/* @__PURE__ */ e(
|
|
1557
1566
|
"input",
|
|
1558
1567
|
{
|
|
@@ -1562,13 +1571,13 @@ const Pa = ({
|
|
|
1562
1571
|
max: 20,
|
|
1563
1572
|
className: t.styleInput,
|
|
1564
1573
|
value: n.style.padding ?? 0,
|
|
1565
|
-
onChange: (i) =>
|
|
1574
|
+
onChange: (i) => _({ padding: +i.target.value })
|
|
1566
1575
|
}
|
|
1567
1576
|
),
|
|
1568
1577
|
/* @__PURE__ */ e("span", { className: t.styleUnit, children: "mm" })
|
|
1569
1578
|
] }),
|
|
1570
1579
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1571
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "
|
|
1580
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.opacity", "Opacity") }),
|
|
1572
1581
|
/* @__PURE__ */ e(
|
|
1573
1582
|
"input",
|
|
1574
1583
|
{
|
|
@@ -1578,7 +1587,7 @@ const Pa = ({
|
|
|
1578
1587
|
step: 0.05,
|
|
1579
1588
|
className: t.sliderInput,
|
|
1580
1589
|
value: n.style.opacity ?? 1,
|
|
1581
|
-
onChange: (i) =>
|
|
1590
|
+
onChange: (i) => _({ opacity: +i.target.value })
|
|
1582
1591
|
}
|
|
1583
1592
|
),
|
|
1584
1593
|
/* @__PURE__ */ a("span", { className: t.styleValue, children: [
|
|
@@ -1588,58 +1597,58 @@ const Pa = ({
|
|
|
1588
1597
|
] })
|
|
1589
1598
|
] })
|
|
1590
1599
|
] }),
|
|
1591
|
-
|
|
1592
|
-
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children:
|
|
1600
|
+
s === "data" && f && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
|
|
1601
|
+
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: h("printing.editor.dataSource", "Data source") }),
|
|
1593
1602
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1594
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1603
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.path", "Path") }),
|
|
1595
1604
|
/* @__PURE__ */ e(
|
|
1596
1605
|
"input",
|
|
1597
1606
|
{
|
|
1598
1607
|
className: t.styleInputFull,
|
|
1599
1608
|
value: n.dataPath,
|
|
1600
1609
|
onChange: (i) => o({ dataPath: i.target.value }),
|
|
1601
|
-
placeholder: "
|
|
1610
|
+
placeholder: b("templateEditor.egInvoiceNumber", "e.g. invoice.number")
|
|
1602
1611
|
}
|
|
1603
1612
|
)
|
|
1604
1613
|
] }),
|
|
1605
1614
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1606
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1615
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.format", "Format") }),
|
|
1607
1616
|
/* @__PURE__ */ e(
|
|
1608
1617
|
"input",
|
|
1609
1618
|
{
|
|
1610
1619
|
className: t.styleInputFull,
|
|
1611
1620
|
value: n.format ?? "",
|
|
1612
1621
|
onChange: (i) => o({ format: i.target.value }),
|
|
1613
|
-
placeholder: "DD.MM.YYYY / #,##0.00"
|
|
1622
|
+
placeholder: b("templateEditor.ddMmYyyy000", "DD.MM.YYYY / #,##0.00")
|
|
1614
1623
|
}
|
|
1615
1624
|
)
|
|
1616
1625
|
] }),
|
|
1617
1626
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1618
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1627
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.default", "Default") }),
|
|
1619
1628
|
/* @__PURE__ */ e(
|
|
1620
1629
|
"input",
|
|
1621
1630
|
{
|
|
1622
1631
|
className: t.styleInputFull,
|
|
1623
1632
|
value: n.fallback ?? "",
|
|
1624
1633
|
onChange: (i) => o({ fallback: i.target.value }),
|
|
1625
|
-
placeholder:
|
|
1634
|
+
placeholder: h("printing.editor.whenEmpty", "When there is no value")
|
|
1626
1635
|
}
|
|
1627
1636
|
)
|
|
1628
1637
|
] }),
|
|
1629
1638
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1630
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1639
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.type", "Type") }),
|
|
1631
1640
|
/* @__PURE__ */ e(
|
|
1632
1641
|
"select",
|
|
1633
1642
|
{
|
|
1634
1643
|
className: t.styleSelectFull,
|
|
1635
1644
|
value: n.type,
|
|
1636
1645
|
onChange: (i) => o({ type: i.target.value }),
|
|
1637
|
-
children: Object.keys(_e).map((i) => /* @__PURE__ */ e("option", { value: i, children: we(
|
|
1646
|
+
children: Object.keys(_e).map((i) => /* @__PURE__ */ e("option", { value: i, children: we(h, i) }, i))
|
|
1638
1647
|
}
|
|
1639
1648
|
)
|
|
1640
1649
|
] }),
|
|
1641
1650
|
(n.type === "barcode" || n.type === "qr") && /* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1642
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1651
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.codeFormat", "Code format") }),
|
|
1643
1652
|
/* @__PURE__ */ e(
|
|
1644
1653
|
"select",
|
|
1645
1654
|
{
|
|
@@ -1651,58 +1660,58 @@ const Pa = ({
|
|
|
1651
1660
|
)
|
|
1652
1661
|
] })
|
|
1653
1662
|
] }),
|
|
1654
|
-
|
|
1655
|
-
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children:
|
|
1656
|
-
/* @__PURE__ */ e("div", { className: t.conditionalHint, children:
|
|
1663
|
+
s === "conditional" && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
|
|
1664
|
+
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: h("printing.editor.conditionalVisibility", "Conditional visibility") }),
|
|
1665
|
+
/* @__PURE__ */ e("div", { className: t.conditionalHint, children: h(
|
|
1657
1666
|
"printing.editor.conditionalHint",
|
|
1658
1667
|
"The element is hidden when the condition is not met."
|
|
1659
1668
|
) }),
|
|
1660
1669
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1661
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1670
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.conditionalField", "Field") }),
|
|
1662
1671
|
/* @__PURE__ */ e(
|
|
1663
1672
|
"input",
|
|
1664
1673
|
{
|
|
1665
1674
|
className: t.styleInputFull,
|
|
1666
|
-
value: ((
|
|
1675
|
+
value: ((C = n.conditional) == null ? void 0 : C.field) ?? "",
|
|
1667
1676
|
onChange: (i) => {
|
|
1668
|
-
var
|
|
1677
|
+
var u, c;
|
|
1669
1678
|
return o({
|
|
1670
1679
|
conditional: {
|
|
1671
1680
|
field: i.target.value,
|
|
1672
|
-
operator: ((
|
|
1673
|
-
value: (
|
|
1681
|
+
operator: ((u = n.conditional) == null ? void 0 : u.operator) ?? "eq",
|
|
1682
|
+
value: (c = n.conditional) == null ? void 0 : c.value
|
|
1674
1683
|
}
|
|
1675
1684
|
});
|
|
1676
1685
|
},
|
|
1677
|
-
placeholder: "
|
|
1686
|
+
placeholder: b("templateEditor.egInvoiceIsPaid", "e.g. invoice.isPaid")
|
|
1678
1687
|
}
|
|
1679
1688
|
)
|
|
1680
1689
|
] }),
|
|
1681
1690
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1682
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "Operator" }),
|
|
1691
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.operator", "Operator") }),
|
|
1683
1692
|
/* @__PURE__ */ a(
|
|
1684
1693
|
"select",
|
|
1685
1694
|
{
|
|
1686
1695
|
className: t.styleSelectFull,
|
|
1687
|
-
value: ((
|
|
1696
|
+
value: ((z = n.conditional) == null ? void 0 : z.operator) ?? "eq",
|
|
1688
1697
|
onChange: (i) => {
|
|
1689
|
-
var
|
|
1698
|
+
var u, c;
|
|
1690
1699
|
return o({
|
|
1691
1700
|
conditional: {
|
|
1692
|
-
field: ((
|
|
1701
|
+
field: ((u = n.conditional) == null ? void 0 : u.field) ?? "",
|
|
1693
1702
|
operator: i.target.value,
|
|
1694
|
-
value: (
|
|
1703
|
+
value: (c = n.conditional) == null ? void 0 : c.value
|
|
1695
1704
|
}
|
|
1696
1705
|
});
|
|
1697
1706
|
},
|
|
1698
1707
|
children: [
|
|
1699
1708
|
/* @__PURE__ */ a("option", { value: "eq", children: [
|
|
1700
1709
|
"= ",
|
|
1701
|
-
|
|
1710
|
+
h("printing.editor.opEqual", "equal")
|
|
1702
1711
|
] }),
|
|
1703
1712
|
/* @__PURE__ */ a("option", { value: "neq", children: [
|
|
1704
1713
|
"≠ ",
|
|
1705
|
-
|
|
1714
|
+
h("printing.editor.opNotEqual", "not equal")
|
|
1706
1715
|
] }),
|
|
1707
1716
|
/* @__PURE__ */ e("option", { value: "gt", children: "> wieksze" }),
|
|
1708
1717
|
/* @__PURE__ */ e("option", { value: "lt", children: "< mniejsze" }),
|
|
@@ -1712,23 +1721,23 @@ const Pa = ({
|
|
|
1712
1721
|
)
|
|
1713
1722
|
] }),
|
|
1714
1723
|
/* @__PURE__ */ a("div", { className: t.styleRow, children: [
|
|
1715
|
-
/* @__PURE__ */ e("label", { className: t.styleLabel, children:
|
|
1724
|
+
/* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.value", "Value") }),
|
|
1716
1725
|
/* @__PURE__ */ e(
|
|
1717
1726
|
"input",
|
|
1718
1727
|
{
|
|
1719
1728
|
className: t.styleInputFull,
|
|
1720
|
-
value: String(((
|
|
1729
|
+
value: String(((y = n.conditional) == null ? void 0 : y.value) ?? ""),
|
|
1721
1730
|
onChange: (i) => {
|
|
1722
|
-
var
|
|
1731
|
+
var u, c;
|
|
1723
1732
|
return o({
|
|
1724
1733
|
conditional: {
|
|
1725
|
-
field: ((
|
|
1726
|
-
operator: ((
|
|
1734
|
+
field: ((u = n.conditional) == null ? void 0 : u.field) ?? "",
|
|
1735
|
+
operator: ((c = n.conditional) == null ? void 0 : c.operator) ?? "eq",
|
|
1727
1736
|
value: i.target.value
|
|
1728
1737
|
}
|
|
1729
1738
|
});
|
|
1730
1739
|
},
|
|
1731
|
-
placeholder: '
|
|
1740
|
+
placeholder: b("templateEditor.egTruePaid", 'e.g. true / "PAID"')
|
|
1732
1741
|
}
|
|
1733
1742
|
)
|
|
1734
1743
|
] }),
|
|
@@ -1737,7 +1746,7 @@ const Pa = ({
|
|
|
1737
1746
|
{
|
|
1738
1747
|
className: t.clearConditionalBtn,
|
|
1739
1748
|
onClick: () => o({ conditional: void 0 }),
|
|
1740
|
-
children:
|
|
1749
|
+
children: h("printing.editor.clearCondition", "Clear condition")
|
|
1741
1750
|
}
|
|
1742
1751
|
)
|
|
1743
1752
|
] })
|
|
@@ -1761,63 +1770,63 @@ function Wa() {
|
|
|
1761
1770
|
signatures: []
|
|
1762
1771
|
};
|
|
1763
1772
|
}
|
|
1764
|
-
const
|
|
1773
|
+
const lr = ({
|
|
1765
1774
|
template: n,
|
|
1766
|
-
dataSchema:
|
|
1767
|
-
sampleData:
|
|
1775
|
+
dataSchema: s,
|
|
1776
|
+
sampleData: m = [],
|
|
1768
1777
|
onChange: o,
|
|
1769
|
-
onSave:
|
|
1770
|
-
readOnly:
|
|
1771
|
-
className:
|
|
1772
|
-
style:
|
|
1773
|
-
theme:
|
|
1778
|
+
onSave: B,
|
|
1779
|
+
readOnly: N = !1,
|
|
1780
|
+
className: b,
|
|
1781
|
+
style: h,
|
|
1782
|
+
theme: g = "light"
|
|
1774
1783
|
}) => {
|
|
1775
|
-
const [{ past:
|
|
1784
|
+
const [{ past: _, present: l, future: f }, C] = Ke(Da, {
|
|
1776
1785
|
past: [],
|
|
1777
1786
|
present: n ?? Wa(),
|
|
1778
1787
|
future: []
|
|
1779
|
-
}), { t:
|
|
1780
|
-
(
|
|
1781
|
-
const
|
|
1782
|
-
|
|
1788
|
+
}), { t: z } = X(), [y, r] = H(/* @__PURE__ */ new Set()), [i, u] = H("sec-body"), [c, F] = H(1), [v, D] = H(0), [x, T] = H("fields"), [A, Y] = H("position"), [Z, w] = H(!1), [K, be] = H(!0), M = E(
|
|
1789
|
+
(d) => {
|
|
1790
|
+
const p = { ...l, ...d };
|
|
1791
|
+
C({ type: "UPDATE", payload: p }), o == null || o(p);
|
|
1783
1792
|
},
|
|
1784
|
-
[
|
|
1785
|
-
), [ee, ye] =
|
|
1786
|
-
const [
|
|
1787
|
-
return
|
|
1788
|
-
}, [
|
|
1789
|
-
() => te.find((
|
|
1790
|
-
[te,
|
|
1791
|
-
),
|
|
1792
|
-
(
|
|
1793
|
-
|
|
1794
|
-
sections:
|
|
1795
|
-
...
|
|
1796
|
-
fields:
|
|
1797
|
-
(
|
|
1793
|
+
[l, o]
|
|
1794
|
+
), [ee, ye] = ue(() => {
|
|
1795
|
+
const [d, p] = Le[l.paperSize] ?? Le.A4;
|
|
1796
|
+
return l.orientation === "landscape" ? [p, d] : [d, p];
|
|
1797
|
+
}, [l.paperSize, l.orientation]), te = ue(() => l.sections.flatMap((d) => d.fields), [l]), G = ue(
|
|
1798
|
+
() => te.find((d) => y.has(d.id)) ?? null,
|
|
1799
|
+
[te, y]
|
|
1800
|
+
), fe = E(
|
|
1801
|
+
(d, p) => {
|
|
1802
|
+
M({
|
|
1803
|
+
sections: l.sections.map((L) => ({
|
|
1804
|
+
...L,
|
|
1805
|
+
fields: L.fields.map(
|
|
1806
|
+
(I) => I.id === d ? { ...I, ...p, style: { ...I.style, ...p.style ?? {} } } : I
|
|
1798
1807
|
)
|
|
1799
1808
|
}))
|
|
1800
1809
|
});
|
|
1801
1810
|
},
|
|
1802
|
-
[
|
|
1803
|
-
), de =
|
|
1804
|
-
(
|
|
1805
|
-
|
|
1806
|
-
sections:
|
|
1807
|
-
...
|
|
1808
|
-
fields:
|
|
1809
|
-
(
|
|
1811
|
+
[l, M]
|
|
1812
|
+
), de = E(
|
|
1813
|
+
(d) => {
|
|
1814
|
+
M({
|
|
1815
|
+
sections: l.sections.map((p) => ({
|
|
1816
|
+
...p,
|
|
1817
|
+
fields: p.fields.map(
|
|
1818
|
+
(L) => y.has(L.id) ? { ...L, ...d, style: { ...L.style, ...d.style ?? {} } } : L
|
|
1810
1819
|
)
|
|
1811
1820
|
}))
|
|
1812
1821
|
});
|
|
1813
1822
|
},
|
|
1814
|
-
[
|
|
1815
|
-
), Ce =
|
|
1816
|
-
(
|
|
1817
|
-
if (
|
|
1818
|
-
|
|
1823
|
+
[l, y, M]
|
|
1824
|
+
), Ce = E(
|
|
1825
|
+
(d, p) => {
|
|
1826
|
+
if (d === "watermark") {
|
|
1827
|
+
M({
|
|
1819
1828
|
watermarks: [
|
|
1820
|
-
...
|
|
1829
|
+
...l.watermarks ?? [],
|
|
1821
1830
|
{
|
|
1822
1831
|
id: ce(),
|
|
1823
1832
|
type: "text",
|
|
@@ -1828,286 +1837,286 @@ const rr = ({
|
|
|
1828
1837
|
color: ge
|
|
1829
1838
|
}
|
|
1830
1839
|
]
|
|
1831
|
-
}),
|
|
1840
|
+
}), T("watermarks");
|
|
1832
1841
|
return;
|
|
1833
1842
|
}
|
|
1834
|
-
if (
|
|
1835
|
-
|
|
1843
|
+
if (d === "signature") {
|
|
1844
|
+
M({
|
|
1836
1845
|
signatures: [
|
|
1837
|
-
...
|
|
1846
|
+
...l.signatures ?? [],
|
|
1838
1847
|
{
|
|
1839
1848
|
id: ce(),
|
|
1840
|
-
label:
|
|
1849
|
+
label: z("printing.editor.signature", "Signature"),
|
|
1841
1850
|
position: { x: 10, y: 5, width: 70, height: 22 },
|
|
1842
1851
|
showLine: !0,
|
|
1843
1852
|
showDate: !1
|
|
1844
1853
|
}
|
|
1845
1854
|
]
|
|
1846
|
-
}),
|
|
1855
|
+
}), T("signatures");
|
|
1847
1856
|
return;
|
|
1848
1857
|
}
|
|
1849
|
-
const
|
|
1850
|
-
if (!
|
|
1858
|
+
const L = l.sections.find((O) => O.id === i) ?? l.sections.find((O) => O.type === "body");
|
|
1859
|
+
if (!L)
|
|
1851
1860
|
return;
|
|
1852
|
-
const
|
|
1853
|
-
sections:
|
|
1854
|
-
(O) => O.id ===
|
|
1861
|
+
const I = ze(d, p), P = {
|
|
1862
|
+
sections: l.sections.map(
|
|
1863
|
+
(O) => O.id === L.id ? { ...O, fields: [...O.fields, I] } : O
|
|
1855
1864
|
)
|
|
1856
1865
|
};
|
|
1857
|
-
|
|
1866
|
+
C({ type: "UPDATE", payload: { ...l, ...P } }), o == null || o({ ...l, ...P }), r(/* @__PURE__ */ new Set([I.id]));
|
|
1858
1867
|
},
|
|
1859
|
-
[
|
|
1860
|
-
), Re =
|
|
1861
|
-
(
|
|
1862
|
-
const
|
|
1863
|
-
O.position.x = Math.round(
|
|
1868
|
+
[l, i, o]
|
|
1869
|
+
), Re = E(
|
|
1870
|
+
(d, p, L, I) => {
|
|
1871
|
+
const P = s == null ? void 0 : s.fields.find((j) => j.path === p), O = ze((P == null ? void 0 : P.type) ?? "text", P);
|
|
1872
|
+
O.position.x = Math.round(L * 2) / 2, O.position.y = Math.round(I * 2) / 2;
|
|
1864
1873
|
const ne = {
|
|
1865
|
-
sections:
|
|
1866
|
-
(
|
|
1874
|
+
sections: l.sections.map(
|
|
1875
|
+
(j) => j.id === d ? { ...j, fields: [...j.fields, O] } : j
|
|
1867
1876
|
)
|
|
1868
1877
|
};
|
|
1869
|
-
|
|
1878
|
+
C({ type: "UPDATE", payload: { ...l, ...ne } }), o == null || o({ ...l, ...ne }), r(/* @__PURE__ */ new Set([O.id]));
|
|
1870
1879
|
},
|
|
1871
|
-
[
|
|
1872
|
-
), Ae =
|
|
1873
|
-
|
|
1874
|
-
const
|
|
1875
|
-
return
|
|
1876
|
-
}) :
|
|
1877
|
-
}, []),
|
|
1878
|
-
(
|
|
1879
|
-
if (
|
|
1880
|
+
[l, s, o]
|
|
1881
|
+
), Ae = E((d, p) => {
|
|
1882
|
+
p.ctrlKey || p.metaKey ? r((L) => {
|
|
1883
|
+
const I = new Set(L);
|
|
1884
|
+
return I.has(d) ? I.delete(d) : I.add(d), I;
|
|
1885
|
+
}) : p.shiftKey ? r((L) => /* @__PURE__ */ new Set([...L, d])) : r(/* @__PURE__ */ new Set([d]));
|
|
1886
|
+
}, []), Ee = E(
|
|
1887
|
+
(d, p) => {
|
|
1888
|
+
if (N)
|
|
1880
1889
|
return;
|
|
1881
|
-
|
|
1882
|
-
const
|
|
1883
|
-
id:
|
|
1884
|
-
fields:
|
|
1885
|
-
})), O = (
|
|
1886
|
-
const ae = (
|
|
1887
|
-
const
|
|
1890
|
+
p.preventDefault(), y.has(d) || r(/* @__PURE__ */ new Set([d]));
|
|
1891
|
+
const L = p.clientX, I = p.clientY, P = l.sections.map((j) => ({
|
|
1892
|
+
id: j.id,
|
|
1893
|
+
fields: j.fields.map((ae) => ({ id: ae.id, pos: { ...ae.position } }))
|
|
1894
|
+
})), O = (j) => {
|
|
1895
|
+
const ae = (j.clientX - L) / (c * W), re = (j.clientY - I) / (c * W), me = y.has(d) ? y : /* @__PURE__ */ new Set([d]), pe = l.sections.map((ie) => {
|
|
1896
|
+
const J = P.find((U) => U.id === ie.id);
|
|
1888
1897
|
return {
|
|
1889
1898
|
...ie,
|
|
1890
|
-
fields: ie.fields.map((
|
|
1899
|
+
fields: ie.fields.map((U) => {
|
|
1891
1900
|
var Ie;
|
|
1892
|
-
if (!
|
|
1893
|
-
return
|
|
1894
|
-
const Be = ((Ie =
|
|
1901
|
+
if (!me.has(U.id))
|
|
1902
|
+
return U;
|
|
1903
|
+
const Be = ((Ie = J == null ? void 0 : J.fields.find((Ue) => Ue.id === U.id)) == null ? void 0 : Ie.pos) ?? U.position;
|
|
1895
1904
|
return {
|
|
1896
|
-
...
|
|
1905
|
+
...U,
|
|
1897
1906
|
position: {
|
|
1898
|
-
...
|
|
1907
|
+
...U.position,
|
|
1899
1908
|
x: Math.max(0, Math.round((Be.x + ae) * 2) / 2),
|
|
1900
1909
|
y: Math.max(0, Math.round((Be.y + re) * 2) / 2)
|
|
1901
1910
|
}
|
|
1902
1911
|
};
|
|
1903
1912
|
})
|
|
1904
1913
|
};
|
|
1905
|
-
}),
|
|
1906
|
-
o == null || o(
|
|
1914
|
+
}), oe = { ...l, sections: pe };
|
|
1915
|
+
o == null || o(oe), C({ type: "UPDATE", payload: oe });
|
|
1907
1916
|
}, ne = () => {
|
|
1908
1917
|
document.removeEventListener("mousemove", O), document.removeEventListener("mouseup", ne);
|
|
1909
1918
|
};
|
|
1910
1919
|
document.addEventListener("mousemove", O), document.addEventListener("mouseup", ne);
|
|
1911
1920
|
},
|
|
1912
|
-
[
|
|
1913
|
-
),
|
|
1914
|
-
(
|
|
1915
|
-
if (
|
|
1921
|
+
[l, c, y, N, o]
|
|
1922
|
+
), Me = E(
|
|
1923
|
+
(d, p, L) => {
|
|
1924
|
+
if (N)
|
|
1916
1925
|
return;
|
|
1917
|
-
|
|
1918
|
-
const
|
|
1919
|
-
if (!
|
|
1926
|
+
L.preventDefault();
|
|
1927
|
+
const I = te.find((re) => re.id === d);
|
|
1928
|
+
if (!I)
|
|
1920
1929
|
return;
|
|
1921
|
-
const
|
|
1922
|
-
const
|
|
1923
|
-
let { x:
|
|
1924
|
-
|
|
1930
|
+
const P = { ...I.position }, O = L.clientX, ne = L.clientY, j = (re) => {
|
|
1931
|
+
const me = (re.clientX - O) / (c * W), pe = (re.clientY - ne) / (c * W);
|
|
1932
|
+
let { x: oe, y: ie, width: J, height: U } = P;
|
|
1933
|
+
p.includes("e") && (J = Math.max(5, J + me)), p.includes("s") && (U = Math.max(3, U + pe)), p.includes("w") && (oe = oe + me, J = Math.max(5, J - me)), p.includes("n") && (ie = ie + pe, U = Math.max(3, U - pe)), fe(d, {
|
|
1925
1934
|
position: {
|
|
1926
|
-
...
|
|
1927
|
-
x: Math.round(
|
|
1935
|
+
...P,
|
|
1936
|
+
x: Math.round(oe * 2) / 2,
|
|
1928
1937
|
y: Math.round(ie * 2) / 2,
|
|
1929
|
-
width: Math.round(
|
|
1930
|
-
height: Math.round(
|
|
1938
|
+
width: Math.round(J * 2) / 2,
|
|
1939
|
+
height: Math.round(U * 2) / 2
|
|
1931
1940
|
}
|
|
1932
1941
|
});
|
|
1933
1942
|
}, ae = () => {
|
|
1934
|
-
document.removeEventListener("mousemove",
|
|
1943
|
+
document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", ae);
|
|
1935
1944
|
};
|
|
1936
|
-
document.addEventListener("mousemove",
|
|
1945
|
+
document.addEventListener("mousemove", j), document.addEventListener("mouseup", ae);
|
|
1937
1946
|
},
|
|
1938
|
-
[te,
|
|
1939
|
-
),
|
|
1940
|
-
|
|
1941
|
-
sections:
|
|
1942
|
-
...
|
|
1943
|
-
fields:
|
|
1947
|
+
[te, c, N, fe]
|
|
1948
|
+
), ve = E(() => {
|
|
1949
|
+
M({
|
|
1950
|
+
sections: l.sections.map((d) => ({
|
|
1951
|
+
...d,
|
|
1952
|
+
fields: d.fields.filter((p) => !y.has(p.id))
|
|
1944
1953
|
}))
|
|
1945
|
-
}),
|
|
1946
|
-
}, [
|
|
1947
|
-
const
|
|
1948
|
-
|
|
1949
|
-
sections:
|
|
1950
|
-
const
|
|
1951
|
-
const
|
|
1952
|
-
...
|
|
1954
|
+
}), r(/* @__PURE__ */ new Set());
|
|
1955
|
+
}, [l, y, M]), Ne = E(() => {
|
|
1956
|
+
const d = /* @__PURE__ */ new Set();
|
|
1957
|
+
M({
|
|
1958
|
+
sections: l.sections.map((p) => {
|
|
1959
|
+
const L = p.fields.filter((I) => y.has(I.id)).map((I) => {
|
|
1960
|
+
const P = {
|
|
1961
|
+
...I,
|
|
1953
1962
|
id: ce(),
|
|
1954
|
-
position: { ...
|
|
1963
|
+
position: { ...I.position, x: I.position.x + 5, y: I.position.y + 5 }
|
|
1955
1964
|
};
|
|
1956
|
-
return
|
|
1965
|
+
return d.add(P.id), P;
|
|
1957
1966
|
});
|
|
1958
|
-
return { ...
|
|
1967
|
+
return { ...p, fields: [...p.fields, ...L] };
|
|
1959
1968
|
})
|
|
1960
|
-
}),
|
|
1961
|
-
}, [
|
|
1962
|
-
(
|
|
1963
|
-
|
|
1964
|
-
sections:
|
|
1965
|
-
...
|
|
1966
|
-
fields:
|
|
1967
|
-
if (!
|
|
1968
|
-
return
|
|
1969
|
-
const
|
|
1970
|
-
return { ...
|
|
1969
|
+
}), r(d);
|
|
1970
|
+
}, [l, y, M]), Pe = E(
|
|
1971
|
+
(d) => {
|
|
1972
|
+
M({
|
|
1973
|
+
sections: l.sections.map((p) => ({
|
|
1974
|
+
...p,
|
|
1975
|
+
fields: p.fields.map((L) => {
|
|
1976
|
+
if (!y.has(L.id))
|
|
1977
|
+
return L;
|
|
1978
|
+
const I = d === "left" ? l.margins.left : d === "right" ? ee - l.margins.right - L.position.width : (ee - L.position.width) / 2;
|
|
1979
|
+
return { ...L, position: { ...L.position, x: I } };
|
|
1971
1980
|
})
|
|
1972
1981
|
}))
|
|
1973
1982
|
});
|
|
1974
1983
|
},
|
|
1975
|
-
[
|
|
1976
|
-
), Fe =
|
|
1977
|
-
(
|
|
1978
|
-
const
|
|
1979
|
-
if (!
|
|
1984
|
+
[l, y, ee, M]
|
|
1985
|
+
), Fe = E(
|
|
1986
|
+
(d) => {
|
|
1987
|
+
const p = l.sections.find((I) => I.id === i);
|
|
1988
|
+
if (!p)
|
|
1980
1989
|
return;
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1983
|
-
sections:
|
|
1984
|
-
...
|
|
1985
|
-
fields:
|
|
1986
|
-
if (!
|
|
1987
|
-
return
|
|
1988
|
-
const O =
|
|
1989
|
-
return { ...
|
|
1990
|
+
const L = p.heightMm ?? 200;
|
|
1991
|
+
M({
|
|
1992
|
+
sections: l.sections.map((I) => I.id !== i ? I : {
|
|
1993
|
+
...I,
|
|
1994
|
+
fields: I.fields.map((P) => {
|
|
1995
|
+
if (!y.has(P.id))
|
|
1996
|
+
return P;
|
|
1997
|
+
const O = d === "top" ? 0 : d === "bottom" ? L - P.position.height : (L - P.position.height) / 2;
|
|
1998
|
+
return { ...P, position: { ...P.position, y: O } };
|
|
1990
1999
|
})
|
|
1991
2000
|
})
|
|
1992
2001
|
});
|
|
1993
2002
|
},
|
|
1994
|
-
[
|
|
1995
|
-
), He =
|
|
1996
|
-
|
|
1997
|
-
sections:
|
|
1998
|
-
...
|
|
1999
|
-
fields:
|
|
2000
|
-
(
|
|
2003
|
+
[l, y, i, M]
|
|
2004
|
+
), He = E(() => {
|
|
2005
|
+
M({
|
|
2006
|
+
sections: l.sections.map((d) => ({
|
|
2007
|
+
...d,
|
|
2008
|
+
fields: d.fields.map(
|
|
2009
|
+
(p) => y.has(p.id) ? { ...p, position: { ...p.position, zIndex: (p.position.zIndex ?? 1) + 1 } } : p
|
|
2001
2010
|
)
|
|
2002
2011
|
}))
|
|
2003
2012
|
});
|
|
2004
|
-
}, [
|
|
2005
|
-
|
|
2006
|
-
sections:
|
|
2007
|
-
...
|
|
2008
|
-
fields:
|
|
2009
|
-
(
|
|
2010
|
-
...
|
|
2011
|
-
position: { ...
|
|
2012
|
-
} :
|
|
2013
|
+
}, [l, y, M]), Ge = E(() => {
|
|
2014
|
+
M({
|
|
2015
|
+
sections: l.sections.map((d) => ({
|
|
2016
|
+
...d,
|
|
2017
|
+
fields: d.fields.map(
|
|
2018
|
+
(p) => y.has(p.id) ? {
|
|
2019
|
+
...p,
|
|
2020
|
+
position: { ...p.position, zIndex: Math.max(1, (p.position.zIndex ?? 1) - 1) }
|
|
2021
|
+
} : p
|
|
2013
2022
|
)
|
|
2014
2023
|
}))
|
|
2015
2024
|
});
|
|
2016
|
-
}, [
|
|
2017
|
-
(
|
|
2018
|
-
|
|
2019
|
-
sections:
|
|
2020
|
-
...
|
|
2021
|
-
fields:
|
|
2022
|
-
(
|
|
2023
|
-
...
|
|
2025
|
+
}, [l, y, M]), Oe = E(
|
|
2026
|
+
(d, p) => {
|
|
2027
|
+
M({
|
|
2028
|
+
sections: l.sections.map((L) => ({
|
|
2029
|
+
...L,
|
|
2030
|
+
fields: L.fields.map(
|
|
2031
|
+
(I) => I.id === d ? {
|
|
2032
|
+
...I,
|
|
2024
2033
|
position: {
|
|
2025
|
-
...
|
|
2026
|
-
zIndex: Math.max(1, (
|
|
2034
|
+
...I.position,
|
|
2035
|
+
zIndex: Math.max(1, (I.position.zIndex ?? 1) - p)
|
|
2027
2036
|
}
|
|
2028
|
-
} :
|
|
2037
|
+
} : I
|
|
2029
2038
|
)
|
|
2030
2039
|
}))
|
|
2031
2040
|
});
|
|
2032
2041
|
},
|
|
2033
|
-
[
|
|
2042
|
+
[l, M]
|
|
2034
2043
|
);
|
|
2035
2044
|
Se(() => {
|
|
2036
|
-
const
|
|
2037
|
-
const
|
|
2038
|
-
if (
|
|
2045
|
+
const d = (p) => {
|
|
2046
|
+
const L = p.target.tagName;
|
|
2047
|
+
if (L === "INPUT" || L === "TEXTAREA" || L === "SELECT")
|
|
2039
2048
|
return;
|
|
2040
|
-
const
|
|
2041
|
-
|
|
2042
|
-
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) -
|
|
2043
|
-
})) :
|
|
2044
|
-
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) +
|
|
2045
|
-
})) :
|
|
2046
|
-
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) -
|
|
2047
|
-
})) :
|
|
2048
|
-
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) +
|
|
2049
|
+
const I = p.shiftKey ? 5 : 0.5;
|
|
2050
|
+
p.key === "Delete" || p.key === "Backspace" ? y.size && (p.preventDefault(), ve()) : p.ctrlKey && p.key === "z" ? (p.preventDefault(), C({ type: "UNDO" })) : p.ctrlKey && (p.key === "y" || p.key === "Y") ? (p.preventDefault(), C({ type: "REDO" })) : p.ctrlKey && (p.key === "d" || p.key === "D") ? (p.preventDefault(), y.size && Ne()) : p.ctrlKey && p.key === "a" ? (p.preventDefault(), r(new Set(te.map((P) => P.id)))) : p.key === "ArrowLeft" ? (p.preventDefault(), de({
|
|
2051
|
+
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) - I }
|
|
2052
|
+
})) : p.key === "ArrowRight" ? (p.preventDefault(), de({
|
|
2053
|
+
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) + I }
|
|
2054
|
+
})) : p.key === "ArrowUp" ? (p.preventDefault(), de({
|
|
2055
|
+
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) - I }
|
|
2056
|
+
})) : p.key === "ArrowDown" && (p.preventDefault(), de({
|
|
2057
|
+
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) + I }
|
|
2049
2058
|
}));
|
|
2050
2059
|
};
|
|
2051
|
-
return window.addEventListener("keydown",
|
|
2052
|
-
}, [
|
|
2053
|
-
const qe =
|
|
2054
|
-
(
|
|
2055
|
-
|
|
2056
|
-
sections:
|
|
2057
|
-
(
|
|
2060
|
+
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
2061
|
+
}, [y, te, G, ve, Ne, de]);
|
|
2062
|
+
const qe = E(
|
|
2063
|
+
(d, p) => {
|
|
2064
|
+
M({
|
|
2065
|
+
sections: l.sections.map(
|
|
2066
|
+
(L) => L.id === d ? { ...L, heightMm: Math.round(p * 2) / 2 } : L
|
|
2058
2067
|
)
|
|
2059
2068
|
});
|
|
2060
2069
|
},
|
|
2061
|
-
[
|
|
2062
|
-
), We =
|
|
2063
|
-
const
|
|
2064
|
-
return
|
|
2065
|
-
}, [
|
|
2070
|
+
[l, M]
|
|
2071
|
+
), We = ue(() => {
|
|
2072
|
+
const d = Array.isArray(m) ? m[v] : m;
|
|
2073
|
+
return d ? "data" in d ? d.data : d : {};
|
|
2074
|
+
}, [m, v]), Ye = ee * c * W, je = ye * c * W;
|
|
2066
2075
|
return /* @__PURE__ */ e(
|
|
2067
|
-
|
|
2076
|
+
Ve,
|
|
2068
2077
|
{
|
|
2069
2078
|
flush: !0,
|
|
2070
|
-
className: `${t.root} ${
|
|
2071
|
-
style:
|
|
2079
|
+
className: `${t.root} ${g === "dark" ? t.dark : ""} ${b ?? ""}`,
|
|
2080
|
+
style: h,
|
|
2072
2081
|
toolbar: /* @__PURE__ */ e(
|
|
2073
2082
|
Ga,
|
|
2074
2083
|
{
|
|
2075
|
-
tpl:
|
|
2076
|
-
zoom:
|
|
2077
|
-
canUndo:
|
|
2078
|
-
canRedo:
|
|
2079
|
-
showGrid:
|
|
2080
|
-
showRulers:
|
|
2081
|
-
readOnly:
|
|
2082
|
-
selectedCount:
|
|
2083
|
-
onPaperChange: (
|
|
2084
|
-
onZoom:
|
|
2085
|
-
onUndo: () =>
|
|
2086
|
-
onRedo: () =>
|
|
2087
|
-
onToggleGrid: () =>
|
|
2088
|
-
onToggleRulers: () => be((
|
|
2084
|
+
tpl: l,
|
|
2085
|
+
zoom: c,
|
|
2086
|
+
canUndo: _.length > 0,
|
|
2087
|
+
canRedo: f.length > 0,
|
|
2088
|
+
showGrid: Z,
|
|
2089
|
+
showRulers: K,
|
|
2090
|
+
readOnly: N,
|
|
2091
|
+
selectedCount: y.size,
|
|
2092
|
+
onPaperChange: (d, p) => M({ paperSize: d, orientation: p }),
|
|
2093
|
+
onZoom: F,
|
|
2094
|
+
onUndo: () => C({ type: "UNDO" }),
|
|
2095
|
+
onRedo: () => C({ type: "REDO" }),
|
|
2096
|
+
onToggleGrid: () => w((d) => !d),
|
|
2097
|
+
onToggleRulers: () => be((d) => !d),
|
|
2089
2098
|
onInsert: Ce,
|
|
2090
|
-
onDelete:
|
|
2091
|
-
onDuplicate:
|
|
2092
|
-
onAlignH:
|
|
2099
|
+
onDelete: ve,
|
|
2100
|
+
onDuplicate: Ne,
|
|
2101
|
+
onAlignH: Pe,
|
|
2093
2102
|
onAlignV: Fe,
|
|
2094
2103
|
onBringForward: He,
|
|
2095
2104
|
onSendBackward: Ge,
|
|
2096
|
-
onSave:
|
|
2105
|
+
onSave: B ? () => B(l) : void 0
|
|
2097
2106
|
}
|
|
2098
2107
|
),
|
|
2099
2108
|
sidebar: /* @__PURE__ */ e(
|
|
2100
2109
|
Oa,
|
|
2101
2110
|
{
|
|
2102
|
-
activeTab:
|
|
2103
|
-
onTabChange:
|
|
2104
|
-
schema:
|
|
2105
|
-
tpl:
|
|
2111
|
+
activeTab: x,
|
|
2112
|
+
onTabChange: T,
|
|
2113
|
+
schema: s,
|
|
2114
|
+
tpl: l,
|
|
2106
2115
|
allFields: te,
|
|
2107
|
-
selectedIds:
|
|
2108
|
-
onInsertSchemaField: (
|
|
2109
|
-
onSelectField: (
|
|
2110
|
-
onUpdateTpl: (
|
|
2116
|
+
selectedIds: y,
|
|
2117
|
+
onInsertSchemaField: (d) => Ce(d.type, d),
|
|
2118
|
+
onSelectField: (d) => r(/* @__PURE__ */ new Set([d])),
|
|
2119
|
+
onUpdateTpl: (d) => M(d),
|
|
2111
2120
|
onReorderField: Oe
|
|
2112
2121
|
}
|
|
2113
2122
|
),
|
|
@@ -2115,93 +2124,93 @@ const rr = ({
|
|
|
2115
2124
|
qa,
|
|
2116
2125
|
{
|
|
2117
2126
|
field: G,
|
|
2118
|
-
activeTab:
|
|
2119
|
-
onTabChange:
|
|
2120
|
-
onChange: (
|
|
2127
|
+
activeTab: A,
|
|
2128
|
+
onTabChange: Y,
|
|
2129
|
+
onChange: (d) => G && fe(G.id, d),
|
|
2121
2130
|
paperWidthMm: ee,
|
|
2122
2131
|
paperHeightMm: ye
|
|
2123
2132
|
}
|
|
2124
2133
|
),
|
|
2125
|
-
children: /* @__PURE__ */ a("div", { className: t.canvasArea, onClick: () =>
|
|
2126
|
-
Array.isArray(
|
|
2134
|
+
children: /* @__PURE__ */ a("div", { className: t.canvasArea, onClick: () => r(/* @__PURE__ */ new Set()), children: [
|
|
2135
|
+
Array.isArray(m) && m.length > 0 && /* @__PURE__ */ a("div", { className: t.testDataBar, children: [
|
|
2127
2136
|
/* @__PURE__ */ a("span", { className: t.testDataLabel, children: [
|
|
2128
|
-
|
|
2137
|
+
z("printing.editor.testData", "Sample data"),
|
|
2129
2138
|
":"
|
|
2130
2139
|
] }),
|
|
2131
2140
|
/* @__PURE__ */ e(
|
|
2132
2141
|
"select",
|
|
2133
2142
|
{
|
|
2134
2143
|
className: t.testDataSelect,
|
|
2135
|
-
value:
|
|
2136
|
-
onChange: (
|
|
2137
|
-
children:
|
|
2138
|
-
|
|
2144
|
+
value: v,
|
|
2145
|
+
onChange: (d) => D(+d.target.value),
|
|
2146
|
+
children: m.map((d, p) => /* @__PURE__ */ a("option", { value: p, children: [
|
|
2147
|
+
z("printing.editor.record", "Record"),
|
|
2139
2148
|
" ",
|
|
2140
|
-
|
|
2141
|
-
] },
|
|
2149
|
+
p + 1
|
|
2150
|
+
] }, p))
|
|
2142
2151
|
}
|
|
2143
2152
|
)
|
|
2144
2153
|
] }),
|
|
2145
|
-
|
|
2154
|
+
K && /* @__PURE__ */ a("div", { className: t.rulerWrapper, children: [
|
|
2146
2155
|
/* @__PURE__ */ e("div", { className: t.rulerCorner }),
|
|
2147
|
-
/* @__PURE__ */ e(Te, { lengthMm: ee, zoom:
|
|
2148
|
-
/* @__PURE__ */ e(Te, { lengthMm: ye, zoom:
|
|
2156
|
+
/* @__PURE__ */ e(Te, { lengthMm: ee, zoom: c, orientation: "h" }),
|
|
2157
|
+
/* @__PURE__ */ e(Te, { lengthMm: ye, zoom: c, orientation: "v" })
|
|
2149
2158
|
] }),
|
|
2150
|
-
/* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (
|
|
2159
|
+
/* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (d) => d.stopPropagation(), children: /* @__PURE__ */ a("div", { className: t.paperShadow, style: { width: Ye, minHeight: je }, children: [
|
|
2151
2160
|
/* @__PURE__ */ e(
|
|
2152
2161
|
"div",
|
|
2153
2162
|
{
|
|
2154
2163
|
className: t.marginGuide,
|
|
2155
2164
|
style: {
|
|
2156
|
-
top:
|
|
2157
|
-
right:
|
|
2158
|
-
bottom:
|
|
2159
|
-
left:
|
|
2165
|
+
top: l.margins.top * c * W,
|
|
2166
|
+
right: l.margins.right * c * W,
|
|
2167
|
+
bottom: l.margins.bottom * c * W,
|
|
2168
|
+
left: l.margins.left * c * W
|
|
2160
2169
|
}
|
|
2161
2170
|
}
|
|
2162
2171
|
),
|
|
2163
|
-
(
|
|
2172
|
+
(l.watermarks ?? []).map((d) => /* @__PURE__ */ e(
|
|
2164
2173
|
"div",
|
|
2165
2174
|
{
|
|
2166
2175
|
className: t.watermark,
|
|
2167
2176
|
style: {
|
|
2168
|
-
fontSize: (
|
|
2169
|
-
color:
|
|
2170
|
-
opacity:
|
|
2171
|
-
transform: `translate(-50%, -50%) rotate(${
|
|
2177
|
+
fontSize: (d.fontSize ?? 60) * c,
|
|
2178
|
+
color: d.color ?? ge,
|
|
2179
|
+
opacity: d.opacity,
|
|
2180
|
+
transform: `translate(-50%, -50%) rotate(${d.angle}deg)`
|
|
2172
2181
|
},
|
|
2173
|
-
children:
|
|
2182
|
+
children: d.type === "text" ? d.text : /* @__PURE__ */ e(S, { name: "image", size: (d.fontSize ?? 60) * c })
|
|
2174
2183
|
},
|
|
2175
|
-
|
|
2184
|
+
d.id
|
|
2176
2185
|
)),
|
|
2177
|
-
|
|
2178
|
-
|
|
2186
|
+
l.sections.map((d) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
2187
|
+
Pa,
|
|
2179
2188
|
{
|
|
2180
|
-
section:
|
|
2181
|
-
zoom:
|
|
2189
|
+
section: d,
|
|
2190
|
+
zoom: c,
|
|
2182
2191
|
paperWidthMm: ee,
|
|
2183
|
-
selectedIds:
|
|
2192
|
+
selectedIds: y,
|
|
2184
2193
|
sampleData: We,
|
|
2185
|
-
readOnly:
|
|
2186
|
-
showGrid:
|
|
2194
|
+
readOnly: N,
|
|
2195
|
+
showGrid: Z,
|
|
2187
2196
|
onFieldClick: Ae,
|
|
2188
|
-
onFieldDragStart:
|
|
2189
|
-
onResizeStart:
|
|
2197
|
+
onFieldDragStart: Ee,
|
|
2198
|
+
onResizeStart: Me,
|
|
2190
2199
|
onSectionHeightChange: qe,
|
|
2191
2200
|
onDropField: Re
|
|
2192
2201
|
}
|
|
2193
|
-
) },
|
|
2202
|
+
) }, d.id))
|
|
2194
2203
|
] }) })
|
|
2195
2204
|
] })
|
|
2196
2205
|
}
|
|
2197
2206
|
);
|
|
2198
|
-
},
|
|
2199
|
-
root:
|
|
2200
|
-
dark:
|
|
2201
|
-
topBar:
|
|
2202
|
-
searchInput:
|
|
2203
|
-
actionBtn:
|
|
2204
|
-
categoryRow:
|
|
2207
|
+
}, Ya = "_root_7m4s0_1", ja = "_dark_7m4s0_25", Ua = "_topBar_7m4s0_39", Va = "_searchInput_7m4s0_69", Xa = "_actionBtn_7m4s0_111", Ka = "_categoryRow_7m4s0_157", Ja = "_catChip_7m4s0_187", Qa = "_catChipActive_7m4s0_217", Za = "_grid_7m4s0_231", ei = "_card_7m4s0_253", ti = "_cardSelected_7m4s0_285", ni = "_thumbnail_7m4s0_307", ai = "_thumbnailImg_7m4s0_321", ii = "_thumbnailPlaceholder_7m4s0_333", si = "_paperMini_7m4s0_347", ri = "_paperLine_7m4s0_371", oi = "_cardOverlay_7m4s0_385", li = "_overlayBtn_7m4s0_405", ci = "_overlayBtnDanger_7m4s0_441", di = "_cardBody_7m4s0_481", mi = "_cardName_7m4s0_489", pi = "_cardDesc_7m4s0_517", ui = "_cardMeta_7m4s0_539", hi = "_cardSize_7m4s0_553", _i = "_cardCat_7m4s0_569", gi = "_cardTags_7m4s0_585", bi = "_cardTag_7m4s0_585", yi = "_emptyState_7m4s0_617", fi = "_emptyIcon_7m4s0_639", $ = {
|
|
2208
|
+
root: Ya,
|
|
2209
|
+
dark: ja,
|
|
2210
|
+
topBar: Ua,
|
|
2211
|
+
searchInput: Va,
|
|
2212
|
+
actionBtn: Xa,
|
|
2213
|
+
categoryRow: Ka,
|
|
2205
2214
|
catChip: Ja,
|
|
2206
2215
|
catChipActive: Qa,
|
|
2207
2216
|
grid: Za,
|
|
@@ -2212,20 +2221,20 @@ const rr = ({
|
|
|
2212
2221
|
thumbnailPlaceholder: ii,
|
|
2213
2222
|
paperMini: si,
|
|
2214
2223
|
paperLine: ri,
|
|
2215
|
-
cardOverlay:
|
|
2216
|
-
overlayBtn:
|
|
2224
|
+
cardOverlay: oi,
|
|
2225
|
+
overlayBtn: li,
|
|
2217
2226
|
overlayBtnDanger: ci,
|
|
2218
2227
|
cardBody: di,
|
|
2219
|
-
cardName:
|
|
2220
|
-
cardDesc:
|
|
2221
|
-
cardMeta:
|
|
2228
|
+
cardName: mi,
|
|
2229
|
+
cardDesc: pi,
|
|
2230
|
+
cardMeta: ui,
|
|
2222
2231
|
cardSize: hi,
|
|
2223
2232
|
cardCat: _i,
|
|
2224
2233
|
cardTags: gi,
|
|
2225
2234
|
cardTag: bi,
|
|
2226
2235
|
emptyState: yi,
|
|
2227
|
-
emptyIcon:
|
|
2228
|
-
}, Ni = [
|
|
2236
|
+
emptyIcon: fi
|
|
2237
|
+
}, vi = [], Ni = [
|
|
2229
2238
|
{ key: "printing.category.invoices", fallback: "Invoices" },
|
|
2230
2239
|
{ key: "printing.category.reports", fallback: "Reports" },
|
|
2231
2240
|
{ key: "printing.category.labels", fallback: "Labels" },
|
|
@@ -2233,224 +2242,224 @@ const rr = ({
|
|
|
2233
2242
|
{ key: "printing.category.contracts", fallback: "Contracts" },
|
|
2234
2243
|
{ key: "printing.category.other", fallback: "Other" }
|
|
2235
2244
|
];
|
|
2236
|
-
function
|
|
2237
|
-
return new Promise((
|
|
2245
|
+
function wi(n) {
|
|
2246
|
+
return new Promise((s, m) => {
|
|
2238
2247
|
const o = new FileReader();
|
|
2239
|
-
o.onload = (
|
|
2240
|
-
var
|
|
2248
|
+
o.onload = (B) => {
|
|
2249
|
+
var N;
|
|
2241
2250
|
try {
|
|
2242
|
-
|
|
2243
|
-
} catch (
|
|
2244
|
-
|
|
2251
|
+
s(JSON.parse((N = B.target) == null ? void 0 : N.result));
|
|
2252
|
+
} catch (b) {
|
|
2253
|
+
m(b);
|
|
2245
2254
|
}
|
|
2246
2255
|
}, o.readAsText(n);
|
|
2247
2256
|
});
|
|
2248
2257
|
}
|
|
2249
|
-
function
|
|
2250
|
-
const
|
|
2251
|
-
o.href =
|
|
2258
|
+
function ki(n) {
|
|
2259
|
+
const s = new Blob([JSON.stringify(n, null, 2)], { type: "application/json" }), m = URL.createObjectURL(s), o = document.createElement("a");
|
|
2260
|
+
o.href = m, o.download = `${n.name.replace(/\s+/g, "_")}.json`, o.click(), URL.revokeObjectURL(m);
|
|
2252
2261
|
}
|
|
2253
|
-
const
|
|
2254
|
-
templates: n,
|
|
2255
|
-
selectedId:
|
|
2256
|
-
onSelect:
|
|
2262
|
+
const cr = ({
|
|
2263
|
+
templates: n = vi,
|
|
2264
|
+
selectedId: s,
|
|
2265
|
+
onSelect: m,
|
|
2257
2266
|
onImport: o,
|
|
2258
|
-
onExport:
|
|
2259
|
-
onDelete:
|
|
2260
|
-
onNew:
|
|
2261
|
-
className:
|
|
2262
|
-
style:
|
|
2263
|
-
theme:
|
|
2267
|
+
onExport: B,
|
|
2268
|
+
onDelete: N,
|
|
2269
|
+
onNew: b,
|
|
2270
|
+
className: h,
|
|
2271
|
+
style: g,
|
|
2272
|
+
theme: _ = "light"
|
|
2264
2273
|
}) => {
|
|
2265
|
-
const { t:
|
|
2266
|
-
var
|
|
2267
|
-
const
|
|
2268
|
-
if (
|
|
2274
|
+
const { t: l } = X(), [f, C] = H(""), [z, y] = H(null), [r, i] = H(null), u = Xe.useRef(null), c = async (v) => {
|
|
2275
|
+
var x;
|
|
2276
|
+
const D = (x = v.target.files) == null ? void 0 : x[0];
|
|
2277
|
+
if (D) {
|
|
2269
2278
|
try {
|
|
2270
|
-
const
|
|
2271
|
-
o == null || o(
|
|
2279
|
+
const T = await wi(D);
|
|
2280
|
+
o == null || o(T);
|
|
2272
2281
|
} catch {
|
|
2273
2282
|
}
|
|
2274
|
-
|
|
2283
|
+
v.target.value = "";
|
|
2275
2284
|
}
|
|
2276
|
-
},
|
|
2277
|
-
const
|
|
2278
|
-
return
|
|
2285
|
+
}, F = n.filter((v) => {
|
|
2286
|
+
const D = !f || v.name.toLowerCase().includes(f.toLowerCase()) || (v.description ?? "").toLowerCase().includes(f.toLowerCase()) || (v.tags ?? []).some((T) => T.toLowerCase().includes(f.toLowerCase())), x = !z || v.category === z;
|
|
2287
|
+
return D && x;
|
|
2279
2288
|
});
|
|
2280
2289
|
return /* @__PURE__ */ a(
|
|
2281
2290
|
"div",
|
|
2282
2291
|
{
|
|
2283
|
-
className: `${
|
|
2284
|
-
style:
|
|
2292
|
+
className: `${$.root} ${_ === "dark" ? $.dark : ""} ${h ?? ""}`,
|
|
2293
|
+
style: g,
|
|
2285
2294
|
children: [
|
|
2286
|
-
/* @__PURE__ */ a("div", { className:
|
|
2295
|
+
/* @__PURE__ */ a("div", { className: $.topBar, children: [
|
|
2287
2296
|
/* @__PURE__ */ e(
|
|
2288
2297
|
"input",
|
|
2289
2298
|
{
|
|
2290
2299
|
type: "search",
|
|
2291
|
-
className:
|
|
2292
|
-
placeholder:
|
|
2293
|
-
value:
|
|
2294
|
-
onChange: (
|
|
2300
|
+
className: $.searchInput,
|
|
2301
|
+
placeholder: l("printing.searchTemplates", "Search templates…"),
|
|
2302
|
+
value: f,
|
|
2303
|
+
onChange: (v) => C(v.target.value)
|
|
2295
2304
|
}
|
|
2296
2305
|
),
|
|
2297
2306
|
/* @__PURE__ */ a(
|
|
2298
2307
|
"button",
|
|
2299
2308
|
{
|
|
2300
|
-
className:
|
|
2301
|
-
onClick:
|
|
2302
|
-
title:
|
|
2309
|
+
className: $.actionBtn,
|
|
2310
|
+
onClick: b,
|
|
2311
|
+
title: l("printing.newTemplate", "New template"),
|
|
2303
2312
|
children: [
|
|
2304
|
-
/* @__PURE__ */ e(
|
|
2313
|
+
/* @__PURE__ */ e(S, { name: "plus", size: 14 }),
|
|
2305
2314
|
" ",
|
|
2306
|
-
|
|
2315
|
+
l("printing.new", "New")
|
|
2307
2316
|
]
|
|
2308
2317
|
}
|
|
2309
2318
|
),
|
|
2310
2319
|
/* @__PURE__ */ a(
|
|
2311
2320
|
"button",
|
|
2312
2321
|
{
|
|
2313
|
-
className:
|
|
2322
|
+
className: $.actionBtn,
|
|
2314
2323
|
onClick: () => {
|
|
2315
|
-
var
|
|
2316
|
-
return (
|
|
2324
|
+
var v;
|
|
2325
|
+
return (v = u.current) == null ? void 0 : v.click();
|
|
2317
2326
|
},
|
|
2318
|
-
title:
|
|
2327
|
+
title: l("printing.importJson", "Import JSON"),
|
|
2319
2328
|
children: [
|
|
2320
|
-
/* @__PURE__ */ e(
|
|
2329
|
+
/* @__PURE__ */ e(S, { name: "upload", size: 14 }),
|
|
2321
2330
|
" ",
|
|
2322
|
-
|
|
2331
|
+
l("printing.import", "Import")
|
|
2323
2332
|
]
|
|
2324
2333
|
}
|
|
2325
2334
|
),
|
|
2326
|
-
/* @__PURE__ */ e("input", { ref:
|
|
2335
|
+
/* @__PURE__ */ e("input", { ref: u, type: "file", accept: ".json", hidden: !0, onChange: c })
|
|
2327
2336
|
] }),
|
|
2328
|
-
/* @__PURE__ */ a("div", { className:
|
|
2337
|
+
/* @__PURE__ */ a("div", { className: $.categoryRow, children: [
|
|
2329
2338
|
/* @__PURE__ */ e(
|
|
2330
2339
|
"button",
|
|
2331
2340
|
{
|
|
2332
|
-
className: `${
|
|
2333
|
-
onClick: () =>
|
|
2334
|
-
children:
|
|
2341
|
+
className: `${$.catChip} ${z ? "" : $.catChipActive}`,
|
|
2342
|
+
onClick: () => y(null),
|
|
2343
|
+
children: l("printing.filter.all", "All")
|
|
2335
2344
|
}
|
|
2336
2345
|
),
|
|
2337
|
-
Ni.map((
|
|
2346
|
+
Ni.map((v) => /* @__PURE__ */ e(
|
|
2338
2347
|
"button",
|
|
2339
2348
|
{
|
|
2340
|
-
className: `${
|
|
2341
|
-
onClick: () =>
|
|
2342
|
-
children:
|
|
2349
|
+
className: `${$.catChip} ${z === v.fallback ? $.catChipActive : ""}`,
|
|
2350
|
+
onClick: () => y((D) => D === v.fallback ? null : v.fallback),
|
|
2351
|
+
children: l(v.key, v.fallback)
|
|
2343
2352
|
},
|
|
2344
|
-
|
|
2353
|
+
v.key
|
|
2345
2354
|
))
|
|
2346
2355
|
] }),
|
|
2347
|
-
/* @__PURE__ */ a("div", { className:
|
|
2348
|
-
|
|
2356
|
+
/* @__PURE__ */ a("div", { className: $.grid, children: [
|
|
2357
|
+
F.map((v) => /* @__PURE__ */ a(
|
|
2349
2358
|
"div",
|
|
2350
2359
|
{
|
|
2351
|
-
className: `${
|
|
2352
|
-
onClick: () =>
|
|
2353
|
-
onMouseEnter: () =>
|
|
2354
|
-
onMouseLeave: () =>
|
|
2360
|
+
className: `${$.card} ${s === v.id ? $.cardSelected : ""}`,
|
|
2361
|
+
onClick: () => m == null ? void 0 : m(v),
|
|
2362
|
+
onMouseEnter: () => i(v.id),
|
|
2363
|
+
onMouseLeave: () => i(null),
|
|
2355
2364
|
children: [
|
|
2356
|
-
/* @__PURE__ */ a("div", { className:
|
|
2357
|
-
|
|
2365
|
+
/* @__PURE__ */ a("div", { className: $.thumbnail, children: [
|
|
2366
|
+
v.previewImageUrl ? /* @__PURE__ */ e("img", { src: v.previewImageUrl, alt: v.name, className: $.thumbnailImg }) : /* @__PURE__ */ e("div", { className: $.thumbnailPlaceholder, children: /* @__PURE__ */ a("div", { className: $.paperMini, children: [
|
|
2358
2367
|
/* @__PURE__ */ e(
|
|
2359
2368
|
"div",
|
|
2360
2369
|
{
|
|
2361
|
-
className:
|
|
2370
|
+
className: $.paperLine,
|
|
2362
2371
|
style: { width: "80%" }
|
|
2363
2372
|
}
|
|
2364
2373
|
),
|
|
2365
2374
|
/* @__PURE__ */ e(
|
|
2366
2375
|
"div",
|
|
2367
2376
|
{
|
|
2368
|
-
className:
|
|
2377
|
+
className: $.paperLine,
|
|
2369
2378
|
style: { width: "60%" }
|
|
2370
2379
|
}
|
|
2371
2380
|
),
|
|
2372
2381
|
/* @__PURE__ */ e(
|
|
2373
2382
|
"div",
|
|
2374
2383
|
{
|
|
2375
|
-
className:
|
|
2384
|
+
className: $.paperLine,
|
|
2376
2385
|
style: { width: "90%" }
|
|
2377
2386
|
}
|
|
2378
2387
|
),
|
|
2379
2388
|
/* @__PURE__ */ e(
|
|
2380
2389
|
"div",
|
|
2381
2390
|
{
|
|
2382
|
-
className:
|
|
2391
|
+
className: $.paperLine,
|
|
2383
2392
|
style: { width: "50%" }
|
|
2384
2393
|
}
|
|
2385
2394
|
)
|
|
2386
2395
|
] }) }),
|
|
2387
|
-
|
|
2396
|
+
r === v.id && /* @__PURE__ */ a("div", { className: $.cardOverlay, children: [
|
|
2388
2397
|
/* @__PURE__ */ e(
|
|
2389
2398
|
"button",
|
|
2390
2399
|
{
|
|
2391
|
-
className:
|
|
2392
|
-
onClick: (
|
|
2393
|
-
|
|
2400
|
+
className: $.overlayBtn,
|
|
2401
|
+
onClick: (D) => {
|
|
2402
|
+
D.stopPropagation(), B == null || B(v), ki(v);
|
|
2394
2403
|
},
|
|
2395
|
-
title:
|
|
2396
|
-
children: /* @__PURE__ */ e(
|
|
2404
|
+
title: l("printing.export", "Export"),
|
|
2405
|
+
children: /* @__PURE__ */ e(S, { name: "download", size: 14 })
|
|
2397
2406
|
}
|
|
2398
2407
|
),
|
|
2399
|
-
|
|
2408
|
+
N && /* @__PURE__ */ e(
|
|
2400
2409
|
"button",
|
|
2401
2410
|
{
|
|
2402
|
-
className:
|
|
2403
|
-
onClick: (
|
|
2404
|
-
|
|
2411
|
+
className: $.overlayBtnDanger,
|
|
2412
|
+
onClick: (D) => {
|
|
2413
|
+
D.stopPropagation(), N(v.id);
|
|
2405
2414
|
},
|
|
2406
|
-
title:
|
|
2407
|
-
children: /* @__PURE__ */ e(
|
|
2415
|
+
title: l("printing.action.remove", "Remove"),
|
|
2416
|
+
children: /* @__PURE__ */ e(S, { name: "trash", size: 14 })
|
|
2408
2417
|
}
|
|
2409
2418
|
)
|
|
2410
2419
|
] })
|
|
2411
2420
|
] }),
|
|
2412
|
-
/* @__PURE__ */ a("div", { className:
|
|
2413
|
-
/* @__PURE__ */ e("div", { className:
|
|
2414
|
-
|
|
2415
|
-
/* @__PURE__ */ a("div", { className:
|
|
2416
|
-
/* @__PURE__ */ a("span", { className:
|
|
2417
|
-
|
|
2421
|
+
/* @__PURE__ */ a("div", { className: $.cardBody, children: [
|
|
2422
|
+
/* @__PURE__ */ e("div", { className: $.cardName, children: v.name }),
|
|
2423
|
+
v.description && /* @__PURE__ */ e("div", { className: $.cardDesc, children: v.description }),
|
|
2424
|
+
/* @__PURE__ */ a("div", { className: $.cardMeta, children: [
|
|
2425
|
+
/* @__PURE__ */ a("span", { className: $.cardSize, children: [
|
|
2426
|
+
v.paperSize,
|
|
2418
2427
|
" ",
|
|
2419
|
-
|
|
2428
|
+
v.orientation === "landscape" ? l("printing.orientation.landscape", "landscape") : l("printing.orientation.portrait", "portrait")
|
|
2420
2429
|
] }),
|
|
2421
|
-
|
|
2430
|
+
v.category && /* @__PURE__ */ e("span", { className: $.cardCat, children: v.category })
|
|
2422
2431
|
] }),
|
|
2423
|
-
|
|
2432
|
+
v.tags && v.tags.length > 0 && /* @__PURE__ */ e("div", { className: $.cardTags, children: v.tags.slice(0, 3).map((D) => /* @__PURE__ */ e("span", { className: $.cardTag, children: D }, D)) })
|
|
2424
2433
|
] })
|
|
2425
2434
|
]
|
|
2426
2435
|
},
|
|
2427
|
-
|
|
2436
|
+
v.id
|
|
2428
2437
|
)),
|
|
2429
|
-
|
|
2430
|
-
/* @__PURE__ */ e("span", { className:
|
|
2431
|
-
/* @__PURE__ */ e("span", { children:
|
|
2438
|
+
F.length === 0 && /* @__PURE__ */ a("div", { className: $.emptyState, children: [
|
|
2439
|
+
/* @__PURE__ */ e("span", { className: $.emptyIcon, children: /* @__PURE__ */ e(S, { name: "file", size: 32 }) }),
|
|
2440
|
+
/* @__PURE__ */ e("span", { children: f ? `${l("printing.noMatches", "No matches for")} "${f}"` : l("printing.noTemplates", "No templates yet.") })
|
|
2432
2441
|
] })
|
|
2433
2442
|
] })
|
|
2434
2443
|
]
|
|
2435
2444
|
}
|
|
2436
2445
|
);
|
|
2437
|
-
},
|
|
2438
|
-
root:
|
|
2439
|
-
dark:
|
|
2440
|
-
headerBar:
|
|
2441
|
-
entityNav:
|
|
2442
|
-
navBtn:
|
|
2443
|
-
navLabel:
|
|
2444
|
-
sampleBadge:
|
|
2445
|
-
zoomBar:
|
|
2446
|
-
zoomBtn:
|
|
2446
|
+
}, Si = "_root_18ja1_1", Ci = "_dark_18ja1_19", Bi = "_headerBar_18ja1_31", Ii = "_entityNav_18ja1_59", Li = "_navBtn_18ja1_69", xi = "_navLabel_18ja1_103", zi = "_sampleBadge_18ja1_117", Ti = "_zoomBar_18ja1_135", $i = "_zoomBtn_18ja1_147", Di = "_zoomLabel_18ja1_179", Ri = "_printBtn_18ja1_193", Ai = "_canvas_18ja1_223", Ei = "_page_18ja1_243", Mi = "_watermark_18ja1_269", Pi = "_footerBar_18ja1_299", q = {
|
|
2447
|
+
root: Si,
|
|
2448
|
+
dark: Ci,
|
|
2449
|
+
headerBar: Bi,
|
|
2450
|
+
entityNav: Ii,
|
|
2451
|
+
navBtn: Li,
|
|
2452
|
+
navLabel: xi,
|
|
2453
|
+
sampleBadge: zi,
|
|
2454
|
+
zoomBar: Ti,
|
|
2455
|
+
zoomBtn: $i,
|
|
2447
2456
|
zoomLabel: Di,
|
|
2448
|
-
printBtn:
|
|
2449
|
-
canvas:
|
|
2450
|
-
page:
|
|
2457
|
+
printBtn: Ri,
|
|
2458
|
+
canvas: Ai,
|
|
2459
|
+
page: Ei,
|
|
2451
2460
|
watermark: Mi,
|
|
2452
2461
|
footerBar: Pi
|
|
2453
|
-
},
|
|
2462
|
+
}, Q = 3.78, $e = {
|
|
2454
2463
|
A3: [297, 420],
|
|
2455
2464
|
A4: [210, 297],
|
|
2456
2465
|
A5: [148, 210],
|
|
@@ -2459,42 +2468,42 @@ const lr = ({
|
|
|
2459
2468
|
Legal: [216, 356],
|
|
2460
2469
|
Tabloid: [279, 432]
|
|
2461
2470
|
};
|
|
2462
|
-
function
|
|
2471
|
+
function Fi(n, s) {
|
|
2463
2472
|
try {
|
|
2464
|
-
return n.split(".").reduce((
|
|
2473
|
+
return n.split(".").reduce((m, o) => m && typeof m == "object" ? m[o] : null, s);
|
|
2465
2474
|
} catch {
|
|
2466
2475
|
return null;
|
|
2467
2476
|
}
|
|
2468
2477
|
}
|
|
2469
|
-
function
|
|
2478
|
+
function Hi(n, s, m) {
|
|
2470
2479
|
if (n == null)
|
|
2471
2480
|
return "";
|
|
2472
|
-
if (
|
|
2481
|
+
if (s === "date" && m)
|
|
2473
2482
|
try {
|
|
2474
2483
|
const o = new Date(n);
|
|
2475
|
-
if (
|
|
2476
|
-
const
|
|
2477
|
-
return `${
|
|
2484
|
+
if (m === "DD.MM.YYYY") {
|
|
2485
|
+
const B = String(o.getDate()).padStart(2, "0"), N = String(o.getMonth() + 1).padStart(2, "0");
|
|
2486
|
+
return `${B}.${N}.${o.getFullYear()}`;
|
|
2478
2487
|
}
|
|
2479
2488
|
return o.toLocaleDateString();
|
|
2480
2489
|
} catch {
|
|
2481
2490
|
return String(n);
|
|
2482
2491
|
}
|
|
2483
|
-
if (
|
|
2492
|
+
if (s === "currency" && m) {
|
|
2484
2493
|
const o = Number(n);
|
|
2485
2494
|
if (!isNaN(o))
|
|
2486
|
-
return `${o.toFixed(2)} ${
|
|
2495
|
+
return `${o.toFixed(2)} ${m}`;
|
|
2487
2496
|
}
|
|
2488
|
-
return
|
|
2497
|
+
return s === "number" && typeof n == "number" ? n.toLocaleString("pl-PL") : String(n);
|
|
2489
2498
|
}
|
|
2490
|
-
const
|
|
2491
|
-
const o = n.dataPath ?
|
|
2499
|
+
const Gi = ({ field: n, data: s, zoom: m }) => {
|
|
2500
|
+
const o = n.dataPath ? Fi(n.dataPath, s) : null, B = o != null ? Hi(o, n.type, n.format) : n.fallback ?? "", N = (h) => h * m * Q, b = {
|
|
2492
2501
|
position: "absolute",
|
|
2493
|
-
left:
|
|
2494
|
-
top:
|
|
2495
|
-
width:
|
|
2496
|
-
height:
|
|
2497
|
-
fontSize: (n.style.fontSize ?? 10) *
|
|
2502
|
+
left: N(n.position.x),
|
|
2503
|
+
top: N(n.position.y),
|
|
2504
|
+
width: N(n.position.width),
|
|
2505
|
+
height: N(n.position.height),
|
|
2506
|
+
fontSize: (n.style.fontSize ?? 10) * m,
|
|
2498
2507
|
fontWeight: n.style.fontWeight ?? "normal",
|
|
2499
2508
|
fontStyle: n.style.fontStyle ?? "normal",
|
|
2500
2509
|
color: n.style.color ?? "var(--nice-text-primary, #0f172a)",
|
|
@@ -2505,7 +2514,7 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
|
|
|
2505
2514
|
display: "flex",
|
|
2506
2515
|
alignItems: n.style.verticalAlign === "middle" ? "center" : n.style.verticalAlign === "bottom" ? "flex-end" : "flex-start",
|
|
2507
2516
|
lineHeight: n.style.lineHeight ?? 1.4,
|
|
2508
|
-
padding: n.style.padding ?
|
|
2517
|
+
padding: n.style.padding ? N(n.style.padding) : 0,
|
|
2509
2518
|
boxSizing: "border-box",
|
|
2510
2519
|
borderWidth: n.style.borderWidth,
|
|
2511
2520
|
borderColor: n.style.borderColor,
|
|
@@ -2513,7 +2522,7 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
|
|
|
2513
2522
|
borderRadius: n.style.borderRadius,
|
|
2514
2523
|
zIndex: n.position.zIndex ?? 1
|
|
2515
2524
|
};
|
|
2516
|
-
return n.type === "image" && o ? /* @__PURE__ */ e("div", { style:
|
|
2525
|
+
return n.type === "image" && o ? /* @__PURE__ */ e("div", { style: b, children: /* @__PURE__ */ e(
|
|
2517
2526
|
"img",
|
|
2518
2527
|
{
|
|
2519
2528
|
src: String(o),
|
|
@@ -2524,189 +2533,197 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
|
|
|
2524
2533
|
"div",
|
|
2525
2534
|
{
|
|
2526
2535
|
style: {
|
|
2527
|
-
...
|
|
2536
|
+
...b,
|
|
2528
2537
|
background: "var(--nice-bg-secondary, #f8fafc)",
|
|
2529
2538
|
border: "1px dashed var(--nice-border-color, #e2e8f0)",
|
|
2530
2539
|
alignItems: "center",
|
|
2531
2540
|
justifyContent: "center",
|
|
2532
|
-
fontSize: 10 *
|
|
2541
|
+
fontSize: 10 * m
|
|
2533
2542
|
},
|
|
2534
2543
|
children: [
|
|
2535
|
-
/* @__PURE__ */ e(
|
|
2544
|
+
/* @__PURE__ */ e(S, { name: n.type === "qr" ? "qr-code" : "barcode", size: 12 * m }),
|
|
2536
2545
|
" ",
|
|
2537
|
-
|
|
2546
|
+
B
|
|
2538
2547
|
]
|
|
2539
2548
|
}
|
|
2540
2549
|
) : n.type === "signature" ? /* @__PURE__ */ e(
|
|
2541
2550
|
"div",
|
|
2542
2551
|
{
|
|
2543
2552
|
style: {
|
|
2544
|
-
...
|
|
2553
|
+
...b,
|
|
2545
2554
|
borderBottom: "1px solid var(--nice-border-color, #0f172a)",
|
|
2546
2555
|
alignItems: "flex-end"
|
|
2547
2556
|
},
|
|
2548
|
-
children: /* @__PURE__ */ e("span", { style: { fontSize: 8 *
|
|
2557
|
+
children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * m, color: "var(--nice-text-muted, #94a3b8)" }, children: n.label })
|
|
2549
2558
|
}
|
|
2550
2559
|
) : n.type === "line" ? /* @__PURE__ */ e(
|
|
2551
2560
|
"div",
|
|
2552
2561
|
{
|
|
2553
2562
|
style: {
|
|
2554
|
-
...
|
|
2563
|
+
...b,
|
|
2555
2564
|
borderBottom: `${n.style.borderWidth ?? 1}px ${n.style.borderStyle ?? "solid"} ${n.style.borderColor ?? "var(--nice-text-primary, #0f172a)"}`
|
|
2556
2565
|
}
|
|
2557
2566
|
}
|
|
2558
|
-
) : /* @__PURE__ */ e("div", { style:
|
|
2559
|
-
},
|
|
2560
|
-
var
|
|
2561
|
-
const [o,
|
|
2562
|
-
const [
|
|
2563
|
-
return n.orientation === "landscape" ? [
|
|
2564
|
-
})(),
|
|
2565
|
-
return /* @__PURE__ */ a("div", { className:
|
|
2567
|
+
) : /* @__PURE__ */ e("div", { style: b, children: B });
|
|
2568
|
+
}, Oi = ({ template: n, data: s, zoom: m }) => {
|
|
2569
|
+
var h;
|
|
2570
|
+
const [o, B] = (() => {
|
|
2571
|
+
const [g, _] = $e[n.paperSize] ?? $e.A4;
|
|
2572
|
+
return n.orientation === "landscape" ? [_ * Q * m, g * Q * m] : [g * Q * m, _ * Q * m];
|
|
2573
|
+
})(), N = n.margins, b = n.sections.flatMap((g) => g.fields);
|
|
2574
|
+
return /* @__PURE__ */ a("div", { className: q.page, style: { width: o, minHeight: B }, children: [
|
|
2566
2575
|
/* @__PURE__ */ e(
|
|
2567
2576
|
"div",
|
|
2568
2577
|
{
|
|
2569
2578
|
style: {
|
|
2570
2579
|
position: "absolute",
|
|
2571
|
-
top:
|
|
2572
|
-
left:
|
|
2573
|
-
right:
|
|
2574
|
-
bottom:
|
|
2580
|
+
top: N.top * m * Q,
|
|
2581
|
+
left: N.left * m * Q,
|
|
2582
|
+
right: N.right * m * Q,
|
|
2583
|
+
bottom: N.bottom * m * Q
|
|
2575
2584
|
},
|
|
2576
|
-
children:
|
|
2585
|
+
children: b.map((g) => /* @__PURE__ */ e(Gi, { field: g, data: s, zoom: m }, g.id))
|
|
2577
2586
|
}
|
|
2578
2587
|
),
|
|
2579
|
-
(
|
|
2588
|
+
(h = n.watermarks) == null ? void 0 : h.map((g) => /* @__PURE__ */ e(
|
|
2580
2589
|
"div",
|
|
2581
2590
|
{
|
|
2582
|
-
className:
|
|
2591
|
+
className: q.watermark,
|
|
2583
2592
|
style: {
|
|
2584
|
-
opacity:
|
|
2585
|
-
transform: `rotate(${
|
|
2586
|
-
fontSize: (
|
|
2593
|
+
opacity: g.opacity,
|
|
2594
|
+
transform: `rotate(${g.angle}deg)`,
|
|
2595
|
+
fontSize: (g.fontSize ?? 48) * m
|
|
2587
2596
|
},
|
|
2588
|
-
children:
|
|
2597
|
+
children: g.type === "text" ? g.text : /* @__PURE__ */ e(
|
|
2589
2598
|
"img",
|
|
2590
2599
|
{
|
|
2591
|
-
src:
|
|
2600
|
+
src: g.imageUrl,
|
|
2592
2601
|
alt: "wm",
|
|
2593
|
-
style: { maxWidth: 200 *
|
|
2602
|
+
style: { maxWidth: 200 * m }
|
|
2594
2603
|
}
|
|
2595
2604
|
)
|
|
2596
2605
|
},
|
|
2597
|
-
|
|
2606
|
+
g.id
|
|
2598
2607
|
))
|
|
2599
2608
|
] });
|
|
2600
|
-
},
|
|
2609
|
+
}, dr = ({
|
|
2601
2610
|
template: n,
|
|
2602
|
-
entities:
|
|
2603
|
-
sampleData:
|
|
2611
|
+
entities: s = [],
|
|
2612
|
+
sampleData: m,
|
|
2604
2613
|
onPrint: o,
|
|
2605
|
-
className:
|
|
2606
|
-
style:
|
|
2607
|
-
theme:
|
|
2608
|
-
asPopup:
|
|
2609
|
-
open:
|
|
2610
|
-
onClose:
|
|
2614
|
+
className: B,
|
|
2615
|
+
style: N,
|
|
2616
|
+
theme: b = "light",
|
|
2617
|
+
asPopup: h = !0,
|
|
2618
|
+
open: g,
|
|
2619
|
+
onClose: _
|
|
2611
2620
|
}) => {
|
|
2612
|
-
const { t:
|
|
2613
|
-
|
|
2621
|
+
const { t: l } = X(), [f, C] = H(0), [z, y] = H(0.8), [r, i] = H(!0), u = g !== void 0, c = u ? g : r, F = () => {
|
|
2622
|
+
u || i(!1), _ == null || _();
|
|
2614
2623
|
};
|
|
2615
2624
|
Se(() => {
|
|
2616
|
-
if (!
|
|
2625
|
+
if (!h || !c)
|
|
2617
2626
|
return;
|
|
2618
|
-
const
|
|
2619
|
-
|
|
2627
|
+
const A = (Y) => {
|
|
2628
|
+
Y.key === "Escape" && F();
|
|
2620
2629
|
};
|
|
2621
|
-
return document.addEventListener("keydown",
|
|
2622
|
-
document.removeEventListener("keydown",
|
|
2630
|
+
return document.addEventListener("keydown", A), document.body.style.overflow = "hidden", () => {
|
|
2631
|
+
document.removeEventListener("keydown", A), document.body.style.overflow = "";
|
|
2623
2632
|
};
|
|
2624
|
-
}, [
|
|
2625
|
-
const
|
|
2626
|
-
if (
|
|
2633
|
+
}, [h, c]);
|
|
2634
|
+
const v = ue(() => s.length > 0 ? s : m ? [m.data] : [{}], [s, m]), D = v[f] ?? {};
|
|
2635
|
+
if (h && !c)
|
|
2627
2636
|
return null;
|
|
2628
|
-
const
|
|
2637
|
+
const x = /* @__PURE__ */ a(
|
|
2629
2638
|
"div",
|
|
2630
2639
|
{
|
|
2631
|
-
className: `${
|
|
2632
|
-
style:
|
|
2640
|
+
className: `${q.root} ${b === "dark" ? q.dark : ""} ${B ?? ""}`,
|
|
2641
|
+
style: N,
|
|
2633
2642
|
children: [
|
|
2634
|
-
/* @__PURE__ */ a("div", { className:
|
|
2635
|
-
/* @__PURE__ */ a("div", { className:
|
|
2636
|
-
|
|
2643
|
+
/* @__PURE__ */ a("div", { className: q.headerBar, children: [
|
|
2644
|
+
/* @__PURE__ */ a("div", { className: q.entityNav, children: [
|
|
2645
|
+
v.length > 1 && /* @__PURE__ */ a(V, { children: [
|
|
2637
2646
|
/* @__PURE__ */ e(
|
|
2638
2647
|
"button",
|
|
2639
2648
|
{
|
|
2640
|
-
className:
|
|
2641
|
-
disabled:
|
|
2642
|
-
onClick: () =>
|
|
2649
|
+
className: q.navBtn,
|
|
2650
|
+
disabled: f === 0,
|
|
2651
|
+
onClick: () => C((A) => A - 1),
|
|
2643
2652
|
children: "‹"
|
|
2644
2653
|
}
|
|
2645
2654
|
),
|
|
2646
|
-
/* @__PURE__ */ a("span", { className:
|
|
2647
|
-
|
|
2655
|
+
/* @__PURE__ */ a("span", { className: q.navLabel, children: [
|
|
2656
|
+
f + 1,
|
|
2648
2657
|
" / ",
|
|
2649
|
-
|
|
2658
|
+
v.length
|
|
2650
2659
|
] }),
|
|
2651
2660
|
/* @__PURE__ */ e(
|
|
2652
2661
|
"button",
|
|
2653
2662
|
{
|
|
2654
|
-
className:
|
|
2655
|
-
disabled:
|
|
2656
|
-
onClick: () =>
|
|
2663
|
+
className: q.navBtn,
|
|
2664
|
+
disabled: f >= v.length - 1,
|
|
2665
|
+
onClick: () => C((A) => A + 1),
|
|
2657
2666
|
children: "›"
|
|
2658
2667
|
}
|
|
2659
2668
|
)
|
|
2660
2669
|
] }),
|
|
2661
|
-
|
|
2670
|
+
s.length === 0 && m && /* @__PURE__ */ e("span", { className: q.sampleBadge, children: l("printing.sampleData", "Sample data") })
|
|
2662
2671
|
] }),
|
|
2663
|
-
/* @__PURE__ */ a("div", { className:
|
|
2664
|
-
/* @__PURE__ */ e("button", { className:
|
|
2665
|
-
/* @__PURE__ */ a("span", { className:
|
|
2666
|
-
Math.round(
|
|
2672
|
+
/* @__PURE__ */ a("div", { className: q.zoomBar, children: [
|
|
2673
|
+
/* @__PURE__ */ e("button", { className: q.zoomBtn, onClick: () => y((A) => Math.max(0.3, A - 0.1)), children: "−" }),
|
|
2674
|
+
/* @__PURE__ */ a("span", { className: q.zoomLabel, children: [
|
|
2675
|
+
Math.round(z * 100),
|
|
2667
2676
|
"%"
|
|
2668
2677
|
] }),
|
|
2669
|
-
/* @__PURE__ */ e("button", { className:
|
|
2670
|
-
/* @__PURE__ */ e(
|
|
2678
|
+
/* @__PURE__ */ e("button", { className: q.zoomBtn, onClick: () => y((A) => Math.min(2.5, A + 0.1)), children: "+" }),
|
|
2679
|
+
/* @__PURE__ */ e(
|
|
2680
|
+
"button",
|
|
2681
|
+
{
|
|
2682
|
+
className: q.zoomBtn,
|
|
2683
|
+
onClick: () => y(0.8),
|
|
2684
|
+
title: l("printing.fit", "Fit"),
|
|
2685
|
+
children: "⊡"
|
|
2686
|
+
}
|
|
2687
|
+
)
|
|
2671
2688
|
] }),
|
|
2672
2689
|
/* @__PURE__ */ a("div", { style: { display: "flex", gap: 8 }, children: [
|
|
2673
2690
|
/* @__PURE__ */ e(
|
|
2674
2691
|
"button",
|
|
2675
2692
|
{
|
|
2676
|
-
className:
|
|
2693
|
+
className: q.printBtn,
|
|
2677
2694
|
onClick: () => o == null ? void 0 : o({ copies: 1, printerId: "" }),
|
|
2678
|
-
children:
|
|
2695
|
+
children: l("printPreview.print", "Print")
|
|
2679
2696
|
}
|
|
2680
2697
|
),
|
|
2681
|
-
|
|
2698
|
+
h && /* @__PURE__ */ e(
|
|
2682
2699
|
"button",
|
|
2683
2700
|
{
|
|
2684
2701
|
type: "button",
|
|
2685
|
-
className:
|
|
2686
|
-
onClick:
|
|
2687
|
-
"aria-label":
|
|
2688
|
-
title:
|
|
2689
|
-
children: /* @__PURE__ */ e(
|
|
2702
|
+
className: q.zoomBtn,
|
|
2703
|
+
onClick: F,
|
|
2704
|
+
"aria-label": l("close", "Close"),
|
|
2705
|
+
title: l("close", "Close"),
|
|
2706
|
+
children: /* @__PURE__ */ e(S, { name: "close", size: 16 })
|
|
2690
2707
|
}
|
|
2691
2708
|
)
|
|
2692
2709
|
] })
|
|
2693
2710
|
] }),
|
|
2694
|
-
/* @__PURE__ */ e("div", { className:
|
|
2695
|
-
/* @__PURE__ */ a("div", { className:
|
|
2711
|
+
/* @__PURE__ */ e("div", { className: q.canvas, children: /* @__PURE__ */ e(Oi, { template: n, data: D, zoom: z }) }),
|
|
2712
|
+
/* @__PURE__ */ a("div", { className: q.footerBar, children: [
|
|
2696
2713
|
/* @__PURE__ */ e("span", { children: n.name }),
|
|
2697
2714
|
/* @__PURE__ */ a("span", { children: [
|
|
2698
2715
|
n.paperSize,
|
|
2699
2716
|
" · ",
|
|
2700
2717
|
n.orientation === "portrait" ? "Pion" : "Poziom"
|
|
2701
2718
|
] }),
|
|
2702
|
-
n.sections.reduce((
|
|
2719
|
+
n.sections.reduce((A, Y) => A + Y.fields.length, 0),
|
|
2703
2720
|
" ",
|
|
2704
|
-
|
|
2721
|
+
l("printing.fields", "fields")
|
|
2705
2722
|
] })
|
|
2706
2723
|
]
|
|
2707
2724
|
}
|
|
2708
2725
|
);
|
|
2709
|
-
return
|
|
2726
|
+
return h ? Qe(/* @__PURE__ */ e(
|
|
2710
2727
|
"div",
|
|
2711
2728
|
{
|
|
2712
2729
|
style: {
|
|
@@ -2719,8 +2736,8 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
|
|
|
2719
2736
|
zIndex: 1e3,
|
|
2720
2737
|
padding: 24
|
|
2721
2738
|
},
|
|
2722
|
-
onMouseDown: (
|
|
2723
|
-
|
|
2739
|
+
onMouseDown: (A) => {
|
|
2740
|
+
A.target === A.currentTarget && F();
|
|
2724
2741
|
},
|
|
2725
2742
|
role: "presentation",
|
|
2726
2743
|
children: /* @__PURE__ */ e(
|
|
@@ -2736,488 +2753,488 @@ const Hi = ({ field: n, data: l, zoom: d }) => {
|
|
|
2736
2753
|
maxHeight: "90vh",
|
|
2737
2754
|
overflow: "auto"
|
|
2738
2755
|
},
|
|
2739
|
-
children:
|
|
2756
|
+
children: x
|
|
2740
2757
|
}
|
|
2741
2758
|
)
|
|
2742
2759
|
}
|
|
2743
|
-
), document.body) :
|
|
2744
|
-
},
|
|
2745
|
-
root:
|
|
2746
|
-
dark:
|
|
2747
|
-
statsBar:
|
|
2748
|
-
stat:
|
|
2749
|
-
dot:
|
|
2760
|
+
), document.body) : x;
|
|
2761
|
+
}, qi = "_root_1f4bm_1", Wi = "_dark_1f4bm_23", Yi = "_statsBar_1f4bm_37", ji = "_stat_1f4bm_37", Ui = "_dot_1f4bm_75", Vi = "_statPrinting_1f4bm_87", Xi = "_statQueued_1f4bm_93", Ki = "_statDone_1f4bm_99", Ji = "_statError_1f4bm_105", Qi = "_toolbar_1f4bm_115", Zi = "_filterTabs_1f4bm_139", es = "_filterTab_1f4bm_139", ts = "_filterTabActive_1f4bm_177", ns = "_filterCount_1f4bm_187", as = "_bulkActions_1f4bm_211", is = "_bulkCount_1f4bm_223", ss = "_bulkBtn_1f4bm_231", rs = "_bulkBtnRemove_1f4bm_255", os = "_jobList_1f4bm_273", ls = "_listHeader_1f4bm_281", cs = "_headerLabel_1f4bm_313", ds = "_jobRow_1f4bm_323", ms = "_jobRowSelected_1f4bm_359", ps = "_jobCheckbox_1f4bm_373", us = "_statusBadge_1f4bm_387", hs = "_pulse_1f4bm_1", _s = "_jobInfo_1f4bm_479", gs = "_jobName_1f4bm_485", bs = "_jobMeta_1f4bm_497", ys = "_jobTime_1f4bm_513", fs = "_jobDuration_1f4bm_519", vs = "_jobError_1f4bm_525", Ns = "_progressBar_1f4bm_539", ws = "_progressFill_1f4bm_553", ks = "_copiesEditor_1f4bm_569", Ss = "_copiesBtn_1f4bm_581", Cs = "_copiesValue_1f4bm_621", Bs = "_jobActions_1f4bm_635", Is = "_actionBtn_1f4bm_645", Ls = "_removeBtn_1f4bm_677", xs = "_emptyState_1f4bm_695", k = {
|
|
2762
|
+
root: qi,
|
|
2763
|
+
dark: Wi,
|
|
2764
|
+
statsBar: Yi,
|
|
2765
|
+
stat: ji,
|
|
2766
|
+
dot: Ui,
|
|
2750
2767
|
statPrinting: Vi,
|
|
2751
|
-
statQueued:
|
|
2768
|
+
statQueued: Xi,
|
|
2752
2769
|
statDone: Ki,
|
|
2753
|
-
statError:
|
|
2754
|
-
toolbar:
|
|
2755
|
-
filterTabs:
|
|
2756
|
-
filterTab:
|
|
2757
|
-
filterTabActive:
|
|
2758
|
-
filterCount:
|
|
2759
|
-
bulkActions:
|
|
2760
|
-
bulkCount:
|
|
2761
|
-
bulkBtn:
|
|
2762
|
-
bulkBtnRemove:
|
|
2763
|
-
jobList:
|
|
2770
|
+
statError: Ji,
|
|
2771
|
+
toolbar: Qi,
|
|
2772
|
+
filterTabs: Zi,
|
|
2773
|
+
filterTab: es,
|
|
2774
|
+
filterTabActive: ts,
|
|
2775
|
+
filterCount: ns,
|
|
2776
|
+
bulkActions: as,
|
|
2777
|
+
bulkCount: is,
|
|
2778
|
+
bulkBtn: ss,
|
|
2779
|
+
bulkBtnRemove: rs,
|
|
2780
|
+
jobList: os,
|
|
2764
2781
|
listHeader: ls,
|
|
2765
|
-
headerLabel:
|
|
2766
|
-
jobRow:
|
|
2767
|
-
jobRowSelected:
|
|
2782
|
+
headerLabel: cs,
|
|
2783
|
+
jobRow: ds,
|
|
2784
|
+
jobRowSelected: ms,
|
|
2768
2785
|
jobCheckbox: ps,
|
|
2769
2786
|
statusBadge: us,
|
|
2770
|
-
"badge-queued": "_badge-
|
|
2771
|
-
"badge-printing": "_badge-
|
|
2772
|
-
pulse:
|
|
2773
|
-
"badge-done": "_badge-
|
|
2774
|
-
"badge-error": "_badge-
|
|
2775
|
-
"badge-paused": "_badge-
|
|
2776
|
-
"badge-cancelled": "_badge-
|
|
2777
|
-
jobInfo:
|
|
2778
|
-
jobName:
|
|
2779
|
-
jobMeta:
|
|
2780
|
-
jobTime:
|
|
2781
|
-
jobDuration:
|
|
2787
|
+
"badge-queued": "_badge-queued_1f4bm_405",
|
|
2788
|
+
"badge-printing": "_badge-printing_1f4bm_413",
|
|
2789
|
+
pulse: hs,
|
|
2790
|
+
"badge-done": "_badge-done_1f4bm_423",
|
|
2791
|
+
"badge-error": "_badge-error_1f4bm_431",
|
|
2792
|
+
"badge-paused": "_badge-paused_1f4bm_439",
|
|
2793
|
+
"badge-cancelled": "_badge-cancelled_1f4bm_447",
|
|
2794
|
+
jobInfo: _s,
|
|
2795
|
+
jobName: gs,
|
|
2796
|
+
jobMeta: bs,
|
|
2797
|
+
jobTime: ys,
|
|
2798
|
+
jobDuration: fs,
|
|
2782
2799
|
jobError: vs,
|
|
2783
2800
|
progressBar: Ns,
|
|
2784
|
-
progressFill:
|
|
2785
|
-
copiesEditor:
|
|
2786
|
-
copiesBtn:
|
|
2787
|
-
copiesValue:
|
|
2788
|
-
jobActions:
|
|
2789
|
-
actionBtn:
|
|
2790
|
-
removeBtn:
|
|
2791
|
-
emptyState:
|
|
2792
|
-
},
|
|
2801
|
+
progressFill: ws,
|
|
2802
|
+
copiesEditor: ks,
|
|
2803
|
+
copiesBtn: Ss,
|
|
2804
|
+
copiesValue: Cs,
|
|
2805
|
+
jobActions: Bs,
|
|
2806
|
+
actionBtn: Is,
|
|
2807
|
+
removeBtn: Ls,
|
|
2808
|
+
emptyState: xs
|
|
2809
|
+
}, zs = [], De = {
|
|
2793
2810
|
queued: "Queued",
|
|
2794
2811
|
printing: "Printing",
|
|
2795
2812
|
done: "Printed",
|
|
2796
2813
|
error: "Error",
|
|
2797
2814
|
paused: "Paused",
|
|
2798
2815
|
cancelled: "Cancelled"
|
|
2799
|
-
}, ke = (n,
|
|
2800
|
-
function
|
|
2816
|
+
}, ke = (n, s) => De[s] ? n(`printing.status.${s}`, De[s]) : s;
|
|
2817
|
+
function Ts(n, s) {
|
|
2801
2818
|
try {
|
|
2802
|
-
return new Date(
|
|
2819
|
+
return new Date(s).toLocaleTimeString(n, { hour: "2-digit", minute: "2-digit" });
|
|
2803
2820
|
} catch {
|
|
2804
|
-
return
|
|
2821
|
+
return s;
|
|
2805
2822
|
}
|
|
2806
2823
|
}
|
|
2807
|
-
function
|
|
2808
|
-
const
|
|
2809
|
-
if (
|
|
2810
|
-
return `${
|
|
2811
|
-
const
|
|
2812
|
-
if (
|
|
2813
|
-
return `${
|
|
2814
|
-
const o = Math.floor(
|
|
2815
|
-
return o < 24 ? `${o}h ${
|
|
2824
|
+
function $s(n) {
|
|
2825
|
+
const s = Math.floor((Date.now() - new Date(n).getTime()) / 1e3);
|
|
2826
|
+
if (s < 60)
|
|
2827
|
+
return `${s}s`;
|
|
2828
|
+
const m = Math.floor(s / 60);
|
|
2829
|
+
if (m < 60)
|
|
2830
|
+
return `${m}m ${s % 60}s`;
|
|
2831
|
+
const o = Math.floor(m / 60);
|
|
2832
|
+
return o < 24 ? `${o}h ${m % 60}m` : `${Math.floor(o / 24)}d ${o % 24}h`;
|
|
2816
2833
|
}
|
|
2817
|
-
const
|
|
2818
|
-
const { t:
|
|
2819
|
-
return /* @__PURE__ */ a("div", { className:
|
|
2820
|
-
/* @__PURE__ */ a("span", { className: `${
|
|
2821
|
-
/* @__PURE__ */ e("span", { className:
|
|
2822
|
-
|
|
2834
|
+
const Ds = ({ jobs: n }) => {
|
|
2835
|
+
const { t: s } = X(), m = n.filter((b) => b.status === "printing").length, o = n.filter((b) => b.status === "queued").length, B = n.filter((b) => b.status === "done").length, N = n.filter((b) => b.status === "error").length;
|
|
2836
|
+
return /* @__PURE__ */ a("div", { className: k.statsBar, children: [
|
|
2837
|
+
/* @__PURE__ */ a("span", { className: `${k.stat} ${k.statPrinting}`, children: [
|
|
2838
|
+
/* @__PURE__ */ e("span", { className: k.dot }),
|
|
2839
|
+
s("printing.stats.active", "Printing"),
|
|
2823
2840
|
": ",
|
|
2824
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2841
|
+
/* @__PURE__ */ e("strong", { children: m })
|
|
2825
2842
|
] }),
|
|
2826
|
-
/* @__PURE__ */ a("span", { className: `${
|
|
2827
|
-
/* @__PURE__ */ e("span", { className:
|
|
2828
|
-
|
|
2843
|
+
/* @__PURE__ */ a("span", { className: `${k.stat} ${k.statQueued}`, children: [
|
|
2844
|
+
/* @__PURE__ */ e("span", { className: k.dot }),
|
|
2845
|
+
s("printing.stats.queued", "In queue"),
|
|
2829
2846
|
": ",
|
|
2830
2847
|
/* @__PURE__ */ e("strong", { children: o })
|
|
2831
2848
|
] }),
|
|
2832
|
-
/* @__PURE__ */ a("span", { className: `${
|
|
2833
|
-
/* @__PURE__ */ e("span", { className:
|
|
2834
|
-
|
|
2849
|
+
/* @__PURE__ */ a("span", { className: `${k.stat} ${k.statDone}`, children: [
|
|
2850
|
+
/* @__PURE__ */ e("span", { className: k.dot }),
|
|
2851
|
+
s("printing.stats.done", "Done"),
|
|
2835
2852
|
": ",
|
|
2836
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2853
|
+
/* @__PURE__ */ e("strong", { children: B })
|
|
2837
2854
|
] }),
|
|
2838
|
-
|
|
2839
|
-
/* @__PURE__ */ e("span", { className:
|
|
2840
|
-
|
|
2855
|
+
N > 0 && /* @__PURE__ */ a("span", { className: `${k.stat} ${k.statError}`, children: [
|
|
2856
|
+
/* @__PURE__ */ e("span", { className: k.dot }),
|
|
2857
|
+
s("printing.stats.errors", "Errors"),
|
|
2841
2858
|
": ",
|
|
2842
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2859
|
+
/* @__PURE__ */ e("strong", { children: N })
|
|
2843
2860
|
] })
|
|
2844
2861
|
] });
|
|
2845
|
-
},
|
|
2862
|
+
}, Rs = ({
|
|
2846
2863
|
job: n,
|
|
2847
|
-
index:
|
|
2848
|
-
total:
|
|
2864
|
+
index: s,
|
|
2865
|
+
total: m,
|
|
2849
2866
|
printers: o,
|
|
2850
|
-
selected:
|
|
2851
|
-
onSelect:
|
|
2852
|
-
onUpdate:
|
|
2853
|
-
onRemove:
|
|
2854
|
-
onPrint:
|
|
2855
|
-
onReorder:
|
|
2867
|
+
selected: B,
|
|
2868
|
+
onSelect: N,
|
|
2869
|
+
onUpdate: b,
|
|
2870
|
+
onRemove: h,
|
|
2871
|
+
onPrint: g,
|
|
2872
|
+
onReorder: _
|
|
2856
2873
|
}) => {
|
|
2857
|
-
const { t:
|
|
2874
|
+
const { t: l, lang: f } = X(), C = o.find((r) => r.id === n.options.printerId), z = s > 0 && n.status === "queued", y = s < m - 1 && n.status === "queued";
|
|
2858
2875
|
return /* @__PURE__ */ a(
|
|
2859
2876
|
"div",
|
|
2860
2877
|
{
|
|
2861
|
-
className: `${
|
|
2878
|
+
className: `${k.jobRow} ${B ? k.jobRowSelected : ""} ${k[`status-${n.status}`] ?? ""}`,
|
|
2862
2879
|
children: [
|
|
2863
2880
|
/* @__PURE__ */ e(
|
|
2864
2881
|
"input",
|
|
2865
2882
|
{
|
|
2866
2883
|
type: "checkbox",
|
|
2867
|
-
className:
|
|
2868
|
-
checked:
|
|
2869
|
-
onChange: () =>
|
|
2884
|
+
className: k.jobCheckbox,
|
|
2885
|
+
checked: B,
|
|
2886
|
+
onChange: () => N(n.id)
|
|
2870
2887
|
}
|
|
2871
2888
|
),
|
|
2872
|
-
/* @__PURE__ */ e("span", { className: `${
|
|
2873
|
-
/* @__PURE__ */ a("div", { className:
|
|
2874
|
-
/* @__PURE__ */ e("div", { className:
|
|
2875
|
-
/* @__PURE__ */ a("div", { className:
|
|
2889
|
+
/* @__PURE__ */ e("span", { className: `${k.statusBadge} ${k[`badge-${n.status}`]}`, children: ke(l, n.status) }),
|
|
2890
|
+
/* @__PURE__ */ a("div", { className: k.jobInfo, children: [
|
|
2891
|
+
/* @__PURE__ */ e("div", { className: k.jobName, children: n.templateName ?? n.templateId }),
|
|
2892
|
+
/* @__PURE__ */ a("div", { className: k.jobMeta, children: [
|
|
2876
2893
|
n.entityLabel && /* @__PURE__ */ e("span", { children: n.entityLabel }),
|
|
2877
|
-
|
|
2878
|
-
/* @__PURE__ */ e(
|
|
2894
|
+
C && /* @__PURE__ */ a("span", { children: [
|
|
2895
|
+
/* @__PURE__ */ e(S, { name: "printer", size: 12 }),
|
|
2879
2896
|
" ",
|
|
2880
|
-
|
|
2897
|
+
C.name
|
|
2881
2898
|
] }),
|
|
2882
2899
|
/* @__PURE__ */ a("span", { children: [
|
|
2883
2900
|
"×",
|
|
2884
2901
|
n.options.copies
|
|
2885
2902
|
] }),
|
|
2886
|
-
n.createdAt && /* @__PURE__ */ e("span", { className:
|
|
2887
|
-
n.startedAt && n.status !== "done" && /* @__PURE__ */ e("span", { className:
|
|
2903
|
+
n.createdAt && /* @__PURE__ */ e("span", { className: k.jobTime, children: Ts(f, n.createdAt) }),
|
|
2904
|
+
n.startedAt && n.status !== "done" && /* @__PURE__ */ e("span", { className: k.jobDuration, children: $s(n.startedAt) })
|
|
2888
2905
|
] }),
|
|
2889
|
-
n.status === "printing" && n.progress != null && /* @__PURE__ */ e("div", { className:
|
|
2890
|
-
n.status === "error" && n.errorMessage && /* @__PURE__ */ e("div", { className:
|
|
2906
|
+
n.status === "printing" && n.progress != null && /* @__PURE__ */ e("div", { className: k.progressBar, children: /* @__PURE__ */ e("div", { className: k.progressFill, style: { width: `${n.progress}%` } }) }),
|
|
2907
|
+
n.status === "error" && n.errorMessage && /* @__PURE__ */ e("div", { className: k.jobError, children: n.errorMessage })
|
|
2891
2908
|
] }),
|
|
2892
|
-
/* @__PURE__ */ a("div", { className:
|
|
2909
|
+
/* @__PURE__ */ a("div", { className: k.copiesEditor, children: [
|
|
2893
2910
|
/* @__PURE__ */ e(
|
|
2894
2911
|
"button",
|
|
2895
2912
|
{
|
|
2896
|
-
className:
|
|
2913
|
+
className: k.copiesBtn,
|
|
2897
2914
|
disabled: n.options.copies <= 1,
|
|
2898
|
-
"aria-label":
|
|
2899
|
-
onClick: () =>
|
|
2900
|
-
children: /* @__PURE__ */ e(
|
|
2915
|
+
"aria-label": l("printing.copies.decrease", "One copy fewer"),
|
|
2916
|
+
onClick: () => b(n.id, { options: { ...n.options, copies: n.options.copies - 1 } }),
|
|
2917
|
+
children: /* @__PURE__ */ e(S, { name: "minus", size: 12 })
|
|
2901
2918
|
}
|
|
2902
2919
|
),
|
|
2903
|
-
/* @__PURE__ */ e("span", { className:
|
|
2920
|
+
/* @__PURE__ */ e("span", { className: k.copiesValue, children: n.options.copies }),
|
|
2904
2921
|
/* @__PURE__ */ e(
|
|
2905
2922
|
"button",
|
|
2906
2923
|
{
|
|
2907
|
-
className:
|
|
2908
|
-
"aria-label":
|
|
2909
|
-
onClick: () =>
|
|
2910
|
-
children: /* @__PURE__ */ e(
|
|
2924
|
+
className: k.copiesBtn,
|
|
2925
|
+
"aria-label": l("printing.copies.increase", "One copy more"),
|
|
2926
|
+
onClick: () => b(n.id, { options: { ...n.options, copies: n.options.copies + 1 } }),
|
|
2927
|
+
children: /* @__PURE__ */ e(S, { name: "plus", size: 12 })
|
|
2911
2928
|
}
|
|
2912
2929
|
)
|
|
2913
2930
|
] }),
|
|
2914
|
-
/* @__PURE__ */ a("div", { className:
|
|
2915
|
-
|
|
2931
|
+
/* @__PURE__ */ a("div", { className: k.jobActions, children: [
|
|
2932
|
+
z && /* @__PURE__ */ e(
|
|
2916
2933
|
"button",
|
|
2917
2934
|
{
|
|
2918
|
-
className:
|
|
2919
|
-
title:
|
|
2920
|
-
onClick: () =>
|
|
2921
|
-
children: /* @__PURE__ */ e(
|
|
2935
|
+
className: k.actionBtn,
|
|
2936
|
+
title: l("printing.action.moveUp", "Move up"),
|
|
2937
|
+
onClick: () => _(s, s - 1),
|
|
2938
|
+
children: /* @__PURE__ */ e(S, { name: "arrow-up", size: 14 })
|
|
2922
2939
|
}
|
|
2923
2940
|
),
|
|
2924
|
-
|
|
2941
|
+
y && /* @__PURE__ */ e(
|
|
2925
2942
|
"button",
|
|
2926
2943
|
{
|
|
2927
|
-
className:
|
|
2928
|
-
title:
|
|
2929
|
-
onClick: () =>
|
|
2930
|
-
children: /* @__PURE__ */ e(
|
|
2944
|
+
className: k.actionBtn,
|
|
2945
|
+
title: l("printing.action.moveDown", "Move down"),
|
|
2946
|
+
onClick: () => _(s, s + 1),
|
|
2947
|
+
children: /* @__PURE__ */ e(S, { name: "arrow-down", size: 14 })
|
|
2931
2948
|
}
|
|
2932
2949
|
),
|
|
2933
2950
|
n.status === "queued" && /* @__PURE__ */ e(
|
|
2934
2951
|
"button",
|
|
2935
2952
|
{
|
|
2936
|
-
className:
|
|
2937
|
-
title:
|
|
2938
|
-
onClick: () =>
|
|
2939
|
-
children: /* @__PURE__ */ e(
|
|
2953
|
+
className: k.actionBtn,
|
|
2954
|
+
title: l("printing.action.printNow", "Print now"),
|
|
2955
|
+
onClick: () => g(n.id),
|
|
2956
|
+
children: /* @__PURE__ */ e(S, { name: "play", size: 14 })
|
|
2940
2957
|
}
|
|
2941
2958
|
),
|
|
2942
2959
|
n.status === "printing" && /* @__PURE__ */ e(
|
|
2943
2960
|
"button",
|
|
2944
2961
|
{
|
|
2945
|
-
className:
|
|
2946
|
-
title:
|
|
2947
|
-
onClick: () =>
|
|
2948
|
-
children: /* @__PURE__ */ e(
|
|
2962
|
+
className: k.actionBtn,
|
|
2963
|
+
title: l("printing.action.pause", "Pause"),
|
|
2964
|
+
onClick: () => b(n.id, { status: "paused" }),
|
|
2965
|
+
children: /* @__PURE__ */ e(S, { name: "pause", size: 14 })
|
|
2949
2966
|
}
|
|
2950
2967
|
),
|
|
2951
2968
|
n.status === "paused" && /* @__PURE__ */ e(
|
|
2952
2969
|
"button",
|
|
2953
2970
|
{
|
|
2954
|
-
className:
|
|
2955
|
-
title:
|
|
2956
|
-
onClick: () =>
|
|
2957
|
-
children: /* @__PURE__ */ e(
|
|
2971
|
+
className: k.actionBtn,
|
|
2972
|
+
title: l("printing.action.resume", "Resume"),
|
|
2973
|
+
onClick: () => b(n.id, { status: "queued" }),
|
|
2974
|
+
children: /* @__PURE__ */ e(S, { name: "play", size: 14 })
|
|
2958
2975
|
}
|
|
2959
2976
|
),
|
|
2960
2977
|
/* @__PURE__ */ e(
|
|
2961
2978
|
"button",
|
|
2962
2979
|
{
|
|
2963
|
-
className: `${
|
|
2964
|
-
title:
|
|
2965
|
-
onClick: () =>
|
|
2966
|
-
children: /* @__PURE__ */ e(
|
|
2980
|
+
className: `${k.actionBtn} ${k.removeBtn}`,
|
|
2981
|
+
title: l("printing.action.remove", "Remove"),
|
|
2982
|
+
onClick: () => h(n.id),
|
|
2983
|
+
children: /* @__PURE__ */ e(S, { name: "close", size: 14 })
|
|
2967
2984
|
}
|
|
2968
2985
|
)
|
|
2969
2986
|
] })
|
|
2970
2987
|
]
|
|
2971
2988
|
}
|
|
2972
2989
|
);
|
|
2973
|
-
},
|
|
2974
|
-
jobs: n,
|
|
2975
|
-
printers:
|
|
2976
|
-
onJobUpdate:
|
|
2990
|
+
}, mr = ({
|
|
2991
|
+
jobs: n = zs,
|
|
2992
|
+
printers: s = [],
|
|
2993
|
+
onJobUpdate: m,
|
|
2977
2994
|
onJobRemove: o,
|
|
2978
|
-
onJobReorder:
|
|
2979
|
-
onJobPrint:
|
|
2980
|
-
onBulkRemove:
|
|
2981
|
-
onBulkPrint:
|
|
2982
|
-
maxHeight:
|
|
2983
|
-
className:
|
|
2984
|
-
style:
|
|
2985
|
-
theme:
|
|
2995
|
+
onJobReorder: B,
|
|
2996
|
+
onJobPrint: N,
|
|
2997
|
+
onBulkRemove: b,
|
|
2998
|
+
onBulkPrint: h,
|
|
2999
|
+
maxHeight: g = 500,
|
|
3000
|
+
className: _,
|
|
3001
|
+
style: l,
|
|
3002
|
+
theme: f = "light"
|
|
2986
3003
|
}) => {
|
|
2987
|
-
const { t:
|
|
2988
|
-
|
|
2989
|
-
const
|
|
2990
|
-
return
|
|
3004
|
+
const { t: C } = X(), [z, y] = H(/* @__PURE__ */ new Set()), [r, i] = H("all"), u = r === "all" ? n : n.filter((x) => x.status === r), c = E((x) => {
|
|
3005
|
+
y((T) => {
|
|
3006
|
+
const A = new Set(T);
|
|
3007
|
+
return A.has(x) ? A.delete(x) : A.add(x), A;
|
|
2991
3008
|
});
|
|
2992
|
-
}, []),
|
|
2993
|
-
|
|
2994
|
-
}, [
|
|
2995
|
-
|
|
2996
|
-
}, [
|
|
2997
|
-
|
|
2998
|
-
}, [
|
|
3009
|
+
}, []), F = E(() => {
|
|
3010
|
+
z.size === u.length ? y(/* @__PURE__ */ new Set()) : y(new Set(u.map((x) => x.id)));
|
|
3011
|
+
}, [u, z.size]), v = E(() => {
|
|
3012
|
+
b == null || b(Array.from(z)), y(/* @__PURE__ */ new Set());
|
|
3013
|
+
}, [z, b]), D = E(() => {
|
|
3014
|
+
h == null || h(Array.from(z)), y(/* @__PURE__ */ new Set());
|
|
3015
|
+
}, [z, h]);
|
|
2999
3016
|
return /* @__PURE__ */ a(
|
|
3000
3017
|
"div",
|
|
3001
3018
|
{
|
|
3002
|
-
className: `${
|
|
3003
|
-
style:
|
|
3019
|
+
className: `${k.root} ${f === "dark" ? k.dark : ""} ${_ ?? ""}`,
|
|
3020
|
+
style: l,
|
|
3004
3021
|
children: [
|
|
3005
|
-
/* @__PURE__ */ e(
|
|
3006
|
-
/* @__PURE__ */ a("div", { className:
|
|
3007
|
-
/* @__PURE__ */ e("div", { className:
|
|
3022
|
+
/* @__PURE__ */ e(Ds, { jobs: n }),
|
|
3023
|
+
/* @__PURE__ */ a("div", { className: k.toolbar, children: [
|
|
3024
|
+
/* @__PURE__ */ e("div", { className: k.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((x) => /* @__PURE__ */ a(
|
|
3008
3025
|
"button",
|
|
3009
3026
|
{
|
|
3010
|
-
className: `${
|
|
3011
|
-
onClick: () =>
|
|
3027
|
+
className: `${k.filterTab} ${r === x ? k.filterTabActive : ""}`,
|
|
3028
|
+
onClick: () => i(x),
|
|
3012
3029
|
children: [
|
|
3013
|
-
|
|
3014
|
-
/* @__PURE__ */ e("span", { className:
|
|
3030
|
+
x === "all" ? C("printing.filter.all", "All") : ke(C, x),
|
|
3031
|
+
/* @__PURE__ */ e("span", { className: k.filterCount, children: x === "all" ? n.length : n.filter((T) => T.status === x).length })
|
|
3015
3032
|
]
|
|
3016
3033
|
},
|
|
3017
|
-
|
|
3034
|
+
x
|
|
3018
3035
|
)) }),
|
|
3019
|
-
|
|
3020
|
-
/* @__PURE__ */ a("span", { className:
|
|
3021
|
-
|
|
3036
|
+
z.size > 0 && /* @__PURE__ */ a("div", { className: k.bulkActions, children: [
|
|
3037
|
+
/* @__PURE__ */ a("span", { className: k.bulkCount, children: [
|
|
3038
|
+
z.size,
|
|
3022
3039
|
" ",
|
|
3023
|
-
|
|
3040
|
+
C("printing.bulk.selected", "selected")
|
|
3024
3041
|
] }),
|
|
3025
|
-
|
|
3026
|
-
/* @__PURE__ */ e(
|
|
3042
|
+
h && /* @__PURE__ */ a("button", { className: k.bulkBtn, onClick: D, children: [
|
|
3043
|
+
/* @__PURE__ */ e(S, { name: "printer", size: 14 }),
|
|
3027
3044
|
" ",
|
|
3028
|
-
|
|
3045
|
+
C("printing.bulk.print", "Print selected")
|
|
3029
3046
|
] }),
|
|
3030
|
-
|
|
3031
|
-
/* @__PURE__ */ e(
|
|
3047
|
+
b && /* @__PURE__ */ a("button", { className: `${k.bulkBtn} ${k.bulkBtnRemove}`, onClick: v, children: [
|
|
3048
|
+
/* @__PURE__ */ e(S, { name: "trash", size: 14 }),
|
|
3032
3049
|
" ",
|
|
3033
|
-
|
|
3050
|
+
C("printing.bulk.remove", "Remove selected")
|
|
3034
3051
|
] })
|
|
3035
3052
|
] })
|
|
3036
3053
|
] }),
|
|
3037
|
-
/* @__PURE__ */ e("div", { className:
|
|
3038
|
-
/* @__PURE__ */ a("div", { className:
|
|
3054
|
+
/* @__PURE__ */ e("div", { className: k.jobList, style: { maxHeight: g }, children: u.length === 0 ? /* @__PURE__ */ e("div", { className: k.emptyState, children: r === "all" ? C("printing.empty.queue", "No jobs in the queue") : `${C("printing.empty.filtered", "No jobs with status")} "${ke(C, r)}"` }) : /* @__PURE__ */ a(V, { children: [
|
|
3055
|
+
/* @__PURE__ */ a("div", { className: k.listHeader, children: [
|
|
3039
3056
|
/* @__PURE__ */ e(
|
|
3040
3057
|
"input",
|
|
3041
3058
|
{
|
|
3042
3059
|
type: "checkbox",
|
|
3043
|
-
onChange:
|
|
3044
|
-
checked:
|
|
3060
|
+
onChange: F,
|
|
3061
|
+
checked: z.size === u.length && u.length > 0
|
|
3045
3062
|
}
|
|
3046
3063
|
),
|
|
3047
|
-
/* @__PURE__ */ e("span", { className:
|
|
3048
|
-
/* @__PURE__ */ e("span", { className:
|
|
3049
|
-
/* @__PURE__ */ e("span", { className:
|
|
3064
|
+
/* @__PURE__ */ e("span", { className: k.headerLabel, children: C("printing.col.job", "Job") }),
|
|
3065
|
+
/* @__PURE__ */ e("span", { className: k.headerLabel, children: C("printing.col.copies", "Copies") }),
|
|
3066
|
+
/* @__PURE__ */ e("span", { className: k.headerLabel, children: C("printing.col.actions", "Actions") })
|
|
3050
3067
|
] }),
|
|
3051
|
-
|
|
3052
|
-
|
|
3068
|
+
u.map((x, T) => /* @__PURE__ */ e(
|
|
3069
|
+
Rs,
|
|
3053
3070
|
{
|
|
3054
|
-
job:
|
|
3055
|
-
index: n.indexOf(
|
|
3071
|
+
job: x,
|
|
3072
|
+
index: n.indexOf(x),
|
|
3056
3073
|
total: n.length,
|
|
3057
|
-
printers:
|
|
3058
|
-
selected:
|
|
3059
|
-
onSelect:
|
|
3060
|
-
onUpdate:
|
|
3074
|
+
printers: s,
|
|
3075
|
+
selected: z.has(x.id),
|
|
3076
|
+
onSelect: c,
|
|
3077
|
+
onUpdate: m,
|
|
3061
3078
|
onRemove: o,
|
|
3062
|
-
onPrint:
|
|
3063
|
-
onReorder:
|
|
3079
|
+
onPrint: N,
|
|
3080
|
+
onReorder: B
|
|
3064
3081
|
},
|
|
3065
|
-
|
|
3082
|
+
x.id
|
|
3066
3083
|
))
|
|
3067
3084
|
] }) })
|
|
3068
3085
|
]
|
|
3069
3086
|
}
|
|
3070
3087
|
);
|
|
3071
|
-
},
|
|
3072
|
-
container:
|
|
3073
|
-
buttonGroup:
|
|
3074
|
-
trigger:
|
|
3075
|
-
triggerDisabled:
|
|
3088
|
+
}, As = "_container_1f76z_1", Es = "_buttonGroup_1f76z_19", Ms = "_trigger_1f76z_31", Ps = "_triggerDisabled_1f76z_57", Fs = "_mainAction_1f76z_151", Hs = "_dropdownToggle_1f76z_175", Gs = "_chevron_1f76z_201", Os = "_chevronUp_1f76z_211", qs = "_dropdown_1f76z_175", Ws = "_dark_1f76z_245", Ys = "_section_1f76z_257", js = "_sectionLabel_1f76z_263", Us = "_divider_1f76z_283", Vs = "_copiesRow_1f76z_301", Xs = "_copiesBtn_1f76z_311", Ks = "_copiesValue_1f76z_351", Js = "_printerSelect_1f76z_375", Qs = "_printerStatus_1f76z_415", Zs = "_printerDot_1f76z_429", er = "_printerStatusLabel_1f76z_463", tr = "_submitBtn_1f76z_473", nr = "_spinner_1f76z_515", ar = "_spin_1f76z_515", R = {
|
|
3089
|
+
container: As,
|
|
3090
|
+
buttonGroup: Es,
|
|
3091
|
+
trigger: Ms,
|
|
3092
|
+
triggerDisabled: Ps,
|
|
3076
3093
|
"variant-primary": "_variant-primary_1f76z_69",
|
|
3077
3094
|
"variant-secondary": "_variant-secondary_1f76z_83",
|
|
3078
3095
|
"variant-ghost": "_variant-ghost_1f76z_99",
|
|
3079
3096
|
"size-sm": "_size-sm_1f76z_117",
|
|
3080
3097
|
"size-md": "_size-md_1f76z_127",
|
|
3081
3098
|
"size-lg": "_size-lg_1f76z_137",
|
|
3082
|
-
mainAction:
|
|
3083
|
-
dropdownToggle:
|
|
3084
|
-
chevron:
|
|
3085
|
-
chevronUp:
|
|
3086
|
-
dropdown:
|
|
3087
|
-
dark:
|
|
3088
|
-
section:
|
|
3089
|
-
sectionLabel:
|
|
3099
|
+
mainAction: Fs,
|
|
3100
|
+
dropdownToggle: Hs,
|
|
3101
|
+
chevron: Gs,
|
|
3102
|
+
chevronUp: Os,
|
|
3103
|
+
dropdown: qs,
|
|
3104
|
+
dark: Ws,
|
|
3105
|
+
section: Ys,
|
|
3106
|
+
sectionLabel: js,
|
|
3090
3107
|
divider: Us,
|
|
3091
|
-
copiesRow:
|
|
3092
|
-
copiesBtn:
|
|
3093
|
-
copiesValue:
|
|
3094
|
-
printerSelect:
|
|
3095
|
-
printerStatus:
|
|
3096
|
-
printerDot:
|
|
3108
|
+
copiesRow: Vs,
|
|
3109
|
+
copiesBtn: Xs,
|
|
3110
|
+
copiesValue: Ks,
|
|
3111
|
+
printerSelect: Js,
|
|
3112
|
+
printerStatus: Qs,
|
|
3113
|
+
printerDot: Zs,
|
|
3097
3114
|
"dot-ready": "_dot-ready_1f76z_439",
|
|
3098
3115
|
"dot-busy": "_dot-busy_1f76z_445",
|
|
3099
3116
|
"dot-offline": "_dot-offline_1f76z_451",
|
|
3100
3117
|
"dot-error": "_dot-error_1f76z_457",
|
|
3101
|
-
printerStatusLabel:
|
|
3102
|
-
submitBtn:
|
|
3103
|
-
spinner:
|
|
3104
|
-
spin:
|
|
3105
|
-
},
|
|
3118
|
+
printerStatusLabel: er,
|
|
3119
|
+
submitBtn: tr,
|
|
3120
|
+
spinner: nr,
|
|
3121
|
+
spin: ar
|
|
3122
|
+
}, pr = ({
|
|
3106
3123
|
onPrint: n,
|
|
3107
|
-
printers:
|
|
3108
|
-
defaultPrinterId:
|
|
3124
|
+
printers: s = [],
|
|
3125
|
+
defaultPrinterId: m,
|
|
3109
3126
|
defaultCopies: o = 1,
|
|
3110
|
-
disabled:
|
|
3111
|
-
loading:
|
|
3112
|
-
variant:
|
|
3113
|
-
size:
|
|
3114
|
-
label:
|
|
3115
|
-
className:
|
|
3116
|
-
style:
|
|
3117
|
-
theme:
|
|
3127
|
+
disabled: B = !1,
|
|
3128
|
+
loading: N = !1,
|
|
3129
|
+
variant: b = "primary",
|
|
3130
|
+
size: h = "md",
|
|
3131
|
+
label: g,
|
|
3132
|
+
className: _,
|
|
3133
|
+
style: l,
|
|
3134
|
+
theme: f = "light"
|
|
3118
3135
|
}) => {
|
|
3119
|
-
var
|
|
3120
|
-
const { t:
|
|
3136
|
+
var Z;
|
|
3137
|
+
const { t: C } = X(), z = g ?? C("printing.print", "Print"), [y, r] = H(!1), [i, u] = H(o), [c, F] = H(m ?? ((Z = s[0]) == null ? void 0 : Z.id) ?? ""), v = Je(null);
|
|
3121
3138
|
Se(() => {
|
|
3122
|
-
if (!
|
|
3139
|
+
if (!y)
|
|
3123
3140
|
return;
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3141
|
+
const w = (K) => {
|
|
3142
|
+
v.current && !v.current.contains(K.target) && r(!1);
|
|
3126
3143
|
};
|
|
3127
|
-
return document.addEventListener("mousedown",
|
|
3128
|
-
}, [
|
|
3129
|
-
const
|
|
3130
|
-
n({ copies:
|
|
3131
|
-
}, [
|
|
3144
|
+
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
3145
|
+
}, [y]);
|
|
3146
|
+
const D = E(() => {
|
|
3147
|
+
n({ copies: i, printerId: c }), r(!1);
|
|
3148
|
+
}, [i, c, n]), x = E(() => u((w) => Math.min(99, w + 1)), []), T = E(() => u((w) => Math.max(1, w - 1)), []), A = [R.container, f === "dark" ? R.dark : "", _ ?? ""].filter(Boolean).join(" "), Y = [
|
|
3132
3149
|
R.trigger,
|
|
3133
|
-
R[`variant-${
|
|
3134
|
-
R[`size-${
|
|
3135
|
-
|
|
3150
|
+
R[`variant-${b}`],
|
|
3151
|
+
R[`size-${h}`],
|
|
3152
|
+
B || N ? R.triggerDisabled : ""
|
|
3136
3153
|
].filter(Boolean).join(" ");
|
|
3137
|
-
return /* @__PURE__ */ a("div", { ref:
|
|
3154
|
+
return /* @__PURE__ */ a("div", { ref: v, className: A, style: l, children: [
|
|
3138
3155
|
/* @__PURE__ */ a("div", { className: R.buttonGroup, children: [
|
|
3139
3156
|
/* @__PURE__ */ a(
|
|
3140
3157
|
"button",
|
|
3141
3158
|
{
|
|
3142
|
-
className: `${
|
|
3143
|
-
disabled:
|
|
3144
|
-
onClick:
|
|
3145
|
-
"aria-label":
|
|
3159
|
+
className: `${Y} ${R.mainAction}`,
|
|
3160
|
+
disabled: B || N,
|
|
3161
|
+
onClick: D,
|
|
3162
|
+
"aria-label": z,
|
|
3146
3163
|
children: [
|
|
3147
|
-
|
|
3148
|
-
/* @__PURE__ */ e("span", { children:
|
|
3164
|
+
N ? /* @__PURE__ */ e("span", { className: R.spinner }) : /* @__PURE__ */ e(S, { name: "printer", size: 16 }),
|
|
3165
|
+
/* @__PURE__ */ e("span", { children: z })
|
|
3149
3166
|
]
|
|
3150
3167
|
}
|
|
3151
3168
|
),
|
|
3152
3169
|
/* @__PURE__ */ e(
|
|
3153
3170
|
"button",
|
|
3154
3171
|
{
|
|
3155
|
-
className: `${
|
|
3156
|
-
disabled:
|
|
3157
|
-
onClick: () =>
|
|
3158
|
-
"aria-label":
|
|
3159
|
-
"aria-expanded":
|
|
3160
|
-
children: /* @__PURE__ */ e("span", { className: `${R.chevron} ${
|
|
3172
|
+
className: `${Y} ${R.dropdownToggle}`,
|
|
3173
|
+
disabled: B || N,
|
|
3174
|
+
onClick: () => r((w) => !w),
|
|
3175
|
+
"aria-label": C("printing.options", "Print options"),
|
|
3176
|
+
"aria-expanded": y,
|
|
3177
|
+
children: /* @__PURE__ */ e("span", { className: `${R.chevron} ${y ? R.chevronUp : ""}`, children: /* @__PURE__ */ e(S, { name: "chevron-down", size: 12 }) })
|
|
3161
3178
|
}
|
|
3162
3179
|
)
|
|
3163
3180
|
] }),
|
|
3164
|
-
|
|
3181
|
+
y && /* @__PURE__ */ a("div", { className: R.dropdown, children: [
|
|
3165
3182
|
/* @__PURE__ */ a("div", { className: R.section, children: [
|
|
3166
|
-
/* @__PURE__ */ e("label", { className: R.sectionLabel, children:
|
|
3183
|
+
/* @__PURE__ */ e("label", { className: R.sectionLabel, children: C("printing.copies.label", "Copies") }),
|
|
3167
3184
|
/* @__PURE__ */ a("div", { className: R.copiesRow, children: [
|
|
3168
3185
|
/* @__PURE__ */ e(
|
|
3169
3186
|
"button",
|
|
3170
3187
|
{
|
|
3171
3188
|
className: R.copiesBtn,
|
|
3172
|
-
onClick:
|
|
3173
|
-
disabled:
|
|
3174
|
-
"aria-label":
|
|
3175
|
-
children: /* @__PURE__ */ e(
|
|
3189
|
+
onClick: T,
|
|
3190
|
+
disabled: i <= 1,
|
|
3191
|
+
"aria-label": C("printing.copies.decrease", "One copy fewer"),
|
|
3192
|
+
children: /* @__PURE__ */ e(S, { name: "minus", size: 12 })
|
|
3176
3193
|
}
|
|
3177
3194
|
),
|
|
3178
|
-
/* @__PURE__ */ e("span", { className: R.copiesValue, children:
|
|
3195
|
+
/* @__PURE__ */ e("span", { className: R.copiesValue, children: i }),
|
|
3179
3196
|
/* @__PURE__ */ e(
|
|
3180
3197
|
"button",
|
|
3181
3198
|
{
|
|
3182
3199
|
className: R.copiesBtn,
|
|
3183
|
-
onClick:
|
|
3184
|
-
disabled:
|
|
3185
|
-
"aria-label":
|
|
3186
|
-
children: /* @__PURE__ */ e(
|
|
3200
|
+
onClick: x,
|
|
3201
|
+
disabled: i >= 99,
|
|
3202
|
+
"aria-label": C("printing.copies.increase", "One copy more"),
|
|
3203
|
+
children: /* @__PURE__ */ e(S, { name: "plus", size: 12 })
|
|
3187
3204
|
}
|
|
3188
3205
|
)
|
|
3189
3206
|
] })
|
|
3190
3207
|
] }),
|
|
3191
3208
|
/* @__PURE__ */ e("div", { className: R.divider }),
|
|
3192
|
-
|
|
3209
|
+
s.length > 0 && /* @__PURE__ */ a(V, { children: [
|
|
3193
3210
|
/* @__PURE__ */ a("div", { className: R.section, children: [
|
|
3194
|
-
/* @__PURE__ */ e("label", { className: R.sectionLabel, children:
|
|
3211
|
+
/* @__PURE__ */ e("label", { className: R.sectionLabel, children: C("printing.printer", "Printer") }),
|
|
3195
3212
|
/* @__PURE__ */ e(
|
|
3196
3213
|
"select",
|
|
3197
3214
|
{
|
|
3198
3215
|
className: R.printerSelect,
|
|
3199
|
-
value:
|
|
3200
|
-
onChange: (
|
|
3201
|
-
children:
|
|
3216
|
+
value: c,
|
|
3217
|
+
onChange: (w) => F(w.target.value),
|
|
3218
|
+
children: s.map((w) => /* @__PURE__ */ a(
|
|
3202
3219
|
"option",
|
|
3203
3220
|
{
|
|
3204
|
-
value:
|
|
3205
|
-
disabled:
|
|
3221
|
+
value: w.id,
|
|
3222
|
+
disabled: w.status === "offline" || !w.isOnline && w.status == null,
|
|
3206
3223
|
children: [
|
|
3207
|
-
|
|
3224
|
+
w.name,
|
|
3208
3225
|
" ",
|
|
3209
|
-
|
|
3226
|
+
w.status === "offline" || !w.isOnline && w.status == null ? "(Offline)" : w.status === "busy" ? `(${C("printing.printerBusyLabel", "Busy")})` : ""
|
|
3210
3227
|
]
|
|
3211
3228
|
},
|
|
3212
|
-
|
|
3229
|
+
w.id
|
|
3213
3230
|
))
|
|
3214
3231
|
}
|
|
3215
3232
|
),
|
|
3216
|
-
|
|
3217
|
-
const
|
|
3218
|
-
return /* @__PURE__ */ a(
|
|
3219
|
-
/* @__PURE__ */ e("span", { className: `${R.printerDot} ${R[`dot-${
|
|
3220
|
-
/* @__PURE__ */ e("span", { className: R.printerStatusLabel, children:
|
|
3233
|
+
s.find((w) => w.id === c) && /* @__PURE__ */ e("div", { className: R.printerStatus, children: (() => {
|
|
3234
|
+
const w = s.find((be) => be.id === c), K = w.status ?? (w.isOnline ? "ready" : "offline");
|
|
3235
|
+
return /* @__PURE__ */ a(V, { children: [
|
|
3236
|
+
/* @__PURE__ */ e("span", { className: `${R.printerDot} ${R[`dot-${K}`]}` }),
|
|
3237
|
+
/* @__PURE__ */ e("span", { className: R.printerStatusLabel, children: K === "ready" ? C("printing.printerReady", "Ready") : K === "busy" ? C("printing.printerBusyLabel", "Busy") : K === "offline" ? "Offline" : C("printing.printerError", "Error") })
|
|
3221
3238
|
] });
|
|
3222
3239
|
})() })
|
|
3223
3240
|
] }),
|
|
@@ -3227,16 +3244,16 @@ const Ts = ({ jobs: n }) => {
|
|
|
3227
3244
|
"button",
|
|
3228
3245
|
{
|
|
3229
3246
|
className: R.submitBtn,
|
|
3230
|
-
onClick:
|
|
3231
|
-
disabled:
|
|
3232
|
-
const
|
|
3233
|
-
return
|
|
3247
|
+
onClick: D,
|
|
3248
|
+
disabled: B || N || s.length > 0 && (() => {
|
|
3249
|
+
const w = s.find((K) => K.id === c);
|
|
3250
|
+
return w != null && (w.status === "offline" || !w.isOnline && w.status == null);
|
|
3234
3251
|
})(),
|
|
3235
|
-
children:
|
|
3236
|
-
/* @__PURE__ */ e(
|
|
3252
|
+
children: N ? C("printing.printing", "Printing…") : /* @__PURE__ */ a(V, { children: [
|
|
3253
|
+
/* @__PURE__ */ e(S, { name: "printer", size: 14 }),
|
|
3237
3254
|
" ",
|
|
3238
|
-
|
|
3239
|
-
|
|
3255
|
+
z,
|
|
3256
|
+
i > 1 ? ` (${i})` : ""
|
|
3240
3257
|
] })
|
|
3241
3258
|
}
|
|
3242
3259
|
) })
|
|
@@ -3244,9 +3261,9 @@ const Ts = ({ jobs: n }) => {
|
|
|
3244
3261
|
] });
|
|
3245
3262
|
};
|
|
3246
3263
|
export {
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3264
|
+
pr as NicePrintButton,
|
|
3265
|
+
dr as NicePrintPreview,
|
|
3266
|
+
mr as NicePrintQueue,
|
|
3267
|
+
cr as NiceTemplateBrowser,
|
|
3268
|
+
lr as NiceTemplateEditor
|
|
3252
3269
|
};
|