@robuust-digital/vue-components 2.2.1 → 2.3.1
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 +19 -0
- package/dist/_shared/{ButtonBase.vue_vue_type_script_setup_true_lang-DeflHqux.js → ButtonBase.vue_vue_type_script_setup_true_lang-BLm8QzEC.js} +23 -23
- package/dist/_shared/{ChevronDownIcon-DaaXfD3C.js → ChevronDownIcon-CcE_K1lg.js} +12 -12
- package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-CxRv55TC.js +256 -0
- package/dist/_shared/{Drawer.vue_vue_type_script_setup_true_lang-CD5914Fk.js → Drawer.vue_vue_type_script_setup_true_lang-XMND_Yzl.js} +62 -62
- package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-BtkiBqxy.js +115 -0
- package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-C_1WSzbH.js +74 -0
- package/dist/_shared/{Modal.vue_vue_type_script_setup_true_lang-CoHkAJj3.js → Modal.vue_vue_type_script_setup_true_lang-2AljJgxw.js} +68 -71
- package/dist/_shared/{RichTextEditor.vue_vue_type_script_setup_true_lang-CIVhqJtE.js → RichTextEditor.vue_vue_type_script_setup_true_lang-BLs_S_-D.js} +102 -133
- package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-DMUJ5Emt.js +670 -0
- package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-BfMkJm5T.js +78 -0
- package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-CKp1wzE2.js +95 -0
- package/dist/combobox/index.js +1 -1
- package/dist/core/checkbox.css +10 -5
- package/dist/core/index.js +4 -4
- package/dist/core/radio.css +11 -6
- package/dist/core.d.ts +2 -2
- package/dist/dialogs/index.js +2 -2
- package/dist/dropdown/index.js +1 -1
- package/dist/index/index.js +11 -11
- package/dist/index.d.ts +2 -2
- package/dist/rich-text-editor/index.js +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/tooltip/index.js +1 -1
- package/package.json +19 -19
- package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-CP3x2DUA.js +0 -266
- package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-CmYj-7WQ.js +0 -115
- package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-BhJpG-Fw.js +0 -75
- package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-DnzOq9GZ.js +0 -679
- package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-Be3i_0zE.js +0 -78
- package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-CoydN9sS.js +0 -96
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
1
|
+
import { createElementBlock as r, openBlock as o, createElementVNode as s, defineComponent as L, ref as p, useAttrs as $, computed as x, watch as B, Fragment as C, createVNode as v, renderSlot as A, withCtx as _, normalizeClass as M, createCommentVNode as y, unref as f, renderList as E, createBlock as S, resolveDynamicComponent as U } from "vue";
|
|
2
2
|
import { useEditor as N, EditorContent as O } from "@tiptap/vue-3";
|
|
3
3
|
import T from "@tiptap/starter-kit";
|
|
4
|
-
import { _ as z } from "./Tooltip.vue_vue_type_script_setup_true_lang-
|
|
5
|
-
import { _ as D } from "./FormInput.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { _ as I } from "./Modal.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
function q(
|
|
8
|
-
return o(),
|
|
4
|
+
import { _ as z } from "./Tooltip.vue_vue_type_script_setup_true_lang-CKp1wzE2.js";
|
|
5
|
+
import { _ as D } from "./FormInput.vue_vue_type_script_setup_true_lang-C_1WSzbH.js";
|
|
6
|
+
import { _ as I } from "./Modal.vue_vue_type_script_setup_true_lang-2AljJgxw.js";
|
|
7
|
+
function q(n, c) {
|
|
8
|
+
return o(), r("svg", {
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
10
|
viewBox: "0 0 16 16",
|
|
11
11
|
fill: "currentColor",
|
|
@@ -19,8 +19,8 @@ function q(r, d) {
|
|
|
19
19
|
})
|
|
20
20
|
]);
|
|
21
21
|
}
|
|
22
|
-
function F(
|
|
23
|
-
return o(),
|
|
22
|
+
function F(n, c) {
|
|
23
|
+
return o(), r("svg", {
|
|
24
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
25
25
|
viewBox: "0 0 16 16",
|
|
26
26
|
fill: "currentColor",
|
|
@@ -34,8 +34,8 @@ function F(r, d) {
|
|
|
34
34
|
})
|
|
35
35
|
]);
|
|
36
36
|
}
|
|
37
|
-
function K(
|
|
38
|
-
return o(),
|
|
37
|
+
function K(n, c) {
|
|
38
|
+
return o(), r("svg", {
|
|
39
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
40
|
viewBox: "0 0 16 16",
|
|
41
41
|
fill: "currentColor",
|
|
@@ -54,8 +54,8 @@ function K(r, d) {
|
|
|
54
54
|
})
|
|
55
55
|
]);
|
|
56
56
|
}
|
|
57
|
-
function P(
|
|
58
|
-
return o(),
|
|
57
|
+
function P(n, c) {
|
|
58
|
+
return o(), r("svg", {
|
|
59
59
|
xmlns: "http://www.w3.org/2000/svg",
|
|
60
60
|
viewBox: "0 0 16 16",
|
|
61
61
|
fill: "currentColor",
|
|
@@ -65,8 +65,8 @@ function P(r, d) {
|
|
|
65
65
|
s("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
66
|
]);
|
|
67
67
|
}
|
|
68
|
-
function R(
|
|
69
|
-
return o(),
|
|
68
|
+
function R(n, c) {
|
|
69
|
+
return o(), r("svg", {
|
|
70
70
|
xmlns: "http://www.w3.org/2000/svg",
|
|
71
71
|
viewBox: "0 0 16 16",
|
|
72
72
|
fill: "currentColor",
|
|
@@ -89,139 +89,108 @@ const j = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
89
89
|
disabled: { type: Boolean, default: !1 }
|
|
90
90
|
},
|
|
91
91
|
emits: ["update:modelValue", "tiptap:onCreate"],
|
|
92
|
-
setup(
|
|
93
|
-
const
|
|
92
|
+
setup(n, { emit: c }) {
|
|
93
|
+
const a = n, b = c, w = p(!1), u = p(!1), d = p(""), m = $(), k = m.class ? `${m.class} ` : "", V = T.configure({
|
|
94
94
|
link: {
|
|
95
95
|
openOnClick: !1
|
|
96
96
|
}
|
|
97
|
-
}),
|
|
98
|
-
extensions: [V, ...
|
|
99
|
-
content:
|
|
97
|
+
}), e = N({
|
|
98
|
+
extensions: [V, ...a.customExtensions],
|
|
99
|
+
content: a.modelValue,
|
|
100
100
|
editorProps: {
|
|
101
101
|
attributes: {
|
|
102
102
|
...m,
|
|
103
|
-
id:
|
|
103
|
+
id: a.id,
|
|
104
104
|
class: `${k}rvc-textarea rvc-rich-text-textarea`
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
onCreate: ({ editor:
|
|
108
|
-
b("tiptap:onCreate",
|
|
107
|
+
onCreate: ({ editor: l }) => {
|
|
108
|
+
b("tiptap:onCreate", l);
|
|
109
109
|
},
|
|
110
|
-
onUpdate: ({ editor:
|
|
111
|
-
const
|
|
112
|
-
b("update:modelValue",
|
|
110
|
+
onUpdate: ({ editor: l }) => {
|
|
111
|
+
const i = l.isEmpty ? "" : l.getHTML();
|
|
112
|
+
b("update:modelValue", i);
|
|
113
113
|
},
|
|
114
|
-
onSelectionUpdate({ editor:
|
|
115
|
-
w.value = !
|
|
114
|
+
onSelectionUpdate({ editor: l }) {
|
|
115
|
+
w.value = !l.view.state.selection.empty;
|
|
116
116
|
}
|
|
117
|
-
}), Z = x(() =>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return (e = t.value) == null ? void 0 : e.commands.toggleBulletList();
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: "orderedList",
|
|
164
|
-
icon: R,
|
|
165
|
-
title: "Ordered List",
|
|
166
|
-
isVisible: i.config === "default",
|
|
167
|
-
isActive: () => {
|
|
168
|
-
var e;
|
|
169
|
-
return ((e = t.value) == null ? void 0 : e.isActive("orderedList")) ?? !1;
|
|
170
|
-
},
|
|
171
|
-
action: () => {
|
|
172
|
-
var e;
|
|
173
|
-
return (e = t.value) == null ? void 0 : e.commands.toggleOrderedList();
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: "link",
|
|
178
|
-
icon: K,
|
|
179
|
-
title: "Hyperlink",
|
|
180
|
-
isVisible: i.config === "default",
|
|
181
|
-
disabled: !w.value && !(((a = t.value) == null ? void 0 : a.isActive("link")) ?? !1),
|
|
182
|
-
isActive: () => {
|
|
183
|
-
var e;
|
|
184
|
-
return ((e = t.value) == null ? void 0 : e.isActive("link")) ?? !1;
|
|
185
|
-
},
|
|
186
|
-
action: () => {
|
|
187
|
-
var e;
|
|
188
|
-
c.value = ((e = t.value) == null ? void 0 : e.getAttributes("link").href) || "", u.value = !0;
|
|
189
|
-
}
|
|
117
|
+
}), Z = x(() => [
|
|
118
|
+
{
|
|
119
|
+
name: "bold",
|
|
120
|
+
icon: q,
|
|
121
|
+
title: "Bold",
|
|
122
|
+
isVisible: !0,
|
|
123
|
+
isActive: () => e.value?.isActive("bold") ?? !1,
|
|
124
|
+
action: () => e.value?.commands.toggleBold()
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "italic",
|
|
128
|
+
icon: F,
|
|
129
|
+
title: "Italic",
|
|
130
|
+
isVisible: !0,
|
|
131
|
+
isActive: () => e.value?.isActive("italic") ?? !1,
|
|
132
|
+
action: () => e.value?.commands.toggleItalic()
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "bulletList",
|
|
136
|
+
icon: P,
|
|
137
|
+
title: "Bullet List",
|
|
138
|
+
isVisible: a.config === "default",
|
|
139
|
+
isActive: () => e.value?.isActive("bulletList") ?? !1,
|
|
140
|
+
action: () => e.value?.commands.toggleBulletList()
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "orderedList",
|
|
144
|
+
icon: R,
|
|
145
|
+
title: "Ordered List",
|
|
146
|
+
isVisible: a.config === "default",
|
|
147
|
+
isActive: () => e.value?.isActive("orderedList") ?? !1,
|
|
148
|
+
action: () => e.value?.commands.toggleOrderedList()
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "link",
|
|
152
|
+
icon: K,
|
|
153
|
+
title: "Hyperlink",
|
|
154
|
+
isVisible: a.config === "default",
|
|
155
|
+
disabled: !w.value && !(e.value?.isActive("link") ?? !1),
|
|
156
|
+
isActive: () => e.value?.isActive("link") ?? !1,
|
|
157
|
+
action: () => {
|
|
158
|
+
d.value = e.value?.getAttributes("link").href || "", u.value = !0;
|
|
190
159
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
let
|
|
195
|
-
return typeof
|
|
196
|
-
...
|
|
197
|
-
isVisible:
|
|
198
|
-
disabled:
|
|
199
|
-
isActive: () =>
|
|
200
|
-
action: () =>
|
|
160
|
+
}
|
|
161
|
+
]), g = x(() => {
|
|
162
|
+
const l = Z.value.filter((t) => a.config === "default" || ["bold", "italic"].includes(t.name)), i = a.customCommands.map((t) => {
|
|
163
|
+
let h = !1;
|
|
164
|
+
return typeof t.disabled == "function" ? h = e.value ? t.disabled(e.value) : !1 : h = t.disabled ?? !1, {
|
|
165
|
+
...t,
|
|
166
|
+
isVisible: t.isVisible ?? !0,
|
|
167
|
+
disabled: h,
|
|
168
|
+
isActive: () => t.isActive && e.value ? t.isActive(e.value) : !1,
|
|
169
|
+
action: () => e.value && t.action(e.value)
|
|
201
170
|
};
|
|
202
171
|
});
|
|
203
|
-
return [...
|
|
172
|
+
return [...l, ...i];
|
|
204
173
|
});
|
|
205
|
-
B(() =>
|
|
206
|
-
if (!
|
|
207
|
-
|
|
174
|
+
B(() => a.modelValue, (l) => {
|
|
175
|
+
if (!e.value) return;
|
|
176
|
+
e.value.getHTML() === l || e.value.commands.setContent(l, { emitUpdate: !1 });
|
|
208
177
|
});
|
|
209
178
|
const H = () => {
|
|
210
|
-
|
|
179
|
+
e.value && (e.value.commands.setLink({ href: d.value }), u.value = !1, d.value = "");
|
|
211
180
|
};
|
|
212
|
-
return (
|
|
181
|
+
return (l, i) => (o(), r(C, null, [
|
|
213
182
|
v(I, {
|
|
214
|
-
id: `${
|
|
183
|
+
id: `${a.id}-modal-add-hyperlink`,
|
|
215
184
|
title: "Add Hyperlink",
|
|
216
185
|
as: "form",
|
|
217
186
|
show: u.value,
|
|
218
|
-
"onModal:close":
|
|
187
|
+
"onModal:close": i[1] || (i[1] = (t) => u.value = !1),
|
|
219
188
|
"onModal:save": H
|
|
220
189
|
}, {
|
|
221
190
|
default: _(() => [
|
|
222
191
|
v(D, {
|
|
223
|
-
modelValue:
|
|
224
|
-
"onUpdate:modelValue":
|
|
192
|
+
modelValue: d.value,
|
|
193
|
+
"onUpdate:modelValue": i[0] || (i[0] = (t) => d.value = t),
|
|
225
194
|
placeholder: "https://www.example.com",
|
|
226
195
|
type: "url",
|
|
227
196
|
required: ""
|
|
@@ -229,34 +198,34 @@ const j = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
229
198
|
]),
|
|
230
199
|
_: 1
|
|
231
200
|
}, 8, ["id", "show"]),
|
|
232
|
-
A(
|
|
201
|
+
A(l.$slots, "default"),
|
|
233
202
|
s("div", {
|
|
234
|
-
class: M(["rvc-rich-text",
|
|
203
|
+
class: M(["rvc-rich-text", n.rootClass, { "rvc-rich-text-disabled": n.disabled }])
|
|
235
204
|
}, [
|
|
236
|
-
f(
|
|
205
|
+
f(e) ? A(l.$slots, "toolbar", {
|
|
237
206
|
key: 0,
|
|
238
207
|
commands: g.value,
|
|
239
|
-
tiptap: f(
|
|
208
|
+
tiptap: f(e)
|
|
240
209
|
}, () => [
|
|
241
210
|
s("ul", j, [
|
|
242
|
-
(o(!0),
|
|
243
|
-
key: `toolbar-item-command-${
|
|
211
|
+
(o(!0), r(C, null, E(g.value.filter((t) => t.isVisible), (t) => (o(), r("li", {
|
|
212
|
+
key: `toolbar-item-command-${t.name}`
|
|
244
213
|
}, [
|
|
245
214
|
v(z, {
|
|
246
|
-
content:
|
|
215
|
+
content: t.title,
|
|
247
216
|
placement: "bottom",
|
|
248
217
|
size: "sm",
|
|
249
218
|
class: "rvc-rich-text-tooltip"
|
|
250
219
|
}, {
|
|
251
220
|
default: _(() => [
|
|
252
221
|
s("button", {
|
|
253
|
-
disabled:
|
|
222
|
+
disabled: t.disabled,
|
|
254
223
|
type: "button",
|
|
255
|
-
"aria-label":
|
|
256
|
-
class: M([{ "rvc-rich-text-button-active":
|
|
257
|
-
onClick:
|
|
224
|
+
"aria-label": t.title,
|
|
225
|
+
class: M([{ "rvc-rich-text-button-active": t.isActive() }, "rvc-rich-text-button"]),
|
|
226
|
+
onClick: t.action
|
|
258
227
|
}, [
|
|
259
|
-
(o(), S(U(
|
|
228
|
+
(o(), S(U(t.icon)))
|
|
260
229
|
], 10, G)
|
|
261
230
|
]),
|
|
262
231
|
_: 2
|
|
@@ -264,7 +233,7 @@ const j = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
264
233
|
]))), 128))
|
|
265
234
|
])
|
|
266
235
|
]) : y("", !0),
|
|
267
|
-
v(f(O), { editor: f(
|
|
236
|
+
v(f(O), { editor: f(e) }, null, 8, ["editor"])
|
|
268
237
|
], 2)
|
|
269
238
|
], 64));
|
|
270
239
|
}
|