@eigenpal/docx-editor-vue 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/KeyboardShortcutsDialog-Dohz9D39.cjs +1 -0
- package/dist/{KeyboardShortcutsDialog-BbuDgglK.js → KeyboardShortcutsDialog-OPAV0oVm.js} +351 -506
- package/dist/{MenuBar-CbONA9-a.js → MenuBar-BLKoZqG3.js} +813 -692
- package/dist/MenuBar-BP-XM0MI.cjs +4 -0
- package/dist/{TablePropertiesDialog-JWT68zEO.cjs → TablePropertiesDialog-B-FVOqkH.cjs} +1 -1
- package/dist/TablePropertiesDialog-B3oZIIjw.js +1145 -0
- package/dist/components/DocxEditor/types.d.ts +26 -0
- package/dist/components/Toolbar/presets.d.ts +0 -1
- package/dist/components/ui/fontPickerValue.d.ts +1 -0
- package/dist/components/ui/fontPickerValue.test.d.ts +1 -0
- package/dist/composables/imageOverlayRect.d.ts +44 -0
- package/dist/composables/imageOverlayRect.test.d.ts +1 -0
- package/dist/composables/useColorMode.d.ts +8 -0
- package/dist/composables/useCommentSidebarItems.test.d.ts +1 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +4 -0
- package/dist/composables/useFileIO.d.ts +5 -0
- package/dist/composables/useFormattingActions.d.ts +5 -2
- package/dist/composables/useImageActions.d.ts +0 -6
- package/dist/composables/useMenuActions.d.ts +3 -1
- package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
- package/dist/composables/useToolbarDropdowns.d.ts +1 -0
- package/dist/composables/useToolbarFontSize.d.ts +15 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +5 -4
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +3 -3
- package/dist/docx-editor-vue.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +1375 -1258
- package/dist/plugin-api.cjs +1 -1
- package/dist/plugin-api.js +1 -1
- package/dist/ui.cjs +2 -2
- package/dist/ui.js +253 -230
- package/dist/{useCommentSidebarItems-CbNvNCd3.cjs → useCommentSidebarItems-DBeGKNGA.cjs} +1 -1
- package/dist/{useCommentSidebarItems-BHomCzpj.js → useCommentSidebarItems-DXbF857R.js} +2 -1
- package/dist/{useDragAutoScroll-BNPB-6SM.js → useDragAutoScroll-B21Ec-Zy.js} +6 -7
- package/dist/useDragAutoScroll-BPnc7LEO.cjs +1 -0
- package/package.json +4 -4
- package/dist/KeyboardShortcutsDialog-Bct8AJ0i.cjs +0 -1
- package/dist/MenuBar-m0JEaF1X.cjs +0 -4
- package/dist/TablePropertiesDialog-D5MIF3cj.js +0 -987
- package/dist/useDragAutoScroll-DCUotwOX.cjs +0 -1
|
@@ -0,0 +1,1145 @@
|
|
|
1
|
+
import { f as e, u as t } from "./KeyboardShortcutsDialog-OPAV0oVm.js";
|
|
2
|
+
import { t as n } from "./_plugin-vue_export-helper-B52Kst-M.js";
|
|
3
|
+
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode 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, vModelCheckbox as y, vModelRadio as b, vModelSelect as x, vModelText as S, watch as C, withDirectives as w, withKeys as T, withModifiers as E } from "vue";
|
|
4
|
+
//#region src/components/tableStylePresets.ts
|
|
5
|
+
var D = (e) => ({
|
|
6
|
+
style: "single",
|
|
7
|
+
size: 4,
|
|
8
|
+
color: { rgb: e }
|
|
9
|
+
}), O = [
|
|
10
|
+
{
|
|
11
|
+
id: "TableNormal",
|
|
12
|
+
name: "Normal Table",
|
|
13
|
+
look: {
|
|
14
|
+
firstRow: !1,
|
|
15
|
+
lastRow: !1,
|
|
16
|
+
noHBand: !0,
|
|
17
|
+
noVBand: !0
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "TableGrid",
|
|
22
|
+
name: "Table Grid",
|
|
23
|
+
tableBorders: {
|
|
24
|
+
top: D("000000"),
|
|
25
|
+
bottom: D("000000"),
|
|
26
|
+
left: D("000000"),
|
|
27
|
+
right: D("000000"),
|
|
28
|
+
insideH: D("000000"),
|
|
29
|
+
insideV: D("000000")
|
|
30
|
+
},
|
|
31
|
+
look: {
|
|
32
|
+
firstRow: !1,
|
|
33
|
+
lastRow: !1,
|
|
34
|
+
noHBand: !0,
|
|
35
|
+
noVBand: !0
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "TableGridLight",
|
|
40
|
+
name: "Grid Table Light",
|
|
41
|
+
tableBorders: {
|
|
42
|
+
top: D("BFBFBF"),
|
|
43
|
+
bottom: D("BFBFBF"),
|
|
44
|
+
left: D("BFBFBF"),
|
|
45
|
+
right: D("BFBFBF"),
|
|
46
|
+
insideH: D("BFBFBF"),
|
|
47
|
+
insideV: D("BFBFBF")
|
|
48
|
+
},
|
|
49
|
+
look: {
|
|
50
|
+
firstRow: !0,
|
|
51
|
+
lastRow: !1,
|
|
52
|
+
noHBand: !0,
|
|
53
|
+
noVBand: !0
|
|
54
|
+
},
|
|
55
|
+
conditionals: { firstRow: {
|
|
56
|
+
bold: !0,
|
|
57
|
+
borders: { bottom: D("000000") }
|
|
58
|
+
} }
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "PlainTable1",
|
|
62
|
+
name: "Plain Table 1",
|
|
63
|
+
tableBorders: {
|
|
64
|
+
top: D("BFBFBF"),
|
|
65
|
+
bottom: D("BFBFBF"),
|
|
66
|
+
insideH: D("BFBFBF")
|
|
67
|
+
},
|
|
68
|
+
look: {
|
|
69
|
+
firstRow: !0,
|
|
70
|
+
lastRow: !1,
|
|
71
|
+
noHBand: !0,
|
|
72
|
+
noVBand: !0
|
|
73
|
+
},
|
|
74
|
+
conditionals: { firstRow: { bold: !0 } }
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "PlainTable2",
|
|
78
|
+
name: "Plain Table 2",
|
|
79
|
+
look: {
|
|
80
|
+
firstRow: !0,
|
|
81
|
+
lastRow: !1,
|
|
82
|
+
noHBand: !1,
|
|
83
|
+
noVBand: !0
|
|
84
|
+
},
|
|
85
|
+
conditionals: {
|
|
86
|
+
firstRow: {
|
|
87
|
+
bold: !0,
|
|
88
|
+
borders: { bottom: D("7F7F7F") }
|
|
89
|
+
},
|
|
90
|
+
band1Horz: { backgroundColor: "#F2F2F2" }
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "PlainTable3",
|
|
95
|
+
name: "Plain Table 3",
|
|
96
|
+
look: {
|
|
97
|
+
firstRow: !0,
|
|
98
|
+
lastRow: !1,
|
|
99
|
+
noHBand: !1,
|
|
100
|
+
noVBand: !0
|
|
101
|
+
},
|
|
102
|
+
conditionals: {
|
|
103
|
+
firstRow: {
|
|
104
|
+
bold: !0,
|
|
105
|
+
color: "#FFFFFF",
|
|
106
|
+
backgroundColor: "#A5A5A5"
|
|
107
|
+
},
|
|
108
|
+
band1Horz: { backgroundColor: "#E7E7E7" }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "PlainTable4",
|
|
113
|
+
name: "Plain Table 4",
|
|
114
|
+
look: {
|
|
115
|
+
firstRow: !0,
|
|
116
|
+
lastRow: !1,
|
|
117
|
+
noHBand: !1,
|
|
118
|
+
noVBand: !0
|
|
119
|
+
},
|
|
120
|
+
conditionals: {
|
|
121
|
+
firstRow: {
|
|
122
|
+
bold: !0,
|
|
123
|
+
color: "#FFFFFF",
|
|
124
|
+
backgroundColor: "#000000"
|
|
125
|
+
},
|
|
126
|
+
band1Horz: { backgroundColor: "#F2F2F2" }
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "GridTable1Light-Accent1",
|
|
131
|
+
name: "Grid Table 1 Light",
|
|
132
|
+
tableBorders: {
|
|
133
|
+
top: D("B4C6E7"),
|
|
134
|
+
bottom: D("B4C6E7"),
|
|
135
|
+
left: D("B4C6E7"),
|
|
136
|
+
right: D("B4C6E7"),
|
|
137
|
+
insideH: D("B4C6E7"),
|
|
138
|
+
insideV: D("B4C6E7")
|
|
139
|
+
},
|
|
140
|
+
look: {
|
|
141
|
+
firstRow: !0,
|
|
142
|
+
lastRow: !1,
|
|
143
|
+
noHBand: !0,
|
|
144
|
+
noVBand: !0
|
|
145
|
+
},
|
|
146
|
+
conditionals: { firstRow: {
|
|
147
|
+
bold: !0,
|
|
148
|
+
borders: { bottom: D("4472C4") }
|
|
149
|
+
} }
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "GridTable4-Accent1",
|
|
153
|
+
name: "Grid Table 4 Accent 1",
|
|
154
|
+
tableBorders: {
|
|
155
|
+
top: D("4472C4"),
|
|
156
|
+
bottom: D("4472C4"),
|
|
157
|
+
left: D("4472C4"),
|
|
158
|
+
right: D("4472C4"),
|
|
159
|
+
insideH: D("4472C4"),
|
|
160
|
+
insideV: D("4472C4")
|
|
161
|
+
},
|
|
162
|
+
look: {
|
|
163
|
+
firstRow: !0,
|
|
164
|
+
lastRow: !1,
|
|
165
|
+
noHBand: !1,
|
|
166
|
+
noVBand: !0
|
|
167
|
+
},
|
|
168
|
+
conditionals: {
|
|
169
|
+
firstRow: {
|
|
170
|
+
bold: !0,
|
|
171
|
+
color: "#FFFFFF",
|
|
172
|
+
backgroundColor: "#4472C4"
|
|
173
|
+
},
|
|
174
|
+
band1Horz: { backgroundColor: "#D6E4F0" }
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "GridTable5Dark-Accent1",
|
|
179
|
+
name: "Grid Table 5 Dark",
|
|
180
|
+
tableBorders: {
|
|
181
|
+
top: D("FFFFFF"),
|
|
182
|
+
bottom: D("FFFFFF"),
|
|
183
|
+
left: D("FFFFFF"),
|
|
184
|
+
right: D("FFFFFF"),
|
|
185
|
+
insideH: D("FFFFFF"),
|
|
186
|
+
insideV: D("FFFFFF")
|
|
187
|
+
},
|
|
188
|
+
look: {
|
|
189
|
+
firstRow: !0,
|
|
190
|
+
lastRow: !1,
|
|
191
|
+
noHBand: !1,
|
|
192
|
+
noVBand: !0
|
|
193
|
+
},
|
|
194
|
+
conditionals: {
|
|
195
|
+
firstRow: {
|
|
196
|
+
bold: !0,
|
|
197
|
+
color: "#FFFFFF",
|
|
198
|
+
backgroundColor: "#4472C4"
|
|
199
|
+
},
|
|
200
|
+
band1Horz: { backgroundColor: "#D6E4F0" },
|
|
201
|
+
band2Horz: { backgroundColor: "#B4C6E7" }
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: "ListTable3-Accent2",
|
|
206
|
+
name: "List Table 3 Accent 2",
|
|
207
|
+
tableBorders: {
|
|
208
|
+
top: D("ED7D31"),
|
|
209
|
+
bottom: D("ED7D31")
|
|
210
|
+
},
|
|
211
|
+
look: {
|
|
212
|
+
firstRow: !0,
|
|
213
|
+
lastRow: !1,
|
|
214
|
+
noHBand: !1,
|
|
215
|
+
noVBand: !0
|
|
216
|
+
},
|
|
217
|
+
conditionals: {
|
|
218
|
+
firstRow: {
|
|
219
|
+
bold: !0,
|
|
220
|
+
color: "#FFFFFF",
|
|
221
|
+
backgroundColor: "#ED7D31"
|
|
222
|
+
},
|
|
223
|
+
band1Horz: { backgroundColor: "#FBE4D5" }
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: "ListTable4-Accent3",
|
|
228
|
+
name: "List Table 4 Accent 3",
|
|
229
|
+
tableBorders: {
|
|
230
|
+
top: D("A5A5A5"),
|
|
231
|
+
bottom: D("A5A5A5"),
|
|
232
|
+
insideH: D("A5A5A5")
|
|
233
|
+
},
|
|
234
|
+
look: {
|
|
235
|
+
firstRow: !0,
|
|
236
|
+
lastRow: !1,
|
|
237
|
+
noHBand: !1,
|
|
238
|
+
noVBand: !0
|
|
239
|
+
},
|
|
240
|
+
conditionals: {
|
|
241
|
+
firstRow: {
|
|
242
|
+
bold: !0,
|
|
243
|
+
color: "#FFFFFF",
|
|
244
|
+
backgroundColor: "#A5A5A5"
|
|
245
|
+
},
|
|
246
|
+
band1Horz: { backgroundColor: "#EDEDED" }
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "GridTable4-Accent5",
|
|
251
|
+
name: "Grid Table 4 Accent 5",
|
|
252
|
+
tableBorders: {
|
|
253
|
+
top: D("5B9BD5"),
|
|
254
|
+
bottom: D("5B9BD5"),
|
|
255
|
+
left: D("5B9BD5"),
|
|
256
|
+
right: D("5B9BD5"),
|
|
257
|
+
insideH: D("5B9BD5"),
|
|
258
|
+
insideV: D("5B9BD5")
|
|
259
|
+
},
|
|
260
|
+
look: {
|
|
261
|
+
firstRow: !0,
|
|
262
|
+
lastRow: !1,
|
|
263
|
+
noHBand: !1,
|
|
264
|
+
noVBand: !0
|
|
265
|
+
},
|
|
266
|
+
conditionals: {
|
|
267
|
+
firstRow: {
|
|
268
|
+
bold: !0,
|
|
269
|
+
color: "#FFFFFF",
|
|
270
|
+
backgroundColor: "#5B9BD5"
|
|
271
|
+
},
|
|
272
|
+
band1Horz: { backgroundColor: "#DEEAF6" }
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
id: "GridTable4-Accent6",
|
|
277
|
+
name: "Grid Table 4 Accent 6",
|
|
278
|
+
tableBorders: {
|
|
279
|
+
top: D("70AD47"),
|
|
280
|
+
bottom: D("70AD47"),
|
|
281
|
+
left: D("70AD47"),
|
|
282
|
+
right: D("70AD47"),
|
|
283
|
+
insideH: D("70AD47"),
|
|
284
|
+
insideV: D("70AD47")
|
|
285
|
+
},
|
|
286
|
+
look: {
|
|
287
|
+
firstRow: !0,
|
|
288
|
+
lastRow: !1,
|
|
289
|
+
noHBand: !1,
|
|
290
|
+
noVBand: !0
|
|
291
|
+
},
|
|
292
|
+
conditionals: {
|
|
293
|
+
firstRow: {
|
|
294
|
+
bold: !0,
|
|
295
|
+
color: "#FFFFFF",
|
|
296
|
+
backgroundColor: "#70AD47"
|
|
297
|
+
},
|
|
298
|
+
band1Horz: { backgroundColor: "#E2EFDA" }
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
], k = {
|
|
302
|
+
TableNormal: "table.styles.normalTable",
|
|
303
|
+
TableGrid: "table.styles.tableGrid",
|
|
304
|
+
TableGridLight: "table.styles.gridTableLight",
|
|
305
|
+
PlainTable1: "table.styles.plainTable1",
|
|
306
|
+
PlainTable2: "table.styles.plainTable2",
|
|
307
|
+
PlainTable3: "table.styles.plainTable3",
|
|
308
|
+
PlainTable4: "table.styles.plainTable4",
|
|
309
|
+
"GridTable1Light-Accent1": "table.styles.gridTable1Light",
|
|
310
|
+
"GridTable4-Accent1": "table.styles.gridTable4Accent1",
|
|
311
|
+
"GridTable5Dark-Accent1": "table.styles.gridTable5Dark",
|
|
312
|
+
"ListTable3-Accent2": "table.styles.listTable3Accent2",
|
|
313
|
+
"ListTable4-Accent3": "table.styles.listTable4Accent3",
|
|
314
|
+
"GridTable4-Accent5": "table.styles.gridTable4Accent5",
|
|
315
|
+
"GridTable4-Accent6": "table.styles.gridTable4Accent6"
|
|
316
|
+
}, A = 4, j = 3;
|
|
317
|
+
function M(e) {
|
|
318
|
+
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"}`;
|
|
319
|
+
}
|
|
320
|
+
function N(e, t = A, n = j) {
|
|
321
|
+
let r = e.look ?? {}, i = e.conditionals ?? {}, a = e.tableBorders, o = [], s = 0;
|
|
322
|
+
for (let e = 0; e < t; e++) {
|
|
323
|
+
let c = e === 0 && !!r.firstRow, l = e === t - 1 && !!r.lastRow, u = r.noHBand !== !0, d;
|
|
324
|
+
c ? d = "firstRow" : l ? d = "lastRow" : (u && (d = s % 2 == 0 ? "band1Horz" : "band2Horz"), s++);
|
|
325
|
+
for (let s = 0; s < n; s++) {
|
|
326
|
+
let u = d, f = s === 0 && !!r.firstCol, p = s === n - 1 && !!r.lastCol;
|
|
327
|
+
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");
|
|
328
|
+
let m = u ? i[u] : void 0, h = m?.borders, g = {
|
|
329
|
+
width: "20px",
|
|
330
|
+
height: "10px",
|
|
331
|
+
boxSizing: "border-box",
|
|
332
|
+
backgroundColor: m?.backgroundColor ?? "transparent",
|
|
333
|
+
borderTop: h?.top === void 0 ? M(e > 0 ? a?.insideH ?? a?.top : a?.top) : M(h.top),
|
|
334
|
+
borderBottom: h?.bottom === void 0 ? e < t - 1 ? M(a?.insideH ?? a?.bottom) : M(a?.bottom) : M(h.bottom),
|
|
335
|
+
borderLeft: h?.left === void 0 ? M(s > 0 ? a?.insideV ?? a?.left : a?.left) : M(h.left),
|
|
336
|
+
borderRight: h?.right === void 0 ? s < n - 1 ? M(a?.insideV ?? a?.right) : M(a?.right) : M(h.right)
|
|
337
|
+
};
|
|
338
|
+
o.push(g);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return o;
|
|
342
|
+
}
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/components/ui/TableStyleGallery.vue?vue&type=script&setup=true&lang.ts
|
|
345
|
+
var P = { class: "tsg" }, F = { class: "tsg__grid" }, I = ["title", "onMousedown"], L = { class: "tsg__preview" }, R = { class: "tsg__name" }, z = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
346
|
+
__name: "TableStyleGallery",
|
|
347
|
+
props: { currentStyleId: {} },
|
|
348
|
+
emits: ["apply"],
|
|
349
|
+
setup(e) {
|
|
350
|
+
let { t: n } = t(), i = O;
|
|
351
|
+
function a(e) {
|
|
352
|
+
let t = k[e.id];
|
|
353
|
+
return t ? n(t) : e.name;
|
|
354
|
+
}
|
|
355
|
+
return (t, n) => (p(), o("div", P, [s("div", F, [(p(!0), o(r, null, g(v(i), (n) => (p(), o("button", {
|
|
356
|
+
key: n.id,
|
|
357
|
+
class: d(["tsg__item", { "tsg__item--selected": e.currentStyleId === n.id }]),
|
|
358
|
+
title: a(n),
|
|
359
|
+
onMousedown: E((e) => t.$emit("apply", n.id), ["prevent"])
|
|
360
|
+
}, [s("div", L, [(p(!0), o(r, null, g(v(N)(n), (e, t) => (p(), o("div", {
|
|
361
|
+
key: t,
|
|
362
|
+
class: "tsg__cell",
|
|
363
|
+
style: f(e)
|
|
364
|
+
}, null, 4))), 128))]), s("span", R, _(a(n)), 1)], 42, I))), 128))])]));
|
|
365
|
+
}
|
|
366
|
+
}), [["__scopeId", "data-v-fad5fdfb"]]), ee = { class: "fnpd-dialog__header" }, te = { class: "fnpd-dialog__body" }, ne = { class: "fnpd-fieldset" }, re = { class: "fnpd-legend" }, ie = { class: "fnpd-row" }, ae = { class: "fnpd-label" }, oe = { value: "pageBottom" }, B = { value: "beneathText" }, V = { class: "fnpd-row" }, H = { class: "fnpd-label" }, U = ["value"], W = { class: "fnpd-row" }, G = { class: "fnpd-label" }, K = { class: "fnpd-row" }, q = { class: "fnpd-label" }, se = { value: "continuous" }, ce = { value: "eachSect" }, le = { value: "eachPage" }, ue = { class: "fnpd-fieldset" }, de = { class: "fnpd-legend" }, fe = { class: "fnpd-row" }, pe = { class: "fnpd-label" }, me = { value: "docEnd" }, he = { value: "sectEnd" }, ge = { class: "fnpd-row" }, _e = { class: "fnpd-label" }, ve = ["value"], ye = { class: "fnpd-row" }, be = { class: "fnpd-label" }, xe = { class: "fnpd-row" }, Se = { class: "fnpd-label" }, Ce = { value: "continuous" }, we = { value: "eachSect" }, Te = { class: "fnpd-dialog__footer" }, Ee = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
367
|
+
__name: "FootnotePropertiesDialog",
|
|
368
|
+
props: {
|
|
369
|
+
isOpen: { type: Boolean },
|
|
370
|
+
footnotePr: {},
|
|
371
|
+
endnotePr: {}
|
|
372
|
+
},
|
|
373
|
+
emits: ["close", "apply"],
|
|
374
|
+
setup(e, { emit: n }) {
|
|
375
|
+
let { t: c } = t(), l = e, u = n, d = i(() => [
|
|
376
|
+
{
|
|
377
|
+
value: "decimal",
|
|
378
|
+
label: c("dialogs.footnoteProperties.formats.decimal")
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
value: "lowerLetter",
|
|
382
|
+
label: c("dialogs.footnoteProperties.formats.lowerAlpha")
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
value: "upperLetter",
|
|
386
|
+
label: c("dialogs.footnoteProperties.formats.upperAlpha")
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
value: "lowerRoman",
|
|
390
|
+
label: c("dialogs.footnoteProperties.formats.lowerRoman")
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
value: "upperRoman",
|
|
394
|
+
label: c("dialogs.footnoteProperties.formats.upperRoman")
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
value: "chicago",
|
|
398
|
+
label: c("dialogs.footnoteProperties.formats.symbols")
|
|
399
|
+
}
|
|
400
|
+
]), f = h("pageBottom"), m = h("decimal"), y = h(1), b = h("continuous"), D = h("docEnd"), O = h("lowerRoman"), k = h(1), A = h("continuous");
|
|
401
|
+
C(() => l.isOpen, (e) => {
|
|
402
|
+
e && (f.value = l.footnotePr?.position ?? "pageBottom", m.value = l.footnotePr?.numFmt ?? "decimal", y.value = l.footnotePr?.numStart ?? 1, b.value = l.footnotePr?.numRestart ?? "continuous", D.value = l.endnotePr?.position ?? "docEnd", O.value = l.endnotePr?.numFmt ?? "lowerRoman", k.value = l.endnotePr?.numStart ?? 1, A.value = l.endnotePr?.numRestart ?? "continuous");
|
|
403
|
+
});
|
|
404
|
+
function j() {
|
|
405
|
+
u("apply", {
|
|
406
|
+
position: f.value,
|
|
407
|
+
numFmt: m.value,
|
|
408
|
+
numStart: y.value,
|
|
409
|
+
numRestart: b.value
|
|
410
|
+
}, {
|
|
411
|
+
position: D.value,
|
|
412
|
+
numFmt: O.value,
|
|
413
|
+
numStart: k.value,
|
|
414
|
+
numRestart: A.value
|
|
415
|
+
}), u("close");
|
|
416
|
+
}
|
|
417
|
+
return (t, n) => e.isOpen ? (p(), o("div", {
|
|
418
|
+
key: 0,
|
|
419
|
+
class: "fnpd-overlay",
|
|
420
|
+
onMousedown: n[10] ||= E((e) => t.$emit("close"), ["self"])
|
|
421
|
+
}, [s("div", {
|
|
422
|
+
class: "fnpd-dialog",
|
|
423
|
+
onKeydown: n[9] ||= T((e) => t.$emit("close"), ["escape"])
|
|
424
|
+
}, [
|
|
425
|
+
s("div", ee, _(v(c)("dialogs.footnoteProperties.title")), 1),
|
|
426
|
+
s("div", te, [s("fieldset", ne, [
|
|
427
|
+
s("legend", re, _(v(c)("dialogs.footnoteProperties.footnotes")), 1),
|
|
428
|
+
s("div", ie, [s("label", ae, _(v(c)("dialogs.footnoteProperties.position")), 1), w(s("select", {
|
|
429
|
+
"onUpdate:modelValue": n[0] ||= (e) => f.value = e,
|
|
430
|
+
class: "fnpd-select"
|
|
431
|
+
}, [s("option", oe, _(v(c)("dialogs.footnoteProperties.footnotePositions.bottomOfPage")), 1), s("option", B, _(v(c)("dialogs.footnoteProperties.footnotePositions.belowText")), 1)], 512), [[x, f.value]])]),
|
|
432
|
+
s("div", V, [s("label", H, _(v(c)("dialogs.footnoteProperties.numberFormat")), 1), w(s("select", {
|
|
433
|
+
"onUpdate:modelValue": n[1] ||= (e) => m.value = e,
|
|
434
|
+
class: "fnpd-select"
|
|
435
|
+
}, [(p(!0), o(r, null, g(d.value, (e) => (p(), o("option", {
|
|
436
|
+
key: e.value,
|
|
437
|
+
value: e.value
|
|
438
|
+
}, _(e.label), 9, U))), 128))], 512), [[x, m.value]])]),
|
|
439
|
+
s("div", W, [s("label", G, _(v(c)("dialogs.footnoteProperties.startAt")), 1), w(s("input", {
|
|
440
|
+
"onUpdate:modelValue": n[2] ||= (e) => y.value = e,
|
|
441
|
+
type: "number",
|
|
442
|
+
class: "fnpd-input",
|
|
443
|
+
min: "1"
|
|
444
|
+
}, null, 512), [[
|
|
445
|
+
S,
|
|
446
|
+
y.value,
|
|
447
|
+
void 0,
|
|
448
|
+
{ number: !0 }
|
|
449
|
+
]])]),
|
|
450
|
+
s("div", K, [s("label", q, _(v(c)("dialogs.footnoteProperties.numbering")), 1), w(s("select", {
|
|
451
|
+
"onUpdate:modelValue": n[3] ||= (e) => b.value = e,
|
|
452
|
+
class: "fnpd-select"
|
|
453
|
+
}, [
|
|
454
|
+
s("option", se, _(v(c)("dialogs.footnoteProperties.numberingOptions.continuous")), 1),
|
|
455
|
+
s("option", ce, _(v(c)("dialogs.footnoteProperties.numberingOptions.restartSection")), 1),
|
|
456
|
+
s("option", le, _(v(c)("dialogs.footnoteProperties.numberingOptions.restartPage")), 1)
|
|
457
|
+
], 512), [[x, b.value]])])
|
|
458
|
+
]), s("fieldset", ue, [
|
|
459
|
+
s("legend", de, _(v(c)("dialogs.footnoteProperties.endnotes")), 1),
|
|
460
|
+
s("div", fe, [s("label", pe, _(v(c)("dialogs.footnoteProperties.position")), 1), w(s("select", {
|
|
461
|
+
"onUpdate:modelValue": n[4] ||= (e) => D.value = e,
|
|
462
|
+
class: "fnpd-select"
|
|
463
|
+
}, [s("option", me, _(v(c)("dialogs.footnoteProperties.endnotePositions.endOfDocument")), 1), s("option", he, _(v(c)("dialogs.footnoteProperties.endnotePositions.endOfSection")), 1)], 512), [[x, D.value]])]),
|
|
464
|
+
s("div", ge, [s("label", _e, _(v(c)("dialogs.footnoteProperties.numberFormat")), 1), w(s("select", {
|
|
465
|
+
"onUpdate:modelValue": n[5] ||= (e) => O.value = e,
|
|
466
|
+
class: "fnpd-select"
|
|
467
|
+
}, [(p(!0), o(r, null, g(d.value, (e) => (p(), o("option", {
|
|
468
|
+
key: e.value,
|
|
469
|
+
value: e.value
|
|
470
|
+
}, _(e.label), 9, ve))), 128))], 512), [[x, O.value]])]),
|
|
471
|
+
s("div", ye, [s("label", be, _(v(c)("dialogs.footnoteProperties.startAt")), 1), w(s("input", {
|
|
472
|
+
"onUpdate:modelValue": n[6] ||= (e) => k.value = e,
|
|
473
|
+
type: "number",
|
|
474
|
+
class: "fnpd-input",
|
|
475
|
+
min: "1"
|
|
476
|
+
}, null, 512), [[
|
|
477
|
+
S,
|
|
478
|
+
k.value,
|
|
479
|
+
void 0,
|
|
480
|
+
{ number: !0 }
|
|
481
|
+
]])]),
|
|
482
|
+
s("div", xe, [s("label", Se, _(v(c)("dialogs.footnoteProperties.numbering")), 1), w(s("select", {
|
|
483
|
+
"onUpdate:modelValue": n[7] ||= (e) => A.value = e,
|
|
484
|
+
class: "fnpd-select"
|
|
485
|
+
}, [s("option", Ce, _(v(c)("dialogs.footnoteProperties.numberingOptions.continuous")), 1), s("option", we, _(v(c)("dialogs.footnoteProperties.numberingOptions.restartSection")), 1)], 512), [[x, A.value]])])
|
|
486
|
+
])]),
|
|
487
|
+
s("div", Te, [s("button", {
|
|
488
|
+
class: "fnpd-btn",
|
|
489
|
+
onClick: n[8] ||= (e) => t.$emit("close")
|
|
490
|
+
}, _(v(c)("common.cancel")), 1), s("button", {
|
|
491
|
+
class: "fnpd-btn fnpd-btn--primary",
|
|
492
|
+
onClick: j
|
|
493
|
+
}, _(v(c)("common.apply")), 1)])
|
|
494
|
+
], 32)], 32)) : a("", !0);
|
|
495
|
+
}
|
|
496
|
+
}), [["__scopeId", "data-v-77c85a25"]]), De = { class: "ipd-dialog__header" }, Oe = { class: "ipd-dialog__body" }, ke = { class: "ipd-fieldset" }, Ae = { class: "ipd-legend" }, je = { class: "ipd-row" }, Me = { value: "align" }, Ne = { value: "offset" }, Pe = {
|
|
497
|
+
key: 0,
|
|
498
|
+
class: "ipd-row"
|
|
499
|
+
}, Fe = { class: "ipd-label" }, Ie = { value: "left" }, Le = { value: "center" }, Re = { value: "right" }, ze = {
|
|
500
|
+
key: 1,
|
|
501
|
+
class: "ipd-row"
|
|
502
|
+
}, Be = { class: "ipd-label" }, Ve = { class: "ipd-row" }, He = { class: "ipd-label" }, Ue = { value: "page" }, We = { value: "column" }, Ge = { value: "margin" }, Ke = { value: "character" }, qe = { class: "ipd-fieldset" }, Je = { class: "ipd-legend" }, Ye = { class: "ipd-row" }, Xe = { value: "align" }, Ze = { value: "offset" }, Qe = {
|
|
503
|
+
key: 0,
|
|
504
|
+
class: "ipd-row"
|
|
505
|
+
}, $e = { class: "ipd-label" }, et = { value: "top" }, tt = { value: "center" }, nt = { value: "bottom" }, rt = {
|
|
506
|
+
key: 1,
|
|
507
|
+
class: "ipd-row"
|
|
508
|
+
}, it = { class: "ipd-label" }, at = { class: "ipd-row" }, ot = { class: "ipd-label" }, st = { value: "page" }, ct = { value: "margin" }, lt = { value: "paragraph" }, ut = { value: "line" }, dt = { class: "ipd-fieldset" }, ft = { class: "ipd-row" }, pt = { class: "ipd-label" }, mt = {
|
|
509
|
+
class: "ipd-label",
|
|
510
|
+
style: { width: "60px" }
|
|
511
|
+
}, ht = { class: "ipd-row" }, gt = { class: "ipd-label" }, _t = {
|
|
512
|
+
class: "ipd-label",
|
|
513
|
+
style: { width: "60px" }
|
|
514
|
+
}, vt = { class: "ipd-dialog__footer" }, yt = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
515
|
+
__name: "ImagePositionDialog",
|
|
516
|
+
props: {
|
|
517
|
+
isOpen: { type: Boolean },
|
|
518
|
+
currentData: {}
|
|
519
|
+
},
|
|
520
|
+
emits: ["close", "apply"],
|
|
521
|
+
setup(e, { emit: n }) {
|
|
522
|
+
let { t: r } = t(), i = e, c = n, l = h("align"), u = h("left"), d = h(0), f = h("column"), m = h("align"), g = h("top"), y = h(0), b = h("paragraph"), D = h(0), O = h(0), k = h(0), A = h(0);
|
|
523
|
+
C(() => i.isOpen, (e) => {
|
|
524
|
+
if (!e) return;
|
|
525
|
+
let t = i.currentData;
|
|
526
|
+
t?.horizontal?.align ? (l.value = "align", u.value = t.horizontal.align) : t?.horizontal?.posOffset != null && (l.value = "offset", d.value = t.horizontal.posOffset), f.value = t?.horizontal?.relativeTo ?? "column", t?.vertical?.align ? (m.value = "align", g.value = t.vertical.align) : t?.vertical?.posOffset != null && (m.value = "offset", y.value = t.vertical.posOffset), b.value = t?.vertical?.relativeTo ?? "paragraph", D.value = t?.distTop ?? 0, O.value = t?.distBottom ?? 0, k.value = t?.distLeft ?? 0, A.value = t?.distRight ?? 0;
|
|
527
|
+
});
|
|
528
|
+
function j() {
|
|
529
|
+
c("apply", {
|
|
530
|
+
horizontal: {
|
|
531
|
+
relativeTo: f.value,
|
|
532
|
+
...l.value === "align" ? { align: u.value } : { posOffset: d.value }
|
|
533
|
+
},
|
|
534
|
+
vertical: {
|
|
535
|
+
relativeTo: b.value,
|
|
536
|
+
...m.value === "align" ? { align: g.value } : { posOffset: y.value }
|
|
537
|
+
},
|
|
538
|
+
distTop: D.value,
|
|
539
|
+
distBottom: O.value,
|
|
540
|
+
distLeft: k.value,
|
|
541
|
+
distRight: A.value
|
|
542
|
+
}), c("close");
|
|
543
|
+
}
|
|
544
|
+
return (t, n) => e.isOpen ? (p(), o("div", {
|
|
545
|
+
key: 0,
|
|
546
|
+
class: "ipd-overlay",
|
|
547
|
+
onMousedown: n[14] ||= E((e) => t.$emit("close"), ["self"])
|
|
548
|
+
}, [s("div", {
|
|
549
|
+
class: "ipd-dialog",
|
|
550
|
+
onKeydown: n[13] ||= T((e) => t.$emit("close"), ["escape"])
|
|
551
|
+
}, [
|
|
552
|
+
s("div", De, _(v(r)("dialogs.imagePosition.title")), 1),
|
|
553
|
+
s("div", Oe, [
|
|
554
|
+
s("fieldset", ke, [
|
|
555
|
+
s("legend", Ae, _(v(r)("dialogs.imagePosition.horizontal")), 1),
|
|
556
|
+
s("div", je, [n[15] ||= s("label", { class: "ipd-label" }, "Mode", -1), w(s("select", {
|
|
557
|
+
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
558
|
+
class: "ipd-select"
|
|
559
|
+
}, [s("option", Me, _(v(r)("dialogs.imagePosition.alignment")), 1), s("option", Ne, _(v(r)("dialogs.imagePosition.offset")), 1)], 512), [[x, l.value]])]),
|
|
560
|
+
l.value === "align" ? (p(), o("div", Pe, [s("label", Fe, _(v(r)("dialogs.imagePosition.align")), 1), w(s("select", {
|
|
561
|
+
"onUpdate:modelValue": n[1] ||= (e) => u.value = e,
|
|
562
|
+
class: "ipd-select"
|
|
563
|
+
}, [
|
|
564
|
+
s("option", Ie, _(v(r)("dialogs.imagePosition.alignOptions.left")), 1),
|
|
565
|
+
s("option", Le, _(v(r)("dialogs.imagePosition.alignOptions.center")), 1),
|
|
566
|
+
s("option", Re, _(v(r)("dialogs.imagePosition.alignOptions.right")), 1)
|
|
567
|
+
], 512), [[x, u.value]])])) : (p(), o("div", ze, [s("label", Be, _(v(r)("dialogs.imagePosition.offsetPx")), 1), w(s("input", {
|
|
568
|
+
"onUpdate:modelValue": n[2] ||= (e) => d.value = e,
|
|
569
|
+
type: "number",
|
|
570
|
+
class: "ipd-input"
|
|
571
|
+
}, null, 512), [[
|
|
572
|
+
S,
|
|
573
|
+
d.value,
|
|
574
|
+
void 0,
|
|
575
|
+
{ number: !0 }
|
|
576
|
+
]])])),
|
|
577
|
+
s("div", Ve, [s("label", He, _(v(r)("dialogs.imagePosition.relativeTo")), 1), w(s("select", {
|
|
578
|
+
"onUpdate:modelValue": n[3] ||= (e) => f.value = e,
|
|
579
|
+
class: "ipd-select"
|
|
580
|
+
}, [
|
|
581
|
+
s("option", Ue, _(v(r)("dialogs.imagePosition.relativeOptions.page")), 1),
|
|
582
|
+
s("option", We, _(v(r)("dialogs.imagePosition.relativeOptions.column")), 1),
|
|
583
|
+
s("option", Ge, _(v(r)("dialogs.imagePosition.relativeOptions.margin")), 1),
|
|
584
|
+
s("option", Ke, _(v(r)("dialogs.imagePosition.relativeOptions.character")), 1)
|
|
585
|
+
], 512), [[x, f.value]])])
|
|
586
|
+
]),
|
|
587
|
+
s("fieldset", qe, [
|
|
588
|
+
s("legend", Je, _(v(r)("dialogs.imagePosition.vertical")), 1),
|
|
589
|
+
s("div", Ye, [n[16] ||= s("label", { class: "ipd-label" }, "Mode", -1), w(s("select", {
|
|
590
|
+
"onUpdate:modelValue": n[4] ||= (e) => m.value = e,
|
|
591
|
+
class: "ipd-select"
|
|
592
|
+
}, [s("option", Xe, _(v(r)("dialogs.imagePosition.alignment")), 1), s("option", Ze, _(v(r)("dialogs.imagePosition.offset")), 1)], 512), [[x, m.value]])]),
|
|
593
|
+
m.value === "align" ? (p(), o("div", Qe, [s("label", $e, _(v(r)("dialogs.imagePosition.align")), 1), w(s("select", {
|
|
594
|
+
"onUpdate:modelValue": n[5] ||= (e) => g.value = e,
|
|
595
|
+
class: "ipd-select"
|
|
596
|
+
}, [
|
|
597
|
+
s("option", et, _(v(r)("dialogs.imagePosition.alignOptions.top")), 1),
|
|
598
|
+
s("option", tt, _(v(r)("dialogs.imagePosition.alignOptions.center")), 1),
|
|
599
|
+
s("option", nt, _(v(r)("dialogs.imagePosition.alignOptions.bottom")), 1)
|
|
600
|
+
], 512), [[x, g.value]])])) : (p(), o("div", rt, [s("label", it, _(v(r)("dialogs.imagePosition.offsetPx")), 1), w(s("input", {
|
|
601
|
+
"onUpdate:modelValue": n[6] ||= (e) => y.value = e,
|
|
602
|
+
type: "number",
|
|
603
|
+
class: "ipd-input"
|
|
604
|
+
}, null, 512), [[
|
|
605
|
+
S,
|
|
606
|
+
y.value,
|
|
607
|
+
void 0,
|
|
608
|
+
{ number: !0 }
|
|
609
|
+
]])])),
|
|
610
|
+
s("div", at, [s("label", ot, _(v(r)("dialogs.imagePosition.relativeTo")), 1), w(s("select", {
|
|
611
|
+
"onUpdate:modelValue": n[7] ||= (e) => b.value = e,
|
|
612
|
+
class: "ipd-select"
|
|
613
|
+
}, [
|
|
614
|
+
s("option", st, _(v(r)("dialogs.imagePosition.relativeOptions.page")), 1),
|
|
615
|
+
s("option", ct, _(v(r)("dialogs.imagePosition.relativeOptions.margin")), 1),
|
|
616
|
+
s("option", lt, _(v(r)("dialogs.imagePosition.relativeOptions.paragraph")), 1),
|
|
617
|
+
s("option", ut, _(v(r)("dialogs.imagePosition.relativeOptions.line")), 1)
|
|
618
|
+
], 512), [[x, b.value]])])
|
|
619
|
+
]),
|
|
620
|
+
s("fieldset", dt, [
|
|
621
|
+
n[17] ||= s("legend", { class: "ipd-legend" }, "Distance from text (px)", -1),
|
|
622
|
+
s("div", ft, [
|
|
623
|
+
s("label", pt, _(v(r)("dialogs.imagePosition.alignOptions.top")), 1),
|
|
624
|
+
w(s("input", {
|
|
625
|
+
"onUpdate:modelValue": n[8] ||= (e) => D.value = e,
|
|
626
|
+
type: "number",
|
|
627
|
+
class: "ipd-input",
|
|
628
|
+
min: "0"
|
|
629
|
+
}, null, 512), [[
|
|
630
|
+
S,
|
|
631
|
+
D.value,
|
|
632
|
+
void 0,
|
|
633
|
+
{ number: !0 }
|
|
634
|
+
]]),
|
|
635
|
+
s("label", mt, _(v(r)("dialogs.imagePosition.alignOptions.bottom")), 1),
|
|
636
|
+
w(s("input", {
|
|
637
|
+
"onUpdate:modelValue": n[9] ||= (e) => O.value = e,
|
|
638
|
+
type: "number",
|
|
639
|
+
class: "ipd-input",
|
|
640
|
+
min: "0"
|
|
641
|
+
}, null, 512), [[
|
|
642
|
+
S,
|
|
643
|
+
O.value,
|
|
644
|
+
void 0,
|
|
645
|
+
{ number: !0 }
|
|
646
|
+
]])
|
|
647
|
+
]),
|
|
648
|
+
s("div", ht, [
|
|
649
|
+
s("label", gt, _(v(r)("dialogs.imagePosition.alignOptions.left")), 1),
|
|
650
|
+
w(s("input", {
|
|
651
|
+
"onUpdate:modelValue": n[10] ||= (e) => k.value = e,
|
|
652
|
+
type: "number",
|
|
653
|
+
class: "ipd-input",
|
|
654
|
+
min: "0"
|
|
655
|
+
}, null, 512), [[
|
|
656
|
+
S,
|
|
657
|
+
k.value,
|
|
658
|
+
void 0,
|
|
659
|
+
{ number: !0 }
|
|
660
|
+
]]),
|
|
661
|
+
s("label", _t, _(v(r)("dialogs.imagePosition.alignOptions.right")), 1),
|
|
662
|
+
w(s("input", {
|
|
663
|
+
"onUpdate:modelValue": n[11] ||= (e) => A.value = e,
|
|
664
|
+
type: "number",
|
|
665
|
+
class: "ipd-input",
|
|
666
|
+
min: "0"
|
|
667
|
+
}, null, 512), [[
|
|
668
|
+
S,
|
|
669
|
+
A.value,
|
|
670
|
+
void 0,
|
|
671
|
+
{ number: !0 }
|
|
672
|
+
]])
|
|
673
|
+
])
|
|
674
|
+
])
|
|
675
|
+
]),
|
|
676
|
+
s("div", vt, [s("button", {
|
|
677
|
+
class: "ipd-btn",
|
|
678
|
+
onClick: n[12] ||= (e) => t.$emit("close")
|
|
679
|
+
}, _(v(r)("common.cancel")), 1), s("button", {
|
|
680
|
+
class: "ipd-btn ipd-btn--primary",
|
|
681
|
+
onClick: j
|
|
682
|
+
}, _(v(r)("common.apply")), 1)])
|
|
683
|
+
], 32)], 32)) : a("", !0);
|
|
684
|
+
}
|
|
685
|
+
}), [["__scopeId", "data-v-ccee8027"]]), bt = { class: "dialog__header" }, xt = { class: "dialog__title" }, St = ["aria-label"], Ct = { class: "dialog__body" }, wt = { class: "drop-zone__icon" }, Tt = { class: "drop-zone__text" }, Et = { class: "drop-zone__hint" }, Dt = ["src", "alt"], Ot = ["aria-label"], kt = {
|
|
686
|
+
key: 0,
|
|
687
|
+
class: "drop-zone__error"
|
|
688
|
+
}, At = {
|
|
689
|
+
key: 1,
|
|
690
|
+
class: "image-controls"
|
|
691
|
+
}, jt = { class: "lock-label" }, Mt = {
|
|
692
|
+
key: 2,
|
|
693
|
+
class: "image-controls"
|
|
694
|
+
}, Nt = { style: { flex: "1" } }, Pt = ["placeholder"], Ft = {
|
|
695
|
+
key: 3,
|
|
696
|
+
class: "dialog__actions"
|
|
697
|
+
}, It = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
698
|
+
__name: "InsertImageDialog",
|
|
699
|
+
props: { isOpen: { type: Boolean } },
|
|
700
|
+
emits: ["close", "insert"],
|
|
701
|
+
setup(n, { emit: i }) {
|
|
702
|
+
let { t: u } = t(), f = i, m = h(null), g = h(""), b = h(400), x = h(300), C = h(!0), T = h(""), D = h(""), O = h(!1), k = 1;
|
|
703
|
+
function A() {
|
|
704
|
+
f("close");
|
|
705
|
+
}
|
|
706
|
+
function j() {
|
|
707
|
+
g.value = "", D.value = "", T.value = "", b.value = 400, x.value = 300;
|
|
708
|
+
}
|
|
709
|
+
function M(e) {
|
|
710
|
+
O.value = !1;
|
|
711
|
+
let t = e.dataTransfer?.files?.[0];
|
|
712
|
+
t && P(t);
|
|
713
|
+
}
|
|
714
|
+
function N(e) {
|
|
715
|
+
let t = e.target.files?.[0];
|
|
716
|
+
t && P(t);
|
|
717
|
+
}
|
|
718
|
+
function P(e) {
|
|
719
|
+
if (D.value = "", !e.type.startsWith("image/")) {
|
|
720
|
+
D.value = u("dialogs.insertImage.invalidFile");
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
if (e.size > 10 * 1024 * 1024) {
|
|
724
|
+
D.value = u("dialogs.insertImage.fileTooLarge");
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
T.value = e.name.replace(/\.[^.]+$/, "");
|
|
728
|
+
let t = new FileReader();
|
|
729
|
+
t.onload = () => {
|
|
730
|
+
let e = t.result, n = new Image();
|
|
731
|
+
n.onload = () => {
|
|
732
|
+
let t = n.naturalWidth, r = n.naturalHeight;
|
|
733
|
+
t > 800 && (r = Math.round(800 / t * r), t = 800), r > 600 && (t = Math.round(600 / r * t), r = 600), b.value = t, x.value = r, k = t / r, g.value = e;
|
|
734
|
+
}, n.onerror = () => {
|
|
735
|
+
D.value = u("dialogs.insertImage.loadFailed");
|
|
736
|
+
}, n.src = e;
|
|
737
|
+
}, t.onerror = () => {
|
|
738
|
+
D.value = u("dialogs.insertImage.readFailed");
|
|
739
|
+
}, t.readAsDataURL(e);
|
|
740
|
+
}
|
|
741
|
+
function F() {
|
|
742
|
+
C.value && k && (x.value = Math.round(b.value / k));
|
|
743
|
+
}
|
|
744
|
+
function I() {
|
|
745
|
+
C.value && k && (b.value = Math.round(x.value * k));
|
|
746
|
+
}
|
|
747
|
+
function L() {
|
|
748
|
+
g.value && (f("insert", {
|
|
749
|
+
src: g.value,
|
|
750
|
+
width: b.value,
|
|
751
|
+
height: x.value,
|
|
752
|
+
alt: T.value
|
|
753
|
+
}), j(), A());
|
|
754
|
+
}
|
|
755
|
+
return (t, i) => n.isOpen ? (p(), o("div", {
|
|
756
|
+
key: 0,
|
|
757
|
+
class: "dialog-overlay",
|
|
758
|
+
onMousedown: E(A, ["self"])
|
|
759
|
+
}, [s("div", {
|
|
760
|
+
class: "dialog",
|
|
761
|
+
onMousedown: i[7] ||= E(() => {}, ["stop"]),
|
|
762
|
+
onKeydown: i[8] ||= E(() => {}, ["stop"])
|
|
763
|
+
}, [s("div", bt, [s("span", xt, _(v(u)("dialogs.insertImage.title")), 1), s("button", {
|
|
764
|
+
class: "dialog__close",
|
|
765
|
+
"aria-label": v(u)("common.closeDialog"),
|
|
766
|
+
onClick: A
|
|
767
|
+
}, " ✕ ", 8, St)]), s("div", Ct, [
|
|
768
|
+
s("div", {
|
|
769
|
+
class: d(["drop-zone", { "drop-zone--active": O.value }]),
|
|
770
|
+
onDragover: i[0] ||= E((e) => O.value = !0, ["prevent"]),
|
|
771
|
+
onDragleave: i[1] ||= (e) => O.value = !1,
|
|
772
|
+
onDrop: E(M, ["prevent"]),
|
|
773
|
+
onClick: i[2] ||= (e) => m.value?.click()
|
|
774
|
+
}, [g.value ? (p(), o("img", {
|
|
775
|
+
key: 1,
|
|
776
|
+
src: g.value,
|
|
777
|
+
class: "drop-zone__preview",
|
|
778
|
+
alt: v(u)("dialogs.insertImage.preview")
|
|
779
|
+
}, null, 8, Dt)) : (p(), o(r, { key: 0 }, [
|
|
780
|
+
s("div", wt, [l(e, {
|
|
781
|
+
name: "image",
|
|
782
|
+
size: 48
|
|
783
|
+
})]),
|
|
784
|
+
s("div", Tt, _(v(u)("dialogs.insertImage.uploadText")), 1),
|
|
785
|
+
s("div", Et, _(v(u)("dialogs.insertImage.uploadSubtext")), 1)
|
|
786
|
+
], 64))], 34),
|
|
787
|
+
s("input", {
|
|
788
|
+
ref_key: "fileInput",
|
|
789
|
+
ref: m,
|
|
790
|
+
type: "file",
|
|
791
|
+
accept: "image/*",
|
|
792
|
+
style: { display: "none" },
|
|
793
|
+
"aria-label": v(u)("dialogs.insertImage.uploadAriaLabel"),
|
|
794
|
+
onChange: N
|
|
795
|
+
}, null, 40, Ot),
|
|
796
|
+
D.value ? (p(), o("div", kt, _(D.value), 1)) : a("", !0),
|
|
797
|
+
g.value ? (p(), o("div", At, [
|
|
798
|
+
s("label", null, [c(_(v(u)("dialogs.insertImage.widthLabel")) + " ", 1), w(s("input", {
|
|
799
|
+
"onUpdate:modelValue": i[3] ||= (e) => b.value = e,
|
|
800
|
+
type: "number",
|
|
801
|
+
min: "1",
|
|
802
|
+
max: "2000",
|
|
803
|
+
class: "dim-input",
|
|
804
|
+
onInput: F
|
|
805
|
+
}, null, 544), [[
|
|
806
|
+
S,
|
|
807
|
+
b.value,
|
|
808
|
+
void 0,
|
|
809
|
+
{ number: !0 }
|
|
810
|
+
]])]),
|
|
811
|
+
s("label", null, [c(_(v(u)("dialogs.insertImage.heightLabel")) + " ", 1), w(s("input", {
|
|
812
|
+
"onUpdate:modelValue": i[4] ||= (e) => x.value = e,
|
|
813
|
+
type: "number",
|
|
814
|
+
min: "1",
|
|
815
|
+
max: "2000",
|
|
816
|
+
class: "dim-input",
|
|
817
|
+
onInput: I
|
|
818
|
+
}, null, 544), [[
|
|
819
|
+
S,
|
|
820
|
+
x.value,
|
|
821
|
+
void 0,
|
|
822
|
+
{ number: !0 }
|
|
823
|
+
]])]),
|
|
824
|
+
s("label", jt, [w(s("input", {
|
|
825
|
+
type: "checkbox",
|
|
826
|
+
"onUpdate:modelValue": i[5] ||= (e) => C.value = e
|
|
827
|
+
}, null, 512), [[y, C.value]]), c(" " + _(C.value ? v(u)("dialogs.insertImage.aspectRatioLocked") : v(u)("dialogs.insertImage.aspectRatioUnlocked")), 1)])
|
|
828
|
+
])) : a("", !0),
|
|
829
|
+
g.value ? (p(), o("div", Mt, [s("label", Nt, [c(_(v(u)("dialogs.insertImage.altTextLabel")) + " ", 1), w(s("input", {
|
|
830
|
+
"onUpdate:modelValue": i[6] ||= (e) => T.value = e,
|
|
831
|
+
class: "alt-input",
|
|
832
|
+
placeholder: v(u)("dialogs.insertImage.altTextPlaceholder")
|
|
833
|
+
}, null, 8, Pt), [[S, T.value]])])])) : a("", !0),
|
|
834
|
+
g.value ? (p(), o("div", Ft, [s("button", {
|
|
835
|
+
class: "dialog__btn",
|
|
836
|
+
onClick: j
|
|
837
|
+
}, _(v(u)("common.clear")), 1), s("button", {
|
|
838
|
+
class: "dialog__btn dialog__btn--primary",
|
|
839
|
+
onMousedown: E(L, ["prevent"])
|
|
840
|
+
}, _(v(u)("dialogs.insertImage.insertButton")), 33)])) : a("", !0)
|
|
841
|
+
])], 32)], 32)) : a("", !0);
|
|
842
|
+
}
|
|
843
|
+
}), [["__scopeId", "data-v-4ab86ad1"]]), J = m({
|
|
844
|
+
rows: 3,
|
|
845
|
+
cols: 3
|
|
846
|
+
}), Lt = { class: "dialog__header" }, Rt = { class: "dialog__title" }, zt = ["title"], Bt = { class: "dialog__body" }, Vt = ["aria-label"], Ht = ["onMouseenter", "onMousedown"], Ut = { class: "table-grid__label" }, Wt = { class: "dialog__separator" }, Gt = { class: "table-manual" }, Kt = { class: "table-manual__field" }, qt = { class: "table-manual__field" }, Jt = { class: "table-options" }, Yt = { class: "table-options__radio" }, Xt = { class: "table-options__radio" }, Zt = { class: "table-options" }, Qt = { class: "table-options__label" }, $t = { class: "dialog__footer" }, en = ["disabled"], tn = 8, nn = 10, Y = 1, X = 100, Z = 1, Q = 20, rn = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
847
|
+
__name: "InsertTableDialog",
|
|
848
|
+
props: { isOpen: { type: Boolean } },
|
|
849
|
+
emits: ["close", "insert"],
|
|
850
|
+
setup(e, { emit: n }) {
|
|
851
|
+
let { t: c } = t(), u = e, f = n, m = h(0), y = h(0), x = h(J.rows), T = h(J.cols), D = h("fixed"), O = h(null);
|
|
852
|
+
C(() => u.isOpen, (e) => {
|
|
853
|
+
e && (x.value = J.rows, T.value = J.cols, m.value = 0, y.value = 0);
|
|
854
|
+
});
|
|
855
|
+
let k = i(() => Number.parseInt(String(x.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);
|
|
856
|
+
function P() {
|
|
857
|
+
f("close");
|
|
858
|
+
}
|
|
859
|
+
function F(e, t) {
|
|
860
|
+
m.value = e, y.value = t, x.value = e, T.value = t;
|
|
861
|
+
}
|
|
862
|
+
function I(e) {
|
|
863
|
+
O.value = O.value === e ? null : e;
|
|
864
|
+
}
|
|
865
|
+
function L(e) {
|
|
866
|
+
e.key === "Escape" ? P() : e.key === "Enter" && (e.preventDefault(), R());
|
|
867
|
+
}
|
|
868
|
+
function R() {
|
|
869
|
+
if (!N.value) return;
|
|
870
|
+
let e = Math.min(Math.max(Y, k.value), X), t = Math.min(Math.max(Z, A.value), Q);
|
|
871
|
+
J.rows = e, J.cols = t, f("insert", {
|
|
872
|
+
rows: e,
|
|
873
|
+
cols: t,
|
|
874
|
+
autofit: D.value === "autofit",
|
|
875
|
+
styleId: O.value
|
|
876
|
+
}), P();
|
|
877
|
+
}
|
|
878
|
+
return (t, n) => e.isOpen ? (p(), o("div", {
|
|
879
|
+
key: 0,
|
|
880
|
+
class: "dialog-overlay",
|
|
881
|
+
onMousedown: E(P, ["self"])
|
|
882
|
+
}, [s("div", {
|
|
883
|
+
class: "dialog",
|
|
884
|
+
onMousedown: n[6] ||= E(() => {}, ["stop"]),
|
|
885
|
+
onKeydown: E(L, ["stop"])
|
|
886
|
+
}, [
|
|
887
|
+
s("div", Lt, [s("span", Rt, _(v(c)("dialogs.insertTable.title")), 1), s("button", {
|
|
888
|
+
class: "dialog__close",
|
|
889
|
+
title: v(c)("common.closeDialog"),
|
|
890
|
+
onClick: P
|
|
891
|
+
}, "✕", 8, zt)]),
|
|
892
|
+
s("div", Bt, [
|
|
893
|
+
s("div", {
|
|
894
|
+
class: "table-grid",
|
|
895
|
+
"aria-label": v(c)("dialogs.insertTable.sizeSelector"),
|
|
896
|
+
onMouseleave: n[0] ||= (e) => {
|
|
897
|
+
m.value = 0, y.value = 0;
|
|
898
|
+
}
|
|
899
|
+
}, [(p(), o(r, null, g(tn, (e) => s("div", {
|
|
900
|
+
key: e,
|
|
901
|
+
class: "table-grid__row"
|
|
902
|
+
}, [(p(), o(r, null, g(nn, (t) => s("div", {
|
|
903
|
+
key: t,
|
|
904
|
+
class: d(["table-grid__cell", { highlight: e <= m.value && t <= y.value }]),
|
|
905
|
+
onMouseenter: (n) => {
|
|
906
|
+
m.value = e, y.value = t;
|
|
907
|
+
},
|
|
908
|
+
onMousedown: E((n) => F(e, t), ["prevent"])
|
|
909
|
+
}, null, 42, Ht)), 64))])), 64))], 40, Vt),
|
|
910
|
+
s("div", Ut, _(m.value > 0 ? v(c)("dialogs.insertTable.tableSize", {
|
|
911
|
+
cols: y.value,
|
|
912
|
+
rows: m.value
|
|
913
|
+
}) : v(c)("dialogs.insertTable.hoverToSelect")), 1),
|
|
914
|
+
s("div", Wt, [s("span", null, _(v(c)("dialogs.insertTable.orSpecifySize")), 1)]),
|
|
915
|
+
s("div", Gt, [s("label", Kt, [s("span", null, _(v(c)("dialogs.insertTable.rowsLabel")), 1), w(s("input", {
|
|
916
|
+
"onUpdate:modelValue": n[1] ||= (e) => x.value = e,
|
|
917
|
+
type: "number",
|
|
918
|
+
min: Y,
|
|
919
|
+
max: X,
|
|
920
|
+
class: d(["table-manual__input", { "table-manual__input--invalid": !j.value }])
|
|
921
|
+
}, null, 2), [[S, x.value]])]), s("label", qt, [s("span", null, _(v(c)("dialogs.insertTable.columnsLabel")), 1), w(s("input", {
|
|
922
|
+
"onUpdate:modelValue": n[2] ||= (e) => T.value = e,
|
|
923
|
+
type: "number",
|
|
924
|
+
min: Z,
|
|
925
|
+
max: Q,
|
|
926
|
+
class: d(["table-manual__input", { "table-manual__input--invalid": !M.value }])
|
|
927
|
+
}, null, 2), [[S, T.value]])])]),
|
|
928
|
+
s("div", { class: d(["table-manual__hint", { "table-manual__hint--error": !N.value }]) }, _(v(c)("dialogs.insertTable.validationHint", {
|
|
929
|
+
minRows: Y,
|
|
930
|
+
maxRows: X,
|
|
931
|
+
minCols: Z,
|
|
932
|
+
maxCols: Q
|
|
933
|
+
})), 3),
|
|
934
|
+
s("fieldset", Jt, [
|
|
935
|
+
s("legend", null, _(v(c)("dialogs.insertTable.columnWidthLabel")), 1),
|
|
936
|
+
s("label", Yt, [w(s("input", {
|
|
937
|
+
type: "radio",
|
|
938
|
+
value: "fixed",
|
|
939
|
+
"onUpdate:modelValue": n[3] ||= (e) => D.value = e
|
|
940
|
+
}, null, 512), [[b, D.value]]), s("span", null, _(v(c)("dialogs.insertTable.fixedWidth")), 1)]),
|
|
941
|
+
s("label", Xt, [w(s("input", {
|
|
942
|
+
type: "radio",
|
|
943
|
+
value: "autofit",
|
|
944
|
+
"onUpdate:modelValue": n[4] ||= (e) => D.value = e
|
|
945
|
+
}, null, 512), [[b, D.value]]), s("span", null, _(v(c)("dialogs.insertTable.autofit")), 1)])
|
|
946
|
+
]),
|
|
947
|
+
s("div", Zt, [s("div", Qt, _(v(c)("dialogs.insertTable.tableStyleLabel")), 1), l(z, {
|
|
948
|
+
"current-style-id": O.value,
|
|
949
|
+
onApply: I
|
|
950
|
+
}, null, 8, ["current-style-id"])])
|
|
951
|
+
]),
|
|
952
|
+
s("div", $t, [s("button", {
|
|
953
|
+
class: "dialog__btn",
|
|
954
|
+
onMousedown: E(P, ["prevent"])
|
|
955
|
+
}, _(v(c)("common.cancel")), 33), s("button", {
|
|
956
|
+
class: "dialog__btn dialog__btn--primary",
|
|
957
|
+
disabled: !N.value,
|
|
958
|
+
onMousedown: n[5] ||= E((e) => R(), ["prevent"])
|
|
959
|
+
}, _(v(c)("dialogs.insertTable.insertButton")), 41, en)])
|
|
960
|
+
], 32)], 32)) : a("", !0);
|
|
961
|
+
}
|
|
962
|
+
}), [["__scopeId", "data-v-82c01bcb"]]), an = { class: "psd-dialog__header" }, on = { class: "psd-dialog__body" }, sn = {
|
|
963
|
+
key: 0,
|
|
964
|
+
class: "psd-preview"
|
|
965
|
+
}, cn = { class: "psd-preview__label" }, ln = { class: "psd-preview__text" }, un = { class: "psd-options" }, dn = { class: "psd-option__info" }, fn = { class: "psd-option__name" }, pn = { class: "psd-option__desc" }, mn = { class: "psd-option__info" }, hn = { class: "psd-option__name" }, gn = { class: "psd-option__desc" }, _n = { class: "psd-dialog__footer" }, vn = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
966
|
+
__name: "PasteSpecialDialog",
|
|
967
|
+
props: { isOpen: { type: Boolean } },
|
|
968
|
+
emits: ["close", "paste"],
|
|
969
|
+
setup(e, { emit: n }) {
|
|
970
|
+
let { t: r } = t(), i = e, c = n, l = h("formatted"), u = h("");
|
|
971
|
+
C(() => i.isOpen, async (e) => {
|
|
972
|
+
if (e) {
|
|
973
|
+
l.value = "formatted";
|
|
974
|
+
try {
|
|
975
|
+
let e = await navigator.clipboard.readText();
|
|
976
|
+
u.value = e.length > 80 ? e.slice(0, 80) + "..." : e;
|
|
977
|
+
} catch {
|
|
978
|
+
u.value = "";
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
function f() {
|
|
983
|
+
c("paste", l.value), c("close");
|
|
984
|
+
}
|
|
985
|
+
return (t, n) => e.isOpen ? (p(), o("div", {
|
|
986
|
+
key: 0,
|
|
987
|
+
class: "psd-overlay",
|
|
988
|
+
onMousedown: n[4] ||= E((e) => t.$emit("close"), ["self"])
|
|
989
|
+
}, [s("div", {
|
|
990
|
+
class: "psd-dialog",
|
|
991
|
+
onKeydown: [n[3] ||= T((e) => t.$emit("close"), ["escape"]), T(f, ["enter"])]
|
|
992
|
+
}, [
|
|
993
|
+
s("div", an, _(v(r)("dialogs.pasteSpecial.title")), 1),
|
|
994
|
+
s("div", on, [u.value ? (p(), o("div", sn, [s("span", cn, _(v(r)("dialogs.pasteSpecial.preview")), 1), s("span", ln, _(u.value), 1)])) : a("", !0), s("div", un, [s("label", { class: d(["psd-option", { "psd-option--selected": l.value === "formatted" }]) }, [w(s("input", {
|
|
995
|
+
type: "radio",
|
|
996
|
+
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
997
|
+
value: "formatted"
|
|
998
|
+
}, null, 512), [[b, l.value]]), s("div", dn, [s("span", fn, _(v(r)("dialogs.pasteSpecial.keepFormatting")), 1), s("span", pn, _(v(r)("dialogs.pasteSpecial.keepFormattingDescription")), 1)])], 2), s("label", { class: d(["psd-option", { "psd-option--selected": l.value === "plain" }]) }, [w(s("input", {
|
|
999
|
+
type: "radio",
|
|
1000
|
+
"onUpdate:modelValue": n[1] ||= (e) => l.value = e,
|
|
1001
|
+
value: "plain"
|
|
1002
|
+
}, null, 512), [[b, l.value]]), s("div", mn, [s("span", hn, _(v(r)("dialogs.pasteSpecial.plainText")), 1), s("span", gn, _(v(r)("dialogs.pasteSpecial.plainTextDescription")), 1)])], 2)])]),
|
|
1003
|
+
s("div", _n, [s("button", {
|
|
1004
|
+
class: "psd-btn",
|
|
1005
|
+
onClick: n[2] ||= (e) => t.$emit("close")
|
|
1006
|
+
}, _(v(r)("common.cancel")), 1), s("button", {
|
|
1007
|
+
class: "psd-btn psd-btn--primary",
|
|
1008
|
+
onClick: f
|
|
1009
|
+
}, _(v(r)("contextMenu.paste")), 1)])
|
|
1010
|
+
], 32)], 32)) : a("", !0);
|
|
1011
|
+
}
|
|
1012
|
+
}), [["__scopeId", "data-v-8276806d"]]), yn = { class: "docx-split-cell__dialog" }, bn = { class: "docx-split-cell__header" }, xn = { class: "docx-split-cell__body" }, Sn = { class: "docx-split-cell__row" }, Cn = { class: "docx-split-cell__label" }, wn = ["min", "onKeydown"], Tn = { class: "docx-split-cell__row" }, En = { class: "docx-split-cell__label" }, Dn = ["min", "onKeydown"], On = { class: "docx-split-cell__footer" }, kn = ["disabled"], An = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
1013
|
+
__name: "SplitCellDialog",
|
|
1014
|
+
props: {
|
|
1015
|
+
isOpen: { type: Boolean },
|
|
1016
|
+
initialRows: { default: 1 },
|
|
1017
|
+
initialCols: { default: 2 },
|
|
1018
|
+
minRows: { default: 1 },
|
|
1019
|
+
minCols: { default: 1 }
|
|
1020
|
+
},
|
|
1021
|
+
emits: ["close", "apply"],
|
|
1022
|
+
setup(e, { emit: n }) {
|
|
1023
|
+
let { t: r } = t(), c = e, l = n, u = h(c.initialRows), d = h(c.initialCols);
|
|
1024
|
+
C(() => c.isOpen, (e) => {
|
|
1025
|
+
e && (u.value = c.initialRows, d.value = c.initialCols);
|
|
1026
|
+
});
|
|
1027
|
+
let f = i(() => Number.isFinite(u.value) && Number.isFinite(d.value) && u.value >= c.minRows && d.value >= c.minCols && u.value * d.value > 1);
|
|
1028
|
+
function m() {
|
|
1029
|
+
f.value && l("apply", u.value, d.value);
|
|
1030
|
+
}
|
|
1031
|
+
return (t, n) => e.isOpen ? (p(), o("div", {
|
|
1032
|
+
key: 0,
|
|
1033
|
+
class: "docx-split-cell",
|
|
1034
|
+
onClick: n[3] ||= E((e) => t.$emit("close"), ["self"])
|
|
1035
|
+
}, [s("div", yn, [
|
|
1036
|
+
s("div", bn, _(v(r)("dialogs.splitCell.title")), 1),
|
|
1037
|
+
s("div", xn, [s("label", Sn, [s("span", Cn, _(v(r)("dialogs.splitCell.rowsLabel")), 1), w(s("input", {
|
|
1038
|
+
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
1039
|
+
type: "number",
|
|
1040
|
+
class: "docx-split-cell__input",
|
|
1041
|
+
min: e.minRows,
|
|
1042
|
+
max: 20,
|
|
1043
|
+
onKeydown: T(E(m, ["prevent"]), ["enter"])
|
|
1044
|
+
}, null, 40, wn), [[
|
|
1045
|
+
S,
|
|
1046
|
+
u.value,
|
|
1047
|
+
void 0,
|
|
1048
|
+
{ number: !0 }
|
|
1049
|
+
]])]), s("label", Tn, [s("span", En, _(v(r)("dialogs.splitCell.columnsLabel")), 1), w(s("input", {
|
|
1050
|
+
"onUpdate:modelValue": n[1] ||= (e) => d.value = e,
|
|
1051
|
+
type: "number",
|
|
1052
|
+
class: "docx-split-cell__input",
|
|
1053
|
+
min: e.minCols,
|
|
1054
|
+
max: 20,
|
|
1055
|
+
onKeydown: T(E(m, ["prevent"]), ["enter"])
|
|
1056
|
+
}, null, 40, Dn), [[
|
|
1057
|
+
S,
|
|
1058
|
+
d.value,
|
|
1059
|
+
void 0,
|
|
1060
|
+
{ number: !0 }
|
|
1061
|
+
]])])]),
|
|
1062
|
+
s("div", On, [s("button", {
|
|
1063
|
+
class: "docx-split-cell__cancel",
|
|
1064
|
+
onClick: n[2] ||= (e) => t.$emit("close")
|
|
1065
|
+
}, _(v(r)("common.cancel")), 1), s("button", {
|
|
1066
|
+
class: "docx-split-cell__apply",
|
|
1067
|
+
disabled: !f.value,
|
|
1068
|
+
onClick: m
|
|
1069
|
+
}, _(v(r)("common.apply")), 9, kn)])
|
|
1070
|
+
])])) : a("", !0);
|
|
1071
|
+
}
|
|
1072
|
+
}), [["__scopeId", "data-v-20cfd7b1"]]), jn = { class: "tpd-dialog__header" }, Mn = { class: "tpd-dialog__body" }, Nn = { class: "tpd-row" }, $ = { class: "tpd-label" }, Pn = { value: "auto" }, Fn = { value: "dxa" }, In = { value: "pct" }, Ln = {
|
|
1073
|
+
key: 0,
|
|
1074
|
+
class: "tpd-row"
|
|
1075
|
+
}, Rn = { class: "tpd-label" }, zn = ["step"], Bn = { class: "tpd-unit" }, Vn = { class: "tpd-row" }, Hn = { class: "tpd-label" }, Un = { value: "left" }, Wn = { value: "center" }, Gn = { value: "right" }, Kn = { class: "tpd-dialog__footer" }, qn = /* @__PURE__ */ n(/* @__PURE__ */ u({
|
|
1076
|
+
__name: "TablePropertiesDialog",
|
|
1077
|
+
props: {
|
|
1078
|
+
isOpen: { type: Boolean },
|
|
1079
|
+
currentProps: {}
|
|
1080
|
+
},
|
|
1081
|
+
emits: ["close", "apply"],
|
|
1082
|
+
setup(e, { emit: n }) {
|
|
1083
|
+
let { t: r } = t(), i = e, c = n, l = h(0), u = h("auto"), d = h("left");
|
|
1084
|
+
C(() => i.isOpen, (e) => {
|
|
1085
|
+
e && (l.value = i.currentProps?.width ?? 0, u.value = i.currentProps?.widthType ?? "auto", d.value = i.currentProps?.justification ?? "left");
|
|
1086
|
+
});
|
|
1087
|
+
function f() {
|
|
1088
|
+
let e = { justification: d.value };
|
|
1089
|
+
u.value === "auto" ? (e.width = null, e.widthType = "auto") : (e.width = l.value, e.widthType = u.value), c("apply", e), c("close");
|
|
1090
|
+
}
|
|
1091
|
+
return (t, n) => e.isOpen ? (p(), o("div", {
|
|
1092
|
+
key: 0,
|
|
1093
|
+
class: "tpd-overlay",
|
|
1094
|
+
onMousedown: n[5] ||= E((e) => t.$emit("close"), ["self"])
|
|
1095
|
+
}, [s("div", {
|
|
1096
|
+
class: "tpd-dialog",
|
|
1097
|
+
onKeydown: [n[4] ||= T((e) => t.$emit("close"), ["escape"]), T(f, ["enter"])]
|
|
1098
|
+
}, [
|
|
1099
|
+
s("div", jn, _(v(r)("dialogs.tableProperties.title")), 1),
|
|
1100
|
+
s("div", Mn, [
|
|
1101
|
+
s("div", Nn, [s("label", $, _(v(r)("dialogs.tableProperties.widthType")), 1), w(s("select", {
|
|
1102
|
+
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
1103
|
+
class: "tpd-select"
|
|
1104
|
+
}, [
|
|
1105
|
+
s("option", Pn, _(v(r)("dialogs.tableProperties.widthTypes.auto")), 1),
|
|
1106
|
+
s("option", Fn, _(v(r)("dialogs.tableProperties.widthTypes.fixed")), 1),
|
|
1107
|
+
s("option", In, _(v(r)("dialogs.tableProperties.widthTypes.percentage")), 1)
|
|
1108
|
+
], 512), [[x, u.value]])]),
|
|
1109
|
+
u.value === "auto" ? a("", !0) : (p(), o("div", Ln, [
|
|
1110
|
+
s("label", Rn, _(v(r)("dialogs.tableProperties.widthLabel")), 1),
|
|
1111
|
+
w(s("input", {
|
|
1112
|
+
"onUpdate:modelValue": n[1] ||= (e) => l.value = e,
|
|
1113
|
+
type: "number",
|
|
1114
|
+
class: "tpd-input",
|
|
1115
|
+
min: 0,
|
|
1116
|
+
step: u.value === "pct" ? 5 : 100
|
|
1117
|
+
}, null, 8, zn), [[
|
|
1118
|
+
S,
|
|
1119
|
+
l.value,
|
|
1120
|
+
void 0,
|
|
1121
|
+
{ number: !0 }
|
|
1122
|
+
]]),
|
|
1123
|
+
s("span", Bn, _(u.value === "pct" ? v(r)("dialogs.tableProperties.units.fiftiethsPercent") : v(r)("dialogs.tableProperties.units.twips")), 1)
|
|
1124
|
+
])),
|
|
1125
|
+
s("div", Vn, [s("label", Hn, _(v(r)("dialogs.tableProperties.alignmentLabel")), 1), w(s("select", {
|
|
1126
|
+
"onUpdate:modelValue": n[2] ||= (e) => d.value = e,
|
|
1127
|
+
class: "tpd-select"
|
|
1128
|
+
}, [
|
|
1129
|
+
s("option", Un, _(v(r)("dialogs.tableProperties.alignOptions.left")), 1),
|
|
1130
|
+
s("option", Wn, _(v(r)("dialogs.tableProperties.alignOptions.center")), 1),
|
|
1131
|
+
s("option", Gn, _(v(r)("dialogs.tableProperties.alignOptions.right")), 1)
|
|
1132
|
+
], 512), [[x, d.value]])])
|
|
1133
|
+
]),
|
|
1134
|
+
s("div", Kn, [s("button", {
|
|
1135
|
+
class: "tpd-btn",
|
|
1136
|
+
onClick: n[3] ||= (e) => t.$emit("close")
|
|
1137
|
+
}, _(v(r)("common.cancel")), 1), s("button", {
|
|
1138
|
+
class: "tpd-btn tpd-btn--primary",
|
|
1139
|
+
onClick: f
|
|
1140
|
+
}, _(v(r)("common.apply")), 1)])
|
|
1141
|
+
], 32)], 32)) : a("", !0);
|
|
1142
|
+
}
|
|
1143
|
+
}), [["__scopeId", "data-v-4ed16c50"]]);
|
|
1144
|
+
//#endregion
|
|
1145
|
+
export { It as a, z as c, rn as i, An as n, yt as o, vn as r, Ee as s, qn as t };
|