@vuetify/v0 0.0.21 → 0.0.23
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 +34 -27
- package/dist/browser/index.js +7353 -4921
- package/dist/components/index.d.mts +4 -4
- package/dist/components/index.mjs +5 -5
- package/dist/{components-BomyjmT3.mjs → components-BI9xdoz5.mjs} +1171 -122
- package/dist/composables/index.d.mts +4 -4
- package/dist/composables/index.mjs +4 -5
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +2 -2
- package/dist/{globals-C3JrEDXZ.mjs → globals-WKdFmgwy.mjs} +1 -1
- package/dist/{index-MLb3LH9a.d.mts → index-Bby5ljat.d.mts} +55 -55
- package/dist/{index-CxeZr8jO.d.mts → index-C8YcMooA.d.mts} +6 -2
- package/dist/index-_y91DmIS.d.mts +4019 -0
- package/dist/{index-OU0IRbIS.d.mts → index-rcTqb9U3.d.mts} +610 -71
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +6 -7
- package/dist/json/attributes.json +898 -0
- package/dist/json/importMap.json +176 -0
- package/dist/json/tags.json +441 -0
- package/dist/json/web-types.json +2132 -0
- package/dist/types/index.d.mts +1 -1
- package/dist/useClickOutside-B47X8X6-.mjs +7656 -0
- package/dist/utilities/index.d.mts +3 -3
- package/dist/utilities/index.mjs +2 -2
- package/dist/{utilities-CjDz-Xvn.mjs → utilities-9i1hJnMd.mjs} +28 -1
- package/package.json +10 -4
- package/dist/composables-CbAPZabd.mjs +0 -3113
- package/dist/index-B0QJdwz9.d.mts +0 -2488
- package/dist/useStep-CfgBbrJB.mjs +0 -3192
- /package/dist/{constants-DypzAkYp.mjs → constants-3l8TGg5J.mjs} +0 -0
- /package/dist/{index-B9mKi4pr.d.mts → index-DMQJJUrv.d.mts} +0 -0
- /package/dist/{index-4jSy8KIt.d.mts → index-DYSwiS9k.d.mts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as isSelfClosingTag } from "./htmlElements-CXObxj0V.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as IN_BROWSER } from "./globals-
|
|
5
|
-
import { computed, createBlock, createCommentVNode, createPropsRestProxy, createTextVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUnmounted, openBlock, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
|
|
2
|
+
import { a as genId, d as isNullOrUndefined, h as isString, p as isObject, u as isNull } from "./utilities-9i1hJnMd.mjs";
|
|
3
|
+
import { $t as createContext, Ht as createRegistry, Nt as useProxyModel, P as createOverflow, Pt as createGroup, b as createStep, bt as createSingle, ht as useLocale, j as createPagination, o as useToggleScope, t as useClickOutside, zt as createSelection } from "./useClickOutside-B47X8X6-.mjs";
|
|
4
|
+
import { t as IN_BROWSER } from "./globals-WKdFmgwy.mjs";
|
|
5
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createPropsRestProxy, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUnmounted, openBlock, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
|
|
6
6
|
|
|
7
7
|
//#region src/components/Atom/Atom.vue
|
|
8
8
|
/**
|
|
@@ -26,7 +26,7 @@ import { computed, createBlock, createCommentVNode, createPropsRestProxy, create
|
|
|
26
26
|
* serving as the foundation for all other components that need polymorphic
|
|
27
27
|
* rendering capabilities.
|
|
28
28
|
*/
|
|
29
|
-
const _sfc_main$
|
|
29
|
+
const _sfc_main$42 = /* @__PURE__ */ defineComponent({
|
|
30
30
|
name: "Atom",
|
|
31
31
|
__name: "Atom",
|
|
32
32
|
props: {
|
|
@@ -57,12 +57,12 @@ const _sfc_main$27 = /* @__PURE__ */ defineComponent({
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
var Atom_default = _sfc_main$
|
|
60
|
+
var Atom_default = _sfc_main$42;
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/components/Avatar/AvatarRoot.vue
|
|
64
64
|
const [useAvatarRoot, provideAvatarContext] = createContext();
|
|
65
|
-
const _sfc_main$
|
|
65
|
+
const _sfc_main$41 = /* @__PURE__ */ defineComponent({
|
|
66
66
|
name: "AvatarRoot",
|
|
67
67
|
__name: "AvatarRoot",
|
|
68
68
|
props: {
|
|
@@ -87,11 +87,11 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
var AvatarRoot_default = _sfc_main$
|
|
90
|
+
var AvatarRoot_default = _sfc_main$41;
|
|
91
91
|
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/components/Avatar/AvatarFallback.vue
|
|
94
|
-
const _sfc_main$
|
|
94
|
+
const _sfc_main$40 = /* @__PURE__ */ defineComponent({
|
|
95
95
|
name: "AvatarFallback",
|
|
96
96
|
__name: "AvatarFallback",
|
|
97
97
|
props: {
|
|
@@ -112,93 +112,799 @@ const _sfc_main$25 = /* @__PURE__ */ defineComponent({
|
|
|
112
112
|
}, {
|
|
113
113
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
114
114
|
_: 3
|
|
115
|
-
}, 8, ["as", "renderless"])) : createCommentVNode("v-if", true);
|
|
115
|
+
}, 8, ["as", "renderless"])) : createCommentVNode("v-if", true);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
var AvatarFallback_default = _sfc_main$40;
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/components/Avatar/AvatarImage.vue
|
|
123
|
+
const _sfc_main$39 = /* @__PURE__ */ defineComponent({
|
|
124
|
+
name: "AvatarImage",
|
|
125
|
+
inheritAttrs: false,
|
|
126
|
+
__name: "AvatarImage",
|
|
127
|
+
props: {
|
|
128
|
+
src: {},
|
|
129
|
+
priority: { default: 0 },
|
|
130
|
+
namespace: { default: "v0:avatar" },
|
|
131
|
+
as: { default: "img" },
|
|
132
|
+
renderless: { type: Boolean }
|
|
133
|
+
},
|
|
134
|
+
emits: ["load", "error"],
|
|
135
|
+
setup(__props, { emit: __emit }) {
|
|
136
|
+
const props = createPropsRestProxy(__props, [
|
|
137
|
+
"as",
|
|
138
|
+
"renderless",
|
|
139
|
+
"priority",
|
|
140
|
+
"namespace"
|
|
141
|
+
]);
|
|
142
|
+
const emit = __emit;
|
|
143
|
+
const context = useAvatarRoot(__props.namespace);
|
|
144
|
+
const ticket = context.register({
|
|
145
|
+
priority: __props.priority,
|
|
146
|
+
type: "image",
|
|
147
|
+
disabled: true
|
|
148
|
+
});
|
|
149
|
+
function onLoad(e) {
|
|
150
|
+
ticket.disabled = false;
|
|
151
|
+
ticket.select();
|
|
152
|
+
emit("load", e);
|
|
153
|
+
}
|
|
154
|
+
function onError(e) {
|
|
155
|
+
ticket.disabled = true;
|
|
156
|
+
const first = context.seek("first");
|
|
157
|
+
if (first) context.select(first.id);
|
|
158
|
+
emit("error", e);
|
|
159
|
+
}
|
|
160
|
+
onUnmounted(() => {
|
|
161
|
+
context.unregister(ticket.id);
|
|
162
|
+
});
|
|
163
|
+
const slotProps = toRef(() => ({
|
|
164
|
+
isSelected: ticket.isSelected.value,
|
|
165
|
+
attrs: {
|
|
166
|
+
role: "img",
|
|
167
|
+
onLoad,
|
|
168
|
+
onError,
|
|
169
|
+
...props
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
return (_ctx, _cache) => {
|
|
173
|
+
return withDirectives((openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
174
|
+
as: __props.as,
|
|
175
|
+
renderless: __props.renderless
|
|
176
|
+
}), {
|
|
177
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
178
|
+
_: 3
|
|
179
|
+
}, 16, ["as", "renderless"])), [[vShow, unref(ticket).isSelected.value]]);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
var AvatarImage_default = _sfc_main$39;
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/components/Avatar/index.ts
|
|
187
|
+
/**
|
|
188
|
+
* Avatar component with sub-components for building avatars.
|
|
189
|
+
*
|
|
190
|
+
* @see https://0.vuetifyjs.com/components/avatar
|
|
191
|
+
*/
|
|
192
|
+
const Avatar = {
|
|
193
|
+
Root: AvatarRoot_default,
|
|
194
|
+
Image: AvatarImage_default,
|
|
195
|
+
Fallback: AvatarFallback_default
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/components/Checkbox/CheckboxGroup.vue
|
|
200
|
+
const [useCheckboxGroup, provideCheckboxGroup] = createContext();
|
|
201
|
+
const _sfc_main$38 = /* @__PURE__ */ defineComponent({
|
|
202
|
+
name: "CheckboxGroup",
|
|
203
|
+
__name: "CheckboxGroup",
|
|
204
|
+
props: /* @__PURE__ */ mergeModels({
|
|
205
|
+
namespace: { default: "v0:checkbox:group" },
|
|
206
|
+
disabled: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: false
|
|
209
|
+
},
|
|
210
|
+
enroll: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: false
|
|
213
|
+
},
|
|
214
|
+
mandatory: {
|
|
215
|
+
type: [Boolean, String],
|
|
216
|
+
default: false
|
|
217
|
+
},
|
|
218
|
+
label: {},
|
|
219
|
+
ariaLabelledby: {},
|
|
220
|
+
ariaDescribedby: {},
|
|
221
|
+
as: { default: "div" },
|
|
222
|
+
renderless: { type: Boolean }
|
|
223
|
+
}, {
|
|
224
|
+
"modelValue": {},
|
|
225
|
+
"modelModifiers": {}
|
|
226
|
+
}),
|
|
227
|
+
emits: /* @__PURE__ */ mergeModels(["update:model-value"], ["update:modelValue"]),
|
|
228
|
+
setup(__props) {
|
|
229
|
+
const model = useModel(__props, "modelValue");
|
|
230
|
+
const group = createGroup({
|
|
231
|
+
disabled: toRef(() => __props.disabled),
|
|
232
|
+
enroll: __props.enroll,
|
|
233
|
+
mandatory: __props.mandatory,
|
|
234
|
+
events: true
|
|
235
|
+
});
|
|
236
|
+
useProxyModel(group, model, { multiple: true });
|
|
237
|
+
provideCheckboxGroup(__props.namespace, group);
|
|
238
|
+
const slotProps = toRef(() => ({
|
|
239
|
+
isDisabled: toValue(group.disabled),
|
|
240
|
+
isNoneSelected: group.isNoneSelected.value,
|
|
241
|
+
isAllSelected: group.isAllSelected.value,
|
|
242
|
+
isMixed: group.isMixed.value,
|
|
243
|
+
select: group.select,
|
|
244
|
+
unselect: group.unselect,
|
|
245
|
+
toggle: group.toggle,
|
|
246
|
+
selectAll: group.selectAll,
|
|
247
|
+
unselectAll: group.unselectAll,
|
|
248
|
+
toggleAll: group.toggleAll,
|
|
249
|
+
attrs: {
|
|
250
|
+
"role": "group",
|
|
251
|
+
"aria-label": __props.label || void 0,
|
|
252
|
+
"aria-labelledby": __props.ariaLabelledby || void 0,
|
|
253
|
+
"aria-describedby": __props.ariaDescribedby || void 0
|
|
254
|
+
}
|
|
255
|
+
}));
|
|
256
|
+
return (_ctx, _cache) => {
|
|
257
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
258
|
+
as: __props.as,
|
|
259
|
+
renderless: __props.renderless
|
|
260
|
+
}), {
|
|
261
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
262
|
+
_: 3
|
|
263
|
+
}, 16, ["as", "renderless"]);
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
var CheckboxGroup_default = _sfc_main$38;
|
|
268
|
+
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/components/Checkbox/CheckboxRoot.vue
|
|
271
|
+
const [useCheckboxRoot, provideCheckboxRoot] = createContext();
|
|
272
|
+
const _sfc_main$37 = /* @__PURE__ */ defineComponent({
|
|
273
|
+
name: "CheckboxRoot",
|
|
274
|
+
inheritAttrs: false,
|
|
275
|
+
__name: "CheckboxRoot",
|
|
276
|
+
props: /* @__PURE__ */ mergeModels({
|
|
277
|
+
id: { default: () => /* @__PURE__ */ genId() },
|
|
278
|
+
label: {},
|
|
279
|
+
value: {},
|
|
280
|
+
name: {},
|
|
281
|
+
form: {},
|
|
282
|
+
disabled: { default: false },
|
|
283
|
+
indeterminate: { default: false },
|
|
284
|
+
namespace: { default: "v0:checkbox:root" },
|
|
285
|
+
groupNamespace: { default: "v0:checkbox:group" },
|
|
286
|
+
ariaLabelledby: {},
|
|
287
|
+
ariaDescribedby: {},
|
|
288
|
+
ariaInvalid: { type: Boolean },
|
|
289
|
+
as: { default: "button" },
|
|
290
|
+
renderless: { type: Boolean }
|
|
291
|
+
}, {
|
|
292
|
+
"modelValue": { type: Boolean },
|
|
293
|
+
"modelModifiers": {}
|
|
294
|
+
}),
|
|
295
|
+
emits: /* @__PURE__ */ mergeModels(["update:model-value"], ["update:modelValue"]),
|
|
296
|
+
setup(__props) {
|
|
297
|
+
const attrs = useAttrs();
|
|
298
|
+
let group = null;
|
|
299
|
+
try {
|
|
300
|
+
group = useCheckboxGroup(__props.groupNamespace);
|
|
301
|
+
} catch {}
|
|
302
|
+
const model = useModel(__props, "modelValue");
|
|
303
|
+
const ticket = group?.register({
|
|
304
|
+
id: __props.id,
|
|
305
|
+
value: __props.value,
|
|
306
|
+
disabled: __props.disabled,
|
|
307
|
+
indeterminate: __props.indeterminate
|
|
308
|
+
});
|
|
309
|
+
const isChecked = toRef(() => ticket ? toValue(ticket.isSelected) : model.value ?? false);
|
|
310
|
+
const isMixed = toRef(() => ticket ? toValue(ticket.isMixed) : toValue(__props.indeterminate) ?? false);
|
|
311
|
+
const isDisabled = toRef(() => group && ticket ? toValue(ticket.disabled) || toValue(group.disabled) : toValue(__props.disabled) ?? false);
|
|
312
|
+
const dataState = toRef(() => isMixed.value ? "indeterminate" : isChecked.value ? "checked" : "unchecked");
|
|
313
|
+
function toggle() {
|
|
314
|
+
if (isDisabled.value) return;
|
|
315
|
+
if (ticket) ticket.toggle();
|
|
316
|
+
else model.value = !model.value;
|
|
317
|
+
}
|
|
318
|
+
function select() {
|
|
319
|
+
if (isDisabled.value) return;
|
|
320
|
+
if (ticket) ticket.select();
|
|
321
|
+
else model.value = true;
|
|
322
|
+
}
|
|
323
|
+
function unselect() {
|
|
324
|
+
if (isDisabled.value) return;
|
|
325
|
+
if (ticket) ticket.unselect();
|
|
326
|
+
else model.value = false;
|
|
327
|
+
}
|
|
328
|
+
function mix() {
|
|
329
|
+
if (isDisabled.value || !ticket) return;
|
|
330
|
+
ticket.mix();
|
|
331
|
+
}
|
|
332
|
+
function unmix() {
|
|
333
|
+
if (isDisabled.value || !ticket) return;
|
|
334
|
+
ticket.unmix();
|
|
335
|
+
}
|
|
336
|
+
function onClick() {
|
|
337
|
+
toggle();
|
|
338
|
+
}
|
|
339
|
+
function onKeydown(e) {
|
|
340
|
+
if (e.key !== " ") return;
|
|
341
|
+
e.preventDefault();
|
|
342
|
+
toggle();
|
|
343
|
+
}
|
|
344
|
+
onUnmounted(() => {
|
|
345
|
+
if (!ticket || !group) return;
|
|
346
|
+
group.unregister(ticket.id);
|
|
347
|
+
});
|
|
348
|
+
const context = {
|
|
349
|
+
id: __props.id,
|
|
350
|
+
label: __props.label,
|
|
351
|
+
value: __props.value,
|
|
352
|
+
name: __props.name,
|
|
353
|
+
form: __props.form,
|
|
354
|
+
isChecked,
|
|
355
|
+
isMixed,
|
|
356
|
+
isDisabled,
|
|
357
|
+
select,
|
|
358
|
+
unselect,
|
|
359
|
+
toggle,
|
|
360
|
+
mix,
|
|
361
|
+
unmix
|
|
362
|
+
};
|
|
363
|
+
provideCheckboxRoot(__props.namespace, context);
|
|
364
|
+
const slotProps = toRef(() => ({
|
|
365
|
+
id: __props.id,
|
|
366
|
+
label: __props.label,
|
|
367
|
+
value: __props.value,
|
|
368
|
+
isChecked: isChecked.value,
|
|
369
|
+
isMixed: isMixed.value,
|
|
370
|
+
isDisabled: isDisabled.value,
|
|
371
|
+
select,
|
|
372
|
+
unselect,
|
|
373
|
+
toggle,
|
|
374
|
+
mix,
|
|
375
|
+
unmix,
|
|
376
|
+
attrs: {
|
|
377
|
+
"type": __props.as === "button" ? "button" : void 0,
|
|
378
|
+
"role": "checkbox",
|
|
379
|
+
"aria-checked": isMixed.value ? "mixed" : isChecked.value,
|
|
380
|
+
"aria-disabled": isDisabled.value || void 0,
|
|
381
|
+
"aria-label": __props.label || void 0,
|
|
382
|
+
"aria-labelledby": __props.ariaLabelledby || void 0,
|
|
383
|
+
"aria-describedby": __props.ariaDescribedby || void 0,
|
|
384
|
+
"aria-invalid": __props.ariaInvalid || void 0,
|
|
385
|
+
"tabindex": isDisabled.value ? void 0 : 0,
|
|
386
|
+
"data-state": dataState.value,
|
|
387
|
+
"data-disabled": isDisabled.value ? true : void 0
|
|
388
|
+
}
|
|
389
|
+
}));
|
|
390
|
+
return (_ctx, _cache) => {
|
|
391
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(Atom_default), mergeProps({
|
|
392
|
+
...unref(attrs),
|
|
393
|
+
...slotProps.value.attrs
|
|
394
|
+
}, {
|
|
395
|
+
as: __props.as,
|
|
396
|
+
renderless: __props.renderless,
|
|
397
|
+
onClick,
|
|
398
|
+
onKeydown
|
|
399
|
+
}), {
|
|
400
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
401
|
+
_: 3
|
|
402
|
+
}, 16, ["as", "renderless"]), __props.name ? (openBlock(), createBlock(CheckboxHiddenInput_default, { key: 0 })) : createCommentVNode("v-if", true)], 64);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
var CheckboxRoot_default = _sfc_main$37;
|
|
407
|
+
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/components/Checkbox/CheckboxHiddenInput.vue
|
|
410
|
+
const _hoisted_1$1 = [
|
|
411
|
+
"checked",
|
|
412
|
+
"disabled",
|
|
413
|
+
"form",
|
|
414
|
+
"name",
|
|
415
|
+
"value"
|
|
416
|
+
];
|
|
417
|
+
const visuallyHiddenStyle$1 = {
|
|
418
|
+
position: "absolute",
|
|
419
|
+
width: "1px",
|
|
420
|
+
height: "1px",
|
|
421
|
+
padding: "0",
|
|
422
|
+
margin: "-1px",
|
|
423
|
+
overflow: "hidden",
|
|
424
|
+
clip: "rect(0, 0, 0, 0)",
|
|
425
|
+
whiteSpace: "nowrap",
|
|
426
|
+
border: "0"
|
|
427
|
+
};
|
|
428
|
+
const _sfc_main$36 = /* @__PURE__ */ defineComponent({
|
|
429
|
+
name: "CheckboxHiddenInput",
|
|
430
|
+
__name: "CheckboxHiddenInput",
|
|
431
|
+
props: {
|
|
432
|
+
namespace: { default: "v0:checkbox:root" },
|
|
433
|
+
name: {},
|
|
434
|
+
value: {},
|
|
435
|
+
form: {}
|
|
436
|
+
},
|
|
437
|
+
setup(__props) {
|
|
438
|
+
const root = useCheckboxRoot(__props.namespace);
|
|
439
|
+
const name = toRef(() => __props.name ?? root.name);
|
|
440
|
+
const form = toRef(() => __props.form ?? root.form);
|
|
441
|
+
const value = toRef(() => {
|
|
442
|
+
const v = __props.value ?? root.value ?? "on";
|
|
443
|
+
if (/* @__PURE__ */ isNullOrUndefined(v)) return "on";
|
|
444
|
+
if (/* @__PURE__ */ isObject(v)) return JSON.stringify(v);
|
|
445
|
+
return String(v);
|
|
446
|
+
});
|
|
447
|
+
const isChecked = root.isChecked;
|
|
448
|
+
const isDisabled = root.isDisabled;
|
|
449
|
+
return (_ctx, _cache) => {
|
|
450
|
+
return openBlock(), createElementBlock("input", {
|
|
451
|
+
checked: unref(isChecked),
|
|
452
|
+
disabled: unref(isDisabled),
|
|
453
|
+
form: form.value,
|
|
454
|
+
inert: "",
|
|
455
|
+
name: name.value,
|
|
456
|
+
style: visuallyHiddenStyle$1,
|
|
457
|
+
tabindex: "-1",
|
|
458
|
+
type: "checkbox",
|
|
459
|
+
value: value.value
|
|
460
|
+
}, null, 8, _hoisted_1$1);
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
var CheckboxHiddenInput_default = _sfc_main$36;
|
|
465
|
+
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region src/components/Checkbox/CheckboxIndicator.vue
|
|
468
|
+
const _sfc_main$35 = /* @__PURE__ */ defineComponent({
|
|
469
|
+
name: "CheckboxIndicator",
|
|
470
|
+
__name: "CheckboxIndicator",
|
|
471
|
+
props: {
|
|
472
|
+
namespace: { default: "v0:checkbox:root" },
|
|
473
|
+
as: { default: "span" },
|
|
474
|
+
renderless: { type: Boolean }
|
|
475
|
+
},
|
|
476
|
+
setup(__props) {
|
|
477
|
+
const root = useCheckboxRoot(__props.namespace);
|
|
478
|
+
const isChecked = toRef(() => toValue(root.isChecked));
|
|
479
|
+
const isMixed = toRef(() => toValue(root.isMixed));
|
|
480
|
+
const isVisible = toRef(() => isChecked.value || isMixed.value);
|
|
481
|
+
const dataState = toRef(() => isMixed.value ? "indeterminate" : isChecked.value ? "checked" : "unchecked");
|
|
482
|
+
const slotProps = toRef(() => ({
|
|
483
|
+
isChecked: isChecked.value,
|
|
484
|
+
isMixed: isMixed.value,
|
|
485
|
+
attrs: {
|
|
486
|
+
"data-state": dataState.value,
|
|
487
|
+
"style": { visibility: isVisible.value ? "visible" : "hidden" }
|
|
488
|
+
}
|
|
489
|
+
}));
|
|
490
|
+
return (_ctx, _cache) => {
|
|
491
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
492
|
+
as: __props.as,
|
|
493
|
+
renderless: __props.renderless
|
|
494
|
+
}), {
|
|
495
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
496
|
+
_: 3
|
|
497
|
+
}, 16, ["as", "renderless"]);
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
var CheckboxIndicator_default = _sfc_main$35;
|
|
502
|
+
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region src/components/Checkbox/CheckboxSelectAll.vue
|
|
505
|
+
const _sfc_main$34 = /* @__PURE__ */ defineComponent({
|
|
506
|
+
name: "CheckboxSelectAll",
|
|
507
|
+
inheritAttrs: false,
|
|
508
|
+
__name: "CheckboxSelectAll",
|
|
509
|
+
props: {
|
|
510
|
+
label: {},
|
|
511
|
+
disabled: { type: Boolean },
|
|
512
|
+
namespace: {},
|
|
513
|
+
groupNamespace: {},
|
|
514
|
+
ariaLabelledby: {},
|
|
515
|
+
ariaDescribedby: {},
|
|
516
|
+
as: {},
|
|
517
|
+
renderless: { type: Boolean }
|
|
518
|
+
},
|
|
519
|
+
setup(__props) {
|
|
520
|
+
const attrs = useAttrs();
|
|
521
|
+
const props = __props;
|
|
522
|
+
const { as = "button", renderless, label, namespace = "v0:checkbox:root", groupNamespace = "v0:checkbox:group" } = props;
|
|
523
|
+
const group = useCheckboxGroup(groupNamespace);
|
|
524
|
+
const id = /* @__PURE__ */ genId();
|
|
525
|
+
const isAllSelected = toRef(() => group.isAllSelected.value);
|
|
526
|
+
const isMixed = toRef(() => group.isMixed.value);
|
|
527
|
+
const isDisabled = toRef(() => toValue(props.disabled) || toValue(group.disabled));
|
|
528
|
+
const dataState = toRef(() => isMixed.value ? "indeterminate" : isAllSelected.value ? "checked" : "unchecked");
|
|
529
|
+
function onClick() {
|
|
530
|
+
if (isDisabled.value) return;
|
|
531
|
+
group.toggleAll();
|
|
532
|
+
}
|
|
533
|
+
function onKeydown(e) {
|
|
534
|
+
if (e.key !== " ") return;
|
|
535
|
+
e.preventDefault();
|
|
536
|
+
if (isDisabled.value) return;
|
|
537
|
+
group.toggleAll();
|
|
538
|
+
}
|
|
539
|
+
provideCheckboxRoot(namespace, {
|
|
540
|
+
id,
|
|
541
|
+
label,
|
|
542
|
+
value: void 0,
|
|
543
|
+
name: void 0,
|
|
544
|
+
form: void 0,
|
|
545
|
+
isChecked: isAllSelected,
|
|
546
|
+
isMixed,
|
|
547
|
+
isDisabled,
|
|
548
|
+
select: group.selectAll,
|
|
549
|
+
unselect: group.unselectAll,
|
|
550
|
+
toggle: group.toggleAll,
|
|
551
|
+
mix: () => {},
|
|
552
|
+
unmix: () => {}
|
|
553
|
+
});
|
|
554
|
+
const slotProps = toRef(() => ({
|
|
555
|
+
label,
|
|
556
|
+
isAllSelected: isAllSelected.value,
|
|
557
|
+
isMixed: isMixed.value,
|
|
558
|
+
isDisabled: isDisabled.value,
|
|
559
|
+
selectAll: group.selectAll,
|
|
560
|
+
unselectAll: group.unselectAll,
|
|
561
|
+
toggleAll: group.toggleAll,
|
|
562
|
+
attrs: {
|
|
563
|
+
"type": as === "button" ? "button" : void 0,
|
|
564
|
+
"role": "checkbox",
|
|
565
|
+
"aria-checked": isMixed.value ? "mixed" : isAllSelected.value,
|
|
566
|
+
"aria-disabled": isDisabled.value || void 0,
|
|
567
|
+
"aria-label": label || void 0,
|
|
568
|
+
"aria-labelledby": props.ariaLabelledby || void 0,
|
|
569
|
+
"aria-describedby": props.ariaDescribedby || void 0,
|
|
570
|
+
"tabindex": isDisabled.value ? void 0 : 0,
|
|
571
|
+
"data-state": dataState.value,
|
|
572
|
+
"data-disabled": isDisabled.value ? true : void 0
|
|
573
|
+
}
|
|
574
|
+
}));
|
|
575
|
+
return (_ctx, _cache) => {
|
|
576
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
577
|
+
...unref(attrs),
|
|
578
|
+
...slotProps.value.attrs
|
|
579
|
+
}, {
|
|
580
|
+
as: unref(as),
|
|
581
|
+
renderless: unref(renderless),
|
|
582
|
+
onClick,
|
|
583
|
+
onKeydown
|
|
584
|
+
}), {
|
|
585
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
586
|
+
_: 3
|
|
587
|
+
}, 16, ["as", "renderless"]);
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
var CheckboxSelectAll_default = _sfc_main$34;
|
|
592
|
+
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region src/components/Checkbox/index.ts
|
|
595
|
+
/**
|
|
596
|
+
* Checkbox component with sub-components for checkbox controls.
|
|
597
|
+
*
|
|
598
|
+
* @see https://0.vuetifyjs.com/components/forms/checkbox
|
|
599
|
+
*
|
|
600
|
+
* @example
|
|
601
|
+
* ```vue
|
|
602
|
+
* <script lang="ts" setup>
|
|
603
|
+
* import { Checkbox } from '@vuetify/v0'
|
|
604
|
+
* <\/script>
|
|
605
|
+
*
|
|
606
|
+
* <template>
|
|
607
|
+
* <label>
|
|
608
|
+
* <Checkbox.Root>
|
|
609
|
+
* <Checkbox.Indicator>✓</Checkbox.Indicator>
|
|
610
|
+
* </Checkbox.Root>
|
|
611
|
+
* I agree to terms
|
|
612
|
+
* </label>
|
|
613
|
+
* </template>
|
|
614
|
+
* ```
|
|
615
|
+
*/
|
|
616
|
+
const Checkbox = {
|
|
617
|
+
Group: CheckboxGroup_default,
|
|
618
|
+
HiddenInput: CheckboxHiddenInput_default,
|
|
619
|
+
Indicator: CheckboxIndicator_default,
|
|
620
|
+
Root: CheckboxRoot_default,
|
|
621
|
+
SelectAll: CheckboxSelectAll_default
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/components/Dialog/DialogRoot.vue
|
|
626
|
+
const [useDialogContext, provideDialogContext] = createContext();
|
|
627
|
+
const _sfc_main$33 = /* @__PURE__ */ defineComponent({
|
|
628
|
+
name: "DialogRoot",
|
|
629
|
+
__name: "DialogRoot",
|
|
630
|
+
props: /* @__PURE__ */ mergeModels({
|
|
631
|
+
namespace: { default: "v0:dialog" },
|
|
632
|
+
id: {},
|
|
633
|
+
as: { default: null },
|
|
634
|
+
renderless: { type: Boolean }
|
|
635
|
+
}, {
|
|
636
|
+
"modelValue": {
|
|
637
|
+
type: Boolean,
|
|
638
|
+
default: false
|
|
639
|
+
},
|
|
640
|
+
"modelModifiers": {}
|
|
641
|
+
}),
|
|
642
|
+
emits: /* @__PURE__ */ mergeModels(["update:modelValue"], ["update:modelValue"]),
|
|
643
|
+
setup(__props) {
|
|
644
|
+
const props = createPropsRestProxy(__props, ["as", "namespace"]);
|
|
645
|
+
const isOpen = useModel(__props, "modelValue");
|
|
646
|
+
const id = toRef(() => props.id ?? useId());
|
|
647
|
+
const titleId = toRef(() => `${toValue(id)}-title`);
|
|
648
|
+
const descriptionId = toRef(() => `${toValue(id)}-description`);
|
|
649
|
+
function open() {
|
|
650
|
+
isOpen.value = true;
|
|
651
|
+
}
|
|
652
|
+
function close() {
|
|
653
|
+
isOpen.value = false;
|
|
654
|
+
}
|
|
655
|
+
provideDialogContext(__props.namespace, {
|
|
656
|
+
isOpen,
|
|
657
|
+
id: toValue(id),
|
|
658
|
+
titleId: toValue(titleId),
|
|
659
|
+
descriptionId: toValue(descriptionId),
|
|
660
|
+
open,
|
|
661
|
+
close
|
|
662
|
+
});
|
|
663
|
+
const slotProps = toRef(() => ({
|
|
664
|
+
id: toValue(id),
|
|
665
|
+
isOpen: isOpen.value,
|
|
666
|
+
open,
|
|
667
|
+
close
|
|
668
|
+
}));
|
|
669
|
+
return (_ctx, _cache) => {
|
|
670
|
+
return openBlock(), createBlock(unref(Atom_default), {
|
|
671
|
+
as: __props.as,
|
|
672
|
+
renderless: ""
|
|
673
|
+
}, {
|
|
674
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
675
|
+
_: 3
|
|
676
|
+
}, 8, ["as"]);
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
var DialogRoot_default = _sfc_main$33;
|
|
681
|
+
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/components/Dialog/DialogClose.vue
|
|
684
|
+
const _sfc_main$32 = /* @__PURE__ */ defineComponent({
|
|
685
|
+
name: "DialogClose",
|
|
686
|
+
__name: "DialogClose",
|
|
687
|
+
props: {
|
|
688
|
+
namespace: { default: "v0:dialog" },
|
|
689
|
+
as: { default: "button" },
|
|
690
|
+
renderless: { type: Boolean }
|
|
691
|
+
},
|
|
692
|
+
setup(__props) {
|
|
693
|
+
const context = useDialogContext(__props.namespace);
|
|
694
|
+
function onClick() {
|
|
695
|
+
context.close();
|
|
696
|
+
}
|
|
697
|
+
const slotProps = toRef(() => ({
|
|
698
|
+
isOpen: context.isOpen.value,
|
|
699
|
+
attrs: {
|
|
700
|
+
"type": __props.as === "button" ? "button" : void 0,
|
|
701
|
+
"aria-label": "Close"
|
|
702
|
+
}
|
|
703
|
+
}));
|
|
704
|
+
return (_ctx, _cache) => {
|
|
705
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({ as: __props.as }, slotProps.value.attrs, { onClick }), {
|
|
706
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
707
|
+
_: 3
|
|
708
|
+
}, 16, ["as"]);
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
var DialogClose_default = _sfc_main$32;
|
|
713
|
+
|
|
714
|
+
//#endregion
|
|
715
|
+
//#region src/components/Dialog/DialogContent.vue
|
|
716
|
+
const _sfc_main$31 = /* @__PURE__ */ defineComponent({
|
|
717
|
+
name: "DialogContent",
|
|
718
|
+
__name: "DialogContent",
|
|
719
|
+
props: {
|
|
720
|
+
namespace: { default: "v0:dialog" },
|
|
721
|
+
closeOnClickOutside: {
|
|
722
|
+
type: Boolean,
|
|
723
|
+
default: true
|
|
724
|
+
},
|
|
725
|
+
as: { default: "dialog" },
|
|
726
|
+
renderless: { type: Boolean }
|
|
727
|
+
},
|
|
728
|
+
emits: ["cancel", "close"],
|
|
729
|
+
setup(__props, { emit: __emit }) {
|
|
730
|
+
const emit = __emit;
|
|
731
|
+
const context = useDialogContext(__props.namespace);
|
|
732
|
+
const contentRef = useTemplateRef("content");
|
|
733
|
+
onMounted(() => {
|
|
734
|
+
if (context.isOpen.value) (contentRef.value?.element)?.showModal();
|
|
735
|
+
});
|
|
736
|
+
watch(context.isOpen, (isOpen) => {
|
|
737
|
+
const element = contentRef.value?.element;
|
|
738
|
+
if (!element) return;
|
|
739
|
+
if (isOpen) element.showModal?.();
|
|
740
|
+
else element.close?.();
|
|
741
|
+
});
|
|
742
|
+
useToggleScope(
|
|
743
|
+
() => __props.closeOnClickOutside && context.isOpen.value,
|
|
744
|
+
/* v8 ignore start -- callback tested via useClickOutside */
|
|
745
|
+
() => {
|
|
746
|
+
useClickOutside(() => contentRef.value?.element, () => context.close(), { bounds: true });
|
|
747
|
+
}
|
|
748
|
+
/* v8 ignore stop */
|
|
749
|
+
);
|
|
750
|
+
function onCancel(e) {
|
|
751
|
+
context.isOpen.value = false;
|
|
752
|
+
emit("cancel", e);
|
|
753
|
+
}
|
|
754
|
+
function onClose(e) {
|
|
755
|
+
context.isOpen.value = false;
|
|
756
|
+
emit("close", e);
|
|
757
|
+
}
|
|
758
|
+
const slotProps = toRef(() => ({
|
|
759
|
+
isOpen: context.isOpen.value,
|
|
760
|
+
attrs: {
|
|
761
|
+
"id": context.id,
|
|
762
|
+
"role": "dialog",
|
|
763
|
+
"aria-modal": "true",
|
|
764
|
+
"aria-labelledby": context.titleId,
|
|
765
|
+
"aria-describedby": context.descriptionId
|
|
766
|
+
}
|
|
767
|
+
}));
|
|
768
|
+
return (_ctx, _cache) => {
|
|
769
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({
|
|
770
|
+
ref: "content",
|
|
771
|
+
as: __props.as
|
|
772
|
+
}, slotProps.value.attrs, {
|
|
773
|
+
onCancel,
|
|
774
|
+
onClose
|
|
775
|
+
}), {
|
|
776
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
777
|
+
_: 3
|
|
778
|
+
}, 16, ["as"]);
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
var DialogContent_default = _sfc_main$31;
|
|
783
|
+
|
|
784
|
+
//#endregion
|
|
785
|
+
//#region src/components/Dialog/DialogDescription.vue
|
|
786
|
+
const _sfc_main$30 = /* @__PURE__ */ defineComponent({
|
|
787
|
+
name: "DialogDescription",
|
|
788
|
+
__name: "DialogDescription",
|
|
789
|
+
props: {
|
|
790
|
+
namespace: { default: "v0:dialog" },
|
|
791
|
+
as: { default: "p" },
|
|
792
|
+
renderless: { type: Boolean }
|
|
793
|
+
},
|
|
794
|
+
setup(__props) {
|
|
795
|
+
const context = useDialogContext(__props.namespace);
|
|
796
|
+
const slotProps = toRef(() => ({ attrs: { id: context.descriptionId } }));
|
|
797
|
+
return (_ctx, _cache) => {
|
|
798
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({ as: __props.as }, slotProps.value.attrs), {
|
|
799
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
800
|
+
_: 3
|
|
801
|
+
}, 16, ["as"]);
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
var DialogDescription_default = _sfc_main$30;
|
|
806
|
+
|
|
807
|
+
//#endregion
|
|
808
|
+
//#region src/components/Dialog/DialogTitle.vue
|
|
809
|
+
const _sfc_main$29 = /* @__PURE__ */ defineComponent({
|
|
810
|
+
name: "DialogTitle",
|
|
811
|
+
__name: "DialogTitle",
|
|
812
|
+
props: {
|
|
813
|
+
namespace: { default: "v0:dialog" },
|
|
814
|
+
as: { default: "h2" },
|
|
815
|
+
renderless: { type: Boolean }
|
|
816
|
+
},
|
|
817
|
+
setup(__props) {
|
|
818
|
+
const context = useDialogContext(__props.namespace);
|
|
819
|
+
const slotProps = toRef(() => ({ attrs: { id: context.titleId } }));
|
|
820
|
+
return (_ctx, _cache) => {
|
|
821
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({ as: __props.as }, slotProps.value.attrs), {
|
|
822
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
823
|
+
_: 3
|
|
824
|
+
}, 16, ["as"]);
|
|
116
825
|
};
|
|
117
826
|
}
|
|
118
827
|
});
|
|
119
|
-
var
|
|
828
|
+
var DialogTitle_default = _sfc_main$29;
|
|
120
829
|
|
|
121
830
|
//#endregion
|
|
122
|
-
//#region src/components/
|
|
123
|
-
const _sfc_main$
|
|
124
|
-
name: "
|
|
125
|
-
|
|
126
|
-
__name: "AvatarImage",
|
|
831
|
+
//#region src/components/Dialog/DialogActivator.vue
|
|
832
|
+
const _sfc_main$28 = /* @__PURE__ */ defineComponent({
|
|
833
|
+
name: "DialogActivator",
|
|
834
|
+
__name: "DialogActivator",
|
|
127
835
|
props: {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
namespace: { default: "v0:avatar" },
|
|
131
|
-
as: { default: "img" },
|
|
836
|
+
namespace: { default: "v0:dialog" },
|
|
837
|
+
as: { default: "button" },
|
|
132
838
|
renderless: { type: Boolean }
|
|
133
839
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"renderless",
|
|
139
|
-
"priority",
|
|
140
|
-
"namespace"
|
|
141
|
-
]);
|
|
142
|
-
const emit = __emit;
|
|
143
|
-
const context = useAvatarRoot(__props.namespace);
|
|
144
|
-
const ticket = context.register({
|
|
145
|
-
priority: __props.priority,
|
|
146
|
-
type: "image",
|
|
147
|
-
disabled: true
|
|
148
|
-
});
|
|
149
|
-
function onLoad(e) {
|
|
150
|
-
ticket.disabled = false;
|
|
151
|
-
ticket.select();
|
|
152
|
-
emit("load", e);
|
|
153
|
-
}
|
|
154
|
-
function onError(e) {
|
|
155
|
-
ticket.disabled = true;
|
|
156
|
-
const first = context.seek("first");
|
|
157
|
-
if (first) context.select(first.id);
|
|
158
|
-
emit("error", e);
|
|
840
|
+
setup(__props) {
|
|
841
|
+
const context = useDialogContext(__props.namespace);
|
|
842
|
+
function onClick() {
|
|
843
|
+
context.open();
|
|
159
844
|
}
|
|
160
|
-
onUnmounted(() => {
|
|
161
|
-
context.unregister(ticket.id);
|
|
162
|
-
});
|
|
163
845
|
const slotProps = toRef(() => ({
|
|
164
|
-
|
|
846
|
+
isOpen: context.isOpen.value,
|
|
165
847
|
attrs: {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
848
|
+
"type": __props.as === "button" ? "button" : void 0,
|
|
849
|
+
"aria-haspopup": "dialog",
|
|
850
|
+
"aria-expanded": context.isOpen.value,
|
|
851
|
+
"data-dialog-open": context.isOpen.value ? "" : void 0
|
|
170
852
|
}
|
|
171
853
|
}));
|
|
172
854
|
return (_ctx, _cache) => {
|
|
173
|
-
return
|
|
174
|
-
as: __props.as,
|
|
175
|
-
renderless: __props.renderless
|
|
176
|
-
}), {
|
|
855
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps({ as: __props.as }, slotProps.value.attrs, { onClick }), {
|
|
177
856
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
178
857
|
_: 3
|
|
179
|
-
}, 16, ["as"
|
|
858
|
+
}, 16, ["as"]);
|
|
180
859
|
};
|
|
181
860
|
}
|
|
182
861
|
});
|
|
183
|
-
var
|
|
862
|
+
var DialogActivator_default = _sfc_main$28;
|
|
184
863
|
|
|
185
864
|
//#endregion
|
|
186
|
-
//#region src/components/
|
|
865
|
+
//#region src/components/Dialog/index.ts
|
|
187
866
|
/**
|
|
188
|
-
*
|
|
867
|
+
* Dialog component with sub-components for building modal dialogs.
|
|
189
868
|
*
|
|
190
|
-
* @see https://0.vuetifyjs.com/components/
|
|
869
|
+
* @see https://0.vuetifyjs.com/components/dialog
|
|
870
|
+
*
|
|
871
|
+
* @example
|
|
872
|
+
* ```vue
|
|
873
|
+
* <script lang="ts" setup>
|
|
874
|
+
* import { Dialog } from '@vuetify/v0'
|
|
875
|
+
* <\/script>
|
|
876
|
+
*
|
|
877
|
+
* <template>
|
|
878
|
+
* <Dialog.Root>
|
|
879
|
+
* <Dialog.Activator>
|
|
880
|
+
* Open Dialog
|
|
881
|
+
* </Dialog.Activator>
|
|
882
|
+
*
|
|
883
|
+
* <Dialog.Content>
|
|
884
|
+
* <Dialog.Title>Dialog Title</Dialog.Title>
|
|
885
|
+
* <Dialog.Description>Dialog description text.</Dialog.Description>
|
|
886
|
+
*
|
|
887
|
+
* <p>Dialog content goes here.</p>
|
|
888
|
+
*
|
|
889
|
+
* <Dialog.Close>Close</Dialog.Close>
|
|
890
|
+
* </Dialog.Content>
|
|
891
|
+
* </Dialog.Root>
|
|
892
|
+
* </template>
|
|
893
|
+
* ```
|
|
191
894
|
*/
|
|
192
|
-
const
|
|
193
|
-
Root:
|
|
194
|
-
|
|
195
|
-
|
|
895
|
+
const Dialog = {
|
|
896
|
+
Root: DialogRoot_default,
|
|
897
|
+
Activator: DialogActivator_default,
|
|
898
|
+
Content: DialogContent_default,
|
|
899
|
+
Title: DialogTitle_default,
|
|
900
|
+
Description: DialogDescription_default,
|
|
901
|
+
Close: DialogClose_default
|
|
196
902
|
};
|
|
197
903
|
|
|
198
904
|
//#endregion
|
|
199
905
|
//#region src/components/ExpansionPanel/ExpansionPanelRoot.vue
|
|
200
906
|
const [useExpansionPanelRoot, provideExpansionPanelSelection] = createContext();
|
|
201
|
-
const _sfc_main$
|
|
907
|
+
const _sfc_main$27 = /* @__PURE__ */ defineComponent({
|
|
202
908
|
name: "ExpansionPanelRoot",
|
|
203
909
|
__name: "ExpansionPanelRoot",
|
|
204
910
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -255,12 +961,12 @@ const _sfc_main$23 = /* @__PURE__ */ defineComponent({
|
|
|
255
961
|
};
|
|
256
962
|
}
|
|
257
963
|
});
|
|
258
|
-
var ExpansionPanelRoot_default = _sfc_main$
|
|
964
|
+
var ExpansionPanelRoot_default = _sfc_main$27;
|
|
259
965
|
|
|
260
966
|
//#endregion
|
|
261
967
|
//#region src/components/ExpansionPanel/ExpansionPanelItem.vue
|
|
262
968
|
const [useExpansionPanelItem, provideExpansionPanelItem] = createContext({ suffix: "item" });
|
|
263
|
-
const _sfc_main$
|
|
969
|
+
const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
264
970
|
name: "ExpansionPanelItem",
|
|
265
971
|
__name: "ExpansionPanelItem",
|
|
266
972
|
props: {
|
|
@@ -304,11 +1010,11 @@ const _sfc_main$22 = /* @__PURE__ */ defineComponent({
|
|
|
304
1010
|
};
|
|
305
1011
|
}
|
|
306
1012
|
});
|
|
307
|
-
var ExpansionPanelItem_default = _sfc_main$
|
|
1013
|
+
var ExpansionPanelItem_default = _sfc_main$26;
|
|
308
1014
|
|
|
309
1015
|
//#endregion
|
|
310
1016
|
//#region src/components/ExpansionPanel/ExpansionPanelActivator.vue
|
|
311
|
-
const _sfc_main$
|
|
1017
|
+
const _sfc_main$25 = /* @__PURE__ */ defineComponent({
|
|
312
1018
|
name: "ExpansionPanelActivator",
|
|
313
1019
|
__name: "ExpansionPanelActivator",
|
|
314
1020
|
props: {
|
|
@@ -354,11 +1060,11 @@ const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
|
354
1060
|
};
|
|
355
1061
|
}
|
|
356
1062
|
});
|
|
357
|
-
var ExpansionPanelActivator_default = _sfc_main$
|
|
1063
|
+
var ExpansionPanelActivator_default = _sfc_main$25;
|
|
358
1064
|
|
|
359
1065
|
//#endregion
|
|
360
1066
|
//#region src/components/ExpansionPanel/ExpansionPanelContent.vue
|
|
361
|
-
const _sfc_main$
|
|
1067
|
+
const _sfc_main$24 = /* @__PURE__ */ defineComponent({
|
|
362
1068
|
name: "ExpansionPanelContent",
|
|
363
1069
|
__name: "ExpansionPanelContent",
|
|
364
1070
|
props: {
|
|
@@ -389,11 +1095,11 @@ const _sfc_main$20 = /* @__PURE__ */ defineComponent({
|
|
|
389
1095
|
};
|
|
390
1096
|
}
|
|
391
1097
|
});
|
|
392
|
-
var ExpansionPanelContent_default = _sfc_main$
|
|
1098
|
+
var ExpansionPanelContent_default = _sfc_main$24;
|
|
393
1099
|
|
|
394
1100
|
//#endregion
|
|
395
1101
|
//#region src/components/ExpansionPanel/ExpansionPanelHeader.vue
|
|
396
|
-
const _sfc_main$
|
|
1102
|
+
const _sfc_main$23 = /* @__PURE__ */ defineComponent({
|
|
397
1103
|
name: "ExpansionPanelHeader",
|
|
398
1104
|
__name: "ExpansionPanelHeader",
|
|
399
1105
|
props: {
|
|
@@ -418,7 +1124,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
418
1124
|
};
|
|
419
1125
|
}
|
|
420
1126
|
});
|
|
421
|
-
var ExpansionPanelHeader_default = _sfc_main$
|
|
1127
|
+
var ExpansionPanelHeader_default = _sfc_main$23;
|
|
422
1128
|
|
|
423
1129
|
//#endregion
|
|
424
1130
|
//#region src/components/ExpansionPanel/index.ts
|
|
@@ -438,7 +1144,7 @@ const ExpansionPanel = {
|
|
|
438
1144
|
//#endregion
|
|
439
1145
|
//#region src/components/Group/GroupRoot.vue
|
|
440
1146
|
const [useGroupRoot, provideGroupRoot] = createContext();
|
|
441
|
-
const _sfc_main$
|
|
1147
|
+
const _sfc_main$22 = /* @__PURE__ */ defineComponent({
|
|
442
1148
|
name: "GroupRoot",
|
|
443
1149
|
__name: "GroupRoot",
|
|
444
1150
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -488,11 +1194,11 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
488
1194
|
};
|
|
489
1195
|
}
|
|
490
1196
|
});
|
|
491
|
-
var GroupRoot_default = _sfc_main$
|
|
1197
|
+
var GroupRoot_default = _sfc_main$22;
|
|
492
1198
|
|
|
493
1199
|
//#endregion
|
|
494
1200
|
//#region src/components/Group/GroupItem.vue
|
|
495
|
-
const _sfc_main$
|
|
1201
|
+
const _sfc_main$21 = /* @__PURE__ */ defineComponent({
|
|
496
1202
|
name: "GroupItem",
|
|
497
1203
|
__name: "GroupItem",
|
|
498
1204
|
props: {
|
|
@@ -541,7 +1247,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
541
1247
|
};
|
|
542
1248
|
}
|
|
543
1249
|
});
|
|
544
|
-
var GroupItem_default = _sfc_main$
|
|
1250
|
+
var GroupItem_default = _sfc_main$21;
|
|
545
1251
|
|
|
546
1252
|
//#endregion
|
|
547
1253
|
//#region src/components/Group/index.ts
|
|
@@ -560,7 +1266,7 @@ const Group = {
|
|
|
560
1266
|
const [usePaginationRoot, providePaginationRoot] = createContext();
|
|
561
1267
|
const [usePaginationControls, providePaginationControls] = createContext({ suffix: "controls" });
|
|
562
1268
|
const [usePaginationItems, providePaginationItems] = createContext({ suffix: "items" });
|
|
563
|
-
const _sfc_main$
|
|
1269
|
+
const _sfc_main$20 = /* @__PURE__ */ defineComponent({
|
|
564
1270
|
name: "PaginationRoot",
|
|
565
1271
|
__name: "PaginationRoot",
|
|
566
1272
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -582,8 +1288,8 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
582
1288
|
setup(__props) {
|
|
583
1289
|
const page = useModel(__props, "modelValue");
|
|
584
1290
|
const locale = useLocale();
|
|
585
|
-
const controls =
|
|
586
|
-
const items =
|
|
1291
|
+
const controls = createRegistry();
|
|
1292
|
+
const items = createRegistry();
|
|
587
1293
|
const atom = useTemplateRef("atom");
|
|
588
1294
|
const itemWidth = shallowRef(0);
|
|
589
1295
|
const itemGap = shallowRef(0);
|
|
@@ -592,27 +1298,32 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
592
1298
|
itemWidth,
|
|
593
1299
|
gap: itemGap
|
|
594
1300
|
});
|
|
1301
|
+
/* v8 ignore start -- browser-only measurement code */
|
|
595
1302
|
watch([() => items.size, () => overflow.width.value], () => {
|
|
596
1303
|
if (!IN_BROWSER) return;
|
|
597
1304
|
const el = items.seek("first")?.value;
|
|
598
1305
|
const root = overflow.container.value;
|
|
599
1306
|
if (!el || !root) return;
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
1307
|
+
requestAnimationFrame(() => {
|
|
1308
|
+
const rootStyle = getComputedStyle(root);
|
|
1309
|
+
const style = getComputedStyle(el);
|
|
1310
|
+
const marginX = Number.parseFloat(style.marginLeft) + Number.parseFloat(style.marginRight);
|
|
1311
|
+
const gapX = Number.parseFloat(rootStyle.gap) || 0;
|
|
1312
|
+
itemWidth.value = el.offsetWidth + marginX;
|
|
1313
|
+
itemGap.value = gapX;
|
|
1314
|
+
});
|
|
606
1315
|
}, { flush: "post" });
|
|
607
1316
|
const pagination = createPagination({
|
|
608
1317
|
page,
|
|
609
1318
|
visible: computed(() => {
|
|
610
1319
|
const totalCap = overflow.capacity.value;
|
|
611
1320
|
if (totalCap === Infinity) return __props.totalVisible ?? 7;
|
|
1321
|
+
/* v8 ignore start -- branches require browser measurement */
|
|
612
1322
|
const pageCap = Math.max(0, totalCap - controls.size);
|
|
613
1323
|
const noVisible = /* @__PURE__ */ isNullOrUndefined(__props.totalVisible);
|
|
614
1324
|
if (pageCap > 0) return noVisible ? pageCap : Math.min(__props.totalVisible, pageCap);
|
|
615
1325
|
return noVisible ? 1 : __props.totalVisible;
|
|
1326
|
+
/* v8 ignore stop */
|
|
616
1327
|
}),
|
|
617
1328
|
ellipsis: __props.ellipsis,
|
|
618
1329
|
size: () => __props.size,
|
|
@@ -655,11 +1366,11 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
655
1366
|
};
|
|
656
1367
|
}
|
|
657
1368
|
});
|
|
658
|
-
var PaginationRoot_default = _sfc_main$
|
|
1369
|
+
var PaginationRoot_default = _sfc_main$20;
|
|
659
1370
|
|
|
660
1371
|
//#endregion
|
|
661
1372
|
//#region src/components/Pagination/PaginationEllipsis.vue
|
|
662
|
-
const _sfc_main$
|
|
1373
|
+
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
663
1374
|
name: "PaginationEllipsis",
|
|
664
1375
|
__name: "PaginationEllipsis",
|
|
665
1376
|
props: {
|
|
@@ -694,17 +1405,17 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
694
1405
|
as: __props.as,
|
|
695
1406
|
renderless: __props.renderless
|
|
696
1407
|
}), {
|
|
697
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)), () => [createTextVNode(toDisplayString(resolvedEllipsis.value), 1)])]),
|
|
1408
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)), () => [createTextVNode(toDisplayString(resolvedEllipsis.value), 1), createCommentVNode(" v8 ignore -- template fallback ")])]),
|
|
698
1409
|
_: 3
|
|
699
1410
|
}, 16, ["as", "renderless"]);
|
|
700
1411
|
};
|
|
701
1412
|
}
|
|
702
1413
|
});
|
|
703
|
-
var PaginationEllipsis_default = _sfc_main$
|
|
1414
|
+
var PaginationEllipsis_default = _sfc_main$19;
|
|
704
1415
|
|
|
705
1416
|
//#endregion
|
|
706
1417
|
//#region src/components/Pagination/PaginationFirst.vue
|
|
707
|
-
const _sfc_main$
|
|
1418
|
+
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
708
1419
|
name: "PaginationFirst",
|
|
709
1420
|
__name: "PaginationFirst",
|
|
710
1421
|
props: {
|
|
@@ -759,11 +1470,11 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
759
1470
|
};
|
|
760
1471
|
}
|
|
761
1472
|
});
|
|
762
|
-
var PaginationFirst_default = _sfc_main$
|
|
1473
|
+
var PaginationFirst_default = _sfc_main$18;
|
|
763
1474
|
|
|
764
1475
|
//#endregion
|
|
765
1476
|
//#region src/components/Pagination/PaginationItem.vue
|
|
766
|
-
const _sfc_main$
|
|
1477
|
+
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
767
1478
|
name: "PaginationItem",
|
|
768
1479
|
__name: "PaginationItem",
|
|
769
1480
|
props: {
|
|
@@ -829,11 +1540,11 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
829
1540
|
};
|
|
830
1541
|
}
|
|
831
1542
|
});
|
|
832
|
-
var PaginationItem_default = _sfc_main$
|
|
1543
|
+
var PaginationItem_default = _sfc_main$17;
|
|
833
1544
|
|
|
834
1545
|
//#endregion
|
|
835
1546
|
//#region src/components/Pagination/PaginationLast.vue
|
|
836
|
-
const _sfc_main$
|
|
1547
|
+
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
837
1548
|
name: "PaginationLast",
|
|
838
1549
|
__name: "PaginationLast",
|
|
839
1550
|
props: {
|
|
@@ -888,11 +1599,11 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
888
1599
|
};
|
|
889
1600
|
}
|
|
890
1601
|
});
|
|
891
|
-
var PaginationLast_default = _sfc_main$
|
|
1602
|
+
var PaginationLast_default = _sfc_main$16;
|
|
892
1603
|
|
|
893
1604
|
//#endregion
|
|
894
1605
|
//#region src/components/Pagination/PaginationNext.vue
|
|
895
|
-
const _sfc_main$
|
|
1606
|
+
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
896
1607
|
name: "PaginationNext",
|
|
897
1608
|
__name: "PaginationNext",
|
|
898
1609
|
props: {
|
|
@@ -947,11 +1658,11 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
947
1658
|
};
|
|
948
1659
|
}
|
|
949
1660
|
});
|
|
950
|
-
var PaginationNext_default = _sfc_main$
|
|
1661
|
+
var PaginationNext_default = _sfc_main$15;
|
|
951
1662
|
|
|
952
1663
|
//#endregion
|
|
953
1664
|
//#region src/components/Pagination/PaginationPrev.vue
|
|
954
|
-
const _sfc_main$
|
|
1665
|
+
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
955
1666
|
name: "PaginationPrev",
|
|
956
1667
|
__name: "PaginationPrev",
|
|
957
1668
|
props: {
|
|
@@ -1006,11 +1717,11 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
1006
1717
|
};
|
|
1007
1718
|
}
|
|
1008
1719
|
});
|
|
1009
|
-
var PaginationPrev_default = _sfc_main$
|
|
1720
|
+
var PaginationPrev_default = _sfc_main$14;
|
|
1010
1721
|
|
|
1011
1722
|
//#endregion
|
|
1012
1723
|
//#region src/components/Pagination/PaginationStatus.vue
|
|
1013
|
-
const _sfc_main$
|
|
1724
|
+
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
1014
1725
|
name: "PaginationStatus",
|
|
1015
1726
|
__name: "PaginationStatus",
|
|
1016
1727
|
props: {
|
|
@@ -1022,6 +1733,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1022
1733
|
const locale = useLocale();
|
|
1023
1734
|
const pagination = usePaginationRoot(__props.namespace);
|
|
1024
1735
|
const text = shallowRef("");
|
|
1736
|
+
/* v8 ignore start -- watch fires after mount, setTimeout callback requires timer */
|
|
1025
1737
|
watch(() => pagination.page.value, (page, prevPage) => {
|
|
1026
1738
|
if (prevPage === void 0) return;
|
|
1027
1739
|
setTimeout(() => {
|
|
@@ -1031,6 +1743,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1031
1743
|
}, `Page ${page} of ${pagination.pages}`);
|
|
1032
1744
|
}, 100);
|
|
1033
1745
|
});
|
|
1746
|
+
/* v8 ignore stop */
|
|
1034
1747
|
const slotProps = toRef(() => ({
|
|
1035
1748
|
page: pagination.page.value,
|
|
1036
1749
|
pages: pagination.pages,
|
|
@@ -1052,7 +1765,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1052
1765
|
};
|
|
1053
1766
|
}
|
|
1054
1767
|
});
|
|
1055
|
-
var PaginationStatus_default = _sfc_main$
|
|
1768
|
+
var PaginationStatus_default = _sfc_main$13;
|
|
1056
1769
|
|
|
1057
1770
|
//#endregion
|
|
1058
1771
|
//#region src/components/Pagination/index.ts
|
|
@@ -1075,7 +1788,7 @@ const Pagination = {
|
|
|
1075
1788
|
//#endregion
|
|
1076
1789
|
//#region src/components/Popover/PopoverRoot.vue
|
|
1077
1790
|
const [usePopoverContext, providePopoverContext] = createContext("Popover");
|
|
1078
|
-
const _sfc_main$
|
|
1791
|
+
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
1079
1792
|
name: "PopoverRoot",
|
|
1080
1793
|
__name: "PopoverRoot",
|
|
1081
1794
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -1118,13 +1831,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1118
1831
|
};
|
|
1119
1832
|
}
|
|
1120
1833
|
});
|
|
1121
|
-
var PopoverRoot_default = _sfc_main$
|
|
1834
|
+
var PopoverRoot_default = _sfc_main$12;
|
|
1122
1835
|
|
|
1123
1836
|
//#endregion
|
|
1124
|
-
//#region src/components/Popover/
|
|
1125
|
-
const _sfc_main$
|
|
1126
|
-
name: "
|
|
1127
|
-
__name: "
|
|
1837
|
+
//#region src/components/Popover/PopoverActivator.vue
|
|
1838
|
+
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
1839
|
+
name: "PopoverActivator",
|
|
1840
|
+
__name: "PopoverActivator",
|
|
1128
1841
|
props: {
|
|
1129
1842
|
target: {},
|
|
1130
1843
|
as: { default: "button" },
|
|
@@ -1154,11 +1867,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1154
1867
|
};
|
|
1155
1868
|
}
|
|
1156
1869
|
});
|
|
1157
|
-
var
|
|
1870
|
+
var PopoverActivator_default = _sfc_main$11;
|
|
1158
1871
|
|
|
1159
1872
|
//#endregion
|
|
1160
1873
|
//#region src/components/Popover/PopoverContent.vue
|
|
1161
|
-
const _sfc_main$
|
|
1874
|
+
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
1162
1875
|
name: "PopoverContent",
|
|
1163
1876
|
__name: "PopoverContent",
|
|
1164
1877
|
props: {
|
|
@@ -1176,21 +1889,28 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1176
1889
|
const ref$1 = useTemplateRef("ref");
|
|
1177
1890
|
const id = toRef(() => props.id ?? context.id);
|
|
1178
1891
|
const style = toRef(() => ({
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1892
|
+
"position": "fixed",
|
|
1893
|
+
"margin": "unset",
|
|
1894
|
+
"inset-area": __props.positionArea,
|
|
1895
|
+
"position-area": __props.positionArea,
|
|
1896
|
+
"position-anchor": `--${toValue(id)}`,
|
|
1897
|
+
"position-try-fallbacks": __props.positionTry
|
|
1182
1898
|
}));
|
|
1899
|
+
/* v8 ignore start -- browser popover API */
|
|
1183
1900
|
onMounted(() => {
|
|
1184
1901
|
if (context.isSelected.value) ref$1.value?.element?.showPopover();
|
|
1185
1902
|
});
|
|
1186
1903
|
watch(context.isSelected, (isOpen) => {
|
|
1187
1904
|
const element = ref$1.value?.element;
|
|
1188
|
-
if (!element) return;
|
|
1905
|
+
if (!element || isOpen === element.matches?.(":popover-open")) return;
|
|
1189
1906
|
if (isOpen) element.showPopover?.();
|
|
1190
1907
|
else element.hidePopover?.();
|
|
1191
1908
|
});
|
|
1192
|
-
function
|
|
1909
|
+
function onToggle(e) {
|
|
1193
1910
|
context.isSelected.value = e.newState === "open";
|
|
1911
|
+
}
|
|
1912
|
+
/* v8 ignore stop */
|
|
1913
|
+
function onBeforeToggle(e) {
|
|
1194
1914
|
emit("beforetoggle", e);
|
|
1195
1915
|
}
|
|
1196
1916
|
const slotProps = toRef(() => ({
|
|
@@ -1205,14 +1925,17 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1205
1925
|
ref_key: "ref",
|
|
1206
1926
|
ref: ref$1,
|
|
1207
1927
|
style: style.value
|
|
1208
|
-
}, slotProps.value.attrs, {
|
|
1928
|
+
}, slotProps.value.attrs, {
|
|
1929
|
+
onBeforetoggle: onBeforeToggle,
|
|
1930
|
+
onToggle
|
|
1931
|
+
}), {
|
|
1209
1932
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
1210
1933
|
_: 3
|
|
1211
1934
|
}, 16, ["style"]);
|
|
1212
1935
|
};
|
|
1213
1936
|
}
|
|
1214
1937
|
});
|
|
1215
|
-
var PopoverContent_default = _sfc_main$
|
|
1938
|
+
var PopoverContent_default = _sfc_main$10;
|
|
1216
1939
|
|
|
1217
1940
|
//#endregion
|
|
1218
1941
|
//#region src/components/Popover/index.ts
|
|
@@ -1223,10 +1946,336 @@ var PopoverContent_default = _sfc_main$6;
|
|
|
1223
1946
|
*/
|
|
1224
1947
|
const Popover = {
|
|
1225
1948
|
Root: PopoverRoot_default,
|
|
1226
|
-
|
|
1949
|
+
Activator: PopoverActivator_default,
|
|
1227
1950
|
Content: PopoverContent_default
|
|
1228
1951
|
};
|
|
1229
1952
|
|
|
1953
|
+
//#endregion
|
|
1954
|
+
//#region src/components/Radio/RadioGroup.vue
|
|
1955
|
+
const [useRadioGroup, provideRadioGroup] = createContext();
|
|
1956
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1957
|
+
name: "RadioGroup",
|
|
1958
|
+
__name: "RadioGroup",
|
|
1959
|
+
props: /* @__PURE__ */ mergeModels({
|
|
1960
|
+
namespace: { default: "v0:radio:group" },
|
|
1961
|
+
disabled: {
|
|
1962
|
+
type: Boolean,
|
|
1963
|
+
default: false
|
|
1964
|
+
},
|
|
1965
|
+
mandatory: {
|
|
1966
|
+
type: [Boolean, String],
|
|
1967
|
+
default: false
|
|
1968
|
+
},
|
|
1969
|
+
label: {},
|
|
1970
|
+
ariaLabelledby: {},
|
|
1971
|
+
ariaDescribedby: {},
|
|
1972
|
+
ariaRequired: { type: Boolean },
|
|
1973
|
+
name: {},
|
|
1974
|
+
as: { default: "div" },
|
|
1975
|
+
renderless: { type: Boolean }
|
|
1976
|
+
}, {
|
|
1977
|
+
"modelValue": {},
|
|
1978
|
+
"modelModifiers": {}
|
|
1979
|
+
}),
|
|
1980
|
+
emits: /* @__PURE__ */ mergeModels(["update:model-value"], ["update:modelValue"]),
|
|
1981
|
+
setup(__props) {
|
|
1982
|
+
const model = useModel(__props, "modelValue");
|
|
1983
|
+
const single = createSingle({
|
|
1984
|
+
disabled: toRef(() => __props.disabled),
|
|
1985
|
+
mandatory: __props.mandatory,
|
|
1986
|
+
events: true
|
|
1987
|
+
});
|
|
1988
|
+
useProxyModel(single, model, { multiple: false });
|
|
1989
|
+
provideRadioGroup(__props.namespace, {
|
|
1990
|
+
...single,
|
|
1991
|
+
name: __props.name
|
|
1992
|
+
});
|
|
1993
|
+
const slotProps = toRef(() => ({
|
|
1994
|
+
isDisabled: toValue(single.disabled),
|
|
1995
|
+
isNoneSelected: single.selectedIds.size === 0,
|
|
1996
|
+
attrs: {
|
|
1997
|
+
"role": "radiogroup",
|
|
1998
|
+
"aria-label": __props.label || void 0,
|
|
1999
|
+
"aria-labelledby": __props.ariaLabelledby || void 0,
|
|
2000
|
+
"aria-describedby": __props.ariaDescribedby || void 0,
|
|
2001
|
+
"aria-required": __props.ariaRequired || void 0
|
|
2002
|
+
}
|
|
2003
|
+
}));
|
|
2004
|
+
return (_ctx, _cache) => {
|
|
2005
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
2006
|
+
as: __props.as,
|
|
2007
|
+
renderless: __props.renderless
|
|
2008
|
+
}), {
|
|
2009
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
2010
|
+
_: 3
|
|
2011
|
+
}, 16, ["as", "renderless"]);
|
|
2012
|
+
};
|
|
2013
|
+
}
|
|
2014
|
+
});
|
|
2015
|
+
var RadioGroup_default = _sfc_main$9;
|
|
2016
|
+
|
|
2017
|
+
//#endregion
|
|
2018
|
+
//#region src/components/Radio/RadioRoot.vue
|
|
2019
|
+
const [useRadioRoot, provideRadioRoot] = createContext();
|
|
2020
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2021
|
+
name: "RadioRoot",
|
|
2022
|
+
inheritAttrs: false,
|
|
2023
|
+
__name: "RadioRoot",
|
|
2024
|
+
props: {
|
|
2025
|
+
id: { default: () => /* @__PURE__ */ genId() },
|
|
2026
|
+
label: {},
|
|
2027
|
+
value: {},
|
|
2028
|
+
name: {},
|
|
2029
|
+
form: {},
|
|
2030
|
+
disabled: { default: false },
|
|
2031
|
+
namespace: { default: "v0:radio:root" },
|
|
2032
|
+
groupNamespace: { default: "v0:radio:group" },
|
|
2033
|
+
ariaLabelledby: {},
|
|
2034
|
+
ariaDescribedby: {},
|
|
2035
|
+
ariaInvalid: { type: Boolean },
|
|
2036
|
+
as: { default: "button" },
|
|
2037
|
+
renderless: { type: Boolean }
|
|
2038
|
+
},
|
|
2039
|
+
setup(__props) {
|
|
2040
|
+
const attrs = useAttrs();
|
|
2041
|
+
const rootRef = useTemplateRef("root");
|
|
2042
|
+
const group = useRadioGroup(__props.groupNamespace);
|
|
2043
|
+
const name = __props.name ?? group.name;
|
|
2044
|
+
const el = toRef(() => rootRef.value?.element ?? void 0);
|
|
2045
|
+
const ticket = group.register({
|
|
2046
|
+
id: __props.id,
|
|
2047
|
+
value: __props.value,
|
|
2048
|
+
disabled: __props.disabled,
|
|
2049
|
+
el
|
|
2050
|
+
});
|
|
2051
|
+
const isChecked = toRef(() => toValue(ticket.isSelected));
|
|
2052
|
+
const isDisabled = toRef(() => toValue(ticket.disabled) || toValue(group.disabled));
|
|
2053
|
+
const dataState = toRef(() => isChecked.value ? "checked" : "unchecked");
|
|
2054
|
+
const isTabbable = toRef(() => {
|
|
2055
|
+
if (toValue(group.disabled)) return false;
|
|
2056
|
+
if (toValue(ticket.disabled)) return false;
|
|
2057
|
+
if (toValue(ticket.isSelected)) return true;
|
|
2058
|
+
if (group.selectedIds.size > 0) return false;
|
|
2059
|
+
for (const item of group.values()) if (!toValue(item.disabled)) return item.id === __props.id;
|
|
2060
|
+
return false;
|
|
2061
|
+
});
|
|
2062
|
+
function select() {
|
|
2063
|
+
if (isDisabled.value) return;
|
|
2064
|
+
ticket.select();
|
|
2065
|
+
}
|
|
2066
|
+
function onClick() {
|
|
2067
|
+
select();
|
|
2068
|
+
}
|
|
2069
|
+
function onKeydown(e) {
|
|
2070
|
+
if (e.key === " ") {
|
|
2071
|
+
e.preventDefault();
|
|
2072
|
+
select();
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
if (![
|
|
2076
|
+
"ArrowUp",
|
|
2077
|
+
"ArrowDown",
|
|
2078
|
+
"ArrowLeft",
|
|
2079
|
+
"ArrowRight"
|
|
2080
|
+
].includes(e.key)) return;
|
|
2081
|
+
e.preventDefault();
|
|
2082
|
+
const items = [...group.values()].filter((item) => !toValue(item.disabled));
|
|
2083
|
+
const currentIndex = items.findIndex((item) => item.id === __props.id);
|
|
2084
|
+
if (currentIndex === -1) return;
|
|
2085
|
+
let nextIndex;
|
|
2086
|
+
if (e.key === "ArrowUp" || e.key === "ArrowLeft") nextIndex = currentIndex === 0 ? items.length - 1 : currentIndex - 1;
|
|
2087
|
+
else nextIndex = currentIndex === items.length - 1 ? 0 : currentIndex + 1;
|
|
2088
|
+
const nextItem = items[nextIndex];
|
|
2089
|
+
if (!nextItem) return;
|
|
2090
|
+
nextItem.select();
|
|
2091
|
+
toValue(nextItem.el)?.focus();
|
|
2092
|
+
}
|
|
2093
|
+
onUnmounted(() => {
|
|
2094
|
+
group.unregister(ticket.id);
|
|
2095
|
+
});
|
|
2096
|
+
const context = {
|
|
2097
|
+
id: __props.id,
|
|
2098
|
+
label: __props.label,
|
|
2099
|
+
value: __props.value,
|
|
2100
|
+
name,
|
|
2101
|
+
form: __props.form,
|
|
2102
|
+
isChecked,
|
|
2103
|
+
isDisabled,
|
|
2104
|
+
select
|
|
2105
|
+
};
|
|
2106
|
+
provideRadioRoot(__props.namespace, context);
|
|
2107
|
+
const slotProps = toRef(() => ({
|
|
2108
|
+
id: __props.id,
|
|
2109
|
+
label: __props.label,
|
|
2110
|
+
value: __props.value,
|
|
2111
|
+
isChecked: isChecked.value,
|
|
2112
|
+
isDisabled: isDisabled.value,
|
|
2113
|
+
select,
|
|
2114
|
+
attrs: {
|
|
2115
|
+
"type": __props.as === "button" ? "button" : void 0,
|
|
2116
|
+
"role": "radio",
|
|
2117
|
+
"aria-checked": isChecked.value,
|
|
2118
|
+
"aria-disabled": isDisabled.value || void 0,
|
|
2119
|
+
"aria-label": __props.label || void 0,
|
|
2120
|
+
"aria-labelledby": __props.ariaLabelledby || void 0,
|
|
2121
|
+
"aria-describedby": __props.ariaDescribedby || void 0,
|
|
2122
|
+
"aria-invalid": __props.ariaInvalid || void 0,
|
|
2123
|
+
"tabindex": isTabbable.value ? 0 : -1,
|
|
2124
|
+
"data-state": dataState.value,
|
|
2125
|
+
"data-disabled": isDisabled.value ? true : void 0,
|
|
2126
|
+
"data-radio-id": __props.id
|
|
2127
|
+
}
|
|
2128
|
+
}));
|
|
2129
|
+
return (_ctx, _cache) => {
|
|
2130
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(Atom_default), mergeProps({ ref: "root" }, {
|
|
2131
|
+
...unref(attrs),
|
|
2132
|
+
...slotProps.value.attrs
|
|
2133
|
+
}, {
|
|
2134
|
+
as: __props.as,
|
|
2135
|
+
renderless: __props.renderless,
|
|
2136
|
+
onClick,
|
|
2137
|
+
onKeydown
|
|
2138
|
+
}), {
|
|
2139
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
2140
|
+
_: 3
|
|
2141
|
+
}, 16, ["as", "renderless"]), unref(name) ? (openBlock(), createBlock(RadioHiddenInput_default, { key: 0 })) : createCommentVNode("v-if", true)], 64);
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
});
|
|
2145
|
+
var RadioRoot_default = _sfc_main$8;
|
|
2146
|
+
|
|
2147
|
+
//#endregion
|
|
2148
|
+
//#region src/components/Radio/RadioHiddenInput.vue
|
|
2149
|
+
const _hoisted_1 = [
|
|
2150
|
+
"checked",
|
|
2151
|
+
"disabled",
|
|
2152
|
+
"form",
|
|
2153
|
+
"name",
|
|
2154
|
+
"value"
|
|
2155
|
+
];
|
|
2156
|
+
const visuallyHiddenStyle = {
|
|
2157
|
+
position: "absolute",
|
|
2158
|
+
width: "1px",
|
|
2159
|
+
height: "1px",
|
|
2160
|
+
padding: "0",
|
|
2161
|
+
margin: "-1px",
|
|
2162
|
+
overflow: "hidden",
|
|
2163
|
+
clip: "rect(0, 0, 0, 0)",
|
|
2164
|
+
whiteSpace: "nowrap",
|
|
2165
|
+
border: "0"
|
|
2166
|
+
};
|
|
2167
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2168
|
+
name: "RadioHiddenInput",
|
|
2169
|
+
__name: "RadioHiddenInput",
|
|
2170
|
+
props: {
|
|
2171
|
+
namespace: { default: "v0:radio:root" },
|
|
2172
|
+
name: {},
|
|
2173
|
+
value: {},
|
|
2174
|
+
form: {}
|
|
2175
|
+
},
|
|
2176
|
+
setup(__props) {
|
|
2177
|
+
const root = useRadioRoot(__props.namespace);
|
|
2178
|
+
const name = toRef(() => __props.name ?? root.name);
|
|
2179
|
+
const form = toRef(() => __props.form ?? root.form);
|
|
2180
|
+
const value = toRef(() => {
|
|
2181
|
+
const v = __props.value ?? root.value ?? "on";
|
|
2182
|
+
if (/* @__PURE__ */ isObject(v)) return JSON.stringify(v);
|
|
2183
|
+
return String(v);
|
|
2184
|
+
});
|
|
2185
|
+
const isChecked = root.isChecked;
|
|
2186
|
+
const isDisabled = root.isDisabled;
|
|
2187
|
+
return (_ctx, _cache) => {
|
|
2188
|
+
return openBlock(), createElementBlock("input", {
|
|
2189
|
+
checked: unref(isChecked),
|
|
2190
|
+
disabled: unref(isDisabled),
|
|
2191
|
+
form: form.value,
|
|
2192
|
+
inert: "",
|
|
2193
|
+
name: name.value,
|
|
2194
|
+
style: visuallyHiddenStyle,
|
|
2195
|
+
tabindex: "-1",
|
|
2196
|
+
type: "radio",
|
|
2197
|
+
value: value.value
|
|
2198
|
+
}, null, 8, _hoisted_1);
|
|
2199
|
+
};
|
|
2200
|
+
}
|
|
2201
|
+
});
|
|
2202
|
+
var RadioHiddenInput_default = _sfc_main$7;
|
|
2203
|
+
|
|
2204
|
+
//#endregion
|
|
2205
|
+
//#region src/components/Radio/RadioIndicator.vue
|
|
2206
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2207
|
+
name: "RadioIndicator",
|
|
2208
|
+
__name: "RadioIndicator",
|
|
2209
|
+
props: {
|
|
2210
|
+
namespace: { default: "v0:radio:root" },
|
|
2211
|
+
as: { default: "span" },
|
|
2212
|
+
renderless: { type: Boolean }
|
|
2213
|
+
},
|
|
2214
|
+
setup(__props) {
|
|
2215
|
+
const root = useRadioRoot(__props.namespace);
|
|
2216
|
+
const isChecked = toRef(() => toValue(root.isChecked));
|
|
2217
|
+
const dataState = toRef(() => isChecked.value ? "checked" : "unchecked");
|
|
2218
|
+
const slotProps = toRef(() => ({
|
|
2219
|
+
isChecked: isChecked.value,
|
|
2220
|
+
attrs: {
|
|
2221
|
+
"data-state": dataState.value,
|
|
2222
|
+
"style": { visibility: isChecked.value ? "visible" : "hidden" }
|
|
2223
|
+
}
|
|
2224
|
+
}));
|
|
2225
|
+
return (_ctx, _cache) => {
|
|
2226
|
+
return openBlock(), createBlock(unref(Atom_default), mergeProps(slotProps.value.attrs, {
|
|
2227
|
+
as: __props.as,
|
|
2228
|
+
renderless: __props.renderless
|
|
2229
|
+
}), {
|
|
2230
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps.value)))]),
|
|
2231
|
+
_: 3
|
|
2232
|
+
}, 16, ["as", "renderless"]);
|
|
2233
|
+
};
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
var RadioIndicator_default = _sfc_main$6;
|
|
2237
|
+
|
|
2238
|
+
//#endregion
|
|
2239
|
+
//#region src/components/Radio/index.ts
|
|
2240
|
+
/**
|
|
2241
|
+
* Radio component with sub-components for radio button controls.
|
|
2242
|
+
*
|
|
2243
|
+
* @see https://0.vuetifyjs.com/components/forms/radio
|
|
2244
|
+
*
|
|
2245
|
+
* @example
|
|
2246
|
+
* ```vue
|
|
2247
|
+
* <script lang="ts" setup>
|
|
2248
|
+
* import { Radio } from '@vuetify/v0'
|
|
2249
|
+
* import { ref } from 'vue'
|
|
2250
|
+
*
|
|
2251
|
+
* const selected = ref<string>()
|
|
2252
|
+
* <\/script>
|
|
2253
|
+
*
|
|
2254
|
+
* <template>
|
|
2255
|
+
* <Radio.Group v-model="selected">
|
|
2256
|
+
* <label>
|
|
2257
|
+
* <Radio.Root value="a">
|
|
2258
|
+
* <Radio.Indicator>●</Radio.Indicator>
|
|
2259
|
+
* </Radio.Root>
|
|
2260
|
+
* Option A
|
|
2261
|
+
* </label>
|
|
2262
|
+
* <label>
|
|
2263
|
+
* <Radio.Root value="b">
|
|
2264
|
+
* <Radio.Indicator>●</Radio.Indicator>
|
|
2265
|
+
* </Radio.Root>
|
|
2266
|
+
* Option B
|
|
2267
|
+
* </label>
|
|
2268
|
+
* </Radio.Group>
|
|
2269
|
+
* </template>
|
|
2270
|
+
* ```
|
|
2271
|
+
*/
|
|
2272
|
+
const Radio = {
|
|
2273
|
+
Group: RadioGroup_default,
|
|
2274
|
+
HiddenInput: RadioHiddenInput_default,
|
|
2275
|
+
Indicator: RadioIndicator_default,
|
|
2276
|
+
Root: RadioRoot_default
|
|
2277
|
+
};
|
|
2278
|
+
|
|
1230
2279
|
//#endregion
|
|
1231
2280
|
//#region src/components/Selection/SelectionRoot.vue
|
|
1232
2281
|
const [useSelectionRoot, provideSelectionRoot] = createContext();
|
|
@@ -1560,4 +2609,4 @@ const Step = {
|
|
|
1560
2609
|
};
|
|
1561
2610
|
|
|
1562
2611
|
//#endregion
|
|
1563
|
-
export {
|
|
2612
|
+
export { ExpansionPanelContent_default as $, usePopoverContext as A, provideAvatarContext as At, providePaginationControls as B, provideRadioGroup as C, CheckboxGroup_default as Ct, PopoverActivator_default as D, AvatarImage_default as Dt, PopoverContent_default as E, Avatar as Et, PaginationLast_default as F, usePaginationRoot as G, providePaginationRoot as H, PaginationItem_default as I, GroupRoot_default as J, Group as K, PaginationFirst_default as L, PaginationStatus_default as M, Atom_default as Mt, PaginationPrev_default as N, PopoverRoot_default as O, AvatarFallback_default as Ot, PaginationNext_default as P, ExpansionPanelHeader_default as Q, PaginationEllipsis_default as R, RadioGroup_default as S, useCheckboxRoot as St, Popover as T, useCheckboxGroup as Tt, usePaginationControls as U, providePaginationItems as V, usePaginationItems as W, useGroupRoot as X, provideGroupRoot as Y, ExpansionPanel as Z, RadioIndicator_default as _, CheckboxSelectAll_default as _t, useStepRoot as a, provideExpansionPanelSelection as at, provideRadioRoot as b, CheckboxRoot_default as bt, SingleRoot_default as c, DialogActivator_default as ct, Selection as d, DialogContent_default as dt, ExpansionPanelActivator_default as et, SelectionItem_default as f, DialogClose_default as ft, Radio as g, Checkbox as gt, useSelectionRoot as h, useDialogContext as ht, provideStepRoot as i, ExpansionPanelRoot_default as it, Pagination as j, useAvatarRoot as jt, providePopoverContext as k, AvatarRoot_default as kt, provideSingleRoot as l, DialogTitle_default as lt, provideSelectionRoot as m, provideDialogContext as mt, StepItem_default as n, provideExpansionPanelItem as nt, Single as o, useExpansionPanelRoot as ot, SelectionRoot_default as p, DialogRoot_default as pt, GroupItem_default as q, StepRoot_default as r, useExpansionPanelItem as rt, SingleItem_default as s, Dialog as st, Step as t, ExpansionPanelItem_default as tt, useSingleRoot as u, DialogDescription_default as ut, RadioHiddenInput_default as v, CheckboxIndicator_default as vt, useRadioGroup as w, provideCheckboxGroup as wt, useRadioRoot as x, provideCheckboxRoot as xt, RadioRoot_default as y, CheckboxHiddenInput_default as yt, PaginationRoot_default as z };
|