@brumaombra/ui-vintage 0.1.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/LICENSE +21 -0
- package/README.md +78 -0
- package/dist/AlertDialogTitle.vue_vue_type_script_setup_true_lang-CWCr2erD.js +360 -0
- package/dist/AlertDialogTrigger.vue_vue_type_script_setup_true_lang-vNwxOYhM.js +158 -0
- package/dist/BackgroundGrid-Cxvbtefm.js +13 -0
- package/dist/Busy-B65Nd9ec.js +62 -0
- package/dist/BusyIndicator-CnWzSMDb.js +4 -0
- package/dist/BusyIndicator.vue_vue_type_script_setup_true_lang-CYeXMI_V.js +66 -0
- package/dist/CalendarPrevButton.vue_vue_type_script_setup_true_lang-C-WnFnvj.js +3805 -0
- package/dist/Card.vue_vue_type_script_setup_true_lang-6ol3rxy1.js +27 -0
- package/dist/CardTitle.vue_vue_type_script_setup_true_lang-DVAd7AWF.js +112 -0
- package/dist/Collection-CmOoLBo7.js +76 -0
- package/dist/ConfigProvider-D2O0Jles.js +6 -0
- package/dist/ConfirmDialog-DEsvF0b_.js +4 -0
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-BAd1l1zF.js +230 -0
- package/dist/DashboardShell.vue_vue_type_script_setup_true_lang-CT2SQBXv.js +171 -0
- package/dist/DatePicker.vue_vue_type_script_setup_true_lang-D8mev2ha.js +92 -0
- package/dist/DialogClose-BNlqG4G2.js +36 -0
- package/dist/DialogTitle-DXj0nkXn.js +522 -0
- package/dist/DialogTitle.vue_vue_type_script_setup_true_lang-Bw40D4AK.js +174 -0
- package/dist/DialogTrigger-CpyKnu11.js +52 -0
- package/dist/DialogTrigger.vue_vue_type_script_setup_true_lang-DLrFiCsw.js +141 -0
- package/dist/FocusScope-C3mcVwsf.js +454 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-U778IWa0.js +37 -0
- package/dist/Label.vue_vue_type_script_setup_true_lang-B_fwvfJ-.js +65 -0
- package/dist/MessageDialog-BrowppID.js +4 -0
- package/dist/MessageDialog.vue_vue_type_script_setup_true_lang-Ddih5Isd.js +242 -0
- package/dist/NativeSelectOption.vue_vue_type_script_setup_true_lang-DS87OTLT.js +73 -0
- package/dist/PopoverAnchor.vue_vue_type_script_setup_true_lang-CsfybvZp.js +61 -0
- package/dist/PopoverTrigger.vue_vue_type_script_setup_true_lang-KTcg6Jnl.js +798 -0
- package/dist/PopperContent-BiM0YLO3.js +2144 -0
- package/dist/Primitive-D3IcFg81.js +61 -0
- package/dist/SelectValue.vue_vue_type_script_setup_true_lang-DGAI4hw5.js +2124 -0
- package/dist/Separator-CFm_M4pb.js +87 -0
- package/dist/Separator.vue_vue_type_script_setup_true_lang-COrZ60NR.js +29 -0
- package/dist/SheetTitle.vue_vue_type_script_setup_true_lang-DLoXGMbx.js +175 -0
- package/dist/SheetTrigger.vue_vue_type_script_setup_true_lang-CE2XJNHy.js +62 -0
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-BSbVyZz7.js +20 -0
- package/dist/Slider.vue_vue_type_script_setup_true_lang-D-cAN-4Q.js +802 -0
- package/dist/SliderFormComponent.vue_vue_type_script_setup_true_lang-KPzC_Lmr.js +59 -0
- package/dist/Switch.vue_vue_type_script_setup_true_lang-BWKCycMm.js +226 -0
- package/dist/SwitchFormComponent.vue_vue_type_script_setup_true_lang-XOBEs3pa.js +39 -0
- package/dist/Teleport-CuUn4UkG.js +493 -0
- package/dist/TooltipProvider.vue_vue_type_script_setup_true_lang-DwIfCQjY.js +28 -0
- package/dist/TooltipTrigger.vue_vue_type_script_setup_true_lang-BRyHTWgw.js +1117 -0
- package/dist/VisuallyHidden-udQT2Fmo.js +60 -0
- package/dist/VisuallyHiddenInput-DLAsRwUw.js +142 -0
- package/dist/_plugin-vue_export-helper-1tPrXgE0.js +10 -0
- package/dist/alert-dialog.d.ts +2 -0
- package/dist/alert-dialog.js +13 -0
- package/dist/alert.d.ts +2 -0
- package/dist/alert.js +76 -0
- package/dist/background-grid.d.ts +6 -0
- package/dist/background-grid.js +5 -0
- package/dist/busy-indicator.d.ts +2 -0
- package/dist/busy-indicator.js +6 -0
- package/dist/busy.d.ts +2 -0
- package/dist/busy.js +4 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +63 -0
- package/dist/calendar.d.ts +2 -0
- package/dist/calendar.js +15 -0
- package/dist/card.d.ts +2 -0
- package/dist/card.js +11 -0
- package/dist/check-iejznCzf.js +11 -0
- package/dist/chevron-down-DP-oz-sL.js +13 -0
- package/dist/clamp-D5Ye0kJT.js +6 -0
- package/dist/command.d.ts +2 -0
- package/dist/command.js +1122 -0
- package/dist/components/background-grid/BackgroundGrid.vue.d.ts +2 -0
- package/dist/components/background-grid/index.d.ts +2 -0
- package/dist/components/busy-indicator/BusyIndicator.vue.d.ts +2 -0
- package/dist/components/busy-indicator/busy-indicator-state.d.ts +15 -0
- package/dist/components/busy-indicator/index.d.ts +3 -0
- package/dist/components/confirm-dialog/ConfirmDialog.vue.d.ts +2 -0
- package/dist/components/confirm-dialog/confirm-dialog-state.d.ts +37 -0
- package/dist/components/confirm-dialog/index.d.ts +3 -0
- package/dist/components/dashboard-shell/DashboardShell.vue.d.ts +54 -0
- package/dist/components/dashboard-shell/index.d.ts +2 -0
- package/dist/components/message-dialog/MessageDialog.vue.d.ts +2 -0
- package/dist/components/message-dialog/index.d.ts +3 -0
- package/dist/components/message-dialog/message-dialog-state.d.ts +28 -0
- package/dist/components/slider-form-component/SliderFormComponent.vue.d.ts +23 -0
- package/dist/components/slider-form-component/index.d.ts +2 -0
- package/dist/components/switch-form-component/SwitchFormComponent.vue.d.ts +12 -0
- package/dist/components/switch-form-component/index.d.ts +2 -0
- package/dist/components/ui/alert/Alert.vue.d.ts +23 -0
- package/dist/components/ui/alert/AlertDescription.vue.d.ts +21 -0
- package/dist/components/ui/alert/AlertTitle.vue.d.ts +21 -0
- package/dist/components/ui/alert/index.d.ts +8 -0
- package/dist/components/ui/alert-dialog/AlertDialog.vue.d.ts +25 -0
- package/dist/components/ui/alert-dialog/AlertDialogAction.vue.d.ts +22 -0
- package/dist/components/ui/alert-dialog/AlertDialogCancel.vue.d.ts +22 -0
- package/dist/components/ui/alert-dialog/AlertDialogContent.vue.d.ts +36 -0
- package/dist/components/ui/alert-dialog/AlertDialogDescription.vue.d.ts +22 -0
- package/dist/components/ui/alert-dialog/AlertDialogFooter.vue.d.ts +21 -0
- package/dist/components/ui/alert-dialog/AlertDialogHeader.vue.d.ts +21 -0
- package/dist/components/ui/alert-dialog/AlertDialogTitle.vue.d.ts +22 -0
- package/dist/components/ui/alert-dialog/AlertDialogTrigger.vue.d.ts +18 -0
- package/dist/components/ui/alert-dialog/index.d.ts +9 -0
- package/dist/components/ui/busy/Busy.vue.d.ts +27 -0
- package/dist/components/ui/busy/index.d.ts +1 -0
- package/dist/components/ui/button/Button.vue.d.ts +27 -0
- package/dist/components/ui/button/index.d.ts +7 -0
- package/dist/components/ui/calendar/Calendar.vue.d.ts +44 -0
- package/dist/components/ui/calendar/CalendarCell.vue.d.ts +22 -0
- package/dist/components/ui/calendar/CalendarCellTrigger.vue.d.ts +24 -0
- package/dist/components/ui/calendar/CalendarGrid.vue.d.ts +22 -0
- package/dist/components/ui/calendar/CalendarGridBody.vue.d.ts +18 -0
- package/dist/components/ui/calendar/CalendarGridHead.vue.d.ts +22 -0
- package/dist/components/ui/calendar/CalendarGridRow.vue.d.ts +22 -0
- package/dist/components/ui/calendar/CalendarHeadCell.vue.d.ts +22 -0
- package/dist/components/ui/calendar/CalendarHeader.vue.d.ts +22 -0
- package/dist/components/ui/calendar/CalendarHeading.vue.d.ts +28 -0
- package/dist/components/ui/calendar/CalendarNextButton.vue.d.ts +22 -0
- package/dist/components/ui/calendar/CalendarPrevButton.vue.d.ts +22 -0
- package/dist/components/ui/calendar/index.d.ts +13 -0
- package/dist/components/ui/card/Card.vue.d.ts +21 -0
- package/dist/components/ui/card/CardAction.vue.d.ts +21 -0
- package/dist/components/ui/card/CardContent.vue.d.ts +21 -0
- package/dist/components/ui/card/CardDescription.vue.d.ts +21 -0
- package/dist/components/ui/card/CardFooter.vue.d.ts +21 -0
- package/dist/components/ui/card/CardHeader.vue.d.ts +21 -0
- package/dist/components/ui/card/CardTitle.vue.d.ts +21 -0
- package/dist/components/ui/card/index.d.ts +7 -0
- package/dist/components/ui/command/Command.vue.d.ts +40 -0
- package/dist/components/ui/command/CommandDialog.vue.d.ts +32 -0
- package/dist/components/ui/command/CommandEmpty.vue.d.ts +22 -0
- package/dist/components/ui/command/CommandGroup.vue.d.ts +23 -0
- package/dist/components/ui/command/CommandInput.vue.d.ts +7 -0
- package/dist/components/ui/command/CommandItem.vue.d.ts +30 -0
- package/dist/components/ui/command/CommandList.vue.d.ts +22 -0
- package/dist/components/ui/command/CommandSeparator.vue.d.ts +22 -0
- package/dist/components/ui/command/CommandShortcut.vue.d.ts +21 -0
- package/dist/components/ui/command/index.d.ts +90 -0
- package/dist/components/ui/date-picker/DatePicker.vue.d.ts +19 -0
- package/dist/components/ui/date-picker/index.d.ts +2 -0
- package/dist/components/ui/dialog/Dialog.vue.d.ts +25 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +18 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +39 -0
- package/dist/components/ui/dialog/DialogDescription.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +24 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +21 -0
- package/dist/components/ui/dialog/DialogOverlay.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +36 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +18 -0
- package/dist/components/ui/dialog/index.d.ts +10 -0
- package/dist/components/ui/field/Field.vue.d.ts +23 -0
- package/dist/components/ui/field/FieldContent.vue.d.ts +21 -0
- package/dist/components/ui/field/FieldDescription.vue.d.ts +21 -0
- package/dist/components/ui/field/FieldError.vue.d.ts +24 -0
- package/dist/components/ui/field/FieldGroup.vue.d.ts +21 -0
- package/dist/components/ui/field/FieldLabel.vue.d.ts +21 -0
- package/dist/components/ui/field/FieldLegend.vue.d.ts +22 -0
- package/dist/components/ui/field/FieldSeparator.vue.d.ts +21 -0
- package/dist/components/ui/field/FieldSet.vue.d.ts +21 -0
- package/dist/components/ui/field/FieldTitle.vue.d.ts +21 -0
- package/dist/components/ui/field/index.d.ts +15 -0
- package/dist/components/ui/input/Input.vue.d.ts +12 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/label/Label.vue.d.ts +22 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/native-select/NativeSelect.vue.d.ts +27 -0
- package/dist/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +21 -0
- package/dist/components/ui/native-select/NativeSelectOption.vue.d.ts +21 -0
- package/dist/components/ui/native-select/index.d.ts +3 -0
- package/dist/components/ui/popover/Popover.vue.d.ts +25 -0
- package/dist/components/ui/popover/PopoverAnchor.vue.d.ts +18 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +39 -0
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +18 -0
- package/dist/components/ui/popover/index.d.ts +4 -0
- package/dist/components/ui/select/Select.vue.d.ts +28 -0
- package/dist/components/ui/select/SelectContent.vue.d.ts +32 -0
- package/dist/components/ui/select/SelectGroup.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectItem.vue.d.ts +24 -0
- package/dist/components/ui/select/SelectItemText.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectLabel.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectSeparator.vue.d.ts +7 -0
- package/dist/components/ui/select/SelectTrigger.vue.d.ts +25 -0
- package/dist/components/ui/select/SelectValue.vue.d.ts +18 -0
- package/dist/components/ui/select/index.d.ts +11 -0
- package/dist/components/ui/separator/Separator.vue.d.ts +10 -0
- package/dist/components/ui/separator/index.d.ts +1 -0
- package/dist/components/ui/sheet/Sheet.vue.d.ts +25 -0
- package/dist/components/ui/sheet/SheetClose.vue.d.ts +18 -0
- package/dist/components/ui/sheet/SheetContent.vue.d.ts +39 -0
- package/dist/components/ui/sheet/SheetDescription.vue.d.ts +22 -0
- package/dist/components/ui/sheet/SheetFooter.vue.d.ts +21 -0
- package/dist/components/ui/sheet/SheetHeader.vue.d.ts +21 -0
- package/dist/components/ui/sheet/SheetOverlay.vue.d.ts +22 -0
- package/dist/components/ui/sheet/SheetTitle.vue.d.ts +22 -0
- package/dist/components/ui/sheet/SheetTrigger.vue.d.ts +18 -0
- package/dist/components/ui/sheet/index.d.ts +8 -0
- package/dist/components/ui/sidebar/Sidebar.vue.d.ts +24 -0
- package/dist/components/ui/sidebar/SidebarContent.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarFooter.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroup.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroupAction.vue.d.ts +22 -0
- package/dist/components/ui/sidebar/SidebarGroupContent.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroupLabel.vue.d.ts +22 -0
- package/dist/components/ui/sidebar/SidebarHeader.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarInput.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarInset.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenu.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuAction.vue.d.ts +25 -0
- package/dist/components/ui/sidebar/SidebarMenuBadge.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuButton.vue.d.ts +27 -0
- package/dist/components/ui/sidebar/SidebarMenuButtonChild.vue.d.ts +30 -0
- package/dist/components/ui/sidebar/SidebarMenuItem.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuSkeleton.vue.d.ts +7 -0
- package/dist/components/ui/sidebar/SidebarMenuSub.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuSubButton.vue.d.ts +27 -0
- package/dist/components/ui/sidebar/SidebarMenuSubItem.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarProvider.vue.d.ts +30 -0
- package/dist/components/ui/sidebar/SidebarRail.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarSeparator.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarTrigger.vue.d.ts +6 -0
- package/dist/components/ui/sidebar/index.d.ts +37 -0
- package/dist/components/ui/sidebar/utils.d.ts +56 -0
- package/dist/components/ui/skeleton/Skeleton.vue.d.ts +6 -0
- package/dist/components/ui/skeleton/index.d.ts +1 -0
- package/dist/components/ui/slider/Slider.vue.d.ts +13 -0
- package/dist/components/ui/slider/index.d.ts +1 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +29 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +24 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +30 -0
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts +20 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +18 -0
- package/dist/components/ui/tooltip/index.d.ts +4 -0
- package/dist/confirm-dialog.d.ts +2 -0
- package/dist/confirm-dialog.js +9 -0
- package/dist/createLucideIcon-CCMB2vDW.js +130 -0
- package/dist/dashboard-shell.d.ts +6 -0
- package/dist/dashboard-shell.js +5 -0
- package/dist/date-picker.d.ts +6 -0
- package/dist/date-picker.js +5 -0
- package/dist/dialog.d.ts +2 -0
- package/dist/dialog.js +14 -0
- package/dist/field.d.ts +2 -0
- package/dist/field.js +294 -0
- package/dist/index-C1_fxYhb.js +251 -0
- package/dist/index-Dfi5ESP2.js +299 -0
- package/dist/index-FpH8cK6B.js +44 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +171 -0
- package/dist/info-DZrSmi42.js +15 -0
- package/dist/input.d.ts +2 -0
- package/dist/input.js +4 -0
- package/dist/label.d.ts +2 -0
- package/dist/label.js +4 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/message-dialog.d.ts +2 -0
- package/dist/message-dialog.js +8 -0
- package/dist/native-select.d.ts +2 -0
- package/dist/native-select.js +25 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +8 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +14 -0
- package/dist/separator.d.ts +2 -0
- package/dist/separator.js +4 -0
- package/dist/sheet.d.ts +2 -0
- package/dist/sheet.js +12 -0
- package/dist/sidebar.d.ts +2 -0
- package/dist/sidebar.js +813 -0
- package/dist/skeleton.d.ts +2 -0
- package/dist/skeleton.js +4 -0
- package/dist/slider-form-component.d.ts +6 -0
- package/dist/slider-form-component.js +5 -0
- package/dist/slider.d.ts +2 -0
- package/dist/slider.js +4 -0
- package/dist/style.css +4021 -0
- package/dist/switch-form-component.d.ts +6 -0
- package/dist/switch-form-component.js +5 -0
- package/dist/switch.d.ts +2 -0
- package/dist/switch.js +4 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tooltip.js +8 -0
- package/dist/useDirection-SIyEYNxv.js +12 -0
- package/dist/useFocusGuards-tgErlvMF.js +29 -0
- package/dist/useFormControl-7ytzz-r7.js +11 -0
- package/dist/useForwardExpose-CNVHwdF2.js +58 -0
- package/dist/useForwardPropsEmits-DmumnZO5.js +63 -0
- package/dist/useKbd-JjFOu4f7.js +41 -0
- package/dist/usePrimitiveElement-CijaRBgF.js +16 -0
- package/dist/useSize-DO9Z3wC4.js +51 -0
- package/dist/useTypeahead-Dqe1QXq1.js +159 -0
- package/dist/utils-Bz4m9VPB.js +3192 -0
- package/dist/utils-RRmyeqLm.js +16 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +4 -0
- package/dist/x-2_VzbDS9.js +48 -0
- package/package.json +186 -0
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
import { i as injectConfigProviderContext } from "./ConfigProvider-D2O0Jles.js";
|
|
2
|
+
import { computed, ref, watch, nextTick, onUnmounted, defineComponent, reactive, watchEffect, openBlock, createBlock, unref, withCtx, renderSlot } from "vue";
|
|
3
|
+
import { b as useEventListener, a as unrefElement } from "./index-C1_fxYhb.js";
|
|
4
|
+
import { h as tryOnBeforeUnmount, j as createSharedComposable, i as isClient, k as isIOS, l as createGlobalState } from "./index-Dfi5ESP2.js";
|
|
5
|
+
import { d as defu } from "./Teleport-CuUn4UkG.js";
|
|
6
|
+
import { u as useForwardExpose } from "./useForwardExpose-CNVHwdF2.js";
|
|
7
|
+
import { P as Primitive } from "./Primitive-D3IcFg81.js";
|
|
8
|
+
function getActiveElement() {
|
|
9
|
+
let activeElement = document.activeElement;
|
|
10
|
+
if (activeElement == null) return null;
|
|
11
|
+
while (activeElement != null && activeElement.shadowRoot != null && activeElement.shadowRoot.activeElement != null) activeElement = activeElement.shadowRoot.activeElement;
|
|
12
|
+
return activeElement;
|
|
13
|
+
}
|
|
14
|
+
const useBodyLockStackCount = createSharedComposable(() => {
|
|
15
|
+
const map = ref(/* @__PURE__ */ new Map());
|
|
16
|
+
const initialOverflow = ref();
|
|
17
|
+
const locked = computed(() => {
|
|
18
|
+
for (const value of map.value.values()) if (value) return true;
|
|
19
|
+
return false;
|
|
20
|
+
});
|
|
21
|
+
const context = injectConfigProviderContext({ scrollBody: ref(true) });
|
|
22
|
+
let stopTouchMoveListener = null;
|
|
23
|
+
const resetBodyStyle = () => {
|
|
24
|
+
document.body.style.paddingRight = "";
|
|
25
|
+
document.body.style.marginRight = "";
|
|
26
|
+
document.body.style.pointerEvents = "";
|
|
27
|
+
document.documentElement.style.removeProperty("--scrollbar-width");
|
|
28
|
+
document.body.style.overflow = initialOverflow.value ?? "";
|
|
29
|
+
isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
|
|
30
|
+
initialOverflow.value = void 0;
|
|
31
|
+
};
|
|
32
|
+
watch(locked, (val, oldVal) => {
|
|
33
|
+
var _a;
|
|
34
|
+
if (!isClient) return;
|
|
35
|
+
if (!val) {
|
|
36
|
+
if (oldVal) resetBodyStyle();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (initialOverflow.value === void 0) initialOverflow.value = document.body.style.overflow;
|
|
40
|
+
const verticalScrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
41
|
+
const defaultConfig = {
|
|
42
|
+
padding: verticalScrollbarWidth,
|
|
43
|
+
margin: 0
|
|
44
|
+
};
|
|
45
|
+
const config = ((_a = context.scrollBody) == null ? void 0 : _a.value) ? typeof context.scrollBody.value === "object" ? defu({
|
|
46
|
+
padding: context.scrollBody.value.padding === true ? verticalScrollbarWidth : context.scrollBody.value.padding,
|
|
47
|
+
margin: context.scrollBody.value.margin === true ? verticalScrollbarWidth : context.scrollBody.value.margin
|
|
48
|
+
}, defaultConfig) : defaultConfig : {
|
|
49
|
+
padding: 0,
|
|
50
|
+
margin: 0
|
|
51
|
+
};
|
|
52
|
+
if (verticalScrollbarWidth > 0) {
|
|
53
|
+
document.body.style.paddingRight = typeof config.padding === "number" ? `${config.padding}px` : String(config.padding);
|
|
54
|
+
document.body.style.marginRight = typeof config.margin === "number" ? `${config.margin}px` : String(config.margin);
|
|
55
|
+
document.documentElement.style.setProperty("--scrollbar-width", `${verticalScrollbarWidth}px`);
|
|
56
|
+
document.body.style.overflow = "hidden";
|
|
57
|
+
}
|
|
58
|
+
if (isIOS) stopTouchMoveListener = useEventListener(document, "touchmove", (e) => preventDefault(e), { passive: false });
|
|
59
|
+
nextTick(() => {
|
|
60
|
+
if (!locked.value) return;
|
|
61
|
+
document.body.style.pointerEvents = "none";
|
|
62
|
+
document.body.style.overflow = "hidden";
|
|
63
|
+
});
|
|
64
|
+
}, {
|
|
65
|
+
immediate: true,
|
|
66
|
+
flush: "sync"
|
|
67
|
+
});
|
|
68
|
+
return map;
|
|
69
|
+
});
|
|
70
|
+
function useBodyScrollLock(initialState) {
|
|
71
|
+
const id = Math.random().toString(36).substring(2, 7);
|
|
72
|
+
const map = useBodyLockStackCount();
|
|
73
|
+
map.value.set(id, initialState ?? false);
|
|
74
|
+
const locked = computed({
|
|
75
|
+
get: () => map.value.get(id) ?? false,
|
|
76
|
+
set: (value) => map.value.set(id, value)
|
|
77
|
+
});
|
|
78
|
+
tryOnBeforeUnmount(() => {
|
|
79
|
+
map.value.delete(id);
|
|
80
|
+
});
|
|
81
|
+
return locked;
|
|
82
|
+
}
|
|
83
|
+
function checkOverflowScroll(ele) {
|
|
84
|
+
const style = window.getComputedStyle(ele);
|
|
85
|
+
if (style.overflowX === "scroll" || style.overflowY === "scroll" || style.overflowX === "auto" && ele.clientWidth < ele.scrollWidth || style.overflowY === "auto" && ele.clientHeight < ele.scrollHeight) return true;
|
|
86
|
+
else {
|
|
87
|
+
const parent = ele.parentNode;
|
|
88
|
+
if (!(parent instanceof Element) || parent.tagName === "BODY") return false;
|
|
89
|
+
return checkOverflowScroll(parent);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function preventDefault(rawEvent) {
|
|
93
|
+
const e = rawEvent || window.event;
|
|
94
|
+
const _target = e.target;
|
|
95
|
+
if (_target instanceof Element && checkOverflowScroll(_target)) return false;
|
|
96
|
+
if (e.touches.length > 1) return true;
|
|
97
|
+
if (e.preventDefault && e.cancelable) e.preventDefault();
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
var getDefaultParent = function(originalTarget) {
|
|
101
|
+
if (typeof document === "undefined") {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
105
|
+
return sampleTarget.ownerDocument.body;
|
|
106
|
+
};
|
|
107
|
+
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
108
|
+
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
109
|
+
var markerMap = {};
|
|
110
|
+
var lockCount = 0;
|
|
111
|
+
var unwrapHost = function(node) {
|
|
112
|
+
return node && (node.host || unwrapHost(node.parentNode));
|
|
113
|
+
};
|
|
114
|
+
var correctTargets = function(parent, targets) {
|
|
115
|
+
return targets.map(function(target) {
|
|
116
|
+
if (parent.contains(target)) {
|
|
117
|
+
return target;
|
|
118
|
+
}
|
|
119
|
+
var correctedTarget = unwrapHost(target);
|
|
120
|
+
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
121
|
+
return correctedTarget;
|
|
122
|
+
}
|
|
123
|
+
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
124
|
+
return null;
|
|
125
|
+
}).filter(function(x) {
|
|
126
|
+
return Boolean(x);
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
130
|
+
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
131
|
+
if (!markerMap[markerName]) {
|
|
132
|
+
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
133
|
+
}
|
|
134
|
+
var markerCounter = markerMap[markerName];
|
|
135
|
+
var hiddenNodes = [];
|
|
136
|
+
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
137
|
+
var elementsToStop = new Set(targets);
|
|
138
|
+
var keep = function(el) {
|
|
139
|
+
if (!el || elementsToKeep.has(el)) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
elementsToKeep.add(el);
|
|
143
|
+
keep(el.parentNode);
|
|
144
|
+
};
|
|
145
|
+
targets.forEach(keep);
|
|
146
|
+
var deep = function(parent) {
|
|
147
|
+
if (!parent || elementsToStop.has(parent)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
Array.prototype.forEach.call(parent.children, function(node) {
|
|
151
|
+
if (elementsToKeep.has(node)) {
|
|
152
|
+
deep(node);
|
|
153
|
+
} else {
|
|
154
|
+
try {
|
|
155
|
+
var attr = node.getAttribute(controlAttribute);
|
|
156
|
+
var alreadyHidden = attr !== null && attr !== "false";
|
|
157
|
+
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
158
|
+
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
159
|
+
counterMap.set(node, counterValue);
|
|
160
|
+
markerCounter.set(node, markerValue);
|
|
161
|
+
hiddenNodes.push(node);
|
|
162
|
+
if (counterValue === 1 && alreadyHidden) {
|
|
163
|
+
uncontrolledNodes.set(node, true);
|
|
164
|
+
}
|
|
165
|
+
if (markerValue === 1) {
|
|
166
|
+
node.setAttribute(markerName, "true");
|
|
167
|
+
}
|
|
168
|
+
if (!alreadyHidden) {
|
|
169
|
+
node.setAttribute(controlAttribute, "true");
|
|
170
|
+
}
|
|
171
|
+
} catch (e) {
|
|
172
|
+
console.error("aria-hidden: cannot operate on ", node, e);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
deep(parentNode);
|
|
178
|
+
elementsToKeep.clear();
|
|
179
|
+
lockCount++;
|
|
180
|
+
return function() {
|
|
181
|
+
hiddenNodes.forEach(function(node) {
|
|
182
|
+
var counterValue = counterMap.get(node) - 1;
|
|
183
|
+
var markerValue = markerCounter.get(node) - 1;
|
|
184
|
+
counterMap.set(node, counterValue);
|
|
185
|
+
markerCounter.set(node, markerValue);
|
|
186
|
+
if (!counterValue) {
|
|
187
|
+
if (!uncontrolledNodes.has(node)) {
|
|
188
|
+
node.removeAttribute(controlAttribute);
|
|
189
|
+
}
|
|
190
|
+
uncontrolledNodes.delete(node);
|
|
191
|
+
}
|
|
192
|
+
if (!markerValue) {
|
|
193
|
+
node.removeAttribute(markerName);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
lockCount--;
|
|
197
|
+
if (!lockCount) {
|
|
198
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
199
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
200
|
+
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
201
|
+
markerMap = {};
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
206
|
+
if (markerName === void 0) {
|
|
207
|
+
markerName = "data-aria-hidden";
|
|
208
|
+
}
|
|
209
|
+
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
210
|
+
var activeParentNode = getDefaultParent(originalTarget);
|
|
211
|
+
if (!activeParentNode) {
|
|
212
|
+
return function() {
|
|
213
|
+
return null;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
217
|
+
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
218
|
+
};
|
|
219
|
+
function useHideOthers(target) {
|
|
220
|
+
let undo;
|
|
221
|
+
watch(() => unrefElement(target), (el) => {
|
|
222
|
+
let isInsideClosedPopover = false;
|
|
223
|
+
try {
|
|
224
|
+
isInsideClosedPopover = !!(el == null ? void 0 : el.closest("[popover]:not(:popover-open)"));
|
|
225
|
+
} catch {
|
|
226
|
+
}
|
|
227
|
+
if (el && !isInsideClosedPopover) undo = hideOthers(el);
|
|
228
|
+
else if (undo) undo();
|
|
229
|
+
});
|
|
230
|
+
onUnmounted(() => {
|
|
231
|
+
if (undo) undo();
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const useFocusStackState = createGlobalState(() => {
|
|
235
|
+
const stack = ref([]);
|
|
236
|
+
return stack;
|
|
237
|
+
});
|
|
238
|
+
function createFocusScopesStack() {
|
|
239
|
+
const stack = useFocusStackState();
|
|
240
|
+
return {
|
|
241
|
+
add(focusScope) {
|
|
242
|
+
const activeFocusScope = stack.value[0];
|
|
243
|
+
if (focusScope !== activeFocusScope) activeFocusScope == null ? void 0 : activeFocusScope.pause();
|
|
244
|
+
stack.value = arrayRemove(stack.value, focusScope);
|
|
245
|
+
stack.value.unshift(focusScope);
|
|
246
|
+
},
|
|
247
|
+
remove(focusScope) {
|
|
248
|
+
var _a;
|
|
249
|
+
stack.value = arrayRemove(stack.value, focusScope);
|
|
250
|
+
(_a = stack.value[0]) == null ? void 0 : _a.resume();
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
function arrayRemove(array, item) {
|
|
255
|
+
const updatedArray = [...array];
|
|
256
|
+
const index = updatedArray.indexOf(item);
|
|
257
|
+
if (index !== -1) updatedArray.splice(index, 1);
|
|
258
|
+
return updatedArray;
|
|
259
|
+
}
|
|
260
|
+
const AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
261
|
+
const AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
262
|
+
const EVENT_OPTIONS = {
|
|
263
|
+
bubbles: false,
|
|
264
|
+
cancelable: true
|
|
265
|
+
};
|
|
266
|
+
function focusFirst(candidates, { select = false } = {}) {
|
|
267
|
+
const previouslyFocusedElement = getActiveElement();
|
|
268
|
+
for (const candidate of candidates) {
|
|
269
|
+
focus(candidate, { select });
|
|
270
|
+
if (getActiveElement() !== previouslyFocusedElement) return true;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function getTabbableEdges(container) {
|
|
274
|
+
const candidates = getTabbableCandidates(container);
|
|
275
|
+
const first = findVisible(candidates, container);
|
|
276
|
+
const last = findVisible(candidates.reverse(), container);
|
|
277
|
+
return [first, last];
|
|
278
|
+
}
|
|
279
|
+
function getTabbableCandidates(container) {
|
|
280
|
+
const nodes = [];
|
|
281
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {
|
|
282
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
283
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
284
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
285
|
+
} });
|
|
286
|
+
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
287
|
+
return nodes;
|
|
288
|
+
}
|
|
289
|
+
function findVisible(elements, container) {
|
|
290
|
+
for (const element of elements) if (!isHidden(element, { upTo: container })) return element;
|
|
291
|
+
}
|
|
292
|
+
function isHidden(node, { upTo }) {
|
|
293
|
+
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
294
|
+
while (node) {
|
|
295
|
+
if (upTo !== void 0 && node === upTo) return false;
|
|
296
|
+
if (getComputedStyle(node).display === "none") return true;
|
|
297
|
+
node = node.parentElement;
|
|
298
|
+
}
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
function isSelectableInput(element) {
|
|
302
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
303
|
+
}
|
|
304
|
+
function focus(element, { select = false } = {}) {
|
|
305
|
+
if (element && element.focus) {
|
|
306
|
+
const previouslyFocusedElement = getActiveElement();
|
|
307
|
+
element.focus({ preventScroll: true });
|
|
308
|
+
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
var FocusScope_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
312
|
+
__name: "FocusScope",
|
|
313
|
+
props: {
|
|
314
|
+
loop: {
|
|
315
|
+
type: Boolean,
|
|
316
|
+
required: false,
|
|
317
|
+
default: false
|
|
318
|
+
},
|
|
319
|
+
trapped: {
|
|
320
|
+
type: Boolean,
|
|
321
|
+
required: false,
|
|
322
|
+
default: false
|
|
323
|
+
},
|
|
324
|
+
asChild: {
|
|
325
|
+
type: Boolean,
|
|
326
|
+
required: false
|
|
327
|
+
},
|
|
328
|
+
as: {
|
|
329
|
+
type: null,
|
|
330
|
+
required: false
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
emits: ["mountAutoFocus", "unmountAutoFocus"],
|
|
334
|
+
setup(__props, { emit: __emit }) {
|
|
335
|
+
const props = __props;
|
|
336
|
+
const emits = __emit;
|
|
337
|
+
const { currentRef, currentElement } = useForwardExpose();
|
|
338
|
+
const lastFocusedElementRef = ref(null);
|
|
339
|
+
const focusScopesStack = createFocusScopesStack();
|
|
340
|
+
const focusScope = reactive({
|
|
341
|
+
paused: false,
|
|
342
|
+
pause() {
|
|
343
|
+
this.paused = true;
|
|
344
|
+
},
|
|
345
|
+
resume() {
|
|
346
|
+
this.paused = false;
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
watchEffect((cleanupFn) => {
|
|
350
|
+
if (!isClient) return;
|
|
351
|
+
const container = currentElement.value;
|
|
352
|
+
if (!props.trapped) return;
|
|
353
|
+
function handleFocusIn(event) {
|
|
354
|
+
if (focusScope.paused || !container) return;
|
|
355
|
+
const target = event.target;
|
|
356
|
+
if (container.contains(target)) lastFocusedElementRef.value = target;
|
|
357
|
+
else focus(lastFocusedElementRef.value, { select: true });
|
|
358
|
+
}
|
|
359
|
+
function handleFocusOut(event) {
|
|
360
|
+
if (focusScope.paused || !container) return;
|
|
361
|
+
const relatedTarget = event.relatedTarget;
|
|
362
|
+
if (relatedTarget === null) return;
|
|
363
|
+
if (!container.contains(relatedTarget)) focus(lastFocusedElementRef.value, { select: true });
|
|
364
|
+
}
|
|
365
|
+
function handleMutations(mutations) {
|
|
366
|
+
const isLastFocusedElementExist = container.contains(lastFocusedElementRef.value);
|
|
367
|
+
if (!isLastFocusedElementExist) focus(container);
|
|
368
|
+
}
|
|
369
|
+
document.addEventListener("focusin", handleFocusIn);
|
|
370
|
+
document.addEventListener("focusout", handleFocusOut);
|
|
371
|
+
const mutationObserver = new MutationObserver(handleMutations);
|
|
372
|
+
if (container) mutationObserver.observe(container, {
|
|
373
|
+
childList: true,
|
|
374
|
+
subtree: true
|
|
375
|
+
});
|
|
376
|
+
cleanupFn(() => {
|
|
377
|
+
document.removeEventListener("focusin", handleFocusIn);
|
|
378
|
+
document.removeEventListener("focusout", handleFocusOut);
|
|
379
|
+
mutationObserver.disconnect();
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
watchEffect(async (cleanupFn) => {
|
|
383
|
+
const container = currentElement.value;
|
|
384
|
+
await nextTick();
|
|
385
|
+
if (!container) return;
|
|
386
|
+
focusScopesStack.add(focusScope);
|
|
387
|
+
const previouslyFocusedElement = getActiveElement();
|
|
388
|
+
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
389
|
+
if (!hasFocusedCandidate) {
|
|
390
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
391
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT, (ev) => emits("mountAutoFocus", ev));
|
|
392
|
+
container.dispatchEvent(mountEvent);
|
|
393
|
+
if (!mountEvent.defaultPrevented) {
|
|
394
|
+
focusFirst(getTabbableCandidates(container), { select: true });
|
|
395
|
+
if (getActiveElement() === previouslyFocusedElement) focus(container);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
cleanupFn(() => {
|
|
399
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT, (ev) => emits("mountAutoFocus", ev));
|
|
400
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
401
|
+
const unmountEventHandler = (ev) => {
|
|
402
|
+
emits("unmountAutoFocus", ev);
|
|
403
|
+
};
|
|
404
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);
|
|
405
|
+
container.dispatchEvent(unmountEvent);
|
|
406
|
+
setTimeout(() => {
|
|
407
|
+
if (!unmountEvent.defaultPrevented) focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
408
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, unmountEventHandler);
|
|
409
|
+
focusScopesStack.remove(focusScope);
|
|
410
|
+
}, 0);
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
function handleKeyDown(event) {
|
|
414
|
+
if (!props.loop && !props.trapped) return;
|
|
415
|
+
if (focusScope.paused) return;
|
|
416
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
417
|
+
const focusedElement = getActiveElement();
|
|
418
|
+
if (isTabKey && focusedElement) {
|
|
419
|
+
const container = event.currentTarget;
|
|
420
|
+
const [first, last] = getTabbableEdges(container);
|
|
421
|
+
const hasTabbableElementsInside = first && last;
|
|
422
|
+
if (!hasTabbableElementsInside) {
|
|
423
|
+
if (focusedElement === container) event.preventDefault();
|
|
424
|
+
} else if (!event.shiftKey && focusedElement === last) {
|
|
425
|
+
event.preventDefault();
|
|
426
|
+
if (props.loop) focus(first, { select: true });
|
|
427
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
428
|
+
event.preventDefault();
|
|
429
|
+
if (props.loop) focus(last, { select: true });
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return (_ctx, _cache) => {
|
|
434
|
+
return openBlock(), createBlock(unref(Primitive), {
|
|
435
|
+
ref_key: "currentRef",
|
|
436
|
+
ref: currentRef,
|
|
437
|
+
tabindex: "-1",
|
|
438
|
+
"as-child": _ctx.asChild,
|
|
439
|
+
as: _ctx.as,
|
|
440
|
+
onKeydown: handleKeyDown
|
|
441
|
+
}, {
|
|
442
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
443
|
+
_: 3
|
|
444
|
+
}, 8, ["as-child", "as"]);
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
var FocusScope_default = FocusScope_vue_vue_type_script_setup_true_lang_default;
|
|
449
|
+
export {
|
|
450
|
+
FocusScope_default as F,
|
|
451
|
+
useHideOthers as a,
|
|
452
|
+
getActiveElement as g,
|
|
453
|
+
useBodyScrollLock as u
|
|
454
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent, withDirectives, openBlock, createElementBlock, normalizeClass, unref, isRef, vModelText } from "vue";
|
|
2
|
+
import { u as useVModel } from "./index-C1_fxYhb.js";
|
|
3
|
+
import { c as cn } from "./utils-Bz4m9VPB.js";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "Input",
|
|
6
|
+
props: {
|
|
7
|
+
defaultValue: {},
|
|
8
|
+
modelValue: {},
|
|
9
|
+
class: {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["update:modelValue"],
|
|
12
|
+
setup(__props, { emit: __emit }) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const emits = __emit;
|
|
15
|
+
const modelValue = useVModel(props, "modelValue", emits, {
|
|
16
|
+
passive: true,
|
|
17
|
+
defaultValue: props.defaultValue
|
|
18
|
+
});
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return withDirectives((openBlock(), createElementBlock("input", {
|
|
21
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
|
|
22
|
+
"data-slot": "input",
|
|
23
|
+
class: normalizeClass(unref(cn)(
|
|
24
|
+
"file:text-foreground selection:bg-primary selection:text-primary-foreground h-[52px] w-full min-w-0 rounded border border-(--border-light) bg-(--button-secondary-light) px-4 py-3 text-xs font-medium text-(--text-primary-light) outline-none transition-all duration-300 ease-in-out placeholder:text-(--text-secondary-light) placeholder:opacity-60 file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60 dark:border-(--border-dark) dark:bg-(--button-secondary-dark) dark:text-(--text-primary-dark) dark:placeholder:text-(--text-secondary-dark) sm:text-sm",
|
|
25
|
+
"focus-visible:border-(--border-hover-light) focus-visible:ring-0 dark:focus-visible:border-(--border-hover-dark)",
|
|
26
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
27
|
+
props.class
|
|
28
|
+
))
|
|
29
|
+
}, null, 2)), [
|
|
30
|
+
[vModelText, unref(modelValue)]
|
|
31
|
+
]);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
_sfc_main as _
|
|
37
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
+
import { u as useForwardExpose } from "./useForwardExpose-CNVHwdF2.js";
|
|
3
|
+
import { P as Primitive } from "./Primitive-D3IcFg81.js";
|
|
4
|
+
import { c as cn } from "./utils-Bz4m9VPB.js";
|
|
5
|
+
import { r as reactiveOmit } from "./index-Dfi5ESP2.js";
|
|
6
|
+
var Label_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "Label",
|
|
8
|
+
props: {
|
|
9
|
+
for: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: false
|
|
12
|
+
},
|
|
13
|
+
asChild: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
as: {
|
|
18
|
+
type: null,
|
|
19
|
+
required: false,
|
|
20
|
+
default: "label"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
useForwardExpose();
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createBlock(unref(Primitive), mergeProps(props, { onMousedown: _cache[0] || (_cache[0] = (event) => {
|
|
28
|
+
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
29
|
+
}) }), {
|
|
30
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
31
|
+
_: 3
|
|
32
|
+
}, 16);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var Label_default = Label_vue_vue_type_script_setup_true_lang_default;
|
|
37
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
|
+
__name: "Label",
|
|
39
|
+
props: {
|
|
40
|
+
for: {},
|
|
41
|
+
asChild: { type: Boolean },
|
|
42
|
+
as: {},
|
|
43
|
+
class: {}
|
|
44
|
+
},
|
|
45
|
+
setup(__props) {
|
|
46
|
+
const props = __props;
|
|
47
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createBlock(unref(Label_default), mergeProps({ "data-slot": "label" }, unref(delegatedProps), {
|
|
50
|
+
class: unref(cn)(
|
|
51
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
52
|
+
props.class
|
|
53
|
+
)
|
|
54
|
+
}), {
|
|
55
|
+
default: withCtx(() => [
|
|
56
|
+
renderSlot(_ctx.$slots, "default")
|
|
57
|
+
]),
|
|
58
|
+
_: 3
|
|
59
|
+
}, 16, ["class"]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
_sfc_main as _
|
|
65
|
+
};
|