@soave/ui 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert.vue.d.ts +23 -0
- package/dist/components/Alert.vue.d.ts.map +1 -0
- package/dist/components/AlertDescription.vue.d.ts +18 -0
- package/dist/components/AlertDescription.vue.d.ts.map +1 -0
- package/dist/components/AlertTitle.vue.d.ts +18 -0
- package/dist/components/AlertTitle.vue.d.ts.map +1 -0
- package/dist/components/CardContent.vue.d.ts +18 -0
- package/dist/components/CardContent.vue.d.ts.map +1 -0
- package/dist/components/CardDescription.vue.d.ts +18 -0
- package/dist/components/CardDescription.vue.d.ts.map +1 -0
- package/dist/components/CardFooter.vue.d.ts +18 -0
- package/dist/components/CardFooter.vue.d.ts.map +1 -0
- package/dist/components/CardHeader.vue.d.ts +18 -0
- package/dist/components/CardHeader.vue.d.ts.map +1 -0
- package/dist/components/CardTitle.vue.d.ts +18 -0
- package/dist/components/CardTitle.vue.d.ts.map +1 -0
- package/dist/components/DialogContent.vue.d.ts +24 -0
- package/dist/components/DialogContent.vue.d.ts.map +1 -0
- package/dist/components/DialogDescription.vue.d.ts +21 -0
- package/dist/components/DialogDescription.vue.d.ts.map +1 -0
- package/dist/components/DialogFooter.vue.d.ts +18 -0
- package/dist/components/DialogFooter.vue.d.ts.map +1 -0
- package/dist/components/DialogHeader.vue.d.ts +18 -0
- package/dist/components/DialogHeader.vue.d.ts.map +1 -0
- package/dist/components/DialogOverlay.vue.d.ts +7 -0
- package/dist/components/DialogOverlay.vue.d.ts.map +1 -0
- package/dist/components/DialogTitle.vue.d.ts +21 -0
- package/dist/components/DialogTitle.vue.d.ts.map +1 -0
- package/dist/components/DialogTrigger.vue.d.ts +20 -0
- package/dist/components/DialogTrigger.vue.d.ts.map +1 -0
- package/dist/components/DropdownMenu.vue.d.ts +33 -0
- package/dist/components/DropdownMenu.vue.d.ts.map +1 -0
- package/dist/components/DropdownMenuContent.vue.d.ts +25 -0
- package/dist/components/DropdownMenuContent.vue.d.ts.map +1 -0
- package/dist/components/DropdownMenuItem.vue.d.ts +29 -0
- package/dist/components/DropdownMenuItem.vue.d.ts.map +1 -0
- package/dist/components/DropdownMenuLabel.vue.d.ts +18 -0
- package/dist/components/DropdownMenuLabel.vue.d.ts.map +1 -0
- package/dist/components/DropdownMenuSeparator.vue.d.ts +3 -0
- package/dist/components/DropdownMenuSeparator.vue.d.ts.map +1 -0
- package/dist/components/DropdownMenuTrigger.vue.d.ts +24 -0
- package/dist/components/DropdownMenuTrigger.vue.d.ts.map +1 -0
- package/dist/components/FileInput.vue.d.ts +81 -0
- package/dist/components/FileInput.vue.d.ts.map +1 -0
- package/dist/components/FormError.vue.d.ts +21 -0
- package/dist/components/FormError.vue.d.ts.map +1 -0
- package/dist/components/FormField.vue.d.ts +26 -0
- package/dist/components/FormField.vue.d.ts.map +1 -0
- package/dist/components/FormInput.vue.d.ts +19 -0
- package/dist/components/FormInput.vue.d.ts.map +1 -0
- package/dist/components/FormLabel.vue.d.ts +21 -0
- package/dist/components/FormLabel.vue.d.ts.map +1 -0
- package/dist/components/FormTextarea.vue.d.ts +19 -0
- package/dist/components/FormTextarea.vue.d.ts.map +1 -0
- package/dist/components/Popover.vue.d.ts +38 -0
- package/dist/components/Popover.vue.d.ts.map +1 -0
- package/dist/components/PopoverContent.vue.d.ts +25 -0
- package/dist/components/PopoverContent.vue.d.ts.map +1 -0
- package/dist/components/PopoverTrigger.vue.d.ts +24 -0
- package/dist/components/PopoverTrigger.vue.d.ts.map +1 -0
- package/dist/components/SelectValue.vue.d.ts +24 -0
- package/dist/components/SelectValue.vue.d.ts.map +1 -0
- package/dist/components/Sheet.vue.d.ts +42 -0
- package/dist/components/Sheet.vue.d.ts.map +1 -0
- package/dist/components/SheetClose.vue.d.ts +20 -0
- package/dist/components/SheetClose.vue.d.ts.map +1 -0
- package/dist/components/SheetContent.vue.d.ts +18 -0
- package/dist/components/SheetContent.vue.d.ts.map +1 -0
- package/dist/components/SheetDescription.vue.d.ts +18 -0
- package/dist/components/SheetDescription.vue.d.ts.map +1 -0
- package/dist/components/SheetFooter.vue.d.ts +18 -0
- package/dist/components/SheetFooter.vue.d.ts.map +1 -0
- package/dist/components/SheetHeader.vue.d.ts +18 -0
- package/dist/components/SheetHeader.vue.d.ts.map +1 -0
- package/dist/components/SheetOverlay.vue.d.ts +3 -0
- package/dist/components/SheetOverlay.vue.d.ts.map +1 -0
- package/dist/components/SheetTitle.vue.d.ts +18 -0
- package/dist/components/SheetTitle.vue.d.ts.map +1 -0
- package/dist/components/SheetTrigger.vue.d.ts +20 -0
- package/dist/components/SheetTrigger.vue.d.ts.map +1 -0
- package/dist/components/Toast.vue.d.ts +35 -0
- package/dist/components/Toast.vue.d.ts.map +1 -0
- package/dist/components/ToastClose.vue.d.ts +22 -0
- package/dist/components/ToastClose.vue.d.ts.map +1 -0
- package/dist/components/ToastDescription.vue.d.ts +18 -0
- package/dist/components/ToastDescription.vue.d.ts.map +1 -0
- package/dist/components/ToastTitle.vue.d.ts +18 -0
- package/dist/components/ToastTitle.vue.d.ts.map +1 -0
- package/dist/components/Toaster.vue.d.ts +58 -0
- package/dist/components/Toaster.vue.d.ts.map +1 -0
- package/dist/components/Tooltip.vue.d.ts +34 -0
- package/dist/components/Tooltip.vue.d.ts.map +1 -0
- package/dist/components/TooltipContent.vue.d.ts +23 -0
- package/dist/components/TooltipContent.vue.d.ts.map +1 -0
- package/dist/components/TooltipTrigger.vue.d.ts +22 -0
- package/dist/components/TooltipTrigger.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +48 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.mjs +1398 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as useButton, a as useInput, m as useTextarea, b as useCard, j as useCheckbox, l as useSwitch, c as useDialog, n as useSelectTrigger, o as useSelectContent, p as useSelectItem, k as useRadioItem } from "./useTheme-C2uPqAtQ.js";
|
|
2
2
|
import { C, D, A, F, I, R, S, i, U, z, y, t, w, q, d, v, h, x, r, s, f, g, e } from "./useTheme-C2uPqAtQ.js";
|
|
3
|
-
import { defineComponent, toRef, createElementBlock, openBlock, mergeProps, unref, renderSlot, mergeModels, useModel, computed, withKeys, withModifiers, createElementVNode, ref, watch, provide, onMounted, onUnmounted, createBlock, Teleport, createCommentVNode, inject } from "vue";
|
|
3
|
+
import { defineComponent, toRef, createElementBlock, openBlock, mergeProps, unref, renderSlot, mergeModels, useModel, computed, withKeys, withModifiers, createElementVNode, ref, watch, provide, onMounted, onUnmounted, createBlock, Teleport, createCommentVNode, inject, createTextVNode, toDisplayString } from "vue";
|
|
4
4
|
import { c, t as t2 } from "./tailwind-B-R7fPT1.js";
|
|
5
5
|
import { ADAPTER_REGISTRY, cssVariablesAdapter, getAdapter, getRegisteredAdapters, headlessAdapter, registerAdapter } from "./adapters.mjs";
|
|
6
6
|
const FORM_LOGS = {
|
|
@@ -20,8 +20,8 @@ const CONFIG_LOGS = {
|
|
|
20
20
|
PROVIDER_INITIALIZED: "UIProviderが初期化されました",
|
|
21
21
|
CONFIG_UPDATED: "UI設定が更新されました"
|
|
22
22
|
};
|
|
23
|
-
const _hoisted_1$
|
|
24
|
-
const _sfc_main$
|
|
23
|
+
const _hoisted_1$t = ["disabled", "type"];
|
|
24
|
+
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
25
25
|
__name: "Button",
|
|
26
26
|
props: {
|
|
27
27
|
variant: { default: "primary" },
|
|
@@ -46,12 +46,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
46
46
|
type: unref(composable).state.value.type
|
|
47
47
|
}, unref(composable).aria_attributes.value, { onClick: handleClick }), [
|
|
48
48
|
renderSlot(_ctx.$slots, "default")
|
|
49
|
-
], 16, _hoisted_1$
|
|
49
|
+
], 16, _hoisted_1$t);
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
const _hoisted_1$
|
|
54
|
-
const _sfc_main$
|
|
53
|
+
const _hoisted_1$s = ["type", "value", "disabled", "readonly", "placeholder", "id"];
|
|
54
|
+
const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
55
55
|
__name: "Input",
|
|
56
56
|
props: {
|
|
57
57
|
type: { default: "text" },
|
|
@@ -87,12 +87,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
87
87
|
(...args) => unref(composable).handleFocus && unref(composable).handleFocus(...args)),
|
|
88
88
|
onBlur: _cache[1] || (_cache[1] = //@ts-ignore
|
|
89
89
|
(...args) => unref(composable).handleBlur && unref(composable).handleBlur(...args))
|
|
90
|
-
}), null, 16, _hoisted_1$
|
|
90
|
+
}), null, 16, _hoisted_1$s);
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
const _hoisted_1$
|
|
95
|
-
const _sfc_main$
|
|
94
|
+
const _hoisted_1$r = ["value", "disabled", "readonly", "placeholder", "rows", "id"];
|
|
95
|
+
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
96
96
|
__name: "Textarea",
|
|
97
97
|
props: {
|
|
98
98
|
size: { default: "md" },
|
|
@@ -133,11 +133,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
133
133
|
(...args) => unref(composable).handleFocus && unref(composable).handleFocus(...args)),
|
|
134
134
|
onBlur: _cache[1] || (_cache[1] = //@ts-ignore
|
|
135
135
|
(...args) => unref(composable).handleBlur && unref(composable).handleBlur(...args))
|
|
136
|
-
}), null, 16, _hoisted_1$
|
|
136
|
+
}), null, 16, _hoisted_1$r);
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
|
-
const _sfc_main$
|
|
140
|
+
const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
141
141
|
__name: "Card",
|
|
142
142
|
props: {
|
|
143
143
|
padding: { default: "md" }
|
|
@@ -155,8 +155,119 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
-
const
|
|
159
|
-
|
|
158
|
+
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
159
|
+
...{
|
|
160
|
+
name: "CardHeader"
|
|
161
|
+
},
|
|
162
|
+
__name: "CardHeader",
|
|
163
|
+
setup(__props) {
|
|
164
|
+
return (_ctx, _cache) => {
|
|
165
|
+
return openBlock(), createElementBlock("div", null, [
|
|
166
|
+
renderSlot(_ctx.$slots, "default")
|
|
167
|
+
]);
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
172
|
+
...{
|
|
173
|
+
name: "CardTitle"
|
|
174
|
+
},
|
|
175
|
+
__name: "CardTitle",
|
|
176
|
+
setup(__props) {
|
|
177
|
+
return (_ctx, _cache) => {
|
|
178
|
+
return openBlock(), createElementBlock("h3", null, [
|
|
179
|
+
renderSlot(_ctx.$slots, "default")
|
|
180
|
+
]);
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
185
|
+
...{
|
|
186
|
+
name: "CardDescription"
|
|
187
|
+
},
|
|
188
|
+
__name: "CardDescription",
|
|
189
|
+
setup(__props) {
|
|
190
|
+
return (_ctx, _cache) => {
|
|
191
|
+
return openBlock(), createElementBlock("p", null, [
|
|
192
|
+
renderSlot(_ctx.$slots, "default")
|
|
193
|
+
]);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
198
|
+
...{
|
|
199
|
+
name: "CardContent"
|
|
200
|
+
},
|
|
201
|
+
__name: "CardContent",
|
|
202
|
+
setup(__props) {
|
|
203
|
+
return (_ctx, _cache) => {
|
|
204
|
+
return openBlock(), createElementBlock("div", null, [
|
|
205
|
+
renderSlot(_ctx.$slots, "default")
|
|
206
|
+
]);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
211
|
+
...{
|
|
212
|
+
name: "CardFooter"
|
|
213
|
+
},
|
|
214
|
+
__name: "CardFooter",
|
|
215
|
+
setup(__props) {
|
|
216
|
+
return (_ctx, _cache) => {
|
|
217
|
+
return openBlock(), createElementBlock("div", null, [
|
|
218
|
+
renderSlot(_ctx.$slots, "default")
|
|
219
|
+
]);
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
const _hoisted_1$q = ["data-variant"];
|
|
224
|
+
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
225
|
+
...{
|
|
226
|
+
name: "Alert"
|
|
227
|
+
},
|
|
228
|
+
__name: "Alert",
|
|
229
|
+
props: {
|
|
230
|
+
variant: { default: "default" }
|
|
231
|
+
},
|
|
232
|
+
setup(__props) {
|
|
233
|
+
return (_ctx, _cache) => {
|
|
234
|
+
return openBlock(), createElementBlock("div", {
|
|
235
|
+
role: "alert",
|
|
236
|
+
"data-variant": __props.variant
|
|
237
|
+
}, [
|
|
238
|
+
renderSlot(_ctx.$slots, "default")
|
|
239
|
+
], 8, _hoisted_1$q);
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
244
|
+
...{
|
|
245
|
+
name: "AlertTitle"
|
|
246
|
+
},
|
|
247
|
+
__name: "AlertTitle",
|
|
248
|
+
setup(__props) {
|
|
249
|
+
return (_ctx, _cache) => {
|
|
250
|
+
return openBlock(), createElementBlock("h5", null, [
|
|
251
|
+
renderSlot(_ctx.$slots, "default")
|
|
252
|
+
]);
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
257
|
+
...{
|
|
258
|
+
name: "AlertDescription"
|
|
259
|
+
},
|
|
260
|
+
__name: "AlertDescription",
|
|
261
|
+
setup(__props) {
|
|
262
|
+
return (_ctx, _cache) => {
|
|
263
|
+
return openBlock(), createElementBlock("div", null, [
|
|
264
|
+
renderSlot(_ctx.$slots, "default")
|
|
265
|
+
]);
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
const _hoisted_1$p = ["disabled", "data-state", "onKeydown"];
|
|
270
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
160
271
|
__name: "Checkbox",
|
|
161
272
|
props: /* @__PURE__ */ mergeModels({
|
|
162
273
|
size: { default: "md" },
|
|
@@ -195,13 +306,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
195
306
|
checked: model.value,
|
|
196
307
|
indeterminate: unref(composable).state.value.indeterminate
|
|
197
308
|
})
|
|
198
|
-
], 16, _hoisted_1$
|
|
309
|
+
], 16, _hoisted_1$p);
|
|
199
310
|
};
|
|
200
311
|
}
|
|
201
312
|
});
|
|
202
|
-
const _hoisted_1$
|
|
203
|
-
const _hoisted_2 = ["data-state"];
|
|
204
|
-
const _sfc_main$
|
|
313
|
+
const _hoisted_1$o = ["disabled", "data-state"];
|
|
314
|
+
const _hoisted_2$1 = ["data-state"];
|
|
315
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
205
316
|
__name: "Switch",
|
|
206
317
|
props: /* @__PURE__ */ mergeModels({
|
|
207
318
|
size: { default: "md" },
|
|
@@ -234,14 +345,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
234
345
|
renderSlot(_ctx.$slots, "default", { checked: model.value }, () => [
|
|
235
346
|
createElementVNode("span", {
|
|
236
347
|
"data-state": model.value ? "checked" : "unchecked"
|
|
237
|
-
}, null, 8, _hoisted_2)
|
|
348
|
+
}, null, 8, _hoisted_2$1)
|
|
238
349
|
])
|
|
239
|
-
], 16, _hoisted_1$
|
|
350
|
+
], 16, _hoisted_1$o);
|
|
240
351
|
};
|
|
241
352
|
}
|
|
242
353
|
});
|
|
243
|
-
const _hoisted_1$
|
|
244
|
-
const _sfc_main$
|
|
354
|
+
const _hoisted_1$n = ["aria-labelledby", "aria-describedby"];
|
|
355
|
+
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
245
356
|
__name: "Dialog",
|
|
246
357
|
props: /* @__PURE__ */ mergeModels({
|
|
247
358
|
closeOnOverlay: { type: Boolean, default: true },
|
|
@@ -328,12 +439,127 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
328
439
|
}, [
|
|
329
440
|
renderSlot(_ctx.$slots, "default", { close: unref(close) })
|
|
330
441
|
], 544)
|
|
331
|
-
], 8, _hoisted_1$
|
|
442
|
+
], 8, _hoisted_1$n)) : createCommentVNode("", true)
|
|
332
443
|
]);
|
|
333
444
|
};
|
|
334
445
|
}
|
|
335
446
|
});
|
|
336
|
-
const _sfc_main$
|
|
447
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
448
|
+
...{
|
|
449
|
+
name: "DialogTrigger"
|
|
450
|
+
},
|
|
451
|
+
__name: "DialogTrigger",
|
|
452
|
+
setup(__props) {
|
|
453
|
+
const DIALOG_KEY2 = Symbol("dialog");
|
|
454
|
+
const context = inject(DIALOG_KEY2, null);
|
|
455
|
+
const open = () => {
|
|
456
|
+
if (context) {
|
|
457
|
+
context.is_open.value = true;
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
return (_ctx, _cache) => {
|
|
461
|
+
return renderSlot(_ctx.$slots, "default", { open });
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
466
|
+
...{
|
|
467
|
+
name: "DialogOverlay"
|
|
468
|
+
},
|
|
469
|
+
__name: "DialogOverlay",
|
|
470
|
+
emits: ["click"],
|
|
471
|
+
setup(__props) {
|
|
472
|
+
return (_ctx, _cache) => {
|
|
473
|
+
return openBlock(), createElementBlock("div", {
|
|
474
|
+
"aria-hidden": "true",
|
|
475
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click"))
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
481
|
+
...{
|
|
482
|
+
name: "DialogContent"
|
|
483
|
+
},
|
|
484
|
+
__name: "DialogContent",
|
|
485
|
+
setup(__props, { expose: __expose }) {
|
|
486
|
+
const content_ref = ref(null);
|
|
487
|
+
__expose({
|
|
488
|
+
content_ref
|
|
489
|
+
});
|
|
490
|
+
return (_ctx, _cache) => {
|
|
491
|
+
return openBlock(), createElementBlock("div", {
|
|
492
|
+
ref_key: "content_ref",
|
|
493
|
+
ref: content_ref,
|
|
494
|
+
role: "document",
|
|
495
|
+
tabindex: "-1"
|
|
496
|
+
}, [
|
|
497
|
+
renderSlot(_ctx.$slots, "default")
|
|
498
|
+
], 512);
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
503
|
+
...{
|
|
504
|
+
name: "DialogHeader"
|
|
505
|
+
},
|
|
506
|
+
__name: "DialogHeader",
|
|
507
|
+
setup(__props) {
|
|
508
|
+
return (_ctx, _cache) => {
|
|
509
|
+
return openBlock(), createElementBlock("div", null, [
|
|
510
|
+
renderSlot(_ctx.$slots, "default")
|
|
511
|
+
]);
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
const _hoisted_1$m = ["id"];
|
|
516
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
517
|
+
...{
|
|
518
|
+
name: "DialogTitle"
|
|
519
|
+
},
|
|
520
|
+
__name: "DialogTitle",
|
|
521
|
+
props: {
|
|
522
|
+
id: {}
|
|
523
|
+
},
|
|
524
|
+
setup(__props) {
|
|
525
|
+
return (_ctx, _cache) => {
|
|
526
|
+
return openBlock(), createElementBlock("h2", { id: __props.id }, [
|
|
527
|
+
renderSlot(_ctx.$slots, "default")
|
|
528
|
+
], 8, _hoisted_1$m);
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
const _hoisted_1$l = ["id"];
|
|
533
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
534
|
+
...{
|
|
535
|
+
name: "DialogDescription"
|
|
536
|
+
},
|
|
537
|
+
__name: "DialogDescription",
|
|
538
|
+
props: {
|
|
539
|
+
id: {}
|
|
540
|
+
},
|
|
541
|
+
setup(__props) {
|
|
542
|
+
return (_ctx, _cache) => {
|
|
543
|
+
return openBlock(), createElementBlock("p", { id: __props.id }, [
|
|
544
|
+
renderSlot(_ctx.$slots, "default")
|
|
545
|
+
], 8, _hoisted_1$l);
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
550
|
+
...{
|
|
551
|
+
name: "DialogFooter"
|
|
552
|
+
},
|
|
553
|
+
__name: "DialogFooter",
|
|
554
|
+
setup(__props) {
|
|
555
|
+
return (_ctx, _cache) => {
|
|
556
|
+
return openBlock(), createElementBlock("div", null, [
|
|
557
|
+
renderSlot(_ctx.$slots, "default")
|
|
558
|
+
]);
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
337
563
|
__name: "Select",
|
|
338
564
|
props: /* @__PURE__ */ mergeModels({
|
|
339
565
|
size: { default: "md" },
|
|
@@ -422,8 +648,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
422
648
|
};
|
|
423
649
|
}
|
|
424
650
|
});
|
|
425
|
-
const _hoisted_1$
|
|
426
|
-
const _sfc_main$
|
|
651
|
+
const _hoisted_1$k = ["disabled", "aria-expanded"];
|
|
652
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
427
653
|
__name: "SelectTrigger",
|
|
428
654
|
setup(__props, { expose: __expose }) {
|
|
429
655
|
const SELECT_KEY = Symbol("select");
|
|
@@ -474,11 +700,38 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
474
700
|
is_open: unref(composable).state.value.is_open,
|
|
475
701
|
disabled: unref(composable).state.value.disabled
|
|
476
702
|
})
|
|
477
|
-
], 40, _hoisted_1$
|
|
703
|
+
], 40, _hoisted_1$k);
|
|
478
704
|
};
|
|
479
705
|
}
|
|
480
706
|
});
|
|
481
|
-
const _sfc_main$
|
|
707
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
708
|
+
...{
|
|
709
|
+
name: "SelectValue"
|
|
710
|
+
},
|
|
711
|
+
__name: "SelectValue",
|
|
712
|
+
props: {
|
|
713
|
+
placeholder: {}
|
|
714
|
+
},
|
|
715
|
+
setup(__props) {
|
|
716
|
+
const SELECT_KEY = Symbol("select");
|
|
717
|
+
const props = __props;
|
|
718
|
+
const context = inject(SELECT_KEY, null);
|
|
719
|
+
const selected_value = computed(() => (context == null ? void 0 : context.model_value.value) ?? "");
|
|
720
|
+
const placeholder = computed(() => props.placeholder ?? (context == null ? void 0 : context.placeholder.value) ?? "Select...");
|
|
721
|
+
const display_text = computed(() => selected_value.value || placeholder.value);
|
|
722
|
+
return (_ctx, _cache) => {
|
|
723
|
+
return openBlock(), createElementBlock("span", null, [
|
|
724
|
+
renderSlot(_ctx.$slots, "default", {
|
|
725
|
+
value: selected_value.value,
|
|
726
|
+
placeholder: placeholder.value
|
|
727
|
+
}, () => [
|
|
728
|
+
createTextVNode(toDisplayString(display_text.value), 1)
|
|
729
|
+
])
|
|
730
|
+
]);
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
482
735
|
__name: "SelectContent",
|
|
483
736
|
setup(__props, { expose: __expose }) {
|
|
484
737
|
const SELECT_KEY = Symbol("select");
|
|
@@ -512,8 +765,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
512
765
|
};
|
|
513
766
|
}
|
|
514
767
|
});
|
|
515
|
-
const _hoisted_1$
|
|
516
|
-
const _sfc_main$
|
|
768
|
+
const _hoisted_1$j = ["aria-selected", "aria-disabled", "data-state", "data-disabled", "onKeydown"];
|
|
769
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
517
770
|
__name: "SelectItem",
|
|
518
771
|
props: {
|
|
519
772
|
value: {},
|
|
@@ -552,12 +805,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
552
805
|
selected: unref(composable).state.value.selected,
|
|
553
806
|
disabled: unref(composable).state.value.disabled
|
|
554
807
|
})
|
|
555
|
-
], 40, _hoisted_1$
|
|
808
|
+
], 40, _hoisted_1$j);
|
|
556
809
|
};
|
|
557
810
|
}
|
|
558
811
|
});
|
|
559
|
-
const _hoisted_1$
|
|
560
|
-
const _sfc_main$
|
|
812
|
+
const _hoisted_1$i = ["aria-orientation"];
|
|
813
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
561
814
|
__name: "RadioGroup",
|
|
562
815
|
props: /* @__PURE__ */ mergeModels({
|
|
563
816
|
disabled: { type: Boolean, default: false },
|
|
@@ -588,12 +841,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
588
841
|
"aria-orientation": __props.orientation
|
|
589
842
|
}, [
|
|
590
843
|
renderSlot(_ctx.$slots, "default")
|
|
591
|
-
], 8, _hoisted_1$
|
|
844
|
+
], 8, _hoisted_1$i);
|
|
592
845
|
};
|
|
593
846
|
}
|
|
594
847
|
});
|
|
595
|
-
const _hoisted_1 = ["disabled", "data-state"];
|
|
596
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
848
|
+
const _hoisted_1$h = ["disabled", "data-state"];
|
|
849
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
597
850
|
__name: "RadioItem",
|
|
598
851
|
props: {
|
|
599
852
|
value: {},
|
|
@@ -639,7 +892,1055 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
639
892
|
checked: unref(composable).state.value.checked,
|
|
640
893
|
disabled: unref(composable).state.value.disabled
|
|
641
894
|
})
|
|
642
|
-
], 16, _hoisted_1);
|
|
895
|
+
], 16, _hoisted_1$h);
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
900
|
+
...{
|
|
901
|
+
name: "FormField"
|
|
902
|
+
},
|
|
903
|
+
__name: "FormField",
|
|
904
|
+
props: {
|
|
905
|
+
name: {},
|
|
906
|
+
error: {}
|
|
907
|
+
},
|
|
908
|
+
setup(__props) {
|
|
909
|
+
const FORM_FIELD_KEY = Symbol("form-field");
|
|
910
|
+
const props = __props;
|
|
911
|
+
const field_id = computed(() => `field-${props.name}`);
|
|
912
|
+
const error_id = computed(() => `field-${props.name}-error`);
|
|
913
|
+
const has_error = computed(() => !!props.error);
|
|
914
|
+
const error = computed(() => props.error);
|
|
915
|
+
provide(FORM_FIELD_KEY, {
|
|
916
|
+
field_id: field_id.value,
|
|
917
|
+
error_id: error_id.value,
|
|
918
|
+
has_error,
|
|
919
|
+
error
|
|
920
|
+
});
|
|
921
|
+
return (_ctx, _cache) => {
|
|
922
|
+
return openBlock(), createElementBlock("div", null, [
|
|
923
|
+
renderSlot(_ctx.$slots, "default", {
|
|
924
|
+
id: field_id.value,
|
|
925
|
+
error_id: error_id.value,
|
|
926
|
+
has_error: !!error.value
|
|
927
|
+
})
|
|
928
|
+
]);
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
const _hoisted_1$g = ["for"];
|
|
933
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
934
|
+
...{
|
|
935
|
+
name: "FormLabel"
|
|
936
|
+
},
|
|
937
|
+
__name: "FormLabel",
|
|
938
|
+
props: {
|
|
939
|
+
for: {}
|
|
940
|
+
},
|
|
941
|
+
setup(__props) {
|
|
942
|
+
const FORM_FIELD_KEY = Symbol("form-field");
|
|
943
|
+
const props = __props;
|
|
944
|
+
const context = inject(FORM_FIELD_KEY, null);
|
|
945
|
+
const for_id = props.for ?? (context == null ? void 0 : context.field_id);
|
|
946
|
+
return (_ctx, _cache) => {
|
|
947
|
+
return openBlock(), createElementBlock("label", { for: unref(for_id) }, [
|
|
948
|
+
renderSlot(_ctx.$slots, "default")
|
|
949
|
+
], 8, _hoisted_1$g);
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
const _hoisted_1$f = ["id", "type", "value", "disabled", "readonly", "placeholder", "aria-invalid", "aria-describedby"];
|
|
954
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
955
|
+
...{
|
|
956
|
+
name: "FormInput"
|
|
957
|
+
},
|
|
958
|
+
__name: "FormInput",
|
|
959
|
+
props: {
|
|
960
|
+
type: { default: "text" },
|
|
961
|
+
modelValue: {},
|
|
962
|
+
disabled: { type: Boolean, default: false },
|
|
963
|
+
readonly: { type: Boolean, default: false },
|
|
964
|
+
placeholder: {},
|
|
965
|
+
id: {}
|
|
966
|
+
},
|
|
967
|
+
emits: ["update:modelValue"],
|
|
968
|
+
setup(__props, { emit: __emit }) {
|
|
969
|
+
const FORM_FIELD_KEY = Symbol("form-field");
|
|
970
|
+
const props = __props;
|
|
971
|
+
const emit = __emit;
|
|
972
|
+
const context = inject(FORM_FIELD_KEY, null);
|
|
973
|
+
const input_id = computed(() => props.id ?? (context == null ? void 0 : context.field_id));
|
|
974
|
+
const has_error = computed(() => (context == null ? void 0 : context.has_error.value) ?? false);
|
|
975
|
+
const aria_error_id = computed(() => context == null ? void 0 : context.error_id);
|
|
976
|
+
const handleInput = (event) => {
|
|
977
|
+
const target = event.target;
|
|
978
|
+
emit("update:modelValue", target.value);
|
|
979
|
+
};
|
|
980
|
+
return (_ctx, _cache) => {
|
|
981
|
+
return openBlock(), createElementBlock("input", {
|
|
982
|
+
id: input_id.value,
|
|
983
|
+
type: __props.type,
|
|
984
|
+
value: __props.modelValue,
|
|
985
|
+
disabled: __props.disabled,
|
|
986
|
+
readonly: __props.readonly,
|
|
987
|
+
placeholder: __props.placeholder,
|
|
988
|
+
"aria-invalid": has_error.value,
|
|
989
|
+
"aria-describedby": has_error.value ? aria_error_id.value : void 0,
|
|
990
|
+
onInput: handleInput
|
|
991
|
+
}, null, 40, _hoisted_1$f);
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
});
|
|
995
|
+
const _hoisted_1$e = ["id", "value", "disabled", "readonly", "placeholder", "rows", "aria-invalid", "aria-describedby"];
|
|
996
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
997
|
+
...{
|
|
998
|
+
name: "FormTextarea"
|
|
999
|
+
},
|
|
1000
|
+
__name: "FormTextarea",
|
|
1001
|
+
props: {
|
|
1002
|
+
modelValue: {},
|
|
1003
|
+
disabled: { type: Boolean, default: false },
|
|
1004
|
+
readonly: { type: Boolean, default: false },
|
|
1005
|
+
placeholder: {},
|
|
1006
|
+
rows: { default: 3 },
|
|
1007
|
+
id: {}
|
|
1008
|
+
},
|
|
1009
|
+
emits: ["update:modelValue"],
|
|
1010
|
+
setup(__props, { emit: __emit }) {
|
|
1011
|
+
const FORM_FIELD_KEY = Symbol("form-field");
|
|
1012
|
+
const props = __props;
|
|
1013
|
+
const emit = __emit;
|
|
1014
|
+
const context = inject(FORM_FIELD_KEY, null);
|
|
1015
|
+
const textarea_id = computed(() => props.id ?? (context == null ? void 0 : context.field_id));
|
|
1016
|
+
const has_error = computed(() => (context == null ? void 0 : context.has_error.value) ?? false);
|
|
1017
|
+
const aria_error_id = computed(() => context == null ? void 0 : context.error_id);
|
|
1018
|
+
const handleInput = (event) => {
|
|
1019
|
+
const target = event.target;
|
|
1020
|
+
emit("update:modelValue", target.value);
|
|
1021
|
+
};
|
|
1022
|
+
return (_ctx, _cache) => {
|
|
1023
|
+
return openBlock(), createElementBlock("textarea", {
|
|
1024
|
+
id: textarea_id.value,
|
|
1025
|
+
value: __props.modelValue,
|
|
1026
|
+
disabled: __props.disabled,
|
|
1027
|
+
readonly: __props.readonly,
|
|
1028
|
+
placeholder: __props.placeholder,
|
|
1029
|
+
rows: __props.rows,
|
|
1030
|
+
"aria-invalid": has_error.value,
|
|
1031
|
+
"aria-describedby": has_error.value ? aria_error_id.value : void 0,
|
|
1032
|
+
onInput: handleInput
|
|
1033
|
+
}, null, 40, _hoisted_1$e);
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
const _hoisted_1$d = ["id"];
|
|
1038
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
1039
|
+
...{
|
|
1040
|
+
name: "FormError"
|
|
1041
|
+
},
|
|
1042
|
+
__name: "FormError",
|
|
1043
|
+
props: {
|
|
1044
|
+
error: {}
|
|
1045
|
+
},
|
|
1046
|
+
setup(__props) {
|
|
1047
|
+
const FORM_FIELD_KEY = Symbol("form-field");
|
|
1048
|
+
const props = __props;
|
|
1049
|
+
const context = inject(FORM_FIELD_KEY, null);
|
|
1050
|
+
const error_id = computed(() => context == null ? void 0 : context.error_id);
|
|
1051
|
+
const error_message = computed(() => props.error ?? (context == null ? void 0 : context.error.value));
|
|
1052
|
+
const show_error = computed(() => !!error_message.value);
|
|
1053
|
+
return (_ctx, _cache) => {
|
|
1054
|
+
return show_error.value ? (openBlock(), createElementBlock("p", {
|
|
1055
|
+
key: 0,
|
|
1056
|
+
id: error_id.value,
|
|
1057
|
+
role: "alert",
|
|
1058
|
+
"aria-live": "polite"
|
|
1059
|
+
}, [
|
|
1060
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1061
|
+
createTextVNode(toDisplayString(error_message.value), 1)
|
|
1062
|
+
])
|
|
1063
|
+
], 8, _hoisted_1$d)) : createCommentVNode("", true);
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
});
|
|
1067
|
+
const _hoisted_1$c = ["data-dragging", "data-disabled", "data-has-files"];
|
|
1068
|
+
const _hoisted_2 = ["accept", "multiple", "disabled"];
|
|
1069
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
1070
|
+
...{
|
|
1071
|
+
name: "FileInput"
|
|
1072
|
+
},
|
|
1073
|
+
__name: "FileInput",
|
|
1074
|
+
props: {
|
|
1075
|
+
accept: {},
|
|
1076
|
+
multiple: { type: Boolean, default: false },
|
|
1077
|
+
disabled: { type: Boolean, default: false },
|
|
1078
|
+
maxSize: {},
|
|
1079
|
+
maxFiles: {}
|
|
1080
|
+
},
|
|
1081
|
+
emits: ["change", "error"],
|
|
1082
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1083
|
+
const props = __props;
|
|
1084
|
+
const emit = __emit;
|
|
1085
|
+
const input_ref = ref(null);
|
|
1086
|
+
const files = ref([]);
|
|
1087
|
+
const is_dragging = ref(false);
|
|
1088
|
+
const has_files = computed(() => files.value.length > 0);
|
|
1089
|
+
const validateFiles = (file_list) => {
|
|
1090
|
+
if (!file_list) return [];
|
|
1091
|
+
const validated = [];
|
|
1092
|
+
const max_files = props.maxFiles ?? (props.multiple ? Infinity : 1);
|
|
1093
|
+
for (let i2 = 0; i2 < Math.min(file_list.length, max_files); i2++) {
|
|
1094
|
+
const file = file_list[i2];
|
|
1095
|
+
if (props.maxSize && file.size > props.maxSize) {
|
|
1096
|
+
emit("error", `File "${file.name}" exceeds maximum size`);
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
validated.push(file);
|
|
1100
|
+
}
|
|
1101
|
+
return validated;
|
|
1102
|
+
};
|
|
1103
|
+
const handleChange = (event) => {
|
|
1104
|
+
const target = event.target;
|
|
1105
|
+
const validated = validateFiles(target.files);
|
|
1106
|
+
files.value = validated;
|
|
1107
|
+
emit("change", validated);
|
|
1108
|
+
};
|
|
1109
|
+
const handleDragOver = (event) => {
|
|
1110
|
+
if (props.disabled) return;
|
|
1111
|
+
is_dragging.value = true;
|
|
1112
|
+
};
|
|
1113
|
+
const handleDragLeave = () => {
|
|
1114
|
+
is_dragging.value = false;
|
|
1115
|
+
};
|
|
1116
|
+
const handleDrop = (event) => {
|
|
1117
|
+
var _a;
|
|
1118
|
+
if (props.disabled) return;
|
|
1119
|
+
is_dragging.value = false;
|
|
1120
|
+
const validated = validateFiles(((_a = event.dataTransfer) == null ? void 0 : _a.files) ?? null);
|
|
1121
|
+
files.value = validated;
|
|
1122
|
+
emit("change", validated);
|
|
1123
|
+
};
|
|
1124
|
+
const openFilePicker = () => {
|
|
1125
|
+
if (!props.disabled && input_ref.value) {
|
|
1126
|
+
input_ref.value.click();
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
const clearFiles = () => {
|
|
1130
|
+
files.value = [];
|
|
1131
|
+
if (input_ref.value) {
|
|
1132
|
+
input_ref.value.value = "";
|
|
1133
|
+
}
|
|
1134
|
+
emit("change", []);
|
|
1135
|
+
};
|
|
1136
|
+
__expose({
|
|
1137
|
+
files,
|
|
1138
|
+
is_dragging,
|
|
1139
|
+
openFilePicker,
|
|
1140
|
+
clearFiles
|
|
1141
|
+
});
|
|
1142
|
+
return (_ctx, _cache) => {
|
|
1143
|
+
return openBlock(), createElementBlock("div", {
|
|
1144
|
+
"data-dragging": is_dragging.value,
|
|
1145
|
+
"data-disabled": __props.disabled,
|
|
1146
|
+
"data-has-files": has_files.value,
|
|
1147
|
+
onDragover: withModifiers(handleDragOver, ["prevent"]),
|
|
1148
|
+
onDragleave: handleDragLeave,
|
|
1149
|
+
onDrop: withModifiers(handleDrop, ["prevent"])
|
|
1150
|
+
}, [
|
|
1151
|
+
createElementVNode("input", {
|
|
1152
|
+
ref_key: "input_ref",
|
|
1153
|
+
ref: input_ref,
|
|
1154
|
+
type: "file",
|
|
1155
|
+
accept: __props.accept,
|
|
1156
|
+
multiple: __props.multiple,
|
|
1157
|
+
disabled: __props.disabled,
|
|
1158
|
+
onChange: handleChange
|
|
1159
|
+
}, null, 40, _hoisted_2),
|
|
1160
|
+
renderSlot(_ctx.$slots, "default", {
|
|
1161
|
+
files: files.value,
|
|
1162
|
+
is_dragging: is_dragging.value,
|
|
1163
|
+
open: openFilePicker,
|
|
1164
|
+
clear: clearFiles
|
|
1165
|
+
})
|
|
1166
|
+
], 40, _hoisted_1$c);
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
const _hoisted_1$b = ["data-side"];
|
|
1171
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
1172
|
+
...{
|
|
1173
|
+
name: "Sheet"
|
|
1174
|
+
},
|
|
1175
|
+
__name: "Sheet",
|
|
1176
|
+
props: /* @__PURE__ */ mergeModels({
|
|
1177
|
+
side: { default: "right" },
|
|
1178
|
+
closeOnOverlay: { type: Boolean, default: true },
|
|
1179
|
+
closeOnEscape: { type: Boolean, default: true }
|
|
1180
|
+
}, {
|
|
1181
|
+
"open": { type: Boolean, ...{ default: false } },
|
|
1182
|
+
"openModifiers": {}
|
|
1183
|
+
}),
|
|
1184
|
+
emits: ["update:open"],
|
|
1185
|
+
setup(__props, { expose: __expose }) {
|
|
1186
|
+
const SHEET_KEY = Symbol("sheet");
|
|
1187
|
+
const props = __props;
|
|
1188
|
+
const model = useModel(__props, "open");
|
|
1189
|
+
const is_open = ref(false);
|
|
1190
|
+
const open = () => {
|
|
1191
|
+
is_open.value = true;
|
|
1192
|
+
};
|
|
1193
|
+
const close = () => {
|
|
1194
|
+
is_open.value = false;
|
|
1195
|
+
};
|
|
1196
|
+
watch(model, (value) => {
|
|
1197
|
+
is_open.value = value;
|
|
1198
|
+
}, { immediate: true });
|
|
1199
|
+
watch(is_open, (value) => {
|
|
1200
|
+
model.value = value;
|
|
1201
|
+
});
|
|
1202
|
+
const handleKeyDown = (event) => {
|
|
1203
|
+
if (event.key === "Escape" && props.closeOnEscape && is_open.value) {
|
|
1204
|
+
close();
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
provide(SHEET_KEY, {
|
|
1208
|
+
is_open,
|
|
1209
|
+
side: props.side,
|
|
1210
|
+
close
|
|
1211
|
+
});
|
|
1212
|
+
onMounted(() => {
|
|
1213
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1214
|
+
});
|
|
1215
|
+
onUnmounted(() => {
|
|
1216
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1217
|
+
});
|
|
1218
|
+
__expose({
|
|
1219
|
+
is_open,
|
|
1220
|
+
open,
|
|
1221
|
+
close
|
|
1222
|
+
});
|
|
1223
|
+
return (_ctx, _cache) => {
|
|
1224
|
+
return openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
1225
|
+
is_open.value ? (openBlock(), createElementBlock("div", {
|
|
1226
|
+
key: 0,
|
|
1227
|
+
"data-side": __props.side
|
|
1228
|
+
}, [
|
|
1229
|
+
renderSlot(_ctx.$slots, "default", {
|
|
1230
|
+
close,
|
|
1231
|
+
is_open: is_open.value
|
|
1232
|
+
})
|
|
1233
|
+
], 8, _hoisted_1$b)) : createCommentVNode("", true)
|
|
1234
|
+
]);
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
1239
|
+
...{
|
|
1240
|
+
name: "SheetTrigger"
|
|
1241
|
+
},
|
|
1242
|
+
__name: "SheetTrigger",
|
|
1243
|
+
setup(__props) {
|
|
1244
|
+
const SHEET_KEY = Symbol("sheet");
|
|
1245
|
+
const context = inject(SHEET_KEY, null);
|
|
1246
|
+
const open = () => {
|
|
1247
|
+
if (context) {
|
|
1248
|
+
context.is_open.value = true;
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
return (_ctx, _cache) => {
|
|
1252
|
+
return renderSlot(_ctx.$slots, "default", { open });
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
1257
|
+
...{
|
|
1258
|
+
name: "SheetOverlay"
|
|
1259
|
+
},
|
|
1260
|
+
__name: "SheetOverlay",
|
|
1261
|
+
setup(__props) {
|
|
1262
|
+
const SHEET_KEY = Symbol("sheet");
|
|
1263
|
+
const context = inject(SHEET_KEY, null);
|
|
1264
|
+
const handleClick = () => {
|
|
1265
|
+
context == null ? void 0 : context.close();
|
|
1266
|
+
};
|
|
1267
|
+
return (_ctx, _cache) => {
|
|
1268
|
+
return openBlock(), createElementBlock("div", {
|
|
1269
|
+
"aria-hidden": "true",
|
|
1270
|
+
onClick: handleClick
|
|
1271
|
+
});
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
const _hoisted_1$a = {
|
|
1276
|
+
role: "dialog",
|
|
1277
|
+
"aria-modal": "true",
|
|
1278
|
+
tabindex: "-1"
|
|
1279
|
+
};
|
|
1280
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
1281
|
+
...{
|
|
1282
|
+
name: "SheetContent"
|
|
1283
|
+
},
|
|
1284
|
+
__name: "SheetContent",
|
|
1285
|
+
setup(__props) {
|
|
1286
|
+
return (_ctx, _cache) => {
|
|
1287
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1288
|
+
renderSlot(_ctx.$slots, "default")
|
|
1289
|
+
]);
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
1294
|
+
...{
|
|
1295
|
+
name: "SheetHeader"
|
|
1296
|
+
},
|
|
1297
|
+
__name: "SheetHeader",
|
|
1298
|
+
setup(__props) {
|
|
1299
|
+
return (_ctx, _cache) => {
|
|
1300
|
+
return openBlock(), createElementBlock("div", null, [
|
|
1301
|
+
renderSlot(_ctx.$slots, "default")
|
|
1302
|
+
]);
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
});
|
|
1306
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
1307
|
+
...{
|
|
1308
|
+
name: "SheetTitle"
|
|
1309
|
+
},
|
|
1310
|
+
__name: "SheetTitle",
|
|
1311
|
+
setup(__props) {
|
|
1312
|
+
return (_ctx, _cache) => {
|
|
1313
|
+
return openBlock(), createElementBlock("h2", null, [
|
|
1314
|
+
renderSlot(_ctx.$slots, "default")
|
|
1315
|
+
]);
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1319
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
1320
|
+
...{
|
|
1321
|
+
name: "SheetDescription"
|
|
1322
|
+
},
|
|
1323
|
+
__name: "SheetDescription",
|
|
1324
|
+
setup(__props) {
|
|
1325
|
+
return (_ctx, _cache) => {
|
|
1326
|
+
return openBlock(), createElementBlock("p", null, [
|
|
1327
|
+
renderSlot(_ctx.$slots, "default")
|
|
1328
|
+
]);
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
});
|
|
1332
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
1333
|
+
...{
|
|
1334
|
+
name: "SheetFooter"
|
|
1335
|
+
},
|
|
1336
|
+
__name: "SheetFooter",
|
|
1337
|
+
setup(__props) {
|
|
1338
|
+
return (_ctx, _cache) => {
|
|
1339
|
+
return openBlock(), createElementBlock("div", null, [
|
|
1340
|
+
renderSlot(_ctx.$slots, "default")
|
|
1341
|
+
]);
|
|
1342
|
+
};
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1346
|
+
...{
|
|
1347
|
+
name: "SheetClose"
|
|
1348
|
+
},
|
|
1349
|
+
__name: "SheetClose",
|
|
1350
|
+
setup(__props) {
|
|
1351
|
+
const SHEET_KEY = Symbol("sheet");
|
|
1352
|
+
const context = inject(SHEET_KEY, null);
|
|
1353
|
+
const close = () => {
|
|
1354
|
+
context == null ? void 0 : context.close();
|
|
1355
|
+
};
|
|
1356
|
+
return (_ctx, _cache) => {
|
|
1357
|
+
return renderSlot(_ctx.$slots, "default", { close }, () => [
|
|
1358
|
+
createElementVNode("button", {
|
|
1359
|
+
type: "button",
|
|
1360
|
+
onClick: close
|
|
1361
|
+
}, " Close ")
|
|
1362
|
+
]);
|
|
1363
|
+
};
|
|
1364
|
+
}
|
|
1365
|
+
});
|
|
1366
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1367
|
+
...{
|
|
1368
|
+
name: "Popover"
|
|
1369
|
+
},
|
|
1370
|
+
__name: "Popover",
|
|
1371
|
+
props: {
|
|
1372
|
+
closeOnClickOutside: { type: Boolean, default: true }
|
|
1373
|
+
},
|
|
1374
|
+
setup(__props, { expose: __expose }) {
|
|
1375
|
+
const POPOVER_KEY = Symbol("popover");
|
|
1376
|
+
const props = __props;
|
|
1377
|
+
const root_ref = ref(null);
|
|
1378
|
+
const trigger_ref = ref(null);
|
|
1379
|
+
const is_open = ref(false);
|
|
1380
|
+
const open = () => {
|
|
1381
|
+
is_open.value = true;
|
|
1382
|
+
};
|
|
1383
|
+
const close = () => {
|
|
1384
|
+
is_open.value = false;
|
|
1385
|
+
};
|
|
1386
|
+
const toggle = () => {
|
|
1387
|
+
is_open.value = !is_open.value;
|
|
1388
|
+
};
|
|
1389
|
+
const setTriggerRef = (el) => {
|
|
1390
|
+
trigger_ref.value = el;
|
|
1391
|
+
};
|
|
1392
|
+
const handleClickOutside = (event) => {
|
|
1393
|
+
if (!props.closeOnClickOutside || !is_open.value) return;
|
|
1394
|
+
const target = event.target;
|
|
1395
|
+
if (root_ref.value && !root_ref.value.contains(target)) {
|
|
1396
|
+
close();
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
provide(POPOVER_KEY, {
|
|
1400
|
+
is_open,
|
|
1401
|
+
trigger_ref,
|
|
1402
|
+
open,
|
|
1403
|
+
close,
|
|
1404
|
+
toggle,
|
|
1405
|
+
setTriggerRef
|
|
1406
|
+
});
|
|
1407
|
+
onMounted(() => {
|
|
1408
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1409
|
+
});
|
|
1410
|
+
onUnmounted(() => {
|
|
1411
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1412
|
+
});
|
|
1413
|
+
__expose({
|
|
1414
|
+
is_open,
|
|
1415
|
+
open,
|
|
1416
|
+
close,
|
|
1417
|
+
toggle
|
|
1418
|
+
});
|
|
1419
|
+
return (_ctx, _cache) => {
|
|
1420
|
+
return openBlock(), createElementBlock("div", {
|
|
1421
|
+
ref_key: "root_ref",
|
|
1422
|
+
ref: root_ref
|
|
1423
|
+
}, [
|
|
1424
|
+
renderSlot(_ctx.$slots, "default", {
|
|
1425
|
+
is_open: is_open.value,
|
|
1426
|
+
open,
|
|
1427
|
+
close,
|
|
1428
|
+
toggle
|
|
1429
|
+
})
|
|
1430
|
+
], 512);
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
const _hoisted_1$9 = ["aria-expanded"];
|
|
1435
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
1436
|
+
...{
|
|
1437
|
+
name: "PopoverTrigger"
|
|
1438
|
+
},
|
|
1439
|
+
__name: "PopoverTrigger",
|
|
1440
|
+
setup(__props) {
|
|
1441
|
+
const POPOVER_KEY = Symbol("popover");
|
|
1442
|
+
const trigger_element = ref(null);
|
|
1443
|
+
const context = inject(POPOVER_KEY, null);
|
|
1444
|
+
const is_open = (context == null ? void 0 : context.is_open) ?? ref(false);
|
|
1445
|
+
const toggle = () => {
|
|
1446
|
+
context == null ? void 0 : context.toggle();
|
|
1447
|
+
};
|
|
1448
|
+
onMounted(() => {
|
|
1449
|
+
context == null ? void 0 : context.setTriggerRef(trigger_element.value);
|
|
1450
|
+
});
|
|
1451
|
+
return (_ctx, _cache) => {
|
|
1452
|
+
return openBlock(), createElementBlock("button", {
|
|
1453
|
+
ref_key: "trigger_element",
|
|
1454
|
+
ref: trigger_element,
|
|
1455
|
+
type: "button",
|
|
1456
|
+
"aria-expanded": unref(is_open),
|
|
1457
|
+
"aria-haspopup": "dialog",
|
|
1458
|
+
onClick: toggle
|
|
1459
|
+
}, [
|
|
1460
|
+
renderSlot(_ctx.$slots, "default", { is_open: unref(is_open) })
|
|
1461
|
+
], 8, _hoisted_1$9);
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
const _hoisted_1$8 = ["data-side", "data-align"];
|
|
1466
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
1467
|
+
...{
|
|
1468
|
+
name: "PopoverContent"
|
|
1469
|
+
},
|
|
1470
|
+
__name: "PopoverContent",
|
|
1471
|
+
props: {
|
|
1472
|
+
side: { default: "bottom" },
|
|
1473
|
+
align: { default: "center" }
|
|
1474
|
+
},
|
|
1475
|
+
setup(__props) {
|
|
1476
|
+
const POPOVER_KEY = Symbol("popover");
|
|
1477
|
+
const context = inject(POPOVER_KEY, null);
|
|
1478
|
+
const is_open = context == null ? void 0 : context.is_open;
|
|
1479
|
+
return (_ctx, _cache) => {
|
|
1480
|
+
return unref(is_open) ? (openBlock(), createElementBlock("div", {
|
|
1481
|
+
key: 0,
|
|
1482
|
+
role: "dialog",
|
|
1483
|
+
tabindex: "-1",
|
|
1484
|
+
"data-side": __props.side,
|
|
1485
|
+
"data-align": __props.align
|
|
1486
|
+
}, [
|
|
1487
|
+
renderSlot(_ctx.$slots, "default")
|
|
1488
|
+
], 8, _hoisted_1$8)) : createCommentVNode("", true);
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1493
|
+
...{
|
|
1494
|
+
name: "Tooltip"
|
|
1495
|
+
},
|
|
1496
|
+
__name: "Tooltip",
|
|
1497
|
+
props: {
|
|
1498
|
+
delay: { default: 200 }
|
|
1499
|
+
},
|
|
1500
|
+
setup(__props, { expose: __expose }) {
|
|
1501
|
+
const TOOLTIP_KEY = Symbol("tooltip");
|
|
1502
|
+
const props = __props;
|
|
1503
|
+
const root_ref = ref(null);
|
|
1504
|
+
const trigger_ref = ref(null);
|
|
1505
|
+
const is_open = ref(false);
|
|
1506
|
+
let timeout_id = null;
|
|
1507
|
+
const open = () => {
|
|
1508
|
+
if (timeout_id) clearTimeout(timeout_id);
|
|
1509
|
+
timeout_id = setTimeout(() => {
|
|
1510
|
+
is_open.value = true;
|
|
1511
|
+
}, props.delay);
|
|
1512
|
+
};
|
|
1513
|
+
const close = () => {
|
|
1514
|
+
if (timeout_id) clearTimeout(timeout_id);
|
|
1515
|
+
is_open.value = false;
|
|
1516
|
+
};
|
|
1517
|
+
const setTriggerRef = (el) => {
|
|
1518
|
+
trigger_ref.value = el;
|
|
1519
|
+
};
|
|
1520
|
+
provide(TOOLTIP_KEY, {
|
|
1521
|
+
is_open,
|
|
1522
|
+
trigger_ref,
|
|
1523
|
+
delay: props.delay,
|
|
1524
|
+
open,
|
|
1525
|
+
close,
|
|
1526
|
+
setTriggerRef
|
|
1527
|
+
});
|
|
1528
|
+
__expose({
|
|
1529
|
+
is_open,
|
|
1530
|
+
open,
|
|
1531
|
+
close
|
|
1532
|
+
});
|
|
1533
|
+
return (_ctx, _cache) => {
|
|
1534
|
+
return openBlock(), createElementBlock("div", {
|
|
1535
|
+
ref_key: "root_ref",
|
|
1536
|
+
ref: root_ref
|
|
1537
|
+
}, [
|
|
1538
|
+
renderSlot(_ctx.$slots, "default", { is_open: is_open.value })
|
|
1539
|
+
], 512);
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
});
|
|
1543
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1544
|
+
...{
|
|
1545
|
+
name: "TooltipTrigger"
|
|
1546
|
+
},
|
|
1547
|
+
__name: "TooltipTrigger",
|
|
1548
|
+
setup(__props) {
|
|
1549
|
+
const TOOLTIP_KEY = Symbol("tooltip");
|
|
1550
|
+
const trigger_element = ref(null);
|
|
1551
|
+
const context = inject(TOOLTIP_KEY, null);
|
|
1552
|
+
const handleMouseEnter = () => {
|
|
1553
|
+
context == null ? void 0 : context.open();
|
|
1554
|
+
};
|
|
1555
|
+
const handleMouseLeave = () => {
|
|
1556
|
+
context == null ? void 0 : context.close();
|
|
1557
|
+
};
|
|
1558
|
+
onMounted(() => {
|
|
1559
|
+
context == null ? void 0 : context.setTriggerRef(trigger_element.value);
|
|
1560
|
+
});
|
|
1561
|
+
return (_ctx, _cache) => {
|
|
1562
|
+
return openBlock(), createElementBlock("span", {
|
|
1563
|
+
ref_key: "trigger_element",
|
|
1564
|
+
ref: trigger_element,
|
|
1565
|
+
onMouseenter: handleMouseEnter,
|
|
1566
|
+
onMouseleave: handleMouseLeave,
|
|
1567
|
+
onFocus: handleMouseEnter,
|
|
1568
|
+
onBlur: handleMouseLeave
|
|
1569
|
+
}, [
|
|
1570
|
+
renderSlot(_ctx.$slots, "default")
|
|
1571
|
+
], 544);
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
const _hoisted_1$7 = ["data-side"];
|
|
1576
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1577
|
+
...{
|
|
1578
|
+
name: "TooltipContent"
|
|
1579
|
+
},
|
|
1580
|
+
__name: "TooltipContent",
|
|
1581
|
+
props: {
|
|
1582
|
+
side: { default: "top" }
|
|
1583
|
+
},
|
|
1584
|
+
setup(__props) {
|
|
1585
|
+
const TOOLTIP_KEY = Symbol("tooltip");
|
|
1586
|
+
const context = inject(TOOLTIP_KEY, null);
|
|
1587
|
+
const is_open = context == null ? void 0 : context.is_open;
|
|
1588
|
+
return (_ctx, _cache) => {
|
|
1589
|
+
return unref(is_open) ? (openBlock(), createElementBlock("div", {
|
|
1590
|
+
key: 0,
|
|
1591
|
+
role: "tooltip",
|
|
1592
|
+
"data-side": __props.side
|
|
1593
|
+
}, [
|
|
1594
|
+
renderSlot(_ctx.$slots, "default")
|
|
1595
|
+
], 8, _hoisted_1$7)) : createCommentVNode("", true);
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1600
|
+
...{
|
|
1601
|
+
name: "DropdownMenu"
|
|
1602
|
+
},
|
|
1603
|
+
__name: "DropdownMenu",
|
|
1604
|
+
setup(__props, { expose: __expose }) {
|
|
1605
|
+
const DROPDOWN_MENU_KEY = Symbol("dropdown-menu");
|
|
1606
|
+
const root_ref = ref(null);
|
|
1607
|
+
const trigger_ref = ref(null);
|
|
1608
|
+
const is_open = ref(false);
|
|
1609
|
+
const open = () => {
|
|
1610
|
+
is_open.value = true;
|
|
1611
|
+
};
|
|
1612
|
+
const close = () => {
|
|
1613
|
+
is_open.value = false;
|
|
1614
|
+
};
|
|
1615
|
+
const toggle = () => {
|
|
1616
|
+
is_open.value = !is_open.value;
|
|
1617
|
+
};
|
|
1618
|
+
const setTriggerRef = (el) => {
|
|
1619
|
+
trigger_ref.value = el;
|
|
1620
|
+
};
|
|
1621
|
+
const handleClickOutside = (event) => {
|
|
1622
|
+
if (!is_open.value) return;
|
|
1623
|
+
const target = event.target;
|
|
1624
|
+
if (root_ref.value && !root_ref.value.contains(target)) {
|
|
1625
|
+
close();
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
provide(DROPDOWN_MENU_KEY, {
|
|
1629
|
+
is_open,
|
|
1630
|
+
trigger_ref,
|
|
1631
|
+
open,
|
|
1632
|
+
close,
|
|
1633
|
+
toggle,
|
|
1634
|
+
setTriggerRef
|
|
1635
|
+
});
|
|
1636
|
+
onMounted(() => {
|
|
1637
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1638
|
+
});
|
|
1639
|
+
onUnmounted(() => {
|
|
1640
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1641
|
+
});
|
|
1642
|
+
__expose({
|
|
1643
|
+
is_open,
|
|
1644
|
+
open,
|
|
1645
|
+
close,
|
|
1646
|
+
toggle
|
|
1647
|
+
});
|
|
1648
|
+
return (_ctx, _cache) => {
|
|
1649
|
+
return openBlock(), createElementBlock("div", {
|
|
1650
|
+
ref_key: "root_ref",
|
|
1651
|
+
ref: root_ref
|
|
1652
|
+
}, [
|
|
1653
|
+
renderSlot(_ctx.$slots, "default", {
|
|
1654
|
+
is_open: is_open.value,
|
|
1655
|
+
open,
|
|
1656
|
+
close,
|
|
1657
|
+
toggle
|
|
1658
|
+
})
|
|
1659
|
+
], 512);
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
const _hoisted_1$6 = ["aria-expanded"];
|
|
1664
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1665
|
+
...{
|
|
1666
|
+
name: "DropdownMenuTrigger"
|
|
1667
|
+
},
|
|
1668
|
+
__name: "DropdownMenuTrigger",
|
|
1669
|
+
setup(__props) {
|
|
1670
|
+
const DROPDOWN_MENU_KEY = Symbol("dropdown-menu");
|
|
1671
|
+
const trigger_element = ref(null);
|
|
1672
|
+
const context = inject(DROPDOWN_MENU_KEY, null);
|
|
1673
|
+
const is_open = (context == null ? void 0 : context.is_open) ?? ref(false);
|
|
1674
|
+
const toggle = () => {
|
|
1675
|
+
context == null ? void 0 : context.toggle();
|
|
1676
|
+
};
|
|
1677
|
+
onMounted(() => {
|
|
1678
|
+
context == null ? void 0 : context.setTriggerRef(trigger_element.value);
|
|
1679
|
+
});
|
|
1680
|
+
return (_ctx, _cache) => {
|
|
1681
|
+
return openBlock(), createElementBlock("button", {
|
|
1682
|
+
ref_key: "trigger_element",
|
|
1683
|
+
ref: trigger_element,
|
|
1684
|
+
type: "button",
|
|
1685
|
+
"aria-expanded": unref(is_open),
|
|
1686
|
+
"aria-haspopup": "menu",
|
|
1687
|
+
onClick: toggle
|
|
1688
|
+
}, [
|
|
1689
|
+
renderSlot(_ctx.$slots, "default", { is_open: unref(is_open) })
|
|
1690
|
+
], 8, _hoisted_1$6);
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
const _hoisted_1$5 = ["data-side", "data-align"];
|
|
1695
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1696
|
+
...{
|
|
1697
|
+
name: "DropdownMenuContent"
|
|
1698
|
+
},
|
|
1699
|
+
__name: "DropdownMenuContent",
|
|
1700
|
+
props: {
|
|
1701
|
+
side: { default: "bottom" },
|
|
1702
|
+
align: { default: "start" }
|
|
1703
|
+
},
|
|
1704
|
+
setup(__props) {
|
|
1705
|
+
const DROPDOWN_MENU_KEY = Symbol("dropdown-menu");
|
|
1706
|
+
const context = inject(DROPDOWN_MENU_KEY, null);
|
|
1707
|
+
const is_open = context == null ? void 0 : context.is_open;
|
|
1708
|
+
const handleKeyDown = (event) => {
|
|
1709
|
+
var _a;
|
|
1710
|
+
if (event.key === "Escape") {
|
|
1711
|
+
context == null ? void 0 : context.close();
|
|
1712
|
+
(_a = context == null ? void 0 : context.trigger_ref.value) == null ? void 0 : _a.focus();
|
|
1713
|
+
}
|
|
1714
|
+
};
|
|
1715
|
+
return (_ctx, _cache) => {
|
|
1716
|
+
return unref(is_open) ? (openBlock(), createElementBlock("div", {
|
|
1717
|
+
key: 0,
|
|
1718
|
+
role: "menu",
|
|
1719
|
+
tabindex: "-1",
|
|
1720
|
+
"data-side": __props.side,
|
|
1721
|
+
"data-align": __props.align,
|
|
1722
|
+
onKeydown: handleKeyDown
|
|
1723
|
+
}, [
|
|
1724
|
+
renderSlot(_ctx.$slots, "default")
|
|
1725
|
+
], 40, _hoisted_1$5)) : createCommentVNode("", true);
|
|
1726
|
+
};
|
|
1727
|
+
}
|
|
1728
|
+
});
|
|
1729
|
+
const _hoisted_1$4 = ["data-disabled", "onKeydown"];
|
|
1730
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1731
|
+
...{
|
|
1732
|
+
name: "DropdownMenuItem"
|
|
1733
|
+
},
|
|
1734
|
+
__name: "DropdownMenuItem",
|
|
1735
|
+
props: {
|
|
1736
|
+
disabled: { type: Boolean, default: false },
|
|
1737
|
+
closeOnSelect: { type: Boolean, default: true }
|
|
1738
|
+
},
|
|
1739
|
+
emits: ["select"],
|
|
1740
|
+
setup(__props, { emit: __emit }) {
|
|
1741
|
+
const DROPDOWN_MENU_KEY = Symbol("dropdown-menu");
|
|
1742
|
+
const props = __props;
|
|
1743
|
+
const emit = __emit;
|
|
1744
|
+
const context = inject(DROPDOWN_MENU_KEY, null);
|
|
1745
|
+
const handleClick = () => {
|
|
1746
|
+
if (props.disabled) return;
|
|
1747
|
+
emit("select");
|
|
1748
|
+
if (props.closeOnSelect) {
|
|
1749
|
+
context == null ? void 0 : context.close();
|
|
1750
|
+
}
|
|
1751
|
+
};
|
|
1752
|
+
return (_ctx, _cache) => {
|
|
1753
|
+
return openBlock(), createElementBlock("div", {
|
|
1754
|
+
role: "menuitem",
|
|
1755
|
+
tabindex: "0",
|
|
1756
|
+
"data-disabled": __props.disabled ? "" : void 0,
|
|
1757
|
+
onClick: handleClick,
|
|
1758
|
+
onKeydown: [
|
|
1759
|
+
withKeys(handleClick, ["enter"]),
|
|
1760
|
+
withKeys(withModifiers(handleClick, ["prevent"]), ["space"])
|
|
1761
|
+
]
|
|
1762
|
+
}, [
|
|
1763
|
+
renderSlot(_ctx.$slots, "default")
|
|
1764
|
+
], 40, _hoisted_1$4);
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
1768
|
+
const _hoisted_1$3 = { role: "separator" };
|
|
1769
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1770
|
+
...{
|
|
1771
|
+
name: "DropdownMenuSeparator"
|
|
1772
|
+
},
|
|
1773
|
+
__name: "DropdownMenuSeparator",
|
|
1774
|
+
setup(__props) {
|
|
1775
|
+
return (_ctx, _cache) => {
|
|
1776
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3);
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
});
|
|
1780
|
+
const _hoisted_1$2 = { role: "presentation" };
|
|
1781
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1782
|
+
...{
|
|
1783
|
+
name: "DropdownMenuLabel"
|
|
1784
|
+
},
|
|
1785
|
+
__name: "DropdownMenuLabel",
|
|
1786
|
+
setup(__props) {
|
|
1787
|
+
return (_ctx, _cache) => {
|
|
1788
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
1789
|
+
renderSlot(_ctx.$slots, "default")
|
|
1790
|
+
]);
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
const _hoisted_1$1 = ["data-variant", "data-state"];
|
|
1795
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1796
|
+
...{
|
|
1797
|
+
name: "Toast"
|
|
1798
|
+
},
|
|
1799
|
+
__name: "Toast",
|
|
1800
|
+
props: {
|
|
1801
|
+
variant: { default: "default" },
|
|
1802
|
+
duration: { default: 5e3 },
|
|
1803
|
+
closable: { type: Boolean, default: true }
|
|
1804
|
+
},
|
|
1805
|
+
emits: ["close"],
|
|
1806
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1807
|
+
const props = __props;
|
|
1808
|
+
const emit = __emit;
|
|
1809
|
+
const is_visible = ref(true);
|
|
1810
|
+
let timeout_id = null;
|
|
1811
|
+
const close = () => {
|
|
1812
|
+
is_visible.value = false;
|
|
1813
|
+
emit("close");
|
|
1814
|
+
};
|
|
1815
|
+
onMounted(() => {
|
|
1816
|
+
if (props.duration > 0) {
|
|
1817
|
+
timeout_id = setTimeout(close, props.duration);
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1820
|
+
onUnmounted(() => {
|
|
1821
|
+
if (timeout_id) {
|
|
1822
|
+
clearTimeout(timeout_id);
|
|
1823
|
+
}
|
|
1824
|
+
});
|
|
1825
|
+
__expose({
|
|
1826
|
+
close
|
|
1827
|
+
});
|
|
1828
|
+
return (_ctx, _cache) => {
|
|
1829
|
+
return openBlock(), createElementBlock("div", {
|
|
1830
|
+
role: "alert",
|
|
1831
|
+
"aria-live": "assertive",
|
|
1832
|
+
"aria-atomic": "true",
|
|
1833
|
+
"data-variant": __props.variant,
|
|
1834
|
+
"data-state": is_visible.value ? "open" : "closed"
|
|
1835
|
+
}, [
|
|
1836
|
+
renderSlot(_ctx.$slots, "default", { close })
|
|
1837
|
+
], 8, _hoisted_1$1);
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
});
|
|
1841
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1842
|
+
...{
|
|
1843
|
+
name: "ToastTitle"
|
|
1844
|
+
},
|
|
1845
|
+
__name: "ToastTitle",
|
|
1846
|
+
setup(__props) {
|
|
1847
|
+
return (_ctx, _cache) => {
|
|
1848
|
+
return openBlock(), createElementBlock("div", null, [
|
|
1849
|
+
renderSlot(_ctx.$slots, "default")
|
|
1850
|
+
]);
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
});
|
|
1854
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1855
|
+
...{
|
|
1856
|
+
name: "ToastDescription"
|
|
1857
|
+
},
|
|
1858
|
+
__name: "ToastDescription",
|
|
1859
|
+
setup(__props) {
|
|
1860
|
+
return (_ctx, _cache) => {
|
|
1861
|
+
return openBlock(), createElementBlock("div", null, [
|
|
1862
|
+
renderSlot(_ctx.$slots, "default")
|
|
1863
|
+
]);
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
});
|
|
1867
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1868
|
+
...{
|
|
1869
|
+
name: "ToastClose"
|
|
1870
|
+
},
|
|
1871
|
+
__name: "ToastClose",
|
|
1872
|
+
emits: ["click"],
|
|
1873
|
+
setup(__props) {
|
|
1874
|
+
return (_ctx, _cache) => {
|
|
1875
|
+
return openBlock(), createElementBlock("button", {
|
|
1876
|
+
type: "button",
|
|
1877
|
+
"aria-label": "Close",
|
|
1878
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click"))
|
|
1879
|
+
}, [
|
|
1880
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1881
|
+
_cache[1] || (_cache[1] = createTextVNode(" × ", -1))
|
|
1882
|
+
])
|
|
1883
|
+
]);
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
});
|
|
1887
|
+
const _hoisted_1 = ["data-position"];
|
|
1888
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1889
|
+
...{
|
|
1890
|
+
name: "Toaster"
|
|
1891
|
+
},
|
|
1892
|
+
__name: "Toaster",
|
|
1893
|
+
props: {
|
|
1894
|
+
position: { default: "bottom-right" },
|
|
1895
|
+
maxToasts: { default: 5 }
|
|
1896
|
+
},
|
|
1897
|
+
setup(__props, { expose: __expose }) {
|
|
1898
|
+
const props = __props;
|
|
1899
|
+
const toasts = ref([]);
|
|
1900
|
+
const add = (toast) => {
|
|
1901
|
+
const id = `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
1902
|
+
const new_toast = { ...toast, id };
|
|
1903
|
+
toasts.value = [...toasts.value, new_toast].slice(-props.maxToasts);
|
|
1904
|
+
if (toast.duration !== 0) {
|
|
1905
|
+
const duration = toast.duration ?? 5e3;
|
|
1906
|
+
setTimeout(() => dismiss(id), duration);
|
|
1907
|
+
}
|
|
1908
|
+
return id;
|
|
1909
|
+
};
|
|
1910
|
+
const dismiss = (id) => {
|
|
1911
|
+
toasts.value = toasts.value.filter((t3) => t3.id !== id);
|
|
1912
|
+
};
|
|
1913
|
+
const dismissAll = () => {
|
|
1914
|
+
toasts.value = [];
|
|
1915
|
+
};
|
|
1916
|
+
const handleToastEvent = (event) => {
|
|
1917
|
+
add(event.detail);
|
|
1918
|
+
};
|
|
1919
|
+
onMounted(() => {
|
|
1920
|
+
window.addEventListener("soave:toast", handleToastEvent);
|
|
1921
|
+
});
|
|
1922
|
+
onUnmounted(() => {
|
|
1923
|
+
window.removeEventListener("soave:toast", handleToastEvent);
|
|
1924
|
+
});
|
|
1925
|
+
__expose({
|
|
1926
|
+
toasts,
|
|
1927
|
+
add,
|
|
1928
|
+
dismiss,
|
|
1929
|
+
dismissAll
|
|
1930
|
+
});
|
|
1931
|
+
return (_ctx, _cache) => {
|
|
1932
|
+
return openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
1933
|
+
createElementVNode("div", {
|
|
1934
|
+
"data-position": __props.position,
|
|
1935
|
+
"aria-live": "polite",
|
|
1936
|
+
"aria-label": "Notifications"
|
|
1937
|
+
}, [
|
|
1938
|
+
renderSlot(_ctx.$slots, "default", {
|
|
1939
|
+
toasts: toasts.value,
|
|
1940
|
+
dismiss
|
|
1941
|
+
})
|
|
1942
|
+
], 8, _hoisted_1)
|
|
1943
|
+
]);
|
|
643
1944
|
};
|
|
644
1945
|
}
|
|
645
1946
|
});
|
|
@@ -692,36 +1993,84 @@ const DEFAULT_DARK_COLORS = {
|
|
|
692
1993
|
};
|
|
693
1994
|
export {
|
|
694
1995
|
ADAPTER_REGISTRY,
|
|
695
|
-
_sfc_main$
|
|
1996
|
+
_sfc_main$P as Alert,
|
|
1997
|
+
_sfc_main$N as AlertDescription,
|
|
1998
|
+
_sfc_main$O as AlertTitle,
|
|
1999
|
+
_sfc_main$Y as Button,
|
|
696
2000
|
C as COMPONENT_ERRORS,
|
|
697
2001
|
COMPONENT_LOGS,
|
|
698
2002
|
CONFIG_LOGS,
|
|
699
|
-
_sfc_main$
|
|
700
|
-
_sfc_main$
|
|
2003
|
+
_sfc_main$V as Card,
|
|
2004
|
+
_sfc_main$R as CardContent,
|
|
2005
|
+
_sfc_main$S as CardDescription,
|
|
2006
|
+
_sfc_main$Q as CardFooter,
|
|
2007
|
+
_sfc_main$U as CardHeader,
|
|
2008
|
+
_sfc_main$T as CardTitle,
|
|
2009
|
+
_sfc_main$M as Checkbox,
|
|
701
2010
|
DEFAULT_DARK_COLORS,
|
|
702
2011
|
DEFAULT_LIGHT_COLORS,
|
|
703
2012
|
D as DEFAULT_UI_CONFIG,
|
|
704
2013
|
A as DIALOG_ERRORS,
|
|
705
2014
|
DIALOG_KEY,
|
|
706
2015
|
DROPDOWN_CONTEXT_KEY,
|
|
707
|
-
_sfc_main$
|
|
2016
|
+
_sfc_main$K as Dialog,
|
|
2017
|
+
_sfc_main$H as DialogContent,
|
|
2018
|
+
_sfc_main$E as DialogDescription,
|
|
2019
|
+
_sfc_main$D as DialogFooter,
|
|
2020
|
+
_sfc_main$G as DialogHeader,
|
|
2021
|
+
_sfc_main$I as DialogOverlay,
|
|
2022
|
+
_sfc_main$F as DialogTitle,
|
|
2023
|
+
_sfc_main$J as DialogTrigger,
|
|
2024
|
+
_sfc_main$a as DropdownMenu,
|
|
2025
|
+
_sfc_main$8 as DropdownMenuContent,
|
|
2026
|
+
_sfc_main$7 as DropdownMenuItem,
|
|
2027
|
+
_sfc_main$5 as DropdownMenuLabel,
|
|
2028
|
+
_sfc_main$6 as DropdownMenuSeparator,
|
|
2029
|
+
_sfc_main$9 as DropdownMenuTrigger,
|
|
708
2030
|
F as FORM_ERRORS,
|
|
709
2031
|
FORM_LOGS,
|
|
2032
|
+
_sfc_main$q as FileInput,
|
|
2033
|
+
_sfc_main$r as FormError,
|
|
2034
|
+
_sfc_main$v as FormField,
|
|
2035
|
+
_sfc_main$t as FormInput,
|
|
2036
|
+
_sfc_main$u as FormLabel,
|
|
2037
|
+
_sfc_main$s as FormTextarea,
|
|
710
2038
|
I as INPUT_ERRORS,
|
|
711
|
-
_sfc_main$
|
|
2039
|
+
_sfc_main$X as Input,
|
|
712
2040
|
POPOVER_CONTEXT_KEY,
|
|
2041
|
+
_sfc_main$g as Popover,
|
|
2042
|
+
_sfc_main$e as PopoverContent,
|
|
2043
|
+
_sfc_main$f as PopoverTrigger,
|
|
713
2044
|
R as RADIO_GROUP_KEY,
|
|
714
|
-
_sfc_main$
|
|
715
|
-
_sfc_main as RadioItem,
|
|
2045
|
+
_sfc_main$x as RadioGroup,
|
|
2046
|
+
_sfc_main$w as RadioItem,
|
|
716
2047
|
S as SELECT_KEY,
|
|
717
2048
|
SHEET_CONTEXT_KEY,
|
|
718
|
-
_sfc_main$
|
|
719
|
-
_sfc_main$
|
|
720
|
-
_sfc_main$
|
|
721
|
-
_sfc_main$
|
|
722
|
-
_sfc_main$
|
|
2049
|
+
_sfc_main$C as Select,
|
|
2050
|
+
_sfc_main$z as SelectContent,
|
|
2051
|
+
_sfc_main$y as SelectItem,
|
|
2052
|
+
_sfc_main$B as SelectTrigger,
|
|
2053
|
+
_sfc_main$A as SelectValue,
|
|
2054
|
+
_sfc_main$p as Sheet,
|
|
2055
|
+
_sfc_main$h as SheetClose,
|
|
2056
|
+
_sfc_main$m as SheetContent,
|
|
2057
|
+
_sfc_main$j as SheetDescription,
|
|
2058
|
+
_sfc_main$i as SheetFooter,
|
|
2059
|
+
_sfc_main$l as SheetHeader,
|
|
2060
|
+
_sfc_main$n as SheetOverlay,
|
|
2061
|
+
_sfc_main$k as SheetTitle,
|
|
2062
|
+
_sfc_main$o as SheetTrigger,
|
|
2063
|
+
_sfc_main$L as Switch,
|
|
723
2064
|
TOOLTIP_CONTEXT_KEY,
|
|
724
|
-
_sfc_main$
|
|
2065
|
+
_sfc_main$W as Textarea,
|
|
2066
|
+
_sfc_main$4 as Toast,
|
|
2067
|
+
_sfc_main$1 as ToastClose,
|
|
2068
|
+
_sfc_main$2 as ToastDescription,
|
|
2069
|
+
_sfc_main$3 as ToastTitle,
|
|
2070
|
+
_sfc_main as Toaster,
|
|
2071
|
+
_sfc_main$d as Tooltip,
|
|
2072
|
+
_sfc_main$b as TooltipContent,
|
|
2073
|
+
_sfc_main$c as TooltipTrigger,
|
|
725
2074
|
i as UI_CONFIG_KEY,
|
|
726
2075
|
U as UI_PROVIDER_KEY,
|
|
727
2076
|
c as cn,
|