@nice2dev/ui-printing 1.1.5 → 1.1.7
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.d.ts +5 -6
- package/dist/index.mjs +901 -901
- package/dist/print-button/NicePrintButton.d.ts +0 -1
- package/dist/print-button/index.d.ts +0 -1
- package/dist/print-preview/NicePrintPreview.d.ts +0 -1
- package/dist/print-preview/index.d.ts +0 -1
- package/dist/print-queue/NicePrintQueue.d.ts +0 -1
- package/dist/print-queue/index.d.ts +0 -1
- package/dist/template-browser/NiceTemplateBrowser.d.ts +0 -1
- package/dist/template-browser/index.d.ts +0 -1
- package/dist/template-editor/NiceTemplateEditor.d.ts +0 -1
- package/dist/template-editor/index.d.ts +0 -1
- package/dist/types/printingTypes.d.ts +0 -1
- package/dist/ui-printing.css +1 -1
- package/package.json +3 -3
- package/src/index.ts +5 -24
- package/src/print-button/NicePrintButton.tsx +5 -1
- package/src/print-button/PrintButton.module.css +147 -43
- package/src/print-preview/NicePrintPreview.tsx +10 -9
- package/src/print-preview/PrintPreview.module.css +60 -18
- package/src/print-queue/PrintQueue.module.css +207 -57
- package/src/template-browser/NiceTemplateBrowser.tsx +5 -1
- package/src/template-browser/TemplateBrowser.module.css +70 -25
- package/src/template-editor/NiceTemplateEditor.tsx +1 -3
- package/src/template-editor/TemplateEditor.module.css +96 -47
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import He, { useReducer as We, useState as P, useCallback as T, useMemo as oe, useEffect as ge, useRef as Fe } from "react";
|
|
3
3
|
import { NiceAppShell as Oe, useNiceTranslation as Ue } from "@nice2dev/ui";
|
|
4
4
|
import { createPortal as Ye } from "react-dom";
|
|
5
|
-
const qe = "
|
|
5
|
+
const qe = "_root_142ej_3", Ke = "_dark_142ej_27", Ve = "_toolbar_142ej_39", Ze = "_toolbarGroup_142ej_75", Xe = "_toolbarBtn_142ej_107", Je = "_toolbarBtnActive_142ej_171", Qe = "_toolbarBtnDanger_142ej_195", et = "_toolbarSelect_142ej_207", tt = "_toolbarSep_142ej_237", at = "_insertWrapper_142ej_263", nt = "_insertBtn_142ej_271", st = "_insertDropdown_142ej_293", lt = "_insertCategory_142ej_333", rt = "_insertItem_142ej_351", it = "_insertIcon_142ej_395", ot = "_zoomSelect_142ej_409", ct = "_saveBtn_142ej_441", dt = "_editorBody_142ej_477", pt = "_leftPanel_142ej_493", mt = "_leftTabs_142ej_523", ut = "_leftTab_142ej_523", _t = "_leftTabActive_142ej_601", ht = "_leftTabIcon_142ej_621", yt = "_leftTabLabel_142ej_629", gt = "_leftContent_142ej_639", bt = "_panelHeader_142ej_653", vt = "_panelHeaderIcon_142ej_677", Nt = "_panelHeaderName_142ej_685", wt = "_searchBox_142ej_699", ft = "_searchInput_142ej_707", kt = "_fieldList_142ej_753", St = "_fieldItem_142ej_763", Bt = "_fieldItemIcon_142ej_807", xt = "_fieldItemInfo_142ej_821", Ct = "_fieldItemLabel_142ej_831", It = "_fieldItemPath_142ej_847", Lt = "_fieldItemType_142ej_863", jt = "_layerList_142ej_883", zt = "_layerItem_142ej_895", Dt = "_layerItemSelected_142ej_931", Tt = "_layerIcon_142ej_949", $t = "_layerName_142ej_961", Rt = "_layerActions_142ej_977", At = "_layerBtn_142ej_999", Pt = "_wmList_142ej_1031", Mt = "_wmItem_142ej_1039", Et = "_wmRow_142ej_1065", Gt = "_wmLabel_142ej_1079", Ht = "_wmInput_142ej_1091", Wt = "_wmInputNum_142ej_1123", Ft = "_wmSelect_142ej_1143", Ot = "_wmSlider_142ej_1175", Ut = "_wmValue_142ej_1185", Yt = "_wmUnit_142ej_1199", qt = "_wmDelete_142ej_1209", Kt = "_addBtn_142ej_1241", Vt = "_settingsForm_142ej_1277", Zt = "_settingsRow_142ej_1285", Xt = "_settingsLabel_142ej_1299", Jt = "_settingsInput_142ej_1311", Qt = "_settingsInputNum_142ej_1343", ea = "_settingsTextarea_142ej_1375", ta = "_settingsDivider_142ej_1409", aa = "_settingsUnit_142ej_1429", na = "_emptyMsg_142ej_1441", sa = "_canvasArea_142ej_1459", la = "_testDataBar_142ej_1485", ra = "_testDataLabel_142ej_1517", ia = "_testDataSelect_142ej_1527", oa = "_rulerWrapper_142ej_1547", ca = "_rulerCorner_142ej_1563", da = "_ruler_142ej_1547", pa = "_ruler_h_142ej_1621", ma = "_ruler_v_142ej_1631", ua = "_rulerTick_142ej_1651", _a = "_rulerTickMajor_142ej_1691", ha = "_rulerLabel_142ej_1711", ya = "_paperScroll_142ej_1749", ga = "_paperShadow_142ej_1767", ba = "_marginGuide_142ej_1795", va = "_watermark_142ej_1811", Na = "_sectionCanvas_142ej_1837", wa = "_sectionCanvasOver_142ej_1851", fa = "_sectionTypeChip_142ej_1859", ka = "_sectionResizeBar_142ej_1891", Sa = "_sectionResizeGrip_142ej_1925", Ba = "_fieldImagePlaceholder_142ej_1941", xa = "_fieldBarcodePlaceholder_142ej_1963", Ca = "_fieldSignaturePlaceholder_142ej_1991", Ia = "_resizeHandle_142ej_2017", La = "_handle_n_142ej_2037", ja = "_handle_s_142ej_2049", za = "_handle_e_142ej_2061", Da = "_handle_w_142ej_2073", Ta = "_handle_ne_142ej_2085", $a = "_handle_nw_142ej_2095", Ra = "_handle_se_142ej_2105", Aa = "_handle_sw_142ej_2115", Pa = "_rightPanel_142ej_2129", Ma = "_rightTabs_142ej_2159", Ea = "_rightTab_142ej_2159", Ga = "_rightTabActive_142ej_2229", Ha = "_propsBody_142ej_2241", Wa = "_propsEmpty_142ej_2253", Fa = "_propsEmptyIcon_142ej_2275", Oa = "_propsEmptyText_142ej_2285", Ua = "_posGrid_142ej_2297", Ya = "_posCell_142ej_2311", qa = "_posLabel_142ej_2323", Ka = "_posInput_142ej_2335", Va = "_posUnit_142ej_2377", Za = "_snapSection_142ej_2389", Xa = "_snapTitle_142ej_2397", Ja = "_snapRow_142ej_2415", Qa = "_snapBtn_142ej_2425", en = "_styleGroup_142ej_2459", tn = "_styleGroupTitle_142ej_2467", an = "_styleRow_142ej_2497", nn = "_styleLabel_142ej_2511", sn = "_styleSelect_142ej_2525", ln = "_styleSelectFull_142ej_2555", rn = "_styleSelectSm_142ej_2587", on = "_styleSelectXs_142ej_2607", cn = "_styleInput_142ej_2639", dn = "_styleInputFull_142ej_2671", pn = "_styleUnit_142ej_2703", mn = "_styleValue_142ej_2715", un = "_toggleGroup_142ej_2729", _n = "_toggleBtn_142ej_2739", hn = "_toggleBtnActive_142ej_2773", yn = "_colorPicker_142ej_2787", gn = "_colorHex_142ej_2805", bn = "_clearBtn_142ej_2839", vn = "_sliderInput_142ej_2871", Nn = "_conditionalHint_142ej_2883", wn = "_clearConditionalBtn_142ej_2915", fn = "_shortcutGrid_142ej_2947", kn = "_shortcutChip_142ej_2961", Sn = "_shortcutKeys_142ej_2993", Bn = "_shortcutLabel_142ej_3013", t = {
|
|
6
6
|
root: qe,
|
|
7
7
|
dark: Ke,
|
|
8
8
|
toolbar: Ve,
|
|
@@ -15,8 +15,8 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
|
|
|
15
15
|
insertWrapper: at,
|
|
16
16
|
insertBtn: nt,
|
|
17
17
|
insertDropdown: st,
|
|
18
|
-
insertCategory:
|
|
19
|
-
insertItem:
|
|
18
|
+
insertCategory: lt,
|
|
19
|
+
insertItem: rt,
|
|
20
20
|
insertIcon: it,
|
|
21
21
|
zoomSelect: ot,
|
|
22
22
|
saveBtn: ct,
|
|
@@ -24,35 +24,35 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
|
|
|
24
24
|
leftPanel: pt,
|
|
25
25
|
leftTabs: mt,
|
|
26
26
|
leftTab: ut,
|
|
27
|
-
leftTabActive:
|
|
28
|
-
leftTabIcon:
|
|
29
|
-
leftTabLabel:
|
|
30
|
-
leftContent:
|
|
27
|
+
leftTabActive: _t,
|
|
28
|
+
leftTabIcon: ht,
|
|
29
|
+
leftTabLabel: yt,
|
|
30
|
+
leftContent: gt,
|
|
31
31
|
panelHeader: bt,
|
|
32
|
-
panelHeaderIcon:
|
|
33
|
-
panelHeaderName:
|
|
34
|
-
searchBox:
|
|
32
|
+
panelHeaderIcon: vt,
|
|
33
|
+
panelHeaderName: Nt,
|
|
34
|
+
searchBox: wt,
|
|
35
35
|
searchInput: ft,
|
|
36
36
|
fieldList: kt,
|
|
37
37
|
fieldItem: St,
|
|
38
38
|
fieldItemIcon: Bt,
|
|
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:
|
|
39
|
+
fieldItemInfo: xt,
|
|
40
|
+
fieldItemLabel: Ct,
|
|
41
|
+
fieldItemPath: It,
|
|
42
|
+
fieldItemType: Lt,
|
|
43
|
+
layerList: jt,
|
|
44
|
+
layerItem: zt,
|
|
45
|
+
layerItemSelected: Dt,
|
|
46
|
+
layerIcon: Tt,
|
|
47
|
+
layerName: $t,
|
|
48
|
+
layerActions: Rt,
|
|
49
|
+
layerBtn: At,
|
|
50
|
+
wmList: Pt,
|
|
51
|
+
wmItem: Mt,
|
|
52
|
+
wmRow: Et,
|
|
53
|
+
wmLabel: Gt,
|
|
54
|
+
wmInput: Ht,
|
|
55
|
+
wmInputNum: Wt,
|
|
56
56
|
wmSelect: Ft,
|
|
57
57
|
wmSlider: Ot,
|
|
58
58
|
wmValue: Ut,
|
|
@@ -69,8 +69,8 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
|
|
|
69
69
|
settingsUnit: aa,
|
|
70
70
|
emptyMsg: na,
|
|
71
71
|
canvasArea: sa,
|
|
72
|
-
testDataBar:
|
|
73
|
-
testDataLabel:
|
|
72
|
+
testDataBar: la,
|
|
73
|
+
testDataLabel: ra,
|
|
74
74
|
testDataSelect: ia,
|
|
75
75
|
rulerWrapper: oa,
|
|
76
76
|
rulerCorner: ca,
|
|
@@ -78,35 +78,35 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
|
|
|
78
78
|
ruler_h: pa,
|
|
79
79
|
ruler_v: ma,
|
|
80
80
|
rulerTick: ua,
|
|
81
|
-
rulerTickMajor:
|
|
82
|
-
rulerLabel:
|
|
83
|
-
paperScroll:
|
|
84
|
-
paperShadow:
|
|
81
|
+
rulerTickMajor: _a,
|
|
82
|
+
rulerLabel: ha,
|
|
83
|
+
paperScroll: ya,
|
|
84
|
+
paperShadow: ga,
|
|
85
85
|
marginGuide: ba,
|
|
86
|
-
watermark:
|
|
87
|
-
sectionCanvas:
|
|
88
|
-
sectionCanvasOver:
|
|
86
|
+
watermark: va,
|
|
87
|
+
sectionCanvas: Na,
|
|
88
|
+
sectionCanvasOver: wa,
|
|
89
89
|
sectionTypeChip: fa,
|
|
90
90
|
sectionResizeBar: ka,
|
|
91
91
|
sectionResizeGrip: Sa,
|
|
92
92
|
fieldImagePlaceholder: Ba,
|
|
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:
|
|
93
|
+
fieldBarcodePlaceholder: xa,
|
|
94
|
+
fieldSignaturePlaceholder: Ca,
|
|
95
|
+
resizeHandle: Ia,
|
|
96
|
+
handle_n: La,
|
|
97
|
+
handle_s: ja,
|
|
98
|
+
handle_e: za,
|
|
99
|
+
handle_w: Da,
|
|
100
|
+
handle_ne: Ta,
|
|
101
|
+
handle_nw: $a,
|
|
102
|
+
handle_se: Ra,
|
|
103
|
+
handle_sw: Aa,
|
|
104
|
+
rightPanel: Pa,
|
|
105
|
+
rightTabs: Ma,
|
|
106
|
+
rightTab: Ea,
|
|
107
|
+
rightTabActive: Ga,
|
|
108
|
+
propsBody: Ha,
|
|
109
|
+
propsEmpty: Wa,
|
|
110
110
|
propsEmptyIcon: Fa,
|
|
111
111
|
propsEmptyText: Oa,
|
|
112
112
|
posGrid: Ua,
|
|
@@ -123,27 +123,27 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
|
|
|
123
123
|
styleRow: an,
|
|
124
124
|
styleLabel: nn,
|
|
125
125
|
styleSelect: sn,
|
|
126
|
-
styleSelectFull:
|
|
127
|
-
styleSelectSm:
|
|
126
|
+
styleSelectFull: ln,
|
|
127
|
+
styleSelectSm: rn,
|
|
128
128
|
styleSelectXs: on,
|
|
129
129
|
styleInput: cn,
|
|
130
130
|
styleInputFull: dn,
|
|
131
131
|
styleUnit: pn,
|
|
132
132
|
styleValue: mn,
|
|
133
133
|
toggleGroup: un,
|
|
134
|
-
toggleBtn:
|
|
135
|
-
toggleBtnActive:
|
|
136
|
-
colorPicker:
|
|
137
|
-
colorHex:
|
|
134
|
+
toggleBtn: _n,
|
|
135
|
+
toggleBtnActive: hn,
|
|
136
|
+
colorPicker: yn,
|
|
137
|
+
colorHex: gn,
|
|
138
138
|
clearBtn: bn,
|
|
139
|
-
sliderInput:
|
|
140
|
-
conditionalHint:
|
|
141
|
-
clearConditionalBtn:
|
|
139
|
+
sliderInput: vn,
|
|
140
|
+
conditionalHint: Nn,
|
|
141
|
+
clearConditionalBtn: wn,
|
|
142
142
|
shortcutGrid: fn,
|
|
143
143
|
shortcutChip: kn,
|
|
144
144
|
shortcutKeys: Sn,
|
|
145
145
|
shortcutLabel: Bn
|
|
146
|
-
}, F = 3.78,
|
|
146
|
+
}, F = 3.78, we = {
|
|
147
147
|
A3: [297, 420],
|
|
148
148
|
A4: [210, 297],
|
|
149
149
|
A5: [148, 210],
|
|
@@ -152,7 +152,7 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
|
|
|
152
152
|
Legal: [216, 356],
|
|
153
153
|
Tabloid: [279, 432],
|
|
154
154
|
custom: [210, 297]
|
|
155
|
-
},
|
|
155
|
+
}, xn = [
|
|
156
156
|
"sans-serif",
|
|
157
157
|
"serif",
|
|
158
158
|
"monospace",
|
|
@@ -199,7 +199,7 @@ const qe = "_root_552wg_3", Ke = "_dark_552wg_27", Ve = "_toolbar_552wg_39", Ze
|
|
|
199
199
|
total_pages: "Liczba stron",
|
|
200
200
|
print_date: "Data wydruku"
|
|
201
201
|
};
|
|
202
|
-
function
|
|
202
|
+
function Cn(a, i) {
|
|
203
203
|
switch (i.type) {
|
|
204
204
|
case "UPDATE":
|
|
205
205
|
return {
|
|
@@ -255,23 +255,23 @@ const Se = ({
|
|
|
255
255
|
zoom: i,
|
|
256
256
|
orientation: p
|
|
257
257
|
}) => {
|
|
258
|
-
const
|
|
259
|
-
for (let
|
|
260
|
-
const S =
|
|
261
|
-
|
|
258
|
+
const r = [], k = i < 0.6 ? 20 : i < 1 ? 10 : 5;
|
|
259
|
+
for (let _ = 0; _ <= a; _ += k) {
|
|
260
|
+
const S = _ * i * F, b = _ % (k * 2) === 0;
|
|
261
|
+
r.push(
|
|
262
262
|
/* @__PURE__ */ e(
|
|
263
263
|
"div",
|
|
264
264
|
{
|
|
265
265
|
className: `${t.rulerTick} ${b ? t.rulerTickMajor : ""}`,
|
|
266
266
|
style: p === "h" ? { left: S } : { top: S },
|
|
267
|
-
children: b && /* @__PURE__ */ e("span", { className: t.rulerLabel, children:
|
|
267
|
+
children: b && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: _ })
|
|
268
268
|
},
|
|
269
|
-
|
|
269
|
+
_
|
|
270
270
|
)
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${p}`]}`, children:
|
|
274
|
-
},
|
|
273
|
+
return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${p}`]}`, children: r });
|
|
274
|
+
}, In = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Ln = ({ onResizeStart: a }) => /* @__PURE__ */ e(Y, { children: In.map((i) => /* @__PURE__ */ e(
|
|
275
275
|
"div",
|
|
276
276
|
{
|
|
277
277
|
className: `${t.resizeHandle} ${t[`handle_${i}`]}`,
|
|
@@ -281,7 +281,7 @@ const Se = ({
|
|
|
281
281
|
},
|
|
282
282
|
i
|
|
283
283
|
)) });
|
|
284
|
-
function
|
|
284
|
+
function jn(a, i) {
|
|
285
285
|
if (a.type === "static_text")
|
|
286
286
|
return a.fallback ?? "Tekst";
|
|
287
287
|
if (a.type === "page_number")
|
|
@@ -292,7 +292,7 @@ function zn(a, i) {
|
|
|
292
292
|
return (/* @__PURE__ */ new Date()).toLocaleDateString("pl-PL");
|
|
293
293
|
if (i && a.dataPath) {
|
|
294
294
|
const p = a.dataPath.split(".").reduce(
|
|
295
|
-
(
|
|
295
|
+
(r, k) => r && typeof r == "object" ? r[k] : null,
|
|
296
296
|
i
|
|
297
297
|
);
|
|
298
298
|
if (p != null)
|
|
@@ -300,77 +300,77 @@ function zn(a, i) {
|
|
|
300
300
|
}
|
|
301
301
|
return a.label ? `{${a.label}}` : `{${a.dataPath}}`;
|
|
302
302
|
}
|
|
303
|
-
const
|
|
303
|
+
const zn = ({
|
|
304
304
|
field: a,
|
|
305
305
|
zoom: i,
|
|
306
306
|
selected: p,
|
|
307
|
-
sampleData:
|
|
307
|
+
sampleData: r,
|
|
308
308
|
onClick: k,
|
|
309
|
-
onDragStart:
|
|
309
|
+
onDragStart: _,
|
|
310
310
|
onResizeStart: S,
|
|
311
311
|
readOnly: b
|
|
312
312
|
}) => {
|
|
313
|
-
const
|
|
313
|
+
const y = a.position, N = a.style, c = (m) => m * i * F, D = a.type === "line", w = a.type === "rect", l = a.type === "image" || a.type === "static_image", n = a.type === "barcode" || a.type === "qr", u = {
|
|
314
314
|
position: "absolute",
|
|
315
|
-
left: c(
|
|
316
|
-
top: c(
|
|
317
|
-
width: c(
|
|
318
|
-
height: c(
|
|
319
|
-
zIndex:
|
|
320
|
-
transform:
|
|
315
|
+
left: c(y.x),
|
|
316
|
+
top: c(y.y),
|
|
317
|
+
width: c(y.width),
|
|
318
|
+
height: c(y.height),
|
|
319
|
+
zIndex: y.zIndex ?? 1,
|
|
320
|
+
transform: N.rotation ? `rotate(${N.rotation}deg)` : void 0,
|
|
321
321
|
boxSizing: "border-box",
|
|
322
322
|
overflow: "hidden",
|
|
323
|
-
...!
|
|
324
|
-
fontSize: (
|
|
325
|
-
fontFamily:
|
|
326
|
-
fontWeight:
|
|
327
|
-
fontStyle:
|
|
328
|
-
color:
|
|
329
|
-
textAlign:
|
|
330
|
-
lineHeight:
|
|
331
|
-
letterSpacing:
|
|
332
|
-
padding:
|
|
323
|
+
...!D && !w ? {
|
|
324
|
+
fontSize: (N.fontSize ?? 10) * i,
|
|
325
|
+
fontFamily: N.fontFamily ?? "sans-serif",
|
|
326
|
+
fontWeight: N.fontWeight ?? "normal",
|
|
327
|
+
fontStyle: N.fontStyle ?? "normal",
|
|
328
|
+
color: N.color ?? "var(--nice-text, #000)",
|
|
329
|
+
textAlign: N.textAlign ?? "left",
|
|
330
|
+
lineHeight: N.lineHeight ?? 1.4,
|
|
331
|
+
letterSpacing: N.letterSpacing ? `${N.letterSpacing}em` : void 0,
|
|
332
|
+
padding: N.padding ? c(N.padding) : 0
|
|
333
333
|
} : {},
|
|
334
|
-
backgroundColor:
|
|
335
|
-
borderWidth:
|
|
336
|
-
borderColor:
|
|
337
|
-
borderStyle:
|
|
338
|
-
borderRadius:
|
|
339
|
-
opacity:
|
|
334
|
+
backgroundColor: N.backgroundColor,
|
|
335
|
+
borderWidth: N.borderWidth ?? 0,
|
|
336
|
+
borderColor: N.borderColor ?? "transparent",
|
|
337
|
+
borderStyle: N.borderStyle ?? "solid",
|
|
338
|
+
borderRadius: N.borderRadius,
|
|
339
|
+
opacity: N.opacity,
|
|
340
340
|
outline: p ? "1.5px solid var(--nice-primary-hover, #2563eb)" : "1px dashed transparent",
|
|
341
341
|
outlineOffset: 1,
|
|
342
342
|
cursor: b ? "default" : "move"
|
|
343
343
|
};
|
|
344
|
-
return /* @__PURE__ */ s("div", { style: u, onClick: k, onMouseDown: b ? void 0 :
|
|
345
|
-
|
|
344
|
+
return /* @__PURE__ */ s("div", { style: u, onClick: k, onMouseDown: b ? void 0 : _, children: [
|
|
345
|
+
D ? /* @__PURE__ */ e(
|
|
346
346
|
"div",
|
|
347
347
|
{
|
|
348
348
|
style: {
|
|
349
349
|
width: "100%",
|
|
350
|
-
borderBottom: `${(
|
|
350
|
+
borderBottom: `${(N.borderWidth ?? 0.5) * i}px ${N.borderStyle ?? "solid"} ${N.borderColor ?? "var(--nice-text, #000)"}`
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
) :
|
|
353
|
+
) : w ? null : l ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: "🖼" }) : n ? /* @__PURE__ */ e("div", { className: t.fieldBarcodePlaceholder, children: a.type === "qr" ? "⬛ QR" : "▮▌▮ Barcode" }) : a.type === "signature" ? /* @__PURE__ */ s("div", { className: t.fieldSignaturePlaceholder, children: [
|
|
354
354
|
"✍ ",
|
|
355
355
|
a.label
|
|
356
|
-
] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children:
|
|
357
|
-
p && !b && /* @__PURE__ */ e(
|
|
356
|
+
] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: jn(a, r) }),
|
|
357
|
+
p && !b && /* @__PURE__ */ e(Ln, { onResizeStart: S })
|
|
358
358
|
] });
|
|
359
|
-
},
|
|
359
|
+
}, Dn = ({
|
|
360
360
|
section: a,
|
|
361
361
|
zoom: i,
|
|
362
362
|
paperWidthMm: p,
|
|
363
|
-
selectedIds:
|
|
363
|
+
selectedIds: r,
|
|
364
364
|
sampleData: k,
|
|
365
|
-
readOnly:
|
|
365
|
+
readOnly: _,
|
|
366
366
|
showGrid: S,
|
|
367
367
|
onFieldClick: b,
|
|
368
|
-
onFieldDragStart:
|
|
369
|
-
onResizeStart:
|
|
368
|
+
onFieldDragStart: y,
|
|
369
|
+
onResizeStart: N,
|
|
370
370
|
onSectionHeightChange: c,
|
|
371
|
-
onDropField:
|
|
371
|
+
onDropField: D
|
|
372
372
|
}) => {
|
|
373
|
-
const
|
|
373
|
+
const w = (a.heightMm ?? (a.type === "body" ? 200 : 40)) * i * F, l = p * i * F, [n, u] = P(!1), m = {
|
|
374
374
|
header: "rgba(219,234,254,0.35)",
|
|
375
375
|
footer: "rgba(220,252,231,0.35)",
|
|
376
376
|
background: "rgba(254,249,195,0.35)",
|
|
@@ -381,8 +381,8 @@ const Dn = ({
|
|
|
381
381
|
{
|
|
382
382
|
className: `${t.sectionCanvas} ${n ? t.sectionCanvasOver : ""}`,
|
|
383
383
|
style: {
|
|
384
|
-
width:
|
|
385
|
-
height:
|
|
384
|
+
width: l,
|
|
385
|
+
height: w,
|
|
386
386
|
position: "relative",
|
|
387
387
|
background: m[a.type] ?? "transparent",
|
|
388
388
|
backgroundImage: S ? `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 * i * F}px),
|
|
@@ -394,41 +394,41 @@ const Dn = ({
|
|
|
394
394
|
onDragLeave: () => u(!1),
|
|
395
395
|
onDrop: (f) => {
|
|
396
396
|
f.preventDefault(), u(!1);
|
|
397
|
-
const
|
|
398
|
-
if (!
|
|
397
|
+
const z = f.dataTransfer.getData("fieldPath");
|
|
398
|
+
if (!z)
|
|
399
399
|
return;
|
|
400
|
-
const
|
|
401
|
-
|
|
400
|
+
const g = f.currentTarget.getBoundingClientRect(), L = (f.clientX - g.left) / (i * F), C = (f.clientY - g.top) / (i * F);
|
|
401
|
+
D(a.id, z, Math.max(0, L), Math.max(0, C));
|
|
402
402
|
},
|
|
403
403
|
children: [
|
|
404
404
|
/* @__PURE__ */ e("div", { className: t.sectionTypeChip, children: a.type }),
|
|
405
405
|
a.fields.map((f) => /* @__PURE__ */ e(
|
|
406
|
-
|
|
406
|
+
zn,
|
|
407
407
|
{
|
|
408
408
|
field: f,
|
|
409
409
|
zoom: i,
|
|
410
|
-
selected:
|
|
410
|
+
selected: r.has(f.id),
|
|
411
411
|
sampleData: k,
|
|
412
|
-
readOnly:
|
|
413
|
-
onClick: (
|
|
414
|
-
onDragStart: (
|
|
415
|
-
onResizeStart: (
|
|
412
|
+
readOnly: _,
|
|
413
|
+
onClick: (z) => b(f.id, z),
|
|
414
|
+
onDragStart: (z) => y(f.id, z),
|
|
415
|
+
onResizeStart: (z, g) => N(f.id, z, g)
|
|
416
416
|
},
|
|
417
417
|
f.id
|
|
418
418
|
)),
|
|
419
|
-
!
|
|
419
|
+
!_ && a.type !== "body" && /* @__PURE__ */ e(
|
|
420
420
|
"div",
|
|
421
421
|
{
|
|
422
422
|
className: t.sectionResizeBar,
|
|
423
423
|
onMouseDown: (f) => {
|
|
424
424
|
f.preventDefault();
|
|
425
|
-
const
|
|
426
|
-
const
|
|
427
|
-
c(a.id, Math.max(10,
|
|
428
|
-
},
|
|
429
|
-
document.removeEventListener("mousemove",
|
|
425
|
+
const z = f.clientY, g = a.heightMm ?? 40, L = (M) => {
|
|
426
|
+
const H = (M.clientY - z) / (i * F);
|
|
427
|
+
c(a.id, Math.max(10, g + H));
|
|
428
|
+
}, C = () => {
|
|
429
|
+
document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", C);
|
|
430
430
|
};
|
|
431
|
-
document.addEventListener("mousemove",
|
|
431
|
+
document.addEventListener("mousemove", L), document.addEventListener("mouseup", C);
|
|
432
432
|
},
|
|
433
433
|
children: /* @__PURE__ */ e("div", { className: t.sectionResizeGrip })
|
|
434
434
|
}
|
|
@@ -439,42 +439,42 @@ const Dn = ({
|
|
|
439
439
|
}, ne = ({ keys: a, label: i }) => /* @__PURE__ */ s("div", { className: t.shortcutChip, children: [
|
|
440
440
|
/* @__PURE__ */ e("span", { className: t.shortcutKeys, children: a }),
|
|
441
441
|
/* @__PURE__ */ e("span", { className: t.shortcutLabel, children: i })
|
|
442
|
-
] }),
|
|
442
|
+
] }), Tn = [
|
|
443
443
|
{ id: "fields", icon: "📝", label: "Pola" },
|
|
444
444
|
{ id: "layers", icon: "◧", label: "Warstwy" },
|
|
445
445
|
{ id: "watermarks", icon: "💧", label: "Znaki" },
|
|
446
446
|
{ id: "signatures", icon: "✍", label: "Podpisy" },
|
|
447
447
|
{ id: "settings", icon: "⚙", label: "Ustawienia" }
|
|
448
|
-
],
|
|
448
|
+
], $n = [
|
|
449
449
|
{ id: "position", label: "Pozycja" },
|
|
450
450
|
{ id: "style", label: "Styl" },
|
|
451
451
|
{ id: "data", label: "Dane" },
|
|
452
452
|
{ id: "conditional", label: "Warunki" }
|
|
453
|
-
],
|
|
453
|
+
], Rn = ({
|
|
454
454
|
tpl: a,
|
|
455
455
|
zoom: i,
|
|
456
456
|
canUndo: p,
|
|
457
|
-
canRedo:
|
|
457
|
+
canRedo: r,
|
|
458
458
|
showGrid: k,
|
|
459
|
-
showRulers:
|
|
459
|
+
showRulers: _,
|
|
460
460
|
readOnly: S,
|
|
461
461
|
selectedCount: b,
|
|
462
|
-
onPaperChange:
|
|
463
|
-
onZoom:
|
|
462
|
+
onPaperChange: y,
|
|
463
|
+
onZoom: N,
|
|
464
464
|
onUndo: c,
|
|
465
|
-
onRedo:
|
|
466
|
-
onToggleGrid:
|
|
467
|
-
onToggleRulers:
|
|
465
|
+
onRedo: D,
|
|
466
|
+
onToggleGrid: w,
|
|
467
|
+
onToggleRulers: l,
|
|
468
468
|
onInsert: n,
|
|
469
469
|
onDelete: u,
|
|
470
470
|
onDuplicate: m,
|
|
471
471
|
onAlignH: f,
|
|
472
|
-
onAlignV:
|
|
473
|
-
onBringForward:
|
|
474
|
-
onSendBackward:
|
|
475
|
-
onSave:
|
|
472
|
+
onAlignV: z,
|
|
473
|
+
onBringForward: g,
|
|
474
|
+
onSendBackward: L,
|
|
475
|
+
onSave: C
|
|
476
476
|
}) => {
|
|
477
|
-
const [
|
|
477
|
+
const [M, H] = P(!1), A = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
478
478
|
return /* @__PURE__ */ s("div", { className: t.toolbar, children: [
|
|
479
479
|
/* @__PURE__ */ s("div", { className: t.toolbarGroup, children: [
|
|
480
480
|
/* @__PURE__ */ e(
|
|
@@ -482,15 +482,15 @@ const Dn = ({
|
|
|
482
482
|
{
|
|
483
483
|
className: t.toolbarSelect,
|
|
484
484
|
value: a.paperSize,
|
|
485
|
-
onChange: (
|
|
486
|
-
children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((
|
|
485
|
+
onChange: (h) => y(h.target.value, a.orientation),
|
|
486
|
+
children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((h) => /* @__PURE__ */ e("option", { value: h, children: h }, h))
|
|
487
487
|
}
|
|
488
488
|
),
|
|
489
489
|
/* @__PURE__ */ e(
|
|
490
490
|
"button",
|
|
491
491
|
{
|
|
492
492
|
className: `${t.toolbarBtn} ${a.orientation === "portrait" ? t.toolbarBtnActive : ""}`,
|
|
493
|
-
onClick: () =>
|
|
493
|
+
onClick: () => y(a.paperSize, "portrait"),
|
|
494
494
|
title: "Pion",
|
|
495
495
|
children: "⬜"
|
|
496
496
|
}
|
|
@@ -499,7 +499,7 @@ const Dn = ({
|
|
|
499
499
|
"button",
|
|
500
500
|
{
|
|
501
501
|
className: `${t.toolbarBtn} ${a.orientation === "landscape" ? t.toolbarBtnActive : ""}`,
|
|
502
|
-
onClick: () =>
|
|
502
|
+
onClick: () => y(a.paperSize, "landscape"),
|
|
503
503
|
title: "Poziom",
|
|
504
504
|
children: "▭"
|
|
505
505
|
}
|
|
@@ -520,8 +520,8 @@ const Dn = ({
|
|
|
520
520
|
"button",
|
|
521
521
|
{
|
|
522
522
|
className: t.toolbarBtn,
|
|
523
|
-
disabled: !
|
|
524
|
-
onClick:
|
|
523
|
+
disabled: !r,
|
|
524
|
+
onClick: D,
|
|
525
525
|
title: "Ponów (Ctrl+Y)",
|
|
526
526
|
children: "↪"
|
|
527
527
|
}
|
|
@@ -532,25 +532,25 @@ const Dn = ({
|
|
|
532
532
|
"button",
|
|
533
533
|
{
|
|
534
534
|
className: `${t.toolbarBtn} ${t.insertBtn}`,
|
|
535
|
-
onClick: () =>
|
|
535
|
+
onClick: () => H((h) => !h),
|
|
536
536
|
children: "+ Wstaw ▾"
|
|
537
537
|
}
|
|
538
538
|
),
|
|
539
|
-
|
|
539
|
+
M && /* @__PURE__ */ s("div", { className: t.insertDropdown, onMouseLeave: () => H(!1), children: [
|
|
540
540
|
/* @__PURE__ */ e("div", { className: t.insertCategory, children: "Pola danych" }),
|
|
541
|
-
["text", "number", "currency", "date", "image", "barcode", "qr"].map((
|
|
541
|
+
["text", "number", "currency", "date", "image", "barcode", "qr"].map((h) => /* @__PURE__ */ s(
|
|
542
542
|
"button",
|
|
543
543
|
{
|
|
544
544
|
className: t.insertItem,
|
|
545
545
|
onClick: () => {
|
|
546
|
-
n(
|
|
546
|
+
n(h), H(!1);
|
|
547
547
|
},
|
|
548
548
|
children: [
|
|
549
|
-
/* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[
|
|
550
|
-
de[
|
|
549
|
+
/* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[h] }),
|
|
550
|
+
de[h]
|
|
551
551
|
]
|
|
552
552
|
},
|
|
553
|
-
|
|
553
|
+
h
|
|
554
554
|
)),
|
|
555
555
|
/* @__PURE__ */ e("div", { className: t.insertCategory, children: "Elementy statyczne" }),
|
|
556
556
|
[
|
|
@@ -561,19 +561,19 @@ const Dn = ({
|
|
|
561
561
|
"page_number",
|
|
562
562
|
"total_pages",
|
|
563
563
|
"print_date"
|
|
564
|
-
].map((
|
|
564
|
+
].map((h) => /* @__PURE__ */ s(
|
|
565
565
|
"button",
|
|
566
566
|
{
|
|
567
567
|
className: t.insertItem,
|
|
568
568
|
onClick: () => {
|
|
569
|
-
n(
|
|
569
|
+
n(h), H(!1);
|
|
570
570
|
},
|
|
571
571
|
children: [
|
|
572
|
-
/* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[
|
|
573
|
-
de[
|
|
572
|
+
/* @__PURE__ */ e("span", { className: t.insertIcon, children: ce[h] }),
|
|
573
|
+
de[h]
|
|
574
574
|
]
|
|
575
575
|
},
|
|
576
|
-
|
|
576
|
+
h
|
|
577
577
|
)),
|
|
578
578
|
/* @__PURE__ */ e("div", { className: t.insertCategory, children: "Specjalne" }),
|
|
579
579
|
/* @__PURE__ */ s(
|
|
@@ -581,7 +581,7 @@ const Dn = ({
|
|
|
581
581
|
{
|
|
582
582
|
className: t.insertItem,
|
|
583
583
|
onClick: () => {
|
|
584
|
-
n("watermark"),
|
|
584
|
+
n("watermark"), H(!1);
|
|
585
585
|
},
|
|
586
586
|
children: [
|
|
587
587
|
/* @__PURE__ */ e("span", { className: t.insertIcon, children: "💧" }),
|
|
@@ -594,7 +594,7 @@ const Dn = ({
|
|
|
594
594
|
{
|
|
595
595
|
className: t.insertItem,
|
|
596
596
|
onClick: () => {
|
|
597
|
-
n("signature"),
|
|
597
|
+
n("signature"), H(!1);
|
|
598
598
|
},
|
|
599
599
|
children: [
|
|
600
600
|
/* @__PURE__ */ e("span", { className: t.insertIcon, children: "✍" }),
|
|
@@ -643,19 +643,19 @@ const Dn = ({
|
|
|
643
643
|
children: "□□⬛"
|
|
644
644
|
}
|
|
645
645
|
),
|
|
646
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
647
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
648
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
646
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => z("top"), title: "Góra", children: "⊤" }),
|
|
647
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => z("center"), title: "Środek V", children: "⊕" }),
|
|
648
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => z("bottom"), title: "Dół", children: "⊥" }),
|
|
649
649
|
/* @__PURE__ */ e("span", { className: t.toolbarSep }),
|
|
650
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick:
|
|
651
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick:
|
|
650
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: g, title: "Do przodu", children: "▲" }),
|
|
651
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: L, title: "Do tyłu", children: "▼" })
|
|
652
652
|
] }),
|
|
653
653
|
/* @__PURE__ */ s("div", { className: t.toolbarGroup, children: [
|
|
654
654
|
/* @__PURE__ */ e(
|
|
655
655
|
"button",
|
|
656
656
|
{
|
|
657
657
|
className: `${t.toolbarBtn} ${k ? t.toolbarBtnActive : ""}`,
|
|
658
|
-
onClick:
|
|
658
|
+
onClick: w,
|
|
659
659
|
title: "Siatka",
|
|
660
660
|
children: "⊞"
|
|
661
661
|
}
|
|
@@ -663,60 +663,60 @@ const Dn = ({
|
|
|
663
663
|
/* @__PURE__ */ e(
|
|
664
664
|
"button",
|
|
665
665
|
{
|
|
666
|
-
className: `${t.toolbarBtn} ${
|
|
667
|
-
onClick:
|
|
666
|
+
className: `${t.toolbarBtn} ${_ ? t.toolbarBtnActive : ""}`,
|
|
667
|
+
onClick: l,
|
|
668
668
|
title: "Linijki",
|
|
669
669
|
children: "⊢"
|
|
670
670
|
}
|
|
671
671
|
)
|
|
672
672
|
] }),
|
|
673
673
|
/* @__PURE__ */ s("div", { className: t.toolbarGroup, children: [
|
|
674
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
674
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => N(Math.max(0.25, i - 0.1)), children: "−" }),
|
|
675
675
|
/* @__PURE__ */ e(
|
|
676
676
|
"select",
|
|
677
677
|
{
|
|
678
678
|
className: t.zoomSelect,
|
|
679
|
-
value:
|
|
680
|
-
onChange: (
|
|
681
|
-
children:
|
|
682
|
-
Math.round(
|
|
679
|
+
value: A.includes(i) ? i : "",
|
|
680
|
+
onChange: (h) => N(+h.target.value),
|
|
681
|
+
children: A.map((h) => /* @__PURE__ */ s("option", { value: h, children: [
|
|
682
|
+
Math.round(h * 100),
|
|
683
683
|
"%"
|
|
684
|
-
] },
|
|
684
|
+
] }, h))
|
|
685
685
|
}
|
|
686
686
|
),
|
|
687
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
688
|
-
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () =>
|
|
687
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => N(Math.min(3, i + 0.1)), children: "+" }),
|
|
688
|
+
/* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => N(1), title: "100%", children: "⊡" })
|
|
689
689
|
] }),
|
|
690
|
-
!S &&
|
|
690
|
+
!S && C && /* @__PURE__ */ e("button", { className: t.saveBtn, onClick: C, children: "💾 Zapisz" })
|
|
691
691
|
] });
|
|
692
|
-
},
|
|
692
|
+
}, An = ({
|
|
693
693
|
activeTab: a,
|
|
694
694
|
onTabChange: i,
|
|
695
695
|
schema: p,
|
|
696
|
-
tpl:
|
|
696
|
+
tpl: r,
|
|
697
697
|
allFields: k,
|
|
698
|
-
selectedIds:
|
|
698
|
+
selectedIds: _,
|
|
699
699
|
onInsertSchemaField: S,
|
|
700
700
|
onSelectField: b,
|
|
701
|
-
onUpdateTpl:
|
|
702
|
-
onReorderField:
|
|
701
|
+
onUpdateTpl: y,
|
|
702
|
+
onReorderField: N
|
|
703
703
|
}) => {
|
|
704
|
-
const [c,
|
|
705
|
-
(
|
|
704
|
+
const [c, D] = P(""), w = p == null ? void 0 : p.fields.filter(
|
|
705
|
+
(l) => l.label.toLowerCase().includes(c.toLowerCase()) || l.path.toLowerCase().includes(c.toLowerCase())
|
|
706
706
|
);
|
|
707
707
|
return /* @__PURE__ */ s("div", { className: t.leftPanel, children: [
|
|
708
|
-
/* @__PURE__ */ e("div", { className: t.leftTabs, children:
|
|
708
|
+
/* @__PURE__ */ e("div", { className: t.leftTabs, children: Tn.map((l) => /* @__PURE__ */ s(
|
|
709
709
|
"button",
|
|
710
710
|
{
|
|
711
|
-
className: `${t.leftTab} ${a ===
|
|
712
|
-
onClick: () => i(
|
|
713
|
-
title:
|
|
711
|
+
className: `${t.leftTab} ${a === l.id ? t.leftTabActive : ""}`,
|
|
712
|
+
onClick: () => i(l.id),
|
|
713
|
+
title: l.label,
|
|
714
714
|
children: [
|
|
715
|
-
/* @__PURE__ */ e("span", { className: t.leftTabIcon, children:
|
|
716
|
-
/* @__PURE__ */ e("span", { className: t.leftTabLabel, children:
|
|
715
|
+
/* @__PURE__ */ e("span", { className: t.leftTabIcon, children: l.icon }),
|
|
716
|
+
/* @__PURE__ */ e("span", { className: t.leftTabLabel, children: l.label })
|
|
717
717
|
]
|
|
718
718
|
},
|
|
719
|
-
|
|
719
|
+
l.id
|
|
720
720
|
)) }),
|
|
721
721
|
/* @__PURE__ */ s("div", { className: t.leftContent, children: [
|
|
722
722
|
a === "fields" && /* @__PURE__ */ s(Y, { children: [
|
|
@@ -727,31 +727,31 @@ const Dn = ({
|
|
|
727
727
|
className: t.searchInput,
|
|
728
728
|
placeholder: "Szukaj...",
|
|
729
729
|
value: c,
|
|
730
|
-
onChange: (
|
|
730
|
+
onChange: (l) => D(l.target.value)
|
|
731
731
|
}
|
|
732
732
|
) }),
|
|
733
733
|
p ? /* @__PURE__ */ s("div", { className: t.fieldList, children: [
|
|
734
|
-
(
|
|
734
|
+
(w ?? []).map((l) => /* @__PURE__ */ s(
|
|
735
735
|
"div",
|
|
736
736
|
{
|
|
737
737
|
className: t.fieldItem,
|
|
738
738
|
draggable: !0,
|
|
739
739
|
onDragStart: (n) => {
|
|
740
|
-
n.dataTransfer.setData("fieldPath",
|
|
740
|
+
n.dataTransfer.setData("fieldPath", l.path), n.dataTransfer.setData("fieldLabel", l.label), n.dataTransfer.setData("fieldType", l.type);
|
|
741
741
|
},
|
|
742
|
-
onClick: () => S(
|
|
742
|
+
onClick: () => S(l),
|
|
743
743
|
children: [
|
|
744
|
-
/* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: ce[
|
|
744
|
+
/* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: ce[l.type] ?? "📝" }),
|
|
745
745
|
/* @__PURE__ */ s("div", { className: t.fieldItemInfo, children: [
|
|
746
|
-
/* @__PURE__ */ e("div", { className: t.fieldItemLabel, children:
|
|
747
|
-
/* @__PURE__ */ e("div", { className: t.fieldItemPath, children:
|
|
746
|
+
/* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: l.label }),
|
|
747
|
+
/* @__PURE__ */ e("div", { className: t.fieldItemPath, children: l.path })
|
|
748
748
|
] }),
|
|
749
|
-
/* @__PURE__ */ e("span", { className: t.fieldItemType, children:
|
|
749
|
+
/* @__PURE__ */ e("span", { className: t.fieldItemType, children: l.type })
|
|
750
750
|
]
|
|
751
751
|
},
|
|
752
|
-
|
|
752
|
+
l.path
|
|
753
753
|
)),
|
|
754
|
-
(
|
|
754
|
+
(w == null ? void 0 : w.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: "Brak wyników" })
|
|
755
755
|
] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: "Brak schematu danych. Przypisz encję w zakładce Ustawienia." })
|
|
756
756
|
] }),
|
|
757
757
|
a === "layers" && /* @__PURE__ */ s(Y, { children: [
|
|
@@ -762,21 +762,21 @@ const Dn = ({
|
|
|
762
762
|
] }),
|
|
763
763
|
/* @__PURE__ */ s("div", { className: t.layerList, children: [
|
|
764
764
|
k.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: "Brak elementów" }),
|
|
765
|
-
k.slice().reverse().map((
|
|
765
|
+
k.slice().reverse().map((l) => /* @__PURE__ */ s(
|
|
766
766
|
"div",
|
|
767
767
|
{
|
|
768
|
-
className: `${t.layerItem} ${
|
|
769
|
-
onClick: () => b(
|
|
768
|
+
className: `${t.layerItem} ${_.has(l.id) ? t.layerItemSelected : ""}`,
|
|
769
|
+
onClick: () => b(l.id),
|
|
770
770
|
children: [
|
|
771
|
-
/* @__PURE__ */ e("span", { className: t.layerIcon, children: ce[
|
|
772
|
-
/* @__PURE__ */ e("span", { className: t.layerName, children:
|
|
771
|
+
/* @__PURE__ */ e("span", { className: t.layerIcon, children: ce[l.type] ?? "📝" }),
|
|
772
|
+
/* @__PURE__ */ e("span", { className: t.layerName, children: l.name || l.label }),
|
|
773
773
|
/* @__PURE__ */ s("div", { className: t.layerActions, children: [
|
|
774
774
|
/* @__PURE__ */ e(
|
|
775
775
|
"button",
|
|
776
776
|
{
|
|
777
777
|
className: t.layerBtn,
|
|
778
778
|
onClick: (n) => {
|
|
779
|
-
n.stopPropagation(),
|
|
779
|
+
n.stopPropagation(), N(l.id, -1);
|
|
780
780
|
},
|
|
781
781
|
title: "Do przodu",
|
|
782
782
|
children: "↑"
|
|
@@ -787,7 +787,7 @@ const Dn = ({
|
|
|
787
787
|
{
|
|
788
788
|
className: t.layerBtn,
|
|
789
789
|
onClick: (n) => {
|
|
790
|
-
n.stopPropagation(),
|
|
790
|
+
n.stopPropagation(), N(l.id, 1);
|
|
791
791
|
},
|
|
792
792
|
title: "Do tyłu",
|
|
793
793
|
children: "↓"
|
|
@@ -796,26 +796,26 @@ const Dn = ({
|
|
|
796
796
|
] })
|
|
797
797
|
]
|
|
798
798
|
},
|
|
799
|
-
|
|
799
|
+
l.id
|
|
800
800
|
))
|
|
801
801
|
] })
|
|
802
802
|
] }),
|
|
803
803
|
a === "watermarks" && /* @__PURE__ */ s(Y, { children: [
|
|
804
804
|
/* @__PURE__ */ e("div", { className: t.panelHeader, children: "Znaki wodne" }),
|
|
805
805
|
/* @__PURE__ */ s("div", { className: t.wmList, children: [
|
|
806
|
-
(
|
|
806
|
+
(r.watermarks ?? []).map((l) => /* @__PURE__ */ s("div", { className: t.wmItem, children: [
|
|
807
807
|
/* @__PURE__ */ s("div", { className: t.wmRow, children: [
|
|
808
808
|
/* @__PURE__ */ e("span", { className: t.wmLabel, children: "Typ" }),
|
|
809
809
|
/* @__PURE__ */ s(
|
|
810
810
|
"select",
|
|
811
811
|
{
|
|
812
812
|
className: t.wmSelect,
|
|
813
|
-
value:
|
|
813
|
+
value: l.type,
|
|
814
814
|
onChange: (n) => {
|
|
815
815
|
var u;
|
|
816
|
-
return
|
|
817
|
-
watermarks: (u =
|
|
818
|
-
(m) => m.id ===
|
|
816
|
+
return y({
|
|
817
|
+
watermarks: (u = r.watermarks) == null ? void 0 : u.map(
|
|
818
|
+
(m) => m.id === l.id ? { ...m, type: n.target.value } : m
|
|
819
819
|
)
|
|
820
820
|
});
|
|
821
821
|
},
|
|
@@ -826,18 +826,18 @@ const Dn = ({
|
|
|
826
826
|
}
|
|
827
827
|
)
|
|
828
828
|
] }),
|
|
829
|
-
|
|
829
|
+
l.type === "text" && /* @__PURE__ */ s("div", { className: t.wmRow, children: [
|
|
830
830
|
/* @__PURE__ */ e("span", { className: t.wmLabel, children: "Tekst" }),
|
|
831
831
|
/* @__PURE__ */ e(
|
|
832
832
|
"input",
|
|
833
833
|
{
|
|
834
834
|
className: t.wmInput,
|
|
835
|
-
value:
|
|
835
|
+
value: l.text ?? "",
|
|
836
836
|
onChange: (n) => {
|
|
837
837
|
var u;
|
|
838
|
-
return
|
|
839
|
-
watermarks: (u =
|
|
840
|
-
(m) => m.id ===
|
|
838
|
+
return y({
|
|
839
|
+
watermarks: (u = r.watermarks) == null ? void 0 : u.map(
|
|
840
|
+
(m) => m.id === l.id ? { ...m, text: n.target.value } : m
|
|
841
841
|
)
|
|
842
842
|
});
|
|
843
843
|
}
|
|
@@ -854,19 +854,19 @@ const Dn = ({
|
|
|
854
854
|
max: 0.5,
|
|
855
855
|
step: 0.01,
|
|
856
856
|
className: t.wmSlider,
|
|
857
|
-
value:
|
|
857
|
+
value: l.opacity,
|
|
858
858
|
onChange: (n) => {
|
|
859
859
|
var u;
|
|
860
|
-
return
|
|
861
|
-
watermarks: (u =
|
|
862
|
-
(m) => m.id ===
|
|
860
|
+
return y({
|
|
861
|
+
watermarks: (u = r.watermarks) == null ? void 0 : u.map(
|
|
862
|
+
(m) => m.id === l.id ? { ...m, opacity: +n.target.value } : m
|
|
863
863
|
)
|
|
864
864
|
});
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
867
|
),
|
|
868
868
|
/* @__PURE__ */ s("span", { className: t.wmValue, children: [
|
|
869
|
-
Math.round(
|
|
869
|
+
Math.round(l.opacity * 100),
|
|
870
870
|
"%"
|
|
871
871
|
] })
|
|
872
872
|
] }),
|
|
@@ -880,19 +880,19 @@ const Dn = ({
|
|
|
880
880
|
max: 90,
|
|
881
881
|
step: 5,
|
|
882
882
|
className: t.wmSlider,
|
|
883
|
-
value:
|
|
883
|
+
value: l.angle,
|
|
884
884
|
onChange: (n) => {
|
|
885
885
|
var u;
|
|
886
|
-
return
|
|
887
|
-
watermarks: (u =
|
|
888
|
-
(m) => m.id ===
|
|
886
|
+
return y({
|
|
887
|
+
watermarks: (u = r.watermarks) == null ? void 0 : u.map(
|
|
888
|
+
(m) => m.id === l.id ? { ...m, angle: +n.target.value } : m
|
|
889
889
|
)
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
),
|
|
894
894
|
/* @__PURE__ */ s("span", { className: t.wmValue, children: [
|
|
895
|
-
|
|
895
|
+
l.angle,
|
|
896
896
|
"°"
|
|
897
897
|
] })
|
|
898
898
|
] }),
|
|
@@ -905,12 +905,12 @@ const Dn = ({
|
|
|
905
905
|
min: 8,
|
|
906
906
|
max: 200,
|
|
907
907
|
className: t.wmInputNum,
|
|
908
|
-
value:
|
|
908
|
+
value: l.fontSize ?? 48,
|
|
909
909
|
onChange: (n) => {
|
|
910
910
|
var u;
|
|
911
|
-
return
|
|
912
|
-
watermarks: (u =
|
|
913
|
-
(m) => m.id ===
|
|
911
|
+
return y({
|
|
912
|
+
watermarks: (u = r.watermarks) == null ? void 0 : u.map(
|
|
913
|
+
(m) => m.id === l.id ? { ...m, fontSize: +n.target.value } : m
|
|
914
914
|
)
|
|
915
915
|
});
|
|
916
916
|
}
|
|
@@ -925,12 +925,12 @@ const Dn = ({
|
|
|
925
925
|
{
|
|
926
926
|
type: "color",
|
|
927
927
|
className: t.colorPicker,
|
|
928
|
-
value:
|
|
928
|
+
value: l.color ?? "var(--nice-text-muted, #94a3b8)",
|
|
929
929
|
onChange: (n) => {
|
|
930
930
|
var u;
|
|
931
|
-
return
|
|
932
|
-
watermarks: (u =
|
|
933
|
-
(m) => m.id ===
|
|
931
|
+
return y({
|
|
932
|
+
watermarks: (u = r.watermarks) == null ? void 0 : u.map(
|
|
933
|
+
(m) => m.id === l.id ? { ...m, color: n.target.value } : m
|
|
934
934
|
)
|
|
935
935
|
});
|
|
936
936
|
}
|
|
@@ -943,19 +943,19 @@ const Dn = ({
|
|
|
943
943
|
className: t.wmDelete,
|
|
944
944
|
onClick: () => {
|
|
945
945
|
var n;
|
|
946
|
-
return
|
|
946
|
+
return y({ watermarks: (n = r.watermarks) == null ? void 0 : n.filter((u) => u.id !== l.id) });
|
|
947
947
|
},
|
|
948
948
|
children: "Usuń"
|
|
949
949
|
}
|
|
950
950
|
)
|
|
951
|
-
] },
|
|
951
|
+
] }, l.id)),
|
|
952
952
|
/* @__PURE__ */ e(
|
|
953
953
|
"button",
|
|
954
954
|
{
|
|
955
955
|
className: t.addBtn,
|
|
956
|
-
onClick: () =>
|
|
956
|
+
onClick: () => y({
|
|
957
957
|
watermarks: [
|
|
958
|
-
...
|
|
958
|
+
...r.watermarks ?? [],
|
|
959
959
|
{
|
|
960
960
|
id: se(),
|
|
961
961
|
type: "text",
|
|
@@ -975,19 +975,19 @@ const Dn = ({
|
|
|
975
975
|
a === "signatures" && /* @__PURE__ */ s(Y, { children: [
|
|
976
976
|
/* @__PURE__ */ e("div", { className: t.panelHeader, children: "Podpisy" }),
|
|
977
977
|
/* @__PURE__ */ s("div", { className: t.wmList, children: [
|
|
978
|
-
(
|
|
978
|
+
(r.signatures ?? []).map((l) => /* @__PURE__ */ s("div", { className: t.wmItem, children: [
|
|
979
979
|
/* @__PURE__ */ s("div", { className: t.wmRow, children: [
|
|
980
980
|
/* @__PURE__ */ e("span", { className: t.wmLabel, children: "Etykieta" }),
|
|
981
981
|
/* @__PURE__ */ e(
|
|
982
982
|
"input",
|
|
983
983
|
{
|
|
984
984
|
className: t.wmInput,
|
|
985
|
-
value:
|
|
985
|
+
value: l.label,
|
|
986
986
|
onChange: (n) => {
|
|
987
987
|
var u;
|
|
988
|
-
return
|
|
989
|
-
signatures: (u =
|
|
990
|
-
(m) => m.id ===
|
|
988
|
+
return y({
|
|
989
|
+
signatures: (u = r.signatures) == null ? void 0 : u.map(
|
|
990
|
+
(m) => m.id === l.id ? { ...m, label: n.target.value } : m
|
|
991
991
|
)
|
|
992
992
|
});
|
|
993
993
|
}
|
|
@@ -1000,12 +1000,12 @@ const Dn = ({
|
|
|
1000
1000
|
"input",
|
|
1001
1001
|
{
|
|
1002
1002
|
className: t.wmInput,
|
|
1003
|
-
value:
|
|
1003
|
+
value: l.signerName ?? "",
|
|
1004
1004
|
onChange: (n) => {
|
|
1005
1005
|
var u;
|
|
1006
|
-
return
|
|
1007
|
-
signatures: (u =
|
|
1008
|
-
(m) => m.id ===
|
|
1006
|
+
return y({
|
|
1007
|
+
signatures: (u = r.signatures) == null ? void 0 : u.map(
|
|
1008
|
+
(m) => m.id === l.id ? { ...m, signerName: n.target.value } : m
|
|
1009
1009
|
)
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
@@ -1018,12 +1018,12 @@ const Dn = ({
|
|
|
1018
1018
|
"input",
|
|
1019
1019
|
{
|
|
1020
1020
|
type: "checkbox",
|
|
1021
|
-
checked:
|
|
1021
|
+
checked: l.showLine ?? !0,
|
|
1022
1022
|
onChange: (n) => {
|
|
1023
1023
|
var u;
|
|
1024
|
-
return
|
|
1025
|
-
signatures: (u =
|
|
1026
|
-
(m) => m.id ===
|
|
1024
|
+
return y({
|
|
1025
|
+
signatures: (u = r.signatures) == null ? void 0 : u.map(
|
|
1026
|
+
(m) => m.id === l.id ? { ...m, showLine: n.target.checked } : m
|
|
1027
1027
|
)
|
|
1028
1028
|
});
|
|
1029
1029
|
}
|
|
@@ -1036,12 +1036,12 @@ const Dn = ({
|
|
|
1036
1036
|
"input",
|
|
1037
1037
|
{
|
|
1038
1038
|
type: "checkbox",
|
|
1039
|
-
checked:
|
|
1039
|
+
checked: l.showDate ?? !1,
|
|
1040
1040
|
onChange: (n) => {
|
|
1041
1041
|
var u;
|
|
1042
|
-
return
|
|
1043
|
-
signatures: (u =
|
|
1044
|
-
(m) => m.id ===
|
|
1042
|
+
return y({
|
|
1043
|
+
signatures: (u = r.signatures) == null ? void 0 : u.map(
|
|
1044
|
+
(m) => m.id === l.id ? { ...m, showDate: n.target.checked } : m
|
|
1045
1045
|
)
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
@@ -1054,19 +1054,19 @@ const Dn = ({
|
|
|
1054
1054
|
className: t.wmDelete,
|
|
1055
1055
|
onClick: () => {
|
|
1056
1056
|
var n;
|
|
1057
|
-
return
|
|
1057
|
+
return y({ signatures: (n = r.signatures) == null ? void 0 : n.filter((u) => u.id !== l.id) });
|
|
1058
1058
|
},
|
|
1059
1059
|
children: "Usuń"
|
|
1060
1060
|
}
|
|
1061
1061
|
)
|
|
1062
|
-
] },
|
|
1062
|
+
] }, l.id)),
|
|
1063
1063
|
/* @__PURE__ */ e(
|
|
1064
1064
|
"button",
|
|
1065
1065
|
{
|
|
1066
1066
|
className: t.addBtn,
|
|
1067
|
-
onClick: () =>
|
|
1067
|
+
onClick: () => y({
|
|
1068
1068
|
signatures: [
|
|
1069
|
-
...
|
|
1069
|
+
...r.signatures ?? [],
|
|
1070
1070
|
{
|
|
1071
1071
|
id: se(),
|
|
1072
1072
|
label: "Podpis",
|
|
@@ -1090,8 +1090,8 @@ const Dn = ({
|
|
|
1090
1090
|
"input",
|
|
1091
1091
|
{
|
|
1092
1092
|
className: t.settingsInput,
|
|
1093
|
-
value:
|
|
1094
|
-
onChange: (
|
|
1093
|
+
value: r.name,
|
|
1094
|
+
onChange: (l) => y({ name: l.target.value })
|
|
1095
1095
|
}
|
|
1096
1096
|
)
|
|
1097
1097
|
] }),
|
|
@@ -1101,8 +1101,8 @@ const Dn = ({
|
|
|
1101
1101
|
"textarea",
|
|
1102
1102
|
{
|
|
1103
1103
|
className: t.settingsTextarea,
|
|
1104
|
-
value:
|
|
1105
|
-
onChange: (
|
|
1104
|
+
value: r.description ?? "",
|
|
1105
|
+
onChange: (l) => y({ description: l.target.value }),
|
|
1106
1106
|
rows: 2
|
|
1107
1107
|
}
|
|
1108
1108
|
)
|
|
@@ -1113,14 +1113,14 @@ const Dn = ({
|
|
|
1113
1113
|
"input",
|
|
1114
1114
|
{
|
|
1115
1115
|
className: t.settingsInput,
|
|
1116
|
-
value:
|
|
1117
|
-
onChange: (
|
|
1116
|
+
value: r.category ?? "",
|
|
1117
|
+
onChange: (l) => y({ category: l.target.value })
|
|
1118
1118
|
}
|
|
1119
1119
|
)
|
|
1120
1120
|
] }),
|
|
1121
1121
|
/* @__PURE__ */ e("div", { className: t.settingsDivider, children: "Marginesy (mm)" }),
|
|
1122
|
-
["top", "right", "bottom", "left"].map((
|
|
1123
|
-
/* @__PURE__ */ e("label", { className: t.settingsLabel, children:
|
|
1122
|
+
["top", "right", "bottom", "left"].map((l) => /* @__PURE__ */ s("div", { className: t.settingsRow, children: [
|
|
1123
|
+
/* @__PURE__ */ e("label", { className: t.settingsLabel, children: l === "top" ? "Góra" : l === "right" ? "Prawo" : l === "bottom" ? "Dół" : "Lewo" }),
|
|
1124
1124
|
/* @__PURE__ */ e(
|
|
1125
1125
|
"input",
|
|
1126
1126
|
{
|
|
@@ -1129,31 +1129,31 @@ const Dn = ({
|
|
|
1129
1129
|
max: 50,
|
|
1130
1130
|
step: 1,
|
|
1131
1131
|
className: t.settingsInputNum,
|
|
1132
|
-
value:
|
|
1133
|
-
onChange: (n) =>
|
|
1132
|
+
value: r.margins[l],
|
|
1133
|
+
onChange: (n) => y({ margins: { ...r.margins, [l]: +n.target.value } })
|
|
1134
1134
|
}
|
|
1135
1135
|
),
|
|
1136
1136
|
/* @__PURE__ */ e("span", { className: t.settingsUnit, children: "mm" })
|
|
1137
|
-
] },
|
|
1137
|
+
] }, l))
|
|
1138
1138
|
] })
|
|
1139
1139
|
] })
|
|
1140
1140
|
] })
|
|
1141
1141
|
] });
|
|
1142
|
-
},
|
|
1142
|
+
}, Pn = ({
|
|
1143
1143
|
field: a,
|
|
1144
1144
|
activeTab: i,
|
|
1145
1145
|
onTabChange: p,
|
|
1146
|
-
onChange:
|
|
1146
|
+
onChange: r,
|
|
1147
1147
|
paperWidthMm: k,
|
|
1148
|
-
paperHeightMm:
|
|
1148
|
+
paperHeightMm: _
|
|
1149
1149
|
}) => {
|
|
1150
|
-
var c,
|
|
1151
|
-
const S =
|
|
1152
|
-
(n) => a &&
|
|
1153
|
-
[a,
|
|
1154
|
-
), b =
|
|
1155
|
-
(n) => a &&
|
|
1156
|
-
[a,
|
|
1150
|
+
var c, D, w, l;
|
|
1151
|
+
const S = T(
|
|
1152
|
+
(n) => a && r({ position: { ...a.position, ...n } }),
|
|
1153
|
+
[a, r]
|
|
1154
|
+
), b = T(
|
|
1155
|
+
(n) => a && r({ style: { ...(a == null ? void 0 : a.style) ?? {}, ...n } }),
|
|
1156
|
+
[a, r]
|
|
1157
1157
|
);
|
|
1158
1158
|
if (!a)
|
|
1159
1159
|
return /* @__PURE__ */ s("div", { className: t.rightPanel, children: [
|
|
@@ -1171,9 +1171,9 @@ const Dn = ({
|
|
|
1171
1171
|
] })
|
|
1172
1172
|
] })
|
|
1173
1173
|
] });
|
|
1174
|
-
const
|
|
1174
|
+
const y = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
|
|
1175
1175
|
a.type
|
|
1176
|
-
),
|
|
1176
|
+
), N = ![
|
|
1177
1177
|
"static_text",
|
|
1178
1178
|
"static_image",
|
|
1179
1179
|
"line",
|
|
@@ -1187,7 +1187,7 @@ const Dn = ({
|
|
|
1187
1187
|
/* @__PURE__ */ e("span", { className: t.panelHeaderIcon, children: ce[a.type] }),
|
|
1188
1188
|
/* @__PURE__ */ e("span", { className: t.panelHeaderName, children: a.name })
|
|
1189
1189
|
] }),
|
|
1190
|
-
/* @__PURE__ */ e("div", { className: t.rightTabs, children:
|
|
1190
|
+
/* @__PURE__ */ e("div", { className: t.rightTabs, children: $n.map((n) => n.id === "data" && !N ? null : /* @__PURE__ */ e(
|
|
1191
1191
|
"button",
|
|
1192
1192
|
{
|
|
1193
1193
|
className: `${t.rightTab} ${i === n.id ? t.rightTabActive : ""}`,
|
|
@@ -1273,7 +1273,7 @@ const Dn = ({
|
|
|
1273
1273
|
] })
|
|
1274
1274
|
] }),
|
|
1275
1275
|
i === "style" && /* @__PURE__ */ s(Y, { children: [
|
|
1276
|
-
|
|
1276
|
+
y && /* @__PURE__ */ s("div", { className: t.styleGroup, children: [
|
|
1277
1277
|
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: "Czcionka" }),
|
|
1278
1278
|
/* @__PURE__ */ s("div", { className: t.styleRow, children: [
|
|
1279
1279
|
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "Rodzina" }),
|
|
@@ -1283,7 +1283,7 @@ const Dn = ({
|
|
|
1283
1283
|
className: t.styleSelectFull,
|
|
1284
1284
|
value: a.style.fontFamily ?? "sans-serif",
|
|
1285
1285
|
onChange: (n) => b({ fontFamily: n.target.value }),
|
|
1286
|
-
children:
|
|
1286
|
+
children: xn.map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
|
|
1287
1287
|
}
|
|
1288
1288
|
)
|
|
1289
1289
|
] }),
|
|
@@ -1512,7 +1512,7 @@ const Dn = ({
|
|
|
1512
1512
|
] })
|
|
1513
1513
|
] })
|
|
1514
1514
|
] }),
|
|
1515
|
-
i === "data" &&
|
|
1515
|
+
i === "data" && N && /* @__PURE__ */ s("div", { className: t.styleGroup, children: [
|
|
1516
1516
|
/* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: "Źródło danych" }),
|
|
1517
1517
|
/* @__PURE__ */ s("div", { className: t.styleRow, children: [
|
|
1518
1518
|
/* @__PURE__ */ e("label", { className: t.styleLabel, children: "Ścieżka" }),
|
|
@@ -1521,7 +1521,7 @@ const Dn = ({
|
|
|
1521
1521
|
{
|
|
1522
1522
|
className: t.styleInputFull,
|
|
1523
1523
|
value: a.dataPath,
|
|
1524
|
-
onChange: (n) =>
|
|
1524
|
+
onChange: (n) => r({ dataPath: n.target.value }),
|
|
1525
1525
|
placeholder: "np. invoice.number"
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
@@ -1533,7 +1533,7 @@ const Dn = ({
|
|
|
1533
1533
|
{
|
|
1534
1534
|
className: t.styleInputFull,
|
|
1535
1535
|
value: a.format ?? "",
|
|
1536
|
-
onChange: (n) =>
|
|
1536
|
+
onChange: (n) => r({ format: n.target.value }),
|
|
1537
1537
|
placeholder: "DD.MM.YYYY / #,##0.00"
|
|
1538
1538
|
}
|
|
1539
1539
|
)
|
|
@@ -1545,7 +1545,7 @@ const Dn = ({
|
|
|
1545
1545
|
{
|
|
1546
1546
|
className: t.styleInputFull,
|
|
1547
1547
|
value: a.fallback ?? "",
|
|
1548
|
-
onChange: (n) =>
|
|
1548
|
+
onChange: (n) => r({ fallback: n.target.value }),
|
|
1549
1549
|
placeholder: "Gdy brak wartości"
|
|
1550
1550
|
}
|
|
1551
1551
|
)
|
|
@@ -1557,7 +1557,7 @@ const Dn = ({
|
|
|
1557
1557
|
{
|
|
1558
1558
|
className: t.styleSelectFull,
|
|
1559
1559
|
value: a.type,
|
|
1560
|
-
onChange: (n) =>
|
|
1560
|
+
onChange: (n) => r({ type: n.target.value }),
|
|
1561
1561
|
children: Object.entries(de).map(([n, u]) => /* @__PURE__ */ e("option", { value: n, children: u }, n))
|
|
1562
1562
|
}
|
|
1563
1563
|
)
|
|
@@ -1569,7 +1569,7 @@ const Dn = ({
|
|
|
1569
1569
|
{
|
|
1570
1570
|
className: t.styleSelectFull,
|
|
1571
1571
|
value: a.barcodeType ?? "code128",
|
|
1572
|
-
onChange: (n) =>
|
|
1572
|
+
onChange: (n) => r({ barcodeType: n.target.value }),
|
|
1573
1573
|
children: ["ean13", "ean8", "code128", "code39", "upc", "itf14", "datamatrix"].map((n) => /* @__PURE__ */ e("option", { value: n, children: n.toUpperCase() }, n))
|
|
1574
1574
|
}
|
|
1575
1575
|
)
|
|
@@ -1587,7 +1587,7 @@ const Dn = ({
|
|
|
1587
1587
|
value: ((c = a.conditional) == null ? void 0 : c.field) ?? "",
|
|
1588
1588
|
onChange: (n) => {
|
|
1589
1589
|
var u, m;
|
|
1590
|
-
return
|
|
1590
|
+
return r({
|
|
1591
1591
|
conditional: {
|
|
1592
1592
|
field: n.target.value,
|
|
1593
1593
|
operator: ((u = a.conditional) == null ? void 0 : u.operator) ?? "eq",
|
|
@@ -1605,10 +1605,10 @@ const Dn = ({
|
|
|
1605
1605
|
"select",
|
|
1606
1606
|
{
|
|
1607
1607
|
className: t.styleSelectFull,
|
|
1608
|
-
value: ((
|
|
1608
|
+
value: ((D = a.conditional) == null ? void 0 : D.operator) ?? "eq",
|
|
1609
1609
|
onChange: (n) => {
|
|
1610
1610
|
var u, m;
|
|
1611
|
-
return
|
|
1611
|
+
return r({
|
|
1612
1612
|
conditional: {
|
|
1613
1613
|
field: ((u = a.conditional) == null ? void 0 : u.field) ?? "",
|
|
1614
1614
|
operator: n.target.value,
|
|
@@ -1632,10 +1632,10 @@ const Dn = ({
|
|
|
1632
1632
|
"input",
|
|
1633
1633
|
{
|
|
1634
1634
|
className: t.styleInputFull,
|
|
1635
|
-
value: String(((
|
|
1635
|
+
value: String(((w = a.conditional) == null ? void 0 : w.value) ?? ""),
|
|
1636
1636
|
onChange: (n) => {
|
|
1637
1637
|
var u, m;
|
|
1638
|
-
return
|
|
1638
|
+
return r({
|
|
1639
1639
|
conditional: {
|
|
1640
1640
|
field: ((u = a.conditional) == null ? void 0 : u.field) ?? "",
|
|
1641
1641
|
operator: ((m = a.conditional) == null ? void 0 : m.operator) ?? "eq",
|
|
@@ -1647,11 +1647,11 @@ const Dn = ({
|
|
|
1647
1647
|
}
|
|
1648
1648
|
)
|
|
1649
1649
|
] }),
|
|
1650
|
-
((
|
|
1650
|
+
((l = a.conditional) == null ? void 0 : l.field) && /* @__PURE__ */ e(
|
|
1651
1651
|
"button",
|
|
1652
1652
|
{
|
|
1653
1653
|
className: t.clearConditionalBtn,
|
|
1654
|
-
onClick: () =>
|
|
1654
|
+
onClick: () => r({ conditional: void 0 }),
|
|
1655
1655
|
children: "Wyczyść warunek"
|
|
1656
1656
|
}
|
|
1657
1657
|
)
|
|
@@ -1659,7 +1659,7 @@ const Dn = ({
|
|
|
1659
1659
|
] })
|
|
1660
1660
|
] });
|
|
1661
1661
|
};
|
|
1662
|
-
function
|
|
1662
|
+
function Mn() {
|
|
1663
1663
|
return {
|
|
1664
1664
|
id: `tpl-${Date.now()}`,
|
|
1665
1665
|
name: "Nowy szablon",
|
|
@@ -1676,61 +1676,61 @@ function En() {
|
|
|
1676
1676
|
signatures: []
|
|
1677
1677
|
};
|
|
1678
1678
|
}
|
|
1679
|
-
const
|
|
1679
|
+
const er = ({
|
|
1680
1680
|
template: a,
|
|
1681
1681
|
dataSchema: i,
|
|
1682
1682
|
sampleData: p = [],
|
|
1683
|
-
onChange:
|
|
1683
|
+
onChange: r,
|
|
1684
1684
|
onSave: k,
|
|
1685
|
-
readOnly:
|
|
1685
|
+
readOnly: _ = !1,
|
|
1686
1686
|
className: S,
|
|
1687
1687
|
style: b,
|
|
1688
|
-
theme:
|
|
1688
|
+
theme: y = "light"
|
|
1689
1689
|
}) => {
|
|
1690
|
-
const [{ past:
|
|
1690
|
+
const [{ past: N, present: c, future: D }, w] = We(Cn, {
|
|
1691
1691
|
past: [],
|
|
1692
|
-
present: a ??
|
|
1692
|
+
present: a ?? Mn(),
|
|
1693
1693
|
future: []
|
|
1694
|
-
}), [
|
|
1694
|
+
}), [l, n] = P(/* @__PURE__ */ new Set()), [u, m] = P("sec-body"), [f, z] = P(1), [g, L] = P(0), [C, M] = P("fields"), [H, A] = P("position"), [h, q] = P(!1), [pe, xe] = P(!0), $ = T(
|
|
1695
1695
|
(o) => {
|
|
1696
1696
|
const d = { ...c, ...o };
|
|
1697
|
-
|
|
1697
|
+
w({ type: "UPDATE", payload: d }), r == null || r(d);
|
|
1698
1698
|
},
|
|
1699
|
-
[c,
|
|
1699
|
+
[c, r]
|
|
1700
1700
|
), [Z, me] = oe(() => {
|
|
1701
|
-
const [o, d] =
|
|
1701
|
+
const [o, d] = we[c.paperSize] ?? we.A4;
|
|
1702
1702
|
return c.orientation === "landscape" ? [d, o] : [o, d];
|
|
1703
|
-
}, [c.paperSize, c.orientation]), X = oe(() => c.sections.flatMap((o) => o.fields), [c]),
|
|
1704
|
-
() => X.find((o) =>
|
|
1705
|
-
[X,
|
|
1706
|
-
), ue =
|
|
1703
|
+
}, [c.paperSize, c.orientation]), X = oe(() => c.sections.flatMap((o) => o.fields), [c]), E = oe(
|
|
1704
|
+
() => X.find((o) => l.has(o.id)) ?? null,
|
|
1705
|
+
[X, l]
|
|
1706
|
+
), ue = T(
|
|
1707
1707
|
(o, d) => {
|
|
1708
|
-
|
|
1709
|
-
sections: c.sections.map((
|
|
1710
|
-
...
|
|
1711
|
-
fields:
|
|
1708
|
+
$({
|
|
1709
|
+
sections: c.sections.map((x) => ({
|
|
1710
|
+
...x,
|
|
1711
|
+
fields: x.fields.map(
|
|
1712
1712
|
(B) => B.id === o ? { ...B, ...d, style: { ...B.style, ...d.style ?? {} } } : B
|
|
1713
1713
|
)
|
|
1714
1714
|
}))
|
|
1715
1715
|
});
|
|
1716
1716
|
},
|
|
1717
|
-
[c,
|
|
1718
|
-
),
|
|
1717
|
+
[c, $]
|
|
1718
|
+
), le = T(
|
|
1719
1719
|
(o) => {
|
|
1720
|
-
|
|
1720
|
+
$({
|
|
1721
1721
|
sections: c.sections.map((d) => ({
|
|
1722
1722
|
...d,
|
|
1723
1723
|
fields: d.fields.map(
|
|
1724
|
-
(
|
|
1724
|
+
(x) => l.has(x.id) ? { ...x, ...o, style: { ...x.style, ...o.style ?? {} } } : x
|
|
1725
1725
|
)
|
|
1726
1726
|
}))
|
|
1727
1727
|
});
|
|
1728
1728
|
},
|
|
1729
|
-
[c,
|
|
1730
|
-
), be =
|
|
1729
|
+
[c, l, $]
|
|
1730
|
+
), be = T(
|
|
1731
1731
|
(o, d) => {
|
|
1732
1732
|
if (o === "watermark") {
|
|
1733
|
-
|
|
1733
|
+
$({
|
|
1734
1734
|
watermarks: [
|
|
1735
1735
|
...c.watermarks ?? [],
|
|
1736
1736
|
{
|
|
@@ -1743,11 +1743,11 @@ const el = ({
|
|
|
1743
1743
|
color: "var(--nice-text-muted, #94a3b8)"
|
|
1744
1744
|
}
|
|
1745
1745
|
]
|
|
1746
|
-
}),
|
|
1746
|
+
}), M("watermarks");
|
|
1747
1747
|
return;
|
|
1748
1748
|
}
|
|
1749
1749
|
if (o === "signature") {
|
|
1750
|
-
|
|
1750
|
+
$({
|
|
1751
1751
|
signatures: [
|
|
1752
1752
|
...c.signatures ?? [],
|
|
1753
1753
|
{
|
|
@@ -1758,87 +1758,87 @@ const el = ({
|
|
|
1758
1758
|
showDate: !1
|
|
1759
1759
|
}
|
|
1760
1760
|
]
|
|
1761
|
-
}),
|
|
1761
|
+
}), M("signatures");
|
|
1762
1762
|
return;
|
|
1763
1763
|
}
|
|
1764
|
-
const
|
|
1765
|
-
if (!
|
|
1764
|
+
const x = c.sections.find((G) => G.id === u) ?? c.sections.find((G) => G.type === "body");
|
|
1765
|
+
if (!x)
|
|
1766
1766
|
return;
|
|
1767
|
-
const B = ke(o, d),
|
|
1767
|
+
const B = ke(o, d), R = {
|
|
1768
1768
|
sections: c.sections.map(
|
|
1769
|
-
(
|
|
1769
|
+
(G) => G.id === x.id ? { ...G, fields: [...G.fields, B] } : G
|
|
1770
1770
|
)
|
|
1771
1771
|
};
|
|
1772
|
-
|
|
1772
|
+
w({ type: "UPDATE", payload: { ...c, ...R } }), r == null || r({ ...c, ...R }), n(/* @__PURE__ */ new Set([B.id]));
|
|
1773
1773
|
},
|
|
1774
|
-
[c, u,
|
|
1775
|
-
),
|
|
1776
|
-
(o, d,
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1774
|
+
[c, u, r]
|
|
1775
|
+
), Ce = T(
|
|
1776
|
+
(o, d, x, B) => {
|
|
1777
|
+
const R = i == null ? void 0 : i.fields.find((O) => O.path === d), G = ke((R == null ? void 0 : R.type) ?? "text", R);
|
|
1778
|
+
G.position.x = Math.round(x * 2) / 2, G.position.y = Math.round(B * 2) / 2;
|
|
1779
1779
|
const J = {
|
|
1780
1780
|
sections: c.sections.map(
|
|
1781
|
-
(O) => O.id === o ? { ...O, fields: [...O.fields,
|
|
1781
|
+
(O) => O.id === o ? { ...O, fields: [...O.fields, G] } : O
|
|
1782
1782
|
)
|
|
1783
1783
|
};
|
|
1784
|
-
|
|
1784
|
+
w({ type: "UPDATE", payload: { ...c, ...J } }), r == null || r({ ...c, ...J }), n(/* @__PURE__ */ new Set([G.id]));
|
|
1785
1785
|
},
|
|
1786
|
-
[c, i,
|
|
1787
|
-
),
|
|
1788
|
-
d.ctrlKey || d.metaKey ? n((
|
|
1789
|
-
const B = new Set(
|
|
1786
|
+
[c, i, r]
|
|
1787
|
+
), Ie = T((o, d) => {
|
|
1788
|
+
d.ctrlKey || d.metaKey ? n((x) => {
|
|
1789
|
+
const B = new Set(x);
|
|
1790
1790
|
return B.has(o) ? B.delete(o) : B.add(o), B;
|
|
1791
|
-
}) : d.shiftKey ? n((
|
|
1792
|
-
}, []),
|
|
1791
|
+
}) : d.shiftKey ? n((x) => /* @__PURE__ */ new Set([...x, o])) : n(/* @__PURE__ */ new Set([o]));
|
|
1792
|
+
}, []), Le = T(
|
|
1793
1793
|
(o, d) => {
|
|
1794
|
-
if (
|
|
1794
|
+
if (_)
|
|
1795
1795
|
return;
|
|
1796
|
-
d.preventDefault(),
|
|
1797
|
-
const
|
|
1796
|
+
d.preventDefault(), l.has(o) || n(/* @__PURE__ */ new Set([o]));
|
|
1797
|
+
const x = d.clientX, B = d.clientY, R = c.sections.map((O) => ({
|
|
1798
1798
|
id: O.id,
|
|
1799
1799
|
fields: O.fields.map((Q) => ({ id: Q.id, pos: { ...Q.position } }))
|
|
1800
|
-
})),
|
|
1801
|
-
const Q = (O.clientX -
|
|
1802
|
-
const K =
|
|
1800
|
+
})), G = (O) => {
|
|
1801
|
+
const Q = (O.clientX - x) / (f * F), te = (O.clientY - B) / (f * F), re = l.has(o) ? l : /* @__PURE__ */ new Set([o]), ie = c.sections.map((ee) => {
|
|
1802
|
+
const K = R.find((U) => U.id === ee.id);
|
|
1803
1803
|
return {
|
|
1804
1804
|
...ee,
|
|
1805
1805
|
fields: ee.fields.map((U) => {
|
|
1806
|
-
var
|
|
1807
|
-
if (!
|
|
1806
|
+
var Ne;
|
|
1807
|
+
if (!re.has(U.id))
|
|
1808
1808
|
return U;
|
|
1809
|
-
const
|
|
1809
|
+
const ve = ((Ne = K == null ? void 0 : K.fields.find((Ge) => Ge.id === U.id)) == null ? void 0 : Ne.pos) ?? U.position;
|
|
1810
1810
|
return {
|
|
1811
1811
|
...U,
|
|
1812
1812
|
position: {
|
|
1813
1813
|
...U.position,
|
|
1814
|
-
x: Math.max(0, Math.round((
|
|
1815
|
-
y: Math.max(0, Math.round((
|
|
1814
|
+
x: Math.max(0, Math.round((ve.x + Q) * 2) / 2),
|
|
1815
|
+
y: Math.max(0, Math.round((ve.y + te) * 2) / 2)
|
|
1816
1816
|
}
|
|
1817
1817
|
};
|
|
1818
1818
|
})
|
|
1819
1819
|
};
|
|
1820
1820
|
}), ae = { ...c, sections: ie };
|
|
1821
|
-
|
|
1821
|
+
r == null || r(ae), w({ type: "UPDATE", payload: ae });
|
|
1822
1822
|
}, J = () => {
|
|
1823
|
-
document.removeEventListener("mousemove",
|
|
1823
|
+
document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", J);
|
|
1824
1824
|
};
|
|
1825
|
-
document.addEventListener("mousemove",
|
|
1825
|
+
document.addEventListener("mousemove", G), document.addEventListener("mouseup", J);
|
|
1826
1826
|
},
|
|
1827
|
-
[c, f,
|
|
1828
|
-
),
|
|
1829
|
-
(o, d,
|
|
1830
|
-
if (
|
|
1827
|
+
[c, f, l, _, r]
|
|
1828
|
+
), je = T(
|
|
1829
|
+
(o, d, x) => {
|
|
1830
|
+
if (_)
|
|
1831
1831
|
return;
|
|
1832
|
-
|
|
1832
|
+
x.preventDefault();
|
|
1833
1833
|
const B = X.find((te) => te.id === o);
|
|
1834
1834
|
if (!B)
|
|
1835
1835
|
return;
|
|
1836
|
-
const
|
|
1837
|
-
const
|
|
1838
|
-
let { x: ae, y: ee, width: K, height: U } =
|
|
1839
|
-
d.includes("e") && (K = Math.max(5, K +
|
|
1836
|
+
const R = { ...B.position }, G = x.clientX, J = x.clientY, O = (te) => {
|
|
1837
|
+
const re = (te.clientX - G) / (f * F), ie = (te.clientY - J) / (f * F);
|
|
1838
|
+
let { x: ae, y: ee, width: K, height: U } = R;
|
|
1839
|
+
d.includes("e") && (K = Math.max(5, K + re)), d.includes("s") && (U = Math.max(3, U + ie)), d.includes("w") && (ae = ae + re, K = Math.max(5, K - re)), d.includes("n") && (ee = ee + ie, U = Math.max(3, U - ie)), ue(o, {
|
|
1840
1840
|
position: {
|
|
1841
|
-
...
|
|
1841
|
+
...R,
|
|
1842
1842
|
x: Math.round(ae * 2) / 2,
|
|
1843
1843
|
y: Math.round(ee * 2) / 2,
|
|
1844
1844
|
width: Math.round(K * 2) / 2,
|
|
@@ -1850,90 +1850,90 @@ const el = ({
|
|
|
1850
1850
|
};
|
|
1851
1851
|
document.addEventListener("mousemove", O), document.addEventListener("mouseup", Q);
|
|
1852
1852
|
},
|
|
1853
|
-
[X, f,
|
|
1854
|
-
),
|
|
1855
|
-
|
|
1853
|
+
[X, f, _, ue]
|
|
1854
|
+
), _e = T(() => {
|
|
1855
|
+
$({
|
|
1856
1856
|
sections: c.sections.map((o) => ({
|
|
1857
1857
|
...o,
|
|
1858
|
-
fields: o.fields.filter((d) => !
|
|
1858
|
+
fields: o.fields.filter((d) => !l.has(d.id))
|
|
1859
1859
|
}))
|
|
1860
1860
|
}), n(/* @__PURE__ */ new Set());
|
|
1861
|
-
}, [c,
|
|
1861
|
+
}, [c, l, $]), he = T(() => {
|
|
1862
1862
|
const o = /* @__PURE__ */ new Set();
|
|
1863
|
-
|
|
1863
|
+
$({
|
|
1864
1864
|
sections: c.sections.map((d) => {
|
|
1865
|
-
const
|
|
1866
|
-
const
|
|
1865
|
+
const x = d.fields.filter((B) => l.has(B.id)).map((B) => {
|
|
1866
|
+
const R = {
|
|
1867
1867
|
...B,
|
|
1868
1868
|
id: se(),
|
|
1869
1869
|
position: { ...B.position, x: B.position.x + 5, y: B.position.y + 5 }
|
|
1870
1870
|
};
|
|
1871
|
-
return o.add(
|
|
1871
|
+
return o.add(R.id), R;
|
|
1872
1872
|
});
|
|
1873
|
-
return { ...d, fields: [...d.fields, ...
|
|
1873
|
+
return { ...d, fields: [...d.fields, ...x] };
|
|
1874
1874
|
})
|
|
1875
1875
|
}), n(o);
|
|
1876
|
-
}, [c,
|
|
1876
|
+
}, [c, l, $]), ze = T(
|
|
1877
1877
|
(o) => {
|
|
1878
|
-
|
|
1878
|
+
$({
|
|
1879
1879
|
sections: c.sections.map((d) => ({
|
|
1880
1880
|
...d,
|
|
1881
|
-
fields: d.fields.map((
|
|
1882
|
-
if (!
|
|
1883
|
-
return
|
|
1884
|
-
const B = o === "left" ? c.margins.left : o === "right" ? Z - c.margins.right -
|
|
1885
|
-
return { ...
|
|
1881
|
+
fields: d.fields.map((x) => {
|
|
1882
|
+
if (!l.has(x.id))
|
|
1883
|
+
return x;
|
|
1884
|
+
const B = o === "left" ? c.margins.left : o === "right" ? Z - c.margins.right - x.position.width : (Z - x.position.width) / 2;
|
|
1885
|
+
return { ...x, position: { ...x.position, x: B } };
|
|
1886
1886
|
})
|
|
1887
1887
|
}))
|
|
1888
1888
|
});
|
|
1889
1889
|
},
|
|
1890
|
-
[c,
|
|
1891
|
-
),
|
|
1890
|
+
[c, l, Z, $]
|
|
1891
|
+
), De = T(
|
|
1892
1892
|
(o) => {
|
|
1893
1893
|
const d = c.sections.find((B) => B.id === u);
|
|
1894
1894
|
if (!d)
|
|
1895
1895
|
return;
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1896
|
+
const x = d.heightMm ?? 200;
|
|
1897
|
+
$({
|
|
1898
1898
|
sections: c.sections.map((B) => B.id !== u ? B : {
|
|
1899
1899
|
...B,
|
|
1900
|
-
fields: B.fields.map((
|
|
1901
|
-
if (!
|
|
1902
|
-
return
|
|
1903
|
-
const
|
|
1904
|
-
return { ...
|
|
1900
|
+
fields: B.fields.map((R) => {
|
|
1901
|
+
if (!l.has(R.id))
|
|
1902
|
+
return R;
|
|
1903
|
+
const G = o === "top" ? 0 : o === "bottom" ? x - R.position.height : (x - R.position.height) / 2;
|
|
1904
|
+
return { ...R, position: { ...R.position, y: G } };
|
|
1905
1905
|
})
|
|
1906
1906
|
})
|
|
1907
1907
|
});
|
|
1908
1908
|
},
|
|
1909
|
-
[c,
|
|
1910
|
-
),
|
|
1911
|
-
|
|
1909
|
+
[c, l, u, $]
|
|
1910
|
+
), Te = T(() => {
|
|
1911
|
+
$({
|
|
1912
1912
|
sections: c.sections.map((o) => ({
|
|
1913
1913
|
...o,
|
|
1914
1914
|
fields: o.fields.map(
|
|
1915
|
-
(d) =>
|
|
1915
|
+
(d) => l.has(d.id) ? { ...d, position: { ...d.position, zIndex: (d.position.zIndex ?? 1) + 1 } } : d
|
|
1916
1916
|
)
|
|
1917
1917
|
}))
|
|
1918
1918
|
});
|
|
1919
|
-
}, [c,
|
|
1920
|
-
|
|
1919
|
+
}, [c, l, $]), $e = T(() => {
|
|
1920
|
+
$({
|
|
1921
1921
|
sections: c.sections.map((o) => ({
|
|
1922
1922
|
...o,
|
|
1923
1923
|
fields: o.fields.map(
|
|
1924
|
-
(d) =>
|
|
1924
|
+
(d) => l.has(d.id) ? {
|
|
1925
1925
|
...d,
|
|
1926
1926
|
position: { ...d.position, zIndex: Math.max(1, (d.position.zIndex ?? 1) - 1) }
|
|
1927
1927
|
} : d
|
|
1928
1928
|
)
|
|
1929
1929
|
}))
|
|
1930
1930
|
});
|
|
1931
|
-
}, [c,
|
|
1931
|
+
}, [c, l, $]), Re = T(
|
|
1932
1932
|
(o, d) => {
|
|
1933
|
-
|
|
1934
|
-
sections: c.sections.map((
|
|
1935
|
-
...
|
|
1936
|
-
fields:
|
|
1933
|
+
$({
|
|
1934
|
+
sections: c.sections.map((x) => ({
|
|
1935
|
+
...x,
|
|
1936
|
+
fields: x.fields.map(
|
|
1937
1937
|
(B) => B.id === o ? {
|
|
1938
1938
|
...B,
|
|
1939
1939
|
position: {
|
|
@@ -1945,94 +1945,94 @@ const el = ({
|
|
|
1945
1945
|
}))
|
|
1946
1946
|
});
|
|
1947
1947
|
},
|
|
1948
|
-
[c,
|
|
1948
|
+
[c, $]
|
|
1949
1949
|
);
|
|
1950
|
-
|
|
1950
|
+
ge(() => {
|
|
1951
1951
|
const o = (d) => {
|
|
1952
|
-
const
|
|
1953
|
-
if (
|
|
1952
|
+
const x = d.target.tagName;
|
|
1953
|
+
if (x === "INPUT" || x === "TEXTAREA" || x === "SELECT")
|
|
1954
1954
|
return;
|
|
1955
1955
|
const B = d.shiftKey ? 5 : 0.5;
|
|
1956
|
-
d.key === "Delete" || d.key === "Backspace" ?
|
|
1957
|
-
position: { ...
|
|
1958
|
-
})) : d.key === "ArrowRight" ? (d.preventDefault(),
|
|
1959
|
-
position: { ...
|
|
1960
|
-
})) : d.key === "ArrowUp" ? (d.preventDefault(),
|
|
1961
|
-
position: { ...
|
|
1962
|
-
})) : d.key === "ArrowDown" && (d.preventDefault(),
|
|
1963
|
-
position: { ...
|
|
1956
|
+
d.key === "Delete" || d.key === "Backspace" ? l.size && (d.preventDefault(), _e()) : d.ctrlKey && d.key === "z" ? (d.preventDefault(), w({ type: "UNDO" })) : d.ctrlKey && (d.key === "y" || d.key === "Y") ? (d.preventDefault(), w({ type: "REDO" })) : d.ctrlKey && (d.key === "d" || d.key === "D") ? (d.preventDefault(), l.size && he()) : d.ctrlKey && d.key === "a" ? (d.preventDefault(), n(new Set(X.map((R) => R.id)))) : d.key === "ArrowLeft" ? (d.preventDefault(), le({
|
|
1957
|
+
position: { ...E.position, x: ((E == null ? void 0 : E.position.x) ?? 0) - B }
|
|
1958
|
+
})) : d.key === "ArrowRight" ? (d.preventDefault(), le({
|
|
1959
|
+
position: { ...E.position, x: ((E == null ? void 0 : E.position.x) ?? 0) + B }
|
|
1960
|
+
})) : d.key === "ArrowUp" ? (d.preventDefault(), le({
|
|
1961
|
+
position: { ...E.position, y: ((E == null ? void 0 : E.position.y) ?? 0) - B }
|
|
1962
|
+
})) : d.key === "ArrowDown" && (d.preventDefault(), le({
|
|
1963
|
+
position: { ...E.position, y: ((E == null ? void 0 : E.position.y) ?? 0) + B }
|
|
1964
1964
|
}));
|
|
1965
1965
|
};
|
|
1966
1966
|
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
1967
|
-
}, [
|
|
1968
|
-
const
|
|
1967
|
+
}, [l, X, E, _e, he, le]);
|
|
1968
|
+
const Ae = T(
|
|
1969
1969
|
(o, d) => {
|
|
1970
|
-
|
|
1970
|
+
$({
|
|
1971
1971
|
sections: c.sections.map(
|
|
1972
|
-
(
|
|
1972
|
+
(x) => x.id === o ? { ...x, heightMm: Math.round(d * 2) / 2 } : x
|
|
1973
1973
|
)
|
|
1974
1974
|
});
|
|
1975
1975
|
},
|
|
1976
|
-
[c,
|
|
1977
|
-
),
|
|
1978
|
-
const o = Array.isArray(p) ? p[
|
|
1976
|
+
[c, $]
|
|
1977
|
+
), Pe = oe(() => {
|
|
1978
|
+
const o = Array.isArray(p) ? p[g] : p;
|
|
1979
1979
|
return o ? "data" in o ? o.data : o : {};
|
|
1980
|
-
}, [p,
|
|
1980
|
+
}, [p, g]), Me = Z * f * F, Ee = me * f * F;
|
|
1981
1981
|
return /* @__PURE__ */ e(
|
|
1982
1982
|
Oe,
|
|
1983
1983
|
{
|
|
1984
1984
|
flush: !0,
|
|
1985
|
-
className: `${t.root} ${
|
|
1985
|
+
className: `${t.root} ${y === "dark" ? t.dark : ""} ${S ?? ""}`,
|
|
1986
1986
|
style: b,
|
|
1987
1987
|
toolbar: /* @__PURE__ */ e(
|
|
1988
|
-
|
|
1988
|
+
Rn,
|
|
1989
1989
|
{
|
|
1990
1990
|
tpl: c,
|
|
1991
1991
|
zoom: f,
|
|
1992
|
-
canUndo:
|
|
1993
|
-
canRedo:
|
|
1994
|
-
showGrid:
|
|
1992
|
+
canUndo: N.length > 0,
|
|
1993
|
+
canRedo: D.length > 0,
|
|
1994
|
+
showGrid: h,
|
|
1995
1995
|
showRulers: pe,
|
|
1996
|
-
readOnly:
|
|
1997
|
-
selectedCount:
|
|
1998
|
-
onPaperChange: (o, d) =>
|
|
1999
|
-
onZoom:
|
|
2000
|
-
onUndo: () =>
|
|
2001
|
-
onRedo: () =>
|
|
1996
|
+
readOnly: _,
|
|
1997
|
+
selectedCount: l.size,
|
|
1998
|
+
onPaperChange: (o, d) => $({ paperSize: o, orientation: d }),
|
|
1999
|
+
onZoom: z,
|
|
2000
|
+
onUndo: () => w({ type: "UNDO" }),
|
|
2001
|
+
onRedo: () => w({ type: "REDO" }),
|
|
2002
2002
|
onToggleGrid: () => q((o) => !o),
|
|
2003
|
-
onToggleRulers: () =>
|
|
2003
|
+
onToggleRulers: () => xe((o) => !o),
|
|
2004
2004
|
onInsert: be,
|
|
2005
|
-
onDelete:
|
|
2006
|
-
onDuplicate:
|
|
2007
|
-
onAlignH:
|
|
2008
|
-
onAlignV:
|
|
2009
|
-
onBringForward:
|
|
2010
|
-
onSendBackward:
|
|
2005
|
+
onDelete: _e,
|
|
2006
|
+
onDuplicate: he,
|
|
2007
|
+
onAlignH: ze,
|
|
2008
|
+
onAlignV: De,
|
|
2009
|
+
onBringForward: Te,
|
|
2010
|
+
onSendBackward: $e,
|
|
2011
2011
|
onSave: k ? () => k(c) : void 0
|
|
2012
2012
|
}
|
|
2013
2013
|
),
|
|
2014
2014
|
sidebar: /* @__PURE__ */ e(
|
|
2015
|
-
|
|
2015
|
+
An,
|
|
2016
2016
|
{
|
|
2017
|
-
activeTab:
|
|
2018
|
-
onTabChange:
|
|
2017
|
+
activeTab: C,
|
|
2018
|
+
onTabChange: M,
|
|
2019
2019
|
schema: i,
|
|
2020
2020
|
tpl: c,
|
|
2021
2021
|
allFields: X,
|
|
2022
|
-
selectedIds:
|
|
2022
|
+
selectedIds: l,
|
|
2023
2023
|
onInsertSchemaField: (o) => be(o.type, o),
|
|
2024
2024
|
onSelectField: (o) => n(/* @__PURE__ */ new Set([o])),
|
|
2025
|
-
onUpdateTpl: (o) =>
|
|
2026
|
-
onReorderField:
|
|
2025
|
+
onUpdateTpl: (o) => $(o),
|
|
2026
|
+
onReorderField: Re
|
|
2027
2027
|
}
|
|
2028
2028
|
),
|
|
2029
2029
|
rightSidebar: /* @__PURE__ */ e(
|
|
2030
|
-
|
|
2030
|
+
Pn,
|
|
2031
2031
|
{
|
|
2032
|
-
field:
|
|
2033
|
-
activeTab:
|
|
2034
|
-
onTabChange:
|
|
2035
|
-
onChange: (o) =>
|
|
2032
|
+
field: E,
|
|
2033
|
+
activeTab: H,
|
|
2034
|
+
onTabChange: A,
|
|
2035
|
+
onChange: (o) => E && ue(E.id, o),
|
|
2036
2036
|
paperWidthMm: Z,
|
|
2037
2037
|
paperHeightMm: me
|
|
2038
2038
|
}
|
|
@@ -2044,8 +2044,8 @@ const el = ({
|
|
|
2044
2044
|
"select",
|
|
2045
2045
|
{
|
|
2046
2046
|
className: t.testDataSelect,
|
|
2047
|
-
value:
|
|
2048
|
-
onChange: (o) =>
|
|
2047
|
+
value: g,
|
|
2048
|
+
onChange: (o) => L(+o.target.value),
|
|
2049
2049
|
children: p.map((o, d) => /* @__PURE__ */ s("option", { value: d, children: [
|
|
2050
2050
|
"Rekord ",
|
|
2051
2051
|
d + 1
|
|
@@ -2058,7 +2058,7 @@ const el = ({
|
|
|
2058
2058
|
/* @__PURE__ */ e(Se, { lengthMm: Z, zoom: f, orientation: "h" }),
|
|
2059
2059
|
/* @__PURE__ */ e(Se, { lengthMm: me, zoom: f, orientation: "v" })
|
|
2060
2060
|
] }),
|
|
2061
|
-
/* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (o) => o.stopPropagation(), children: /* @__PURE__ */ s("div", { className: t.paperShadow, style: { width:
|
|
2061
|
+
/* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (o) => o.stopPropagation(), children: /* @__PURE__ */ s("div", { className: t.paperShadow, style: { width: Me, minHeight: Ee }, children: [
|
|
2062
2062
|
/* @__PURE__ */ e(
|
|
2063
2063
|
"div",
|
|
2064
2064
|
{
|
|
@@ -2086,31 +2086,31 @@ const el = ({
|
|
|
2086
2086
|
o.id
|
|
2087
2087
|
)),
|
|
2088
2088
|
c.sections.map((o) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
2089
|
-
|
|
2089
|
+
Dn,
|
|
2090
2090
|
{
|
|
2091
2091
|
section: o,
|
|
2092
2092
|
zoom: f,
|
|
2093
2093
|
paperWidthMm: Z,
|
|
2094
|
-
selectedIds:
|
|
2095
|
-
sampleData:
|
|
2096
|
-
readOnly:
|
|
2097
|
-
showGrid:
|
|
2098
|
-
onFieldClick:
|
|
2099
|
-
onFieldDragStart:
|
|
2100
|
-
onResizeStart:
|
|
2101
|
-
onSectionHeightChange:
|
|
2102
|
-
onDropField:
|
|
2094
|
+
selectedIds: l,
|
|
2095
|
+
sampleData: Pe,
|
|
2096
|
+
readOnly: _,
|
|
2097
|
+
showGrid: h,
|
|
2098
|
+
onFieldClick: Ie,
|
|
2099
|
+
onFieldDragStart: Le,
|
|
2100
|
+
onResizeStart: je,
|
|
2101
|
+
onSectionHeightChange: Ae,
|
|
2102
|
+
onDropField: Ce
|
|
2103
2103
|
}
|
|
2104
2104
|
) }, o.id))
|
|
2105
2105
|
] }) })
|
|
2106
2106
|
] })
|
|
2107
2107
|
}
|
|
2108
2108
|
);
|
|
2109
|
-
},
|
|
2110
|
-
root:
|
|
2111
|
-
dark:
|
|
2112
|
-
topBar:
|
|
2113
|
-
searchInput:
|
|
2109
|
+
}, En = "_root_85lw2_1", Gn = "_dark_85lw2_25", Hn = "_topBar_85lw2_39", Wn = "_searchInput_85lw2_69", Fn = "_actionBtn_85lw2_111", On = "_categoryRow_85lw2_157", Un = "_catChip_85lw2_187", Yn = "_catChipActive_85lw2_217", qn = "_grid_85lw2_231", Kn = "_card_85lw2_253", Vn = "_cardSelected_85lw2_285", Zn = "_thumbnail_85lw2_307", Xn = "_thumbnailImg_85lw2_321", Jn = "_thumbnailPlaceholder_85lw2_333", Qn = "_paperMini_85lw2_347", es = "_paperLine_85lw2_371", ts = "_cardOverlay_85lw2_385", as = "_overlayBtn_85lw2_405", ns = "_overlayBtnDanger_85lw2_441", ss = "_cardBody_85lw2_481", ls = "_cardName_85lw2_489", rs = "_cardDesc_85lw2_517", is = "_cardMeta_85lw2_539", os = "_cardSize_85lw2_553", cs = "_cardCat_85lw2_569", ds = "_cardTags_85lw2_585", ps = "_cardTag_85lw2_585", ms = "_emptyState_85lw2_617", us = "_emptyIcon_85lw2_639", I = {
|
|
2110
|
+
root: En,
|
|
2111
|
+
dark: Gn,
|
|
2112
|
+
topBar: Hn,
|
|
2113
|
+
searchInput: Wn,
|
|
2114
2114
|
actionBtn: Fn,
|
|
2115
2115
|
categoryRow: On,
|
|
2116
2116
|
catChip: Un,
|
|
@@ -2127,8 +2127,8 @@ const el = ({
|
|
|
2127
2127
|
overlayBtn: as,
|
|
2128
2128
|
overlayBtnDanger: ns,
|
|
2129
2129
|
cardBody: ss,
|
|
2130
|
-
cardName:
|
|
2131
|
-
cardDesc:
|
|
2130
|
+
cardName: ls,
|
|
2131
|
+
cardDesc: rs,
|
|
2132
2132
|
cardMeta: is,
|
|
2133
2133
|
cardSize: os,
|
|
2134
2134
|
cardCat: cs,
|
|
@@ -2136,76 +2136,76 @@ const el = ({
|
|
|
2136
2136
|
cardTag: ps,
|
|
2137
2137
|
emptyState: ms,
|
|
2138
2138
|
emptyIcon: us
|
|
2139
|
-
},
|
|
2140
|
-
function
|
|
2139
|
+
}, _s = ["Faktury", "Raporty", "Etykiety", "Listy", "Umowy", "Inne"];
|
|
2140
|
+
function hs(a) {
|
|
2141
2141
|
return new Promise((i, p) => {
|
|
2142
|
-
const
|
|
2143
|
-
|
|
2144
|
-
var
|
|
2142
|
+
const r = new FileReader();
|
|
2143
|
+
r.onload = (k) => {
|
|
2144
|
+
var _;
|
|
2145
2145
|
try {
|
|
2146
|
-
i(JSON.parse((
|
|
2146
|
+
i(JSON.parse((_ = k.target) == null ? void 0 : _.result));
|
|
2147
2147
|
} catch (S) {
|
|
2148
2148
|
p(S);
|
|
2149
2149
|
}
|
|
2150
|
-
},
|
|
2150
|
+
}, r.readAsText(a);
|
|
2151
2151
|
});
|
|
2152
2152
|
}
|
|
2153
|
-
function
|
|
2154
|
-
const i = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), p = URL.createObjectURL(i),
|
|
2155
|
-
|
|
2153
|
+
function ys(a) {
|
|
2154
|
+
const i = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), p = URL.createObjectURL(i), r = document.createElement("a");
|
|
2155
|
+
r.href = p, r.download = `${a.name.replace(/\s+/g, "_")}.json`, r.click(), URL.revokeObjectURL(p);
|
|
2156
2156
|
}
|
|
2157
|
-
const
|
|
2157
|
+
const tr = ({
|
|
2158
2158
|
templates: a,
|
|
2159
2159
|
selectedId: i,
|
|
2160
2160
|
onSelect: p,
|
|
2161
|
-
onImport:
|
|
2161
|
+
onImport: r,
|
|
2162
2162
|
onExport: k,
|
|
2163
|
-
onDelete:
|
|
2163
|
+
onDelete: _,
|
|
2164
2164
|
onNew: S,
|
|
2165
2165
|
className: b,
|
|
2166
|
-
style:
|
|
2167
|
-
theme:
|
|
2166
|
+
style: y,
|
|
2167
|
+
theme: N = "light"
|
|
2168
2168
|
}) => {
|
|
2169
|
-
const [c,
|
|
2170
|
-
var
|
|
2171
|
-
const
|
|
2172
|
-
if (
|
|
2169
|
+
const [c, D] = P(""), [w, l] = P(null), [n, u] = P(null), m = He.useRef(null), f = async (g) => {
|
|
2170
|
+
var C;
|
|
2171
|
+
const L = (C = g.target.files) == null ? void 0 : C[0];
|
|
2172
|
+
if (L) {
|
|
2173
2173
|
try {
|
|
2174
|
-
const
|
|
2175
|
-
|
|
2174
|
+
const M = await hs(L);
|
|
2175
|
+
r == null || r(M);
|
|
2176
2176
|
} catch {
|
|
2177
2177
|
}
|
|
2178
|
-
|
|
2178
|
+
g.target.value = "";
|
|
2179
2179
|
}
|
|
2180
|
-
},
|
|
2181
|
-
const
|
|
2182
|
-
return
|
|
2180
|
+
}, z = a.filter((g) => {
|
|
2181
|
+
const L = !c || g.name.toLowerCase().includes(c.toLowerCase()) || (g.description ?? "").toLowerCase().includes(c.toLowerCase()) || (g.tags ?? []).some((M) => M.toLowerCase().includes(c.toLowerCase())), C = !w || g.category === w;
|
|
2182
|
+
return L && C;
|
|
2183
2183
|
});
|
|
2184
2184
|
return /* @__PURE__ */ s(
|
|
2185
2185
|
"div",
|
|
2186
2186
|
{
|
|
2187
|
-
className: `${
|
|
2188
|
-
style:
|
|
2187
|
+
className: `${I.root} ${N === "dark" ? I.dark : ""} ${b ?? ""}`,
|
|
2188
|
+
style: y,
|
|
2189
2189
|
children: [
|
|
2190
|
-
/* @__PURE__ */ s("div", { className:
|
|
2190
|
+
/* @__PURE__ */ s("div", { className: I.topBar, children: [
|
|
2191
2191
|
/* @__PURE__ */ e(
|
|
2192
2192
|
"input",
|
|
2193
2193
|
{
|
|
2194
2194
|
type: "search",
|
|
2195
|
-
className:
|
|
2195
|
+
className: I.searchInput,
|
|
2196
2196
|
placeholder: "Szukaj szablonów…",
|
|
2197
2197
|
value: c,
|
|
2198
|
-
onChange: (
|
|
2198
|
+
onChange: (g) => D(g.target.value)
|
|
2199
2199
|
}
|
|
2200
2200
|
),
|
|
2201
|
-
/* @__PURE__ */ e("button", { className:
|
|
2201
|
+
/* @__PURE__ */ e("button", { className: I.actionBtn, onClick: S, title: "Nowy szablon", children: "+ Nowy" }),
|
|
2202
2202
|
/* @__PURE__ */ e(
|
|
2203
2203
|
"button",
|
|
2204
2204
|
{
|
|
2205
|
-
className:
|
|
2205
|
+
className: I.actionBtn,
|
|
2206
2206
|
onClick: () => {
|
|
2207
|
-
var
|
|
2208
|
-
return (
|
|
2207
|
+
var g;
|
|
2208
|
+
return (g = m.current) == null ? void 0 : g.click();
|
|
2209
2209
|
},
|
|
2210
2210
|
title: "Importuj JSON",
|
|
2211
2211
|
children: "⬆ Import"
|
|
@@ -2213,83 +2213,83 @@ const tl = ({
|
|
|
2213
2213
|
),
|
|
2214
2214
|
/* @__PURE__ */ e("input", { ref: m, type: "file", accept: ".json", hidden: !0, onChange: f })
|
|
2215
2215
|
] }),
|
|
2216
|
-
/* @__PURE__ */ s("div", { className:
|
|
2216
|
+
/* @__PURE__ */ s("div", { className: I.categoryRow, children: [
|
|
2217
2217
|
/* @__PURE__ */ e(
|
|
2218
2218
|
"button",
|
|
2219
2219
|
{
|
|
2220
|
-
className: `${
|
|
2221
|
-
onClick: () =>
|
|
2220
|
+
className: `${I.catChip} ${w ? "" : I.catChipActive}`,
|
|
2221
|
+
onClick: () => l(null),
|
|
2222
2222
|
children: "Wszystkie"
|
|
2223
2223
|
}
|
|
2224
2224
|
),
|
|
2225
|
-
|
|
2225
|
+
_s.map((g) => /* @__PURE__ */ e(
|
|
2226
2226
|
"button",
|
|
2227
2227
|
{
|
|
2228
|
-
className: `${
|
|
2229
|
-
onClick: () =>
|
|
2230
|
-
children:
|
|
2228
|
+
className: `${I.catChip} ${w === g ? I.catChipActive : ""}`,
|
|
2229
|
+
onClick: () => l((L) => L === g ? null : g),
|
|
2230
|
+
children: g
|
|
2231
2231
|
},
|
|
2232
|
-
|
|
2232
|
+
g
|
|
2233
2233
|
))
|
|
2234
2234
|
] }),
|
|
2235
|
-
/* @__PURE__ */ s("div", { className:
|
|
2236
|
-
|
|
2235
|
+
/* @__PURE__ */ s("div", { className: I.grid, children: [
|
|
2236
|
+
z.map((g) => /* @__PURE__ */ s(
|
|
2237
2237
|
"div",
|
|
2238
2238
|
{
|
|
2239
|
-
className: `${
|
|
2240
|
-
onClick: () => p == null ? void 0 : p(
|
|
2241
|
-
onMouseEnter: () => u(
|
|
2239
|
+
className: `${I.card} ${i === g.id ? I.cardSelected : ""}`,
|
|
2240
|
+
onClick: () => p == null ? void 0 : p(g),
|
|
2241
|
+
onMouseEnter: () => u(g.id),
|
|
2242
2242
|
onMouseLeave: () => u(null),
|
|
2243
2243
|
children: [
|
|
2244
|
-
/* @__PURE__ */ s("div", { className:
|
|
2245
|
-
|
|
2244
|
+
/* @__PURE__ */ s("div", { className: I.thumbnail, children: [
|
|
2245
|
+
g.previewImageUrl ? /* @__PURE__ */ e("img", { src: g.previewImageUrl, alt: g.name, className: I.thumbnailImg }) : /* @__PURE__ */ e("div", { className: I.thumbnailPlaceholder, children: /* @__PURE__ */ s("div", { className: I.paperMini, children: [
|
|
2246
2246
|
/* @__PURE__ */ e(
|
|
2247
2247
|
"div",
|
|
2248
2248
|
{
|
|
2249
|
-
className:
|
|
2249
|
+
className: I.paperLine,
|
|
2250
2250
|
style: { width: "80%" }
|
|
2251
2251
|
}
|
|
2252
2252
|
),
|
|
2253
2253
|
/* @__PURE__ */ e(
|
|
2254
2254
|
"div",
|
|
2255
2255
|
{
|
|
2256
|
-
className:
|
|
2256
|
+
className: I.paperLine,
|
|
2257
2257
|
style: { width: "60%" }
|
|
2258
2258
|
}
|
|
2259
2259
|
),
|
|
2260
2260
|
/* @__PURE__ */ e(
|
|
2261
2261
|
"div",
|
|
2262
2262
|
{
|
|
2263
|
-
className:
|
|
2263
|
+
className: I.paperLine,
|
|
2264
2264
|
style: { width: "90%" }
|
|
2265
2265
|
}
|
|
2266
2266
|
),
|
|
2267
2267
|
/* @__PURE__ */ e(
|
|
2268
2268
|
"div",
|
|
2269
2269
|
{
|
|
2270
|
-
className:
|
|
2270
|
+
className: I.paperLine,
|
|
2271
2271
|
style: { width: "50%" }
|
|
2272
2272
|
}
|
|
2273
2273
|
)
|
|
2274
2274
|
] }) }),
|
|
2275
|
-
n ===
|
|
2275
|
+
n === g.id && /* @__PURE__ */ s("div", { className: I.cardOverlay, children: [
|
|
2276
2276
|
/* @__PURE__ */ e(
|
|
2277
2277
|
"button",
|
|
2278
2278
|
{
|
|
2279
|
-
className:
|
|
2280
|
-
onClick: (
|
|
2281
|
-
|
|
2279
|
+
className: I.overlayBtn,
|
|
2280
|
+
onClick: (L) => {
|
|
2281
|
+
L.stopPropagation(), k == null || k(g), ys(g);
|
|
2282
2282
|
},
|
|
2283
2283
|
title: "Eksportuj",
|
|
2284
2284
|
children: "⬇"
|
|
2285
2285
|
}
|
|
2286
2286
|
),
|
|
2287
|
-
|
|
2287
|
+
_ && /* @__PURE__ */ e(
|
|
2288
2288
|
"button",
|
|
2289
2289
|
{
|
|
2290
|
-
className:
|
|
2291
|
-
onClick: (
|
|
2292
|
-
|
|
2290
|
+
className: I.overlayBtnDanger,
|
|
2291
|
+
onClick: (L) => {
|
|
2292
|
+
L.stopPropagation(), _(g.id);
|
|
2293
2293
|
},
|
|
2294
2294
|
title: "Usuń",
|
|
2295
2295
|
children: "✕"
|
|
@@ -2297,47 +2297,47 @@ const tl = ({
|
|
|
2297
2297
|
)
|
|
2298
2298
|
] })
|
|
2299
2299
|
] }),
|
|
2300
|
-
/* @__PURE__ */ s("div", { className:
|
|
2301
|
-
/* @__PURE__ */ e("div", { className:
|
|
2302
|
-
|
|
2303
|
-
/* @__PURE__ */ s("div", { className:
|
|
2304
|
-
/* @__PURE__ */ s("span", { className:
|
|
2305
|
-
|
|
2300
|
+
/* @__PURE__ */ s("div", { className: I.cardBody, children: [
|
|
2301
|
+
/* @__PURE__ */ e("div", { className: I.cardName, children: g.name }),
|
|
2302
|
+
g.description && /* @__PURE__ */ e("div", { className: I.cardDesc, children: g.description }),
|
|
2303
|
+
/* @__PURE__ */ s("div", { className: I.cardMeta, children: [
|
|
2304
|
+
/* @__PURE__ */ s("span", { className: I.cardSize, children: [
|
|
2305
|
+
g.paperSize,
|
|
2306
2306
|
" ",
|
|
2307
|
-
|
|
2307
|
+
g.orientation === "landscape" ? "↔" : "↕"
|
|
2308
2308
|
] }),
|
|
2309
|
-
|
|
2309
|
+
g.category && /* @__PURE__ */ e("span", { className: I.cardCat, children: g.category })
|
|
2310
2310
|
] }),
|
|
2311
|
-
|
|
2311
|
+
g.tags && g.tags.length > 0 && /* @__PURE__ */ e("div", { className: I.cardTags, children: g.tags.slice(0, 3).map((L) => /* @__PURE__ */ e("span", { className: I.cardTag, children: L }, L)) })
|
|
2312
2312
|
] })
|
|
2313
2313
|
]
|
|
2314
2314
|
},
|
|
2315
|
-
|
|
2315
|
+
g.id
|
|
2316
2316
|
)),
|
|
2317
|
-
|
|
2318
|
-
/* @__PURE__ */ e("span", { className:
|
|
2317
|
+
z.length === 0 && /* @__PURE__ */ s("div", { className: I.emptyState, children: [
|
|
2318
|
+
/* @__PURE__ */ e("span", { className: I.emptyIcon, children: "📄" }),
|
|
2319
2319
|
/* @__PURE__ */ e("span", { children: c ? `Brak wyników dla "${c}"` : "Brak szablonów. Utwórz pierwszy!" })
|
|
2320
2320
|
] })
|
|
2321
2321
|
] })
|
|
2322
2322
|
]
|
|
2323
2323
|
}
|
|
2324
2324
|
);
|
|
2325
|
-
},
|
|
2326
|
-
root:
|
|
2325
|
+
}, gs = "_root_10i1f_1", bs = "_dark_10i1f_19", vs = "_headerBar_10i1f_31", Ns = "_entityNav_10i1f_59", ws = "_navBtn_10i1f_69", fs = "_navLabel_10i1f_103", ks = "_sampleBadge_10i1f_117", Ss = "_zoomBar_10i1f_135", Bs = "_zoomBtn_10i1f_147", xs = "_zoomLabel_10i1f_179", Cs = "_printBtn_10i1f_193", Is = "_canvas_10i1f_223", Ls = "_page_10i1f_243", js = "_watermark_10i1f_269", zs = "_footerBar_10i1f_299", W = {
|
|
2326
|
+
root: gs,
|
|
2327
2327
|
dark: bs,
|
|
2328
|
-
headerBar:
|
|
2329
|
-
entityNav:
|
|
2330
|
-
navBtn:
|
|
2328
|
+
headerBar: vs,
|
|
2329
|
+
entityNav: Ns,
|
|
2330
|
+
navBtn: ws,
|
|
2331
2331
|
navLabel: fs,
|
|
2332
2332
|
sampleBadge: ks,
|
|
2333
2333
|
zoomBar: Ss,
|
|
2334
2334
|
zoomBtn: Bs,
|
|
2335
|
-
zoomLabel:
|
|
2336
|
-
printBtn:
|
|
2337
|
-
canvas:
|
|
2338
|
-
page:
|
|
2339
|
-
watermark:
|
|
2340
|
-
footerBar:
|
|
2335
|
+
zoomLabel: xs,
|
|
2336
|
+
printBtn: Cs,
|
|
2337
|
+
canvas: Is,
|
|
2338
|
+
page: Ls,
|
|
2339
|
+
watermark: js,
|
|
2340
|
+
footerBar: zs
|
|
2341
2341
|
}, V = 3.78, Be = {
|
|
2342
2342
|
A3: [297, 420],
|
|
2343
2343
|
A4: [210, 297],
|
|
@@ -2347,45 +2347,45 @@ const tl = ({
|
|
|
2347
2347
|
Legal: [216, 356],
|
|
2348
2348
|
Tabloid: [279, 432]
|
|
2349
2349
|
};
|
|
2350
|
-
function
|
|
2350
|
+
function Ds(a, i) {
|
|
2351
2351
|
try {
|
|
2352
|
-
return a.split(".").reduce((p,
|
|
2352
|
+
return a.split(".").reduce((p, r) => p && typeof p == "object" ? p[r] : null, i);
|
|
2353
2353
|
} catch {
|
|
2354
2354
|
return null;
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
|
-
function
|
|
2357
|
+
function Ts(a, i, p) {
|
|
2358
2358
|
if (a == null)
|
|
2359
2359
|
return "";
|
|
2360
2360
|
if (i === "date" && p)
|
|
2361
2361
|
try {
|
|
2362
|
-
const
|
|
2362
|
+
const r = new Date(a);
|
|
2363
2363
|
if (p === "DD.MM.YYYY") {
|
|
2364
|
-
const k = String(
|
|
2365
|
-
return `${k}.${
|
|
2364
|
+
const k = String(r.getDate()).padStart(2, "0"), _ = String(r.getMonth() + 1).padStart(2, "0");
|
|
2365
|
+
return `${k}.${_}.${r.getFullYear()}`;
|
|
2366
2366
|
}
|
|
2367
|
-
return
|
|
2367
|
+
return r.toLocaleDateString();
|
|
2368
2368
|
} catch {
|
|
2369
2369
|
return String(a);
|
|
2370
2370
|
}
|
|
2371
2371
|
if (i === "currency" && p) {
|
|
2372
|
-
const
|
|
2373
|
-
if (!isNaN(
|
|
2374
|
-
return `${
|
|
2372
|
+
const r = Number(a);
|
|
2373
|
+
if (!isNaN(r))
|
|
2374
|
+
return `${r.toFixed(2)} ${p}`;
|
|
2375
2375
|
}
|
|
2376
2376
|
return i === "number" && typeof a == "number" ? a.toLocaleString("pl-PL") : String(a);
|
|
2377
2377
|
}
|
|
2378
|
-
const
|
|
2379
|
-
const
|
|
2378
|
+
const $s = ({ field: a, data: i, zoom: p }) => {
|
|
2379
|
+
const r = a.dataPath ? Ds(a.dataPath, i) : null, k = r != null ? Ts(r, a.type, a.format) : a.fallback ?? "", _ = (b) => b * p * V, S = {
|
|
2380
2380
|
position: "absolute",
|
|
2381
|
-
left:
|
|
2382
|
-
top:
|
|
2383
|
-
width:
|
|
2384
|
-
height:
|
|
2381
|
+
left: _(a.position.x),
|
|
2382
|
+
top: _(a.position.y),
|
|
2383
|
+
width: _(a.position.width),
|
|
2384
|
+
height: _(a.position.height),
|
|
2385
2385
|
fontSize: (a.style.fontSize ?? 10) * p,
|
|
2386
2386
|
fontWeight: a.style.fontWeight ?? "normal",
|
|
2387
2387
|
fontStyle: a.style.fontStyle ?? "normal",
|
|
2388
|
-
color: a.style.color ?? "var(--text-primary, #0f172a)",
|
|
2388
|
+
color: a.style.color ?? "var(--nice-text-primary, #0f172a)",
|
|
2389
2389
|
textAlign: a.style.textAlign ?? "left",
|
|
2390
2390
|
backgroundColor: a.style.backgroundColor,
|
|
2391
2391
|
transform: a.style.rotation ? `rotate(${a.style.rotation}deg)` : void 0,
|
|
@@ -2393,7 +2393,7 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2393
2393
|
display: "flex",
|
|
2394
2394
|
alignItems: a.style.verticalAlign === "middle" ? "center" : a.style.verticalAlign === "bottom" ? "flex-end" : "flex-start",
|
|
2395
2395
|
lineHeight: a.style.lineHeight ?? 1.4,
|
|
2396
|
-
padding: a.style.padding ?
|
|
2396
|
+
padding: a.style.padding ? _(a.style.padding) : 0,
|
|
2397
2397
|
boxSizing: "border-box",
|
|
2398
2398
|
borderWidth: a.style.borderWidth,
|
|
2399
2399
|
borderColor: a.style.borderColor,
|
|
@@ -2401,10 +2401,10 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2401
2401
|
borderRadius: a.style.borderRadius,
|
|
2402
2402
|
zIndex: a.position.zIndex ?? 1
|
|
2403
2403
|
};
|
|
2404
|
-
return a.type === "image" &&
|
|
2404
|
+
return a.type === "image" && r ? /* @__PURE__ */ e("div", { style: S, children: /* @__PURE__ */ e(
|
|
2405
2405
|
"img",
|
|
2406
2406
|
{
|
|
2407
|
-
src: String(
|
|
2407
|
+
src: String(r),
|
|
2408
2408
|
alt: "",
|
|
2409
2409
|
style: { width: "100%", height: "100%", objectFit: "contain" }
|
|
2410
2410
|
}
|
|
@@ -2413,8 +2413,8 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2413
2413
|
{
|
|
2414
2414
|
style: {
|
|
2415
2415
|
...S,
|
|
2416
|
-
background: "var(--bg-secondary, #f8fafc)",
|
|
2417
|
-
border: "1px dashed var(--border-color, #e2e8f0)",
|
|
2416
|
+
background: "var(--nice-bg-secondary, #f8fafc)",
|
|
2417
|
+
border: "1px dashed var(--nice-border-color, #e2e8f0)",
|
|
2418
2418
|
alignItems: "center",
|
|
2419
2419
|
justifyContent: "center",
|
|
2420
2420
|
fontSize: 10 * p
|
|
@@ -2430,139 +2430,139 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2430
2430
|
{
|
|
2431
2431
|
style: {
|
|
2432
2432
|
...S,
|
|
2433
|
-
borderBottom: "1px solid var(--text-primary, #0f172a)",
|
|
2433
|
+
borderBottom: "1px solid var(--nice-text-primary, #0f172a)",
|
|
2434
2434
|
alignItems: "flex-end"
|
|
2435
2435
|
},
|
|
2436
|
-
children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * p, color: "var(--text-muted, #94a3b8)" }, children: a.label })
|
|
2436
|
+
children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * p, color: "var(--nice-text-muted, #94a3b8)" }, children: a.label })
|
|
2437
2437
|
}
|
|
2438
2438
|
) : a.type === "line" ? /* @__PURE__ */ e(
|
|
2439
2439
|
"div",
|
|
2440
2440
|
{
|
|
2441
2441
|
style: {
|
|
2442
2442
|
...S,
|
|
2443
|
-
borderBottom: `${a.style.borderWidth ?? 1}px ${a.style.borderStyle ?? "solid"} ${a.style.borderColor ?? "var(--text-primary, #0f172a)"}`
|
|
2443
|
+
borderBottom: `${a.style.borderWidth ?? 1}px ${a.style.borderStyle ?? "solid"} ${a.style.borderColor ?? "var(--nice-text-primary, #0f172a)"}`
|
|
2444
2444
|
}
|
|
2445
2445
|
}
|
|
2446
2446
|
) : /* @__PURE__ */ e("div", { style: S, children: k });
|
|
2447
|
-
},
|
|
2447
|
+
}, Rs = ({ template: a, data: i, zoom: p }) => {
|
|
2448
2448
|
var b;
|
|
2449
|
-
const [
|
|
2450
|
-
const [
|
|
2451
|
-
return a.orientation === "landscape" ? [
|
|
2452
|
-
})(),
|
|
2453
|
-
return /* @__PURE__ */ s("div", { className:
|
|
2449
|
+
const [r, k] = (() => {
|
|
2450
|
+
const [y, N] = Be[a.paperSize] ?? Be.A4;
|
|
2451
|
+
return a.orientation === "landscape" ? [N * V * p, y * V * p] : [y * V * p, N * V * p];
|
|
2452
|
+
})(), _ = a.margins, S = a.sections.flatMap((y) => y.fields);
|
|
2453
|
+
return /* @__PURE__ */ s("div", { className: W.page, style: { width: r, minHeight: k }, children: [
|
|
2454
2454
|
/* @__PURE__ */ e(
|
|
2455
2455
|
"div",
|
|
2456
2456
|
{
|
|
2457
2457
|
style: {
|
|
2458
2458
|
position: "absolute",
|
|
2459
|
-
top:
|
|
2460
|
-
left:
|
|
2461
|
-
right:
|
|
2462
|
-
bottom:
|
|
2459
|
+
top: _.top * p * V,
|
|
2460
|
+
left: _.left * p * V,
|
|
2461
|
+
right: _.right * p * V,
|
|
2462
|
+
bottom: _.bottom * p * V
|
|
2463
2463
|
},
|
|
2464
|
-
children: S.map((
|
|
2464
|
+
children: S.map((y) => /* @__PURE__ */ e($s, { field: y, data: i, zoom: p }, y.id))
|
|
2465
2465
|
}
|
|
2466
2466
|
),
|
|
2467
|
-
(b = a.watermarks) == null ? void 0 : b.map((
|
|
2467
|
+
(b = a.watermarks) == null ? void 0 : b.map((y) => /* @__PURE__ */ e(
|
|
2468
2468
|
"div",
|
|
2469
2469
|
{
|
|
2470
|
-
className:
|
|
2470
|
+
className: W.watermark,
|
|
2471
2471
|
style: {
|
|
2472
|
-
opacity:
|
|
2473
|
-
transform: `rotate(${
|
|
2474
|
-
fontSize: (
|
|
2472
|
+
opacity: y.opacity,
|
|
2473
|
+
transform: `rotate(${y.angle}deg)`,
|
|
2474
|
+
fontSize: (y.fontSize ?? 48) * p
|
|
2475
2475
|
},
|
|
2476
|
-
children:
|
|
2476
|
+
children: y.type === "text" ? y.text : /* @__PURE__ */ e(
|
|
2477
2477
|
"img",
|
|
2478
2478
|
{
|
|
2479
|
-
src:
|
|
2479
|
+
src: y.imageUrl,
|
|
2480
2480
|
alt: "wm",
|
|
2481
2481
|
style: { maxWidth: 200 * p }
|
|
2482
2482
|
}
|
|
2483
2483
|
)
|
|
2484
2484
|
},
|
|
2485
|
-
|
|
2485
|
+
y.id
|
|
2486
2486
|
))
|
|
2487
2487
|
] });
|
|
2488
|
-
},
|
|
2488
|
+
}, ar = ({
|
|
2489
2489
|
template: a,
|
|
2490
2490
|
entities: i = [],
|
|
2491
2491
|
sampleData: p,
|
|
2492
|
-
onPrint:
|
|
2492
|
+
onPrint: r,
|
|
2493
2493
|
className: k,
|
|
2494
|
-
style:
|
|
2494
|
+
style: _,
|
|
2495
2495
|
theme: S = "light",
|
|
2496
2496
|
asPopup: b = !0,
|
|
2497
|
-
open:
|
|
2498
|
-
onClose:
|
|
2497
|
+
open: y,
|
|
2498
|
+
onClose: N
|
|
2499
2499
|
}) => {
|
|
2500
|
-
const { t: c } = Ue(), [
|
|
2501
|
-
f || m(!1),
|
|
2500
|
+
const { t: c } = Ue(), [D, w] = P(0), [l, n] = P(0.8), [u, m] = P(!0), f = y !== void 0, z = f ? y : u, g = () => {
|
|
2501
|
+
f || m(!1), N == null || N();
|
|
2502
2502
|
};
|
|
2503
|
-
|
|
2504
|
-
if (!b || !
|
|
2503
|
+
ge(() => {
|
|
2504
|
+
if (!b || !z)
|
|
2505
2505
|
return;
|
|
2506
|
-
const
|
|
2507
|
-
|
|
2506
|
+
const A = (h) => {
|
|
2507
|
+
h.key === "Escape" && g();
|
|
2508
2508
|
};
|
|
2509
|
-
return document.addEventListener("keydown",
|
|
2510
|
-
document.removeEventListener("keydown",
|
|
2509
|
+
return document.addEventListener("keydown", A), document.body.style.overflow = "hidden", () => {
|
|
2510
|
+
document.removeEventListener("keydown", A), document.body.style.overflow = "";
|
|
2511
2511
|
};
|
|
2512
|
-
}, [b,
|
|
2513
|
-
const
|
|
2514
|
-
if (b && !
|
|
2512
|
+
}, [b, z]);
|
|
2513
|
+
const L = oe(() => i.length > 0 ? i : p ? [p.data] : [{}], [i, p]), C = L[D] ?? {};
|
|
2514
|
+
if (b && !z)
|
|
2515
2515
|
return null;
|
|
2516
|
-
const
|
|
2516
|
+
const M = /* @__PURE__ */ s(
|
|
2517
2517
|
"div",
|
|
2518
2518
|
{
|
|
2519
|
-
className: `${
|
|
2520
|
-
style:
|
|
2519
|
+
className: `${W.root} ${S === "dark" ? W.dark : ""} ${k ?? ""}`,
|
|
2520
|
+
style: _,
|
|
2521
2521
|
children: [
|
|
2522
|
-
/* @__PURE__ */ s("div", { className:
|
|
2523
|
-
/* @__PURE__ */ s("div", { className:
|
|
2524
|
-
|
|
2522
|
+
/* @__PURE__ */ s("div", { className: W.headerBar, children: [
|
|
2523
|
+
/* @__PURE__ */ s("div", { className: W.entityNav, children: [
|
|
2524
|
+
L.length > 1 && /* @__PURE__ */ s(Y, { children: [
|
|
2525
2525
|
/* @__PURE__ */ e(
|
|
2526
2526
|
"button",
|
|
2527
2527
|
{
|
|
2528
|
-
className:
|
|
2529
|
-
disabled:
|
|
2530
|
-
onClick: () =>
|
|
2528
|
+
className: W.navBtn,
|
|
2529
|
+
disabled: D === 0,
|
|
2530
|
+
onClick: () => w((A) => A - 1),
|
|
2531
2531
|
children: "‹"
|
|
2532
2532
|
}
|
|
2533
2533
|
),
|
|
2534
|
-
/* @__PURE__ */ s("span", { className:
|
|
2535
|
-
|
|
2534
|
+
/* @__PURE__ */ s("span", { className: W.navLabel, children: [
|
|
2535
|
+
D + 1,
|
|
2536
2536
|
" / ",
|
|
2537
|
-
|
|
2537
|
+
L.length
|
|
2538
2538
|
] }),
|
|
2539
2539
|
/* @__PURE__ */ e(
|
|
2540
2540
|
"button",
|
|
2541
2541
|
{
|
|
2542
|
-
className:
|
|
2543
|
-
disabled:
|
|
2544
|
-
onClick: () =>
|
|
2542
|
+
className: W.navBtn,
|
|
2543
|
+
disabled: D >= L.length - 1,
|
|
2544
|
+
onClick: () => w((A) => A + 1),
|
|
2545
2545
|
children: "›"
|
|
2546
2546
|
}
|
|
2547
2547
|
)
|
|
2548
2548
|
] }),
|
|
2549
|
-
i.length === 0 && p && /* @__PURE__ */ e("span", { className:
|
|
2549
|
+
i.length === 0 && p && /* @__PURE__ */ e("span", { className: W.sampleBadge, children: "Przykładowe dane" })
|
|
2550
2550
|
] }),
|
|
2551
|
-
/* @__PURE__ */ s("div", { className:
|
|
2552
|
-
/* @__PURE__ */ e("button", { className:
|
|
2553
|
-
/* @__PURE__ */ s("span", { className:
|
|
2554
|
-
Math.round(
|
|
2551
|
+
/* @__PURE__ */ s("div", { className: W.zoomBar, children: [
|
|
2552
|
+
/* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => n((A) => Math.max(0.3, A - 0.1)), children: "−" }),
|
|
2553
|
+
/* @__PURE__ */ s("span", { className: W.zoomLabel, children: [
|
|
2554
|
+
Math.round(l * 100),
|
|
2555
2555
|
"%"
|
|
2556
2556
|
] }),
|
|
2557
|
-
/* @__PURE__ */ e("button", { className:
|
|
2558
|
-
/* @__PURE__ */ e("button", { className:
|
|
2557
|
+
/* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => n((A) => Math.min(2.5, A + 0.1)), children: "+" }),
|
|
2558
|
+
/* @__PURE__ */ e("button", { className: W.zoomBtn, onClick: () => n(0.8), title: "Dopasuj", children: "⊡" })
|
|
2559
2559
|
] }),
|
|
2560
2560
|
/* @__PURE__ */ s("div", { style: { display: "flex", gap: 8 }, children: [
|
|
2561
2561
|
/* @__PURE__ */ e(
|
|
2562
2562
|
"button",
|
|
2563
2563
|
{
|
|
2564
|
-
className:
|
|
2565
|
-
onClick: () =>
|
|
2564
|
+
className: W.printBtn,
|
|
2565
|
+
onClick: () => r == null ? void 0 : r({ copies: 1, printerId: "" }),
|
|
2566
2566
|
children: c("printPreview.print", "Drukuj")
|
|
2567
2567
|
}
|
|
2568
2568
|
),
|
|
@@ -2570,8 +2570,8 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2570
2570
|
"button",
|
|
2571
2571
|
{
|
|
2572
2572
|
type: "button",
|
|
2573
|
-
className:
|
|
2574
|
-
onClick:
|
|
2573
|
+
className: W.zoomBtn,
|
|
2574
|
+
onClick: g,
|
|
2575
2575
|
"aria-label": c("common.close", "Zamknij"),
|
|
2576
2576
|
title: c("common.close", "Zamknij"),
|
|
2577
2577
|
children: "✕"
|
|
@@ -2579,15 +2579,15 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2579
2579
|
)
|
|
2580
2580
|
] })
|
|
2581
2581
|
] }),
|
|
2582
|
-
/* @__PURE__ */ e("div", { className:
|
|
2583
|
-
/* @__PURE__ */ s("div", { className:
|
|
2582
|
+
/* @__PURE__ */ e("div", { className: W.canvas, children: /* @__PURE__ */ e(Rs, { template: a, data: C, zoom: l }) }),
|
|
2583
|
+
/* @__PURE__ */ s("div", { className: W.footerBar, children: [
|
|
2584
2584
|
/* @__PURE__ */ e("span", { children: a.name }),
|
|
2585
2585
|
/* @__PURE__ */ s("span", { children: [
|
|
2586
2586
|
a.paperSize,
|
|
2587
2587
|
" · ",
|
|
2588
2588
|
a.orientation === "portrait" ? "Pion" : "Poziom"
|
|
2589
2589
|
] }),
|
|
2590
|
-
a.sections.reduce((
|
|
2590
|
+
a.sections.reduce((A, h) => A + h.fields.length, 0),
|
|
2591
2591
|
" pól"
|
|
2592
2592
|
] })
|
|
2593
2593
|
]
|
|
@@ -2599,15 +2599,15 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2599
2599
|
style: {
|
|
2600
2600
|
position: "fixed",
|
|
2601
2601
|
inset: 0,
|
|
2602
|
-
background: "color-mix(in srgb, var(--text-primary, #000) 50%, transparent)",
|
|
2602
|
+
background: "color-mix(in srgb, var(--nice-text-primary, #000) 50%, transparent)",
|
|
2603
2603
|
display: "flex",
|
|
2604
2604
|
alignItems: "center",
|
|
2605
2605
|
justifyContent: "center",
|
|
2606
2606
|
zIndex: 1e3,
|
|
2607
2607
|
padding: 24
|
|
2608
2608
|
},
|
|
2609
|
-
onMouseDown: (
|
|
2610
|
-
|
|
2609
|
+
onMouseDown: (A) => {
|
|
2610
|
+
A.target === A.currentTarget && g();
|
|
2611
2611
|
},
|
|
2612
2612
|
role: "presentation",
|
|
2613
2613
|
children: /* @__PURE__ */ e(
|
|
@@ -2616,26 +2616,26 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2616
2616
|
role: "dialog",
|
|
2617
2617
|
"aria-modal": "true",
|
|
2618
2618
|
style: {
|
|
2619
|
-
background: "var(--bg-elevated, var(--bg-primary, #ffffff))",
|
|
2619
|
+
background: "var(--nice-bg-elevated, var(--nice-bg-primary, #ffffff))",
|
|
2620
2620
|
borderRadius: 12,
|
|
2621
|
-
boxShadow: "0 20px 60px color-mix(in srgb, var(--text-primary, #000) 30%, transparent)",
|
|
2621
|
+
boxShadow: "0 20px 60px color-mix(in srgb, var(--nice-text-primary, #000) 30%, transparent)",
|
|
2622
2622
|
maxWidth: "90vw",
|
|
2623
2623
|
maxHeight: "90vh",
|
|
2624
2624
|
overflow: "auto"
|
|
2625
2625
|
},
|
|
2626
|
-
children:
|
|
2626
|
+
children: M
|
|
2627
2627
|
}
|
|
2628
2628
|
)
|
|
2629
2629
|
}
|
|
2630
|
-
), document.body) :
|
|
2631
|
-
},
|
|
2632
|
-
root:
|
|
2633
|
-
dark:
|
|
2634
|
-
statsBar:
|
|
2635
|
-
stat:
|
|
2636
|
-
dot:
|
|
2637
|
-
statPrinting:
|
|
2638
|
-
statQueued:
|
|
2630
|
+
), document.body) : M;
|
|
2631
|
+
}, As = "_root_lsn26_1", Ps = "_dark_lsn26_23", Ms = "_statsBar_lsn26_37", Es = "_stat_lsn26_37", Gs = "_dot_lsn26_75", Hs = "_statPrinting_lsn26_87", Ws = "_statQueued_lsn26_93", Fs = "_statDone_lsn26_99", Os = "_statError_lsn26_105", Us = "_toolbar_lsn26_115", Ys = "_filterTabs_lsn26_139", qs = "_filterTab_lsn26_139", Ks = "_filterTabActive_lsn26_177", Vs = "_filterCount_lsn26_187", Zs = "_bulkActions_lsn26_211", Xs = "_bulkCount_lsn26_223", Js = "_bulkBtn_lsn26_231", Qs = "_bulkBtnRemove_lsn26_255", el = "_jobList_lsn26_273", tl = "_listHeader_lsn26_281", al = "_headerLabel_lsn26_313", nl = "_jobRow_lsn26_323", sl = "_jobRowSelected_lsn26_359", ll = "_jobCheckbox_lsn26_373", rl = "_statusBadge_lsn26_387", il = "_pulse_lsn26_1", ol = "_jobInfo_lsn26_479", cl = "_jobName_lsn26_485", dl = "_jobMeta_lsn26_497", pl = "_jobTime_lsn26_513", ml = "_jobDuration_lsn26_519", ul = "_jobError_lsn26_525", _l = "_progressBar_lsn26_539", hl = "_progressFill_lsn26_553", yl = "_copiesEditor_lsn26_569", gl = "_copiesBtn_lsn26_581", bl = "_copiesValue_lsn26_621", vl = "_jobActions_lsn26_635", Nl = "_actionBtn_lsn26_645", wl = "_removeBtn_lsn26_677", fl = "_emptyState_lsn26_695", v = {
|
|
2632
|
+
root: As,
|
|
2633
|
+
dark: Ps,
|
|
2634
|
+
statsBar: Ms,
|
|
2635
|
+
stat: Es,
|
|
2636
|
+
dot: Gs,
|
|
2637
|
+
statPrinting: Hs,
|
|
2638
|
+
statQueued: Ws,
|
|
2639
2639
|
statDone: Fs,
|
|
2640
2640
|
statError: Os,
|
|
2641
2641
|
toolbar: Us,
|
|
@@ -2647,36 +2647,36 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2647
2647
|
bulkCount: Xs,
|
|
2648
2648
|
bulkBtn: Js,
|
|
2649
2649
|
bulkBtnRemove: Qs,
|
|
2650
|
-
jobList:
|
|
2651
|
-
listHeader:
|
|
2652
|
-
headerLabel:
|
|
2653
|
-
jobRow:
|
|
2654
|
-
jobRowSelected:
|
|
2655
|
-
jobCheckbox:
|
|
2656
|
-
statusBadge:
|
|
2657
|
-
"badge-queued": "_badge-
|
|
2658
|
-
"badge-printing": "_badge-
|
|
2659
|
-
pulse:
|
|
2660
|
-
"badge-done": "_badge-
|
|
2661
|
-
"badge-error": "_badge-
|
|
2662
|
-
"badge-paused": "_badge-
|
|
2663
|
-
"badge-cancelled": "_badge-
|
|
2664
|
-
jobInfo:
|
|
2665
|
-
jobName:
|
|
2666
|
-
jobMeta:
|
|
2667
|
-
jobTime:
|
|
2668
|
-
jobDuration:
|
|
2669
|
-
jobError:
|
|
2670
|
-
progressBar:
|
|
2671
|
-
progressFill:
|
|
2672
|
-
copiesEditor:
|
|
2673
|
-
copiesBtn:
|
|
2674
|
-
copiesValue:
|
|
2675
|
-
jobActions:
|
|
2676
|
-
actionBtn:
|
|
2677
|
-
removeBtn:
|
|
2678
|
-
emptyState:
|
|
2679
|
-
},
|
|
2650
|
+
jobList: el,
|
|
2651
|
+
listHeader: tl,
|
|
2652
|
+
headerLabel: al,
|
|
2653
|
+
jobRow: nl,
|
|
2654
|
+
jobRowSelected: sl,
|
|
2655
|
+
jobCheckbox: ll,
|
|
2656
|
+
statusBadge: rl,
|
|
2657
|
+
"badge-queued": "_badge-queued_lsn26_405",
|
|
2658
|
+
"badge-printing": "_badge-printing_lsn26_413",
|
|
2659
|
+
pulse: il,
|
|
2660
|
+
"badge-done": "_badge-done_lsn26_423",
|
|
2661
|
+
"badge-error": "_badge-error_lsn26_431",
|
|
2662
|
+
"badge-paused": "_badge-paused_lsn26_439",
|
|
2663
|
+
"badge-cancelled": "_badge-cancelled_lsn26_447",
|
|
2664
|
+
jobInfo: ol,
|
|
2665
|
+
jobName: cl,
|
|
2666
|
+
jobMeta: dl,
|
|
2667
|
+
jobTime: pl,
|
|
2668
|
+
jobDuration: ml,
|
|
2669
|
+
jobError: ul,
|
|
2670
|
+
progressBar: _l,
|
|
2671
|
+
progressFill: hl,
|
|
2672
|
+
copiesEditor: yl,
|
|
2673
|
+
copiesBtn: gl,
|
|
2674
|
+
copiesValue: bl,
|
|
2675
|
+
jobActions: vl,
|
|
2676
|
+
actionBtn: Nl,
|
|
2677
|
+
removeBtn: wl,
|
|
2678
|
+
emptyState: fl
|
|
2679
|
+
}, ye = {
|
|
2680
2680
|
queued: "Kolejka",
|
|
2681
2681
|
printing: "Drukowanie",
|
|
2682
2682
|
done: "Wydrukowano",
|
|
@@ -2684,72 +2684,72 @@ const Rs = ({ field: a, data: i, zoom: p }) => {
|
|
|
2684
2684
|
paused: "Wstrzymano",
|
|
2685
2685
|
cancelled: "Anulowano"
|
|
2686
2686
|
};
|
|
2687
|
-
function
|
|
2687
|
+
function kl(a) {
|
|
2688
2688
|
try {
|
|
2689
2689
|
return new Date(a).toLocaleTimeString("pl-PL", { hour: "2-digit", minute: "2-digit" });
|
|
2690
2690
|
} catch {
|
|
2691
2691
|
return a;
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
2694
|
-
function
|
|
2694
|
+
function Sl(a) {
|
|
2695
2695
|
const i = Date.now() - new Date(a).getTime(), p = Math.floor(i / 1e3);
|
|
2696
2696
|
return p < 60 ? `${p}s` : `${Math.floor(p / 60)}m ${p % 60}s`;
|
|
2697
2697
|
}
|
|
2698
|
-
const
|
|
2699
|
-
const i = a.filter((
|
|
2700
|
-
return /* @__PURE__ */ s("div", { className:
|
|
2701
|
-
/* @__PURE__ */ s("span", { className: `${
|
|
2702
|
-
/* @__PURE__ */ e("span", { className:
|
|
2698
|
+
const Bl = ({ jobs: a }) => {
|
|
2699
|
+
const i = a.filter((_) => _.status === "printing").length, p = a.filter((_) => _.status === "queued").length, r = a.filter((_) => _.status === "done").length, k = a.filter((_) => _.status === "error").length;
|
|
2700
|
+
return /* @__PURE__ */ s("div", { className: v.statsBar, children: [
|
|
2701
|
+
/* @__PURE__ */ s("span", { className: `${v.stat} ${v.statPrinting}`, children: [
|
|
2702
|
+
/* @__PURE__ */ e("span", { className: v.dot }),
|
|
2703
2703
|
"Drukuje: ",
|
|
2704
2704
|
/* @__PURE__ */ e("strong", { children: i })
|
|
2705
2705
|
] }),
|
|
2706
|
-
/* @__PURE__ */ s("span", { className: `${
|
|
2707
|
-
/* @__PURE__ */ e("span", { className:
|
|
2706
|
+
/* @__PURE__ */ s("span", { className: `${v.stat} ${v.statQueued}`, children: [
|
|
2707
|
+
/* @__PURE__ */ e("span", { className: v.dot }),
|
|
2708
2708
|
"W kolejce: ",
|
|
2709
2709
|
/* @__PURE__ */ e("strong", { children: p })
|
|
2710
2710
|
] }),
|
|
2711
|
-
/* @__PURE__ */ s("span", { className: `${
|
|
2712
|
-
/* @__PURE__ */ e("span", { className:
|
|
2711
|
+
/* @__PURE__ */ s("span", { className: `${v.stat} ${v.statDone}`, children: [
|
|
2712
|
+
/* @__PURE__ */ e("span", { className: v.dot }),
|
|
2713
2713
|
"Gotowe: ",
|
|
2714
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2714
|
+
/* @__PURE__ */ e("strong", { children: r })
|
|
2715
2715
|
] }),
|
|
2716
|
-
k > 0 && /* @__PURE__ */ s("span", { className: `${
|
|
2717
|
-
/* @__PURE__ */ e("span", { className:
|
|
2716
|
+
k > 0 && /* @__PURE__ */ s("span", { className: `${v.stat} ${v.statError}`, children: [
|
|
2717
|
+
/* @__PURE__ */ e("span", { className: v.dot }),
|
|
2718
2718
|
"Błędy: ",
|
|
2719
2719
|
/* @__PURE__ */ e("strong", { children: k })
|
|
2720
2720
|
] })
|
|
2721
2721
|
] });
|
|
2722
|
-
},
|
|
2722
|
+
}, xl = ({
|
|
2723
2723
|
job: a,
|
|
2724
2724
|
index: i,
|
|
2725
2725
|
total: p,
|
|
2726
|
-
printers:
|
|
2726
|
+
printers: r,
|
|
2727
2727
|
selected: k,
|
|
2728
|
-
onSelect:
|
|
2728
|
+
onSelect: _,
|
|
2729
2729
|
onUpdate: S,
|
|
2730
2730
|
onRemove: b,
|
|
2731
|
-
onPrint:
|
|
2732
|
-
onReorder:
|
|
2731
|
+
onPrint: y,
|
|
2732
|
+
onReorder: N
|
|
2733
2733
|
}) => {
|
|
2734
|
-
const c =
|
|
2734
|
+
const c = r.find((l) => l.id === a.options.printerId), D = i > 0 && a.status === "queued", w = i < p - 1 && a.status === "queued";
|
|
2735
2735
|
return /* @__PURE__ */ s(
|
|
2736
2736
|
"div",
|
|
2737
2737
|
{
|
|
2738
|
-
className: `${
|
|
2738
|
+
className: `${v.jobRow} ${k ? v.jobRowSelected : ""} ${v[`status-${a.status}`] ?? ""}`,
|
|
2739
2739
|
children: [
|
|
2740
2740
|
/* @__PURE__ */ e(
|
|
2741
2741
|
"input",
|
|
2742
2742
|
{
|
|
2743
2743
|
type: "checkbox",
|
|
2744
|
-
className:
|
|
2744
|
+
className: v.jobCheckbox,
|
|
2745
2745
|
checked: k,
|
|
2746
|
-
onChange: () =>
|
|
2746
|
+
onChange: () => _(a.id)
|
|
2747
2747
|
}
|
|
2748
2748
|
),
|
|
2749
|
-
/* @__PURE__ */ e("span", { className: `${
|
|
2750
|
-
/* @__PURE__ */ s("div", { className:
|
|
2751
|
-
/* @__PURE__ */ e("div", { className:
|
|
2752
|
-
/* @__PURE__ */ s("div", { className:
|
|
2749
|
+
/* @__PURE__ */ e("span", { className: `${v.statusBadge} ${v[`badge-${a.status}`]}`, children: ye[a.status] ?? a.status }),
|
|
2750
|
+
/* @__PURE__ */ s("div", { className: v.jobInfo, children: [
|
|
2751
|
+
/* @__PURE__ */ e("div", { className: v.jobName, children: a.templateName ?? a.templateId }),
|
|
2752
|
+
/* @__PURE__ */ s("div", { className: v.jobMeta, children: [
|
|
2753
2753
|
a.entityLabel && /* @__PURE__ */ e("span", { children: a.entityLabel }),
|
|
2754
2754
|
c && /* @__PURE__ */ s("span", { children: [
|
|
2755
2755
|
"🖨 ",
|
|
@@ -2759,56 +2759,56 @@ const Br = ({ jobs: a }) => {
|
|
|
2759
2759
|
"×",
|
|
2760
2760
|
a.options.copies
|
|
2761
2761
|
] }),
|
|
2762
|
-
a.createdAt && /* @__PURE__ */ e("span", { className:
|
|
2763
|
-
a.startedAt && a.status !== "done" && /* @__PURE__ */ e("span", { className:
|
|
2762
|
+
a.createdAt && /* @__PURE__ */ e("span", { className: v.jobTime, children: kl(a.createdAt) }),
|
|
2763
|
+
a.startedAt && a.status !== "done" && /* @__PURE__ */ e("span", { className: v.jobDuration, children: Sl(a.startedAt) })
|
|
2764
2764
|
] }),
|
|
2765
|
-
a.status === "printing" && a.progress != null && /* @__PURE__ */ e("div", { className:
|
|
2766
|
-
a.status === "error" && a.errorMessage && /* @__PURE__ */ e("div", { className:
|
|
2765
|
+
a.status === "printing" && a.progress != null && /* @__PURE__ */ e("div", { className: v.progressBar, children: /* @__PURE__ */ e("div", { className: v.progressFill, style: { width: `${a.progress}%` } }) }),
|
|
2766
|
+
a.status === "error" && a.errorMessage && /* @__PURE__ */ e("div", { className: v.jobError, children: a.errorMessage })
|
|
2767
2767
|
] }),
|
|
2768
|
-
/* @__PURE__ */ s("div", { className:
|
|
2768
|
+
/* @__PURE__ */ s("div", { className: v.copiesEditor, children: [
|
|
2769
2769
|
/* @__PURE__ */ e(
|
|
2770
2770
|
"button",
|
|
2771
2771
|
{
|
|
2772
|
-
className:
|
|
2772
|
+
className: v.copiesBtn,
|
|
2773
2773
|
disabled: a.options.copies <= 1,
|
|
2774
2774
|
onClick: () => S(a.id, { options: { ...a.options, copies: a.options.copies - 1 } }),
|
|
2775
2775
|
children: "−"
|
|
2776
2776
|
}
|
|
2777
2777
|
),
|
|
2778
|
-
/* @__PURE__ */ e("span", { className:
|
|
2778
|
+
/* @__PURE__ */ e("span", { className: v.copiesValue, children: a.options.copies }),
|
|
2779
2779
|
/* @__PURE__ */ e(
|
|
2780
2780
|
"button",
|
|
2781
2781
|
{
|
|
2782
|
-
className:
|
|
2782
|
+
className: v.copiesBtn,
|
|
2783
2783
|
onClick: () => S(a.id, { options: { ...a.options, copies: a.options.copies + 1 } }),
|
|
2784
2784
|
children: "+"
|
|
2785
2785
|
}
|
|
2786
2786
|
)
|
|
2787
2787
|
] }),
|
|
2788
|
-
/* @__PURE__ */ s("div", { className:
|
|
2789
|
-
|
|
2788
|
+
/* @__PURE__ */ s("div", { className: v.jobActions, children: [
|
|
2789
|
+
D && /* @__PURE__ */ e(
|
|
2790
2790
|
"button",
|
|
2791
2791
|
{
|
|
2792
|
-
className:
|
|
2792
|
+
className: v.actionBtn,
|
|
2793
2793
|
title: "Przesuń wyżej",
|
|
2794
|
-
onClick: () =>
|
|
2794
|
+
onClick: () => N(i, i - 1),
|
|
2795
2795
|
children: "↑"
|
|
2796
2796
|
}
|
|
2797
2797
|
),
|
|
2798
|
-
|
|
2798
|
+
w && /* @__PURE__ */ e(
|
|
2799
2799
|
"button",
|
|
2800
2800
|
{
|
|
2801
|
-
className:
|
|
2801
|
+
className: v.actionBtn,
|
|
2802
2802
|
title: "Przesuń niżej",
|
|
2803
|
-
onClick: () =>
|
|
2803
|
+
onClick: () => N(i, i + 1),
|
|
2804
2804
|
children: "↓"
|
|
2805
2805
|
}
|
|
2806
2806
|
),
|
|
2807
|
-
a.status === "queued" && /* @__PURE__ */ e("button", { className:
|
|
2807
|
+
a.status === "queued" && /* @__PURE__ */ e("button", { className: v.actionBtn, title: "Drukuj teraz", onClick: () => y(a.id), children: "▶" }),
|
|
2808
2808
|
a.status === "printing" && /* @__PURE__ */ e(
|
|
2809
2809
|
"button",
|
|
2810
2810
|
{
|
|
2811
|
-
className:
|
|
2811
|
+
className: v.actionBtn,
|
|
2812
2812
|
title: "Wstrzymaj",
|
|
2813
2813
|
onClick: () => S(a.id, { status: "paused" }),
|
|
2814
2814
|
children: "⏸"
|
|
@@ -2817,7 +2817,7 @@ const Br = ({ jobs: a }) => {
|
|
|
2817
2817
|
a.status === "paused" && /* @__PURE__ */ e(
|
|
2818
2818
|
"button",
|
|
2819
2819
|
{
|
|
2820
|
-
className:
|
|
2820
|
+
className: v.actionBtn,
|
|
2821
2821
|
title: "Wznów",
|
|
2822
2822
|
onClick: () => S(a.id, { status: "queued" }),
|
|
2823
2823
|
children: "▶"
|
|
@@ -2826,7 +2826,7 @@ const Br = ({ jobs: a }) => {
|
|
|
2826
2826
|
/* @__PURE__ */ e(
|
|
2827
2827
|
"button",
|
|
2828
2828
|
{
|
|
2829
|
-
className: `${
|
|
2829
|
+
className: `${v.actionBtn} ${v.removeBtn}`,
|
|
2830
2830
|
title: "Usuń",
|
|
2831
2831
|
onClick: () => b(a.id),
|
|
2832
2832
|
children: "✕"
|
|
@@ -2836,251 +2836,251 @@ const Br = ({ jobs: a }) => {
|
|
|
2836
2836
|
]
|
|
2837
2837
|
}
|
|
2838
2838
|
);
|
|
2839
|
-
},
|
|
2839
|
+
}, nr = ({
|
|
2840
2840
|
jobs: a,
|
|
2841
2841
|
printers: i = [],
|
|
2842
2842
|
onJobUpdate: p,
|
|
2843
|
-
onJobRemove:
|
|
2843
|
+
onJobRemove: r,
|
|
2844
2844
|
onJobReorder: k,
|
|
2845
|
-
onJobPrint:
|
|
2845
|
+
onJobPrint: _,
|
|
2846
2846
|
onBulkRemove: S,
|
|
2847
2847
|
onBulkPrint: b,
|
|
2848
|
-
maxHeight:
|
|
2849
|
-
className:
|
|
2848
|
+
maxHeight: y = 500,
|
|
2849
|
+
className: N,
|
|
2850
2850
|
style: c,
|
|
2851
|
-
theme:
|
|
2851
|
+
theme: D = "light"
|
|
2852
2852
|
}) => {
|
|
2853
|
-
const [
|
|
2854
|
-
|
|
2855
|
-
const
|
|
2856
|
-
return
|
|
2853
|
+
const [w, l] = P(/* @__PURE__ */ new Set()), [n, u] = P("all"), m = n === "all" ? a : a.filter((C) => C.status === n), f = T((C) => {
|
|
2854
|
+
l((M) => {
|
|
2855
|
+
const H = new Set(M);
|
|
2856
|
+
return H.has(C) ? H.delete(C) : H.add(C), H;
|
|
2857
2857
|
});
|
|
2858
|
-
}, []),
|
|
2859
|
-
|
|
2860
|
-
}, [m,
|
|
2861
|
-
S == null || S(Array.from(
|
|
2862
|
-
}, [
|
|
2863
|
-
b == null || b(Array.from(
|
|
2864
|
-
}, [
|
|
2858
|
+
}, []), z = T(() => {
|
|
2859
|
+
w.size === m.length ? l(/* @__PURE__ */ new Set()) : l(new Set(m.map((C) => C.id)));
|
|
2860
|
+
}, [m, w.size]), g = T(() => {
|
|
2861
|
+
S == null || S(Array.from(w)), l(/* @__PURE__ */ new Set());
|
|
2862
|
+
}, [w, S]), L = T(() => {
|
|
2863
|
+
b == null || b(Array.from(w)), l(/* @__PURE__ */ new Set());
|
|
2864
|
+
}, [w, b]);
|
|
2865
2865
|
return /* @__PURE__ */ s(
|
|
2866
2866
|
"div",
|
|
2867
2867
|
{
|
|
2868
|
-
className: `${
|
|
2868
|
+
className: `${v.root} ${D === "dark" ? v.dark : ""} ${N ?? ""}`,
|
|
2869
2869
|
style: c,
|
|
2870
2870
|
children: [
|
|
2871
|
-
/* @__PURE__ */ e(
|
|
2872
|
-
/* @__PURE__ */ s("div", { className:
|
|
2873
|
-
/* @__PURE__ */ e("div", { className:
|
|
2871
|
+
/* @__PURE__ */ e(Bl, { jobs: a }),
|
|
2872
|
+
/* @__PURE__ */ s("div", { className: v.toolbar, children: [
|
|
2873
|
+
/* @__PURE__ */ e("div", { className: v.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((C) => /* @__PURE__ */ s(
|
|
2874
2874
|
"button",
|
|
2875
2875
|
{
|
|
2876
|
-
className: `${
|
|
2877
|
-
onClick: () => u(
|
|
2876
|
+
className: `${v.filterTab} ${n === C ? v.filterTabActive : ""}`,
|
|
2877
|
+
onClick: () => u(C),
|
|
2878
2878
|
children: [
|
|
2879
|
-
|
|
2880
|
-
/* @__PURE__ */ e("span", { className:
|
|
2879
|
+
C === "all" ? "Wszystkie" : ye[C],
|
|
2880
|
+
/* @__PURE__ */ e("span", { className: v.filterCount, children: C === "all" ? a.length : a.filter((M) => M.status === C).length })
|
|
2881
2881
|
]
|
|
2882
2882
|
},
|
|
2883
|
-
|
|
2883
|
+
C
|
|
2884
2884
|
)) }),
|
|
2885
|
-
|
|
2886
|
-
/* @__PURE__ */ s("span", { className:
|
|
2887
|
-
|
|
2885
|
+
w.size > 0 && /* @__PURE__ */ s("div", { className: v.bulkActions, children: [
|
|
2886
|
+
/* @__PURE__ */ s("span", { className: v.bulkCount, children: [
|
|
2887
|
+
w.size,
|
|
2888
2888
|
" zaznaczonych"
|
|
2889
2889
|
] }),
|
|
2890
|
-
b && /* @__PURE__ */ e("button", { className:
|
|
2891
|
-
S && /* @__PURE__ */ e("button", { className: `${
|
|
2890
|
+
b && /* @__PURE__ */ e("button", { className: v.bulkBtn, onClick: L, children: "▶ Drukuj wybrane" }),
|
|
2891
|
+
S && /* @__PURE__ */ e("button", { className: `${v.bulkBtn} ${v.bulkBtnRemove}`, onClick: g, children: "✕ Usuń wybrane" })
|
|
2892
2892
|
] })
|
|
2893
2893
|
] }),
|
|
2894
|
-
/* @__PURE__ */ e("div", { className:
|
|
2895
|
-
/* @__PURE__ */ s("div", { className:
|
|
2894
|
+
/* @__PURE__ */ e("div", { className: v.jobList, style: { maxHeight: y }, children: m.length === 0 ? /* @__PURE__ */ e("div", { className: v.emptyState, children: n === "all" ? "Brak zadań w kolejce" : `Brak zadań ze statusem "${ye[n]}"` }) : /* @__PURE__ */ s(Y, { children: [
|
|
2895
|
+
/* @__PURE__ */ s("div", { className: v.listHeader, children: [
|
|
2896
2896
|
/* @__PURE__ */ e(
|
|
2897
2897
|
"input",
|
|
2898
2898
|
{
|
|
2899
2899
|
type: "checkbox",
|
|
2900
|
-
onChange:
|
|
2901
|
-
checked:
|
|
2900
|
+
onChange: z,
|
|
2901
|
+
checked: w.size === m.length && m.length > 0
|
|
2902
2902
|
}
|
|
2903
2903
|
),
|
|
2904
|
-
/* @__PURE__ */ e("span", { className:
|
|
2905
|
-
/* @__PURE__ */ e("span", { className:
|
|
2906
|
-
/* @__PURE__ */ e("span", { className:
|
|
2904
|
+
/* @__PURE__ */ e("span", { className: v.headerLabel, children: "Zadanie" }),
|
|
2905
|
+
/* @__PURE__ */ e("span", { className: v.headerLabel, children: "Kopie" }),
|
|
2906
|
+
/* @__PURE__ */ e("span", { className: v.headerLabel, children: "Akcje" })
|
|
2907
2907
|
] }),
|
|
2908
|
-
m.map((
|
|
2909
|
-
|
|
2908
|
+
m.map((C, M) => /* @__PURE__ */ e(
|
|
2909
|
+
xl,
|
|
2910
2910
|
{
|
|
2911
|
-
job:
|
|
2912
|
-
index: a.indexOf(
|
|
2911
|
+
job: C,
|
|
2912
|
+
index: a.indexOf(C),
|
|
2913
2913
|
total: a.length,
|
|
2914
2914
|
printers: i,
|
|
2915
|
-
selected:
|
|
2915
|
+
selected: w.has(C.id),
|
|
2916
2916
|
onSelect: f,
|
|
2917
2917
|
onUpdate: p,
|
|
2918
|
-
onRemove:
|
|
2919
|
-
onPrint:
|
|
2918
|
+
onRemove: r,
|
|
2919
|
+
onPrint: _,
|
|
2920
2920
|
onReorder: k
|
|
2921
2921
|
},
|
|
2922
|
-
|
|
2922
|
+
C.id
|
|
2923
2923
|
))
|
|
2924
2924
|
] }) })
|
|
2925
2925
|
]
|
|
2926
2926
|
}
|
|
2927
2927
|
);
|
|
2928
|
-
},
|
|
2929
|
-
container:
|
|
2930
|
-
buttonGroup:
|
|
2931
|
-
trigger:
|
|
2932
|
-
triggerDisabled:
|
|
2933
|
-
"variant-primary": "_variant-
|
|
2934
|
-
"variant-secondary": "_variant-
|
|
2935
|
-
"variant-ghost": "_variant-
|
|
2936
|
-
"size-sm": "_size-
|
|
2937
|
-
"size-md": "_size-
|
|
2938
|
-
"size-lg": "_size-
|
|
2939
|
-
mainAction:
|
|
2940
|
-
dropdownToggle:
|
|
2941
|
-
chevron:
|
|
2942
|
-
chevronUp:
|
|
2943
|
-
dropdown:
|
|
2944
|
-
dark:
|
|
2945
|
-
section:
|
|
2946
|
-
sectionLabel:
|
|
2947
|
-
divider:
|
|
2948
|
-
copiesRow:
|
|
2949
|
-
copiesBtn:
|
|
2950
|
-
copiesValue:
|
|
2951
|
-
printerSelect:
|
|
2952
|
-
printerStatus:
|
|
2953
|
-
printerDot:
|
|
2954
|
-
"dot-ready": "_dot-
|
|
2955
|
-
"dot-busy": "_dot-
|
|
2956
|
-
"dot-offline": "_dot-
|
|
2957
|
-
"dot-error": "_dot-
|
|
2958
|
-
printerStatusLabel:
|
|
2959
|
-
submitBtn:
|
|
2960
|
-
spinner:
|
|
2961
|
-
spin:
|
|
2962
|
-
},
|
|
2928
|
+
}, Cl = "_container_yxz96_1", Il = "_buttonGroup_yxz96_19", Ll = "_trigger_yxz96_31", jl = "_triggerDisabled_yxz96_57", zl = "_mainAction_yxz96_151", Dl = "_dropdownToggle_yxz96_175", Tl = "_chevron_yxz96_201", $l = "_chevronUp_yxz96_211", Rl = "_dropdown_yxz96_175", Al = "_dark_yxz96_245", Pl = "_section_yxz96_257", Ml = "_sectionLabel_yxz96_263", El = "_divider_yxz96_283", Gl = "_copiesRow_yxz96_301", Hl = "_copiesBtn_yxz96_311", Wl = "_copiesValue_yxz96_351", Fl = "_printerSelect_yxz96_375", Ol = "_printerStatus_yxz96_415", Ul = "_printerDot_yxz96_429", Yl = "_printerStatusLabel_yxz96_463", ql = "_submitBtn_yxz96_473", Kl = "_spinner_yxz96_515", Vl = "_spin_yxz96_515", j = {
|
|
2929
|
+
container: Cl,
|
|
2930
|
+
buttonGroup: Il,
|
|
2931
|
+
trigger: Ll,
|
|
2932
|
+
triggerDisabled: jl,
|
|
2933
|
+
"variant-primary": "_variant-primary_yxz96_69",
|
|
2934
|
+
"variant-secondary": "_variant-secondary_yxz96_83",
|
|
2935
|
+
"variant-ghost": "_variant-ghost_yxz96_99",
|
|
2936
|
+
"size-sm": "_size-sm_yxz96_117",
|
|
2937
|
+
"size-md": "_size-md_yxz96_127",
|
|
2938
|
+
"size-lg": "_size-lg_yxz96_137",
|
|
2939
|
+
mainAction: zl,
|
|
2940
|
+
dropdownToggle: Dl,
|
|
2941
|
+
chevron: Tl,
|
|
2942
|
+
chevronUp: $l,
|
|
2943
|
+
dropdown: Rl,
|
|
2944
|
+
dark: Al,
|
|
2945
|
+
section: Pl,
|
|
2946
|
+
sectionLabel: Ml,
|
|
2947
|
+
divider: El,
|
|
2948
|
+
copiesRow: Gl,
|
|
2949
|
+
copiesBtn: Hl,
|
|
2950
|
+
copiesValue: Wl,
|
|
2951
|
+
printerSelect: Fl,
|
|
2952
|
+
printerStatus: Ol,
|
|
2953
|
+
printerDot: Ul,
|
|
2954
|
+
"dot-ready": "_dot-ready_yxz96_439",
|
|
2955
|
+
"dot-busy": "_dot-busy_yxz96_445",
|
|
2956
|
+
"dot-offline": "_dot-offline_yxz96_451",
|
|
2957
|
+
"dot-error": "_dot-error_yxz96_457",
|
|
2958
|
+
printerStatusLabel: Yl,
|
|
2959
|
+
submitBtn: ql,
|
|
2960
|
+
spinner: Kl,
|
|
2961
|
+
spin: Vl
|
|
2962
|
+
}, sr = ({
|
|
2963
2963
|
onPrint: a,
|
|
2964
2964
|
printers: i = [],
|
|
2965
2965
|
defaultPrinterId: p,
|
|
2966
|
-
defaultCopies:
|
|
2966
|
+
defaultCopies: r = 1,
|
|
2967
2967
|
disabled: k = !1,
|
|
2968
|
-
loading:
|
|
2968
|
+
loading: _ = !1,
|
|
2969
2969
|
variant: S = "primary",
|
|
2970
2970
|
size: b = "md",
|
|
2971
|
-
label:
|
|
2972
|
-
className:
|
|
2971
|
+
label: y = "Drukuj",
|
|
2972
|
+
className: N,
|
|
2973
2973
|
style: c,
|
|
2974
|
-
theme:
|
|
2974
|
+
theme: D = "light"
|
|
2975
2975
|
}) => {
|
|
2976
|
-
var
|
|
2977
|
-
const [
|
|
2978
|
-
|
|
2979
|
-
if (!
|
|
2976
|
+
var A;
|
|
2977
|
+
const [w, l] = P(!1), [n, u] = P(r), [m, f] = P(p ?? ((A = i[0]) == null ? void 0 : A.id) ?? ""), z = Fe(null);
|
|
2978
|
+
ge(() => {
|
|
2979
|
+
if (!w)
|
|
2980
2980
|
return;
|
|
2981
|
-
const
|
|
2982
|
-
|
|
2981
|
+
const h = (q) => {
|
|
2982
|
+
z.current && !z.current.contains(q.target) && l(!1);
|
|
2983
2983
|
};
|
|
2984
|
-
return document.addEventListener("mousedown",
|
|
2985
|
-
}, [
|
|
2986
|
-
const
|
|
2987
|
-
a({ copies: n, printerId: m }),
|
|
2988
|
-
}, [n, m, a]),
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
k ||
|
|
2984
|
+
return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
2985
|
+
}, [w]);
|
|
2986
|
+
const g = T(() => {
|
|
2987
|
+
a({ copies: n, printerId: m }), l(!1);
|
|
2988
|
+
}, [n, m, a]), L = T(() => u((h) => Math.min(99, h + 1)), []), C = T(() => u((h) => Math.max(1, h - 1)), []), M = [j.container, D === "dark" ? j.dark : "", N ?? ""].filter(Boolean).join(" "), H = [
|
|
2989
|
+
j.trigger,
|
|
2990
|
+
j[`variant-${S}`],
|
|
2991
|
+
j[`size-${b}`],
|
|
2992
|
+
k || _ ? j.triggerDisabled : ""
|
|
2993
2993
|
].filter(Boolean).join(" ");
|
|
2994
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2995
|
-
/* @__PURE__ */ s("div", { className:
|
|
2994
|
+
return /* @__PURE__ */ s("div", { ref: z, className: M, style: c, children: [
|
|
2995
|
+
/* @__PURE__ */ s("div", { className: j.buttonGroup, children: [
|
|
2996
2996
|
/* @__PURE__ */ s(
|
|
2997
2997
|
"button",
|
|
2998
2998
|
{
|
|
2999
|
-
className: `${
|
|
3000
|
-
disabled: k ||
|
|
3001
|
-
onClick:
|
|
3002
|
-
"aria-label":
|
|
2999
|
+
className: `${H} ${j.mainAction}`,
|
|
3000
|
+
disabled: k || _,
|
|
3001
|
+
onClick: g,
|
|
3002
|
+
"aria-label": y,
|
|
3003
3003
|
children: [
|
|
3004
|
-
|
|
3005
|
-
/* @__PURE__ */ e("span", { children:
|
|
3004
|
+
_ ? /* @__PURE__ */ e("span", { className: j.spinner }) : /* @__PURE__ */ e("span", { children: "🖨" }),
|
|
3005
|
+
/* @__PURE__ */ e("span", { children: y })
|
|
3006
3006
|
]
|
|
3007
3007
|
}
|
|
3008
3008
|
),
|
|
3009
3009
|
/* @__PURE__ */ e(
|
|
3010
3010
|
"button",
|
|
3011
3011
|
{
|
|
3012
|
-
className: `${
|
|
3013
|
-
disabled: k ||
|
|
3014
|
-
onClick: () =>
|
|
3012
|
+
className: `${H} ${j.dropdownToggle}`,
|
|
3013
|
+
disabled: k || _,
|
|
3014
|
+
onClick: () => l((h) => !h),
|
|
3015
3015
|
"aria-label": "Opcje druku",
|
|
3016
|
-
"aria-expanded":
|
|
3017
|
-
children: /* @__PURE__ */ e("span", { className: `${
|
|
3016
|
+
"aria-expanded": w,
|
|
3017
|
+
children: /* @__PURE__ */ e("span", { className: `${j.chevron} ${w ? j.chevronUp : ""}`, children: "▾" })
|
|
3018
3018
|
}
|
|
3019
3019
|
)
|
|
3020
3020
|
] }),
|
|
3021
|
-
|
|
3022
|
-
/* @__PURE__ */ s("div", { className:
|
|
3023
|
-
/* @__PURE__ */ e("label", { className:
|
|
3024
|
-
/* @__PURE__ */ s("div", { className:
|
|
3025
|
-
/* @__PURE__ */ e("button", { className:
|
|
3026
|
-
/* @__PURE__ */ e("span", { className:
|
|
3027
|
-
/* @__PURE__ */ e("button", { className:
|
|
3021
|
+
w && /* @__PURE__ */ s("div", { className: j.dropdown, children: [
|
|
3022
|
+
/* @__PURE__ */ s("div", { className: j.section, children: [
|
|
3023
|
+
/* @__PURE__ */ e("label", { className: j.sectionLabel, children: "Liczba kopii" }),
|
|
3024
|
+
/* @__PURE__ */ s("div", { className: j.copiesRow, children: [
|
|
3025
|
+
/* @__PURE__ */ e("button", { className: j.copiesBtn, onClick: C, disabled: n <= 1, children: "−" }),
|
|
3026
|
+
/* @__PURE__ */ e("span", { className: j.copiesValue, children: n }),
|
|
3027
|
+
/* @__PURE__ */ e("button", { className: j.copiesBtn, onClick: L, disabled: n >= 99, children: "+" })
|
|
3028
3028
|
] })
|
|
3029
3029
|
] }),
|
|
3030
|
-
/* @__PURE__ */ e("div", { className:
|
|
3030
|
+
/* @__PURE__ */ e("div", { className: j.divider }),
|
|
3031
3031
|
i.length > 0 && /* @__PURE__ */ s(Y, { children: [
|
|
3032
|
-
/* @__PURE__ */ s("div", { className:
|
|
3033
|
-
/* @__PURE__ */ e("label", { className:
|
|
3032
|
+
/* @__PURE__ */ s("div", { className: j.section, children: [
|
|
3033
|
+
/* @__PURE__ */ e("label", { className: j.sectionLabel, children: "Drukarka" }),
|
|
3034
3034
|
/* @__PURE__ */ e(
|
|
3035
3035
|
"select",
|
|
3036
3036
|
{
|
|
3037
|
-
className:
|
|
3037
|
+
className: j.printerSelect,
|
|
3038
3038
|
value: m,
|
|
3039
|
-
onChange: (
|
|
3040
|
-
children: i.map((
|
|
3039
|
+
onChange: (h) => f(h.target.value),
|
|
3040
|
+
children: i.map((h) => /* @__PURE__ */ s(
|
|
3041
3041
|
"option",
|
|
3042
3042
|
{
|
|
3043
|
-
value:
|
|
3044
|
-
disabled:
|
|
3043
|
+
value: h.id,
|
|
3044
|
+
disabled: h.status === "offline" || !h.isOnline && h.status == null,
|
|
3045
3045
|
children: [
|
|
3046
|
-
|
|
3046
|
+
h.name,
|
|
3047
3047
|
" ",
|
|
3048
|
-
|
|
3048
|
+
h.status === "offline" || !h.isOnline && h.status == null ? "(Offline)" : h.status === "busy" ? "(Zajęta)" : ""
|
|
3049
3049
|
]
|
|
3050
3050
|
},
|
|
3051
|
-
|
|
3051
|
+
h.id
|
|
3052
3052
|
))
|
|
3053
3053
|
}
|
|
3054
3054
|
),
|
|
3055
|
-
i.find((
|
|
3056
|
-
const
|
|
3055
|
+
i.find((h) => h.id === m) && /* @__PURE__ */ e("div", { className: j.printerStatus, children: (() => {
|
|
3056
|
+
const h = i.find((pe) => pe.id === m), q = h.status ?? (h.isOnline ? "ready" : "offline");
|
|
3057
3057
|
return /* @__PURE__ */ s(Y, { children: [
|
|
3058
|
-
/* @__PURE__ */ e("span", { className: `${
|
|
3059
|
-
/* @__PURE__ */ e("span", { className:
|
|
3058
|
+
/* @__PURE__ */ e("span", { className: `${j.printerDot} ${j[`dot-${q}`]}` }),
|
|
3059
|
+
/* @__PURE__ */ e("span", { className: j.printerStatusLabel, children: q === "ready" ? "Gotowa" : q === "busy" ? "Zajęta" : q === "offline" ? "Offline" : "Błąd" })
|
|
3060
3060
|
] });
|
|
3061
3061
|
})() })
|
|
3062
3062
|
] }),
|
|
3063
|
-
/* @__PURE__ */ e("div", { className:
|
|
3063
|
+
/* @__PURE__ */ e("div", { className: j.divider })
|
|
3064
3064
|
] }),
|
|
3065
|
-
/* @__PURE__ */ e("div", { className:
|
|
3065
|
+
/* @__PURE__ */ e("div", { className: j.section, children: /* @__PURE__ */ e(
|
|
3066
3066
|
"button",
|
|
3067
3067
|
{
|
|
3068
|
-
className:
|
|
3069
|
-
onClick:
|
|
3070
|
-
disabled: k ||
|
|
3071
|
-
const
|
|
3072
|
-
return
|
|
3068
|
+
className: j.submitBtn,
|
|
3069
|
+
onClick: g,
|
|
3070
|
+
disabled: k || _ || i.length > 0 && (() => {
|
|
3071
|
+
const h = i.find((q) => q.id === m);
|
|
3072
|
+
return h != null && (h.status === "offline" || !h.isOnline && h.status == null);
|
|
3073
3073
|
})(),
|
|
3074
|
-
children:
|
|
3074
|
+
children: _ ? "Drukowanie..." : `🖨 Drukuj${n > 1 ? ` (${n} kopie)` : ""}`
|
|
3075
3075
|
}
|
|
3076
3076
|
) })
|
|
3077
3077
|
] })
|
|
3078
3078
|
] });
|
|
3079
3079
|
};
|
|
3080
3080
|
export {
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3081
|
+
sr as NicePrintButton,
|
|
3082
|
+
ar as NicePrintPreview,
|
|
3083
|
+
nr as NicePrintQueue,
|
|
3084
|
+
tr as NiceTemplateBrowser,
|
|
3085
|
+
er as NiceTemplateEditor
|
|
3086
3086
|
};
|