@robuust-digital/vue-components 2.0.0-rc.0 → 2.0.0-rc.10
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 +246 -0
- package/dist/_shared/{ButtonBase-CQjlJ85F.js → ButtonBase-DfkwHIhN.js} +10 -10
- package/dist/_shared/Modal-DdpJnce6.js +200 -0
- package/dist/_shared/{Tooltip-BKXJoJ1x.js → Tooltip-B93ZF7IF.js} +16 -16
- package/dist/combobox/combobox.css +76 -34
- package/dist/combobox/index.js +46 -46
- package/dist/core/accordion.css +21 -10
- package/dist/core/alert.css +26 -20
- package/dist/core/badge.css +10 -10
- package/dist/core/button.css +31 -19
- package/dist/core/checkbox.css +35 -10
- package/dist/core/empty-state.css +6 -6
- package/dist/core/index.js +351 -347
- package/dist/core/input.css +23 -13
- package/dist/core/pagination.css +68 -9
- package/dist/core/radio.css +35 -10
- package/dist/core/select.css +25 -16
- package/dist/core/styles.css +5 -35
- package/dist/core/table.css +66 -5
- package/dist/core/tabs.css +20 -9
- package/dist/core/textarea.css +17 -10
- package/dist/core/utilities.css +12 -0
- package/dist/dialogs/drawer.css +140 -4
- package/dist/dialogs/index.js +100 -93
- package/dist/dialogs/modal.css +124 -22
- package/dist/dialogs/styles.css +20 -0
- package/dist/dropdown/dropdown.css +79 -49
- package/dist/dropdown/index.js +38 -38
- package/dist/lightswitch/lightswitch.css +19 -8
- package/dist/rich-text-editor/index.js +42 -39
- package/dist/rich-text-editor/rich-text.css +28 -10
- package/dist/toast/index.js +35 -34
- package/dist/toast/toast.css +54 -28
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip/tooltip.css +18 -16
- package/package.json +22 -8
- package/dist/_shared/Modal-COVlUEud.js +0 -193
package/dist/dialogs/styles.css
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
1
|
@import "./drawer.css";
|
|
2
2
|
@import "./modal.css";
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
/* Dialogs Variables */
|
|
6
|
+
--rvc-dialog-backdrop-bg-color: --alpha(var(--color-slate-900) / 50%);
|
|
7
|
+
--rvc-dialog-padding-x: calc(var(--spacing) * 4);
|
|
8
|
+
--rvc-dialog-padding-y: calc(var(--spacing) * 4);
|
|
9
|
+
--rvc-dialog-header-bg-color: var(--color-white);
|
|
10
|
+
--rvc-dialog-close-size: calc(var(--spacing) * 6);
|
|
11
|
+
--rvc-dialog-close-color: var(--color-slate-700);
|
|
12
|
+
--rvc-dialog-close-color-hover: var(--color-slate-900);
|
|
13
|
+
--rvc-dialog-title-color: var(--color-slate-900);
|
|
14
|
+
--rvc-dialog-title-font-size: var(--text-xl);
|
|
15
|
+
--rvc-dialog-title-font-weight: var(--font-weight-bold);
|
|
16
|
+
--rvc-dialog-title-font-family: var(--font-sans);
|
|
17
|
+
--rvc-dialog-content-bg-color: var(--color-white);
|
|
18
|
+
--rvc-dialog-footer-bg-color: var(--color-slate-50);
|
|
19
|
+
--rvc-dialog-footer-gap: calc(var(--spacing) * 2);
|
|
20
|
+
--rvc-dialog-transition-timing-function: var(--rvc-base-transition-timing-function);
|
|
21
|
+
--rvc-dialog-transition-duration: 300ms;
|
|
22
|
+
}
|
|
@@ -23,67 +23,97 @@
|
|
|
23
23
|
--rvc-dropdown-item-padding-y: 0;
|
|
24
24
|
--rvc-dropdown-item-font-size: var(--rvc-base-font-size);
|
|
25
25
|
--rvc-dropdown-item-font-weight: var(--rvc-base-font-weight);
|
|
26
|
+
--rvc-dropdown-transition-timing-function: ease-in-out;
|
|
27
|
+
--rvc-dropdown-transition-duration: 100ms;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
@layer components {
|
|
29
31
|
.rvc-dropdown {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border-width: var(--rvc-dropdown-border-width);
|
|
34
|
-
border-color: var(--rvc-dropdown-border-color);
|
|
35
|
-
padding-block: var(--rvc-dropdown-padding-y);
|
|
36
|
-
padding-inline: var(--rvc-dropdown-padding-x);
|
|
37
|
-
font-size: var(--rvc-dropdown-font-size);
|
|
38
|
-
font-weight: var(--rvc-dropdown-font-weight);
|
|
39
|
-
gap: var(--rvc-dropdown-gap);
|
|
40
|
-
z-index: var(--rvc-dropdown-z-index);
|
|
41
|
-
margin-top: calc(var(--spacing) * 1);
|
|
42
|
-
position: absolute;
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
align-items: flex-start;
|
|
46
|
-
right: 0;
|
|
32
|
+
display: inline-block;
|
|
33
|
+
position: relative;
|
|
34
|
+
width: fit-content;
|
|
47
35
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
&.rvc-dropdown-full {
|
|
54
|
-
left: 0;
|
|
36
|
+
.rvc-dropdown-items {
|
|
37
|
+
display: flex;
|
|
38
|
+
position: absolute;
|
|
39
|
+
z-index: var(--rvc-dropdown-z-index);
|
|
55
40
|
right: 0;
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
align-items: flex-start;
|
|
43
|
+
width: var(--rvc-dropdown-width);
|
|
44
|
+
margin-top: calc(var(--spacing) * 1);
|
|
45
|
+
padding-block: var(--rvc-dropdown-padding-y);
|
|
46
|
+
padding-inline: var(--rvc-dropdown-padding-x);
|
|
47
|
+
border-width: var(--rvc-dropdown-border-width);
|
|
48
|
+
border-radius: var(--rvc-dropdown-border-radius);
|
|
49
|
+
border-color: var(--rvc-dropdown-border-color);
|
|
50
|
+
background-color: var(--rvc-dropdown-bg-color);
|
|
51
|
+
font-size: var(--rvc-dropdown-font-size);
|
|
52
|
+
font-weight: var(--rvc-dropdown-font-weight);
|
|
53
|
+
gap: var(--rvc-dropdown-gap);
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
padding-block: var(--rvc-dropdown-item-padding-y);
|
|
64
|
-
padding-inline: var(--rvc-dropdown-item-padding-x);
|
|
65
|
-
border-radius: var(--rvc-dropdown-item-border-radius);
|
|
66
|
-
font-size: var(--rvc-dropdown-item-font-size);
|
|
67
|
-
font-weight: var(--rvc-dropdown-item-font-weight);
|
|
68
|
-
display: flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
width: 100%;
|
|
55
|
+
&.rvc-dropdown-items-left {
|
|
56
|
+
right: auto;
|
|
57
|
+
left: 0;
|
|
58
|
+
}
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
&.rvc-dropdown-items-full {
|
|
61
|
+
right: 0;
|
|
62
|
+
left: 0;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
76
65
|
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
.rvc-dropdown-item {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
width: 100%;
|
|
70
|
+
padding-block: var(--rvc-dropdown-item-padding-y);
|
|
71
|
+
padding-inline: var(--rvc-dropdown-item-padding-x);
|
|
72
|
+
border-radius: var(--rvc-dropdown-item-border-radius);
|
|
73
|
+
background-color: var(--rvc-dropdown-item-bg-color);
|
|
74
|
+
color: var(--rvc-dropdown-item-color);
|
|
75
|
+
font-size: var(--rvc-dropdown-item-font-size);
|
|
76
|
+
font-weight: var(--rvc-dropdown-item-font-weight);
|
|
77
|
+
gap: var(--rvc-dropdown-item-gap);
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
background-color: var(--rvc-dropdown-item-bg-color-hover);
|
|
81
|
+
color: var(--rvc-dropdown-item-color-hover);
|
|
82
|
+
text-decoration: underline;
|
|
83
|
+
|
|
84
|
+
.rvc-dropdown-item-icon {
|
|
85
|
+
color: var(--rvc-dropdown-icon-color-hover);
|
|
86
|
+
}
|
|
79
87
|
}
|
|
80
|
-
}
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
.rvc-dropdown-item-icon {
|
|
90
|
+
width: var(--rvc-dropdown-icon-size);
|
|
91
|
+
height: var(--rvc-dropdown-icon-size);
|
|
92
|
+
color: var(--rvc-dropdown-icon-color);
|
|
93
|
+
}
|
|
86
94
|
}
|
|
87
95
|
}
|
|
88
96
|
}
|
|
97
|
+
|
|
98
|
+
/* Transitions */
|
|
99
|
+
.rvc-dropdown-transition-enter,
|
|
100
|
+
.rvc-dropdown-transition-leave {
|
|
101
|
+
--tw-duration: var(--rvc-dropdown-transition-duration);
|
|
102
|
+
|
|
103
|
+
transition-duration: var(--rvc-dropdown-transition-duration);
|
|
104
|
+
|
|
105
|
+
--tw-ease: var(--rvc-dropdown-transition-timing-function);
|
|
106
|
+
|
|
107
|
+
transition-timing-function: var(--rvc-dropdown-transition-timing-function);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.rvc-dropdown-transition-enter-from,
|
|
111
|
+
.rvc-dropdown-transition-leave-to {
|
|
112
|
+
opacity: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.rvc-dropdown-transition-enter-to,
|
|
116
|
+
.rvc-dropdown-transition-leave-from {
|
|
117
|
+
opacity: 1;
|
|
118
|
+
}
|
|
89
119
|
}
|
package/dist/dropdown/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createElementBlock as w, openBlock as
|
|
2
|
-
import { Menu as N, MenuButton as
|
|
3
|
-
import { _ as V } from "../_shared/ButtonBase-
|
|
1
|
+
import { createElementBlock as w, openBlock as r, createElementVNode as C, createBlock as l, unref as n, normalizeClass as u, withCtx as a, renderSlot as s, createVNode as i, mergeProps as f, Transition as B, Fragment as M, renderList as $, resolveDynamicComponent as m, createCommentVNode as A, createTextVNode as D, toDisplayString as L } from "vue";
|
|
2
|
+
import { Menu as N, MenuButton as v, MenuItems as S, MenuItem as p } from "@headlessui/vue";
|
|
3
|
+
import { _ as V } from "../_shared/ButtonBase-DfkwHIhN.js";
|
|
4
4
|
function x(t, c) {
|
|
5
|
-
return
|
|
5
|
+
return r(), w("svg", {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
viewBox: "0 0 20 20",
|
|
8
8
|
fill: "currentColor",
|
|
@@ -41,72 +41,72 @@ const T = /* @__PURE__ */ Object.assign({
|
|
|
41
41
|
},
|
|
42
42
|
emits: ["dropdown:click"],
|
|
43
43
|
setup(t, { emit: c }) {
|
|
44
|
-
const b = c,
|
|
44
|
+
const b = c, g = (o) => {
|
|
45
45
|
const {
|
|
46
|
-
as:
|
|
46
|
+
as: h,
|
|
47
47
|
bindAs: e,
|
|
48
48
|
event: d,
|
|
49
|
-
icon:
|
|
49
|
+
icon: y,
|
|
50
50
|
name: I,
|
|
51
51
|
...k
|
|
52
|
-
} =
|
|
52
|
+
} = o;
|
|
53
53
|
return k;
|
|
54
54
|
};
|
|
55
|
-
return (
|
|
55
|
+
return (o, h) => (r(), l(n(N), {
|
|
56
56
|
as: "div",
|
|
57
|
-
class: u(["
|
|
57
|
+
class: u(["rvc-dropdown", t.rootClass])
|
|
58
58
|
}, {
|
|
59
|
-
default:
|
|
60
|
-
s(
|
|
59
|
+
default: a(() => [
|
|
60
|
+
s(o.$slots, "button", {
|
|
61
61
|
label: t.label,
|
|
62
|
-
button:
|
|
62
|
+
button: n(v)
|
|
63
63
|
}, () => [
|
|
64
|
-
i(
|
|
64
|
+
i(n(v), f({
|
|
65
65
|
as: V,
|
|
66
66
|
label: t.label,
|
|
67
67
|
color: "light",
|
|
68
|
-
icon:
|
|
68
|
+
icon: n(x),
|
|
69
69
|
"icon-left": t.alignLeft
|
|
70
|
-
},
|
|
70
|
+
}, o.$attrs), null, 16, ["label", "icon", "icon-left"])
|
|
71
71
|
]),
|
|
72
72
|
i(B, {
|
|
73
|
-
"enter-active-class": "transition
|
|
74
|
-
"enter-from-class": "
|
|
75
|
-
"enter-to-class": "
|
|
76
|
-
"leave-active-class": "transition
|
|
77
|
-
"leave-from-class": "
|
|
78
|
-
"leave-to-class": "
|
|
73
|
+
"enter-active-class": "rvc-dropdown-transition-enter",
|
|
74
|
+
"enter-from-class": "rvc-dropdown-transition-enter-from",
|
|
75
|
+
"enter-to-class": "rvc-dropdown-transition-enter-to",
|
|
76
|
+
"leave-active-class": "rvc-dropdown-transition-leave",
|
|
77
|
+
"leave-from-class": "rvc-dropdown-transition-leave-from",
|
|
78
|
+
"leave-to-class": "rvc-dropdown-transition-leave-to"
|
|
79
79
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
i(
|
|
80
|
+
default: a(() => [
|
|
81
|
+
i(n(S), {
|
|
82
82
|
class: u([
|
|
83
|
-
"rvc-dropdown",
|
|
83
|
+
"rvc-dropdown-items",
|
|
84
84
|
{
|
|
85
|
-
"rvc-dropdown-left": t.alignLeft,
|
|
86
|
-
"rvc-dropdown-full": t.fullWidth
|
|
85
|
+
"rvc-dropdown-items-left": t.alignLeft,
|
|
86
|
+
"rvc-dropdown-items-full": t.fullWidth
|
|
87
87
|
}
|
|
88
88
|
])
|
|
89
89
|
}, {
|
|
90
|
-
default:
|
|
91
|
-
s(
|
|
90
|
+
default: a(() => [
|
|
91
|
+
s(o.$slots, "items", {
|
|
92
92
|
items: t.items,
|
|
93
|
-
menuItem:
|
|
93
|
+
menuItem: n(p)
|
|
94
94
|
}, () => [
|
|
95
|
-
(
|
|
95
|
+
(r(!0), w(M, null, $(t.items, (e, d) => (r(), l(n(p), {
|
|
96
96
|
key: `${d}-dropdown-item`,
|
|
97
97
|
as: "template"
|
|
98
98
|
}, {
|
|
99
|
-
default:
|
|
100
|
-
s(
|
|
101
|
-
(
|
|
99
|
+
default: a(() => [
|
|
100
|
+
s(o.$slots, "item", { item: e }, () => [
|
|
101
|
+
(r(), l(m(e.as ? e.as : "button"), f({
|
|
102
102
|
class: "rvc-dropdown-item",
|
|
103
103
|
ref_for: !0
|
|
104
|
-
},
|
|
104
|
+
}, g(e), {
|
|
105
105
|
as: e.bindAs ? e.bindAs : void 0,
|
|
106
|
-
onClick: (
|
|
106
|
+
onClick: (y) => (b("dropdown:click", e), e.event ? e.event() : null)
|
|
107
107
|
}), {
|
|
108
|
-
default:
|
|
109
|
-
e.icon ? (
|
|
108
|
+
default: a(() => [
|
|
109
|
+
e.icon ? (r(), l(m(e.icon), {
|
|
110
110
|
key: 0,
|
|
111
111
|
class: "rvc-dropdown-item-icon"
|
|
112
112
|
})) : A("", !0),
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
--rvc-lightswitch-width: 3.125rem;
|
|
9
9
|
--rvc-lightswitch-bg-color: var(--color-slate-200);
|
|
10
10
|
--rvc-lightswitch-bg-color-enabled: var(--color-green-400);
|
|
11
|
+
--rvc-lightswitch-bg-color-disabled: var(--rvc-base-input-bg-color-disabled);
|
|
12
|
+
--rvc-lightswitch-disabled-opacity: var(--rvc-base-input-disabled-opacity);
|
|
11
13
|
--rvc-lightswitch-transition-property: colors;
|
|
12
14
|
--rvc-lightswitch-label-offset: 0.5rem;
|
|
13
15
|
--rvc-lightswitch-toggle-offset: 0.1875rem;
|
|
@@ -25,34 +27,43 @@
|
|
|
25
27
|
align-items: center;
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
&:has(:disabled) .rvc-lightswitch {
|
|
31
|
+
opacity: var(--rvc-lightswitch-disabled-opacity);
|
|
32
|
+
cursor: default;
|
|
33
|
+
|
|
34
|
+
.rvc-lightswitch-toggle {
|
|
35
|
+
background-color: var(--rvc-lightswitch-bg-color-disabled);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
label {
|
|
29
|
-
cursor: pointer;
|
|
30
40
|
padding-left: var(--rvc-lightswitch-label-offset);
|
|
41
|
+
cursor: pointer;
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
.rvc-lightswitch {
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
position: relative;
|
|
47
|
+
align-items: center;
|
|
48
|
+
width: var(--rvc-lightswitch-width);
|
|
34
49
|
height: var(--rvc-lightswitch-height);
|
|
35
50
|
transition-property: var(--rvc-lightswitch-transition-property);
|
|
36
51
|
transition-duration: var(--rvc-lightswitch-transition-duration);
|
|
37
52
|
transition-timing-function: var(--rvc-lightswitch-transition-timing-function);
|
|
38
|
-
width: var(--rvc-lightswitch-width);
|
|
39
53
|
border-radius: var(--rvc-lightswitch-border-radius);
|
|
40
54
|
background-color: var(--rvc-lightswitch-bg-color);
|
|
41
|
-
position: relative;
|
|
42
|
-
display: inline-flex;
|
|
43
|
-
align-items: center;
|
|
44
55
|
|
|
45
56
|
.rvc-lightswitch-toggle {
|
|
57
|
+
display: inline-block;
|
|
46
58
|
width: var(--rvc-lightswitch-toggle-size);
|
|
47
59
|
height: var(--rvc-lightswitch-toggle-size);
|
|
48
60
|
transform: translateX(var(--rvc-lightswitch-toggle-offset));
|
|
49
61
|
transform-origin: left;
|
|
50
|
-
border-radius: var(--rvc-lightswitch-border-radius);
|
|
51
|
-
background-color: var(--rvc-lightswitch-toggle-bg-color);
|
|
52
62
|
transition-property: var(--rvc-lightswitch-toggle-transition-property);
|
|
53
63
|
transition-duration: var(--rvc-lightswitch-toggle-transition-duration);
|
|
54
64
|
transition-timing-function: var(--rvc-lightswitch-toggle-transition-timing-function);
|
|
55
|
-
|
|
65
|
+
border-radius: var(--rvc-lightswitch-border-radius);
|
|
66
|
+
background-color: var(--rvc-lightswitch-toggle-bg-color);
|
|
56
67
|
box-shadow: var(--shadow-md);
|
|
57
68
|
}
|
|
58
69
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createElementBlock as r, openBlock as s, createElementVNode as n, ref as p, useAttrs as H, computed as x, watch as L, Fragment as A, createVNode as v, renderSlot as C, withCtx as
|
|
1
|
+
import { createElementBlock as r, openBlock as s, createElementVNode as n, ref as p, useAttrs as H, computed as x, watch as L, Fragment as A, createVNode as v, renderSlot as C, withCtx as M, normalizeClass as _, createCommentVNode as $, unref as f, renderList as B, createBlock as E, resolveDynamicComponent as S } from "vue";
|
|
2
2
|
import { useEditor as O, EditorContent as T } from "@tiptap/vue-3";
|
|
3
3
|
import N from "@tiptap/extension-link";
|
|
4
4
|
import U from "@tiptap/starter-kit";
|
|
5
|
-
import { _ as q } from "../_shared/Tooltip-
|
|
5
|
+
import { _ as q } from "../_shared/Tooltip-B93ZF7IF.js";
|
|
6
6
|
import { _ as z } from "../_shared/FormInput-abFMz_J4.js";
|
|
7
|
-
import { _ as D } from "../_shared/Modal-
|
|
8
|
-
function I(
|
|
7
|
+
import { _ as D } from "../_shared/Modal-DdpJnce6.js";
|
|
8
|
+
function I(i, d) {
|
|
9
9
|
return s(), r("svg", {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
viewBox: "0 0 16 16",
|
|
@@ -20,7 +20,7 @@ function I(a, c) {
|
|
|
20
20
|
})
|
|
21
21
|
]);
|
|
22
22
|
}
|
|
23
|
-
function R(
|
|
23
|
+
function R(i, d) {
|
|
24
24
|
return s(), r("svg", {
|
|
25
25
|
xmlns: "http://www.w3.org/2000/svg",
|
|
26
26
|
viewBox: "0 0 16 16",
|
|
@@ -35,7 +35,7 @@ function R(a, c) {
|
|
|
35
35
|
})
|
|
36
36
|
]);
|
|
37
37
|
}
|
|
38
|
-
function j(
|
|
38
|
+
function j(i, d) {
|
|
39
39
|
return s(), r("svg", {
|
|
40
40
|
xmlns: "http://www.w3.org/2000/svg",
|
|
41
41
|
viewBox: "0 0 16 16",
|
|
@@ -55,7 +55,7 @@ function j(a, c) {
|
|
|
55
55
|
})
|
|
56
56
|
]);
|
|
57
57
|
}
|
|
58
|
-
function F(
|
|
58
|
+
function F(i, d) {
|
|
59
59
|
return s(), r("svg", {
|
|
60
60
|
xmlns: "http://www.w3.org/2000/svg",
|
|
61
61
|
viewBox: "0 0 16 16",
|
|
@@ -66,7 +66,7 @@ function F(a, c) {
|
|
|
66
66
|
n("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" })
|
|
67
67
|
]);
|
|
68
68
|
}
|
|
69
|
-
function K(
|
|
69
|
+
function K(i, d) {
|
|
70
70
|
return s(), r("svg", {
|
|
71
71
|
xmlns: "http://www.w3.org/2000/svg",
|
|
72
72
|
viewBox: "0 0 16 16",
|
|
@@ -95,7 +95,7 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
95
95
|
config: {
|
|
96
96
|
type: String,
|
|
97
97
|
default: "default",
|
|
98
|
-
validator: (
|
|
98
|
+
validator: (i) => ["default", "simple"].includes(i)
|
|
99
99
|
},
|
|
100
100
|
customExtensions: {
|
|
101
101
|
type: Array,
|
|
@@ -104,22 +104,25 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
104
104
|
customCommands: {
|
|
105
105
|
type: Array,
|
|
106
106
|
default: () => []
|
|
107
|
+
},
|
|
108
|
+
disabled: {
|
|
109
|
+
type: Boolean
|
|
107
110
|
}
|
|
108
111
|
},
|
|
109
112
|
emits: ["update:modelValue", "tiptap:onCreate"],
|
|
110
|
-
setup(
|
|
111
|
-
const
|
|
113
|
+
setup(i, { emit: d }) {
|
|
114
|
+
const a = i, h = d, b = p(!1), u = p(!1), c = p(""), m = H(), k = m.class ? `${m.class} ` : "", y = [
|
|
112
115
|
U,
|
|
113
116
|
N.configure({
|
|
114
117
|
openOnClick: !1
|
|
115
118
|
})
|
|
116
119
|
], t = O({
|
|
117
|
-
extensions: [...
|
|
118
|
-
content:
|
|
120
|
+
extensions: [...y, ...a.customExtensions],
|
|
121
|
+
content: a.modelValue,
|
|
119
122
|
editorProps: {
|
|
120
123
|
attributes: {
|
|
121
|
-
...
|
|
122
|
-
id:
|
|
124
|
+
...m,
|
|
125
|
+
id: a.id,
|
|
123
126
|
class: `${k}rvc-textarea rvc-rich-text-textarea`
|
|
124
127
|
}
|
|
125
128
|
},
|
|
@@ -131,9 +134,9 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
131
134
|
h("update:modelValue", o);
|
|
132
135
|
},
|
|
133
136
|
onSelectionUpdate({ editor: l }) {
|
|
134
|
-
|
|
137
|
+
b.value = !l.view.state.selection.empty;
|
|
135
138
|
}
|
|
136
|
-
}),
|
|
139
|
+
}), V = x(() => [
|
|
137
140
|
{
|
|
138
141
|
name: "bold",
|
|
139
142
|
icon: I,
|
|
@@ -154,7 +157,7 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
154
157
|
name: "bulletList",
|
|
155
158
|
icon: F,
|
|
156
159
|
title: "Bullet List",
|
|
157
|
-
isVisible:
|
|
160
|
+
isVisible: a.config === "default",
|
|
158
161
|
isActive: () => t.value.isActive("bulletList"),
|
|
159
162
|
action: () => t.value.commands.toggleBulletList()
|
|
160
163
|
},
|
|
@@ -162,7 +165,7 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
162
165
|
name: "orderedList",
|
|
163
166
|
icon: K,
|
|
164
167
|
title: "Ordered List",
|
|
165
|
-
isVisible:
|
|
168
|
+
isVisible: a.config === "default",
|
|
166
169
|
isActive: () => t.value.isActive("orderedList"),
|
|
167
170
|
action: () => t.value.commands.toggleOrderedList()
|
|
168
171
|
},
|
|
@@ -170,15 +173,15 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
170
173
|
name: "link",
|
|
171
174
|
icon: j,
|
|
172
175
|
title: "Hyperlink",
|
|
173
|
-
isVisible:
|
|
174
|
-
disabled: !
|
|
176
|
+
isVisible: a.config === "default",
|
|
177
|
+
disabled: !b.value && !t.value.isActive("link"),
|
|
175
178
|
isActive: () => t.value.isActive("link"),
|
|
176
179
|
action: () => {
|
|
177
|
-
|
|
180
|
+
c.value = t.value.getAttributes("link").href, u.value = !0;
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
|
-
]),
|
|
181
|
-
const l =
|
|
183
|
+
]), g = x(() => {
|
|
184
|
+
const l = V.value.filter((e) => a.config === "default" || ["bold", "italic"].includes(e.name)), o = a.customCommands.map((e) => ({
|
|
182
185
|
...e,
|
|
183
186
|
isVisible: e.isVisible ?? !0,
|
|
184
187
|
disabled: typeof e.disabled == "function" ? e.disabled(t.value) : e.disabled ?? !1,
|
|
@@ -190,25 +193,25 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
190
193
|
}));
|
|
191
194
|
return [...l, ...o];
|
|
192
195
|
});
|
|
193
|
-
L(() =>
|
|
196
|
+
L(() => a.modelValue, (l) => {
|
|
194
197
|
t.value.getHTML() === l || t.value.commands.setContent(l, !1);
|
|
195
198
|
});
|
|
196
199
|
const Z = () => {
|
|
197
|
-
t.value.commands.setLink({ href:
|
|
200
|
+
t.value.commands.setLink({ href: c.value }), u.value = !1, c.value = null;
|
|
198
201
|
};
|
|
199
202
|
return (l, o) => (s(), r(A, null, [
|
|
200
203
|
v(D, {
|
|
201
|
-
id: `${
|
|
204
|
+
id: `${a.id}-modal-add-hyperlink`,
|
|
202
205
|
title: "Add Hyperlink",
|
|
203
206
|
as: "form",
|
|
204
207
|
show: u.value,
|
|
205
208
|
"onModal:close": o[1] || (o[1] = (e) => u.value = !1),
|
|
206
209
|
"onModal:save": Z
|
|
207
210
|
}, {
|
|
208
|
-
default:
|
|
211
|
+
default: M(() => [
|
|
209
212
|
v(z, {
|
|
210
|
-
modelValue:
|
|
211
|
-
"onUpdate:modelValue": o[0] || (o[0] = (e) =>
|
|
213
|
+
modelValue: c.value,
|
|
214
|
+
"onUpdate:modelValue": o[0] || (o[0] = (e) => c.value = e),
|
|
212
215
|
placeholder: "https://www.example.com",
|
|
213
216
|
type: "url",
|
|
214
217
|
required: ""
|
|
@@ -218,29 +221,29 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
218
221
|
}, 8, ["id", "show"]),
|
|
219
222
|
C(l.$slots, "default"),
|
|
220
223
|
n("div", {
|
|
221
|
-
class:
|
|
224
|
+
class: _(["rvc-rich-text", i.rootClass, { "rvc-rich-text-disabled": i.disabled }])
|
|
222
225
|
}, [
|
|
223
|
-
|
|
226
|
+
f(t) ? C(l.$slots, "toolbar", {
|
|
224
227
|
key: 0,
|
|
225
|
-
commands:
|
|
226
|
-
tiptap:
|
|
228
|
+
commands: g.value,
|
|
229
|
+
tiptap: f(t)
|
|
227
230
|
}, () => [
|
|
228
231
|
n("ul", P, [
|
|
229
|
-
(s(!0), r(A, null, B(
|
|
232
|
+
(s(!0), r(A, null, B(g.value.filter((e) => e.isVisible), (e) => (s(), r("li", {
|
|
230
233
|
key: `toolbar-item-command-${e.name}`
|
|
231
234
|
}, [
|
|
232
235
|
v(q, {
|
|
233
236
|
content: e.title,
|
|
234
237
|
placement: "bottom",
|
|
235
238
|
size: "sm",
|
|
236
|
-
class: "text-
|
|
239
|
+
class: "rvc-rich-text-tooltip"
|
|
237
240
|
}, {
|
|
238
|
-
default:
|
|
241
|
+
default: M(() => [
|
|
239
242
|
n("button", {
|
|
240
243
|
disabled: e.disabled,
|
|
241
244
|
type: "button",
|
|
242
245
|
"aria-label": e.title,
|
|
243
|
-
class:
|
|
246
|
+
class: _([{ "rvc-rich-text-button-active": e.isActive() }, "rvc-rich-text-button"]),
|
|
244
247
|
onClick: e.action
|
|
245
248
|
}, [
|
|
246
249
|
(s(), E(S(e.icon)))
|
|
@@ -251,7 +254,7 @@ const P = { class: "rvc-rich-text-toolbar" }, G = ["disabled", "aria-label", "on
|
|
|
251
254
|
]))), 128))
|
|
252
255
|
])
|
|
253
256
|
]) : $("", !0),
|
|
254
|
-
v(
|
|
257
|
+
v(f(T), { editor: f(t) }, null, 8, ["editor"])
|
|
255
258
|
], 2)
|
|
256
259
|
], 64));
|
|
257
260
|
}
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
ul, ol {
|
|
31
|
-
list-style-position: var(--rvc-rich-text-list-position);
|
|
32
31
|
padding-left: var(--rvc-rich-text-list-padding);
|
|
32
|
+
list-style-position: var(--rvc-rich-text-list-position);
|
|
33
33
|
|
|
34
34
|
li > * {
|
|
35
35
|
display: inline;
|
|
@@ -40,28 +40,41 @@
|
|
|
40
40
|
ol { list-style-type: decimal; }
|
|
41
41
|
|
|
42
42
|
a {
|
|
43
|
-
text-decoration: var(--rvc-rich-text-anchor-text-decoration);
|
|
44
|
-
font-weight: var(--rvc-rich-text-anchor-font-weight);
|
|
45
43
|
color: var(--rvc-rich-text-anchor-color);
|
|
44
|
+
font-weight: var(--rvc-rich-text-anchor-font-weight);
|
|
45
|
+
text-decoration: var(--rvc-rich-text-anchor-text-decoration);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.rvc-rich-text-disabled {
|
|
50
|
+
opacity: var(--rvc-textarea-disabled-opacity);
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
|
|
53
|
+
.rvc-rich-text-button {
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.rvc-rich-text-textarea {
|
|
58
|
+
background-color: var(--rvc-textarea-bg-color-disabled);
|
|
46
59
|
}
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
.rvc-rich-text-toolbar {
|
|
50
|
-
padding: var(--rvc-textarea-padding-x);
|
|
51
|
-
gap: calc(var(--spacing) * 1);
|
|
52
63
|
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
64
|
position: absolute;
|
|
55
|
-
inset-block-start: 0;
|
|
56
|
-
inset-inline: 0;
|
|
57
|
-
flex-wrap: wrap;
|
|
58
65
|
z-index: 1;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
align-items: center;
|
|
68
|
+
padding: var(--rvc-textarea-padding-x);
|
|
59
69
|
pointer-events: none;
|
|
70
|
+
gap: calc(var(--spacing) * 1);
|
|
71
|
+
inset-block-start: 0;
|
|
72
|
+
inset-inline: 0;
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
.rvc-rich-text-button {
|
|
63
|
-
border-radius: var(--rvc-rich-text-button-border-radius);
|
|
64
76
|
padding: var(--rvc-rich-text-button-padding);
|
|
77
|
+
border-radius: var(--rvc-rich-text-button-border-radius);
|
|
65
78
|
background-color: var(--rvc-rich-text-button-bg-color);
|
|
66
79
|
color: var(--rvc-rich-text-button-color);
|
|
67
80
|
pointer-events: auto;
|
|
@@ -79,5 +92,10 @@
|
|
|
79
92
|
height: var(--rvc-rich-text-icon-size);
|
|
80
93
|
}
|
|
81
94
|
}
|
|
95
|
+
|
|
96
|
+
.rvc-rich-text-tooltip {
|
|
97
|
+
font-size: var(--text-sm);
|
|
98
|
+
font-weight: var(--font-weight-medium);
|
|
99
|
+
}
|
|
82
100
|
}
|
|
83
101
|
}
|