@robuust-digital/vue-components 2.1.0 → 2.2.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.
- package/CHANGELOG.md +6 -0
- package/dist/_shared/ButtonBase.vue_vue_type_script_setup_true_lang-DeflHqux.js +60 -0
- package/dist/_shared/ChevronDownIcon-DaaXfD3C.js +41 -0
- package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-CP3x2DUA.js +266 -0
- package/dist/_shared/Drawer.vue_vue_type_script_setup_true_lang-CD5914Fk.js +185 -0
- package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-CmYj-7WQ.js +115 -0
- package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-BhJpG-Fw.js +75 -0
- package/dist/_shared/Lightswitch.vue_vue_type_script_setup_true_lang-DX23lEFd.js +43 -0
- package/dist/_shared/Modal.vue_vue_type_script_setup_true_lang-CoHkAJj3.js +186 -0
- package/dist/_shared/RichTextEditor.vue_vue_type_script_setup_true_lang-CIVhqJtE.js +274 -0
- package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-BgOTdYXd.js +676 -0
- package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-Be3i_0zE.js +78 -0
- package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-CoydN9sS.js +96 -0
- package/dist/_shared/{icon-spinner-CmxIOqaK.js → icon-spinner-CP0VP_YM.js} +2 -2
- package/dist/combobox/index.js +3 -347
- package/dist/combobox.d.ts +132 -0
- package/dist/core/index.js +17 -826
- package/dist/core.d.ts +669 -0
- package/dist/dialogs/index.js +4 -216
- package/dist/dialogs.d.ts +226 -0
- package/dist/dropdown/index.js +3 -131
- package/dist/dropdown.d.ts +145 -0
- package/dist/index/index.js +35 -0
- package/dist/index.d.ts +1343 -0
- package/dist/lightswitch/index.js +3 -47
- package/dist/lightswitch.d.ts +39 -0
- package/dist/rich-text-editor/index.js +3 -261
- package/dist/rich-text-editor.d.ts +89 -0
- package/dist/toast/index.js +3 -99
- package/dist/toast.d.ts +66 -0
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip.d.ts +61 -0
- package/package.json +69 -38
- package/dist/_shared/ButtonBase-DfkwHIhN.js +0 -87
- package/dist/_shared/ChevronDownIcon-z-5U4fIb.js +0 -55
- package/dist/_shared/FormInput-B-SQTZTA.js +0 -92
- package/dist/_shared/Modal-Bw2sID1x.js +0 -213
- package/dist/_shared/Tooltip-B93ZF7IF.js +0 -126
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as d, onMounted as y, watch as h, createBlock as a, openBlock as e, unref as i, withCtx as c, resolveDynamicComponent as m, normalizeClass as w, renderSlot as s, createElementVNode as C, createCommentVNode as n, createElementBlock as u, toDisplayString as $, createVNode as k } from "vue";
|
|
2
|
+
import { TransitionRoot as b } from "@headlessui/vue";
|
|
3
|
+
import { r as B } from "./XMarkIcon-90mcPzBs.js";
|
|
4
|
+
const T = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "rvc-toast-title"
|
|
7
|
+
}, S = /* @__PURE__ */ d({
|
|
8
|
+
__name: "Toast",
|
|
9
|
+
props: {
|
|
10
|
+
show: { type: Boolean, default: !1 },
|
|
11
|
+
as: { default: "div" },
|
|
12
|
+
title: { default: "" },
|
|
13
|
+
icon: { type: [Function, Object, null], default: null },
|
|
14
|
+
timeout: { type: [Number, Boolean], default: 5e3 },
|
|
15
|
+
position: { default: "bottom" },
|
|
16
|
+
type: { default: "info" },
|
|
17
|
+
showClose: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["toast:close"],
|
|
20
|
+
setup(f, { emit: p }) {
|
|
21
|
+
const o = f, v = p, l = () => {
|
|
22
|
+
o.timeout && o.show && setTimeout(() => {
|
|
23
|
+
v("toast:close");
|
|
24
|
+
}, o.timeout);
|
|
25
|
+
};
|
|
26
|
+
return y(() => {
|
|
27
|
+
l();
|
|
28
|
+
}), h(() => o.show, (t) => {
|
|
29
|
+
t && l();
|
|
30
|
+
}), (t, r) => (e(), a(i(b), {
|
|
31
|
+
show: t.show,
|
|
32
|
+
as: "template",
|
|
33
|
+
enter: "rvc-toast-transition-enter",
|
|
34
|
+
"enter-from": "rvc-toast-transition-enter-from",
|
|
35
|
+
"enter-to": "rvc-toast-transition-enter-to",
|
|
36
|
+
leave: "rvc-toast-transition-leave",
|
|
37
|
+
"leave-from": "rvc-toast-transition-leave-from",
|
|
38
|
+
"leave-to": "rvc-toast-transition-leave-to"
|
|
39
|
+
}, {
|
|
40
|
+
default: c(() => [
|
|
41
|
+
(e(), a(m(t.as), {
|
|
42
|
+
class: w(["rvc-toast", `rvc-toast-${t.position}`, `rvc-toast-${t.type}`, { "rvc-toast-open": t.show }])
|
|
43
|
+
}, {
|
|
44
|
+
default: c(() => [
|
|
45
|
+
s(t.$slots, "icon", {}, () => [
|
|
46
|
+
t.icon ? (e(), a(m(t.icon), {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "rvc-toast-icon"
|
|
49
|
+
})) : n("", !0)
|
|
50
|
+
]),
|
|
51
|
+
C("div", null, [
|
|
52
|
+
s(t.$slots, "title", {}, () => [
|
|
53
|
+
t.title ? (e(), u("span", T, $(t.title), 1)) : n("", !0)
|
|
54
|
+
]),
|
|
55
|
+
s(t.$slots, "default")
|
|
56
|
+
]),
|
|
57
|
+
s(t.$slots, "close", {}, () => [
|
|
58
|
+
t.showClose ? (e(), u("button", {
|
|
59
|
+
key: 0,
|
|
60
|
+
type: "button",
|
|
61
|
+
class: "rvc-toast-close",
|
|
62
|
+
"aria-label": "Close",
|
|
63
|
+
onClick: r[0] || (r[0] = (N) => t.$emit("toast:close"))
|
|
64
|
+
}, [
|
|
65
|
+
k(i(B))
|
|
66
|
+
])) : n("", !0)
|
|
67
|
+
])
|
|
68
|
+
]),
|
|
69
|
+
_: 3
|
|
70
|
+
}, 8, ["class"]))
|
|
71
|
+
]),
|
|
72
|
+
_: 3
|
|
73
|
+
}, 8, ["show"]));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
S as _
|
|
78
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { defineComponent as R, shallowRef as n, createElementBlock as f, openBlock as d, renderSlot as u, createElementVNode as w, normalizeStyle as k, normalizeClass as z, unref as h, createCommentVNode as S, mergeProps as x } from "vue";
|
|
2
|
+
import { useFloating as C, autoUpdate as W, autoPlacement as M, offset as P, shift as _, arrow as A, size as B } from "@floating-ui/vue";
|
|
3
|
+
const E = ["innerHTML"], L = /* @__PURE__ */ R({
|
|
4
|
+
__name: "Tooltip",
|
|
5
|
+
props: {
|
|
6
|
+
content: {},
|
|
7
|
+
blur: { type: Boolean, default: !0 },
|
|
8
|
+
maxWidth: { default: null },
|
|
9
|
+
tooltipClass: { default: "" },
|
|
10
|
+
placement: { default: void 0 },
|
|
11
|
+
size: { default: "base" }
|
|
12
|
+
},
|
|
13
|
+
setup(v) {
|
|
14
|
+
const o = v, s = n(), a = n(), l = n(), {
|
|
15
|
+
floatingStyles: y,
|
|
16
|
+
middlewareData: g,
|
|
17
|
+
placement: i
|
|
18
|
+
} = C(s, a, {
|
|
19
|
+
middleware: [
|
|
20
|
+
...o.placement ? [] : [M()],
|
|
21
|
+
P(o.size === "sm" ? 7 : 10),
|
|
22
|
+
_({ crossAxis: !0, padding: 5 }),
|
|
23
|
+
A({ element: l }),
|
|
24
|
+
B({
|
|
25
|
+
apply({ availableWidth: e, availableHeight: t, elements: r }) {
|
|
26
|
+
Object.assign(r.floating.style, {
|
|
27
|
+
maxWidth: o.maxWidth ? `${Math.min(e, o.maxWidth) / 16}rem` : "",
|
|
28
|
+
maxHeight: `${t / 16}rem `
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
],
|
|
33
|
+
whileElementsMounted: W,
|
|
34
|
+
placement: o.placement
|
|
35
|
+
}), b = (e) => {
|
|
36
|
+
const t = {
|
|
37
|
+
top: 0,
|
|
38
|
+
bottom: 180,
|
|
39
|
+
left: -90,
|
|
40
|
+
right: 90
|
|
41
|
+
}, r = e.split("-")[0];
|
|
42
|
+
return r && t[r] || 0;
|
|
43
|
+
}, $ = (e) => {
|
|
44
|
+
var m, c;
|
|
45
|
+
const t = i.value.split("-")[0], p = t ? {
|
|
46
|
+
left: "right",
|
|
47
|
+
right: "left",
|
|
48
|
+
bottom: "top",
|
|
49
|
+
top: "bottom"
|
|
50
|
+
}[t] : "";
|
|
51
|
+
return {
|
|
52
|
+
style: {
|
|
53
|
+
left: (m = e.arrow) != null && m.x ? `${e.arrow.x}px` : "",
|
|
54
|
+
top: (c = e.arrow) != null && c.y ? `${e.arrow.y}px` : "",
|
|
55
|
+
bottom: "",
|
|
56
|
+
right: "",
|
|
57
|
+
...p ? { [p]: l.value ? `${l.value.offsetWidth * -1}px` : "" } : {},
|
|
58
|
+
transform: `rotate(${b(i.value)}deg)`
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
return (e, t) => (d(), f("div", {
|
|
63
|
+
ref_key: "wrapperRef",
|
|
64
|
+
ref: s,
|
|
65
|
+
class: "rvc-tooltip-wrapper"
|
|
66
|
+
}, [
|
|
67
|
+
u(e.$slots, "default"),
|
|
68
|
+
w("div", {
|
|
69
|
+
ref_key: "tooltipRef",
|
|
70
|
+
ref: a,
|
|
71
|
+
class: z([
|
|
72
|
+
"rvc-tooltip",
|
|
73
|
+
e.tooltipClass,
|
|
74
|
+
`rvc-tooltip-${e.size}`,
|
|
75
|
+
{ "rvc-tooltip-blur": e.blur }
|
|
76
|
+
]),
|
|
77
|
+
style: k(h(y))
|
|
78
|
+
}, [
|
|
79
|
+
u(e.$slots, "content", { content: e.content }, () => [
|
|
80
|
+
e.content ? (d(), f("div", {
|
|
81
|
+
key: 0,
|
|
82
|
+
innerHTML: e.content
|
|
83
|
+
}, null, 8, E)) : S("", !0)
|
|
84
|
+
]),
|
|
85
|
+
w("div", x({
|
|
86
|
+
ref_key: "arrowRef",
|
|
87
|
+
ref: l,
|
|
88
|
+
class: "rvc-tooltip-arrow"
|
|
89
|
+
}, $(h(g))), null, 16)
|
|
90
|
+
], 6)
|
|
91
|
+
], 512));
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
export {
|
|
95
|
+
L as _
|
|
96
|
+
};
|
|
@@ -5,7 +5,7 @@ const n = {
|
|
|
5
5
|
viewBox: "0 0 24 24"
|
|
6
6
|
};
|
|
7
7
|
function l(c, e) {
|
|
8
|
-
return t(), o("svg", n, e[0] || (e[0] = [
|
|
8
|
+
return t(), o("svg", n, [...e[0] || (e[0] = [
|
|
9
9
|
r("circle", {
|
|
10
10
|
cx: "12",
|
|
11
11
|
cy: "12",
|
|
@@ -18,7 +18,7 @@ function l(c, e) {
|
|
|
18
18
|
fill: "currentColor",
|
|
19
19
|
d: "M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z"
|
|
20
20
|
}, null, -1)
|
|
21
|
-
]));
|
|
21
|
+
])]);
|
|
22
22
|
}
|
|
23
23
|
const s = { render: l };
|
|
24
24
|
export {
|
package/dist/combobox/index.js
CHANGED
|
@@ -1,349 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useDebounceFn as G } from "@vueuse/core";
|
|
3
|
-
import { Combobox as H, ComboboxInput as J, ComboboxButton as Q, ComboboxOptions as W, ComboboxOption as X } from "@headlessui/vue";
|
|
4
|
-
import { r as Y, _ } from "../_shared/ChevronDownIcon-z-5U4fIb.js";
|
|
5
|
-
import { S as ee } from "../_shared/icon-spinner-CmxIOqaK.js";
|
|
6
|
-
function te(e, $) {
|
|
7
|
-
return a(), d("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 le(e, $) {
|
|
22
|
-
return a(), d("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 oe = { class: "rvc-combobox-container" }, ne = { class: "rvc-combobox-wrapper" }, ae = { class: "rvc-combobox-field" }, ie = {
|
|
33
|
-
key: 0,
|
|
34
|
-
class: "rvc-combobox-chips"
|
|
35
|
-
}, ue = ["onClick"], re = {
|
|
36
|
-
key: 0,
|
|
37
|
-
class: "rvc-combobox-content"
|
|
38
|
-
}, se = {
|
|
39
|
-
key: 1,
|
|
40
|
-
class: "rvc-combobox-content"
|
|
41
|
-
}, ce = { class: "rvc-combobox-option-text" }, ye = /* @__PURE__ */ Object.assign({
|
|
42
|
-
inheritAttrs: !1
|
|
43
|
-
}, {
|
|
44
|
-
__name: "Combobox",
|
|
45
|
-
props: {
|
|
46
|
-
id: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: !0
|
|
49
|
-
},
|
|
50
|
-
rootClass: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: ""
|
|
53
|
-
},
|
|
54
|
-
modelValue: {
|
|
55
|
-
type: [Number, String, Object, Array, null],
|
|
56
|
-
required: !1,
|
|
57
|
-
default: null
|
|
58
|
-
},
|
|
59
|
-
endpoint: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: void 0
|
|
62
|
-
},
|
|
63
|
-
requestParams: {
|
|
64
|
-
type: Object,
|
|
65
|
-
required: !1,
|
|
66
|
-
default: () => ({})
|
|
67
|
-
},
|
|
68
|
-
manualInput: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
required: !1,
|
|
71
|
-
default: !1
|
|
72
|
-
},
|
|
73
|
-
responseData: {
|
|
74
|
-
type: Function,
|
|
75
|
-
required: !1,
|
|
76
|
-
default: (e) => e
|
|
77
|
-
},
|
|
78
|
-
displayValue: {
|
|
79
|
-
type: Function,
|
|
80
|
-
required: !1,
|
|
81
|
-
default: (e) => (e == null ? void 0 : e.name) || null
|
|
82
|
-
},
|
|
83
|
-
optionText: {
|
|
84
|
-
type: Function,
|
|
85
|
-
required: !1,
|
|
86
|
-
default: (e) => (e == null ? void 0 : e.name) || null
|
|
87
|
-
},
|
|
88
|
-
disabled: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
required: !1,
|
|
91
|
-
default: !1
|
|
92
|
-
},
|
|
93
|
-
minLength: {
|
|
94
|
-
type: Number,
|
|
95
|
-
default: 2,
|
|
96
|
-
required: !1
|
|
97
|
-
},
|
|
98
|
-
itemKey: {
|
|
99
|
-
type: String,
|
|
100
|
-
required: !1,
|
|
101
|
-
default: "id"
|
|
102
|
-
},
|
|
103
|
-
clearable: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
required: !1
|
|
106
|
-
},
|
|
107
|
-
rootAttrs: {
|
|
108
|
-
type: Object,
|
|
109
|
-
default: () => {
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
multiple: {
|
|
113
|
-
type: Boolean
|
|
114
|
-
},
|
|
115
|
-
onSearch: {
|
|
116
|
-
type: Function,
|
|
117
|
-
default: () => null
|
|
118
|
-
},
|
|
119
|
-
searchOnly: {
|
|
120
|
-
type: Boolean
|
|
121
|
-
},
|
|
122
|
-
icon: {
|
|
123
|
-
type: [Object, Function],
|
|
124
|
-
default: null
|
|
125
|
-
},
|
|
126
|
-
prefixIcon: {
|
|
127
|
-
type: [Object, Function],
|
|
128
|
-
default: null
|
|
129
|
-
},
|
|
130
|
-
size: {
|
|
131
|
-
type: String,
|
|
132
|
-
default: "base",
|
|
133
|
-
validator: (e) => ["sm", "base"].includes(e)
|
|
134
|
-
},
|
|
135
|
-
debounce: {
|
|
136
|
-
type: Number,
|
|
137
|
-
default: 150
|
|
138
|
-
},
|
|
139
|
-
minLoadingTime: {
|
|
140
|
-
type: Number,
|
|
141
|
-
default: 0
|
|
142
|
-
},
|
|
143
|
-
onCancel: {
|
|
144
|
-
type: Function,
|
|
145
|
-
default: null
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
emits: ["update:modelValue", "update:requestParams", "combobox:noResults", "combobox:error"],
|
|
149
|
-
setup(e, { emit: $ }) {
|
|
150
|
-
const n = e, m = $, s = p([]), f = p(!1), k = p(null), L = p(!0), q = p(null), b = K({
|
|
151
|
-
get: () => n.multiple ? n.modelValue || [] : n.modelValue,
|
|
152
|
-
set: (t) => m("update:modelValue", t)
|
|
153
|
-
}), O = K({
|
|
154
|
-
get: () => n.requestParams,
|
|
155
|
-
set: (t) => m("update:requestParams", t)
|
|
156
|
-
}), D = (t) => new Promise((l) => {
|
|
157
|
-
setTimeout(l, t);
|
|
158
|
-
}), T = (t, l) => {
|
|
159
|
-
s.value = [], m("combobox:error", t), m("combobox:noResults", l);
|
|
160
|
-
}, A = async (t) => {
|
|
161
|
-
if (!n.onSearch) return;
|
|
162
|
-
if (n.searchOnly && !t) {
|
|
163
|
-
s.value = [];
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (t && t.length < n.minLength) {
|
|
167
|
-
s.value = [];
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
q.value && n.onCancel && n.onCancel(q.value), f.value = !0;
|
|
171
|
-
const l = Date.now();
|
|
172
|
-
try {
|
|
173
|
-
const { data: i, error: h, cancel: w } = await n.onSearch(t, O.value, n.endpoint);
|
|
174
|
-
q.value = w;
|
|
175
|
-
const o = n.responseData(i), u = Date.now() - l;
|
|
176
|
-
!o.length && h && T(h, t), u < n.minLoadingTime && await D(n.minLoadingTime - u), o != null && o.length ? s.value = o : (s.value = [], m("combobox:noResults", t));
|
|
177
|
-
} catch (i) {
|
|
178
|
-
i.cancelled || T(i, t);
|
|
179
|
-
} finally {
|
|
180
|
-
f.value = !1;
|
|
181
|
-
}
|
|
182
|
-
}, M = G(A, n.debounce), B = (t) => {
|
|
183
|
-
L.value ? (L.value = !1, A(t)) : M(t);
|
|
184
|
-
}, R = (t) => {
|
|
185
|
-
var l;
|
|
186
|
-
((l = t.target.value) == null ? void 0 : l.length) === 0 && (s.value = [], m("update:modelValue", null)), n.manualInput && m("update:modelValue", O.value.query);
|
|
187
|
-
}, V = (t) => {
|
|
188
|
-
var l;
|
|
189
|
-
return n.multiple ? b.value.some((i) => i[n.itemKey] === t) : ((l = b.value) == null ? void 0 : l[n.itemKey]) === t;
|
|
190
|
-
}, I = (t) => {
|
|
191
|
-
b.value = b.value.filter((l) => l[n.itemKey] !== t[n.itemKey]);
|
|
192
|
-
};
|
|
193
|
-
return (t, l) => (a(), g(c(H), F({
|
|
194
|
-
modelValue: b.value,
|
|
195
|
-
"onUpdate:modelValue": l[4] || (l[4] = (i) => b.value = i),
|
|
196
|
-
as: "div"
|
|
197
|
-
}, e.rootAttrs, {
|
|
198
|
-
multiple: e.multiple,
|
|
199
|
-
class: [
|
|
200
|
-
"rvc-combobox",
|
|
201
|
-
`rvc-combobox-${e.size}`,
|
|
202
|
-
e.rootClass
|
|
203
|
-
]
|
|
204
|
-
}), {
|
|
205
|
-
default: x(() => {
|
|
206
|
-
var i, h, w;
|
|
207
|
-
return [
|
|
208
|
-
r("div", oe, [
|
|
209
|
-
r("div", ne, [
|
|
210
|
-
r("div", ae, [
|
|
211
|
-
e.prefixIcon ? v(t.$slots, "prefixIcon", {
|
|
212
|
-
key: 0,
|
|
213
|
-
icon: e.prefixIcon
|
|
214
|
-
}, () => [
|
|
215
|
-
(a(), g(N(e.prefixIcon), { "aria-hidden": "true" }))
|
|
216
|
-
]) : C("", !0),
|
|
217
|
-
y(c(J), F(t.$attrs, {
|
|
218
|
-
id: e.id,
|
|
219
|
-
"display-value": e.displayValue,
|
|
220
|
-
disabled: e.disabled,
|
|
221
|
-
autocomplete: "off",
|
|
222
|
-
onChange: l[0] || (l[0] = (o) => B(o.target.value)),
|
|
223
|
-
onSearch: R,
|
|
224
|
-
onInput: l[1] || (l[1] = (o) => k.value = o.target.value)
|
|
225
|
-
}), null, 16, ["id", "display-value", "disabled"]),
|
|
226
|
-
y(c(Q), {
|
|
227
|
-
disabled: e.disabled,
|
|
228
|
-
class: "rvc-combobox-button",
|
|
229
|
-
onClick: l[2] || (l[2] = (o) => B(k.value || null))
|
|
230
|
-
}, {
|
|
231
|
-
default: x(() => {
|
|
232
|
-
var o;
|
|
233
|
-
return [
|
|
234
|
-
f.value ? v(t.$slots, "spinner", {
|
|
235
|
-
key: 0,
|
|
236
|
-
spinning: f.value
|
|
237
|
-
}, () => [
|
|
238
|
-
y(c(ee), { class: "rvc-combobox-spinner" })
|
|
239
|
-
]) : (!e.searchOnly || (o = s.value) != null && o.length) && !f.value ? v(t.$slots, "icon", {
|
|
240
|
-
key: 1,
|
|
241
|
-
icon: e.icon
|
|
242
|
-
}, () => [
|
|
243
|
-
(a(), g(N(e.icon ?? c(Y)), { "aria-hidden": "true" }))
|
|
244
|
-
]) : C("", !0)
|
|
245
|
-
];
|
|
246
|
-
}),
|
|
247
|
-
_: 3
|
|
248
|
-
}, 8, ["disabled"])
|
|
249
|
-
]),
|
|
250
|
-
e.clearable && ((i = e.modelValue) != null && i.length || (h = e.modelValue) != null && h.id) ? (a(), d("button", {
|
|
251
|
-
key: 0,
|
|
252
|
-
type: "button",
|
|
253
|
-
"aria-label": "Clear selection",
|
|
254
|
-
class: "rvc-combobox-clear",
|
|
255
|
-
onClick: l[3] || (l[3] = P((o) => m("update:modelValue", e.multiple ? [] : null), ["prevent"]))
|
|
256
|
-
}, [
|
|
257
|
-
v(t.$slots, "clear", {}, () => [
|
|
258
|
-
y(c(le))
|
|
259
|
-
])
|
|
260
|
-
])) : C("", !0)
|
|
261
|
-
]),
|
|
262
|
-
e.multiple && b.value.length ? (a(), d("ul", ie, [
|
|
263
|
-
(a(!0), d(j, null, z(b.value, (o) => (a(), d("li", {
|
|
264
|
-
key: `${e.id}-selected-option-${o[e.itemKey]}`
|
|
265
|
-
}, [
|
|
266
|
-
v(t.$slots, "chip", {
|
|
267
|
-
optionText: e.optionText(o),
|
|
268
|
-
option: o,
|
|
269
|
-
removeOption: I
|
|
270
|
-
}, () => [
|
|
271
|
-
y(_, {
|
|
272
|
-
color: "gray",
|
|
273
|
-
class: "rvc-combobox-chip",
|
|
274
|
-
size: e.size
|
|
275
|
-
}, {
|
|
276
|
-
default: x(() => [
|
|
277
|
-
Z(S(e.optionText(o)) + " ", 1),
|
|
278
|
-
r("button", {
|
|
279
|
-
type: "button",
|
|
280
|
-
"aria-label": "Remove option",
|
|
281
|
-
onClick: P((u) => I(o), ["prevent"])
|
|
282
|
-
}, [
|
|
283
|
-
y(c(te))
|
|
284
|
-
], 8, ue)
|
|
285
|
-
]),
|
|
286
|
-
_: 2
|
|
287
|
-
}, 1032, ["size"])
|
|
288
|
-
])
|
|
289
|
-
]))), 128))
|
|
290
|
-
])) : C("", !0),
|
|
291
|
-
(!e.searchOnly || (w = k.value) != null && w.length) && (!f.value || s.value.length) ? (a(), g(c(W), {
|
|
292
|
-
key: 1,
|
|
293
|
-
class: "rvc-combobox-options"
|
|
294
|
-
}, {
|
|
295
|
-
default: x(() => {
|
|
296
|
-
var o;
|
|
297
|
-
return [
|
|
298
|
-
((o = k.value) == null ? void 0 : o.length) < e.minLength ? (a(), d("div", re, [
|
|
299
|
-
r("div", null, [
|
|
300
|
-
r("em", null, "Minimal " + S(e.minLength) + " characters.", 1)
|
|
301
|
-
])
|
|
302
|
-
])) : !f.value && !s.value.length ? (a(), d("div", se, l[5] || (l[5] = [
|
|
303
|
-
r("div", null, " No results found. ", -1)
|
|
304
|
-
]))) : (a(!0), d(j, { key: 2 }, z(s.value, (u) => (a(), g(c(X), {
|
|
305
|
-
key: u[e.itemKey],
|
|
306
|
-
value: u,
|
|
307
|
-
as: "template"
|
|
308
|
-
}, {
|
|
309
|
-
default: x(({ active: E }) => [
|
|
310
|
-
r("li", {
|
|
311
|
-
class: U([
|
|
312
|
-
"rvc-combobox-option",
|
|
313
|
-
{ "rvc-combobox-option-hover": E },
|
|
314
|
-
{ "rvc-combobox-option-active": V(u[e.itemKey]) }
|
|
315
|
-
])
|
|
316
|
-
}, [
|
|
317
|
-
v(t.$slots, "option", {
|
|
318
|
-
option: u,
|
|
319
|
-
isActive: V
|
|
320
|
-
}, () => [
|
|
321
|
-
v(t.$slots, "optionPrefix", {
|
|
322
|
-
option: u[e.itemKey],
|
|
323
|
-
isActive: V
|
|
324
|
-
}),
|
|
325
|
-
r("span", ce, S(e.optionText(u)), 1),
|
|
326
|
-
v(t.$slots, "optionSuffix", {
|
|
327
|
-
option: u[e.itemKey],
|
|
328
|
-
isActive: V
|
|
329
|
-
})
|
|
330
|
-
])
|
|
331
|
-
], 2)
|
|
332
|
-
]),
|
|
333
|
-
_: 2
|
|
334
|
-
}, 1032, ["value"]))), 128))
|
|
335
|
-
];
|
|
336
|
-
}),
|
|
337
|
-
_: 3
|
|
338
|
-
})) : C("", !0)
|
|
339
|
-
])
|
|
340
|
-
];
|
|
341
|
-
}),
|
|
342
|
-
_: 3
|
|
343
|
-
}, 16, ["modelValue", "multiple", "class"]));
|
|
344
|
-
}
|
|
345
|
-
});
|
|
1
|
+
import { _ as a } from "../_shared/Combobox.vue_vue_type_script_setup_true_lang-CP3x2DUA.js";
|
|
346
2
|
export {
|
|
347
|
-
|
|
348
|
-
|
|
3
|
+
a as Combobox,
|
|
4
|
+
a as default
|
|
349
5
|
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
2
|
+
import { ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { DefineComponent } from 'vue';
|
|
4
|
+
import { FunctionalComponent } from 'vue';
|
|
5
|
+
import { HTMLAttributes } from 'vue';
|
|
6
|
+
import { PublicProps } from 'vue';
|
|
7
|
+
import { SVGAttributes } from 'vue';
|
|
8
|
+
import { VNodeProps } from 'vue';
|
|
9
|
+
|
|
10
|
+
declare const __VLS_component: DefineComponent<ComboboxProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
11
|
+
"update:modelValue": (value: ComboboxModelValue) => any;
|
|
12
|
+
"update:requestParams": (value: Record<string, unknown>) => any;
|
|
13
|
+
"combobox:noResults": (value: string | null) => any;
|
|
14
|
+
"combobox:error": (error: unknown) => any;
|
|
15
|
+
}, string, PublicProps, Readonly<ComboboxProps> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: ComboboxModelValue) => any) | undefined;
|
|
17
|
+
"onUpdate:requestParams"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
18
|
+
"onCombobox:noResults"?: ((value: string | null) => any) | undefined;
|
|
19
|
+
"onCombobox:error"?: ((error: unknown) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
icon: Icon | null;
|
|
22
|
+
size: ComboboxSize;
|
|
23
|
+
modelValue: ComboboxModelValue;
|
|
24
|
+
rootClass: string;
|
|
25
|
+
prefixIcon: Icon | null;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
endpoint: string;
|
|
28
|
+
requestParams: Record<string, unknown>;
|
|
29
|
+
manualInput: boolean;
|
|
30
|
+
responseData: (data: unknown) => unknown[];
|
|
31
|
+
displayValue: (item: unknown) => string | null;
|
|
32
|
+
optionText: (option: unknown) => string | null;
|
|
33
|
+
minLength: number;
|
|
34
|
+
itemKey: string;
|
|
35
|
+
clearable: boolean;
|
|
36
|
+
rootAttrs: Record<string, unknown>;
|
|
37
|
+
multiple: boolean;
|
|
38
|
+
onSearch: (value: string | null, params: Record<string, unknown>, endpoint?: string) => Promise<{
|
|
39
|
+
data: unknown;
|
|
40
|
+
error?: unknown;
|
|
41
|
+
cancel?: () => void;
|
|
42
|
+
}>;
|
|
43
|
+
searchOnly: boolean;
|
|
44
|
+
debounce: number;
|
|
45
|
+
minLoadingTime: number;
|
|
46
|
+
onCancel: (cancelToken: (() => void) | null) => void;
|
|
47
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
|
|
49
|
+
declare function __VLS_template(): {
|
|
50
|
+
attrs: Partial<{}>;
|
|
51
|
+
slots: {
|
|
52
|
+
prefixIcon?(_: {
|
|
53
|
+
icon: Icon;
|
|
54
|
+
}): any;
|
|
55
|
+
spinner?(_: {
|
|
56
|
+
spinning: true;
|
|
57
|
+
}): any;
|
|
58
|
+
icon?(_: {
|
|
59
|
+
icon: Icon | null;
|
|
60
|
+
}): any;
|
|
61
|
+
clear?(_: {}): any;
|
|
62
|
+
chip?(_: {
|
|
63
|
+
optionText: string | null;
|
|
64
|
+
option: any;
|
|
65
|
+
removeOption: (option: Record<string, unknown>) => void;
|
|
66
|
+
}): any;
|
|
67
|
+
option?(_: {
|
|
68
|
+
option: unknown;
|
|
69
|
+
isActive: (value: number | string) => boolean;
|
|
70
|
+
}): any;
|
|
71
|
+
optionPrefix?(_: {
|
|
72
|
+
option: unknown;
|
|
73
|
+
isActive: (value: number | string) => boolean;
|
|
74
|
+
}): any;
|
|
75
|
+
optionSuffix?(_: {
|
|
76
|
+
option: unknown;
|
|
77
|
+
isActive: (value: number | string) => boolean;
|
|
78
|
+
}): any;
|
|
79
|
+
};
|
|
80
|
+
refs: {};
|
|
81
|
+
rootEl: any;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
85
|
+
|
|
86
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
87
|
+
new (): {
|
|
88
|
+
$slots: S;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
declare type ComboboxModelValue = object | Array<unknown> | null;
|
|
93
|
+
|
|
94
|
+
declare interface ComboboxProps {
|
|
95
|
+
id: string;
|
|
96
|
+
rootClass?: string;
|
|
97
|
+
modelValue?: ComboboxModelValue;
|
|
98
|
+
endpoint?: string;
|
|
99
|
+
requestParams?: Record<string, unknown>;
|
|
100
|
+
manualInput?: boolean;
|
|
101
|
+
responseData?: (data: unknown) => unknown[];
|
|
102
|
+
displayValue?: (item: unknown) => string | null;
|
|
103
|
+
optionText?: (option: unknown) => string | null;
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
minLength?: number;
|
|
106
|
+
itemKey?: string;
|
|
107
|
+
clearable?: boolean;
|
|
108
|
+
rootAttrs?: Record<string, unknown>;
|
|
109
|
+
multiple?: boolean;
|
|
110
|
+
onSearch?: (value: string | null, params: Record<string, unknown>, endpoint?: string) => Promise<{
|
|
111
|
+
data: unknown;
|
|
112
|
+
error?: unknown;
|
|
113
|
+
cancel?: () => void;
|
|
114
|
+
}>;
|
|
115
|
+
searchOnly?: boolean;
|
|
116
|
+
icon?: Icon | null;
|
|
117
|
+
prefixIcon?: Icon | null;
|
|
118
|
+
size?: ComboboxSize;
|
|
119
|
+
debounce?: number;
|
|
120
|
+
minLoadingTime?: number;
|
|
121
|
+
onCancel?: (cancelToken: (() => void) | null) => void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare type ComboboxSize = 'sm' | 'base';
|
|
125
|
+
|
|
126
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
127
|
+
export { _default as Combobox }
|
|
128
|
+
export default _default;
|
|
129
|
+
|
|
130
|
+
declare type Icon = FunctionalComponent<SVGAttributes & HTMLAttributes & VNodeProps>;
|
|
131
|
+
|
|
132
|
+
export { }
|