@robuust-digital/vue-components 2.2.1 → 2.3.1

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 (31) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/_shared/{ButtonBase.vue_vue_type_script_setup_true_lang-DeflHqux.js → ButtonBase.vue_vue_type_script_setup_true_lang-BLm8QzEC.js} +23 -23
  3. package/dist/_shared/{ChevronDownIcon-DaaXfD3C.js → ChevronDownIcon-CcE_K1lg.js} +12 -12
  4. package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-CxRv55TC.js +256 -0
  5. package/dist/_shared/{Drawer.vue_vue_type_script_setup_true_lang-CD5914Fk.js → Drawer.vue_vue_type_script_setup_true_lang-XMND_Yzl.js} +62 -62
  6. package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-BtkiBqxy.js +115 -0
  7. package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-C_1WSzbH.js +74 -0
  8. package/dist/_shared/{Modal.vue_vue_type_script_setup_true_lang-CoHkAJj3.js → Modal.vue_vue_type_script_setup_true_lang-2AljJgxw.js} +68 -71
  9. package/dist/_shared/{RichTextEditor.vue_vue_type_script_setup_true_lang-CIVhqJtE.js → RichTextEditor.vue_vue_type_script_setup_true_lang-BLs_S_-D.js} +102 -133
  10. package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-DMUJ5Emt.js +670 -0
  11. package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-BfMkJm5T.js +78 -0
  12. package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-CKp1wzE2.js +95 -0
  13. package/dist/combobox/index.js +1 -1
  14. package/dist/core/checkbox.css +10 -5
  15. package/dist/core/index.js +4 -4
  16. package/dist/core/radio.css +11 -6
  17. package/dist/core.d.ts +2 -2
  18. package/dist/dialogs/index.js +2 -2
  19. package/dist/dropdown/index.js +1 -1
  20. package/dist/index/index.js +11 -11
  21. package/dist/index.d.ts +2 -2
  22. package/dist/rich-text-editor/index.js +1 -1
  23. package/dist/toast/index.js +1 -1
  24. package/dist/tooltip/index.js +1 -1
  25. package/package.json +19 -19
  26. package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-CP3x2DUA.js +0 -266
  27. package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-CmYj-7WQ.js +0 -115
  28. package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-BhJpG-Fw.js +0 -75
  29. package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-DnzOq9GZ.js +0 -679
  30. package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-Be3i_0zE.js +0 -78
  31. package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-CoydN9sS.js +0 -96
@@ -1,266 +0,0 @@
1
- import { createElementBlock as c, openBlock as n, createElementVNode as r, defineComponent as U, ref as g, computed as P, createBlock as C, unref as d, mergeProps as D, withCtx as V, createCommentVNode as k, renderSlot as v, createVNode as f, resolveDynamicComponent as q, withModifiers as z, Fragment as N, renderList as M, createTextVNode as G, toDisplayString as A, normalizeClass as H } from "vue";
2
- import { useDebounceFn as J } from "@vueuse/core";
3
- import { Combobox as Q, ComboboxInput as W, ComboboxButton as X, ComboboxOptions as Y, ComboboxOption as _ } from "@headlessui/vue";
4
- import { r as ee, _ as oe } from "./ChevronDownIcon-DaaXfD3C.js";
5
- import { S as le } from "./icon-spinner-CP0VP_YM.js";
6
- function te(s, L) {
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
- r("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 ae(s, L) {
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
- r("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 ne = { class: "rvc-combobox-container" }, se = { class: "rvc-combobox-wrapper" }, re = { class: "rvc-combobox-field" }, ie = {
33
- key: 0,
34
- class: "rvc-combobox-chips"
35
- }, ue = ["onClick"], de = {
36
- key: 0,
37
- class: "rvc-combobox-content"
38
- }, ce = {
39
- key: 1,
40
- class: "rvc-combobox-content"
41
- }, me = { class: "rvc-combobox-option-text" }, he = /* @__PURE__ */ U({
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: (s) => s },
52
- displayValue: { type: Function, default: (s) => (s == null ? void 0 : s.name) || null },
53
- optionText: { type: Function, default: (s) => (s == null ? void 0 : s.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(s, { emit: L }) {
71
- const t = s, m = L, i = g([]), b = g(!1), y = g(null), B = g(!0), T = g(null), u = P({
72
- get: () => t.multiple ? t.modelValue || [] : t.modelValue,
73
- set: (e) => m("update:modelValue", e)
74
- }), I = P({
75
- get: () => t.requestParams,
76
- set: (e) => m("update:requestParams", e)
77
- }), R = (e) => t.displayValue(e) || "", E = (e) => new Promise((l) => {
78
- setTimeout(l, e);
79
- }), S = (e, l) => {
80
- i.value = [], m("combobox:error", e), m("combobox:noResults", l);
81
- }, x = async (e) => {
82
- if (!t.onSearch) return;
83
- if (t.searchOnly && !e) {
84
- i.value = [];
85
- return;
86
- }
87
- if (e && e.length < t.minLength) {
88
- i.value = [];
89
- return;
90
- }
91
- T.value && t.onCancel && t.onCancel(T.value), b.value = !0;
92
- const l = Date.now();
93
- try {
94
- const { data: a, error: h, cancel: w } = await t.onSearch(e, I.value, t.endpoint);
95
- T.value = w || null;
96
- const p = t.responseData(a), o = Date.now() - l;
97
- !p.length && h && S(h, e), o < t.minLoadingTime && await E(t.minLoadingTime - o), p != null && p.length ? i.value = p : (i.value = [], m("combobox:noResults", e));
98
- } catch (a) {
99
- a != null && a.cancelled || S(a, e);
100
- } finally {
101
- b.value = !1;
102
- }
103
- }, Z = J(x, t.debounce), K = (e) => {
104
- B.value ? (B.value = !1, x(e)) : Z(e);
105
- }, j = (e) => {
106
- var a;
107
- ((a = e.target.value) == null ? void 0 : a.length) === 0 && (i.value = [], m("update:modelValue", null)), t.manualInput && m("update:modelValue", I.value.query);
108
- }, $ = (e) => {
109
- var l;
110
- return t.multiple ? u.value.some((a) => a[t.itemKey] === e) : ((l = u.value) == null ? void 0 : l[t.itemKey]) === e;
111
- }, F = (e) => {
112
- u.value = u.value.filter((l) => l[t.itemKey] !== e[t.itemKey]);
113
- };
114
- return (e, l) => (n(), C(d(Q), D({
115
- modelValue: u.value,
116
- "onUpdate:modelValue": l[4] || (l[4] = (a) => u.value = a),
117
- as: "div"
118
- }, e.rootAttrs, {
119
- multiple: e.multiple,
120
- class: [
121
- "rvc-combobox",
122
- `rvc-combobox-${e.size}`,
123
- e.rootClass
124
- ]
125
- }), {
126
- default: V(() => {
127
- var a, h, w, p;
128
- return [
129
- r("div", ne, [
130
- r("div", se, [
131
- r("div", re, [
132
- e.prefixIcon ? v(e.$slots, "prefixIcon", {
133
- key: 0,
134
- icon: e.prefixIcon
135
- }, () => [
136
- (n(), C(q(e.prefixIcon), { "aria-hidden": "true" }))
137
- ]) : k("", !0),
138
- f(d(W), D(e.$attrs, {
139
- id: e.id,
140
- "display-value": R,
141
- disabled: e.disabled,
142
- autocomplete: "off",
143
- onChange: l[0] || (l[0] = (o) => K(o.target.value)),
144
- onSearch: j,
145
- onInput: l[1] || (l[1] = (o) => y.value = o.target.value)
146
- }), null, 16, ["id", "disabled"]),
147
- f(d(X), {
148
- disabled: e.disabled,
149
- class: "rvc-combobox-button",
150
- onClick: l[2] || (l[2] = (o) => K(y.value || null))
151
- }, {
152
- default: V(() => {
153
- var o;
154
- return [
155
- b.value ? v(e.$slots, "spinner", {
156
- key: 0,
157
- spinning: b.value
158
- }, () => [
159
- f(d(le), { class: "rvc-combobox-spinner" })
160
- ]) : (!e.searchOnly || (o = i.value) != null && o.length) && !b.value ? v(e.$slots, "icon", {
161
- key: 1,
162
- icon: e.icon
163
- }, () => [
164
- (n(), C(q(e.icon ?? d(ee)), { "aria-hidden": "true" }))
165
- ]) : k("", !0)
166
- ];
167
- }),
168
- _: 3
169
- }, 8, ["disabled"])
170
- ]),
171
- e.clearable && (Array.isArray(e.modelValue) ? (a = e.modelValue) != null && a.length : (h = e.modelValue) != null && h.id) ? (n(), c("button", {
172
- key: 0,
173
- type: "button",
174
- "aria-label": "Clear selection",
175
- class: "rvc-combobox-clear",
176
- onClick: l[3] || (l[3] = z((o) => m("update:modelValue", e.multiple ? [] : null), ["prevent"]))
177
- }, [
178
- v(e.$slots, "clear", {}, () => [
179
- f(d(ae))
180
- ])
181
- ])) : k("", !0)
182
- ]),
183
- e.multiple && Array.isArray(u.value) && ((w = u.value) != null && w.length) ? (n(), c("ul", ie, [
184
- (n(!0), c(N, null, M(u.value, (o) => (n(), c("li", {
185
- key: `${e.id}-selected-option-${o[e.itemKey]}`
186
- }, [
187
- v(e.$slots, "chip", {
188
- optionText: e.optionText(o),
189
- option: o,
190
- removeOption: F
191
- }, () => [
192
- f(oe, {
193
- color: "gray",
194
- class: "rvc-combobox-chip",
195
- size: e.size
196
- }, {
197
- default: V(() => [
198
- G(A(e.optionText(o)) + " ", 1),
199
- r("button", {
200
- type: "button",
201
- "aria-label": "Remove option",
202
- onClick: z((O) => F(o), ["prevent"])
203
- }, [
204
- f(d(te))
205
- ], 8, ue)
206
- ]),
207
- _: 2
208
- }, 1032, ["size"])
209
- ])
210
- ]))), 128))
211
- ])) : k("", !0),
212
- (!e.searchOnly || (p = y.value) != null && p.length) && (!b.value || i.value.length) ? (n(), C(d(Y), {
213
- key: 1,
214
- class: "rvc-combobox-options"
215
- }, {
216
- default: V(() => [
217
- y.value && y.value.length < e.minLength ? (n(), c("div", de, [
218
- r("div", null, [
219
- r("em", null, "Minimal " + A(e.minLength) + " characters.", 1)
220
- ])
221
- ])) : !b.value && !i.value.length ? (n(), c("div", ce, [...l[5] || (l[5] = [
222
- r("div", null, " No results found. ", -1)
223
- ])])) : (n(!0), c(N, { key: 2 }, M(i.value, (o) => (n(), C(d(_), {
224
- key: `option-${o[e.itemKey]}`,
225
- value: o,
226
- as: "template"
227
- }, {
228
- default: V(({ active: O }) => [
229
- r("li", {
230
- class: H([
231
- "rvc-combobox-option",
232
- { "rvc-combobox-option-hover": O },
233
- { "rvc-combobox-option-active": $(o[e.itemKey]) }
234
- ])
235
- }, [
236
- v(e.$slots, "option", {
237
- option: o,
238
- isActive: $
239
- }, () => [
240
- v(e.$slots, "optionPrefix", {
241
- option: o[e.itemKey],
242
- isActive: $
243
- }),
244
- r("span", me, A(e.optionText(o)), 1),
245
- v(e.$slots, "optionSuffix", {
246
- option: o[e.itemKey],
247
- isActive: $
248
- })
249
- ])
250
- ], 2)
251
- ]),
252
- _: 2
253
- }, 1032, ["value"]))), 128))
254
- ]),
255
- _: 3
256
- })) : k("", !0)
257
- ])
258
- ];
259
- }),
260
- _: 3
261
- }, 16, ["modelValue", "multiple", "class"]));
262
- }
263
- });
264
- export {
265
- he as _
266
- };
@@ -1,115 +0,0 @@
1
- import { createElementBlock as v, openBlock as n, createElementVNode as _, defineComponent as B, createBlock as a, unref as t, normalizeClass as c, withCtx as r, renderSlot as s, createVNode as l, mergeProps as u, Transition as M, Fragment as $, renderList as y, resolveDynamicComponent as f, createCommentVNode as A, createTextVNode as L, toDisplayString as N } from "vue";
2
- import { Menu as V, MenuButton as p, MenuItems as D, MenuItem as m } from "@headlessui/vue";
3
- import { _ as I } from "./ButtonBase.vue_vue_type_script_setup_true_lang-DeflHqux.js";
4
- function Z(w, i) {
5
- return n(), v("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
- _("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__ */ B({
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
- rootClass: { default: "" }
24
- },
25
- emits: ["dropdown:click"],
26
- setup(w, { emit: i }) {
27
- const b = i, g = (e) => {
28
- const {
29
- as: h,
30
- bindAs: o,
31
- event: d,
32
- icon: C,
33
- name: E,
34
- ...k
35
- } = e;
36
- return k;
37
- };
38
- return (e, h) => (n(), a(t(V), {
39
- as: "div",
40
- class: c(["rvc-dropdown", e.rootClass])
41
- }, {
42
- default: r(() => [
43
- s(e.$slots, "button", {
44
- label: e.label,
45
- button: t(p)
46
- }, () => [
47
- l(t(p), u({
48
- as: I,
49
- label: e.label,
50
- color: "light",
51
- icon: t(Z),
52
- "icon-left": e.alignLeft
53
- }, e.$attrs), null, 16, ["label", "icon", "icon-left"])
54
- ]),
55
- l(M, {
56
- "enter-active-class": "rvc-dropdown-transition-enter",
57
- "enter-from-class": "rvc-dropdown-transition-enter-from",
58
- "enter-to-class": "rvc-dropdown-transition-enter-to",
59
- "leave-active-class": "rvc-dropdown-transition-leave",
60
- "leave-from-class": "rvc-dropdown-transition-leave-from",
61
- "leave-to-class": "rvc-dropdown-transition-leave-to"
62
- }, {
63
- default: r(() => [
64
- l(t(D), {
65
- class: c([
66
- "rvc-dropdown-items",
67
- {
68
- "rvc-dropdown-items-left": e.alignLeft,
69
- "rvc-dropdown-items-full": e.fullWidth
70
- }
71
- ])
72
- }, {
73
- default: r(() => [
74
- s(e.$slots, "items", {
75
- items: e.items,
76
- menuItem: t(m)
77
- }, () => [
78
- (n(!0), v($, null, y(e.items, (o, d) => (n(), a(t(m), {
79
- key: `${d}-dropdown-item`,
80
- as: "template"
81
- }, {
82
- default: r(() => [
83
- s(e.$slots, "item", { item: o }, () => [
84
- (n(), a(f(o.as ? o.as : "button"), u({ class: "rvc-dropdown-item" }, { ref_for: !0 }, g(o), {
85
- as: o.bindAs ? o.bindAs : void 0,
86
- onClick: (C) => (b("dropdown:click", o), o.event ? o.event() : null)
87
- }), {
88
- default: r(() => [
89
- o.icon ? (n(), a(f(o.icon), {
90
- key: 0,
91
- class: "rvc-dropdown-item-icon"
92
- })) : A("", !0),
93
- L(" " + N(o.name), 1)
94
- ]),
95
- _: 2
96
- }, 1040, ["as", "onClick"]))
97
- ])
98
- ]),
99
- _: 2
100
- }, 1024))), 128))
101
- ])
102
- ]),
103
- _: 3
104
- }, 8, ["class"])
105
- ]),
106
- _: 3
107
- })
108
- ]),
109
- _: 3
110
- }, 8, ["class"]));
111
- }
112
- });
113
- export {
114
- z as _
115
- };
@@ -1,75 +0,0 @@
1
- import { computed as v, getCurrentInstance as I, defineComponent as g, useSlots as B, ref as C, createElementBlock as n, openBlock as o, normalizeClass as V, createCommentVNode as p, renderSlot as s, unref as r, createBlock as f, resolveDynamicComponent as m, normalizeProps as b, guardReactiveProps as z, withDirectives as F, mergeProps as y, vModelDynamic as M } from "vue";
2
- const O = () => ({ hasModelBinding: v(() => {
3
- var i;
4
- const t = I();
5
- return !!((i = t == null ? void 0 : t.vnode) != null && i.props && Object.prototype.hasOwnProperty.call(t.vnode.props, "onUpdate:modelValue"));
6
- }) }), P = {
7
- key: 0,
8
- class: "rvc-input-prefix"
9
- }, j = ["type"], D = ["type"], w = {
10
- key: 1,
11
- class: "rvc-input-suffix"
12
- }, U = /* @__PURE__ */ g({
13
- inheritAttrs: !1,
14
- __name: "FormInput",
15
- props: {
16
- modelValue: { default: void 0 },
17
- rootClass: { default: "" },
18
- prefixIcon: { type: [Function, Object, null], default: null },
19
- icon: { type: [Function, Object, null], default: null },
20
- size: { default: "base" }
21
- },
22
- emits: ["update:modelValue"],
23
- setup(u, { emit: t }) {
24
- const i = u, h = t, { hasModelBinding: k } = O(), l = B(), a = C(null), d = v({
25
- get: () => i.modelValue,
26
- set: (e) => h("update:modelValue", e)
27
- });
28
- return (e, c) => (o(), n("div", {
29
- class: V([
30
- "rvc-input",
31
- `rvc-input-${e.size}`,
32
- e.rootClass
33
- ])
34
- }, [
35
- r(l).prefix || r(l).prefixIcon || e.prefixIcon ? (o(), n("span", P, [
36
- s(e.$slots, "prefix", {}, () => [
37
- s(e.$slots, "prefixIcon", { icon: e.prefixIcon }, () => [
38
- e.prefixIcon ? (o(), f(m(e.prefixIcon), {
39
- key: 0,
40
- "aria-hidden": "true"
41
- })) : p("", !0)
42
- ])
43
- ])
44
- ])) : p("", !0),
45
- s(e.$slots, "input", b(z(e.$attrs)), () => [
46
- r(k) ? F((o(), n("input", y({ key: 0 }, e.$attrs, {
47
- ref_key: "input",
48
- ref: a,
49
- "onUpdate:modelValue": c[0] || (c[0] = ($) => d.value = $),
50
- type: e.$attrs.type || "text"
51
- }), null, 16, j)), [
52
- [M, d.value]
53
- ]) : (o(), n("input", y({ key: 1 }, e.$attrs, {
54
- ref_key: "input",
55
- ref: a,
56
- type: e.$attrs.type || "text"
57
- }), null, 16, D))
58
- ]),
59
- r(l).suffix || r(l).icon || e.icon ? (o(), n("span", w, [
60
- s(e.$slots, "suffix", {}, () => [
61
- s(e.$slots, "icon", { icon: e.icon }, () => [
62
- e.icon ? (o(), f(m(e.icon), {
63
- key: 0,
64
- "aria-hidden": "true"
65
- })) : p("", !0)
66
- ])
67
- ])
68
- ])) : p("", !0)
69
- ], 2));
70
- }
71
- });
72
- export {
73
- U as _,
74
- O as u
75
- };