@typlog/ui 0.15.0 → 0.16.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/addons.css +33 -29
- package/addons.d.ts +8 -4
- package/addons.js +58 -38
- package/charts.d.ts +2 -2
- package/index.css +13652 -2
- package/{components.d.ts → index.d.ts} +659 -301
- package/{components.js → index.js} +1106 -157
- package/package.json +8 -15
- package/base.css +0 -6753
- package/components.css +0 -5410
- package/tailwind.css +0 -1111
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as useForwardPropsEmitsWithout, r as useForwardPropsWithout, t as buildPropsClass } from "./util-lkbchXvM.js";
|
|
2
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, effectScope, guardReactiveProps, isRef, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, toDisplayString, toRef, toRefs, unref, useAttrs, useId, useModel, useTemplateRef, vModelDynamic, vModelRadio, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
3
|
-
import { AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogOverlay, AlertDialogPortal, AlertDialogRoot, AlertDialogTrigger, AvatarFallback, AvatarImage, AvatarRoot, CheckboxGroupRoot
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, effectScope, getCurrentInstance, guardReactiveProps, isRef, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowReactive, toDisplayString, toRef, toRefs, unref, useAttrs, useId, useModel, useTemplateRef, vModelDynamic, vModelRadio, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
3
|
+
import { AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogOverlay, AlertDialogPortal, AlertDialogRoot, AlertDialogTrigger, AvatarFallback, AvatarImage, AvatarRoot, CheckboxGroupRoot, CheckboxIndicator, CheckboxRoot, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, ComboboxAnchor, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxPortal, ComboboxRoot, ComboboxTrigger, ComboboxViewport, DialogClose, DialogClose as DialogClose$1, DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTrigger, DrawerClose, DrawerClose as DrawerClose$1, DrawerContent, DrawerDescription, DrawerHandle, DrawerIndent, DrawerIndentBackground, DrawerOverlay, DrawerPortal, DrawerProvider, DrawerRoot, DrawerSwipeArea, DrawerTitle, DrawerTrigger, DrawerViewport, DropdownMenuContent, DropdownMenuItem, DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger, EditableArea, EditableInput, EditablePreview, EditableRoot, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, PaginationEllipsis, PaginationFirst, PaginationLast, PaginationList, PaginationListItem, PaginationNext, PaginationPrev, PaginationRoot, PinInputInput, PinInputRoot, PopoverClose, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Primitive, ProgressIndicator, ProgressRoot, RadioGroupItem, RadioGroupRoot, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, SelectContent, SelectGroup, SelectItem, SelectItemIndicator, SelectItemText, SelectLabel, SelectPortal, SelectRoot, SelectTrigger, SelectValue, SelectViewport, SwitchRoot, SwitchThumb, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger, ToastAction, ToastDescription, ToastPortal, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroupItem, ToggleGroupRoot, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TreeItem, TreeRoot, TreeVirtualizer, createContext, injectComboboxRootContext, injectDialogRootContext, injectDrawerRootContext, injectPaginationRootContext, injectTreeRootContext, useForwardExpose, useForwardProps, useForwardPropsEmits, useId as useId$1 } from "reka-ui";
|
|
4
4
|
import { Icon } from "@iconify/vue";
|
|
5
5
|
//#region src/components/provider/ThemeProvider.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var [injectThemeContext, provideThemeContext] = createContext("ThemeProvider");
|
|
@@ -36,7 +36,7 @@ var ThemeProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
return (_ctx, _cache) => {
|
|
37
37
|
return openBlock(), createBlock(unref(TooltipProvider), null, {
|
|
38
38
|
default: withCtx(() => [createVNode(unref(Primitive), mergeProps({
|
|
39
|
-
class: "ui-root",
|
|
39
|
+
class: "ui-root ui-theme",
|
|
40
40
|
"data-accent-color": unref(accentColor),
|
|
41
41
|
"data-gray-color": unref(grayColor),
|
|
42
42
|
"data-radius": unref(radius),
|
|
@@ -65,13 +65,13 @@ var ThemeProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
});
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region ~icons/ri/user-line
|
|
68
|
-
var _hoisted_1$
|
|
68
|
+
var _hoisted_1$39 = {
|
|
69
69
|
viewBox: "0 0 24 24",
|
|
70
70
|
width: "1em",
|
|
71
71
|
height: "1em"
|
|
72
72
|
};
|
|
73
73
|
function render$15(_ctx, _cache) {
|
|
74
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
74
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$39, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
75
75
|
fill: "currentColor",
|
|
76
76
|
d: "M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"
|
|
77
77
|
}, null, -1)])]);
|
|
@@ -305,13 +305,13 @@ var IconButton_default = /* @__PURE__ */ defineComponent({
|
|
|
305
305
|
});
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region ~icons/radix-icons/cross-2
|
|
308
|
-
var _hoisted_1$
|
|
308
|
+
var _hoisted_1$38 = {
|
|
309
309
|
viewBox: "0 0 15 15",
|
|
310
310
|
width: "1em",
|
|
311
311
|
height: "1em"
|
|
312
312
|
};
|
|
313
313
|
function render$14(_ctx, _cache) {
|
|
314
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
314
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$38, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
315
315
|
fill: "currentColor",
|
|
316
316
|
d: "M10.969 3.219a.574.574 0 1 1 .812.812L8.313 7.5l3.468 3.469l.074.09a.575.575 0 0 1-.796.796l-.09-.074L7.5 8.312l-3.469 3.47a.574.574 0 1 1-.812-.813L6.688 7.5l-3.47-3.469l-.073-.09a.575.575 0 0 1 .796-.797l.09.075L7.5 6.687z"
|
|
317
317
|
}, null, -1)])]);
|
|
@@ -736,7 +736,7 @@ var TreeRoot_default = /* @__PURE__ */ defineComponent({
|
|
|
736
736
|
});
|
|
737
737
|
//#endregion
|
|
738
738
|
//#region src/components/tree/TreeItemIndicator.vue?vue&type=script&setup=true&lang.ts
|
|
739
|
-
var _hoisted_1$
|
|
739
|
+
var _hoisted_1$37 = [
|
|
740
740
|
"data-expanded",
|
|
741
741
|
"data-has-children",
|
|
742
742
|
"data-disabled"
|
|
@@ -772,13 +772,13 @@ var TreeItemIndicator_default = /* @__PURE__ */ defineComponent({
|
|
|
772
772
|
class: "ui-TreeItemIndicatorGraphic",
|
|
773
773
|
icon: "lucide:chevron-right",
|
|
774
774
|
"aria-hidden": "true"
|
|
775
|
-
})])], 8, _hoisted_1$
|
|
775
|
+
})])], 8, _hoisted_1$37);
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
778
|
});
|
|
779
779
|
//#endregion
|
|
780
780
|
//#region src/components/tree/TreeItem.vue?vue&type=script&setup=true&lang.ts
|
|
781
|
-
var _hoisted_1$
|
|
781
|
+
var _hoisted_1$36 = { class: "ui-TreeItemRow" };
|
|
782
782
|
var _hoisted_2$8 = { class: "ui-TreeItemTarget" };
|
|
783
783
|
var _hoisted_3$2 = {
|
|
784
784
|
key: 0,
|
|
@@ -792,7 +792,6 @@ var _hoisted_5$1 = {
|
|
|
792
792
|
//#endregion
|
|
793
793
|
//#region src/components/tree/TreeItem.vue
|
|
794
794
|
var TreeItem_default = /* @__PURE__ */ defineComponent({
|
|
795
|
-
inheritAttrs: false,
|
|
796
795
|
__name: "TreeItem",
|
|
797
796
|
props: {
|
|
798
797
|
hasChildren: {
|
|
@@ -830,17 +829,14 @@ var TreeItem_default = /* @__PURE__ */ defineComponent({
|
|
|
830
829
|
};
|
|
831
830
|
}
|
|
832
831
|
return (_ctx, _cache) => {
|
|
833
|
-
return openBlock(), createBlock(unref(TreeItem), mergeProps({
|
|
834
|
-
..._ctx.$attrs,
|
|
835
|
-
...unref(forwarded)
|
|
836
|
-
}, {
|
|
832
|
+
return openBlock(), createBlock(unref(TreeItem), mergeProps(unref(forwarded), {
|
|
837
833
|
value: props.value,
|
|
838
834
|
level: props.level,
|
|
839
835
|
class: ["ui-TreeItem", unref(context).highContrast.value ? "r-high-contrast" : void 0],
|
|
840
836
|
"data-accent-color": unref(context).color.value,
|
|
841
837
|
style: { "--tree-item-level": props.level }
|
|
842
838
|
}), {
|
|
843
|
-
default: withCtx((state) => [createElementVNode("div", _hoisted_1$
|
|
839
|
+
default: withCtx((state) => [createElementVNode("div", _hoisted_1$36, [
|
|
844
840
|
createVNode(TreeItemIndicator_default, {
|
|
845
841
|
class: "ui-TreeItemIndicator",
|
|
846
842
|
expanded: state.isExpanded,
|
|
@@ -891,7 +887,7 @@ var ThemeWrapper_default = /* @__PURE__ */ defineComponent({
|
|
|
891
887
|
const theme = injectThemeContext();
|
|
892
888
|
return (_ctx, _cache) => {
|
|
893
889
|
return openBlock(), createBlock(unref(Primitive), {
|
|
894
|
-
class: "ui-
|
|
890
|
+
class: "ui-theme",
|
|
895
891
|
"data-accent-color": props.accentColor || unref(theme).accentColor.value,
|
|
896
892
|
"data-gray-color": unref(theme).grayColor.value,
|
|
897
893
|
"data-radius": props.radius || unref(theme).radius.value,
|
|
@@ -911,7 +907,7 @@ var ThemeWrapper_default = /* @__PURE__ */ defineComponent({
|
|
|
911
907
|
});
|
|
912
908
|
//#endregion
|
|
913
909
|
//#region src/components/tooltip/Tooltip.vue?vue&type=script&setup=true&lang.ts
|
|
914
|
-
var _hoisted_1$
|
|
910
|
+
var _hoisted_1$35 = ["textContent"];
|
|
915
911
|
//#endregion
|
|
916
912
|
//#region src/components/tooltip/Tooltip.vue
|
|
917
913
|
var Tooltip_default = /* @__PURE__ */ defineComponent({
|
|
@@ -986,7 +982,7 @@ var Tooltip_default = /* @__PURE__ */ defineComponent({
|
|
|
986
982
|
default: withCtx(() => [renderSlot(_ctx.$slots, "content", {}, () => [createElementVNode("p", {
|
|
987
983
|
class: "ui-TooltipText",
|
|
988
984
|
textContent: toDisplayString(props.content)
|
|
989
|
-
}, null, 8, _hoisted_1$
|
|
985
|
+
}, null, 8, _hoisted_1$35)]), createVNode(unref(TooltipArrow), { class: "ui-TooltipArrow" })]),
|
|
990
986
|
_: 3
|
|
991
987
|
}, 8, [
|
|
992
988
|
"align",
|
|
@@ -1157,7 +1153,7 @@ var DialogPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
1157
1153
|
});
|
|
1158
1154
|
//#endregion
|
|
1159
1155
|
//#region src/components/dialog/AlertDialogPopup.vue?vue&type=script&setup=true&lang.ts
|
|
1160
|
-
var _hoisted_1$
|
|
1156
|
+
var _hoisted_1$34 = { class: "ui-DialogWrapper" };
|
|
1161
1157
|
var _hoisted_2$7 = { class: "ui-DialogContainer" };
|
|
1162
1158
|
//#endregion
|
|
1163
1159
|
//#region src/components/dialog/AlertDialogPopup.vue
|
|
@@ -1184,7 +1180,7 @@ var AlertDialogPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
1184
1180
|
return openBlock(), createBlock(unref(AlertDialogPortal), null, {
|
|
1185
1181
|
default: withCtx(() => [createVNode(ThemeWrapper_default, null, {
|
|
1186
1182
|
default: withCtx(() => [createVNode(unref(AlertDialogOverlay), { class: "ui-DialogOverlay" }, {
|
|
1187
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1$
|
|
1183
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$34, [createElementVNode("div", _hoisted_2$7, [createVNode(unref(AlertDialogContent), mergeProps({ class: "ui-DialogPopup ui-AlertPopup r-size-3" }, {
|
|
1188
1184
|
..._ctx.$attrs,
|
|
1189
1185
|
...unref(forwarded)
|
|
1190
1186
|
}), {
|
|
@@ -1201,8 +1197,200 @@ var AlertDialogPopup_default = /* @__PURE__ */ defineComponent({
|
|
|
1201
1197
|
}
|
|
1202
1198
|
});
|
|
1203
1199
|
//#endregion
|
|
1200
|
+
//#region src/components/drawer/DrawerCloseButton.vue
|
|
1201
|
+
var DrawerCloseButton_default = /* @__PURE__ */ defineComponent({
|
|
1202
|
+
__name: "DrawerCloseButton",
|
|
1203
|
+
props: {
|
|
1204
|
+
tooltip: { default: "Close" },
|
|
1205
|
+
variant: { default: "ghost" },
|
|
1206
|
+
color: { default: "gray" },
|
|
1207
|
+
radius: {},
|
|
1208
|
+
size: { default: "2" },
|
|
1209
|
+
highContrast: {
|
|
1210
|
+
type: Boolean,
|
|
1211
|
+
default: false
|
|
1212
|
+
},
|
|
1213
|
+
disabled: { type: Boolean },
|
|
1214
|
+
as: { default: "button" },
|
|
1215
|
+
asChild: { type: Boolean }
|
|
1216
|
+
},
|
|
1217
|
+
setup(__props) {
|
|
1218
|
+
const props = __props;
|
|
1219
|
+
const forwarded = useForwardPropsWithout(props, ["tooltip"]);
|
|
1220
|
+
return (_ctx, _cache) => {
|
|
1221
|
+
return openBlock(), createBlock(Tooltip_default, {
|
|
1222
|
+
content: props.tooltip,
|
|
1223
|
+
"as-child": ""
|
|
1224
|
+
}, {
|
|
1225
|
+
default: withCtx(() => [createVNode(unref(DrawerClose$1), {
|
|
1226
|
+
class: "ui-DrawerCloseButton",
|
|
1227
|
+
"as-child": ""
|
|
1228
|
+
}, {
|
|
1229
|
+
default: withCtx(() => [createVNode(IconButton_default, normalizeProps(guardReactiveProps(unref(forwarded))), {
|
|
1230
|
+
default: withCtx(() => [createVNode(unref(cross_2_default))]),
|
|
1231
|
+
_: 1
|
|
1232
|
+
}, 16)]),
|
|
1233
|
+
_: 1
|
|
1234
|
+
})]),
|
|
1235
|
+
_: 1
|
|
1236
|
+
}, 8, ["content"]);
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
//#endregion
|
|
1241
|
+
//#region src/components/drawer/DrawerDescription.vue
|
|
1242
|
+
var DrawerDescription_default = /* @__PURE__ */ defineComponent({
|
|
1243
|
+
__name: "DrawerDescription",
|
|
1244
|
+
props: {
|
|
1245
|
+
asChild: { type: Boolean },
|
|
1246
|
+
as: { default: "p" }
|
|
1247
|
+
},
|
|
1248
|
+
setup(__props) {
|
|
1249
|
+
const props = __props;
|
|
1250
|
+
const rootContext = injectDrawerRootContext();
|
|
1251
|
+
useForwardExpose();
|
|
1252
|
+
return (_ctx, _cache) => {
|
|
1253
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
|
|
1254
|
+
id: unref(rootContext).descriptionId,
|
|
1255
|
+
class: "ui-DrawerDescription"
|
|
1256
|
+
}), {
|
|
1257
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1258
|
+
_: 3
|
|
1259
|
+
}, 16, ["id"]);
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
//#endregion
|
|
1264
|
+
//#region src/components/drawer/DrawerHandle.vue
|
|
1265
|
+
var DrawerHandle_default = /* @__PURE__ */ defineComponent({
|
|
1266
|
+
__name: "DrawerHandle",
|
|
1267
|
+
props: {
|
|
1268
|
+
asChild: { type: Boolean },
|
|
1269
|
+
as: {}
|
|
1270
|
+
},
|
|
1271
|
+
setup(__props) {
|
|
1272
|
+
const props = __props;
|
|
1273
|
+
return (_ctx, _cache) => {
|
|
1274
|
+
return openBlock(), createBlock(unref(DrawerHandle), mergeProps(props, { class: "ui-DrawerHandle" }), {
|
|
1275
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1276
|
+
_: 3
|
|
1277
|
+
}, 16);
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1281
|
+
//#endregion
|
|
1282
|
+
//#region src/components/drawer/DrawerPopup.vue
|
|
1283
|
+
var DrawerPopup_default = /* @__PURE__ */ defineComponent({
|
|
1284
|
+
inheritAttrs: false,
|
|
1285
|
+
__name: "DrawerPopup",
|
|
1286
|
+
props: {
|
|
1287
|
+
size: { default: "2" },
|
|
1288
|
+
showHandle: {
|
|
1289
|
+
type: Boolean,
|
|
1290
|
+
default: true
|
|
1291
|
+
},
|
|
1292
|
+
ui: {},
|
|
1293
|
+
forceMount: { type: Boolean },
|
|
1294
|
+
initialFocus: { type: [Boolean, null] },
|
|
1295
|
+
finalFocus: { type: [Boolean, null] },
|
|
1296
|
+
disableOutsidePointerEvents: { type: Boolean },
|
|
1297
|
+
asChild: { type: Boolean },
|
|
1298
|
+
as: {}
|
|
1299
|
+
},
|
|
1300
|
+
emits: [
|
|
1301
|
+
"escapeKeyDown",
|
|
1302
|
+
"pointerDownOutside",
|
|
1303
|
+
"focusOutside",
|
|
1304
|
+
"interactOutside",
|
|
1305
|
+
"openAutoFocus",
|
|
1306
|
+
"closeAutoFocus"
|
|
1307
|
+
],
|
|
1308
|
+
setup(__props, { emit: __emit }) {
|
|
1309
|
+
const props = __props;
|
|
1310
|
+
const forwarded = useForwardPropsEmitsWithout(props, __emit, [
|
|
1311
|
+
"size",
|
|
1312
|
+
"showHandle",
|
|
1313
|
+
"ui",
|
|
1314
|
+
"class"
|
|
1315
|
+
]);
|
|
1316
|
+
return (_ctx, _cache) => {
|
|
1317
|
+
return openBlock(), createBlock(unref(DrawerPortal), null, {
|
|
1318
|
+
default: withCtx(() => [createVNode(ThemeWrapper_default, null, {
|
|
1319
|
+
default: withCtx(() => [createVNode(unref(DrawerViewport), { class: normalizeClass(["ui-DrawerViewport", props.ui?.viewport]) }, {
|
|
1320
|
+
default: withCtx(() => [createVNode(unref(DrawerOverlay), { class: normalizeClass(["ui-DrawerOverlay", props.ui?.overlay]) }, null, 8, ["class"]), createVNode(unref(DrawerContent), mergeProps({ class: ["ui-DrawerPopup ui-DrawerMotion", [`r-size-${props.size}`, props.ui?.content]] }, {
|
|
1321
|
+
..._ctx.$attrs,
|
|
1322
|
+
...unref(forwarded)
|
|
1323
|
+
}), {
|
|
1324
|
+
default: withCtx(() => [props.showHandle ? (openBlock(), createBlock(DrawerHandle_default, {
|
|
1325
|
+
key: 0,
|
|
1326
|
+
class: normalizeClass(props.ui?.handle)
|
|
1327
|
+
}, null, 8, ["class"])) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
|
|
1328
|
+
_: 3
|
|
1329
|
+
}, 16, ["class"])]),
|
|
1330
|
+
_: 3
|
|
1331
|
+
}, 8, ["class"])]),
|
|
1332
|
+
_: 3
|
|
1333
|
+
})]),
|
|
1334
|
+
_: 3
|
|
1335
|
+
});
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region src/components/drawer/DrawerRoot.vue
|
|
1341
|
+
var DrawerRoot_default = /* @__PURE__ */ defineComponent({
|
|
1342
|
+
__name: "DrawerRoot",
|
|
1343
|
+
props: {
|
|
1344
|
+
open: { type: Boolean },
|
|
1345
|
+
defaultOpen: { type: Boolean },
|
|
1346
|
+
modal: { type: [Boolean, String] },
|
|
1347
|
+
swipeDirection: {},
|
|
1348
|
+
snapPoints: {},
|
|
1349
|
+
snapPoint: {},
|
|
1350
|
+
defaultSnapPoint: {},
|
|
1351
|
+
snapToSequentialPoints: { type: Boolean }
|
|
1352
|
+
},
|
|
1353
|
+
emits: [
|
|
1354
|
+
"update:open",
|
|
1355
|
+
"update:openComplete",
|
|
1356
|
+
"update:snapPoint"
|
|
1357
|
+
],
|
|
1358
|
+
setup(__props, { emit: __emit }) {
|
|
1359
|
+
const forwarded = useForwardPropsEmitsWithout(__props, __emit, []);
|
|
1360
|
+
return (_ctx, _cache) => {
|
|
1361
|
+
return openBlock(), createBlock(unref(DrawerRoot), normalizeProps(guardReactiveProps(unref(forwarded))), {
|
|
1362
|
+
default: withCtx((slotProps) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
1363
|
+
_: 3
|
|
1364
|
+
}, 16);
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region src/components/drawer/DrawerTitle.vue
|
|
1370
|
+
var DrawerTitle_default = /* @__PURE__ */ defineComponent({
|
|
1371
|
+
__name: "DrawerTitle",
|
|
1372
|
+
props: {
|
|
1373
|
+
asChild: { type: Boolean },
|
|
1374
|
+
as: { default: "h2" }
|
|
1375
|
+
},
|
|
1376
|
+
setup(__props) {
|
|
1377
|
+
const props = __props;
|
|
1378
|
+
const rootContext = injectDrawerRootContext();
|
|
1379
|
+
useForwardExpose();
|
|
1380
|
+
return (_ctx, _cache) => {
|
|
1381
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
|
|
1382
|
+
id: unref(rootContext).titleId,
|
|
1383
|
+
class: "ui-DrawerTitle"
|
|
1384
|
+
}), {
|
|
1385
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1386
|
+
_: 3
|
|
1387
|
+
}, 16, ["id"]);
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
});
|
|
1391
|
+
//#endregion
|
|
1204
1392
|
//#region src/components/dropdown/DropdownMenuContent.vue?vue&type=script&setup=true&lang.ts
|
|
1205
|
-
var _hoisted_1$
|
|
1393
|
+
var _hoisted_1$33 = { class: "ui-MenuViewport" };
|
|
1206
1394
|
var [injectDropdownMenuContentContext, provideDropdownMenuContentContext] = createContext("ui:DropdownMenuContent");
|
|
1207
1395
|
//#endregion
|
|
1208
1396
|
//#region src/components/dropdown/DropdownMenuContent.vue
|
|
@@ -1279,7 +1467,7 @@ var DropdownMenuContent_default = /* @__PURE__ */ defineComponent({
|
|
|
1279
1467
|
class: ["ui-PopperContent ui-MenuContent", unref(resetClass)]
|
|
1280
1468
|
}), {
|
|
1281
1469
|
default: withCtx(() => [createVNode(ScrollArea_default, { type: "auto" }, {
|
|
1282
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_1$
|
|
1470
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$33, [renderSlot(_ctx.$slots, "default")])]),
|
|
1283
1471
|
_: 3
|
|
1284
1472
|
})]),
|
|
1285
1473
|
_: 3
|
|
@@ -1293,7 +1481,7 @@ var DropdownMenuContent_default = /* @__PURE__ */ defineComponent({
|
|
|
1293
1481
|
});
|
|
1294
1482
|
//#endregion
|
|
1295
1483
|
//#region src/components/dropdown/DropdownMenuItem.vue?vue&type=script&setup=true&lang.ts
|
|
1296
|
-
var _hoisted_1$
|
|
1484
|
+
var _hoisted_1$32 = ["textContent"];
|
|
1297
1485
|
//#endregion
|
|
1298
1486
|
//#region src/components/dropdown/DropdownMenuItem.vue
|
|
1299
1487
|
var DropdownMenuItem_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1322,7 +1510,7 @@ var DropdownMenuItem_default = /* @__PURE__ */ defineComponent({
|
|
|
1322
1510
|
key: 0,
|
|
1323
1511
|
class: "ui-MenuShortcut",
|
|
1324
1512
|
textContent: toDisplayString(props.shortcut)
|
|
1325
|
-
}, null, 8, _hoisted_1$
|
|
1513
|
+
}, null, 8, _hoisted_1$32)) : createCommentVNode("", true)]),
|
|
1326
1514
|
_: 3
|
|
1327
1515
|
}, 16, ["data-accent-color", "data-high-contrast"]);
|
|
1328
1516
|
};
|
|
@@ -1338,12 +1526,12 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
1338
1526
|
//#endregion
|
|
1339
1527
|
//#region src/components/dropdown/DropdownMenuSeparator.vue
|
|
1340
1528
|
var _sfc_main$2 = {};
|
|
1341
|
-
var _hoisted_1$
|
|
1529
|
+
var _hoisted_1$31 = {
|
|
1342
1530
|
class: "ui-DropdownMenuSeparator",
|
|
1343
1531
|
"aria-hidden": "true"
|
|
1344
1532
|
};
|
|
1345
1533
|
function _sfc_render$2(_ctx, _cache) {
|
|
1346
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1534
|
+
return openBlock(), createElementBlock("div", _hoisted_1$31);
|
|
1347
1535
|
}
|
|
1348
1536
|
var DropdownMenuSeparator_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
1349
1537
|
//#endregion
|
|
@@ -1514,13 +1702,13 @@ var NavigationMenuLink_default = /* @__PURE__ */ defineComponent({
|
|
|
1514
1702
|
});
|
|
1515
1703
|
//#endregion
|
|
1516
1704
|
//#region ~icons/radix-icons/caret-down
|
|
1517
|
-
var _hoisted_1$
|
|
1705
|
+
var _hoisted_1$30 = {
|
|
1518
1706
|
viewBox: "0 0 15 15",
|
|
1519
1707
|
width: "1em",
|
|
1520
1708
|
height: "1em"
|
|
1521
1709
|
};
|
|
1522
1710
|
function render$13(_ctx, _cache) {
|
|
1523
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
1711
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$30, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
1524
1712
|
fill: "currentColor",
|
|
1525
1713
|
d: "M7.5 9.95a.45.45 0 0 0 .319-.132l3-3a.45.45 0 0 0-.637-.637L7.5 8.863L4.82 6.181l-.07-.057a.451.451 0 0 0-.625.624l.058.07l3 3a.45.45 0 0 0 .318.132"
|
|
1526
1714
|
}, null, -1)])]);
|
|
@@ -1609,10 +1797,13 @@ var [injectSidebarProviderContext, provideSidebarProviderContext] = createContex
|
|
|
1609
1797
|
//#region src/components/sidebar/SidebarProvider.vue
|
|
1610
1798
|
var SidebarProvider_default = /* @__PURE__ */ defineComponent({
|
|
1611
1799
|
__name: "SidebarProvider",
|
|
1612
|
-
props: {
|
|
1800
|
+
props: {
|
|
1801
|
+
as: { default: "div" },
|
|
1802
|
+
breakpoint: { default: 1024 }
|
|
1803
|
+
},
|
|
1613
1804
|
setup(__props) {
|
|
1614
1805
|
const props = __props;
|
|
1615
|
-
const
|
|
1806
|
+
const isNarrowViewport = ref(false);
|
|
1616
1807
|
const sidebars = shallowReactive({});
|
|
1617
1808
|
function register(side, controller) {
|
|
1618
1809
|
const existing = sidebars[side];
|
|
@@ -1631,23 +1822,29 @@ var SidebarProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
1631
1822
|
if (other && other !== controller && other.open.value) other.setOpen(false);
|
|
1632
1823
|
}
|
|
1633
1824
|
provideSidebarProviderContext({
|
|
1634
|
-
|
|
1825
|
+
isNarrowViewport,
|
|
1635
1826
|
sidebars,
|
|
1636
1827
|
register,
|
|
1637
1828
|
unregister,
|
|
1638
1829
|
requestOpen
|
|
1639
1830
|
});
|
|
1640
1831
|
let mediaQuery;
|
|
1641
|
-
function
|
|
1642
|
-
|
|
1832
|
+
function updateNarrowViewport(event) {
|
|
1833
|
+
isNarrowViewport.value = event.matches;
|
|
1643
1834
|
}
|
|
1644
|
-
|
|
1645
|
-
mediaQuery
|
|
1646
|
-
|
|
1647
|
-
mediaQuery
|
|
1835
|
+
function setupMediaQuery() {
|
|
1836
|
+
mediaQuery?.removeEventListener("change", updateNarrowViewport);
|
|
1837
|
+
mediaQuery = window.matchMedia(`(max-width: ${props.breakpoint - .02}px)`);
|
|
1838
|
+
updateNarrowViewport(mediaQuery);
|
|
1839
|
+
mediaQuery.addEventListener("change", updateNarrowViewport);
|
|
1840
|
+
}
|
|
1841
|
+
onMounted(setupMediaQuery);
|
|
1842
|
+
watch(() => props.breakpoint, () => {
|
|
1843
|
+
if (mediaQuery) setupMediaQuery();
|
|
1648
1844
|
});
|
|
1649
1845
|
onBeforeUnmount(() => {
|
|
1650
|
-
mediaQuery?.removeEventListener("change",
|
|
1846
|
+
mediaQuery?.removeEventListener("change", updateNarrowViewport);
|
|
1847
|
+
mediaQuery = void 0;
|
|
1651
1848
|
});
|
|
1652
1849
|
const hasInset = computed(() => sidebars.left?.variant.value === "inset" || sidebars.right?.variant.value === "inset");
|
|
1653
1850
|
const hasPadding = computed(() => sidebars.left?.variant.value === "floating" || sidebars.right?.variant.value === "floating" || hasInset.value);
|
|
@@ -1655,24 +1852,24 @@ var SidebarProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
1655
1852
|
return openBlock(), createBlock(unref(Primitive), {
|
|
1656
1853
|
class: "ui-SidebarProvider",
|
|
1657
1854
|
as: props.as,
|
|
1658
|
-
"data-mobile": isMobile.value,
|
|
1659
1855
|
"data-padded": hasPadding.value,
|
|
1660
|
-
"data-inset": hasInset.value
|
|
1856
|
+
"data-inset": hasInset.value,
|
|
1857
|
+
"data-mobile": isNarrowViewport.value
|
|
1661
1858
|
}, {
|
|
1662
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default"
|
|
1859
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1663
1860
|
_: 3
|
|
1664
1861
|
}, 8, [
|
|
1665
1862
|
"as",
|
|
1666
|
-
"data-mobile",
|
|
1667
1863
|
"data-padded",
|
|
1668
|
-
"data-inset"
|
|
1864
|
+
"data-inset",
|
|
1865
|
+
"data-mobile"
|
|
1669
1866
|
]);
|
|
1670
1867
|
};
|
|
1671
1868
|
}
|
|
1672
1869
|
});
|
|
1673
1870
|
//#endregion
|
|
1674
1871
|
//#region src/components/sidebar/Sidebar.vue?vue&type=script&setup=true&lang.ts
|
|
1675
|
-
var _hoisted_1$
|
|
1872
|
+
var _hoisted_1$29 = ["data-collapsed"];
|
|
1676
1873
|
var [injectSidebarContext, provideSidebarContext] = createContext("ui:Sidebar");
|
|
1677
1874
|
//#endregion
|
|
1678
1875
|
//#region src/components/sidebar/Sidebar.vue
|
|
@@ -1705,6 +1902,8 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1705
1902
|
mobileTitle: { default: "Navigation" },
|
|
1706
1903
|
mobileDescription: { default: "Site navigation" },
|
|
1707
1904
|
forceMount: { type: Boolean },
|
|
1905
|
+
initialFocus: { type: [Boolean, null] },
|
|
1906
|
+
finalFocus: { type: [Boolean, null] },
|
|
1708
1907
|
disableOutsidePointerEvents: {
|
|
1709
1908
|
type: Boolean,
|
|
1710
1909
|
default: void 0
|
|
@@ -1728,14 +1927,14 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1728
1927
|
const provider = injectSidebarProviderContext();
|
|
1729
1928
|
const internalOpen = ref(props.defaultOpen);
|
|
1730
1929
|
const internalCollapsed = ref(props.defaultCollapsed);
|
|
1731
|
-
const
|
|
1930
|
+
const isNarrowViewport = provider.isNarrowViewport;
|
|
1732
1931
|
const lastTrigger = ref(null);
|
|
1733
1932
|
const panelId = `ui-sidebar-${useId()}`;
|
|
1734
1933
|
const { side, variant, collapsible } = toRefs(props);
|
|
1735
1934
|
const open = computed({
|
|
1736
1935
|
get: () => props.open ?? internalOpen.value,
|
|
1737
1936
|
set: (value) => {
|
|
1738
|
-
if (value &&
|
|
1937
|
+
if (value && isNarrowViewport.value) provider.requestOpen(side.value, controller);
|
|
1739
1938
|
if (props.open === void 0) internalOpen.value = value;
|
|
1740
1939
|
emits("update:open", value);
|
|
1741
1940
|
}
|
|
@@ -1747,11 +1946,12 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1747
1946
|
emits("update:collapsed", value);
|
|
1748
1947
|
}
|
|
1749
1948
|
});
|
|
1949
|
+
const isVisuallyCollapsed = computed(() => !isNarrowViewport.value && collapsed.value);
|
|
1750
1950
|
function toggleCollapsed() {
|
|
1751
1951
|
if (collapsible.value !== "none") collapsed.value = !collapsed.value;
|
|
1752
1952
|
}
|
|
1753
1953
|
function toggle() {
|
|
1754
|
-
if (
|
|
1954
|
+
if (isNarrowViewport.value) open.value = !open.value;
|
|
1755
1955
|
else toggleCollapsed();
|
|
1756
1956
|
}
|
|
1757
1957
|
function setOpen(value) {
|
|
@@ -1774,13 +1974,13 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1774
1974
|
watch(side, (value, _oldValue, onCleanup) => {
|
|
1775
1975
|
if (provider.register(value, controller)) onCleanup(() => provider.unregister(value, controller));
|
|
1776
1976
|
}, { immediate: true });
|
|
1777
|
-
watch([open,
|
|
1778
|
-
if (isOpen &&
|
|
1977
|
+
watch([open, isNarrowViewport], ([isOpen, narrowViewport]) => {
|
|
1978
|
+
if (isOpen && narrowViewport) provider.requestOpen(side.value, controller);
|
|
1779
1979
|
}, { immediate: true });
|
|
1780
1980
|
provideSidebarContext({
|
|
1781
1981
|
open,
|
|
1782
1982
|
collapsed,
|
|
1783
|
-
|
|
1983
|
+
isNarrowViewport,
|
|
1784
1984
|
side,
|
|
1785
1985
|
variant,
|
|
1786
1986
|
collapsible,
|
|
@@ -1790,7 +1990,7 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1790
1990
|
toggleCollapsed,
|
|
1791
1991
|
shouldRestoreFocus
|
|
1792
1992
|
});
|
|
1793
|
-
const
|
|
1993
|
+
const forwarded = useForwardPropsWithout(props, [
|
|
1794
1994
|
"open",
|
|
1795
1995
|
"defaultOpen",
|
|
1796
1996
|
"collapsed",
|
|
@@ -1804,7 +2004,7 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1804
2004
|
"mobileTitle",
|
|
1805
2005
|
"mobileDescription"
|
|
1806
2006
|
]);
|
|
1807
|
-
const
|
|
2007
|
+
const desktopClass = buildPropsClass(props, [
|
|
1808
2008
|
"side",
|
|
1809
2009
|
"variant",
|
|
1810
2010
|
"collapsible"
|
|
@@ -1829,40 +2029,41 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1829
2029
|
}
|
|
1830
2030
|
}
|
|
1831
2031
|
return (_ctx, _cache) => {
|
|
1832
|
-
return
|
|
2032
|
+
return !unref(isNarrowViewport) ? (openBlock(), createElementBlock("div", {
|
|
2033
|
+
key: 0,
|
|
2034
|
+
class: normalizeClass(["ui-Sidebar", unref(desktopClass)]),
|
|
2035
|
+
style: normalizeStyle(sidebarStyle.value),
|
|
2036
|
+
"data-collapsed": collapsed.value
|
|
2037
|
+
}, [createVNode(unref(Primitive), mergeProps(_ctx.$attrs, {
|
|
2038
|
+
id: panelId,
|
|
2039
|
+
as: props.as,
|
|
2040
|
+
"as-child": props.asChild,
|
|
2041
|
+
class: "ui-SidebarPanel r-desktop"
|
|
2042
|
+
}), {
|
|
2043
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
|
|
2044
|
+
open: open.value,
|
|
2045
|
+
collapsed: isVisuallyCollapsed.value,
|
|
2046
|
+
toggle
|
|
2047
|
+
})]),
|
|
2048
|
+
_: 3
|
|
2049
|
+
}, 16, ["as", "as-child"])], 14, _hoisted_1$29)) : (openBlock(), createBlock(unref(DrawerRoot), {
|
|
2050
|
+
key: 1,
|
|
1833
2051
|
open: open.value,
|
|
2052
|
+
"swipe-direction": unref(side),
|
|
1834
2053
|
"onUpdate:open": setOpen
|
|
1835
2054
|
}, {
|
|
1836
|
-
default: withCtx(() => [
|
|
1837
|
-
key: 0,
|
|
1838
|
-
class: normalizeClass(["ui-Sidebar", unref(resetClass)]),
|
|
1839
|
-
style: normalizeStyle(sidebarStyle.value),
|
|
1840
|
-
"data-collapsed": collapsed.value
|
|
1841
|
-
}, [createVNode(unref(Primitive), mergeProps(_ctx.$attrs, {
|
|
1842
|
-
id: panelId,
|
|
1843
|
-
as: props.as,
|
|
1844
|
-
"as-child": props.asChild,
|
|
1845
|
-
class: "ui-SidebarPanel r-desktop"
|
|
1846
|
-
}), {
|
|
1847
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
|
|
1848
|
-
open: open.value,
|
|
1849
|
-
collapsed: collapsed.value,
|
|
1850
|
-
isMobile: unref(isMobile),
|
|
1851
|
-
toggle
|
|
1852
|
-
})]),
|
|
1853
|
-
_: 3
|
|
1854
|
-
}, 16, ["as", "as-child"])], 14, _hoisted_1$28)) : (openBlock(), createBlock(unref(DialogPortal), { key: 1 }, {
|
|
2055
|
+
default: withCtx(() => [createVNode(unref(DrawerPortal), null, {
|
|
1855
2056
|
default: withCtx(() => [createVNode(ThemeWrapper_default, null, {
|
|
1856
|
-
default: withCtx(() => [createVNode(unref(
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
2057
|
+
default: withCtx(() => [createVNode(unref(DrawerViewport), { class: "ui-SidebarViewport" }, {
|
|
2058
|
+
default: withCtx(() => [createVNode(unref(DrawerOverlay), {
|
|
2059
|
+
class: "ui-SidebarOverlay",
|
|
2060
|
+
"force-mount": props.forceMount
|
|
2061
|
+
}, null, 8, ["force-mount"]), createVNode(unref(DrawerContent), mergeProps({
|
|
1861
2062
|
..._ctx.$attrs,
|
|
1862
|
-
...unref(
|
|
2063
|
+
...unref(forwarded)
|
|
1863
2064
|
}, {
|
|
1864
2065
|
id: panelId,
|
|
1865
|
-
class: ["ui-SidebarPanel r-mobile", mobileClass.value],
|
|
2066
|
+
class: ["ui-SidebarPanel ui-DrawerMotion r-mobile", mobileClass.value],
|
|
1866
2067
|
style: sidebarStyle.value,
|
|
1867
2068
|
onCloseAutoFocus: closeAutoFocus,
|
|
1868
2069
|
onEscapeKeyDown: _cache[0] || (_cache[0] = ($event) => emits("escapeKeyDown", $event)),
|
|
@@ -1874,15 +2075,14 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1874
2075
|
default: withCtx(() => [
|
|
1875
2076
|
renderSlot(_ctx.$slots, "default", {
|
|
1876
2077
|
open: open.value,
|
|
1877
|
-
collapsed:
|
|
1878
|
-
isMobile: unref(isMobile),
|
|
2078
|
+
collapsed: isVisuallyCollapsed.value,
|
|
1879
2079
|
toggle
|
|
1880
2080
|
}),
|
|
1881
|
-
createVNode(unref(
|
|
2081
|
+
createVNode(unref(DrawerTitle), { class: "ui-SidebarVisuallyHidden" }, {
|
|
1882
2082
|
default: withCtx(() => [createTextVNode(toDisplayString(props.mobileTitle), 1)]),
|
|
1883
2083
|
_: 1
|
|
1884
2084
|
}),
|
|
1885
|
-
createVNode(unref(
|
|
2085
|
+
createVNode(unref(DrawerDescription), { class: "ui-SidebarVisuallyHidden" }, {
|
|
1886
2086
|
default: withCtx(() => [createTextVNode(toDisplayString(props.mobileDescription), 1)]),
|
|
1887
2087
|
_: 1
|
|
1888
2088
|
})
|
|
@@ -1890,13 +2090,13 @@ var Sidebar_default = /* @__PURE__ */ defineComponent({
|
|
|
1890
2090
|
_: 3
|
|
1891
2091
|
}, 16, ["class", "style"])]),
|
|
1892
2092
|
_: 3
|
|
1893
|
-
}
|
|
2093
|
+
})]),
|
|
1894
2094
|
_: 3
|
|
1895
2095
|
})]),
|
|
1896
2096
|
_: 3
|
|
1897
|
-
})
|
|
2097
|
+
})]),
|
|
1898
2098
|
_: 3
|
|
1899
|
-
}, 8, ["open"]);
|
|
2099
|
+
}, 8, ["open", "swipe-direction"]));
|
|
1900
2100
|
};
|
|
1901
2101
|
}
|
|
1902
2102
|
});
|
|
@@ -1984,10 +2184,10 @@ var SidebarTrigger_default = /* @__PURE__ */ defineComponent({
|
|
|
1984
2184
|
const props = __props;
|
|
1985
2185
|
const provider = injectSidebarProviderContext();
|
|
1986
2186
|
const target = computed(() => provider.sidebars[props.target]);
|
|
1987
|
-
const isDisabled = computed(() => props.disabled || !target.value || !provider.
|
|
2187
|
+
const isDisabled = computed(() => props.disabled || !target.value || !provider.isNarrowViewport.value && target.value.collapsible.value === "none");
|
|
1988
2188
|
const accessibleLabel = computed(() => {
|
|
1989
2189
|
if (props.label) return props.label;
|
|
1990
|
-
if (provider.
|
|
2190
|
+
if (provider.isNarrowViewport.value) return `${target.value?.open.value ? "Close" : "Open"} ${props.target} sidebar`;
|
|
1991
2191
|
return `${target.value?.collapsed.value ? "Expand" : "Collapse"} ${props.target} sidebar`;
|
|
1992
2192
|
});
|
|
1993
2193
|
function toggle(event) {
|
|
@@ -2004,19 +2204,17 @@ var SidebarTrigger_default = /* @__PURE__ */ defineComponent({
|
|
|
2004
2204
|
disabled: isDisabled.value && props.as === "button" ? true : void 0,
|
|
2005
2205
|
"data-disabled": isDisabled.value ? true : void 0,
|
|
2006
2206
|
"aria-disabled": isDisabled.value ? true : void 0,
|
|
2007
|
-
"data-mobile": unref(provider).isMobile.value,
|
|
2008
2207
|
"data-collapsible": target.value?.collapsible.value,
|
|
2009
2208
|
"data-target": props.target,
|
|
2010
2209
|
"aria-label": accessibleLabel.value,
|
|
2011
2210
|
"aria-controls": target.value?.panelId,
|
|
2012
|
-
"aria-expanded": unref(provider).
|
|
2013
|
-
"aria-haspopup": unref(provider).
|
|
2211
|
+
"aria-expanded": unref(provider).isNarrowViewport.value ? target.value?.open.value ?? false : !(target.value?.collapsed.value ?? true),
|
|
2212
|
+
"aria-haspopup": unref(provider).isNarrowViewport.value ? "dialog" : void 0,
|
|
2014
2213
|
onClick: toggle
|
|
2015
2214
|
}, {
|
|
2016
2215
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
|
|
2017
2216
|
open: target.value?.open.value ?? false,
|
|
2018
2217
|
collapsed: target.value?.collapsed.value ?? false,
|
|
2019
|
-
isMobile: unref(provider).isMobile.value,
|
|
2020
2218
|
target: props.target
|
|
2021
2219
|
}, () => [createVNode(unref(Icon), {
|
|
2022
2220
|
class: "ui-SidebarTriggerIcon",
|
|
@@ -2031,7 +2229,6 @@ var SidebarTrigger_default = /* @__PURE__ */ defineComponent({
|
|
|
2031
2229
|
"disabled",
|
|
2032
2230
|
"data-disabled",
|
|
2033
2231
|
"aria-disabled",
|
|
2034
|
-
"data-mobile",
|
|
2035
2232
|
"data-collapsible",
|
|
2036
2233
|
"data-target",
|
|
2037
2234
|
"aria-label",
|
|
@@ -2279,7 +2476,7 @@ var SidebarMenuButton_default = /* @__PURE__ */ defineComponent({
|
|
|
2279
2476
|
const context = injectSidebarContext();
|
|
2280
2477
|
injectSidebarMenuContext();
|
|
2281
2478
|
const tooltip = computed(() => props.tooltip === false ? void 0 : props.tooltip ?? props.text);
|
|
2282
|
-
const showTooltip = computed(() => Boolean(tooltip.value) && !props.disabled && !context.
|
|
2479
|
+
const showTooltip = computed(() => Boolean(tooltip.value) && !props.disabled && !context.isNarrowViewport.value && context.collapsible.value === "icon" && context.collapsed.value);
|
|
2283
2480
|
const tooltipSide = computed(() => context.side.value === "left" ? "right" : "left");
|
|
2284
2481
|
function preventDisabled(event) {
|
|
2285
2482
|
if (!props.disabled) return;
|
|
@@ -2449,7 +2646,6 @@ var SidebarMenuSubItem_default = /* @__PURE__ */ defineComponent({
|
|
|
2449
2646
|
//#endregion
|
|
2450
2647
|
//#region src/components/sidebar/SidebarMenuSubButton.vue
|
|
2451
2648
|
var SidebarMenuSubButton_default = /* @__PURE__ */ defineComponent({
|
|
2452
|
-
inheritAttrs: false,
|
|
2453
2649
|
__name: "SidebarMenuSubButton",
|
|
2454
2650
|
props: {
|
|
2455
2651
|
icon: {},
|
|
@@ -2475,7 +2671,7 @@ var SidebarMenuSubButton_default = /* @__PURE__ */ defineComponent({
|
|
|
2475
2671
|
event.stopImmediatePropagation();
|
|
2476
2672
|
}
|
|
2477
2673
|
return (_ctx, _cache) => {
|
|
2478
|
-
return openBlock(), createBlock(unref(Primitive),
|
|
2674
|
+
return openBlock(), createBlock(unref(Primitive), {
|
|
2479
2675
|
class: "ui-SidebarMenuSubButton",
|
|
2480
2676
|
as: props.as,
|
|
2481
2677
|
"as-child": props.asChild,
|
|
@@ -2485,7 +2681,7 @@ var SidebarMenuSubButton_default = /* @__PURE__ */ defineComponent({
|
|
|
2485
2681
|
"data-disabled": props.disabled ? true : void 0,
|
|
2486
2682
|
"aria-disabled": props.disabled ? true : void 0,
|
|
2487
2683
|
onClick: preventDisabled
|
|
2488
|
-
}
|
|
2684
|
+
}, {
|
|
2489
2685
|
default: withCtx(() => [props.asChild ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : (openBlock(), createBlock(SidebarMenuButtonContent_default, {
|
|
2490
2686
|
key: 1,
|
|
2491
2687
|
"is-sub": "",
|
|
@@ -2519,7 +2715,7 @@ var SidebarMenuSubButton_default = /* @__PURE__ */ defineComponent({
|
|
|
2519
2715
|
"trailing-icon"
|
|
2520
2716
|
]))]),
|
|
2521
2717
|
_: 3
|
|
2522
|
-
},
|
|
2718
|
+
}, 8, [
|
|
2523
2719
|
"as",
|
|
2524
2720
|
"as-child",
|
|
2525
2721
|
"type",
|
|
@@ -2590,7 +2786,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
2590
2786
|
});
|
|
2591
2787
|
//#endregion
|
|
2592
2788
|
//#region src/components/checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
2593
|
-
var _hoisted_1$
|
|
2789
|
+
var _hoisted_1$28 = {
|
|
2594
2790
|
width: "9",
|
|
2595
2791
|
height: "9",
|
|
2596
2792
|
viewBox: "0 0 9 9",
|
|
@@ -2654,7 +2850,7 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
2654
2850
|
class: "ui-CheckboxIndicator",
|
|
2655
2851
|
"as-child": ""
|
|
2656
2852
|
}, {
|
|
2657
|
-
default: withCtx(() => [(openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2853
|
+
default: withCtx(() => [(openBlock(), createElementBlock("svg", _hoisted_1$28, [state === "indeterminate" ? (openBlock(), createElementBlock("path", _hoisted_2$6)) : (openBlock(), createElementBlock("path", _hoisted_3$1))]))]),
|
|
2658
2854
|
_: 2
|
|
2659
2855
|
}, 1024)]),
|
|
2660
2856
|
_: 1
|
|
@@ -2663,6 +2859,319 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
2663
2859
|
}
|
|
2664
2860
|
});
|
|
2665
2861
|
//#endregion
|
|
2862
|
+
//#region ../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.42_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js
|
|
2863
|
+
/**
|
|
2864
|
+
* Keep states in the global scope to be reusable across Vue instances.
|
|
2865
|
+
*
|
|
2866
|
+
* @see https://vueuse.org/createGlobalState
|
|
2867
|
+
* @param stateFactory A factory function to create the state
|
|
2868
|
+
*
|
|
2869
|
+
* @__NO_SIDE_EFFECTS__
|
|
2870
|
+
*/
|
|
2871
|
+
function createGlobalState(stateFactory) {
|
|
2872
|
+
let initialized = false;
|
|
2873
|
+
let state;
|
|
2874
|
+
const scope = effectScope(true);
|
|
2875
|
+
return ((...args) => {
|
|
2876
|
+
if (!initialized) {
|
|
2877
|
+
state = scope.run(() => stateFactory(...args));
|
|
2878
|
+
initialized = true;
|
|
2879
|
+
}
|
|
2880
|
+
return state;
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2884
|
+
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
2885
|
+
var isDef = (val) => typeof val !== "undefined";
|
|
2886
|
+
isClient && window.document;
|
|
2887
|
+
isClient && window.navigator;
|
|
2888
|
+
isClient && window.location;
|
|
2889
|
+
function cloneFnJSON(source) {
|
|
2890
|
+
return JSON.parse(JSON.stringify(source));
|
|
2891
|
+
}
|
|
2892
|
+
Number.POSITIVE_INFINITY;
|
|
2893
|
+
/**
|
|
2894
|
+
* Shorthand for v-model binding, props + emit -> ref
|
|
2895
|
+
*
|
|
2896
|
+
* @see https://vueuse.org/useVModel
|
|
2897
|
+
* @param props
|
|
2898
|
+
* @param key (default 'modelValue')
|
|
2899
|
+
* @param emit
|
|
2900
|
+
* @param options
|
|
2901
|
+
*
|
|
2902
|
+
* @__NO_SIDE_EFFECTS__
|
|
2903
|
+
*/
|
|
2904
|
+
function useVModel(props, key, emit, options = {}) {
|
|
2905
|
+
var _vm$$emit, _vm$proxy;
|
|
2906
|
+
const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;
|
|
2907
|
+
const vm = getCurrentInstance();
|
|
2908
|
+
const _emit = emit || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy));
|
|
2909
|
+
let event = eventName;
|
|
2910
|
+
if (!key) key = "modelValue";
|
|
2911
|
+
event = event || `update:${key.toString()}`;
|
|
2912
|
+
const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
|
|
2913
|
+
const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;
|
|
2914
|
+
const triggerEmit = (value) => {
|
|
2915
|
+
if (shouldEmit) {
|
|
2916
|
+
if (shouldEmit(value)) _emit(event, value);
|
|
2917
|
+
} else _emit(event, value);
|
|
2918
|
+
};
|
|
2919
|
+
if (passive) {
|
|
2920
|
+
const proxy = ref(getValue());
|
|
2921
|
+
let isUpdating = false;
|
|
2922
|
+
watch(() => props[key], (v) => {
|
|
2923
|
+
if (!isUpdating) {
|
|
2924
|
+
isUpdating = true;
|
|
2925
|
+
proxy.value = cloneFn(v);
|
|
2926
|
+
nextTick(() => isUpdating = false);
|
|
2927
|
+
}
|
|
2928
|
+
});
|
|
2929
|
+
watch(proxy, (v) => {
|
|
2930
|
+
if (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);
|
|
2931
|
+
}, { deep });
|
|
2932
|
+
return proxy;
|
|
2933
|
+
} else return computed({
|
|
2934
|
+
get() {
|
|
2935
|
+
return getValue();
|
|
2936
|
+
},
|
|
2937
|
+
set(value) {
|
|
2938
|
+
triggerEmit(value);
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2942
|
+
//#endregion
|
|
2943
|
+
//#region ../../node_modules/.pnpm/ohash@2.0.12/node_modules/ohash/dist/_chunks/is-equal.mjs
|
|
2944
|
+
function serialize(input) {
|
|
2945
|
+
if (typeof input === "string") return `'${input}'`;
|
|
2946
|
+
return new Serializer().serialize(input);
|
|
2947
|
+
}
|
|
2948
|
+
var asciiOrder = " _-,;:!?.'\"()[]{}@*/\\&#%`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz";
|
|
2949
|
+
var asciiWeights = /*@__PURE__*/ (function() {
|
|
2950
|
+
const weights = /* @__PURE__ */ new Uint8Array(128);
|
|
2951
|
+
for (let i = 0; i < 69; i++) weights[asciiOrder.charCodeAt(i)] = i + 1;
|
|
2952
|
+
for (let code = 65; code <= 90; code++) weights[code] = weights[code + 32];
|
|
2953
|
+
return weights;
|
|
2954
|
+
})();
|
|
2955
|
+
function compareStrings(a, b) {
|
|
2956
|
+
if (a === b) return 0;
|
|
2957
|
+
const length = Math.min(a.length, b.length);
|
|
2958
|
+
let tieBreaker = 0;
|
|
2959
|
+
for (let i = 0; i < length; i++) {
|
|
2960
|
+
const codeA = a.charCodeAt(i);
|
|
2961
|
+
const codeB = b.charCodeAt(i);
|
|
2962
|
+
if (codeA === codeB) continue;
|
|
2963
|
+
const weightA = codeA < 128 && asciiWeights[codeA] ? asciiWeights[codeA] : codeA + 128;
|
|
2964
|
+
const weightB = codeB < 128 && asciiWeights[codeB] ? asciiWeights[codeB] : codeB + 128;
|
|
2965
|
+
if (weightA !== weightB) return weightA < weightB ? -1 : 1;
|
|
2966
|
+
if (tieBreaker === 0) tieBreaker = codeA > codeB ? -1 : 1;
|
|
2967
|
+
}
|
|
2968
|
+
if (a.length !== b.length) return a.length < b.length ? -1 : 1;
|
|
2969
|
+
return tieBreaker;
|
|
2970
|
+
}
|
|
2971
|
+
var Serializer = /*@__PURE__*/ (function() {
|
|
2972
|
+
class Serializer {
|
|
2973
|
+
#context = /* @__PURE__ */ new Map();
|
|
2974
|
+
compare(a, b) {
|
|
2975
|
+
const typeA = typeof a;
|
|
2976
|
+
const typeB = typeof b;
|
|
2977
|
+
if (typeA === "string" && typeB === "string") return compareStrings(a, b);
|
|
2978
|
+
if (typeA === "number" && typeB === "number") return a - b;
|
|
2979
|
+
return compareStrings(this.serialize(a, true), this.serialize(b, true));
|
|
2980
|
+
}
|
|
2981
|
+
serialize(value, noQuotes) {
|
|
2982
|
+
if (value === null) return "null";
|
|
2983
|
+
switch (typeof value) {
|
|
2984
|
+
case "string": return noQuotes ? value : `'${value}'`;
|
|
2985
|
+
case "bigint": return `${value}n`;
|
|
2986
|
+
case "object": return this.$object(value);
|
|
2987
|
+
case "function": return this.$function(value);
|
|
2988
|
+
}
|
|
2989
|
+
return String(value);
|
|
2990
|
+
}
|
|
2991
|
+
serializeObject(object) {
|
|
2992
|
+
const objString = Object.prototype.toString.call(object);
|
|
2993
|
+
if (objString !== "[object Object]") return this.serializeBuiltInType(objString.length < 10 ? `unknown:${objString}` : objString.slice(8, -1), object);
|
|
2994
|
+
const constructor = object.constructor;
|
|
2995
|
+
const objName = constructor === Object || constructor === void 0 ? "" : constructor.name;
|
|
2996
|
+
if (objName !== "" && globalThis[objName] === constructor) return this.serializeBuiltInType(objName, object);
|
|
2997
|
+
if ("toJSON" in object && typeof object.toJSON === "function") {
|
|
2998
|
+
const json = object.toJSON();
|
|
2999
|
+
return objName + (json !== null && typeof json === "object" ? this.$object(json) : `(${this.serialize(json)})`);
|
|
3000
|
+
}
|
|
3001
|
+
const keys = Object.keys(object).sort(compareStrings);
|
|
3002
|
+
let content = `${objName}{`;
|
|
3003
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3004
|
+
const key = keys[i];
|
|
3005
|
+
content += `${key}:${this.serialize(object[key])}`;
|
|
3006
|
+
if (i < keys.length - 1) content += ",";
|
|
3007
|
+
}
|
|
3008
|
+
return content + "}";
|
|
3009
|
+
}
|
|
3010
|
+
serializeBuiltInType(type, object) {
|
|
3011
|
+
const handler = this["$" + type];
|
|
3012
|
+
if (handler) return handler.call(this, object);
|
|
3013
|
+
if (typeof object.entries === "function") return this.serializeObjectEntries(type, object.entries());
|
|
3014
|
+
throw new Error(`Cannot serialize ${type}`);
|
|
3015
|
+
}
|
|
3016
|
+
serializeObjectEntries(type, entries) {
|
|
3017
|
+
const sortedEntries = Array.from(entries).sort((a, b) => this.compare(a[0], b[0]));
|
|
3018
|
+
let content = `${type}{`;
|
|
3019
|
+
for (let i = 0; i < sortedEntries.length; i++) {
|
|
3020
|
+
const [key, value] = sortedEntries[i];
|
|
3021
|
+
content += `${this.serialize(key, true)}:${this.serialize(value)}`;
|
|
3022
|
+
if (i < sortedEntries.length - 1) content += ",";
|
|
3023
|
+
}
|
|
3024
|
+
return content + "}";
|
|
3025
|
+
}
|
|
3026
|
+
$object(object) {
|
|
3027
|
+
let content = this.#context.get(object);
|
|
3028
|
+
if (content === void 0) {
|
|
3029
|
+
this.#context.set(object, `#${this.#context.size}`);
|
|
3030
|
+
content = this.serializeObject(object);
|
|
3031
|
+
this.#context.set(object, content);
|
|
3032
|
+
}
|
|
3033
|
+
return content;
|
|
3034
|
+
}
|
|
3035
|
+
$function(fn) {
|
|
3036
|
+
const fnStr = Function.prototype.toString.call(fn);
|
|
3037
|
+
if (fnStr.slice(-15) === "[native code] }") return `${fn.name || ""}()[native]`;
|
|
3038
|
+
return `${fn.name}(${fn.length})${fnStr.replace(/\s*\n\s*/g, "")}`;
|
|
3039
|
+
}
|
|
3040
|
+
$Array(arr) {
|
|
3041
|
+
let content = "[";
|
|
3042
|
+
for (let i = 0; i < arr.length; i++) {
|
|
3043
|
+
content += this.serialize(arr[i]);
|
|
3044
|
+
if (i < arr.length - 1) content += ",";
|
|
3045
|
+
}
|
|
3046
|
+
return content + "]";
|
|
3047
|
+
}
|
|
3048
|
+
$Date(date) {
|
|
3049
|
+
try {
|
|
3050
|
+
return `Date(${date.toISOString()})`;
|
|
3051
|
+
} catch {
|
|
3052
|
+
return `Date(null)`;
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
$ArrayBuffer(arr) {
|
|
3056
|
+
return `ArrayBuffer[${new Uint8Array(arr).join(",")}]`;
|
|
3057
|
+
}
|
|
3058
|
+
$Set(set) {
|
|
3059
|
+
return `Set${this.$Array(Array.from(set).sort((a, b) => this.compare(a, b)))}`;
|
|
3060
|
+
}
|
|
3061
|
+
$Map(map) {
|
|
3062
|
+
return this.serializeObjectEntries("Map", map.entries());
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
for (const type of [
|
|
3066
|
+
"Error",
|
|
3067
|
+
"RegExp",
|
|
3068
|
+
"URL"
|
|
3069
|
+
]) Serializer.prototype["$" + type] = function(val) {
|
|
3070
|
+
return `${type}(${val})`;
|
|
3071
|
+
};
|
|
3072
|
+
for (const type of [
|
|
3073
|
+
"Int8Array",
|
|
3074
|
+
"Uint8Array",
|
|
3075
|
+
"Uint8ClampedArray",
|
|
3076
|
+
"Int16Array",
|
|
3077
|
+
"Uint16Array",
|
|
3078
|
+
"Int32Array",
|
|
3079
|
+
"Uint32Array",
|
|
3080
|
+
"Float32Array",
|
|
3081
|
+
"Float64Array"
|
|
3082
|
+
]) Serializer.prototype["$" + type] = function(arr) {
|
|
3083
|
+
return `${type}[${arr.join(",")}]`;
|
|
3084
|
+
};
|
|
3085
|
+
for (const type of ["BigInt64Array", "BigUint64Array"]) Serializer.prototype["$" + type] = function(arr) {
|
|
3086
|
+
return `${type}[${arr.join("n,")}${arr.length > 0 ? "n" : ""}]`;
|
|
3087
|
+
};
|
|
3088
|
+
return Serializer;
|
|
3089
|
+
})();
|
|
3090
|
+
function isEqual(object1, object2) {
|
|
3091
|
+
if (object1 === object2) return true;
|
|
3092
|
+
if (serialize(object1) === serialize(object2)) return true;
|
|
3093
|
+
return false;
|
|
3094
|
+
}
|
|
3095
|
+
//#endregion
|
|
3096
|
+
//#region src/components/checkbox/CheckboxGroup.vue
|
|
3097
|
+
var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
3098
|
+
inheritAttrs: false,
|
|
3099
|
+
__name: "CheckboxGroup",
|
|
3100
|
+
props: {
|
|
3101
|
+
as: { default: "div" },
|
|
3102
|
+
contentAs: { default: "div" },
|
|
3103
|
+
allValues: {},
|
|
3104
|
+
defaultValue: {},
|
|
3105
|
+
modelValue: {},
|
|
3106
|
+
rovingFocus: { type: Boolean },
|
|
3107
|
+
disabled: { type: Boolean },
|
|
3108
|
+
dir: {},
|
|
3109
|
+
orientation: {},
|
|
3110
|
+
loop: { type: Boolean },
|
|
3111
|
+
name: {},
|
|
3112
|
+
required: { type: Boolean }
|
|
3113
|
+
},
|
|
3114
|
+
emits: ["update:modelValue"],
|
|
3115
|
+
setup(__props, { emit: __emit }) {
|
|
3116
|
+
const props = __props;
|
|
3117
|
+
const modelValue = useVModel(props, "modelValue", __emit, {
|
|
3118
|
+
defaultValue: props.defaultValue ?? [],
|
|
3119
|
+
passive: props.modelValue === void 0
|
|
3120
|
+
});
|
|
3121
|
+
const forwarded = useForwardPropsWithout(props, [
|
|
3122
|
+
"allValues",
|
|
3123
|
+
"as",
|
|
3124
|
+
"contentAs",
|
|
3125
|
+
"defaultValue",
|
|
3126
|
+
"modelValue"
|
|
3127
|
+
]);
|
|
3128
|
+
const { forwardRef } = useForwardExpose();
|
|
3129
|
+
function includesValue(values, value) {
|
|
3130
|
+
return values.some((item) => isEqual(item, value));
|
|
3131
|
+
}
|
|
3132
|
+
const groupValues = computed(() => {
|
|
3133
|
+
return (props.allValues ?? []).reduce((values, value) => {
|
|
3134
|
+
if (!includesValue(values, value)) values.push(value);
|
|
3135
|
+
return values;
|
|
3136
|
+
}, []);
|
|
3137
|
+
});
|
|
3138
|
+
const selectAllState = computed(() => {
|
|
3139
|
+
if (groupValues.value.length === 0) return false;
|
|
3140
|
+
const selected = groupValues.value.filter((value) => includesValue(modelValue.value, value)).length;
|
|
3141
|
+
if (selected === 0) return false;
|
|
3142
|
+
if (selected === groupValues.value.length) return true;
|
|
3143
|
+
return "indeterminate";
|
|
3144
|
+
});
|
|
3145
|
+
function updateSelectAll(checked) {
|
|
3146
|
+
const otherValues = modelValue.value.filter((value) => !includesValue(groupValues.value, value));
|
|
3147
|
+
modelValue.value = checked === true ? [...otherValues, ...groupValues.value] : otherValues;
|
|
3148
|
+
}
|
|
3149
|
+
const checkboxProps = computed(() => ({
|
|
3150
|
+
modelValue: selectAllState.value,
|
|
3151
|
+
disabled: props.disabled,
|
|
3152
|
+
"onUpdate:modelValue": updateSelectAll
|
|
3153
|
+
}));
|
|
3154
|
+
return (_ctx, _cache) => {
|
|
3155
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(_ctx.$attrs, {
|
|
3156
|
+
ref: unref(forwardRef),
|
|
3157
|
+
class: "ui-CheckboxGroup",
|
|
3158
|
+
as: props.as
|
|
3159
|
+
}), {
|
|
3160
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "select-all", { checkboxProps: checkboxProps.value }), createVNode(unref(CheckboxGroupRoot), mergeProps(unref(forwarded), {
|
|
3161
|
+
class: "ui-CheckboxGroupContent",
|
|
3162
|
+
as: props.contentAs,
|
|
3163
|
+
"model-value": unref(modelValue),
|
|
3164
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
3165
|
+
}), {
|
|
3166
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
3167
|
+
_: 3
|
|
3168
|
+
}, 16, ["as", "model-value"])]),
|
|
3169
|
+
_: 3
|
|
3170
|
+
}, 16, ["as"]);
|
|
3171
|
+
};
|
|
3172
|
+
}
|
|
3173
|
+
});
|
|
3174
|
+
//#endregion
|
|
2666
3175
|
//#region src/components/toggle/Toggle.vue
|
|
2667
3176
|
var Toggle_default = /* @__PURE__ */ defineComponent({
|
|
2668
3177
|
__name: "Toggle",
|
|
@@ -2789,7 +3298,7 @@ var ToggleGroupItem_default = /* @__PURE__ */ defineComponent({
|
|
|
2789
3298
|
});
|
|
2790
3299
|
//#endregion
|
|
2791
3300
|
//#region src/components/inputs/TextField.vue?vue&type=script&setup=true&lang.ts
|
|
2792
|
-
var _hoisted_1$
|
|
3301
|
+
var _hoisted_1$27 = ["data-radius", "data-accent-color"];
|
|
2793
3302
|
var _hoisted_2$5 = ["id", "type"];
|
|
2794
3303
|
var _hoisted_3 = ["id", "type"];
|
|
2795
3304
|
var _hoisted_4 = {
|
|
@@ -2828,14 +3337,25 @@ var TextField_default = /* @__PURE__ */ defineComponent({
|
|
|
2828
3337
|
if (target.closest("input, button, a")) return;
|
|
2829
3338
|
const input = inputRef.value;
|
|
2830
3339
|
if (!input) return;
|
|
3340
|
+
input.focus();
|
|
3341
|
+
if (![
|
|
3342
|
+
"text",
|
|
3343
|
+
"search",
|
|
3344
|
+
"tel",
|
|
3345
|
+
"url",
|
|
3346
|
+
"password"
|
|
3347
|
+
].includes(props.type)) return;
|
|
2831
3348
|
const cursorPosition = target.closest("[data-side=right]") ? input.value.length : 0;
|
|
2832
3349
|
requestAnimationFrame(() => {
|
|
2833
3350
|
input.setSelectionRange(cursorPosition, cursorPosition);
|
|
2834
|
-
input.focus();
|
|
2835
3351
|
});
|
|
2836
3352
|
};
|
|
2837
3353
|
const [modelValue, modifiers] = useModel(__props, "modelValue", { set(value) {
|
|
2838
|
-
if (modifiers.number)
|
|
3354
|
+
if (modifiers.number) {
|
|
3355
|
+
if (value === "") return "";
|
|
3356
|
+
const number = parseFloat(value);
|
|
3357
|
+
return Number.isNaN(number) ? value : number;
|
|
3358
|
+
}
|
|
2839
3359
|
if (modifiers.trim) return value.trim();
|
|
2840
3360
|
return value;
|
|
2841
3361
|
} });
|
|
@@ -2871,13 +3391,13 @@ var TextField_default = /* @__PURE__ */ defineComponent({
|
|
|
2871
3391
|
}, _ctx.$attrs, { class: "ui-TextFieldInput" }), null, 16, _hoisted_3)), [[vModelDynamic, unref(modelValue)]]),
|
|
2872
3392
|
_ctx.$slots.left ? (openBlock(), createElementBlock("div", _hoisted_4, [renderSlot(_ctx.$slots, "left")])) : createCommentVNode("", true),
|
|
2873
3393
|
_ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "right")])) : createCommentVNode("", true)
|
|
2874
|
-
], 42, _hoisted_1$
|
|
3394
|
+
], 42, _hoisted_1$27);
|
|
2875
3395
|
};
|
|
2876
3396
|
}
|
|
2877
3397
|
});
|
|
2878
3398
|
//#endregion
|
|
2879
3399
|
//#region src/components/inputs/TextArea.vue?vue&type=script&setup=true&lang.ts
|
|
2880
|
-
var _hoisted_1$
|
|
3400
|
+
var _hoisted_1$26 = ["data-accent-color", "data-radius"];
|
|
2881
3401
|
//#endregion
|
|
2882
3402
|
//#region src/components/inputs/TextArea.vue
|
|
2883
3403
|
var TextArea_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2909,13 +3429,13 @@ var TextArea_default = /* @__PURE__ */ defineComponent({
|
|
|
2909
3429
|
class: normalizeClass(["ui-TextArea", unref(resetClass)]),
|
|
2910
3430
|
"data-accent-color": props.color,
|
|
2911
3431
|
"data-radius": props.radius
|
|
2912
|
-
}, [withDirectives(createElementVNode("textarea", mergeProps({ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event) }, _ctx.$attrs, { class: "ui-TextAreaInput" }), null, 16), [[vModelText, modelValue.value]])], 10, _hoisted_1$
|
|
3432
|
+
}, [withDirectives(createElementVNode("textarea", mergeProps({ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event) }, _ctx.$attrs, { class: "ui-TextAreaInput" }), null, 16), [[vModelText, modelValue.value]])], 10, _hoisted_1$26);
|
|
2913
3433
|
};
|
|
2914
3434
|
}
|
|
2915
3435
|
});
|
|
2916
3436
|
//#endregion
|
|
2917
3437
|
//#region src/components/inputs/ColorField.vue?vue&type=script&setup=true&lang.ts
|
|
2918
|
-
var _hoisted_1$
|
|
3438
|
+
var _hoisted_1$25 = ["id"];
|
|
2919
3439
|
//#endregion
|
|
2920
3440
|
//#region src/components/inputs/ColorField.vue
|
|
2921
3441
|
var ColorField_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2951,7 +3471,7 @@ var ColorField_default = /* @__PURE__ */ defineComponent({
|
|
|
2951
3471
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
2952
3472
|
class: "ui-ColorFieldInput",
|
|
2953
3473
|
type: "color"
|
|
2954
|
-
}, null, 8, _hoisted_1$
|
|
3474
|
+
}, null, 8, _hoisted_1$25), [[vModelText, modelValue.value]])]),
|
|
2955
3475
|
_: 1
|
|
2956
3476
|
}, 8, [
|
|
2957
3477
|
"as",
|
|
@@ -3172,13 +3692,13 @@ var SelectContent_default = /* @__PURE__ */ defineComponent({
|
|
|
3172
3692
|
});
|
|
3173
3693
|
//#endregion
|
|
3174
3694
|
//#region ~icons/radix-icons/chevron-down
|
|
3175
|
-
var _hoisted_1$
|
|
3695
|
+
var _hoisted_1$24 = {
|
|
3176
3696
|
viewBox: "0 0 15 15",
|
|
3177
3697
|
width: "1em",
|
|
3178
3698
|
height: "1em"
|
|
3179
3699
|
};
|
|
3180
3700
|
function render$12(_ctx, _cache) {
|
|
3181
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
3701
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$24, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
3182
3702
|
fill: "currentColor",
|
|
3183
3703
|
d: "M11.158 6.135a.5.5 0 0 1 .684.73l-4 3.75a.5.5 0 0 1-.684 0l-4-3.75l-.066-.077a.5.5 0 0 1 .67-.715l.08.062L7.5 9.564z"
|
|
3184
3704
|
}, null, -1)])]);
|
|
@@ -3189,7 +3709,7 @@ var chevron_down_default = markRaw({
|
|
|
3189
3709
|
});
|
|
3190
3710
|
//#endregion
|
|
3191
3711
|
//#region src/components/select/SelectTrigger.vue?vue&type=script&setup=true&lang.ts
|
|
3192
|
-
var _hoisted_1$
|
|
3712
|
+
var _hoisted_1$23 = { class: "ui-SelectTriggerInner" };
|
|
3193
3713
|
//#endregion
|
|
3194
3714
|
//#region src/components/select/SelectTrigger.vue
|
|
3195
3715
|
var SelectTrigger_default = /* @__PURE__ */ defineComponent({
|
|
@@ -3216,7 +3736,7 @@ var SelectTrigger_default = /* @__PURE__ */ defineComponent({
|
|
|
3216
3736
|
"data-accent-color": unref(context).color.value,
|
|
3217
3737
|
"data-radius": props.radius
|
|
3218
3738
|
}, {
|
|
3219
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_1$
|
|
3739
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_1$23, [createVNode(unref(SelectValue), { placeholder: props.placeholder }, {
|
|
3220
3740
|
default: withCtx(({ selectedLabel, modelValue }) => [selectedLabel.length ? renderSlot(_ctx.$slots, "default", {
|
|
3221
3741
|
selectedLabel,
|
|
3222
3742
|
modelValue
|
|
@@ -3235,13 +3755,13 @@ var SelectTrigger_default = /* @__PURE__ */ defineComponent({
|
|
|
3235
3755
|
});
|
|
3236
3756
|
//#endregion
|
|
3237
3757
|
//#region ~icons/radix-icons/check
|
|
3238
|
-
var _hoisted_1$
|
|
3758
|
+
var _hoisted_1$22 = {
|
|
3239
3759
|
viewBox: "0 0 15 15",
|
|
3240
3760
|
width: "1em",
|
|
3241
3761
|
height: "1em"
|
|
3242
3762
|
};
|
|
3243
3763
|
function render$11(_ctx, _cache) {
|
|
3244
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
3764
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$22, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
3245
3765
|
fill: "currentColor",
|
|
3246
3766
|
d: "M10.602 3.908a.626.626 0 0 1 1.046.684l-4.25 6.5a.626.626 0 0 1-.944.12l-2.75-2.5l-.084-.094a.626.626 0 0 1 .823-.906l.103.075l2.207 2.006z"
|
|
3247
3767
|
}, null, -1)])]);
|
|
@@ -3301,12 +3821,12 @@ var SelectLabel_default = /* @__PURE__ */ defineComponent({
|
|
|
3301
3821
|
//#endregion
|
|
3302
3822
|
//#region src/components/select/SelectSeparator.vue
|
|
3303
3823
|
var _sfc_main$1 = {};
|
|
3304
|
-
var _hoisted_1$
|
|
3824
|
+
var _hoisted_1$21 = {
|
|
3305
3825
|
class: "ui-SelectSeparator",
|
|
3306
3826
|
"aria-hidden": "true"
|
|
3307
3827
|
};
|
|
3308
3828
|
function _sfc_render$1(_ctx, _cache) {
|
|
3309
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3829
|
+
return openBlock(), createElementBlock("div", _hoisted_1$21);
|
|
3310
3830
|
}
|
|
3311
3831
|
var SelectSeparator_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
3312
3832
|
//#endregion
|
|
@@ -3377,7 +3897,7 @@ var ComboboxRoot_default = /* @__PURE__ */ defineComponent({
|
|
|
3377
3897
|
});
|
|
3378
3898
|
//#endregion
|
|
3379
3899
|
//#region src/components/combobox/ComboboxInput.vue?vue&type=script&setup=true&lang.ts
|
|
3380
|
-
var _hoisted_1$
|
|
3900
|
+
var _hoisted_1$20 = ["aria-current", "value"];
|
|
3381
3901
|
var _hoisted_2$4 = ["onClick"];
|
|
3382
3902
|
//#endregion
|
|
3383
3903
|
//#region src/components/combobox/ComboboxInput.vue
|
|
@@ -3453,7 +3973,7 @@ var ComboboxInput_default = /* @__PURE__ */ defineComponent({
|
|
|
3453
3973
|
tabindex: "-1",
|
|
3454
3974
|
class: normalizeClass(props.ui?.remove),
|
|
3455
3975
|
onClick: withModifiers(($event) => onDeleteIndex(index), ["prevent"])
|
|
3456
|
-
}, [createVNode(unref(cross_2_default))], 10, _hoisted_2$4)], 10, _hoisted_1$
|
|
3976
|
+
}, [createVNode(unref(cross_2_default))], 10, _hoisted_2$4)], 10, _hoisted_1$20);
|
|
3457
3977
|
}), 128)), createVNode(unref(ComboboxInput), mergeProps({
|
|
3458
3978
|
..._ctx.$attrs,
|
|
3459
3979
|
...unref(forwarded),
|
|
@@ -3639,7 +4159,7 @@ var ComboboxEmpty_default = /* @__PURE__ */ defineComponent({
|
|
|
3639
4159
|
});
|
|
3640
4160
|
//#endregion
|
|
3641
4161
|
//#region src/components/radio/Radio.vue?vue&type=script&setup=true&lang.ts
|
|
3642
|
-
var _hoisted_1$
|
|
4162
|
+
var _hoisted_1$19 = ["data-accent-color"];
|
|
3643
4163
|
//#endregion
|
|
3644
4164
|
//#region src/components/radio/Radio.vue
|
|
3645
4165
|
var Radio_default = /* @__PURE__ */ defineComponent({
|
|
@@ -3672,7 +4192,7 @@ var Radio_default = /* @__PURE__ */ defineComponent({
|
|
|
3672
4192
|
class: normalizeClass(["ui-RadioBase ui-Radio", unref(resetClass)]),
|
|
3673
4193
|
type: "radio",
|
|
3674
4194
|
"data-accent-color": props.color
|
|
3675
|
-
}, null, 10, _hoisted_1$
|
|
4195
|
+
}, null, 10, _hoisted_1$19)), [[vModelRadio, unref(modelValue)]]);
|
|
3676
4196
|
};
|
|
3677
4197
|
}
|
|
3678
4198
|
});
|
|
@@ -3724,7 +4244,7 @@ var RadioGroupRoot_default = /* @__PURE__ */ defineComponent({
|
|
|
3724
4244
|
});
|
|
3725
4245
|
//#endregion
|
|
3726
4246
|
//#region src/components/radio/RadioGroupItem.vue?vue&type=script&setup=true&lang.ts
|
|
3727
|
-
var _hoisted_1$
|
|
4247
|
+
var _hoisted_1$18 = { class: "ui-RadioGroupItem" };
|
|
3728
4248
|
//#endregion
|
|
3729
4249
|
//#region src/components/radio/RadioGroupItem.vue
|
|
3730
4250
|
var RadioGroupItem_default = /* @__PURE__ */ defineComponent({
|
|
@@ -3756,7 +4276,7 @@ var RadioGroupItem_default = /* @__PURE__ */ defineComponent({
|
|
|
3756
4276
|
"highContrast"
|
|
3757
4277
|
]);
|
|
3758
4278
|
return (_ctx, _cache) => {
|
|
3759
|
-
return openBlock(), createElementBlock("label", _hoisted_1$
|
|
4279
|
+
return openBlock(), createElementBlock("label", _hoisted_1$18, [createVNode(unref(RadioGroupItem), mergeProps({
|
|
3760
4280
|
class: ["ui-RadioBase ui-RadioGroupItemIndicator", unref(resetClass)],
|
|
3761
4281
|
"data-accent-color": props.color
|
|
3762
4282
|
}, unref(forwarded)), null, 16, ["class", "data-accent-color"]), renderSlot(_ctx.$slots, "default")]);
|
|
@@ -3942,7 +4462,7 @@ var TabsList_default = /* @__PURE__ */ defineComponent({
|
|
|
3942
4462
|
});
|
|
3943
4463
|
//#endregion
|
|
3944
4464
|
//#region src/components/tabs/TabsTrigger.vue?vue&type=script&setup=true&lang.ts
|
|
3945
|
-
var _hoisted_1$
|
|
4465
|
+
var _hoisted_1$17 = { class: "ui-TabTriggerInner" };
|
|
3946
4466
|
var _hoisted_2$3 = { class: "ui-TabTriggerInnerHidden" };
|
|
3947
4467
|
//#endregion
|
|
3948
4468
|
//#region src/components/tabs/TabsTrigger.vue
|
|
@@ -3958,7 +4478,7 @@ var TabsTrigger_default = /* @__PURE__ */ defineComponent({
|
|
|
3958
4478
|
const forwarded = useForwardProps(__props);
|
|
3959
4479
|
return (_ctx, _cache) => {
|
|
3960
4480
|
return openBlock(), createBlock(unref(TabsTrigger), mergeProps(unref(forwarded), { class: "ui-TabTrigger" }), {
|
|
3961
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_1$
|
|
4481
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_1$17, [renderSlot(_ctx.$slots, "default")]), createElementVNode("span", _hoisted_2$3, [renderSlot(_ctx.$slots, "default")])]),
|
|
3962
4482
|
_: 3
|
|
3963
4483
|
}, 16);
|
|
3964
4484
|
};
|
|
@@ -4019,6 +4539,405 @@ var Editable_default = /* @__PURE__ */ defineComponent({
|
|
|
4019
4539
|
}
|
|
4020
4540
|
});
|
|
4021
4541
|
//#endregion
|
|
4542
|
+
//#region src/components/form/context.ts
|
|
4543
|
+
var [injectFieldContext, provideFieldContext] = createContext("ui:FieldRoot");
|
|
4544
|
+
var [injectFormContext, provideFormContext] = createContext("ui:FormRoot");
|
|
4545
|
+
function normalizeErrors(value) {
|
|
4546
|
+
if (!value) return [];
|
|
4547
|
+
return Array.isArray(value) ? value.filter(Boolean) : [value];
|
|
4548
|
+
}
|
|
4549
|
+
//#endregion
|
|
4550
|
+
//#region src/components/form/FormRoot.vue
|
|
4551
|
+
var FormRoot_default = /* @__PURE__ */ defineComponent({
|
|
4552
|
+
__name: "FormRoot",
|
|
4553
|
+
props: { errors: {} },
|
|
4554
|
+
emits: [
|
|
4555
|
+
"submit",
|
|
4556
|
+
"reset",
|
|
4557
|
+
"invalid"
|
|
4558
|
+
],
|
|
4559
|
+
setup(__props, { emit: __emit }) {
|
|
4560
|
+
const props = __props;
|
|
4561
|
+
const emits = __emit;
|
|
4562
|
+
const fields = /* @__PURE__ */ new Set();
|
|
4563
|
+
const localErrors = ref({});
|
|
4564
|
+
const clearedErrors = ref(/* @__PURE__ */ new Set());
|
|
4565
|
+
const externalErrors = toRef(props, "errors");
|
|
4566
|
+
const mergedErrors = computed(() => {
|
|
4567
|
+
const result = { ...localErrors.value };
|
|
4568
|
+
for (const [name, value] of Object.entries(externalErrors.value || {})) if (!clearedErrors.value.has(name)) result[name] = value;
|
|
4569
|
+
return result;
|
|
4570
|
+
});
|
|
4571
|
+
watch(externalErrors, () => clearedErrors.value = /* @__PURE__ */ new Set());
|
|
4572
|
+
const context = provideFormContext({
|
|
4573
|
+
errors: mergedErrors,
|
|
4574
|
+
registerField: (field) => fields.add(field),
|
|
4575
|
+
unregisterField: (field) => fields.delete(field),
|
|
4576
|
+
clearError: (name) => {
|
|
4577
|
+
if (!name) {
|
|
4578
|
+
localErrors.value = {};
|
|
4579
|
+
clearedErrors.value = new Set(Object.keys(externalErrors.value || {}));
|
|
4580
|
+
return;
|
|
4581
|
+
}
|
|
4582
|
+
if (name in localErrors.value) {
|
|
4583
|
+
const next = { ...localErrors.value };
|
|
4584
|
+
delete next[name];
|
|
4585
|
+
localErrors.value = next;
|
|
4586
|
+
}
|
|
4587
|
+
if (name in (externalErrors.value || {})) clearedErrors.value = new Set(clearedErrors.value).add(name);
|
|
4588
|
+
},
|
|
4589
|
+
validate: async () => {
|
|
4590
|
+
return (await Promise.all(Array.from(fields, (field) => field.validate()))).every(Boolean);
|
|
4591
|
+
}
|
|
4592
|
+
});
|
|
4593
|
+
const onSubmit = async (event) => {
|
|
4594
|
+
event.preventDefault();
|
|
4595
|
+
if (!await context.validate()) {
|
|
4596
|
+
await nextTick();
|
|
4597
|
+
(Array.from(fields).find((field) => field.invalid.value)?.control.value)?.focus();
|
|
4598
|
+
return;
|
|
4599
|
+
}
|
|
4600
|
+
emits("submit", event);
|
|
4601
|
+
};
|
|
4602
|
+
const onReset = (event) => {
|
|
4603
|
+
emits("reset", event);
|
|
4604
|
+
fields.forEach((field) => field.reset());
|
|
4605
|
+
nextTick(() => {
|
|
4606
|
+
localErrors.value = {};
|
|
4607
|
+
clearedErrors.value = /* @__PURE__ */ new Set();
|
|
4608
|
+
});
|
|
4609
|
+
};
|
|
4610
|
+
const onInvalid = (event) => {
|
|
4611
|
+
const target = event.target;
|
|
4612
|
+
if (target instanceof HTMLElement) Array.from(fields).find((item) => item.control.value === target || item.controlId.value === target.id || target.closest("[data-field-control]") === item.control.value)?.syncValidity(target, true);
|
|
4613
|
+
emits("invalid", event);
|
|
4614
|
+
};
|
|
4615
|
+
return (_ctx, _cache) => {
|
|
4616
|
+
return openBlock(), createElementBlock("form", {
|
|
4617
|
+
class: "ui-FormRoot",
|
|
4618
|
+
onSubmit,
|
|
4619
|
+
onReset,
|
|
4620
|
+
onInvalidCapture: onInvalid
|
|
4621
|
+
}, [renderSlot(_ctx.$slots, "default")], 32);
|
|
4622
|
+
};
|
|
4623
|
+
}
|
|
4624
|
+
});
|
|
4625
|
+
//#endregion
|
|
4626
|
+
//#region src/components/form/FieldRoot.vue?vue&type=script&setup=true&lang.ts
|
|
4627
|
+
var _hoisted_1$16 = [
|
|
4628
|
+
"data-invalid",
|
|
4629
|
+
"data-focused",
|
|
4630
|
+
"data-touched",
|
|
4631
|
+
"data-dirty",
|
|
4632
|
+
"data-disabled",
|
|
4633
|
+
"data-required"
|
|
4634
|
+
];
|
|
4635
|
+
//#endregion
|
|
4636
|
+
//#region src/components/form/FieldRoot.vue
|
|
4637
|
+
var FieldRoot_default = /* @__PURE__ */ defineComponent({
|
|
4638
|
+
__name: "FieldRoot",
|
|
4639
|
+
props: {
|
|
4640
|
+
name: {},
|
|
4641
|
+
id: {},
|
|
4642
|
+
required: {
|
|
4643
|
+
type: Boolean,
|
|
4644
|
+
default: false
|
|
4645
|
+
},
|
|
4646
|
+
disabled: {
|
|
4647
|
+
type: Boolean,
|
|
4648
|
+
default: false
|
|
4649
|
+
},
|
|
4650
|
+
validate: {},
|
|
4651
|
+
errors: {}
|
|
4652
|
+
},
|
|
4653
|
+
setup(__props) {
|
|
4654
|
+
const props = __props;
|
|
4655
|
+
const form = injectFormContext(null);
|
|
4656
|
+
const uid = useId().replace(/:/g, "");
|
|
4657
|
+
const name = toRef(props, "name");
|
|
4658
|
+
const required = toRef(props, "required");
|
|
4659
|
+
const disabled = toRef(props, "disabled");
|
|
4660
|
+
const control = ref();
|
|
4661
|
+
const descriptionPresent = ref(false);
|
|
4662
|
+
const validity = ref();
|
|
4663
|
+
const focused = ref(false);
|
|
4664
|
+
const touched = ref(false);
|
|
4665
|
+
const dirty = ref(false);
|
|
4666
|
+
const nativeValidityVisible = ref(false);
|
|
4667
|
+
const initialValue = ref();
|
|
4668
|
+
const localErrors = ref(normalizeErrors(props.errors));
|
|
4669
|
+
const controlId = computed(() => props.id || `ui-field-${uid}`);
|
|
4670
|
+
const descriptionId = computed(() => `${controlId.value}-description`);
|
|
4671
|
+
const errorId = computed(() => `${controlId.value}-error`);
|
|
4672
|
+
const serverErrors = computed(() => normalizeErrors(name.value ? form?.errors.value[name.value] : void 0));
|
|
4673
|
+
const fieldErrors = computed(() => {
|
|
4674
|
+
const nativeError = nativeValidityVisible.value && validity.value?.valid === false ? "validationMessage" in (control.value || {}) ? control.value.validationMessage : void 0 : void 0;
|
|
4675
|
+
return [
|
|
4676
|
+
...serverErrors.value,
|
|
4677
|
+
...localErrors.value,
|
|
4678
|
+
...normalizeErrors(nativeError)
|
|
4679
|
+
];
|
|
4680
|
+
});
|
|
4681
|
+
const invalid = computed(() => fieldErrors.value.length > 0);
|
|
4682
|
+
const describedBy = computed(() => {
|
|
4683
|
+
const ids = [];
|
|
4684
|
+
if (descriptionPresent.value) ids.push(descriptionId.value);
|
|
4685
|
+
if (fieldErrors.value.length) ids.push(errorId.value);
|
|
4686
|
+
return ids.length ? ids.join(" ") : void 0;
|
|
4687
|
+
});
|
|
4688
|
+
const syncValidity = (element = control.value, reveal = false) => {
|
|
4689
|
+
if (reveal) nativeValidityVisible.value = true;
|
|
4690
|
+
validity.value = element && "validity" in element ? element.validity : void 0;
|
|
4691
|
+
};
|
|
4692
|
+
const setControl = (element) => {
|
|
4693
|
+
control.value = element;
|
|
4694
|
+
if (element && "value" in element && initialValue.value === void 0) initialValue.value = element.value;
|
|
4695
|
+
syncValidity(element);
|
|
4696
|
+
};
|
|
4697
|
+
const setDescriptionPresent = (present) => {
|
|
4698
|
+
descriptionPresent.value = present;
|
|
4699
|
+
};
|
|
4700
|
+
const valueOf = () => {
|
|
4701
|
+
return control.value?.value;
|
|
4702
|
+
};
|
|
4703
|
+
const validate = async () => {
|
|
4704
|
+
syncValidity(void 0, true);
|
|
4705
|
+
let nextErrors = [];
|
|
4706
|
+
if (props.validate) nextErrors = normalizeErrors(await props.validate(valueOf()));
|
|
4707
|
+
localErrors.value = nextErrors;
|
|
4708
|
+
return !invalid.value;
|
|
4709
|
+
};
|
|
4710
|
+
const reset = () => {
|
|
4711
|
+
const element = control.value;
|
|
4712
|
+
if (element && initialValue.value !== void 0 && "value" in element) {
|
|
4713
|
+
const input = element;
|
|
4714
|
+
input.value = initialValue.value;
|
|
4715
|
+
element.dispatchEvent(new Event("input", { bubbles: true }));
|
|
4716
|
+
}
|
|
4717
|
+
validity.value = void 0;
|
|
4718
|
+
nativeValidityVisible.value = false;
|
|
4719
|
+
focused.value = false;
|
|
4720
|
+
touched.value = false;
|
|
4721
|
+
dirty.value = false;
|
|
4722
|
+
localErrors.value = normalizeErrors(props.errors);
|
|
4723
|
+
syncValidity();
|
|
4724
|
+
};
|
|
4725
|
+
watch(() => props.errors, (value) => {
|
|
4726
|
+
localErrors.value = normalizeErrors(value);
|
|
4727
|
+
});
|
|
4728
|
+
const fieldContext = {
|
|
4729
|
+
name,
|
|
4730
|
+
controlId,
|
|
4731
|
+
descriptionId,
|
|
4732
|
+
descriptionPresent,
|
|
4733
|
+
errorId,
|
|
4734
|
+
describedBy,
|
|
4735
|
+
errors: fieldErrors,
|
|
4736
|
+
invalid,
|
|
4737
|
+
required,
|
|
4738
|
+
disabled,
|
|
4739
|
+
validity,
|
|
4740
|
+
control,
|
|
4741
|
+
setControl,
|
|
4742
|
+
setDescriptionPresent,
|
|
4743
|
+
markFocused: (value) => {
|
|
4744
|
+
focused.value = value;
|
|
4745
|
+
},
|
|
4746
|
+
markTouched: () => {
|
|
4747
|
+
touched.value = true;
|
|
4748
|
+
},
|
|
4749
|
+
markDirty: () => {
|
|
4750
|
+
dirty.value = true;
|
|
4751
|
+
localErrors.value = [];
|
|
4752
|
+
nativeValidityVisible.value = false;
|
|
4753
|
+
form?.clearError(name.value);
|
|
4754
|
+
},
|
|
4755
|
+
validate,
|
|
4756
|
+
syncValidity,
|
|
4757
|
+
reset
|
|
4758
|
+
};
|
|
4759
|
+
provideFieldContext(fieldContext);
|
|
4760
|
+
onMounted(() => form?.registerField(fieldContext));
|
|
4761
|
+
onBeforeUnmount(() => {
|
|
4762
|
+
form?.unregisterField(fieldContext);
|
|
4763
|
+
});
|
|
4764
|
+
return (_ctx, _cache) => {
|
|
4765
|
+
return openBlock(), createElementBlock("div", {
|
|
4766
|
+
class: "ui-FieldRoot",
|
|
4767
|
+
"data-invalid": invalid.value || void 0,
|
|
4768
|
+
"data-focused": focused.value || void 0,
|
|
4769
|
+
"data-touched": touched.value || void 0,
|
|
4770
|
+
"data-dirty": dirty.value || void 0,
|
|
4771
|
+
"data-disabled": disabled.value || void 0,
|
|
4772
|
+
"data-required": required.value || void 0
|
|
4773
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$16);
|
|
4774
|
+
};
|
|
4775
|
+
}
|
|
4776
|
+
});
|
|
4777
|
+
//#endregion
|
|
4778
|
+
//#region src/components/form/FieldLabel.vue
|
|
4779
|
+
var FieldLabel_default = /* @__PURE__ */ defineComponent({
|
|
4780
|
+
__name: "FieldLabel",
|
|
4781
|
+
props: {
|
|
4782
|
+
as: { default: "label" },
|
|
4783
|
+
asChild: { type: Boolean },
|
|
4784
|
+
for: {}
|
|
4785
|
+
},
|
|
4786
|
+
setup(__props) {
|
|
4787
|
+
const props = __props;
|
|
4788
|
+
const field = injectFieldContext();
|
|
4789
|
+
return (_ctx, _cache) => {
|
|
4790
|
+
return openBlock(), createBlock(unref(Primitive), {
|
|
4791
|
+
class: "ui-FieldLabel",
|
|
4792
|
+
as: props.as,
|
|
4793
|
+
"as-child": props.asChild,
|
|
4794
|
+
for: props.for || unref(field).controlId.value
|
|
4795
|
+
}, {
|
|
4796
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
4797
|
+
_: 3
|
|
4798
|
+
}, 8, [
|
|
4799
|
+
"as",
|
|
4800
|
+
"as-child",
|
|
4801
|
+
"for"
|
|
4802
|
+
]);
|
|
4803
|
+
};
|
|
4804
|
+
}
|
|
4805
|
+
});
|
|
4806
|
+
//#endregion
|
|
4807
|
+
//#region src/components/form/FieldControl.vue
|
|
4808
|
+
var FieldControl_default = /* @__PURE__ */ defineComponent({
|
|
4809
|
+
inheritAttrs: false,
|
|
4810
|
+
__name: "FieldControl",
|
|
4811
|
+
props: {
|
|
4812
|
+
as: { default: "input" },
|
|
4813
|
+
asChild: { type: Boolean },
|
|
4814
|
+
id: {}
|
|
4815
|
+
},
|
|
4816
|
+
setup(__props) {
|
|
4817
|
+
const props = __props;
|
|
4818
|
+
const attrs = useAttrs();
|
|
4819
|
+
const field = injectFieldContext();
|
|
4820
|
+
const primitiveRef = ref();
|
|
4821
|
+
const controlAttrs = computed(() => {
|
|
4822
|
+
const result = { ...attrs };
|
|
4823
|
+
const generatedDescribedBy = field.describedBy.value;
|
|
4824
|
+
const describedBy = [attrs["aria-describedby"], generatedDescribedBy].filter(Boolean).join(" ");
|
|
4825
|
+
result.id = props.id || field.controlId.value;
|
|
4826
|
+
if (field.name.value && !result.name) result.name = field.name.value;
|
|
4827
|
+
if (field.required.value) result.required = true;
|
|
4828
|
+
if (field.disabled.value) result.disabled = true;
|
|
4829
|
+
if (describedBy) result["aria-describedby"] = describedBy;
|
|
4830
|
+
if (field.invalid.value) result["aria-invalid"] = "true";
|
|
4831
|
+
if (field.required.value) result["aria-required"] = "true";
|
|
4832
|
+
result["data-field-control"] = true;
|
|
4833
|
+
return result;
|
|
4834
|
+
});
|
|
4835
|
+
const findControl = () => {
|
|
4836
|
+
const root = primitiveRef.value?.$el;
|
|
4837
|
+
if (!root) return void 0;
|
|
4838
|
+
if (root.matches?.("[data-field-control], input, textarea, select, button")) return root;
|
|
4839
|
+
return root.querySelector("[data-field-control], input, textarea, select, button") || root;
|
|
4840
|
+
};
|
|
4841
|
+
const onInput = () => {
|
|
4842
|
+
field.markDirty();
|
|
4843
|
+
field.syncValidity(findControl());
|
|
4844
|
+
};
|
|
4845
|
+
const onChange = () => {
|
|
4846
|
+
field.markDirty();
|
|
4847
|
+
field.syncValidity(findControl());
|
|
4848
|
+
};
|
|
4849
|
+
const onFocus = () => field.markFocused(true);
|
|
4850
|
+
const onBlur = async () => {
|
|
4851
|
+
field.markFocused(false);
|
|
4852
|
+
field.markTouched();
|
|
4853
|
+
await field.validate();
|
|
4854
|
+
};
|
|
4855
|
+
onMounted(() => nextTick(() => field.setControl(findControl())));
|
|
4856
|
+
return (_ctx, _cache) => {
|
|
4857
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(controlAttrs.value, {
|
|
4858
|
+
ref_key: "primitiveRef",
|
|
4859
|
+
ref: primitiveRef,
|
|
4860
|
+
as: props.as,
|
|
4861
|
+
"as-child": props.asChild,
|
|
4862
|
+
onInput,
|
|
4863
|
+
onChange,
|
|
4864
|
+
onFocus,
|
|
4865
|
+
onBlur
|
|
4866
|
+
}), {
|
|
4867
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
4868
|
+
_: 3
|
|
4869
|
+
}, 16, ["as", "as-child"]);
|
|
4870
|
+
};
|
|
4871
|
+
}
|
|
4872
|
+
});
|
|
4873
|
+
//#endregion
|
|
4874
|
+
//#region src/components/form/FieldDescription.vue
|
|
4875
|
+
var FieldDescription_default = /* @__PURE__ */ defineComponent({
|
|
4876
|
+
__name: "FieldDescription",
|
|
4877
|
+
props: {
|
|
4878
|
+
as: { default: "p" },
|
|
4879
|
+
asChild: { type: Boolean }
|
|
4880
|
+
},
|
|
4881
|
+
setup(__props) {
|
|
4882
|
+
const props = __props;
|
|
4883
|
+
const field = injectFieldContext();
|
|
4884
|
+
onMounted(() => field.setDescriptionPresent(true));
|
|
4885
|
+
onBeforeUnmount(() => field.setDescriptionPresent(false));
|
|
4886
|
+
return (_ctx, _cache) => {
|
|
4887
|
+
return openBlock(), createBlock(unref(Primitive), {
|
|
4888
|
+
id: unref(field).descriptionId.value,
|
|
4889
|
+
class: "ui-FieldDescription",
|
|
4890
|
+
as: props.as,
|
|
4891
|
+
"as-child": props.asChild
|
|
4892
|
+
}, {
|
|
4893
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
4894
|
+
_: 3
|
|
4895
|
+
}, 8, [
|
|
4896
|
+
"id",
|
|
4897
|
+
"as",
|
|
4898
|
+
"as-child"
|
|
4899
|
+
]);
|
|
4900
|
+
};
|
|
4901
|
+
}
|
|
4902
|
+
});
|
|
4903
|
+
//#endregion
|
|
4904
|
+
//#region src/components/form/FieldError.vue
|
|
4905
|
+
var FieldError_default = /* @__PURE__ */ defineComponent({
|
|
4906
|
+
__name: "FieldError",
|
|
4907
|
+
props: {
|
|
4908
|
+
as: { default: "p" },
|
|
4909
|
+
asChild: { type: Boolean },
|
|
4910
|
+
match: {}
|
|
4911
|
+
},
|
|
4912
|
+
setup(__props) {
|
|
4913
|
+
const props = __props;
|
|
4914
|
+
const field = injectFieldContext();
|
|
4915
|
+
const errors = computed(() => {
|
|
4916
|
+
if (props.match && field.validity.value?.[props.match] !== true) return [];
|
|
4917
|
+
return field.errors.value;
|
|
4918
|
+
});
|
|
4919
|
+
return (_ctx, _cache) => {
|
|
4920
|
+
return errors.value.length ? (openBlock(), createBlock(unref(Primitive), {
|
|
4921
|
+
key: 0,
|
|
4922
|
+
id: unref(field).errorId.value,
|
|
4923
|
+
class: "ui-FieldError",
|
|
4924
|
+
as: props.as,
|
|
4925
|
+
"as-child": props.asChild,
|
|
4926
|
+
"data-invalid": true
|
|
4927
|
+
}, {
|
|
4928
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", { errors: errors.value }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(errors.value, (error) => {
|
|
4929
|
+
return openBlock(), createElementBlock("span", { key: error }, toDisplayString(error), 1);
|
|
4930
|
+
}), 128))])]),
|
|
4931
|
+
_: 3
|
|
4932
|
+
}, 8, [
|
|
4933
|
+
"id",
|
|
4934
|
+
"as",
|
|
4935
|
+
"as-child"
|
|
4936
|
+
])) : createCommentVNode("", true);
|
|
4937
|
+
};
|
|
4938
|
+
}
|
|
4939
|
+
});
|
|
4940
|
+
//#endregion
|
|
4022
4941
|
//#region src/components/accordion/AccordionRoot.vue?vue&type=script&setup=true&lang.ts
|
|
4023
4942
|
var [injectAccordionRootContext, provideAccordionRootContext] = createContext("ui:AccordionRoot");
|
|
4024
4943
|
//#endregion
|
|
@@ -4493,29 +5412,6 @@ var Pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
4493
5412
|
}
|
|
4494
5413
|
});
|
|
4495
5414
|
//#endregion
|
|
4496
|
-
//#region ../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.42_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js
|
|
4497
|
-
/**
|
|
4498
|
-
* Keep states in the global scope to be reusable across Vue instances.
|
|
4499
|
-
*
|
|
4500
|
-
* @see https://vueuse.org/createGlobalState
|
|
4501
|
-
* @param stateFactory A factory function to create the state
|
|
4502
|
-
*
|
|
4503
|
-
* @__NO_SIDE_EFFECTS__
|
|
4504
|
-
*/
|
|
4505
|
-
function createGlobalState(stateFactory) {
|
|
4506
|
-
let initialized = false;
|
|
4507
|
-
let state;
|
|
4508
|
-
const scope = effectScope(true);
|
|
4509
|
-
return ((...args) => {
|
|
4510
|
-
if (!initialized) {
|
|
4511
|
-
state = scope.run(() => stateFactory(...args));
|
|
4512
|
-
initialized = true;
|
|
4513
|
-
}
|
|
4514
|
-
return state;
|
|
4515
|
-
});
|
|
4516
|
-
}
|
|
4517
|
-
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
4518
|
-
//#endregion
|
|
4519
5415
|
//#region src/components/toast/manager.ts
|
|
4520
5416
|
var count = 0;
|
|
4521
5417
|
var useToastManager = createGlobalState(() => {
|
|
@@ -4594,7 +5490,7 @@ var useToastManager = createGlobalState(() => {
|
|
|
4594
5490
|
...msg,
|
|
4595
5491
|
category: "error"
|
|
4596
5492
|
});
|
|
4597
|
-
}
|
|
5493
|
+
} else remove(id);
|
|
4598
5494
|
});
|
|
4599
5495
|
return id;
|
|
4600
5496
|
};
|
|
@@ -4717,13 +5613,17 @@ var ToastItem_default = /* @__PURE__ */ defineComponent({
|
|
|
4717
5613
|
setup(__props) {
|
|
4718
5614
|
const props = __props;
|
|
4719
5615
|
const toastRef = useTemplateRef("toastRef");
|
|
5616
|
+
const layoutRef = useTemplateRef("layoutRef");
|
|
4720
5617
|
const paused = ref(false);
|
|
4721
5618
|
const manager = useToastManager();
|
|
5619
|
+
let resizeObserver;
|
|
4722
5620
|
const styleVars = computed(() => {
|
|
4723
5621
|
const offsetY = manager.messages.value.slice(0, props.index).map((item) => item.height || 60).reduce((sum, num) => sum + num, 0);
|
|
5622
|
+
const frontHeight = manager.messages.value[0]?.height || 60;
|
|
4724
5623
|
return {
|
|
4725
5624
|
"--toast-index": props.index,
|
|
4726
|
-
"--toast-offset-y": offsetY + "px"
|
|
5625
|
+
"--toast-offset-y": offsetY + "px",
|
|
5626
|
+
"--toast-front-height": frontHeight + "px"
|
|
4727
5627
|
};
|
|
4728
5628
|
});
|
|
4729
5629
|
const categoryIcon = computed(() => {
|
|
@@ -4747,7 +5647,25 @@ var ToastItem_default = /* @__PURE__ */ defineComponent({
|
|
|
4747
5647
|
};
|
|
4748
5648
|
onMounted(() => {
|
|
4749
5649
|
const el = toastRef.value.$el;
|
|
4750
|
-
|
|
5650
|
+
const layout = layoutRef.value;
|
|
5651
|
+
let height;
|
|
5652
|
+
const updateHeight = () => {
|
|
5653
|
+
const borderHeight = el.offsetHeight - el.clientHeight;
|
|
5654
|
+
const nextHeight = layout.offsetHeight + borderHeight;
|
|
5655
|
+
if (nextHeight !== height) {
|
|
5656
|
+
height = nextHeight;
|
|
5657
|
+
manager.update(props.message.id, { height: nextHeight });
|
|
5658
|
+
}
|
|
5659
|
+
};
|
|
5660
|
+
updateHeight();
|
|
5661
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
5662
|
+
resizeObserver = new ResizeObserver(updateHeight);
|
|
5663
|
+
resizeObserver.observe(layout);
|
|
5664
|
+
}
|
|
5665
|
+
});
|
|
5666
|
+
onBeforeUnmount(() => {
|
|
5667
|
+
resizeObserver?.disconnect();
|
|
5668
|
+
resizeObserver = void 0;
|
|
4751
5669
|
});
|
|
4752
5670
|
return (_ctx, _cache) => {
|
|
4753
5671
|
return openBlock(), createBlock(unref(ToastRoot), {
|
|
@@ -4763,7 +5681,11 @@ var ToastItem_default = /* @__PURE__ */ defineComponent({
|
|
|
4763
5681
|
onPause,
|
|
4764
5682
|
onResume
|
|
4765
5683
|
}, {
|
|
4766
|
-
default: withCtx(() => [
|
|
5684
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
5685
|
+
ref_key: "layoutRef",
|
|
5686
|
+
ref: layoutRef,
|
|
5687
|
+
class: "ui-ToastLayout"
|
|
5688
|
+
}, [
|
|
4767
5689
|
__props.message.category ? (openBlock(), createElementBlock("div", {
|
|
4768
5690
|
key: 0,
|
|
4769
5691
|
class: "ui-ToastIcon",
|
|
@@ -4802,7 +5724,7 @@ var ToastItem_default = /* @__PURE__ */ defineComponent({
|
|
|
4802
5724
|
])]),
|
|
4803
5725
|
_: 1
|
|
4804
5726
|
}, 8, ["alt-text", "onClick"])) : createCommentVNode("", true)
|
|
4805
|
-
]),
|
|
5727
|
+
], 512)]),
|
|
4806
5728
|
_: 1
|
|
4807
5729
|
}, 8, [
|
|
4808
5730
|
"duration",
|
|
@@ -4819,6 +5741,7 @@ var ToastProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
4819
5741
|
inheritAttrs: false,
|
|
4820
5742
|
__name: "ToastProvider",
|
|
4821
5743
|
props: {
|
|
5744
|
+
breakpoint: { default: 640 },
|
|
4822
5745
|
size: { default: "1" },
|
|
4823
5746
|
position: { default: "bottom-right" },
|
|
4824
5747
|
label: {},
|
|
@@ -4829,8 +5752,31 @@ var ToastProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
4829
5752
|
},
|
|
4830
5753
|
setup(__props) {
|
|
4831
5754
|
const props = __props;
|
|
4832
|
-
const forwarded = useForwardPropsWithout(props, [
|
|
5755
|
+
const forwarded = useForwardPropsWithout(props, [
|
|
5756
|
+
"breakpoint",
|
|
5757
|
+
"position",
|
|
5758
|
+
"size"
|
|
5759
|
+
]);
|
|
4833
5760
|
const { messages } = useToastManager();
|
|
5761
|
+
const isNarrowViewport = ref(false);
|
|
5762
|
+
let mediaQuery;
|
|
5763
|
+
function updateNarrowViewport(event) {
|
|
5764
|
+
isNarrowViewport.value = event.matches;
|
|
5765
|
+
}
|
|
5766
|
+
function setupMediaQuery() {
|
|
5767
|
+
mediaQuery?.removeEventListener("change", updateNarrowViewport);
|
|
5768
|
+
mediaQuery = window.matchMedia(`(max-width: ${props.breakpoint - .02}px)`);
|
|
5769
|
+
updateNarrowViewport(mediaQuery);
|
|
5770
|
+
mediaQuery.addEventListener("change", updateNarrowViewport);
|
|
5771
|
+
}
|
|
5772
|
+
onMounted(setupMediaQuery);
|
|
5773
|
+
watch(() => props.breakpoint, () => {
|
|
5774
|
+
if (mediaQuery) setupMediaQuery();
|
|
5775
|
+
});
|
|
5776
|
+
onBeforeUnmount(() => {
|
|
5777
|
+
mediaQuery?.removeEventListener("change", updateNarrowViewport);
|
|
5778
|
+
mediaQuery = void 0;
|
|
5779
|
+
});
|
|
4834
5780
|
const yPosition = computed(() => {
|
|
4835
5781
|
return props.position.split("-")[0];
|
|
4836
5782
|
});
|
|
@@ -4839,6 +5785,7 @@ var ToastProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
4839
5785
|
});
|
|
4840
5786
|
const swipeDirection = computed(() => {
|
|
4841
5787
|
if (props.swipeDirection) return props.swipeDirection;
|
|
5788
|
+
if (isNarrowViewport.value && yPosition.value !== "center") return yPosition.value === "top" ? "up" : "down";
|
|
4842
5789
|
if (xPosition.value !== "center") return xPosition.value;
|
|
4843
5790
|
return yPosition.value === "top" ? "up" : "down";
|
|
4844
5791
|
});
|
|
@@ -4872,11 +5819,13 @@ var ToastProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
4872
5819
|
default: withCtx(() => [createVNode(unref(ToastViewport), mergeProps({ class: "ui-ToastViewport" }, _ctx.$attrs, {
|
|
4873
5820
|
class: `r-size-${__props.size}`,
|
|
4874
5821
|
"data-x-position": xPosition.value,
|
|
4875
|
-
"data-y-position": yPosition.value
|
|
5822
|
+
"data-y-position": yPosition.value,
|
|
5823
|
+
"data-mobile": isNarrowViewport.value
|
|
4876
5824
|
}), null, 16, [
|
|
4877
5825
|
"class",
|
|
4878
5826
|
"data-x-position",
|
|
4879
|
-
"data-y-position"
|
|
5827
|
+
"data-y-position",
|
|
5828
|
+
"data-mobile"
|
|
4880
5829
|
])]),
|
|
4881
5830
|
_: 1
|
|
4882
5831
|
})]),
|
|
@@ -5043,4 +5992,4 @@ var SavingIndicator_default = /* @__PURE__ */ defineComponent({
|
|
|
5043
5992
|
}
|
|
5044
5993
|
});
|
|
5045
5994
|
//#endregion
|
|
5046
|
-
export { AccordionContent_default as AccordionContent, AccordionIndicator_default as AccordionIndicator, AccordionItem_default as AccordionItem, AccordionRoot_default as AccordionRoot, AccordionTrigger_default as AccordionTrigger, AlertDialogAction, AlertDialogCancel, DialogCloseButton_default as AlertDialogCancelButton, DialogCloseButton_default as DialogCloseButton, DialogDescription_default as AlertDialogDescription, DialogDescription_default as DialogDescription, AlertDialogPopup_default as AlertDialogPopup, AlertDialogRoot, DialogTitle_default as AlertDialogTitle, DialogTitle_default as DialogTitle, AlertDialogTrigger, Avatar_default as Avatar, Badge_default as Badge, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, CheckboxGroup, CloseButton_default as CloseButton, CollapsibleContent_default as CollapsibleContent, CollapsibleIndicator_default as CollapsibleIndicator, CollapsibleRoot_default as CollapsibleRoot, CollapsibleTrigger_default as CollapsibleTrigger, ColorField_default as ColorField, ComboboxContent_default as ComboboxContent, ComboboxEmpty_default as ComboboxEmpty, ComboboxGroup, ComboboxInput_default as ComboboxInput, ComboboxItem_default as ComboboxItem, ComboboxLabel_default as ComboboxLabel, ComboboxRoot_default as ComboboxRoot, DialogClose, DialogPopup_default as DialogPopup, DialogRoot, DialogTrigger, DropdownMenuContent_default as DropdownMenuContent, DropdownMenuItem_default as DropdownMenuItem, DropdownMenuRoot, DropdownMenuSeparator_default as DropdownMenuSeparator, DropdownMenuTrigger, Editable_default as Editable, Empty_default as Empty, EmptyContent_default as EmptyContent, EmptyDescription_default as EmptyDescription, EmptyHeader_default as EmptyHeader, EmptyMedia_default as EmptyMedia, EmptyTitle_default as EmptyTitle, IconButton_default as IconButton, NavigationMenuContent_default as NavigationMenuContent, NavigationMenuItem, NavigationMenuLink_default as NavigationMenuLink, NavigationMenuList_default as NavigationMenuList, NavigationMenuRoot_default as NavigationMenuRoot, NavigationMenuTrigger_default as NavigationMenuTrigger, Pagination_default as Pagination, PinInputInput_default as PinInputInput, PinInputRoot_default as PinInputRoot, PopoverClose, PopoverPopup_default as PopoverPopup, PopoverRoot, PopoverTrigger, Quota_default as Quota, Radio_default as Radio, RadioCardsItem_default as RadioCardsItem, RadioCardsRoot_default as RadioCardsRoot, RadioGroupItem_default as RadioGroupItem, RadioGroupRoot_default as RadioGroupRoot, RadioTabsItem_default as RadioTabsItem, RadioTabsRoot_default as RadioTabsRoot, SavingIndicator_default as SavingIndicator, ScrollArea_default as ScrollArea, SelectContent_default as SelectContent, SelectGroup, SelectItem_default as SelectItem, SelectLabel_default as SelectLabel, SelectRoot_default as SelectRoot, SelectSeparator_default as SelectSeparator, SelectTrigger_default as SelectTrigger, Separator_default as Separator, Sidebar_default as Sidebar, SidebarBody_default as SidebarBody, SidebarFooter_default as SidebarFooter, SidebarGroup_default as SidebarGroup, SidebarGroupLabel_default as SidebarGroupLabel, SidebarHeader_default as SidebarHeader, SidebarInset_default as SidebarInset, SidebarMenu_default as SidebarMenu, SidebarMenuButton_default as SidebarMenuButton, SidebarMenuItem_default as SidebarMenuItem, SidebarMenuSub_default as SidebarMenuSub, SidebarMenuSubButton_default as SidebarMenuSubButton, SidebarMenuSubItem_default as SidebarMenuSubItem, SidebarProvider_default as SidebarProvider, SidebarRail_default as SidebarRail, SidebarTrigger_default as SidebarTrigger, Skeleton_default as Skeleton, Spinner_default as Spinner, SpinnerIcon_default as SpinnerIcon, Switch_default as Switch, Table_default as Table, TabsContent, TabsList_default as TabsList, TabsRoot, TabsTrigger_default as TabsTrigger, TextArea_default as TextArea, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ToastProvider_default as ToastProvider, Toggle_default as Toggle, ToggleGroupItem_default as ToggleGroupItem, ToggleGroupRoot_default as ToggleGroupRoot, Tooltip_default as Tooltip, TreeItem_default as TreeItem, TreeItemIndicator_default as TreeItemIndicator, TreeRoot_default as TreeRoot, buildPropsClass, injectEmptyContext, injectThemeContext, provideEmptyContext, provideThemeContext, toast, useForwardPropsEmitsWithout, useForwardPropsWithout };
|
|
5995
|
+
export { AccordionContent_default as AccordionContent, AccordionIndicator_default as AccordionIndicator, AccordionItem_default as AccordionItem, AccordionRoot_default as AccordionRoot, AccordionTrigger_default as AccordionTrigger, AlertDialogAction, AlertDialogCancel, DialogCloseButton_default as AlertDialogCancelButton, DialogCloseButton_default as DialogCloseButton, DialogDescription_default as AlertDialogDescription, DialogDescription_default as DialogDescription, AlertDialogPopup_default as AlertDialogPopup, AlertDialogRoot, DialogTitle_default as AlertDialogTitle, DialogTitle_default as DialogTitle, AlertDialogTrigger, Avatar_default as Avatar, Badge_default as Badge, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, CheckboxGroup_default as CheckboxGroup, CloseButton_default as CloseButton, CollapsibleContent_default as CollapsibleContent, CollapsibleIndicator_default as CollapsibleIndicator, CollapsibleRoot_default as CollapsibleRoot, CollapsibleTrigger_default as CollapsibleTrigger, ColorField_default as ColorField, ComboboxContent_default as ComboboxContent, ComboboxEmpty_default as ComboboxEmpty, ComboboxGroup, ComboboxInput_default as ComboboxInput, ComboboxItem_default as ComboboxItem, ComboboxLabel_default as ComboboxLabel, ComboboxRoot_default as ComboboxRoot, DialogClose, DialogPopup_default as DialogPopup, DialogRoot, DialogTrigger, DrawerClose, DrawerCloseButton_default as DrawerCloseButton, DrawerDescription_default as DrawerDescription, DrawerHandle_default as DrawerHandle, DrawerIndent, DrawerIndentBackground, DrawerPopup_default as DrawerPopup, DrawerProvider, DrawerRoot_default as DrawerRoot, DrawerSwipeArea, DrawerTitle_default as DrawerTitle, DrawerTrigger, DropdownMenuContent_default as DropdownMenuContent, DropdownMenuItem_default as DropdownMenuItem, DropdownMenuRoot, DropdownMenuSeparator_default as DropdownMenuSeparator, DropdownMenuTrigger, Editable_default as Editable, Empty_default as Empty, EmptyContent_default as EmptyContent, EmptyDescription_default as EmptyDescription, EmptyHeader_default as EmptyHeader, EmptyMedia_default as EmptyMedia, EmptyTitle_default as EmptyTitle, FieldControl_default as FieldControl, FieldDescription_default as FieldDescription, FieldError_default as FieldError, FieldLabel_default as FieldLabel, FieldRoot_default as FieldRoot, FormRoot_default as FormRoot, IconButton_default as IconButton, NavigationMenuContent_default as NavigationMenuContent, NavigationMenuItem, NavigationMenuLink_default as NavigationMenuLink, NavigationMenuList_default as NavigationMenuList, NavigationMenuRoot_default as NavigationMenuRoot, NavigationMenuTrigger_default as NavigationMenuTrigger, Pagination_default as Pagination, PinInputInput_default as PinInputInput, PinInputRoot_default as PinInputRoot, PopoverClose, PopoverPopup_default as PopoverPopup, PopoverRoot, PopoverTrigger, Quota_default as Quota, Radio_default as Radio, RadioCardsItem_default as RadioCardsItem, RadioCardsRoot_default as RadioCardsRoot, RadioGroupItem_default as RadioGroupItem, RadioGroupRoot_default as RadioGroupRoot, RadioTabsItem_default as RadioTabsItem, RadioTabsRoot_default as RadioTabsRoot, SavingIndicator_default as SavingIndicator, ScrollArea_default as ScrollArea, SelectContent_default as SelectContent, SelectGroup, SelectItem_default as SelectItem, SelectLabel_default as SelectLabel, SelectRoot_default as SelectRoot, SelectSeparator_default as SelectSeparator, SelectTrigger_default as SelectTrigger, Separator_default as Separator, Sidebar_default as Sidebar, SidebarBody_default as SidebarBody, SidebarFooter_default as SidebarFooter, SidebarGroup_default as SidebarGroup, SidebarGroupLabel_default as SidebarGroupLabel, SidebarHeader_default as SidebarHeader, SidebarInset_default as SidebarInset, SidebarMenu_default as SidebarMenu, SidebarMenuButton_default as SidebarMenuButton, SidebarMenuItem_default as SidebarMenuItem, SidebarMenuSub_default as SidebarMenuSub, SidebarMenuSubButton_default as SidebarMenuSubButton, SidebarMenuSubItem_default as SidebarMenuSubItem, SidebarProvider_default as SidebarProvider, SidebarRail_default as SidebarRail, SidebarTrigger_default as SidebarTrigger, Skeleton_default as Skeleton, Spinner_default as Spinner, SpinnerIcon_default as SpinnerIcon, Switch_default as Switch, Table_default as Table, TabsContent, TabsList_default as TabsList, TabsRoot, TabsTrigger_default as TabsTrigger, TextArea_default as TextArea, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ToastProvider_default as ToastProvider, Toggle_default as Toggle, ToggleGroupItem_default as ToggleGroupItem, ToggleGroupRoot_default as ToggleGroupRoot, Tooltip_default as Tooltip, TreeItem_default as TreeItem, TreeItemIndicator_default as TreeItemIndicator, TreeRoot_default as TreeRoot, buildPropsClass, injectEmptyContext, injectThemeContext, provideEmptyContext, provideThemeContext, toast, useForwardPropsEmitsWithout, useForwardPropsWithout };
|