akar 2.0.9 → 2.0.10
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/Combobox/ComboboxContent.cjs +4 -0
- package/dist/Combobox/ComboboxContent.cjs.map +1 -1
- package/dist/Combobox/ComboboxContent.js +4 -0
- package/dist/Combobox/ComboboxContent.js.map +1 -1
- package/dist/Combobox/ComboboxContentImpl.cjs +14 -2
- package/dist/Combobox/ComboboxContentImpl.cjs.map +1 -1
- package/dist/Combobox/ComboboxContentImpl.js +14 -2
- package/dist/Combobox/ComboboxContentImpl.js.map +1 -1
- package/dist/Combobox/ComboboxItem.cjs +11 -2
- package/dist/Combobox/ComboboxItem.cjs.map +1 -1
- package/dist/Combobox/ComboboxItem.js +12 -3
- package/dist/Combobox/ComboboxItem.js.map +1 -1
- package/dist/ContextMenu/ContextMenuContent.cjs +4 -0
- package/dist/ContextMenu/ContextMenuContent.cjs.map +1 -1
- package/dist/ContextMenu/ContextMenuContent.js +4 -0
- package/dist/ContextMenu/ContextMenuContent.js.map +1 -1
- package/dist/ContextMenu/ContextMenuSubContent.cjs +4 -0
- package/dist/ContextMenu/ContextMenuSubContent.cjs.map +1 -1
- package/dist/ContextMenu/ContextMenuSubContent.js +4 -0
- package/dist/ContextMenu/ContextMenuSubContent.js.map +1 -1
- package/dist/DateField/DateFieldInput.cjs +3 -1
- package/dist/DateField/DateFieldInput.cjs.map +1 -1
- package/dist/DateField/DateFieldInput.js +3 -1
- package/dist/DateField/DateFieldInput.js.map +1 -1
- package/dist/DateField/DateFieldRoot.cjs +7 -1
- package/dist/DateField/DateFieldRoot.cjs.map +1 -1
- package/dist/DateField/DateFieldRoot.js +7 -1
- package/dist/DateField/DateFieldRoot.js.map +1 -1
- package/dist/DatePicker/DatePickerContent.cjs +4 -0
- package/dist/DatePicker/DatePickerContent.cjs.map +1 -1
- package/dist/DatePicker/DatePickerContent.js +4 -0
- package/dist/DatePicker/DatePickerContent.js.map +1 -1
- package/dist/DatePicker/DatePickerRoot.cjs +4 -0
- package/dist/DatePicker/DatePickerRoot.cjs.map +1 -1
- package/dist/DatePicker/DatePickerRoot.js +4 -0
- package/dist/DatePicker/DatePickerRoot.js.map +1 -1
- package/dist/DateRangePicker/DateRangePickerContent.cjs +4 -0
- package/dist/DateRangePicker/DateRangePickerContent.cjs.map +1 -1
- package/dist/DateRangePicker/DateRangePickerContent.js +4 -0
- package/dist/DateRangePicker/DateRangePickerContent.js.map +1 -1
- package/dist/Dialog/DialogContent.cjs +2 -1
- package/dist/Dialog/DialogContent.cjs.map +1 -1
- package/dist/Dialog/DialogContent.js +2 -1
- package/dist/Dialog/DialogContent.js.map +1 -1
- package/dist/Dialog/DialogContentModal.cjs +4 -3
- package/dist/Dialog/DialogContentModal.cjs.map +1 -1
- package/dist/Dialog/DialogContentModal.js +4 -3
- package/dist/Dialog/DialogContentModal.js.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.cjs +10 -9
- package/dist/DismissableLayer/DismissableLayer.cjs.map +1 -1
- package/dist/DismissableLayer/DismissableLayer.js +11 -10
- package/dist/DismissableLayer/DismissableLayer.js.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContent.cjs +4 -0
- package/dist/DropdownMenu/DropdownMenuContent.cjs.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContent.js +4 -0
- package/dist/DropdownMenu/DropdownMenuContent.js.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubContent.cjs +4 -0
- package/dist/DropdownMenu/DropdownMenuSubContent.cjs.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubContent.js +4 -0
- package/dist/DropdownMenu/DropdownMenuSubContent.js.map +1 -1
- package/dist/HoverCard/HoverCardContent.cjs +4 -0
- package/dist/HoverCard/HoverCardContent.cjs.map +1 -1
- package/dist/HoverCard/HoverCardContent.js +4 -0
- package/dist/HoverCard/HoverCardContent.js.map +1 -1
- package/dist/HoverCard/HoverCardContentImpl.cjs +4 -0
- package/dist/HoverCard/HoverCardContentImpl.cjs.map +1 -1
- package/dist/HoverCard/HoverCardContentImpl.js +4 -0
- package/dist/HoverCard/HoverCardContentImpl.js.map +1 -1
- package/dist/HoverCard/HoverCardRoot.cjs +15 -4
- package/dist/HoverCard/HoverCardRoot.cjs.map +1 -1
- package/dist/HoverCard/HoverCardRoot.js +15 -4
- package/dist/HoverCard/HoverCardRoot.js.map +1 -1
- package/dist/HoverCard/HoverCardTrigger.cjs +6 -0
- package/dist/HoverCard/HoverCardTrigger.cjs.map +1 -1
- package/dist/HoverCard/HoverCardTrigger.js +6 -0
- package/dist/HoverCard/HoverCardTrigger.js.map +1 -1
- package/dist/Listbox/ListboxRoot.cjs +4 -1
- package/dist/Listbox/ListboxRoot.cjs.map +1 -1
- package/dist/Listbox/ListboxRoot.js +4 -1
- package/dist/Listbox/ListboxRoot.js.map +1 -1
- package/dist/Listbox/ListboxVirtualizer.cjs +7 -3
- package/dist/Listbox/ListboxVirtualizer.cjs.map +1 -1
- package/dist/Listbox/ListboxVirtualizer.js +7 -3
- package/dist/Listbox/ListboxVirtualizer.js.map +1 -1
- package/dist/Menu/MenuContent.cjs +4 -0
- package/dist/Menu/MenuContent.cjs.map +1 -1
- package/dist/Menu/MenuContent.js +4 -0
- package/dist/Menu/MenuContent.js.map +1 -1
- package/dist/Menu/MenuContentImpl.cjs +4 -0
- package/dist/Menu/MenuContentImpl.cjs.map +1 -1
- package/dist/Menu/MenuContentImpl.js +4 -0
- package/dist/Menu/MenuContentImpl.js.map +1 -1
- package/dist/Menu/MenuRootContentModal.cjs +4 -0
- package/dist/Menu/MenuRootContentModal.cjs.map +1 -1
- package/dist/Menu/MenuRootContentModal.js +4 -0
- package/dist/Menu/MenuRootContentModal.js.map +1 -1
- package/dist/Menu/MenuRootContentNonModal.cjs +4 -0
- package/dist/Menu/MenuRootContentNonModal.cjs.map +1 -1
- package/dist/Menu/MenuRootContentNonModal.js +4 -0
- package/dist/Menu/MenuRootContentNonModal.js.map +1 -1
- package/dist/Menu/MenuSubContent.cjs +4 -0
- package/dist/Menu/MenuSubContent.cjs.map +1 -1
- package/dist/Menu/MenuSubContent.js +4 -0
- package/dist/Menu/MenuSubContent.js.map +1 -1
- package/dist/Menubar/MenubarContent.cjs +4 -0
- package/dist/Menubar/MenubarContent.cjs.map +1 -1
- package/dist/Menubar/MenubarContent.js +4 -0
- package/dist/Menubar/MenubarContent.js.map +1 -1
- package/dist/Menubar/MenubarSubContent.cjs +4 -0
- package/dist/Menubar/MenubarSubContent.cjs.map +1 -1
- package/dist/Menubar/MenubarSubContent.js +4 -0
- package/dist/Menubar/MenubarSubContent.js.map +1 -1
- package/dist/NumberField/NumberFieldInput.cjs +1 -0
- package/dist/NumberField/NumberFieldInput.cjs.map +1 -1
- package/dist/NumberField/NumberFieldInput.js +1 -0
- package/dist/NumberField/NumberFieldInput.js.map +1 -1
- package/dist/Popover/PopoverContent.cjs +4 -0
- package/dist/Popover/PopoverContent.cjs.map +1 -1
- package/dist/Popover/PopoverContent.js +4 -0
- package/dist/Popover/PopoverContent.js.map +1 -1
- package/dist/Popover/PopoverContentImpl.cjs +4 -0
- package/dist/Popover/PopoverContentImpl.cjs.map +1 -1
- package/dist/Popover/PopoverContentImpl.js +4 -0
- package/dist/Popover/PopoverContentImpl.js.map +1 -1
- package/dist/Popover/PopoverContentModal.cjs +4 -0
- package/dist/Popover/PopoverContentModal.cjs.map +1 -1
- package/dist/Popover/PopoverContentModal.js +4 -0
- package/dist/Popover/PopoverContentModal.js.map +1 -1
- package/dist/Popover/PopoverContentNonModal.cjs +4 -0
- package/dist/Popover/PopoverContentNonModal.cjs.map +1 -1
- package/dist/Popover/PopoverContentNonModal.js +4 -0
- package/dist/Popover/PopoverContentNonModal.js.map +1 -1
- package/dist/Popper/PopperContent.cjs +36 -3
- package/dist/Popper/PopperContent.cjs.map +1 -1
- package/dist/Popper/PopperContent.js +37 -4
- package/dist/Popper/PopperContent.js.map +1 -1
- package/dist/Select/SelectContent.cjs +4 -0
- package/dist/Select/SelectContent.cjs.map +1 -1
- package/dist/Select/SelectContent.js +4 -0
- package/dist/Select/SelectContent.js.map +1 -1
- package/dist/Select/SelectContentImpl.cjs +4 -0
- package/dist/Select/SelectContentImpl.cjs.map +1 -1
- package/dist/Select/SelectContentImpl.js +4 -0
- package/dist/Select/SelectContentImpl.js.map +1 -1
- package/dist/Select/SelectPopperPosition.cjs +4 -0
- package/dist/Select/SelectPopperPosition.cjs.map +1 -1
- package/dist/Select/SelectPopperPosition.js +4 -0
- package/dist/Select/SelectPopperPosition.js.map +1 -1
- package/dist/Select/SelectRoot.cjs +10 -5
- package/dist/Select/SelectRoot.cjs.map +1 -1
- package/dist/Select/SelectRoot.js +10 -5
- package/dist/Select/SelectRoot.js.map +1 -1
- package/dist/Select/SelectTrigger.cjs +25 -14
- package/dist/Select/SelectTrigger.cjs.map +1 -1
- package/dist/Select/SelectTrigger.js +25 -14
- package/dist/Select/SelectTrigger.js.map +1 -1
- package/dist/Tabs/TabsIndicator.cjs +7 -3
- package/dist/Tabs/TabsIndicator.cjs.map +1 -1
- package/dist/Tabs/TabsIndicator.js +7 -3
- package/dist/Tabs/TabsIndicator.js.map +1 -1
- package/dist/Tree/TreeItem.cjs +18 -2
- package/dist/Tree/TreeItem.cjs.map +1 -1
- package/dist/Tree/TreeItem.js +18 -2
- package/dist/Tree/TreeItem.js.map +1 -1
- package/dist/Tree/TreeVirtualizer.cjs +2 -1
- package/dist/Tree/TreeVirtualizer.cjs.map +1 -1
- package/dist/Tree/TreeVirtualizer.js +2 -1
- package/dist/Tree/TreeVirtualizer.js.map +1 -1
- package/dist/date/utils.cjs +1 -1
- package/dist/date/utils.cjs.map +1 -1
- package/dist/date/utils.js +1 -1
- package/dist/date/utils.js.map +1 -1
- package/dist/index2.d.ts.map +1 -1
- package/dist/index3.d.cts +44 -24
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +29 -8
- package/dist/index3.d.ts.map +1 -1
- package/dist/index4.d.cts +661 -642
- package/dist/index4.d.cts.map +1 -1
- package/dist/index4.d.ts +647 -628
- package/dist/index4.d.ts.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.cts.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/shared/useEmitAsProps.cjs +4 -0
- package/dist/shared/useEmitAsProps.cjs.map +1 -1
- package/dist/shared/useEmitAsProps.js +4 -0
- package/dist/shared/useEmitAsProps.js.map +1 -1
- package/dist/shared/useForwardPropsEmits.cjs +0 -12
- package/dist/shared/useForwardPropsEmits.cjs.map +1 -1
- package/dist/shared/useForwardPropsEmits.js +0 -12
- package/dist/shared/useForwardPropsEmits.js.map +1 -1
- package/dist/shared/useId.cjs +6 -7
- package/dist/shared/useId.cjs.map +1 -1
- package/dist/shared/useId.js +6 -7
- package/dist/shared/useId.js.map +1 -1
- package/dist/shared.d.cts +2 -2
- package/dist/shared.d.ts +2 -2
- package/package.json +6 -5
- package/src/Combobox/ComboboxContentImpl.vue +21 -4
- package/src/Combobox/ComboboxItem.vue +1 -0
- package/src/DateField/DateFieldInput.vue +6 -1
- package/src/DateField/DateFieldRoot.vue +18 -8
- package/src/Dialog/DialogContent.vue +10 -1
- package/src/Dialog/DialogContentModal.vue +7 -2
- package/src/DismissableLayer/DismissableLayer.vue +39 -21
- package/src/HoverCard/HoverCardRoot.vue +13 -3
- package/src/HoverCard/HoverCardTrigger.vue +13 -0
- package/src/Listbox/ListboxRoot.vue +7 -4
- package/src/Listbox/ListboxVirtualizer.vue +19 -3
- package/src/NumberField/NumberFieldInput.vue +1 -1
- package/src/Popper/PopperContent.vue +32 -1
- package/src/Select/SelectRoot.vue +11 -5
- package/src/Select/SelectTrigger.vue +52 -32
- package/src/Tabs/TabsIndicator.vue +5 -0
- package/src/Tree/TreeItem.vue +26 -0
- package/src/Tree/TreeVirtualizer.vue +4 -1
- package/src/shared/date/utils.ts +1 -1
- package/src/shared/index.ts +1 -1
- package/src/shared/useEmitAsProps.test-d.ts +79 -0
- package/src/shared/useEmitAsProps.ts +82 -4
- package/src/shared/useForwardProps.ts +1 -1
- package/src/shared/useForwardPropsEmits.ts +17 -2
- package/src/shared/useId.ts +12 -5
package/dist/internal.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index2.cjs";
|
|
2
2
|
import "./index3.cjs";
|
|
3
3
|
import { MenuArrowProps, MenuCheckboxItemEmits, MenuCheckboxItemProps, MenuContentEmits, MenuContentProps, MenuEmits, MenuGroupProps, MenuItemEmits, MenuItemIndicatorProps, MenuItemProps, MenuLabelProps, MenuPortalProps, MenuProps, MenuRadioGroupEmits, MenuRadioGroupProps, MenuRadioItemEmits, MenuRadioItemProps, MenuSeparatorProps, MenuSubContentEmits, MenuSubContentProps, MenuSubEmits, MenuSubProps, MenuSubTriggerProps, PopperAnchorProps, _default$277 as _default$13, _default$278 as _default$8, _default$279 as _default, _default$280 as _default$6, _default$281 as _default$10, _default$282 as _default$3, _default$283 as _default$14, _default$284 as _default$12, _default$285 as _default$2, _default$286 as _default$1, _default$287 as _default$11, _default$288 as _default$7, _default$290 as _default$9, _default$291 as _default$4, _default$292 as _default$5, injectMenuContext, injectMenuRootContext } from "./index4.cjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue69 from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/Menu/MenuAnchor.vue.d.ts
|
|
7
7
|
interface MenuAnchorProps extends PopperAnchorProps {}
|
|
@@ -9,7 +9,7 @@ declare var __VLS_8: {};
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_8) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_base:
|
|
12
|
+
declare const __VLS_base: vue69.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue69.ComponentOptionsMixin, vue69.ComponentOptionsMixin, {}, string, vue69.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue69.ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
14
|
declare const _default$15: typeof __VLS_export;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
package/dist/internal.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.cts","names":[],"sources":["../src/Menu/MenuAnchor.vue"],"sourcesContent":[],"mappings":";;;;;;UAoBU,eAAA,SAAwB;YAsC9B;KACC,WAAA;2BACwB;AA3CqB,CAAA;AAGC,cA2C7C,UALgB,EAKN,
|
|
1
|
+
{"version":3,"file":"internal.d.cts","names":[],"sources":["../src/Menu/MenuAnchor.vue"],"sourcesContent":[],"mappings":";;;;;;UAoBU,eAAA,SAAwB;YAsC9B;KACC,WAAA;2BACwB;AA3CqB,CAAA;AAGC,cA2C7C,UALgB,EAKN,KAAA,CAAA,eALM,CAKN,eALM,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAKN,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,EALM,CAAA,CAAA,EAAA,MAAA,EAKN,KAAA,CAAA,WAAA,EAAA,QALM,CAKN,eALM,CAAA,GAKN,QALM,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAKN,KAAA,CAAA,uBAAA,EALM,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;AAAA,cAQhB,YAPU,EAOW,eANS,CAAA,OAMc,UANd,EAM0B,WAN1B,CAAA;AAAA,cAMM,WADxC,EAAA,OAE0B,YAF1B;KAGG,eALW,CAAA,CAAA,EAAA,CAAA,CAAA,GAKa,CALb,GAAA;EAAA,MAAA,EAAA;IAAA,MAAA,EAON,CAPM;EAAA,CAAA;CAAA"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index2.js";
|
|
2
2
|
import "./index3.js";
|
|
3
3
|
import { MenuArrowProps, MenuCheckboxItemEmits, MenuCheckboxItemProps, MenuContentEmits, MenuContentProps, MenuEmits, MenuGroupProps, MenuItemEmits, MenuItemIndicatorProps, MenuItemProps, MenuLabelProps, MenuPortalProps, MenuProps, MenuRadioGroupEmits, MenuRadioGroupProps, MenuRadioItemEmits, MenuRadioItemProps, MenuSeparatorProps, MenuSubContentEmits, MenuSubContentProps, MenuSubEmits, MenuSubProps, MenuSubTriggerProps, PopperAnchorProps, _default$277 as _default$13, _default$278 as _default$8, _default$279 as _default, _default$280 as _default$6, _default$281 as _default$10, _default$282 as _default$3, _default$283 as _default$14, _default$284 as _default$12, _default$285 as _default$2, _default$286 as _default$1, _default$287 as _default$11, _default$288 as _default$7, _default$290 as _default$9, _default$291 as _default$4, _default$292 as _default$5, injectMenuContext, injectMenuRootContext } from "./index4.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue23 from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/Menu/MenuAnchor.vue.d.ts
|
|
7
7
|
interface MenuAnchorProps extends PopperAnchorProps {}
|
|
@@ -9,7 +9,7 @@ declare var __VLS_8: {};
|
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
default?: (props: typeof __VLS_8) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_base:
|
|
12
|
+
declare const __VLS_base: vue23.DefineComponent<MenuAnchorProps, {}, {}, {}, {}, vue23.ComponentOptionsMixin, vue23.ComponentOptionsMixin, {}, string, vue23.PublicProps, Readonly<MenuAnchorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue23.ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
14
|
declare const _default$15: typeof __VLS_export;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -5,6 +5,10 @@ const vue = require_rolldown_runtime.__toESM(require("vue"));
|
|
|
5
5
|
/**
|
|
6
6
|
* The `useEmitAsProps` function is a TypeScript utility that converts emitted events into props for a
|
|
7
7
|
* Vue component.
|
|
8
|
+
*
|
|
9
|
+
* @template Name - The event name string union type.
|
|
10
|
+
* @template Fn - The emit function type.
|
|
11
|
+
*
|
|
8
12
|
* @param emit - The `emit` parameter is a function that is used to emit events from a component. It
|
|
9
13
|
* takes two parameters: `name` which is the name of the event to be emitted, and `...args` which are
|
|
10
14
|
* the arguments to be passed along with the event.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEmitAsProps.cjs","names":["emit:
|
|
1
|
+
{"version":3,"file":"useEmitAsProps.cjs","names":["emit: Emit<Name, Fn>","result: Record<string, any>"],"sources":["../../src/shared/useEmitAsProps.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,eAA8DA,MAAsB;CAClG,MAAM,KAAK,6BAAoB;CAE/B,MAAM,SAAS,IAAI,KAAK;CACxB,MAAMC,SAA8B,CAAE;AAEtC,MAAK,QAAQ,OACX,SAAQ,KACN,CAAC,gDAAgD,EAAE,IAAI,KAAK,QAAQ,CACrE;AAGH,SAAQ,QAAQ,CAAC,OAAO;AACtB,SAAO,sBAAa,kBAAS,GAAG,CAAC,IAAI,CAAC,GAAG,QAAa,KAAK,IAAI,GAAG,IAAI;CACvE,EAAC;AAEF,QAAO;AACR"}
|
|
@@ -4,6 +4,10 @@ import { camelize, getCurrentInstance, toHandlerKey } from "vue";
|
|
|
4
4
|
/**
|
|
5
5
|
* The `useEmitAsProps` function is a TypeScript utility that converts emitted events into props for a
|
|
6
6
|
* Vue component.
|
|
7
|
+
*
|
|
8
|
+
* @template Name - The event name string union type.
|
|
9
|
+
* @template Fn - The emit function type.
|
|
10
|
+
*
|
|
7
11
|
* @param emit - The `emit` parameter is a function that is used to emit events from a component. It
|
|
8
12
|
* takes two parameters: `name` which is the name of the event to be emitted, and `...args` which are
|
|
9
13
|
* the arguments to be passed along with the event.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEmitAsProps.js","names":["emit:
|
|
1
|
+
{"version":3,"file":"useEmitAsProps.js","names":["emit: Emit<Name, Fn>","result: Record<string, any>"],"sources":["../../src/shared/useEmitAsProps.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAAgB,eAA8DA,MAAsB;CAClG,MAAM,KAAK,oBAAoB;CAE/B,MAAM,SAAS,IAAI,KAAK;CACxB,MAAMC,SAA8B,CAAE;AAEtC,MAAK,QAAQ,OACX,SAAQ,KACN,CAAC,gDAAgD,EAAE,IAAI,KAAK,QAAQ,CACrE;AAGH,SAAQ,QAAQ,CAAC,OAAO;AACtB,SAAO,aAAa,SAAS,GAAG,CAAC,IAAI,CAAC,GAAG,QAAa,KAAK,IAAI,GAAG,IAAI;CACvE,EAAC;AAEF,QAAO;AACR"}
|
|
@@ -4,18 +4,6 @@ const require_shared_useForwardProps = require('./useForwardProps.cjs');
|
|
|
4
4
|
const vue = require_rolldown_runtime.__toESM(require("vue"));
|
|
5
5
|
|
|
6
6
|
//#region src/shared/useForwardPropsEmits.ts
|
|
7
|
-
/**
|
|
8
|
-
* The function `useForwardPropsEmits` takes in props and an optional emit function, and returns a
|
|
9
|
-
* computed object that combines the parsed props and emits as props.
|
|
10
|
-
* @param props - The `props` parameter is of type `T`, which is a generic type that extends the
|
|
11
|
-
* parameters of the `useForwardProps` function. It represents the props object that is passed to the
|
|
12
|
-
* `useForwardProps` function.
|
|
13
|
-
* @param [emit] - The `emit` parameter is a function that can be used to emit events. It takes two
|
|
14
|
-
* arguments: `name`, which is the name of the event to be emitted, and `args`, which are the arguments
|
|
15
|
-
* to be passed along with the event.
|
|
16
|
-
* @returns a computed property that combines the parsed
|
|
17
|
-
* props and emits as props.
|
|
18
|
-
*/
|
|
19
7
|
function useForwardPropsEmits(props, emit) {
|
|
20
8
|
const parsedProps = require_shared_useForwardProps.useForwardProps(props);
|
|
21
9
|
const emitsAsProps = emit ? require_shared_useEmitAsProps.useEmitAsProps(emit) : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForwardPropsEmits.cjs","names":["props: MaybeRefOrGetter<T>","emit?:
|
|
1
|
+
{"version":3,"file":"useForwardPropsEmits.cjs","names":["props: MaybeRefOrGetter<T>","emit?: Emit<Name, Fn>"],"sources":["../../src/shared/useForwardPropsEmits.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA,SAAgB,qBAIdA,OAA4BC,MAAuB;CACnD,MAAM,cAAc,+CAAgB,MAAM;CAC1C,MAAM,eAAe,OAAO,6CAAe,KAAK,GAAG,CAAE;AAErD,QAAO,kBAAS,OAAO;EACrB,GAAG,YAAY;EACf,GAAG;CACJ,GAAE;AACJ"}
|
|
@@ -3,18 +3,6 @@ import { useForwardProps } from "./useForwardProps.js";
|
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/shared/useForwardPropsEmits.ts
|
|
6
|
-
/**
|
|
7
|
-
* The function `useForwardPropsEmits` takes in props and an optional emit function, and returns a
|
|
8
|
-
* computed object that combines the parsed props and emits as props.
|
|
9
|
-
* @param props - The `props` parameter is of type `T`, which is a generic type that extends the
|
|
10
|
-
* parameters of the `useForwardProps` function. It represents the props object that is passed to the
|
|
11
|
-
* `useForwardProps` function.
|
|
12
|
-
* @param [emit] - The `emit` parameter is a function that can be used to emit events. It takes two
|
|
13
|
-
* arguments: `name`, which is the name of the event to be emitted, and `args`, which are the arguments
|
|
14
|
-
* to be passed along with the event.
|
|
15
|
-
* @returns a computed property that combines the parsed
|
|
16
|
-
* props and emits as props.
|
|
17
|
-
*/
|
|
18
6
|
function useForwardPropsEmits(props, emit) {
|
|
19
7
|
const parsedProps = useForwardProps(props);
|
|
20
8
|
const emitsAsProps = emit ? useEmitAsProps(emit) : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForwardPropsEmits.js","names":["props: MaybeRefOrGetter<T>","emit?:
|
|
1
|
+
{"version":3,"file":"useForwardPropsEmits.js","names":["props: MaybeRefOrGetter<T>","emit?: Emit<Name, Fn>"],"sources":["../../src/shared/useForwardPropsEmits.ts"],"sourcesContent":[],"mappings":";;;;;AA4BA,SAAgB,qBAIdA,OAA4BC,MAAuB;CACnD,MAAM,cAAc,gBAAgB,MAAM;CAC1C,MAAM,eAAe,OAAO,eAAe,KAAK,GAAG,CAAE;AAErD,QAAO,SAAS,OAAO;EACrB,GAAG,YAAY;EACf,GAAG;CACJ,GAAE;AACJ"}
|
package/dist/shared/useId.cjs
CHANGED
|
@@ -6,20 +6,19 @@ const vue = require_rolldown_runtime.__toESM(require("vue"));
|
|
|
6
6
|
let count = 0;
|
|
7
7
|
/**
|
|
8
8
|
* The `useId` function generates a unique identifier using a provided deterministic ID or a default
|
|
9
|
-
*
|
|
9
|
+
* a configured `<ConfigProvider>` ID source, Vue's native `useId`, or a fallback counter.
|
|
10
10
|
* @param [deterministicId] - The `useId` function you provided takes an
|
|
11
11
|
* optional parameter `deterministicId`, which can be a string, null, or undefined. If
|
|
12
12
|
* `deterministicId` is provided, the function will return it. Otherwise, it will generate an id using
|
|
13
|
-
* the
|
|
13
|
+
* the configured ID source.
|
|
14
14
|
*/
|
|
15
15
|
function useId(deterministicId, prefix = "akar") {
|
|
16
16
|
if (deterministicId) return deterministicId;
|
|
17
17
|
let id;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
18
|
+
const configProviderContext = require_ConfigProvider_ConfigProvider.injectConfigProviderContext({ useId: void 0 });
|
|
19
|
+
if (configProviderContext.useId) id = configProviderContext.useId();
|
|
20
|
+
else if ("useId" in vue) id = vue.useId?.();
|
|
21
|
+
else id = `${++count}`;
|
|
23
22
|
return prefix ? `${prefix}-${id}` : id;
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.cjs","names":["deterministicId?: string | null | undefined","id: string"],"sources":["../../src/shared/useId.ts"],"sourcesContent":[],"mappings":";;;;;AAKA,IAAI,QAAQ;;;;;;;;;AASZ,SAAgB,MAAMA,iBAA6C,SAAS,QAAQ;AAClF,KAAI,gBACF,QAAO;CAGT,IAAIC;
|
|
1
|
+
{"version":3,"file":"useId.cjs","names":["deterministicId?: string | null | undefined","id: string"],"sources":["../../src/shared/useId.ts"],"sourcesContent":[],"mappings":";;;;;AAKA,IAAI,QAAQ;;;;;;;;;AASZ,SAAgB,MAAMA,iBAA6C,SAAS,QAAQ;AAClF,KAAI,gBACF,QAAO;CAGT,IAAIC;CACJ,MAAM,wBAAwB,kEAA4B,EAAE,cAAkB,EAAC;AAM/E,KAAI,sBAAsB,MACxB,MAAK,sBAAsB,OAAO;UACzB,WAAW,IACpB,MAAK,IAAI,SAAS;KAElB,MAAK,GAAG,EAAE,OAAO;AAGnB,QAAO,SAAS,GAAG,OAAO,CAAC,EAAE,IAAI,GAAG;AACrC"}
|
package/dist/shared/useId.js
CHANGED
|
@@ -5,20 +5,19 @@ import * as vue from "vue";
|
|
|
5
5
|
let count = 0;
|
|
6
6
|
/**
|
|
7
7
|
* The `useId` function generates a unique identifier using a provided deterministic ID or a default
|
|
8
|
-
*
|
|
8
|
+
* a configured `<ConfigProvider>` ID source, Vue's native `useId`, or a fallback counter.
|
|
9
9
|
* @param [deterministicId] - The `useId` function you provided takes an
|
|
10
10
|
* optional parameter `deterministicId`, which can be a string, null, or undefined. If
|
|
11
11
|
* `deterministicId` is provided, the function will return it. Otherwise, it will generate an id using
|
|
12
|
-
* the
|
|
12
|
+
* the configured ID source.
|
|
13
13
|
*/
|
|
14
14
|
function useId(deterministicId, prefix = "akar") {
|
|
15
15
|
if (deterministicId) return deterministicId;
|
|
16
16
|
let id;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
const configProviderContext = injectConfigProviderContext({ useId: void 0 });
|
|
18
|
+
if (configProviderContext.useId) id = configProviderContext.useId();
|
|
19
|
+
else if ("useId" in vue) id = vue.useId?.();
|
|
20
|
+
else id = `${++count}`;
|
|
22
21
|
return prefix ? `${prefix}-${id}` : id;
|
|
23
22
|
}
|
|
24
23
|
|
package/dist/shared/useId.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.js","names":["deterministicId?: string | null | undefined","id: string"],"sources":["../../src/shared/useId.ts"],"sourcesContent":[],"mappings":";;;;AAKA,IAAI,QAAQ;;;;;;;;;AASZ,SAAgB,MAAMA,iBAA6C,SAAS,QAAQ;AAClF,KAAI,gBACF,QAAO;CAGT,IAAIC;
|
|
1
|
+
{"version":3,"file":"useId.js","names":["deterministicId?: string | null | undefined","id: string"],"sources":["../../src/shared/useId.ts"],"sourcesContent":[],"mappings":";;;;AAKA,IAAI,QAAQ;;;;;;;;;AASZ,SAAgB,MAAMA,iBAA6C,SAAS,QAAQ;AAClF,KAAI,gBACF,QAAO;CAGT,IAAIC;CACJ,MAAM,wBAAwB,4BAA4B,EAAE,cAAkB,EAAC;AAM/E,KAAI,sBAAsB,MACxB,MAAK,sBAAsB,OAAO;UACzB,WAAW,IACpB,MAAK,IAAI,SAAS;KAElB,MAAK,GAAG,EAAE,OAAO;AAGnB,QAAO,SAAS,GAAG,OAAO,CAAC,EAAE,IAAI,GAAG;AACrC"}
|
package/dist/shared.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DateRange, DateStep, DateValue, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault } from "./index3.cjs";
|
|
2
|
-
export { DateRange, DateStep, DateValue, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault };
|
|
1
|
+
import { DateRange, DateStep, DateValue, EmitAsProps, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault } from "./index3.cjs";
|
|
2
|
+
export { DateRange, DateStep, DateValue, EmitAsProps, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault };
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DateRange, DateStep, DateValue, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault } from "./index3.js";
|
|
2
|
-
export { DateRange, DateStep, DateValue, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault };
|
|
1
|
+
import { DateRange, DateStep, DateValue, EmitAsProps, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault } from "./index3.js";
|
|
2
|
+
export { DateRange, DateStep, DateValue, EmitAsProps, Formatter, SegmentPart, TimeRange, TimeValue, areEqual, createContext, findValuesBetween, getActiveElement, handleAndDispatchCustomEvent, isValidVNodeElement, isValueEqualOrExist, onFocusOutside, renderSlotFragments, roundToStepPrecision, snapValueToStep, trapFocus, useArrowNavigation, useBodyScrollLock, useComposing, useDateFormatter, useDirection, useEmitAsProps, useFilter, useFocusGuards, useFormControl, useForwardExpose, useForwardProps, useForwardPropsEmits, useForwardRef, useGraceArea, useHideOthers, useId, useLocale, useSelectionBehavior, useSize, useStateMachine, useTestKbd, useTypeahead, withDefault };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akar",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.10",
|
|
5
5
|
"description": "Vue UI primitives components",
|
|
6
6
|
"author": "Vinicunca Contributors (https://github.com/vinicunca)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -112,14 +112,15 @@
|
|
|
112
112
|
"@types/jsdom": "^28.0.0",
|
|
113
113
|
"@types/node": "^24.0.13",
|
|
114
114
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
115
|
-
"@vitest/coverage-istanbul": "^3.2.
|
|
116
|
-
"@vue/
|
|
115
|
+
"@vitest/coverage-istanbul": "^3.2.6",
|
|
116
|
+
"@vue/server-renderer": "^3.5.17",
|
|
117
|
+
"@vue/test-utils": "^2.4.11",
|
|
117
118
|
"@vue/tsconfig": "^0.7.0",
|
|
118
119
|
"jsdom": "^26.1.0",
|
|
119
120
|
"size-limit": "^12.0.1",
|
|
120
121
|
"tsdown": "^0.12.9",
|
|
121
|
-
"vite": "^8.0.
|
|
122
|
-
"vitest": "^
|
|
122
|
+
"vite": "^8.0.16",
|
|
123
|
+
"vitest": "^4.1.8",
|
|
123
124
|
"vitest-axe": "0.1.0",
|
|
124
125
|
"vitest-canvas-mock": "^0.3.3",
|
|
125
126
|
"vue": "3.5.17",
|
|
@@ -99,6 +99,20 @@ onUnmounted(() => {
|
|
|
99
99
|
rootContext.triggerElement.value?.focus();
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
+
|
|
103
|
+
function isEventTargetWithinCombobox(target: EventTarget | null) {
|
|
104
|
+
if (rootContext.parentElement.value?.contains(target as Node)) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// A `<label>` associated (via `for`) with an element inside the combobox forwards its
|
|
109
|
+
// click/focus to that control, so interacting with it should not dismiss the content.
|
|
110
|
+
// Without this, clicking such a label while open dismisses on `pointerdown` and the
|
|
111
|
+
// forwarded click/focus immediately re-opens it.
|
|
112
|
+
const label = target instanceof Element ? target.closest('label') : null;
|
|
113
|
+
const control = label?.control;
|
|
114
|
+
return !!control && !!rootContext.parentElement.value?.contains(control);
|
|
115
|
+
}
|
|
102
116
|
</script>
|
|
103
117
|
|
|
104
118
|
<template>
|
|
@@ -113,15 +127,15 @@ onUnmounted(() => {
|
|
|
113
127
|
:disable-outside-pointer-events="disableOutsidePointerEvents"
|
|
114
128
|
@dismiss="rootContext.onOpenChange(false)"
|
|
115
129
|
@focus-outside="(ev) => {
|
|
116
|
-
// if
|
|
117
|
-
if (
|
|
130
|
+
// if focusing inside the combobox (or a label tied to it), prevent dismiss
|
|
131
|
+
if (isEventTargetWithinCombobox(ev.target)) ev.preventDefault()
|
|
118
132
|
emits('focusOutside', ev)
|
|
119
133
|
}"
|
|
120
134
|
@interact-outside="emits('interactOutside', $event)"
|
|
121
135
|
@escape-key-down="emits('escapeKeyDown', $event)"
|
|
122
136
|
@pointer-down-outside="(ev) => {
|
|
123
|
-
// if clicking inside the combobox, prevent dismiss
|
|
124
|
-
if (
|
|
137
|
+
// if clicking inside the combobox (or a label tied to it), prevent dismiss
|
|
138
|
+
if (isEventTargetWithinCombobox(ev.target)) ev.preventDefault()
|
|
125
139
|
emits('pointerDownOutside', ev)
|
|
126
140
|
}"
|
|
127
141
|
>
|
|
@@ -130,6 +144,9 @@ onUnmounted(() => {
|
|
|
130
144
|
v-bind="{ ...$attrs, ...forwardedProps }"
|
|
131
145
|
:id="rootContext.contentId"
|
|
132
146
|
:ref="forwardRef"
|
|
147
|
+
:memo-dependencies="position === 'popper'
|
|
148
|
+
? [rootContext.filterSearch.value, rootContext.filterState.value]
|
|
149
|
+
: undefined"
|
|
133
150
|
:data-state="rootContext.open.value ? 'open' : 'closed'"
|
|
134
151
|
:data-empty="isEmpty ? '' : undefined"
|
|
135
152
|
:style="{
|
|
@@ -78,6 +78,7 @@ onUnmounted(() => {
|
|
|
78
78
|
v-bind="props"
|
|
79
79
|
:id="id"
|
|
80
80
|
ref="primitiveElement"
|
|
81
|
+
v-memo="[isRender, rootContext.filterSearch.value, rootContext.disabled.value, disabled, props.value, props.as, props.asChild, ...Object.values($attrs)]"
|
|
81
82
|
:disabled="rootContext.disabled.value || disabled"
|
|
82
83
|
@select="(event) => {
|
|
83
84
|
emits('select', event as any)
|
|
@@ -23,6 +23,7 @@ const lastKeyZero = ref(false);
|
|
|
23
23
|
const {
|
|
24
24
|
handleSegmentClick,
|
|
25
25
|
handleSegmentKeydown,
|
|
26
|
+
handleSegmentFocusOut,
|
|
26
27
|
attributes,
|
|
27
28
|
handleSegmentBeforeInput,
|
|
28
29
|
handleSegmentCompositionStart,
|
|
@@ -33,6 +34,7 @@ const {
|
|
|
33
34
|
placeholder: rootContext.placeholder,
|
|
34
35
|
hourCycle: rootContext.hourCycle,
|
|
35
36
|
step: rootContext.step,
|
|
37
|
+
stepSnapping: rootContext.stepSnapping,
|
|
36
38
|
segmentValues: rootContext.segmentValues,
|
|
37
39
|
formatter: rootContext.formatter,
|
|
38
40
|
part: props.part,
|
|
@@ -65,7 +67,10 @@ const isInvalid = computed(() => rootContext.isInvalid.value);
|
|
|
65
67
|
beforeinput: handleSegmentBeforeInput,
|
|
66
68
|
compositionstart: handleSegmentCompositionStart,
|
|
67
69
|
compositionend: handleSegmentCompositionEnd,
|
|
68
|
-
focusout: () => {
|
|
70
|
+
focusout: () => {
|
|
71
|
+
hasLeftFocus = true
|
|
72
|
+
handleSegmentFocusOut()
|
|
73
|
+
},
|
|
69
74
|
focusin: (e: FocusEvent) => {
|
|
70
75
|
rootContext.setFocusedElement(e.target as HTMLElement)
|
|
71
76
|
},
|
|
@@ -32,6 +32,7 @@ type DateFieldRootContext = {
|
|
|
32
32
|
formatter: Formatter;
|
|
33
33
|
hourCycle: HourCycle;
|
|
34
34
|
step: Ref<DateStep>;
|
|
35
|
+
stepSnapping: Ref<boolean>;
|
|
35
36
|
segmentValues: Ref<SegmentValueObj>;
|
|
36
37
|
segmentContents: Ref<Array<{ part: SegmentPart; value: string }>>;
|
|
37
38
|
elements: Ref<Set<HTMLElement>>;
|
|
@@ -52,6 +53,8 @@ export interface DateFieldRootProps extends PrimitiveProps, FormFieldProps {
|
|
|
52
53
|
hourCycle?: HourCycle;
|
|
53
54
|
/** The stepping interval for the time fields. Defaults to `1`. */
|
|
54
55
|
step?: DateStep;
|
|
56
|
+
/** Whether to enforce snapping the time value to the nearest step increment after input. Defaults to `false`. */
|
|
57
|
+
stepSnapping?: boolean;
|
|
55
58
|
/** The granularity to use for formatting times. Defaults to day if a CalendarDate is provided, otherwise defaults to minute. The field will render segments for each part of the date up to and including the specified granularity */
|
|
56
59
|
granularity?: Granularity;
|
|
57
60
|
/** Whether or not to hide the time zone segment of the field */
|
|
@@ -96,14 +99,20 @@ defineOptions({
|
|
|
96
99
|
inheritAttrs: false,
|
|
97
100
|
});
|
|
98
101
|
|
|
99
|
-
const props = withDefaults(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
const props = withDefaults(
|
|
103
|
+
defineProps<DateFieldRootProps>(),
|
|
104
|
+
{
|
|
105
|
+
defaultValue: undefined,
|
|
106
|
+
disabled: false,
|
|
107
|
+
readonly: false,
|
|
108
|
+
placeholder: undefined,
|
|
109
|
+
isDateUnavailable: undefined,
|
|
110
|
+
stepSnapping: false,
|
|
111
|
+
},
|
|
112
|
+
);
|
|
113
|
+
|
|
106
114
|
const emits = defineEmits<DateFieldRootEmits>();
|
|
115
|
+
|
|
107
116
|
defineSlots<{
|
|
108
117
|
default?: (props: {
|
|
109
118
|
/** The current date of the field */
|
|
@@ -115,7 +124,7 @@ defineSlots<{
|
|
|
115
124
|
}) => any;
|
|
116
125
|
}>();
|
|
117
126
|
|
|
118
|
-
const { disabled, readonly, isDateUnavailable: propsIsDateUnavailable, granularity, defaultValue, dir: propDir, locale: propLocale } = toRefs(props);
|
|
127
|
+
const { disabled, readonly, isDateUnavailable: propsIsDateUnavailable, granularity, defaultValue, stepSnapping, dir: propDir, locale: propLocale } = toRefs(props);
|
|
119
128
|
const locale = useLocale(propLocale);
|
|
120
129
|
const dir = useDirection(propDir);
|
|
121
130
|
|
|
@@ -290,6 +299,7 @@ provideDateFieldRootContext({
|
|
|
290
299
|
hourCycle: props.hourCycle,
|
|
291
300
|
step,
|
|
292
301
|
readonly,
|
|
302
|
+
stepSnapping,
|
|
293
303
|
segmentValues,
|
|
294
304
|
isInvalid,
|
|
295
305
|
segmentContents: editableSegmentContents,
|
|
@@ -22,7 +22,16 @@ import DialogContentModal from './DialogContentModal.vue';
|
|
|
22
22
|
import DialogContentNonModal from './DialogContentNonModal.vue';
|
|
23
23
|
import { injectDialogRootContext } from './DialogRoot.vue';
|
|
24
24
|
|
|
25
|
-
const props =
|
|
25
|
+
const props = withDefaults(
|
|
26
|
+
defineProps<DialogContentProps>(),
|
|
27
|
+
{
|
|
28
|
+
// Keep `undefined` (instead of Vue's boolean coercion to `false`) so the
|
|
29
|
+
// modal/non-modal child can apply its own default. This lets a modal
|
|
30
|
+
// `DialogContent` stay locked by default while still honoring an explicit
|
|
31
|
+
// `:disable-outside-pointer-events="false"`.
|
|
32
|
+
disableOutsidePointerEvents: undefined,
|
|
33
|
+
},
|
|
34
|
+
);
|
|
26
35
|
const emits = defineEmits<DialogContentEmits>();
|
|
27
36
|
|
|
28
37
|
const rootContext = injectDialogRootContext();
|
|
@@ -4,7 +4,12 @@ import { useEmitAsProps, useForwardExpose, useHideOthers } from '@/shared';
|
|
|
4
4
|
import DialogContentImpl from './DialogContentImpl.vue';
|
|
5
5
|
import { injectDialogRootContext } from './DialogRoot.vue';
|
|
6
6
|
|
|
7
|
-
const props =
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<DialogContentImplProps>(),
|
|
9
|
+
{
|
|
10
|
+
disableOutsidePointerEvents: true,
|
|
11
|
+
},
|
|
12
|
+
);
|
|
8
13
|
const emits = defineEmits<DialogContentImplEmits>();
|
|
9
14
|
|
|
10
15
|
const rootContext = injectDialogRootContext();
|
|
@@ -20,7 +25,7 @@ useHideOthers(currentElement);
|
|
|
20
25
|
v-bind="{ ...props, ...emitsAsProps }"
|
|
21
26
|
:ref="forwardRef"
|
|
22
27
|
:trap-focus="rootContext.open.value"
|
|
23
|
-
:disable-outside-pointer-events="
|
|
28
|
+
:disable-outside-pointer-events="props.disableOutsidePointerEvents"
|
|
24
29
|
@close-auto-focus="
|
|
25
30
|
(event) => {
|
|
26
31
|
if (!event.defaultPrevented) {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
computed,
|
|
10
10
|
nextTick,
|
|
11
11
|
reactive,
|
|
12
|
+
watch,
|
|
12
13
|
watchEffect,
|
|
13
14
|
} from 'vue';
|
|
14
15
|
import { useForwardExpose } from '@/shared';
|
|
@@ -144,29 +145,46 @@ onKeyStroke('Escape', (event) => {
|
|
|
144
145
|
}
|
|
145
146
|
});
|
|
146
147
|
|
|
147
|
-
watchEffect
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
// Use `watch` with explicit sources (instead of `watchEffect`) so this effect
|
|
149
|
+
// only re-runs when `layerElement` or `disableOutsidePointerEvents` change.
|
|
150
|
+
// Reading `context.layersWithOutsidePointerEventsDisabled.size` inside the
|
|
151
|
+
// callback must NOT make it reactive: otherwise adding/removing any other
|
|
152
|
+
// layer would re-run this effect and its cleanup could prematurely restore the
|
|
153
|
+
// body's `pointer-events` while an ancestor layer is still open.
|
|
154
|
+
watch(
|
|
155
|
+
[layerElement, () => props.disableOutsidePointerEvents],
|
|
156
|
+
([element, disableOutsidePointerEvents], _, onCleanup) => {
|
|
157
|
+
if (!element) {
|
|
158
|
+
return;
|
|
155
159
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
if (disableOutsidePointerEvents) {
|
|
161
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
162
|
+
context.originalBodyPointerEvents = ownerDocument.value.body.style.pointerEvents;
|
|
163
|
+
ownerDocument.value.body.style.pointerEvents = 'none';
|
|
164
|
+
}
|
|
165
|
+
context.layersWithOutsidePointerEventsDisabled.add(element);
|
|
166
|
+
|
|
167
|
+
// Remove this layer from the set on cleanup (re-run via prop toggle, or
|
|
168
|
+
// unmount) and restore the body's `pointer-events` only once the last
|
|
169
|
+
// disabling layer is gone. Removing here — rather than relying solely on
|
|
170
|
+
// the unmount-only effect below — keeps the set accurate when
|
|
171
|
+
// `disableOutsidePointerEvents` toggles `true -> false` while still
|
|
172
|
+
// mounted (e.g. a modal Menu closing). Checking `size === 0` *after*
|
|
173
|
+
// deletion makes the restore independent of cleanup ordering.
|
|
174
|
+
onCleanup(() => {
|
|
175
|
+
context.layersWithOutsidePointerEventsDisabled.delete(element);
|
|
176
|
+
if (
|
|
177
|
+
context.layersWithOutsidePointerEventsDisabled.size === 0
|
|
178
|
+
&& !isNullish(context.originalBodyPointerEvents)
|
|
179
|
+
) {
|
|
180
|
+
ownerDocument.value.body.style.pointerEvents = context.originalBodyPointerEvents;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
167
183
|
}
|
|
168
|
-
|
|
169
|
-
}
|
|
184
|
+
layers.value.add(element);
|
|
185
|
+
},
|
|
186
|
+
{ immediate: true },
|
|
187
|
+
);
|
|
170
188
|
|
|
171
189
|
watchEffect((cleanupFn) => {
|
|
172
190
|
cleanupFn(() => {
|
|
@@ -11,6 +11,8 @@ export interface HoverCardRootProps {
|
|
|
11
11
|
openDelay?: number;
|
|
12
12
|
/** The duration from when the mouse leaves the trigger or content until the hover card closes. */
|
|
13
13
|
closeDelay?: number;
|
|
14
|
+
/** When `true`, tapping the trigger on touch devices toggles the hover card open/closed. By default touch interactions are ignored to match pointer hover semantics. */
|
|
15
|
+
enableTouch?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export type HoverCardRootEmits = {
|
|
16
18
|
/** Event handler called when the open state of the hover card changes. */
|
|
@@ -27,6 +29,7 @@ export interface HoverCardRootContext {
|
|
|
27
29
|
isPointerDownOnContentRef: Ref<boolean>;
|
|
28
30
|
isPointerInTransitRef: Ref<boolean>;
|
|
29
31
|
triggerElement: Ref<HTMLElement | undefined>;
|
|
32
|
+
enableTouch: Ref<boolean>;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
export const [injectHoverCardRootContext, provideHoverCardRootContext]
|
|
@@ -43,6 +46,7 @@ const props = withDefaults(defineProps<HoverCardRootProps>(), {
|
|
|
43
46
|
open: undefined,
|
|
44
47
|
openDelay: 700,
|
|
45
48
|
closeDelay: 300,
|
|
49
|
+
enableTouch: false,
|
|
46
50
|
});
|
|
47
51
|
const emit = defineEmits<HoverCardRootEmits>();
|
|
48
52
|
|
|
@@ -53,7 +57,7 @@ defineSlots<{
|
|
|
53
57
|
}) => any;
|
|
54
58
|
}>();
|
|
55
59
|
|
|
56
|
-
const { openDelay, closeDelay } = toRefs(props);
|
|
60
|
+
const { openDelay, closeDelay, enableTouch } = toRefs(props);
|
|
57
61
|
|
|
58
62
|
useForwardExpose();
|
|
59
63
|
const open = useVModel(props, 'open', emit, {
|
|
@@ -70,17 +74,22 @@ const triggerElement = ref<HTMLElement>();
|
|
|
70
74
|
|
|
71
75
|
function handleOpen() {
|
|
72
76
|
clearTimeout(closeTimerRef.value);
|
|
73
|
-
openTimerRef.value = window.setTimeout(() =>
|
|
77
|
+
openTimerRef.value = window.setTimeout(() => {
|
|
78
|
+
open.value = true;
|
|
79
|
+
}, openDelay.value);
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
function handleClose() {
|
|
77
83
|
clearTimeout(openTimerRef.value);
|
|
78
84
|
if (!hasSelectionRef.value && !isPointerDownOnContentRef.value) {
|
|
79
|
-
closeTimerRef.value = window.setTimeout(() =>
|
|
85
|
+
closeTimerRef.value = window.setTimeout(() => {
|
|
86
|
+
open.value = false;
|
|
87
|
+
}, closeDelay.value);
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
90
|
|
|
83
91
|
function handleDismiss() {
|
|
92
|
+
clearTimeout(openTimerRef.value);
|
|
84
93
|
open.value = false;
|
|
85
94
|
}
|
|
86
95
|
|
|
@@ -96,6 +105,7 @@ provideHoverCardRootContext({
|
|
|
96
105
|
isPointerDownOnContentRef,
|
|
97
106
|
isPointerInTransitRef,
|
|
98
107
|
triggerElement,
|
|
108
|
+
enableTouch,
|
|
99
109
|
});
|
|
100
110
|
</script>
|
|
101
111
|
|
|
@@ -25,6 +25,18 @@ function handleLeave() {
|
|
|
25
25
|
}
|
|
26
26
|
}, 0);
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
function handleTouch(event: PointerEvent) {
|
|
30
|
+
if (!rootContext.enableTouch.value || event.pointerType !== 'touch') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (rootContext.open.value) {
|
|
35
|
+
rootContext.onDismiss();
|
|
36
|
+
} else {
|
|
37
|
+
rootContext.onOpenChange(true);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
28
40
|
</script>
|
|
29
41
|
|
|
30
42
|
<template>
|
|
@@ -40,6 +52,7 @@ function handleLeave() {
|
|
|
40
52
|
data-grace-area-trigger
|
|
41
53
|
@pointerenter="excludeTouch(rootContext.onOpen)($event)"
|
|
42
54
|
@pointerleave="excludeTouch(handleLeave)($event)"
|
|
55
|
+
@pointerup="handleTouch"
|
|
43
56
|
@focus="rootContext.onOpen()"
|
|
44
57
|
@blur="rootContext.onClose()"
|
|
45
58
|
>
|