@glimstone/vue 4.4.1 → 4.5.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/dist/AboutCard.vue.d.ts +40 -0
- package/dist/Accordion.js +36 -0
- package/dist/Accordion.vue.d.ts +32 -0
- package/dist/AngleSlider.js +46 -0
- package/dist/AngleSlider.vue.d.ts +22 -0
- package/dist/Avatar.js +37 -0
- package/dist/Avatar.vue.d.ts +14 -0
- package/dist/Badge-BhK0gMse.js +81 -0
- package/dist/Badge.vue.d.ts +1 -1
- package/dist/Button-BM5Dzboj.js +203 -0
- package/dist/Carousel.js +80 -0
- package/dist/Carousel.vue.d.ts +36 -0
- package/dist/CoffeeDialog.vue.d.ts +21 -0
- package/dist/Collapsible.js +34 -0
- package/dist/Collapsible.vue.d.ts +30 -0
- package/dist/Combobox.js +3 -3
- package/dist/ContextMenu.vue.d.ts +3 -0
- package/dist/CryptoDonateDialog.vue.d.ts +48 -0
- package/dist/DatePicker.js +103 -0
- package/dist/DatePicker.vue.d.ts +24 -0
- package/dist/DropdownListbox.vue.d.ts +30 -0
- package/dist/FileUpload.js +67 -0
- package/dist/FileUpload.vue.d.ts +25 -0
- package/dist/FloatingPanel.js +85 -0
- package/dist/FloatingPanel.vue.d.ts +34 -0
- package/dist/HoverCard.js +42 -0
- package/dist/HoverCard.vue.d.ts +23 -0
- package/dist/IconButton-D5YOChZI.js +48 -0
- package/dist/IconTipButton-BLtrZfgN.js +56 -0
- package/dist/Marquee.js +49 -0
- package/dist/Marquee.vue.d.ts +32 -0
- package/dist/MenuBar.vue.d.ts +1 -3
- package/dist/Pagination.js +72 -0
- package/dist/Pagination.vue.d.ts +23 -0
- package/dist/PaypalDialog.vue.d.ts +63 -0
- package/dist/PinInput.js +61 -0
- package/dist/PinInput.vue.d.ts +34 -0
- package/dist/PresenceBadges.vue.d.ts +8 -0
- package/dist/ProgressBar.vue.d.ts +1 -1
- package/dist/Rating.js +56 -0
- package/dist/Rating.vue.d.ts +27 -0
- package/dist/ScrollArea.js +31 -0
- package/dist/ScrollArea.vue.d.ts +21 -0
- package/dist/Select-CBScnONy.js +458 -0
- package/dist/Select.js +1 -1
- package/dist/SignaturePad.js +63 -0
- package/dist/SignaturePad.vue.d.ts +19 -0
- package/dist/Splitter.js +46 -0
- package/dist/Splitter.vue.d.ts +31 -0
- package/dist/Steps.js +77 -0
- package/dist/Steps.vue.d.ts +34 -0
- package/dist/TagsInput.js +73 -0
- package/dist/TagsInput.vue.d.ts +25 -0
- package/dist/Timer.js +74 -0
- package/dist/Timer.vue.d.ts +22 -0
- package/dist/TipWrap-5Nw7Yj0O.js +51 -0
- package/dist/ToastCard.vue.d.ts +25 -0
- package/dist/ToastViewport.vue.d.ts +16 -8
- package/dist/Tour.js +84 -0
- package/dist/Tour.vue.d.ts +16 -0
- package/dist/Tree.vue.d.ts +2 -2
- package/dist/WindowBar.vue.d.ts +27 -0
- package/dist/confirm.d.ts +5 -1
- package/dist/deprecatedEvents.d.ts +8 -0
- package/dist/engines.d.ts +2 -1
- package/dist/entries/accordion.d.ts +2 -0
- package/dist/entries/angleslider.d.ts +1 -0
- package/dist/entries/avatar.d.ts +2 -0
- package/dist/entries/carousel.d.ts +2 -0
- package/dist/entries/collapsible.d.ts +1 -0
- package/dist/entries/datepicker.d.ts +2 -0
- package/dist/entries/fileupload.d.ts +2 -0
- package/dist/entries/floatingpanel.d.ts +2 -0
- package/dist/entries/hovercard.d.ts +1 -0
- package/dist/entries/marquee.d.ts +2 -0
- package/dist/entries/pagination.d.ts +2 -0
- package/dist/entries/pininput.d.ts +2 -0
- package/dist/entries/rating.d.ts +2 -0
- package/dist/entries/scrollarea.d.ts +1 -0
- package/dist/entries/signaturepad.d.ts +2 -0
- package/dist/entries/splitter.d.ts +2 -0
- package/dist/entries/steps.d.ts +2 -0
- package/dist/entries/tagsinput.d.ts +2 -0
- package/dist/entries/timer.d.ts +2 -0
- package/dist/entries/tour.d.ts +2 -0
- package/dist/fortressParts.d.ts +3 -0
- package/dist/{glyphs-CYhs4mrY.js → glyphs-DEch1yYd.js} +2 -2
- package/dist/glyphs.d.ts +8 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.js +3655 -3331
- package/dist/paypalButtons.d.ts +17 -0
- package/dist/selectParts-0e1ib8BL.js +23 -0
- package/dist/selectParts.d.ts +9 -5
- package/package.json +108 -7
- package/dist/Select-D8Kf1NZa.js +0 -520
package/dist/Select-D8Kf1NZa.js
DELETED
|
@@ -1,520 +0,0 @@
|
|
|
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, portalTarget as W, readPortalHue as ee, selectRootClass as G, selectRowParts as te, selectTriggerClass as ne, shake as re, trackInputModality as ie, wheelValue as ae } 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), ie();
|
|
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 oe = ["id"], Z = /* @__PURE__ */ d({
|
|
35
|
-
__name: "TipBubble",
|
|
36
|
-
props: { state: {} },
|
|
37
|
-
setup(e) {
|
|
38
|
-
return (t, n) => (b(), o(i, { to: E(W)() }, [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, oe)) : s("", !0)], 8, ["to"]));
|
|
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 se = {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: "glim-select-glyph"
|
|
60
|
-
}, ce = { class: "glim-select-value" }, le = ["aria-hidden"], ue = /* @__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", se, [i.value ? (b(), o(C(i.value), { key: 0 })) : s("", !0)])) : s("", !0), l("span", ce, [(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, le))), 128))])], 64));
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
// src/selectParts.ts
|
|
79
|
-
function de(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 fe(e, t) {
|
|
87
|
-
let n;
|
|
88
|
-
k(e, (e) => {
|
|
89
|
-
n?.(), n = e ? F(e, (e) => {
|
|
90
|
-
if (t.inert()) return;
|
|
91
|
-
let n = ae(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(re(e.value));
|
|
96
|
-
}), y(() => n?.());
|
|
97
|
-
}
|
|
98
|
-
// src/ListSelect.vue?vue&type=script&setup=true&lang.ts
|
|
99
|
-
var pe = ["aria-busy", "aria-describedby"], me = /* @__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(() => te(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
|
-
fe(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 = de(() => 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(G)(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(ue, {
|
|
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, pe)]),
|
|
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: E(W)() }, [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)], 8, ["to"])),
|
|
211
|
-
l("select", _(f(I.value.getHiddenSelectProps())), null, 16)
|
|
212
|
-
], 16));
|
|
213
|
-
}
|
|
214
|
-
}), he = ["data-state"], $ = /* @__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, he)
|
|
245
|
-
], 16));
|
|
246
|
-
}
|
|
247
|
-
}), ge = /* @__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: E(W)() }, [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($, {
|
|
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)], 8, ["to"]))], 64));
|
|
295
|
-
}
|
|
296
|
-
}), _e = {
|
|
297
|
-
key: 0,
|
|
298
|
-
"aria-hidden": "true",
|
|
299
|
-
class: "glim-field-label"
|
|
300
|
-
}, ve = [
|
|
301
|
-
"disabled",
|
|
302
|
-
"data-disabled",
|
|
303
|
-
"data-readonly",
|
|
304
|
-
"aria-busy",
|
|
305
|
-
"aria-label",
|
|
306
|
-
"aria-describedby"
|
|
307
|
-
], ye = /* @__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(() => te(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
|
-
fe(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 = de(() => 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(G)(e.width)) }, [
|
|
374
|
-
e.hideLabel ? s("", !0) : (b(), c("span", _e, 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(ue, {
|
|
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, ve)]),
|
|
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: E(W)() }, [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(ge, {
|
|
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($, {
|
|
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)], 8, ["to"]))
|
|
455
|
-
], 2));
|
|
456
|
-
}
|
|
457
|
-
}), be = /* @__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: ne(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(ye, h({
|
|
512
|
-
key: 0,
|
|
513
|
-
"data-glim": "Select"
|
|
514
|
-
}, l.value, { onChange: t[0] ||= (e) => r.value = e }), null, 16)) : (b(), o(me, h({
|
|
515
|
-
key: 1,
|
|
516
|
-
"data-glim": "Select"
|
|
517
|
-
}, l.value, { onChange: t[1] ||= (e) => r.value = e }), null, 16));
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
export { X as i, Q as n, Z as r, be as t };
|