@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
package/dist/field.js
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { c as cva } from "./index-FpH8cK6B.js";
|
|
2
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot, computed, Fragment, createTextVNode, toDisplayString, renderList, createCommentVNode, createBlock, withCtx, createVNode } from "vue";
|
|
3
|
+
import { c as cn } from "./utils-Bz4m9VPB.js";
|
|
4
|
+
import { _ as _sfc_main$a } from "./Label.vue_vue_type_script_setup_true_lang-B_fwvfJ-.js";
|
|
5
|
+
import { _ as _sfc_main$b } from "./Separator.vue_vue_type_script_setup_true_lang-COrZ60NR.js";
|
|
6
|
+
const _hoisted_1$3 = ["data-orientation"];
|
|
7
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "Field",
|
|
9
|
+
props: {
|
|
10
|
+
class: {},
|
|
11
|
+
orientation: {}
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return openBlock(), createElementBlock("div", {
|
|
17
|
+
role: "group",
|
|
18
|
+
"data-slot": "field",
|
|
19
|
+
"data-orientation": _ctx.orientation,
|
|
20
|
+
class: normalizeClass(unref(cn)(
|
|
21
|
+
unref(fieldVariants)({ orientation: _ctx.orientation }),
|
|
22
|
+
props.class
|
|
23
|
+
))
|
|
24
|
+
}, [
|
|
25
|
+
renderSlot(_ctx.$slots, "default")
|
|
26
|
+
], 10, _hoisted_1$3);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
31
|
+
__name: "FieldContent",
|
|
32
|
+
props: {
|
|
33
|
+
class: {}
|
|
34
|
+
},
|
|
35
|
+
setup(__props) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock("div", {
|
|
39
|
+
"data-slot": "field-content",
|
|
40
|
+
class: normalizeClass(unref(cn)(
|
|
41
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
42
|
+
props.class
|
|
43
|
+
))
|
|
44
|
+
}, [
|
|
45
|
+
renderSlot(_ctx.$slots, "default")
|
|
46
|
+
], 2);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
51
|
+
__name: "FieldDescription",
|
|
52
|
+
props: {
|
|
53
|
+
class: {}
|
|
54
|
+
},
|
|
55
|
+
setup(__props) {
|
|
56
|
+
const props = __props;
|
|
57
|
+
return (_ctx, _cache) => {
|
|
58
|
+
return openBlock(), createElementBlock("p", {
|
|
59
|
+
"data-slot": "field-description",
|
|
60
|
+
class: normalizeClass(unref(cn)(
|
|
61
|
+
"text-xs leading-6 font-normal text-(--text-secondary-light) sm:text-sm dark:text-(--text-secondary-dark) group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
62
|
+
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
63
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
64
|
+
props.class
|
|
65
|
+
))
|
|
66
|
+
}, [
|
|
67
|
+
renderSlot(_ctx.$slots, "default")
|
|
68
|
+
], 2);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const _hoisted_1$2 = {
|
|
73
|
+
key: 2,
|
|
74
|
+
class: "ml-4 flex list-disc flex-col gap-1"
|
|
75
|
+
};
|
|
76
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
77
|
+
__name: "FieldError",
|
|
78
|
+
props: {
|
|
79
|
+
class: {},
|
|
80
|
+
errors: {}
|
|
81
|
+
},
|
|
82
|
+
setup(__props) {
|
|
83
|
+
const props = __props;
|
|
84
|
+
const content = computed(() => {
|
|
85
|
+
if (!props.errors || props.errors.length === 0)
|
|
86
|
+
return null;
|
|
87
|
+
const uniqueErrors = [
|
|
88
|
+
...new Map(
|
|
89
|
+
props.errors.filter(Boolean).map((error) => {
|
|
90
|
+
const message = typeof error === "string" ? error : error == null ? void 0 : error.message;
|
|
91
|
+
return [message, error];
|
|
92
|
+
})
|
|
93
|
+
).values()
|
|
94
|
+
];
|
|
95
|
+
if (uniqueErrors.length === 1 && uniqueErrors[0]) {
|
|
96
|
+
return typeof uniqueErrors[0] === "string" ? uniqueErrors[0] : uniqueErrors[0].message;
|
|
97
|
+
}
|
|
98
|
+
return uniqueErrors.map((error) => typeof error === "string" ? error : error == null ? void 0 : error.message);
|
|
99
|
+
});
|
|
100
|
+
return (_ctx, _cache) => {
|
|
101
|
+
return _ctx.$slots.default || content.value ? (openBlock(), createElementBlock("div", {
|
|
102
|
+
key: 0,
|
|
103
|
+
role: "alert",
|
|
104
|
+
"data-slot": "field-error",
|
|
105
|
+
class: normalizeClass(unref(cn)("text-destructive text-sm font-normal", props.class))
|
|
106
|
+
}, [
|
|
107
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : typeof content.value === "string" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
108
|
+
createTextVNode(toDisplayString(content.value), 1)
|
|
109
|
+
], 64)) : Array.isArray(content.value) ? (openBlock(), createElementBlock("ul", _hoisted_1$2, [
|
|
110
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(content.value, (error, index) => {
|
|
111
|
+
return openBlock(), createElementBlock("li", { key: index }, toDisplayString(error), 1);
|
|
112
|
+
}), 128))
|
|
113
|
+
])) : createCommentVNode("", true)
|
|
114
|
+
], 2)) : createCommentVNode("", true);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
119
|
+
__name: "FieldGroup",
|
|
120
|
+
props: {
|
|
121
|
+
class: {}
|
|
122
|
+
},
|
|
123
|
+
setup(__props) {
|
|
124
|
+
const props = __props;
|
|
125
|
+
return (_ctx, _cache) => {
|
|
126
|
+
return openBlock(), createElementBlock("div", {
|
|
127
|
+
"data-slot": "field-group",
|
|
128
|
+
class: normalizeClass(unref(cn)(
|
|
129
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
130
|
+
props.class
|
|
131
|
+
))
|
|
132
|
+
}, [
|
|
133
|
+
renderSlot(_ctx.$slots, "default")
|
|
134
|
+
], 2);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
139
|
+
__name: "FieldLabel",
|
|
140
|
+
props: {
|
|
141
|
+
class: {}
|
|
142
|
+
},
|
|
143
|
+
setup(__props) {
|
|
144
|
+
const props = __props;
|
|
145
|
+
return (_ctx, _cache) => {
|
|
146
|
+
return openBlock(), createBlock(unref(_sfc_main$a), {
|
|
147
|
+
"data-slot": "field-label",
|
|
148
|
+
class: normalizeClass(unref(cn)(
|
|
149
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
150
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
|
|
151
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
152
|
+
props.class
|
|
153
|
+
))
|
|
154
|
+
}, {
|
|
155
|
+
default: withCtx(() => [
|
|
156
|
+
renderSlot(_ctx.$slots, "default")
|
|
157
|
+
]),
|
|
158
|
+
_: 3
|
|
159
|
+
}, 8, ["class"]);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const _hoisted_1$1 = ["data-variant"];
|
|
164
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
165
|
+
__name: "FieldLegend",
|
|
166
|
+
props: {
|
|
167
|
+
class: {},
|
|
168
|
+
variant: {}
|
|
169
|
+
},
|
|
170
|
+
setup(__props) {
|
|
171
|
+
const props = __props;
|
|
172
|
+
return (_ctx, _cache) => {
|
|
173
|
+
return openBlock(), createElementBlock("legend", {
|
|
174
|
+
"data-slot": "field-legend",
|
|
175
|
+
"data-variant": _ctx.variant,
|
|
176
|
+
class: normalizeClass(unref(cn)(
|
|
177
|
+
"mb-3 font-medium",
|
|
178
|
+
"data-[variant=legend]:text-base",
|
|
179
|
+
"data-[variant=label]:text-sm",
|
|
180
|
+
props.class
|
|
181
|
+
))
|
|
182
|
+
}, [
|
|
183
|
+
renderSlot(_ctx.$slots, "default")
|
|
184
|
+
], 10, _hoisted_1$1);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
const _hoisted_1 = ["data-content"];
|
|
189
|
+
const _hoisted_2 = {
|
|
190
|
+
key: 0,
|
|
191
|
+
class: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
192
|
+
"data-slot": "field-separator-content"
|
|
193
|
+
};
|
|
194
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
195
|
+
__name: "FieldSeparator",
|
|
196
|
+
props: {
|
|
197
|
+
class: {}
|
|
198
|
+
},
|
|
199
|
+
setup(__props) {
|
|
200
|
+
const props = __props;
|
|
201
|
+
return (_ctx, _cache) => {
|
|
202
|
+
return openBlock(), createElementBlock("div", {
|
|
203
|
+
"data-slot": "field-separator",
|
|
204
|
+
"data-content": !!_ctx.$slots.default,
|
|
205
|
+
class: normalizeClass(unref(cn)(
|
|
206
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
207
|
+
props.class
|
|
208
|
+
))
|
|
209
|
+
}, [
|
|
210
|
+
createVNode(unref(_sfc_main$b), { class: "absolute inset-0 top-1/2" }),
|
|
211
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_2, [
|
|
212
|
+
renderSlot(_ctx.$slots, "default")
|
|
213
|
+
])) : createCommentVNode("", true)
|
|
214
|
+
], 10, _hoisted_1);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
219
|
+
__name: "FieldSet",
|
|
220
|
+
props: {
|
|
221
|
+
class: {}
|
|
222
|
+
},
|
|
223
|
+
setup(__props) {
|
|
224
|
+
const props = __props;
|
|
225
|
+
return (_ctx, _cache) => {
|
|
226
|
+
return openBlock(), createElementBlock("fieldset", {
|
|
227
|
+
"data-slot": "field-set",
|
|
228
|
+
class: normalizeClass(unref(cn)(
|
|
229
|
+
"flex flex-col gap-6",
|
|
230
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
231
|
+
props.class
|
|
232
|
+
))
|
|
233
|
+
}, [
|
|
234
|
+
renderSlot(_ctx.$slots, "default")
|
|
235
|
+
], 2);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
240
|
+
__name: "FieldTitle",
|
|
241
|
+
props: {
|
|
242
|
+
class: {}
|
|
243
|
+
},
|
|
244
|
+
setup(__props) {
|
|
245
|
+
const props = __props;
|
|
246
|
+
return (_ctx, _cache) => {
|
|
247
|
+
return openBlock(), createElementBlock("div", {
|
|
248
|
+
"data-slot": "field-label",
|
|
249
|
+
class: normalizeClass(unref(cn)(
|
|
250
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
251
|
+
props.class
|
|
252
|
+
))
|
|
253
|
+
}, [
|
|
254
|
+
renderSlot(_ctx.$slots, "default")
|
|
255
|
+
], 2);
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
const fieldVariants = cva(
|
|
260
|
+
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
261
|
+
{
|
|
262
|
+
variants: {
|
|
263
|
+
orientation: {
|
|
264
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
265
|
+
horizontal: [
|
|
266
|
+
"flex-row items-center",
|
|
267
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
268
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
269
|
+
],
|
|
270
|
+
responsive: [
|
|
271
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
272
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
273
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
defaultVariants: {
|
|
278
|
+
orientation: "vertical"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
export {
|
|
283
|
+
_sfc_main$9 as Field,
|
|
284
|
+
_sfc_main$8 as FieldContent,
|
|
285
|
+
_sfc_main$7 as FieldDescription,
|
|
286
|
+
_sfc_main$6 as FieldError,
|
|
287
|
+
_sfc_main$5 as FieldGroup,
|
|
288
|
+
_sfc_main$4 as FieldLabel,
|
|
289
|
+
_sfc_main$3 as FieldLegend,
|
|
290
|
+
_sfc_main$2 as FieldSeparator,
|
|
291
|
+
_sfc_main$1 as FieldSet,
|
|
292
|
+
_sfc_main as FieldTitle,
|
|
293
|
+
fieldVariants
|
|
294
|
+
};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { c as computedWithControl, p as pxValue, t as toArray, w as watchImmediate, i as isClient, m as makeDestructurable, a as injectLocal, b as isDef, d as camelize, e as tryOnScopeDispose, f as isObject } from "./index-Dfi5ESP2.js";
|
|
2
|
+
import { getCurrentInstance, onUpdated, onMounted, shallowRef, watchEffect, toValue, computed, ref, watch, nextTick, defineComponent, hasInjectionContext, unref } from "vue";
|
|
3
|
+
// @__NO_SIDE_EFFECTS__
|
|
4
|
+
function createReusableTemplate(options = {}) {
|
|
5
|
+
const { inheritAttrs = true } = options;
|
|
6
|
+
const render = shallowRef();
|
|
7
|
+
const define = defineComponent({ setup(_, { slots }) {
|
|
8
|
+
return () => {
|
|
9
|
+
render.value = slots.default;
|
|
10
|
+
};
|
|
11
|
+
} });
|
|
12
|
+
const reuse = defineComponent({
|
|
13
|
+
inheritAttrs,
|
|
14
|
+
props: options.props,
|
|
15
|
+
setup(props, { attrs, slots }) {
|
|
16
|
+
return () => {
|
|
17
|
+
var _render$value;
|
|
18
|
+
if (!render.value && true) throw new Error("[VueUse] Failed to find the definition of reusable template");
|
|
19
|
+
const vnode = (_render$value = render.value) === null || _render$value === void 0 ? void 0 : _render$value.call(render, {
|
|
20
|
+
...options.props == null ? keysToCamelKebabCase(attrs) : props,
|
|
21
|
+
$slots: slots
|
|
22
|
+
});
|
|
23
|
+
return inheritAttrs && (vnode === null || vnode === void 0 ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return makeDestructurable({
|
|
28
|
+
define,
|
|
29
|
+
reuse
|
|
30
|
+
}, [define, reuse]);
|
|
31
|
+
}
|
|
32
|
+
function keysToCamelKebabCase(obj) {
|
|
33
|
+
const newObj = {};
|
|
34
|
+
for (const key in obj) newObj[camelize(key)] = obj[key];
|
|
35
|
+
return newObj;
|
|
36
|
+
}
|
|
37
|
+
const defaultWindow = isClient ? window : void 0;
|
|
38
|
+
const defaultDocument = isClient ? window.document : void 0;
|
|
39
|
+
function unrefElement(elRef) {
|
|
40
|
+
var _$el;
|
|
41
|
+
const plain = toValue(elRef);
|
|
42
|
+
return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
|
|
43
|
+
}
|
|
44
|
+
function useEventListener(...args) {
|
|
45
|
+
const register = (el, event, listener, options) => {
|
|
46
|
+
el.addEventListener(event, listener, options);
|
|
47
|
+
return () => el.removeEventListener(event, listener, options);
|
|
48
|
+
};
|
|
49
|
+
const firstParamTargets = computed(() => {
|
|
50
|
+
const test = toArray(toValue(args[0])).filter((e) => e != null);
|
|
51
|
+
return test.every((e) => typeof e !== "string") ? test : void 0;
|
|
52
|
+
});
|
|
53
|
+
return watchImmediate(() => {
|
|
54
|
+
var _firstParamTargets$va, _firstParamTargets$va2;
|
|
55
|
+
return [
|
|
56
|
+
(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
|
|
57
|
+
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
|
|
58
|
+
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
|
|
59
|
+
toValue(firstParamTargets.value ? args[3] : args[2])
|
|
60
|
+
];
|
|
61
|
+
}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
|
|
62
|
+
if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
|
|
63
|
+
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
|
|
64
|
+
const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
|
|
65
|
+
onCleanup(() => {
|
|
66
|
+
cleanups.forEach((fn) => fn());
|
|
67
|
+
});
|
|
68
|
+
}, { flush: "post" });
|
|
69
|
+
}
|
|
70
|
+
// @__NO_SIDE_EFFECTS__
|
|
71
|
+
function useMounted() {
|
|
72
|
+
const isMounted = shallowRef(false);
|
|
73
|
+
const instance = getCurrentInstance();
|
|
74
|
+
if (instance) onMounted(() => {
|
|
75
|
+
isMounted.value = true;
|
|
76
|
+
}, instance);
|
|
77
|
+
return isMounted;
|
|
78
|
+
}
|
|
79
|
+
// @__NO_SIDE_EFFECTS__
|
|
80
|
+
function useSupported(callback) {
|
|
81
|
+
const isMounted = /* @__PURE__ */ useMounted();
|
|
82
|
+
return computed(() => {
|
|
83
|
+
isMounted.value;
|
|
84
|
+
return Boolean(callback());
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function createKeyPredicate(keyFilter) {
|
|
88
|
+
if (typeof keyFilter === "function") return keyFilter;
|
|
89
|
+
else if (typeof keyFilter === "string") return (event) => event.key === keyFilter;
|
|
90
|
+
else if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);
|
|
91
|
+
return () => true;
|
|
92
|
+
}
|
|
93
|
+
function onKeyStroke(...args) {
|
|
94
|
+
let key;
|
|
95
|
+
let handler;
|
|
96
|
+
let options = {};
|
|
97
|
+
if (args.length === 3) {
|
|
98
|
+
key = args[0];
|
|
99
|
+
handler = args[1];
|
|
100
|
+
options = args[2];
|
|
101
|
+
} else if (args.length === 2) if (typeof args[1] === "object") {
|
|
102
|
+
key = true;
|
|
103
|
+
handler = args[0];
|
|
104
|
+
options = args[1];
|
|
105
|
+
} else {
|
|
106
|
+
key = args[0];
|
|
107
|
+
handler = args[1];
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
key = true;
|
|
111
|
+
handler = args[0];
|
|
112
|
+
}
|
|
113
|
+
const { target = defaultWindow, eventName = "keydown", passive = false, dedupe = false } = options;
|
|
114
|
+
const predicate = createKeyPredicate(key);
|
|
115
|
+
const listener = (e) => {
|
|
116
|
+
if (e.repeat && toValue(dedupe)) return;
|
|
117
|
+
if (predicate(e)) handler(e);
|
|
118
|
+
};
|
|
119
|
+
return useEventListener(target, eventName, listener, passive);
|
|
120
|
+
}
|
|
121
|
+
const ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
122
|
+
// @__NO_SIDE_EFFECTS__
|
|
123
|
+
function useSSRWidth() {
|
|
124
|
+
const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
|
|
125
|
+
return typeof ssrWidth === "number" ? ssrWidth : void 0;
|
|
126
|
+
}
|
|
127
|
+
function useMediaQuery(query, options = {}) {
|
|
128
|
+
const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
129
|
+
const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
|
|
130
|
+
const ssrSupport = shallowRef(typeof ssrWidth === "number");
|
|
131
|
+
const mediaQuery = shallowRef();
|
|
132
|
+
const matches = shallowRef(false);
|
|
133
|
+
const handler = (event) => {
|
|
134
|
+
matches.value = event.matches;
|
|
135
|
+
};
|
|
136
|
+
watchEffect(() => {
|
|
137
|
+
if (ssrSupport.value) {
|
|
138
|
+
ssrSupport.value = !isSupported.value;
|
|
139
|
+
matches.value = toValue(query).split(",").some((queryString) => {
|
|
140
|
+
const not = queryString.includes("not all");
|
|
141
|
+
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
142
|
+
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
143
|
+
let res = Boolean(minWidth || maxWidth);
|
|
144
|
+
if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
|
|
145
|
+
if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
|
|
146
|
+
return not ? !res : res;
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (!isSupported.value) return;
|
|
151
|
+
mediaQuery.value = window$1.matchMedia(toValue(query));
|
|
152
|
+
matches.value = mediaQuery.value.matches;
|
|
153
|
+
});
|
|
154
|
+
useEventListener(mediaQuery, "change", handler, { passive: true });
|
|
155
|
+
return computed(() => matches.value);
|
|
156
|
+
}
|
|
157
|
+
function cloneFnJSON(source) {
|
|
158
|
+
return JSON.parse(JSON.stringify(source));
|
|
159
|
+
}
|
|
160
|
+
function useCurrentElement(rootComponent) {
|
|
161
|
+
const vm = getCurrentInstance();
|
|
162
|
+
const currentElement = computedWithControl(() => null, () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el);
|
|
163
|
+
onUpdated(currentElement.trigger);
|
|
164
|
+
onMounted(currentElement.trigger);
|
|
165
|
+
return currentElement;
|
|
166
|
+
}
|
|
167
|
+
function useResizeObserver(target, callback, options = {}) {
|
|
168
|
+
const { window: window$1 = defaultWindow, ...observerOptions } = options;
|
|
169
|
+
let observer;
|
|
170
|
+
const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "ResizeObserver" in window$1);
|
|
171
|
+
const cleanup = () => {
|
|
172
|
+
if (observer) {
|
|
173
|
+
observer.disconnect();
|
|
174
|
+
observer = void 0;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const stopWatch = watch(computed(() => {
|
|
178
|
+
const _targets = toValue(target);
|
|
179
|
+
return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
|
|
180
|
+
}), (els) => {
|
|
181
|
+
cleanup();
|
|
182
|
+
if (isSupported.value && window$1) {
|
|
183
|
+
observer = new ResizeObserver(callback);
|
|
184
|
+
for (const _el of els) if (_el) observer.observe(_el, observerOptions);
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
immediate: true,
|
|
188
|
+
flush: "post"
|
|
189
|
+
});
|
|
190
|
+
const stop = () => {
|
|
191
|
+
cleanup();
|
|
192
|
+
stopWatch();
|
|
193
|
+
};
|
|
194
|
+
tryOnScopeDispose(stop);
|
|
195
|
+
return {
|
|
196
|
+
isSupported,
|
|
197
|
+
stop
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
// @__NO_SIDE_EFFECTS__
|
|
201
|
+
function useVModel(props, key, emit, options = {}) {
|
|
202
|
+
var _vm$$emit, _vm$proxy;
|
|
203
|
+
const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;
|
|
204
|
+
const vm = getCurrentInstance();
|
|
205
|
+
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));
|
|
206
|
+
let event = eventName;
|
|
207
|
+
if (!key) key = "modelValue";
|
|
208
|
+
event = event || `update:${key.toString()}`;
|
|
209
|
+
const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
|
|
210
|
+
const getValue$1 = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;
|
|
211
|
+
const triggerEmit = (value) => {
|
|
212
|
+
if (shouldEmit) {
|
|
213
|
+
if (shouldEmit(value)) _emit(event, value);
|
|
214
|
+
} else _emit(event, value);
|
|
215
|
+
};
|
|
216
|
+
if (passive) {
|
|
217
|
+
const proxy = ref(getValue$1());
|
|
218
|
+
let isUpdating = false;
|
|
219
|
+
watch(() => props[key], (v) => {
|
|
220
|
+
if (!isUpdating) {
|
|
221
|
+
isUpdating = true;
|
|
222
|
+
proxy.value = cloneFn(v);
|
|
223
|
+
nextTick(() => isUpdating = false);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
watch(proxy, (v) => {
|
|
227
|
+
if (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);
|
|
228
|
+
}, { deep });
|
|
229
|
+
return proxy;
|
|
230
|
+
} else return computed({
|
|
231
|
+
get() {
|
|
232
|
+
return getValue$1();
|
|
233
|
+
},
|
|
234
|
+
set(value) {
|
|
235
|
+
triggerEmit(value);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
export {
|
|
240
|
+
unrefElement as a,
|
|
241
|
+
useEventListener as b,
|
|
242
|
+
useMounted as c,
|
|
243
|
+
defaultWindow as d,
|
|
244
|
+
useCurrentElement as e,
|
|
245
|
+
useMediaQuery as f,
|
|
246
|
+
defaultDocument as g,
|
|
247
|
+
useResizeObserver as h,
|
|
248
|
+
createReusableTemplate as i,
|
|
249
|
+
onKeyStroke as o,
|
|
250
|
+
useVModel as u
|
|
251
|
+
};
|