@stll/folio-vue 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,901 @@
1
+ import { E as e, S as t, u as n } from "./PageSetupDialog-Djs8aW5A.js";
2
+ import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, reactive as m, ref as h, renderList as g, toDisplayString as _, unref as v, vModelRadio as y, vModelSelect as b, vModelText as x, watch as S, withCtx as C, withDirectives as w, withKeys as T, withModifiers as E } from "vue";
3
+ //#region src/components/tableStylePresets.ts
4
+ var D = (e) => ({
5
+ style: "single",
6
+ size: 4,
7
+ color: { rgb: e }
8
+ }), O = [
9
+ {
10
+ id: "TableNormal",
11
+ name: "Normal Table",
12
+ look: {
13
+ firstRow: !1,
14
+ lastRow: !1,
15
+ noHBand: !0,
16
+ noVBand: !0
17
+ }
18
+ },
19
+ {
20
+ id: "TableGrid",
21
+ name: "Table Grid",
22
+ tableBorders: {
23
+ top: D("000000"),
24
+ bottom: D("000000"),
25
+ left: D("000000"),
26
+ right: D("000000"),
27
+ insideH: D("000000"),
28
+ insideV: D("000000")
29
+ },
30
+ look: {
31
+ firstRow: !1,
32
+ lastRow: !1,
33
+ noHBand: !0,
34
+ noVBand: !0
35
+ }
36
+ },
37
+ {
38
+ id: "TableGridLight",
39
+ name: "Grid Table Light",
40
+ tableBorders: {
41
+ top: D("BFBFBF"),
42
+ bottom: D("BFBFBF"),
43
+ left: D("BFBFBF"),
44
+ right: D("BFBFBF"),
45
+ insideH: D("BFBFBF"),
46
+ insideV: D("BFBFBF")
47
+ },
48
+ look: {
49
+ firstRow: !0,
50
+ lastRow: !1,
51
+ noHBand: !0,
52
+ noVBand: !0
53
+ },
54
+ conditionals: { firstRow: {
55
+ bold: !0,
56
+ borders: { bottom: D("000000") }
57
+ } }
58
+ },
59
+ {
60
+ id: "PlainTable1",
61
+ name: "Plain Table 1",
62
+ tableBorders: {
63
+ top: D("BFBFBF"),
64
+ bottom: D("BFBFBF"),
65
+ insideH: D("BFBFBF")
66
+ },
67
+ look: {
68
+ firstRow: !0,
69
+ lastRow: !1,
70
+ noHBand: !0,
71
+ noVBand: !0
72
+ },
73
+ conditionals: { firstRow: { bold: !0 } }
74
+ },
75
+ {
76
+ id: "PlainTable2",
77
+ name: "Plain Table 2",
78
+ look: {
79
+ firstRow: !0,
80
+ lastRow: !1,
81
+ noHBand: !1,
82
+ noVBand: !0
83
+ },
84
+ conditionals: {
85
+ firstRow: {
86
+ bold: !0,
87
+ borders: { bottom: D("7F7F7F") }
88
+ },
89
+ band1Horz: { backgroundColor: "#F2F2F2" }
90
+ }
91
+ },
92
+ {
93
+ id: "PlainTable3",
94
+ name: "Plain Table 3",
95
+ look: {
96
+ firstRow: !0,
97
+ lastRow: !1,
98
+ noHBand: !1,
99
+ noVBand: !0
100
+ },
101
+ conditionals: {
102
+ firstRow: {
103
+ bold: !0,
104
+ color: "#FFFFFF",
105
+ backgroundColor: "#A5A5A5"
106
+ },
107
+ band1Horz: { backgroundColor: "#E7E7E7" }
108
+ }
109
+ },
110
+ {
111
+ id: "PlainTable4",
112
+ name: "Plain Table 4",
113
+ look: {
114
+ firstRow: !0,
115
+ lastRow: !1,
116
+ noHBand: !1,
117
+ noVBand: !0
118
+ },
119
+ conditionals: {
120
+ firstRow: {
121
+ bold: !0,
122
+ color: "#FFFFFF",
123
+ backgroundColor: "#000000"
124
+ },
125
+ band1Horz: { backgroundColor: "#F2F2F2" }
126
+ }
127
+ },
128
+ {
129
+ id: "GridTable1Light-Accent1",
130
+ name: "Grid Table 1 Light",
131
+ tableBorders: {
132
+ top: D("B4C6E7"),
133
+ bottom: D("B4C6E7"),
134
+ left: D("B4C6E7"),
135
+ right: D("B4C6E7"),
136
+ insideH: D("B4C6E7"),
137
+ insideV: D("B4C6E7")
138
+ },
139
+ look: {
140
+ firstRow: !0,
141
+ lastRow: !1,
142
+ noHBand: !0,
143
+ noVBand: !0
144
+ },
145
+ conditionals: { firstRow: {
146
+ bold: !0,
147
+ borders: { bottom: D("4472C4") }
148
+ } }
149
+ },
150
+ {
151
+ id: "GridTable4-Accent1",
152
+ name: "Grid Table 4 Accent 1",
153
+ tableBorders: {
154
+ top: D("4472C4"),
155
+ bottom: D("4472C4"),
156
+ left: D("4472C4"),
157
+ right: D("4472C4"),
158
+ insideH: D("4472C4"),
159
+ insideV: D("4472C4")
160
+ },
161
+ look: {
162
+ firstRow: !0,
163
+ lastRow: !1,
164
+ noHBand: !1,
165
+ noVBand: !0
166
+ },
167
+ conditionals: {
168
+ firstRow: {
169
+ bold: !0,
170
+ color: "#FFFFFF",
171
+ backgroundColor: "#4472C4"
172
+ },
173
+ band1Horz: { backgroundColor: "#D6E4F0" }
174
+ }
175
+ },
176
+ {
177
+ id: "GridTable5Dark-Accent1",
178
+ name: "Grid Table 5 Dark",
179
+ tableBorders: {
180
+ top: D("FFFFFF"),
181
+ bottom: D("FFFFFF"),
182
+ left: D("FFFFFF"),
183
+ right: D("FFFFFF"),
184
+ insideH: D("FFFFFF"),
185
+ insideV: D("FFFFFF")
186
+ },
187
+ look: {
188
+ firstRow: !0,
189
+ lastRow: !1,
190
+ noHBand: !1,
191
+ noVBand: !0
192
+ },
193
+ conditionals: {
194
+ firstRow: {
195
+ bold: !0,
196
+ color: "#FFFFFF",
197
+ backgroundColor: "#4472C4"
198
+ },
199
+ band1Horz: { backgroundColor: "#D6E4F0" },
200
+ band2Horz: { backgroundColor: "#B4C6E7" }
201
+ }
202
+ },
203
+ {
204
+ id: "ListTable3-Accent2",
205
+ name: "List Table 3 Accent 2",
206
+ tableBorders: {
207
+ top: D("ED7D31"),
208
+ bottom: D("ED7D31")
209
+ },
210
+ look: {
211
+ firstRow: !0,
212
+ lastRow: !1,
213
+ noHBand: !1,
214
+ noVBand: !0
215
+ },
216
+ conditionals: {
217
+ firstRow: {
218
+ bold: !0,
219
+ color: "#FFFFFF",
220
+ backgroundColor: "#ED7D31"
221
+ },
222
+ band1Horz: { backgroundColor: "#FBE4D5" }
223
+ }
224
+ },
225
+ {
226
+ id: "ListTable4-Accent3",
227
+ name: "List Table 4 Accent 3",
228
+ tableBorders: {
229
+ top: D("A5A5A5"),
230
+ bottom: D("A5A5A5"),
231
+ insideH: D("A5A5A5")
232
+ },
233
+ look: {
234
+ firstRow: !0,
235
+ lastRow: !1,
236
+ noHBand: !1,
237
+ noVBand: !0
238
+ },
239
+ conditionals: {
240
+ firstRow: {
241
+ bold: !0,
242
+ color: "#FFFFFF",
243
+ backgroundColor: "#A5A5A5"
244
+ },
245
+ band1Horz: { backgroundColor: "#EDEDED" }
246
+ }
247
+ },
248
+ {
249
+ id: "GridTable4-Accent5",
250
+ name: "Grid Table 4 Accent 5",
251
+ tableBorders: {
252
+ top: D("5B9BD5"),
253
+ bottom: D("5B9BD5"),
254
+ left: D("5B9BD5"),
255
+ right: D("5B9BD5"),
256
+ insideH: D("5B9BD5"),
257
+ insideV: D("5B9BD5")
258
+ },
259
+ look: {
260
+ firstRow: !0,
261
+ lastRow: !1,
262
+ noHBand: !1,
263
+ noVBand: !0
264
+ },
265
+ conditionals: {
266
+ firstRow: {
267
+ bold: !0,
268
+ color: "#FFFFFF",
269
+ backgroundColor: "#5B9BD5"
270
+ },
271
+ band1Horz: { backgroundColor: "#DEEAF6" }
272
+ }
273
+ },
274
+ {
275
+ id: "GridTable4-Accent6",
276
+ name: "Grid Table 4 Accent 6",
277
+ tableBorders: {
278
+ top: D("70AD47"),
279
+ bottom: D("70AD47"),
280
+ left: D("70AD47"),
281
+ right: D("70AD47"),
282
+ insideH: D("70AD47"),
283
+ insideV: D("70AD47")
284
+ },
285
+ look: {
286
+ firstRow: !0,
287
+ lastRow: !1,
288
+ noHBand: !1,
289
+ noVBand: !0
290
+ },
291
+ conditionals: {
292
+ firstRow: {
293
+ bold: !0,
294
+ color: "#FFFFFF",
295
+ backgroundColor: "#70AD47"
296
+ },
297
+ band1Horz: { backgroundColor: "#E2EFDA" }
298
+ }
299
+ }
300
+ ], k = {
301
+ TableNormal: "table.styles.normalTable",
302
+ TableGrid: "table.styles.tableGrid",
303
+ TableGridLight: "table.styles.gridTableLight",
304
+ PlainTable1: "table.styles.plainTable1",
305
+ PlainTable2: "table.styles.plainTable2",
306
+ PlainTable3: "table.styles.plainTable3",
307
+ PlainTable4: "table.styles.plainTable4",
308
+ "GridTable1Light-Accent1": "table.styles.gridTable1Light",
309
+ "GridTable4-Accent1": "table.styles.gridTable4Accent1",
310
+ "GridTable5Dark-Accent1": "table.styles.gridTable5Dark",
311
+ "ListTable3-Accent2": "table.styles.listTable3Accent2",
312
+ "ListTable4-Accent3": "table.styles.listTable4Accent3",
313
+ "GridTable4-Accent5": "table.styles.gridTable4Accent5",
314
+ "GridTable4-Accent6": "table.styles.gridTable4Accent6"
315
+ }, A = 4, j = 3;
316
+ function M(e) {
317
+ return !e || e.style === "none" ? "none" : `${e.size ? Math.max(1, Math.round(e.size / 8)) : 1}px solid ${e.color?.rgb ? `#${e.color.rgb}` : "#000"}`;
318
+ }
319
+ function N(e, t, n, r) {
320
+ return M(e === void 0 ? t ? n ?? r : r : e);
321
+ }
322
+ function P(e, t = A, n = j) {
323
+ let r = e.look ?? {}, i = e.conditionals ?? {}, a = e.tableBorders, o = [], s = 0;
324
+ for (let e = 0; e < t; e++) {
325
+ let c = e === 0 && !!r.firstRow, l = e === t - 1 && !!r.lastRow, u = r.noHBand !== !0, d;
326
+ c ? d = "firstRow" : l ? d = "lastRow" : (u && (d = s % 2 == 0 ? "band1Horz" : "band2Horz"), s++);
327
+ for (let s = 0; s < n; s++) {
328
+ let u = d, f = s === 0 && !!r.firstCol, p = s === n - 1 && !!r.lastCol;
329
+ c && f && i.nwCell ? u = "nwCell" : c && p && i.neCell ? u = "neCell" : l && f && i.swCell ? u = "swCell" : l && p && i.seCell ? u = "seCell" : f ? u = "firstCol" : p && (u = "lastCol");
330
+ let m = u ? i[u] : void 0, h = m?.borders, g = {
331
+ width: "20px",
332
+ height: "10px",
333
+ boxSizing: "border-box",
334
+ backgroundColor: m?.backgroundColor ?? "transparent",
335
+ borderTop: N(h?.top, e > 0, a?.insideH, a?.top),
336
+ borderBottom: N(h?.bottom, e < t - 1, a?.insideH, a?.bottom),
337
+ borderLeft: N(h?.left, s > 0, a?.insideV, a?.left),
338
+ borderRight: N(h?.right, s < n - 1, a?.insideV, a?.right)
339
+ };
340
+ o.push(g);
341
+ }
342
+ }
343
+ return o;
344
+ }
345
+ //#endregion
346
+ //#region src/components/ui/TableStyleGallery.vue?vue&type=script&setup=true&lang.ts
347
+ var F = { class: "tsg" }, I = { class: "tsg__grid" }, L = ["title", "onMousedown"], ee = { class: "tsg__preview" }, te = { class: "tsg__name" }, R = /*#__PURE__*/ e(/* @__PURE__ */ u({
348
+ __name: "TableStyleGallery",
349
+ props: { currentStyleId: {} },
350
+ emits: ["apply"],
351
+ setup(e) {
352
+ let { t: n } = t(), i = O;
353
+ function a(e) {
354
+ let t = k[e.id];
355
+ return t ? n(t) : e.name;
356
+ }
357
+ return (t, n) => (p(), s("div", F, [c("div", I, [(p(!0), s(r, null, g(v(i), (n) => (p(), s("button", {
358
+ key: n.id,
359
+ class: d(["tsg__item", { "tsg__item--selected": e.currentStyleId === n.id }]),
360
+ title: a(n),
361
+ onMousedown: E((e) => t.$emit("apply", n.id), ["prevent"])
362
+ }, [c("div", ee, [(p(!0), s(r, null, g(v(P)(n), (e, t) => (p(), s("div", {
363
+ key: t,
364
+ class: "tsg__cell",
365
+ style: f(e)
366
+ }, null, 4))), 128))]), c("span", te, _(a(n)), 1)], 42, L))), 128))])]));
367
+ }
368
+ }), [["__scopeId", "data-v-a2d658b3"]]), ne = { class: "fnpd-dialog__header" }, re = { class: "fnpd-dialog__body" }, ie = { class: "fnpd-fieldset" }, ae = { class: "fnpd-legend" }, oe = { class: "fnpd-row" }, z = { class: "fnpd-label" }, B = { value: "pageBottom" }, V = { value: "beneathText" }, H = { class: "fnpd-row" }, U = { class: "fnpd-label" }, W = ["value"], G = { class: "fnpd-row" }, K = { class: "fnpd-label" }, q = { class: "fnpd-row" }, se = { class: "fnpd-label" }, ce = { value: "continuous" }, le = { value: "eachSect" }, ue = { value: "eachPage" }, de = { class: "fnpd-fieldset" }, fe = { class: "fnpd-legend" }, pe = { class: "fnpd-row" }, me = { class: "fnpd-label" }, he = { value: "docEnd" }, ge = { value: "sectEnd" }, _e = { class: "fnpd-row" }, ve = { class: "fnpd-label" }, ye = ["value"], be = { class: "fnpd-row" }, xe = { class: "fnpd-label" }, Se = { class: "fnpd-row" }, Ce = { class: "fnpd-label" }, we = { value: "continuous" }, Te = { value: "eachSect" }, Ee = { class: "fnpd-dialog__footer" }, De = /*#__PURE__*/ e(/* @__PURE__ */ u({
369
+ __name: "FootnotePropertiesDialog",
370
+ props: {
371
+ isOpen: { type: Boolean },
372
+ footnotePr: {},
373
+ endnotePr: {}
374
+ },
375
+ emits: ["close", "apply"],
376
+ setup(e, { emit: o }) {
377
+ let { t: l } = t(), { Dialog: u } = n(), d = e, f = o, m = i(() => [
378
+ {
379
+ value: "decimal",
380
+ label: l("dialogs.footnoteProperties.formats.decimal")
381
+ },
382
+ {
383
+ value: "lowerLetter",
384
+ label: l("dialogs.footnoteProperties.formats.lowerAlpha")
385
+ },
386
+ {
387
+ value: "upperLetter",
388
+ label: l("dialogs.footnoteProperties.formats.upperAlpha")
389
+ },
390
+ {
391
+ value: "lowerRoman",
392
+ label: l("dialogs.footnoteProperties.formats.lowerRoman")
393
+ },
394
+ {
395
+ value: "upperRoman",
396
+ label: l("dialogs.footnoteProperties.formats.upperRoman")
397
+ },
398
+ {
399
+ value: "chicago",
400
+ label: l("dialogs.footnoteProperties.formats.symbols")
401
+ }
402
+ ]), y = h("pageBottom"), T = h("decimal"), E = h(1), D = h("continuous"), O = h("docEnd"), k = h("lowerRoman"), A = h(1), j = h("continuous");
403
+ S(() => d.isOpen, (e) => {
404
+ e && (y.value = d.footnotePr?.position ?? "pageBottom", T.value = d.footnotePr?.numFmt ?? "decimal", E.value = d.footnotePr?.numStart ?? 1, D.value = d.footnotePr?.numRestart ?? "continuous", O.value = d.endnotePr?.position ?? "docEnd", k.value = d.endnotePr?.numFmt ?? "lowerRoman", A.value = d.endnotePr?.numStart ?? 1, j.value = d.endnotePr?.numRestart ?? "continuous");
405
+ });
406
+ function M() {
407
+ f("apply", {
408
+ position: y.value,
409
+ numFmt: T.value,
410
+ numStart: E.value,
411
+ numRestart: D.value
412
+ }, {
413
+ position: O.value,
414
+ numFmt: k.value,
415
+ numStart: A.value,
416
+ numRestart: j.value
417
+ }), f("close");
418
+ }
419
+ return (t, n) => (p(), a(v(u), {
420
+ open: e.isOpen,
421
+ "aria-label": v(l)("dialogs.footnoteProperties.title"),
422
+ style: {
423
+ width: "440px",
424
+ maxWidth: "90vw"
425
+ },
426
+ onClose: n[9] ||= (e) => t.$emit("close")
427
+ }, {
428
+ default: C(() => [
429
+ c("div", ne, _(v(l)("dialogs.footnoteProperties.title")), 1),
430
+ c("div", re, [c("fieldset", ie, [
431
+ c("legend", ae, _(v(l)("dialogs.footnoteProperties.footnotes")), 1),
432
+ c("div", oe, [c("label", z, _(v(l)("dialogs.footnoteProperties.position")), 1), w(c("select", {
433
+ "onUpdate:modelValue": n[0] ||= (e) => y.value = e,
434
+ class: "fnpd-select"
435
+ }, [c("option", B, _(v(l)("dialogs.footnoteProperties.footnotePositions.bottomOfPage")), 1), c("option", V, _(v(l)("dialogs.footnoteProperties.footnotePositions.belowText")), 1)], 512), [[b, y.value]])]),
436
+ c("div", H, [c("label", U, _(v(l)("dialogs.footnoteProperties.numberFormat")), 1), w(c("select", {
437
+ "onUpdate:modelValue": n[1] ||= (e) => T.value = e,
438
+ class: "fnpd-select"
439
+ }, [(p(!0), s(r, null, g(m.value, (e) => (p(), s("option", {
440
+ key: e.value,
441
+ value: e.value
442
+ }, _(e.label), 9, W))), 128))], 512), [[b, T.value]])]),
443
+ c("div", G, [c("label", K, _(v(l)("dialogs.footnoteProperties.startAt")), 1), w(c("input", {
444
+ "onUpdate:modelValue": n[2] ||= (e) => E.value = e,
445
+ type: "number",
446
+ class: "fnpd-input",
447
+ min: "1"
448
+ }, null, 512), [[
449
+ x,
450
+ E.value,
451
+ void 0,
452
+ { number: !0 }
453
+ ]])]),
454
+ c("div", q, [c("label", se, _(v(l)("dialogs.footnoteProperties.numbering")), 1), w(c("select", {
455
+ "onUpdate:modelValue": n[3] ||= (e) => D.value = e,
456
+ class: "fnpd-select"
457
+ }, [
458
+ c("option", ce, _(v(l)("dialogs.footnoteProperties.numberingOptions.continuous")), 1),
459
+ c("option", le, _(v(l)("dialogs.footnoteProperties.numberingOptions.restartSection")), 1),
460
+ c("option", ue, _(v(l)("dialogs.footnoteProperties.numberingOptions.restartPage")), 1)
461
+ ], 512), [[b, D.value]])])
462
+ ]), c("fieldset", de, [
463
+ c("legend", fe, _(v(l)("dialogs.footnoteProperties.endnotes")), 1),
464
+ c("div", pe, [c("label", me, _(v(l)("dialogs.footnoteProperties.position")), 1), w(c("select", {
465
+ "onUpdate:modelValue": n[4] ||= (e) => O.value = e,
466
+ class: "fnpd-select"
467
+ }, [c("option", he, _(v(l)("dialogs.footnoteProperties.endnotePositions.endOfDocument")), 1), c("option", ge, _(v(l)("dialogs.footnoteProperties.endnotePositions.endOfSection")), 1)], 512), [[b, O.value]])]),
468
+ c("div", _e, [c("label", ve, _(v(l)("dialogs.footnoteProperties.numberFormat")), 1), w(c("select", {
469
+ "onUpdate:modelValue": n[5] ||= (e) => k.value = e,
470
+ class: "fnpd-select"
471
+ }, [(p(!0), s(r, null, g(m.value, (e) => (p(), s("option", {
472
+ key: e.value,
473
+ value: e.value
474
+ }, _(e.label), 9, ye))), 128))], 512), [[b, k.value]])]),
475
+ c("div", be, [c("label", xe, _(v(l)("dialogs.footnoteProperties.startAt")), 1), w(c("input", {
476
+ "onUpdate:modelValue": n[6] ||= (e) => A.value = e,
477
+ type: "number",
478
+ class: "fnpd-input",
479
+ min: "1"
480
+ }, null, 512), [[
481
+ x,
482
+ A.value,
483
+ void 0,
484
+ { number: !0 }
485
+ ]])]),
486
+ c("div", Se, [c("label", Ce, _(v(l)("dialogs.footnoteProperties.numbering")), 1), w(c("select", {
487
+ "onUpdate:modelValue": n[7] ||= (e) => j.value = e,
488
+ class: "fnpd-select"
489
+ }, [c("option", we, _(v(l)("dialogs.footnoteProperties.numberingOptions.continuous")), 1), c("option", Te, _(v(l)("dialogs.footnoteProperties.numberingOptions.restartSection")), 1)], 512), [[b, j.value]])])
490
+ ])]),
491
+ c("div", Ee, [c("button", {
492
+ class: "fnpd-btn",
493
+ onClick: n[8] ||= (e) => t.$emit("close")
494
+ }, _(v(l)("common.cancel")), 1), c("button", {
495
+ class: "fnpd-btn fnpd-btn--primary",
496
+ onClick: M
497
+ }, _(v(l)("common.apply")), 1)])
498
+ ]),
499
+ _: 1
500
+ }, 8, ["open", "aria-label"]));
501
+ }
502
+ }), [["__scopeId", "data-v-2d896d01"]]), Oe = { class: "ipd-dialog__header" }, ke = { class: "ipd-dialog__body" }, Ae = { class: "ipd-fieldset" }, je = { class: "ipd-legend" }, Me = { class: "ipd-row" }, Ne = { value: "align" }, Pe = { value: "offset" }, Fe = {
503
+ key: 0,
504
+ class: "ipd-row"
505
+ }, Ie = { class: "ipd-label" }, Le = { value: "left" }, Re = { value: "center" }, ze = { value: "right" }, Be = {
506
+ key: 1,
507
+ class: "ipd-row"
508
+ }, Ve = { class: "ipd-label" }, He = { class: "ipd-row" }, Ue = { class: "ipd-label" }, We = { value: "page" }, Ge = { value: "column" }, Ke = { value: "margin" }, qe = { value: "character" }, Je = { class: "ipd-fieldset" }, Ye = { class: "ipd-legend" }, Xe = { class: "ipd-row" }, Ze = { value: "align" }, Qe = { value: "offset" }, $e = {
509
+ key: 0,
510
+ class: "ipd-row"
511
+ }, et = { class: "ipd-label" }, tt = { value: "top" }, nt = { value: "center" }, rt = { value: "bottom" }, it = {
512
+ key: 1,
513
+ class: "ipd-row"
514
+ }, at = { class: "ipd-label" }, ot = { class: "ipd-row" }, st = { class: "ipd-label" }, ct = { value: "page" }, lt = { value: "margin" }, ut = { value: "paragraph" }, dt = { value: "line" }, ft = { class: "ipd-fieldset" }, pt = { class: "ipd-row" }, mt = { class: "ipd-label" }, ht = {
515
+ class: "ipd-label",
516
+ style: { width: "60px" }
517
+ }, gt = { class: "ipd-row" }, _t = { class: "ipd-label" }, vt = {
518
+ class: "ipd-label",
519
+ style: { width: "60px" }
520
+ }, yt = { class: "ipd-dialog__footer" }, bt = /*#__PURE__*/ e(/* @__PURE__ */ u({
521
+ __name: "ImagePositionDialog",
522
+ props: {
523
+ isOpen: { type: Boolean },
524
+ currentData: {}
525
+ },
526
+ emits: ["close", "apply"],
527
+ setup(e, { emit: r }) {
528
+ let { t: i } = t(), { Dialog: o } = n(), l = e, u = r, d = h("align"), f = h("left"), m = h(0), g = h("column"), y = h("align"), T = h("top"), E = h(0), D = h("paragraph"), O = h(0), k = h(0), A = h(0), j = h(0);
529
+ S(() => l.isOpen, (e) => {
530
+ if (!e) return;
531
+ let t = l.currentData;
532
+ t?.horizontal?.align ? (d.value = "align", f.value = t.horizontal.align) : t?.horizontal?.posOffset != null && (d.value = "offset", m.value = t.horizontal.posOffset), g.value = t?.horizontal?.relativeTo ?? "column", t?.vertical?.align ? (y.value = "align", T.value = t.vertical.align) : t?.vertical?.posOffset != null && (y.value = "offset", E.value = t.vertical.posOffset), D.value = t?.vertical?.relativeTo ?? "paragraph", O.value = t?.distTop ?? 0, k.value = t?.distBottom ?? 0, A.value = t?.distLeft ?? 0, j.value = t?.distRight ?? 0;
533
+ });
534
+ function M() {
535
+ u("apply", {
536
+ horizontal: {
537
+ relativeTo: g.value,
538
+ ...d.value === "align" ? { align: f.value } : { posOffset: m.value }
539
+ },
540
+ vertical: {
541
+ relativeTo: D.value,
542
+ ...y.value === "align" ? { align: T.value } : { posOffset: E.value }
543
+ },
544
+ distTop: O.value,
545
+ distBottom: k.value,
546
+ distLeft: A.value,
547
+ distRight: j.value
548
+ }), u("close");
549
+ }
550
+ return (t, n) => (p(), a(v(o), {
551
+ open: e.isOpen,
552
+ "aria-label": v(i)("dialogs.imagePosition.title"),
553
+ style: {
554
+ width: "420px",
555
+ maxWidth: "90vw"
556
+ },
557
+ onClose: n[13] ||= (e) => t.$emit("close")
558
+ }, {
559
+ default: C(() => [
560
+ c("div", Oe, _(v(i)("dialogs.imagePosition.title")), 1),
561
+ c("div", ke, [
562
+ c("fieldset", Ae, [
563
+ c("legend", je, _(v(i)("dialogs.imagePosition.horizontal")), 1),
564
+ c("div", Me, [n[14] ||= c("label", { class: "ipd-label" }, "Mode", -1), w(c("select", {
565
+ "onUpdate:modelValue": n[0] ||= (e) => d.value = e,
566
+ class: "ipd-select"
567
+ }, [c("option", Ne, _(v(i)("dialogs.imagePosition.alignment")), 1), c("option", Pe, _(v(i)("dialogs.imagePosition.offset")), 1)], 512), [[b, d.value]])]),
568
+ d.value === "align" ? (p(), s("div", Fe, [c("label", Ie, _(v(i)("dialogs.imagePosition.align")), 1), w(c("select", {
569
+ "onUpdate:modelValue": n[1] ||= (e) => f.value = e,
570
+ class: "ipd-select"
571
+ }, [
572
+ c("option", Le, _(v(i)("dialogs.imagePosition.alignOptions.left")), 1),
573
+ c("option", Re, _(v(i)("dialogs.imagePosition.alignOptions.center")), 1),
574
+ c("option", ze, _(v(i)("dialogs.imagePosition.alignOptions.right")), 1)
575
+ ], 512), [[b, f.value]])])) : (p(), s("div", Be, [c("label", Ve, _(v(i)("dialogs.imagePosition.offsetPx")), 1), w(c("input", {
576
+ "onUpdate:modelValue": n[2] ||= (e) => m.value = e,
577
+ type: "number",
578
+ class: "ipd-input"
579
+ }, null, 512), [[
580
+ x,
581
+ m.value,
582
+ void 0,
583
+ { number: !0 }
584
+ ]])])),
585
+ c("div", He, [c("label", Ue, _(v(i)("dialogs.imagePosition.relativeTo")), 1), w(c("select", {
586
+ "onUpdate:modelValue": n[3] ||= (e) => g.value = e,
587
+ class: "ipd-select"
588
+ }, [
589
+ c("option", We, _(v(i)("dialogs.imagePosition.relativeOptions.page")), 1),
590
+ c("option", Ge, _(v(i)("dialogs.imagePosition.relativeOptions.column")), 1),
591
+ c("option", Ke, _(v(i)("dialogs.imagePosition.relativeOptions.margin")), 1),
592
+ c("option", qe, _(v(i)("dialogs.imagePosition.relativeOptions.character")), 1)
593
+ ], 512), [[b, g.value]])])
594
+ ]),
595
+ c("fieldset", Je, [
596
+ c("legend", Ye, _(v(i)("dialogs.imagePosition.vertical")), 1),
597
+ c("div", Xe, [n[15] ||= c("label", { class: "ipd-label" }, "Mode", -1), w(c("select", {
598
+ "onUpdate:modelValue": n[4] ||= (e) => y.value = e,
599
+ class: "ipd-select"
600
+ }, [c("option", Ze, _(v(i)("dialogs.imagePosition.alignment")), 1), c("option", Qe, _(v(i)("dialogs.imagePosition.offset")), 1)], 512), [[b, y.value]])]),
601
+ y.value === "align" ? (p(), s("div", $e, [c("label", et, _(v(i)("dialogs.imagePosition.align")), 1), w(c("select", {
602
+ "onUpdate:modelValue": n[5] ||= (e) => T.value = e,
603
+ class: "ipd-select"
604
+ }, [
605
+ c("option", tt, _(v(i)("dialogs.imagePosition.alignOptions.top")), 1),
606
+ c("option", nt, _(v(i)("dialogs.imagePosition.alignOptions.center")), 1),
607
+ c("option", rt, _(v(i)("dialogs.imagePosition.alignOptions.bottom")), 1)
608
+ ], 512), [[b, T.value]])])) : (p(), s("div", it, [c("label", at, _(v(i)("dialogs.imagePosition.offsetPx")), 1), w(c("input", {
609
+ "onUpdate:modelValue": n[6] ||= (e) => E.value = e,
610
+ type: "number",
611
+ class: "ipd-input"
612
+ }, null, 512), [[
613
+ x,
614
+ E.value,
615
+ void 0,
616
+ { number: !0 }
617
+ ]])])),
618
+ c("div", ot, [c("label", st, _(v(i)("dialogs.imagePosition.relativeTo")), 1), w(c("select", {
619
+ "onUpdate:modelValue": n[7] ||= (e) => D.value = e,
620
+ class: "ipd-select"
621
+ }, [
622
+ c("option", ct, _(v(i)("dialogs.imagePosition.relativeOptions.page")), 1),
623
+ c("option", lt, _(v(i)("dialogs.imagePosition.relativeOptions.margin")), 1),
624
+ c("option", ut, _(v(i)("dialogs.imagePosition.relativeOptions.paragraph")), 1),
625
+ c("option", dt, _(v(i)("dialogs.imagePosition.relativeOptions.line")), 1)
626
+ ], 512), [[b, D.value]])])
627
+ ]),
628
+ c("fieldset", ft, [
629
+ n[16] ||= c("legend", { class: "ipd-legend" }, "Distance from text (px)", -1),
630
+ c("div", pt, [
631
+ c("label", mt, _(v(i)("dialogs.imagePosition.alignOptions.top")), 1),
632
+ w(c("input", {
633
+ "onUpdate:modelValue": n[8] ||= (e) => O.value = e,
634
+ type: "number",
635
+ class: "ipd-input",
636
+ min: "0"
637
+ }, null, 512), [[
638
+ x,
639
+ O.value,
640
+ void 0,
641
+ { number: !0 }
642
+ ]]),
643
+ c("label", ht, _(v(i)("dialogs.imagePosition.alignOptions.bottom")), 1),
644
+ w(c("input", {
645
+ "onUpdate:modelValue": n[9] ||= (e) => k.value = e,
646
+ type: "number",
647
+ class: "ipd-input",
648
+ min: "0"
649
+ }, null, 512), [[
650
+ x,
651
+ k.value,
652
+ void 0,
653
+ { number: !0 }
654
+ ]])
655
+ ]),
656
+ c("div", gt, [
657
+ c("label", _t, _(v(i)("dialogs.imagePosition.alignOptions.left")), 1),
658
+ w(c("input", {
659
+ "onUpdate:modelValue": n[10] ||= (e) => A.value = e,
660
+ type: "number",
661
+ class: "ipd-input",
662
+ min: "0"
663
+ }, null, 512), [[
664
+ x,
665
+ A.value,
666
+ void 0,
667
+ { number: !0 }
668
+ ]]),
669
+ c("label", vt, _(v(i)("dialogs.imagePosition.alignOptions.right")), 1),
670
+ w(c("input", {
671
+ "onUpdate:modelValue": n[11] ||= (e) => j.value = e,
672
+ type: "number",
673
+ class: "ipd-input",
674
+ min: "0"
675
+ }, null, 512), [[
676
+ x,
677
+ j.value,
678
+ void 0,
679
+ { number: !0 }
680
+ ]])
681
+ ])
682
+ ])
683
+ ]),
684
+ c("div", yt, [c("button", {
685
+ class: "ipd-btn",
686
+ onClick: n[12] ||= (e) => t.$emit("close")
687
+ }, _(v(i)("common.cancel")), 1), c("button", {
688
+ class: "ipd-btn ipd-btn--primary",
689
+ onClick: M
690
+ }, _(v(i)("common.apply")), 1)])
691
+ ]),
692
+ _: 1
693
+ }, 8, ["open", "aria-label"]));
694
+ }
695
+ }), [["__scopeId", "data-v-82d9e45f"]]), J = m({
696
+ rows: 3,
697
+ cols: 3
698
+ }), xt = { class: "dialog__header" }, St = { class: "dialog__title" }, Ct = ["title"], wt = { class: "dialog__body" }, Tt = ["aria-label"], Et = ["onMouseenter", "onMousedown"], Dt = { class: "table-grid__label" }, Ot = { class: "dialog__separator" }, kt = { class: "table-manual" }, At = { class: "table-manual__field" }, jt = { class: "table-manual__field" }, Mt = { class: "table-options" }, Nt = { class: "table-options__radio" }, Pt = { class: "table-options__radio" }, Ft = { class: "dialog__separator" }, It = { class: "dialog__footer" }, Lt = ["disabled"], Rt = 8, zt = 10, Y = 1, X = 100, Z = 1, Q = 20, Bt = /*#__PURE__*/ e(/* @__PURE__ */ u({
699
+ __name: "InsertTableDialog",
700
+ props: { isOpen: { type: Boolean } },
701
+ emits: ["close", "insert"],
702
+ setup(e, { emit: n }) {
703
+ let { t: a } = t(), u = e, f = n, m = h(0), b = h(0), C = h(J.rows), T = h(J.cols), D = h("fixed"), O = h(null);
704
+ S(() => u.isOpen, (e) => {
705
+ e && (C.value = J.rows, T.value = J.cols, m.value = 0, b.value = 0);
706
+ });
707
+ let k = i(() => Number.parseInt(String(C.value), 10)), A = i(() => Number.parseInt(String(T.value), 10)), j = i(() => Number.isFinite(k.value) && k.value >= Y && k.value <= X), M = i(() => Number.isFinite(A.value) && A.value >= Z && A.value <= Q), N = i(() => j.value && M.value);
708
+ function P() {
709
+ f("close");
710
+ }
711
+ function F(e, t) {
712
+ m.value = e, b.value = t, C.value = e, T.value = t;
713
+ }
714
+ function I(e) {
715
+ e.key === "Escape" ? P() : e.key === "Enter" && (e.preventDefault(), L());
716
+ }
717
+ function L() {
718
+ if (!N.value) return;
719
+ let e = Math.min(Math.max(Y, k.value), X), t = Math.min(Math.max(Z, A.value), Q);
720
+ J.rows = e, J.cols = t, f("insert", {
721
+ rows: e,
722
+ cols: t,
723
+ autofit: D.value === "autofit",
724
+ styleId: O.value
725
+ }), P();
726
+ }
727
+ return (t, n) => e.isOpen ? (p(), s("div", {
728
+ key: 0,
729
+ class: "dialog-overlay",
730
+ onMousedown: E(P, ["self"])
731
+ }, [c("div", {
732
+ class: "dialog",
733
+ onMousedown: n[7] ||= E(() => {}, ["stop"]),
734
+ onKeydown: E(I, ["stop"])
735
+ }, [
736
+ c("div", xt, [c("span", St, _(v(a)("dialogs.insertTable.title")), 1), c("button", {
737
+ class: "dialog__close",
738
+ title: v(a)("common.closeDialog"),
739
+ onClick: P
740
+ }, "✕", 8, Ct)]),
741
+ c("div", wt, [
742
+ c("div", {
743
+ class: "table-grid",
744
+ "aria-label": v(a)("dialogs.insertTable.sizeSelector"),
745
+ onMouseleave: n[0] ||= (e) => {
746
+ m.value = 0, b.value = 0;
747
+ }
748
+ }, [(p(), s(r, null, g(Rt, (e) => c("div", {
749
+ key: e,
750
+ class: "table-grid__row"
751
+ }, [(p(), s(r, null, g(zt, (t) => c("div", {
752
+ key: t,
753
+ class: d(["table-grid__cell", { highlight: e <= m.value && t <= b.value }]),
754
+ onMouseenter: (n) => {
755
+ m.value = e, b.value = t;
756
+ },
757
+ onMousedown: E((n) => F(e, t), ["prevent"])
758
+ }, null, 42, Et)), 64))])), 64))], 40, Tt),
759
+ c("div", Dt, _(m.value > 0 ? v(a)("dialogs.insertTable.tableSize", {
760
+ cols: b.value,
761
+ rows: m.value
762
+ }) : v(a)("dialogs.insertTable.hoverToSelect")), 1),
763
+ c("div", Ot, [c("span", null, _(v(a)("dialogs.insertTable.orSpecifySize")), 1)]),
764
+ c("div", kt, [c("label", At, [c("span", null, _(v(a)("dialogs.insertTable.rowsLabel")), 1), w(c("input", {
765
+ "onUpdate:modelValue": n[1] ||= (e) => C.value = e,
766
+ type: "number",
767
+ min: Y,
768
+ max: X,
769
+ class: d(["table-manual__input", { "table-manual__input--invalid": !j.value }])
770
+ }, null, 2), [[x, C.value]])]), c("label", jt, [c("span", null, _(v(a)("dialogs.insertTable.columnsLabel")), 1), w(c("input", {
771
+ "onUpdate:modelValue": n[2] ||= (e) => T.value = e,
772
+ type: "number",
773
+ min: Z,
774
+ max: Q,
775
+ class: d(["table-manual__input", { "table-manual__input--invalid": !M.value }])
776
+ }, null, 2), [[x, T.value]])])]),
777
+ c("div", { class: d(["table-manual__hint", { "table-manual__hint--error": !N.value }]) }, _(v(a)("dialogs.insertTable.validationHint", {
778
+ minRows: Y,
779
+ maxRows: X,
780
+ minCols: Z,
781
+ maxCols: Q
782
+ })), 3),
783
+ c("fieldset", Mt, [
784
+ c("legend", null, _(v(a)("dialogs.insertTable.columnWidthLabel")), 1),
785
+ c("label", Nt, [w(c("input", {
786
+ type: "radio",
787
+ value: "fixed",
788
+ "onUpdate:modelValue": n[3] ||= (e) => D.value = e
789
+ }, null, 512), [[y, D.value]]), c("span", null, _(v(a)("dialogs.insertTable.fixedWidth")), 1)]),
790
+ c("label", Pt, [w(c("input", {
791
+ type: "radio",
792
+ value: "autofit",
793
+ "onUpdate:modelValue": n[4] ||= (e) => D.value = e
794
+ }, null, 512), [[y, D.value]]), c("span", null, _(v(a)("dialogs.insertTable.autofit")), 1)])
795
+ ]),
796
+ c("div", Ft, [c("span", null, _(v(a)("dialogs.insertTable.style")), 1)]),
797
+ l(R, {
798
+ "current-style-id": O.value,
799
+ onApply: n[5] ||= (e) => O.value = e
800
+ }, null, 8, ["current-style-id"])
801
+ ]),
802
+ c("div", It, [c("button", {
803
+ class: "dialog__btn",
804
+ onMousedown: E(P, ["prevent"])
805
+ }, _(v(a)("common.cancel")), 33), c("button", {
806
+ class: "dialog__btn dialog__btn--primary",
807
+ disabled: !N.value,
808
+ onMousedown: n[6] ||= E((e) => L(), ["prevent"])
809
+ }, _(v(a)("dialogs.insertTable.insertButton")), 41, Lt)])
810
+ ], 32)], 32)) : o("", !0);
811
+ }
812
+ }), [["__scopeId", "data-v-a366a209"]]), $ = { class: "tpd-dialog__header" }, Vt = { class: "tpd-dialog__body" }, Ht = { class: "tpd-row" }, Ut = { class: "tpd-label" }, Wt = { value: "auto" }, Gt = { value: "dxa" }, Kt = { value: "pct" }, qt = {
813
+ key: 0,
814
+ class: "tpd-row"
815
+ }, Jt = { class: "tpd-label" }, Yt = ["step"], Xt = { class: "tpd-unit" }, Zt = { class: "tpd-row" }, Qt = { class: "tpd-label" }, $t = { value: "left" }, en = { value: "center" }, tn = { value: "right" }, nn = { class: "tpd-dialog__footer" }, rn = /*#__PURE__*/ e(/* @__PURE__ */ u({
816
+ __name: "TablePropertiesDialog",
817
+ props: {
818
+ isOpen: { type: Boolean },
819
+ currentProps: {}
820
+ },
821
+ emits: ["close", "apply"],
822
+ setup(e, { emit: r }) {
823
+ let { t: i } = t(), { Dialog: l } = n(), u = e, d = r, f = h(0), m = h("auto"), g = h("left");
824
+ function y(e) {
825
+ return e === "center" || e === "right" ? e : "left";
826
+ }
827
+ S(() => u.isOpen, (e) => {
828
+ e && (f.value = u.currentProps?.width ?? 0, m.value = u.currentProps?.widthType ?? "auto", g.value = y(u.currentProps?.justification));
829
+ });
830
+ function E() {
831
+ d("apply", m.value === "auto" ? {
832
+ justification: g.value,
833
+ width: null,
834
+ widthType: "auto"
835
+ } : {
836
+ justification: g.value,
837
+ width: f.value,
838
+ widthType: m.value
839
+ }), d("close");
840
+ }
841
+ return (t, n) => (p(), a(v(l), {
842
+ open: e.isOpen,
843
+ "aria-label": v(i)("dialogs.tableProperties.title"),
844
+ style: {
845
+ minWidth: "360px",
846
+ maxWidth: "440px",
847
+ width: "100%"
848
+ },
849
+ onClose: n[4] ||= (e) => t.$emit("close"),
850
+ onKeydown: T(E, ["enter"])
851
+ }, {
852
+ default: C(() => [
853
+ c("div", $, _(v(i)("dialogs.tableProperties.title")), 1),
854
+ c("div", Vt, [
855
+ c("div", Ht, [c("label", Ut, _(v(i)("dialogs.tableProperties.widthType")), 1), w(c("select", {
856
+ "onUpdate:modelValue": n[0] ||= (e) => m.value = e,
857
+ class: "tpd-select"
858
+ }, [
859
+ c("option", Wt, _(v(i)("dialogs.tableProperties.widthTypes.auto")), 1),
860
+ c("option", Gt, _(v(i)("dialogs.tableProperties.widthTypes.fixed")), 1),
861
+ c("option", Kt, _(v(i)("dialogs.tableProperties.widthTypes.percentage")), 1)
862
+ ], 512), [[b, m.value]])]),
863
+ m.value === "auto" ? o("", !0) : (p(), s("div", qt, [
864
+ c("label", Jt, _(v(i)("dialogs.tableProperties.widthLabel")), 1),
865
+ w(c("input", {
866
+ "onUpdate:modelValue": n[1] ||= (e) => f.value = e,
867
+ type: "number",
868
+ class: "tpd-input",
869
+ min: 0,
870
+ step: m.value === "pct" ? 5 : 100
871
+ }, null, 8, Yt), [[
872
+ x,
873
+ f.value,
874
+ void 0,
875
+ { number: !0 }
876
+ ]]),
877
+ c("span", Xt, _(m.value === "pct" ? v(i)("dialogs.tableProperties.units.fiftiethsPercent") : v(i)("dialogs.tableProperties.units.twips")), 1)
878
+ ])),
879
+ c("div", Zt, [c("label", Qt, _(v(i)("dialogs.tableProperties.alignmentLabel")), 1), w(c("select", {
880
+ "onUpdate:modelValue": n[2] ||= (e) => g.value = e,
881
+ class: "tpd-select"
882
+ }, [
883
+ c("option", $t, _(v(i)("dialogs.tableProperties.alignOptions.left")), 1),
884
+ c("option", en, _(v(i)("dialogs.tableProperties.alignOptions.center")), 1),
885
+ c("option", tn, _(v(i)("dialogs.tableProperties.alignOptions.right")), 1)
886
+ ], 512), [[b, g.value]])])
887
+ ]),
888
+ c("div", nn, [c("button", {
889
+ class: "tpd-btn",
890
+ onClick: n[3] ||= (e) => t.$emit("close")
891
+ }, _(v(i)("common.cancel")), 1), c("button", {
892
+ class: "tpd-btn tpd-btn--primary",
893
+ onClick: E
894
+ }, _(v(i)("common.apply")), 1)])
895
+ ]),
896
+ _: 1
897
+ }, 8, ["open", "aria-label"]));
898
+ }
899
+ }), [["__scopeId", "data-v-fb5280be"]]);
900
+ //#endregion
901
+ export { R as a, De as i, Bt as n, bt as r, rn as t };