@nice2dev/ui-printing 1.2.1 → 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.cjs +2 -2
- package/dist/index.mjs +1589 -1504
- package/package.json +3 -3
- package/src/print-button/NicePrintButton.tsx +2 -2
- package/src/print-preview/NicePrintPreview.tsx +73 -18
- package/src/template-browser/NiceTemplateBrowser.tsx +4 -2
- package/src/template-editor/NiceTemplateEditor.tsx +36 -16
package/dist/index.mjs
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
import { jsx as e, jsxs as a, Fragment as
|
|
2
|
-
import { useNiceTranslation 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 Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
|
|
|
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 Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
|
|
|
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 Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
|
|
|
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,13 +198,13 @@ const Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
|
|
|
198
198
|
page_number: "Page number",
|
|
199
199
|
total_pages: "Total pages",
|
|
200
200
|
print_date: "Print date"
|
|
201
|
-
},
|
|
202
|
-
function
|
|
203
|
-
switch (
|
|
201
|
+
}, Se = (n, o) => ge[o] ? n(`printing.fieldType.${o}`, ge[o]) : o;
|
|
202
|
+
function Ma(n, o) {
|
|
203
|
+
switch (o.type) {
|
|
204
204
|
case "UPDATE":
|
|
205
205
|
return {
|
|
206
206
|
past: [...n.past.slice(-50), n.present],
|
|
207
|
-
present:
|
|
207
|
+
present: o.payload,
|
|
208
208
|
future: []
|
|
209
209
|
};
|
|
210
210
|
case "UNDO":
|
|
@@ -223,17 +223,17 @@ function Da(n, s) {
|
|
|
223
223
|
return n;
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
const se = "#000000",
|
|
226
|
+
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: (
|
|
234
|
-
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
|
-
dataPath: (
|
|
236
|
+
dataPath: (o == null ? void 0 : o.path) ?? "",
|
|
237
237
|
fallback: n === "static_text" ? "Static text" : void 0,
|
|
238
238
|
format: n === "date" || n === "datetime" ? "DD.MM.YYYY" : void 0,
|
|
239
239
|
position: {
|
|
@@ -244,45 +244,45 @@ function ze(n, s) {
|
|
|
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
|
-
zoom:
|
|
257
|
-
orientation:
|
|
256
|
+
zoom: o,
|
|
257
|
+
orientation: d
|
|
258
258
|
}) => {
|
|
259
|
-
const
|
|
260
|
-
for (let N = 0; N <= n; N +=
|
|
261
|
-
const
|
|
262
|
-
|
|
259
|
+
const l = [], C = o < 0.6 ? 20 : o < 1 ? 10 : 5;
|
|
260
|
+
for (let N = 0; N <= n; N += C) {
|
|
261
|
+
const _ = N * o * W, g = N % (C * 2) === 0;
|
|
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
|
-
className: `${t.resizeHandle} ${t[`handle_${
|
|
279
|
-
onMouseDown: (
|
|
280
|
-
|
|
278
|
+
className: `${t.resizeHandle} ${t[`handle_${o}`]}`,
|
|
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")
|
|
@@ -291,92 +291,101 @@ function Ea(n, s) {
|
|
|
291
291
|
return "3";
|
|
292
292
|
if (n.type === "print_date")
|
|
293
293
|
return (/* @__PURE__ */ new Date()).toLocaleDateString("pl-PL");
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
(
|
|
297
|
-
|
|
294
|
+
if (o && n.dataPath) {
|
|
295
|
+
const d = n.dataPath.split(".").reduce(
|
|
296
|
+
(l, C) => l && typeof l == "object" ? l[C] : null,
|
|
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
|
-
zoom:
|
|
307
|
-
selected:
|
|
308
|
-
sampleData:
|
|
309
|
-
onClick:
|
|
306
|
+
zoom: o,
|
|
307
|
+
selected: d,
|
|
308
|
+
sampleData: l,
|
|
309
|
+
onClick: C,
|
|
310
310
|
onDragStart: N,
|
|
311
|
-
onResizeStart:
|
|
312
|
-
readOnly:
|
|
311
|
+
onResizeStart: _,
|
|
312
|
+
readOnly: g
|
|
313
313
|
}) => {
|
|
314
|
-
const
|
|
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
|
-
left:
|
|
317
|
-
top:
|
|
318
|
-
width:
|
|
319
|
-
height:
|
|
320
|
-
zIndex:
|
|
321
|
-
transform:
|
|
316
|
+
left: r(k.x),
|
|
317
|
+
top: r(k.y),
|
|
318
|
+
width: r(k.width),
|
|
319
|
+
height: r(k.height),
|
|
320
|
+
zIndex: k.zIndex ?? 1,
|
|
321
|
+
transform: u.rotation ? `rotate(${u.rotation}deg)` : void 0,
|
|
322
322
|
boxSizing: "border-box",
|
|
323
323
|
overflow: "hidden",
|
|
324
|
-
...!
|
|
325
|
-
fontSize: (
|
|
326
|
-
fontFamily:
|
|
327
|
-
fontWeight:
|
|
328
|
-
fontStyle:
|
|
329
|
-
color:
|
|
330
|
-
textAlign:
|
|
331
|
-
lineHeight:
|
|
332
|
-
letterSpacing:
|
|
333
|
-
padding:
|
|
324
|
+
...!S && !I ? {
|
|
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
|
-
zoom:
|
|
368
|
-
paperWidthMm:
|
|
369
|
-
selectedIds:
|
|
370
|
-
sampleData:
|
|
376
|
+
zoom: o,
|
|
377
|
+
paperWidthMm: d,
|
|
378
|
+
selectedIds: l,
|
|
379
|
+
sampleData: C,
|
|
371
380
|
readOnly: N,
|
|
372
|
-
showGrid:
|
|
373
|
-
onFieldClick:
|
|
374
|
-
onFieldDragStart:
|
|
375
|
-
onResizeStart:
|
|
376
|
-
onSectionHeightChange:
|
|
377
|
-
onDropField:
|
|
381
|
+
showGrid: _,
|
|
382
|
+
onFieldClick: g,
|
|
383
|
+
onFieldDragStart: f,
|
|
384
|
+
onResizeStart: k,
|
|
385
|
+
onSectionHeightChange: u,
|
|
386
|
+
onDropField: r
|
|
378
387
|
}) => {
|
|
379
|
-
const
|
|
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)",
|
|
@@ -386,56 +395,56 @@ const Ma = ({
|
|
|
386
395
|
return /* @__PURE__ */ a(
|
|
387
396
|
"div",
|
|
388
397
|
{
|
|
389
|
-
className: `${t.sectionCanvas} ${
|
|
398
|
+
className: `${t.sectionCanvas} ${x ? t.sectionCanvasOver : ""}`,
|
|
390
399
|
style: {
|
|
391
|
-
width:
|
|
392
|
-
height:
|
|
400
|
+
width: I,
|
|
401
|
+
height: S,
|
|
393
402
|
position: "relative",
|
|
394
403
|
background: i[n.type] ?? "transparent",
|
|
395
|
-
backgroundImage:
|
|
396
|
-
repeating-linear-gradient(90deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 *
|
|
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),
|
|
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
|
-
onDragLeave: () =>
|
|
402
|
-
onDrop: (
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
if (!
|
|
410
|
+
onDragLeave: () => s(!1),
|
|
411
|
+
onDrop: (m) => {
|
|
412
|
+
m.preventDefault(), s(!1);
|
|
413
|
+
const h = m.dataTransfer.getData("fieldPath");
|
|
414
|
+
if (!h)
|
|
406
415
|
return;
|
|
407
|
-
const
|
|
408
|
-
|
|
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:
|
|
416
|
-
zoom:
|
|
417
|
-
selected:
|
|
418
|
-
sampleData:
|
|
424
|
+
field: m,
|
|
425
|
+
zoom: o,
|
|
426
|
+
selected: l.has(m.id),
|
|
427
|
+
sampleData: C,
|
|
419
428
|
readOnly: N,
|
|
420
|
-
onClick: (
|
|
421
|
-
onDragStart: (
|
|
422
|
-
onResizeStart: (
|
|
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
|
-
|
|
435
|
-
},
|
|
436
|
-
document.removeEventListener("mousemove",
|
|
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));
|
|
444
|
+
}, R = () => {
|
|
445
|
+
document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", R);
|
|
437
446
|
};
|
|
438
|
-
document.addEventListener("mousemove",
|
|
447
|
+
document.addEventListener("mousemove", y), document.addEventListener("mouseup", R);
|
|
439
448
|
},
|
|
440
449
|
children: /* @__PURE__ */ e("div", { className: t.sectionResizeGrip })
|
|
441
450
|
}
|
|
@@ -443,45 +452,45 @@ const Ma = ({
|
|
|
443
452
|
]
|
|
444
453
|
}
|
|
445
454
|
);
|
|
446
|
-
}, le = ({ keys: n, label:
|
|
455
|
+
}, le = ({ keys: n, label: o }) => /* @__PURE__ */ a("div", { className: t.shortcutChip, children: [
|
|
447
456
|
/* @__PURE__ */ e("span", { className: t.shortcutKeys, children: n }),
|
|
448
|
-
/* @__PURE__ */ e("span", { className: t.shortcutLabel, children:
|
|
449
|
-
] }),
|
|
457
|
+
/* @__PURE__ */ e("span", { className: t.shortcutLabel, children: o })
|
|
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
|
-
zoom:
|
|
463
|
-
canUndo:
|
|
464
|
-
canRedo:
|
|
465
|
-
showGrid:
|
|
471
|
+
zoom: o,
|
|
472
|
+
canUndo: d,
|
|
473
|
+
canRedo: l,
|
|
474
|
+
showGrid: C,
|
|
466
475
|
showRulers: N,
|
|
467
|
-
readOnly:
|
|
468
|
-
selectedCount:
|
|
469
|
-
onPaperChange:
|
|
470
|
-
onZoom:
|
|
471
|
-
onUndo:
|
|
472
|
-
onRedo:
|
|
473
|
-
onToggleGrid:
|
|
474
|
-
onToggleRulers:
|
|
475
|
-
onInsert:
|
|
476
|
-
onDelete:
|
|
476
|
+
readOnly: _,
|
|
477
|
+
selectedCount: g,
|
|
478
|
+
onPaperChange: f,
|
|
479
|
+
onZoom: k,
|
|
480
|
+
onUndo: u,
|
|
481
|
+
onRedo: r,
|
|
482
|
+
onToggleGrid: S,
|
|
483
|
+
onToggleRulers: I,
|
|
484
|
+
onInsert: x,
|
|
485
|
+
onDelete: s,
|
|
477
486
|
onDuplicate: i,
|
|
478
|
-
onAlignH:
|
|
479
|
-
onAlignV:
|
|
480
|
-
onBringForward:
|
|
481
|
-
onSendBackward:
|
|
482
|
-
onSave:
|
|
487
|
+
onAlignH: m,
|
|
488
|
+
onAlignV: h,
|
|
489
|
+
onBringForward: z,
|
|
490
|
+
onSendBackward: y,
|
|
491
|
+
onSave: R
|
|
483
492
|
}) => {
|
|
484
|
-
const { 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,83 +498,83 @@ const Ma = ({
|
|
|
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: () =>
|
|
501
|
-
title:
|
|
502
|
-
children: /* @__PURE__ */ e(
|
|
509
|
+
onClick: () => f(n.paperSize, "portrait"),
|
|
510
|
+
title: T("templateEditor.portrait", "Portrait"),
|
|
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: () =>
|
|
510
|
-
title:
|
|
511
|
-
children: /* @__PURE__ */ e(
|
|
518
|
+
onClick: () => f(n.paperSize, "landscape"),
|
|
519
|
+
title: T("templateEditor.landscape", "Landscape"),
|
|
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(
|
|
527
536
|
"button",
|
|
528
537
|
{
|
|
529
538
|
className: t.toolbarBtn,
|
|
530
|
-
disabled: !
|
|
531
|
-
onClick:
|
|
532
|
-
title: `${
|
|
533
|
-
children: /* @__PURE__ */ e(
|
|
539
|
+
disabled: !l,
|
|
540
|
+
onClick: r,
|
|
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
|
-
|
|
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
|
-
/* @__PURE__ */ e("div", { className: t.insertCategory, children:
|
|
577
|
+
/* @__PURE__ */ e("div", { className: t.insertCategory, children: T("templateEditor.staticElements", "Static elements") }),
|
|
569
578
|
[
|
|
570
579
|
"static_text",
|
|
571
580
|
"static_image",
|
|
@@ -574,31 +583,31 @@ const Ma = ({
|
|
|
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
|
-
|
|
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
|
-
/* @__PURE__ */ e("div", { className: t.insertCategory, children:
|
|
600
|
+
/* @__PURE__ */ e("div", { className: t.insertCategory, children: T("templateEditor.special", "Special") }),
|
|
592
601
|
/* @__PURE__ */ a(
|
|
593
602
|
"button",
|
|
594
603
|
{
|
|
595
604
|
className: t.insertItem,
|
|
596
605
|
onClick: () => {
|
|
597
|
-
|
|
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,33 +616,33 @@ const Ma = ({
|
|
|
607
616
|
{
|
|
608
617
|
className: t.insertItem,
|
|
609
618
|
onClick: () => {
|
|
610
|
-
|
|
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(
|
|
631
640
|
"button",
|
|
632
641
|
{
|
|
633
642
|
className: `${t.toolbarBtn} ${t.toolbarBtnDanger}`,
|
|
634
|
-
onClick:
|
|
635
|
-
title: `${
|
|
636
|
-
children: /* @__PURE__ */ e(
|
|
643
|
+
onClick: s,
|
|
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 Ma = ({
|
|
|
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 Ma = ({
|
|
|
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 Ma = ({
|
|
|
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
|
),
|
|
@@ -696,18 +705,18 @@ const Ma = ({
|
|
|
696
705
|
"button",
|
|
697
706
|
{
|
|
698
707
|
className: t.toolbarBtn,
|
|
699
|
-
onClick:
|
|
700
|
-
title:
|
|
701
|
-
children: /* @__PURE__ */ e(
|
|
708
|
+
onClick: z,
|
|
709
|
+
title: T("templateEditor.bringForward", "Bring forward"),
|
|
710
|
+
children: /* @__PURE__ */ e(v, { name: "arrow-up", size: 14 })
|
|
702
711
|
}
|
|
703
712
|
),
|
|
704
713
|
/* @__PURE__ */ e(
|
|
705
714
|
"button",
|
|
706
715
|
{
|
|
707
716
|
className: t.toolbarBtn,
|
|
708
|
-
onClick:
|
|
709
|
-
title:
|
|
710
|
-
children: /* @__PURE__ */ e(
|
|
717
|
+
onClick: y,
|
|
718
|
+
title: D("printing.editor.sendBackward", "Send backward"),
|
|
719
|
+
children: /* @__PURE__ */ e(v, { name: "arrow-down", size: 14 })
|
|
711
720
|
}
|
|
712
721
|
)
|
|
713
722
|
] }),
|
|
@@ -715,9 +724,9 @@ const Ma = ({
|
|
|
715
724
|
/* @__PURE__ */ e(
|
|
716
725
|
"button",
|
|
717
726
|
{
|
|
718
|
-
className: `${t.toolbarBtn} ${
|
|
719
|
-
onClick:
|
|
720
|
-
title:
|
|
727
|
+
className: `${t.toolbarBtn} ${C ? t.toolbarBtnActive : ""}`,
|
|
728
|
+
onClick: S,
|
|
729
|
+
title: D("printing.editor.grid", "Grid"),
|
|
721
730
|
children: "⊞"
|
|
722
731
|
}
|
|
723
732
|
),
|
|
@@ -725,130 +734,136 @@ const Ma = ({
|
|
|
725
734
|
"button",
|
|
726
735
|
{
|
|
727
736
|
className: `${t.toolbarBtn} ${N ? t.toolbarBtnActive : ""}`,
|
|
728
|
-
onClick:
|
|
729
|
-
title:
|
|
730
|
-
children: /* @__PURE__ */ e(
|
|
737
|
+
onClick: I,
|
|
738
|
+
title: D("printing.editor.rulers", "Rulers"),
|
|
739
|
+
children: /* @__PURE__ */ e(v, { name: "ruler", size: 14 })
|
|
731
740
|
}
|
|
732
741
|
)
|
|
733
742
|
] }),
|
|
734
743
|
/* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
|
|
735
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
744
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(Math.max(0.25, o - 0.1)), children: "−" }),
|
|
736
745
|
/* @__PURE__ */ e(
|
|
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
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
749
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
757
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(Math.min(3, o + 0.1)), children: "+" }),
|
|
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
|
-
onTabChange:
|
|
760
|
-
schema:
|
|
761
|
-
tpl:
|
|
762
|
-
allFields:
|
|
768
|
+
onTabChange: o,
|
|
769
|
+
schema: d,
|
|
770
|
+
tpl: l,
|
|
771
|
+
allFields: C,
|
|
763
772
|
selectedIds: N,
|
|
764
|
-
onInsertSchemaField:
|
|
765
|
-
onSelectField:
|
|
766
|
-
onUpdateTpl:
|
|
767
|
-
onReorderField:
|
|
773
|
+
onInsertSchemaField: _,
|
|
774
|
+
onSelectField: g,
|
|
775
|
+
onUpdateTpl: f,
|
|
776
|
+
onReorderField: k
|
|
768
777
|
}) => {
|
|
769
|
-
const { t:
|
|
770
|
-
(
|
|
778
|
+
const { t: u } = j(), { t: r } = j(), [S, I] = H(""), x = d == null ? void 0 : d.fields.filter(
|
|
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
|
-
className: `${t.leftTab} ${n ===
|
|
777
|
-
onClick: () => s
|
|
778
|
-
title:
|
|
785
|
+
className: `${t.leftTab} ${n === s.id ? t.leftTabActive : ""}`,
|
|
786
|
+
onClick: () => o(s.id),
|
|
787
|
+
title: r(s.key, s.label),
|
|
779
788
|
children: [
|
|
780
|
-
/* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(
|
|
781
|
-
/* @__PURE__ */ e("span", { className: t.leftTabLabel, children:
|
|
789
|
+
/* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(v, { name: s.icon, size: 16 }) }),
|
|
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(
|
|
788
|
-
/* @__PURE__ */ e("div", { className: t.panelHeader, children:
|
|
796
|
+
n === "fields" && /* @__PURE__ */ a(J, { children: [
|
|
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",
|
|
791
800
|
{
|
|
792
801
|
className: t.searchInput,
|
|
793
|
-
placeholder:
|
|
794
|
-
value:
|
|
795
|
-
onChange: (
|
|
802
|
+
placeholder: r("printing.editor.search", "Search…"),
|
|
803
|
+
value: S,
|
|
804
|
+
onChange: (s) => I(s.target.value)
|
|
796
805
|
}
|
|
797
806
|
) }),
|
|
798
|
-
|
|
799
|
-
(
|
|
807
|
+
d ? /* @__PURE__ */ a("div", { className: t.fieldList, children: [
|
|
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
|
-
i.dataTransfer.setData("fieldPath",
|
|
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
|
-
/* @__PURE__ */ e("div", { className: t.fieldItemLabel, children:
|
|
812
|
-
/* @__PURE__ */ e("div", { className: t.fieldItemPath, children:
|
|
823
|
+
/* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: s.label }),
|
|
824
|
+
/* @__PURE__ */ e("div", { className: t.fieldItemPath, children: s.path })
|
|
813
825
|
] }),
|
|
814
|
-
/* @__PURE__ */ e("span", { className: t.fieldItemType, children:
|
|
826
|
+
/* @__PURE__ */ e("span", { className: t.fieldItemType, children: s.type })
|
|
815
827
|
]
|
|
816
828
|
},
|
|
817
|
-
|
|
829
|
+
s.path
|
|
818
830
|
)),
|
|
819
|
-
(
|
|
820
|
-
] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children:
|
|
831
|
+
(x == null ? void 0 : x.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r("printing.editor.noMatches", "No matches") })
|
|
832
|
+
] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r(
|
|
821
833
|
"printing.editor.noSchema",
|
|
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
|
" (",
|
|
829
|
-
|
|
841
|
+
C.length,
|
|
830
842
|
")"
|
|
831
843
|
] }),
|
|
832
844
|
/* @__PURE__ */ a("div", { className: t.layerList, children: [
|
|
833
|
-
|
|
834
|
-
|
|
845
|
+
C.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r("printing.editor.noElements", "No elements") }),
|
|
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(
|
|
841
|
-
/* @__PURE__ */ e("span", { className: t.layerName, children:
|
|
855
|
+
/* @__PURE__ */ e("span", { className: t.layerIcon, children: /* @__PURE__ */ e(v, { name: he[s.type] ?? "type", size: 14 }) }),
|
|
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(
|
|
844
859
|
"button",
|
|
845
860
|
{
|
|
846
861
|
className: t.layerBtn,
|
|
847
862
|
onClick: (i) => {
|
|
848
|
-
i.stopPropagation(),
|
|
863
|
+
i.stopPropagation(), k(s.id, -1);
|
|
849
864
|
},
|
|
850
|
-
title:
|
|
851
|
-
children: /* @__PURE__ */ e(
|
|
865
|
+
title: r("printing.editor.bringForward", "Bring forward"),
|
|
866
|
+
children: /* @__PURE__ */ e(v, { name: "arrow-up", size: 12 })
|
|
852
867
|
}
|
|
853
868
|
),
|
|
854
869
|
/* @__PURE__ */ e(
|
|
@@ -856,57 +871,57 @@ const Ma = ({
|
|
|
856
871
|
{
|
|
857
872
|
className: t.layerBtn,
|
|
858
873
|
onClick: (i) => {
|
|
859
|
-
i.stopPropagation(),
|
|
874
|
+
i.stopPropagation(), k(s.id, 1);
|
|
860
875
|
},
|
|
861
|
-
title:
|
|
862
|
-
children: /* @__PURE__ */ e(
|
|
876
|
+
title: r("printing.editor.sendBackward", "Send backward"),
|
|
877
|
+
children: /* @__PURE__ */ e(v, { name: "arrow-down", size: 12 })
|
|
863
878
|
}
|
|
864
879
|
)
|
|
865
880
|
] })
|
|
866
881
|
]
|
|
867
882
|
},
|
|
868
|
-
|
|
883
|
+
s.id
|
|
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: [
|
|
877
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
892
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.type", "Type") }),
|
|
878
893
|
/* @__PURE__ */ a(
|
|
879
894
|
"select",
|
|
880
895
|
{
|
|
881
896
|
className: t.wmSelect,
|
|
882
|
-
value:
|
|
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
|
},
|
|
891
906
|
children: [
|
|
892
|
-
/* @__PURE__ */ e("option", { value: "text", children:
|
|
893
|
-
/* @__PURE__ */ e("option", { value: "image", children:
|
|
907
|
+
/* @__PURE__ */ e("option", { value: "text", children: r("printing.fieldType.text", "Text") }),
|
|
908
|
+
/* @__PURE__ */ e("option", { value: "image", children: r("printing.fieldType.image", "Image") })
|
|
894
909
|
]
|
|
895
910
|
}
|
|
896
911
|
)
|
|
897
912
|
] }),
|
|
898
|
-
|
|
899
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
913
|
+
s.type === "text" && /* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
914
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.fieldType.text", "Text") }),
|
|
900
915
|
/* @__PURE__ */ e(
|
|
901
916
|
"input",
|
|
902
917
|
{
|
|
903
918
|
className: t.wmInput,
|
|
904
|
-
value:
|
|
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 Ma = ({
|
|
|
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
|
{
|
|
@@ -923,24 +938,24 @@ const Ma = ({
|
|
|
923
938
|
max: 0.5,
|
|
924
939
|
step: 0.01,
|
|
925
940
|
className: t.wmSlider,
|
|
926
|
-
value:
|
|
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
|
}
|
|
935
950
|
}
|
|
936
951
|
),
|
|
937
952
|
/* @__PURE__ */ a("span", { className: t.wmValue, children: [
|
|
938
|
-
Math.round(
|
|
953
|
+
Math.round(s.opacity * 100),
|
|
939
954
|
"%"
|
|
940
955
|
] })
|
|
941
956
|
] }),
|
|
942
957
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
943
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
958
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.angle", "Angle") }),
|
|
944
959
|
/* @__PURE__ */ e(
|
|
945
960
|
"input",
|
|
946
961
|
{
|
|
@@ -949,24 +964,24 @@ const Ma = ({
|
|
|
949
964
|
max: 90,
|
|
950
965
|
step: 5,
|
|
951
966
|
className: t.wmSlider,
|
|
952
|
-
value:
|
|
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
|
}
|
|
961
976
|
}
|
|
962
977
|
),
|
|
963
978
|
/* @__PURE__ */ a("span", { className: t.wmValue, children: [
|
|
964
|
-
|
|
979
|
+
s.angle,
|
|
965
980
|
"°"
|
|
966
981
|
] })
|
|
967
982
|
] }),
|
|
968
983
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
969
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
984
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.size", "Size") }),
|
|
970
985
|
/* @__PURE__ */ e(
|
|
971
986
|
"input",
|
|
972
987
|
{
|
|
@@ -974,12 +989,12 @@ const Ma = ({
|
|
|
974
989
|
min: 8,
|
|
975
990
|
max: 200,
|
|
976
991
|
className: t.wmInputNum,
|
|
977
|
-
value:
|
|
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
|
}
|
|
@@ -988,18 +1003,18 @@ const Ma = ({
|
|
|
988
1003
|
/* @__PURE__ */ e("span", { className: t.wmUnit, children: "pt" })
|
|
989
1004
|
] }),
|
|
990
1005
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
991
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
1006
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.colour", "Colour") }),
|
|
992
1007
|
/* @__PURE__ */ e(
|
|
993
1008
|
"input",
|
|
994
1009
|
{
|
|
995
1010
|
type: "color",
|
|
996
1011
|
className: t.colorPicker,
|
|
997
|
-
value:
|
|
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,55 +1027,55 @@ const Ma = ({
|
|
|
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
|
-
children:
|
|
1032
|
+
children: r("printing.action.remove", "Remove")
|
|
1018
1033
|
}
|
|
1019
1034
|
)
|
|
1020
|
-
] },
|
|
1035
|
+
] }, s.id)),
|
|
1021
1036
|
/* @__PURE__ */ a(
|
|
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: "COPY",
|
|
1046
|
+
text: u("templateEditor.copy", "COPY"),
|
|
1032
1047
|
opacity: 0.12,
|
|
1033
1048
|
angle: -45,
|
|
1034
1049
|
fontSize: 60,
|
|
1035
|
-
color:
|
|
1050
|
+
color: be
|
|
1036
1051
|
}
|
|
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
|
]
|
|
1044
1059
|
}
|
|
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
|
-
value:
|
|
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 Ma = ({
|
|
|
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
|
-
value:
|
|
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
|
}
|
|
@@ -1086,17 +1101,17 @@ const Ma = ({
|
|
|
1086
1101
|
)
|
|
1087
1102
|
] }),
|
|
1088
1103
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
1089
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
1104
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.fieldType.line", "Line") }),
|
|
1090
1105
|
/* @__PURE__ */ e(
|
|
1091
1106
|
"input",
|
|
1092
1107
|
{
|
|
1093
1108
|
type: "checkbox",
|
|
1094
|
-
checked:
|
|
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
|
}
|
|
@@ -1104,17 +1119,17 @@ const Ma = ({
|
|
|
1104
1119
|
)
|
|
1105
1120
|
] }),
|
|
1106
1121
|
/* @__PURE__ */ a("div", { className: t.wmRow, children: [
|
|
1107
|
-
/* @__PURE__ */ e("span", { className: t.wmLabel, children:
|
|
1122
|
+
/* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.showDate", "Show date") }),
|
|
1108
1123
|
/* @__PURE__ */ e(
|
|
1109
1124
|
"input",
|
|
1110
1125
|
{
|
|
1111
1126
|
type: "checkbox",
|
|
1112
|
-
checked:
|
|
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,22 +1142,22 @@ const Ma = ({
|
|
|
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
|
-
children:
|
|
1147
|
+
children: r("printing.action.remove", "Remove")
|
|
1133
1148
|
}
|
|
1134
1149
|
)
|
|
1135
|
-
] },
|
|
1150
|
+
] }, s.id)),
|
|
1136
1151
|
/* @__PURE__ */ a(
|
|
1137
1152
|
"button",
|
|
1138
1153
|
{
|
|
1139
1154
|
className: t.addBtn,
|
|
1140
|
-
onClick: () =>
|
|
1155
|
+
onClick: () => f({
|
|
1141
1156
|
signatures: [
|
|
1142
|
-
...
|
|
1157
|
+
...l.signatures ?? [],
|
|
1143
1158
|
{
|
|
1144
1159
|
id: ce(),
|
|
1145
|
-
label:
|
|
1160
|
+
label: r("printing.editor.signature", "Signature"),
|
|
1146
1161
|
position: { x: 10, y: 5, width: 70, height: 22 },
|
|
1147
1162
|
showLine: !0,
|
|
1148
1163
|
showDate: !1
|
|
@@ -1150,54 +1165,54 @@ const Ma = ({
|
|
|
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
|
]
|
|
1157
1172
|
}
|
|
1158
1173
|
)
|
|
1159
1174
|
] })
|
|
1160
1175
|
] }),
|
|
1161
|
-
n === "settings" && /* @__PURE__ */ a(
|
|
1162
|
-
/* @__PURE__ */ e("div", { className: t.panelHeader, children:
|
|
1176
|
+
n === "settings" && /* @__PURE__ */ a(J, { children: [
|
|
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: [
|
|
1165
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children:
|
|
1180
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: r("printing.editor.name", "Name") }),
|
|
1166
1181
|
/* @__PURE__ */ e(
|
|
1167
1182
|
"input",
|
|
1168
1183
|
{
|
|
1169
1184
|
className: t.settingsInput,
|
|
1170
|
-
value:
|
|
1171
|
-
onChange: (
|
|
1185
|
+
value: l.name,
|
|
1186
|
+
onChange: (s) => f({ name: s.target.value })
|
|
1172
1187
|
}
|
|
1173
1188
|
)
|
|
1174
1189
|
] }),
|
|
1175
1190
|
/* @__PURE__ */ a("div", { className: t.settingsRow, children: [
|
|
1176
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children:
|
|
1191
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: r("printing.editor.description", "Description") }),
|
|
1177
1192
|
/* @__PURE__ */ e(
|
|
1178
1193
|
"textarea",
|
|
1179
1194
|
{
|
|
1180
1195
|
className: t.settingsTextarea,
|
|
1181
|
-
value:
|
|
1182
|
-
onChange: (
|
|
1196
|
+
value: l.description ?? "",
|
|
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
|
-
value:
|
|
1194
|
-
onChange: (
|
|
1208
|
+
value: l.category ?? "",
|
|
1209
|
+
onChange: (s) => f({ category: s.target.value })
|
|
1195
1210
|
}
|
|
1196
1211
|
)
|
|
1197
1212
|
] }),
|
|
1198
|
-
/* @__PURE__ */ e("div", { className: t.settingsDivider, children:
|
|
1199
|
-
["top", "right", "bottom", "left"].map((
|
|
1200
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children:
|
|
1213
|
+
/* @__PURE__ */ e("div", { className: t.settingsDivider, children: r("printing.editor.margins", "Margins (mm)") }),
|
|
1214
|
+
["top", "right", "bottom", "left"].map((s) => /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
|
|
1215
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: s === "top" ? r("printing.editor.marginTop", "Top") : s === "right" ? r("printing.editor.marginRight", "Right") : s === "bottom" ? r("printing.editor.marginBottom", "Bottom") : r("printing.editor.marginLeft", "Left") }),
|
|
1201
1216
|
/* @__PURE__ */ e(
|
|
1202
1217
|
"input",
|
|
1203
1218
|
{
|
|
@@ -1206,51 +1221,51 @@ const Ma = ({
|
|
|
1206
1221
|
max: 50,
|
|
1207
1222
|
step: 1,
|
|
1208
1223
|
className: t.settingsInputNum,
|
|
1209
|
-
value:
|
|
1210
|
-
onChange: (i) =>
|
|
1224
|
+
value: l.margins[s],
|
|
1225
|
+
onChange: (i) => f({ margins: { ...l.margins, [s]: +i.target.value } })
|
|
1211
1226
|
}
|
|
1212
1227
|
),
|
|
1213
|
-
/* @__PURE__ */ e("span", { className: t.settingsUnit, children: "mm" })
|
|
1214
|
-
] },
|
|
1228
|
+
/* @__PURE__ */ e("span", { className: t.settingsUnit, children: u("templateEditor.mm", "mm") })
|
|
1229
|
+
] }, s))
|
|
1215
1230
|
] })
|
|
1216
1231
|
] })
|
|
1217
1232
|
] })
|
|
1218
1233
|
] });
|
|
1219
|
-
},
|
|
1234
|
+
}, Va = ({
|
|
1220
1235
|
field: n,
|
|
1221
|
-
activeTab:
|
|
1222
|
-
onTabChange:
|
|
1223
|
-
onChange:
|
|
1224
|
-
paperWidthMm:
|
|
1236
|
+
activeTab: o,
|
|
1237
|
+
onTabChange: d,
|
|
1238
|
+
onChange: l,
|
|
1239
|
+
paperWidthMm: C,
|
|
1225
1240
|
paperHeightMm: N
|
|
1226
1241
|
}) => {
|
|
1227
|
-
var
|
|
1228
|
-
const { t:
|
|
1229
|
-
(i) => n &&
|
|
1230
|
-
[n,
|
|
1231
|
-
),
|
|
1232
|
-
(i) => n &&
|
|
1233
|
-
[n,
|
|
1242
|
+
var S, I, x, s;
|
|
1243
|
+
const { t: _ } = j(), { t: g } = j(), f = M(
|
|
1244
|
+
(i) => n && l({ position: { ...n.position, ...i } }),
|
|
1245
|
+
[n, l]
|
|
1246
|
+
), k = M(
|
|
1247
|
+
(i) => n && l({ style: { ...(n == null ? void 0 : n.style) ?? {}, ...i } }),
|
|
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",
|
|
1255
1270
|
"static_image",
|
|
1256
1271
|
"line",
|
|
@@ -1264,25 +1279,25 @@ const Ma = ({
|
|
|
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
|
-
className: `${t.rightTab} ${
|
|
1271
|
-
onClick: () =>
|
|
1272
|
-
children:
|
|
1285
|
+
className: `${t.rightTab} ${o === i.id ? t.rightTabActive : ""}`,
|
|
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
|
-
|
|
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 Ma = ({
|
|
|
1290
1305
|
step: 0.5,
|
|
1291
1306
|
className: t.posInput,
|
|
1292
1307
|
value: Math.round(n.position[i] * 10) / 10,
|
|
1293
|
-
onChange: (
|
|
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
|
{
|
|
@@ -1304,13 +1319,13 @@ const Ma = ({
|
|
|
1304
1319
|
step: 5,
|
|
1305
1320
|
className: t.posInput,
|
|
1306
1321
|
value: n.style.rotation ?? 0,
|
|
1307
|
-
onChange: (i) =>
|
|
1322
|
+
onChange: (i) => k({ rotation: +i.target.value })
|
|
1308
1323
|
}
|
|
1309
1324
|
),
|
|
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 Ma = ({
|
|
|
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 Ma = ({
|
|
|
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
|
-
|
|
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
|
-
onChange: (i) =>
|
|
1371
|
-
children:
|
|
1385
|
+
onChange: (i) => k({ fontFamily: i.target.value }),
|
|
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:
|
|
1382
|
-
onChange: (i) =>
|
|
1383
|
-
children:
|
|
1396
|
+
value: Te.includes(n.style.fontSize ?? 10) ? n.style.fontSize ?? 10 : "",
|
|
1397
|
+
onChange: (i) => k({ fontSize: +i.target.value }),
|
|
1398
|
+
children: Te.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
|
|
1384
1399
|
}
|
|
1385
1400
|
),
|
|
1386
1401
|
/* @__PURE__ */ e(
|
|
@@ -1392,20 +1407,20 @@ const Ma = ({
|
|
|
1392
1407
|
max: 200,
|
|
1393
1408
|
className: t.styleInput,
|
|
1394
1409
|
value: n.style.fontSize ?? 10,
|
|
1395
|
-
onChange: (i) =>
|
|
1410
|
+
onChange: (i) => k({ fontSize: +i.target.value })
|
|
1396
1411
|
}
|
|
1397
1412
|
),
|
|
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
|
{
|
|
1405
1420
|
type: "color",
|
|
1406
1421
|
className: t.colorPicker,
|
|
1407
1422
|
value: n.style.color ?? se,
|
|
1408
|
-
onChange: (i) =>
|
|
1423
|
+
onChange: (i) => k({ color: i.target.value })
|
|
1409
1424
|
}
|
|
1410
1425
|
),
|
|
1411
1426
|
/* @__PURE__ */ e(
|
|
@@ -1413,19 +1428,19 @@ const Ma = ({
|
|
|
1413
1428
|
{
|
|
1414
1429
|
className: t.colorHex,
|
|
1415
1430
|
value: n.style.color ?? se,
|
|
1416
|
-
onChange: (i) =>
|
|
1431
|
+
onChange: (i) => k({ color: i.target.value }),
|
|
1417
1432
|
maxLength: 7
|
|
1418
1433
|
}
|
|
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",
|
|
1426
1441
|
{
|
|
1427
1442
|
className: `${t.toggleBtn} ${n.style.fontWeight === "bold" ? t.toggleBtnActive : ""}`,
|
|
1428
|
-
onClick: () =>
|
|
1443
|
+
onClick: () => k({ fontWeight: n.style.fontWeight === "bold" ? "normal" : "bold" }),
|
|
1429
1444
|
children: /* @__PURE__ */ e("b", { children: "B" })
|
|
1430
1445
|
}
|
|
1431
1446
|
),
|
|
@@ -1433,27 +1448,27 @@ const Ma = ({
|
|
|
1433
1448
|
"button",
|
|
1434
1449
|
{
|
|
1435
1450
|
className: `${t.toggleBtn} ${n.style.fontStyle === "italic" ? t.toggleBtnActive : ""}`,
|
|
1436
|
-
onClick: () =>
|
|
1451
|
+
onClick: () => k({ fontStyle: n.style.fontStyle === "italic" ? "normal" : "italic" }),
|
|
1437
1452
|
children: /* @__PURE__ */ e("i", { children: "I" })
|
|
1438
1453
|
}
|
|
1439
1454
|
)
|
|
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
|
{
|
|
1447
1462
|
title: i,
|
|
1448
1463
|
className: `${t.toggleBtn} ${(n.style.textAlign ?? "left") === i ? t.toggleBtnActive : ""}`,
|
|
1449
|
-
onClick: () =>
|
|
1464
|
+
onClick: () => k({ textAlign: i }),
|
|
1450
1465
|
children: i === "left" ? "≡L" : i === "center" ? "≡C" : i === "right" ? "≡R" : "≡J"
|
|
1451
1466
|
},
|
|
1452
1467
|
i
|
|
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
|
{
|
|
@@ -1463,12 +1478,12 @@ const Ma = ({
|
|
|
1463
1478
|
max: 4,
|
|
1464
1479
|
className: t.styleInput,
|
|
1465
1480
|
value: n.style.lineHeight ?? 1.4,
|
|
1466
|
-
onChange: (i) =>
|
|
1481
|
+
onChange: (i) => k({ lineHeight: +i.target.value })
|
|
1467
1482
|
}
|
|
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
|
{
|
|
@@ -1478,37 +1493,37 @@ const Ma = ({
|
|
|
1478
1493
|
max: 0.5,
|
|
1479
1494
|
className: t.styleInput,
|
|
1480
1495
|
value: n.style.letterSpacing ?? 0,
|
|
1481
|
-
onChange: (i) =>
|
|
1496
|
+
onChange: (i) => k({ letterSpacing: +i.target.value })
|
|
1482
1497
|
}
|
|
1483
1498
|
),
|
|
1484
1499
|
/* @__PURE__ */ e("span", { className: t.styleUnit, children: "em" })
|
|
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
|
{
|
|
1494
1509
|
type: "color",
|
|
1495
1510
|
className: t.colorPicker,
|
|
1496
1511
|
value: n.style.backgroundColor ?? "var(--nice-bg, #fff)",
|
|
1497
|
-
onChange: (i) =>
|
|
1512
|
+
onChange: (i) => k({ backgroundColor: i.target.value })
|
|
1498
1513
|
}
|
|
1499
1514
|
),
|
|
1500
1515
|
/* @__PURE__ */ e(
|
|
1501
1516
|
"button",
|
|
1502
1517
|
{
|
|
1503
1518
|
className: t.clearBtn,
|
|
1504
|
-
onClick: () =>
|
|
1505
|
-
title:
|
|
1506
|
-
children: /* @__PURE__ */ e(
|
|
1519
|
+
onClick: () => k({ backgroundColor: void 0 }),
|
|
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
|
{
|
|
@@ -1518,7 +1533,7 @@ const Ma = ({
|
|
|
1518
1533
|
max: 10,
|
|
1519
1534
|
className: t.styleInput,
|
|
1520
1535
|
value: n.style.borderWidth ?? 0,
|
|
1521
|
-
onChange: (i) =>
|
|
1536
|
+
onChange: (i) => k({ borderWidth: +i.target.value })
|
|
1522
1537
|
}
|
|
1523
1538
|
),
|
|
1524
1539
|
/* @__PURE__ */ e(
|
|
@@ -1527,7 +1542,7 @@ const Ma = ({
|
|
|
1527
1542
|
type: "color",
|
|
1528
1543
|
className: t.colorPicker,
|
|
1529
1544
|
value: n.style.borderColor ?? se,
|
|
1530
|
-
onChange: (i) =>
|
|
1545
|
+
onChange: (i) => k({ borderColor: i.target.value })
|
|
1531
1546
|
}
|
|
1532
1547
|
),
|
|
1533
1548
|
/* @__PURE__ */ a(
|
|
@@ -1535,7 +1550,7 @@ const Ma = ({
|
|
|
1535
1550
|
{
|
|
1536
1551
|
className: t.styleSelectXs,
|
|
1537
1552
|
value: n.style.borderStyle ?? "solid",
|
|
1538
|
-
onChange: (i) =>
|
|
1553
|
+
onChange: (i) => k({ borderStyle: i.target.value }),
|
|
1539
1554
|
children: [
|
|
1540
1555
|
/* @__PURE__ */ e("option", { value: "solid", children: "─" }),
|
|
1541
1556
|
/* @__PURE__ */ e("option", { value: "dashed", children: "- -" }),
|
|
@@ -1545,7 +1560,7 @@ const Ma = ({
|
|
|
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
|
{
|
|
@@ -1555,13 +1570,13 @@ const Ma = ({
|
|
|
1555
1570
|
max: 50,
|
|
1556
1571
|
className: t.styleInput,
|
|
1557
1572
|
value: n.style.borderRadius ?? 0,
|
|
1558
|
-
onChange: (i) =>
|
|
1573
|
+
onChange: (i) => k({ borderRadius: +i.target.value })
|
|
1559
1574
|
}
|
|
1560
1575
|
),
|
|
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
|
{
|
|
@@ -1571,13 +1586,13 @@ const Ma = ({
|
|
|
1571
1586
|
max: 20,
|
|
1572
1587
|
className: t.styleInput,
|
|
1573
1588
|
value: n.style.padding ?? 0,
|
|
1574
|
-
onChange: (i) =>
|
|
1589
|
+
onChange: (i) => k({ padding: +i.target.value })
|
|
1575
1590
|
}
|
|
1576
1591
|
),
|
|
1577
|
-
/* @__PURE__ */ e("span", { className: t.styleUnit, children: "mm" })
|
|
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
|
{
|
|
@@ -1587,7 +1602,7 @@ const Ma = ({
|
|
|
1587
1602
|
step: 0.05,
|
|
1588
1603
|
className: t.sliderInput,
|
|
1589
1604
|
value: n.style.opacity ?? 1,
|
|
1590
|
-
onChange: (i) =>
|
|
1605
|
+
onChange: (i) => k({ opacity: +i.target.value })
|
|
1591
1606
|
}
|
|
1592
1607
|
),
|
|
1593
1608
|
/* @__PURE__ */ a("span", { className: t.styleValue, children: [
|
|
@@ -1597,163 +1612,163 @@ const Ma = ({
|
|
|
1597
1612
|
] })
|
|
1598
1613
|
] })
|
|
1599
1614
|
] }),
|
|
1600
|
-
|
|
1601
|
-
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children:
|
|
1615
|
+
o === "data" && r && /* @__PURE__ */ a("div", { className: t.styleGroup, 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
|
-
onChange: (i) =>
|
|
1610
|
-
placeholder:
|
|
1624
|
+
onChange: (i) => l({ dataPath: i.target.value }),
|
|
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
|
-
onChange: (i) =>
|
|
1622
|
-
placeholder:
|
|
1636
|
+
onChange: (i) => l({ format: i.target.value }),
|
|
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
|
-
onChange: (i) =>
|
|
1634
|
-
placeholder:
|
|
1648
|
+
onChange: (i) => l({ fallback: i.target.value }),
|
|
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
|
-
onChange: (i) =>
|
|
1646
|
-
children: Object.keys(
|
|
1660
|
+
onChange: (i) => l({ type: i.target.value }),
|
|
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
|
{
|
|
1655
1670
|
className: t.styleSelectFull,
|
|
1656
1671
|
value: n.barcodeType ?? "code128",
|
|
1657
|
-
onChange: (i) =>
|
|
1672
|
+
onChange: (i) => l({ barcodeType: i.target.value }),
|
|
1658
1673
|
children: ["ean13", "ean8", "code128", "code39", "upc", "itf14", "datamatrix"].map((i) => /* @__PURE__ */ e("option", { value: i, children: i.toUpperCase() }, i))
|
|
1659
1674
|
}
|
|
1660
1675
|
)
|
|
1661
1676
|
] })
|
|
1662
1677
|
] }),
|
|
1663
|
-
|
|
1664
|
-
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children:
|
|
1665
|
-
/* @__PURE__ */ e("div", { className: t.conditionalHint, children:
|
|
1678
|
+
o === "conditional" && /* @__PURE__ */ a("div", { className: t.styleGroup, 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
|
-
value: ((
|
|
1690
|
+
value: ((S = n.conditional) == null ? void 0 : S.field) ?? "",
|
|
1676
1691
|
onChange: (i) => {
|
|
1677
|
-
var
|
|
1678
|
-
return
|
|
1692
|
+
var m, h;
|
|
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
|
-
value: ((
|
|
1711
|
+
value: ((I = n.conditional) == null ? void 0 : I.operator) ?? "eq",
|
|
1697
1712
|
onChange: (i) => {
|
|
1698
|
-
var
|
|
1699
|
-
return
|
|
1713
|
+
var m, h;
|
|
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
|
-
value: String(((
|
|
1744
|
+
value: String(((x = n.conditional) == null ? void 0 : x.value) ?? ""),
|
|
1730
1745
|
onChange: (i) => {
|
|
1731
|
-
var
|
|
1732
|
-
return
|
|
1746
|
+
var m, h;
|
|
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
|
] }),
|
|
1744
|
-
((
|
|
1759
|
+
((s = n.conditional) == null ? void 0 : s.field) && /* @__PURE__ */ e(
|
|
1745
1760
|
"button",
|
|
1746
1761
|
{
|
|
1747
1762
|
className: t.clearConditionalBtn,
|
|
1748
|
-
onClick: () =>
|
|
1749
|
-
children:
|
|
1763
|
+
onClick: () => l({ conditional: void 0 }),
|
|
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,471 +1785,487 @@ function Wa() {
|
|
|
1770
1785
|
signatures: []
|
|
1771
1786
|
};
|
|
1772
1787
|
}
|
|
1773
|
-
const
|
|
1788
|
+
const ur = ({
|
|
1774
1789
|
template: n,
|
|
1775
|
-
dataSchema:
|
|
1776
|
-
sampleData:
|
|
1777
|
-
onChange:
|
|
1778
|
-
onSave:
|
|
1790
|
+
dataSchema: o,
|
|
1791
|
+
sampleData: d = [],
|
|
1792
|
+
onChange: l,
|
|
1793
|
+
onSave: C,
|
|
1779
1794
|
readOnly: N = !1,
|
|
1780
|
-
className:
|
|
1781
|
-
style:
|
|
1782
|
-
theme:
|
|
1795
|
+
className: _,
|
|
1796
|
+
style: g,
|
|
1797
|
+
theme: f = "light"
|
|
1783
1798
|
}) => {
|
|
1784
|
-
const [{ 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:
|
|
1789
|
-
(
|
|
1790
|
-
const p = { ...
|
|
1791
|
-
|
|
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(
|
|
1804
|
+
(c) => {
|
|
1805
|
+
const p = { ...r, ...c };
|
|
1806
|
+
I({ type: "UPDATE", payload: p }), l == null || l(p);
|
|
1792
1807
|
},
|
|
1793
|
-
[
|
|
1808
|
+
[r, l]
|
|
1794
1809
|
), [ee, ye] = ue(() => {
|
|
1795
|
-
const [
|
|
1796
|
-
return
|
|
1797
|
-
}, [
|
|
1798
|
-
() => te.find((
|
|
1799
|
-
[te,
|
|
1800
|
-
), fe =
|
|
1801
|
-
(
|
|
1802
|
-
|
|
1803
|
-
sections:
|
|
1810
|
+
const [c, p] = ze[r.paperSize] ?? ze.A4;
|
|
1811
|
+
return r.orientation === "landscape" ? [p, c] : [c, p];
|
|
1812
|
+
}, [r.paperSize, r.orientation]), te = ue(() => r.sections.flatMap((c) => c.fields), [r]), G = ue(
|
|
1813
|
+
() => te.find((c) => s.has(c.id)) ?? null,
|
|
1814
|
+
[te, s]
|
|
1815
|
+
), fe = M(
|
|
1816
|
+
(c, p) => {
|
|
1817
|
+
E({
|
|
1818
|
+
sections: r.sections.map((L) => ({
|
|
1804
1819
|
...L,
|
|
1805
1820
|
fields: L.fields.map(
|
|
1806
|
-
(
|
|
1821
|
+
(B) => B.id === c ? { ...B, ...p, style: { ...B.style, ...p.style ?? {} } } : B
|
|
1807
1822
|
)
|
|
1808
1823
|
}))
|
|
1809
1824
|
});
|
|
1810
1825
|
},
|
|
1811
|
-
[
|
|
1812
|
-
), de =
|
|
1813
|
-
(
|
|
1814
|
-
|
|
1815
|
-
sections:
|
|
1826
|
+
[r, E]
|
|
1827
|
+
), de = M(
|
|
1828
|
+
(c) => {
|
|
1829
|
+
E({
|
|
1830
|
+
sections: r.sections.map((p) => ({
|
|
1816
1831
|
...p,
|
|
1817
1832
|
fields: p.fields.map(
|
|
1818
|
-
(L) =>
|
|
1833
|
+
(L) => s.has(L.id) ? { ...L, ...c, style: { ...L.style, ...c.style ?? {} } } : L
|
|
1819
1834
|
)
|
|
1820
1835
|
}))
|
|
1821
1836
|
});
|
|
1822
1837
|
},
|
|
1823
|
-
[
|
|
1824
|
-
),
|
|
1825
|
-
(
|
|
1826
|
-
if (
|
|
1827
|
-
|
|
1838
|
+
[r, s, E]
|
|
1839
|
+
), Ie = M(
|
|
1840
|
+
(c, p) => {
|
|
1841
|
+
if (c === "watermark") {
|
|
1842
|
+
E({
|
|
1828
1843
|
watermarks: [
|
|
1829
|
-
...
|
|
1844
|
+
...r.watermarks ?? [],
|
|
1830
1845
|
{
|
|
1831
1846
|
id: ce(),
|
|
1832
1847
|
type: "text",
|
|
1833
|
-
text: "COPY",
|
|
1848
|
+
text: k("templateEditor.copy", "COPY"),
|
|
1834
1849
|
opacity: 0.12,
|
|
1835
1850
|
angle: -45,
|
|
1836
1851
|
fontSize: 60,
|
|
1837
|
-
color:
|
|
1852
|
+
color: be
|
|
1838
1853
|
}
|
|
1839
1854
|
]
|
|
1840
|
-
}),
|
|
1855
|
+
}), Y("watermarks");
|
|
1841
1856
|
return;
|
|
1842
1857
|
}
|
|
1843
|
-
if (
|
|
1844
|
-
|
|
1858
|
+
if (c === "signature") {
|
|
1859
|
+
E({
|
|
1845
1860
|
signatures: [
|
|
1846
|
-
...
|
|
1861
|
+
...r.signatures ?? [],
|
|
1847
1862
|
{
|
|
1848
1863
|
id: ce(),
|
|
1849
|
-
label:
|
|
1864
|
+
label: x("printing.editor.signature", "Signature"),
|
|
1850
1865
|
position: { x: 10, y: 5, width: 70, height: 22 },
|
|
1851
1866
|
showLine: !0,
|
|
1852
1867
|
showDate: !1
|
|
1853
1868
|
}
|
|
1854
1869
|
]
|
|
1855
|
-
}),
|
|
1870
|
+
}), Y("signatures");
|
|
1856
1871
|
return;
|
|
1857
1872
|
}
|
|
1858
|
-
const L =
|
|
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
|
|
1862
|
-
sections:
|
|
1863
|
-
(O) => O.id === L.id ? { ...O, fields: [...O.fields,
|
|
1876
|
+
const B = De(c, p), F = {
|
|
1877
|
+
sections: r.sections.map(
|
|
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
|
-
[l,
|
|
1869
|
-
),
|
|
1870
|
-
(
|
|
1871
|
-
const
|
|
1872
|
-
O.position.x = Math.round(L * 2) / 2, O.position.y = Math.round(
|
|
1883
|
+
[r, m, l, k, x, E]
|
|
1884
|
+
), Ee = M(
|
|
1885
|
+
(c, p, L, B) => {
|
|
1886
|
+
const F = o == null ? void 0 : o.fields.find((U) => U.path === p), O = De((F == null ? void 0 : F.type) ?? "text", F);
|
|
1887
|
+
O.position.x = Math.round(L * 2) / 2, O.position.y = Math.round(B * 2) / 2;
|
|
1873
1888
|
const ne = {
|
|
1874
|
-
sections:
|
|
1875
|
-
(
|
|
1889
|
+
sections: r.sections.map(
|
|
1890
|
+
(U) => U.id === c ? { ...U, fields: [...U.fields, O] } : U
|
|
1876
1891
|
)
|
|
1877
1892
|
};
|
|
1878
|
-
|
|
1893
|
+
I({ type: "UPDATE", payload: { ...r, ...ne } }), l == null || l({ ...r, ...ne }), i(/* @__PURE__ */ new Set([O.id]));
|
|
1879
1894
|
},
|
|
1880
|
-
[
|
|
1881
|
-
),
|
|
1882
|
-
p.ctrlKey || p.metaKey ?
|
|
1883
|
-
const
|
|
1884
|
-
return
|
|
1885
|
-
}) : p.shiftKey ?
|
|
1886
|
-
}, []),
|
|
1887
|
-
(
|
|
1895
|
+
[r, o, l]
|
|
1896
|
+
), Me = M((c, p) => {
|
|
1897
|
+
p.ctrlKey || p.metaKey ? i((L) => {
|
|
1898
|
+
const B = new Set(L);
|
|
1899
|
+
return B.has(c) ? B.delete(c) : B.add(c), B;
|
|
1900
|
+
}) : p.shiftKey ? i((L) => /* @__PURE__ */ new Set([...L, c])) : i(/* @__PURE__ */ new Set([c]));
|
|
1901
|
+
}, []), Fe = M(
|
|
1902
|
+
(c, p) => {
|
|
1888
1903
|
if (N)
|
|
1889
1904
|
return;
|
|
1890
|
-
p.preventDefault(),
|
|
1891
|
-
const L = p.clientX,
|
|
1892
|
-
id:
|
|
1893
|
-
fields:
|
|
1894
|
-
})), O = (
|
|
1895
|
-
const ae = (
|
|
1896
|
-
const
|
|
1905
|
+
p.preventDefault(), s.has(c) || i(/* @__PURE__ */ new Set([c]));
|
|
1906
|
+
const L = p.clientX, B = p.clientY, F = r.sections.map((U) => ({
|
|
1907
|
+
id: U.id,
|
|
1908
|
+
fields: U.fields.map((ae) => ({ id: ae.id, pos: { ...ae.position } }))
|
|
1909
|
+
})), O = (U) => {
|
|
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) => {
|
|
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
|
})
|
|
1913
1928
|
};
|
|
1914
|
-
}), oe = { ...
|
|
1915
|
-
|
|
1929
|
+
}), oe = { ...r, sections: pe };
|
|
1930
|
+
l == null || l(oe), I({ type: "UPDATE", payload: oe });
|
|
1916
1931
|
}, ne = () => {
|
|
1917
1932
|
document.removeEventListener("mousemove", O), document.removeEventListener("mouseup", ne);
|
|
1918
1933
|
};
|
|
1919
1934
|
document.addEventListener("mousemove", O), document.addEventListener("mouseup", ne);
|
|
1920
1935
|
},
|
|
1921
|
-
[
|
|
1922
|
-
),
|
|
1923
|
-
(
|
|
1936
|
+
[r, z, s, N, l]
|
|
1937
|
+
), He = M(
|
|
1938
|
+
(c, p, L) => {
|
|
1924
1939
|
if (N)
|
|
1925
1940
|
return;
|
|
1926
1941
|
L.preventDefault();
|
|
1927
|
-
const
|
|
1928
|
-
if (!
|
|
1942
|
+
const B = te.find((re) => re.id === c);
|
|
1943
|
+
if (!B)
|
|
1929
1944
|
return;
|
|
1930
|
-
const
|
|
1931
|
-
const me = (re.clientX - O) / (
|
|
1932
|
-
let { x: oe, y: ie, width:
|
|
1933
|
-
p.includes("e") && (
|
|
1945
|
+
const F = { ...B.position }, O = L.clientX, ne = L.clientY, U = (re) => {
|
|
1946
|
+
const me = (re.clientX - O) / (z * W), pe = (re.clientY - ne) / (z * W);
|
|
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 = () => {
|
|
1943
|
-
document.removeEventListener("mousemove",
|
|
1958
|
+
document.removeEventListener("mousemove", U), document.removeEventListener("mouseup", ae);
|
|
1944
1959
|
};
|
|
1945
|
-
document.addEventListener("mousemove",
|
|
1960
|
+
document.addEventListener("mousemove", U), document.addEventListener("mouseup", ae);
|
|
1946
1961
|
},
|
|
1947
|
-
[te,
|
|
1948
|
-
), ve =
|
|
1949
|
-
|
|
1950
|
-
sections:
|
|
1951
|
-
...
|
|
1952
|
-
fields:
|
|
1962
|
+
[te, z, N, fe]
|
|
1963
|
+
), ve = M(() => {
|
|
1964
|
+
E({
|
|
1965
|
+
sections: r.sections.map((c) => ({
|
|
1966
|
+
...c,
|
|
1967
|
+
fields: c.fields.filter((p) => !s.has(p.id))
|
|
1953
1968
|
}))
|
|
1954
|
-
}),
|
|
1955
|
-
}, [
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
-
sections:
|
|
1959
|
-
const L = p.fields.filter((
|
|
1960
|
-
const
|
|
1961
|
-
...
|
|
1969
|
+
}), i(/* @__PURE__ */ new Set());
|
|
1970
|
+
}, [r, s, E]), Ne = M(() => {
|
|
1971
|
+
const c = /* @__PURE__ */ new Set();
|
|
1972
|
+
E({
|
|
1973
|
+
sections: r.sections.map((p) => {
|
|
1974
|
+
const L = p.fields.filter((B) => s.has(B.id)).map((B) => {
|
|
1975
|
+
const F = {
|
|
1976
|
+
...B,
|
|
1962
1977
|
id: ce(),
|
|
1963
|
-
position: { ...
|
|
1978
|
+
position: { ...B.position, x: B.position.x + 5, y: B.position.y + 5 }
|
|
1964
1979
|
};
|
|
1965
|
-
return
|
|
1980
|
+
return c.add(F.id), F;
|
|
1966
1981
|
});
|
|
1967
1982
|
return { ...p, fields: [...p.fields, ...L] };
|
|
1968
1983
|
})
|
|
1969
|
-
}),
|
|
1970
|
-
}, [
|
|
1971
|
-
(
|
|
1972
|
-
|
|
1973
|
-
sections:
|
|
1984
|
+
}), i(c);
|
|
1985
|
+
}, [r, s, E]), Ge = M(
|
|
1986
|
+
(c) => {
|
|
1987
|
+
E({
|
|
1988
|
+
sections: r.sections.map((p) => ({
|
|
1974
1989
|
...p,
|
|
1975
1990
|
fields: p.fields.map((L) => {
|
|
1976
|
-
if (!
|
|
1991
|
+
if (!s.has(L.id))
|
|
1977
1992
|
return L;
|
|
1978
|
-
const
|
|
1979
|
-
return { ...L, position: { ...L.position, x:
|
|
1993
|
+
const B = c === "left" ? r.margins.left : c === "right" ? ee - r.margins.right - L.position.width : (ee - L.position.width) / 2;
|
|
1994
|
+
return { ...L, position: { ...L.position, x: B } };
|
|
1980
1995
|
})
|
|
1981
1996
|
}))
|
|
1982
1997
|
});
|
|
1983
1998
|
},
|
|
1984
|
-
[
|
|
1985
|
-
),
|
|
1986
|
-
(
|
|
1987
|
-
const p =
|
|
1999
|
+
[r, s, ee, E]
|
|
2000
|
+
), Oe = M(
|
|
2001
|
+
(c) => {
|
|
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:
|
|
1993
|
-
...
|
|
1994
|
-
fields:
|
|
1995
|
-
if (!
|
|
1996
|
-
return
|
|
1997
|
-
const O =
|
|
1998
|
-
return { ...
|
|
2006
|
+
E({
|
|
2007
|
+
sections: r.sections.map((B) => B.id !== m ? B : {
|
|
2008
|
+
...B,
|
|
2009
|
+
fields: B.fields.map((F) => {
|
|
2010
|
+
if (!s.has(F.id))
|
|
2011
|
+
return F;
|
|
2012
|
+
const O = c === "top" ? 0 : c === "bottom" ? L - F.position.height : (L - F.position.height) / 2;
|
|
2013
|
+
return { ...F, position: { ...F.position, y: O } };
|
|
1999
2014
|
})
|
|
2000
2015
|
})
|
|
2001
2016
|
});
|
|
2002
2017
|
},
|
|
2003
|
-
[
|
|
2004
|
-
),
|
|
2005
|
-
|
|
2006
|
-
sections:
|
|
2007
|
-
...
|
|
2008
|
-
fields:
|
|
2009
|
-
(p) =>
|
|
2018
|
+
[r, s, m, E]
|
|
2019
|
+
), qe = M(() => {
|
|
2020
|
+
E({
|
|
2021
|
+
sections: r.sections.map((c) => ({
|
|
2022
|
+
...c,
|
|
2023
|
+
fields: c.fields.map(
|
|
2024
|
+
(p) => s.has(p.id) ? { ...p, position: { ...p.position, zIndex: (p.position.zIndex ?? 1) + 1 } } : p
|
|
2010
2025
|
)
|
|
2011
2026
|
}))
|
|
2012
2027
|
});
|
|
2013
|
-
}, [
|
|
2014
|
-
|
|
2015
|
-
sections:
|
|
2016
|
-
...
|
|
2017
|
-
fields:
|
|
2018
|
-
(p) =>
|
|
2028
|
+
}, [r, s, E]), We = M(() => {
|
|
2029
|
+
E({
|
|
2030
|
+
sections: r.sections.map((c) => ({
|
|
2031
|
+
...c,
|
|
2032
|
+
fields: c.fields.map(
|
|
2033
|
+
(p) => s.has(p.id) ? {
|
|
2019
2034
|
...p,
|
|
2020
2035
|
position: { ...p.position, zIndex: Math.max(1, (p.position.zIndex ?? 1) - 1) }
|
|
2021
2036
|
} : p
|
|
2022
2037
|
)
|
|
2023
2038
|
}))
|
|
2024
2039
|
});
|
|
2025
|
-
}, [
|
|
2026
|
-
(
|
|
2027
|
-
|
|
2028
|
-
sections:
|
|
2040
|
+
}, [r, s, E]), Ye = M(
|
|
2041
|
+
(c, p) => {
|
|
2042
|
+
E({
|
|
2043
|
+
sections: r.sections.map((L) => ({
|
|
2029
2044
|
...L,
|
|
2030
2045
|
fields: L.fields.map(
|
|
2031
|
-
(
|
|
2032
|
-
...
|
|
2046
|
+
(B) => B.id === c ? {
|
|
2047
|
+
...B,
|
|
2033
2048
|
position: {
|
|
2034
|
-
...
|
|
2035
|
-
zIndex: Math.max(1, (
|
|
2049
|
+
...B.position,
|
|
2050
|
+
zIndex: Math.max(1, (B.position.zIndex ?? 1) - p)
|
|
2036
2051
|
}
|
|
2037
|
-
} :
|
|
2052
|
+
} : B
|
|
2038
2053
|
)
|
|
2039
2054
|
}))
|
|
2040
2055
|
});
|
|
2041
2056
|
},
|
|
2042
|
-
[
|
|
2057
|
+
[r, E]
|
|
2043
2058
|
);
|
|
2044
|
-
|
|
2045
|
-
const
|
|
2059
|
+
Be(() => {
|
|
2060
|
+
const c = (p) => {
|
|
2046
2061
|
const L = p.target.tagName;
|
|
2047
2062
|
if (L === "INPUT" || L === "TEXTAREA" || L === "SELECT")
|
|
2048
2063
|
return;
|
|
2049
|
-
const
|
|
2050
|
-
p.key === "Delete" || p.key === "Backspace" ?
|
|
2051
|
-
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) -
|
|
2064
|
+
const B = p.shiftKey ? 5 : 0.5;
|
|
2065
|
+
p.key === "Delete" || p.key === "Backspace" ? s.size && (p.preventDefault(), ve()) : p.ctrlKey && p.key === "z" ? (p.preventDefault(), I({ type: "UNDO" })) : p.ctrlKey && (p.key === "y" || p.key === "Y") ? (p.preventDefault(), I({ type: "REDO" })) : p.ctrlKey && (p.key === "d" || p.key === "D") ? (p.preventDefault(), s.size && Ne()) : p.ctrlKey && p.key === "a" ? (p.preventDefault(), i(new Set(te.map((F) => F.id)))) : p.key === "ArrowLeft" ? (p.preventDefault(), de({
|
|
2066
|
+
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) - B }
|
|
2052
2067
|
})) : p.key === "ArrowRight" ? (p.preventDefault(), de({
|
|
2053
|
-
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) +
|
|
2068
|
+
position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) + B }
|
|
2054
2069
|
})) : p.key === "ArrowUp" ? (p.preventDefault(), de({
|
|
2055
|
-
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) -
|
|
2070
|
+
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) - B }
|
|
2056
2071
|
})) : p.key === "ArrowDown" && (p.preventDefault(), de({
|
|
2057
|
-
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) +
|
|
2072
|
+
position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) + B }
|
|
2058
2073
|
}));
|
|
2059
2074
|
};
|
|
2060
|
-
return window.addEventListener("keydown",
|
|
2061
|
-
}, [
|
|
2062
|
-
const
|
|
2063
|
-
(
|
|
2064
|
-
|
|
2065
|
-
sections:
|
|
2066
|
-
(L) => L.id ===
|
|
2075
|
+
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
2076
|
+
}, [s, te, G, ve, Ne, de]);
|
|
2077
|
+
const Ue = M(
|
|
2078
|
+
(c, p) => {
|
|
2079
|
+
E({
|
|
2080
|
+
sections: r.sections.map(
|
|
2081
|
+
(L) => L.id === c ? { ...L, heightMm: Math.round(p * 2) / 2 } : L
|
|
2067
2082
|
)
|
|
2068
2083
|
});
|
|
2069
2084
|
},
|
|
2070
|
-
[
|
|
2071
|
-
),
|
|
2072
|
-
const
|
|
2073
|
-
return
|
|
2074
|
-
}, [
|
|
2085
|
+
[r, E]
|
|
2086
|
+
), je = ue(() => {
|
|
2087
|
+
const c = Array.isArray(d) ? d[R] : d;
|
|
2088
|
+
return c ? "data" in c ? c.data : c : {};
|
|
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
|
-
tpl:
|
|
2085
|
-
zoom:
|
|
2086
|
-
canUndo:
|
|
2087
|
-
canRedo:
|
|
2088
|
-
showGrid:
|
|
2089
|
-
showRulers:
|
|
2099
|
+
tpl: r,
|
|
2100
|
+
zoom: z,
|
|
2101
|
+
canUndo: u.length > 0,
|
|
2102
|
+
canRedo: S.length > 0,
|
|
2103
|
+
showGrid: b,
|
|
2104
|
+
showRulers: _e,
|
|
2090
2105
|
readOnly: N,
|
|
2091
|
-
selectedCount:
|
|
2092
|
-
onPaperChange: (
|
|
2093
|
-
onZoom:
|
|
2094
|
-
onUndo: () =>
|
|
2095
|
-
onRedo: () =>
|
|
2096
|
-
onToggleGrid: () =>
|
|
2097
|
-
onToggleRulers: () =>
|
|
2098
|
-
onInsert:
|
|
2106
|
+
selectedCount: s.size,
|
|
2107
|
+
onPaperChange: (c, p) => E({ paperSize: c, orientation: p }),
|
|
2108
|
+
onZoom: y,
|
|
2109
|
+
onUndo: () => I({ type: "UNDO" }),
|
|
2110
|
+
onRedo: () => I({ type: "REDO" }),
|
|
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:
|
|
2105
|
-
onSave:
|
|
2116
|
+
onAlignH: Ge,
|
|
2117
|
+
onAlignV: Oe,
|
|
2118
|
+
onBringForward: qe,
|
|
2119
|
+
onSendBackward: We,
|
|
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:
|
|
2113
|
-
schema:
|
|
2114
|
-
tpl:
|
|
2126
|
+
activeTab: D,
|
|
2127
|
+
onTabChange: Y,
|
|
2128
|
+
schema: o,
|
|
2129
|
+
tpl: r,
|
|
2115
2130
|
allFields: te,
|
|
2116
|
-
selectedIds:
|
|
2117
|
-
onInsertSchemaField: (
|
|
2118
|
-
onSelectField: (
|
|
2119
|
-
onUpdateTpl: (
|
|
2120
|
-
onReorderField:
|
|
2131
|
+
selectedIds: s,
|
|
2132
|
+
onInsertSchemaField: (c) => Ie(c.type, c),
|
|
2133
|
+
onSelectField: (c) => i(/* @__PURE__ */ new Set([c])),
|
|
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:
|
|
2129
|
-
onChange: (
|
|
2142
|
+
activeTab: X,
|
|
2143
|
+
onTabChange: P,
|
|
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: (d.fontSize ?? 60) * c,
|
|
2178
|
-
color: d.color ?? ge,
|
|
2179
|
-
opacity: d.opacity,
|
|
2180
|
-
transform: `translate(-50%, -50%) rotate(${d.angle}deg)`
|
|
2181
|
-
},
|
|
2182
|
-
children: d.type === "text" ? d.text : /* @__PURE__ */ e(S, { name: "image", size: (d.fontSize ?? 60) * c })
|
|
2183
|
-
},
|
|
2184
|
-
d.id
|
|
2185
|
-
)),
|
|
2186
|
-
l.sections.map((d) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
2187
|
-
Pa,
|
|
2188
|
-
{
|
|
2189
|
-
section: d,
|
|
2190
|
-
zoom: c,
|
|
2191
|
-
paperWidthMm: ee,
|
|
2192
|
-
selectedIds: y,
|
|
2193
|
-
sampleData: We,
|
|
2194
|
-
readOnly: N,
|
|
2195
|
-
showGrid: Z,
|
|
2196
|
-
onFieldClick: Ae,
|
|
2197
|
-
onFieldDragStart: Ee,
|
|
2198
|
-
onResizeStart: Me,
|
|
2199
|
-
onSectionHeightChange: qe,
|
|
2200
|
-
onDropField: Re
|
|
2201
|
-
}
|
|
2202
|
-
) }, d.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,55 +2273,55 @@ const lr = ({
|
|
|
2242
2273
|
{ key: "printing.category.contracts", fallback: "Contracts" },
|
|
2243
2274
|
{ key: "printing.category.other", fallback: "Other" }
|
|
2244
2275
|
];
|
|
2245
|
-
function
|
|
2246
|
-
return new Promise((
|
|
2247
|
-
const
|
|
2248
|
-
|
|
2276
|
+
function Ii(n) {
|
|
2277
|
+
return new Promise((o, d) => {
|
|
2278
|
+
const l = new FileReader();
|
|
2279
|
+
l.onload = (C) => {
|
|
2249
2280
|
var N;
|
|
2250
2281
|
try {
|
|
2251
|
-
|
|
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
|
|
2260
|
-
|
|
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 =
|
|
2264
|
-
selectedId:
|
|
2265
|
-
onSelect:
|
|
2266
|
-
onImport:
|
|
2267
|
-
onExport:
|
|
2293
|
+
const hr = ({
|
|
2294
|
+
templates: n = Ci,
|
|
2295
|
+
selectedId: o,
|
|
2296
|
+
onSelect: d,
|
|
2297
|
+
onImport: l,
|
|
2298
|
+
onExport: C,
|
|
2268
2299
|
onDelete: N,
|
|
2269
|
-
onNew:
|
|
2270
|
-
className:
|
|
2271
|
-
style:
|
|
2272
|
-
theme:
|
|
2300
|
+
onNew: _,
|
|
2301
|
+
className: g,
|
|
2302
|
+
style: f,
|
|
2303
|
+
theme: k = "light"
|
|
2273
2304
|
}) => {
|
|
2274
|
-
const { t:
|
|
2275
|
-
var
|
|
2276
|
-
const
|
|
2277
|
-
if (
|
|
2305
|
+
const { t: u } = j(), [r, S] = H(""), [I, x] = H(null), [s, i] = H(null), m = tt.useRef(null), h = async (y) => {
|
|
2306
|
+
var T;
|
|
2307
|
+
const R = (T = y.target.files) == null ? void 0 : T[0];
|
|
2308
|
+
if (R) {
|
|
2278
2309
|
try {
|
|
2279
|
-
const
|
|
2280
|
-
|
|
2310
|
+
const D = await Ii(R);
|
|
2311
|
+
l == null || l(D);
|
|
2281
2312
|
} catch {
|
|
2282
2313
|
}
|
|
2283
|
-
|
|
2314
|
+
y.target.value = "";
|
|
2284
2315
|
}
|
|
2285
|
-
},
|
|
2286
|
-
const
|
|
2287
|
-
return
|
|
2316
|
+
}, z = n.filter((y) => {
|
|
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;
|
|
2318
|
+
return R && T;
|
|
2288
2319
|
});
|
|
2289
2320
|
return /* @__PURE__ */ a(
|
|
2290
2321
|
"div",
|
|
2291
2322
|
{
|
|
2292
|
-
className: `${$.root} ${
|
|
2293
|
-
style:
|
|
2323
|
+
className: `${$.root} ${k === "dark" ? $.dark : ""} ${g ?? ""}`,
|
|
2324
|
+
style: f,
|
|
2294
2325
|
children: [
|
|
2295
2326
|
/* @__PURE__ */ a("div", { className: $.topBar, children: [
|
|
2296
2327
|
/* @__PURE__ */ e(
|
|
@@ -2298,21 +2329,21 @@ const cr = ({
|
|
|
2298
2329
|
{
|
|
2299
2330
|
type: "search",
|
|
2300
2331
|
className: $.searchInput,
|
|
2301
|
-
placeholder:
|
|
2302
|
-
value:
|
|
2303
|
-
onChange: (
|
|
2332
|
+
placeholder: u("printing.searchTemplates", "Search templates…"),
|
|
2333
|
+
value: r,
|
|
2334
|
+
onChange: (y) => S(y.target.value)
|
|
2304
2335
|
}
|
|
2305
2336
|
),
|
|
2306
2337
|
/* @__PURE__ */ a(
|
|
2307
2338
|
"button",
|
|
2308
2339
|
{
|
|
2309
2340
|
className: $.actionBtn,
|
|
2310
|
-
onClick:
|
|
2311
|
-
title:
|
|
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
|
),
|
|
@@ -2321,49 +2352,52 @@ const cr = ({
|
|
|
2321
2352
|
{
|
|
2322
2353
|
className: $.actionBtn,
|
|
2323
2354
|
onClick: () => {
|
|
2324
|
-
var
|
|
2325
|
-
return (
|
|
2355
|
+
var 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
2368
|
/* @__PURE__ */ a("div", { className: $.categoryRow, children: [
|
|
2338
2369
|
/* @__PURE__ */ e(
|
|
2339
2370
|
"button",
|
|
2340
2371
|
{
|
|
2341
|
-
className: `${$.catChip} ${
|
|
2342
|
-
onClick: () =>
|
|
2343
|
-
children:
|
|
2372
|
+
className: `${$.catChip} ${I ? "" : $.catChipActive}`,
|
|
2373
|
+
onClick: () => x(null),
|
|
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: `${$.catChip} ${
|
|
2350
|
-
onClick: () =>
|
|
2351
|
-
children:
|
|
2380
|
+
className: `${$.catChip} ${I === y.fallback ? $.catChipActive : ""}`,
|
|
2381
|
+
onClick: () => x((R) => R === y.fallback ? null : y.fallback),
|
|
2382
|
+
children: u(y.key, y.fallback)
|
|
2352
2383
|
},
|
|
2353
|
-
|
|
2384
|
+
y.key
|
|
2354
2385
|
))
|
|
2355
2386
|
] }),
|
|
2356
2387
|
/* @__PURE__ */ a("div", { className: $.grid, children: [
|
|
2357
|
-
|
|
2388
|
+
z.map((y) => /* @__PURE__ */ a(
|
|
2358
2389
|
"div",
|
|
2359
2390
|
{
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
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),
|
|
2396
|
+
onMouseEnter: () => i(y.id),
|
|
2363
2397
|
onMouseLeave: () => i(null),
|
|
2364
2398
|
children: [
|
|
2365
2399
|
/* @__PURE__ */ a("div", { className: $.thumbnail, children: [
|
|
2366
|
-
|
|
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
|
{
|
|
@@ -2393,73 +2427,73 @@ const cr = ({
|
|
|
2393
2427
|
}
|
|
2394
2428
|
)
|
|
2395
2429
|
] }) }),
|
|
2396
|
-
|
|
2430
|
+
s === y.id && /* @__PURE__ */ a("div", { className: $.cardOverlay, children: [
|
|
2397
2431
|
/* @__PURE__ */ e(
|
|
2398
2432
|
"button",
|
|
2399
2433
|
{
|
|
2400
2434
|
className: $.overlayBtn,
|
|
2401
|
-
onClick: (
|
|
2402
|
-
|
|
2435
|
+
onClick: (R) => {
|
|
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
2445
|
className: $.overlayBtnDanger,
|
|
2412
|
-
onClick: (
|
|
2413
|
-
|
|
2446
|
+
onClick: (R) => {
|
|
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
2455
|
/* @__PURE__ */ a("div", { className: $.cardBody, children: [
|
|
2422
|
-
/* @__PURE__ */ e("div", { className: $.cardName, children:
|
|
2423
|
-
|
|
2456
|
+
/* @__PURE__ */ e("div", { className: $.cardName, children: y.name }),
|
|
2457
|
+
y.description && /* @__PURE__ */ e("div", { className: $.cardDesc, children: y.description }),
|
|
2424
2458
|
/* @__PURE__ */ a("div", { className: $.cardMeta, children: [
|
|
2425
2459
|
/* @__PURE__ */ a("span", { className: $.cardSize, children: [
|
|
2426
|
-
|
|
2460
|
+
y.paperSize,
|
|
2427
2461
|
" ",
|
|
2428
|
-
|
|
2462
|
+
y.orientation === "landscape" ? u("printing.orientation.landscape", "landscape") : u("printing.orientation.portrait", "portrait")
|
|
2429
2463
|
] }),
|
|
2430
|
-
|
|
2464
|
+
y.category && /* @__PURE__ */ e("span", { className: $.cardCat, children: y.category })
|
|
2431
2465
|
] }),
|
|
2432
|
-
|
|
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
|
-
|
|
2439
|
-
/* @__PURE__ */ e("span", { className: $.emptyIcon, children: /* @__PURE__ */ e(
|
|
2440
|
-
/* @__PURE__ */ e("span", { children:
|
|
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 cr = ({
|
|
|
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 (
|
|
2515
|
+
if (o === "date" && d)
|
|
2482
2516
|
try {
|
|
2483
|
-
const
|
|
2484
|
-
if (
|
|
2485
|
-
const
|
|
2486
|
-
return `${
|
|
2517
|
+
const l = new Date(n);
|
|
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
|
-
return
|
|
2522
|
+
return l.toLocaleDateString();
|
|
2489
2523
|
} catch {
|
|
2490
2524
|
return String(n);
|
|
2491
2525
|
}
|
|
2492
|
-
if (
|
|
2493
|
-
const
|
|
2494
|
-
if (!isNaN(
|
|
2495
|
-
return `${
|
|
2526
|
+
if (o === "currency" && d) {
|
|
2527
|
+
const l = Number(n);
|
|
2528
|
+
if (!isNaN(l))
|
|
2529
|
+
return `${l.toFixed(2)} ${d}`;
|
|
2496
2530
|
}
|
|
2497
|
-
return
|
|
2531
|
+
return o === "number" && typeof n == "number" ? n.toLocaleString("pl-PL") : String(n);
|
|
2498
2532
|
}
|
|
2499
|
-
const
|
|
2500
|
-
const
|
|
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
2536
|
left: N(n.position.x),
|
|
2503
2537
|
top: N(n.position.y),
|
|
2504
2538
|
width: N(n.position.width),
|
|
2505
2539
|
height: N(n.position.height),
|
|
2506
|
-
fontSize: (n.style.fontSize ?? 10) *
|
|
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)",
|
|
@@ -2522,10 +2556,10 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
|
|
|
2522
2556
|
borderRadius: n.style.borderRadius,
|
|
2523
2557
|
zIndex: n.position.zIndex ?? 1
|
|
2524
2558
|
};
|
|
2525
|
-
return n.type === "image" &&
|
|
2559
|
+
return n.type === "image" && l ? /* @__PURE__ */ e("div", { style: _, children: /* @__PURE__ */ e(
|
|
2526
2560
|
"img",
|
|
2527
2561
|
{
|
|
2528
|
-
src: String(
|
|
2562
|
+
src: String(l),
|
|
2529
2563
|
alt: "",
|
|
2530
2564
|
style: { width: "100%", height: "100%", objectFit: "contain" }
|
|
2531
2565
|
}
|
|
@@ -2533,156 +2567,201 @@ const Gi = ({ field: n, data: s, 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
|
]
|
|
2548
2582
|
}
|
|
2549
2583
|
) : n.type === "signature" ? /* @__PURE__ */ e(
|
|
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
|
|
2570
|
-
const [
|
|
2571
|
-
const [
|
|
2572
|
-
return n.orientation === "landscape" ? [
|
|
2573
|
-
})(), N = n.margins,
|
|
2574
|
-
return /* @__PURE__ */ a("div", { className: q.page, style: { width:
|
|
2601
|
+
) : /* @__PURE__ */ e("div", { style: _, children: C });
|
|
2602
|
+
}, ji = ({ template: n, data: o, zoom: d }) => {
|
|
2603
|
+
var g;
|
|
2604
|
+
const [l, C] = (() => {
|
|
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);
|
|
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: N.top *
|
|
2581
|
-
left: N.left *
|
|
2582
|
-
right: N.right *
|
|
2583
|
-
bottom: N.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
|
-
entities:
|
|
2612
|
-
sampleData:
|
|
2613
|
-
onPrint:
|
|
2614
|
-
className:
|
|
2645
|
+
entities: o = [],
|
|
2646
|
+
sampleData: d,
|
|
2647
|
+
onPrint: l,
|
|
2648
|
+
className: C,
|
|
2615
2649
|
style: N,
|
|
2616
|
-
theme:
|
|
2617
|
-
asPopup:
|
|
2618
|
-
open:
|
|
2619
|
-
onClose:
|
|
2650
|
+
theme: _ = "light",
|
|
2651
|
+
asPopup: g = !0,
|
|
2652
|
+
open: f,
|
|
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
|
-
|
|
2699
|
+
ref: D,
|
|
2700
|
+
className: `${q.root} ${_ === "dark" ? q.dark : ""} ${C ?? ""}`,
|
|
2641
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
|
-
|
|
2705
|
+
y.length > 1 && /* @__PURE__ */ a(J, { children: [
|
|
2646
2706
|
/* @__PURE__ */ e(
|
|
2647
2707
|
"button",
|
|
2648
2708
|
{
|
|
2649
2709
|
className: q.navBtn,
|
|
2650
|
-
disabled:
|
|
2651
|
-
onClick: () =>
|
|
2652
|
-
|
|
2710
|
+
disabled: r === 0,
|
|
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: [
|
|
2656
|
-
|
|
2717
|
+
r + 1,
|
|
2657
2718
|
" / ",
|
|
2658
|
-
|
|
2719
|
+
y.length
|
|
2659
2720
|
] }),
|
|
2660
2721
|
/* @__PURE__ */ e(
|
|
2661
2722
|
"button",
|
|
2662
2723
|
{
|
|
2663
2724
|
className: q.navBtn,
|
|
2664
|
-
disabled:
|
|
2665
|
-
onClick: () =>
|
|
2666
|
-
|
|
2725
|
+
disabled: r >= y.length - 1,
|
|
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
|
-
|
|
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
|
-
Math.round(
|
|
2745
|
+
Math.round(I * 100),
|
|
2676
2746
|
"%"
|
|
2677
2747
|
] }),
|
|
2678
|
-
/* @__PURE__ */ e("button", { className: q.zoomBtn, onClick: () => y((A) => Math.min(2.5, A + 0.1)), children: "+" }),
|
|
2679
2748
|
/* @__PURE__ */ e(
|
|
2680
2749
|
"button",
|
|
2681
2750
|
{
|
|
2682
2751
|
className: q.zoomBtn,
|
|
2683
|
-
onClick: () =>
|
|
2684
|
-
|
|
2685
|
-
children: "
|
|
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
|
+
),
|
|
2757
|
+
/* @__PURE__ */ e(
|
|
2758
|
+
"button",
|
|
2759
|
+
{
|
|
2760
|
+
className: q.zoomBtn,
|
|
2761
|
+
onClick: () => x(0.8),
|
|
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
|
] }),
|
|
@@ -2691,39 +2770,42 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
|
|
|
2691
2770
|
"button",
|
|
2692
2771
|
{
|
|
2693
2772
|
className: q.printBtn,
|
|
2694
|
-
onClick: () =>
|
|
2695
|
-
children:
|
|
2773
|
+
onClick: () => l == null ? void 0 : l({ copies: 1, printerId: "" }),
|
|
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
|
-
onClick:
|
|
2704
|
-
"aria-label":
|
|
2705
|
-
title:
|
|
2706
|
-
children: /* @__PURE__ */ e(
|
|
2782
|
+
onClick: z,
|
|
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
|
-
" ·
|
|
2717
|
-
|
|
2795
|
+
" ·",
|
|
2796
|
+
" ",
|
|
2797
|
+
n.orientation === "portrait" ? u("printing.portrait", "Portrait") : u("printing.landscape", "Landscape")
|
|
2718
2798
|
] }),
|
|
2719
|
-
n.sections.reduce((
|
|
2799
|
+
n.sections.reduce((P, b) => P + b.fields.length, 0),
|
|
2720
2800
|
" ",
|
|
2721
|
-
|
|
2801
|
+
u("printing.fields", "fields")
|
|
2722
2802
|
] })
|
|
2723
2803
|
]
|
|
2724
2804
|
}
|
|
2725
2805
|
);
|
|
2726
|
-
|
|
2806
|
+
if (!g)
|
|
2807
|
+
return Y;
|
|
2808
|
+
const X = /* @__PURE__ */ e(
|
|
2727
2809
|
"div",
|
|
2728
2810
|
{
|
|
2729
2811
|
style: {
|
|
@@ -2736,15 +2818,17 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
|
|
|
2736
2818
|
zIndex: 1e3,
|
|
2737
2819
|
padding: 24
|
|
2738
2820
|
},
|
|
2739
|
-
onMouseDown: (
|
|
2740
|
-
|
|
2821
|
+
onMouseDown: (P) => {
|
|
2822
|
+
P.target === P.currentTarget && z();
|
|
2741
2823
|
},
|
|
2742
2824
|
role: "presentation",
|
|
2743
2825
|
children: /* @__PURE__ */ e(
|
|
2744
2826
|
"div",
|
|
2745
2827
|
{
|
|
2828
|
+
ref: T,
|
|
2746
2829
|
role: "dialog",
|
|
2747
2830
|
"aria-modal": "true",
|
|
2831
|
+
"aria-label": n.name,
|
|
2748
2832
|
style: {
|
|
2749
2833
|
background: "var(--nice-bg-elevated, var(--nice-bg-primary, #ffffff))",
|
|
2750
2834
|
borderRadius: 12,
|
|
@@ -2753,506 +2837,507 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
|
|
|
2753
2837
|
maxHeight: "90vh",
|
|
2754
2838
|
overflow: "auto"
|
|
2755
2839
|
},
|
|
2756
|
-
children:
|
|
2840
|
+
children: Y
|
|
2757
2841
|
}
|
|
2758
2842
|
)
|
|
2759
2843
|
}
|
|
2760
|
-
)
|
|
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
|
-
|
|
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,
|
|
2787
2872
|
"badge-queued": "_badge-queued_1f4bm_405",
|
|
2788
2873
|
"badge-printing": "_badge-printing_1f4bm_413",
|
|
2789
|
-
pulse:
|
|
2874
|
+
pulse: fs,
|
|
2790
2875
|
"badge-done": "_badge-done_1f4bm_423",
|
|
2791
2876
|
"badge-error": "_badge-error_1f4bm_431",
|
|
2792
2877
|
"badge-paused": "_badge-paused_1f4bm_439",
|
|
2793
2878
|
"badge-cancelled": "_badge-cancelled_1f4bm_447",
|
|
2794
|
-
jobInfo:
|
|
2795
|
-
jobName:
|
|
2796
|
-
jobMeta:
|
|
2797
|
-
jobTime:
|
|
2798
|
-
jobDuration:
|
|
2799
|
-
jobError:
|
|
2800
|
-
progressBar:
|
|
2801
|
-
progressFill:
|
|
2802
|
-
copiesEditor:
|
|
2803
|
-
copiesBtn:
|
|
2804
|
-
copiesValue:
|
|
2805
|
-
jobActions:
|
|
2806
|
-
actionBtn:
|
|
2807
|
-
removeBtn:
|
|
2808
|
-
emptyState:
|
|
2809
|
-
},
|
|
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 = {
|
|
2810
2895
|
queued: "Queued",
|
|
2811
2896
|
printing: "Printing",
|
|
2812
2897
|
done: "Printed",
|
|
2813
2898
|
error: "Error",
|
|
2814
2899
|
paused: "Paused",
|
|
2815
2900
|
cancelled: "Cancelled"
|
|
2816
|
-
},
|
|
2817
|
-
function
|
|
2901
|
+
}, Ce = (n, o) => Ae[o] ? n(`printing.status.${o}`, Ae[o]) : o;
|
|
2902
|
+
function Ps(n, o) {
|
|
2818
2903
|
try {
|
|
2819
|
-
return new Date(
|
|
2904
|
+
return new Date(o).toLocaleTimeString(n, { hour: "2-digit", minute: "2-digit" });
|
|
2820
2905
|
} catch {
|
|
2821
|
-
return
|
|
2906
|
+
return o;
|
|
2822
2907
|
}
|
|
2823
2908
|
}
|
|
2824
|
-
function
|
|
2825
|
-
const
|
|
2826
|
-
if (
|
|
2827
|
-
return `${
|
|
2828
|
-
const
|
|
2829
|
-
if (
|
|
2830
|
-
return `${
|
|
2831
|
-
const
|
|
2832
|
-
return
|
|
2909
|
+
function Es(n) {
|
|
2910
|
+
const o = Math.floor((Date.now() - new Date(n).getTime()) / 1e3);
|
|
2911
|
+
if (o < 60)
|
|
2912
|
+
return `${o}s`;
|
|
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`;
|
|
2833
2918
|
}
|
|
2834
|
-
const
|
|
2835
|
-
const { t:
|
|
2836
|
-
return /* @__PURE__ */ a("div", { className:
|
|
2837
|
-
/* @__PURE__ */ a("span", { className: `${
|
|
2838
|
-
/* @__PURE__ */ e("span", { className:
|
|
2839
|
-
|
|
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 }),
|
|
2924
|
+
o("printing.stats.active", "Printing"),
|
|
2840
2925
|
": ",
|
|
2841
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2926
|
+
/* @__PURE__ */ e("strong", { children: d })
|
|
2842
2927
|
] }),
|
|
2843
|
-
/* @__PURE__ */ a("span", { className: `${
|
|
2844
|
-
/* @__PURE__ */ e("span", { className:
|
|
2845
|
-
|
|
2928
|
+
/* @__PURE__ */ a("span", { className: `${w.stat} ${w.statQueued}`, children: [
|
|
2929
|
+
/* @__PURE__ */ e("span", { className: w.dot }),
|
|
2930
|
+
o("printing.stats.queued", "In queue"),
|
|
2846
2931
|
": ",
|
|
2847
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2932
|
+
/* @__PURE__ */ e("strong", { children: l })
|
|
2848
2933
|
] }),
|
|
2849
|
-
/* @__PURE__ */ a("span", { className: `${
|
|
2850
|
-
/* @__PURE__ */ e("span", { className:
|
|
2851
|
-
|
|
2934
|
+
/* @__PURE__ */ a("span", { className: `${w.stat} ${w.statDone}`, children: [
|
|
2935
|
+
/* @__PURE__ */ e("span", { className: w.dot }),
|
|
2936
|
+
o("printing.stats.done", "Done"),
|
|
2852
2937
|
": ",
|
|
2853
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2938
|
+
/* @__PURE__ */ e("strong", { children: C })
|
|
2854
2939
|
] }),
|
|
2855
|
-
N > 0 && /* @__PURE__ */ a("span", { className: `${
|
|
2856
|
-
/* @__PURE__ */ e("span", { className:
|
|
2857
|
-
|
|
2940
|
+
N > 0 && /* @__PURE__ */ a("span", { className: `${w.stat} ${w.statError}`, children: [
|
|
2941
|
+
/* @__PURE__ */ e("span", { className: w.dot }),
|
|
2942
|
+
o("printing.stats.errors", "Errors"),
|
|
2858
2943
|
": ",
|
|
2859
2944
|
/* @__PURE__ */ e("strong", { children: N })
|
|
2860
2945
|
] })
|
|
2861
2946
|
] });
|
|
2862
|
-
},
|
|
2947
|
+
}, Fs = ({
|
|
2863
2948
|
job: n,
|
|
2864
|
-
index:
|
|
2865
|
-
total:
|
|
2866
|
-
printers:
|
|
2867
|
-
selected:
|
|
2949
|
+
index: o,
|
|
2950
|
+
total: d,
|
|
2951
|
+
printers: l,
|
|
2952
|
+
selected: C,
|
|
2868
2953
|
onSelect: N,
|
|
2869
|
-
onUpdate:
|
|
2870
|
-
onRemove:
|
|
2871
|
-
onPrint:
|
|
2872
|
-
onReorder:
|
|
2954
|
+
onUpdate: _,
|
|
2955
|
+
onRemove: g,
|
|
2956
|
+
onPrint: f,
|
|
2957
|
+
onReorder: k
|
|
2873
2958
|
}) => {
|
|
2874
|
-
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";
|
|
2875
2960
|
return /* @__PURE__ */ a(
|
|
2876
2961
|
"div",
|
|
2877
2962
|
{
|
|
2878
|
-
className: `${
|
|
2963
|
+
className: `${w.jobRow} ${C ? w.jobRowSelected : ""} ${w[`status-${n.status}`] ?? ""}`,
|
|
2879
2964
|
children: [
|
|
2880
2965
|
/* @__PURE__ */ e(
|
|
2881
2966
|
"input",
|
|
2882
2967
|
{
|
|
2883
2968
|
type: "checkbox",
|
|
2884
|
-
className:
|
|
2885
|
-
checked:
|
|
2969
|
+
className: w.jobCheckbox,
|
|
2970
|
+
checked: C,
|
|
2886
2971
|
onChange: () => N(n.id)
|
|
2887
2972
|
}
|
|
2888
2973
|
),
|
|
2889
|
-
/* @__PURE__ */ e("span", { className: `${
|
|
2890
|
-
/* @__PURE__ */ a("div", { className:
|
|
2891
|
-
/* @__PURE__ */ e("div", { className:
|
|
2892
|
-
/* @__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: [
|
|
2893
2978
|
n.entityLabel && /* @__PURE__ */ e("span", { children: n.entityLabel }),
|
|
2894
|
-
|
|
2895
|
-
/* @__PURE__ */ e(
|
|
2979
|
+
S && /* @__PURE__ */ a("span", { children: [
|
|
2980
|
+
/* @__PURE__ */ e(v, { name: "printer", size: 12 }),
|
|
2896
2981
|
" ",
|
|
2897
|
-
|
|
2982
|
+
S.name
|
|
2898
2983
|
] }),
|
|
2899
2984
|
/* @__PURE__ */ a("span", { children: [
|
|
2900
2985
|
"×",
|
|
2901
2986
|
n.options.copies
|
|
2902
2987
|
] }),
|
|
2903
|
-
n.createdAt && /* @__PURE__ */ e("span", { className:
|
|
2904
|
-
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) })
|
|
2905
2990
|
] }),
|
|
2906
|
-
n.status === "printing" && n.progress != null && /* @__PURE__ */ e("div", { className:
|
|
2907
|
-
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 })
|
|
2908
2993
|
] }),
|
|
2909
|
-
/* @__PURE__ */ a("div", { className:
|
|
2994
|
+
/* @__PURE__ */ a("div", { className: w.copiesEditor, children: [
|
|
2910
2995
|
/* @__PURE__ */ e(
|
|
2911
2996
|
"button",
|
|
2912
2997
|
{
|
|
2913
|
-
className:
|
|
2998
|
+
className: w.copiesBtn,
|
|
2914
2999
|
disabled: n.options.copies <= 1,
|
|
2915
|
-
"aria-label":
|
|
2916
|
-
onClick: () =>
|
|
2917
|
-
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 })
|
|
2918
3003
|
}
|
|
2919
3004
|
),
|
|
2920
|
-
/* @__PURE__ */ e("span", { className:
|
|
3005
|
+
/* @__PURE__ */ e("span", { className: w.copiesValue, children: n.options.copies }),
|
|
2921
3006
|
/* @__PURE__ */ e(
|
|
2922
3007
|
"button",
|
|
2923
3008
|
{
|
|
2924
|
-
className:
|
|
2925
|
-
"aria-label":
|
|
2926
|
-
onClick: () =>
|
|
2927
|
-
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 })
|
|
2928
3013
|
}
|
|
2929
3014
|
)
|
|
2930
3015
|
] }),
|
|
2931
|
-
/* @__PURE__ */ a("div", { className:
|
|
2932
|
-
|
|
3016
|
+
/* @__PURE__ */ a("div", { className: w.jobActions, children: [
|
|
3017
|
+
I && /* @__PURE__ */ e(
|
|
2933
3018
|
"button",
|
|
2934
3019
|
{
|
|
2935
|
-
className:
|
|
2936
|
-
title:
|
|
2937
|
-
onClick: () =>
|
|
2938
|
-
children: /* @__PURE__ */ e(
|
|
3020
|
+
className: w.actionBtn,
|
|
3021
|
+
title: u("printing.action.moveUp", "Move up"),
|
|
3022
|
+
onClick: () => k(o, o - 1),
|
|
3023
|
+
children: /* @__PURE__ */ e(v, { name: "arrow-up", size: 14 })
|
|
2939
3024
|
}
|
|
2940
3025
|
),
|
|
2941
|
-
|
|
3026
|
+
x && /* @__PURE__ */ e(
|
|
2942
3027
|
"button",
|
|
2943
3028
|
{
|
|
2944
|
-
className:
|
|
2945
|
-
title:
|
|
2946
|
-
onClick: () =>
|
|
2947
|
-
children: /* @__PURE__ */ e(
|
|
3029
|
+
className: w.actionBtn,
|
|
3030
|
+
title: u("printing.action.moveDown", "Move down"),
|
|
3031
|
+
onClick: () => k(o, o + 1),
|
|
3032
|
+
children: /* @__PURE__ */ e(v, { name: "arrow-down", size: 14 })
|
|
2948
3033
|
}
|
|
2949
3034
|
),
|
|
2950
3035
|
n.status === "queued" && /* @__PURE__ */ e(
|
|
2951
3036
|
"button",
|
|
2952
3037
|
{
|
|
2953
|
-
className:
|
|
2954
|
-
title:
|
|
2955
|
-
onClick: () =>
|
|
2956
|
-
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 })
|
|
2957
3042
|
}
|
|
2958
3043
|
),
|
|
2959
3044
|
n.status === "printing" && /* @__PURE__ */ e(
|
|
2960
3045
|
"button",
|
|
2961
3046
|
{
|
|
2962
|
-
className:
|
|
2963
|
-
title:
|
|
2964
|
-
onClick: () =>
|
|
2965
|
-
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 })
|
|
2966
3051
|
}
|
|
2967
3052
|
),
|
|
2968
3053
|
n.status === "paused" && /* @__PURE__ */ e(
|
|
2969
3054
|
"button",
|
|
2970
3055
|
{
|
|
2971
|
-
className:
|
|
2972
|
-
title:
|
|
2973
|
-
onClick: () =>
|
|
2974
|
-
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 })
|
|
2975
3060
|
}
|
|
2976
3061
|
),
|
|
2977
3062
|
/* @__PURE__ */ e(
|
|
2978
3063
|
"button",
|
|
2979
3064
|
{
|
|
2980
|
-
className: `${
|
|
2981
|
-
title:
|
|
2982
|
-
onClick: () =>
|
|
2983
|
-
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 })
|
|
2984
3069
|
}
|
|
2985
3070
|
)
|
|
2986
3071
|
] })
|
|
2987
3072
|
]
|
|
2988
3073
|
}
|
|
2989
3074
|
);
|
|
2990
|
-
},
|
|
2991
|
-
jobs: n =
|
|
2992
|
-
printers:
|
|
2993
|
-
onJobUpdate:
|
|
2994
|
-
onJobRemove:
|
|
2995
|
-
onJobReorder:
|
|
3075
|
+
}, _r = ({
|
|
3076
|
+
jobs: n = As,
|
|
3077
|
+
printers: o = [],
|
|
3078
|
+
onJobUpdate: d,
|
|
3079
|
+
onJobRemove: l,
|
|
3080
|
+
onJobReorder: C,
|
|
2996
3081
|
onJobPrint: N,
|
|
2997
|
-
onBulkRemove:
|
|
2998
|
-
onBulkPrint:
|
|
2999
|
-
maxHeight:
|
|
3000
|
-
className:
|
|
3001
|
-
style:
|
|
3002
|
-
theme:
|
|
3082
|
+
onBulkRemove: _,
|
|
3083
|
+
onBulkPrint: g,
|
|
3084
|
+
maxHeight: f = 500,
|
|
3085
|
+
className: k,
|
|
3086
|
+
style: u,
|
|
3087
|
+
theme: r = "light"
|
|
3003
3088
|
}) => {
|
|
3004
|
-
const { t:
|
|
3005
|
-
|
|
3006
|
-
const
|
|
3007
|
-
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;
|
|
3008
3093
|
});
|
|
3009
|
-
}, []),
|
|
3010
|
-
|
|
3011
|
-
}, [
|
|
3012
|
-
|
|
3013
|
-
}, [
|
|
3014
|
-
|
|
3015
|
-
}, [
|
|
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(() => {
|
|
3097
|
+
_ == null || _(Array.from(I)), x(/* @__PURE__ */ new Set());
|
|
3098
|
+
}, [I, _]), R = M(() => {
|
|
3099
|
+
g == null || g(Array.from(I)), x(/* @__PURE__ */ new Set());
|
|
3100
|
+
}, [I, g]);
|
|
3016
3101
|
return /* @__PURE__ */ a(
|
|
3017
3102
|
"div",
|
|
3018
3103
|
{
|
|
3019
|
-
className: `${
|
|
3020
|
-
style:
|
|
3104
|
+
className: `${w.root} ${r === "dark" ? w.dark : ""} ${k ?? ""}`,
|
|
3105
|
+
style: u,
|
|
3021
3106
|
children: [
|
|
3022
|
-
/* @__PURE__ */ e(
|
|
3023
|
-
/* @__PURE__ */ a("div", { className:
|
|
3024
|
-
/* @__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(
|
|
3025
3110
|
"button",
|
|
3026
3111
|
{
|
|
3027
|
-
className: `${
|
|
3028
|
-
onClick: () => i(
|
|
3112
|
+
className: `${w.filterTab} ${s === T ? w.filterTabActive : ""}`,
|
|
3113
|
+
onClick: () => i(T),
|
|
3029
3114
|
children: [
|
|
3030
|
-
|
|
3031
|
-
/* @__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 })
|
|
3032
3117
|
]
|
|
3033
3118
|
},
|
|
3034
|
-
|
|
3119
|
+
T
|
|
3035
3120
|
)) }),
|
|
3036
|
-
|
|
3037
|
-
/* @__PURE__ */ a("span", { className:
|
|
3038
|
-
|
|
3121
|
+
I.size > 0 && /* @__PURE__ */ a("div", { className: w.bulkActions, children: [
|
|
3122
|
+
/* @__PURE__ */ a("span", { className: w.bulkCount, children: [
|
|
3123
|
+
I.size,
|
|
3039
3124
|
" ",
|
|
3040
|
-
|
|
3125
|
+
S("printing.bulk.selected", "selected")
|
|
3041
3126
|
] }),
|
|
3042
|
-
|
|
3043
|
-
/* @__PURE__ */ e(
|
|
3127
|
+
g && /* @__PURE__ */ a("button", { className: w.bulkBtn, onClick: R, children: [
|
|
3128
|
+
/* @__PURE__ */ e(v, { name: "printer", size: 14 }),
|
|
3044
3129
|
" ",
|
|
3045
|
-
|
|
3130
|
+
S("printing.bulk.print", "Print selected")
|
|
3046
3131
|
] }),
|
|
3047
|
-
|
|
3048
|
-
/* @__PURE__ */ e(
|
|
3132
|
+
_ && /* @__PURE__ */ a("button", { className: `${w.bulkBtn} ${w.bulkBtnRemove}`, onClick: y, children: [
|
|
3133
|
+
/* @__PURE__ */ e(v, { name: "trash", size: 14 }),
|
|
3049
3134
|
" ",
|
|
3050
|
-
|
|
3135
|
+
S("printing.bulk.remove", "Remove selected")
|
|
3051
3136
|
] })
|
|
3052
3137
|
] })
|
|
3053
3138
|
] }),
|
|
3054
|
-
/* @__PURE__ */ e("div", { className:
|
|
3055
|
-
/* @__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: [
|
|
3056
3141
|
/* @__PURE__ */ e(
|
|
3057
3142
|
"input",
|
|
3058
3143
|
{
|
|
3059
3144
|
type: "checkbox",
|
|
3060
|
-
onChange:
|
|
3061
|
-
checked:
|
|
3145
|
+
onChange: z,
|
|
3146
|
+
checked: I.size === m.length && m.length > 0
|
|
3062
3147
|
}
|
|
3063
3148
|
),
|
|
3064
|
-
/* @__PURE__ */ e("span", { className:
|
|
3065
|
-
/* @__PURE__ */ e("span", { className:
|
|
3066
|
-
/* @__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") })
|
|
3067
3152
|
] }),
|
|
3068
|
-
|
|
3069
|
-
|
|
3153
|
+
m.map((T, D) => /* @__PURE__ */ e(
|
|
3154
|
+
Fs,
|
|
3070
3155
|
{
|
|
3071
|
-
job:
|
|
3072
|
-
index: n.indexOf(
|
|
3156
|
+
job: T,
|
|
3157
|
+
index: n.indexOf(T),
|
|
3073
3158
|
total: n.length,
|
|
3074
|
-
printers:
|
|
3075
|
-
selected:
|
|
3076
|
-
onSelect:
|
|
3077
|
-
onUpdate:
|
|
3078
|
-
onRemove:
|
|
3159
|
+
printers: o,
|
|
3160
|
+
selected: I.has(T.id),
|
|
3161
|
+
onSelect: h,
|
|
3162
|
+
onUpdate: d,
|
|
3163
|
+
onRemove: l,
|
|
3079
3164
|
onPrint: N,
|
|
3080
|
-
onReorder:
|
|
3165
|
+
onReorder: C
|
|
3081
3166
|
},
|
|
3082
|
-
|
|
3167
|
+
T.id
|
|
3083
3168
|
))
|
|
3084
3169
|
] }) })
|
|
3085
3170
|
]
|
|
3086
3171
|
}
|
|
3087
3172
|
);
|
|
3088
|
-
},
|
|
3089
|
-
container:
|
|
3090
|
-
buttonGroup:
|
|
3091
|
-
trigger:
|
|
3092
|
-
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,
|
|
3093
3178
|
"variant-primary": "_variant-primary_1f76z_69",
|
|
3094
3179
|
"variant-secondary": "_variant-secondary_1f76z_83",
|
|
3095
3180
|
"variant-ghost": "_variant-ghost_1f76z_99",
|
|
3096
3181
|
"size-sm": "_size-sm_1f76z_117",
|
|
3097
3182
|
"size-md": "_size-md_1f76z_127",
|
|
3098
3183
|
"size-lg": "_size-lg_1f76z_137",
|
|
3099
|
-
mainAction:
|
|
3100
|
-
dropdownToggle:
|
|
3101
|
-
chevron:
|
|
3102
|
-
chevronUp:
|
|
3103
|
-
dropdown:
|
|
3104
|
-
dark:
|
|
3105
|
-
section:
|
|
3106
|
-
sectionLabel:
|
|
3107
|
-
divider:
|
|
3108
|
-
copiesRow:
|
|
3109
|
-
copiesBtn:
|
|
3110
|
-
copiesValue:
|
|
3111
|
-
printerSelect:
|
|
3112
|
-
printerStatus:
|
|
3113
|
-
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,
|
|
3114
3199
|
"dot-ready": "_dot-ready_1f76z_439",
|
|
3115
3200
|
"dot-busy": "_dot-busy_1f76z_445",
|
|
3116
3201
|
"dot-offline": "_dot-offline_1f76z_451",
|
|
3117
3202
|
"dot-error": "_dot-error_1f76z_457",
|
|
3118
|
-
printerStatusLabel:
|
|
3119
|
-
submitBtn:
|
|
3120
|
-
spinner:
|
|
3121
|
-
spin:
|
|
3122
|
-
},
|
|
3203
|
+
printerStatusLabel: sr,
|
|
3204
|
+
submitBtn: rr,
|
|
3205
|
+
spinner: or,
|
|
3206
|
+
spin: lr
|
|
3207
|
+
}, br = ({
|
|
3123
3208
|
onPrint: n,
|
|
3124
|
-
printers:
|
|
3125
|
-
defaultPrinterId:
|
|
3126
|
-
defaultCopies:
|
|
3127
|
-
disabled:
|
|
3209
|
+
printers: o = [],
|
|
3210
|
+
defaultPrinterId: d,
|
|
3211
|
+
defaultCopies: l = 1,
|
|
3212
|
+
disabled: C = !1,
|
|
3128
3213
|
loading: N = !1,
|
|
3129
|
-
variant:
|
|
3130
|
-
size:
|
|
3131
|
-
label:
|
|
3132
|
-
className:
|
|
3133
|
-
style:
|
|
3134
|
-
theme:
|
|
3214
|
+
variant: _ = "primary",
|
|
3215
|
+
size: g = "md",
|
|
3216
|
+
label: f,
|
|
3217
|
+
className: k,
|
|
3218
|
+
style: u,
|
|
3219
|
+
theme: r = "light"
|
|
3135
3220
|
}) => {
|
|
3136
|
-
var
|
|
3137
|
-
const { t:
|
|
3138
|
-
|
|
3139
|
-
if (!
|
|
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(() => {
|
|
3224
|
+
if (!x)
|
|
3140
3225
|
return;
|
|
3141
|
-
const
|
|
3142
|
-
|
|
3226
|
+
const b = (V) => {
|
|
3227
|
+
y.current && !y.current.contains(V.target) && s(!1);
|
|
3143
3228
|
};
|
|
3144
|
-
return document.addEventListener("mousedown",
|
|
3145
|
-
}, [
|
|
3146
|
-
const
|
|
3147
|
-
n({ copies: i, printerId:
|
|
3148
|
-
}, [i,
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3229
|
+
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
3230
|
+
}, [x]);
|
|
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 : ""
|
|
3153
3238
|
].filter(Boolean).join(" ");
|
|
3154
|
-
return /* @__PURE__ */ a("div", { ref:
|
|
3155
|
-
/* @__PURE__ */ a("div", { className:
|
|
3239
|
+
return /* @__PURE__ */ a("div", { ref: y, className: Y, style: u, children: [
|
|
3240
|
+
/* @__PURE__ */ a("div", { className: A.buttonGroup, children: [
|
|
3156
3241
|
/* @__PURE__ */ a(
|
|
3157
3242
|
"button",
|
|
3158
3243
|
{
|
|
3159
|
-
className: `${
|
|
3160
|
-
disabled:
|
|
3161
|
-
onClick:
|
|
3162
|
-
"aria-label":
|
|
3244
|
+
className: `${X} ${A.mainAction}`,
|
|
3245
|
+
disabled: C || N,
|
|
3246
|
+
onClick: R,
|
|
3247
|
+
"aria-label": I,
|
|
3163
3248
|
children: [
|
|
3164
|
-
N ? /* @__PURE__ */ e("span", { className:
|
|
3165
|
-
/* @__PURE__ */ e("span", { children:
|
|
3249
|
+
N ? /* @__PURE__ */ e("span", { className: A.spinner }) : /* @__PURE__ */ e(v, { name: "printer", size: 16 }),
|
|
3250
|
+
/* @__PURE__ */ e("span", { children: I })
|
|
3166
3251
|
]
|
|
3167
3252
|
}
|
|
3168
3253
|
),
|
|
3169
3254
|
/* @__PURE__ */ e(
|
|
3170
3255
|
"button",
|
|
3171
3256
|
{
|
|
3172
|
-
className: `${
|
|
3173
|
-
disabled:
|
|
3174
|
-
onClick: () =>
|
|
3175
|
-
"aria-label":
|
|
3176
|
-
"aria-expanded":
|
|
3177
|
-
children: /* @__PURE__ */ e("span", { className: `${
|
|
3257
|
+
className: `${X} ${A.dropdownToggle}`,
|
|
3258
|
+
disabled: C || N,
|
|
3259
|
+
onClick: () => s((b) => !b),
|
|
3260
|
+
"aria-label": S("printing.options", "Print options"),
|
|
3261
|
+
"aria-expanded": x,
|
|
3262
|
+
children: /* @__PURE__ */ e("span", { className: `${A.chevron} ${x ? A.chevronUp : ""}`, children: /* @__PURE__ */ e(v, { name: "chevron-down", size: 12 }) })
|
|
3178
3263
|
}
|
|
3179
3264
|
)
|
|
3180
3265
|
] }),
|
|
3181
|
-
|
|
3182
|
-
/* @__PURE__ */ a("div", { className:
|
|
3183
|
-
/* @__PURE__ */ e("label", { className:
|
|
3184
|
-
/* @__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: [
|
|
3185
3270
|
/* @__PURE__ */ e(
|
|
3186
3271
|
"button",
|
|
3187
3272
|
{
|
|
3188
|
-
className:
|
|
3189
|
-
onClick:
|
|
3273
|
+
className: A.copiesBtn,
|
|
3274
|
+
onClick: D,
|
|
3190
3275
|
disabled: i <= 1,
|
|
3191
|
-
"aria-label":
|
|
3192
|
-
children: /* @__PURE__ */ e(
|
|
3276
|
+
"aria-label": S("printing.copies.decrease", "One copy fewer"),
|
|
3277
|
+
children: /* @__PURE__ */ e(v, { name: "minus", size: 12 })
|
|
3193
3278
|
}
|
|
3194
3279
|
),
|
|
3195
|
-
/* @__PURE__ */ e("span", { className:
|
|
3280
|
+
/* @__PURE__ */ e("span", { className: A.copiesValue, children: i }),
|
|
3196
3281
|
/* @__PURE__ */ e(
|
|
3197
3282
|
"button",
|
|
3198
3283
|
{
|
|
3199
|
-
className:
|
|
3200
|
-
onClick:
|
|
3284
|
+
className: A.copiesBtn,
|
|
3285
|
+
onClick: T,
|
|
3201
3286
|
disabled: i >= 99,
|
|
3202
|
-
"aria-label":
|
|
3203
|
-
children: /* @__PURE__ */ e(
|
|
3287
|
+
"aria-label": S("printing.copies.increase", "One copy more"),
|
|
3288
|
+
children: /* @__PURE__ */ e(v, { name: "plus", size: 12 })
|
|
3204
3289
|
}
|
|
3205
3290
|
)
|
|
3206
3291
|
] })
|
|
3207
3292
|
] }),
|
|
3208
|
-
/* @__PURE__ */ e("div", { className:
|
|
3209
|
-
|
|
3210
|
-
/* @__PURE__ */ a("div", { className:
|
|
3211
|
-
/* @__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") }),
|
|
3212
3297
|
/* @__PURE__ */ e(
|
|
3213
3298
|
"select",
|
|
3214
3299
|
{
|
|
3215
|
-
className:
|
|
3216
|
-
value:
|
|
3217
|
-
onChange: (
|
|
3218
|
-
children:
|
|
3300
|
+
className: A.printerSelect,
|
|
3301
|
+
value: h,
|
|
3302
|
+
onChange: (b) => z(b.target.value),
|
|
3303
|
+
children: o.map((b) => /* @__PURE__ */ a(
|
|
3219
3304
|
"option",
|
|
3220
3305
|
{
|
|
3221
|
-
value:
|
|
3222
|
-
disabled:
|
|
3306
|
+
value: b.id,
|
|
3307
|
+
disabled: b.status === "offline" || !b.isOnline && b.status == null,
|
|
3223
3308
|
children: [
|
|
3224
|
-
|
|
3309
|
+
b.name,
|
|
3225
3310
|
" ",
|
|
3226
|
-
|
|
3311
|
+
b.status === "offline" || !b.isOnline && b.status == null ? S("printing.offline", "(Offline)") : b.status === "busy" ? `(${S("printing.printerBusyLabel", "Busy")})` : ""
|
|
3227
3312
|
]
|
|
3228
3313
|
},
|
|
3229
|
-
|
|
3314
|
+
b.id
|
|
3230
3315
|
))
|
|
3231
3316
|
}
|
|
3232
3317
|
),
|
|
3233
|
-
|
|
3234
|
-
const
|
|
3235
|
-
return /* @__PURE__ */ a(
|
|
3236
|
-
/* @__PURE__ */ e("span", { className: `${
|
|
3237
|
-
/* @__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") })
|
|
3238
3323
|
] });
|
|
3239
3324
|
})() })
|
|
3240
3325
|
] }),
|
|
3241
|
-
/* @__PURE__ */ e("div", { className:
|
|
3326
|
+
/* @__PURE__ */ e("div", { className: A.divider })
|
|
3242
3327
|
] }),
|
|
3243
|
-
/* @__PURE__ */ e("div", { className:
|
|
3328
|
+
/* @__PURE__ */ e("div", { className: A.section, children: /* @__PURE__ */ e(
|
|
3244
3329
|
"button",
|
|
3245
3330
|
{
|
|
3246
|
-
className:
|
|
3247
|
-
onClick:
|
|
3248
|
-
disabled:
|
|
3249
|
-
const
|
|
3250
|
-
return
|
|
3331
|
+
className: A.submitBtn,
|
|
3332
|
+
onClick: R,
|
|
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);
|
|
3251
3336
|
})(),
|
|
3252
|
-
children: N ?
|
|
3253
|
-
/* @__PURE__ */ e(
|
|
3337
|
+
children: N ? S("printing.printing", "Printing…") : /* @__PURE__ */ a(J, { children: [
|
|
3338
|
+
/* @__PURE__ */ e(v, { name: "printer", size: 14 }),
|
|
3254
3339
|
" ",
|
|
3255
|
-
|
|
3340
|
+
I,
|
|
3256
3341
|
i > 1 ? ` (${i})` : ""
|
|
3257
3342
|
] })
|
|
3258
3343
|
}
|
|
@@ -3261,9 +3346,9 @@ const Ds = ({ jobs: n }) => {
|
|
|
3261
3346
|
] });
|
|
3262
3347
|
};
|
|
3263
3348
|
export {
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3349
|
+
br as NicePrintButton,
|
|
3350
|
+
gr as NicePrintPreview,
|
|
3351
|
+
_r as NicePrintQueue,
|
|
3352
|
+
hr as NiceTemplateBrowser,
|
|
3353
|
+
ur as NiceTemplateEditor
|
|
3269
3354
|
};
|