@robuust-digital/vue-components 2.7.0 → 3.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/CHANGELOG.md +25 -0
- package/dist/_shared/ButtonBase-DyeIkb-l.js +76 -0
- package/dist/_shared/ChevronDownIcon-Y_yqpwON.js +39 -0
- package/dist/_shared/FormInput-k0vAk3VU.js +69 -0
- package/dist/_shared/Modal-D0x_VHiB.js +188 -0
- package/dist/_shared/Tooltip-B5w_Ojie.js +85 -0
- package/dist/_shared/XMarkIcon-CBoWSM1l.js +17 -0
- package/dist/_shared/combobox-yh0YQ8_d.js +265 -0
- package/dist/_shared/core-C0o6izrz.js +854 -0
- package/dist/_shared/dialogs-SvdPsILD.js +179 -0
- package/dist/_shared/dropdown-BPUpLokN.js +134 -0
- package/dist/_shared/icon-spinner-D3Dhustt.js +23 -0
- package/dist/_shared/lightswitch-CpyX1iA_.js +38 -0
- package/dist/_shared/rich-text-editor-DkHKNS2n.js +226 -0
- package/dist/_shared/toast-DNxJDQWN.js +84 -0
- package/dist/combobox/index.js +2 -5
- package/dist/combobox.d.ts +3 -132
- package/dist/composables/useDialogContext.d.ts +19 -0
- package/dist/composables/useForm.d.ts +6 -0
- package/dist/core/file-upload.css +28 -1
- package/dist/core/index.js +5 -20
- package/dist/core.d.ts +15 -794
- package/dist/dialogs/index.js +3 -6
- package/dist/dialogs.d.ts +3 -300
- package/dist/dropdown/index.js +2 -5
- package/dist/dropdown.d.ts +3 -149
- package/dist/index/index.js +14 -36
- package/dist/index.d.ts +8 -1546
- package/dist/lightswitch/index.js +2 -5
- package/dist/lightswitch.d.ts +3 -39
- package/dist/rich-text-editor/index.js +2 -5
- package/dist/rich-text-editor.d.ts +3 -89
- package/dist/toast/index.js +2 -5
- package/dist/toast.d.ts +3 -66
- package/dist/tooltip/index.js +5 -5
- package/dist/tooltip.d.ts +3 -61
- package/dist/types/shared.d.ts +2 -0
- package/package.json +33 -36
- package/dist/_shared/ButtonBase.vue_vue_type_script_setup_true_lang-ZYVNEyNx.js +0 -60
- package/dist/_shared/ChevronDownIcon-BYWciGnh.js +0 -41
- package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-BwTRzqr6.js +0 -256
- package/dist/_shared/Drawer.vue_vue_type_script_setup_true_lang-DeAu2U_2.js +0 -197
- package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-Cv3HwIyF.js +0 -150
- package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-Bg7YPGyY.js +0 -74
- package/dist/_shared/Lightswitch.vue_vue_type_script_setup_true_lang-hiuDVfo5.js +0 -43
- package/dist/_shared/Modal.vue_vue_type_script_setup_true_lang-CdMsCCBi.js +0 -203
- package/dist/_shared/RichTextEditor.vue_vue_type_script_setup_true_lang-Miebq2nL.js +0 -247
- package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-BaTWaeN3.js +0 -931
- package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-DS6keeu7.js +0 -78
- package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-B3MHy48T.js +0 -95
- package/dist/_shared/XMarkIcon-CPr_Rd8y.js +0 -19
- package/dist/_shared/icon-spinner-BYCMrTdL.js +0 -26
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, computed as p, openBlock as s, createBlock as r, unref as o, withCtx as a, createVNode as f, mergeProps as h, createElementVNode as g, renderSlot as V, createCommentVNode as w } from "vue";
|
|
2
|
-
import { SwitchGroup as v, Switch as S, SwitchLabel as b } from "@headlessui/vue";
|
|
3
|
-
const C = /* @__PURE__ */ c({
|
|
4
|
-
inheritAttrs: !1,
|
|
5
|
-
__name: "Lightswitch",
|
|
6
|
-
props: {
|
|
7
|
-
modelValue: { type: Boolean, default: !1 }
|
|
8
|
-
},
|
|
9
|
-
emits: ["update:modelValue"],
|
|
10
|
-
setup(u, { emit: d }) {
|
|
11
|
-
const i = u, n = d, l = p({
|
|
12
|
-
get: () => i.modelValue,
|
|
13
|
-
set: (e) => n("update:modelValue", e)
|
|
14
|
-
});
|
|
15
|
-
return (e, t) => (s(), r(o(v), {
|
|
16
|
-
as: "div",
|
|
17
|
-
class: "rvc-lightswitch-group"
|
|
18
|
-
}, {
|
|
19
|
-
default: a(() => [
|
|
20
|
-
f(o(S), h({
|
|
21
|
-
modelValue: l.value,
|
|
22
|
-
"onUpdate:modelValue": t[0] || (t[0] = (m) => l.value = m),
|
|
23
|
-
class: [{ "rvc-lightswitch-enabled": l.value }, "rvc-lightswitch"]
|
|
24
|
-
}, e.$attrs), {
|
|
25
|
-
default: a(() => [...t[1] || (t[1] = [
|
|
26
|
-
g("span", { class: "rvc-lightswitch-toggle" }, null, -1)
|
|
27
|
-
])]),
|
|
28
|
-
_: 1
|
|
29
|
-
}, 16, ["modelValue", "class"]),
|
|
30
|
-
e.$slots.default ? (s(), r(o(b), { key: 0 }, {
|
|
31
|
-
default: a(() => [
|
|
32
|
-
V(e.$slots, "default")
|
|
33
|
-
]),
|
|
34
|
-
_: 3
|
|
35
|
-
})) : w("", !0)
|
|
36
|
-
]),
|
|
37
|
-
_: 3
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
export {
|
|
42
|
-
C as _
|
|
43
|
-
};
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { ref as $, computed as y, defineComponent as L, openBlock as p, createBlock as I, unref as t, withCtx as c, createVNode as i, withModifiers as N, createElementVNode as d, normalizeClass as T, renderSlot as s, createElementBlock as w, createTextVNode as h, toDisplayString as D, createCommentVNode as R } from "vue";
|
|
2
|
-
import { TransitionRoot as S, Dialog as V, TransitionChild as B, DialogPanel as M, DialogTitle as g } from "@headlessui/vue";
|
|
3
|
-
import { _ as E } from "./ButtonBase.vue_vue_type_script_setup_true_lang-ZYVNEyNx.js";
|
|
4
|
-
import { r as F } from "./XMarkIcon-CPr_Rd8y.js";
|
|
5
|
-
function A(e) {
|
|
6
|
-
const u = $(null), C = $(!1), a = y(() => {
|
|
7
|
-
if (typeof e.as == "string")
|
|
8
|
-
return e.as.toLowerCase() === "form";
|
|
9
|
-
const r = e.as, m = r.name ?? r.__name;
|
|
10
|
-
return (typeof m == "string" ? m.toLowerCase() : "") === "form";
|
|
11
|
-
}), b = y(() => `${e.id}-title`), f = y(() => `${e.id}-content`), v = y(() => u.value?.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
|
12
|
-
return {
|
|
13
|
-
contentRef: u,
|
|
14
|
-
ready: C,
|
|
15
|
-
isForm: a,
|
|
16
|
-
titleId: b,
|
|
17
|
-
descriptionId: f,
|
|
18
|
-
initialFocusElement: v
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const H = {
|
|
22
|
-
role: "presentation",
|
|
23
|
-
class: "rvc-modal-presentation"
|
|
24
|
-
}, q = { class: "rvc-modal-container" }, x = {
|
|
25
|
-
key: 0,
|
|
26
|
-
class: "rvc-modal-header"
|
|
27
|
-
}, z = { class: "rvc-modal-header-inner" }, P = { class: "rvc-modal-close-wrapper" }, j = ["id"], G = {
|
|
28
|
-
key: 2,
|
|
29
|
-
class: "rvc-modal-footer"
|
|
30
|
-
}, U = /* @__PURE__ */ L({
|
|
31
|
-
__name: "Modal",
|
|
32
|
-
props: {
|
|
33
|
-
as: { default: "div" },
|
|
34
|
-
id: {},
|
|
35
|
-
title: {},
|
|
36
|
-
showClose: { type: Boolean, default: !1 },
|
|
37
|
-
spinning: { type: Boolean, default: !1 },
|
|
38
|
-
submitLabel: { default: "Confirm" },
|
|
39
|
-
cancelLabel: { default: "Cancel" },
|
|
40
|
-
panelClass: { default: "rvc-modal-panel-max-width" },
|
|
41
|
-
resetHeader: { type: Boolean, default: !1 },
|
|
42
|
-
resetFooter: { type: Boolean, default: !1 }
|
|
43
|
-
},
|
|
44
|
-
emits: ["modal:open", "modal:opened", "modal:close", "modal:save", "modal:closed"],
|
|
45
|
-
setup(e, { emit: u }) {
|
|
46
|
-
const C = e, a = u, {
|
|
47
|
-
contentRef: b,
|
|
48
|
-
ready: f,
|
|
49
|
-
isForm: v,
|
|
50
|
-
titleId: r,
|
|
51
|
-
descriptionId: m,
|
|
52
|
-
initialFocusElement: k
|
|
53
|
-
} = A(C);
|
|
54
|
-
return (n, o) => (p(), I(t(S), { as: "template" }, {
|
|
55
|
-
default: c(() => [
|
|
56
|
-
i(t(V), {
|
|
57
|
-
as: e.as,
|
|
58
|
-
class: "rvc-modal",
|
|
59
|
-
static: "",
|
|
60
|
-
"aria-modal": "true",
|
|
61
|
-
role: "dialog",
|
|
62
|
-
"initial-focus": t(k),
|
|
63
|
-
"aria-labelledby": t(r),
|
|
64
|
-
onClose: o[7] || (o[7] = (l) => a("modal:close")),
|
|
65
|
-
onSubmit: o[8] || (o[8] = N((l) => a("modal:save", l), ["prevent"]))
|
|
66
|
-
}, {
|
|
67
|
-
default: c(() => [
|
|
68
|
-
i(t(B), {
|
|
69
|
-
as: "template",
|
|
70
|
-
enter: "rvc-modal-backdrop-transition-enter",
|
|
71
|
-
"enter-from": "rvc-modal-backdrop-transition-enter-from",
|
|
72
|
-
"enter-to": "rvc-modal-backdrop-transition-enter-to",
|
|
73
|
-
leave: "rvc-modal-backdrop-transition-leave",
|
|
74
|
-
"leave-from": "rvc-modal-backdrop-transition-leave-from",
|
|
75
|
-
"leave-to": "rvc-modal-backdrop-transition-leave-to",
|
|
76
|
-
onBeforeEnter: o[0] || (o[0] = (l) => a("modal:open")),
|
|
77
|
-
onAfterEnter: o[1] || (o[1] = (l) => a("modal:opened"))
|
|
78
|
-
}, {
|
|
79
|
-
default: c(() => [...o[9] || (o[9] = [
|
|
80
|
-
d("div", {
|
|
81
|
-
"aria-hidden": "true",
|
|
82
|
-
class: "rvc-modal-backdrop"
|
|
83
|
-
}, null, -1)
|
|
84
|
-
])]),
|
|
85
|
-
_: 1
|
|
86
|
-
}),
|
|
87
|
-
d("div", H, [
|
|
88
|
-
d("div", q, [
|
|
89
|
-
i(t(B), {
|
|
90
|
-
as: "template",
|
|
91
|
-
enter: "rvc-modal-transition-enter",
|
|
92
|
-
"enter-from": "rvc-modal-transition-enter-from",
|
|
93
|
-
"enter-to": "rvc-modal-transition-enter-to",
|
|
94
|
-
leave: "rvc-modal-transition-leave",
|
|
95
|
-
"leave-from": "rvc-modal-transition-leave-from",
|
|
96
|
-
"leave-to": "rvc-modal-transition-leave-to",
|
|
97
|
-
onBeforeEnter: o[5] || (o[5] = (l) => f.value = !0),
|
|
98
|
-
onAfterLeave: o[6] || (o[6] = (l) => (f.value = !1, a("modal:closed")))
|
|
99
|
-
}, {
|
|
100
|
-
default: c(() => [
|
|
101
|
-
i(t(M), {
|
|
102
|
-
class: T(["rvc-modal-panel", e.panelClass]),
|
|
103
|
-
"aria-busy": e.spinning,
|
|
104
|
-
"aria-describedby": t(m)
|
|
105
|
-
}, {
|
|
106
|
-
default: c(() => [
|
|
107
|
-
s(n.$slots, "panel", {
|
|
108
|
-
title: e.title,
|
|
109
|
-
loading: e.spinning,
|
|
110
|
-
isForm: t(v),
|
|
111
|
-
titleId: t(r),
|
|
112
|
-
descriptionId: t(m),
|
|
113
|
-
contentRef: t(b),
|
|
114
|
-
dialogTitle: t(g),
|
|
115
|
-
emitClose: () => a("modal:close"),
|
|
116
|
-
emitSave: (l = void 0) => a("modal:save", l)
|
|
117
|
-
}, () => [
|
|
118
|
-
e.resetHeader ? s(n.$slots, "header", { key: 1 }) : (p(), w("header", x, [
|
|
119
|
-
s(n.$slots, "header", {
|
|
120
|
-
title: e.title,
|
|
121
|
-
showClose: e.showClose
|
|
122
|
-
}, () => [
|
|
123
|
-
d("div", z, [
|
|
124
|
-
s(n.$slots, "title", {
|
|
125
|
-
id: t(r),
|
|
126
|
-
dialogTitle: t(g),
|
|
127
|
-
title: e.title
|
|
128
|
-
}, () => [
|
|
129
|
-
i(t(g), {
|
|
130
|
-
id: t(r),
|
|
131
|
-
class: "rvc-modal-title"
|
|
132
|
-
}, {
|
|
133
|
-
default: c(() => [
|
|
134
|
-
h(D(e.title), 1)
|
|
135
|
-
]),
|
|
136
|
-
_: 1
|
|
137
|
-
}, 8, ["id"])
|
|
138
|
-
]),
|
|
139
|
-
e.showClose ? s(n.$slots, "close", {
|
|
140
|
-
key: 0,
|
|
141
|
-
icon: t(F),
|
|
142
|
-
emitClose: () => a("modal:close")
|
|
143
|
-
}, () => [
|
|
144
|
-
d("div", P, [
|
|
145
|
-
d("button", {
|
|
146
|
-
type: "button",
|
|
147
|
-
class: "rvc-modal-close",
|
|
148
|
-
"aria-label": "Close panel",
|
|
149
|
-
onClick: o[2] || (o[2] = (l) => a("modal:close"))
|
|
150
|
-
}, [
|
|
151
|
-
i(t(F), { "aria-hidden": "true" })
|
|
152
|
-
])
|
|
153
|
-
])
|
|
154
|
-
]) : R("", !0)
|
|
155
|
-
])
|
|
156
|
-
])
|
|
157
|
-
])),
|
|
158
|
-
d("div", {
|
|
159
|
-
id: t(m),
|
|
160
|
-
ref_key: "contentRef",
|
|
161
|
-
ref: b,
|
|
162
|
-
class: "rvc-modal-content"
|
|
163
|
-
}, [
|
|
164
|
-
s(n.$slots, "default", { ready: t(f) })
|
|
165
|
-
], 8, j),
|
|
166
|
-
e.resetFooter ? s(n.$slots, "footer", { key: 3 }) : (p(), w("footer", G, [
|
|
167
|
-
s(n.$slots, "footer", { loading: e.spinning }, () => [
|
|
168
|
-
i(E, {
|
|
169
|
-
type: t(v) ? "submit" : "button",
|
|
170
|
-
label: e.submitLabel,
|
|
171
|
-
spinning: e.spinning,
|
|
172
|
-
disabled: e.spinning,
|
|
173
|
-
onClick: o[3] || (o[3] = (l) => !t(v) && a("modal:save"))
|
|
174
|
-
}, null, 8, ["type", "label", "spinning", "disabled"]),
|
|
175
|
-
i(E, {
|
|
176
|
-
type: "button",
|
|
177
|
-
color: "light",
|
|
178
|
-
label: e.cancelLabel,
|
|
179
|
-
onClick: o[4] || (o[4] = (l) => a("modal:close"))
|
|
180
|
-
}, null, 8, ["label"])
|
|
181
|
-
])
|
|
182
|
-
]))
|
|
183
|
-
])
|
|
184
|
-
]),
|
|
185
|
-
_: 3
|
|
186
|
-
}, 8, ["class", "aria-busy", "aria-describedby"])
|
|
187
|
-
]),
|
|
188
|
-
_: 3
|
|
189
|
-
})
|
|
190
|
-
])
|
|
191
|
-
])
|
|
192
|
-
]),
|
|
193
|
-
_: 3
|
|
194
|
-
}, 8, ["as", "initial-focus", "aria-labelledby"])
|
|
195
|
-
]),
|
|
196
|
-
_: 3
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
export {
|
|
201
|
-
U as _,
|
|
202
|
-
A as u
|
|
203
|
-
};
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { openBlock as s, createElementBlock as r, createElementVNode as o, defineComponent as $, ref as h, useAttrs as B, computed as x, watch as y, Fragment as C, createVNode as v, withCtx as A, renderSlot as _, normalizeClass as M, unref as f, renderList as E, createBlock as S, resolveDynamicComponent as O, createCommentVNode as U } from "vue";
|
|
2
|
-
import { useEditor as N, EditorContent as T } from "@tiptap/vue-3";
|
|
3
|
-
import j from "@tiptap/starter-kit";
|
|
4
|
-
import { _ as z } from "./Tooltip.vue_vue_type_script_setup_true_lang-B3MHy48T.js";
|
|
5
|
-
import { _ as D } from "./FormInput.vue_vue_type_script_setup_true_lang-Bg7YPGyY.js";
|
|
6
|
-
import { _ as I } from "./Modal.vue_vue_type_script_setup_true_lang-CdMsCCBi.js";
|
|
7
|
-
function q(n, c) {
|
|
8
|
-
return s(), r("svg", {
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
viewBox: "0 0 16 16",
|
|
11
|
-
fill: "currentColor",
|
|
12
|
-
"aria-hidden": "true",
|
|
13
|
-
"data-slot": "icon"
|
|
14
|
-
}, [
|
|
15
|
-
o("path", {
|
|
16
|
-
"fill-rule": "evenodd",
|
|
17
|
-
d: "M3 3a1 1 0 0 1 1-1h5a3.5 3.5 0 0 1 2.843 5.541A3.75 3.75 0 0 1 9.25 14H4a1 1 0 0 1-1-1V3Zm2.5 3.5v-2H9a1 1 0 0 1 0 2H5.5Zm0 2.5v2.5h3.75a1.25 1.25 0 1 0 0-2.5H5.5Z",
|
|
18
|
-
"clip-rule": "evenodd"
|
|
19
|
-
})
|
|
20
|
-
]);
|
|
21
|
-
}
|
|
22
|
-
function F(n, c) {
|
|
23
|
-
return s(), r("svg", {
|
|
24
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
-
viewBox: "0 0 16 16",
|
|
26
|
-
fill: "currentColor",
|
|
27
|
-
"aria-hidden": "true",
|
|
28
|
-
"data-slot": "icon"
|
|
29
|
-
}, [
|
|
30
|
-
o("path", {
|
|
31
|
-
"fill-rule": "evenodd",
|
|
32
|
-
d: "M6.25 2.75A.75.75 0 0 1 7 2h6a.75.75 0 0 1 0 1.5h-2.483l-3.429 9H9A.75.75 0 0 1 9 14H3a.75.75 0 0 1 0-1.5h2.483l3.429-9H7a.75.75 0 0 1-.75-.75Z",
|
|
33
|
-
"clip-rule": "evenodd"
|
|
34
|
-
})
|
|
35
|
-
]);
|
|
36
|
-
}
|
|
37
|
-
function K(n, c) {
|
|
38
|
-
return s(), r("svg", {
|
|
39
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
-
viewBox: "0 0 16 16",
|
|
41
|
-
fill: "currentColor",
|
|
42
|
-
"aria-hidden": "true",
|
|
43
|
-
"data-slot": "icon"
|
|
44
|
-
}, [
|
|
45
|
-
o("path", {
|
|
46
|
-
"fill-rule": "evenodd",
|
|
47
|
-
d: "M8.914 6.025a.75.75 0 0 1 1.06 0 3.5 3.5 0 0 1 0 4.95l-2 2a3.5 3.5 0 0 1-5.396-4.402.75.75 0 0 1 1.251.827 2 2 0 0 0 3.085 2.514l2-2a2 2 0 0 0 0-2.828.75.75 0 0 1 0-1.06Z",
|
|
48
|
-
"clip-rule": "evenodd"
|
|
49
|
-
}),
|
|
50
|
-
o("path", {
|
|
51
|
-
"fill-rule": "evenodd",
|
|
52
|
-
d: "M7.086 9.975a.75.75 0 0 1-1.06 0 3.5 3.5 0 0 1 0-4.95l2-2a3.5 3.5 0 0 1 5.396 4.402.75.75 0 0 1-1.251-.827 2 2 0 0 0-3.085-2.514l-2 2a2 2 0 0 0 0 2.828.75.75 0 0 1 0 1.06Z",
|
|
53
|
-
"clip-rule": "evenodd"
|
|
54
|
-
})
|
|
55
|
-
]);
|
|
56
|
-
}
|
|
57
|
-
function P(n, c) {
|
|
58
|
-
return s(), r("svg", {
|
|
59
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
60
|
-
viewBox: "0 0 16 16",
|
|
61
|
-
fill: "currentColor",
|
|
62
|
-
"aria-hidden": "true",
|
|
63
|
-
"data-slot": "icon"
|
|
64
|
-
}, [
|
|
65
|
-
o("path", { d: "M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" })
|
|
66
|
-
]);
|
|
67
|
-
}
|
|
68
|
-
function R(n, c) {
|
|
69
|
-
return s(), r("svg", {
|
|
70
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
71
|
-
viewBox: "0 0 16 16",
|
|
72
|
-
fill: "currentColor",
|
|
73
|
-
"aria-hidden": "true",
|
|
74
|
-
"data-slot": "icon"
|
|
75
|
-
}, [
|
|
76
|
-
o("path", { d: "M2.995 1a.625.625 0 1 0 0 1.25h.38v2.125a.625.625 0 1 0 1.25 0v-2.75A.625.625 0 0 0 4 1H2.995ZM3.208 7.385a2.37 2.37 0 0 1 1.027-.124L2.573 8.923a.625.625 0 0 0 .439 1.067l1.987.011a.625.625 0 0 0 .006-1.25l-.49-.003.777-.776c.215-.215.335-.506.335-.809 0-.465-.297-.957-.842-1.078a3.636 3.636 0 0 0-1.993.121.625.625 0 1 0 .416 1.179ZM2.625 11a.625.625 0 1 0 0 1.25H4.25a.125.125 0 0 1 0 .25H3.5a.625.625 0 1 0 0 1.25h.75a.125.125 0 0 1 0 .25H2.625a.625.625 0 1 0 0 1.25H4.25a1.375 1.375 0 0 0 1.153-2.125A1.375 1.375 0 0 0 4.25 11H2.625ZM7.25 2a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM7.25 7.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM6.5 13.25a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Z" })
|
|
77
|
-
]);
|
|
78
|
-
}
|
|
79
|
-
const G = { class: "rvc-rich-text-toolbar" }, J = ["disabled", "aria-label", "onClick"], le = /* @__PURE__ */ $({
|
|
80
|
-
inheritAttrs: !1,
|
|
81
|
-
__name: "RichTextEditor",
|
|
82
|
-
props: {
|
|
83
|
-
id: {},
|
|
84
|
-
modelValue: { default: "" },
|
|
85
|
-
rootClass: { default: void 0 },
|
|
86
|
-
config: { default: "default" },
|
|
87
|
-
customExtensions: { default: () => [] },
|
|
88
|
-
customCommands: { default: () => [] },
|
|
89
|
-
disabled: { type: Boolean, default: !1 }
|
|
90
|
-
},
|
|
91
|
-
emits: ["update:modelValue", "tiptap:onCreate"],
|
|
92
|
-
setup(n, { emit: c }) {
|
|
93
|
-
const a = n, b = c, g = h(!1), u = h(!1), d = h(""), m = B(), k = m.class ? `${m.class} ` : "", V = Object.fromEntries(
|
|
94
|
-
Object.entries(m).filter(
|
|
95
|
-
(l) => l[0] !== "class" && typeof l[1] == "string"
|
|
96
|
-
)
|
|
97
|
-
), Z = j.configure({
|
|
98
|
-
link: {
|
|
99
|
-
openOnClick: !1
|
|
100
|
-
}
|
|
101
|
-
}), e = N({
|
|
102
|
-
extensions: [Z, ...a.customExtensions],
|
|
103
|
-
content: a.modelValue,
|
|
104
|
-
editorProps: {
|
|
105
|
-
attributes: {
|
|
106
|
-
...V,
|
|
107
|
-
id: a.id,
|
|
108
|
-
class: `${k}rvc-textarea rvc-rich-text-textarea`
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
onCreate: ({ editor: l }) => {
|
|
112
|
-
b("tiptap:onCreate", l);
|
|
113
|
-
},
|
|
114
|
-
onUpdate: ({ editor: l }) => {
|
|
115
|
-
const i = l.isEmpty ? "" : l.getHTML();
|
|
116
|
-
b("update:modelValue", i);
|
|
117
|
-
},
|
|
118
|
-
onSelectionUpdate({ editor: l }) {
|
|
119
|
-
g.value = !l.view.state.selection.empty;
|
|
120
|
-
}
|
|
121
|
-
}), H = x(() => [
|
|
122
|
-
{
|
|
123
|
-
name: "bold",
|
|
124
|
-
icon: q,
|
|
125
|
-
title: "Bold",
|
|
126
|
-
isVisible: !0,
|
|
127
|
-
isActive: () => e.value?.isActive("bold") ?? !1,
|
|
128
|
-
action: () => e.value?.commands.toggleBold()
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
name: "italic",
|
|
132
|
-
icon: F,
|
|
133
|
-
title: "Italic",
|
|
134
|
-
isVisible: !0,
|
|
135
|
-
isActive: () => e.value?.isActive("italic") ?? !1,
|
|
136
|
-
action: () => e.value?.commands.toggleItalic()
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: "bulletList",
|
|
140
|
-
icon: P,
|
|
141
|
-
title: "Bullet List",
|
|
142
|
-
isVisible: a.config === "default",
|
|
143
|
-
isActive: () => e.value?.isActive("bulletList") ?? !1,
|
|
144
|
-
action: () => e.value?.commands.toggleBulletList()
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "orderedList",
|
|
148
|
-
icon: R,
|
|
149
|
-
title: "Ordered List",
|
|
150
|
-
isVisible: a.config === "default",
|
|
151
|
-
isActive: () => e.value?.isActive("orderedList") ?? !1,
|
|
152
|
-
action: () => e.value?.commands.toggleOrderedList()
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: "link",
|
|
156
|
-
icon: K,
|
|
157
|
-
title: "Hyperlink",
|
|
158
|
-
isVisible: a.config === "default",
|
|
159
|
-
disabled: !g.value && !(e.value?.isActive("link") ?? !1),
|
|
160
|
-
isActive: () => e.value?.isActive("link") ?? !1,
|
|
161
|
-
action: () => {
|
|
162
|
-
d.value = e.value?.getAttributes("link").href || "", u.value = !0;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
]), w = x(() => {
|
|
166
|
-
const l = H.value.filter((t) => a.config === "default" || ["bold", "italic"].includes(t.name)), i = a.customCommands.map((t) => {
|
|
167
|
-
let p = !1;
|
|
168
|
-
return typeof t.disabled == "function" ? p = e.value ? t.disabled(e.value) : !1 : p = t.disabled ?? !1, {
|
|
169
|
-
...t,
|
|
170
|
-
isVisible: t.isVisible ?? !0,
|
|
171
|
-
disabled: p,
|
|
172
|
-
isActive: () => t.isActive && e.value ? t.isActive(e.value) : !1,
|
|
173
|
-
action: () => e.value && t.action(e.value)
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
return [...l, ...i];
|
|
177
|
-
});
|
|
178
|
-
y(() => a.modelValue, (l) => {
|
|
179
|
-
if (!e.value) return;
|
|
180
|
-
e.value.getHTML() === l || e.value.commands.setContent(l, { emitUpdate: !1 });
|
|
181
|
-
});
|
|
182
|
-
const L = () => {
|
|
183
|
-
e.value && (e.value.commands.setLink({ href: d.value }), u.value = !1, d.value = "");
|
|
184
|
-
};
|
|
185
|
-
return (l, i) => (s(), r(C, null, [
|
|
186
|
-
v(I, {
|
|
187
|
-
id: `${a.id}-modal-add-hyperlink`,
|
|
188
|
-
title: "Add Hyperlink",
|
|
189
|
-
as: "form",
|
|
190
|
-
show: u.value,
|
|
191
|
-
"onModal:close": i[1] || (i[1] = (t) => u.value = !1),
|
|
192
|
-
"onModal:save": L
|
|
193
|
-
}, {
|
|
194
|
-
default: A(() => [
|
|
195
|
-
v(D, {
|
|
196
|
-
modelValue: d.value,
|
|
197
|
-
"onUpdate:modelValue": i[0] || (i[0] = (t) => d.value = t),
|
|
198
|
-
placeholder: "https://www.example.com",
|
|
199
|
-
type: "url",
|
|
200
|
-
required: ""
|
|
201
|
-
}, null, 8, ["modelValue"])
|
|
202
|
-
]),
|
|
203
|
-
_: 1
|
|
204
|
-
}, 8, ["id", "show"]),
|
|
205
|
-
_(l.$slots, "default"),
|
|
206
|
-
o("div", {
|
|
207
|
-
class: M(["rvc-rich-text", n.rootClass, { "rvc-rich-text-disabled": n.disabled }])
|
|
208
|
-
}, [
|
|
209
|
-
f(e) ? _(l.$slots, "toolbar", {
|
|
210
|
-
key: 0,
|
|
211
|
-
commands: w.value,
|
|
212
|
-
tiptap: f(e)
|
|
213
|
-
}, () => [
|
|
214
|
-
o("ul", G, [
|
|
215
|
-
(s(!0), r(C, null, E(w.value.filter((t) => t.isVisible), (t) => (s(), r("li", {
|
|
216
|
-
key: `toolbar-item-command-${t.name}`
|
|
217
|
-
}, [
|
|
218
|
-
v(z, {
|
|
219
|
-
content: t.title,
|
|
220
|
-
placement: "bottom",
|
|
221
|
-
size: "sm",
|
|
222
|
-
class: "rvc-rich-text-tooltip"
|
|
223
|
-
}, {
|
|
224
|
-
default: A(() => [
|
|
225
|
-
o("button", {
|
|
226
|
-
disabled: t.disabled,
|
|
227
|
-
type: "button",
|
|
228
|
-
"aria-label": t.title,
|
|
229
|
-
class: M([{ "rvc-rich-text-button-active": t.isActive() }, "rvc-rich-text-button"]),
|
|
230
|
-
onClick: t.action
|
|
231
|
-
}, [
|
|
232
|
-
(s(), S(O(t.icon)))
|
|
233
|
-
], 10, J)
|
|
234
|
-
]),
|
|
235
|
-
_: 2
|
|
236
|
-
}, 1032, ["content"])
|
|
237
|
-
]))), 128))
|
|
238
|
-
])
|
|
239
|
-
]) : U("", !0),
|
|
240
|
-
v(f(T), { editor: f(e) }, null, 8, ["editor"])
|
|
241
|
-
], 2)
|
|
242
|
-
], 64));
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
export {
|
|
246
|
-
le as _
|
|
247
|
-
};
|