@hina-ui/vue 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +769 -331
- package/dist/index.js.map +1 -1
- package/dist/types/components/accordion/AccordionContent.vue.d.ts.map +1 -1
- package/dist/types/components/avatar/AvatarGroup.vue.d.ts.map +1 -1
- package/dist/types/components/avatar/utils/children.d.ts +3 -0
- package/dist/types/components/avatar/utils/children.d.ts.map +1 -0
- package/dist/types/components/checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/types/components/checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/types/components/checkbox/checkbox.variants.d.ts +75 -2
- package/dist/types/components/checkbox/checkbox.variants.d.ts.map +1 -1
- package/dist/types/components/checkbox-group/CheckboxGroup.vue.d.ts +32 -27
- package/dist/types/components/checkbox-group/CheckboxGroup.vue.d.ts.map +1 -1
- package/dist/types/components/checkbox-group/checkbox-group.variants.d.ts +34 -0
- package/dist/types/components/checkbox-group/checkbox-group.variants.d.ts.map +1 -1
- package/dist/types/components/collapsible/CollapsibleContent.vue.d.ts.map +1 -1
- package/dist/types/components/combobox/Combobox.vue.d.ts +38 -38
- package/dist/types/components/combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/types/components/combobox/ComboboxList.vue.d.ts +22 -15
- package/dist/types/components/combobox/ComboboxList.vue.d.ts.map +1 -1
- package/dist/types/components/date-picker/DatePicker.vue.d.ts.map +1 -1
- package/dist/types/components/date-range-picker/DateRangePicker.vue.d.ts.map +1 -1
- package/dist/types/components/date-time-picker/DateTimePicker.vue.d.ts.map +1 -1
- package/dist/types/components/dialog/Dialog.vue.d.ts +22 -16
- package/dist/types/components/dialog/Dialog.vue.d.ts.map +1 -1
- package/dist/types/components/dialog/dialog.variants.d.ts +32 -2
- package/dist/types/components/dialog/dialog.variants.d.ts.map +1 -1
- package/dist/types/components/form-field/FormField.vue.d.ts +7 -4
- package/dist/types/components/form-field/FormField.vue.d.ts.map +1 -1
- package/dist/types/components/form-field/form-field.variants.d.ts +73 -1
- package/dist/types/components/form-field/form-field.variants.d.ts.map +1 -1
- package/dist/types/components/form-field/types.d.ts +6 -0
- package/dist/types/components/form-field/types.d.ts.map +1 -0
- package/dist/types/components/form-layout/FormLayout.vue.d.ts +2 -1
- package/dist/types/components/form-layout/FormLayout.vue.d.ts.map +1 -1
- package/dist/types/components/form-layout/context.d.ts +7 -0
- package/dist/types/components/form-layout/context.d.ts.map +1 -0
- package/dist/types/components/image/ImageGroup.vue.d.ts.map +1 -1
- package/dist/types/components/image/composables/useImageGroupState.d.ts +7 -0
- package/dist/types/components/image/composables/useImageGroupState.d.ts.map +1 -0
- package/dist/types/components/input/Input.vue.d.ts +3 -3
- package/dist/types/components/input/Input.vue.d.ts.map +1 -1
- package/dist/types/components/input/InputBase.vue.d.ts +3 -3
- package/dist/types/components/input/InputBase.vue.d.ts.map +1 -1
- package/dist/types/components/input/input.variants.d.ts +53 -7
- package/dist/types/components/input/input.variants.d.ts.map +1 -1
- package/dist/types/components/input-group/InputGroup.vue.d.ts +3 -3
- package/dist/types/components/input-group/InputGroup.vue.d.ts.map +1 -1
- package/dist/types/components/input-group/context.d.ts +2 -1
- package/dist/types/components/input-group/context.d.ts.map +1 -1
- package/dist/types/components/input-group/input-group.variants.d.ts +13 -1
- package/dist/types/components/input-group/input-group.variants.d.ts.map +1 -1
- package/dist/types/components/listbox/Listbox.vue.d.ts +36 -29
- package/dist/types/components/listbox/Listbox.vue.d.ts.map +1 -1
- package/dist/types/components/listbox/ListboxOptionContent.vue.d.ts +31 -0
- package/dist/types/components/listbox/ListboxOptionContent.vue.d.ts.map +1 -0
- package/dist/types/components/listbox/listbox.variants.d.ts +19 -1
- package/dist/types/components/listbox/listbox.variants.d.ts.map +1 -1
- package/dist/types/components/multi-combobox/MultiCombobox.vue.d.ts +41 -43
- package/dist/types/components/multi-combobox/MultiCombobox.vue.d.ts.map +1 -1
- package/dist/types/components/multi-combobox/composables/useMultiCombobox.d.ts +27 -0
- package/dist/types/components/multi-combobox/composables/useMultiCombobox.d.ts.map +1 -0
- package/dist/types/components/multi-select/MultiSelect.vue.d.ts +39 -41
- package/dist/types/components/multi-select/MultiSelect.vue.d.ts.map +1 -1
- package/dist/types/components/number-input/NumberInput.vue.d.ts +3 -3
- package/dist/types/components/number-input/NumberInput.vue.d.ts.map +1 -1
- package/dist/types/components/number-input/number-input.variants.d.ts +10 -1
- package/dist/types/components/number-input/number-input.variants.d.ts.map +1 -1
- package/dist/types/components/password-input/PasswordInput.vue.d.ts +3 -3
- package/dist/types/components/password-input/PasswordInput.vue.d.ts.map +1 -1
- package/dist/types/components/radio-group/RadioGroup.vue.d.ts +32 -27
- package/dist/types/components/radio-group/RadioGroup.vue.d.ts.map +1 -1
- package/dist/types/components/scroll-area/scroll-restore.d.ts +0 -1
- package/dist/types/components/scroll-area/scroll-restore.d.ts.map +1 -1
- package/dist/types/components/search-input/SearchInput.vue.d.ts +3 -3
- package/dist/types/components/search-input/SearchInput.vue.d.ts.map +1 -1
- package/dist/types/components/segmented-control/SegmentedControl.vue.d.ts +30 -30
- package/dist/types/components/segmented-control/SegmentedControl.vue.d.ts.map +1 -1
- package/dist/types/components/select/Select.vue.d.ts +41 -37
- package/dist/types/components/select/Select.vue.d.ts.map +1 -1
- package/dist/types/components/select/SelectList.vue.d.ts +22 -15
- package/dist/types/components/select/SelectList.vue.d.ts.map +1 -1
- package/dist/types/components/select/composables/useClearTransition.d.ts +10 -0
- package/dist/types/components/select/composables/useClearTransition.d.ts.map +1 -0
- package/dist/types/components/select/select.variants.d.ts +16 -0
- package/dist/types/components/select/select.variants.d.ts.map +1 -1
- package/dist/types/components/select/types.d.ts +7 -7
- package/dist/types/components/select/types.d.ts.map +1 -1
- package/dist/types/components/switch/Switch.vue.d.ts +3 -0
- package/dist/types/components/switch/Switch.vue.d.ts.map +1 -1
- package/dist/types/components/tags-input/TagsInput.vue.d.ts.map +1 -1
- package/dist/types/components/textarea/Textarea.vue.d.ts.map +1 -1
- package/dist/types/components/textarea/composables/useTextareaSizing.d.ts +27 -0
- package/dist/types/components/textarea/composables/useTextareaSizing.d.ts.map +1 -0
- package/dist/types/components/textarea/textarea.variants.d.ts +9 -6
- package/dist/types/components/textarea/textarea.variants.d.ts.map +1 -1
- package/dist/types/components/tree-select/TreeSelect.vue.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/caret.d.ts +0 -4
- package/dist/types/lib/caret.d.ts.map +1 -1
- package/dist/types/lib/collapse.d.ts +2 -0
- package/dist/types/lib/collapse.d.ts.map +1 -1
- package/dist/types/lib/field-focus.d.ts +0 -4
- package/dist/types/lib/field-focus.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/AccordionContent.vue +2 -11
- package/src/components/avatar/AvatarGroup.vue +3 -8
- package/src/components/avatar/utils/children.ts +7 -0
- package/src/components/checkbox/Checkbox.vue +25 -4
- package/src/components/checkbox/checkbox.variants.ts +34 -3
- package/src/components/checkbox-group/CheckboxGroup.vue +14 -5
- package/src/components/checkbox-group/checkbox-group.variants.ts +9 -0
- package/src/components/collapsible/CollapsibleContent.vue +2 -11
- package/src/components/combobox/Combobox.vue +4 -3
- package/src/components/combobox/ComboboxList.vue +3 -3
- package/src/components/date-picker/DatePicker.vue +1 -0
- package/src/components/date-range-picker/DateRangePicker.vue +1 -0
- package/src/components/date-time-picker/DateTimePicker.vue +1 -0
- package/src/components/dialog/Dialog.vue +70 -39
- package/src/components/dialog/dialog.variants.ts +9 -3
- package/src/components/form-field/FormField.vue +82 -37
- package/src/components/form-field/form-field.variants.ts +39 -0
- package/src/components/form-field/types.ts +5 -0
- package/src/components/form-layout/FormLayout.vue +13 -7
- package/src/components/form-layout/context.ts +19 -0
- package/src/components/image/ImageGroup.vue +2 -30
- package/src/components/image/composables/useImageGroupState.ts +35 -0
- package/src/components/input/Input.vue +3 -3
- package/src/components/input/InputBase.vue +6 -5
- package/src/components/input/input.variants.ts +19 -5
- package/src/components/input-group/InputGroup.vue +16 -5
- package/src/components/input-group/context.ts +2 -1
- package/src/components/input-group/input-group.variants.ts +8 -1
- package/src/components/listbox/Listbox.vue +26 -29
- package/src/components/listbox/ListboxOptionContent.vue +28 -0
- package/src/components/listbox/listbox.variants.ts +6 -1
- package/src/components/multi-combobox/MultiCombobox.vue +15 -52
- package/src/components/multi-combobox/composables/useMultiCombobox.ts +63 -0
- package/src/components/multi-select/MultiSelect.vue +4 -4
- package/src/components/number-input/NumberInput.vue +9 -7
- package/src/components/number-input/number-input.variants.ts +5 -1
- package/src/components/password-input/PasswordInput.vue +3 -3
- package/src/components/radio-group/RadioGroup.vue +29 -8
- package/src/components/scroll-area/scroll-restore.ts +0 -5
- package/src/components/search-input/SearchInput.vue +3 -3
- package/src/components/segmented-control/SegmentedControl.vue +3 -3
- package/src/components/select/Select.vue +69 -25
- package/src/components/select/SelectList.vue +3 -3
- package/src/components/select/composables/useClearTransition.ts +25 -0
- package/src/components/select/select.variants.ts +24 -0
- package/src/components/select/types.ts +10 -8
- package/src/components/switch/Switch.vue +26 -4
- package/src/components/tags-input/TagsInput.vue +1 -0
- package/src/components/textarea/Textarea.vue +3 -41
- package/src/components/textarea/composables/useTextareaSizing.ts +54 -0
- package/src/components/textarea/textarea.variants.ts +6 -5
- package/src/components/tree-select/TreeSelect.vue +1 -0
- package/src/index.ts +1 -0
- package/src/lib/caret.ts +0 -4
- package/src/lib/collapse.ts +21 -1
- package/src/lib/field-focus.ts +0 -4
- package/src/styles/interaction.css +6 -4
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { clsx } from "clsx";
|
|
|
2
2
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
3
|
import { createTV } from "tailwind-variants";
|
|
4
4
|
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isRef, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRef, toValue, unref, useAttrs, useId, useModel, useSlots, vModelDynamic, vModelSelect, vModelText, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
5
|
-
import { AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger, AspectRatio, CalendarCell, CalendarCellTrigger, CalendarGrid, CalendarGridBody, CalendarGridHead, CalendarGridRow, CalendarHeadCell, CalendarNext, CalendarPrev, CalendarRoot, CheckboxGroupRoot, CheckboxRoot, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, ComboboxAnchor, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxPortal, ComboboxRoot, ComboboxTrigger, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuItemIndicator, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuRoot, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DateFieldInput, DateFieldRoot, DateRangeFieldInput, DateRangeFieldRoot, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, HoverCardContent, HoverCardPortal, HoverCardRoot, HoverCardTrigger, ListboxContent, ListboxFilter, ListboxGroup, ListboxGroupLabel, ListboxItem, ListboxItemIndicator, ListboxRoot, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarItemIndicator, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarRoot, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthPickerCell, MonthPickerCellTrigger, MonthPickerGrid, MonthPickerGridBody, MonthPickerGridRow, MonthPickerNext, MonthPickerPrev, MonthPickerRoot, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, PinInputInput, PinInputRoot, PopoverAnchor, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Primitive, ProgressIndicator, ProgressRoot, RadioGroupItem, RadioGroupRoot, RangeCalendarCell, RangeCalendarCellTrigger, RangeCalendarGrid, RangeCalendarGridBody, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarNext, RangeCalendarPrev, RangeCalendarRoot, RatingItem, RatingItemIndicator, RatingRoot, SelectContent, SelectGroup, SelectItem, SelectItemIndicator, SelectItemText, SelectLabel, SelectPortal, SelectRoot, SelectTrigger, Separator, SliderRoot, SliderThumb, SliderTrack, SplitterGroup, SplitterPanel, SplitterResizeHandle, SwitchRoot, TabsContent, TabsList, TabsRoot, TabsTrigger, TagsInputInput, TagsInputItem, TagsInputItemText, TagsInputRoot, TimeFieldInput, TimeFieldRoot, ToastClose, ToastDescription, ToastPortal, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroupItem, ToggleGroupRoot, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TreeItem, TreeRoot, VisuallyHidden, YearPickerCell, YearPickerCellTrigger, YearPickerGrid, YearPickerGridBody, YearPickerGridRow, YearPickerNext, YearPickerPrev, YearPickerRoot, injectTabsRootContext, injectTooltipProviderContext, useBodyScrollLock, useForwardPropsEmits } from "reka-ui";
|
|
5
|
+
import { AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger, AspectRatio, CalendarCell, CalendarCellTrigger, CalendarGrid, CalendarGridBody, CalendarGridHead, CalendarGridRow, CalendarHeadCell, CalendarNext, CalendarPrev, CalendarRoot, CheckboxGroupRoot, CheckboxRoot, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, ComboboxAnchor, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxPortal, ComboboxRoot, ComboboxTrigger, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuItemIndicator, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuRoot, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DateFieldInput, DateFieldRoot, DateRangeFieldInput, DateRangeFieldRoot, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, HoverCardContent, HoverCardPortal, HoverCardRoot, HoverCardTrigger, ListboxContent, ListboxFilter, ListboxGroup, ListboxGroupLabel, ListboxItem, ListboxItemIndicator, ListboxRoot, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarItemIndicator, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarRoot, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthPickerCell, MonthPickerCellTrigger, MonthPickerGrid, MonthPickerGridBody, MonthPickerGridRow, MonthPickerNext, MonthPickerPrev, MonthPickerRoot, NumberFieldDecrement, NumberFieldIncrement, NumberFieldInput, NumberFieldRoot, PinInputInput, PinInputRoot, PopoverAnchor, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Primitive, ProgressIndicator, ProgressRoot, RadioGroupItem, RadioGroupRoot, RangeCalendarCell, RangeCalendarCellTrigger, RangeCalendarGrid, RangeCalendarGridBody, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarNext, RangeCalendarPrev, RangeCalendarRoot, RatingItem, RatingItemIndicator, RatingRoot, SelectContent, SelectGroup, SelectItem, SelectItemIndicator, SelectItemText, SelectLabel, SelectPortal, SelectRoot, SelectTrigger, Separator, SliderRoot, SliderThumb, SliderTrack, SplitterGroup, SplitterPanel, SplitterResizeHandle, SwitchRoot, TabsContent, TabsList, TabsRoot, TabsTrigger, TagsInputInput, TagsInputItem, TagsInputItemText, TagsInputRoot, TimeFieldInput, TimeFieldRoot, ToastClose, ToastDescription, ToastPortal, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroupItem, ToggleGroupRoot, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TreeItem, TreeRoot, VisuallyHidden, YearPickerCell, YearPickerCellTrigger, YearPickerGrid, YearPickerGridBody, YearPickerGridRow, YearPickerNext, YearPickerPrev, YearPickerRoot, injectListboxItemContext, injectTabsRootContext, injectTooltipProviderContext, useBodyScrollLock, useDirection, useForwardPropsEmits } from "reka-ui";
|
|
6
6
|
import { ArrowLeft, ArrowRight, CalendarClock, CalendarDays, CalendarRange, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleCheck, CircleX, Copy, Download, Eye, EyeOff, File, Inbox, Info, Lightbulb, Megaphone, Minus, PanelLeft, RotateCw, Search, Shrink, Star, TrendingDown, TrendingUp, TriangleAlert, Upload, User, X, ZoomIn, ZoomOut } from "@lucide/vue";
|
|
7
7
|
import { Motion, animate, useMotionValue, useTransform } from "motion-v";
|
|
8
8
|
import { createSharedComposable, useDocumentVisibility, useEventListener, useIntersectionObserver, useIntervalFn, useMediaQuery, useMutationObserver } from "@vueuse/core";
|
|
@@ -4296,6 +4296,11 @@ var Avatar_default = /* @__PURE__ */ defineComponent({
|
|
|
4296
4296
|
}
|
|
4297
4297
|
});
|
|
4298
4298
|
//#endregion
|
|
4299
|
+
//#region src/components/avatar/utils/children.ts
|
|
4300
|
+
function flattenChildren(nodes) {
|
|
4301
|
+
return (nodes ?? []).flatMap((node) => node.type === Fragment ? flattenChildren(node.children) : [node]);
|
|
4302
|
+
}
|
|
4303
|
+
//#endregion
|
|
4299
4304
|
//#region src/components/avatar/avatar-group.variants.ts
|
|
4300
4305
|
var avatarGroupItem = tv({
|
|
4301
4306
|
base: "ring-surface first:me-0 ring-2",
|
|
@@ -4319,10 +4324,7 @@ var AvatarGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
4319
4324
|
setup(__props) {
|
|
4320
4325
|
const props = __props;
|
|
4321
4326
|
const slots = useSlots();
|
|
4322
|
-
|
|
4323
|
-
return (nodes ?? []).flatMap((node) => node.type === Fragment ? flatten(node.children) : [node]);
|
|
4324
|
-
}
|
|
4325
|
-
const children = computed(() => flatten(slots.default?.()));
|
|
4327
|
+
const children = computed(() => flattenChildren(slots.default?.()));
|
|
4326
4328
|
const visible = computed(() => props.max && props.max > 0 ? children.value.slice(0, props.max) : children.value);
|
|
4327
4329
|
const hidden = computed(() => children.value.length - visible.value.length);
|
|
4328
4330
|
const item = computed(() => avatarGroupItem({ size: props.size }));
|
|
@@ -4636,6 +4638,16 @@ function useCollapseHooks(axis = "y") {
|
|
|
4636
4638
|
onBeforeUpdate(remember);
|
|
4637
4639
|
return collapseHooks(axis, () => parent);
|
|
4638
4640
|
}
|
|
4641
|
+
function useCollapseGap() {
|
|
4642
|
+
const content = shallowRef(null);
|
|
4643
|
+
function measure() {
|
|
4644
|
+
const el = content.value?.$el;
|
|
4645
|
+
if (el instanceof Element) writeCollapseGap(el, el.parentElement);
|
|
4646
|
+
}
|
|
4647
|
+
onMounted(measure);
|
|
4648
|
+
onBeforeUpdate(measure);
|
|
4649
|
+
return content;
|
|
4650
|
+
}
|
|
4639
4651
|
//#endregion
|
|
4640
4652
|
//#region src/components/alert/Alert.vue?vue&type=script&setup=true&lang.ts
|
|
4641
4653
|
var _hoisted_1$80 = {
|
|
@@ -5333,10 +5345,6 @@ function controlOf(node) {
|
|
|
5333
5345
|
const control = node.matches(CONTROL) ? node : node.querySelector(CONTROL);
|
|
5334
5346
|
return control instanceof HTMLInputElement || control instanceof HTMLTextAreaElement ? control : null;
|
|
5335
5347
|
}
|
|
5336
|
-
/**
|
|
5337
|
-
* 点击输入面里非交互的部分(附属格、前后缀、空白)时把焦点交给最近的输入区,返回被聚焦的输入区;点击落在交互元素上或者没有可聚焦的输入区时返回 null。
|
|
5338
|
-
* 点击所在的段自己含输入区时只认它、不动光标(段内的处理器已经定过位);否则先向后找,再向前找;落在点击位置之后的输入区把光标放到开头,之前的放到末尾。
|
|
5339
|
-
*/
|
|
5340
5348
|
function focusFieldFrom(root, target) {
|
|
5341
5349
|
if (target.closest(INTERACTIVE)) return null;
|
|
5342
5350
|
const segments = Array.from(root.children);
|
|
@@ -5361,11 +5369,11 @@ function focusFieldFrom(root, target) {
|
|
|
5361
5369
|
//#endregion
|
|
5362
5370
|
//#region src/components/input/input.variants.ts
|
|
5363
5371
|
var inputHost = tv({
|
|
5364
|
-
base: ["hn-field text-fg flex w-full min-w-0 cursor-text items-stretch overflow-hidden rounded-md border font-medium", "
|
|
5372
|
+
base: ["group/hn-field text-fg flex w-full min-w-0 cursor-text items-stretch overflow-hidden rounded-md border font-medium", "data-disabled:cursor-not-allowed data-disabled:opacity-50"],
|
|
5365
5373
|
variants: {
|
|
5366
5374
|
variant: {
|
|
5367
|
-
primary: "border-line [--hn-field-bg:var(--hn-surface)] [--hn-field-shadow:var(--hn-shadow-sm)]",
|
|
5368
|
-
secondary: "border-transparent [--hn-field-bg:var(--hn-bg-inset)]"
|
|
5375
|
+
primary: "hn-field border-line [--hn-field-bg:var(--hn-surface)] [--hn-field-shadow:var(--hn-shadow-sm)]",
|
|
5376
|
+
secondary: "hn-field border-transparent [--hn-field-bg:var(--hn-bg-inset)]"
|
|
5369
5377
|
},
|
|
5370
5378
|
size: {
|
|
5371
5379
|
sm: "h-[var(--hn-control-h-sm)] text-sm [--hn-input-h:var(--hn-control-h-sm)] [--hn-input-px:var(--hn-control-px-sm)] [--hn-input-icon:0.875rem]",
|
|
@@ -5378,6 +5386,10 @@ var inputHost = tv({
|
|
|
5378
5386
|
size: "md"
|
|
5379
5387
|
}
|
|
5380
5388
|
});
|
|
5389
|
+
var textInputHost = tv({
|
|
5390
|
+
extend: inputHost,
|
|
5391
|
+
variants: { variant: { bare: "rounded-none border-0 bg-transparent shadow-none outline-none" } }
|
|
5392
|
+
});
|
|
5381
5393
|
var inputControl = tv({
|
|
5382
5394
|
base: ["h-full min-w-0 flex-1 bg-transparent px-[var(--hn-input-px)] text-inherit outline-none [font:inherit]", "placeholder:text-faint placeholder:font-normal disabled:cursor-not-allowed"],
|
|
5383
5395
|
variants: {
|
|
@@ -5393,7 +5405,11 @@ var inputAction = tv({ base: [
|
|
|
5393
5405
|
] });
|
|
5394
5406
|
var inputIndicator = tv({ base: "cursor-pointer outline-none" });
|
|
5395
5407
|
var inputActionSlot = tv({ base: "flex shrink-0 items-stretch self-stretch" });
|
|
5396
|
-
var inputEmbedded = tv({ base:
|
|
5408
|
+
var inputEmbedded = tv({ base: [
|
|
5409
|
+
"group/hn-field flex min-w-0 flex-1 items-stretch",
|
|
5410
|
+
"data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
5411
|
+
"group-data-disabled/hn-field:data-disabled:opacity-100"
|
|
5412
|
+
] });
|
|
5397
5413
|
//#endregion
|
|
5398
5414
|
//#region src/components/input/InputAction.vue
|
|
5399
5415
|
var InputAction_default = /* @__PURE__ */ defineComponent({
|
|
@@ -5471,7 +5487,11 @@ function injectInputGroup() {
|
|
|
5471
5487
|
}
|
|
5472
5488
|
//#endregion
|
|
5473
5489
|
//#region src/components/input/InputBase.vue?vue&type=script&setup=true&lang.ts
|
|
5474
|
-
var _hoisted_1$75 = [
|
|
5490
|
+
var _hoisted_1$75 = [
|
|
5491
|
+
"data-invalid",
|
|
5492
|
+
"data-disabled",
|
|
5493
|
+
"aria-busy"
|
|
5494
|
+
];
|
|
5475
5495
|
var _hoisted_2$36 = [
|
|
5476
5496
|
"id",
|
|
5477
5497
|
"disabled",
|
|
@@ -5527,8 +5547,9 @@ var InputBase_default = /* @__PURE__ */ defineComponent({
|
|
|
5527
5547
|
return openBlock(), createElementBlock("div", {
|
|
5528
5548
|
"data-hn-input": "",
|
|
5529
5549
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
5550
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
5530
5551
|
"aria-busy": props.loading || void 0,
|
|
5531
|
-
class: normalizeClass(unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(
|
|
5552
|
+
class: normalizeClass(unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(textInputHost)({
|
|
5532
5553
|
variant: props.variant,
|
|
5533
5554
|
size: props.size
|
|
5534
5555
|
}), props.class)),
|
|
@@ -5687,10 +5708,6 @@ var MIRRORED = [
|
|
|
5687
5708
|
"border-bottom-width",
|
|
5688
5709
|
"border-left-width"
|
|
5689
5710
|
];
|
|
5690
|
-
/**
|
|
5691
|
-
* 量出 textarea 光标所在行的顶边(相对 textarea 自身的边框盒)。
|
|
5692
|
-
* 原生没有光标几何 API,只能用同排版的镜像块把光标前的文字排一遍。
|
|
5693
|
-
*/
|
|
5694
5711
|
function caretTop(node, at = node.selectionEnd) {
|
|
5695
5712
|
const style = getComputedStyle(node);
|
|
5696
5713
|
const mirror = node.ownerDocument.createElement("div");
|
|
@@ -5716,13 +5733,63 @@ function caretTop(node, at = node.selectionEnd) {
|
|
|
5716
5733
|
return top;
|
|
5717
5734
|
}
|
|
5718
5735
|
//#endregion
|
|
5736
|
+
//#region src/components/textarea/composables/useTextareaSizing.ts
|
|
5737
|
+
function useTextareaSizing(props, model) {
|
|
5738
|
+
const el = shallowRef(null);
|
|
5739
|
+
const area = shallowRef();
|
|
5740
|
+
const bounds = computed(() => {
|
|
5741
|
+
const options = props.autosize === true ? {} : props.autosize || null;
|
|
5742
|
+
return {
|
|
5743
|
+
min: options?.minRows ?? props.rows,
|
|
5744
|
+
max: options?.maxRows
|
|
5745
|
+
};
|
|
5746
|
+
});
|
|
5747
|
+
function fit() {
|
|
5748
|
+
const node = el.value;
|
|
5749
|
+
if (!node) return;
|
|
5750
|
+
node.style.height = "auto";
|
|
5751
|
+
node.style.height = `${node.scrollHeight}px`;
|
|
5752
|
+
if (document.activeElement === node) reveal(node);
|
|
5753
|
+
}
|
|
5754
|
+
function reveal(node) {
|
|
5755
|
+
const scroller = area.value?.viewport ?? node.closest("[data-overlayscrollbars-initialize]");
|
|
5756
|
+
if (!scroller) return;
|
|
5757
|
+
const box = scroller.getBoundingClientRect();
|
|
5758
|
+
const top = node.getBoundingClientRect().top + caretTop(node);
|
|
5759
|
+
const bottom = top + parseFloat(getComputedStyle(node).lineHeight);
|
|
5760
|
+
if (bottom > box.bottom) scroller.scrollTop += bottom - box.bottom;
|
|
5761
|
+
else if (top < box.top) scroller.scrollTop -= box.top - top;
|
|
5762
|
+
}
|
|
5763
|
+
function focus(event) {
|
|
5764
|
+
const node = el.value;
|
|
5765
|
+
if (!node || node.disabled || event.target === node) return;
|
|
5766
|
+
node.focus();
|
|
5767
|
+
node.setSelectionRange(node.value.length, node.value.length);
|
|
5768
|
+
}
|
|
5769
|
+
onMounted(fit);
|
|
5770
|
+
watch(() => [
|
|
5771
|
+
model.value,
|
|
5772
|
+
props.size,
|
|
5773
|
+
props.variant,
|
|
5774
|
+
bounds.value.min
|
|
5775
|
+
], () => void nextTick(fit));
|
|
5776
|
+
return {
|
|
5777
|
+
el,
|
|
5778
|
+
area,
|
|
5779
|
+
bounds,
|
|
5780
|
+
fit,
|
|
5781
|
+
focus
|
|
5782
|
+
};
|
|
5783
|
+
}
|
|
5784
|
+
//#endregion
|
|
5719
5785
|
//#region src/components/textarea/textarea.variants.ts
|
|
5720
5786
|
var textarea = tv({
|
|
5721
|
-
base: ["
|
|
5787
|
+
base: ["text-fg flex w-full min-w-0 cursor-text flex-col overflow-hidden rounded-md border font-medium", "data-disabled:cursor-not-allowed data-disabled:opacity-50"],
|
|
5722
5788
|
variants: {
|
|
5723
5789
|
variant: {
|
|
5724
|
-
|
|
5725
|
-
|
|
5790
|
+
bare: "rounded-none border-0 bg-transparent shadow-none outline-none [--hn-textarea-border-w:0px]",
|
|
5791
|
+
primary: "hn-field border-line [--hn-field-bg:var(--hn-surface)] [--hn-field-shadow:var(--hn-shadow-sm)]",
|
|
5792
|
+
secondary: "hn-field border-transparent [--hn-field-bg:var(--hn-bg-inset)]"
|
|
5726
5793
|
},
|
|
5727
5794
|
size: {
|
|
5728
5795
|
sm: "text-sm [--hn-textarea-h:var(--hn-control-h-sm)] [--hn-textarea-px:var(--hn-control-px-sm)]",
|
|
@@ -5747,12 +5814,12 @@ var textarea = tv({
|
|
|
5747
5814
|
});
|
|
5748
5815
|
var textareaField = tv({ base: [
|
|
5749
5816
|
"block w-full resize-none overflow-hidden bg-transparent text-inherit outline-none [font:inherit]",
|
|
5750
|
-
"px-[var(--hn-textarea-px)] py-[calc((var(--hn-textarea-h)_-_1lh)/2_-
|
|
5817
|
+
"px-[var(--hn-textarea-px)] py-[calc((var(--hn-textarea-h)_-_1lh)/2_-_var(--hn-textarea-border-w,1px))]",
|
|
5751
5818
|
"placeholder:text-faint placeholder:font-normal disabled:cursor-not-allowed"
|
|
5752
5819
|
] });
|
|
5753
5820
|
//#endregion
|
|
5754
5821
|
//#region src/components/textarea/Textarea.vue?vue&type=script&setup=true&lang.ts
|
|
5755
|
-
var _hoisted_1$74 = ["data-invalid"];
|
|
5822
|
+
var _hoisted_1$74 = ["data-invalid", "data-disabled"];
|
|
5756
5823
|
var _hoisted_2$35 = [
|
|
5757
5824
|
"id",
|
|
5758
5825
|
"rows",
|
|
@@ -5787,50 +5854,15 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
5787
5854
|
});
|
|
5788
5855
|
const props = __props;
|
|
5789
5856
|
const model = useModel(__props, "modelValue");
|
|
5790
|
-
const el =
|
|
5791
|
-
const area = shallowRef();
|
|
5792
|
-
const bounds = computed(() => {
|
|
5793
|
-
const options = props.autosize === true ? {} : props.autosize || null;
|
|
5794
|
-
return {
|
|
5795
|
-
min: options?.minRows ?? props.rows,
|
|
5796
|
-
max: options?.maxRows
|
|
5797
|
-
};
|
|
5798
|
-
});
|
|
5799
|
-
function fit() {
|
|
5800
|
-
const node = el.value;
|
|
5801
|
-
if (!node) return;
|
|
5802
|
-
node.style.height = "auto";
|
|
5803
|
-
node.style.height = `${node.scrollHeight}px`;
|
|
5804
|
-
if (document.activeElement === node) reveal(node);
|
|
5805
|
-
}
|
|
5806
|
-
function reveal(node) {
|
|
5807
|
-
const scroller = area.value?.viewport ?? node.closest("[data-overlayscrollbars-initialize]");
|
|
5808
|
-
if (!scroller) return;
|
|
5809
|
-
const box = scroller.getBoundingClientRect();
|
|
5810
|
-
const top = node.getBoundingClientRect().top + caretTop(node);
|
|
5811
|
-
const bottom = top + parseFloat(getComputedStyle(node).lineHeight);
|
|
5812
|
-
if (bottom > box.bottom) scroller.scrollTop += bottom - box.bottom;
|
|
5813
|
-
else if (top < box.top) scroller.scrollTop -= box.top - top;
|
|
5814
|
-
}
|
|
5815
|
-
function focus(event) {
|
|
5816
|
-
const node = el.value;
|
|
5817
|
-
if (!node || node.disabled || event.target === node) return;
|
|
5818
|
-
node.focus();
|
|
5819
|
-
node.setSelectionRange(node.value.length, node.value.length);
|
|
5820
|
-
}
|
|
5821
|
-
onMounted(fit);
|
|
5822
|
-
watch(() => [
|
|
5823
|
-
model.value,
|
|
5824
|
-
props.size,
|
|
5825
|
-
bounds.value.min
|
|
5826
|
-
], () => void nextTick(fit));
|
|
5857
|
+
const { el, area, bounds, fit, focus } = useTextareaSizing(props, model);
|
|
5827
5858
|
return (_ctx, _cache) => {
|
|
5828
5859
|
return openBlock(), createElementBlock("div", {
|
|
5829
5860
|
"data-hn-textarea": "",
|
|
5830
5861
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
5862
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
5831
5863
|
style: normalizeStyle({
|
|
5832
|
-
"--hn-textarea-rows": bounds.
|
|
5833
|
-
"--hn-textarea-max-rows": bounds.
|
|
5864
|
+
"--hn-textarea-rows": unref(bounds).min,
|
|
5865
|
+
"--hn-textarea-max-rows": unref(bounds).max
|
|
5834
5866
|
}),
|
|
5835
5867
|
class: normalizeClass(unref(cn)(unref(textarea)({
|
|
5836
5868
|
variant: props.variant,
|
|
@@ -5838,7 +5870,7 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
5838
5870
|
autosize: Boolean(props.autosize),
|
|
5839
5871
|
resize: props.autosize ? "none" : props.resize
|
|
5840
5872
|
}), props.class)),
|
|
5841
|
-
onClick: focus
|
|
5873
|
+
onClick: _cache[2] || (_cache[2] = (...args) => unref(focus) && unref(focus)(...args))
|
|
5842
5874
|
}, [createVNode(ScrollArea_default, {
|
|
5843
5875
|
ref_key: "area",
|
|
5844
5876
|
ref: area,
|
|
@@ -5851,12 +5883,12 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
5851
5883
|
}, _ctx.$attrs, {
|
|
5852
5884
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
5853
5885
|
id: unref(fieldId),
|
|
5854
|
-
rows: bounds.
|
|
5886
|
+
rows: unref(bounds).min,
|
|
5855
5887
|
disabled: unref(disabled),
|
|
5856
5888
|
"aria-invalid": unref(invalid) || void 0,
|
|
5857
5889
|
"aria-describedby": unref(describedBy),
|
|
5858
5890
|
class: unref(textareaField)(),
|
|
5859
|
-
onInput: fit
|
|
5891
|
+
onInput: _cache[1] || (_cache[1] = (...args) => unref(fit) && unref(fit)(...args))
|
|
5860
5892
|
}), null, 16, _hoisted_2$35), [[vModelText, model.value]])]),
|
|
5861
5893
|
_: 1
|
|
5862
5894
|
}, 512)], 14, _hoisted_1$74);
|
|
@@ -5866,13 +5898,19 @@ var Textarea_default = /* @__PURE__ */ defineComponent({
|
|
|
5866
5898
|
//#endregion
|
|
5867
5899
|
//#region src/components/number-input/number-input.variants.ts
|
|
5868
5900
|
var numberInputStepper = tv({
|
|
5869
|
-
base: "
|
|
5870
|
-
variants: {
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5901
|
+
base: "flex shrink-0 flex-col",
|
|
5902
|
+
variants: {
|
|
5903
|
+
divided: { true: "border-line border-s" },
|
|
5904
|
+
size: {
|
|
5905
|
+
sm: "[&_svg]:size-3",
|
|
5906
|
+
md: "[&_svg]:size-3",
|
|
5907
|
+
lg: "[&_svg]:size-3.5"
|
|
5908
|
+
}
|
|
5909
|
+
},
|
|
5910
|
+
defaultVariants: {
|
|
5911
|
+
size: "md",
|
|
5912
|
+
divided: true
|
|
5913
|
+
}
|
|
5876
5914
|
});
|
|
5877
5915
|
var numberInputStep = tv({
|
|
5878
5916
|
base: [
|
|
@@ -5917,6 +5955,7 @@ var NumberInput_default = /* @__PURE__ */ defineComponent({
|
|
|
5917
5955
|
const emits = __emit;
|
|
5918
5956
|
const t = useUiLocale();
|
|
5919
5957
|
const group = injectInputGroup();
|
|
5958
|
+
const divided = computed(() => (group ? group.variant?.value : props.variant) !== "bare");
|
|
5920
5959
|
const size = computed(() => group ? group.size.value : props.size);
|
|
5921
5960
|
const { id: fieldId, invalid, disabled, describedBy } = useFieldControl({
|
|
5922
5961
|
invalid: () => props.invalid || !!group?.invalid.value,
|
|
@@ -5938,7 +5977,8 @@ var NumberInput_default = /* @__PURE__ */ defineComponent({
|
|
|
5938
5977
|
disabled: unref(disabled),
|
|
5939
5978
|
"data-hn-number-input": "",
|
|
5940
5979
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
5941
|
-
|
|
5980
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
5981
|
+
class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(textInputHost)({
|
|
5942
5982
|
variant: props.variant,
|
|
5943
5983
|
size: props.size
|
|
5944
5984
|
}), props.class)
|
|
@@ -5955,7 +5995,10 @@ var NumberInput_default = /* @__PURE__ */ defineComponent({
|
|
|
5955
5995
|
"class"
|
|
5956
5996
|
]), props.controls ? (openBlock(), createElementBlock("div", {
|
|
5957
5997
|
key: 0,
|
|
5958
|
-
class: normalizeClass(unref(numberInputStepper)({
|
|
5998
|
+
class: normalizeClass(unref(numberInputStepper)({
|
|
5999
|
+
size: size.value,
|
|
6000
|
+
divided: divided.value
|
|
6001
|
+
}))
|
|
5959
6002
|
}, [createVNode(unref(NumberFieldIncrement), {
|
|
5960
6003
|
"aria-label": unref(t).numberInput.increase,
|
|
5961
6004
|
class: normalizeClass(unref(numberInputStep)())
|
|
@@ -5964,7 +6007,7 @@ var NumberInput_default = /* @__PURE__ */ defineComponent({
|
|
|
5964
6007
|
_: 1
|
|
5965
6008
|
}, 8, ["aria-label", "class"]), createVNode(unref(NumberFieldDecrement), {
|
|
5966
6009
|
"aria-label": unref(t).numberInput.decrease,
|
|
5967
|
-
class: normalizeClass(unref(numberInputStep)({ divided:
|
|
6010
|
+
class: normalizeClass(unref(numberInputStep)({ divided: divided.value }))
|
|
5968
6011
|
}, {
|
|
5969
6012
|
default: withCtx(() => [createVNode(unref(ChevronDown))]),
|
|
5970
6013
|
_: 1
|
|
@@ -5974,6 +6017,7 @@ var NumberInput_default = /* @__PURE__ */ defineComponent({
|
|
|
5974
6017
|
"locale",
|
|
5975
6018
|
"disabled",
|
|
5976
6019
|
"data-invalid",
|
|
6020
|
+
"data-disabled",
|
|
5977
6021
|
"class"
|
|
5978
6022
|
]);
|
|
5979
6023
|
};
|
|
@@ -6112,15 +6156,15 @@ var SearchInput_default = /* @__PURE__ */ defineComponent({
|
|
|
6112
6156
|
});
|
|
6113
6157
|
//#endregion
|
|
6114
6158
|
//#region src/components/input-group/input-group.variants.ts
|
|
6115
|
-
var inputGroup = tv({
|
|
6116
|
-
"[
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6159
|
+
var inputGroup = tv({
|
|
6160
|
+
base: ["[&>button]:h-auto [&>button]:rounded-none [&>button]:[--hn-press-scale:1]", "[&>button:focus-visible]:-outline-offset-2"],
|
|
6161
|
+
variants: { divided: { true: "[&>*+*]:border-s [&>*+*]:border-s-line" } },
|
|
6162
|
+
defaultVariants: { divided: true }
|
|
6163
|
+
});
|
|
6120
6164
|
var inputGroupAddon = tv({ base: "text-muted flex shrink-0 items-center gap-2 px-[var(--hn-input-px)] whitespace-nowrap [&>svg]:size-[var(--hn-input-icon)]" });
|
|
6121
6165
|
//#endregion
|
|
6122
6166
|
//#region src/components/input-group/InputGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6123
|
-
var _hoisted_1$72 = ["data-invalid"];
|
|
6167
|
+
var _hoisted_1$72 = ["data-invalid", "data-disabled"];
|
|
6124
6168
|
//#endregion
|
|
6125
6169
|
//#region src/components/input-group/InputGroup.vue
|
|
6126
6170
|
var InputGroup_default = /* @__PURE__ */ defineComponent({
|
|
@@ -6135,19 +6179,22 @@ var InputGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
6135
6179
|
},
|
|
6136
6180
|
setup(__props) {
|
|
6137
6181
|
const props = __props;
|
|
6182
|
+
const { disabled } = useFieldControl({ disabled: () => props.disabled });
|
|
6138
6183
|
provideInputGroup({
|
|
6184
|
+
variant: computed(() => props.variant),
|
|
6139
6185
|
size: computed(() => props.size),
|
|
6140
|
-
disabled
|
|
6186
|
+
disabled,
|
|
6141
6187
|
invalid: computed(() => !!props.invalid)
|
|
6142
6188
|
});
|
|
6143
6189
|
return (_ctx, _cache) => {
|
|
6144
6190
|
return openBlock(), createElementBlock("div", {
|
|
6145
6191
|
"data-hn-input-group": "",
|
|
6146
6192
|
"data-invalid": props.invalid ? "" : void 0,
|
|
6147
|
-
|
|
6193
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
6194
|
+
class: normalizeClass(unref(cn)(unref(textInputHost)({
|
|
6148
6195
|
variant: props.variant,
|
|
6149
6196
|
size: props.size
|
|
6150
|
-
}), unref(inputGroup)(), props.class)),
|
|
6197
|
+
}), unref(inputGroup)({ divided: props.variant !== "bare" }), props.class)),
|
|
6151
6198
|
onClick: _cache[0] || (_cache[0] = ($event) => unref(focusFieldFrom)($event.currentTarget, $event.target))
|
|
6152
6199
|
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$72);
|
|
6153
6200
|
};
|
|
@@ -6288,6 +6335,11 @@ var selectTrigger = tv({ base: [
|
|
|
6288
6335
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
6289
6336
|
"[&_svg]:size-[var(--hn-input-icon)] [&_svg]:shrink-0"
|
|
6290
6337
|
] });
|
|
6338
|
+
var selectButton = tv({ base: [
|
|
6339
|
+
"group/hn-disclosure flex h-full min-w-0 flex-1 cursor-pointer items-center bg-transparent ps-[var(--hn-input-px)] pe-0 text-start text-inherit outline-none [font:inherit]",
|
|
6340
|
+
"data-placeholder:text-faint data-placeholder:font-normal disabled:cursor-not-allowed",
|
|
6341
|
+
"[&_svg]:size-[var(--hn-input-icon)] [&_svg]:shrink-0"
|
|
6342
|
+
] });
|
|
6291
6343
|
var selectContent = tv({ base: ["hn-anim-pop z-(--hn-z-overlay) flex w-[var(--reka-select-trigger-width)] min-w-40 flex-col overflow-hidden shadow-md outline-none", "[&[data-hn-fresh]_[data-highlighted]:not(:hover)]:[--hn-state-hover-opacity:0]"] });
|
|
6292
6344
|
var selectList = tv({ base: "max-h-[min(20rem,var(--reka-select-content-available-height))]" });
|
|
6293
6345
|
var selectItem = tv({ base: [
|
|
@@ -6299,10 +6351,16 @@ var selectItem = tv({ base: [
|
|
|
6299
6351
|
var selectLabel = tv({ base: "text-muted px-2.5 py-1.5 text-xs font-medium" });
|
|
6300
6352
|
var selectEmpty = tv({ base: "text-muted px-2.5 py-2 text-sm" });
|
|
6301
6353
|
var selectListBody = tv({ base: "flex flex-col p-1" });
|
|
6354
|
+
var selectHost = tv({ base: "relative cursor-pointer" });
|
|
6355
|
+
var selectValue = tv({
|
|
6356
|
+
base: "min-w-0 flex-1 truncate",
|
|
6357
|
+
variants: { clearing: { true: "pe-[var(--hn-input-h)]" } }
|
|
6358
|
+
});
|
|
6359
|
+
var selectClearSlot = tv({ base: [inputActionSlot(), "absolute inset-y-0 end-[var(--hn-input-h)]"] });
|
|
6302
6360
|
//#endregion
|
|
6303
6361
|
//#region src/components/select/types.ts
|
|
6304
6362
|
function isOptionGroup(item) {
|
|
6305
|
-
return "options" in item;
|
|
6363
|
+
return !("value" in item) && "options" in item;
|
|
6306
6364
|
}
|
|
6307
6365
|
function flattenOptions(items) {
|
|
6308
6366
|
return items.flatMap((item) => isOptionGroup(item) ? item.options : [item]);
|
|
@@ -6322,7 +6380,7 @@ var _hoisted_7$5 = {
|
|
|
6322
6380
|
key: 0,
|
|
6323
6381
|
class: "text-muted block truncate text-xs"
|
|
6324
6382
|
};
|
|
6325
|
-
var _hoisted_8$
|
|
6383
|
+
var _hoisted_8$1 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
6326
6384
|
//#endregion
|
|
6327
6385
|
//#region src/components/select/SelectList.vue
|
|
6328
6386
|
var SelectList_default = /* @__PURE__ */ defineComponent({
|
|
@@ -6393,7 +6451,7 @@ var SelectList_default = /* @__PURE__ */ defineComponent({
|
|
|
6393
6451
|
default: withCtx(() => [createVNode(unref(SelectItemText), { "as-child": "" }, {
|
|
6394
6452
|
default: withCtx(() => [createElementVNode("span", _hoisted_5$9, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$7, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(item.description), 1)) : createCommentVNode("", true)])])]),
|
|
6395
6453
|
_: 2
|
|
6396
|
-
}, 1024), createElementVNode("span", _hoisted_8$
|
|
6454
|
+
}, 1024), createElementVNode("span", _hoisted_8$1, [createVNode(unref(SelectItemIndicator), null, {
|
|
6397
6455
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
6398
6456
|
_: 1
|
|
6399
6457
|
})])]),
|
|
@@ -6420,8 +6478,38 @@ var SelectList_default = /* @__PURE__ */ defineComponent({
|
|
|
6420
6478
|
}
|
|
6421
6479
|
});
|
|
6422
6480
|
//#endregion
|
|
6481
|
+
//#region src/components/select/composables/useClearTransition.ts
|
|
6482
|
+
function useClearTransition(visible) {
|
|
6483
|
+
const leaving = ref(false);
|
|
6484
|
+
const reserved = computed(() => visible() || leaving.value);
|
|
6485
|
+
function beforeEnter(element) {
|
|
6486
|
+
leaving.value = false;
|
|
6487
|
+
element.removeAttribute("inert");
|
|
6488
|
+
}
|
|
6489
|
+
function beforeLeave(element) {
|
|
6490
|
+
leaving.value = true;
|
|
6491
|
+
element.setAttribute("inert", "");
|
|
6492
|
+
}
|
|
6493
|
+
function finishLeave() {
|
|
6494
|
+
leaving.value = false;
|
|
6495
|
+
}
|
|
6496
|
+
return {
|
|
6497
|
+
reserved,
|
|
6498
|
+
hooks: {
|
|
6499
|
+
beforeEnter,
|
|
6500
|
+
beforeLeave,
|
|
6501
|
+
afterLeave: finishLeave,
|
|
6502
|
+
leaveCancelled: finishLeave
|
|
6503
|
+
}
|
|
6504
|
+
};
|
|
6505
|
+
}
|
|
6506
|
+
//#endregion
|
|
6423
6507
|
//#region src/components/select/Select.vue?vue&type=script&setup=true&lang.ts
|
|
6424
|
-
var _hoisted_1$70 =
|
|
6508
|
+
var _hoisted_1$70 = [
|
|
6509
|
+
"dir",
|
|
6510
|
+
"data-invalid",
|
|
6511
|
+
"data-disabled"
|
|
6512
|
+
];
|
|
6425
6513
|
//#endregion
|
|
6426
6514
|
//#region src/components/select/Select.vue
|
|
6427
6515
|
var Select_default = /* @__PURE__ */ defineComponent({
|
|
@@ -6431,6 +6519,7 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
6431
6519
|
props: /*@__PURE__*/ mergeModels({
|
|
6432
6520
|
options: {},
|
|
6433
6521
|
placeholder: {},
|
|
6522
|
+
clearable: { type: Boolean },
|
|
6434
6523
|
name: {},
|
|
6435
6524
|
required: { type: Boolean },
|
|
6436
6525
|
autocomplete: {},
|
|
@@ -6448,19 +6537,31 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
6448
6537
|
},
|
|
6449
6538
|
"openModifiers": {}
|
|
6450
6539
|
}),
|
|
6451
|
-
emits: ["update:modelValue", "update:open"],
|
|
6452
|
-
setup(__props) {
|
|
6540
|
+
emits: /*@__PURE__*/ mergeModels(["clear"], ["update:modelValue", "update:open"]),
|
|
6541
|
+
setup(__props, { emit: __emit }) {
|
|
6453
6542
|
const props = __props;
|
|
6543
|
+
const emit = __emit;
|
|
6454
6544
|
const model = useModel(__props, "modelValue");
|
|
6455
6545
|
const open = useModel(__props, "open");
|
|
6456
6546
|
const t = useUiLocale();
|
|
6457
6547
|
const group = injectInputGroup();
|
|
6548
|
+
const direction = useDirection();
|
|
6458
6549
|
const keyboard = ref(false);
|
|
6550
|
+
const host = shallowRef(null);
|
|
6551
|
+
const trigger = shallowRef(null);
|
|
6459
6552
|
const { id: fieldId, invalid, disabled, describedBy } = useFieldControl({
|
|
6460
6553
|
invalid: () => props.invalid || !!group?.invalid.value,
|
|
6461
6554
|
disabled: () => props.disabled || !!group?.disabled.value
|
|
6462
6555
|
});
|
|
6463
6556
|
const selected = computed(() => flattenOptions(props.options).find((option) => option.value === model.value));
|
|
6557
|
+
const clearing = computed(() => !!props.clearable && model.value != null && model.value !== "" && !disabled.value);
|
|
6558
|
+
const { reserved: clearSpace, hooks: clearTransition } = useClearTransition(() => clearing.value);
|
|
6559
|
+
function clear() {
|
|
6560
|
+
if (disabled.value || model.value == null || model.value === "") return;
|
|
6561
|
+
model.value = null;
|
|
6562
|
+
emit("clear");
|
|
6563
|
+
trigger.value?.$el.focus();
|
|
6564
|
+
}
|
|
6464
6565
|
return (_ctx, _cache) => {
|
|
6465
6566
|
return openBlock(), createBlock(unref(SelectRoot), {
|
|
6466
6567
|
modelValue: model.value,
|
|
@@ -6472,28 +6573,57 @@ var Select_default = /* @__PURE__ */ defineComponent({
|
|
|
6472
6573
|
required: props.required,
|
|
6473
6574
|
autocomplete: props.autocomplete
|
|
6474
6575
|
}, {
|
|
6475
|
-
default: withCtx(() => [
|
|
6476
|
-
|
|
6477
|
-
|
|
6576
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
6577
|
+
ref_key: "host",
|
|
6578
|
+
ref: host,
|
|
6579
|
+
dir: unref(direction),
|
|
6478
6580
|
"data-hn-select": "",
|
|
6479
|
-
onKeydown: _cache[0] || (_cache[0] = ($event) => keyboard.value = true),
|
|
6480
|
-
onPointerdown: _cache[1] || (_cache[1] = ($event) => keyboard.value = false),
|
|
6481
6581
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
6482
|
-
"
|
|
6483
|
-
class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
6582
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
6583
|
+
class: normalizeClass(unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
6484
6584
|
variant: props.variant,
|
|
6485
6585
|
size: props.size
|
|
6486
|
-
}), unref(
|
|
6586
|
+
}), unref(selectHost)(), props.class))
|
|
6587
|
+
}, [createVNode(unref(SelectTrigger), mergeProps({
|
|
6588
|
+
ref_key: "trigger",
|
|
6589
|
+
ref: trigger
|
|
6590
|
+
}, _ctx.$attrs, {
|
|
6591
|
+
reference: host.value ?? void 0,
|
|
6592
|
+
id: unref(fieldId),
|
|
6593
|
+
"aria-describedby": unref(describedBy),
|
|
6594
|
+
"aria-invalid": unref(invalid) || void 0,
|
|
6595
|
+
"data-hn-select-trigger": "",
|
|
6596
|
+
onKeydown: _cache[0] || (_cache[0] = ($event) => keyboard.value = true),
|
|
6597
|
+
onPointerdown: _cache[1] || (_cache[1] = ($event) => keyboard.value = false),
|
|
6598
|
+
class: unref(selectButton)()
|
|
6487
6599
|
}), {
|
|
6488
|
-
default: withCtx(() => [createElementVNode("span",
|
|
6600
|
+
default: withCtx(() => [createElementVNode("span", { class: normalizeClass(unref(selectValue)({ clearing: unref(clearSpace) })) }, [selected.value ? renderSlot(_ctx.$slots, "value", { option: selected.value }, () => [createTextVNode(toDisplayString(selected.value.label), 1)], void 0, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(props.placeholder ?? unref(t).select.placeholder), 1)], 64))], 2), createElementVNode("span", { class: normalizeClass(unref(inputAdornment)()) }, [createVNode(DisclosureIcon_default)], 2)]),
|
|
6489
6601
|
_: 3
|
|
6490
6602
|
}, 16, [
|
|
6603
|
+
"reference",
|
|
6491
6604
|
"id",
|
|
6492
6605
|
"aria-describedby",
|
|
6493
|
-
"data-invalid",
|
|
6494
6606
|
"aria-invalid",
|
|
6495
6607
|
"class"
|
|
6496
|
-
]), createVNode(
|
|
6608
|
+
]), createVNode(Transition, mergeProps({
|
|
6609
|
+
"enter-active-class": "hn-transition-base",
|
|
6610
|
+
"enter-from-class": "scale-90 opacity-0",
|
|
6611
|
+
"leave-active-class": "hn-transition",
|
|
6612
|
+
"leave-to-class": "scale-90 opacity-0"
|
|
6613
|
+
}, toHandlers(unref(clearTransition))), {
|
|
6614
|
+
default: withCtx(() => [clearing.value ? (openBlock(), createElementBlock("span", {
|
|
6615
|
+
key: 0,
|
|
6616
|
+
class: normalizeClass(unref(selectClearSlot)())
|
|
6617
|
+
}, [createVNode(InputAction_default, {
|
|
6618
|
+
"data-hn-select-clear": "",
|
|
6619
|
+
label: unref(t).common.clear,
|
|
6620
|
+
onClick: clear
|
|
6621
|
+
}, {
|
|
6622
|
+
default: withCtx(() => [createVNode(unref(X))]),
|
|
6623
|
+
_: 1
|
|
6624
|
+
}, 8, ["label"])], 2)) : createCommentVNode("", true)]),
|
|
6625
|
+
_: 1
|
|
6626
|
+
}, 16)], 10, _hoisted_1$70), createVNode(SelectList_default, {
|
|
6497
6627
|
options: props.options,
|
|
6498
6628
|
keyboard: keyboard.value
|
|
6499
6629
|
}, {
|
|
@@ -6618,6 +6748,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
6618
6748
|
tabindex: unref(disabled) ? -1 : 0,
|
|
6619
6749
|
"aria-disabled": unref(disabled) || void 0,
|
|
6620
6750
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
6751
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
6621
6752
|
"aria-invalid": unref(invalid) || void 0,
|
|
6622
6753
|
class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
6623
6754
|
variant: props.variant,
|
|
@@ -6681,6 +6812,7 @@ var MultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
6681
6812
|
"tabindex",
|
|
6682
6813
|
"aria-disabled",
|
|
6683
6814
|
"data-invalid",
|
|
6815
|
+
"data-disabled",
|
|
6684
6816
|
"aria-invalid",
|
|
6685
6817
|
"class"
|
|
6686
6818
|
]),
|
|
@@ -6743,7 +6875,7 @@ var _hoisted_7$4 = {
|
|
|
6743
6875
|
key: 0,
|
|
6744
6876
|
class: "text-muted block truncate text-xs"
|
|
6745
6877
|
};
|
|
6746
|
-
var _hoisted_8
|
|
6878
|
+
var _hoisted_8 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
6747
6879
|
//#endregion
|
|
6748
6880
|
//#region src/components/combobox/ComboboxList.vue
|
|
6749
6881
|
var ComboboxList_default = /* @__PURE__ */ defineComponent({
|
|
@@ -6808,7 +6940,7 @@ var ComboboxList_default = /* @__PURE__ */ defineComponent({
|
|
|
6808
6940
|
disabled: item.disabled,
|
|
6809
6941
|
class: normalizeClass(unref(selectItem)())
|
|
6810
6942
|
}, {
|
|
6811
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_5$8, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$6, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString(item.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_8
|
|
6943
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_5$8, [renderSlot(_ctx.$slots, "option", { option: item }, () => [createElementVNode("span", _hoisted_6$6, toDisplayString(item.label), 1), item.description ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString(item.description), 1)) : createCommentVNode("", true)])]), createElementVNode("span", _hoisted_8, [createVNode(unref(ComboboxItemIndicator), null, {
|
|
6812
6944
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
6813
6945
|
_: 1
|
|
6814
6946
|
})])]),
|
|
@@ -6836,7 +6968,7 @@ var ComboboxList_default = /* @__PURE__ */ defineComponent({
|
|
|
6836
6968
|
});
|
|
6837
6969
|
//#endregion
|
|
6838
6970
|
//#region src/components/combobox/Combobox.vue?vue&type=script&setup=true&lang.ts
|
|
6839
|
-
var _hoisted_1$67 = ["data-invalid"];
|
|
6971
|
+
var _hoisted_1$67 = ["data-invalid", "data-disabled"];
|
|
6840
6972
|
//#endregion
|
|
6841
6973
|
//#region src/components/combobox/Combobox.vue
|
|
6842
6974
|
var Combobox_default = /* @__PURE__ */ defineComponent({
|
|
@@ -6914,6 +7046,7 @@ var Combobox_default = /* @__PURE__ */ defineComponent({
|
|
|
6914
7046
|
default: withCtx(() => [createElementVNode("div", {
|
|
6915
7047
|
"data-hn-combobox": "",
|
|
6916
7048
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
7049
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
6917
7050
|
class: normalizeClass(unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
6918
7051
|
variant: props.variant,
|
|
6919
7052
|
size: props.size
|
|
@@ -7420,32 +7553,61 @@ var CommandPalette_default = /* @__PURE__ */ defineComponent({
|
|
|
7420
7553
|
}
|
|
7421
7554
|
});
|
|
7422
7555
|
//#endregion
|
|
7556
|
+
//#region src/components/listbox/ListboxOptionContent.vue?vue&type=script&setup=true&lang.ts
|
|
7557
|
+
var _hoisted_1$65 = { class: "min-w-0 flex-1" };
|
|
7558
|
+
var _hoisted_2$30 = { class: "block truncate" };
|
|
7559
|
+
var _hoisted_3$14 = {
|
|
7560
|
+
key: 0,
|
|
7561
|
+
class: "text-muted block truncate text-xs"
|
|
7562
|
+
};
|
|
7563
|
+
var _hoisted_4$9 = {
|
|
7564
|
+
key: 1,
|
|
7565
|
+
class: "flex size-4 shrink-0 items-center justify-center"
|
|
7566
|
+
};
|
|
7567
|
+
//#endregion
|
|
7568
|
+
//#region src/components/listbox/ListboxOptionContent.vue
|
|
7569
|
+
var ListboxOptionContent_default = /* @__PURE__ */ defineComponent({
|
|
7570
|
+
name: "HnListboxOptionContent",
|
|
7571
|
+
inheritAttrs: false,
|
|
7572
|
+
__name: "ListboxOptionContent",
|
|
7573
|
+
props: { option: {} },
|
|
7574
|
+
setup(__props) {
|
|
7575
|
+
const props = __props;
|
|
7576
|
+
const slots = useSlots();
|
|
7577
|
+
const { isSelected: selected } = injectListboxItemContext();
|
|
7578
|
+
return (_ctx, _cache) => {
|
|
7579
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("span", _hoisted_1$65, [renderSlot(_ctx.$slots, "option", {
|
|
7580
|
+
option: props.option,
|
|
7581
|
+
selected: unref(selected)
|
|
7582
|
+
}, () => [createElementVNode("span", _hoisted_2$30, toDisplayString(props.option.label), 1), props.option.description ? (openBlock(), createElementBlock("span", _hoisted_3$14, toDisplayString(props.option.description), 1)) : createCommentVNode("", true)])]), slots.trailing ? renderSlot(_ctx.$slots, "trailing", {
|
|
7583
|
+
option: props.option,
|
|
7584
|
+
selected: unref(selected)
|
|
7585
|
+
}, void 0, void 0, 0) : (openBlock(), createElementBlock("span", _hoisted_4$9, [createVNode(unref(ListboxItemIndicator), null, {
|
|
7586
|
+
default: withCtx(() => [createVNode(unref(Check))]),
|
|
7587
|
+
_: 1
|
|
7588
|
+
})]))], 64);
|
|
7589
|
+
};
|
|
7590
|
+
}
|
|
7591
|
+
});
|
|
7592
|
+
//#endregion
|
|
7423
7593
|
//#region src/components/listbox/listbox.variants.ts
|
|
7424
7594
|
var listbox = tv({
|
|
7425
7595
|
base: ["flex w-full min-w-0 flex-col overflow-hidden rounded-md data-disabled:opacity-50", "[&:not(:focus-within)_[data-highlighted]:not(:hover)]:[--hn-state-hover-opacity:0]"],
|
|
7426
7596
|
variants: { variant: {
|
|
7427
7597
|
primary: "border-line bg-surface border shadow-sm",
|
|
7428
|
-
secondary: "bg-inset"
|
|
7598
|
+
secondary: "bg-inset",
|
|
7599
|
+
bare: "rounded-none border-0 bg-transparent shadow-none"
|
|
7429
7600
|
} },
|
|
7430
7601
|
defaultVariants: { variant: "primary" }
|
|
7431
7602
|
});
|
|
7432
|
-
var listboxContent = tv({
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
};
|
|
7441
|
-
var _hoisted_4$9 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
7442
|
-
var _hoisted_5$6 = { class: "min-w-0 flex-1" };
|
|
7443
|
-
var _hoisted_6$5 = { class: "block truncate" };
|
|
7444
|
-
var _hoisted_7$3 = {
|
|
7445
|
-
key: 0,
|
|
7446
|
-
class: "text-muted block truncate text-xs"
|
|
7447
|
-
};
|
|
7448
|
-
var _hoisted_8 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
7603
|
+
var listboxContent = tv({
|
|
7604
|
+
base: "flex flex-col outline-none",
|
|
7605
|
+
variants: { padded: {
|
|
7606
|
+
true: "p-1",
|
|
7607
|
+
false: "p-0"
|
|
7608
|
+
} },
|
|
7609
|
+
defaultVariants: { padded: true }
|
|
7610
|
+
});
|
|
7449
7611
|
//#endregion
|
|
7450
7612
|
//#region src/components/listbox/Listbox.vue
|
|
7451
7613
|
var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
@@ -7456,6 +7618,10 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7456
7618
|
options: {},
|
|
7457
7619
|
multiple: { type: Boolean },
|
|
7458
7620
|
maxHeight: { default: "20rem" },
|
|
7621
|
+
padded: {
|
|
7622
|
+
type: Boolean,
|
|
7623
|
+
default: true
|
|
7624
|
+
},
|
|
7459
7625
|
variant: {},
|
|
7460
7626
|
disabled: { type: Boolean },
|
|
7461
7627
|
class: {}
|
|
@@ -7467,6 +7633,7 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7467
7633
|
setup(__props) {
|
|
7468
7634
|
const props = __props;
|
|
7469
7635
|
const model = useModel(__props, "modelValue");
|
|
7636
|
+
const slots = useSlots();
|
|
7470
7637
|
const t = useUiLocale();
|
|
7471
7638
|
const { labelledBy, invalid, disabled, describedBy } = useFieldControl({ disabled: () => props.disabled });
|
|
7472
7639
|
return (_ctx, _cache) => {
|
|
@@ -7484,7 +7651,7 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7484
7651
|
class: normalizeClass(unref(cn)(unref(listbox)({ variant: props.variant }), props.class))
|
|
7485
7652
|
}, {
|
|
7486
7653
|
default: withCtx(() => [createVNode(ScrollArea_default, { style: normalizeStyle({ maxHeight: props.maxHeight }) }, {
|
|
7487
|
-
default: withCtx(() => [createVNode(unref(ListboxContent), mergeProps(_ctx.$attrs, { class: unref(listboxContent)() }), {
|
|
7654
|
+
default: withCtx(() => [createVNode(unref(ListboxContent), mergeProps(_ctx.$attrs, { class: unref(listboxContent)({ padded: props.padded }) }), {
|
|
7488
7655
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (item) => {
|
|
7489
7656
|
return openBlock(), createElementBlock(Fragment, { key: unref(isOptionGroup)(item) ? item.label : item.value }, [unref(isOptionGroup)(item) ? (openBlock(), createBlock(unref(ListboxGroup), { key: 0 }, {
|
|
7490
7657
|
default: withCtx(() => [createVNode(unref(ListboxGroupLabel), { class: normalizeClass(unref(selectLabel)()) }, {
|
|
@@ -7497,10 +7664,15 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7497
7664
|
disabled: option.disabled,
|
|
7498
7665
|
class: normalizeClass(unref(selectItem)())
|
|
7499
7666
|
}, {
|
|
7500
|
-
default: withCtx(() => [
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7667
|
+
default: withCtx(() => [createVNode(ListboxOptionContent_default, { option }, createSlots({ _: 2 }, [slots.option ? {
|
|
7668
|
+
name: "option",
|
|
7669
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, slotProps))]),
|
|
7670
|
+
key: "0"
|
|
7671
|
+
} : void 0, slots.trailing ? {
|
|
7672
|
+
name: "trailing",
|
|
7673
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "trailing", mergeProps({ ref_for: true }, slotProps))]),
|
|
7674
|
+
key: "1"
|
|
7675
|
+
} : void 0]), 1032, ["option"])]),
|
|
7504
7676
|
_: 2
|
|
7505
7677
|
}, 1032, [
|
|
7506
7678
|
"value",
|
|
@@ -7515,10 +7687,15 @@ var Listbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7515
7687
|
disabled: item.disabled,
|
|
7516
7688
|
class: normalizeClass(unref(selectItem)())
|
|
7517
7689
|
}, {
|
|
7518
|
-
default: withCtx(() => [
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7690
|
+
default: withCtx(() => [createVNode(ListboxOptionContent_default, { option: item }, createSlots({ _: 2 }, [slots.option ? {
|
|
7691
|
+
name: "option",
|
|
7692
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, slotProps))]),
|
|
7693
|
+
key: "0"
|
|
7694
|
+
} : void 0, slots.trailing ? {
|
|
7695
|
+
name: "trailing",
|
|
7696
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "trailing", mergeProps({ ref_for: true }, slotProps))]),
|
|
7697
|
+
key: "1"
|
|
7698
|
+
} : void 0]), 1032, ["option"])]),
|
|
7522
7699
|
_: 2
|
|
7523
7700
|
}, 1032, [
|
|
7524
7701
|
"value",
|
|
@@ -7587,12 +7764,12 @@ var _hoisted_3$13 = {
|
|
|
7587
7764
|
class: "size-5 shrink-0"
|
|
7588
7765
|
};
|
|
7589
7766
|
var _hoisted_4$8 = { class: "min-w-0 flex-1" };
|
|
7590
|
-
var _hoisted_5$
|
|
7591
|
-
var _hoisted_6$
|
|
7767
|
+
var _hoisted_5$6 = { class: "block truncate" };
|
|
7768
|
+
var _hoisted_6$5 = {
|
|
7592
7769
|
key: 0,
|
|
7593
7770
|
class: "text-muted block truncate text-xs"
|
|
7594
7771
|
};
|
|
7595
|
-
var _hoisted_7$
|
|
7772
|
+
var _hoisted_7$3 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
7596
7773
|
//#endregion
|
|
7597
7774
|
//#region src/components/tree-select/TreeSelect.vue
|
|
7598
7775
|
var TreeSelect_default = /* @__PURE__ */ defineComponent({
|
|
@@ -7661,6 +7838,7 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
7661
7838
|
disabled: unref(disabled),
|
|
7662
7839
|
"data-placeholder": selected.value ? void 0 : "",
|
|
7663
7840
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
7841
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
7664
7842
|
"aria-invalid": unref(invalid) || void 0,
|
|
7665
7843
|
class: unref(cn)(unref(group) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
7666
7844
|
variant: props.variant,
|
|
@@ -7676,6 +7854,7 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
7676
7854
|
"disabled",
|
|
7677
7855
|
"data-placeholder",
|
|
7678
7856
|
"data-invalid",
|
|
7857
|
+
"data-disabled",
|
|
7679
7858
|
"aria-invalid",
|
|
7680
7859
|
"class"
|
|
7681
7860
|
]), createVNode(unref(PopoverPortal), null, {
|
|
@@ -7718,8 +7897,8 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
7718
7897
|
direction: "end",
|
|
7719
7898
|
open: isExpanded
|
|
7720
7899
|
}, null, 8, ["open"])], 10, _hoisted_2$29)) : (openBlock(), createElementBlock("span", _hoisted_3$13)),
|
|
7721
|
-
createElementVNode("span", _hoisted_4$8, [renderSlot(_ctx.$slots, "node", { node: item.value }, () => [createElementVNode("span", _hoisted_5$
|
|
7722
|
-
createElementVNode("span", _hoisted_7$
|
|
7900
|
+
createElementVNode("span", _hoisted_4$8, [renderSlot(_ctx.$slots, "node", { node: item.value }, () => [createElementVNode("span", _hoisted_5$6, toDisplayString(item.value.label), 1), item.value.description ? (openBlock(), createElementBlock("span", _hoisted_6$5, toDisplayString(item.value.description), 1)) : createCommentVNode("", true)])]),
|
|
7901
|
+
createElementVNode("span", _hoisted_7$3, [isSelected ? (openBlock(), createBlock(unref(Check), { key: 0 })) : createCommentVNode("", true)])
|
|
7723
7902
|
]),
|
|
7724
7903
|
_: 2
|
|
7725
7904
|
}, 1040, [
|
|
@@ -7756,13 +7935,33 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
7756
7935
|
//#endregion
|
|
7757
7936
|
//#region src/components/checkbox/checkbox.variants.ts
|
|
7758
7937
|
var checkbox = tv({
|
|
7759
|
-
base: ["text-fg grid w-fit max-w-full cursor-pointer
|
|
7760
|
-
variants: {
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7938
|
+
base: ["text-fg grid w-fit max-w-full cursor-pointer items-center gap-x-[var(--hn-field-gap)] select-none", "data-disabled:cursor-not-allowed data-disabled:opacity-50"],
|
|
7939
|
+
variants: {
|
|
7940
|
+
controlPlacement: {
|
|
7941
|
+
start: "grid-cols-[auto_minmax(0,1fr)]",
|
|
7942
|
+
end: "grid-cols-[minmax(0,1fr)_auto]"
|
|
7943
|
+
},
|
|
7944
|
+
block: { true: "w-full" },
|
|
7945
|
+
bare: { true: "gap-x-0" },
|
|
7946
|
+
size: {
|
|
7947
|
+
sm: "text-sm",
|
|
7948
|
+
md: "text-base",
|
|
7949
|
+
lg: "text-md"
|
|
7950
|
+
}
|
|
7951
|
+
},
|
|
7952
|
+
defaultVariants: {
|
|
7953
|
+
size: "md",
|
|
7954
|
+
controlPlacement: "start",
|
|
7955
|
+
block: false
|
|
7956
|
+
}
|
|
7957
|
+
});
|
|
7958
|
+
var checkboxControl = tv({
|
|
7959
|
+
base: "row-start-1",
|
|
7960
|
+
variants: { controlPlacement: {
|
|
7961
|
+
start: "col-start-1 justify-self-start",
|
|
7962
|
+
end: "col-start-2 justify-self-end"
|
|
7764
7963
|
} },
|
|
7765
|
-
defaultVariants: {
|
|
7964
|
+
defaultVariants: { controlPlacement: "start" }
|
|
7766
7965
|
});
|
|
7767
7966
|
var checkboxBox = tv({
|
|
7768
7967
|
base: [
|
|
@@ -7791,16 +7990,32 @@ var checkboxBox = tv({
|
|
|
7791
7990
|
size: "md"
|
|
7792
7991
|
}
|
|
7793
7992
|
});
|
|
7794
|
-
var checkboxTitle = tv({
|
|
7993
|
+
var checkboxTitle = tv({
|
|
7994
|
+
base: "row-start-1 flex min-h-[1lh] min-w-0 items-center",
|
|
7995
|
+
variants: { controlPlacement: {
|
|
7996
|
+
start: "col-start-2",
|
|
7997
|
+
end: "col-start-1"
|
|
7998
|
+
} },
|
|
7999
|
+
defaultVariants: { controlPlacement: "start" }
|
|
8000
|
+
});
|
|
7795
8001
|
var checkboxTitleText = tv({ base: "block [text-box:trim-both_cap_alphabetic]" });
|
|
7796
8002
|
var checkboxDescription = tv({
|
|
7797
|
-
base: "text-muted
|
|
7798
|
-
variants: {
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
8003
|
+
base: "text-muted row-start-2 block",
|
|
8004
|
+
variants: {
|
|
8005
|
+
controlPlacement: {
|
|
8006
|
+
start: "col-start-2",
|
|
8007
|
+
end: "col-start-1"
|
|
8008
|
+
},
|
|
8009
|
+
size: {
|
|
8010
|
+
sm: "text-xs",
|
|
8011
|
+
md: "text-sm",
|
|
8012
|
+
lg: "text-base"
|
|
8013
|
+
}
|
|
8014
|
+
},
|
|
8015
|
+
defaultVariants: {
|
|
8016
|
+
size: "md",
|
|
8017
|
+
controlPlacement: "start"
|
|
8018
|
+
}
|
|
7804
8019
|
});
|
|
7805
8020
|
//#endregion
|
|
7806
8021
|
//#region src/components/checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -7814,6 +8029,8 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7814
8029
|
props: /*@__PURE__*/ mergeModels({
|
|
7815
8030
|
size: {},
|
|
7816
8031
|
description: {},
|
|
8032
|
+
controlPlacement: {},
|
|
8033
|
+
block: { type: Boolean },
|
|
7817
8034
|
disabled: { type: Boolean },
|
|
7818
8035
|
invalid: { type: Boolean },
|
|
7819
8036
|
class: {}
|
|
@@ -7838,7 +8055,12 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7838
8055
|
"data-hn-checkbox": "",
|
|
7839
8056
|
"data-hn-state-group": "",
|
|
7840
8057
|
"data-disabled": unref(disabled) ? "" : void 0,
|
|
7841
|
-
class: normalizeClass(unref(cn)(unref(checkbox)({
|
|
8058
|
+
class: normalizeClass(unref(cn)(unref(checkbox)({
|
|
8059
|
+
size: props.size,
|
|
8060
|
+
controlPlacement: props.controlPlacement,
|
|
8061
|
+
block: props.block,
|
|
8062
|
+
bare: !unref(slots).default && !props.description
|
|
8063
|
+
}), props.class))
|
|
7842
8064
|
}, [
|
|
7843
8065
|
createVNode(unref(CheckboxRoot), mergeProps(_ctx.$attrs, {
|
|
7844
8066
|
modelValue: model.value,
|
|
@@ -7848,7 +8070,7 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7848
8070
|
"aria-invalid": unref(invalid) || void 0,
|
|
7849
8071
|
"aria-describedby": unref(describedBy),
|
|
7850
8072
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
7851
|
-
class: unref(checkboxBox)({ size: props.size })
|
|
8073
|
+
class: unref(cn)(unref(checkboxBox)({ size: props.size }), unref(checkboxControl)({ controlPlacement: props.controlPlacement }))
|
|
7852
8074
|
}), {
|
|
7853
8075
|
default: withCtx(({ state }) => [createVNode(Transition, {
|
|
7854
8076
|
"enter-active-class": "hn-transition-press",
|
|
@@ -7885,11 +8107,14 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7885
8107
|
]),
|
|
7886
8108
|
unref(slots).default ? (openBlock(), createElementBlock("span", {
|
|
7887
8109
|
key: 0,
|
|
7888
|
-
class: normalizeClass(unref(checkboxTitle)())
|
|
8110
|
+
class: normalizeClass(unref(checkboxTitle)({ controlPlacement: props.controlPlacement }))
|
|
7889
8111
|
}, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "default")], 2)], 2)) : createCommentVNode("", true),
|
|
7890
8112
|
props.description ? (openBlock(), createElementBlock("span", {
|
|
7891
8113
|
key: 1,
|
|
7892
|
-
class: normalizeClass(unref(checkboxDescription)({
|
|
8114
|
+
class: normalizeClass(unref(checkboxDescription)({
|
|
8115
|
+
size: props.size,
|
|
8116
|
+
controlPlacement: props.controlPlacement
|
|
8117
|
+
}))
|
|
7893
8118
|
}, toDisplayString(props.description), 3)) : createCommentVNode("", true)
|
|
7894
8119
|
], 10, _hoisted_1$63);
|
|
7895
8120
|
};
|
|
@@ -7899,12 +8124,29 @@ var Checkbox_default = /* @__PURE__ */ defineComponent({
|
|
|
7899
8124
|
//#region src/components/checkbox-group/checkbox-group.variants.ts
|
|
7900
8125
|
var checkboxGroup = tv({
|
|
7901
8126
|
base: "flex min-w-0",
|
|
7902
|
-
variants: {
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
8127
|
+
variants: {
|
|
8128
|
+
block: { true: "w-full" },
|
|
8129
|
+
orientation: {
|
|
8130
|
+
vertical: "flex-col gap-2",
|
|
8131
|
+
horizontal: "flex-row flex-wrap gap-x-[var(--hn-inline-gap)] gap-y-2"
|
|
8132
|
+
}
|
|
8133
|
+
},
|
|
7906
8134
|
defaultVariants: { orientation: "vertical" }
|
|
7907
8135
|
});
|
|
8136
|
+
var checkboxGroupItem = tv({
|
|
8137
|
+
variants: {
|
|
8138
|
+
orientation: {
|
|
8139
|
+
vertical: "",
|
|
8140
|
+
horizontal: ""
|
|
8141
|
+
},
|
|
8142
|
+
block: { true: "" }
|
|
8143
|
+
},
|
|
8144
|
+
compoundVariants: [{
|
|
8145
|
+
orientation: "horizontal",
|
|
8146
|
+
block: true,
|
|
8147
|
+
class: "flex-1"
|
|
8148
|
+
}]
|
|
8149
|
+
});
|
|
7908
8150
|
//#endregion
|
|
7909
8151
|
//#region src/components/checkbox-group/CheckboxGroup.vue
|
|
7910
8152
|
var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
@@ -7914,6 +8156,8 @@ var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
7914
8156
|
options: {},
|
|
7915
8157
|
orientation: {},
|
|
7916
8158
|
size: {},
|
|
8159
|
+
controlPlacement: {},
|
|
8160
|
+
block: { type: Boolean },
|
|
7917
8161
|
disabled: { type: Boolean },
|
|
7918
8162
|
invalid: { type: Boolean },
|
|
7919
8163
|
class: {}
|
|
@@ -7943,13 +8187,22 @@ var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
7943
8187
|
"data-hn-checkbox-group": "",
|
|
7944
8188
|
"data-orientation": props.orientation ?? "vertical",
|
|
7945
8189
|
"data-disabled": unref(disabled) ? "" : void 0,
|
|
7946
|
-
class: normalizeClass(unref(cn)(unref(checkboxGroup)({
|
|
8190
|
+
class: normalizeClass(unref(cn)(unref(checkboxGroup)({
|
|
8191
|
+
orientation: props.orientation,
|
|
8192
|
+
block: props.block
|
|
8193
|
+
}), props.class))
|
|
7947
8194
|
}, {
|
|
7948
8195
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (option) => {
|
|
7949
8196
|
return openBlock(), createBlock(Checkbox_default, {
|
|
7950
8197
|
key: option.value,
|
|
7951
8198
|
value: option.value,
|
|
7952
8199
|
size: props.size,
|
|
8200
|
+
"control-placement": props.controlPlacement,
|
|
8201
|
+
block: props.block,
|
|
8202
|
+
class: normalizeClass(unref(checkboxGroupItem)({
|
|
8203
|
+
orientation: props.orientation,
|
|
8204
|
+
block: props.block
|
|
8205
|
+
})),
|
|
7953
8206
|
disabled: unref(disabled) || option.disabled,
|
|
7954
8207
|
invalid: unref(invalid),
|
|
7955
8208
|
description: option.description
|
|
@@ -7959,6 +8212,9 @@ var CheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
7959
8212
|
}, 1032, [
|
|
7960
8213
|
"value",
|
|
7961
8214
|
"size",
|
|
8215
|
+
"control-placement",
|
|
8216
|
+
"block",
|
|
8217
|
+
"class",
|
|
7962
8218
|
"disabled",
|
|
7963
8219
|
"invalid",
|
|
7964
8220
|
"description"
|
|
@@ -7993,6 +8249,8 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
7993
8249
|
options: {},
|
|
7994
8250
|
orientation: {},
|
|
7995
8251
|
size: {},
|
|
8252
|
+
controlPlacement: {},
|
|
8253
|
+
block: { type: Boolean },
|
|
7996
8254
|
disabled: { type: Boolean },
|
|
7997
8255
|
invalid: { type: Boolean },
|
|
7998
8256
|
class: {}
|
|
@@ -8017,7 +8275,10 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
8017
8275
|
"aria-describedby": unref(describedBy),
|
|
8018
8276
|
"aria-invalid": unref(invalid) || void 0,
|
|
8019
8277
|
"data-hn-radio-group": "",
|
|
8020
|
-
class: normalizeClass(unref(cn)(unref(checkboxGroup)({
|
|
8278
|
+
class: normalizeClass(unref(cn)(unref(checkboxGroup)({
|
|
8279
|
+
orientation: props.orientation,
|
|
8280
|
+
block: props.block
|
|
8281
|
+
}), props.class))
|
|
8021
8282
|
}, {
|
|
8022
8283
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.options, (option) => {
|
|
8023
8284
|
return openBlock(), createElementBlock("label", {
|
|
@@ -8025,17 +8286,24 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
8025
8286
|
"data-hn-radio": "",
|
|
8026
8287
|
"data-hn-state-group": "",
|
|
8027
8288
|
"data-disabled": unref(disabled) || option.disabled ? "" : void 0,
|
|
8028
|
-
class: normalizeClass(unref(checkbox)({
|
|
8289
|
+
class: normalizeClass(unref(cn)(unref(checkbox)({
|
|
8290
|
+
size: props.size,
|
|
8291
|
+
controlPlacement: props.controlPlacement,
|
|
8292
|
+
block: props.block
|
|
8293
|
+
}), unref(checkboxGroupItem)({
|
|
8294
|
+
orientation: props.orientation,
|
|
8295
|
+
block: props.block
|
|
8296
|
+
})))
|
|
8029
8297
|
}, [
|
|
8030
8298
|
createVNode(unref(RadioGroupItem), {
|
|
8031
8299
|
value: option.value,
|
|
8032
8300
|
disabled: option.disabled,
|
|
8033
8301
|
"aria-invalid": unref(invalid) || void 0,
|
|
8034
8302
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
8035
|
-
class: normalizeClass(unref(checkboxBox)({
|
|
8303
|
+
class: normalizeClass(unref(cn)(unref(checkboxBox)({
|
|
8036
8304
|
shape: "round",
|
|
8037
8305
|
size: props.size
|
|
8038
|
-
}))
|
|
8306
|
+
}), unref(checkboxControl)({ controlPlacement: props.controlPlacement })))
|
|
8039
8307
|
}, {
|
|
8040
8308
|
default: withCtx(({ checked }) => [createVNode(Transition, {
|
|
8041
8309
|
"enter-active-class": "hn-transition-press",
|
|
@@ -8057,10 +8325,13 @@ var RadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
8057
8325
|
"data-invalid",
|
|
8058
8326
|
"class"
|
|
8059
8327
|
]),
|
|
8060
|
-
createElementVNode("span", { class: normalizeClass(unref(checkboxTitle)()) }, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.label), 1)])], 2)], 2),
|
|
8328
|
+
createElementVNode("span", { class: normalizeClass(unref(checkboxTitle)({ controlPlacement: props.controlPlacement })) }, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "option", { option }, () => [createTextVNode(toDisplayString(option.label), 1)])], 2)], 2),
|
|
8061
8329
|
option.description ? (openBlock(), createElementBlock("span", {
|
|
8062
8330
|
key: 0,
|
|
8063
|
-
class: normalizeClass(unref(checkboxDescription)({
|
|
8331
|
+
class: normalizeClass(unref(checkboxDescription)({
|
|
8332
|
+
size: props.size,
|
|
8333
|
+
controlPlacement: props.controlPlacement
|
|
8334
|
+
}))
|
|
8064
8335
|
}, toDisplayString(option.description), 3)) : createCommentVNode("", true)
|
|
8065
8336
|
], 10, _hoisted_1$62);
|
|
8066
8337
|
}), 128))]),
|
|
@@ -8113,6 +8384,8 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
8113
8384
|
props: /*@__PURE__*/ mergeModels({
|
|
8114
8385
|
size: {},
|
|
8115
8386
|
description: {},
|
|
8387
|
+
controlPlacement: {},
|
|
8388
|
+
block: { type: Boolean },
|
|
8116
8389
|
disabled: { type: Boolean },
|
|
8117
8390
|
invalid: { type: Boolean },
|
|
8118
8391
|
class: {}
|
|
@@ -8137,7 +8410,12 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
8137
8410
|
"data-hn-switch": "",
|
|
8138
8411
|
"data-hn-state-group": "",
|
|
8139
8412
|
"data-disabled": unref(disabled) ? "" : void 0,
|
|
8140
|
-
class: normalizeClass(unref(cn)(unref(checkbox)({
|
|
8413
|
+
class: normalizeClass(unref(cn)(unref(checkbox)({
|
|
8414
|
+
size: props.size,
|
|
8415
|
+
controlPlacement: props.controlPlacement,
|
|
8416
|
+
block: props.block,
|
|
8417
|
+
bare: !unref(slots).default && !props.description
|
|
8418
|
+
}), props.class))
|
|
8141
8419
|
}, [
|
|
8142
8420
|
createVNode(unref(SwitchRoot), mergeProps(_ctx.$attrs, {
|
|
8143
8421
|
modelValue: model.value,
|
|
@@ -8148,7 +8426,7 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
8148
8426
|
"aria-describedby": unref(describedBy),
|
|
8149
8427
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
8150
8428
|
"data-hn-on": model.value ? "" : void 0,
|
|
8151
|
-
class: unref(switchTrack)({ size: props.size })
|
|
8429
|
+
class: unref(cn)(unref(switchTrack)({ size: props.size }), unref(checkboxControl)({ controlPlacement: props.controlPlacement }))
|
|
8152
8430
|
}), {
|
|
8153
8431
|
default: withCtx(() => [createElementVNode("span", {
|
|
8154
8432
|
"data-hn-thumb": "",
|
|
@@ -8168,11 +8446,14 @@ var Switch_default = /* @__PURE__ */ defineComponent({
|
|
|
8168
8446
|
]),
|
|
8169
8447
|
unref(slots).default ? (openBlock(), createElementBlock("span", {
|
|
8170
8448
|
key: 0,
|
|
8171
|
-
class: normalizeClass(unref(checkboxTitle)())
|
|
8449
|
+
class: normalizeClass(unref(checkboxTitle)({ controlPlacement: props.controlPlacement }))
|
|
8172
8450
|
}, [createElementVNode("span", { class: normalizeClass(unref(checkboxTitleText)()) }, [renderSlot(_ctx.$slots, "default")], 2)], 2)) : createCommentVNode("", true),
|
|
8173
8451
|
props.description ? (openBlock(), createElementBlock("span", {
|
|
8174
8452
|
key: 1,
|
|
8175
|
-
class: normalizeClass(unref(checkboxDescription)({
|
|
8453
|
+
class: normalizeClass(unref(checkboxDescription)({
|
|
8454
|
+
size: props.size,
|
|
8455
|
+
controlPlacement: props.controlPlacement
|
|
8456
|
+
}))
|
|
8176
8457
|
}, toDisplayString(props.description), 3)) : createCommentVNode("", true)
|
|
8177
8458
|
], 10, _hoisted_1$61);
|
|
8178
8459
|
};
|
|
@@ -8777,7 +9058,7 @@ var TagsInputChip_default = /* @__PURE__ */ defineComponent({
|
|
|
8777
9058
|
});
|
|
8778
9059
|
//#endregion
|
|
8779
9060
|
//#region src/components/tags-input/TagsInput.vue?vue&type=script&setup=true&lang.ts
|
|
8780
|
-
var _hoisted_1$56 = ["data-invalid"];
|
|
9061
|
+
var _hoisted_1$56 = ["data-invalid", "data-disabled"];
|
|
8781
9062
|
//#endregion
|
|
8782
9063
|
//#region src/components/tags-input/TagsInput.vue
|
|
8783
9064
|
var TagsInput_default = /* @__PURE__ */ defineComponent({
|
|
@@ -8844,6 +9125,7 @@ var TagsInput_default = /* @__PURE__ */ defineComponent({
|
|
|
8844
9125
|
return openBlock(), createElementBlock("div", {
|
|
8845
9126
|
"data-hn-tags-input": "",
|
|
8846
9127
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
9128
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
8847
9129
|
onClick: _cache[2] || (_cache[2] = ($event) => unref(focusFieldFrom)($event.currentTarget, $event.target)),
|
|
8848
9130
|
class: normalizeClass(unref(cn)(unref(inputHost)({
|
|
8849
9131
|
variant: props.variant,
|
|
@@ -8932,6 +9214,54 @@ var TagsInput_default = /* @__PURE__ */ defineComponent({
|
|
|
8932
9214
|
}
|
|
8933
9215
|
});
|
|
8934
9216
|
//#endregion
|
|
9217
|
+
//#region src/components/multi-combobox/composables/useMultiCombobox.ts
|
|
9218
|
+
function useMultiCombobox(options) {
|
|
9219
|
+
const { model, open } = options;
|
|
9220
|
+
const keyboard = ref(false);
|
|
9221
|
+
const input = shallowRef(null);
|
|
9222
|
+
const labels = reactive(/* @__PURE__ */ new Map());
|
|
9223
|
+
watch(options.options, (options) => {
|
|
9224
|
+
for (const option of flattenOptions(options)) labels.set(option.value, option.label);
|
|
9225
|
+
}, {
|
|
9226
|
+
immediate: true,
|
|
9227
|
+
deep: true
|
|
9228
|
+
});
|
|
9229
|
+
const selected = computed(() => model.value.map((value) => ({
|
|
9230
|
+
value,
|
|
9231
|
+
label: labels.get(value) ?? String(value)
|
|
9232
|
+
})));
|
|
9233
|
+
watch(open, (value) => {
|
|
9234
|
+
if (!value) keyboard.value = false;
|
|
9235
|
+
});
|
|
9236
|
+
function remove(value) {
|
|
9237
|
+
if (options.disabled()) return;
|
|
9238
|
+
model.value = model.value.filter((item) => item !== value);
|
|
9239
|
+
}
|
|
9240
|
+
function clear() {
|
|
9241
|
+
if (!model.value.length) return;
|
|
9242
|
+
model.value = [];
|
|
9243
|
+
options.onClear();
|
|
9244
|
+
input.value?.$el.focus();
|
|
9245
|
+
}
|
|
9246
|
+
function onHostClick(event) {
|
|
9247
|
+
if (focusFieldFrom(event.currentTarget, event.target) && !open.value) open.value = true;
|
|
9248
|
+
}
|
|
9249
|
+
function onInputKeydown(event) {
|
|
9250
|
+
keyboard.value = true;
|
|
9251
|
+
if (event.key !== "Backspace" || event.target.value !== "" || !model.value.length) return;
|
|
9252
|
+
model.value = model.value.slice(0, -1);
|
|
9253
|
+
}
|
|
9254
|
+
return {
|
|
9255
|
+
selected,
|
|
9256
|
+
keyboard,
|
|
9257
|
+
input,
|
|
9258
|
+
remove,
|
|
9259
|
+
clear,
|
|
9260
|
+
onHostClick,
|
|
9261
|
+
onInputKeydown
|
|
9262
|
+
};
|
|
9263
|
+
}
|
|
9264
|
+
//#endregion
|
|
8935
9265
|
//#region src/components/multi-combobox/multi-combobox.variants.ts
|
|
8936
9266
|
var multiComboboxHost = tv({
|
|
8937
9267
|
base: "",
|
|
@@ -8940,7 +9270,11 @@ var multiComboboxHost = tv({
|
|
|
8940
9270
|
var multiComboboxEnd = tv({ base: "absolute inset-y-0 end-0 flex items-stretch" });
|
|
8941
9271
|
//#endregion
|
|
8942
9272
|
//#region src/components/multi-combobox/MultiCombobox.vue?vue&type=script&setup=true&lang.ts
|
|
8943
|
-
var _hoisted_1$55 = [
|
|
9273
|
+
var _hoisted_1$55 = [
|
|
9274
|
+
"data-invalid",
|
|
9275
|
+
"data-disabled",
|
|
9276
|
+
"aria-busy"
|
|
9277
|
+
];
|
|
8944
9278
|
var _hoisted_2$27 = { class: "min-w-0 truncate" };
|
|
8945
9279
|
//#endregion
|
|
8946
9280
|
//#region src/components/multi-combobox/MultiCombobox.vue
|
|
@@ -8986,52 +9320,25 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
|
|
|
8986
9320
|
const search = useModel(__props, "search");
|
|
8987
9321
|
const open = useModel(__props, "open");
|
|
8988
9322
|
const t = useUiLocale();
|
|
8989
|
-
const keyboard = ref(false);
|
|
8990
|
-
const input = shallowRef(null);
|
|
8991
9323
|
const { id: fieldId, invalid, disabled, describedBy } = useFieldControl({
|
|
8992
9324
|
invalid: () => props.invalid,
|
|
8993
9325
|
disabled: () => props.disabled
|
|
8994
9326
|
});
|
|
8995
|
-
const
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9327
|
+
const { selected, keyboard, input, remove, clear, onHostClick, onInputKeydown } = useMultiCombobox({
|
|
9328
|
+
options: () => props.options,
|
|
9329
|
+
model,
|
|
9330
|
+
open,
|
|
9331
|
+
disabled: () => disabled.value,
|
|
9332
|
+
onClear: () => emit("clear")
|
|
9001
9333
|
});
|
|
9002
|
-
const selected = computed(() => model.value.map((value) => ({
|
|
9003
|
-
value,
|
|
9004
|
-
label: labels.get(value) ?? String(value)
|
|
9005
|
-
})));
|
|
9006
9334
|
const chipSize = computed(() => props.size === "sm" ? "sm" : "md");
|
|
9007
9335
|
const clearing = computed(() => props.clearable && selected.value.length > 0 && !disabled.value);
|
|
9008
|
-
watch(open, (value) => {
|
|
9009
|
-
if (!value) keyboard.value = false;
|
|
9010
|
-
});
|
|
9011
|
-
function remove(value) {
|
|
9012
|
-
if (disabled.value) return;
|
|
9013
|
-
model.value = model.value.filter((item) => item !== value);
|
|
9014
|
-
}
|
|
9015
|
-
function clear() {
|
|
9016
|
-
if (!model.value.length) return;
|
|
9017
|
-
model.value = [];
|
|
9018
|
-
emit("clear");
|
|
9019
|
-
input.value?.$el.focus();
|
|
9020
|
-
}
|
|
9021
|
-
function onHostClick(event) {
|
|
9022
|
-
if (focusFieldFrom(event.currentTarget, event.target) && !open.value) open.value = true;
|
|
9023
|
-
}
|
|
9024
|
-
function onInputKeydown(event) {
|
|
9025
|
-
keyboard.value = true;
|
|
9026
|
-
if (event.key !== "Backspace" || event.target.value !== "" || !model.value.length) return;
|
|
9027
|
-
model.value = model.value.slice(0, -1);
|
|
9028
|
-
}
|
|
9029
9336
|
return (_ctx, _cache) => {
|
|
9030
9337
|
return openBlock(), createBlock(unref(ComboboxRoot), {
|
|
9031
9338
|
modelValue: model.value,
|
|
9032
|
-
"onUpdate:modelValue": _cache[
|
|
9339
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => model.value = $event),
|
|
9033
9340
|
open: open.value,
|
|
9034
|
-
"onUpdate:open": _cache[
|
|
9341
|
+
"onUpdate:open": _cache[4] || (_cache[4] = ($event) => open.value = $event),
|
|
9035
9342
|
disabled: unref(disabled),
|
|
9036
9343
|
"ignore-filter": props.ignoreFilter,
|
|
9037
9344
|
name: props.name,
|
|
@@ -9042,6 +9349,7 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
|
|
|
9042
9349
|
default: withCtx(() => [createElementVNode("div", {
|
|
9043
9350
|
"data-hn-multi-combobox": "",
|
|
9044
9351
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
9352
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
9045
9353
|
"aria-busy": props.loading || void 0,
|
|
9046
9354
|
class: normalizeClass(unref(cn)(unref(inputHost)({
|
|
9047
9355
|
variant: props.variant,
|
|
@@ -9050,15 +9358,15 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
|
|
|
9050
9358
|
size: props.size,
|
|
9051
9359
|
trailing: true
|
|
9052
9360
|
}), unref(multiComboboxHost)({ clearing: clearing.value }), props.class)),
|
|
9053
|
-
onClick: onHostClick
|
|
9054
|
-
}, [createElementVNode("div", { class: normalizeClass(unref(tagsInputList)()) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(selected
|
|
9361
|
+
onClick: _cache[2] || (_cache[2] = (...args) => unref(onHostClick) && unref(onHostClick)(...args))
|
|
9362
|
+
}, [createElementVNode("div", { class: normalizeClass(unref(tagsInputList)()) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(selected), (option) => {
|
|
9055
9363
|
return openBlock(), createBlock(Chip_default, {
|
|
9056
9364
|
key: option.value,
|
|
9057
9365
|
size: chipSize.value,
|
|
9058
9366
|
removable: "",
|
|
9059
9367
|
disabled: unref(disabled),
|
|
9060
9368
|
class: normalizeClass(unref(tagsInputChip)()),
|
|
9061
|
-
onRemove: ($event) => remove(option.value)
|
|
9369
|
+
onRemove: ($event) => unref(remove)(option.value)
|
|
9062
9370
|
}, {
|
|
9063
9371
|
default: withCtx(() => [createElementVNode("span", _hoisted_2$27, toDisplayString(option.label), 1)]),
|
|
9064
9372
|
_: 2
|
|
@@ -9074,13 +9382,13 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
|
|
|
9074
9382
|
}, _ctx.$attrs, {
|
|
9075
9383
|
modelValue: search.value,
|
|
9076
9384
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
9077
|
-
placeholder: selected.
|
|
9385
|
+
placeholder: unref(selected).length ? void 0 : props.placeholder ?? unref(t).combobox.placeholder,
|
|
9078
9386
|
disabled: unref(disabled),
|
|
9079
9387
|
id: unref(fieldId),
|
|
9080
9388
|
"aria-invalid": unref(invalid) || void 0,
|
|
9081
9389
|
"aria-describedby": unref(describedBy),
|
|
9082
9390
|
class: unref(tagsInputControl)({ size: props.size }),
|
|
9083
|
-
onKeydown: onInputKeydown
|
|
9391
|
+
onKeydown: unref(onInputKeydown)
|
|
9084
9392
|
}), null, 16, [
|
|
9085
9393
|
"modelValue",
|
|
9086
9394
|
"placeholder",
|
|
@@ -9088,7 +9396,8 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
|
|
|
9088
9396
|
"id",
|
|
9089
9397
|
"aria-invalid",
|
|
9090
9398
|
"aria-describedby",
|
|
9091
|
-
"class"
|
|
9399
|
+
"class",
|
|
9400
|
+
"onKeydown"
|
|
9092
9401
|
])], 2), createElementVNode("span", { class: normalizeClass(unref(multiComboboxEnd)()) }, [createVNode(Transition, {
|
|
9093
9402
|
"enter-active-class": "hn-transition-base",
|
|
9094
9403
|
"enter-from-class": "scale-90 opacity-0",
|
|
@@ -9101,11 +9410,11 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
|
|
|
9101
9410
|
class: normalizeClass(unref(inputActionSlot)())
|
|
9102
9411
|
}, [createVNode(InputAction_default, {
|
|
9103
9412
|
label: unref(t).common.clear,
|
|
9104
|
-
onClick: clear
|
|
9413
|
+
onClick: unref(clear)
|
|
9105
9414
|
}, {
|
|
9106
9415
|
default: withCtx(() => [createVNode(unref(X))]),
|
|
9107
9416
|
_: 1
|
|
9108
|
-
}, 8, ["label"])], 2)) : createCommentVNode("", true)]),
|
|
9417
|
+
}, 8, ["label", "onClick"])], 2)) : createCommentVNode("", true)]),
|
|
9109
9418
|
_: 1
|
|
9110
9419
|
}), createVNode(unref(ComboboxTrigger), {
|
|
9111
9420
|
"aria-label": unref(t).combobox.toggle,
|
|
@@ -9130,7 +9439,7 @@ var MultiCombobox_default = /* @__PURE__ */ defineComponent({
|
|
|
9130
9439
|
_: 1
|
|
9131
9440
|
}), createVNode(ComboboxList_default, {
|
|
9132
9441
|
options: props.options,
|
|
9133
|
-
keyboard: keyboard
|
|
9442
|
+
keyboard: unref(keyboard)
|
|
9134
9443
|
}, {
|
|
9135
9444
|
option: withCtx((slotProps) => [renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
9136
9445
|
_: 3
|
|
@@ -9998,7 +10307,7 @@ var InputGroupScope_default = /* @__PURE__ */ defineComponent({
|
|
|
9998
10307
|
var datePickerContent = tv({ base: "hn-anim-pop z-(--hn-z-overlay) p-2 shadow-md outline-none" });
|
|
9999
10308
|
//#endregion
|
|
10000
10309
|
//#region src/components/date-picker/DatePicker.vue?vue&type=script&setup=true&lang.ts
|
|
10001
|
-
var _hoisted_1$53 = ["data-invalid"];
|
|
10310
|
+
var _hoisted_1$53 = ["data-invalid", "data-disabled"];
|
|
10002
10311
|
//#endregion
|
|
10003
10312
|
//#region src/components/date-picker/DatePicker.vue
|
|
10004
10313
|
var DatePicker_default = /* @__PURE__ */ defineComponent({
|
|
@@ -10068,6 +10377,7 @@ var DatePicker_default = /* @__PURE__ */ defineComponent({
|
|
|
10068
10377
|
ref: host,
|
|
10069
10378
|
"data-hn-date-picker": "",
|
|
10070
10379
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
10380
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
10071
10381
|
class: normalizeClass(unref(cn)(unref(outer) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
10072
10382
|
variant: props.variant,
|
|
10073
10383
|
size: props.size
|
|
@@ -10596,7 +10906,7 @@ var RangeCalendar_default = /* @__PURE__ */ defineComponent({
|
|
|
10596
10906
|
});
|
|
10597
10907
|
//#endregion
|
|
10598
10908
|
//#region src/components/date-range-picker/DateRangePicker.vue?vue&type=script&setup=true&lang.ts
|
|
10599
|
-
var _hoisted_1$51 = ["data-invalid"];
|
|
10909
|
+
var _hoisted_1$51 = ["data-invalid", "data-disabled"];
|
|
10600
10910
|
//#endregion
|
|
10601
10911
|
//#region src/components/date-range-picker/DateRangePicker.vue
|
|
10602
10912
|
var DateRangePicker_default = /* @__PURE__ */ defineComponent({
|
|
@@ -10667,6 +10977,7 @@ var DateRangePicker_default = /* @__PURE__ */ defineComponent({
|
|
|
10667
10977
|
ref: host,
|
|
10668
10978
|
"data-hn-date-range-picker": "",
|
|
10669
10979
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
10980
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
10670
10981
|
class: normalizeClass(unref(cn)(unref(outer) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
10671
10982
|
variant: props.variant,
|
|
10672
10983
|
size: props.size
|
|
@@ -10939,7 +11250,7 @@ var TimeField_default = /* @__PURE__ */ defineComponent({
|
|
|
10939
11250
|
var dateTimePickerFooter = tv({ base: "mt-2 flex items-center justify-between gap-2" });
|
|
10940
11251
|
//#endregion
|
|
10941
11252
|
//#region src/components/date-time-picker/DateTimePicker.vue?vue&type=script&setup=true&lang.ts
|
|
10942
|
-
var _hoisted_1$49 = ["data-invalid"];
|
|
11253
|
+
var _hoisted_1$49 = ["data-invalid", "data-disabled"];
|
|
10943
11254
|
//#endregion
|
|
10944
11255
|
//#region src/components/date-time-picker/DateTimePicker.vue
|
|
10945
11256
|
var DateTimePicker_default = /* @__PURE__ */ defineComponent({
|
|
@@ -11021,6 +11332,7 @@ var DateTimePicker_default = /* @__PURE__ */ defineComponent({
|
|
|
11021
11332
|
ref: host,
|
|
11022
11333
|
"data-hn-date-time-picker": "",
|
|
11023
11334
|
"data-invalid": unref(invalid) ? "" : void 0,
|
|
11335
|
+
"data-disabled": unref(disabled) ? "" : void 0,
|
|
11024
11336
|
class: normalizeClass(unref(cn)(unref(outer) ? unref(inputEmbedded)() : unref(inputHost)({
|
|
11025
11337
|
variant: props.variant,
|
|
11026
11338
|
size: props.size
|
|
@@ -11707,31 +12019,38 @@ var FileUpload_default = /* @__PURE__ */ defineComponent({
|
|
|
11707
12019
|
//#endregion
|
|
11708
12020
|
//#region src/components/dialog/dialog.variants.ts
|
|
11709
12021
|
var dialogWrapper = tv({
|
|
11710
|
-
base: "",
|
|
12022
|
+
base: "pointer-events-none fixed inset-0 z-(--hn-z-overlay) grid",
|
|
11711
12023
|
variants: { placement: {
|
|
11712
12024
|
center: "place-items-center p-4",
|
|
12025
|
+
top: "items-start justify-items-center p-4",
|
|
11713
12026
|
bottom: "items-end justify-items-center p-4",
|
|
11714
12027
|
auto: "place-items-center p-4 max-sm:items-end max-sm:justify-items-stretch"
|
|
11715
12028
|
} },
|
|
11716
12029
|
defaultVariants: { placement: "auto" }
|
|
11717
12030
|
});
|
|
11718
12031
|
var dialogCard = tv({
|
|
11719
|
-
base: "",
|
|
12032
|
+
base: "pointer-events-auto flex w-full flex-col shadow-lg outline-none",
|
|
11720
12033
|
variants: {
|
|
12034
|
+
padded: { true: "gap-4 py-(--hn-panel-p)" },
|
|
12035
|
+
fitViewport: { true: "max-h-[calc(100dvh-2rem)]" },
|
|
11721
12036
|
placement: {
|
|
11722
12037
|
center: "hn-anim-modal",
|
|
12038
|
+
top: "hn-anim-sheet-top",
|
|
11723
12039
|
bottom: "hn-anim-sheet-bottom",
|
|
11724
12040
|
auto: "hn-anim-modal max-sm:hn-anim-sheet-bottom max-sm:max-w-none"
|
|
11725
12041
|
},
|
|
11726
12042
|
size: {
|
|
11727
12043
|
sm: "max-w-sm",
|
|
11728
12044
|
md: "max-w-md",
|
|
11729
|
-
lg: "max-w-xl"
|
|
12045
|
+
lg: "max-w-xl",
|
|
12046
|
+
xl: "max-w-2xl",
|
|
12047
|
+
"2xl": "max-w-4xl"
|
|
11730
12048
|
}
|
|
11731
12049
|
},
|
|
11732
12050
|
defaultVariants: {
|
|
11733
12051
|
placement: "auto",
|
|
11734
|
-
size: "md"
|
|
12052
|
+
size: "md",
|
|
12053
|
+
padded: true
|
|
11735
12054
|
}
|
|
11736
12055
|
});
|
|
11737
12056
|
//#endregion
|
|
@@ -12530,8 +12849,8 @@ var _hoisted_1$40 = ["data-dragging"];
|
|
|
12530
12849
|
var _hoisted_2$21 = ["data-disabled"];
|
|
12531
12850
|
var _hoisted_3$9 = { class: "flex items-start justify-between gap-4 px-(--hn-panel-p)" };
|
|
12532
12851
|
var _hoisted_4$7 = { class: "flex min-w-0 flex-col gap-1.5" };
|
|
12533
|
-
var _hoisted_5$
|
|
12534
|
-
var _hoisted_6$
|
|
12852
|
+
var _hoisted_5$5 = { class: "px-(--hn-panel-p) py-1" };
|
|
12853
|
+
var _hoisted_6$4 = {
|
|
12535
12854
|
key: 1,
|
|
12536
12855
|
class: "flex shrink-0 justify-end gap-(--hn-inline-gap) px-(--hn-panel-p)"
|
|
12537
12856
|
};
|
|
@@ -12646,10 +12965,10 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
12646
12965
|
key: 0,
|
|
12647
12966
|
class: "min-h-0 grow"
|
|
12648
12967
|
}, {
|
|
12649
|
-
default: withCtx(() => [createElementVNode("div", _hoisted_5$
|
|
12968
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_5$5, [renderSlot(_ctx.$slots, "content", { close })])]),
|
|
12650
12969
|
_: 3
|
|
12651
12970
|
})) : createCommentVNode("", true),
|
|
12652
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
12971
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$4, [renderSlot(_ctx.$slots, "footer", { close })])) : createCommentVNode("", true)
|
|
12653
12972
|
]),
|
|
12654
12973
|
_: 3
|
|
12655
12974
|
}, 8, [
|
|
@@ -14343,33 +14662,86 @@ var Form_default = /* @__PURE__ */ defineComponent({
|
|
|
14343
14662
|
}
|
|
14344
14663
|
});
|
|
14345
14664
|
//#endregion
|
|
14665
|
+
//#region src/components/form-layout/context.ts
|
|
14666
|
+
var FORM_LAYOUT_KEY = Symbol("hn-form-layout");
|
|
14667
|
+
function useFormFieldLayout(props) {
|
|
14668
|
+
const parent = inject(FORM_LAYOUT_KEY, null);
|
|
14669
|
+
return computed(() => ({
|
|
14670
|
+
orientation: props.orientation ?? parent?.value.orientation ?? "vertical",
|
|
14671
|
+
descriptionPlacement: props.descriptionPlacement ?? parent?.value.descriptionPlacement ?? "control",
|
|
14672
|
+
labelWidth: props.labelWidth ?? parent?.value.labelWidth ?? "10rem"
|
|
14673
|
+
}));
|
|
14674
|
+
}
|
|
14675
|
+
function provideFormLayout(layout) {
|
|
14676
|
+
provide(FORM_LAYOUT_KEY, layout);
|
|
14677
|
+
}
|
|
14678
|
+
//#endregion
|
|
14346
14679
|
//#region src/components/form-field/form-field.variants.ts
|
|
14347
|
-
var formFieldRoot = tv({
|
|
14680
|
+
var formFieldRoot = tv({
|
|
14681
|
+
base: "min-w-0",
|
|
14682
|
+
variants: { orientation: {
|
|
14683
|
+
vertical: "",
|
|
14684
|
+
horizontal: "",
|
|
14685
|
+
responsive: "@container/hn-form-field"
|
|
14686
|
+
} }
|
|
14687
|
+
});
|
|
14688
|
+
var formFieldLayout = tv({
|
|
14689
|
+
base: "grid min-w-0 grid-cols-1 items-start gap-x-6 gap-y-1.5",
|
|
14690
|
+
variants: { orientation: {
|
|
14691
|
+
vertical: "",
|
|
14692
|
+
horizontal: "grid-cols-[var(--hn-form-label-width)_minmax(0,1fr)]",
|
|
14693
|
+
responsive: "@min-[32rem]/hn-form-field:grid-cols-[var(--hn-form-label-width)_minmax(0,1fr)]"
|
|
14694
|
+
} }
|
|
14695
|
+
});
|
|
14696
|
+
var formFieldContent = tv({ base: "flex min-w-0 flex-col gap-1.5" });
|
|
14697
|
+
var formFieldControl = tv({
|
|
14698
|
+
base: "min-w-0",
|
|
14699
|
+
variants: { orientation: {
|
|
14700
|
+
vertical: "",
|
|
14701
|
+
horizontal: "grid min-h-[var(--hn-control-h-md)] items-center",
|
|
14702
|
+
responsive: "@min-[32rem]/hn-form-field:grid @min-[32rem]/hn-form-field:min-h-[var(--hn-control-h-md)] @min-[32rem]/hn-form-field:items-center"
|
|
14703
|
+
} }
|
|
14704
|
+
});
|
|
14348
14705
|
var formFieldLabel = tv({
|
|
14349
14706
|
base: "text-fg inline-flex items-center gap-1 text-sm font-medium",
|
|
14350
|
-
variants: {
|
|
14707
|
+
variants: {
|
|
14708
|
+
orientation: {
|
|
14709
|
+
vertical: "",
|
|
14710
|
+
horizontal: "min-h-[var(--hn-control-h-md)]",
|
|
14711
|
+
responsive: "@min-[32rem]/hn-form-field:min-h-[var(--hn-control-h-md)]"
|
|
14712
|
+
},
|
|
14713
|
+
disabled: { true: "text-disabled" }
|
|
14714
|
+
}
|
|
14351
14715
|
});
|
|
14352
14716
|
var formFieldMark = tv({ base: "text-danger-text" });
|
|
14353
14717
|
var formFieldDescription = tv({ base: "text-muted text-sm" });
|
|
14354
14718
|
var formFieldMessage = tv({ base: "text-danger-text text-sm" });
|
|
14355
14719
|
//#endregion
|
|
14356
14720
|
//#region src/components/form-field/FormField.vue?vue&type=script&setup=true&lang.ts
|
|
14357
|
-
var _hoisted_1$26 = [
|
|
14721
|
+
var _hoisted_1$26 = [
|
|
14722
|
+
"data-invalid",
|
|
14723
|
+
"data-disabled",
|
|
14724
|
+
"data-orientation"
|
|
14725
|
+
];
|
|
14358
14726
|
var _hoisted_2$15 = ["id", "for"];
|
|
14359
14727
|
var _hoisted_3$7 = ["id"];
|
|
14360
|
-
var _hoisted_4$5 =
|
|
14728
|
+
var _hoisted_4$5 = ["id"];
|
|
14729
|
+
var _hoisted_5$4 = {
|
|
14361
14730
|
key: 0,
|
|
14362
14731
|
"data-hn-form-field-message": "",
|
|
14363
14732
|
class: "hn-collapse [--hn-collapse-out:var(--hn-duration-fast)]"
|
|
14364
14733
|
};
|
|
14365
|
-
var
|
|
14366
|
-
var
|
|
14734
|
+
var _hoisted_6$3 = { class: "hn-collapse-body" };
|
|
14735
|
+
var _hoisted_7$2 = ["id"];
|
|
14367
14736
|
//#endregion
|
|
14368
14737
|
//#region src/components/form-field/FormField.vue
|
|
14369
14738
|
var FormField_default = /* @__PURE__ */ defineComponent({
|
|
14370
14739
|
name: "HnFormField",
|
|
14371
14740
|
__name: "FormField",
|
|
14372
14741
|
props: {
|
|
14742
|
+
orientation: {},
|
|
14743
|
+
descriptionPlacement: {},
|
|
14744
|
+
labelWidth: {},
|
|
14373
14745
|
name: {},
|
|
14374
14746
|
label: {},
|
|
14375
14747
|
description: {},
|
|
@@ -14380,6 +14752,7 @@ var FormField_default = /* @__PURE__ */ defineComponent({
|
|
|
14380
14752
|
},
|
|
14381
14753
|
setup(__props) {
|
|
14382
14754
|
const props = __props;
|
|
14755
|
+
const layout = useFormFieldLayout(props);
|
|
14383
14756
|
const slots = useSlots();
|
|
14384
14757
|
const t = useUiLocale();
|
|
14385
14758
|
const form = injectForm();
|
|
@@ -14394,6 +14767,10 @@ var FormField_default = /* @__PURE__ */ defineComponent({
|
|
|
14394
14767
|
const invalid = computed(() => !!message.value);
|
|
14395
14768
|
const disabled = computed(() => !!props.disabled || !!form?.disabled.value);
|
|
14396
14769
|
const described = computed(() => !!props.description || !!slots.description);
|
|
14770
|
+
const headed = computed(() => !!props.label || !!slots.label);
|
|
14771
|
+
const descriptionWithLabel = computed(() => described.value && layout.value.descriptionPlacement === "label");
|
|
14772
|
+
const contentOrientation = computed(() => headed.value || descriptionWithLabel.value ? layout.value.orientation : "vertical");
|
|
14773
|
+
const layoutStyle = computed(() => ({ "--hn-form-label-width": typeof layout.value.labelWidth === "number" ? `${layout.value.labelWidth}px` : layout.value.labelWidth }));
|
|
14397
14774
|
const describedBy = computed(() => {
|
|
14398
14775
|
const ids = [];
|
|
14399
14776
|
if (described.value) ids.push(descriptionId);
|
|
@@ -14419,46 +14796,67 @@ var FormField_default = /* @__PURE__ */ defineComponent({
|
|
|
14419
14796
|
"data-hn-form-field": "",
|
|
14420
14797
|
"data-invalid": invalid.value ? "" : void 0,
|
|
14421
14798
|
"data-disabled": disabled.value ? "" : void 0,
|
|
14422
|
-
|
|
14799
|
+
"data-orientation": unref(layout).orientation,
|
|
14800
|
+
class: normalizeClass(unref(cn)(unref(formFieldRoot)({ orientation: unref(layout).orientation }), props.class)),
|
|
14801
|
+
style: normalizeStyle(layoutStyle.value),
|
|
14423
14802
|
onFocusout: onFocusOut
|
|
14803
|
+
}, [createElementVNode("div", {
|
|
14804
|
+
"data-hn-form-field-layout": "",
|
|
14805
|
+
class: normalizeClass(unref(formFieldLayout)({ orientation: contentOrientation.value }))
|
|
14806
|
+
}, [headed.value || descriptionWithLabel.value ? (openBlock(), createElementBlock("div", {
|
|
14807
|
+
key: 0,
|
|
14808
|
+
"data-hn-form-field-header": "",
|
|
14809
|
+
class: normalizeClass(unref(formFieldContent)())
|
|
14810
|
+
}, [headed.value ? (openBlock(), createElementBlock("label", {
|
|
14811
|
+
key: 0,
|
|
14812
|
+
id: unref(labelId),
|
|
14813
|
+
for: controlId.value,
|
|
14814
|
+
class: normalizeClass(unref(formFieldLabel)({
|
|
14815
|
+
disabled: disabled.value,
|
|
14816
|
+
orientation: contentOrientation.value
|
|
14817
|
+
}))
|
|
14424
14818
|
}, [
|
|
14425
|
-
|
|
14819
|
+
renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(props.label), 1)]),
|
|
14820
|
+
props.required ? (openBlock(), createElementBlock("span", {
|
|
14821
|
+
key: 0,
|
|
14822
|
+
class: normalizeClass(unref(formFieldMark)()),
|
|
14823
|
+
"aria-hidden": "true"
|
|
14824
|
+
}, "*", 2)) : createCommentVNode("", true),
|
|
14825
|
+
props.required ? (openBlock(), createBlock(VisuallyHidden_default, { key: 1 }, {
|
|
14826
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(t).form.required), 1)]),
|
|
14827
|
+
_: 1
|
|
14828
|
+
})) : createCommentVNode("", true)
|
|
14829
|
+
], 10, _hoisted_2$15)) : createCommentVNode("", true), descriptionWithLabel.value ? (openBlock(), createElementBlock("p", {
|
|
14830
|
+
key: 1,
|
|
14831
|
+
id: unref(descriptionId),
|
|
14832
|
+
class: normalizeClass(unref(formFieldDescription)())
|
|
14833
|
+
}, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10, _hoisted_3$7)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true), createElementVNode("div", {
|
|
14834
|
+
"data-hn-form-field-body": "",
|
|
14835
|
+
class: normalizeClass(unref(formFieldContent)())
|
|
14836
|
+
}, [
|
|
14837
|
+
createElementVNode("div", {
|
|
14838
|
+
"data-hn-form-field-control": "",
|
|
14839
|
+
class: normalizeClass(unref(formFieldControl)({ orientation: contentOrientation.value }))
|
|
14840
|
+
}, [renderSlot(_ctx.$slots, "default")], 2),
|
|
14841
|
+
described.value && !descriptionWithLabel.value ? (openBlock(), createElementBlock("p", {
|
|
14426
14842
|
key: 0,
|
|
14427
|
-
id: unref(labelId),
|
|
14428
|
-
for: controlId.value,
|
|
14429
|
-
class: normalizeClass(unref(formFieldLabel)({ disabled: disabled.value }))
|
|
14430
|
-
}, [
|
|
14431
|
-
renderSlot(_ctx.$slots, "label", {}, () => [createTextVNode(toDisplayString(props.label), 1)]),
|
|
14432
|
-
props.required ? (openBlock(), createElementBlock("span", {
|
|
14433
|
-
key: 0,
|
|
14434
|
-
class: normalizeClass(unref(formFieldMark)()),
|
|
14435
|
-
"aria-hidden": "true"
|
|
14436
|
-
}, "*", 2)) : createCommentVNode("", true),
|
|
14437
|
-
props.required ? (openBlock(), createBlock(VisuallyHidden_default, { key: 1 }, {
|
|
14438
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(t).form.required), 1)]),
|
|
14439
|
-
_: 1
|
|
14440
|
-
})) : createCommentVNode("", true)
|
|
14441
|
-
], 10, _hoisted_2$15)) : createCommentVNode("", true),
|
|
14442
|
-
renderSlot(_ctx.$slots, "default"),
|
|
14443
|
-
described.value ? (openBlock(), createElementBlock("p", {
|
|
14444
|
-
key: 1,
|
|
14445
14843
|
id: unref(descriptionId),
|
|
14446
14844
|
class: normalizeClass(unref(formFieldDescription)())
|
|
14447
|
-
}, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10,
|
|
14845
|
+
}, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])], 10, _hoisted_4$5)) : createCommentVNode("", true),
|
|
14448
14846
|
createVNode(Transition, mergeProps({
|
|
14449
14847
|
"enter-from-class": "hn-collapse-closed",
|
|
14450
14848
|
"enter-to-class": "hn-collapse-open",
|
|
14451
14849
|
"leave-from-class": "hn-collapse-open",
|
|
14452
14850
|
"leave-to-class": "hn-collapse-closed"
|
|
14453
14851
|
}, toHandlers(unref(hooks))), {
|
|
14454
|
-
default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div",
|
|
14852
|
+
default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div", _hoisted_5$4, [createElementVNode("div", _hoisted_6$3, [createElementVNode("p", {
|
|
14455
14853
|
id: unref(messageId),
|
|
14456
14854
|
class: normalizeClass(unref(formFieldMessage)()),
|
|
14457
14855
|
"aria-live": "polite"
|
|
14458
|
-
}, toDisplayString(message.value), 11,
|
|
14856
|
+
}, toDisplayString(message.value), 11, _hoisted_7$2)])])) : createCommentVNode("", true)]),
|
|
14459
14857
|
_: 1
|
|
14460
14858
|
}, 16)
|
|
14461
|
-
],
|
|
14859
|
+
], 2)], 2)], 46, _hoisted_1$26);
|
|
14462
14860
|
};
|
|
14463
14861
|
}
|
|
14464
14862
|
});
|
|
@@ -14490,6 +14888,9 @@ var FormLayout_default = /* @__PURE__ */ defineComponent({
|
|
|
14490
14888
|
name: "HnFormLayout",
|
|
14491
14889
|
__name: "FormLayout",
|
|
14492
14890
|
props: {
|
|
14891
|
+
orientation: {},
|
|
14892
|
+
descriptionPlacement: {},
|
|
14893
|
+
labelWidth: {},
|
|
14493
14894
|
legend: {},
|
|
14494
14895
|
description: {},
|
|
14495
14896
|
columns: { default: 1 },
|
|
@@ -14498,6 +14899,7 @@ var FormLayout_default = /* @__PURE__ */ defineComponent({
|
|
|
14498
14899
|
},
|
|
14499
14900
|
setup(__props) {
|
|
14500
14901
|
const props = __props;
|
|
14902
|
+
provideFormLayout(useFormFieldLayout(props));
|
|
14501
14903
|
const slots = useSlots();
|
|
14502
14904
|
const form = injectForm();
|
|
14503
14905
|
const descriptionId = useId();
|
|
@@ -14970,8 +15372,8 @@ var _hoisted_1$23 = ["data-lang"];
|
|
|
14970
15372
|
var _hoisted_2$13 = { class: "m-0" };
|
|
14971
15373
|
var _hoisted_3$6 = ["innerHTML"];
|
|
14972
15374
|
var _hoisted_4$4 = { key: 1 };
|
|
14973
|
-
var _hoisted_5$
|
|
14974
|
-
var _hoisted_6$
|
|
15375
|
+
var _hoisted_5$3 = { key: 2 };
|
|
15376
|
+
var _hoisted_6$2 = { class: "absolute top-2 end-2 flex items-center gap-2" };
|
|
14975
15377
|
var _hoisted_7$1 = {
|
|
14976
15378
|
key: 0,
|
|
14977
15379
|
class: "text-faint font-mono text-xs select-none"
|
|
@@ -15036,9 +15438,9 @@ var CodeBlock_default = /* @__PURE__ */ defineComponent({
|
|
|
15036
15438
|
style: normalizeStyle(tk.htmlStyle)
|
|
15037
15439
|
}, toDisplayString(tk.content), 5);
|
|
15038
15440
|
}), 128))], 64);
|
|
15039
|
-
}), 128))])) : (openBlock(), createElementBlock("code", _hoisted_5$
|
|
15441
|
+
}), 128))])) : (openBlock(), createElementBlock("code", _hoisted_5$3, toDisplayString(__props.code), 1))])]),
|
|
15040
15442
|
_: 1
|
|
15041
|
-
}, 8, ["label"]), createElementVNode("div", _hoisted_6$
|
|
15443
|
+
}, 8, ["label"]), createElementVNode("div", _hoisted_6$2, [tag.value ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(tag.value), 1)) : createCommentVNode("", true), __props.copyable ? (openBlock(), createBlock(CopyButton_default, {
|
|
15042
15444
|
key: 1,
|
|
15043
15445
|
text: props.code,
|
|
15044
15446
|
label: unref(t).codeblock.copy
|
|
@@ -15840,13 +16242,7 @@ var CollapsibleContent_default = /* @__PURE__ */ defineComponent({
|
|
|
15840
16242
|
props: { class: {} },
|
|
15841
16243
|
setup(__props) {
|
|
15842
16244
|
const props = __props;
|
|
15843
|
-
const content =
|
|
15844
|
-
function measure() {
|
|
15845
|
-
const el = content.value?.$el;
|
|
15846
|
-
if (el instanceof Element) writeCollapseGap(el, el.parentElement);
|
|
15847
|
-
}
|
|
15848
|
-
onMounted(measure);
|
|
15849
|
-
onBeforeUpdate(measure);
|
|
16245
|
+
const content = useCollapseGap();
|
|
15850
16246
|
return (_ctx, _cache) => {
|
|
15851
16247
|
return openBlock(), createBlock(unref(CollapsibleContent), {
|
|
15852
16248
|
ref_key: "content",
|
|
@@ -15978,13 +16374,7 @@ var AccordionContent_default = /* @__PURE__ */ defineComponent({
|
|
|
15978
16374
|
props: { class: {} },
|
|
15979
16375
|
setup(__props) {
|
|
15980
16376
|
const props = __props;
|
|
15981
|
-
const content =
|
|
15982
|
-
function measure() {
|
|
15983
|
-
const el = content.value?.$el;
|
|
15984
|
-
if (el instanceof Element) writeCollapseGap(el, el.parentElement);
|
|
15985
|
-
}
|
|
15986
|
-
onMounted(measure);
|
|
15987
|
-
onBeforeUpdate(measure);
|
|
16377
|
+
const content = useCollapseGap();
|
|
15988
16378
|
return (_ctx, _cache) => {
|
|
15989
16379
|
return openBlock(), createBlock(unref(AccordionContent), {
|
|
15990
16380
|
ref_key: "content",
|
|
@@ -16408,11 +16798,11 @@ var _hoisted_3$4 = {
|
|
|
16408
16798
|
class: "hidden h-full shrink-0 lg:block"
|
|
16409
16799
|
};
|
|
16410
16800
|
var _hoisted_4$2 = { class: "flex min-h-0 min-w-0 flex-1 flex-col" };
|
|
16411
|
-
var _hoisted_5$
|
|
16801
|
+
var _hoisted_5$2 = {
|
|
16412
16802
|
key: 0,
|
|
16413
16803
|
class: "border-line bg-canvas shrink-0 border-b"
|
|
16414
16804
|
};
|
|
16415
|
-
var _hoisted_6 = { class: "flex h-14 items-center gap-3 px-4 sm:px-6" };
|
|
16805
|
+
var _hoisted_6$1 = { class: "flex h-14 items-center gap-3 px-4 sm:px-6" };
|
|
16416
16806
|
var _hoisted_7 = { class: "min-h-0 min-w-0 flex-1" };
|
|
16417
16807
|
//#endregion
|
|
16418
16808
|
//#region src/components/app-shell/AppShell.vue
|
|
@@ -16468,7 +16858,7 @@ var AppShell_default = /* @__PURE__ */ defineComponent({
|
|
|
16468
16858
|
return openBlock(), createBlock(TooltipProvider_default, null, {
|
|
16469
16859
|
default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(cn)("bg-canvas text-fg flex h-screen flex-col overflow-hidden", props.class)) }, [
|
|
16470
16860
|
_ctx.$slots.banner ? (openBlock(), createElementBlock("div", _hoisted_1$14, [renderSlot(_ctx.$slots, "banner")])) : createCommentVNode("", true),
|
|
16471
|
-
createElementVNode("div", _hoisted_2$10, [_ctx.$slots.sidebar ? (openBlock(), createElementBlock("div", _hoisted_3$4, [renderSlot(_ctx.$slots, "sidebar")])) : createCommentVNode("", true), createElementVNode("div", _hoisted_4$2, [_ctx.$slots.header ? (openBlock(), createElementBlock("header", _hoisted_5$
|
|
16861
|
+
createElementVNode("div", _hoisted_2$10, [_ctx.$slots.sidebar ? (openBlock(), createElementBlock("div", _hoisted_3$4, [renderSlot(_ctx.$slots, "sidebar")])) : createCommentVNode("", true), createElementVNode("div", _hoisted_4$2, [_ctx.$slots.header ? (openBlock(), createElementBlock("header", _hoisted_5$2, [createElementVNode("div", _hoisted_6$1, [renderSlot(_ctx.$slots, "header")])])) : createCommentVNode("", true), createElementVNode("main", _hoisted_7, [createVNode(ScrollArea_default, {
|
|
16472
16862
|
ref_key: "main",
|
|
16473
16863
|
ref: main,
|
|
16474
16864
|
"data-scroll-restore": props.restoreKey,
|
|
@@ -17249,11 +17639,20 @@ var DropdownMenuRadioItem_default = /* @__PURE__ */ defineComponent({
|
|
|
17249
17639
|
});
|
|
17250
17640
|
//#endregion
|
|
17251
17641
|
//#region src/components/dialog/Dialog.vue?vue&type=script&setup=true&lang.ts
|
|
17252
|
-
var _hoisted_1$2 = {
|
|
17642
|
+
var _hoisted_1$2 = {
|
|
17643
|
+
key: 0,
|
|
17644
|
+
class: "flex shrink-0 items-start justify-between gap-4 px-(--hn-panel-p)"
|
|
17645
|
+
};
|
|
17253
17646
|
var _hoisted_2$2 = { class: "flex min-w-0 flex-col gap-1.5" };
|
|
17254
|
-
var _hoisted_3$1 = { class: "
|
|
17647
|
+
var _hoisted_3$1 = { class: "flex min-w-0 items-center gap-2" };
|
|
17255
17648
|
var _hoisted_4$1 = {
|
|
17256
|
-
key:
|
|
17649
|
+
key: 0,
|
|
17650
|
+
class: "text-muted flex shrink-0 [&_svg]:size-5",
|
|
17651
|
+
"aria-hidden": "true"
|
|
17652
|
+
};
|
|
17653
|
+
var _hoisted_5$1 = { class: "px-(--hn-panel-p) py-1" };
|
|
17654
|
+
var _hoisted_6 = {
|
|
17655
|
+
key: 2,
|
|
17257
17656
|
class: "flex shrink-0 justify-end gap-(--hn-inline-gap) px-(--hn-panel-p)"
|
|
17258
17657
|
};
|
|
17259
17658
|
//#endregion
|
|
@@ -17266,6 +17665,14 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
17266
17665
|
description: {},
|
|
17267
17666
|
size: { default: "md" },
|
|
17268
17667
|
placement: {},
|
|
17668
|
+
header: {
|
|
17669
|
+
type: Boolean,
|
|
17670
|
+
default: true
|
|
17671
|
+
},
|
|
17672
|
+
closable: {
|
|
17673
|
+
type: Boolean,
|
|
17674
|
+
default: true
|
|
17675
|
+
},
|
|
17269
17676
|
locked: {
|
|
17270
17677
|
type: Boolean,
|
|
17271
17678
|
default: false
|
|
@@ -17278,11 +17685,11 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
17278
17685
|
emits: ["update:open"],
|
|
17279
17686
|
setup(__props) {
|
|
17280
17687
|
const props = __props;
|
|
17688
|
+
const slots = useSlots();
|
|
17281
17689
|
function guard(e) {
|
|
17282
17690
|
if (props.locked) e.preventDefault();
|
|
17283
17691
|
}
|
|
17284
17692
|
const open = useModel(__props, "open");
|
|
17285
|
-
useUiLocale();
|
|
17286
17693
|
function close() {
|
|
17287
17694
|
open.value = false;
|
|
17288
17695
|
}
|
|
@@ -17298,29 +17705,47 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
17298
17705
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
17299
17706
|
_: 3
|
|
17300
17707
|
})) : createCommentVNode("", true), createVNode(unref(DialogPortal), null, {
|
|
17301
|
-
default: withCtx(() => [createVNode(unref(DialogOverlay), { class: "hn-scrim" }), createElementVNode("div", { class: normalizeClass(unref(
|
|
17708
|
+
default: withCtx(() => [createVNode(unref(DialogOverlay), { class: "hn-scrim" }), createElementVNode("div", { class: normalizeClass(unref(dialogWrapper)({ placement: props.placement ?? "auto" })) }, [createVNode(unref(DialogContent), {
|
|
17302
17709
|
"as-child": "",
|
|
17303
17710
|
onEscapeKeyDown: guard,
|
|
17304
17711
|
onInteractOutside: guard
|
|
17305
17712
|
}, {
|
|
17306
|
-
default: withCtx(() => [createVNode(Card_default, {
|
|
17713
|
+
default: withCtx(() => [createVNode(Card_default, mergeProps(props.description ? {} : { "aria-describedby": void 0 }, {
|
|
17307
17714
|
padded: false,
|
|
17308
|
-
class:
|
|
17715
|
+
class: unref(cn)(unref(dialogCard)({
|
|
17309
17716
|
placement: props.placement ?? "auto",
|
|
17310
|
-
size: props.size
|
|
17311
|
-
|
|
17312
|
-
|
|
17313
|
-
|
|
17314
|
-
|
|
17717
|
+
size: props.size,
|
|
17718
|
+
padded: !slots.body,
|
|
17719
|
+
fitViewport: true
|
|
17720
|
+
}), props.class)
|
|
17721
|
+
}), {
|
|
17722
|
+
default: withCtx(() => [!props.header || slots.body ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
17723
|
+
default: withCtx(() => [createVNode(Heading_default, {
|
|
17724
|
+
level: 2,
|
|
17725
|
+
class: "sr-only"
|
|
17726
|
+
}, {
|
|
17727
|
+
default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
|
|
17728
|
+
_: 1
|
|
17729
|
+
})]),
|
|
17730
|
+
_: 1
|
|
17731
|
+
}), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
17732
|
+
key: 0,
|
|
17733
|
+
class: "sr-only"
|
|
17734
|
+
}, {
|
|
17735
|
+
default: withCtx(() => [createTextVNode(toDisplayString(props.description), 1)]),
|
|
17736
|
+
_: 1
|
|
17737
|
+
})) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), slots.body ? renderSlot(_ctx.$slots, "body", { close }, void 0, void 0, 1) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
17738
|
+
props.header ? (openBlock(), createElementBlock("div", _hoisted_1$2, [createElementVNode("div", _hoisted_2$2, [createElementVNode("div", _hoisted_3$1, [slots.icon ? (openBlock(), createElementBlock("span", _hoisted_4$1, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("", true), createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
17315
17739
|
default: withCtx(() => [createVNode(Heading_default, {
|
|
17316
17740
|
level: 2,
|
|
17317
|
-
size: "lg"
|
|
17741
|
+
size: "lg",
|
|
17742
|
+
class: "min-w-0"
|
|
17318
17743
|
}, {
|
|
17319
|
-
default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
|
|
17320
|
-
_:
|
|
17744
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(props.title), 1)])]),
|
|
17745
|
+
_: 3
|
|
17321
17746
|
})]),
|
|
17322
|
-
_:
|
|
17323
|
-
}), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
17747
|
+
_: 3
|
|
17748
|
+
})]), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
17324
17749
|
key: 0,
|
|
17325
17750
|
"as-child": ""
|
|
17326
17751
|
}, {
|
|
@@ -17329,24 +17754,27 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
17329
17754
|
_: 1
|
|
17330
17755
|
})]),
|
|
17331
17756
|
_: 1
|
|
17332
|
-
})) : createCommentVNode("", true)]),
|
|
17757
|
+
})) : createCommentVNode("", true)]), props.closable ? (openBlock(), createBlock(unref(DialogClose), {
|
|
17758
|
+
key: 0,
|
|
17759
|
+
"as-child": ""
|
|
17760
|
+
}, {
|
|
17333
17761
|
default: withCtx(() => [createVNode(CloseButton_default, {
|
|
17334
17762
|
disabled: props.locked,
|
|
17335
17763
|
class: "-mt-1.5 -me-1.5 shrink-0"
|
|
17336
17764
|
}, null, 8, ["disabled"])]),
|
|
17337
17765
|
_: 1
|
|
17338
|
-
})]),
|
|
17766
|
+
})) : createCommentVNode("", true)])) : createCommentVNode("", true),
|
|
17339
17767
|
_ctx.$slots.content ? (openBlock(), createBlock(ScrollArea_default, {
|
|
17340
|
-
key:
|
|
17768
|
+
key: 1,
|
|
17341
17769
|
class: "min-h-0"
|
|
17342
17770
|
}, {
|
|
17343
|
-
default: withCtx(() => [createElementVNode("div",
|
|
17771
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "content", { close })])]),
|
|
17344
17772
|
_: 3
|
|
17345
17773
|
})) : createCommentVNode("", true),
|
|
17346
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div",
|
|
17347
|
-
]),
|
|
17774
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "footer", { close })])) : createCommentVNode("", true)
|
|
17775
|
+
], 64))]),
|
|
17348
17776
|
_: 3
|
|
17349
|
-
},
|
|
17777
|
+
}, 16, ["class"])]),
|
|
17350
17778
|
_: 3
|
|
17351
17779
|
})], 2)]),
|
|
17352
17780
|
_: 3
|
|
@@ -18268,6 +18696,39 @@ var Spoiler_default = /* @__PURE__ */ defineComponent({
|
|
|
18268
18696
|
}
|
|
18269
18697
|
});
|
|
18270
18698
|
//#endregion
|
|
18699
|
+
//#region src/components/image/composables/useImageGroupState.ts
|
|
18700
|
+
function useImageGroupState() {
|
|
18701
|
+
const registry = reactive(/* @__PURE__ */ new Map());
|
|
18702
|
+
const open = shallowRef(false);
|
|
18703
|
+
const index = shallowRef(0);
|
|
18704
|
+
function byDom(a, b) {
|
|
18705
|
+
const first = a.source?.();
|
|
18706
|
+
const second = b.source?.();
|
|
18707
|
+
if (!first || !second || first === second) return 0;
|
|
18708
|
+
return first.compareDocumentPosition(second) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
18709
|
+
}
|
|
18710
|
+
const items = computed(() => [...registry.values()].map((read) => read()).sort(byDom));
|
|
18711
|
+
provideImageGroup({
|
|
18712
|
+
register: (id, item) => {
|
|
18713
|
+
registry.set(id, item);
|
|
18714
|
+
},
|
|
18715
|
+
unregister: (id) => {
|
|
18716
|
+
registry.delete(id);
|
|
18717
|
+
},
|
|
18718
|
+
open: (id) => {
|
|
18719
|
+
const at = items.value.findIndex((item) => item.id === id);
|
|
18720
|
+
if (at < 0) return;
|
|
18721
|
+
index.value = at;
|
|
18722
|
+
open.value = true;
|
|
18723
|
+
}
|
|
18724
|
+
});
|
|
18725
|
+
return {
|
|
18726
|
+
items,
|
|
18727
|
+
open,
|
|
18728
|
+
index
|
|
18729
|
+
};
|
|
18730
|
+
}
|
|
18731
|
+
//#endregion
|
|
18271
18732
|
//#region src/components/image/ImageGroup.vue
|
|
18272
18733
|
var ImageGroup_default = /* @__PURE__ */ defineComponent({
|
|
18273
18734
|
name: "HnImageGroup",
|
|
@@ -18275,37 +18736,14 @@ var ImageGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
18275
18736
|
props: { loop: { type: Boolean } },
|
|
18276
18737
|
setup(__props) {
|
|
18277
18738
|
const props = __props;
|
|
18278
|
-
const
|
|
18279
|
-
const open = shallowRef(false);
|
|
18280
|
-
const index = shallowRef(0);
|
|
18281
|
-
function byDom(a, b) {
|
|
18282
|
-
const first = a.source?.();
|
|
18283
|
-
const second = b.source?.();
|
|
18284
|
-
if (!first || !second || first === second) return 0;
|
|
18285
|
-
return first.compareDocumentPosition(second) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
18286
|
-
}
|
|
18287
|
-
const items = computed(() => [...registry.values()].map((read) => read()).sort(byDom));
|
|
18288
|
-
provideImageGroup({
|
|
18289
|
-
register: (id, item) => {
|
|
18290
|
-
registry.set(id, item);
|
|
18291
|
-
},
|
|
18292
|
-
unregister: (id) => {
|
|
18293
|
-
registry.delete(id);
|
|
18294
|
-
},
|
|
18295
|
-
open: (id) => {
|
|
18296
|
-
const at = items.value.findIndex((item) => item.id === id);
|
|
18297
|
-
if (at < 0) return;
|
|
18298
|
-
index.value = at;
|
|
18299
|
-
open.value = true;
|
|
18300
|
-
}
|
|
18301
|
-
});
|
|
18739
|
+
const { items, open, index } = useImageGroupState();
|
|
18302
18740
|
return (_ctx, _cache) => {
|
|
18303
18741
|
return openBlock(), createElementBlock(Fragment, null, [renderSlot(_ctx.$slots, "default"), createVNode(Lightbox_default, {
|
|
18304
|
-
open: open
|
|
18305
|
-
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
18306
|
-
index: index
|
|
18307
|
-
"onUpdate:index": _cache[1] || (_cache[1] = ($event) => index.value = $event),
|
|
18308
|
-
items: items
|
|
18742
|
+
open: unref(open),
|
|
18743
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => isRef(open) ? open.value = $event : null),
|
|
18744
|
+
index: unref(index),
|
|
18745
|
+
"onUpdate:index": _cache[1] || (_cache[1] = ($event) => isRef(index) ? index.value = $event : null),
|
|
18746
|
+
items: unref(items),
|
|
18309
18747
|
loop: props.loop
|
|
18310
18748
|
}, null, 8, [
|
|
18311
18749
|
"open",
|