@robuust-digital/vue-components 2.7.0 → 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 (52) hide show
  1. package/CHANGELOG.md +25 -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/combobox.d.ts +3 -132
  18. package/dist/composables/useDialogContext.d.ts +19 -0
  19. package/dist/composables/useForm.d.ts +6 -0
  20. package/dist/core/file-upload.css +28 -1
  21. package/dist/core/index.js +5 -20
  22. package/dist/core.d.ts +15 -794
  23. package/dist/dialogs/index.js +3 -6
  24. package/dist/dialogs.d.ts +3 -300
  25. package/dist/dropdown/index.js +2 -5
  26. package/dist/dropdown.d.ts +3 -149
  27. package/dist/index/index.js +14 -36
  28. package/dist/index.d.ts +8 -1546
  29. package/dist/lightswitch/index.js +2 -5
  30. package/dist/lightswitch.d.ts +3 -39
  31. package/dist/rich-text-editor/index.js +2 -5
  32. package/dist/rich-text-editor.d.ts +3 -89
  33. package/dist/toast/index.js +2 -5
  34. package/dist/toast.d.ts +3 -66
  35. package/dist/tooltip/index.js +5 -5
  36. package/dist/tooltip.d.ts +3 -61
  37. package/dist/types/shared.d.ts +2 -0
  38. package/package.json +33 -36
  39. package/dist/_shared/ButtonBase.vue_vue_type_script_setup_true_lang-ZYVNEyNx.js +0 -60
  40. package/dist/_shared/ChevronDownIcon-BYWciGnh.js +0 -41
  41. package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-BwTRzqr6.js +0 -256
  42. package/dist/_shared/Drawer.vue_vue_type_script_setup_true_lang-DeAu2U_2.js +0 -197
  43. package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-Cv3HwIyF.js +0 -150
  44. package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-Bg7YPGyY.js +0 -74
  45. package/dist/_shared/Lightswitch.vue_vue_type_script_setup_true_lang-hiuDVfo5.js +0 -43
  46. package/dist/_shared/Modal.vue_vue_type_script_setup_true_lang-CdMsCCBi.js +0 -203
  47. package/dist/_shared/RichTextEditor.vue_vue_type_script_setup_true_lang-Miebq2nL.js +0 -247
  48. package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-BaTWaeN3.js +0 -931
  49. package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-DS6keeu7.js +0 -78
  50. package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-B3MHy48T.js +0 -95
  51. package/dist/_shared/XMarkIcon-CPr_Rd8y.js +0 -19
  52. package/dist/_shared/icon-spinner-BYCMrTdL.js +0 -26
@@ -1,256 +0,0 @@
1
- import { openBlock as n, createElementBlock as c, createElementVNode as i, defineComponent as j, ref as h, computed as D, createBlock as x, unref as r, mergeProps as F, withCtx as g, renderSlot as m, resolveDynamicComponent as O, createCommentVNode as p, createVNode as b, withModifiers as P, Fragment as q, renderList as z, createTextVNode as U, toDisplayString as w, normalizeClass as G } from "vue";
2
- import { useDebounceFn as H } from "@vueuse/core";
3
- import { Combobox as J, ComboboxInput as Q, ComboboxButton as W, ComboboxOptions as X, ComboboxOption as Y } from "@headlessui/vue";
4
- import { r as _, _ as ee } from "./ChevronDownIcon-BYWciGnh.js";
5
- import { S as te } from "./icon-spinner-BYCMrTdL.js";
6
- function le(e, V) {
7
- return n(), c("svg", {
8
- xmlns: "http://www.w3.org/2000/svg",
9
- viewBox: "0 0 16 16",
10
- fill: "currentColor",
11
- "aria-hidden": "true",
12
- "data-slot": "icon"
13
- }, [
14
- i("path", {
15
- "fill-rule": "evenodd",
16
- d: "M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm2.78-4.22a.75.75 0 0 1-1.06 0L8 9.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L6.94 8 5.22 6.28a.75.75 0 0 1 1.06-1.06L8 6.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L9.06 8l1.72 1.72a.75.75 0 0 1 0 1.06Z",
17
- "clip-rule": "evenodd"
18
- })
19
- ]);
20
- }
21
- function oe(e, V) {
22
- return n(), c("svg", {
23
- xmlns: "http://www.w3.org/2000/svg",
24
- viewBox: "0 0 20 20",
25
- fill: "currentColor",
26
- "aria-hidden": "true",
27
- "data-slot": "icon"
28
- }, [
29
- i("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
30
- ]);
31
- }
32
- const ae = { class: "rvc-combobox-container" }, ne = { class: "rvc-combobox-wrapper" }, ie = { class: "rvc-combobox-field" }, ue = {
33
- key: 0,
34
- class: "rvc-combobox-chips"
35
- }, se = ["onClick"], re = {
36
- key: 0,
37
- class: "rvc-combobox-content"
38
- }, ce = {
39
- key: 1,
40
- class: "rvc-combobox-content"
41
- }, de = { class: "rvc-combobox-option-text" }, he = /* @__PURE__ */ j({
42
- inheritAttrs: !1,
43
- __name: "Combobox",
44
- props: {
45
- id: {},
46
- rootClass: { default: "" },
47
- modelValue: { default: null },
48
- endpoint: { default: void 0 },
49
- requestParams: { default: () => ({}) },
50
- manualInput: { type: Boolean, default: !1 },
51
- responseData: { type: Function, default: (e) => e },
52
- displayValue: { type: Function, default: (e) => e?.name || null },
53
- optionText: { type: Function, default: (e) => e?.name || null },
54
- disabled: { type: Boolean, default: !1 },
55
- minLength: { default: 2 },
56
- itemKey: { default: "id" },
57
- clearable: { type: Boolean, default: !1 },
58
- rootAttrs: { default: () => ({}) },
59
- multiple: { type: Boolean, default: !1 },
60
- onSearch: { type: Function, default: () => Promise.resolve({ data: [] }) },
61
- searchOnly: { type: Boolean, default: !1 },
62
- icon: { type: [Function, Object, null], default: null },
63
- prefixIcon: { type: [Function, Object, null], default: null },
64
- size: { default: "base" },
65
- debounce: { default: 150 },
66
- minLoadingTime: { default: 0 },
67
- onCancel: { type: Function, default: void 0 }
68
- },
69
- emits: ["update:modelValue", "update:requestParams", "combobox:noResults", "combobox:error"],
70
- setup(e, { emit: V }) {
71
- const a = e, d = V, u = h([]), v = h(!1), f = h(null), L = h(!0), k = h(null), s = D({
72
- get: () => a.multiple ? a.modelValue || [] : a.modelValue,
73
- set: (t) => d("update:modelValue", t)
74
- }), T = D({
75
- get: () => a.requestParams,
76
- set: (t) => d("update:requestParams", t)
77
- }), N = (t) => a.displayValue(t) || "", M = (t) => new Promise((o) => {
78
- setTimeout(o, t);
79
- }), A = (t, o) => {
80
- u.value = [], d("combobox:error", t), d("combobox:noResults", o);
81
- }, B = async (t) => {
82
- if (!a.onSearch) return;
83
- if (a.searchOnly && !t) {
84
- u.value = [];
85
- return;
86
- }
87
- if (t && t.length < a.minLength) {
88
- u.value = [];
89
- return;
90
- }
91
- k.value && a.onCancel && a.onCancel(k.value), v.value = !0;
92
- const o = Date.now();
93
- try {
94
- const { data: l, error: y, cancel: Z } = await a.onSearch(t, T.value, a.endpoint);
95
- k.value = Z || null;
96
- const $ = a.responseData(l), K = Date.now() - o;
97
- !$.length && y && A(y, t), K < a.minLoadingTime && await M(a.minLoadingTime - K), $?.length ? u.value = $ : (u.value = [], d("combobox:noResults", t));
98
- } catch (l) {
99
- l?.cancelled || A(l, t);
100
- } finally {
101
- v.value = !1;
102
- }
103
- }, R = H(B, a.debounce), I = (t) => {
104
- L.value ? (L.value = !1, B(t)) : R(t);
105
- }, E = (t) => {
106
- t.target.value?.length === 0 && (u.value = [], d("update:modelValue", null)), a.manualInput && d("update:modelValue", T.value.query);
107
- }, C = (t) => a.multiple ? s.value.some((o) => o[a.itemKey] === t) : s.value?.[a.itemKey] === t, S = (t) => {
108
- s.value = s.value.filter((o) => o[a.itemKey] !== t[a.itemKey]);
109
- };
110
- return (t, o) => (n(), x(r(J), F({
111
- modelValue: s.value,
112
- "onUpdate:modelValue": o[4] || (o[4] = (l) => s.value = l),
113
- as: "div"
114
- }, e.rootAttrs, {
115
- multiple: e.multiple,
116
- class: [
117
- "rvc-combobox",
118
- `rvc-combobox-${e.size}`,
119
- e.rootClass
120
- ]
121
- }), {
122
- default: g(() => [
123
- i("div", ae, [
124
- i("div", ne, [
125
- i("div", ie, [
126
- e.prefixIcon ? m(t.$slots, "prefixIcon", {
127
- key: 0,
128
- icon: e.prefixIcon
129
- }, () => [
130
- (n(), x(O(e.prefixIcon), { "aria-hidden": "true" }))
131
- ]) : p("", !0),
132
- b(r(Q), F(t.$attrs, {
133
- id: e.id,
134
- "display-value": N,
135
- disabled: e.disabled,
136
- autocomplete: "off",
137
- onChange: o[0] || (o[0] = (l) => I(l.target.value)),
138
- onSearch: E,
139
- onInput: o[1] || (o[1] = (l) => f.value = l.target.value)
140
- }), null, 16, ["id", "disabled"]),
141
- b(r(W), {
142
- disabled: e.disabled,
143
- class: "rvc-combobox-button",
144
- onClick: o[2] || (o[2] = (l) => I(f.value || null))
145
- }, {
146
- default: g(() => [
147
- v.value ? m(t.$slots, "spinner", {
148
- key: 0,
149
- spinning: v.value
150
- }, () => [
151
- b(r(te), { class: "rvc-combobox-spinner" })
152
- ]) : (!e.searchOnly || u.value?.length) && !v.value ? m(t.$slots, "icon", {
153
- key: 1,
154
- icon: e.icon
155
- }, () => [
156
- (n(), x(O(e.icon ?? r(_)), { "aria-hidden": "true" }))
157
- ]) : p("", !0)
158
- ]),
159
- _: 3
160
- }, 8, ["disabled"])
161
- ]),
162
- e.clearable && (Array.isArray(e.modelValue) ? e.modelValue?.length : e.modelValue?.id) ? (n(), c("button", {
163
- key: 0,
164
- type: "button",
165
- "aria-label": "Clear selection",
166
- class: "rvc-combobox-clear",
167
- onClick: o[3] || (o[3] = P((l) => d("update:modelValue", e.multiple ? [] : null), ["prevent"]))
168
- }, [
169
- m(t.$slots, "clear", {}, () => [
170
- b(r(oe))
171
- ])
172
- ])) : p("", !0)
173
- ]),
174
- e.multiple && Array.isArray(s.value) && s.value?.length ? (n(), c("ul", ue, [
175
- (n(!0), c(q, null, z(s.value, (l) => (n(), c("li", {
176
- key: `${e.id}-selected-option-${l[e.itemKey]}`
177
- }, [
178
- m(t.$slots, "chip", {
179
- optionText: e.optionText(l),
180
- option: l,
181
- removeOption: S
182
- }, () => [
183
- b(ee, {
184
- color: "gray",
185
- class: "rvc-combobox-chip",
186
- size: e.size
187
- }, {
188
- default: g(() => [
189
- U(w(e.optionText(l)) + " ", 1),
190
- i("button", {
191
- type: "button",
192
- "aria-label": "Remove option",
193
- onClick: P((y) => S(l), ["prevent"])
194
- }, [
195
- b(r(le))
196
- ], 8, se)
197
- ]),
198
- _: 2
199
- }, 1032, ["size"])
200
- ])
201
- ]))), 128))
202
- ])) : p("", !0),
203
- (!e.searchOnly || f.value?.length) && (!v.value || u.value.length) ? (n(), x(r(X), {
204
- key: 1,
205
- class: "rvc-combobox-options"
206
- }, {
207
- default: g(() => [
208
- f.value && f.value.length < e.minLength ? (n(), c("div", re, [
209
- i("div", null, [
210
- i("em", null, "Minimal " + w(e.minLength) + " characters.", 1)
211
- ])
212
- ])) : !v.value && !u.value.length ? (n(), c("div", ce, [...o[5] || (o[5] = [
213
- i("div", null, " No results found. ", -1)
214
- ])])) : (n(!0), c(q, { key: 2 }, z(u.value, (l) => (n(), x(r(Y), {
215
- key: `option-${l[e.itemKey]}`,
216
- value: l,
217
- as: "template"
218
- }, {
219
- default: g(({ active: y }) => [
220
- i("li", {
221
- class: G([
222
- "rvc-combobox-option",
223
- { "rvc-combobox-option-hover": y },
224
- { "rvc-combobox-option-active": C(l[e.itemKey]) }
225
- ])
226
- }, [
227
- m(t.$slots, "option", {
228
- option: l,
229
- isActive: C
230
- }, () => [
231
- m(t.$slots, "optionPrefix", {
232
- option: l[e.itemKey],
233
- isActive: C
234
- }),
235
- i("span", de, w(e.optionText(l)), 1),
236
- m(t.$slots, "optionSuffix", {
237
- option: l[e.itemKey],
238
- isActive: C
239
- })
240
- ])
241
- ], 2)
242
- ]),
243
- _: 2
244
- }, 1032, ["value"]))), 128))
245
- ]),
246
- _: 3
247
- })) : p("", !0)
248
- ])
249
- ]),
250
- _: 3
251
- }, 16, ["modelValue", "multiple", "class"]));
252
- }
253
- });
254
- export {
255
- he as _
256
- };
@@ -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
- };