@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,197 +0,0 @@
1
- import { defineComponent as E, openBlock as v, createBlock as k, unref as e, withCtx as d, createVNode as s, withModifiers as T, createElementVNode as o, normalizeClass as m, renderSlot as i, createElementBlock as p, createTextVNode as F, toDisplayString as L, createCommentVNode as g } from "vue";
2
- import { TransitionRoot as I, Dialog as N, TransitionChild as C, DialogPanel as R, DialogTitle as u } from "@headlessui/vue";
3
- import { _ as $ } from "./ButtonBase.vue_vue_type_script_setup_true_lang-ZYVNEyNx.js";
4
- import { u as V } from "./Modal.vue_vue_type_script_setup_true_lang-CdMsCCBi.js";
5
- import { r as B } from "./XMarkIcon-CPr_Rd8y.js";
6
- const A = {
7
- class: "rvc-drawer-presentation",
8
- role: "presentation"
9
- }, H = { class: "rvc-drawer-container" }, z = { class: "rvc-drawer-inner" }, M = { class: "rvc-drawer-panel-inner" }, P = { class: "rvc-drawer-header-inner" }, j = { class: "rvc-drawer-close-wrapper" }, q = ["id"], G = {
10
- key: 2,
11
- class: "rvc-drawer-footer"
12
- }, W = /* @__PURE__ */ E({
13
- __name: "Drawer",
14
- props: {
15
- as: { default: "form" },
16
- id: {},
17
- title: {},
18
- showClose: { type: Boolean, default: !1 },
19
- scrolledDown: { type: Boolean, default: !1 },
20
- headerSticky: { type: Boolean, default: !1 },
21
- spinning: { type: Boolean, default: !1 },
22
- submitLabel: { default: "Save" },
23
- cancelLabel: { default: "Cancel" },
24
- panelClass: { default: "rvc-drawer-panel-max-width" },
25
- resetHeader: { type: Boolean, default: !1 },
26
- resetFooter: { type: Boolean, default: !1 }
27
- },
28
- emits: ["drawer:open", "drawer:opened", "drawer:close", "drawer:save", "drawer:closed"],
29
- setup(r, { emit: h }) {
30
- const D = r, a = h, {
31
- contentRef: b,
32
- ready: f,
33
- isForm: y,
34
- titleId: c,
35
- descriptionId: w,
36
- initialFocusElement: S
37
- } = V(D);
38
- return (n, t) => (v(), k(e(I), { as: "template" }, {
39
- default: d(() => [
40
- s(e(N), {
41
- as: r.as,
42
- class: "rvc-drawer",
43
- static: "",
44
- "aria-modal": "true",
45
- role: "dialog",
46
- "initial-focus": e(S),
47
- "aria-labelledby": e(c),
48
- onClose: t[6] || (t[6] = (l) => a("drawer:close")),
49
- onSubmit: t[7] || (t[7] = T((l) => a("drawer:save", l), ["prevent"]))
50
- }, {
51
- default: d(() => [
52
- s(e(C), {
53
- as: "template",
54
- enter: "rvc-drawer-backdrop-transition-enter",
55
- "enter-from": "rvc-drawer-backdrop-transition-enter-from",
56
- "enter-to": "rvc-drawer-backdrop-transition-enter-to",
57
- leave: "rvc-drawer-backdrop-transition-leave",
58
- "leave-from": "rvc-drawer-backdrop-transition-leave-from",
59
- "leave-to": "rvc-drawer-backdrop-transition-leave-to",
60
- onBeforeEnter: t[0] || (t[0] = (l) => a("drawer:open")),
61
- onAfterEnter: t[1] || (t[1] = (l) => a("drawer:opened"))
62
- }, {
63
- default: d(() => [...t[8] || (t[8] = [
64
- o("div", {
65
- class: "rvc-drawer-backdrop",
66
- "aria-hidden": "true"
67
- }, null, -1)
68
- ])]),
69
- _: 1
70
- }),
71
- o("div", A, [
72
- o("div", H, [
73
- o("div", z, [
74
- s(e(C), {
75
- as: "template",
76
- enter: "rvc-drawer-transition-enter",
77
- "enter-from": "rvc-drawer-transition-enter-from",
78
- "enter-to": "rvc-drawer-transition-enter-to",
79
- leave: "rvc-drawer-transition-leave",
80
- "leave-from": "rvc-drawer-transition-leave-from",
81
- "leave-to": "rvc-drawer-transition-leave-to",
82
- onBeforeEnter: t[4] || (t[4] = (l) => f.value = !0),
83
- onAfterLeave: t[5] || (t[5] = (l) => (f.value = !1, a("drawer:closed")))
84
- }, {
85
- default: d(() => [
86
- s(e(R), {
87
- class: m(["rvc-drawer-panel", r.panelClass]),
88
- "aria-busy": r.spinning,
89
- "aria-describedby": e(w)
90
- }, {
91
- default: d(() => [
92
- i(n.$slots, "panel", {
93
- title: r.title,
94
- loading: r.spinning,
95
- isForm: e(y),
96
- titleId: e(c),
97
- descriptionId: e(w),
98
- contentRef: e(b),
99
- dialogTitle: e(u),
100
- emitClose: () => a("drawer:close"),
101
- emitSave: (l = void 0) => a("drawer:save", l)
102
- }, () => [
103
- o("div", M, [
104
- r.resetHeader ? i(n.$slots, "header", { key: 1 }) : (v(), p("header", {
105
- key: 0,
106
- class: m([{ "rvc-drawer-header-sticky": r.headerSticky }, "rvc-drawer-header"])
107
- }, [
108
- i(n.$slots, "header", {
109
- title: r.title,
110
- showClose: r.showClose
111
- }, () => [
112
- o("div", P, [
113
- i(n.$slots, "title", {
114
- id: e(c),
115
- dialogTitle: e(u),
116
- title: r.title
117
- }, () => [
118
- s(e(u), {
119
- id: e(c),
120
- class: "rvc-drawer-title"
121
- }, {
122
- default: d(() => [
123
- F(L(r.title), 1)
124
- ]),
125
- _: 1
126
- }, 8, ["id"])
127
- ]),
128
- r.showClose ? i(n.$slots, "close", {
129
- key: 0,
130
- icon: e(B),
131
- emitClose: () => a("drawer:close")
132
- }, () => [
133
- o("div", j, [
134
- o("button", {
135
- type: "button",
136
- class: "rvc-drawer-close",
137
- "aria-label": "Close panel",
138
- onClick: t[2] || (t[2] = (l) => a("drawer:close"))
139
- }, [
140
- s(e(B), { "aria-hidden": "true" })
141
- ])
142
- ])
143
- ]) : g("", !0)
144
- ])
145
- ])
146
- ], 2)),
147
- o("div", {
148
- class: m([{ "rvc-drawer-scroll-reverse": r.scrolledDown }, "rvc-drawer-scroll"])
149
- }, [
150
- o("div", {
151
- id: e(w),
152
- ref_key: "contentRef",
153
- ref: b,
154
- class: "rvc-drawer-content"
155
- }, [
156
- i(n.$slots, "default", { ready: e(f) })
157
- ], 8, q)
158
- ], 2),
159
- r.resetFooter ? i(n.$slots, "footer", { key: 3 }) : (v(), p("footer", G, [
160
- i(n.$slots, "footer", { loading: r.spinning }, () => [
161
- s($, {
162
- type: "button",
163
- label: r.cancelLabel,
164
- color: "light",
165
- onClick: t[3] || (t[3] = (l) => a("drawer:close"))
166
- }, null, 8, ["label"]),
167
- e(y) ? (v(), k($, {
168
- key: 0,
169
- type: "submit",
170
- label: r.submitLabel,
171
- spinning: r.spinning,
172
- disabled: r.spinning
173
- }, null, 8, ["label", "spinning", "disabled"])) : g("", !0)
174
- ])
175
- ]))
176
- ])
177
- ])
178
- ]),
179
- _: 3
180
- }, 8, ["class", "aria-busy", "aria-describedby"])
181
- ]),
182
- _: 3
183
- })
184
- ])
185
- ])
186
- ])
187
- ]),
188
- _: 3
189
- }, 8, ["as", "initial-focus", "aria-labelledby"])
190
- ]),
191
- _: 3
192
- }));
193
- }
194
- });
195
- export {
196
- W as _
197
- };
@@ -1,150 +0,0 @@
1
- import { openBlock as r, createElementBlock as k, createElementVNode as D, defineComponent as w, watch as b, createBlock as d, unref as o, normalizeClass as g, withCtx as s, createVNode as i, renderSlot as c, mergeProps as B, Transition as A, Fragment as L, renderList as N, resolveDynamicComponent as y, createCommentVNode as O, createTextVNode as V, toDisplayString as x } from "vue";
2
- import { Menu as I, MenuButton as C, MenuItems as Z, MenuItem as h } from "@headlessui/vue";
3
- import { _ as q } from "./ButtonBase.vue_vue_type_script_setup_true_lang-ZYVNEyNx.js";
4
- function E(t, u) {
5
- return r(), k("svg", {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- viewBox: "0 0 20 20",
8
- fill: "currentColor",
9
- "aria-hidden": "true",
10
- "data-slot": "icon"
11
- }, [
12
- D("path", { d: "M10 3a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM10 8.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM11.5 15.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Z" })
13
- ]);
14
- }
15
- const z = /* @__PURE__ */ w({
16
- inheritAttrs: !1,
17
- __name: "Dropdown",
18
- props: {
19
- items: {},
20
- alignLeft: { type: Boolean, default: !1 },
21
- fullWidth: { type: Boolean, default: !1 },
22
- label: { default: "Options" },
23
- open: { type: [Boolean, null], default: null },
24
- rootClass: { default: "" }
25
- },
26
- emits: ["dropdown:click", "update:open"],
27
- setup(t, { emit: u }) {
28
- const m = u, M = w({
29
- name: "DropdownMenuStateBridge",
30
- props: {
31
- close: {
32
- type: Function,
33
- required: !0
34
- },
35
- menuOpen: {
36
- type: Boolean,
37
- required: !0
38
- },
39
- open: {
40
- type: Boolean,
41
- default: null
42
- }
43
- },
44
- emits: ["update:open"],
45
- setup(n, { emit: a }) {
46
- return b(
47
- () => n.menuOpen,
48
- (l) => a("update:open", l)
49
- ), b(
50
- () => n.open,
51
- (l) => {
52
- l === !1 && n.menuOpen && n.close();
53
- }
54
- ), () => null;
55
- }
56
- }), $ = (n) => {
57
- const {
58
- as: a,
59
- bindAs: l,
60
- event: p,
61
- icon: e,
62
- name: f,
63
- ...v
64
- } = n;
65
- return v;
66
- };
67
- return (n, a) => (r(), d(o(I), {
68
- as: "div",
69
- class: g(["rvc-dropdown", t.rootClass])
70
- }, {
71
- default: s(({ open: l, close: p }) => [
72
- i(o(M), {
73
- open: t.open,
74
- "menu-open": l,
75
- close: p,
76
- "onUpdate:open": a[0] || (a[0] = (e) => m("update:open", e))
77
- }, null, 8, ["open", "menu-open", "close"]),
78
- c(n.$slots, "button", {
79
- label: t.label,
80
- button: o(C)
81
- }, () => [
82
- i(o(C), B({
83
- as: q,
84
- label: t.label,
85
- color: "light",
86
- icon: o(E),
87
- "icon-left": t.alignLeft
88
- }, n.$attrs), null, 16, ["label", "icon", "icon-left"])
89
- ]),
90
- i(A, {
91
- "enter-active-class": "rvc-dropdown-transition-enter",
92
- "enter-from-class": "rvc-dropdown-transition-enter-from",
93
- "enter-to-class": "rvc-dropdown-transition-enter-to",
94
- "leave-active-class": "rvc-dropdown-transition-leave",
95
- "leave-from-class": "rvc-dropdown-transition-leave-from",
96
- "leave-to-class": "rvc-dropdown-transition-leave-to"
97
- }, {
98
- default: s(() => [
99
- i(o(Z), {
100
- class: g([
101
- "rvc-dropdown-items",
102
- {
103
- "rvc-dropdown-items-left": t.alignLeft,
104
- "rvc-dropdown-items-full": t.fullWidth
105
- }
106
- ])
107
- }, {
108
- default: s(() => [
109
- c(n.$slots, "items", {
110
- items: t.items,
111
- menuItem: o(h)
112
- }, () => [
113
- (r(!0), k(L, null, N(t.items, (e, f) => (r(), d(o(h), {
114
- key: `${f}-dropdown-item`,
115
- as: "template"
116
- }, {
117
- default: s(() => [
118
- c(n.$slots, "item", { item: e }, () => [
119
- (r(), d(y(e.as ? e.as : "button"), B({ class: "rvc-dropdown-item" }, { ref_for: !0 }, $(e), {
120
- as: e.bindAs ? e.bindAs : void 0,
121
- onClick: (v) => (m("dropdown:click", e), e.event ? e.event() : null)
122
- }), {
123
- default: s(() => [
124
- e.icon ? (r(), d(y(e.icon), {
125
- key: 0,
126
- class: "rvc-dropdown-item-icon"
127
- })) : O("", !0),
128
- V(" " + x(e.name), 1)
129
- ]),
130
- _: 2
131
- }, 1040, ["as", "onClick"]))
132
- ])
133
- ]),
134
- _: 2
135
- }, 1024))), 128))
136
- ])
137
- ]),
138
- _: 3
139
- }, 8, ["class"])
140
- ]),
141
- _: 3
142
- })
143
- ]),
144
- _: 3
145
- }, 8, ["class"]));
146
- }
147
- });
148
- export {
149
- z as _
150
- };
@@ -1,74 +0,0 @@
1
- import { computed as y, getCurrentInstance as I, defineComponent as g, useSlots as x, ref as B, openBlock as n, createElementBlock as o, normalizeClass as C, unref as s, renderSlot as i, createBlock as p, resolveDynamicComponent as f, createCommentVNode as a, normalizeProps as V, guardReactiveProps as b, withDirectives as z, mergeProps as m, vModelDynamic as F } from "vue";
2
- const M = () => ({ hasModelBinding: y(() => {
3
- const l = I();
4
- return !!(l?.vnode?.props && Object.prototype.hasOwnProperty.call(l.vnode.props, "onUpdate:modelValue"));
5
- }) }), O = {
6
- key: 0,
7
- class: "rvc-input-prefix"
8
- }, P = ["type"], j = ["type"], D = {
9
- key: 1,
10
- class: "rvc-input-suffix"
11
- }, S = /* @__PURE__ */ g({
12
- inheritAttrs: !1,
13
- __name: "FormInput",
14
- props: {
15
- modelValue: { default: void 0 },
16
- rootClass: { default: "" },
17
- prefixIcon: { type: [Function, Object, null], default: null },
18
- icon: { type: [Function, Object, null], default: null },
19
- size: { default: "base" }
20
- },
21
- emits: ["update:modelValue"],
22
- setup(e, { emit: l }) {
23
- const v = e, h = l, { hasModelBinding: k } = M(), r = x(), u = B(null), c = y({
24
- get: () => v.modelValue,
25
- set: (t) => h("update:modelValue", t)
26
- });
27
- return (t, d) => (n(), o("div", {
28
- class: C([
29
- "rvc-input",
30
- `rvc-input-${e.size}`,
31
- e.rootClass
32
- ])
33
- }, [
34
- s(r).prefix || s(r).prefixIcon || e.prefixIcon ? (n(), o("span", O, [
35
- i(t.$slots, "prefix", {}, () => [
36
- i(t.$slots, "prefixIcon", { icon: e.prefixIcon }, () => [
37
- e.prefixIcon ? (n(), p(f(e.prefixIcon), {
38
- key: 0,
39
- "aria-hidden": "true"
40
- })) : a("", !0)
41
- ])
42
- ])
43
- ])) : a("", !0),
44
- i(t.$slots, "input", V(b(t.$attrs)), () => [
45
- s(k) ? z((n(), o("input", m({ key: 0 }, t.$attrs, {
46
- ref_key: "input",
47
- ref: u,
48
- "onUpdate:modelValue": d[0] || (d[0] = ($) => c.value = $),
49
- type: t.$attrs.type || "text"
50
- }), null, 16, P)), [
51
- [F, c.value]
52
- ]) : (n(), o("input", m({ key: 1 }, t.$attrs, {
53
- ref_key: "input",
54
- ref: u,
55
- type: t.$attrs.type || "text"
56
- }), null, 16, j))
57
- ]),
58
- s(r).suffix || s(r).icon || e.icon ? (n(), o("span", D, [
59
- i(t.$slots, "suffix", {}, () => [
60
- i(t.$slots, "icon", { icon: e.icon }, () => [
61
- e.icon ? (n(), p(f(e.icon), {
62
- key: 0,
63
- "aria-hidden": "true"
64
- })) : a("", !0)
65
- ])
66
- ])
67
- ])) : a("", !0)
68
- ], 2));
69
- }
70
- });
71
- export {
72
- S as _,
73
- M as u
74
- };
@@ -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
- };