@glimstone/vue 4.2.8 → 4.3.4
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/dist/InfoHelpCard.vue.d.ts +1 -1
- package/dist/InfoVersionCard.vue.d.ts +1 -1
- package/dist/Select-ohRK0e4y.js +514 -0
- package/dist/Select.js +1 -467
- package/dist/Selector.vue.d.ts +4 -3
- package/dist/SelectorSegment.vue.d.ts +3 -1
- package/dist/index.js +343 -307
- package/dist/info.d.ts +3 -1
- package/package.json +2 -2
- package/dist/TipWrap-rNAEgvb0.js +0 -51
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InfoHelpCardProps } from "./info";
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<InfoHelpCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InfoHelpCardProps> & Readonly<{}>, {
|
|
3
|
-
openUrl:
|
|
3
|
+
openUrl: (url: string) => void;
|
|
4
4
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
5
|
declare const _default: typeof __VLS_export;
|
|
6
6
|
export default _default;
|
|
@@ -3,7 +3,7 @@ type __VLS_Slots = {
|
|
|
3
3
|
"whats-new"?: () => unknown;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_base: import("vue").DefineComponent<InfoVersionCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InfoVersionCardProps> & Readonly<{}>, {
|
|
6
|
-
openUrl:
|
|
6
|
+
openUrl: (url: string) => void;
|
|
7
7
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
8
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
9
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import { r as e } from "./fieldName-DBygJJfe.js";
|
|
2
|
+
import { a as t, n } from "./glyphs-CYhs4mrY.js";
|
|
3
|
+
import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, mergeModels as m, mergeProps as h, normalizeClass as g, normalizeProps as _, onMounted as v, onScopeDispose as y, openBlock as b, ref as x, renderList as S, resolveDynamicComponent as C, shallowRef as w, toDisplayString as T, unref as E, useId as D, useModel as O, watch as k, withCtx as A } from "vue";
|
|
4
|
+
import { SELECT_POSITIONING as j, closeOnPageMove as M, defaultWidth as N, dismissBubbleOn as P, enableWheelStep as F, faceLabels as I, flattenRuns as L, hasSubmenu as R, homeRow as z, isSubmenu as B, pageDir as V, placeBubble as H, pointerWasLast as U, readPortalHue as ee, selectRootClass as W, selectRowParts as G, selectTriggerClass as te, shake as ne, trackInputModality as re, wheelValue as ie } from "@glimstone/core";
|
|
5
|
+
import * as K from "@zag-js/select";
|
|
6
|
+
import { normalizeProps as q, useMachine as J } from "@zag-js/vue";
|
|
7
|
+
import * as Y from "@zag-js/menu";
|
|
8
|
+
// src/tipBubble.ts
|
|
9
|
+
function X(e, t = () => !1) {
|
|
10
|
+
let n = x(!1), r = w(null), i = w(null), o = D(), s = a(e), c = a(() => !!s.value && n.value);
|
|
11
|
+
k(t, () => n.value = !1), re();
|
|
12
|
+
let l = () => {
|
|
13
|
+
s.value && (n.value = !0);
|
|
14
|
+
}, u = () => {
|
|
15
|
+
n.value = !1;
|
|
16
|
+
}, d;
|
|
17
|
+
return k(c, (e) => {
|
|
18
|
+
d?.(), d = void 0, e && (r.value && i.value && H(r.value, i.value), d = P(u));
|
|
19
|
+
}, { flush: "post" }), y(() => d?.()), {
|
|
20
|
+
trigger: r,
|
|
21
|
+
bubble: i,
|
|
22
|
+
id: o,
|
|
23
|
+
text: s,
|
|
24
|
+
shown: c,
|
|
25
|
+
describedBy: a(() => c.value ? o : void 0),
|
|
26
|
+
show: l,
|
|
27
|
+
hide: u,
|
|
28
|
+
showOnFocus: () => {
|
|
29
|
+
U() || l();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// src/TipBubble.vue?vue&type=script&setup=true&lang.ts
|
|
34
|
+
var ae = ["id"], Z = /* @__PURE__ */ d({
|
|
35
|
+
__name: "TipBubble",
|
|
36
|
+
props: { state: {} },
|
|
37
|
+
setup(e) {
|
|
38
|
+
return (t, n) => (b(), o(i, { to: "body" }, [e.state.shown.value ? (b(), c("div", {
|
|
39
|
+
key: 0,
|
|
40
|
+
ref: (t) => e.state.bubble.value = t,
|
|
41
|
+
id: e.state.id,
|
|
42
|
+
role: "tooltip",
|
|
43
|
+
class: "glim-bubble glim-fade"
|
|
44
|
+
}, T(e.state.text.value), 9, ae)) : s("", !0)]));
|
|
45
|
+
}
|
|
46
|
+
}), Q = (e, { slots: t }) => e.on ? p("span", {
|
|
47
|
+
class: "glim-tip-wrap",
|
|
48
|
+
onMouseenter: e.show,
|
|
49
|
+
onMouseleave: e.hide
|
|
50
|
+
}, t.default?.()) : t.default?.();
|
|
51
|
+
Q.props = [
|
|
52
|
+
"on",
|
|
53
|
+
"show",
|
|
54
|
+
"hide"
|
|
55
|
+
];
|
|
56
|
+
// src/SelectFace.vue?vue&type=script&setup=true&lang.ts
|
|
57
|
+
var oe = {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: "glim-select-glyph"
|
|
60
|
+
}, se = { class: "glim-select-value" }, ce = ["aria-hidden"], $ = /* @__PURE__ */ d({
|
|
61
|
+
__name: "SelectFace",
|
|
62
|
+
props: {
|
|
63
|
+
all: {},
|
|
64
|
+
value: {},
|
|
65
|
+
placeholder: {},
|
|
66
|
+
width: {},
|
|
67
|
+
glyphs: { type: Boolean }
|
|
68
|
+
},
|
|
69
|
+
setup(e) {
|
|
70
|
+
let t = e, n = a(() => I(t.all, t.value, t.placeholder, t.width)), i = a(() => t.all.find((e) => e.value === t.value)?.glyph);
|
|
71
|
+
return (t, a) => (b(), c(r, null, [e.glyphs ? (b(), c("span", oe, [i.value ? (b(), o(C(i.value), { key: 0 })) : s("", !0)])) : s("", !0), l("span", se, [(b(!0), c(r, null, S(n.value.labels, (e) => (b(), c("span", {
|
|
72
|
+
key: e,
|
|
73
|
+
"aria-hidden": e !== n.value.text || void 0,
|
|
74
|
+
class: g(e === n.value.text ? void 0 : "glim-select-ghost")
|
|
75
|
+
}, T(e), 11, ce))), 128))])], 64));
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
// src/selectParts.ts
|
|
79
|
+
function le(e, t) {
|
|
80
|
+
let n = w(null);
|
|
81
|
+
return k(e, (e) => n.value = e && t.value ? ee(t.value) : null, { flush: "sync" }), {
|
|
82
|
+
style: a(() => n.value ?? void 0),
|
|
83
|
+
className: a(() => n.value ? "glim-hue" : "")
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function ue(e, t) {
|
|
87
|
+
let n;
|
|
88
|
+
k(e, (e) => {
|
|
89
|
+
n?.(), n = e ? F(e, (e) => {
|
|
90
|
+
if (t.inert()) return;
|
|
91
|
+
let n = ie(t.all(), t.value(), e);
|
|
92
|
+
n !== void 0 && t.onChange(n);
|
|
93
|
+
}) : void 0;
|
|
94
|
+
}, { immediate: !0 }), k(t.shakeCount, (t, n, r) => {
|
|
95
|
+
e.value && t > 0 && r(ne(e.value));
|
|
96
|
+
}), y(() => n?.());
|
|
97
|
+
}
|
|
98
|
+
// src/ListSelect.vue?vue&type=script&setup=true&lang.ts
|
|
99
|
+
var de = ["aria-busy", "aria-describedby"], fe = /* @__PURE__ */ d({
|
|
100
|
+
__name: "ListSelect",
|
|
101
|
+
props: {
|
|
102
|
+
label: {},
|
|
103
|
+
hideLabel: { type: Boolean },
|
|
104
|
+
groups: {},
|
|
105
|
+
value: {},
|
|
106
|
+
placeholder: {},
|
|
107
|
+
width: {},
|
|
108
|
+
rows: {},
|
|
109
|
+
triggerClass: {},
|
|
110
|
+
id: {},
|
|
111
|
+
triggerAttrs: {},
|
|
112
|
+
listId: {},
|
|
113
|
+
disabled: { type: Boolean },
|
|
114
|
+
busy: { type: Boolean },
|
|
115
|
+
tip: {},
|
|
116
|
+
shake: {}
|
|
117
|
+
},
|
|
118
|
+
emits: ["change"],
|
|
119
|
+
setup(e, { expose: d, emit: p }) {
|
|
120
|
+
let m = e, v = p, y = D(), x = a(() => L(m.groups)), O = a(() => x.value.some((e) => e.glyph)), N = a(() => G(m.rows, O.value)), P = a(() => K.collection({
|
|
121
|
+
items: x.value,
|
|
122
|
+
itemToValue: (e) => e.value,
|
|
123
|
+
itemToString: (e) => e.label,
|
|
124
|
+
isItemDisabled: (e) => !!e.disabled
|
|
125
|
+
})), F = J(K.machine, a(() => ({
|
|
126
|
+
id: y,
|
|
127
|
+
ids: {
|
|
128
|
+
trigger: m.id,
|
|
129
|
+
content: m.listId
|
|
130
|
+
},
|
|
131
|
+
dir: V(),
|
|
132
|
+
collection: P.value,
|
|
133
|
+
value: m.value === null ? [] : [m.value],
|
|
134
|
+
disabled: m.disabled,
|
|
135
|
+
readOnly: m.busy,
|
|
136
|
+
onValueChange: (e) => {
|
|
137
|
+
let t = e.value[0];
|
|
138
|
+
t !== void 0 && t !== m.value && v("change", t);
|
|
139
|
+
},
|
|
140
|
+
positioning: j
|
|
141
|
+
}))), I = a(() => K.connect(F, q)), R = w(null), z = X(() => m.tip, () => !!m.disabled);
|
|
142
|
+
ue(R, {
|
|
143
|
+
all: () => x.value,
|
|
144
|
+
value: () => m.value,
|
|
145
|
+
inert: () => !!(m.disabled || m.busy),
|
|
146
|
+
onChange: (e) => v("change", e),
|
|
147
|
+
shakeCount: () => m.shake ?? 0
|
|
148
|
+
}), k(() => I.value.open, (e, t, n) => {
|
|
149
|
+
e && n(M(() => I.value.setOpen(!1)));
|
|
150
|
+
});
|
|
151
|
+
let B = le(() => I.value.open, R);
|
|
152
|
+
function H(e) {
|
|
153
|
+
R.value = e, z.trigger.value = R.value;
|
|
154
|
+
}
|
|
155
|
+
return d({ trigger: R }), (a, d) => (b(), c("div", h(I.value.getRootProps(), { class: E(W)(e.width) }), [
|
|
156
|
+
l("label", h(I.value.getLabelProps(), { class: e.hideLabel ? "glim-sr-only" : "glim-field-label" }), T(e.label), 17),
|
|
157
|
+
l("div", _(f(I.value.getControlProps())), [u(E(Q), {
|
|
158
|
+
on: !!e.disabled && !!e.tip,
|
|
159
|
+
show: E(z).show,
|
|
160
|
+
hide: E(z).hide
|
|
161
|
+
}, {
|
|
162
|
+
default: A(() => [l("button", h({
|
|
163
|
+
...e.triggerAttrs,
|
|
164
|
+
...I.value.getTriggerProps()
|
|
165
|
+
}, {
|
|
166
|
+
ref: H,
|
|
167
|
+
"aria-busy": e.busy || void 0,
|
|
168
|
+
"aria-describedby": E(z).describedBy.value,
|
|
169
|
+
class: e.triggerClass,
|
|
170
|
+
onMouseenter: d[0] ||= (...e) => E(z).show && E(z).show(...e),
|
|
171
|
+
onMouseleave: d[1] ||= (...e) => E(z).hide && E(z).hide(...e),
|
|
172
|
+
onFocus: d[2] ||= (...e) => E(z).showOnFocus && E(z).showOnFocus(...e),
|
|
173
|
+
onBlur: d[3] ||= (...e) => E(z).hide && E(z).hide(...e)
|
|
174
|
+
}), [u($, {
|
|
175
|
+
all: x.value,
|
|
176
|
+
value: e.value,
|
|
177
|
+
placeholder: e.placeholder,
|
|
178
|
+
width: e.width,
|
|
179
|
+
glyphs: O.value
|
|
180
|
+
}, null, 8, [
|
|
181
|
+
"all",
|
|
182
|
+
"value",
|
|
183
|
+
"placeholder",
|
|
184
|
+
"width",
|
|
185
|
+
"glyphs"
|
|
186
|
+
]), l("span", h(I.value.getIndicatorProps(), { class: "glim-select-indicator" }), [u(E(t))], 16)], 16, de)]),
|
|
187
|
+
_: 1
|
|
188
|
+
}, 8, [
|
|
189
|
+
"on",
|
|
190
|
+
"show",
|
|
191
|
+
"hide"
|
|
192
|
+
])], 16),
|
|
193
|
+
u(Z, { state: E(z) }, null, 8, ["state"]),
|
|
194
|
+
(b(), o(i, { to: "body" }, [l("div", h(I.value.getPositionerProps(), {
|
|
195
|
+
style: E(B).style.value,
|
|
196
|
+
class: ["glim-select-positioner", E(B).className.value]
|
|
197
|
+
}), [l("div", h(I.value.getContentProps(), { class: N.value.content }), [(b(!0), c(r, null, S(e.groups, (e, t) => (b(), c(r, { key: t }, [e.entries.length > 0 ? (b(), c("div", h({
|
|
198
|
+
key: 0,
|
|
199
|
+
ref_for: !0
|
|
200
|
+
}, e.heading ? I.value.getItemGroupProps({ id: `${E(y)}-g${t}` }) : {}, { class: "glim-select-group" }), [e.heading ? (b(), c("div", h({
|
|
201
|
+
key: 0,
|
|
202
|
+
ref_for: !0
|
|
203
|
+
}, I.value.getItemGroupLabelProps({ htmlFor: `${E(y)}-g${t}` }), { class: N.value.heading }), T(e.heading), 17)) : s("", !0), (b(!0), c(r, null, S(e.entries, (e) => (b(), c("div", h({ key: e.value }, { ref_for: !0 }, I.value.getItemProps({ item: e }), { class: N.value.item }), [
|
|
204
|
+
N.value.glyph ? (b(), c("span", {
|
|
205
|
+
key: 0,
|
|
206
|
+
class: g(N.value.glyph)
|
|
207
|
+
}, [e.glyph ? (b(), o(C(e.glyph), { key: 0 })) : s("", !0)], 2)) : s("", !0),
|
|
208
|
+
l("span", h({ ref_for: !0 }, I.value.getItemTextProps({ item: e }), { class: N.value.label }), T(e.label), 17),
|
|
209
|
+
l("span", h({ ref_for: !0 }, I.value.getItemIndicatorProps({ item: e }), { class: N.value.check }), [u(E(n))], 16)
|
|
210
|
+
], 16))), 128))], 16)) : s("", !0)], 64))), 128))], 16)], 16)])),
|
|
211
|
+
l("select", _(f(I.value.getHiddenSelectProps())), null, 16)
|
|
212
|
+
], 16));
|
|
213
|
+
}
|
|
214
|
+
}), pe = ["data-state"], me = /* @__PURE__ */ d({
|
|
215
|
+
__name: "MenuChoice",
|
|
216
|
+
props: {
|
|
217
|
+
api: {},
|
|
218
|
+
option: {},
|
|
219
|
+
value: {},
|
|
220
|
+
parts: {}
|
|
221
|
+
},
|
|
222
|
+
emits: ["change"],
|
|
223
|
+
setup(e, { emit: t }) {
|
|
224
|
+
let r = e, i = t, d = a(() => r.option.value === r.value), f = a(() => ({
|
|
225
|
+
type: "radio",
|
|
226
|
+
value: r.option.value,
|
|
227
|
+
valueText: r.option.label,
|
|
228
|
+
checked: d.value,
|
|
229
|
+
disabled: r.option.disabled,
|
|
230
|
+
onCheckedChange: () => {
|
|
231
|
+
d.value || i("change", r.option.value);
|
|
232
|
+
}
|
|
233
|
+
}));
|
|
234
|
+
return (t, r) => (b(), c("div", h(e.api.getOptionItemProps(f.value), { class: e.parts.item }), [
|
|
235
|
+
e.parts.glyph ? (b(), c("span", {
|
|
236
|
+
key: 0,
|
|
237
|
+
class: g(e.parts.glyph)
|
|
238
|
+
}, [e.option.glyph ? (b(), o(C(e.option.glyph), { key: 0 })) : s("", !0)], 2)) : s("", !0),
|
|
239
|
+
l("span", h(e.api.getItemTextProps(f.value), { class: e.parts.label }), T(e.option.label), 17),
|
|
240
|
+
l("span", {
|
|
241
|
+
"aria-hidden": "true",
|
|
242
|
+
"data-state": d.value ? "checked" : "unchecked",
|
|
243
|
+
class: g(e.parts.check)
|
|
244
|
+
}, [u(E(n))], 10, pe)
|
|
245
|
+
], 16));
|
|
246
|
+
}
|
|
247
|
+
}), he = /* @__PURE__ */ d({
|
|
248
|
+
__name: "MenuSubmenu",
|
|
249
|
+
props: {
|
|
250
|
+
parent: {},
|
|
251
|
+
parentApi: {},
|
|
252
|
+
triggerId: {},
|
|
253
|
+
entry: {},
|
|
254
|
+
value: {},
|
|
255
|
+
parts: {},
|
|
256
|
+
hueStyle: {},
|
|
257
|
+
hueClass: {}
|
|
258
|
+
},
|
|
259
|
+
emits: ["change"],
|
|
260
|
+
setup(e, { emit: n }) {
|
|
261
|
+
let d = e, f = n, p = J(Y.machine, {
|
|
262
|
+
id: D(),
|
|
263
|
+
ids: { trigger: d.triggerId },
|
|
264
|
+
dir: V(),
|
|
265
|
+
"aria-label": d.entry.label
|
|
266
|
+
}), m = a(() => Y.connect(p, q));
|
|
267
|
+
return v(() => {
|
|
268
|
+
d.parentApi.setChild(p), m.value.setParent(d.parent);
|
|
269
|
+
}), (n, a) => (b(), c(r, null, [l("div", h(e.parentApi.getTriggerItemProps(m.value), { class: e.parts.item }), [
|
|
270
|
+
e.parts.glyph ? (b(), c("span", {
|
|
271
|
+
key: 0,
|
|
272
|
+
class: g(e.parts.glyph)
|
|
273
|
+
}, [e.entry.glyph ? (b(), o(C(e.entry.glyph), { key: 0 })) : s("", !0)], 2)) : s("", !0),
|
|
274
|
+
l("span", { class: g(e.parts.label) }, T(e.entry.label), 3),
|
|
275
|
+
l("span", {
|
|
276
|
+
"aria-hidden": "true",
|
|
277
|
+
class: g(e.parts.caret)
|
|
278
|
+
}, [u(E(t))], 2)
|
|
279
|
+
], 16), (b(), o(i, { to: "body" }, [l("div", h(m.value.getPositionerProps(), {
|
|
280
|
+
style: e.hueStyle,
|
|
281
|
+
class: ["glim-select-positioner", e.hueClass]
|
|
282
|
+
}), [l("div", h(m.value.getContentProps(), { class: e.parts.content }), [(b(!0), c(r, null, S(e.entry.options, (t) => (b(), o(me, {
|
|
283
|
+
key: t.value,
|
|
284
|
+
api: m.value,
|
|
285
|
+
option: t,
|
|
286
|
+
value: e.value,
|
|
287
|
+
parts: e.parts,
|
|
288
|
+
onChange: a[0] ||= (e) => f("change", e)
|
|
289
|
+
}, null, 8, [
|
|
290
|
+
"api",
|
|
291
|
+
"option",
|
|
292
|
+
"value",
|
|
293
|
+
"parts"
|
|
294
|
+
]))), 128))], 16)], 16)]))], 64));
|
|
295
|
+
}
|
|
296
|
+
}), ge = {
|
|
297
|
+
key: 0,
|
|
298
|
+
"aria-hidden": "true",
|
|
299
|
+
class: "glim-field-label"
|
|
300
|
+
}, _e = [
|
|
301
|
+
"disabled",
|
|
302
|
+
"data-disabled",
|
|
303
|
+
"data-readonly",
|
|
304
|
+
"aria-busy",
|
|
305
|
+
"aria-label",
|
|
306
|
+
"aria-describedby"
|
|
307
|
+
], ve = /* @__PURE__ */ d({
|
|
308
|
+
__name: "MenuSelect",
|
|
309
|
+
props: {
|
|
310
|
+
label: {},
|
|
311
|
+
hideLabel: { type: Boolean },
|
|
312
|
+
groups: {},
|
|
313
|
+
value: {},
|
|
314
|
+
placeholder: {},
|
|
315
|
+
width: {},
|
|
316
|
+
rows: {},
|
|
317
|
+
triggerClass: {},
|
|
318
|
+
id: {},
|
|
319
|
+
triggerAttrs: {},
|
|
320
|
+
listId: {},
|
|
321
|
+
disabled: { type: Boolean },
|
|
322
|
+
busy: { type: Boolean },
|
|
323
|
+
tip: {},
|
|
324
|
+
shake: {}
|
|
325
|
+
},
|
|
326
|
+
emits: ["change"],
|
|
327
|
+
setup(e, { expose: n, emit: d }) {
|
|
328
|
+
let f = e, p = d, m = D(), _ = J(Y.machine, a(() => ({
|
|
329
|
+
id: m,
|
|
330
|
+
ids: {
|
|
331
|
+
trigger: f.id,
|
|
332
|
+
content: f.listId
|
|
333
|
+
},
|
|
334
|
+
dir: V(),
|
|
335
|
+
"aria-label": f.label,
|
|
336
|
+
positioning: j
|
|
337
|
+
}))), v = a(() => Y.connect(_, q)), y = a(() => L(f.groups)), x = a(() => y.value.some((e) => e.glyph)), C = a(() => G(f.rows, x.value)), O = a(() => I(y.value, f.value, f.placeholder, f.width).text), N = (e, t) => `${m}-sub-${e}-${t}`, P = w(null), F = X(() => f.tip, () => !!f.disabled);
|
|
338
|
+
ue(P, {
|
|
339
|
+
all: () => y.value,
|
|
340
|
+
value: () => f.value,
|
|
341
|
+
inert: () => !!(f.disabled || f.busy),
|
|
342
|
+
onChange: (e) => p("change", e),
|
|
343
|
+
shakeCount: () => f.shake ?? 0
|
|
344
|
+
});
|
|
345
|
+
let R = le(() => v.value.open, P);
|
|
346
|
+
k(() => v.value.open, (e, t, n) => {
|
|
347
|
+
if (!e) return;
|
|
348
|
+
n(M(() => v.value.setOpen(!1)));
|
|
349
|
+
let r = z(f.groups, f.value, N);
|
|
350
|
+
if (r === null) return;
|
|
351
|
+
let i = 0, a = requestAnimationFrame(() => {
|
|
352
|
+
i = requestAnimationFrame(() => v.value.setHighlightedValue(r));
|
|
353
|
+
});
|
|
354
|
+
n(() => {
|
|
355
|
+
cancelAnimationFrame(a), cancelAnimationFrame(i);
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
let H = a(() => {
|
|
359
|
+
let e = v.value.getTriggerProps(), t = (t) => (n) => {
|
|
360
|
+
f.busy ? n.preventDefault() : e[t]?.(n);
|
|
361
|
+
};
|
|
362
|
+
return {
|
|
363
|
+
...f.triggerAttrs,
|
|
364
|
+
...e,
|
|
365
|
+
onPointerdown: t("onPointerdown"),
|
|
366
|
+
onClick: t("onClick"),
|
|
367
|
+
onKeydown: t("onKeydown")
|
|
368
|
+
};
|
|
369
|
+
});
|
|
370
|
+
function U(e) {
|
|
371
|
+
P.value = e, F.trigger.value = P.value;
|
|
372
|
+
}
|
|
373
|
+
return n({ trigger: P }), (n, a) => (b(), c("div", { class: g(E(W)(e.width)) }, [
|
|
374
|
+
e.hideLabel ? s("", !0) : (b(), c("span", ge, T(e.label), 1)),
|
|
375
|
+
l("div", null, [u(E(Q), {
|
|
376
|
+
on: !!e.disabled && !!e.tip,
|
|
377
|
+
show: E(F).show,
|
|
378
|
+
hide: E(F).hide
|
|
379
|
+
}, {
|
|
380
|
+
default: A(() => [l("button", h(H.value, {
|
|
381
|
+
ref: U,
|
|
382
|
+
disabled: e.disabled,
|
|
383
|
+
"data-disabled": e.disabled ? "" : void 0,
|
|
384
|
+
"data-readonly": e.busy ? "" : void 0,
|
|
385
|
+
"aria-busy": e.busy || void 0,
|
|
386
|
+
"aria-label": `${e.label}: ${O.value}`,
|
|
387
|
+
"aria-describedby": E(F).describedBy.value,
|
|
388
|
+
class: e.triggerClass,
|
|
389
|
+
onMouseenter: a[0] ||= (...e) => E(F).show && E(F).show(...e),
|
|
390
|
+
onMouseleave: a[1] ||= (...e) => E(F).hide && E(F).hide(...e),
|
|
391
|
+
onFocus: a[2] ||= (...e) => E(F).showOnFocus && E(F).showOnFocus(...e),
|
|
392
|
+
onBlur: a[3] ||= (...e) => E(F).hide && E(F).hide(...e)
|
|
393
|
+
}), [u($, {
|
|
394
|
+
all: y.value,
|
|
395
|
+
value: e.value,
|
|
396
|
+
placeholder: e.placeholder,
|
|
397
|
+
width: e.width,
|
|
398
|
+
glyphs: x.value
|
|
399
|
+
}, null, 8, [
|
|
400
|
+
"all",
|
|
401
|
+
"value",
|
|
402
|
+
"placeholder",
|
|
403
|
+
"width",
|
|
404
|
+
"glyphs"
|
|
405
|
+
]), l("span", h(v.value.getIndicatorProps(), { class: "glim-select-indicator" }), [u(E(t))], 16)], 16, _e)]),
|
|
406
|
+
_: 1
|
|
407
|
+
}, 8, [
|
|
408
|
+
"on",
|
|
409
|
+
"show",
|
|
410
|
+
"hide"
|
|
411
|
+
])]),
|
|
412
|
+
u(Z, { state: E(F) }, null, 8, ["state"]),
|
|
413
|
+
(b(), o(i, { to: "body" }, [l("div", h(v.value.getPositionerProps(), {
|
|
414
|
+
style: E(R).style.value,
|
|
415
|
+
class: ["glim-select-positioner", E(R).className.value]
|
|
416
|
+
}), [l("div", h(v.value.getContentProps(), { class: C.value.content }), [(b(!0), c(r, null, S(e.groups, (t, n) => (b(), c(r, { key: n }, [t.entries.length > 0 ? (b(), c("div", h({
|
|
417
|
+
key: 0,
|
|
418
|
+
ref_for: !0
|
|
419
|
+
}, t.heading ? v.value.getItemGroupProps({ id: `g${n}` }) : {}, { class: "glim-select-group" }), [t.heading ? (b(), c("div", h({
|
|
420
|
+
key: 0,
|
|
421
|
+
ref_for: !0
|
|
422
|
+
}, v.value.getItemGroupLabelProps({ htmlFor: `g${n}` }), { class: C.value.heading }), T(t.heading), 17)) : s("", !0), (b(!0), c(r, null, S(t.entries, (t, i) => (b(), c(r, { key: E(B)(t) ? `s${i}` : t.value }, [E(B)(t) ? (b(), o(he, {
|
|
423
|
+
key: 0,
|
|
424
|
+
parent: E(_),
|
|
425
|
+
"parent-api": v.value,
|
|
426
|
+
"trigger-id": N(n, i),
|
|
427
|
+
entry: t,
|
|
428
|
+
value: e.value,
|
|
429
|
+
parts: C.value,
|
|
430
|
+
"hue-style": E(R).style.value,
|
|
431
|
+
"hue-class": E(R).className.value,
|
|
432
|
+
onChange: a[4] ||= (e) => p("change", e)
|
|
433
|
+
}, null, 8, [
|
|
434
|
+
"parent",
|
|
435
|
+
"parent-api",
|
|
436
|
+
"trigger-id",
|
|
437
|
+
"entry",
|
|
438
|
+
"value",
|
|
439
|
+
"parts",
|
|
440
|
+
"hue-style",
|
|
441
|
+
"hue-class"
|
|
442
|
+
])) : (b(), o(me, {
|
|
443
|
+
key: 1,
|
|
444
|
+
api: v.value,
|
|
445
|
+
option: t,
|
|
446
|
+
value: e.value,
|
|
447
|
+
parts: C.value,
|
|
448
|
+
onChange: a[5] ||= (e) => p("change", e)
|
|
449
|
+
}, null, 8, [
|
|
450
|
+
"api",
|
|
451
|
+
"option",
|
|
452
|
+
"value",
|
|
453
|
+
"parts"
|
|
454
|
+
]))], 64))), 128))], 16)) : s("", !0)], 64))), 128))], 16)], 16)]))
|
|
455
|
+
], 2));
|
|
456
|
+
}
|
|
457
|
+
}), ye = /* @__PURE__ */ d({
|
|
458
|
+
__name: "Select",
|
|
459
|
+
props: /*@__PURE__*/ m({
|
|
460
|
+
label: {},
|
|
461
|
+
hideLabel: {
|
|
462
|
+
type: Boolean,
|
|
463
|
+
default: !1
|
|
464
|
+
},
|
|
465
|
+
options: {},
|
|
466
|
+
groups: {},
|
|
467
|
+
placeholder: {},
|
|
468
|
+
width: {},
|
|
469
|
+
size: { default: "field" },
|
|
470
|
+
rows: { default: "list" },
|
|
471
|
+
wrap: {
|
|
472
|
+
type: Boolean,
|
|
473
|
+
default: !1
|
|
474
|
+
},
|
|
475
|
+
id: {},
|
|
476
|
+
triggerAttrs: {},
|
|
477
|
+
listId: {},
|
|
478
|
+
disabled: {
|
|
479
|
+
type: Boolean,
|
|
480
|
+
default: !1
|
|
481
|
+
},
|
|
482
|
+
busy: {
|
|
483
|
+
type: Boolean,
|
|
484
|
+
default: !1
|
|
485
|
+
},
|
|
486
|
+
tip: {},
|
|
487
|
+
shake: {}
|
|
488
|
+
}, {
|
|
489
|
+
modelValue: { required: !0 },
|
|
490
|
+
modelModifiers: {}
|
|
491
|
+
}),
|
|
492
|
+
emits: ["update:modelValue"],
|
|
493
|
+
setup(t) {
|
|
494
|
+
let n = t, r = O(t, "modelValue"), i = a(() => n.groups ?? [{ entries: n.options ?? [] }]), s = e(() => n.label), c = a(() => n.label === void 0), l = a(() => ({
|
|
495
|
+
label: s.value ?? "",
|
|
496
|
+
hideLabel: n.hideLabel || c.value,
|
|
497
|
+
groups: i.value,
|
|
498
|
+
value: r.value,
|
|
499
|
+
placeholder: n.placeholder,
|
|
500
|
+
width: n.width ?? (c.value ? "steady" : N(n.size)),
|
|
501
|
+
rows: n.rows,
|
|
502
|
+
triggerClass: te(n.size, n.wrap),
|
|
503
|
+
id: n.id,
|
|
504
|
+
triggerAttrs: n.triggerAttrs,
|
|
505
|
+
listId: n.listId,
|
|
506
|
+
disabled: n.disabled,
|
|
507
|
+
busy: n.busy,
|
|
508
|
+
tip: n.tip,
|
|
509
|
+
shake: n.shake
|
|
510
|
+
}));
|
|
511
|
+
return (e, t) => E(R)(i.value) ? (b(), o(ve, h({ key: 0 }, l.value, { onChange: t[0] ||= (e) => r.value = e }), null, 16)) : (b(), o(fe, h({ key: 1 }, l.value, { onChange: t[1] ||= (e) => r.value = e }), null, 16));
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
export { X as i, Q as n, Z as r, ye as t };
|