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