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