@eigenpal/docx-editor-vue 0.0.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/LICENSE +204 -0
- package/README.md +60 -0
- package/dist/KeyboardShortcutsDialog-BtJB9UOD.js +2902 -0
- package/dist/KeyboardShortcutsDialog-D72k5DXR.cjs +1 -0
- package/dist/MenuBar-BrQW4COn.cjs +4 -0
- package/dist/MenuBar-D_Dvwb0F.js +3313 -0
- package/dist/RenderedDomContext-CHc18N_2.js +2 -0
- package/dist/TablePropertiesDialog-Ct5XChwd.cjs +1 -0
- package/dist/TablePropertiesDialog-cJx_xxxE.js +987 -0
- package/dist/_plugin-vue_export-helper-B52Kst-M.js +8 -0
- package/dist/_plugin-vue_export-helper-CX7YVcP6.cjs +1 -0
- package/dist/components/DocxEditor/types.d.ts +100 -0
- package/dist/components/EditorToolbarContext.d.ts +9 -0
- package/dist/components/Toolbar/presets.d.ts +42 -0
- package/dist/components/dialogs/index.d.ts +27 -0
- package/dist/components/imageContextMenuTypes.d.ts +30 -0
- package/dist/components/imageSelectionTypes.d.ts +14 -0
- package/dist/components/insertTableState.d.ts +9 -0
- package/dist/components/sidebar/cardStyles.d.ts +3 -0
- package/dist/components/sidebar/cardUtils.d.ts +1 -0
- package/dist/components/sidebar/resolveItemPositions.d.ts +4 -0
- package/dist/components/sidebar/sidebarUtils.d.ts +4 -0
- package/dist/components/tableStylePresets.d.ts +53 -0
- package/dist/components/toolbarUtils.d.ts +1 -0
- package/dist/components/ui/Icons.d.ts +1 -0
- package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
- package/dist/composables/index.d.ts +30 -0
- package/dist/composables/useAutoSave.d.ts +40 -0
- package/dist/composables/useClipboard.d.ts +22 -0
- package/dist/composables/useCommentLifecycle.d.ts +52 -0
- package/dist/composables/useCommentManagement.d.ts +41 -0
- package/dist/composables/useCommentSidebarItems.d.ts +24 -0
- package/dist/composables/useContextMenus.d.ts +39 -0
- package/dist/composables/useDocumentLifecycle.d.ts +11 -0
- package/dist/composables/useDocxEditor.d.ts +56 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +49 -0
- package/dist/composables/useDragAutoScroll.d.ts +11 -0
- package/dist/composables/useFileIO.d.ts +30 -0
- package/dist/composables/useFindReplace.d.ts +34 -0
- package/dist/composables/useFixedDropdown.d.ts +14 -0
- package/dist/composables/useFormattingActions.d.ts +40 -0
- package/dist/composables/useHistory.d.ts +9 -0
- package/dist/composables/useHyperlinkManagement.d.ts +38 -0
- package/dist/composables/useImageActions.d.ts +30 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +17 -0
- package/dist/composables/useMenuActions.d.ts +23 -0
- package/dist/composables/useOutlineSidebar.d.ts +17 -0
- package/dist/composables/usePageSetupControls.d.ts +22 -0
- package/dist/composables/usePagesPointer.d.ts +70 -0
- package/dist/composables/useSelectionHighlight.d.ts +19 -0
- package/dist/composables/useSelectionSync.d.ts +13 -0
- package/dist/composables/useTableResize.d.ts +7 -0
- package/dist/composables/useTableSelection.d.ts +10 -0
- package/dist/composables/useToolbarDropdowns.d.ts +14 -0
- package/dist/composables/useTrackedChanges.d.ts +12 -0
- package/dist/composables/useVisualLineNavigation.d.ts +11 -0
- package/dist/composables/useWheelZoom.d.ts +10 -0
- package/dist/composables/useZoom.d.ts +16 -0
- package/dist/composables.cjs +1 -0
- package/dist/composables.js +485 -0
- package/dist/dialogs.cjs +1 -0
- package/dist/dialogs.js +3 -0
- package/dist/docx-editor-vue.css +2 -0
- package/dist/i18n/LocaleContext.d.ts +1 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/index.cjs +20 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +3600 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +1 -0
- package/dist/plugin-api/index.d.ts +18 -0
- package/dist/plugin-api/types.d.ts +28 -0
- package/dist/plugin-api.cjs +1 -0
- package/dist/plugin-api.js +62 -0
- package/dist/renderAsync.d.ts +31 -0
- package/dist/styles/index.d.ts +12 -0
- package/dist/styles/zIndex.d.ts +24 -0
- package/dist/styles.cjs +1 -0
- package/dist/styles.js +5 -0
- package/dist/ui.cjs +18 -0
- package/dist/ui.d.ts +79 -0
- package/dist/ui.js +963 -0
- package/dist/useTableResize-1oSe9Kjk.js +480 -0
- package/dist/useTableResize-lWdIgX9x.cjs +1 -0
- package/dist/utils/commentFactories.d.ts +7 -0
- package/dist/utils/domQueries.d.ts +28 -0
- package/dist/utils/imageClipboard.d.ts +9 -0
- package/dist/utils/paraTextHelpers.d.ts +29 -0
- package/dist/utils/refApiQueries.d.ts +46 -0
- package/dist/zIndex-CH0jZ7U7.cjs +1 -0
- package/dist/zIndex-CxELVe_L.js +12 -0
- package/package.json +119 -0
package/dist/ui.js
ADDED
|
@@ -0,0 +1,963 @@
|
|
|
1
|
+
import { a as e, i as t, n, o as r, p as i, r as a, s as o, t as s } from "./KeyboardShortcutsDialog-BtJB9UOD.js";
|
|
2
|
+
import { C as c, D as l, E as u, S as d, T as f, _ as ee, a as te, b as ne, c as p, d as m, f as h, g, h as _, i as v, l as y, m as b, n as x, o as S, p as re, r as ie, s as ae, t as C, u as oe, v as se, w as ce, x as w, y as le } from "./MenuBar-D_Dvwb0F.js";
|
|
3
|
+
import { t as T } from "./_plugin-vue_export-helper-B52Kst-M.js";
|
|
4
|
+
import { a as ue, i as de, n as fe, o as pe, r as E, s as D, t as O } from "./TablePropertiesDialog-cJx_xxxE.js";
|
|
5
|
+
import { Fragment as k, Teleport as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createTextVNode as I, createVNode as L, defineComponent as R, guardReactiveProps as z, nextTick as B, normalizeClass as V, normalizeProps as me, normalizeStyle as H, onBeforeUnmount as U, onMounted as W, openBlock as G, ref as K, renderList as q, renderSlot as J, resolveDynamicComponent as he, toDisplayString as Y, watch as ge, withCtx as X, withKeys as Z, withModifiers as Q } from "vue";
|
|
6
|
+
import "@eigenpal/docx-editor-core/utils/units";
|
|
7
|
+
import { createDefaultListState as _e } from "@eigenpal/docx-editor-core/utils/listState";
|
|
8
|
+
import { CARD_STYLE_COLLAPSED as ve, CARD_STYLE_EXPANDED as ye } from "@eigenpal/docx-editor-core/utils/cardStyles";
|
|
9
|
+
//#region src/components/EditorToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var be = { class: "docx-editor-toolbar" }, xe = { class: "docx-editor-toolbar__title-row" }, Se = { class: "docx-editor-toolbar__title-left" }, Ce = { class: "docx-editor-toolbar__title-center" }, we = { class: "docx-editor-toolbar__title-right" }, Te = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
11
|
+
inheritAttrs: !1,
|
|
12
|
+
__name: "EditorToolbar",
|
|
13
|
+
props: { showMenuBar: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !0
|
|
16
|
+
} },
|
|
17
|
+
emits: ["menu-action"],
|
|
18
|
+
setup(e) {
|
|
19
|
+
return (t, n) => (G(), P("div", be, [J(t.$slots, "title-bar", {}, () => [F("div", xe, [
|
|
20
|
+
F("div", Se, [J(t.$slots, "title-bar-left", {}, void 0, !0)]),
|
|
21
|
+
F("div", Ce, [J(t.$slots, "document-name", {}, void 0, !0), e.showMenuBar ? (G(), M(C, {
|
|
22
|
+
key: 0,
|
|
23
|
+
onAction: n[0] ||= (e) => t.$emit("menu-action", e)
|
|
24
|
+
})) : N("", !0)]),
|
|
25
|
+
F("div", we, [J(t.$slots, "title-bar-right", {}, void 0, !0)])
|
|
26
|
+
])], !0), J(t.$slots, "toolbar", {}, () => [L(w, me(z(t.$attrs)), null, 16)], !0)]));
|
|
27
|
+
}
|
|
28
|
+
}), [["__scopeId", "data-v-7d626a51"]]), Ee = {}, De = { class: "docx-title-bar" }, Oe = { class: "docx-title-bar__left" }, ke = { class: "docx-title-bar__center" }, Ae = { class: "docx-title-bar__right" };
|
|
29
|
+
function je(e, t) {
|
|
30
|
+
return G(), P("div", De, [
|
|
31
|
+
F("div", Oe, [J(e.$slots, "left", {}, void 0, !0)]),
|
|
32
|
+
F("div", ke, [J(e.$slots, "default", {}, void 0, !0)]),
|
|
33
|
+
F("div", Ae, [J(e.$slots, "right", {}, void 0, !0)])
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
var Me = /* @__PURE__ */ T(Ee, [["render", je], ["__scopeId", "data-v-53d684ff"]]), Ne = ["title"], Pe = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "responsive-toolbar__overflow-menu"
|
|
39
|
+
}, Fe = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
40
|
+
__name: "ResponsiveToolbar",
|
|
41
|
+
setup(e) {
|
|
42
|
+
let t = K(null), n = K(null), r = K(null), i = K(0), a = K(!1), o = null;
|
|
43
|
+
function s() {
|
|
44
|
+
let e = t.value, r = n.value;
|
|
45
|
+
if (!e || !r) return;
|
|
46
|
+
let a = e.clientWidth - 40, o = Array.from(r.children), s = 0;
|
|
47
|
+
for (let e of o) e.style.display = "";
|
|
48
|
+
let c = 0;
|
|
49
|
+
for (let e of o) c += e.offsetWidth + 2, c > a ? e.style.display = "none" : s++;
|
|
50
|
+
i.value = o.length - s;
|
|
51
|
+
}
|
|
52
|
+
function c(e) {
|
|
53
|
+
let t = e.target;
|
|
54
|
+
r.value?.contains(t) || (a.value = !1);
|
|
55
|
+
}
|
|
56
|
+
return W(() => {
|
|
57
|
+
o = new ResizeObserver(() => {
|
|
58
|
+
B(s);
|
|
59
|
+
}), t.value && o.observe(t.value), B(s), document.addEventListener("mousedown", c);
|
|
60
|
+
}), U(() => {
|
|
61
|
+
o?.disconnect(), document.removeEventListener("mousedown", c);
|
|
62
|
+
}), (e, o) => (G(), P("div", {
|
|
63
|
+
class: "responsive-toolbar",
|
|
64
|
+
ref_key: "containerRef",
|
|
65
|
+
ref: t
|
|
66
|
+
}, [F("div", {
|
|
67
|
+
class: "responsive-toolbar__items",
|
|
68
|
+
ref_key: "itemsRef",
|
|
69
|
+
ref: n
|
|
70
|
+
}, [J(e.$slots, "default", {}, void 0, !0)], 512), i.value > 0 ? (G(), P("div", {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "responsive-toolbar__overflow",
|
|
73
|
+
ref_key: "overflowRef",
|
|
74
|
+
ref: r
|
|
75
|
+
}, [F("button", {
|
|
76
|
+
class: "responsive-toolbar__overflow-btn",
|
|
77
|
+
onMousedown: o[0] ||= Q((e) => a.value = !a.value, ["prevent"]),
|
|
78
|
+
title: `${i.value} more items`
|
|
79
|
+
}, " ⋯ ", 40, Ne), a.value ? (G(), P("div", Pe, [J(e.$slots, "overflow", {}, void 0, !0)])) : N("", !0)], 512)) : N("", !0)], 512));
|
|
80
|
+
}
|
|
81
|
+
}), [["__scopeId", "data-v-30fbba34"]]), Ie = ["value", "disabled"], Le = {
|
|
82
|
+
key: 0,
|
|
83
|
+
label: "Sans-serif"
|
|
84
|
+
}, Re = ["value"], ze = {
|
|
85
|
+
key: 1,
|
|
86
|
+
label: "Serif"
|
|
87
|
+
}, Be = ["value"], Ve = {
|
|
88
|
+
key: 2,
|
|
89
|
+
label: "Monospace"
|
|
90
|
+
}, He = ["value"], Ue = {
|
|
91
|
+
key: 3,
|
|
92
|
+
label: "Other"
|
|
93
|
+
}, We = ["value"], Ge = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
94
|
+
__name: "FontPicker",
|
|
95
|
+
props: {
|
|
96
|
+
value: {},
|
|
97
|
+
fonts: {},
|
|
98
|
+
disabled: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: !1
|
|
101
|
+
},
|
|
102
|
+
className: {},
|
|
103
|
+
placeholder: { default: "Font" },
|
|
104
|
+
showPreview: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: !0
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
emits: ["change"],
|
|
110
|
+
setup(e, { emit: t }) {
|
|
111
|
+
let n = e, r = t, i = [
|
|
112
|
+
{
|
|
113
|
+
name: "Arial",
|
|
114
|
+
fontFamily: "Arial, Helvetica, sans-serif",
|
|
115
|
+
category: "sans-serif"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Calibri",
|
|
119
|
+
fontFamily: "\"Calibri\", Arial, sans-serif",
|
|
120
|
+
category: "sans-serif"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "Helvetica",
|
|
124
|
+
fontFamily: "Helvetica, Arial, sans-serif",
|
|
125
|
+
category: "sans-serif"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "Verdana",
|
|
129
|
+
fontFamily: "Verdana, Geneva, sans-serif",
|
|
130
|
+
category: "sans-serif"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "Open Sans",
|
|
134
|
+
fontFamily: "\"Open Sans\", sans-serif",
|
|
135
|
+
category: "sans-serif"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "Roboto",
|
|
139
|
+
fontFamily: "Roboto, sans-serif",
|
|
140
|
+
category: "sans-serif"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "Times New Roman",
|
|
144
|
+
fontFamily: "\"Times New Roman\", Times, serif",
|
|
145
|
+
category: "serif"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: "Georgia",
|
|
149
|
+
fontFamily: "Georgia, serif",
|
|
150
|
+
category: "serif"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "Cambria",
|
|
154
|
+
fontFamily: "Cambria, Georgia, serif",
|
|
155
|
+
category: "serif"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "Garamond",
|
|
159
|
+
fontFamily: "Garamond, serif",
|
|
160
|
+
category: "serif"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "Courier New",
|
|
164
|
+
fontFamily: "\"Courier New\", monospace",
|
|
165
|
+
category: "monospace"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "Consolas",
|
|
169
|
+
fontFamily: "Consolas, monospace",
|
|
170
|
+
category: "monospace"
|
|
171
|
+
}
|
|
172
|
+
], a = j(() => n.fonts ?? i), o = j(() => {
|
|
173
|
+
let e = {
|
|
174
|
+
"sans-serif": [],
|
|
175
|
+
serif: [],
|
|
176
|
+
monospace: [],
|
|
177
|
+
other: []
|
|
178
|
+
};
|
|
179
|
+
for (let t of a.value) e[t.category ?? "other"].push(t);
|
|
180
|
+
return e;
|
|
181
|
+
}), s = j(() => n.value ? a.value.find((e) => e.fontFamily === n.value || e.name.toLowerCase() === n.value.toLowerCase())?.name ?? n.value : n.placeholder);
|
|
182
|
+
function c(e) {
|
|
183
|
+
let t = e.target.value;
|
|
184
|
+
r("change", a.value.find((e) => e.name === t)?.fontFamily ?? t);
|
|
185
|
+
}
|
|
186
|
+
return (t, n) => (G(), P("select", {
|
|
187
|
+
class: V(["docx-font-picker", e.className]),
|
|
188
|
+
value: s.value,
|
|
189
|
+
disabled: e.disabled,
|
|
190
|
+
"aria-label": "Font family",
|
|
191
|
+
onChange: c
|
|
192
|
+
}, [
|
|
193
|
+
o.value["sans-serif"].length ? (G(), P("optgroup", Le, [(G(!0), P(k, null, q(o.value["sans-serif"], (t) => (G(), P("option", {
|
|
194
|
+
key: t.name,
|
|
195
|
+
value: t.name,
|
|
196
|
+
style: H(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
197
|
+
}, Y(t.name), 13, Re))), 128))])) : N("", !0),
|
|
198
|
+
o.value.serif.length ? (G(), P("optgroup", ze, [(G(!0), P(k, null, q(o.value.serif, (t) => (G(), P("option", {
|
|
199
|
+
key: t.name,
|
|
200
|
+
value: t.name,
|
|
201
|
+
style: H(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
202
|
+
}, Y(t.name), 13, Be))), 128))])) : N("", !0),
|
|
203
|
+
o.value.monospace.length ? (G(), P("optgroup", Ve, [(G(!0), P(k, null, q(o.value.monospace, (t) => (G(), P("option", {
|
|
204
|
+
key: t.name,
|
|
205
|
+
value: t.name,
|
|
206
|
+
style: H(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
207
|
+
}, Y(t.name), 13, He))), 128))])) : N("", !0),
|
|
208
|
+
o.value.other.length ? (G(), P("optgroup", Ue, [(G(!0), P(k, null, q(o.value.other, (t) => (G(), P("option", {
|
|
209
|
+
key: t.name,
|
|
210
|
+
value: t.name,
|
|
211
|
+
style: H(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
212
|
+
}, Y(t.name), 13, We))), 128))])) : N("", !0)
|
|
213
|
+
], 42, Ie));
|
|
214
|
+
}
|
|
215
|
+
}), [["__scopeId", "data-v-e9575b1d"]]), Ke = { class: "docx-font-size" }, qe = ["disabled"], Je = [
|
|
216
|
+
"value",
|
|
217
|
+
"disabled",
|
|
218
|
+
"placeholder"
|
|
219
|
+
], Ye = ["disabled"], Xe = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
220
|
+
__name: "FontSizePicker",
|
|
221
|
+
props: {
|
|
222
|
+
value: {},
|
|
223
|
+
sizes: {},
|
|
224
|
+
disabled: {
|
|
225
|
+
type: Boolean,
|
|
226
|
+
default: !1
|
|
227
|
+
},
|
|
228
|
+
minSize: { default: 1 },
|
|
229
|
+
maxSize: { default: 1638 },
|
|
230
|
+
placeholder: { default: "11" }
|
|
231
|
+
},
|
|
232
|
+
emits: ["change"],
|
|
233
|
+
setup(e, { emit: t }) {
|
|
234
|
+
let n = e, r = t, i = [
|
|
235
|
+
8,
|
|
236
|
+
9,
|
|
237
|
+
10,
|
|
238
|
+
11,
|
|
239
|
+
12,
|
|
240
|
+
14,
|
|
241
|
+
16,
|
|
242
|
+
18,
|
|
243
|
+
20,
|
|
244
|
+
24,
|
|
245
|
+
28,
|
|
246
|
+
36,
|
|
247
|
+
48,
|
|
248
|
+
72
|
|
249
|
+
], a = j(() => n.sizes ?? i), o = j(() => n.value ?? parseInt(n.placeholder, 10) ?? 11), s = j(() => n.value === void 0 ? n.placeholder : String(n.value));
|
|
250
|
+
function c(e) {
|
|
251
|
+
return a.value.find((t) => t > e) ?? Math.min(e + 1, n.maxSize);
|
|
252
|
+
}
|
|
253
|
+
function l(e) {
|
|
254
|
+
return [...a.value].reverse().find((t) => t < e) ?? Math.max(e - 1, n.minSize);
|
|
255
|
+
}
|
|
256
|
+
function u() {
|
|
257
|
+
n.disabled || r("change", l(o.value));
|
|
258
|
+
}
|
|
259
|
+
function d() {
|
|
260
|
+
n.disabled || r("change", c(o.value));
|
|
261
|
+
}
|
|
262
|
+
function f(e) {
|
|
263
|
+
let t = parseFloat(e.target.value);
|
|
264
|
+
!isNaN(t) && t >= n.minSize && t <= n.maxSize && r("change", Math.round(t * 2) / 2);
|
|
265
|
+
}
|
|
266
|
+
return (t, n) => (G(), P("div", Ke, [
|
|
267
|
+
F("button", {
|
|
268
|
+
type: "button",
|
|
269
|
+
class: "docx-font-size__btn",
|
|
270
|
+
disabled: e.disabled || o.value <= e.minSize,
|
|
271
|
+
title: "Decrease font size",
|
|
272
|
+
onClick: Q(u, ["prevent"])
|
|
273
|
+
}, "−", 8, qe),
|
|
274
|
+
F("input", {
|
|
275
|
+
class: "docx-font-size__input",
|
|
276
|
+
type: "text",
|
|
277
|
+
value: s.value,
|
|
278
|
+
disabled: e.disabled,
|
|
279
|
+
placeholder: e.placeholder,
|
|
280
|
+
onKeydown: [
|
|
281
|
+
n[0] ||= Z(Q((e) => {
|
|
282
|
+
u(), e.stopPropagation();
|
|
283
|
+
}, ["prevent"]), ["up"]),
|
|
284
|
+
n[1] ||= Z(Q((e) => {
|
|
285
|
+
d(), e.stopPropagation();
|
|
286
|
+
}, ["prevent"]), ["down"]),
|
|
287
|
+
n[2] ||= Z(Q((e) => f(e), ["prevent"]), ["enter"])
|
|
288
|
+
],
|
|
289
|
+
onBlur: n[3] ||= (e) => f(e)
|
|
290
|
+
}, null, 40, Je),
|
|
291
|
+
F("button", {
|
|
292
|
+
type: "button",
|
|
293
|
+
class: "docx-font-size__btn",
|
|
294
|
+
disabled: e.disabled || o.value >= e.maxSize,
|
|
295
|
+
title: "Increase font size",
|
|
296
|
+
onClick: Q(d, ["prevent"])
|
|
297
|
+
}, "+", 8, Ye)
|
|
298
|
+
]));
|
|
299
|
+
}
|
|
300
|
+
}), [["__scopeId", "data-v-966fd914"]]), Ze = ["value", "disabled"], Qe = ["value"], $e = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
301
|
+
__name: "LineSpacingPicker",
|
|
302
|
+
props: {
|
|
303
|
+
value: {},
|
|
304
|
+
options: {},
|
|
305
|
+
disabled: {
|
|
306
|
+
type: Boolean,
|
|
307
|
+
default: !1
|
|
308
|
+
},
|
|
309
|
+
className: {}
|
|
310
|
+
},
|
|
311
|
+
emits: ["change"],
|
|
312
|
+
setup(e, { emit: t }) {
|
|
313
|
+
let n = e, r = t, i = [
|
|
314
|
+
{
|
|
315
|
+
label: "Single",
|
|
316
|
+
value: 1,
|
|
317
|
+
twipsValue: 240
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
label: "1.15",
|
|
321
|
+
value: 1.15,
|
|
322
|
+
twipsValue: 276
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
label: "1.5",
|
|
326
|
+
value: 1.5,
|
|
327
|
+
twipsValue: 360
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
label: "Double",
|
|
331
|
+
value: 2,
|
|
332
|
+
twipsValue: 480
|
|
333
|
+
}
|
|
334
|
+
], a = j(() => n.options ?? i), o = j(() => n.value ?? a.value[0].twipsValue);
|
|
335
|
+
function s(e) {
|
|
336
|
+
let t = parseInt(e.target.value, 10);
|
|
337
|
+
isNaN(t) || r("change", t);
|
|
338
|
+
}
|
|
339
|
+
return (t, n) => (G(), P("select", {
|
|
340
|
+
class: V(["docx-line-spacing", e.className]),
|
|
341
|
+
value: String(o.value),
|
|
342
|
+
disabled: e.disabled,
|
|
343
|
+
"aria-label": "Line spacing",
|
|
344
|
+
onChange: s
|
|
345
|
+
}, [(G(!0), P(k, null, q(a.value, (e) => (G(), P("option", {
|
|
346
|
+
key: e.twipsValue,
|
|
347
|
+
value: String(e.twipsValue)
|
|
348
|
+
}, Y(e.label), 9, Qe))), 128))], 42, Ze));
|
|
349
|
+
}
|
|
350
|
+
}), [["__scopeId", "data-v-fa103426"]]), et = ["value", "disabled"], tt = ["value"], nt = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
351
|
+
__name: "StylePicker",
|
|
352
|
+
props: {
|
|
353
|
+
value: {},
|
|
354
|
+
styles: {},
|
|
355
|
+
disabled: {
|
|
356
|
+
type: Boolean,
|
|
357
|
+
default: !1
|
|
358
|
+
},
|
|
359
|
+
className: {}
|
|
360
|
+
},
|
|
361
|
+
emits: ["change"],
|
|
362
|
+
setup(e, { emit: t }) {
|
|
363
|
+
let n = e, r = t, i = [
|
|
364
|
+
{
|
|
365
|
+
styleId: "Normal",
|
|
366
|
+
name: "Normal text"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
styleId: "Title",
|
|
370
|
+
name: "Title"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
styleId: "Subtitle",
|
|
374
|
+
name: "Subtitle"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
styleId: "Heading1",
|
|
378
|
+
name: "Heading 1"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
styleId: "Heading2",
|
|
382
|
+
name: "Heading 2"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
styleId: "Heading3",
|
|
386
|
+
name: "Heading 3"
|
|
387
|
+
}
|
|
388
|
+
], a = j(() => n.styles ?? i);
|
|
389
|
+
function o(e) {
|
|
390
|
+
r("change", e.target.value);
|
|
391
|
+
}
|
|
392
|
+
return (t, n) => (G(), P("select", {
|
|
393
|
+
class: V(["docx-style-picker", e.className]),
|
|
394
|
+
value: e.value ?? "Normal",
|
|
395
|
+
disabled: e.disabled,
|
|
396
|
+
"aria-label": "Paragraph style",
|
|
397
|
+
onChange: o
|
|
398
|
+
}, [(G(!0), P(k, null, q(a.value, (e) => (G(), P("option", {
|
|
399
|
+
key: e.styleId,
|
|
400
|
+
value: e.styleId
|
|
401
|
+
}, Y(e.name), 9, tt))), 128))], 42, et));
|
|
402
|
+
}
|
|
403
|
+
}), [["__scopeId", "data-v-e8ec7466"]]), rt = [
|
|
404
|
+
"disabled",
|
|
405
|
+
"title",
|
|
406
|
+
"aria-expanded",
|
|
407
|
+
"onClick"
|
|
408
|
+
], it = { class: "docx-align__panel" }, at = ["title", "onClick"], ot = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
409
|
+
__name: "AlignmentButtons",
|
|
410
|
+
props: {
|
|
411
|
+
value: { default: "left" },
|
|
412
|
+
disabled: {
|
|
413
|
+
type: Boolean,
|
|
414
|
+
default: !1
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
emits: ["change"],
|
|
418
|
+
setup(e, { emit: t }) {
|
|
419
|
+
let n = e, r = t, a = K(!1), o = [
|
|
420
|
+
{
|
|
421
|
+
value: "left",
|
|
422
|
+
label: "Align left",
|
|
423
|
+
icon: "format_align_left",
|
|
424
|
+
shortcut: "Ctrl+L"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
value: "center",
|
|
428
|
+
label: "Center",
|
|
429
|
+
icon: "format_align_center",
|
|
430
|
+
shortcut: "Ctrl+E"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
value: "right",
|
|
434
|
+
label: "Align right",
|
|
435
|
+
icon: "format_align_right",
|
|
436
|
+
shortcut: "Ctrl+R"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
value: "both",
|
|
440
|
+
label: "Justify",
|
|
441
|
+
icon: "format_align_justify",
|
|
442
|
+
shortcut: "Ctrl+J"
|
|
443
|
+
}
|
|
444
|
+
], s = j(() => o.find((e) => e.value === n.value)?.icon ?? "format_align_left"), c = j(() => o.find((e) => e.value === n.value)?.label ?? "Left");
|
|
445
|
+
function l(e) {
|
|
446
|
+
r("change", e), a.value = !1;
|
|
447
|
+
}
|
|
448
|
+
return (t, n) => (G(), M(u, {
|
|
449
|
+
open: a.value,
|
|
450
|
+
"onUpdate:open": n[0] ||= (e) => a.value = e,
|
|
451
|
+
onClose: n[1] ||= (e) => a.value = !1
|
|
452
|
+
}, {
|
|
453
|
+
trigger: X(({ toggle: t }) => [F("button", {
|
|
454
|
+
type: "button",
|
|
455
|
+
class: V(["docx-align__btn", { "docx-align__btn--open": a.value }]),
|
|
456
|
+
disabled: e.disabled,
|
|
457
|
+
title: `Alignment: ${c.value}`,
|
|
458
|
+
"aria-expanded": a.value,
|
|
459
|
+
"aria-haspopup": "true",
|
|
460
|
+
onClick: Q(t, ["prevent"])
|
|
461
|
+
}, [L(i, {
|
|
462
|
+
name: s.value,
|
|
463
|
+
size: 20
|
|
464
|
+
}, null, 8, ["name"]), L(i, {
|
|
465
|
+
name: "arrow_drop_down",
|
|
466
|
+
size: 14
|
|
467
|
+
})], 10, rt)]),
|
|
468
|
+
panel: X(() => [F("div", it, [(G(), P(k, null, q(o, (t) => F("button", {
|
|
469
|
+
key: t.value,
|
|
470
|
+
type: "button",
|
|
471
|
+
class: V(["docx-align__option", { "docx-align__option--active": e.value === t.value }]),
|
|
472
|
+
title: `${t.label} (${t.shortcut})`,
|
|
473
|
+
onClick: Q((e) => l(t.value), ["prevent"])
|
|
474
|
+
}, [L(i, {
|
|
475
|
+
name: t.icon,
|
|
476
|
+
size: 20
|
|
477
|
+
}, null, 8, ["name"])], 10, at)), 64))])]),
|
|
478
|
+
_: 1
|
|
479
|
+
}, 8, ["open"]));
|
|
480
|
+
}
|
|
481
|
+
}), [["__scopeId", "data-v-f2eb4f74"]]), st = { class: "docx-list-btns" }, ct = ["disabled"], lt = ["disabled"], ut = ["disabled"], dt = ["disabled"], ft = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
482
|
+
__name: "ListButtons",
|
|
483
|
+
props: {
|
|
484
|
+
listState: {},
|
|
485
|
+
disabled: {
|
|
486
|
+
type: Boolean,
|
|
487
|
+
default: !1
|
|
488
|
+
},
|
|
489
|
+
showIndentButtons: {
|
|
490
|
+
type: Boolean,
|
|
491
|
+
default: !0
|
|
492
|
+
},
|
|
493
|
+
canOutdent: {
|
|
494
|
+
type: Boolean,
|
|
495
|
+
default: !0
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
emits: [
|
|
499
|
+
"bullet-list",
|
|
500
|
+
"numbered-list",
|
|
501
|
+
"indent",
|
|
502
|
+
"outdent"
|
|
503
|
+
],
|
|
504
|
+
setup(e) {
|
|
505
|
+
return (t, n) => (G(), P("span", st, [
|
|
506
|
+
F("button", {
|
|
507
|
+
type: "button",
|
|
508
|
+
class: V(["docx-list-btns__btn", { "docx-list-btns__btn--active": e.listState?.isInList && e.listState?.type === "bullet" }]),
|
|
509
|
+
disabled: e.disabled,
|
|
510
|
+
title: "Bullet list",
|
|
511
|
+
onClick: n[0] ||= Q((e) => t.$emit("bullet-list"), ["prevent"])
|
|
512
|
+
}, [L(i, {
|
|
513
|
+
name: "format_list_bulleted",
|
|
514
|
+
size: 20
|
|
515
|
+
})], 10, ct),
|
|
516
|
+
F("button", {
|
|
517
|
+
type: "button",
|
|
518
|
+
class: V(["docx-list-btns__btn", { "docx-list-btns__btn--active": e.listState?.isInList && e.listState?.type === "numbered" }]),
|
|
519
|
+
disabled: e.disabled,
|
|
520
|
+
title: "Numbered list",
|
|
521
|
+
onClick: n[1] ||= Q((e) => t.$emit("numbered-list"), ["prevent"])
|
|
522
|
+
}, [L(i, {
|
|
523
|
+
name: "format_list_numbered",
|
|
524
|
+
size: 20
|
|
525
|
+
})], 10, lt),
|
|
526
|
+
e.showIndentButtons ? (G(), P(k, { key: 0 }, [F("button", {
|
|
527
|
+
type: "button",
|
|
528
|
+
class: "docx-list-btns__btn",
|
|
529
|
+
disabled: e.disabled || !e.canOutdent,
|
|
530
|
+
title: "Decrease indent",
|
|
531
|
+
onClick: n[2] ||= Q((e) => t.$emit("outdent"), ["prevent"])
|
|
532
|
+
}, [L(i, {
|
|
533
|
+
name: "format_indent_decrease",
|
|
534
|
+
size: 20
|
|
535
|
+
})], 8, ut), F("button", {
|
|
536
|
+
type: "button",
|
|
537
|
+
class: "docx-list-btns__btn",
|
|
538
|
+
disabled: e.disabled,
|
|
539
|
+
title: "Increase indent",
|
|
540
|
+
onClick: n[3] ||= Q((e) => t.$emit("indent"), ["prevent"])
|
|
541
|
+
}, [L(i, {
|
|
542
|
+
name: "format_indent_increase",
|
|
543
|
+
size: 20
|
|
544
|
+
})], 8, dt)], 64)) : N("", !0)
|
|
545
|
+
]));
|
|
546
|
+
}
|
|
547
|
+
}), [["__scopeId", "data-v-6e11903a"]]), pt = [
|
|
548
|
+
"value",
|
|
549
|
+
"disabled",
|
|
550
|
+
"aria-label"
|
|
551
|
+
], mt = ["value"], ht = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
552
|
+
__name: "ZoomControl",
|
|
553
|
+
props: {
|
|
554
|
+
value: { default: 1 },
|
|
555
|
+
levels: {},
|
|
556
|
+
disabled: {
|
|
557
|
+
type: Boolean,
|
|
558
|
+
default: !1
|
|
559
|
+
},
|
|
560
|
+
className: {},
|
|
561
|
+
compact: {
|
|
562
|
+
type: Boolean,
|
|
563
|
+
default: !1
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
emits: ["change"],
|
|
567
|
+
setup(e, { emit: t }) {
|
|
568
|
+
let n = e, r = t, i = [
|
|
569
|
+
{
|
|
570
|
+
value: .5,
|
|
571
|
+
label: "50%"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
value: .75,
|
|
575
|
+
label: "75%"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
value: 1,
|
|
579
|
+
label: "100%"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
value: 1.25,
|
|
583
|
+
label: "125%"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
value: 1.5,
|
|
587
|
+
label: "150%"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
value: 2,
|
|
591
|
+
label: "200%"
|
|
592
|
+
}
|
|
593
|
+
], a = j(() => n.levels ?? i), o = j(() => {
|
|
594
|
+
let e = a.value.find((e) => Math.abs(e.value - n.value) < .001);
|
|
595
|
+
return e ? e.label : `${Math.round(n.value * 100)}%`;
|
|
596
|
+
});
|
|
597
|
+
function s(e) {
|
|
598
|
+
let t = parseFloat(e.target.value);
|
|
599
|
+
isNaN(t) || r("change", t);
|
|
600
|
+
}
|
|
601
|
+
return (t, n) => (G(), P("select", {
|
|
602
|
+
class: V(["docx-zoom-control", {
|
|
603
|
+
"docx-zoom-control--compact": e.compact,
|
|
604
|
+
[e.className ?? ""]: !!e.className
|
|
605
|
+
}]),
|
|
606
|
+
value: e.value,
|
|
607
|
+
disabled: e.disabled,
|
|
608
|
+
"aria-label": `Zoom: ${o.value}`,
|
|
609
|
+
onChange: s
|
|
610
|
+
}, [(G(!0), P(k, null, q(a.value, (e) => (G(), P("option", {
|
|
611
|
+
key: e.value,
|
|
612
|
+
value: e.value
|
|
613
|
+
}, Y(e.label), 9, mt))), 128))], 42, pt));
|
|
614
|
+
}
|
|
615
|
+
}), [["__scopeId", "data-v-b68bd14b"]]), gt = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
616
|
+
__name: "Tooltip",
|
|
617
|
+
props: {
|
|
618
|
+
content: {},
|
|
619
|
+
side: { default: "bottom" },
|
|
620
|
+
delayMs: { default: 400 }
|
|
621
|
+
},
|
|
622
|
+
setup(e) {
|
|
623
|
+
let t = e, n = K(!1), r = K({
|
|
624
|
+
x: 0,
|
|
625
|
+
y: 0
|
|
626
|
+
}), i = K(null), a = null;
|
|
627
|
+
function o() {
|
|
628
|
+
a = setTimeout(() => {
|
|
629
|
+
let e = i.value;
|
|
630
|
+
if (e) {
|
|
631
|
+
let n = e.getBoundingClientRect();
|
|
632
|
+
r.value = {
|
|
633
|
+
x: n.left + n.width / 2,
|
|
634
|
+
y: t.side === "top" ? n.top - 8 : n.bottom + 8
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
n.value = !0;
|
|
638
|
+
}, t.delayMs);
|
|
639
|
+
}
|
|
640
|
+
function s() {
|
|
641
|
+
a &&= (clearTimeout(a), null), n.value = !1;
|
|
642
|
+
}
|
|
643
|
+
U(() => {
|
|
644
|
+
a && clearTimeout(a);
|
|
645
|
+
});
|
|
646
|
+
let c = j(() => ({
|
|
647
|
+
left: r.value.x + "px",
|
|
648
|
+
top: r.value.y + "px",
|
|
649
|
+
transform: t.side === "top" ? "translate(-50%, -100%)" : t.side === "bottom" ? "translate(-50%, 0)" : void 0
|
|
650
|
+
}));
|
|
651
|
+
return (t, r) => (G(), P(k, null, [F("span", {
|
|
652
|
+
ref_key: "triggerRef",
|
|
653
|
+
ref: i,
|
|
654
|
+
class: "docx-tooltip__trigger",
|
|
655
|
+
onMouseenter: o,
|
|
656
|
+
onMouseleave: s
|
|
657
|
+
}, [J(t.$slots, "default", {}, void 0, !0)], 544), (G(), M(A, { to: "body" }, [n.value ? (G(), P("div", {
|
|
658
|
+
key: 0,
|
|
659
|
+
class: "docx-tooltip",
|
|
660
|
+
style: H(c.value)
|
|
661
|
+
}, Y(e.content), 5)) : N("", !0)]))], 64));
|
|
662
|
+
}
|
|
663
|
+
}), [["__scopeId", "data-v-ad4cfb4e"]]), _t = ["aria-label"], vt = {
|
|
664
|
+
key: 0,
|
|
665
|
+
class: "docx-loading__spinner"
|
|
666
|
+
}, yt = {
|
|
667
|
+
key: 1,
|
|
668
|
+
class: "docx-loading__bar"
|
|
669
|
+
}, bt = {
|
|
670
|
+
key: 2,
|
|
671
|
+
class: "docx-loading__message"
|
|
672
|
+
}, xt = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
673
|
+
__name: "LoadingIndicator",
|
|
674
|
+
props: {
|
|
675
|
+
isLoading: { type: Boolean },
|
|
676
|
+
variant: { default: "spinner" },
|
|
677
|
+
size: { default: "medium" },
|
|
678
|
+
message: {},
|
|
679
|
+
overlay: {
|
|
680
|
+
type: Boolean,
|
|
681
|
+
default: !1
|
|
682
|
+
},
|
|
683
|
+
progress: { default: null }
|
|
684
|
+
},
|
|
685
|
+
setup(e) {
|
|
686
|
+
return (t, n) => e.isLoading ? (G(), P("div", {
|
|
687
|
+
key: 0,
|
|
688
|
+
class: V([
|
|
689
|
+
"docx-loading",
|
|
690
|
+
`docx-loading--${e.variant}`,
|
|
691
|
+
`docx-loading--${e.size}`,
|
|
692
|
+
{ "docx-loading--overlay": e.overlay }
|
|
693
|
+
]),
|
|
694
|
+
role: "status",
|
|
695
|
+
"aria-label": e.message
|
|
696
|
+
}, [e.variant === "spinner" ? (G(), P("span", vt)) : e.variant === "bar" || e.variant === "progress" ? (G(), P("div", yt, [F("div", {
|
|
697
|
+
class: "docx-loading__bar-fill",
|
|
698
|
+
style: H(e.variant === "progress" && e.progress != null ? { width: e.progress + "%" } : void 0)
|
|
699
|
+
}, null, 4)])) : N("", !0), e.message ? (G(), P("span", bt, Y(e.message), 1)) : N("", !0)], 10, _t)) : N("", !0);
|
|
700
|
+
}
|
|
701
|
+
}), [["__scopeId", "data-v-2bd78a2f"]]), St = ["disabled"], Ct = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", wt = /* @__PURE__ */ R({
|
|
702
|
+
__name: "Button",
|
|
703
|
+
props: {
|
|
704
|
+
variant: { default: "default" },
|
|
705
|
+
size: { default: "default" },
|
|
706
|
+
disabled: {
|
|
707
|
+
type: Boolean,
|
|
708
|
+
default: !1
|
|
709
|
+
},
|
|
710
|
+
className: { default: "" }
|
|
711
|
+
},
|
|
712
|
+
emits: ["click"],
|
|
713
|
+
setup(e) {
|
|
714
|
+
let t = e, n = {
|
|
715
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
716
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
717
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
718
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
719
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
720
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
721
|
+
}, r = {
|
|
722
|
+
default: "h-10 px-4 py-2",
|
|
723
|
+
sm: "h-9 rounded-md px-3",
|
|
724
|
+
lg: "h-11 rounded-md px-8",
|
|
725
|
+
icon: "h-9 w-9",
|
|
726
|
+
"icon-sm": "h-7 w-7"
|
|
727
|
+
}, i = j(() => [
|
|
728
|
+
Ct,
|
|
729
|
+
n[t.variant],
|
|
730
|
+
r[t.size],
|
|
731
|
+
t.className
|
|
732
|
+
].filter(Boolean).join(" "));
|
|
733
|
+
return (t, n) => (G(), P("button", {
|
|
734
|
+
class: V(i.value),
|
|
735
|
+
disabled: e.disabled,
|
|
736
|
+
onClick: n[0] ||= (e) => t.$emit("click", e)
|
|
737
|
+
}, [J(t.$slots, "default")], 10, St));
|
|
738
|
+
}
|
|
739
|
+
}), Tt = [
|
|
740
|
+
"disabled",
|
|
741
|
+
"aria-expanded",
|
|
742
|
+
"title",
|
|
743
|
+
"onClick"
|
|
744
|
+
], Et = { class: "docx-table-grid__panel" }, Dt = { class: "docx-table-grid__label" }, Ot = ["onMouseenter", "onClick"], kt = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
745
|
+
__name: "TableGridPicker",
|
|
746
|
+
props: {
|
|
747
|
+
disabled: {
|
|
748
|
+
type: Boolean,
|
|
749
|
+
default: !1
|
|
750
|
+
},
|
|
751
|
+
gridRows: { default: 5 },
|
|
752
|
+
gridColumns: { default: 5 },
|
|
753
|
+
tooltip: { default: "Insert table" }
|
|
754
|
+
},
|
|
755
|
+
emits: ["insert"],
|
|
756
|
+
setup(e, { emit: t }) {
|
|
757
|
+
let n = e, r = t, a = K(!1), o = K({
|
|
758
|
+
rows: 1,
|
|
759
|
+
cols: 1
|
|
760
|
+
}), s = j(() => {
|
|
761
|
+
let e = [];
|
|
762
|
+
for (let t = 1; t <= n.gridRows; t++) for (let r = 1; r <= n.gridColumns; r++) e.push({
|
|
763
|
+
r: t,
|
|
764
|
+
c: r
|
|
765
|
+
});
|
|
766
|
+
return e;
|
|
767
|
+
});
|
|
768
|
+
function c(e, t) {
|
|
769
|
+
r("insert", e, t), a.value = !1;
|
|
770
|
+
}
|
|
771
|
+
function l() {
|
|
772
|
+
a.value = !1, o.value = {
|
|
773
|
+
rows: 1,
|
|
774
|
+
cols: 1
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
return (t, n) => (G(), M(u, {
|
|
778
|
+
open: a.value,
|
|
779
|
+
"onUpdate:open": n[0] ||= (e) => a.value = e,
|
|
780
|
+
onClose: l
|
|
781
|
+
}, {
|
|
782
|
+
trigger: X(({ toggle: t }) => [F("button", {
|
|
783
|
+
type: "button",
|
|
784
|
+
class: "docx-table-grid__btn",
|
|
785
|
+
disabled: e.disabled,
|
|
786
|
+
"aria-expanded": a.value,
|
|
787
|
+
"aria-haspopup": "grid",
|
|
788
|
+
title: e.tooltip,
|
|
789
|
+
onClick: Q(t, ["prevent"])
|
|
790
|
+
}, [L(i, {
|
|
791
|
+
name: "grid_on",
|
|
792
|
+
size: 20
|
|
793
|
+
})], 8, Tt)]),
|
|
794
|
+
panel: X(() => [F("div", Et, [F("div", Dt, Y(o.value.rows) + " × " + Y(o.value.cols), 1), F("div", {
|
|
795
|
+
class: "docx-table-grid__grid",
|
|
796
|
+
style: H({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` })
|
|
797
|
+
}, [(G(!0), P(k, null, q(s.value, (e) => (G(), P("button", {
|
|
798
|
+
key: `${e.r}-${e.c}`,
|
|
799
|
+
class: V(["docx-table-grid__cell", { "docx-table-grid__cell--active": e.r <= o.value.rows && e.c <= o.value.cols }]),
|
|
800
|
+
onMouseenter: (t) => o.value = {
|
|
801
|
+
rows: e.r,
|
|
802
|
+
cols: e.c
|
|
803
|
+
},
|
|
804
|
+
onClick: Q((t) => c(e.r, e.c), ["prevent"])
|
|
805
|
+
}, null, 42, Ot))), 128))], 4)])]),
|
|
806
|
+
_: 1
|
|
807
|
+
}, 8, ["open"]));
|
|
808
|
+
}
|
|
809
|
+
}), [["__scopeId", "data-v-235ac5f8"]]), At = { class: "docx-table-insert" }, jt = [
|
|
810
|
+
"disabled",
|
|
811
|
+
"title",
|
|
812
|
+
"onClick"
|
|
813
|
+
], Mt = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
814
|
+
__name: "TableInsertButtons",
|
|
815
|
+
props: { disabled: { type: Boolean } },
|
|
816
|
+
emits: ["action"],
|
|
817
|
+
setup(e, { emit: t }) {
|
|
818
|
+
let n = t, r = [
|
|
819
|
+
{
|
|
820
|
+
action: "addRowAbove",
|
|
821
|
+
icon: "keyboard_arrow_up",
|
|
822
|
+
label: "Insert row above"
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
action: "addRowBelow",
|
|
826
|
+
icon: "keyboard_arrow_down",
|
|
827
|
+
label: "Insert row below"
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
action: "addColumnLeft",
|
|
831
|
+
icon: "keyboard_arrow_left",
|
|
832
|
+
label: "Insert column left"
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
action: "addColumnRight",
|
|
836
|
+
icon: "keyboard_arrow_right",
|
|
837
|
+
label: "Insert column right"
|
|
838
|
+
}
|
|
839
|
+
];
|
|
840
|
+
return (t, a) => (G(), P("span", At, [(G(), P(k, null, q(r, (t) => F("button", {
|
|
841
|
+
key: t.action,
|
|
842
|
+
type: "button",
|
|
843
|
+
class: "docx-table-insert__btn",
|
|
844
|
+
disabled: e.disabled,
|
|
845
|
+
title: t.label,
|
|
846
|
+
onClick: Q((e) => n("action", t.action), ["prevent"])
|
|
847
|
+
}, [L(i, {
|
|
848
|
+
name: t.icon,
|
|
849
|
+
size: 20
|
|
850
|
+
}, null, 8, ["name"])], 8, jt)), 64))]));
|
|
851
|
+
}
|
|
852
|
+
}), [["__scopeId", "data-v-c5bf5e60"]]), Nt = ["disabled", "title"], $ = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
853
|
+
__name: "TableMergeButton",
|
|
854
|
+
props: {
|
|
855
|
+
canSplit: { type: Boolean },
|
|
856
|
+
disabled: { type: Boolean }
|
|
857
|
+
},
|
|
858
|
+
emits: ["action"],
|
|
859
|
+
setup(e, { emit: t }) {
|
|
860
|
+
let n = t;
|
|
861
|
+
return (t, r) => (G(), P("button", {
|
|
862
|
+
type: "button",
|
|
863
|
+
class: "docx-table-merge",
|
|
864
|
+
disabled: e.disabled,
|
|
865
|
+
title: e.canSplit ? "Split cells" : "Merge cells",
|
|
866
|
+
onClick: r[0] ||= Q((t) => n("action", e.canSplit ? "splitCells" : "mergeCells"), ["prevent"])
|
|
867
|
+
}, [L(i, {
|
|
868
|
+
name: e.canSplit ? "call_split" : "call_merge",
|
|
869
|
+
size: 20
|
|
870
|
+
}, null, 8, ["name"])], 8, Nt));
|
|
871
|
+
}
|
|
872
|
+
}), [["__scopeId", "data-v-ec895571"]]), Pt = ["disabled", "title"], Ft = {
|
|
873
|
+
key: 0,
|
|
874
|
+
class: "print-btn__icon"
|
|
875
|
+
}, It = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
876
|
+
__name: "PrintButton",
|
|
877
|
+
props: {
|
|
878
|
+
disabled: {
|
|
879
|
+
type: Boolean,
|
|
880
|
+
default: !1
|
|
881
|
+
},
|
|
882
|
+
label: { default: "Print" },
|
|
883
|
+
compact: {
|
|
884
|
+
type: Boolean,
|
|
885
|
+
default: !1
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
emits: ["print"],
|
|
889
|
+
setup(e, { emit: t }) {
|
|
890
|
+
let n = e, r = t;
|
|
891
|
+
function i() {
|
|
892
|
+
n.disabled || (r("print"), window.print());
|
|
893
|
+
}
|
|
894
|
+
return (t, n) => (G(), P("button", {
|
|
895
|
+
class: "print-btn",
|
|
896
|
+
disabled: e.disabled,
|
|
897
|
+
title: e.label,
|
|
898
|
+
onMousedown: Q(i, ["prevent"])
|
|
899
|
+
}, [I(Y(e.compact ? "" : e.label) + " ", 1), e.compact ? (G(), P("span", Ft, "🖨")) : N("", !0)], 40, Pt));
|
|
900
|
+
}
|
|
901
|
+
}), [["__scopeId", "data-v-aa063c92"]]), Lt = "\n@media print {\n body * { visibility: hidden; }\n .docx-print-pages, .docx-print-pages * { visibility: visible; }\n .docx-print-pages { position: absolute; left: 0; top: 0; }\n .docx-print-page {\n box-shadow: none !important;\n margin: 0 !important;\n page-break-after: always;\n page-break-inside: avoid;\n }\n img { max-width: 100%; page-break-inside: avoid; }\n table, tr { page-break-inside: avoid; }\n h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }\n p { orphans: 3; widows: 3; }\n}\n@page { margin: 0; size: auto; }\n", Rt = /* @__PURE__ */ R({
|
|
902
|
+
__name: "PrintPreview",
|
|
903
|
+
setup(e) {
|
|
904
|
+
return (e, t) => (G(), M(he("style"), null, {
|
|
905
|
+
default: X(() => [I(Y(Lt))]),
|
|
906
|
+
_: 1
|
|
907
|
+
}));
|
|
908
|
+
}
|
|
909
|
+
}), zt = ["title"], Bt = {
|
|
910
|
+
key: 0,
|
|
911
|
+
class: "unsaved-indicator__dot"
|
|
912
|
+
}, Vt = {
|
|
913
|
+
key: 1,
|
|
914
|
+
class: "unsaved-indicator__badge"
|
|
915
|
+
}, Ht = {
|
|
916
|
+
key: 2,
|
|
917
|
+
class: "unsaved-indicator__text"
|
|
918
|
+
}, Ut = /* @__PURE__ */ T(/* @__PURE__ */ R({
|
|
919
|
+
__name: "UnsavedIndicator",
|
|
920
|
+
props: {
|
|
921
|
+
currentState: {},
|
|
922
|
+
warnOnUnload: {
|
|
923
|
+
type: Boolean,
|
|
924
|
+
default: !0
|
|
925
|
+
},
|
|
926
|
+
variant: { default: "dot" },
|
|
927
|
+
label: { default: "Unsaved changes" },
|
|
928
|
+
title: { default: "You have unsaved changes" }
|
|
929
|
+
},
|
|
930
|
+
setup(e, { expose: t }) {
|
|
931
|
+
let n = e, r = K(!1), i = K(0), a = null;
|
|
932
|
+
ge(() => n.currentState, (e) => {
|
|
933
|
+
if (e !== void 0) {
|
|
934
|
+
if (a === null) {
|
|
935
|
+
a = e;
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
e !== a && (r.value = !0, i.value++);
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
function o() {
|
|
942
|
+
a = n.currentState ?? null, r.value = !1, i.value = 0;
|
|
943
|
+
}
|
|
944
|
+
function s(e) {
|
|
945
|
+
r.value && n.warnOnUnload && (e.preventDefault(), e.returnValue = "");
|
|
946
|
+
}
|
|
947
|
+
return W(() => {
|
|
948
|
+
window.addEventListener("beforeunload", s);
|
|
949
|
+
}), U(() => {
|
|
950
|
+
window.removeEventListener("beforeunload", s);
|
|
951
|
+
}), t({
|
|
952
|
+
hasUnsavedChanges: r,
|
|
953
|
+
changeCount: i,
|
|
954
|
+
markAsSaved: o
|
|
955
|
+
}), (t, n) => r.value ? (G(), P("span", {
|
|
956
|
+
key: 0,
|
|
957
|
+
class: V(["unsaved-indicator", `unsaved-indicator--${e.variant}`]),
|
|
958
|
+
title: e.title
|
|
959
|
+
}, [e.variant === "dot" ? (G(), P("span", Bt)) : e.variant === "badge" ? (G(), P("span", Vt, Y(i.value), 1)) : (G(), P("span", Ht, Y(e.label), 1))], 10, zt)) : N("", !0);
|
|
960
|
+
}
|
|
961
|
+
}), [["__scopeId", "data-v-bf5add7c"]]), Wt = ve, Gt = ye;
|
|
962
|
+
//#endregion
|
|
963
|
+
export { y as AddCommentCard, ot as AlignmentButtons, wt as Button, Wt as CARD_STYLE_COLLAPSED, Gt as CARD_STYLE_EXPANDED, l as ColorPicker, h as CommentCard, ae as CommentMarginMarkers, v as DocumentName, f as EditingModeDropdown, Te as EditorToolbar, o as FindReplaceDialog, Ge as FontPicker, Xe as FontSizePicker, pe as FootnotePropertiesDialog, S as HorizontalRuler, e as HyperlinkDialog, ce as IconGridDropdown, ue as ImagePositionDialog, a as ImagePropertiesDialog, d as ImageTransformDropdown, c as ImageWrapDropdown, r as InsertImageDialog, t as InsertSymbolDialog, de as InsertTableDialog, s as KeyboardShortcutsDialog, $e as LineSpacingPicker, ft as ListButtons, xt as LoadingIndicator, C as MenuBar, ie as MenuDropdown, n as PageSetupDialog, E as PasteSpecialDialog, u as Popover, It as PrintButton, Rt as PrintPreview, re as ReplyInput, b as ReplyThread, m as ResolvedCommentMarker, Fe as ResponsiveToolbar, fe as SplitCellDialog, nt as StylePicker, se as TableBorderColorPicker, le as TableBorderPicker, ee as TableBorderWidthPicker, ne as TableCellFillPicker, x as TableGridInline, kt as TableGridPicker, Mt as TableInsertButtons, $ as TableMergeButton, g as TableMoreDropdown, O as TablePropertiesDialog, D as TableStyleGallery, _ as TableToolbar, Me as TitleBar, w as Toolbar, gt as Tooltip, oe as TrackedChangeCard, p as UnifiedSidebar, Ut as UnsavedIndicator, te as VerticalRuler, ht as ZoomControl, _e as createDefaultListState };
|