@hydrateless/vue 0.7.0 → 0.9.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/README.md +126 -43
- package/dist/index.d.ts +2387 -943
- package/dist/index.js +1300 -1391
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,1526 +1,1435 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
function useEnhancer(target, enhance) {
|
|
4
|
-
const api = shallowRef(null);
|
|
5
|
-
let destroy = null;
|
|
6
|
-
onMounted(() => {
|
|
7
|
-
if (!target.value) return;
|
|
8
|
-
const handle = enhance(target.value);
|
|
9
|
-
api.value = handle.api;
|
|
10
|
-
destroy = handle.destroy;
|
|
11
|
-
});
|
|
12
|
-
onUnmounted(() => {
|
|
13
|
-
destroy?.();
|
|
14
|
-
destroy = null;
|
|
15
|
-
api.value = null;
|
|
16
|
-
});
|
|
17
|
-
return api;
|
|
18
|
-
}
|
|
1
|
+
import { defineComponent, useId, reactive, computed, provide, h, inject, ref, cloneVNode, shallowRef, onMounted, watch, onBeforeUnmount, toValue } from 'vue';
|
|
2
|
+
import { enhanceAccordion, enhanceDisclosure, enhanceTabs, enhanceDropdown, enhanceMenu, enhanceModal, enhanceDrawer, enhancePopover, enhanceTooltip, enhanceCombobox, enhanceCommand, enhanceToast, enhanceToc } from '@hydrateless/enhancers';
|
|
19
3
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
function useEnhancer(el, enhancer, options, deps) {
|
|
5
|
+
const api = shallowRef(null);
|
|
6
|
+
let destroy = null;
|
|
7
|
+
const detach = () => {
|
|
8
|
+
destroy?.();
|
|
9
|
+
destroy = null;
|
|
10
|
+
api.value = null;
|
|
11
|
+
};
|
|
12
|
+
const attach = () => {
|
|
13
|
+
detach();
|
|
14
|
+
if (!el.value)
|
|
15
|
+
return;
|
|
16
|
+
const handle = enhancer(el.value, toValue(options));
|
|
17
|
+
api.value = handle.api;
|
|
18
|
+
destroy = handle.destroy;
|
|
19
|
+
};
|
|
20
|
+
onMounted(attach);
|
|
21
|
+
if (deps)
|
|
22
|
+
watch(deps, attach);
|
|
23
|
+
onBeforeUnmount(detach);
|
|
24
|
+
return api;
|
|
25
|
+
}
|
|
23
26
|
function useToast(options) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const api = () => enhanceToast(document, options).api;
|
|
28
|
+
return {
|
|
29
|
+
show: (message, opts) => api().show(message, opts),
|
|
30
|
+
dismiss: (toast) => api()?.dismiss(toast)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function cx(...classes) {
|
|
34
|
+
return classes.filter(Boolean).join(" ");
|
|
35
|
+
}
|
|
36
|
+
function part(name, tag, klass) {
|
|
37
|
+
return defineComponent({
|
|
38
|
+
name,
|
|
39
|
+
inheritAttrs: false,
|
|
40
|
+
setup(_, { slots, attrs }) {
|
|
41
|
+
return () => h(tag, { ...attrs, class: cx(klass, attrs.class) }, slots.default?.());
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function useControlled(props, emit, { prop, event, default: fallback }) {
|
|
46
|
+
const controlled = () => props[prop];
|
|
47
|
+
const internal = shallowRef(controlled() ?? fallback);
|
|
48
|
+
const value = computed(() => {
|
|
49
|
+
const outer = controlled();
|
|
50
|
+
return outer === void 0 ? internal.value : outer;
|
|
51
|
+
});
|
|
52
|
+
const set = (next) => {
|
|
53
|
+
internal.value = next;
|
|
54
|
+
emit(event, next);
|
|
55
|
+
};
|
|
56
|
+
return { value, set };
|
|
57
|
+
}
|
|
58
|
+
function same(a, b) {
|
|
59
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
60
|
+
return a.length === b.length && a.every((item, i) => item === b[i]);
|
|
31
61
|
}
|
|
32
|
-
|
|
62
|
+
return a === b;
|
|
33
63
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
function useApiSync(api, source, read, write) {
|
|
65
|
+
watch(source, (value) => {
|
|
66
|
+
const current = api.value;
|
|
67
|
+
if (current && value !== void 0 && !same(read(current), value)) {
|
|
68
|
+
write(current, value);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
var FieldKey = Symbol("hl-field");
|
|
73
|
+
var fieldProps = {
|
|
74
|
+
id: { type: String, default: void 0 },
|
|
75
|
+
label: { type: String, default: void 0 },
|
|
76
|
+
description: { type: String, default: void 0 },
|
|
77
|
+
error: { type: String, default: void 0 },
|
|
78
|
+
invalid: { type: Boolean, default: false },
|
|
79
|
+
required: { type: Boolean, default: false }
|
|
80
|
+
};
|
|
81
|
+
var Field = defineComponent({
|
|
82
|
+
name: "HlField",
|
|
83
|
+
inheritAttrs: false,
|
|
84
|
+
props: fieldProps,
|
|
85
|
+
setup(props, { slots, attrs }) {
|
|
86
|
+
const id = props.id ?? useId();
|
|
87
|
+
const ctx = reactive({
|
|
88
|
+
id,
|
|
89
|
+
helpId: `${id}-help`,
|
|
90
|
+
errorId: `${id}-error`,
|
|
91
|
+
help: false,
|
|
92
|
+
error: false,
|
|
93
|
+
invalid: computed(() => props.invalid || !!props.error),
|
|
94
|
+
required: computed(() => props.required),
|
|
95
|
+
describedBy: computed(() => cx(ctx.help && ctx.helpId, ctx.error && ctx.invalid && ctx.errorId) || void 0)
|
|
96
|
+
});
|
|
97
|
+
provide(FieldKey, ctx);
|
|
98
|
+
return () => {
|
|
99
|
+
const children = slots.default?.() ?? [];
|
|
100
|
+
const has = (part2) => children.some((child) => child.type === part2);
|
|
101
|
+
ctx.help = !!props.description || has(FieldHelp);
|
|
102
|
+
ctx.error = !!props.error || has(FieldError);
|
|
103
|
+
return h("div", {
|
|
104
|
+
...attrs,
|
|
105
|
+
class: cx("hl-field", attrs.class),
|
|
106
|
+
"data-hl-invalid": ctx.invalid || void 0
|
|
107
|
+
}, [
|
|
108
|
+
slots.label ? h(FieldLabel, null, slots.label) : props.label && h(FieldLabel, () => props.label),
|
|
109
|
+
children,
|
|
110
|
+
props.description && h(FieldHelp, () => props.description),
|
|
111
|
+
props.error && h(FieldError, () => props.error)
|
|
112
|
+
]);
|
|
113
|
+
};
|
|
59
114
|
}
|
|
60
|
-
|
|
115
|
+
});
|
|
116
|
+
function useField() {
|
|
117
|
+
return inject(FieldKey, null);
|
|
61
118
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
119
|
+
function fieldAttrs(field) {
|
|
120
|
+
return {
|
|
121
|
+
id: field?.id,
|
|
122
|
+
"aria-describedby": field?.describedBy,
|
|
123
|
+
"aria-invalid": field?.invalid || void 0,
|
|
124
|
+
required: field?.required || void 0
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
var FieldLabel = defineComponent({
|
|
128
|
+
name: "HlFieldLabel",
|
|
129
|
+
inheritAttrs: false,
|
|
130
|
+
setup(_, { slots, attrs }) {
|
|
131
|
+
const ctx = inject(FieldKey, null);
|
|
132
|
+
return () => h("label", {
|
|
133
|
+
for: ctx?.id,
|
|
134
|
+
...attrs,
|
|
135
|
+
class: cx("hl-label", attrs.class),
|
|
136
|
+
"data-hl-required": ctx?.required || void 0
|
|
137
|
+
}, slots.default?.());
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
var FieldHelp = defineComponent({
|
|
141
|
+
name: "HlFieldHelp",
|
|
142
|
+
inheritAttrs: false,
|
|
143
|
+
setup(_, { slots, attrs }) {
|
|
144
|
+
const ctx = inject(FieldKey, null);
|
|
145
|
+
return () => h("p", { ...attrs, id: ctx?.helpId, class: cx("hl-help", attrs.class) }, slots.default?.());
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
var FieldError = defineComponent({
|
|
149
|
+
name: "HlFieldError",
|
|
150
|
+
inheritAttrs: false,
|
|
151
|
+
setup(_, { slots, attrs }) {
|
|
152
|
+
const ctx = inject(FieldKey, null);
|
|
153
|
+
return () => {
|
|
154
|
+
const content = slots.default?.();
|
|
155
|
+
if (!content || Array.isArray(content) && content.length === 0)
|
|
156
|
+
return null;
|
|
157
|
+
return h("p", { ...attrs, id: ctx?.errorId, role: "alert", class: cx("hl-error", attrs.class) }, content);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
var Fieldset = defineComponent({
|
|
162
|
+
name: "HlFieldset",
|
|
163
|
+
inheritAttrs: false,
|
|
164
|
+
setup(_, { slots, attrs }) {
|
|
165
|
+
return () => h("fieldset", { ...attrs, class: cx("hl-fieldset", attrs.class) }, [
|
|
166
|
+
slots.legend && h("legend", { class: "hl-legend" }, slots.legend()),
|
|
167
|
+
slots.default?.()
|
|
168
|
+
]);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
var textProps = {
|
|
172
|
+
size: { type: String, default: void 0 },
|
|
173
|
+
invalid: { type: Boolean, default: false }
|
|
87
174
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
175
|
+
var target = (e) => e.target;
|
|
176
|
+
var inputProps = {
|
|
177
|
+
...textProps,
|
|
178
|
+
modelValue: { type: [String, Number], default: void 0 }
|
|
179
|
+
};
|
|
180
|
+
var Input = defineComponent({
|
|
181
|
+
name: "HlInput",
|
|
182
|
+
inheritAttrs: false,
|
|
183
|
+
props: inputProps,
|
|
184
|
+
emits: ["update:modelValue"],
|
|
185
|
+
setup(props, { attrs, emit }) {
|
|
186
|
+
const field = useField();
|
|
187
|
+
return () => h("input", {
|
|
188
|
+
...fieldAttrs(field),
|
|
189
|
+
...attrs,
|
|
190
|
+
class: cx("hl-input", attrs.class),
|
|
191
|
+
"data-hl-size": props.size,
|
|
192
|
+
"data-hl-invalid": props.invalid || void 0,
|
|
193
|
+
"aria-invalid": props.invalid || field?.invalid || void 0,
|
|
194
|
+
value: props.modelValue,
|
|
195
|
+
onInput: (e) => emit("update:modelValue", target(e).value)
|
|
196
|
+
});
|
|
94
197
|
}
|
|
95
|
-
|
|
198
|
+
});
|
|
199
|
+
var textareaProps = {
|
|
200
|
+
...textProps,
|
|
201
|
+
modelValue: { type: String, default: void 0 },
|
|
202
|
+
autosize: { type: Boolean, default: false }
|
|
96
203
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
204
|
+
var Textarea = defineComponent({
|
|
205
|
+
name: "HlTextarea",
|
|
206
|
+
inheritAttrs: false,
|
|
207
|
+
props: textareaProps,
|
|
208
|
+
emits: ["update:modelValue"],
|
|
209
|
+
setup(props, { attrs, emit }) {
|
|
210
|
+
const field = useField();
|
|
211
|
+
return () => h("textarea", {
|
|
212
|
+
...fieldAttrs(field),
|
|
213
|
+
...attrs,
|
|
214
|
+
class: cx("hl-textarea", attrs.class),
|
|
215
|
+
"data-hl-size": props.size,
|
|
216
|
+
"data-hl-invalid": props.invalid || void 0,
|
|
217
|
+
"data-hl-autosize": props.autosize || void 0,
|
|
218
|
+
"aria-invalid": props.invalid || field?.invalid || void 0,
|
|
219
|
+
value: props.modelValue,
|
|
220
|
+
onInput: (e) => emit("update:modelValue", target(e).value)
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
var selectProps = {
|
|
225
|
+
...textProps,
|
|
226
|
+
modelValue: { type: String, default: void 0 }
|
|
227
|
+
};
|
|
228
|
+
var Select = defineComponent({
|
|
229
|
+
name: "HlSelect",
|
|
230
|
+
inheritAttrs: false,
|
|
231
|
+
props: selectProps,
|
|
232
|
+
emits: ["update:modelValue"],
|
|
233
|
+
setup(props, { slots, attrs, emit }) {
|
|
234
|
+
const field = useField();
|
|
235
|
+
return () => h("span", { class: "hl-select-wrapper" }, [
|
|
236
|
+
h("select", {
|
|
237
|
+
...fieldAttrs(field),
|
|
238
|
+
...attrs,
|
|
239
|
+
class: cx("hl-select", attrs.class),
|
|
240
|
+
"data-hl-size": props.size,
|
|
241
|
+
"data-hl-invalid": props.invalid || void 0,
|
|
242
|
+
"aria-invalid": props.invalid || field?.invalid || void 0,
|
|
243
|
+
value: props.modelValue,
|
|
244
|
+
onChange: (e) => emit("update:modelValue", target(e).value)
|
|
245
|
+
}, slots.default?.())
|
|
246
|
+
]);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
var checkedProps = {
|
|
250
|
+
modelValue: { type: Boolean, default: void 0 }
|
|
251
|
+
};
|
|
252
|
+
function checkable(name, wrapper, role) {
|
|
253
|
+
return defineComponent({
|
|
254
|
+
name,
|
|
255
|
+
inheritAttrs: false,
|
|
256
|
+
props: checkedProps,
|
|
257
|
+
emits: ["update:modelValue"],
|
|
258
|
+
setup(props, { slots, attrs, emit }) {
|
|
259
|
+
const field = useField();
|
|
260
|
+
return () => h("label", { ...wrapper, class: cx(wrapper.class, attrs.class) }, [
|
|
261
|
+
h("input", {
|
|
262
|
+
...fieldAttrs(field),
|
|
263
|
+
...attrs,
|
|
264
|
+
class: void 0,
|
|
265
|
+
type: "checkbox",
|
|
266
|
+
role,
|
|
267
|
+
checked: props.modelValue,
|
|
268
|
+
onChange: (e) => emit("update:modelValue", target(e).checked)
|
|
269
|
+
}),
|
|
270
|
+
slots.default && h("span", slots.default())
|
|
271
|
+
]);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
123
274
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
275
|
+
var Checkbox = checkable("HlCheckbox", { class: "hl-checkbox" });
|
|
276
|
+
var Switch = checkable("HlSwitch", { "data-hl-switch": "" }, "switch");
|
|
277
|
+
var sliderProps = {
|
|
278
|
+
modelValue: { type: [String, Number], default: void 0 }
|
|
279
|
+
};
|
|
280
|
+
var Slider = defineComponent({
|
|
281
|
+
name: "HlSlider",
|
|
282
|
+
inheritAttrs: false,
|
|
283
|
+
props: sliderProps,
|
|
284
|
+
emits: ["update:modelValue"],
|
|
285
|
+
setup(props, { attrs, emit }) {
|
|
286
|
+
const field = useField();
|
|
287
|
+
return () => h("input", {
|
|
288
|
+
...fieldAttrs(field),
|
|
289
|
+
...attrs,
|
|
290
|
+
type: "range",
|
|
291
|
+
class: cx("hl-slider", attrs.class),
|
|
292
|
+
value: props.modelValue,
|
|
293
|
+
onInput: (e) => emit("update:modelValue", target(e).value)
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
var RadioGroupKey = Symbol("hl-radio-group");
|
|
298
|
+
var radioGroupProps = {
|
|
299
|
+
modelValue: { type: String, default: void 0 },
|
|
300
|
+
defaultValue: { type: String, default: void 0 },
|
|
301
|
+
name: { type: String, default: void 0 },
|
|
302
|
+
orientation: {
|
|
303
|
+
type: String,
|
|
304
|
+
default: void 0
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
var RadioGroup = defineComponent({
|
|
308
|
+
name: "HlRadioGroup",
|
|
309
|
+
inheritAttrs: false,
|
|
310
|
+
props: radioGroupProps,
|
|
311
|
+
emits: ["update:modelValue"],
|
|
312
|
+
setup(props, { slots, attrs, emit }) {
|
|
313
|
+
const name = props.name ?? useId();
|
|
314
|
+
const { value, set } = useControlled(props, emit, {
|
|
315
|
+
prop: "modelValue",
|
|
316
|
+
event: "update:modelValue",
|
|
317
|
+
default: props.defaultValue
|
|
318
|
+
});
|
|
319
|
+
provide(RadioGroupKey, {
|
|
320
|
+
get name() {
|
|
321
|
+
return name;
|
|
322
|
+
},
|
|
323
|
+
get value() {
|
|
324
|
+
return value.value;
|
|
325
|
+
},
|
|
326
|
+
select: set
|
|
327
|
+
});
|
|
328
|
+
return () => h("div", {
|
|
329
|
+
...attrs,
|
|
330
|
+
role: "radiogroup",
|
|
331
|
+
class: cx("hl-radio-group", attrs.class),
|
|
332
|
+
"data-hl-orientation": props.orientation,
|
|
333
|
+
"aria-orientation": props.orientation
|
|
334
|
+
}, slots.default?.());
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
var radioProps = {
|
|
338
|
+
value: { type: String, required: true }
|
|
339
|
+
};
|
|
340
|
+
var Radio = defineComponent({
|
|
341
|
+
name: "HlRadio",
|
|
342
|
+
inheritAttrs: false,
|
|
343
|
+
props: radioProps,
|
|
344
|
+
setup(props, { slots, attrs }) {
|
|
345
|
+
const group = inject(RadioGroupKey, null);
|
|
346
|
+
return () => h("label", { class: cx("hl-radio", attrs.class) }, [
|
|
347
|
+
h("input", {
|
|
348
|
+
name: group?.name,
|
|
349
|
+
...attrs,
|
|
350
|
+
class: void 0,
|
|
351
|
+
type: "radio",
|
|
352
|
+
value: props.value,
|
|
353
|
+
checked: group ? group.value === props.value : void 0,
|
|
354
|
+
onChange: () => group?.select(props.value)
|
|
355
|
+
}),
|
|
356
|
+
slots.default && h("span", slots.default())
|
|
357
|
+
]);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
var segmentedControlProps = {
|
|
361
|
+
options: { type: Array, default: () => [] },
|
|
362
|
+
modelValue: { type: String, default: void 0 },
|
|
363
|
+
defaultValue: { type: String, default: void 0 },
|
|
364
|
+
name: { type: String, default: void 0 },
|
|
365
|
+
size: { type: String, default: void 0 }
|
|
366
|
+
};
|
|
367
|
+
var SegmentedControl = defineComponent({
|
|
368
|
+
name: "HlSegmentedControl",
|
|
369
|
+
inheritAttrs: false,
|
|
370
|
+
props: segmentedControlProps,
|
|
371
|
+
emits: ["update:modelValue"],
|
|
372
|
+
setup(props, { attrs, emit }) {
|
|
373
|
+
const name = props.name ?? useId();
|
|
374
|
+
const { value, set } = useControlled(props, emit, {
|
|
375
|
+
prop: "modelValue",
|
|
376
|
+
event: "update:modelValue",
|
|
377
|
+
default: props.defaultValue ?? props.options[0]?.value
|
|
378
|
+
});
|
|
379
|
+
return () => h("div", {
|
|
380
|
+
...attrs,
|
|
381
|
+
role: "radiogroup",
|
|
382
|
+
class: cx("hl-segmented", attrs.class),
|
|
383
|
+
"data-hl-size": props.size
|
|
384
|
+
}, props.options.map((option) => h("label", { class: "hl-segmented-item", key: option.value }, [
|
|
385
|
+
h("input", {
|
|
386
|
+
type: "radio",
|
|
387
|
+
name,
|
|
388
|
+
value: option.value,
|
|
389
|
+
checked: value.value === option.value,
|
|
390
|
+
disabled: option.disabled,
|
|
391
|
+
onChange: () => set(option.value)
|
|
392
|
+
}),
|
|
393
|
+
h("span", option.label)
|
|
394
|
+
])));
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
var AccordionKey = Symbol("hl-accordion");
|
|
398
|
+
var accordionProps = {
|
|
130
399
|
allowMultiple: { type: Boolean, default: false },
|
|
131
|
-
/** Controlled list of open item values (`v-model`). */
|
|
132
400
|
modelValue: { type: Array, default: void 0 },
|
|
133
|
-
/** Initially open item values for uncontrolled usage. */
|
|
134
401
|
defaultValue: { type: Array, default: void 0 }
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
402
|
+
};
|
|
403
|
+
var Accordion = defineComponent({
|
|
404
|
+
name: "HlAccordion",
|
|
405
|
+
inheritAttrs: false,
|
|
406
|
+
props: accordionProps,
|
|
407
|
+
emits: ["update:modelValue"],
|
|
408
|
+
setup(props, { slots, attrs, emit }) {
|
|
409
|
+
const host = ref(null);
|
|
410
|
+
const { value, set } = useControlled(props, emit, {
|
|
411
|
+
prop: "modelValue",
|
|
412
|
+
event: "update:modelValue",
|
|
413
|
+
default: props.defaultValue
|
|
414
|
+
});
|
|
415
|
+
const api = useEnhancer(host, enhanceAccordion, () => ({
|
|
416
|
+
allowMultiple: props.allowMultiple,
|
|
417
|
+
defaultValue: value.value,
|
|
418
|
+
onValueChange: set
|
|
419
|
+
}), () => props.allowMultiple);
|
|
420
|
+
useApiSync(api, value, (a) => a.value, (a, v) => a.setValue(v));
|
|
421
|
+
let count = 0;
|
|
422
|
+
provide(AccordionKey, { value, register: () => count++ });
|
|
423
|
+
return () => h("div", { ...attrs, "data-hl-accordion": "", ref: host }, slots.default?.());
|
|
424
|
+
}
|
|
153
425
|
});
|
|
154
|
-
var
|
|
155
|
-
name: "HlAccordionItem",
|
|
156
|
-
inheritAttrs: false,
|
|
157
|
-
props: {
|
|
158
|
-
/** Stable value identifying this item; defaults to its index. */
|
|
426
|
+
var accordionItemProps = {
|
|
159
427
|
value: { type: String, default: void 0 },
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
428
|
+
title: { type: String, default: void 0 }
|
|
429
|
+
};
|
|
430
|
+
var AccordionItem = defineComponent({
|
|
431
|
+
name: "HlAccordionItem",
|
|
432
|
+
inheritAttrs: false,
|
|
433
|
+
props: accordionItemProps,
|
|
434
|
+
setup(props, { slots, attrs }) {
|
|
435
|
+
const ctx = inject(AccordionKey, null);
|
|
436
|
+
const index = ctx?.register();
|
|
437
|
+
const open = computed(() => ctx?.value.value?.includes(props.value ?? String(index)));
|
|
438
|
+
return () => h("details", { ...attrs, "data-hl-value": props.value, open: open.value || void 0 }, [
|
|
439
|
+
h("summary", slots.summary?.() ?? props.title),
|
|
440
|
+
h("div", { class: "hl-accordion-panel" }, slots.default?.())
|
|
441
|
+
]);
|
|
442
|
+
}
|
|
172
443
|
});
|
|
444
|
+
var disclosureProps = {
|
|
445
|
+
open: { type: Boolean, default: void 0 },
|
|
446
|
+
defaultOpen: { type: Boolean, default: false },
|
|
447
|
+
title: { type: String, default: void 0 }
|
|
448
|
+
};
|
|
173
449
|
var Disclosure = defineComponent({
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
450
|
+
name: "HlDisclosure",
|
|
451
|
+
inheritAttrs: false,
|
|
452
|
+
props: disclosureProps,
|
|
453
|
+
emits: ["update:open"],
|
|
454
|
+
setup(props, { slots, attrs, emit }) {
|
|
455
|
+
const host = ref(null);
|
|
456
|
+
const { value: open, set } = useControlled(props, emit, {
|
|
457
|
+
prop: "open",
|
|
458
|
+
event: "update:open",
|
|
459
|
+
default: props.defaultOpen
|
|
460
|
+
});
|
|
461
|
+
const api = useEnhancer(host, enhanceDisclosure, () => ({
|
|
462
|
+
defaultOpen: open.value,
|
|
463
|
+
onOpenChange: set
|
|
464
|
+
}));
|
|
465
|
+
useApiSync(api, open, (a) => a.open, (a, v) => a.setOpen(v));
|
|
466
|
+
return () => h("details", {
|
|
467
|
+
...attrs,
|
|
468
|
+
class: cx("hl-disclosure", attrs.class),
|
|
469
|
+
"data-hl-disclosure": "",
|
|
470
|
+
open: open.value || void 0,
|
|
471
|
+
ref: host
|
|
472
|
+
}, [
|
|
473
|
+
h("summary", slots.summary?.() ?? props.title),
|
|
474
|
+
h("div", { class: "hl-disclosure-panel" }, slots.default?.())
|
|
475
|
+
]);
|
|
476
|
+
}
|
|
198
477
|
});
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
import { defineComponent as defineComponent2, h as h2, watch as watch2 } from "vue";
|
|
202
|
-
import { enhanceTabs as enhanceTabs2 } from "@hydrateless/enhancers";
|
|
203
|
-
var Tabs = defineComponent2({
|
|
204
|
-
name: "HlTabs",
|
|
205
|
-
inheritAttrs: false,
|
|
206
|
-
props: {
|
|
478
|
+
var TabsKey = Symbol("hl-tabs");
|
|
479
|
+
var tabsProps = {
|
|
207
480
|
activation: { type: String, default: void 0 },
|
|
208
|
-
orientation: {
|
|
209
|
-
type: String,
|
|
210
|
-
default: void 0
|
|
211
|
-
},
|
|
212
|
-
/** Controlled value of the selected tab (`v-model`). */
|
|
481
|
+
orientation: { type: String, default: void 0 },
|
|
213
482
|
modelValue: { type: String, default: void 0 },
|
|
214
|
-
/** Initial value for uncontrolled usage. */
|
|
215
483
|
defaultValue: { type: String, default: void 0 }
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
484
|
+
};
|
|
485
|
+
var Tabs = defineComponent({
|
|
486
|
+
name: "HlTabs",
|
|
487
|
+
inheritAttrs: false,
|
|
488
|
+
props: tabsProps,
|
|
489
|
+
emits: ["update:modelValue"],
|
|
490
|
+
setup(props, { slots, attrs, emit }) {
|
|
491
|
+
const host = ref(null);
|
|
492
|
+
const { value, set } = useControlled(props, emit, {
|
|
493
|
+
prop: "modelValue",
|
|
494
|
+
event: "update:modelValue",
|
|
495
|
+
default: props.defaultValue
|
|
496
|
+
});
|
|
497
|
+
const api = useEnhancer(host, enhanceTabs, () => ({
|
|
498
|
+
activation: props.activation,
|
|
499
|
+
orientation: props.orientation,
|
|
500
|
+
defaultValue: value.value,
|
|
501
|
+
onValueChange: set
|
|
502
|
+
}), () => [props.activation, props.orientation]);
|
|
503
|
+
useApiSync(api, value, (a) => a.value, (a, v) => a.setValue(v));
|
|
504
|
+
const values = [];
|
|
505
|
+
let panels = 0;
|
|
506
|
+
provide(TabsKey, {
|
|
507
|
+
id: useId(),
|
|
508
|
+
value,
|
|
509
|
+
values,
|
|
510
|
+
tab: (v) => values.push(v ?? String(values.length)) - 1,
|
|
511
|
+
panel: () => panels++
|
|
512
|
+
});
|
|
513
|
+
return () => h("div", { ...attrs, "data-hl-tabs": "", ref: host }, slots.default?.());
|
|
514
|
+
}
|
|
235
515
|
});
|
|
236
|
-
var TabList =
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
516
|
+
var TabList = defineComponent({
|
|
517
|
+
name: "HlTabList",
|
|
518
|
+
inheritAttrs: false,
|
|
519
|
+
setup(_, { slots, attrs }) {
|
|
520
|
+
return () => h("div", { ...attrs, role: "tablist" }, slots.default?.());
|
|
521
|
+
}
|
|
242
522
|
});
|
|
243
|
-
var
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
)
|
|
256
|
-
|
|
523
|
+
var tabProps = {
|
|
524
|
+
value: { type: String, default: void 0 },
|
|
525
|
+
disabled: { type: Boolean, default: false }
|
|
526
|
+
};
|
|
527
|
+
function isSelected(ctx, index) {
|
|
528
|
+
const selected = ctx?.value.value;
|
|
529
|
+
return selected === void 0 ? index === 0 : ctx.values.indexOf(selected) === index;
|
|
530
|
+
}
|
|
531
|
+
var Tab = defineComponent({
|
|
532
|
+
name: "HlTab",
|
|
533
|
+
inheritAttrs: false,
|
|
534
|
+
props: tabProps,
|
|
535
|
+
setup(props, { slots, attrs }) {
|
|
536
|
+
const ctx = inject(TabsKey, null);
|
|
537
|
+
const index = ctx?.tab(props.value) ?? 0;
|
|
538
|
+
const selected = computed(() => isSelected(ctx, index));
|
|
539
|
+
return () => h("button", {
|
|
540
|
+
type: "button",
|
|
541
|
+
...attrs,
|
|
542
|
+
id: ctx && `${ctx.id}-t${index}`,
|
|
543
|
+
role: "tab",
|
|
544
|
+
"data-hl-value": props.value,
|
|
545
|
+
"aria-selected": String(selected.value),
|
|
546
|
+
"aria-controls": ctx && `${ctx.id}-p${index}`,
|
|
547
|
+
"aria-disabled": props.disabled || void 0,
|
|
548
|
+
tabindex: selected.value ? 0 : -1
|
|
549
|
+
}, slots.default?.());
|
|
550
|
+
}
|
|
257
551
|
});
|
|
258
|
-
var TabPanel =
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
552
|
+
var TabPanel = defineComponent({
|
|
553
|
+
name: "HlTabPanel",
|
|
554
|
+
inheritAttrs: false,
|
|
555
|
+
setup(_, { slots, attrs }) {
|
|
556
|
+
const ctx = inject(TabsKey, null);
|
|
557
|
+
const index = ctx?.panel() ?? 0;
|
|
558
|
+
const selected = computed(() => isSelected(ctx, index));
|
|
559
|
+
return () => h("div", {
|
|
560
|
+
...attrs,
|
|
561
|
+
id: ctx && `${ctx.id}-p${index}`,
|
|
562
|
+
role: "tabpanel",
|
|
563
|
+
"aria-labelledby": ctx && `${ctx.id}-t${index}`,
|
|
564
|
+
tabindex: 0,
|
|
565
|
+
hidden: !selected.value
|
|
566
|
+
}, slots.default?.());
|
|
567
|
+
}
|
|
264
568
|
});
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
enhanceDropdown as enhanceDropdown2
|
|
270
|
-
} from "@hydrateless/enhancers";
|
|
271
|
-
var Dropdown = defineComponent3({
|
|
272
|
-
name: "HlDropdown",
|
|
273
|
-
inheritAttrs: false,
|
|
274
|
-
props: {
|
|
275
|
-
placement: {
|
|
276
|
-
type: String,
|
|
277
|
-
default: void 0
|
|
278
|
-
},
|
|
279
|
-
/** Controlled open state (`v-model:open`). */
|
|
569
|
+
var DropdownKey = Symbol("hl-dropdown");
|
|
570
|
+
var dropdownProps = {
|
|
571
|
+
placement: { type: String, default: void 0 },
|
|
572
|
+
closeOnSelect: { type: Boolean, default: true },
|
|
280
573
|
open: { type: Boolean, default: void 0 },
|
|
281
|
-
/** Open the menu initially for uncontrolled usage. */
|
|
282
574
|
defaultOpen: { type: Boolean, default: false }
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
575
|
+
};
|
|
576
|
+
var Dropdown = defineComponent({
|
|
577
|
+
name: "HlDropdown",
|
|
578
|
+
inheritAttrs: false,
|
|
579
|
+
props: dropdownProps,
|
|
580
|
+
emits: ["update:open", "select"],
|
|
581
|
+
setup(props, { slots, attrs, emit }) {
|
|
582
|
+
const host = ref(null);
|
|
583
|
+
const { value: open, set } = useControlled(props, emit, {
|
|
584
|
+
prop: "open",
|
|
585
|
+
event: "update:open",
|
|
586
|
+
default: props.defaultOpen
|
|
587
|
+
});
|
|
588
|
+
const api = useEnhancer(host, enhanceDropdown, () => ({
|
|
589
|
+
placement: props.placement,
|
|
590
|
+
closeOnSelect: props.closeOnSelect,
|
|
591
|
+
defaultOpen: open.value,
|
|
592
|
+
onOpenChange: set,
|
|
593
|
+
onSelect: (value, item, checked) => emit("select", value, item, checked)
|
|
594
|
+
}), () => [props.placement, props.closeOnSelect]);
|
|
595
|
+
useApiSync(api, open, (a) => a.open, (a, v) => a.setOpen(v));
|
|
596
|
+
provide(DropdownKey, { menuId: useId(), open });
|
|
597
|
+
return () => h("div", { ...attrs, "data-hl-dropdown": "", ref: host }, slots.default?.());
|
|
598
|
+
}
|
|
301
599
|
});
|
|
302
|
-
var DropdownTrigger =
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
600
|
+
var DropdownTrigger = defineComponent({
|
|
601
|
+
name: "HlDropdownTrigger",
|
|
602
|
+
inheritAttrs: false,
|
|
603
|
+
setup(_, { slots, attrs }) {
|
|
604
|
+
const ctx = inject(DropdownKey, null);
|
|
605
|
+
return () => h("button", {
|
|
606
|
+
type: "button",
|
|
607
|
+
...attrs,
|
|
608
|
+
"data-hl-dropdown-trigger": "",
|
|
609
|
+
popovertarget: ctx?.menuId,
|
|
610
|
+
"aria-haspopup": "menu",
|
|
611
|
+
"aria-expanded": String(!!ctx?.open.value)
|
|
612
|
+
}, slots.default?.());
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
var DropdownMenu = defineComponent({
|
|
616
|
+
name: "HlDropdownMenu",
|
|
617
|
+
inheritAttrs: false,
|
|
618
|
+
setup(_, { slots, attrs }) {
|
|
619
|
+
const ctx = inject(DropdownKey, null);
|
|
620
|
+
return () => h("ul", { ...attrs, id: ctx?.menuId, popover: "auto", role: "menu", "data-hl-dropdown-menu": "" }, slots.default?.());
|
|
621
|
+
}
|
|
308
622
|
});
|
|
309
|
-
var
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
623
|
+
var dropdownItemProps = {
|
|
624
|
+
value: { type: String, default: void 0 },
|
|
625
|
+
disabled: { type: Boolean, default: false },
|
|
626
|
+
role: {
|
|
627
|
+
type: String,
|
|
628
|
+
default: "menuitem"
|
|
629
|
+
},
|
|
630
|
+
checked: { type: Boolean, default: void 0 }
|
|
631
|
+
};
|
|
632
|
+
var DropdownItem = defineComponent({
|
|
633
|
+
name: "HlDropdownItem",
|
|
634
|
+
inheritAttrs: false,
|
|
635
|
+
props: dropdownItemProps,
|
|
636
|
+
emits: ["click", "select"],
|
|
637
|
+
setup(props, { slots, attrs, emit }) {
|
|
638
|
+
return () => {
|
|
639
|
+
const checkable2 = props.role !== "menuitem";
|
|
640
|
+
return h("li", [
|
|
641
|
+
h("button", {
|
|
642
|
+
type: "button",
|
|
643
|
+
...attrs,
|
|
644
|
+
role: props.role,
|
|
645
|
+
"data-hl-value": props.value,
|
|
646
|
+
disabled: props.disabled || void 0,
|
|
647
|
+
"aria-checked": checkable2 ? String(!!props.checked) : void 0,
|
|
648
|
+
onClick: (e) => {
|
|
649
|
+
emit("click", e);
|
|
650
|
+
const el = e.currentTarget;
|
|
651
|
+
const value = props.value ?? el.textContent?.trim() ?? "";
|
|
652
|
+
const checked = props.role === "menuitemcheckbox" ? el.getAttribute("aria-checked") !== "true" : props.role === "menuitemradio" || void 0;
|
|
653
|
+
emit("select", value, checked);
|
|
654
|
+
}
|
|
655
|
+
}, slots.default?.())
|
|
656
|
+
]);
|
|
657
|
+
};
|
|
658
|
+
}
|
|
315
659
|
});
|
|
316
|
-
var
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
{
|
|
325
|
-
|
|
326
|
-
...attrs,
|
|
327
|
-
role: "menuitem",
|
|
328
|
-
onClick: () => emit("select")
|
|
329
|
-
},
|
|
330
|
-
slots.default?.()
|
|
331
|
-
)
|
|
332
|
-
]);
|
|
333
|
-
}
|
|
660
|
+
var dropdownGroupProps = {
|
|
661
|
+
label: { type: String, default: void 0 }
|
|
662
|
+
};
|
|
663
|
+
var DropdownGroup = defineComponent({
|
|
664
|
+
name: "HlDropdownGroup",
|
|
665
|
+
inheritAttrs: false,
|
|
666
|
+
props: dropdownGroupProps,
|
|
667
|
+
setup(props, { slots, attrs }) {
|
|
668
|
+
return () => h("li", [h("ul", { ...attrs, role: "group", "aria-label": props.label }, slots.default?.())]);
|
|
669
|
+
}
|
|
334
670
|
});
|
|
335
|
-
var DropdownSeparator =
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
671
|
+
var DropdownSeparator = defineComponent({
|
|
672
|
+
name: "HlDropdownSeparator",
|
|
673
|
+
inheritAttrs: false,
|
|
674
|
+
setup(_, { attrs }) {
|
|
675
|
+
return () => h("li", {
|
|
676
|
+
...attrs,
|
|
677
|
+
role: "separator",
|
|
678
|
+
class: cx("hl-dropdown-separator", attrs.class)
|
|
679
|
+
});
|
|
680
|
+
}
|
|
341
681
|
});
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
import { defineComponent as defineComponent4, h as h4 } from "vue";
|
|
345
|
-
import { enhanceMenu as enhanceMenu2 } from "@hydrateless/enhancers";
|
|
346
|
-
var Menu = defineComponent4({
|
|
347
|
-
name: "HlMenu",
|
|
348
|
-
inheritAttrs: false,
|
|
349
|
-
props: {
|
|
682
|
+
var MenuKey = Symbol("hl-menu");
|
|
683
|
+
var menuProps = {
|
|
350
684
|
orientation: {
|
|
351
|
-
|
|
352
|
-
|
|
685
|
+
type: String,
|
|
686
|
+
default: "horizontal"
|
|
687
|
+
},
|
|
688
|
+
modelValue: { type: String, default: void 0 },
|
|
689
|
+
defaultValue: { type: String, default: null }
|
|
690
|
+
};
|
|
691
|
+
var Menu = defineComponent({
|
|
692
|
+
name: "HlMenu",
|
|
693
|
+
inheritAttrs: false,
|
|
694
|
+
props: menuProps,
|
|
695
|
+
emits: ["update:modelValue", "select"],
|
|
696
|
+
setup(props, { slots, attrs, emit }) {
|
|
697
|
+
const host = ref(null);
|
|
698
|
+
const { value, set } = useControlled(props, emit, { prop: "modelValue", event: "update:modelValue", default: props.defaultValue });
|
|
699
|
+
const api = useEnhancer(host, enhanceMenu, () => ({
|
|
700
|
+
orientation: props.orientation,
|
|
701
|
+
defaultValue: value.value,
|
|
702
|
+
onValueChange: set,
|
|
703
|
+
onSelect: (v, item, checked) => emit("select", v, item, checked)
|
|
704
|
+
}), () => props.orientation);
|
|
705
|
+
useApiSync(api, value, (a) => a.value, (a, v) => a.setValue(v));
|
|
706
|
+
let count = 0;
|
|
707
|
+
provide(MenuKey, { register: () => count++ });
|
|
708
|
+
return () => h("ul", {
|
|
709
|
+
...attrs,
|
|
710
|
+
"data-hl-menu": "",
|
|
711
|
+
role: props.orientation === "vertical" ? "menu" : "menubar",
|
|
712
|
+
"aria-orientation": props.orientation,
|
|
713
|
+
ref: host
|
|
714
|
+
}, slots.default?.());
|
|
353
715
|
}
|
|
354
|
-
},
|
|
355
|
-
setup(props, { slots, attrs }) {
|
|
356
|
-
const { host } = useHostEnhancer((el) => enhanceMenu2(el, { orientation: props.orientation }));
|
|
357
|
-
return () => h4(
|
|
358
|
-
"ul",
|
|
359
|
-
{
|
|
360
|
-
...attrs,
|
|
361
|
-
"data-hl-menu": "",
|
|
362
|
-
role: props.orientation === "vertical" ? "menu" : "menubar",
|
|
363
|
-
"aria-orientation": props.orientation,
|
|
364
|
-
ref: host
|
|
365
|
-
},
|
|
366
|
-
slots.default?.()
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
716
|
});
|
|
370
|
-
var
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
717
|
+
var menuItemProps = {
|
|
718
|
+
href: { type: String, default: void 0 },
|
|
719
|
+
value: { type: String, default: void 0 },
|
|
720
|
+
role: {
|
|
721
|
+
type: String,
|
|
722
|
+
default: "menuitem"
|
|
723
|
+
},
|
|
724
|
+
checked: { type: Boolean, default: void 0 },
|
|
725
|
+
disabled: { type: Boolean, default: false }
|
|
726
|
+
};
|
|
727
|
+
var MenuItem = defineComponent({
|
|
728
|
+
name: "HlMenuItem",
|
|
729
|
+
inheritAttrs: false,
|
|
730
|
+
props: menuItemProps,
|
|
731
|
+
emits: ["click"],
|
|
732
|
+
setup(props, { slots, attrs, emit }) {
|
|
733
|
+
inject(MenuKey, null)?.register();
|
|
734
|
+
return () => {
|
|
735
|
+
const common = {
|
|
736
|
+
...attrs,
|
|
737
|
+
role: props.role,
|
|
738
|
+
"aria-checked": props.role === "menuitem" ? void 0 : String(props.checked ?? false),
|
|
739
|
+
"aria-disabled": props.disabled || void 0,
|
|
740
|
+
"data-hl-value": props.value,
|
|
741
|
+
onClick: (e) => emit("click", e)
|
|
742
|
+
};
|
|
743
|
+
const label = props.href ? h("a", { ...common, href: props.href }, slots.default?.()) : h("button", { type: "button", disabled: props.disabled || void 0, ...common }, [
|
|
744
|
+
slots.default?.()
|
|
745
|
+
]);
|
|
746
|
+
return h("li", { role: "none" }, [label]);
|
|
747
|
+
};
|
|
748
|
+
}
|
|
394
749
|
});
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
return host;
|
|
419
|
-
}
|
|
420
|
-
var Modal = defineComponent5({
|
|
421
|
-
name: "HlModal",
|
|
422
|
-
inheritAttrs: false,
|
|
423
|
-
props: {
|
|
424
|
-
open: { type: Boolean, required: true },
|
|
425
|
-
closeOnBackdrop: { type: Boolean, default: true }
|
|
426
|
-
},
|
|
427
|
-
emits: ["update:open"],
|
|
428
|
-
setup(props, { slots, attrs, emit }) {
|
|
429
|
-
const host = useDialogEnhancer(props, emit, enhanceModal2);
|
|
430
|
-
return () => h5(
|
|
431
|
-
"dialog",
|
|
432
|
-
{
|
|
433
|
-
...attrs,
|
|
434
|
-
class: cx("hl-modal", attrs.class),
|
|
435
|
-
"data-hl-modal": "",
|
|
436
|
-
ref: host
|
|
437
|
-
},
|
|
438
|
-
slots.default?.()
|
|
439
|
-
);
|
|
440
|
-
}
|
|
750
|
+
var menuSubmenuProps = {
|
|
751
|
+
label: { type: String, default: void 0 },
|
|
752
|
+
value: { type: String, default: void 0 },
|
|
753
|
+
disabled: { type: Boolean, default: false }
|
|
754
|
+
};
|
|
755
|
+
var MenuSubmenu = defineComponent({
|
|
756
|
+
name: "HlMenuSubmenu",
|
|
757
|
+
inheritAttrs: false,
|
|
758
|
+
props: menuSubmenuProps,
|
|
759
|
+
setup(props, { slots, attrs }) {
|
|
760
|
+
inject(MenuKey, null)?.register();
|
|
761
|
+
provide(MenuKey, null);
|
|
762
|
+
return () => h("li", { role: "none" }, [
|
|
763
|
+
h("button", {
|
|
764
|
+
type: "button",
|
|
765
|
+
role: "menuitem",
|
|
766
|
+
"data-hl-value": props.value,
|
|
767
|
+
"aria-disabled": props.disabled || void 0,
|
|
768
|
+
disabled: props.disabled || void 0
|
|
769
|
+
}, slots.trigger ? slots.trigger() : props.label),
|
|
770
|
+
h("ul", { ...attrs, role: "menu", "data-hl-menu-submenu": "" }, slots.default?.())
|
|
771
|
+
]);
|
|
772
|
+
}
|
|
441
773
|
});
|
|
442
|
-
var
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
774
|
+
var openProps = {
|
|
775
|
+
open: { type: Boolean, default: void 0 },
|
|
776
|
+
defaultOpen: { type: Boolean, default: false }
|
|
777
|
+
};
|
|
778
|
+
function useOpen(props, emit, attach) {
|
|
779
|
+
const open = useControlled(props, emit, {
|
|
780
|
+
prop: "open",
|
|
781
|
+
event: "update:open",
|
|
782
|
+
default: props.defaultOpen ?? false
|
|
783
|
+
});
|
|
784
|
+
const api = attach(open);
|
|
785
|
+
useApiSync(api, open.value, (a) => a.open, (a, v) => a.setOpen(v));
|
|
786
|
+
return open.value;
|
|
787
|
+
}
|
|
788
|
+
function useDialog(host, enhance, props, emit) {
|
|
789
|
+
return useOpen(props, emit, (open) => useEnhancer(host, enhance, () => ({
|
|
790
|
+
closeOnBackdrop: props.closeOnBackdrop,
|
|
791
|
+
defaultOpen: open.value.value,
|
|
792
|
+
onOpenChange: open.set
|
|
793
|
+
}), () => props.closeOnBackdrop));
|
|
794
|
+
}
|
|
795
|
+
var modalProps = {
|
|
796
|
+
...openProps,
|
|
448
797
|
closeOnBackdrop: { type: Boolean, default: true }
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
798
|
+
};
|
|
799
|
+
var Modal = defineComponent({
|
|
800
|
+
name: "HlModal",
|
|
801
|
+
inheritAttrs: false,
|
|
802
|
+
props: modalProps,
|
|
803
|
+
emits: ["update:open"],
|
|
804
|
+
setup(props, { slots, attrs, emit }) {
|
|
805
|
+
const host = ref(null);
|
|
806
|
+
useDialog(host, enhanceModal, props, emit);
|
|
807
|
+
return () => h("dialog", {
|
|
808
|
+
...attrs,
|
|
809
|
+
class: cx("hl-modal", attrs.class),
|
|
810
|
+
"data-hl-modal": "",
|
|
811
|
+
ref: host
|
|
812
|
+
}, slots.default?.());
|
|
813
|
+
}
|
|
465
814
|
});
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
815
|
+
var drawerProps = {
|
|
816
|
+
...modalProps,
|
|
817
|
+
side: { type: String, default: "end" }
|
|
818
|
+
};
|
|
819
|
+
var Drawer = defineComponent({
|
|
820
|
+
name: "HlDrawer",
|
|
469
821
|
inheritAttrs: false,
|
|
470
|
-
|
|
471
|
-
|
|
822
|
+
props: drawerProps,
|
|
823
|
+
emits: ["update:open"],
|
|
824
|
+
setup(props, { slots, attrs, emit }) {
|
|
825
|
+
const host = ref(null);
|
|
826
|
+
useDialog(host, enhanceDrawer, props, emit);
|
|
827
|
+
return () => h("dialog", {
|
|
828
|
+
...attrs,
|
|
829
|
+
class: cx("hl-drawer", attrs.class),
|
|
830
|
+
"data-hl-drawer": "",
|
|
831
|
+
"data-hl-side": props.side,
|
|
832
|
+
ref: host
|
|
833
|
+
}, slots.default?.());
|
|
472
834
|
}
|
|
473
|
-
|
|
474
|
-
|
|
835
|
+
});
|
|
836
|
+
var section = (name, klass) => part(name, "div", klass);
|
|
475
837
|
var ModalHeader = section("HlModalHeader", "hl-modal-header");
|
|
476
838
|
var ModalBody = section("HlModalBody", "hl-modal-body");
|
|
477
839
|
var ModalFooter = section("HlModalFooter", "hl-modal-footer");
|
|
478
840
|
var DrawerHeader = section("HlDrawerHeader", "hl-drawer-header");
|
|
479
841
|
var DrawerBody = section("HlDrawerBody", "hl-drawer-body");
|
|
480
842
|
var DrawerFooter = section("HlDrawerFooter", "hl-drawer-footer");
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
)
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
{ ...attrs, "data-hl-popover": "", popover: "auto", role: "dialog", ref: host },
|
|
502
|
-
slots.default?.()
|
|
503
|
-
);
|
|
504
|
-
}
|
|
843
|
+
var popoverProps = {
|
|
844
|
+
...openProps,
|
|
845
|
+
placement: { type: String, default: void 0 },
|
|
846
|
+
hover: { type: Boolean, default: false }
|
|
847
|
+
};
|
|
848
|
+
var Popover = defineComponent({
|
|
849
|
+
name: "HlPopover",
|
|
850
|
+
inheritAttrs: false,
|
|
851
|
+
props: popoverProps,
|
|
852
|
+
emits: ["update:open"],
|
|
853
|
+
setup(props, { slots, attrs, emit }) {
|
|
854
|
+
const host = ref(null);
|
|
855
|
+
useOpen(props, emit, (open) => useEnhancer(host, enhancePopover, () => ({
|
|
856
|
+
placement: props.placement,
|
|
857
|
+
triggerEvent: props.hover ? "hover" : "click",
|
|
858
|
+
defaultOpen: open.value.value,
|
|
859
|
+
onOpenChange: open.set
|
|
860
|
+
}), () => [props.placement, props.hover]));
|
|
861
|
+
return () => h("div", { ...attrs, "data-hl-popover": "", popover: "auto", role: "dialog", ref: host }, slots.default?.());
|
|
862
|
+
}
|
|
505
863
|
});
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
864
|
+
var tooltipProps = {
|
|
865
|
+
content: { type: String, default: void 0 },
|
|
866
|
+
placement: { type: String, default: void 0 },
|
|
867
|
+
showDelay: { type: Number, default: void 0 },
|
|
868
|
+
hideDelay: { type: Number, default: void 0 },
|
|
869
|
+
open: { type: Boolean, default: void 0 }
|
|
870
|
+
};
|
|
871
|
+
var Tooltip = defineComponent({
|
|
872
|
+
name: "HlTooltip",
|
|
873
|
+
inheritAttrs: false,
|
|
874
|
+
props: tooltipProps,
|
|
875
|
+
emits: ["update:open"],
|
|
876
|
+
setup(props, { slots, attrs, emit }) {
|
|
877
|
+
const host = ref(null);
|
|
878
|
+
const tipId = useId();
|
|
879
|
+
useOpen(props, emit, (open) => useEnhancer(host, enhanceTooltip, () => ({
|
|
880
|
+
placement: props.placement,
|
|
881
|
+
showDelay: props.showDelay,
|
|
882
|
+
hideDelay: props.hideDelay,
|
|
883
|
+
onOpenChange: open.set
|
|
884
|
+
}), () => [props.placement, props.showDelay, props.hideDelay]));
|
|
885
|
+
return () => {
|
|
886
|
+
const [trigger] = slots.default?.() ?? [];
|
|
887
|
+
return h("span", { ...attrs, ref: host }, [
|
|
888
|
+
trigger && cloneVNode(trigger, { "data-hl-tooltip": tipId, "aria-describedby": tipId }),
|
|
889
|
+
h("span", { id: tipId, role: "tooltip" }, slots.content?.() ?? props.content)
|
|
890
|
+
]);
|
|
891
|
+
};
|
|
892
|
+
}
|
|
535
893
|
});
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
"nav",
|
|
545
|
-
{
|
|
546
|
-
...attrs,
|
|
547
|
-
"data-hl-breadcrumb": "",
|
|
548
|
-
"aria-label": attrs["aria-label"] ?? "Breadcrumb"
|
|
549
|
-
},
|
|
550
|
-
[h6("ol", slots.default?.())]
|
|
551
|
-
);
|
|
552
|
-
}
|
|
894
|
+
var Breadcrumb = defineComponent({
|
|
895
|
+
name: "HlBreadcrumb",
|
|
896
|
+
inheritAttrs: false,
|
|
897
|
+
setup(_, { slots, attrs }) {
|
|
898
|
+
return () => h("nav", { "aria-label": "Breadcrumb", ...attrs, "data-hl-breadcrumb": "" }, [
|
|
899
|
+
h("ol", slots.default?.())
|
|
900
|
+
]);
|
|
901
|
+
}
|
|
553
902
|
});
|
|
554
|
-
var
|
|
555
|
-
name: "HlBreadcrumbItem",
|
|
556
|
-
inheritAttrs: false,
|
|
557
|
-
props: {
|
|
903
|
+
var breadcrumbItemProps = {
|
|
558
904
|
href: { type: String, default: void 0 },
|
|
559
905
|
current: { type: Boolean, default: false }
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
906
|
+
};
|
|
907
|
+
var BreadcrumbItem = defineComponent({
|
|
908
|
+
name: "HlBreadcrumbItem",
|
|
909
|
+
inheritAttrs: false,
|
|
910
|
+
props: breadcrumbItemProps,
|
|
911
|
+
setup(props, { slots, attrs }) {
|
|
912
|
+
return () => h("li", attrs, [
|
|
913
|
+
props.current || !props.href ? h("span", { "aria-current": props.current ? "page" : void 0 }, slots.default?.()) : h("a", { href: props.href }, slots.default?.())
|
|
914
|
+
]);
|
|
915
|
+
}
|
|
566
916
|
});
|
|
567
|
-
|
|
568
|
-
// src/components/combobox.ts
|
|
569
|
-
import { defineComponent as defineComponent7, h as h7, watch as watch5 } from "vue";
|
|
570
|
-
import {
|
|
571
|
-
enhanceCombobox as enhanceCombobox2
|
|
572
|
-
} from "@hydrateless/enhancers";
|
|
573
|
-
var Combobox = defineComponent7({
|
|
574
|
-
name: "HlCombobox",
|
|
575
|
-
inheritAttrs: false,
|
|
576
|
-
props: {
|
|
917
|
+
var comboboxProps = {
|
|
577
918
|
filter: { type: Boolean, default: void 0 },
|
|
578
919
|
autoHighlight: {
|
|
579
|
-
|
|
580
|
-
|
|
920
|
+
type: Boolean,
|
|
921
|
+
default: void 0
|
|
581
922
|
},
|
|
582
|
-
/** Controlled committed value (`v-model`). */
|
|
583
923
|
modelValue: { type: String, default: void 0 },
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
924
|
+
defaultValue: { type: String, default: void 0 },
|
|
925
|
+
open: { type: Boolean, default: void 0 },
|
|
926
|
+
defaultOpen: { type: Boolean, default: false }
|
|
927
|
+
};
|
|
928
|
+
var Combobox = defineComponent({
|
|
929
|
+
name: "HlCombobox",
|
|
930
|
+
inheritAttrs: false,
|
|
931
|
+
props: comboboxProps,
|
|
932
|
+
emits: ["update:modelValue", "update:open"],
|
|
933
|
+
setup(props, { slots, attrs, emit }) {
|
|
934
|
+
const host = ref(null);
|
|
935
|
+
const { value, set } = useControlled(props, emit, {
|
|
936
|
+
prop: "modelValue",
|
|
937
|
+
event: "update:modelValue",
|
|
938
|
+
default: props.defaultValue
|
|
939
|
+
});
|
|
940
|
+
const { value: open, set: setOpen } = useControlled(props, emit, { prop: "open", event: "update:open", default: props.defaultOpen });
|
|
941
|
+
const api = useEnhancer(host, enhanceCombobox, () => ({
|
|
942
|
+
filter: props.filter,
|
|
943
|
+
autoHighlight: props.autoHighlight,
|
|
944
|
+
defaultValue: value.value,
|
|
945
|
+
onValueChange: set,
|
|
946
|
+
onOpenChange: setOpen
|
|
947
|
+
}), () => [props.filter, props.autoHighlight]);
|
|
948
|
+
useApiSync(api, value, (a) => a.value, (a, v) => a.setValue(v));
|
|
949
|
+
useApiSync(api, open, (a) => a.open, (a, v) => a.setOpen(v));
|
|
950
|
+
return () => h("div", { ...attrs, "data-hl-combobox": "", ref: host }, slots.default?.());
|
|
951
|
+
}
|
|
608
952
|
});
|
|
609
|
-
var
|
|
610
|
-
name: "HlComboboxInput",
|
|
611
|
-
inheritAttrs: false,
|
|
612
|
-
props: {
|
|
953
|
+
var comboboxInputProps = {
|
|
613
954
|
styled: { type: Boolean, default: true }
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
955
|
+
};
|
|
956
|
+
var ComboboxInput = defineComponent({
|
|
957
|
+
name: "HlComboboxInput",
|
|
958
|
+
inheritAttrs: false,
|
|
959
|
+
props: comboboxInputProps,
|
|
960
|
+
setup(props, { attrs }) {
|
|
961
|
+
const field = useField();
|
|
962
|
+
return () => h("input", {
|
|
963
|
+
id: field?.id,
|
|
964
|
+
"aria-describedby": field?.describedBy,
|
|
965
|
+
"aria-invalid": field?.invalid || void 0,
|
|
966
|
+
required: field?.required || void 0,
|
|
967
|
+
...attrs,
|
|
968
|
+
class: cx(props.styled && "hl-input", attrs.class)
|
|
969
|
+
});
|
|
970
|
+
}
|
|
618
971
|
});
|
|
619
|
-
var ComboboxList =
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
972
|
+
var ComboboxList = defineComponent({
|
|
973
|
+
name: "HlComboboxList",
|
|
974
|
+
inheritAttrs: false,
|
|
975
|
+
setup(_, { slots, attrs }) {
|
|
976
|
+
return () => h("ul", { ...attrs, role: "listbox" }, slots.default?.());
|
|
977
|
+
}
|
|
625
978
|
});
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
979
|
+
var comboboxOptionProps = {
|
|
980
|
+
value: { type: String, required: true },
|
|
981
|
+
disabled: { type: Boolean, default: false }
|
|
982
|
+
};
|
|
983
|
+
var ComboboxOption = defineComponent({
|
|
984
|
+
name: "HlComboboxOption",
|
|
985
|
+
inheritAttrs: false,
|
|
986
|
+
props: comboboxOptionProps,
|
|
987
|
+
setup(props, { slots, attrs }) {
|
|
988
|
+
return () => h("li", {
|
|
989
|
+
...attrs,
|
|
990
|
+
role: "option",
|
|
991
|
+
"data-hl-value": props.value,
|
|
992
|
+
"aria-disabled": props.disabled || void 0
|
|
993
|
+
}, slots.default?.() ?? props.value);
|
|
994
|
+
}
|
|
639
995
|
});
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
996
|
+
var commandProps = {
|
|
997
|
+
hotkey: { type: String, default: void 0 },
|
|
998
|
+
query: { type: String, default: void 0 },
|
|
999
|
+
defaultQuery: { type: String, default: void 0 }
|
|
1000
|
+
};
|
|
1001
|
+
var Command = defineComponent({
|
|
1002
|
+
name: "HlCommand",
|
|
1003
|
+
inheritAttrs: false,
|
|
1004
|
+
props: commandProps,
|
|
1005
|
+
emits: ["update:query", "command"],
|
|
1006
|
+
setup(props, { slots, attrs, emit }) {
|
|
1007
|
+
const host = ref(null);
|
|
1008
|
+
const { value: query, set } = useControlled(props, emit, {
|
|
1009
|
+
prop: "query",
|
|
1010
|
+
event: "update:query",
|
|
1011
|
+
default: props.defaultQuery
|
|
1012
|
+
});
|
|
1013
|
+
const api = useEnhancer(host, enhanceCommand, () => ({
|
|
1014
|
+
hotkey: props.hotkey,
|
|
1015
|
+
defaultValue: query.value,
|
|
1016
|
+
onValueChange: set,
|
|
1017
|
+
onCommand: (value, item) => emit("command", value, item)
|
|
1018
|
+
}), () => props.hotkey);
|
|
1019
|
+
useApiSync(api, query, (a) => a.value, (a, v) => a.setValue(v));
|
|
1020
|
+
return () => h("div", { ...attrs, "data-hl-command": "", "data-hl-command-hotkey": props.hotkey, ref: host }, slots.default?.());
|
|
1021
|
+
}
|
|
664
1022
|
});
|
|
665
|
-
var
|
|
666
|
-
name: "HlCommandInput",
|
|
667
|
-
inheritAttrs: false,
|
|
668
|
-
props: {
|
|
1023
|
+
var commandInputProps = {
|
|
669
1024
|
styled: { type: Boolean, default: true }
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
1025
|
+
};
|
|
1026
|
+
var CommandInput = defineComponent({
|
|
1027
|
+
name: "HlCommandInput",
|
|
1028
|
+
inheritAttrs: false,
|
|
1029
|
+
props: commandInputProps,
|
|
1030
|
+
setup(props, { attrs }) {
|
|
1031
|
+
return () => h("input", {
|
|
1032
|
+
...attrs,
|
|
1033
|
+
class: cx(props.styled && "hl-input", attrs.class),
|
|
1034
|
+
"data-hl-command-input": ""
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
678
1037
|
});
|
|
679
|
-
var CommandList =
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
1038
|
+
var CommandList = defineComponent({
|
|
1039
|
+
name: "HlCommandList",
|
|
1040
|
+
inheritAttrs: false,
|
|
1041
|
+
setup(_, { slots, attrs }) {
|
|
1042
|
+
return () => h("div", { ...attrs, "data-hl-command-list": "", role: "listbox" }, slots.default?.());
|
|
1043
|
+
}
|
|
685
1044
|
});
|
|
686
|
-
var
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1045
|
+
var commandGroupProps = {
|
|
1046
|
+
label: { type: String, default: void 0 }
|
|
1047
|
+
};
|
|
1048
|
+
var CommandGroup = defineComponent({
|
|
1049
|
+
name: "HlCommandGroup",
|
|
1050
|
+
inheritAttrs: false,
|
|
1051
|
+
props: commandGroupProps,
|
|
1052
|
+
setup(props, { slots, attrs }) {
|
|
1053
|
+
return () => {
|
|
1054
|
+
const label = slots.label?.() ?? props.label;
|
|
1055
|
+
return h("div", { ...attrs, "data-hl-command-group": "" }, [
|
|
1056
|
+
label ? h("div", { class: "hl-command-group-label", role: "presentation" }, label) : null,
|
|
1057
|
+
slots.default?.()
|
|
1058
|
+
]);
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
701
1061
|
});
|
|
702
|
-
var
|
|
703
|
-
name: "HlCommandItem",
|
|
704
|
-
inheritAttrs: false,
|
|
705
|
-
props: {
|
|
1062
|
+
var commandItemProps = {
|
|
706
1063
|
value: { type: String, required: true },
|
|
707
1064
|
keywords: { type: String, default: void 0 }
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
});
|
|
722
|
-
var CommandEmpty = defineComponent8({
|
|
723
|
-
name: "HlCommandEmpty",
|
|
724
|
-
inheritAttrs: false,
|
|
725
|
-
setup(_, { slots, attrs }) {
|
|
726
|
-
return () => h8(
|
|
727
|
-
"div",
|
|
728
|
-
{ ...attrs, "data-hl-command-empty": "", hidden: true },
|
|
729
|
-
slots.default?.() ?? "No results found."
|
|
730
|
-
);
|
|
731
|
-
}
|
|
732
|
-
});
|
|
733
|
-
|
|
734
|
-
// src/components/forms.ts
|
|
735
|
-
import {
|
|
736
|
-
computed,
|
|
737
|
-
defineComponent as defineComponent9,
|
|
738
|
-
h as h9,
|
|
739
|
-
inject,
|
|
740
|
-
provide
|
|
741
|
-
} from "vue";
|
|
742
|
-
var FieldKey = /* @__PURE__ */ Symbol("hl-field");
|
|
743
|
-
var fieldCounter = 0;
|
|
744
|
-
var Field = defineComponent9({
|
|
745
|
-
name: "HlField",
|
|
746
|
-
inheritAttrs: false,
|
|
747
|
-
props: {
|
|
748
|
-
id: { type: String, default: void 0 },
|
|
749
|
-
invalid: { type: Boolean, default: false },
|
|
750
|
-
required: { type: Boolean, default: false }
|
|
751
|
-
},
|
|
752
|
-
setup(props, { slots, attrs }) {
|
|
753
|
-
const baseId = props.id ?? `hl-field-${fieldCounter += 1}`;
|
|
754
|
-
provide(FieldKey, {
|
|
755
|
-
id: baseId,
|
|
756
|
-
helpId: `${baseId}-help`,
|
|
757
|
-
errorId: `${baseId}-error`,
|
|
758
|
-
invalid: props.invalid,
|
|
759
|
-
required: props.required
|
|
760
|
-
});
|
|
761
|
-
return () => h9(
|
|
762
|
-
"div",
|
|
763
|
-
{
|
|
764
|
-
...attrs,
|
|
765
|
-
class: cx("hl-field", attrs.class),
|
|
766
|
-
"data-hl-invalid": props.invalid || void 0
|
|
767
|
-
},
|
|
768
|
-
slots.default?.()
|
|
769
|
-
);
|
|
770
|
-
}
|
|
771
|
-
});
|
|
772
|
-
function useFieldBindings() {
|
|
773
|
-
const ctx = inject(FieldKey, null);
|
|
774
|
-
if (!ctx) return {};
|
|
775
|
-
const describedBy = [ctx.helpId, ctx.invalid ? ctx.errorId : null].filter(Boolean).join(" ");
|
|
776
|
-
return {
|
|
777
|
-
id: ctx.id,
|
|
778
|
-
"aria-describedby": describedBy || void 0,
|
|
779
|
-
"aria-invalid": ctx.invalid || void 0
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
var FieldLabel = defineComponent9({
|
|
783
|
-
name: "HlFieldLabel",
|
|
784
|
-
inheritAttrs: false,
|
|
785
|
-
setup(_, { slots, attrs }) {
|
|
786
|
-
const ctx = inject(FieldKey, null);
|
|
787
|
-
return () => h9(
|
|
788
|
-
"label",
|
|
789
|
-
{
|
|
790
|
-
...attrs,
|
|
791
|
-
for: attrs.for ?? ctx?.id,
|
|
792
|
-
class: cx("hl-label", attrs.class),
|
|
793
|
-
"data-hl-required": ctx?.required || void 0
|
|
794
|
-
},
|
|
795
|
-
slots.default?.()
|
|
796
|
-
);
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
var FieldHelp = defineComponent9({
|
|
800
|
-
name: "HlFieldHelp",
|
|
801
|
-
inheritAttrs: false,
|
|
802
|
-
setup(_, { slots, attrs }) {
|
|
803
|
-
const ctx = inject(FieldKey, null);
|
|
804
|
-
return () => h9(
|
|
805
|
-
"p",
|
|
806
|
-
{ ...attrs, id: ctx?.helpId, class: cx("hl-help", attrs.class) },
|
|
807
|
-
slots.default?.()
|
|
808
|
-
);
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
var FieldError = defineComponent9({
|
|
812
|
-
name: "HlFieldError",
|
|
813
|
-
inheritAttrs: false,
|
|
814
|
-
setup(_, { slots, attrs }) {
|
|
815
|
-
const ctx = inject(FieldKey, null);
|
|
816
|
-
return () => {
|
|
817
|
-
const content = slots.default?.();
|
|
818
|
-
if (!content || Array.isArray(content) && content.length === 0) return null;
|
|
819
|
-
return h9(
|
|
820
|
-
"p",
|
|
821
|
-
{ ...attrs, id: ctx?.errorId, role: "alert", class: cx("hl-error", attrs.class) },
|
|
822
|
-
content
|
|
823
|
-
);
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
});
|
|
827
|
-
var Fieldset = defineComponent9({
|
|
828
|
-
name: "HlFieldset",
|
|
829
|
-
inheritAttrs: false,
|
|
830
|
-
setup(_, { slots, attrs }) {
|
|
831
|
-
return () => {
|
|
832
|
-
const children = [];
|
|
833
|
-
if (slots.legend) children.push(h9("legend", { class: "hl-legend" }, slots.legend()));
|
|
834
|
-
if (slots.default) children.push(...slots.default());
|
|
835
|
-
return h9("fieldset", { ...attrs, class: cx("hl-fieldset", attrs.class) }, children);
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
});
|
|
839
|
-
var Input = defineComponent9({
|
|
840
|
-
name: "HlInput",
|
|
841
|
-
inheritAttrs: false,
|
|
842
|
-
props: {
|
|
843
|
-
modelValue: { type: [String, Number], default: void 0 },
|
|
844
|
-
size: { type: String, default: void 0 },
|
|
845
|
-
invalid: { type: Boolean, default: false }
|
|
846
|
-
},
|
|
847
|
-
emits: ["update:modelValue"],
|
|
848
|
-
setup(props, { attrs, emit }) {
|
|
849
|
-
const field = useFieldBindings();
|
|
850
|
-
return () => h9("input", {
|
|
851
|
-
...field,
|
|
852
|
-
...attrs,
|
|
853
|
-
class: cx("hl-input", attrs.class),
|
|
854
|
-
"data-hl-size": props.size,
|
|
855
|
-
"data-hl-invalid": props.invalid || void 0,
|
|
856
|
-
"aria-invalid": props.invalid || attrs["aria-invalid"] || void 0,
|
|
857
|
-
value: props.modelValue,
|
|
858
|
-
onInput: (e) => emit("update:modelValue", e.target.value)
|
|
859
|
-
});
|
|
860
|
-
}
|
|
861
|
-
});
|
|
862
|
-
var Textarea = defineComponent9({
|
|
863
|
-
name: "HlTextarea",
|
|
864
|
-
inheritAttrs: false,
|
|
865
|
-
props: {
|
|
866
|
-
modelValue: { type: String, default: void 0 },
|
|
867
|
-
size: { type: String, default: void 0 },
|
|
868
|
-
invalid: { type: Boolean, default: false }
|
|
869
|
-
},
|
|
870
|
-
emits: ["update:modelValue"],
|
|
871
|
-
setup(props, { attrs, emit }) {
|
|
872
|
-
const field = useFieldBindings();
|
|
873
|
-
return () => h9("textarea", {
|
|
874
|
-
...field,
|
|
875
|
-
...attrs,
|
|
876
|
-
class: cx("hl-textarea", attrs.class),
|
|
877
|
-
"data-hl-size": props.size,
|
|
878
|
-
"data-hl-invalid": props.invalid || void 0,
|
|
879
|
-
"aria-invalid": props.invalid || void 0,
|
|
880
|
-
value: props.modelValue,
|
|
881
|
-
onInput: (e) => emit("update:modelValue", e.target.value)
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
});
|
|
885
|
-
var Select = defineComponent9({
|
|
886
|
-
name: "HlSelect",
|
|
887
|
-
inheritAttrs: false,
|
|
888
|
-
props: {
|
|
889
|
-
modelValue: { type: String, default: void 0 },
|
|
890
|
-
size: { type: String, default: void 0 },
|
|
891
|
-
invalid: { type: Boolean, default: false }
|
|
892
|
-
},
|
|
893
|
-
emits: ["update:modelValue"],
|
|
894
|
-
setup(props, { slots, attrs, emit }) {
|
|
895
|
-
const field = useFieldBindings();
|
|
896
|
-
return () => h9("span", { class: "hl-select-wrapper" }, [
|
|
897
|
-
h9(
|
|
898
|
-
"select",
|
|
899
|
-
{
|
|
900
|
-
...field,
|
|
901
|
-
...attrs,
|
|
902
|
-
class: cx("hl-select", attrs.class),
|
|
903
|
-
"data-hl-size": props.size,
|
|
904
|
-
"data-hl-invalid": props.invalid || void 0,
|
|
905
|
-
"aria-invalid": props.invalid || void 0,
|
|
906
|
-
value: props.modelValue,
|
|
907
|
-
onChange: (e) => emit("update:modelValue", e.target.value)
|
|
908
|
-
},
|
|
909
|
-
slots.default?.()
|
|
910
|
-
)
|
|
911
|
-
]);
|
|
912
|
-
}
|
|
913
|
-
});
|
|
914
|
-
var Checkbox = defineComponent9({
|
|
915
|
-
name: "HlCheckbox",
|
|
916
|
-
inheritAttrs: false,
|
|
917
|
-
props: {
|
|
918
|
-
modelValue: { type: Boolean, default: void 0 }
|
|
919
|
-
},
|
|
920
|
-
emits: ["update:modelValue"],
|
|
921
|
-
setup(props, { slots, attrs, emit }) {
|
|
922
|
-
return () => h9("label", { class: cx("hl-checkbox", attrs.class) }, [
|
|
923
|
-
h9("input", {
|
|
924
|
-
...attrs,
|
|
925
|
-
class: void 0,
|
|
926
|
-
type: "checkbox",
|
|
927
|
-
checked: props.modelValue,
|
|
928
|
-
onChange: (e) => emit("update:modelValue", e.target.checked)
|
|
929
|
-
}),
|
|
930
|
-
slots.default ? h9("span", slots.default()) : null
|
|
931
|
-
]);
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
var Switch = defineComponent9({
|
|
935
|
-
name: "HlSwitch",
|
|
936
|
-
inheritAttrs: false,
|
|
937
|
-
props: {
|
|
938
|
-
modelValue: { type: Boolean, default: void 0 }
|
|
939
|
-
},
|
|
940
|
-
emits: ["update:modelValue"],
|
|
941
|
-
setup(props, { slots, attrs, emit }) {
|
|
942
|
-
return () => h9("label", { "data-hl-switch": "", class: attrs.class }, [
|
|
943
|
-
h9("input", {
|
|
944
|
-
...attrs,
|
|
945
|
-
class: void 0,
|
|
946
|
-
type: "checkbox",
|
|
947
|
-
role: "switch",
|
|
948
|
-
checked: props.modelValue,
|
|
949
|
-
onChange: (e) => emit("update:modelValue", e.target.checked)
|
|
950
|
-
}),
|
|
951
|
-
slots.default?.()
|
|
952
|
-
]);
|
|
953
|
-
}
|
|
954
|
-
});
|
|
955
|
-
var Slider = defineComponent9({
|
|
956
|
-
name: "HlSlider",
|
|
957
|
-
inheritAttrs: false,
|
|
958
|
-
props: {
|
|
959
|
-
modelValue: { type: [String, Number], default: void 0 }
|
|
960
|
-
},
|
|
961
|
-
emits: ["update:modelValue"],
|
|
962
|
-
setup(props, { attrs, emit }) {
|
|
963
|
-
return () => h9("input", {
|
|
964
|
-
...attrs,
|
|
965
|
-
type: "range",
|
|
966
|
-
class: cx("hl-slider", attrs.class),
|
|
967
|
-
value: props.modelValue,
|
|
968
|
-
onInput: (e) => emit("update:modelValue", e.target.value)
|
|
969
|
-
});
|
|
970
|
-
}
|
|
971
|
-
});
|
|
972
|
-
var RadioGroupKey = /* @__PURE__ */ Symbol("hl-radio-group");
|
|
973
|
-
var RadioGroup = defineComponent9({
|
|
974
|
-
name: "HlRadioGroup",
|
|
975
|
-
inheritAttrs: false,
|
|
976
|
-
props: {
|
|
977
|
-
modelValue: { type: String, default: void 0 },
|
|
978
|
-
name: { type: String, default: void 0 }
|
|
979
|
-
},
|
|
980
|
-
emits: ["update:modelValue"],
|
|
981
|
-
setup(props, { slots, attrs, emit }) {
|
|
982
|
-
provide(RadioGroupKey, {
|
|
983
|
-
get name() {
|
|
984
|
-
return props.name;
|
|
985
|
-
},
|
|
986
|
-
get value() {
|
|
987
|
-
return props.modelValue;
|
|
988
|
-
},
|
|
989
|
-
select: (value) => emit("update:modelValue", value)
|
|
990
|
-
});
|
|
991
|
-
return () => h9(
|
|
992
|
-
"div",
|
|
993
|
-
{ ...attrs, role: "radiogroup", class: cx("hl-radio-group", attrs.class) },
|
|
994
|
-
slots.default?.()
|
|
995
|
-
);
|
|
996
|
-
}
|
|
997
|
-
});
|
|
998
|
-
var Radio = defineComponent9({
|
|
999
|
-
name: "HlRadio",
|
|
1000
|
-
inheritAttrs: false,
|
|
1001
|
-
props: {
|
|
1002
|
-
value: { type: String, required: true }
|
|
1003
|
-
},
|
|
1004
|
-
setup(props, { slots, attrs }) {
|
|
1005
|
-
const group = inject(RadioGroupKey, null);
|
|
1006
|
-
const checked = computed(() => group ? group.value === props.value : void 0);
|
|
1007
|
-
return () => h9("label", { class: cx("hl-radio", attrs.class) }, [
|
|
1008
|
-
h9("input", {
|
|
1009
|
-
...attrs,
|
|
1010
|
-
class: void 0,
|
|
1011
|
-
type: "radio",
|
|
1012
|
-
name: attrs.name ?? group?.name,
|
|
1013
|
-
value: props.value,
|
|
1014
|
-
checked: checked.value,
|
|
1015
|
-
onChange: () => group?.select(props.value)
|
|
1016
|
-
}),
|
|
1017
|
-
slots.default ? h9("span", slots.default()) : null
|
|
1018
|
-
]);
|
|
1019
|
-
}
|
|
1065
|
+
};
|
|
1066
|
+
var CommandItem = defineComponent({
|
|
1067
|
+
name: "HlCommandItem",
|
|
1068
|
+
inheritAttrs: false,
|
|
1069
|
+
props: commandItemProps,
|
|
1070
|
+
setup(props, { slots, attrs }) {
|
|
1071
|
+
return () => h("div", {
|
|
1072
|
+
...attrs,
|
|
1073
|
+
role: "option",
|
|
1074
|
+
"data-hl-value": props.value,
|
|
1075
|
+
"data-hl-keywords": props.keywords
|
|
1076
|
+
}, [slots.icon?.(), h("span", slots.default?.())]);
|
|
1077
|
+
}
|
|
1020
1078
|
});
|
|
1021
|
-
var
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
type: Array,
|
|
1028
|
-
default: () => []
|
|
1029
|
-
},
|
|
1030
|
-
name: { type: String, default: void 0 },
|
|
1031
|
-
size: { type: String, default: void 0 }
|
|
1032
|
-
},
|
|
1033
|
-
emits: ["update:modelValue"],
|
|
1034
|
-
setup(props, { attrs, emit }) {
|
|
1035
|
-
const groupName = props.name ?? `hl-seg-${fieldCounter += 1}`;
|
|
1036
|
-
return () => h9(
|
|
1037
|
-
"div",
|
|
1038
|
-
{
|
|
1039
|
-
...attrs,
|
|
1040
|
-
role: "radiogroup",
|
|
1041
|
-
class: cx("hl-segmented", attrs.class),
|
|
1042
|
-
"data-hl-size": props.size
|
|
1043
|
-
},
|
|
1044
|
-
props.options.map(
|
|
1045
|
-
(option) => h9("label", { class: "hl-segmented-item", key: option.value }, [
|
|
1046
|
-
h9("input", {
|
|
1047
|
-
type: "radio",
|
|
1048
|
-
name: groupName,
|
|
1049
|
-
value: option.value,
|
|
1050
|
-
checked: props.modelValue === option.value,
|
|
1051
|
-
disabled: option.disabled,
|
|
1052
|
-
onChange: () => emit("update:modelValue", option.value)
|
|
1053
|
-
}),
|
|
1054
|
-
h9("span", option.label)
|
|
1055
|
-
])
|
|
1056
|
-
)
|
|
1057
|
-
);
|
|
1058
|
-
}
|
|
1079
|
+
var CommandEmpty = defineComponent({
|
|
1080
|
+
name: "HlCommandEmpty",
|
|
1081
|
+
inheritAttrs: false,
|
|
1082
|
+
setup(_, { slots, attrs }) {
|
|
1083
|
+
return () => h("div", { ...attrs, "data-hl-command-empty": "", hidden: true }, slots.default?.() ?? "No results found.");
|
|
1084
|
+
}
|
|
1059
1085
|
});
|
|
1060
|
-
|
|
1061
|
-
// src/components/button.ts
|
|
1062
|
-
import { defineComponent as defineComponent10, h as h10 } from "vue";
|
|
1063
|
-
var Button = defineComponent10({
|
|
1064
|
-
name: "HlButton",
|
|
1065
|
-
inheritAttrs: false,
|
|
1066
|
-
props: {
|
|
1086
|
+
var buttonProps = {
|
|
1067
1087
|
variant: {
|
|
1068
|
-
|
|
1069
|
-
|
|
1088
|
+
type: String,
|
|
1089
|
+
default: void 0
|
|
1070
1090
|
},
|
|
1071
1091
|
intent: {
|
|
1072
|
-
|
|
1073
|
-
|
|
1092
|
+
type: String,
|
|
1093
|
+
default: void 0
|
|
1074
1094
|
},
|
|
1075
1095
|
size: { type: String, default: void 0 },
|
|
1076
1096
|
block: { type: Boolean, default: false },
|
|
1077
1097
|
icon: { type: Boolean, default: false },
|
|
1078
1098
|
loading: { type: Boolean, default: false }
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
+
};
|
|
1100
|
+
var Button = defineComponent({
|
|
1101
|
+
name: "HlButton",
|
|
1102
|
+
inheritAttrs: false,
|
|
1103
|
+
props: buttonProps,
|
|
1104
|
+
setup(props, { slots, attrs }) {
|
|
1105
|
+
return () => h("button", {
|
|
1106
|
+
type: "button",
|
|
1107
|
+
...attrs,
|
|
1108
|
+
class: cx("hl-button", attrs.class),
|
|
1109
|
+
"data-hl-variant": props.variant,
|
|
1110
|
+
"data-hl-intent": props.intent,
|
|
1111
|
+
"data-hl-size": props.size,
|
|
1112
|
+
"data-hl-block": props.block || void 0,
|
|
1113
|
+
"data-hl-icon": props.icon || void 0,
|
|
1114
|
+
"data-hl-loading": props.loading || void 0,
|
|
1115
|
+
"aria-busy": props.loading || void 0,
|
|
1116
|
+
disabled: attrs.disabled || props.loading || void 0
|
|
1117
|
+
}, slots.default?.());
|
|
1118
|
+
}
|
|
1099
1119
|
});
|
|
1100
|
-
|
|
1101
|
-
// src/components/feedback.ts
|
|
1102
|
-
import { defineComponent as defineComponent11, h as h11 } from "vue";
|
|
1103
|
-
var Alert = defineComponent11({
|
|
1104
|
-
name: "HlAlert",
|
|
1105
|
-
inheritAttrs: false,
|
|
1106
|
-
props: {
|
|
1120
|
+
var alertProps = {
|
|
1107
1121
|
intent: { type: String, default: void 0 },
|
|
1108
1122
|
title: { type: String, default: void 0 }
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1123
|
+
};
|
|
1124
|
+
var Alert = defineComponent({
|
|
1125
|
+
name: "HlAlert",
|
|
1126
|
+
inheritAttrs: false,
|
|
1127
|
+
props: alertProps,
|
|
1128
|
+
setup(props, { slots, attrs }) {
|
|
1129
|
+
return () => h("div", {
|
|
1130
|
+
role: "alert",
|
|
1131
|
+
...attrs,
|
|
1132
|
+
class: cx("hl-alert", attrs.class),
|
|
1133
|
+
"data-hl-intent": props.intent
|
|
1134
|
+
}, [
|
|
1135
|
+
slots.icon?.(),
|
|
1136
|
+
h("div", { class: "hl-alert-body" }, [
|
|
1137
|
+
props.title != null && h("p", { class: "hl-alert-title" }, props.title),
|
|
1138
|
+
slots.default?.()
|
|
1139
|
+
])
|
|
1140
|
+
]);
|
|
1141
|
+
}
|
|
1128
1142
|
});
|
|
1129
|
-
var
|
|
1130
|
-
name: "HlBadge",
|
|
1131
|
-
inheritAttrs: false,
|
|
1132
|
-
props: {
|
|
1143
|
+
var badgeProps = {
|
|
1133
1144
|
intent: { type: String, default: void 0 },
|
|
1134
1145
|
variant: { type: String, default: void 0 },
|
|
1135
1146
|
size: { type: String, default: void 0 }
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1147
|
+
};
|
|
1148
|
+
var Badge = defineComponent({
|
|
1149
|
+
name: "HlBadge",
|
|
1150
|
+
inheritAttrs: false,
|
|
1151
|
+
props: badgeProps,
|
|
1152
|
+
setup(props, { slots, attrs }) {
|
|
1153
|
+
return () => h("span", {
|
|
1154
|
+
...attrs,
|
|
1155
|
+
class: cx("hl-badge", attrs.class),
|
|
1156
|
+
"data-hl-intent": props.intent,
|
|
1157
|
+
"data-hl-variant": props.variant,
|
|
1158
|
+
"data-hl-size": props.size
|
|
1159
|
+
}, slots.default?.());
|
|
1160
|
+
}
|
|
1150
1161
|
});
|
|
1151
|
-
var
|
|
1152
|
-
name: "HlProgress",
|
|
1153
|
-
inheritAttrs: false,
|
|
1154
|
-
props: {
|
|
1162
|
+
var progressProps = {
|
|
1155
1163
|
value: { type: Number, default: void 0 },
|
|
1156
1164
|
max: { type: Number, default: 100 },
|
|
1157
1165
|
intent: {
|
|
1158
|
-
|
|
1159
|
-
|
|
1166
|
+
type: String,
|
|
1167
|
+
default: void 0
|
|
1160
1168
|
},
|
|
1161
1169
|
size: { type: String, default: void 0 }
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1170
|
+
};
|
|
1171
|
+
var Progress = defineComponent({
|
|
1172
|
+
name: "HlProgress",
|
|
1173
|
+
inheritAttrs: false,
|
|
1174
|
+
props: progressProps,
|
|
1175
|
+
setup(props, { attrs }) {
|
|
1176
|
+
return () => h("progress", {
|
|
1177
|
+
...attrs,
|
|
1178
|
+
class: cx("hl-progress", attrs.class),
|
|
1179
|
+
"data-hl-intent": props.intent,
|
|
1180
|
+
"data-hl-size": props.size,
|
|
1181
|
+
value: props.value,
|
|
1182
|
+
max: props.max
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1173
1185
|
});
|
|
1174
|
-
var
|
|
1175
|
-
name: "HlSpinner",
|
|
1176
|
-
inheritAttrs: false,
|
|
1177
|
-
props: {
|
|
1186
|
+
var spinnerProps = {
|
|
1178
1187
|
size: { type: String, default: void 0 },
|
|
1179
1188
|
label: { type: String, default: "Loading" }
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1189
|
+
};
|
|
1190
|
+
var Spinner = defineComponent({
|
|
1191
|
+
name: "HlSpinner",
|
|
1192
|
+
inheritAttrs: false,
|
|
1193
|
+
props: spinnerProps,
|
|
1194
|
+
setup(props, { attrs }) {
|
|
1195
|
+
return () => h("span", {
|
|
1196
|
+
...attrs,
|
|
1197
|
+
class: cx("hl-spinner", attrs.class),
|
|
1198
|
+
"data-hl-size": props.size,
|
|
1199
|
+
role: "status",
|
|
1200
|
+
"aria-label": props.label
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1190
1203
|
});
|
|
1191
|
-
var
|
|
1192
|
-
|
|
1193
|
-
inheritAttrs: false,
|
|
1194
|
-
props: {
|
|
1195
|
-
variant: { type: String, default: void 0 },
|
|
1204
|
+
var skeletonProps = {
|
|
1205
|
+
shape: { type: String, default: void 0 },
|
|
1196
1206
|
width: { type: [String, Number], default: void 0 },
|
|
1197
1207
|
height: { type: [String, Number], default: void 0 }
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1208
|
+
};
|
|
1209
|
+
var px = (size) => typeof size === "number" ? `${size}px` : size;
|
|
1210
|
+
var Skeleton = defineComponent({
|
|
1211
|
+
name: "HlSkeleton",
|
|
1212
|
+
inheritAttrs: false,
|
|
1213
|
+
props: skeletonProps,
|
|
1214
|
+
setup(props, { attrs }) {
|
|
1215
|
+
return () => h("span", {
|
|
1216
|
+
...attrs,
|
|
1217
|
+
class: cx("hl-skeleton", attrs.class),
|
|
1218
|
+
"data-hl-shape": props.shape,
|
|
1219
|
+
style: [{ inlineSize: px(props.width), blockSize: px(props.height) }, attrs.style],
|
|
1220
|
+
"aria-hidden": "true"
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1212
1223
|
});
|
|
1213
|
-
var
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1224
|
+
var toastRegionProps = {
|
|
1225
|
+
duration: { type: Number, default: void 0 }
|
|
1226
|
+
};
|
|
1227
|
+
var ToastRegion = defineComponent({
|
|
1228
|
+
name: "HlToastRegion",
|
|
1229
|
+
inheritAttrs: false,
|
|
1230
|
+
props: toastRegionProps,
|
|
1231
|
+
setup(props, { attrs }) {
|
|
1232
|
+
const host = ref(null);
|
|
1233
|
+
useEnhancer(host, enhanceToast, () => ({ duration: props.duration }));
|
|
1234
|
+
return () => h("div", {
|
|
1235
|
+
role: "status",
|
|
1236
|
+
"aria-live": "polite",
|
|
1237
|
+
"aria-relevant": "additions",
|
|
1238
|
+
...attrs,
|
|
1239
|
+
"data-hl-toast-region": "",
|
|
1240
|
+
ref: host
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1219
1243
|
});
|
|
1220
|
-
|
|
1221
|
-
// src/components/data.ts
|
|
1222
|
-
import { defineComponent as defineComponent12, h as h12, ref as ref4 } from "vue";
|
|
1223
|
-
var Card = defineComponent12({
|
|
1224
|
-
name: "HlCard",
|
|
1225
|
-
inheritAttrs: false,
|
|
1226
|
-
props: {
|
|
1244
|
+
var cardProps = {
|
|
1227
1245
|
interactive: { type: Boolean, default: false }
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
"div",
|
|
1232
|
-
{
|
|
1233
|
-
...attrs,
|
|
1234
|
-
class: cx("hl-card", attrs.class),
|
|
1235
|
-
"data-hl-interactive": props.interactive || void 0
|
|
1236
|
-
},
|
|
1237
|
-
slots.default?.()
|
|
1238
|
-
);
|
|
1239
|
-
}
|
|
1240
|
-
});
|
|
1241
|
-
function part(name, tag, klass) {
|
|
1242
|
-
return defineComponent12({
|
|
1243
|
-
name,
|
|
1246
|
+
};
|
|
1247
|
+
var Card = defineComponent({
|
|
1248
|
+
name: "HlCard",
|
|
1244
1249
|
inheritAttrs: false,
|
|
1245
|
-
|
|
1246
|
-
|
|
1250
|
+
props: cardProps,
|
|
1251
|
+
setup(props, { slots, attrs }) {
|
|
1252
|
+
return () => h("div", {
|
|
1253
|
+
...attrs,
|
|
1254
|
+
class: cx("hl-card", attrs.class),
|
|
1255
|
+
"data-hl-interactive": props.interactive || void 0
|
|
1256
|
+
}, slots.default?.());
|
|
1247
1257
|
}
|
|
1248
|
-
|
|
1249
|
-
}
|
|
1258
|
+
});
|
|
1250
1259
|
var CardHeader = part("HlCardHeader", "div", "hl-card-header");
|
|
1251
1260
|
var CardBody = part("HlCardBody", "div", "hl-card-body");
|
|
1252
1261
|
var CardFooter = part("HlCardFooter", "div", "hl-card-footer");
|
|
1253
1262
|
var CardTitle = part("HlCardTitle", "h3", "hl-card-title");
|
|
1254
1263
|
var CardDescription = part("HlCardDescription", "p", "hl-card-description");
|
|
1255
|
-
var
|
|
1256
|
-
name: "HlAvatar",
|
|
1257
|
-
inheritAttrs: false,
|
|
1258
|
-
props: {
|
|
1264
|
+
var avatarProps = {
|
|
1259
1265
|
src: { type: String, default: void 0 },
|
|
1260
1266
|
alt: { type: String, default: "" },
|
|
1261
1267
|
size: { type: String, default: void 0 },
|
|
1262
1268
|
shape: { type: String, default: void 0 }
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1269
|
+
};
|
|
1270
|
+
var Avatar = defineComponent({
|
|
1271
|
+
name: "HlAvatar",
|
|
1272
|
+
inheritAttrs: false,
|
|
1273
|
+
props: avatarProps,
|
|
1274
|
+
setup(props, { slots, attrs }) {
|
|
1275
|
+
const failed = ref(false);
|
|
1276
|
+
return () => h("span", {
|
|
1277
|
+
...attrs,
|
|
1278
|
+
class: cx("hl-avatar", attrs.class),
|
|
1279
|
+
"data-hl-size": props.size,
|
|
1280
|
+
"data-hl-shape": props.shape === "square" ? "square" : void 0
|
|
1281
|
+
}, props.src && !failed.value ? h("img", { src: props.src, alt: props.alt, onError: () => failed.value = true }) : slots.default?.());
|
|
1282
|
+
}
|
|
1277
1283
|
});
|
|
1278
1284
|
var AvatarGroup = part("HlAvatarGroup", "div", "hl-avatar-group");
|
|
1279
1285
|
var Kbd = part("HlKbd", "kbd", "hl-kbd");
|
|
1280
|
-
var
|
|
1281
|
-
name: "HlSeparator",
|
|
1282
|
-
inheritAttrs: false,
|
|
1283
|
-
props: {
|
|
1286
|
+
var separatorProps = {
|
|
1284
1287
|
orientation: { type: String, default: "horizontal" },
|
|
1285
1288
|
decorative: { type: Boolean, default: false }
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1289
|
+
};
|
|
1290
|
+
var Separator = defineComponent({
|
|
1291
|
+
name: "HlSeparator",
|
|
1292
|
+
inheritAttrs: false,
|
|
1293
|
+
props: separatorProps,
|
|
1294
|
+
setup(props, { attrs }) {
|
|
1295
|
+
return () => h("hr", {
|
|
1296
|
+
...attrs,
|
|
1297
|
+
class: cx("hl-separator", attrs.class),
|
|
1298
|
+
"data-hl-orientation": props.orientation === "vertical" ? "vertical" : void 0,
|
|
1299
|
+
"aria-orientation": props.orientation,
|
|
1300
|
+
role: props.decorative ? "presentation" : "separator"
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
});
|
|
1304
|
+
var tableProps = {
|
|
1305
|
+
striped: { type: Boolean, default: false },
|
|
1306
|
+
hover: { type: Boolean, default: false },
|
|
1307
|
+
align: { type: String, default: void 0 },
|
|
1308
|
+
size: { type: String, default: void 0 }
|
|
1309
|
+
};
|
|
1310
|
+
var Table = defineComponent({
|
|
1311
|
+
name: "HlTable",
|
|
1312
|
+
inheritAttrs: false,
|
|
1313
|
+
props: tableProps,
|
|
1314
|
+
setup(props, { slots, attrs }) {
|
|
1315
|
+
return () => h("table", {
|
|
1316
|
+
...attrs,
|
|
1317
|
+
class: cx("hl-table", attrs.class),
|
|
1318
|
+
"data-hl-striped": props.striped || void 0,
|
|
1319
|
+
"data-hl-hover": props.hover || void 0,
|
|
1320
|
+
"data-hl-align": props.align,
|
|
1321
|
+
"data-hl-size": props.size
|
|
1322
|
+
}, slots.default?.());
|
|
1323
|
+
}
|
|
1296
1324
|
});
|
|
1297
|
-
|
|
1298
|
-
// src/components/navigation.ts
|
|
1299
|
-
import { defineComponent as defineComponent13, h as h13 } from "vue";
|
|
1300
|
-
import { enhanceToc as enhanceToc2 } from "@hydrateless/enhancers";
|
|
1301
1325
|
var ELLIPSIS = "ellipsis";
|
|
1302
1326
|
function range(start, end) {
|
|
1303
|
-
|
|
1327
|
+
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
1304
1328
|
}
|
|
1305
1329
|
function paginationRange(page, count, siblingCount) {
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1330
|
+
const totalNumbers = siblingCount * 2 + 5;
|
|
1331
|
+
if (totalNumbers >= count)
|
|
1332
|
+
return range(1, count);
|
|
1333
|
+
const leftSibling = Math.max(page - siblingCount, 1);
|
|
1334
|
+
const rightSibling = Math.min(page + siblingCount, count);
|
|
1335
|
+
const showLeftDots = leftSibling > 2;
|
|
1336
|
+
const showRightDots = rightSibling < count - 1;
|
|
1337
|
+
if (!showLeftDots && showRightDots)
|
|
1338
|
+
return [...range(1, siblingCount * 2 + 3), ELLIPSIS, count];
|
|
1339
|
+
if (showLeftDots && !showRightDots)
|
|
1340
|
+
return [1, ELLIPSIS, ...range(count - (siblingCount * 2 + 2), count)];
|
|
1341
|
+
return [1, ELLIPSIS, ...range(leftSibling, rightSibling), ELLIPSIS, count];
|
|
1316
1342
|
}
|
|
1317
|
-
var
|
|
1318
|
-
name: "HlPagination",
|
|
1319
|
-
inheritAttrs: false,
|
|
1320
|
-
props: {
|
|
1343
|
+
var paginationProps = {
|
|
1321
1344
|
page: { type: Number, required: true },
|
|
1322
1345
|
count: { type: Number, required: true },
|
|
1323
1346
|
siblingCount: { type: Number, default: 1 },
|
|
1324
1347
|
showControls: { type: Boolean, default: true },
|
|
1325
1348
|
prevLabel: { type: String, default: "\u2039" },
|
|
1326
1349
|
nextLabel: { type: String, default: "\u203A" }
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
{
|
|
1385
|
-
type: "button",
|
|
1386
|
-
class: "hl-pagination-item",
|
|
1387
|
-
"aria-label": "Next page",
|
|
1388
|
-
disabled: props.page >= props.count,
|
|
1389
|
-
onClick: () => go(props.page + 1)
|
|
1390
|
-
},
|
|
1391
|
-
props.nextLabel
|
|
1392
|
-
)
|
|
1393
|
-
])
|
|
1394
|
-
);
|
|
1395
|
-
}
|
|
1396
|
-
return h13(
|
|
1397
|
-
"nav",
|
|
1398
|
-
{
|
|
1399
|
-
...attrs,
|
|
1400
|
-
class: cx("hl-pagination", attrs.class),
|
|
1401
|
-
"aria-label": attrs["aria-label"] ?? "Pagination"
|
|
1402
|
-
},
|
|
1403
|
-
[h13("ul", lis)]
|
|
1404
|
-
);
|
|
1405
|
-
};
|
|
1406
|
-
}
|
|
1350
|
+
};
|
|
1351
|
+
var Pagination = defineComponent({
|
|
1352
|
+
name: "HlPagination",
|
|
1353
|
+
inheritAttrs: false,
|
|
1354
|
+
props: paginationProps,
|
|
1355
|
+
emits: ["update:page"],
|
|
1356
|
+
setup(props, { attrs, emit }) {
|
|
1357
|
+
const go = (target2) => {
|
|
1358
|
+
if (target2 >= 1 && target2 <= props.count && target2 !== props.page)
|
|
1359
|
+
emit("update:page", target2);
|
|
1360
|
+
};
|
|
1361
|
+
return () => {
|
|
1362
|
+
const items = paginationRange(props.page, props.count, props.siblingCount);
|
|
1363
|
+
const lis = [];
|
|
1364
|
+
if (props.showControls) {
|
|
1365
|
+
lis.push(h("li", [
|
|
1366
|
+
h("button", {
|
|
1367
|
+
type: "button",
|
|
1368
|
+
class: "hl-pagination-item",
|
|
1369
|
+
"aria-label": "Previous page",
|
|
1370
|
+
disabled: props.page <= 1,
|
|
1371
|
+
onClick: () => go(props.page - 1)
|
|
1372
|
+
}, props.prevLabel)
|
|
1373
|
+
]));
|
|
1374
|
+
}
|
|
1375
|
+
items.forEach((item, i) => {
|
|
1376
|
+
if (item === ELLIPSIS) {
|
|
1377
|
+
lis.push(h("li", { key: `e${i}`, "aria-hidden": "true" }, [
|
|
1378
|
+
h("span", { class: "hl-pagination-ellipsis" }, "\u2026")
|
|
1379
|
+
]));
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1382
|
+
lis.push(h("li", { key: item }, [
|
|
1383
|
+
h("button", {
|
|
1384
|
+
type: "button",
|
|
1385
|
+
class: "hl-pagination-item",
|
|
1386
|
+
"aria-current": item === props.page ? "page" : void 0,
|
|
1387
|
+
"aria-label": `Page ${item}`,
|
|
1388
|
+
onClick: () => go(item)
|
|
1389
|
+
}, String(item))
|
|
1390
|
+
]));
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
if (props.showControls) {
|
|
1394
|
+
lis.push(h("li", [
|
|
1395
|
+
h("button", {
|
|
1396
|
+
type: "button",
|
|
1397
|
+
class: "hl-pagination-item",
|
|
1398
|
+
"aria-label": "Next page",
|
|
1399
|
+
disabled: props.page >= props.count,
|
|
1400
|
+
onClick: () => go(props.page + 1)
|
|
1401
|
+
}, props.nextLabel)
|
|
1402
|
+
]));
|
|
1403
|
+
}
|
|
1404
|
+
return h("nav", { "aria-label": "Pagination", ...attrs, class: cx("hl-pagination", attrs.class) }, [h("ul", lis)]);
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
1407
|
});
|
|
1408
|
-
var
|
|
1409
|
-
name: "HlToc",
|
|
1410
|
-
inheritAttrs: false,
|
|
1411
|
-
props: {
|
|
1408
|
+
var tocProps = {
|
|
1412
1409
|
contentSelector: { type: String, default: void 0 },
|
|
1413
1410
|
headings: { type: String, default: void 0 },
|
|
1414
1411
|
scrollSpy: { type: Boolean, default: void 0 }
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1412
|
+
};
|
|
1413
|
+
var Toc = defineComponent({
|
|
1414
|
+
name: "HlToc",
|
|
1415
|
+
inheritAttrs: false,
|
|
1416
|
+
props: tocProps,
|
|
1417
|
+
setup(props, { slots, attrs }) {
|
|
1418
|
+
const host = ref(null);
|
|
1419
|
+
useEnhancer(host, (el, options) => enhanceToc(el.ownerDocument, options), () => ({
|
|
1420
|
+
contentSelector: props.contentSelector,
|
|
1421
|
+
headings: props.headings,
|
|
1422
|
+
scrollSpy: props.scrollSpy
|
|
1423
|
+
}), () => [props.contentSelector, props.headings, props.scrollSpy]);
|
|
1424
|
+
return () => h("nav", { "aria-label": "Table of contents", ...attrs, "data-hl-toc": "", ref: host }, slots.default?.());
|
|
1425
|
+
}
|
|
1426
1426
|
});
|
|
1427
|
-
var SkipLink =
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
{ ...attrs, class: cx("hl-skip-link", attrs.class) },
|
|
1434
|
-
slots.default?.() ?? "Skip to content"
|
|
1435
|
-
);
|
|
1436
|
-
}
|
|
1427
|
+
var SkipLink = defineComponent({
|
|
1428
|
+
name: "HlSkipLink",
|
|
1429
|
+
inheritAttrs: false,
|
|
1430
|
+
setup(_, { slots, attrs }) {
|
|
1431
|
+
return () => h("a", { ...attrs, class: cx("hl-skip-link", attrs.class) }, slots.default?.() ?? "Skip to content");
|
|
1432
|
+
}
|
|
1437
1433
|
});
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
AccordionItem,
|
|
1441
|
-
Alert,
|
|
1442
|
-
Avatar,
|
|
1443
|
-
AvatarGroup,
|
|
1444
|
-
Badge,
|
|
1445
|
-
Breadcrumb,
|
|
1446
|
-
BreadcrumbItem,
|
|
1447
|
-
Button,
|
|
1448
|
-
Card,
|
|
1449
|
-
CardBody,
|
|
1450
|
-
CardDescription,
|
|
1451
|
-
CardFooter,
|
|
1452
|
-
CardHeader,
|
|
1453
|
-
CardTitle,
|
|
1454
|
-
Checkbox,
|
|
1455
|
-
Combobox,
|
|
1456
|
-
ComboboxInput,
|
|
1457
|
-
ComboboxList,
|
|
1458
|
-
ComboboxOption,
|
|
1459
|
-
Command,
|
|
1460
|
-
CommandEmpty,
|
|
1461
|
-
CommandGroup,
|
|
1462
|
-
CommandInput,
|
|
1463
|
-
CommandItem,
|
|
1464
|
-
CommandList,
|
|
1465
|
-
Disclosure,
|
|
1466
|
-
Drawer,
|
|
1467
|
-
DrawerBody,
|
|
1468
|
-
DrawerFooter,
|
|
1469
|
-
DrawerHeader,
|
|
1470
|
-
Dropdown,
|
|
1471
|
-
DropdownItem,
|
|
1472
|
-
DropdownMenu,
|
|
1473
|
-
DropdownSeparator,
|
|
1474
|
-
DropdownTrigger,
|
|
1475
|
-
Field,
|
|
1476
|
-
FieldError,
|
|
1477
|
-
FieldHelp,
|
|
1478
|
-
FieldLabel,
|
|
1479
|
-
Fieldset,
|
|
1480
|
-
HydratelessPlugin,
|
|
1481
|
-
Input,
|
|
1482
|
-
Kbd,
|
|
1483
|
-
Menu,
|
|
1484
|
-
MenuItem,
|
|
1485
|
-
Modal,
|
|
1486
|
-
ModalBody,
|
|
1487
|
-
ModalFooter,
|
|
1488
|
-
ModalHeader,
|
|
1489
|
-
Pagination,
|
|
1490
|
-
Popover,
|
|
1491
|
-
Progress,
|
|
1492
|
-
Radio,
|
|
1493
|
-
RadioGroup,
|
|
1494
|
-
SegmentedControl,
|
|
1495
|
-
Select,
|
|
1496
|
-
Separator,
|
|
1497
|
-
Skeleton,
|
|
1498
|
-
SkipLink,
|
|
1499
|
-
Slider,
|
|
1500
|
-
Spinner,
|
|
1501
|
-
Switch,
|
|
1502
|
-
Tab,
|
|
1503
|
-
TabList,
|
|
1504
|
-
TabPanel,
|
|
1505
|
-
Tabs,
|
|
1506
|
-
Textarea,
|
|
1507
|
-
ToastRegion,
|
|
1508
|
-
Toc,
|
|
1509
|
-
Tooltip,
|
|
1510
|
-
directives,
|
|
1511
|
-
useEnhancer,
|
|
1512
|
-
useFieldBindings,
|
|
1513
|
-
useToast,
|
|
1514
|
-
vHlAccordion,
|
|
1515
|
-
vHlCombobox,
|
|
1516
|
-
vHlCommand,
|
|
1517
|
-
vHlDisclosure,
|
|
1518
|
-
vHlDrawer,
|
|
1519
|
-
vHlDropdown,
|
|
1520
|
-
vHlMenu,
|
|
1521
|
-
vHlModal,
|
|
1522
|
-
vHlPopover,
|
|
1523
|
-
vHlTabs,
|
|
1524
|
-
vHlToc,
|
|
1525
|
-
vHlTooltip
|
|
1526
|
-
};
|
|
1434
|
+
|
|
1435
|
+
export { Accordion, AccordionItem, Alert, Avatar, AvatarGroup, Badge, Breadcrumb, BreadcrumbItem, Button, Card, CardBody, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, Disclosure, Drawer, DrawerBody, DrawerFooter, DrawerHeader, Dropdown, DropdownGroup, DropdownItem, DropdownMenu, DropdownSeparator, DropdownTrigger, Field, FieldError, FieldHelp, FieldLabel, Fieldset, Input, Kbd, Menu, MenuItem, MenuSubmenu, Modal, ModalBody, ModalFooter, ModalHeader, Pagination, Popover, Progress, Radio, RadioGroup, SegmentedControl, Select, Separator, Skeleton, SkipLink, Slider, Spinner, Switch, Tab, TabList, TabPanel, Table, Tabs, Textarea, ToastRegion, Toc, Tooltip, useEnhancer, useField, useToast };
|