@robuust-digital/vue-components 2.7.1 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/_shared/ButtonBase-DyeIkb-l.js +76 -0
  3. package/dist/_shared/ChevronDownIcon-Y_yqpwON.js +39 -0
  4. package/dist/_shared/FormInput-k0vAk3VU.js +69 -0
  5. package/dist/_shared/Modal-D0x_VHiB.js +188 -0
  6. package/dist/_shared/Tooltip-B5w_Ojie.js +85 -0
  7. package/dist/_shared/XMarkIcon-CBoWSM1l.js +17 -0
  8. package/dist/_shared/combobox-yh0YQ8_d.js +265 -0
  9. package/dist/_shared/core-C0o6izrz.js +854 -0
  10. package/dist/_shared/dialogs-SvdPsILD.js +179 -0
  11. package/dist/_shared/dropdown-BPUpLokN.js +134 -0
  12. package/dist/_shared/icon-spinner-D3Dhustt.js +23 -0
  13. package/dist/_shared/lightswitch-CpyX1iA_.js +38 -0
  14. package/dist/_shared/rich-text-editor-DkHKNS2n.js +226 -0
  15. package/dist/_shared/toast-DNxJDQWN.js +84 -0
  16. package/dist/combobox/index.js +2 -5
  17. package/dist/core/file-upload.css +28 -1
  18. package/dist/core/index.js +5 -20
  19. package/dist/dialogs/index.js +3 -6
  20. package/dist/dropdown/index.js +2 -5
  21. package/dist/index/index.js +14 -36
  22. package/dist/lightswitch/index.js +2 -5
  23. package/dist/rich-text-editor/index.js +2 -5
  24. package/dist/toast/index.js +2 -5
  25. package/dist/tooltip/index.js +5 -5
  26. package/package.json +31 -31
  27. package/dist/_shared/ButtonBase.vue_vue_type_script_setup_true_lang-ZYVNEyNx.js +0 -60
  28. package/dist/_shared/ChevronDownIcon-BYWciGnh.js +0 -41
  29. package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-BwTRzqr6.js +0 -256
  30. package/dist/_shared/Drawer.vue_vue_type_script_setup_true_lang-DeAu2U_2.js +0 -197
  31. package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-Cv3HwIyF.js +0 -150
  32. package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-Bg7YPGyY.js +0 -74
  33. package/dist/_shared/Lightswitch.vue_vue_type_script_setup_true_lang-hiuDVfo5.js +0 -43
  34. package/dist/_shared/Modal.vue_vue_type_script_setup_true_lang-CdMsCCBi.js +0 -203
  35. package/dist/_shared/RichTextEditor.vue_vue_type_script_setup_true_lang-t8nRuJ6k.js +0 -247
  36. package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-C4NAAuLp.js +0 -931
  37. package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-DS6keeu7.js +0 -78
  38. package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-B3MHy48T.js +0 -95
  39. package/dist/_shared/XMarkIcon-CPr_Rd8y.js +0 -19
  40. package/dist/_shared/icon-spinner-BYCMrTdL.js +0 -26
@@ -1,247 +0,0 @@
1
- import { openBlock as s, createElementBlock as r, createElementVNode as o, defineComponent as $, ref as p, useAttrs as B, computed as w, watch as y, Fragment as x, createVNode as v, withCtx as C, renderSlot as A, normalizeClass as _, 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, h = c, b = p(!1), u = p(!1), d = p(""), m = B(), M = m.class ? `${m.class} ` : "", k = Object.fromEntries(
94
- Object.entries(m).filter(
95
- (l) => l[0] !== "class" && typeof l[1] == "string"
96
- )
97
- ), V = j.configure({
98
- link: {
99
- openOnClick: !1
100
- }
101
- }), e = N({
102
- extensions: [V, ...a.customExtensions],
103
- content: a.modelValue,
104
- editorProps: {
105
- attributes: {
106
- ...k,
107
- id: a.id,
108
- class: `${M}rvc-textarea rvc-rich-text-textarea`
109
- }
110
- },
111
- onCreate: ({ editor: l }) => {
112
- h("tiptap:onCreate", l);
113
- },
114
- onUpdate: ({ editor: l }) => {
115
- const i = l.isEmpty ? "" : l.getHTML();
116
- h("update:modelValue", i);
117
- },
118
- onSelectionUpdate({ editor: l }) {
119
- b.value = !l.view.state.selection.empty;
120
- }
121
- }), Z = w(() => [
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: !b.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
- ]), g = w(() => {
166
- const l = Z.value.filter((t) => a.config === "default" || ["bold", "italic"].includes(t.name)), i = a.customCommands.map((t) => {
167
- const L = typeof t.disabled == "function" ? e.value ? t.disabled(e.value) : !1 : t.disabled ?? !1;
168
- return {
169
- ...t,
170
- isVisible: t.isVisible ?? !0,
171
- disabled: L,
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 H = () => {
183
- e.value && (e.value.commands.setLink({ href: d.value }), u.value = !1, d.value = "");
184
- };
185
- return (l, i) => (s(), r(x, 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": H
193
- }, {
194
- default: C(() => [
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
- A(l.$slots, "default"),
206
- o("div", {
207
- class: _(["rvc-rich-text", n.rootClass, { "rvc-rich-text-disabled": n.disabled }])
208
- }, [
209
- f(e) ? A(l.$slots, "toolbar", {
210
- key: 0,
211
- commands: g.value,
212
- tiptap: f(e)
213
- }, () => [
214
- o("ul", G, [
215
- (s(!0), r(x, null, E(g.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: C(() => [
225
- o("button", {
226
- disabled: t.disabled,
227
- type: "button",
228
- "aria-label": t.title,
229
- class: _([{ "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
- };