@hina-ui/vue 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +330 -148
- package/dist/index.js.map +1 -1
- package/dist/types/components/dialog/Dialog.vue.d.ts +3 -1
- package/dist/types/components/dialog/Dialog.vue.d.ts.map +1 -1
- package/dist/types/components/drawer/Drawer.vue.d.ts +21 -14
- package/dist/types/components/drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/types/components/drawer/drawer.variants.d.ts +10 -1
- package/dist/types/components/drawer/drawer.variants.d.ts.map +1 -1
- package/dist/types/components/dropdown-menu/DropdownMenu.vue.d.ts +4 -1
- package/dist/types/components/dropdown-menu/DropdownMenu.vue.d.ts.map +1 -1
- package/dist/types/components/hover-card/HoverCard.vue.d.ts +4 -1
- package/dist/types/components/hover-card/HoverCard.vue.d.ts.map +1 -1
- package/dist/types/components/hover-card/HoverCardAnchor.vue.d.ts +6 -4
- package/dist/types/components/hover-card/HoverCardAnchor.vue.d.ts.map +1 -1
- package/dist/types/components/hover-card/composables/useHoverCardAnchor.d.ts +9 -4
- package/dist/types/components/hover-card/composables/useHoverCardAnchor.d.ts.map +1 -1
- package/dist/types/components/popover/Popover.vue.d.ts +4 -1
- package/dist/types/components/popover/Popover.vue.d.ts.map +1 -1
- package/dist/types/components/sheet/Sheet.vue.d.ts +21 -14
- package/dist/types/components/sheet/Sheet.vue.d.ts.map +1 -1
- package/dist/types/components/sheet/sheet.variants.d.ts +54 -3
- package/dist/types/components/sheet/sheet.variants.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/anchored-overlay.d.ts +12 -2
- package/dist/types/lib/anchored-overlay.d.ts.map +1 -1
- package/dist/types/lib/overlay-anchor.d.ts +16 -0
- package/dist/types/lib/overlay-anchor.d.ts.map +1 -0
- package/dist/types/lib/scroll-viewport.d.ts +9 -0
- package/dist/types/lib/scroll-viewport.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/dialog/Dialog.vue +5 -1
- package/src/components/drawer/Drawer.vue +69 -32
- package/src/components/drawer/drawer.variants.ts +6 -2
- package/src/components/dropdown-menu/DropdownMenu.vue +18 -5
- package/src/components/hover-card/HoverCard.vue +6 -1
- package/src/components/hover-card/HoverCardAnchor.vue +3 -1
- package/src/components/hover-card/composables/useHoverCardAnchor.ts +33 -42
- package/src/components/popover/Popover.vue +17 -7
- package/src/components/sheet/Sheet.vue +67 -24
- package/src/components/sheet/sheet.variants.ts +17 -4
- package/src/index.ts +1 -0
- package/src/lib/anchored-overlay.ts +28 -19
- package/src/lib/overlay-anchor.ts +65 -0
- package/src/lib/scroll-viewport.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, Accord
|
|
|
6
6
|
import { ArrowLeft, ArrowRight, CalendarClock, CalendarDays, CalendarRange, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsLeft, ChevronsRight, CircleCheck, CircleX, Copy, Download, Eye, EyeOff, File, Inbox, Info, Lightbulb, Megaphone, Minus, MoreHorizontal, PanelLeft, RotateCw, Scan, 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 { OverlayScrollbars } from "overlayscrollbars";
|
|
9
|
-
import { createSharedComposable, useDocumentVisibility, useEventListener, useIntersectionObserver, useIntervalFn, useMediaQuery, useMutationObserver, useRafFn, useResizeObserver } from "@vueuse/core";
|
|
9
|
+
import { createSharedComposable, defaultDocument, useDocumentVisibility, useEventListener, useIntersectionObserver, useIntervalFn, useMediaQuery, useMutationObserver, useRafFn, useResizeObserver } from "@vueuse/core";
|
|
10
10
|
import { CalendarDate, CalendarDateTime, Time, getLocalTimeZone, parseDate, parseDateTime, parseTime, today } from "@internationalized/date";
|
|
11
11
|
//#region src/lib/tw-merge.ts
|
|
12
12
|
var TW_MERGE_CONFIG = { extend: {
|
|
@@ -5136,11 +5136,11 @@ var _hoisted_1$83 = {
|
|
|
5136
5136
|
var _hoisted_2$40 = { class: "hn-collapse-body" };
|
|
5137
5137
|
var _hoisted_3$19 = ["role"];
|
|
5138
5138
|
var _hoisted_4$15 = { class: "flex min-w-0 flex-1 flex-col gap-1" };
|
|
5139
|
-
var _hoisted_5$
|
|
5139
|
+
var _hoisted_5$11 = {
|
|
5140
5140
|
key: 0,
|
|
5141
5141
|
class: "text-fg font-medium"
|
|
5142
5142
|
};
|
|
5143
|
-
var _hoisted_6$
|
|
5143
|
+
var _hoisted_6$8 = {
|
|
5144
5144
|
key: 0,
|
|
5145
5145
|
class: "flex shrink-0 items-center gap-2 self-center"
|
|
5146
5146
|
};
|
|
@@ -5193,8 +5193,8 @@ var Alert_default = /* @__PURE__ */ defineComponent({
|
|
|
5193
5193
|
class: normalizeClass(unref(calloutIcon)({ tone: props.tone })),
|
|
5194
5194
|
"aria-hidden": "true"
|
|
5195
5195
|
}, null, 8, ["class"])) : createCommentVNode("", true)]),
|
|
5196
|
-
createElementVNode("div", _hoisted_4$15, [props.title ? (openBlock(), createElementBlock("p", _hoisted_5$
|
|
5197
|
-
unref(slots).actions ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
5196
|
+
createElementVNode("div", _hoisted_4$15, [props.title ? (openBlock(), createElementBlock("p", _hoisted_5$11, toDisplayString(props.title), 1)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
|
|
5197
|
+
unref(slots).actions ? (openBlock(), createElementBlock("div", _hoisted_6$8, [renderSlot(_ctx.$slots, "actions")])) : createCommentVNode("", true),
|
|
5198
5198
|
props.closable ? (openBlock(), createBlock(CloseButton_default, {
|
|
5199
5199
|
key: 1,
|
|
5200
5200
|
size: "sm",
|
|
@@ -6739,13 +6739,13 @@ var _hoisted_3$18 = {
|
|
|
6739
6739
|
class: "text-muted block truncate text-xs"
|
|
6740
6740
|
};
|
|
6741
6741
|
var _hoisted_4$14 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
6742
|
-
var _hoisted_5$
|
|
6743
|
-
var _hoisted_6$
|
|
6744
|
-
var _hoisted_7$
|
|
6742
|
+
var _hoisted_5$10 = { class: "min-w-0 flex-1" };
|
|
6743
|
+
var _hoisted_6$7 = { class: "block truncate" };
|
|
6744
|
+
var _hoisted_7$5 = {
|
|
6745
6745
|
key: 0,
|
|
6746
6746
|
class: "text-muted block truncate text-xs"
|
|
6747
6747
|
};
|
|
6748
|
-
var _hoisted_8$
|
|
6748
|
+
var _hoisted_8$3 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
6749
6749
|
//#endregion
|
|
6750
6750
|
//#region src/components/select/SelectList.vue
|
|
6751
6751
|
var SelectList_default = /* @__PURE__ */ defineComponent({
|
|
@@ -6814,9 +6814,9 @@ var SelectList_default = /* @__PURE__ */ defineComponent({
|
|
|
6814
6814
|
class: normalizeClass(unref(selectItem)())
|
|
6815
6815
|
}, {
|
|
6816
6816
|
default: withCtx(() => [createVNode(unref(SelectItemText), { "as-child": "" }, {
|
|
6817
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_5$
|
|
6817
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_5$10, [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)])])]),
|
|
6818
6818
|
_: 2
|
|
6819
|
-
}, 1024), createElementVNode("span", _hoisted_8$
|
|
6819
|
+
}, 1024), createElementVNode("span", _hoisted_8$3, [createVNode(unref(SelectItemIndicator), null, {
|
|
6820
6820
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
6821
6821
|
_: 1
|
|
6822
6822
|
})])]),
|
|
@@ -7420,7 +7420,7 @@ var _hoisted_4$13 = [
|
|
|
7420
7420
|
"inert",
|
|
7421
7421
|
"data-disabled"
|
|
7422
7422
|
];
|
|
7423
|
-
var _hoisted_5$
|
|
7423
|
+
var _hoisted_5$9 = {
|
|
7424
7424
|
key: 1,
|
|
7425
7425
|
class: "flex max-w-full flex-wrap items-center gap-3"
|
|
7426
7426
|
};
|
|
@@ -7515,7 +7515,7 @@ var Pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
7515
7515
|
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "ellipsis", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
7516
7516
|
key: "1"
|
|
7517
7517
|
} : void 0]), 1024),
|
|
7518
|
-
props.pageSizeOptions?.length || props.showJump ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
7518
|
+
props.pageSizeOptions?.length || props.showJump ? (openBlock(), createElementBlock("div", _hoisted_5$9, [props.pageSizeOptions?.length ? (openBlock(), createBlock(PaginationSize_default, { key: 0 })) : createCommentVNode("", true), props.showJump ? (openBlock(), createBlock(PaginationJump_default, { key: 1 })) : createCommentVNode("", true)])) : createCommentVNode("", true)
|
|
7519
7519
|
])], 10, _hoisted_4$13)]),
|
|
7520
7520
|
_: 3
|
|
7521
7521
|
}, 8, [
|
|
@@ -8903,13 +8903,13 @@ var _hoisted_3$15 = {
|
|
|
8903
8903
|
class: "text-muted block truncate text-xs"
|
|
8904
8904
|
};
|
|
8905
8905
|
var _hoisted_4$11 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
8906
|
-
var _hoisted_5$
|
|
8907
|
-
var _hoisted_6$
|
|
8908
|
-
var _hoisted_7$
|
|
8906
|
+
var _hoisted_5$8 = { class: "min-w-0 flex-1" };
|
|
8907
|
+
var _hoisted_6$6 = { class: "block truncate" };
|
|
8908
|
+
var _hoisted_7$4 = {
|
|
8909
8909
|
key: 0,
|
|
8910
8910
|
class: "text-muted block truncate text-xs"
|
|
8911
8911
|
};
|
|
8912
|
-
var _hoisted_8$
|
|
8912
|
+
var _hoisted_8$2 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
8913
8913
|
//#endregion
|
|
8914
8914
|
//#region src/components/combobox/ComboboxList.vue
|
|
8915
8915
|
var ComboboxList_default = /* @__PURE__ */ defineComponent({
|
|
@@ -8974,7 +8974,7 @@ var ComboboxList_default = /* @__PURE__ */ defineComponent({
|
|
|
8974
8974
|
disabled: item.disabled,
|
|
8975
8975
|
class: normalizeClass(unref(selectItem)())
|
|
8976
8976
|
}, {
|
|
8977
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_5$
|
|
8977
|
+
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$2, [createVNode(unref(ComboboxItemIndicator), null, {
|
|
8978
8978
|
default: withCtx(() => [createVNode(unref(Check))]),
|
|
8979
8979
|
_: 1
|
|
8980
8980
|
})])]),
|
|
@@ -9195,7 +9195,7 @@ var _hoisted_1$66 = { class: "truncate" };
|
|
|
9195
9195
|
var _hoisted_2$31 = ["textContent"];
|
|
9196
9196
|
var _hoisted_3$14 = ["textContent"];
|
|
9197
9197
|
var _hoisted_4$10 = ["textContent"];
|
|
9198
|
-
var _hoisted_5$
|
|
9198
|
+
var _hoisted_5$7 = {
|
|
9199
9199
|
key: 0,
|
|
9200
9200
|
class: "text-muted truncate text-xs"
|
|
9201
9201
|
};
|
|
@@ -9247,7 +9247,7 @@ var CommandPaletteItem_default = /* @__PURE__ */ defineComponent({
|
|
|
9247
9247
|
key: 1,
|
|
9248
9248
|
textContent: toDisplayString(parts.value[2])
|
|
9249
9249
|
}, null, 8, _hoisted_4$10)) : createCommentVNode("", true)
|
|
9250
|
-
]), props.match.item.description ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
9250
|
+
]), props.match.item.description ? (openBlock(), createElementBlock("span", _hoisted_5$7, toDisplayString(props.match.item.description), 1)) : createCommentVNode("", true)], 2),
|
|
9251
9251
|
props.match.item.kbd?.length ? (openBlock(), createElementBlock("span", {
|
|
9252
9252
|
key: 1,
|
|
9253
9253
|
class: normalizeClass(unref(commandItemHint)())
|
|
@@ -9990,13 +9990,13 @@ var _hoisted_4$8 = {
|
|
|
9990
9990
|
key: 1,
|
|
9991
9991
|
class: "size-5 shrink-0"
|
|
9992
9992
|
};
|
|
9993
|
-
var _hoisted_5$
|
|
9994
|
-
var _hoisted_6$
|
|
9995
|
-
var _hoisted_7$
|
|
9993
|
+
var _hoisted_5$6 = { class: "min-w-0 flex-1" };
|
|
9994
|
+
var _hoisted_6$5 = { class: "block truncate" };
|
|
9995
|
+
var _hoisted_7$3 = {
|
|
9996
9996
|
key: 0,
|
|
9997
9997
|
class: "text-muted block truncate text-xs"
|
|
9998
9998
|
};
|
|
9999
|
-
var _hoisted_8 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
9999
|
+
var _hoisted_8$1 = { class: "flex size-4 shrink-0 items-center justify-center" };
|
|
10000
10000
|
var _hoisted_9 = { role: "status" };
|
|
10001
10001
|
//#endregion
|
|
10002
10002
|
//#region src/components/tree-select/TreeSelect.vue
|
|
@@ -10135,8 +10135,8 @@ var TreeSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
10135
10135
|
direction: "end",
|
|
10136
10136
|
open: isExpanded
|
|
10137
10137
|
}, null, 8, ["open"])], 10, _hoisted_3$12)) : (openBlock(), createElementBlock("span", _hoisted_4$8)),
|
|
10138
|
-
createElementVNode("span", _hoisted_5$
|
|
10139
|
-
createElementVNode("span", _hoisted_8, [isSelected ? (openBlock(), createBlock(unref(Check), { key: 0 })) : createCommentVNode("", true)])
|
|
10138
|
+
createElementVNode("span", _hoisted_5$6, [renderSlot(_ctx.$slots, "node", { node: item.value }, () => [createElementVNode("span", _hoisted_6$5, toDisplayString(item.value.label), 1), item.value.description ? (openBlock(), createElementBlock("span", _hoisted_7$3, toDisplayString(item.value.description), 1)) : createCommentVNode("", true)])]),
|
|
10139
|
+
createElementVNode("span", _hoisted_8$1, [isSelected ? (openBlock(), createBlock(unref(Check), { key: 0 })) : createCommentVNode("", true)])
|
|
10140
10140
|
]),
|
|
10141
10141
|
_: 2
|
|
10142
10142
|
}, 1040, [
|
|
@@ -14677,6 +14677,59 @@ var Popconfirm_default = /* @__PURE__ */ defineComponent({
|
|
|
14677
14677
|
}
|
|
14678
14678
|
});
|
|
14679
14679
|
//#endregion
|
|
14680
|
+
//#region src/lib/overlay-anchor.ts
|
|
14681
|
+
function overlayAnchorElement(anchor) {
|
|
14682
|
+
return anchor && "nodeType" in anchor ? anchor : void 0;
|
|
14683
|
+
}
|
|
14684
|
+
function overlayAnchorContext(anchor) {
|
|
14685
|
+
return overlayAnchorElement(anchor) ?? (anchor && "contextElement" in anchor ? anchor.contextElement : void 0);
|
|
14686
|
+
}
|
|
14687
|
+
function useOverlayAnchor(source, open, present, strategy) {
|
|
14688
|
+
const reference = shallowRef();
|
|
14689
|
+
let current;
|
|
14690
|
+
watch([
|
|
14691
|
+
source,
|
|
14692
|
+
open,
|
|
14693
|
+
present,
|
|
14694
|
+
strategy
|
|
14695
|
+
], ([anchor, active, mounted]) => {
|
|
14696
|
+
if (!mounted) {
|
|
14697
|
+
current = void 0;
|
|
14698
|
+
reference.value = void 0;
|
|
14699
|
+
return;
|
|
14700
|
+
}
|
|
14701
|
+
if (!anchor || !active && reference.value && anchor !== current) return;
|
|
14702
|
+
const contextElement = overlayAnchorContext(anchor);
|
|
14703
|
+
if (contextElement && !contextElement.isConnected) return;
|
|
14704
|
+
current = anchor;
|
|
14705
|
+
const measure = () => {
|
|
14706
|
+
const { x, y, width, height, top, right, bottom, left } = anchor.getBoundingClientRect();
|
|
14707
|
+
return {
|
|
14708
|
+
x,
|
|
14709
|
+
y,
|
|
14710
|
+
width,
|
|
14711
|
+
height,
|
|
14712
|
+
top,
|
|
14713
|
+
right,
|
|
14714
|
+
bottom,
|
|
14715
|
+
left
|
|
14716
|
+
};
|
|
14717
|
+
};
|
|
14718
|
+
let rect = measure();
|
|
14719
|
+
reference.value = {
|
|
14720
|
+
contextElement,
|
|
14721
|
+
getBoundingClientRect: () => {
|
|
14722
|
+
if (source() === anchor && (!contextElement || contextElement.isConnected)) rect = measure();
|
|
14723
|
+
return rect;
|
|
14724
|
+
}
|
|
14725
|
+
};
|
|
14726
|
+
}, {
|
|
14727
|
+
immediate: true,
|
|
14728
|
+
flush: "post"
|
|
14729
|
+
});
|
|
14730
|
+
return reference;
|
|
14731
|
+
}
|
|
14732
|
+
//#endregion
|
|
14680
14733
|
//#region src/lib/overlay-positioner.ts
|
|
14681
14734
|
function useOverlayPositionerClass(content, className) {
|
|
14682
14735
|
watchEffect((onCleanup) => {
|
|
@@ -14698,12 +14751,12 @@ function useHoverCardAnchor(props) {
|
|
|
14698
14751
|
onDismiss: root.onDismiss
|
|
14699
14752
|
};
|
|
14700
14753
|
const anchor = computed(() => props.external ? props.anchor ?? void 0 : void 0);
|
|
14754
|
+
const element = computed(() => overlayAnchorElement(anchor.value));
|
|
14755
|
+
const virtual = computed(() => !!anchor.value && !element.value);
|
|
14701
14756
|
const { content, present } = useOverlayPortal(root.open);
|
|
14702
14757
|
useOverlayPositionerClass(content, () => props.positionerClass);
|
|
14703
14758
|
const panel = computed(() => props.external ? content.value?.$el : void 0);
|
|
14704
|
-
const
|
|
14705
|
-
const retained = shallowRef();
|
|
14706
|
-
const reference = computed(() => props.external ? liveAnchor.value ?? retained.value : void 0);
|
|
14759
|
+
const reference = useOverlayAnchor(() => props.external ? anchor.value : root.triggerElement.value, root.open, present, () => props.updatePositionStrategy);
|
|
14707
14760
|
let timer;
|
|
14708
14761
|
let tracking = false;
|
|
14709
14762
|
function cancel() {
|
|
@@ -14716,7 +14769,7 @@ function useHoverCardAnchor(props) {
|
|
|
14716
14769
|
root.onOpenChange(false);
|
|
14717
14770
|
}
|
|
14718
14771
|
function close() {
|
|
14719
|
-
if (timer !== void 0 || !root.open.value || root.hasSelectionRef.value || root.isPointerDownOnContentRef.value) return;
|
|
14772
|
+
if (virtual.value || timer !== void 0 || !root.open.value || root.hasSelectionRef.value || root.isPointerDownOnContentRef.value) return;
|
|
14720
14773
|
timer = setTimeout(dismiss, props.closeDelay);
|
|
14721
14774
|
}
|
|
14722
14775
|
function keep() {
|
|
@@ -14727,8 +14780,8 @@ function useHoverCardAnchor(props) {
|
|
|
14727
14780
|
const pointer = event;
|
|
14728
14781
|
if (!root.open.value || !tracking || pointer.pointerType === "touch") return;
|
|
14729
14782
|
const target = pointer.target;
|
|
14730
|
-
if (target && (
|
|
14731
|
-
const a =
|
|
14783
|
+
if (target && (element.value?.contains(target) || panel.value?.contains(target))) return keep();
|
|
14784
|
+
const a = element.value?.getBoundingClientRect();
|
|
14732
14785
|
const b = panel.value?.getBoundingClientRect();
|
|
14733
14786
|
if (a && b && inPointerCorridor({
|
|
14734
14787
|
x: pointer.clientX,
|
|
@@ -14738,9 +14791,9 @@ function useHoverCardAnchor(props) {
|
|
|
14738
14791
|
}
|
|
14739
14792
|
function leave(event) {
|
|
14740
14793
|
const pointer = event;
|
|
14741
|
-
if (pointer.pointerType === "touch" || !root.open.value) return;
|
|
14794
|
+
if (virtual.value || pointer.pointerType === "touch" || !root.open.value) return;
|
|
14742
14795
|
tracking = true;
|
|
14743
|
-
const a =
|
|
14796
|
+
const a = element.value?.getBoundingClientRect();
|
|
14744
14797
|
const b = panel.value?.getBoundingClientRect();
|
|
14745
14798
|
if (a && b && inPointerCorridor({
|
|
14746
14799
|
x: pointer.clientX,
|
|
@@ -14749,19 +14802,11 @@ function useHoverCardAnchor(props) {
|
|
|
14749
14802
|
else close();
|
|
14750
14803
|
}
|
|
14751
14804
|
function measure() {
|
|
14752
|
-
|
|
14753
|
-
if (!element?.isConnected) {
|
|
14754
|
-
liveAnchor.value = void 0;
|
|
14805
|
+
if (!anchor.value || element.value && !element.value.isConnected) {
|
|
14755
14806
|
if (root.open.value) dismiss();
|
|
14756
14807
|
return;
|
|
14757
14808
|
}
|
|
14758
|
-
|
|
14759
|
-
const rect = element.getBoundingClientRect();
|
|
14760
|
-
const previous = retained.value?.getBoundingClientRect();
|
|
14761
|
-
if (!previous || retained.value?.contextElement !== element || rect.x !== previous.x || rect.y !== previous.y || rect.width !== previous.width || rect.height !== previous.height) retained.value = {
|
|
14762
|
-
getBoundingClientRect: () => rect,
|
|
14763
|
-
contextElement: element
|
|
14764
|
-
};
|
|
14809
|
+
reference.value?.getBoundingClientRect();
|
|
14765
14810
|
}
|
|
14766
14811
|
const { pause, resume } = useRafFn(measure, { immediate: false });
|
|
14767
14812
|
root.onOpen = () => props.external ? keep() : original.onOpen();
|
|
@@ -14775,32 +14820,29 @@ function useHoverCardAnchor(props) {
|
|
|
14775
14820
|
cancel();
|
|
14776
14821
|
tracking = false;
|
|
14777
14822
|
pause();
|
|
14778
|
-
if (!props.external || !mounted)
|
|
14779
|
-
liveAnchor.value = void 0;
|
|
14780
|
-
return;
|
|
14781
|
-
}
|
|
14823
|
+
if (!props.external || !mounted) return;
|
|
14782
14824
|
if (element !== previous?.[0]) {
|
|
14783
14825
|
root.hasSelectionRef.value = false;
|
|
14784
14826
|
root.isPointerDownOnContentRef.value = false;
|
|
14785
14827
|
}
|
|
14786
14828
|
measure();
|
|
14787
|
-
resume();
|
|
14829
|
+
if (!virtual.value) resume();
|
|
14788
14830
|
}, {
|
|
14789
14831
|
immediate: true,
|
|
14790
14832
|
flush: "post"
|
|
14791
14833
|
});
|
|
14792
|
-
useEventListener(
|
|
14793
|
-
useEventListener(
|
|
14794
|
-
useEventListener(
|
|
14795
|
-
useEventListener(
|
|
14834
|
+
useEventListener(element, "pointerenter", keep);
|
|
14835
|
+
useEventListener(element, "pointerleave", leave);
|
|
14836
|
+
useEventListener(element, "focusin", keep);
|
|
14837
|
+
useEventListener(element, "focusout", (event) => {
|
|
14796
14838
|
const target = event.relatedTarget;
|
|
14797
|
-
if (!target || !
|
|
14839
|
+
if (!target || !element.value?.contains(target) && !panel.value?.contains(target)) close();
|
|
14798
14840
|
});
|
|
14799
14841
|
useEventListener(panel, "pointerenter", keep);
|
|
14800
14842
|
useEventListener(panel, "pointerleave", leave);
|
|
14801
|
-
useEventListener(() =>
|
|
14802
|
-
useEventListener(() =>
|
|
14803
|
-
if (root.open.value && event.target?.contains(
|
|
14843
|
+
useEventListener(() => element.value?.ownerDocument, "pointermove", track);
|
|
14844
|
+
useEventListener(() => element.value?.ownerDocument, "scroll", (event) => {
|
|
14845
|
+
if (root.open.value && event.target?.contains(element.value ?? null)) dismiss();
|
|
14804
14846
|
}, {
|
|
14805
14847
|
capture: true,
|
|
14806
14848
|
passive: true
|
|
@@ -14811,7 +14853,6 @@ function useHoverCardAnchor(props) {
|
|
|
14811
14853
|
});
|
|
14812
14854
|
function contentRef(value) {
|
|
14813
14855
|
content.value = value;
|
|
14814
|
-
if (!value && !root.open.value) retained.value = void 0;
|
|
14815
14856
|
}
|
|
14816
14857
|
return {
|
|
14817
14858
|
reference,
|
|
@@ -14826,6 +14867,7 @@ var HoverCardAnchor_default = /* @__PURE__ */ defineComponent({
|
|
|
14826
14867
|
__name: "HoverCardAnchor",
|
|
14827
14868
|
props: {
|
|
14828
14869
|
anchor: {},
|
|
14870
|
+
updatePositionStrategy: {},
|
|
14829
14871
|
external: { type: Boolean },
|
|
14830
14872
|
closeDelay: {},
|
|
14831
14873
|
positionerClass: {}
|
|
@@ -14848,6 +14890,7 @@ var HoverCard_default = /* @__PURE__ */ defineComponent({
|
|
|
14848
14890
|
__name: "HoverCard",
|
|
14849
14891
|
props: /*@__PURE__*/ mergeModels({
|
|
14850
14892
|
anchor: {},
|
|
14893
|
+
updatePositionStrategy: { default: "optimized" },
|
|
14851
14894
|
side: { default: "bottom" },
|
|
14852
14895
|
align: { default: "center" },
|
|
14853
14896
|
sideOffset: { default: 8 },
|
|
@@ -14882,6 +14925,7 @@ var HoverCard_default = /* @__PURE__ */ defineComponent({
|
|
|
14882
14925
|
_: 3
|
|
14883
14926
|
})) : createCommentVNode("", true), createVNode(HoverCardAnchor_default, {
|
|
14884
14927
|
anchor: props.anchor,
|
|
14928
|
+
"update-position-strategy": props.updatePositionStrategy,
|
|
14885
14929
|
external: !_ctx.$slots.default,
|
|
14886
14930
|
"close-delay": props.closeDelay,
|
|
14887
14931
|
"positioner-class": props.positionerClass
|
|
@@ -14889,6 +14933,7 @@ var HoverCard_default = /* @__PURE__ */ defineComponent({
|
|
|
14889
14933
|
default: withCtx(({ reference, contentRef, present }) => [present ? (openBlock(), createBlock(unref(HoverCardPortal), { key: 0 }, {
|
|
14890
14934
|
default: withCtx(() => [createVNode(unref(HoverCardContent), {
|
|
14891
14935
|
reference,
|
|
14936
|
+
"update-position-strategy": props.updatePositionStrategy,
|
|
14892
14937
|
"as-child": "",
|
|
14893
14938
|
side: props.side,
|
|
14894
14939
|
align: props.align,
|
|
@@ -14911,6 +14956,7 @@ var HoverCard_default = /* @__PURE__ */ defineComponent({
|
|
|
14911
14956
|
_: 2
|
|
14912
14957
|
}, 1032, [
|
|
14913
14958
|
"reference",
|
|
14959
|
+
"update-position-strategy",
|
|
14914
14960
|
"side",
|
|
14915
14961
|
"align",
|
|
14916
14962
|
"side-offset"
|
|
@@ -14920,6 +14966,7 @@ var HoverCard_default = /* @__PURE__ */ defineComponent({
|
|
|
14920
14966
|
_: 3
|
|
14921
14967
|
}, 8, [
|
|
14922
14968
|
"anchor",
|
|
14969
|
+
"update-position-strategy",
|
|
14923
14970
|
"external",
|
|
14924
14971
|
"close-delay",
|
|
14925
14972
|
"positioner-class"
|
|
@@ -15260,6 +15307,15 @@ var ContextMenuRadioItem_default = /* @__PURE__ */ defineComponent({
|
|
|
15260
15307
|
}
|
|
15261
15308
|
});
|
|
15262
15309
|
//#endregion
|
|
15310
|
+
//#region src/lib/scroll-viewport.ts
|
|
15311
|
+
function useScrollViewport() {
|
|
15312
|
+
const scrollArea = shallowRef(null);
|
|
15313
|
+
return {
|
|
15314
|
+
scrollArea,
|
|
15315
|
+
viewport: computed(() => scrollArea.value?.viewport)
|
|
15316
|
+
};
|
|
15317
|
+
}
|
|
15318
|
+
//#endregion
|
|
15263
15319
|
//#region src/components/sheet/composables/useDragToDismiss.ts
|
|
15264
15320
|
var DISTANCE_RATIO = .3;
|
|
15265
15321
|
var FLICK_VELOCITY = .6;
|
|
@@ -15315,23 +15371,63 @@ function useDragToDismiss(panel, options) {
|
|
|
15315
15371
|
}
|
|
15316
15372
|
//#endregion
|
|
15317
15373
|
//#region src/components/sheet/sheet.variants.ts
|
|
15318
|
-
var sheetPanel = tv({
|
|
15319
|
-
|
|
15320
|
-
|
|
15321
|
-
|
|
15322
|
-
|
|
15323
|
-
|
|
15324
|
-
]
|
|
15325
|
-
|
|
15326
|
-
|
|
15374
|
+
var sheetPanel = tv({
|
|
15375
|
+
base: [
|
|
15376
|
+
"hn-anim-sheet-bottom hn-transition pointer-events-auto fixed inset-x-0 bottom-0 z-(--hn-z-overlay)",
|
|
15377
|
+
"mx-auto flex max-h-[calc(100dvh-3rem)] w-full flex-col sm:max-w-xl",
|
|
15378
|
+
"rounded-t-xl rounded-b-none border-b-0 shadow-lg outline-none",
|
|
15379
|
+
"data-dragging:transition-none"
|
|
15380
|
+
],
|
|
15381
|
+
variants: {
|
|
15382
|
+
padded: { true: "gap-4 pb-[max(var(--hn-panel-p),env(safe-area-inset-bottom))]" },
|
|
15383
|
+
grip: {
|
|
15384
|
+
true: "",
|
|
15385
|
+
false: ""
|
|
15386
|
+
}
|
|
15387
|
+
},
|
|
15388
|
+
compoundVariants: [{
|
|
15389
|
+
padded: true,
|
|
15390
|
+
grip: true,
|
|
15391
|
+
class: "pt-2"
|
|
15392
|
+
}, {
|
|
15393
|
+
padded: true,
|
|
15394
|
+
grip: false,
|
|
15395
|
+
class: "pt-(--hn-panel-p)"
|
|
15396
|
+
}],
|
|
15397
|
+
defaultVariants: {
|
|
15398
|
+
grip: true,
|
|
15399
|
+
padded: true
|
|
15400
|
+
}
|
|
15401
|
+
});
|
|
15402
|
+
var sheetGrip = tv({
|
|
15403
|
+
base: "flex shrink-0 cursor-grab touch-none flex-col select-none data-dragging:cursor-grabbing",
|
|
15404
|
+
variants: { standalone: { true: "py-2" } }
|
|
15405
|
+
});
|
|
15406
|
+
var sheetHandle = tv({
|
|
15407
|
+
base: "bg-line-strong hn-transition-base mx-auto h-1.5 w-10 rounded-full data-disabled:opacity-50",
|
|
15408
|
+
variants: { header: {
|
|
15409
|
+
true: "mb-3",
|
|
15410
|
+
false: ""
|
|
15411
|
+
} },
|
|
15412
|
+
defaultVariants: { header: true }
|
|
15413
|
+
});
|
|
15327
15414
|
//#endregion
|
|
15328
15415
|
//#region src/components/sheet/Sheet.vue?vue&type=script&setup=true&lang.ts
|
|
15329
15416
|
var _hoisted_1$40 = ["data-dragging"];
|
|
15330
15417
|
var _hoisted_2$21 = ["data-disabled"];
|
|
15331
|
-
var _hoisted_3$9 = {
|
|
15418
|
+
var _hoisted_3$9 = {
|
|
15419
|
+
key: 1,
|
|
15420
|
+
class: "flex items-start justify-between gap-4 px-(--hn-panel-p)"
|
|
15421
|
+
};
|
|
15332
15422
|
var _hoisted_4$7 = { class: "flex min-w-0 flex-col gap-1.5" };
|
|
15333
|
-
var _hoisted_5$
|
|
15334
|
-
var _hoisted_6$
|
|
15423
|
+
var _hoisted_5$5 = { class: "flex min-w-0 items-center gap-2" };
|
|
15424
|
+
var _hoisted_6$4 = {
|
|
15425
|
+
key: 0,
|
|
15426
|
+
class: "text-muted flex shrink-0 [&_svg]:size-5",
|
|
15427
|
+
"aria-hidden": "true"
|
|
15428
|
+
};
|
|
15429
|
+
var _hoisted_7$2 = { class: "px-(--hn-panel-p) py-1" };
|
|
15430
|
+
var _hoisted_8 = {
|
|
15335
15431
|
key: 1,
|
|
15336
15432
|
class: "flex shrink-0 justify-end gap-(--hn-inline-gap) px-(--hn-panel-p)"
|
|
15337
15433
|
};
|
|
@@ -15343,6 +15439,14 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
15343
15439
|
props: /*@__PURE__*/ mergeModels({
|
|
15344
15440
|
title: {},
|
|
15345
15441
|
description: {},
|
|
15442
|
+
header: {
|
|
15443
|
+
type: Boolean,
|
|
15444
|
+
default: true
|
|
15445
|
+
},
|
|
15446
|
+
closable: {
|
|
15447
|
+
type: Boolean,
|
|
15448
|
+
default: true
|
|
15449
|
+
},
|
|
15346
15450
|
handle: {
|
|
15347
15451
|
type: Boolean,
|
|
15348
15452
|
default: true
|
|
@@ -15357,11 +15461,13 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
15357
15461
|
"openModifiers": {}
|
|
15358
15462
|
}),
|
|
15359
15463
|
emits: ["update:open"],
|
|
15360
|
-
setup(__props) {
|
|
15464
|
+
setup(__props, { expose: __expose }) {
|
|
15361
15465
|
const props = __props;
|
|
15466
|
+
const slots = useSlots();
|
|
15467
|
+
const { scrollArea, viewport } = useScrollViewport();
|
|
15468
|
+
__expose({ viewport });
|
|
15362
15469
|
const open = useModel(__props, "open");
|
|
15363
|
-
|
|
15364
|
-
const panel = shallowRef(null);
|
|
15470
|
+
const { content: panel, present } = useOverlayPortal(open);
|
|
15365
15471
|
const { dragging, offset, onPointerDown } = useDragToDismiss(() => panel.value?.$el ?? null, {
|
|
15366
15472
|
enabled: () => !props.locked,
|
|
15367
15473
|
open,
|
|
@@ -15388,42 +15494,64 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
15388
15494
|
}, {
|
|
15389
15495
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
15390
15496
|
_: 3
|
|
15391
|
-
})) : createCommentVNode("", true),
|
|
15497
|
+
})) : createCommentVNode("", true), unref(present) ? (openBlock(), createBlock(unref(DialogPortal), { key: 1 }, {
|
|
15392
15498
|
default: withCtx(() => [createVNode(unref(DialogOverlay), { class: "hn-scrim" }), createVNode(unref(DialogContent), {
|
|
15393
15499
|
"as-child": "",
|
|
15394
15500
|
onEscapeKeyDown: guard,
|
|
15395
15501
|
onInteractOutside: guard
|
|
15396
15502
|
}, {
|
|
15397
|
-
default: withCtx(() => [createVNode(Card_default, {
|
|
15503
|
+
default: withCtx(() => [createVNode(Card_default, mergeProps({
|
|
15398
15504
|
ref_key: "panel",
|
|
15399
|
-
ref: panel
|
|
15505
|
+
ref: panel
|
|
15506
|
+
}, props.description ? {} : { "aria-describedby": void 0 }, {
|
|
15400
15507
|
"data-hn-sheet": "",
|
|
15401
15508
|
"data-dragging": unref(dragging) ? "" : void 0,
|
|
15402
15509
|
padded: false,
|
|
15403
|
-
style:
|
|
15404
|
-
class:
|
|
15405
|
-
|
|
15510
|
+
style: style.value,
|
|
15511
|
+
class: unref(cn)(unref(sheetPanel)({
|
|
15512
|
+
grip: props.header || props.handle,
|
|
15513
|
+
padded: !slots.body
|
|
15514
|
+
}), props.class)
|
|
15515
|
+
}), {
|
|
15406
15516
|
default: withCtx(() => [
|
|
15407
|
-
|
|
15517
|
+
!props.header || slots.body ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
15518
|
+
default: withCtx(() => [createVNode(Heading_default, {
|
|
15519
|
+
level: 2,
|
|
15520
|
+
class: "sr-only"
|
|
15521
|
+
}, {
|
|
15522
|
+
default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
|
|
15523
|
+
_: 1
|
|
15524
|
+
})]),
|
|
15525
|
+
_: 1
|
|
15526
|
+
}), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
15527
|
+
key: 0,
|
|
15528
|
+
class: "sr-only"
|
|
15529
|
+
}, {
|
|
15530
|
+
default: withCtx(() => [createTextVNode(toDisplayString(props.description), 1)]),
|
|
15531
|
+
_: 1
|
|
15532
|
+
})) : createCommentVNode("", true)], 64)) : createCommentVNode("", true),
|
|
15533
|
+
props.handle || props.header && !slots.body ? (openBlock(), createElementBlock("div", {
|
|
15534
|
+
key: 1,
|
|
15408
15535
|
"data-hn-sheet-grip": "",
|
|
15409
15536
|
"data-dragging": unref(dragging) ? "" : void 0,
|
|
15410
|
-
class: normalizeClass(unref(sheetGrip)()),
|
|
15537
|
+
class: normalizeClass(unref(sheetGrip)({ standalone: !!slots.body })),
|
|
15411
15538
|
onPointerdown: _cache[0] || (_cache[0] = (...args) => unref(onPointerDown) && unref(onPointerDown)(...args))
|
|
15412
15539
|
}, [props.handle ? (openBlock(), createElementBlock("div", {
|
|
15413
15540
|
key: 0,
|
|
15414
15541
|
"aria-hidden": "true",
|
|
15415
15542
|
"data-disabled": props.locked ? "" : void 0,
|
|
15416
|
-
class: normalizeClass(unref(sheetHandle)())
|
|
15417
|
-
}, null, 10, _hoisted_2$21)) : createCommentVNode("", true),
|
|
15543
|
+
class: normalizeClass(unref(sheetHandle)({ header: props.header && !slots.body }))
|
|
15544
|
+
}, null, 10, _hoisted_2$21)) : createCommentVNode("", true), props.header && !slots.body ? (openBlock(), createElementBlock("div", _hoisted_3$9, [createElementVNode("div", _hoisted_4$7, [createElementVNode("div", _hoisted_5$5, [slots.icon ? (openBlock(), createElementBlock("span", _hoisted_6$4, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("", true), createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
15418
15545
|
default: withCtx(() => [createVNode(Heading_default, {
|
|
15419
15546
|
level: 2,
|
|
15420
|
-
size: "lg"
|
|
15547
|
+
size: "lg",
|
|
15548
|
+
class: "min-w-0"
|
|
15421
15549
|
}, {
|
|
15422
|
-
default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
|
|
15423
|
-
_:
|
|
15550
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(props.title), 1)])]),
|
|
15551
|
+
_: 3
|
|
15424
15552
|
})]),
|
|
15425
|
-
_:
|
|
15426
|
-
}), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
15553
|
+
_: 3
|
|
15554
|
+
})]), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
15427
15555
|
key: 0,
|
|
15428
15556
|
"as-child": ""
|
|
15429
15557
|
}, {
|
|
@@ -15432,7 +15560,7 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
15432
15560
|
_: 1
|
|
15433
15561
|
})]),
|
|
15434
15562
|
_: 1
|
|
15435
|
-
})) : createCommentVNode("", true)]), !props.handle ? (openBlock(), createBlock(unref(DialogClose), {
|
|
15563
|
+
})) : createCommentVNode("", true)]), !props.handle && props.closable ? (openBlock(), createBlock(unref(DialogClose), {
|
|
15436
15564
|
key: 0,
|
|
15437
15565
|
"as-child": ""
|
|
15438
15566
|
}, {
|
|
@@ -15441,18 +15569,19 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
15441
15569
|
class: "-mt-1.5 -me-1.5 shrink-0"
|
|
15442
15570
|
}, null, 8, ["disabled"])]),
|
|
15443
15571
|
_: 1
|
|
15444
|
-
})) : createCommentVNode("", true)])], 42, _hoisted_1$40),
|
|
15445
|
-
_ctx.$slots.content ? (openBlock(), createBlock(ScrollArea_default, {
|
|
15572
|
+
})) : createCommentVNode("", true)])) : createCommentVNode("", true)], 42, _hoisted_1$40)) : createCommentVNode("", true),
|
|
15573
|
+
slots.body ? renderSlot(_ctx.$slots, "body", { close }, void 0, void 0, 2) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [_ctx.$slots.content ? (openBlock(), createBlock(ScrollArea_default, {
|
|
15446
15574
|
key: 0,
|
|
15575
|
+
ref_key: "scrollArea",
|
|
15576
|
+
ref: scrollArea,
|
|
15447
15577
|
class: "min-h-0 grow"
|
|
15448
15578
|
}, {
|
|
15449
|
-
default: withCtx(() => [createElementVNode("div",
|
|
15579
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_7$2, [renderSlot(_ctx.$slots, "content", { close })])]),
|
|
15450
15580
|
_: 3
|
|
15451
|
-
})) : createCommentVNode("", true),
|
|
15452
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$3, [renderSlot(_ctx.$slots, "footer", { close })])) : createCommentVNode("", true)
|
|
15581
|
+
}, 512)) : createCommentVNode("", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_8, [renderSlot(_ctx.$slots, "footer", { close })])) : createCommentVNode("", true)], 64))
|
|
15453
15582
|
]),
|
|
15454
15583
|
_: 3
|
|
15455
|
-
},
|
|
15584
|
+
}, 16, [
|
|
15456
15585
|
"data-dragging",
|
|
15457
15586
|
"style",
|
|
15458
15587
|
"class"
|
|
@@ -15460,7 +15589,7 @@ var Sheet_default = /* @__PURE__ */ defineComponent({
|
|
|
15460
15589
|
_: 3
|
|
15461
15590
|
})]),
|
|
15462
15591
|
_: 3
|
|
15463
|
-
})]),
|
|
15592
|
+
})) : createCommentVNode("", true)]),
|
|
15464
15593
|
_: 3
|
|
15465
15594
|
}, 8, ["open"]);
|
|
15466
15595
|
};
|
|
@@ -17094,12 +17223,12 @@ var _hoisted_1$26 = [
|
|
|
17094
17223
|
var _hoisted_2$15 = ["id", "for"];
|
|
17095
17224
|
var _hoisted_3$7 = ["id"];
|
|
17096
17225
|
var _hoisted_4$5 = ["id"];
|
|
17097
|
-
var _hoisted_5$
|
|
17226
|
+
var _hoisted_5$4 = {
|
|
17098
17227
|
key: 0,
|
|
17099
17228
|
"data-hn-form-field-message": "",
|
|
17100
17229
|
class: "hn-collapse [--hn-collapse-out:var(--hn-duration-fast)]"
|
|
17101
17230
|
};
|
|
17102
|
-
var _hoisted_6$
|
|
17231
|
+
var _hoisted_6$3 = { class: "hn-collapse-body" };
|
|
17103
17232
|
var _hoisted_7$1 = ["id"];
|
|
17104
17233
|
//#endregion
|
|
17105
17234
|
//#region src/components/form-field/FormField.vue
|
|
@@ -17217,7 +17346,7 @@ var FormField_default = /* @__PURE__ */ defineComponent({
|
|
|
17217
17346
|
"leave-from-class": "hn-collapse-open",
|
|
17218
17347
|
"leave-to-class": "hn-collapse-closed"
|
|
17219
17348
|
}, toHandlers(unref(hooks))), {
|
|
17220
|
-
default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
17349
|
+
default: withCtx(() => [message.value ? (openBlock(), createElementBlock("div", _hoisted_5$4, [createElementVNode("div", _hoisted_6$3, [createElementVNode("p", {
|
|
17221
17350
|
id: unref(messageId),
|
|
17222
17351
|
class: normalizeClass(unref(formFieldMessage)()),
|
|
17223
17352
|
"aria-live": "polite"
|
|
@@ -19012,8 +19141,9 @@ var TooltipProvider_default = /* @__PURE__ */ defineComponent({
|
|
|
19012
19141
|
//#endregion
|
|
19013
19142
|
//#region src/components/drawer/drawer.variants.ts
|
|
19014
19143
|
var drawerCard = tv({
|
|
19015
|
-
base: "",
|
|
19144
|
+
base: ["hn-anim-drawer pointer-events-auto fixed inset-y-0 z-(--hn-z-overlay) flex flex-col", "max-w-[calc(100vw-3rem)] rounded-none shadow-lg outline-none"],
|
|
19016
19145
|
variants: {
|
|
19146
|
+
padded: { true: "gap-4 py-(--hn-panel-p)" },
|
|
19017
19147
|
side: {
|
|
19018
19148
|
start: "start-0",
|
|
19019
19149
|
end: "end-0"
|
|
@@ -19026,16 +19156,26 @@ var drawerCard = tv({
|
|
|
19026
19156
|
},
|
|
19027
19157
|
defaultVariants: {
|
|
19028
19158
|
side: "end",
|
|
19029
|
-
size: "md"
|
|
19159
|
+
size: "md",
|
|
19160
|
+
padded: true
|
|
19030
19161
|
}
|
|
19031
19162
|
});
|
|
19032
19163
|
//#endregion
|
|
19033
19164
|
//#region src/components/drawer/Drawer.vue?vue&type=script&setup=true&lang.ts
|
|
19034
|
-
var _hoisted_1$15 = {
|
|
19165
|
+
var _hoisted_1$15 = {
|
|
19166
|
+
key: 0,
|
|
19167
|
+
class: "flex shrink-0 items-start justify-between gap-4 px-(--hn-panel-p)"
|
|
19168
|
+
};
|
|
19035
19169
|
var _hoisted_2$11 = { class: "flex min-w-0 flex-col gap-1.5" };
|
|
19036
|
-
var _hoisted_3$5 = { class: "
|
|
19170
|
+
var _hoisted_3$5 = { class: "flex min-w-0 items-center gap-2" };
|
|
19037
19171
|
var _hoisted_4$3 = {
|
|
19038
|
-
key:
|
|
19172
|
+
key: 0,
|
|
19173
|
+
class: "text-muted flex shrink-0 [&_svg]:size-5",
|
|
19174
|
+
"aria-hidden": "true"
|
|
19175
|
+
};
|
|
19176
|
+
var _hoisted_5$3 = { class: "px-(--hn-panel-p) py-1" };
|
|
19177
|
+
var _hoisted_6$2 = {
|
|
19178
|
+
key: 2,
|
|
19039
19179
|
class: "flex shrink-0 justify-end gap-(--hn-inline-gap) px-(--hn-panel-p)"
|
|
19040
19180
|
};
|
|
19041
19181
|
//#endregion
|
|
@@ -19048,6 +19188,14 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
19048
19188
|
description: {},
|
|
19049
19189
|
side: { default: "end" },
|
|
19050
19190
|
size: { default: "md" },
|
|
19191
|
+
header: {
|
|
19192
|
+
type: Boolean,
|
|
19193
|
+
default: true
|
|
19194
|
+
},
|
|
19195
|
+
closable: {
|
|
19196
|
+
type: Boolean,
|
|
19197
|
+
default: true
|
|
19198
|
+
},
|
|
19051
19199
|
locked: {
|
|
19052
19200
|
type: Boolean,
|
|
19053
19201
|
default: false
|
|
@@ -19058,13 +19206,16 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
19058
19206
|
"openModifiers": {}
|
|
19059
19207
|
}),
|
|
19060
19208
|
emits: ["update:open"],
|
|
19061
|
-
setup(__props) {
|
|
19209
|
+
setup(__props, { expose: __expose }) {
|
|
19062
19210
|
const props = __props;
|
|
19211
|
+
const slots = useSlots();
|
|
19063
19212
|
function guard(e) {
|
|
19064
19213
|
if (props.locked) e.preventDefault();
|
|
19065
19214
|
}
|
|
19215
|
+
const { scrollArea, viewport } = useScrollViewport();
|
|
19216
|
+
__expose({ viewport });
|
|
19066
19217
|
const open = useModel(__props, "open");
|
|
19067
|
-
|
|
19218
|
+
const { content, present } = useOverlayPortal(open);
|
|
19068
19219
|
function close() {
|
|
19069
19220
|
open.value = false;
|
|
19070
19221
|
}
|
|
@@ -19079,31 +19230,51 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
19079
19230
|
}, {
|
|
19080
19231
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
19081
19232
|
_: 3
|
|
19082
|
-
})) : createCommentVNode("", true),
|
|
19233
|
+
})) : createCommentVNode("", true), unref(present) ? (openBlock(), createBlock(unref(DialogPortal), { key: 1 }, {
|
|
19083
19234
|
default: withCtx(() => [createVNode(unref(DialogOverlay), { class: "hn-scrim" }), createVNode(unref(DialogContent), {
|
|
19084
19235
|
"as-child": "",
|
|
19085
19236
|
onEscapeKeyDown: guard,
|
|
19086
19237
|
onInteractOutside: guard
|
|
19087
19238
|
}, {
|
|
19088
|
-
default: withCtx(() => [createVNode(Card_default, {
|
|
19239
|
+
default: withCtx(() => [createVNode(Card_default, mergeProps({
|
|
19240
|
+
ref_key: "content",
|
|
19241
|
+
ref: content
|
|
19242
|
+
}, props.description ? {} : { "aria-describedby": void 0 }, {
|
|
19089
19243
|
"data-hn-side": props.side,
|
|
19090
19244
|
padded: false,
|
|
19091
|
-
class:
|
|
19245
|
+
class: unref(cn)(unref(drawerCard)({
|
|
19092
19246
|
side: props.side,
|
|
19093
|
-
size: props.size
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19247
|
+
size: props.size,
|
|
19248
|
+
padded: !slots.body
|
|
19249
|
+
}), props.class)
|
|
19250
|
+
}), {
|
|
19251
|
+
default: withCtx(() => [!props.header || slots.body ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
19252
|
+
default: withCtx(() => [createVNode(Heading_default, {
|
|
19253
|
+
level: 2,
|
|
19254
|
+
class: "sr-only"
|
|
19255
|
+
}, {
|
|
19256
|
+
default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
|
|
19257
|
+
_: 1
|
|
19258
|
+
})]),
|
|
19259
|
+
_: 1
|
|
19260
|
+
}), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
19261
|
+
key: 0,
|
|
19262
|
+
class: "sr-only"
|
|
19263
|
+
}, {
|
|
19264
|
+
default: withCtx(() => [createTextVNode(toDisplayString(props.description), 1)]),
|
|
19265
|
+
_: 1
|
|
19266
|
+
})) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), slots.body ? renderSlot(_ctx.$slots, "body", { close }, void 0, void 0, 1) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
19267
|
+
props.header ? (openBlock(), createElementBlock("div", _hoisted_1$15, [createElementVNode("div", _hoisted_2$11, [createElementVNode("div", _hoisted_3$5, [slots.icon ? (openBlock(), createElementBlock("span", _hoisted_4$3, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("", true), createVNode(unref(DialogTitle), { "as-child": "" }, {
|
|
19098
19268
|
default: withCtx(() => [createVNode(Heading_default, {
|
|
19099
19269
|
level: 2,
|
|
19100
|
-
size: "lg"
|
|
19270
|
+
size: "lg",
|
|
19271
|
+
class: "min-w-0"
|
|
19101
19272
|
}, {
|
|
19102
|
-
default: withCtx(() => [createTextVNode(toDisplayString(props.title), 1)]),
|
|
19103
|
-
_:
|
|
19273
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(props.title), 1)])]),
|
|
19274
|
+
_: 3
|
|
19104
19275
|
})]),
|
|
19105
|
-
_:
|
|
19106
|
-
}), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
19276
|
+
_: 3
|
|
19277
|
+
})]), props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
19107
19278
|
key: 0,
|
|
19108
19279
|
"as-child": ""
|
|
19109
19280
|
}, {
|
|
@@ -19112,28 +19283,33 @@ var Drawer_default = /* @__PURE__ */ defineComponent({
|
|
|
19112
19283
|
_: 1
|
|
19113
19284
|
})]),
|
|
19114
19285
|
_: 1
|
|
19115
|
-
})) : createCommentVNode("", true)]),
|
|
19286
|
+
})) : createCommentVNode("", true)]), props.closable ? (openBlock(), createBlock(unref(DialogClose), {
|
|
19287
|
+
key: 0,
|
|
19288
|
+
"as-child": ""
|
|
19289
|
+
}, {
|
|
19116
19290
|
default: withCtx(() => [createVNode(CloseButton_default, {
|
|
19117
19291
|
disabled: props.locked,
|
|
19118
19292
|
class: "-mt-1.5 -me-1.5 shrink-0"
|
|
19119
19293
|
}, null, 8, ["disabled"])]),
|
|
19120
19294
|
_: 1
|
|
19121
|
-
})]),
|
|
19295
|
+
})) : createCommentVNode("", true)])) : createCommentVNode("", true),
|
|
19122
19296
|
_ctx.$slots.content ? (openBlock(), createBlock(ScrollArea_default, {
|
|
19123
|
-
key:
|
|
19297
|
+
key: 1,
|
|
19298
|
+
ref_key: "scrollArea",
|
|
19299
|
+
ref: scrollArea,
|
|
19124
19300
|
class: "min-h-0 grow"
|
|
19125
19301
|
}, {
|
|
19126
|
-
default: withCtx(() => [createElementVNode("div",
|
|
19302
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_5$3, [renderSlot(_ctx.$slots, "content", { close })])]),
|
|
19127
19303
|
_: 3
|
|
19128
|
-
})) : createCommentVNode("", true),
|
|
19129
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div",
|
|
19130
|
-
]),
|
|
19304
|
+
}, 512)) : createCommentVNode("", true),
|
|
19305
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6$2, [renderSlot(_ctx.$slots, "footer", { close })])) : createCommentVNode("", true)
|
|
19306
|
+
], 64))]),
|
|
19131
19307
|
_: 3
|
|
19132
|
-
},
|
|
19308
|
+
}, 16, ["data-hn-side", "class"])]),
|
|
19133
19309
|
_: 3
|
|
19134
19310
|
})]),
|
|
19135
19311
|
_: 3
|
|
19136
|
-
})]),
|
|
19312
|
+
})) : createCommentVNode("", true)]),
|
|
19137
19313
|
_: 3
|
|
19138
19314
|
}, 8, ["open"]);
|
|
19139
19315
|
};
|
|
@@ -19628,20 +19804,14 @@ var BreadcrumbSeparator_default = /* @__PURE__ */ defineComponent({
|
|
|
19628
19804
|
//#region src/lib/anchored-overlay.ts
|
|
19629
19805
|
function useAnchoredOverlay(props, open, emit, openAutoFocus) {
|
|
19630
19806
|
const { forwardRef: trigger, currentElement: triggerElement } = useForwardExpose();
|
|
19631
|
-
const retainedAnchor = shallowRef();
|
|
19632
|
-
const reference = computed(() => props.anchor ?? (open.value ? triggerElement.value ?? retainedAnchor.value : retainedAnchor.value ?? triggerElement.value));
|
|
19633
19807
|
const visible = computed({
|
|
19634
19808
|
get: () => !!open.value && !!(props.anchor || triggerElement.value),
|
|
19635
19809
|
set: (value) => {
|
|
19636
19810
|
open.value = value;
|
|
19637
19811
|
}
|
|
19638
19812
|
});
|
|
19639
|
-
|
|
19640
|
-
|
|
19641
|
-
}, {
|
|
19642
|
-
immediate: true,
|
|
19643
|
-
flush: "sync"
|
|
19644
|
-
});
|
|
19813
|
+
const { content, present } = useOverlayPortal(visible);
|
|
19814
|
+
const reference = useOverlayAnchor(() => props.anchor ?? triggerElement.value, visible, present, () => props.updatePositionStrategy);
|
|
19645
19815
|
let previousFocus = null;
|
|
19646
19816
|
let interactedOutside = false;
|
|
19647
19817
|
function once(handler) {
|
|
@@ -19654,7 +19824,7 @@ function useAnchoredOverlay(props, open, emit, openAutoFocus) {
|
|
|
19654
19824
|
}
|
|
19655
19825
|
watch(visible, (active) => {
|
|
19656
19826
|
if (!active) return;
|
|
19657
|
-
previousFocus = (props.anchor?.ownerDocument ?? triggerElement.value?.ownerDocument)?.activeElement;
|
|
19827
|
+
previousFocus = (overlayAnchorContext(props.anchor)?.ownerDocument ?? triggerElement.value?.ownerDocument ?? defaultDocument)?.activeElement;
|
|
19658
19828
|
interactedOutside = false;
|
|
19659
19829
|
}, {
|
|
19660
19830
|
immediate: true,
|
|
@@ -19670,11 +19840,10 @@ function useAnchoredOverlay(props, open, emit, openAutoFocus) {
|
|
|
19670
19840
|
nextTick(() => {
|
|
19671
19841
|
const active = panel.ownerDocument.activeElement;
|
|
19672
19842
|
if (restore && !visible.value && target?.isConnected && (active === panel.ownerDocument.body || panel.contains(active))) target.focus({ preventScroll: true });
|
|
19673
|
-
if (!visible.value) retainedAnchor.value = void 0;
|
|
19674
19843
|
});
|
|
19675
19844
|
});
|
|
19676
19845
|
const onInteractOutside = once((event) => {
|
|
19677
|
-
if (!triggerElement.value && props.anchor?.contains(event.target)) event.preventDefault();
|
|
19846
|
+
if (!triggerElement.value && overlayAnchorElement(props.anchor)?.contains(event.target)) event.preventDefault();
|
|
19678
19847
|
emit("interactOutside", event);
|
|
19679
19848
|
const original = event.detail.originalEvent;
|
|
19680
19849
|
const rightClick = "button" in original && (original.button === 2 || original.button === 0 && original.ctrlKey);
|
|
@@ -19682,6 +19851,8 @@ function useAnchoredOverlay(props, open, emit, openAutoFocus) {
|
|
|
19682
19851
|
});
|
|
19683
19852
|
return {
|
|
19684
19853
|
trigger,
|
|
19854
|
+
content,
|
|
19855
|
+
present,
|
|
19685
19856
|
reference,
|
|
19686
19857
|
visible,
|
|
19687
19858
|
events: {
|
|
@@ -19702,6 +19873,7 @@ var Popover_default = /* @__PURE__ */ defineComponent({
|
|
|
19702
19873
|
__name: "Popover",
|
|
19703
19874
|
props: /*@__PURE__*/ mergeModels({
|
|
19704
19875
|
anchor: {},
|
|
19876
|
+
updatePositionStrategy: { default: "optimized" },
|
|
19705
19877
|
modal: {
|
|
19706
19878
|
type: Boolean,
|
|
19707
19879
|
default: true
|
|
@@ -19730,8 +19902,7 @@ var Popover_default = /* @__PURE__ */ defineComponent({
|
|
|
19730
19902
|
const props = __props;
|
|
19731
19903
|
const open = useModel(__props, "open");
|
|
19732
19904
|
const emit = __emit;
|
|
19733
|
-
const { trigger, reference, visible, events } = useAnchoredOverlay(props, open, emit, (event) => emit("openAutoFocus", event));
|
|
19734
|
-
const { content, present } = useOverlayPortal(visible);
|
|
19905
|
+
const { trigger, content, present, reference, visible, events } = useAnchoredOverlay(props, open, emit, (event) => emit("openAutoFocus", event));
|
|
19735
19906
|
const pressOrigin = computed(() => {
|
|
19736
19907
|
if (props.side === "left") return "right";
|
|
19737
19908
|
if (props.side === "right") return "left";
|
|
@@ -19759,6 +19930,7 @@ var Popover_default = /* @__PURE__ */ defineComponent({
|
|
|
19759
19930
|
...unref(events)
|
|
19760
19931
|
}, {
|
|
19761
19932
|
reference: unref(reference),
|
|
19933
|
+
"update-position-strategy": props.updatePositionStrategy,
|
|
19762
19934
|
"as-child": "",
|
|
19763
19935
|
side: props.side,
|
|
19764
19936
|
align: props.align,
|
|
@@ -19776,6 +19948,7 @@ var Popover_default = /* @__PURE__ */ defineComponent({
|
|
|
19776
19948
|
_: 3
|
|
19777
19949
|
}, 16, [
|
|
19778
19950
|
"reference",
|
|
19951
|
+
"update-position-strategy",
|
|
19779
19952
|
"side",
|
|
19780
19953
|
"align",
|
|
19781
19954
|
"side-offset"
|
|
@@ -19796,6 +19969,7 @@ var DropdownMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
19796
19969
|
props: /*@__PURE__*/ mergeModels({
|
|
19797
19970
|
label: {},
|
|
19798
19971
|
anchor: {},
|
|
19972
|
+
updatePositionStrategy: { default: "optimized" },
|
|
19799
19973
|
modal: {
|
|
19800
19974
|
type: Boolean,
|
|
19801
19975
|
default: true
|
|
@@ -19818,7 +19992,7 @@ var DropdownMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
19818
19992
|
], ["update:open"]),
|
|
19819
19993
|
setup(__props, { emit: __emit }) {
|
|
19820
19994
|
const props = __props;
|
|
19821
|
-
const { trigger, reference, visible, events } = useAnchoredOverlay(props, useModel(__props, "open"), __emit);
|
|
19995
|
+
const { trigger, content, present, reference, visible, events } = useAnchoredOverlay(props, useModel(__props, "open"), __emit);
|
|
19822
19996
|
const pressOrigin = computed(() => {
|
|
19823
19997
|
if (props.side === "left") return "right";
|
|
19824
19998
|
if (props.side === "right") return "left";
|
|
@@ -19842,19 +20016,22 @@ var DropdownMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
19842
20016
|
}, {
|
|
19843
20017
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
19844
20018
|
_: 3
|
|
19845
|
-
}, 8, ["style"])) : createCommentVNode("", true),
|
|
19846
|
-
default: withCtx(() => [
|
|
20019
|
+
}, 8, ["style"])) : createCommentVNode("", true), unref(present) ? (openBlock(), createBlock(unref(DropdownMenuPortal), { key: 1 }, {
|
|
20020
|
+
default: withCtx(() => [createVNode(unref(DropdownMenuContent), mergeProps({
|
|
19847
20021
|
"aria-label": props.label,
|
|
19848
20022
|
..._ctx.$attrs,
|
|
19849
20023
|
...unref(events)
|
|
19850
20024
|
}, {
|
|
19851
20025
|
reference: unref(reference),
|
|
20026
|
+
"update-position-strategy": props.updatePositionStrategy,
|
|
19852
20027
|
"as-child": "",
|
|
19853
20028
|
side: props.side,
|
|
19854
20029
|
align: props.align,
|
|
19855
20030
|
"side-offset": props.sideOffset
|
|
19856
20031
|
}), {
|
|
19857
20032
|
default: withCtx(() => [createVNode(Card_default, {
|
|
20033
|
+
ref_key: "content",
|
|
20034
|
+
ref: content,
|
|
19858
20035
|
padded: false,
|
|
19859
20036
|
class: normalizeClass(unref(cn)("hn-anim-pop z-(--hn-z-overlay) flex min-w-40 flex-col gap-0.5 p-1 shadow-md outline-none", props.class))
|
|
19860
20037
|
}, {
|
|
@@ -19864,12 +20041,13 @@ var DropdownMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
19864
20041
|
_: 3
|
|
19865
20042
|
}, 16, [
|
|
19866
20043
|
"reference",
|
|
20044
|
+
"update-position-strategy",
|
|
19867
20045
|
"side",
|
|
19868
20046
|
"align",
|
|
19869
20047
|
"side-offset"
|
|
19870
|
-
])
|
|
20048
|
+
])]),
|
|
19871
20049
|
_: 3
|
|
19872
|
-
})]),
|
|
20050
|
+
})) : createCommentVNode("", true)]),
|
|
19873
20051
|
_: 3
|
|
19874
20052
|
}, 8, [
|
|
19875
20053
|
"open",
|
|
@@ -20186,12 +20364,14 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
20186
20364
|
"openModifiers": {}
|
|
20187
20365
|
}),
|
|
20188
20366
|
emits: ["update:open"],
|
|
20189
|
-
setup(__props) {
|
|
20367
|
+
setup(__props, { expose: __expose }) {
|
|
20190
20368
|
const props = __props;
|
|
20191
20369
|
const slots = useSlots();
|
|
20192
20370
|
function guard(e) {
|
|
20193
20371
|
if (props.locked) e.preventDefault();
|
|
20194
20372
|
}
|
|
20373
|
+
const { scrollArea, viewport } = useScrollViewport();
|
|
20374
|
+
__expose({ viewport });
|
|
20195
20375
|
const open = useModel(__props, "open");
|
|
20196
20376
|
const { content, present } = useOverlayPortal(open);
|
|
20197
20377
|
function close() {
|
|
@@ -20273,11 +20453,13 @@ var Dialog_default = /* @__PURE__ */ defineComponent({
|
|
|
20273
20453
|
})) : createCommentVNode("", true)])) : createCommentVNode("", true),
|
|
20274
20454
|
_ctx.$slots.content ? (openBlock(), createBlock(ScrollArea_default, {
|
|
20275
20455
|
key: 1,
|
|
20456
|
+
ref_key: "scrollArea",
|
|
20457
|
+
ref: scrollArea,
|
|
20276
20458
|
class: "min-h-0"
|
|
20277
20459
|
}, {
|
|
20278
20460
|
default: withCtx(() => [createElementVNode("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "content", { close })])]),
|
|
20279
20461
|
_: 3
|
|
20280
|
-
})) : createCommentVNode("", true),
|
|
20462
|
+
}, 512)) : createCommentVNode("", true),
|
|
20281
20463
|
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "footer", { close })])) : createCommentVNode("", true)
|
|
20282
20464
|
], 64))]),
|
|
20283
20465
|
_: 3
|