@soybeanjs/headless 0.7.0 → 0.8.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/components/accordion/accordion-item.js +1 -1
- package/dist/components/accordion/accordion-item.vue.d.ts +3 -1
- package/dist/components/alert-dialog/alert-dialog-content.vue.d.ts +2 -2
- package/dist/components/context-menu/context-menu-content.js +1 -1
- package/dist/components/context-menu/context-menu-content.vue.d.ts +4 -4
- package/dist/components/context-menu/context-menu-trigger.js +1 -1
- package/dist/components/dialog/dialog-content.vue.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-content.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-content.vue.d.ts +4 -4
- package/dist/components/dropdown-menu/dropdown-menu-root.vue.d.ts +1 -1
- package/dist/components/layout/layout-root.vue.d.ts +1 -1
- package/dist/components/listbox/listbox-content.js +1 -1
- package/dist/components/listbox/listbox-virtualizer.js +1 -1
- package/dist/components/listbox/types.d.ts +1 -1
- package/dist/components/menu/menu-content-impl.js +1 -1
- package/dist/components/menu/menu-content.js +1 -1
- package/dist/components/menu/menu-content.vue.d.ts +4 -4
- package/dist/components/menu/menu-sub-content.js +1 -1
- package/dist/components/menu/menu-sub-content.vue.d.ts +4 -4
- package/dist/components/navigation-menu/context.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-content-impl.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-indicator.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-item.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-link.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-root.js +1 -1
- package/dist/components/navigation-menu/navigation-menu-root.vue.d.ts +1 -1
- package/dist/components/navigation-menu/navigation-menu-viewport.js +1 -1
- package/dist/components/number-input/context.js +1 -1
- package/dist/components/number-input/number-input-root.js +1 -1
- package/dist/components/number-input/number-input-root.vue.d.ts +1 -0
- package/dist/components/number-input/types.d.ts +2 -0
- package/dist/components/pagination/pagination-root.vue.d.ts +1 -1
- package/dist/components/popover/popover-positioner-impl.js +1 -1
- package/dist/components/popover/popover-positioner.js +1 -1
- package/dist/components/popover/popover-positioner.vue.d.ts +2 -2
- package/dist/components/popper/popper-arrow.js +1 -1
- package/dist/components/popper/popper-positioner.js +1 -1
- package/dist/components/popper/popper-positioner.vue.d.ts +5 -4
- package/dist/components/popper/types.d.ts +7 -0
- package/dist/components/select/select-arrow.js +1 -1
- package/dist/components/select/select-content-impl.js +1 -1
- package/dist/components/select/select-content.js +1 -1
- package/dist/components/select/select-content.vue.d.ts +4 -4
- package/dist/components/select/select-root.vue.d.ts +2 -2
- package/dist/components/select/types.d.ts +2 -2
- package/dist/components/tabs/context.js +1 -1
- package/dist/components/tabs/tabs-content.js +1 -1
- package/dist/components/tabs/tabs-indicator.js +1 -1
- package/dist/components/tabs/tabs-trigger.js +1 -1
- package/dist/components/toast/toast-provider.js +1 -1
- package/dist/components/toast/toast-root.js +1 -1
- package/dist/components/toast/toast-root.vue.d.ts +1 -1
- package/dist/components/toast/types.d.ts +6 -0
- package/dist/components/tooltip/tooltip-popup.js +1 -1
- package/dist/components/tooltip/tooltip-positioner-impl.js +1 -1
- package/dist/components/tooltip/tooltip-positioner.js +1 -1
- package/dist/components/tree-menu/tree-menu-root.vue.d.ts +1 -1
- package/dist/composables/use-grace-area.js +1 -1
- package/dist/shared/dom.d.ts +1 -12
- package/dist/shared/dom.js +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useArrowNavigation as e}from"../../composables/use-arrow-navigation.js";import{getOpenFromSingleOrMultiple as t}from"../../shared/value.js";import{getCollectionItemElements as n}from"../../shared/dom.js";import{transformPropsToContext as r}from"../../shared/vue.js";import"../../shared/index.js";import{useOmitProps as i}from"../../composables/use-props.js";import"../../composables/index.js";import{provideAccordionItemContext as a,useAccordionRootContext as o}from"./context.js";import s from"../collapsible/collapsible-root.js";import"../collapsible/index.js";import{computed as c,createBlock as l,defineComponent as u,mergeProps as d,openBlock as f,renderSlot as p,unref as m,withCtx as h}from"vue";const g=u({name:`AccordionItem`,__name:`accordion-item`,props:{value:{},disabled:{type:Boolean},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},setup(u,{expose:g}){let _=u,v=i(_,[`value`]),{modelValue:y,disabled:b,isMultiple:x,rootElement:S,orientation:C,dir:w,unmountOnHide:T}=o(`AccordionItem`),E=c(()=>t(_.value,y.value,x.value)),D=c(()=>b.value||_.disabled),{dataDisabled:
|
|
1
|
+
import{useArrowNavigation as e}from"../../composables/use-arrow-navigation.js";import{getOpenFromSingleOrMultiple as t}from"../../shared/value.js";import{getCollectionItemElements as n}from"../../shared/dom.js";import{transformPropsToContext as r}from"../../shared/vue.js";import"../../shared/index.js";import{useOmitProps as i}from"../../composables/use-props.js";import"../../composables/index.js";import{provideAccordionItemContext as a,useAccordionRootContext as o}from"./context.js";import s from"../collapsible/collapsible-root.js";import"../collapsible/index.js";import{computed as c,createBlock as l,defineComponent as u,mergeProps as d,openBlock as f,renderSlot as p,unref as m,withCtx as h}from"vue";const g=u({name:`AccordionItem`,__name:`accordion-item`,props:{value:{},disabled:{type:Boolean},unmountOnHide:{type:Boolean,default:void 0},asChild:{type:Boolean},as:{}},setup(u,{expose:g}){let _=u,v=i(_,[`value`]),{modelValue:y,disabled:b,isMultiple:x,rootElement:S,orientation:C,dir:w,unmountOnHide:T}=o(`AccordionItem`),E=c(()=>t(_.value,y.value,x.value)),D=c(()=>b.value||_.disabled),O=c(()=>_.unmountOnHide??T.value),{dataDisabled:k,dataState:A}=a({open:E,disabled:D,...r(_,[`value`])}),j=t=>{if(!S.value)return;let r=n(S.value),i=t.target;r.findIndex(e=>e===i)!==-1&&e(t,i,S.value,{arrowKeyOptions:C.value,dir:w.value,focus:!0})};return g({open:E,dataDisabled:k}),(e,t)=>(f(),l(m(s),d(m(v),{open:E.value,disabled:D.value,"unmount-on-hide":O.value,"data-disabled":m(k),"data-orientation":m(C),"data-state":m(A),onKeydown:j}),{default:h(()=>[p(e.$slots,`default`,{open:E.value})]),_:3},16,[`open`,`disabled`,`unmount-on-hide`,`data-disabled`,`data-orientation`,`data-state`]))}});export{g as default};
|
|
@@ -11,7 +11,9 @@ type __VLS_Slots = {} & {
|
|
|
11
11
|
declare const __VLS_base: vue.DefineComponent<AccordionItemProps, {
|
|
12
12
|
open: vue.ComputedRef<boolean>;
|
|
13
13
|
dataDisabled: vue.ComputedRef<"" | undefined>;
|
|
14
|
-
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<AccordionItemProps> & Readonly<{}>, {
|
|
14
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<AccordionItemProps> & Readonly<{}>, {
|
|
15
|
+
unmountOnHide: boolean;
|
|
16
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
15
17
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
18
|
declare const _default: typeof __VLS_export;
|
|
17
19
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -10,19 +10,19 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
default?: (props: typeof __VLS_12) => any;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: vue.DefineComponent<DialogContentProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
13
|
+
closeAutoFocus: (event: Event) => any;
|
|
13
14
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
14
15
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
15
16
|
focusOutside: (event: FocusOutsideEvent) => any;
|
|
16
17
|
interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
17
18
|
openAutoFocus: (event: Event) => any;
|
|
18
|
-
closeAutoFocus: (event: Event) => any;
|
|
19
19
|
}, string, vue.PublicProps, Readonly<DialogContentProps> & Readonly<{
|
|
20
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
20
21
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
21
22
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
22
23
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
23
24
|
onInteractOutside?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
24
25
|
onOpenAutoFocus?: ((event: Event) => any) | undefined;
|
|
25
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
26
26
|
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import"../../composables/index.js";import t from"../menu/menu-content.js";import"../menu/index.js";import{useContextMenuRootContext as n}from"./context.js";import{createBlock as r,defineComponent as i,mergeProps as a,openBlock as o,renderSlot as s,toHandlers as c,unref as l,withCtx as u}from"vue";const d=i({name:`ContextMenuContent`,__name:`context-menu-content`,props:{popupProps:{},placement:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(i,{emit:d}){let f=i,p=e(d),{modal:m,triggerElement:h}=n(`ContextMenuContent`),g=!1;function _(e){!e.defaultPrevented&&g&&e.preventDefault(),g=!1}function v(e){e.detail.originalEvent.button===2&&e.target===h.value&&e.preventDefault(),!e.defaultPrevented&&!m.value&&(g=!0)}return(e,n)=>(o(),r(l(t),a(f,{side:`right`,"side-offset":2,align:`start`,"update-position-strategy":`always`},c(l(p)),{onCloseAutoFocus:_,onInteractOutside:v}),{default:u(()=>[s(e.$slots,`default`)]),_:3},16))}});export{d as default};
|
|
1
|
+
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import"../../composables/index.js";import t from"../menu/menu-content.js";import"../menu/index.js";import{useContextMenuRootContext as n}from"./context.js";import{createBlock as r,defineComponent as i,mergeProps as a,openBlock as o,renderSlot as s,toHandlers as c,unref as l,withCtx as u}from"vue";const d=i({name:`ContextMenuContent`,__name:`context-menu-content`,props:{popupProps:{},placement:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(i,{emit:d}){let f=i,p=e(d),{modal:m,triggerElement:h}=n(`ContextMenuContent`),g=!1;function _(e){!e.defaultPrevented&&g&&e.preventDefault(),g=!1}function v(e){e.detail.originalEvent.button===2&&e.target===h.value&&e.preventDefault(),!e.defaultPrevented&&!m.value&&(g=!0)}return(e,n)=>(o(),r(l(t),a(f,{side:`right`,"side-offset":2,align:`start`,"update-position-strategy":`always`},c(l(p)),{onCloseAutoFocus:_,onInteractOutside:v}),{default:u(()=>[s(e.$slots,`default`)]),_:3},16))}});export{d as default};
|
|
@@ -9,21 +9,21 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_11) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: vue.DefineComponent<ContextMenuContentProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
12
|
+
closeAutoFocus: (event: Event) => any;
|
|
12
13
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
13
14
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
15
|
+
entryFocus: (event: Event) => any;
|
|
14
16
|
focusOutside: (event: FocusOutsideEvent) => any;
|
|
15
17
|
interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
16
18
|
openAutoFocus: (event: Event) => any;
|
|
17
|
-
closeAutoFocus: (event: Event) => any;
|
|
18
|
-
entryFocus: (event: Event) => any;
|
|
19
19
|
}, string, vue.PublicProps, Readonly<ContextMenuContentProps> & Readonly<{
|
|
20
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
20
21
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
21
22
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
23
|
+
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
22
24
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
23
25
|
onInteractOutside?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
24
26
|
onOpenAutoFocus?: ((event: Event) => any) | undefined;
|
|
25
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
26
|
-
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
28
|
avoidCollisions: boolean;
|
|
29
29
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardElement as e}from"../../composables/use-forward-element.js";import"../../composables/index.js";import{Primitive as t}from"../primitive/primitive.js";import"../primitive/index.js";import n from"../popper/popper-anchor.js";import"../menu/index.js";import{useContextMenuRootContext as r}from"./context.js";import{Fragment as i,computed as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createVNode as l,defineComponent as u,mergeProps as d,nextTick as f,onWatcherCleanup as p,openBlock as m,ref as h,renderSlot as g,unref as _,useAttrs as v,watchEffect as y,withCtx as b}from"vue";const x=u({name:`ContextMenuTrigger`,inheritAttrs:!1,__name:`context-menu-trigger`,props:{reference:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`span`}},setup(u){let x=u,{dataState:S,pressOpenDelay:C,onOpenChange:w,
|
|
1
|
+
import{useForwardElement as e}from"../../composables/use-forward-element.js";import"../../composables/index.js";import{Primitive as t}from"../primitive/primitive.js";import"../primitive/index.js";import n from"../popper/popper-anchor.js";import"../menu/index.js";import{useContextMenuRootContext as r}from"./context.js";import{Fragment as i,computed as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createVNode as l,defineComponent as u,mergeProps as d,nextTick as f,onWatcherCleanup as p,openBlock as m,ref as h,renderSlot as g,unref as _,useAttrs as v,watchEffect as y,withCtx as b}from"vue";const x=u({name:`ContextMenuTrigger`,inheritAttrs:!1,__name:`context-menu-trigger`,props:{reference:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{default:`span`}},setup(u){let x=u,{dataState:S,pressOpenDelay:C,onOpenChange:w,onTriggerElementChange:T}=r(`ContextMenuTrigger`),[E,D]=e(e=>{T(e)}),O=v(),k=a(()=>x.disabled?``:void 0),A=h({x:0,y:0}),j=a(()=>({getBoundingClientRect:()=>({width:0,height:0,left:A.value.x,right:A.value.x,top:A.value.y,bottom:A.value.y,...A.value})})),M=null,N=()=>{M&&(window.clearTimeout(M),M=null)},P=e=>{let{clientX:t,clientY:n}=e;A.value={x:t,y:n},w(!0)},F=e=>e.pointerType!==`mouse`,I=async e=>{x.disabled||(await f(),!e.defaultPrevented&&(N(),P(e),e.preventDefault()))},L=async e=>{x.disabled||(await f(),!e.defaultPrevented&&F(e)&&(N(),M=window.setTimeout(()=>{P(e)},C.value)))},R=async e=>{x.disabled||(await f(),!e.defaultPrevented&&F(e)&&N())};return y(()=>{x.reference&&(T(x.reference),x.reference.addEventListener(`contextmenu`,I),x.reference.addEventListener(`pointerdown`,L),x.reference.addEventListener(`pointermove`,R),x.reference.addEventListener(`pointercancel`,R),x.reference.addEventListener(`pointerup`,R),p(()=>{x.reference?.removeEventListener(`contextmenu`,I),x.reference?.removeEventListener(`pointerdown`,L),x.reference?.removeEventListener(`pointermove`,R),x.reference?.removeEventListener(`pointercancel`,R),x.reference?.removeEventListener(`pointerup`,R)}))}),(e,r)=>(m(),c(i,null,[l(_(n),{as:`template`,reference:j.value},null,8,[`reference`]),u.reference?s(`v-if`,!0):(m(),o(_(t),d({key:0,ref:_(D)},{...x,..._(O)},{"data-disabled":k.value,"data-state":_(S),style:{WebkitTouchCallout:`none`,pointerEvents:`auto`},onContextmenu:I,onPointerdown:L,onPointermove:R,onPointercancel:R,onPointerup:R}),{default:b(()=>[g(e.$slots,`default`)]),_:3},16,[`data-disabled`,`data-state`]))],64))}});export{x as default};
|
|
@@ -9,19 +9,19 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_13) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: vue.DefineComponent<DialogContentProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
12
|
+
closeAutoFocus: (event: Event) => any;
|
|
12
13
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
13
14
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
14
15
|
focusOutside: (event: FocusOutsideEvent) => any;
|
|
15
16
|
interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
16
17
|
openAutoFocus: (event: Event) => any;
|
|
17
|
-
closeAutoFocus: (event: Event) => any;
|
|
18
18
|
}, string, vue.PublicProps, Readonly<DialogContentProps> & Readonly<{
|
|
19
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
19
20
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
20
21
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
21
22
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
22
23
|
onInteractOutside?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
23
24
|
onOpenAutoFocus?: ((event: Event) => any) | undefined;
|
|
24
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
25
25
|
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
27
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{useGraceArea as t}from"../../composables/use-grace-area.js";import"../../composables/index.js";import{useMenuContext as n}from"../menu/context.js";import r from"../menu/menu-content.js";import"../menu/index.js";import{DROPDOWN_MENU_HOVER_OPEN as i}from"./shared.js";import{useDropdownMenuHoverContext as a,useDropdownMenuRootContext as o}from"./context.js";import{computed as s,createBlock as c,defineComponent as l,mergeProps as u,onWatcherCleanup as d,openBlock as f,renderSlot as p,toHandlers as m,unref as h,watchPostEffect as g,withCtx as _}from"vue";const v=l({name:`DropdownMenuContent`,__name:`dropdown-menu-content`,props:{popupProps:{},placement:{},side:{},sideOffset:{default:8},sideFlip:{type:Boolean,default:!0},align:{},alignOffset:{},alignFlip:{type:Boolean,default:!0},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(l,{emit:v}){let y=l,b=e(v),{popupElement:x,triggerElement:S}=n(`DropdownMenuContent`),{modal:C}=o(`DropdownMenuContent`),{isPointerInTransitRef:w,hoverable:T,onClose:E}=a(`DropdownMenuContent`);t({triggerElement:S,areaElement:x,onPointerInTransitChange:e=>{w.value=e},onPointerExit:()=>{E()},subAreaAttribute:`data-soybean-menu-sub-popup`,disabled:s(()=>!T.value)});let D=!1,O=e=>{e.defaultPrevented||T.value||D||(setTimeout(()=>{S.value?.focus()},0),D=!1,e.preventDefault())},k=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!C.value||r)&&(D=!0),S.value?.contains(e.target)&&e.preventDefault()};return g(()=>{if(!T.value)return;let e=e=>{e.target?.contains(S.value)&&E()};window.addEventListener(`scroll`,e),window.addEventListener(i,E),d(()=>{window.removeEventListener(`scroll`,e),window.removeEventListener(i,E)})}),(e,t)=>(f(),c(h(r),u(y,m(h(b)),{onCloseAutoFocus:O,onInteractOutside:k}),{default:_(()=>[p(e.$slots,`default`)]),_:3},16))}});export{v as default};
|
|
1
|
+
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{useGraceArea as t}from"../../composables/use-grace-area.js";import"../../composables/index.js";import{useMenuContext as n}from"../menu/context.js";import r from"../menu/menu-content.js";import"../menu/index.js";import{DROPDOWN_MENU_HOVER_OPEN as i}from"./shared.js";import{useDropdownMenuHoverContext as a,useDropdownMenuRootContext as o}from"./context.js";import{computed as s,createBlock as c,defineComponent as l,mergeProps as u,onWatcherCleanup as d,openBlock as f,renderSlot as p,toHandlers as m,unref as h,watchPostEffect as g,withCtx as _}from"vue";const v=l({name:`DropdownMenuContent`,__name:`dropdown-menu-content`,props:{popupProps:{},placement:{},side:{},sideOffset:{default:8},sideFlip:{type:Boolean,default:!0},align:{},alignOffset:{},alignFlip:{type:Boolean,default:!0},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(l,{emit:v}){let y=l,b=e(v),{popupElement:x,triggerElement:S}=n(`DropdownMenuContent`),{modal:C}=o(`DropdownMenuContent`),{isPointerInTransitRef:w,hoverable:T,onClose:E}=a(`DropdownMenuContent`);t({triggerElement:S,areaElement:x,onPointerInTransitChange:e=>{w.value=e},onPointerExit:()=>{E()},subAreaAttribute:`data-soybean-menu-sub-popup`,disabled:s(()=>!T.value)});let D=!1,O=e=>{e.defaultPrevented||T.value||D||(setTimeout(()=>{S.value?.focus()},0),D=!1,e.preventDefault())},k=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!C.value||r)&&(D=!0),S.value?.contains(e.target)&&e.preventDefault()};return g(()=>{if(!T.value)return;let e=e=>{e.target?.contains(S.value)&&E()};window.addEventListener(`scroll`,e),window.addEventListener(i,E),d(()=>{window.removeEventListener(`scroll`,e),window.removeEventListener(i,E)})}),(e,t)=>(f(),c(h(r),u(y,m(h(b)),{onCloseAutoFocus:O,onInteractOutside:k}),{default:_(()=>[p(e.$slots,`default`)]),_:3},16))}});export{v as default};
|
|
@@ -10,21 +10,21 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
default?: (props: typeof __VLS_11) => any;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: vue.DefineComponent<MenuContentProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
13
|
+
closeAutoFocus: (event: Event) => any;
|
|
13
14
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
14
15
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
16
|
+
entryFocus: (event: Event) => any;
|
|
15
17
|
focusOutside: (event: FocusOutsideEvent) => any;
|
|
16
18
|
interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
17
19
|
openAutoFocus: (event: Event) => any;
|
|
18
|
-
closeAutoFocus: (event: Event) => any;
|
|
19
|
-
entryFocus: (event: Event) => any;
|
|
20
20
|
}, string, vue.PublicProps, Readonly<MenuContentProps> & Readonly<{
|
|
21
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
21
22
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
22
23
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
24
|
+
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
23
25
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
24
26
|
onInteractOutside?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
25
27
|
onOpenAutoFocus?: ((event: Event) => any) | undefined;
|
|
26
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
27
|
-
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
29
|
sideOffset: number;
|
|
30
30
|
sideFlip: boolean;
|
|
@@ -14,10 +14,10 @@ declare const __VLS_base: vue.DefineComponent<DropdownMenuRootProps, {}, {}, {},
|
|
|
14
14
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
16
|
open: boolean;
|
|
17
|
-
modal: boolean;
|
|
18
17
|
trigger: DropdownMenuTriggerType;
|
|
19
18
|
delayDuration: number;
|
|
20
19
|
skipDelayDuration: number;
|
|
20
|
+
modal: boolean;
|
|
21
21
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
23
|
declare const _default: typeof __VLS_export;
|
|
@@ -16,8 +16,8 @@ declare const __VLS_base: vue.DefineComponent<LayoutRootProps, {}, {}, {}, {}, v
|
|
|
16
16
|
}>, {
|
|
17
17
|
collapsible: LayoutCollapsible;
|
|
18
18
|
open: boolean;
|
|
19
|
-
side: LayoutSide;
|
|
20
19
|
defaultOpen: boolean;
|
|
20
|
+
side: LayoutSide;
|
|
21
21
|
variant: LayoutVariant;
|
|
22
22
|
sidebarWidth: number;
|
|
23
23
|
collapsedSidebarWidth: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardElement as e}from"../../composables/use-forward-element.js";import"../../composables/index.js";import{useCollectionContext as t,useListboxRootContext as n,useListboxUi as r}from"./context.js";import{computed as i,createElementBlock as a,defineComponent as o,normalizeClass as s,openBlock as c,renderSlot as l,unref as u,withKeys as d,withModifiers as f}from"vue";import{refAutoReset as p}from"@vueuse/shared";const m=[`tabindex`,`aria-orientation`,`aria-multiselectable`,`data-orientation
|
|
1
|
+
import{useForwardElement as e}from"../../composables/use-forward-element.js";import"../../composables/index.js";import{useCollectionContext as t,useListboxRootContext as n,useListboxUi as r}from"./context.js";import{computed as i,createElementBlock as a,defineComponent as o,normalizeClass as s,openBlock as c,renderSlot as l,unref as u,withKeys as d,withModifiers as f}from"vue";import{refAutoReset as p}from"@vueuse/shared";const m=[`tabindex`,`aria-orientation`,`aria-multiselectable`,`data-orientation`],h=o({name:`ListboxContent`,__name:`listbox-content`,setup(o){let{orientation:h,focusable:g,highlightedElement:_,isMultiple:v,onEnter:y,onKeydownNavigation:b,onKeydownEnter:x,onKeydownTypeahead:S}=n(`ListboxContent`),{onContainerElementChange:C}=t(`ListboxContent`),[w,T]=e(e=>{C(e)}),E=r(`content`),D=p(!1,10),O=i(()=>g.value?_.value?`-1`:`0`:`-1`),k=e=>{D.value||y(e)},A=e=>{h.value===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(e.key)||h.value===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(e.key)||(e.preventDefault(),g.value&&b(e))},j=()=>{D.value=!0};return(e,t)=>(c(),a(`div`,{ref:u(T),class:s(u(E)),role:`listbox`,tabindex:O.value,"aria-orientation":u(h),"aria-multiselectable":u(v),"data-orientation":u(h),onMousedown:f(j,[`left`]),onFocus:k,onKeydown:[d(A,[`down`,`up`,`left`,`right`,`home`,`end`]),t[0]||(t[0]=d((...e)=>u(x)&&u(x)(...e),[`enter`])),t[1]||(t[1]=(...e)=>u(S)&&u(S)(...e))]},[l(e.$slots,`default`)],42,m))}});export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAP_KEY_TO_FOCUS_INTENT as e}from"../../constants/common.js";import{findValuesBetween as t,getNextMatch as n}from"../../shared/object.js";import{getActiveElement as r}from"../../shared/dom.js";import"../../shared/index.js";import{useCollectionContext as i,useListboxRootContext as a,useListboxUi as o}from"./context.js";import{getVirtualizerItems as s,getVirtualizerPadding as c,queryCheckedElement as l}from"./shared.js";import{Fragment as u,computed as d,createBlock as f,createElementBlock as p,defineComponent as m,normalizeClass as h,normalizeStyle as g,openBlock as _,renderList as v,resolveDynamicComponent as y,unref as b,useSlots as x}from"vue";import{refAutoReset as S,useParentElement as C}from"@vueuse/core";import{useVirtualizer as w}from"@tanstack/vue-virtual";const T=m({name:`ListboxVirtualizer`,__name:`listbox-virtualizer`,props:{options:{},overscan:{},estimateSize:{},textContent:{type:Function}},setup(m){let T=m,E=x(),{modelValue:D,isMultiple:O,orientation:k,firstValue:A,isVirtual:j,virtualFocusHook:M,virtualHighlightHook:N,virtualKeydownHook:P,highlightedElement:F,changeHighlight:I,highlightFirstItem:L}=a(`ListboxVirtualizer`);j.value=!0;let R=o(`virtualizer`),{getOrderedItems:z,getOrderedElements:B}=i(`ListboxVirtualizer`),V=S(``,1e3),H=d(()=>{let e=e=>T.textContent?T.textContent(e):e?.toString()?.toLowerCase();return T.options.map((t,n)=>({index:n,textContent:e(t)}))}),U=C(),W=d(()=>c(U.value)),G=w(d(()=>({scrollPaddingStart:W.value.start,scrollPaddingEnd:W.value.end,count:T.options.length,horizontal:k.value===`horizontal`,overscan:T.overscan??12,estimateSize:()
|
|
1
|
+
import{MAP_KEY_TO_FOCUS_INTENT as e}from"../../constants/common.js";import{findValuesBetween as t,getNextMatch as n}from"../../shared/object.js";import{getActiveElement as r}from"../../shared/dom.js";import"../../shared/index.js";import{useCollectionContext as i,useListboxRootContext as a,useListboxUi as o}from"./context.js";import{getVirtualizerItems as s,getVirtualizerPadding as c,queryCheckedElement as l}from"./shared.js";import{Fragment as u,computed as d,createBlock as f,createElementBlock as p,defineComponent as m,normalizeClass as h,normalizeStyle as g,openBlock as _,renderList as v,resolveDynamicComponent as y,unref as b,useSlots as x}from"vue";import{refAutoReset as S,useParentElement as C}from"@vueuse/core";import{useVirtualizer as w}from"@tanstack/vue-virtual";const T=m({name:`ListboxVirtualizer`,__name:`listbox-virtualizer`,props:{options:{},overscan:{},estimateSize:{type:[Number,Function]},textContent:{type:Function}},setup(m){let T=m,E=x(),{modelValue:D,isMultiple:O,orientation:k,firstValue:A,isVirtual:j,virtualFocusHook:M,virtualHighlightHook:N,virtualKeydownHook:P,highlightedElement:F,changeHighlight:I,highlightFirstItem:L}=a(`ListboxVirtualizer`);j.value=!0;let R=o(`virtualizer`),{getOrderedItems:z,getOrderedElements:B}=i(`ListboxVirtualizer`),V=S(``,1e3),H=d(()=>{let e=e=>T.textContent?T.textContent(e):e?.toString()?.toLowerCase();return T.options.map((t,n)=>({index:n,textContent:e(t)}))}),U=C(),W=d(()=>c(U.value)),G=w(d(()=>({scrollPaddingStart:W.value.start,scrollPaddingEnd:W.value.end,count:T.options.length,horizontal:k.value===`horizontal`,overscan:T.overscan??12,estimateSize:e=>typeof T.estimateSize==`function`?T.estimateSize(e):T.estimateSize??28,getScrollElement:()=>U.value}))),K=d(()=>G.value.getTotalSize()),q=d(()=>`position:relative;width:100%;height:${K.value}px;`),J=d(()=>s(G.value,T.options,E.default));M.on(e=>{let t=T.options.findIndex(e=>e===(Array.isArray(D.value)?D.value[0]:D.value));t===-1?L():(e?.preventDefault(),G.value.scrollToIndex(t,{align:`start`}),requestAnimationFrame(()=>{let t=l(U.value);t&&(I(t),e&&t.focus())}))}),N.on(e=>{let t=T.options.findIndex(t=>t===e);G.value.scrollToIndex(t,{align:`start`}),requestAnimationFrame(()=>{let e=l(U.value);e&&I(e)})}),P.on(t=>{let i=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!i)return;let a=e[t.key];if(i&&t.key===`a`&&O.value?(t.preventDefault(),D.value=[...T.options],a=`last`):t.shiftKey&&a&&Y(t,a),[`first`,`last`].includes(a)){t.preventDefault();let e=a===`first`?0:T.options.length-1;G.value.scrollToIndex(e),requestAnimationFrame(()=>{let e=B(),t=a===`first`?e[0]:e[e.length-1];t&&I(t)})}else if(!a&&!i){V.value+=t.key;let e=Number(r()?.getAttribute(`data-index`)),i=H.value[e]?.textContent,a=n(H.value.map(e=>e.textContent||``),V.value,i),o=H.value.find(e=>e.textContent===a);o&&(G.value.scrollToIndex(o.index,{align:`start`}),requestAnimationFrame(()=>{let e=U.value?.querySelector(`[data-index="${o.index}"]`);e instanceof HTMLElement&&I(e)}))}});function Y(e,n){if(!A.value||!O.value||!Array.isArray(D.value))return;let r=z().find(e=>e.element===F.value)?.data?.value;if(!r)return;let i=null;switch(n){case`prev`:case`next`:i=t(T.options,A.value,r);break;case`first`:i=t(T.options,A.value,T.options?.[0]);break;case`last`:i=t(T.options,A.value,T.options?.[T.options.length-1]);break;default:}D.value=i??void 0}return(e,t)=>(_(),p(`div`,{"data-soybean-virtualizer":``,class:h(b(R)),style:g(q.value)},[(_(!0),p(u,null,v(J.value,({is:e,item:t})=>(_(),f(y(e),{key:t.index}))),128))],6))}});export{T as default};
|
|
@@ -69,7 +69,7 @@ interface ListboxVirtualizerProps {
|
|
|
69
69
|
/** Number of items rendered outside the visible area */
|
|
70
70
|
overscan?: number;
|
|
71
71
|
/** Estimated size (in px) of each item */
|
|
72
|
-
estimateSize?: number;
|
|
72
|
+
estimateSize?: number | ((index: number) => number);
|
|
73
73
|
/** Text content for each item to achieve type-ahead feature */
|
|
74
74
|
textContent?: (option: string) => string;
|
|
75
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COLLECTION_ITEM_ATTRIBUTE as e}from"../../constants/attr.js";import{useArrowNavigation as t}from"../../composables/use-arrow-navigation.js";import{getActiveElement as n}from"../../shared/dom.js";import{tryFocusFirst as ee}from"../../shared/focus.js";import{isMouseEvent as r}from"../../shared/event.js";import"../../shared/index.js";import{useBodyScrollLock as i}from"../../composables/use-body-scroll-lock.js";import{useDismissableLayer as a}from"../../composables/use-dismissable-layer.js";import{useForwardElement as o}from"../../composables/use-forward-element.js";import{useFocusGuards as s}from"../../composables/use-focus-guards.js";import{useFocusScope as c}from"../../composables/use-focus-scope.js";import{useHideOthers as l}from"../../composables/use-hide-others.js";import{useOmitProps as te}from"../../composables/use-props.js";import{useTypeahead as ne}from"../../composables/use-typeahead.js";import"../../composables/index.js";import u from"../roving-focus/roving-focus-group.js";import"../roving-focus/index.js";import{popperCssVars as d}from"../popper/shared.js";import re from"../popper/popper-positioner.js";import ie from"../popper/popper-popup.js";import"../popper/index.js";import{provideMenuContentContext as f,useMenuContext as p,useMenuRootContext as m,useMenuUi as h}from"./context.js";import{FIRST_LAST_KEYS as g,LAST_KEYS as _,MENU_POPUP_DATA_ATTRIBUTE as v,menuCssVars as y,subMenuCssVars as b}from"./shared.js";import{computed as x,createBlock as ae,createVNode as S,defineComponent as C,isRef as w,mergeProps as T,onWatcherCleanup as E,openBlock as D,renderSlot as O,unref as k,useTemplateRef as A,watchEffect as j,withCtx as M}from"vue";const N=C({name:`MenuContentImpl`,__name:`menu-content-impl`,props:{popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(C,{emit:N}){let P=C,F=N,{modal:I,dir:L,isUsingKeyboard:R}=m(`MenuContentImpl`),{isRoot:z,dataState:B,popupId:V,triggerId:H,dataPopupAttr:oe,initPopupId:U,onOpenChange:W,onPopupElementChange:G}=p(`MenuContentImpl`),[K,q]=o(),[J,se]=o(e=>{G(e)}),{currentItemId:Y,searchRef:ce,pointerSide:le}=f({popupElement:J}),X=h(),Z=x(()=>z?X.value?.positioner:X.value?.subPositioner),ue=x(()=>z?X.value?.popup:X.value?.subPopup),{handleTypeaheadSearch:de}=ne(),Q=A(`rovingFocusGroupRef`),{pointerEvents:fe}=a(J,{disableOutsidePointerEvents:()=>P.disableOutsidePointerEvents,onEscapeKeyDown:e=>{F(`escapeKeyDown`,e)},onPointerDownOutside:e=>{F(`pointerDownOutside`,e)},onFocusOutside:e=>{F(`focusOutside`,e)},onInteractOutside:e=>{F(`interactOutside`,e)},onDismiss:()=>{z&&W(!1)}}),{onKeydown:pe}=c(K,{trapped:()=>P.trapFocus,onOpenAutoFocus:e=>{F(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),J.value?.focus({preventScroll:!0}))},onCloseAutoFocus:e=>{F(`closeAutoFocus`,e)}}),me=te(P,[`disableOutsidePointerEvents`,`trapFocus`,`loop`,`popupProps`]),he=x(()=>({...P.popupProps,[oe]:``})),ge=x(()=>{let e=z?y:b;return{[e.popupTransformOrigin]:`var(${d.transformOrigin})`,[e.popupAvailableWidth]:`var(${d.availableWidth})`,[e.popupAvailableHeight]:`var(${d.availableHeight})`,[e.triggerWidth]:`var(${d.anchorWidth})`,[e.triggerHeight]:`var(${d.anchorHeight})`,pointerEvents:fe.value}}),_e=e=>{F(`entryFocus`,e),R.value||e.preventDefault()},ve=r=>{if(pe(r),r.defaultPrevented)return;let i=r.target.closest(`[${v}]`)===r.currentTarget,a=r.ctrlKey||r.altKey||r.metaKey,o=r.key.length===1,s=t(r,n(),J.value,{loop:P.loop,arrowKeyOptions:`vertical`,dir:L.value,focus:!0,attributeName:`[${e}]:not([data-disabled])`});if(s){s.focus();return}if(r.code===`Space`)return;let c=Q.value?.getItems()??[];if(i&&(r.key===`Tab`&&r.preventDefault(),!a&&o&&de(r.key,c)),r.target!==J.value||!g.includes(r.key))return;r.preventDefault();let l=c.map(e=>e.element);_.includes(r.key)&&l.reverse(),ee(l)};function ye(e){if(!e)return;let{currentTarget:t,target:n}=e;t?.contains(n)||(ce.value=``)}let $=0;function be(e){if(!r(e))return;let t=e.target,n=$!==e.clientX;(e?.currentTarget)?.contains(t)&&n&&(le.value=e.clientX>$?`right`:`left`,$=e.clientX)}return U(),s(),l(K,()=>I.value&&z),j(()=>{P.disableOutsidePointerEvents&&E(i())}),(e,t)=>(D(),ae(k(u),{ref_key:`rovingFocusGroupRef`,ref:Q,"current-tab-stop-id":k(Y),"onUpdate:currentTabStopId":t[0]||(t[0]=e=>w(Y)?Y.value=e:null),"as-child":``,orientation:`vertical`,dir:k(L),loop:C.loop,onEntryFocus:_e},{default:M(()=>[S(k(re),T(k(me),{ref:k(q),class:Z.value,onKeydown:ve,onBlur:ye,onPointermove:be}),{default:M(()=>[S(k(ie),T(he.value,{id:k(V),ref:k(se),class:ue.value,"aria-labelledby":k(H),"aria-orientation":`vertical`,"data-dismissable-layer":``,"data-state":k(B),dir:k(L),role:`menu`,tabindex:`-1`,style:ge.value}),{default:M(()=>[O(e.$slots,`default`)]),_:3},16,[`id`,`class`,`aria-labelledby`,`data-state`,`dir`,`style`])]),_:3},16,[`class`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`]))}});export{N as default};
|
|
1
|
+
import{COLLECTION_ITEM_ATTRIBUTE as e}from"../../constants/attr.js";import{useArrowNavigation as t}from"../../composables/use-arrow-navigation.js";import{getActiveElement as n}from"../../shared/dom.js";import{tryFocusFirst as ee}from"../../shared/focus.js";import{isMouseEvent as r}from"../../shared/event.js";import"../../shared/index.js";import{useBodyScrollLock as i}from"../../composables/use-body-scroll-lock.js";import{useDismissableLayer as a}from"../../composables/use-dismissable-layer.js";import{useForwardElement as o}from"../../composables/use-forward-element.js";import{useFocusGuards as s}from"../../composables/use-focus-guards.js";import{useFocusScope as c}from"../../composables/use-focus-scope.js";import{useHideOthers as l}from"../../composables/use-hide-others.js";import{useOmitProps as te}from"../../composables/use-props.js";import{useTypeahead as ne}from"../../composables/use-typeahead.js";import"../../composables/index.js";import u from"../roving-focus/roving-focus-group.js";import"../roving-focus/index.js";import{popperCssVars as d}from"../popper/shared.js";import re from"../popper/popper-positioner.js";import ie from"../popper/popper-popup.js";import"../popper/index.js";import{provideMenuContentContext as f,useMenuContext as p,useMenuRootContext as m,useMenuUi as h}from"./context.js";import{FIRST_LAST_KEYS as g,LAST_KEYS as _,MENU_POPUP_DATA_ATTRIBUTE as v,menuCssVars as y,subMenuCssVars as b}from"./shared.js";import{computed as x,createBlock as ae,createVNode as S,defineComponent as C,isRef as w,mergeProps as T,onWatcherCleanup as E,openBlock as D,renderSlot as O,unref as k,useTemplateRef as A,watchEffect as j,withCtx as M}from"vue";const N=C({name:`MenuContentImpl`,__name:`menu-content-impl`,props:{popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(C,{emit:N}){let P=C,F=N,{modal:I,dir:L,isUsingKeyboard:R}=m(`MenuContentImpl`),{isRoot:z,dataState:B,popupId:V,triggerId:H,dataPopupAttr:oe,initPopupId:U,onOpenChange:W,onPopupElementChange:G}=p(`MenuContentImpl`),[K,q]=o(),[J,se]=o(e=>{G(e)}),{currentItemId:Y,searchRef:ce,pointerSide:le}=f({popupElement:J}),X=h(),Z=x(()=>z?X.value?.positioner:X.value?.subPositioner),ue=x(()=>z?X.value?.popup:X.value?.subPopup),{handleTypeaheadSearch:de}=ne(),Q=A(`rovingFocusGroupRef`),{pointerEvents:fe}=a(J,{disableOutsidePointerEvents:()=>P.disableOutsidePointerEvents,onEscapeKeyDown:e=>{F(`escapeKeyDown`,e)},onPointerDownOutside:e=>{F(`pointerDownOutside`,e)},onFocusOutside:e=>{F(`focusOutside`,e)},onInteractOutside:e=>{F(`interactOutside`,e)},onDismiss:()=>{z&&W(!1)}}),{onKeydown:pe}=c(K,{trapped:()=>P.trapFocus,onOpenAutoFocus:e=>{F(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),J.value?.focus({preventScroll:!0}))},onCloseAutoFocus:e=>{F(`closeAutoFocus`,e)}}),me=te(P,[`disableOutsidePointerEvents`,`trapFocus`,`loop`,`popupProps`]),he=x(()=>({...P.popupProps,[oe]:``})),ge=x(()=>{let e=z?y:b;return{[e.popupTransformOrigin]:`var(${d.transformOrigin})`,[e.popupAvailableWidth]:`var(${d.availableWidth})`,[e.popupAvailableHeight]:`var(${d.availableHeight})`,[e.triggerWidth]:`var(${d.anchorWidth})`,[e.triggerHeight]:`var(${d.anchorHeight})`,pointerEvents:fe.value}}),_e=e=>{F(`entryFocus`,e),R.value||e.preventDefault()},ve=r=>{if(pe(r),r.defaultPrevented)return;let i=r.target.closest(`[${v}]`)===r.currentTarget,a=r.ctrlKey||r.altKey||r.metaKey,o=r.key.length===1,s=t(r,n(),J.value,{loop:P.loop,arrowKeyOptions:`vertical`,dir:L.value,focus:!0,attributeName:`[${e}]:not([data-disabled])`});if(s){s.focus();return}if(r.code===`Space`)return;let c=Q.value?.getItems()??[];if(i&&(r.key===`Tab`&&r.preventDefault(),!a&&o&&de(r.key,c)),r.target!==J.value||!g.includes(r.key))return;r.preventDefault();let l=c.map(e=>e.element);_.includes(r.key)&&l.reverse(),ee(l)};function ye(e){if(!e)return;let{currentTarget:t,target:n}=e;t?.contains(n)||(ce.value=``)}let $=0;function be(e){if(!r(e))return;let t=e.target,n=$!==e.clientX;(e?.currentTarget)?.contains(t)&&n&&(le.value=e.clientX>$?`right`:`left`,$=e.clientX)}return U(),s(),l(K,()=>I.value&&z),j(()=>{P.disableOutsidePointerEvents&&E(i())}),(e,t)=>(D(),ae(k(u),{ref_key:`rovingFocusGroupRef`,ref:Q,"current-tab-stop-id":k(Y),"onUpdate:currentTabStopId":t[0]||(t[0]=e=>w(Y)?Y.value=e:null),"as-child":``,orientation:`vertical`,dir:k(L),loop:C.loop,onEntryFocus:_e},{default:M(()=>[S(k(re),T(k(me),{ref:k(q),class:Z.value,onKeydown:ve,onBlur:ye,onPointermove:be}),{default:M(()=>[S(k(ie),T(he.value,{id:k(V),ref:k(se),class:ue.value,"aria-labelledby":k(H),"aria-orientation":`vertical`,"data-dismissable-layer":``,"data-state":k(B),dir:k(L),role:`menu`,tabindex:`-1`,style:ge.value}),{default:M(()=>[O(e.$slots,`default`)]),_:3},16,[`id`,`class`,`aria-labelledby`,`data-state`,`dir`,`style`])]),_:3},16,[`class`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`]))}});export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import{useOmitProps as n}from"../../composables/use-props.js";import"../../composables/index.js";import{useMenuContext as r,useMenuRootContext as i}from"./context.js";import a from"./menu-content-impl.js";import{computed as o,createBlock as s,createCommentVNode as c,defineComponent as l,mergeProps as u,openBlock as d,renderSlot as f,shallowRef as p,toHandlers as m,unref as h,withCtx as g}from"vue";const _=l({name:`MenuContent`,__name:`menu-content`,props:{popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(l,{emit:_}){let v=l,y=_,b=n(v,[`forceMount`]),x=e(y),{open:S,popupElement:C}=r(`MenuContent`),{modal:w}=i(`MenuContent`),T=v.forceMount?p(!0):t(C,S),E=o(()=>w.value&&S.value),D=e=>{w.value&&e.preventDefault()};return(e,t)=>h(T)?(d(),s(a,u({key:0},h(b),{"trap-focus":E.value,"disable-outside-pointer-events":E.value},m(h(x)),{onFocusOutside:D}),{default:g(()=>[f(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`])):c(`v-if`,!0)}});export{_ as default};
|
|
1
|
+
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import{useOmitProps as n}from"../../composables/use-props.js";import"../../composables/index.js";import{useMenuContext as r,useMenuRootContext as i}from"./context.js";import a from"./menu-content-impl.js";import{computed as o,createBlock as s,createCommentVNode as c,defineComponent as l,mergeProps as u,openBlock as d,renderSlot as f,shallowRef as p,toHandlers as m,unref as h,withCtx as g}from"vue";const _=l({name:`MenuContent`,__name:`menu-content`,props:{popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(l,{emit:_}){let v=l,y=_,b=n(v,[`forceMount`]),x=e(y),{open:S,popupElement:C}=r(`MenuContent`),{modal:w}=i(`MenuContent`),T=v.forceMount?p(!0):t(C,S),E=o(()=>w.value&&S.value),D=e=>{w.value&&e.preventDefault()};return(e,t)=>h(T)?(d(),s(a,u({key:0},h(b),{"trap-focus":E.value,"disable-outside-pointer-events":E.value},m(h(x)),{onFocusOutside:D}),{default:g(()=>[f(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`])):c(`v-if`,!0)}});export{_ as default};
|
|
@@ -10,21 +10,21 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
default?: (props: typeof __VLS_10) => any;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: vue.DefineComponent<MenuContentProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
13
|
+
closeAutoFocus: (event: Event) => any;
|
|
13
14
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
14
15
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
16
|
+
entryFocus: (event: Event) => any;
|
|
15
17
|
focusOutside: (event: FocusOutsideEvent) => any;
|
|
16
18
|
interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
17
19
|
openAutoFocus: (event: Event) => any;
|
|
18
|
-
closeAutoFocus: (event: Event) => any;
|
|
19
|
-
entryFocus: (event: Event) => any;
|
|
20
20
|
}, string, vue.PublicProps, Readonly<MenuContentProps> & Readonly<{
|
|
21
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
21
22
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
22
23
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
24
|
+
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
23
25
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
24
26
|
onInteractOutside?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
25
27
|
onOpenAutoFocus?: ((event: Event) => any) | undefined;
|
|
26
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
27
|
-
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
28
28
|
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import"../../composables/index.js";import{useMenuContext as n,useMenuRootContext as r}from"./context.js";import{SUB_CLOSE_KEYS as i}from"./shared.js";import a from"./menu-content-impl.js";import{computed as o,createBlock as s,createCommentVNode as c,defineComponent as l,mergeProps as u,openBlock as d,renderSlot as f,shallowRef as p,toHandlers as m,unref as h,withCtx as g,withModifiers as _}from"vue";const v=l({name:`MenuSubContent`,__name:`menu-sub-content`,props:{popupProps:{},placement:{},sideOffset:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean,default:!0},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(l,{emit:v}){let y=l,b=e(v),{open:x,popupElement:S,triggerId:C,triggerElement:w,onOpenChange:T}=n(`MenuSubContent`),{dir:E,isUsingKeyboard:D,onClose:O}=r(`MenuSubContent`),k=y.forceMount?p(!0):t(S,x),A=o(()=>E.value===`rtl`?`left`:`right`),j=()=>{D.value&&S.value?.focus()},M=e=>{e.defaultPrevented||e.target!==w.value&&T(!1)},N=e=>{O(),e.preventDefault()},P=e=>{let t=e.currentTarget?.contains(e.target),n=i[E.value].includes(e.key);t&&n&&(T(!1),w.value?.focus(),e.preventDefault())};return(e,t)=>h(k)?(d(),s(a,u({key:0},y,{"trap-focus":!1,"disable-outside-pointer-events":!1,"aria-labelledby":h(C),align:`start`,side:A.value},m(h(b)),{onOpenAutoFocus:_(j,[`prevent`]),onCloseAutoFocus:t[0]||(t[0]=_(()=>{},[`prevent`])),onEscapeKeyDown:N,onFocusOutside:M,onKeydown:P}),{default:g(()=>[f(e.$slots,`default`)]),_:3},16,[`aria-labelledby`,`side`])):c(`v-if`,!0)}});export{v as default};
|
|
1
|
+
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import"../../composables/index.js";import{useMenuContext as n,useMenuRootContext as r}from"./context.js";import{SUB_CLOSE_KEYS as i}from"./shared.js";import a from"./menu-content-impl.js";import{computed as o,createBlock as s,createCommentVNode as c,defineComponent as l,mergeProps as u,openBlock as d,renderSlot as f,shallowRef as p,toHandlers as m,unref as h,withCtx as g,withModifiers as _}from"vue";const v=l({name:`MenuSubContent`,__name:`menu-sub-content`,props:{popupProps:{},placement:{},sideOffset:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean,default:!0},reference:{},forceMount:{type:Boolean},loop:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`,`entryFocus`],setup(l,{emit:v}){let y=l,b=e(v),{open:x,popupElement:S,triggerId:C,triggerElement:w,onOpenChange:T}=n(`MenuSubContent`),{dir:E,isUsingKeyboard:D,onClose:O}=r(`MenuSubContent`),k=y.forceMount?p(!0):t(S,x),A=o(()=>E.value===`rtl`?`left`:`right`),j=()=>{D.value&&S.value?.focus()},M=e=>{e.defaultPrevented||e.target!==w.value&&T(!1)},N=e=>{O(),e.preventDefault()},P=e=>{let t=e.currentTarget?.contains(e.target),n=i[E.value].includes(e.key);t&&n&&(T(!1),w.value?.focus(),e.preventDefault())};return(e,t)=>h(k)?(d(),s(a,u({key:0},y,{"trap-focus":!1,"disable-outside-pointer-events":!1,"aria-labelledby":h(C),align:`start`,side:A.value},m(h(b)),{onOpenAutoFocus:_(j,[`prevent`]),onCloseAutoFocus:t[0]||(t[0]=_(()=>{},[`prevent`])),onEscapeKeyDown:N,onFocusOutside:M,onKeydown:P}),{default:g(()=>[f(e.$slots,`default`)]),_:3},16,[`aria-labelledby`,`side`])):c(`v-if`,!0)}});export{v as default};
|
|
@@ -10,21 +10,21 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
default?: (props: typeof __VLS_14) => any;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: vue.DefineComponent<MenuSubContentProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
13
|
+
closeAutoFocus: (event: Event) => any;
|
|
13
14
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
14
15
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
16
|
+
entryFocus: (event: Event) => any;
|
|
15
17
|
focusOutside: (event: FocusOutsideEvent) => any;
|
|
16
18
|
interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
17
19
|
openAutoFocus: (event: Event) => any;
|
|
18
|
-
closeAutoFocus: (event: Event) => any;
|
|
19
|
-
entryFocus: (event: Event) => any;
|
|
20
20
|
}, string, vue.PublicProps, Readonly<MenuSubContentProps> & Readonly<{
|
|
21
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
21
22
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
22
23
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
24
|
+
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
23
25
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
24
26
|
onInteractOutside?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
25
27
|
onOpenAutoFocus?: ((event: Event) => any) | undefined;
|
|
26
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
27
|
-
onEntryFocus?: ((event: Event) => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
29
|
prioritizePosition: boolean;
|
|
30
30
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getDisclosureState as e}from"../../shared/value.js";import"../../shared/index.js";import{useContext as t}from"../../composables/use-context.js";import{useCollection as n}from"../../composables/use-collection.js";import{useForwardElement as r}from"../../composables/use-forward-element.js";import{useUiContext as i}from"../../composables/use-ui-context.js";import"../../composables/index.js";import{useDirection as a}from"../config-provider/context.js";import{computed as
|
|
1
|
+
import{getDisclosureState as e}from"../../shared/value.js";import"../../shared/index.js";import{useContext as t}from"../../composables/use-context.js";import{useCollection as n}from"../../composables/use-collection.js";import{useForwardElement as r}from"../../composables/use-forward-element.js";import{useUiContext as i}from"../../composables/use-ui-context.js";import"../../composables/index.js";import{useDirection as a}from"../config-provider/context.js";import{EVENT_ROOT_CONTENT_DISMISS as o}from"./shared.js";import{computed as s,shallowRef as c}from"vue";import{refAutoReset as l,useDebounceFn as u,useEventListener as d}from"@vueuse/core";const[f,p]=t(`NavigationMenuRoot`,e=>{let{modelValue:t,skipDelayDuration:n,delayDuration:i,disablePointerLeaveClose:f}=e,p=a(e.dir),m=c(),h=e=>{m.value=e},[g,_]=r(),[v,y]=r(),b=c(),x=e=>{b.value=e},S=c(new Set),C=e=>{S.value.add(e)},w=e=>{S.value.delete(e)},T=s(()=>S.value.has(t.value)),E=c(``),D=l(!1,n.value),O=u(e=>{typeof e==`string`&&(E.value=t.value,t.value=e)},s(()=>t.value!==``||D.value?150:i.value)),k=e=>{O(e)},A=()=>{D.value=!0,O(``)},j=e=>{O(e)},M=()=>{f.value||O(``)},N=e=>{E.value=t.value,t.value=e},P=()=>{E.value=t.value,t.value=``};return d(m,o,P),{...e,dir:p,baseId:`soybean-navigation-menu`,rootElement:m,onRootElementChange:h,viewportElement:g,setViewportElement:_,indicatorTrackElement:v,setIndicatorTrackElement:y,activeTriggerElement:b,values:S,addValue:C,removeValue:w,open:T,previousValue:E,onActiveTriggerElementChange:x,onTriggerEnter:k,onTriggerLeave:A,onContentEnter:j,onContentLeave:M,onItemSelect:N,onItemDismiss:P}}),{provideCollectionContext:m,useCollectionContext:h,useCollectionItem:g}=n(`NavigationMenu`),[_,v]=t(`NavigationMenuItem`,t=>{let[n,i]=r(),{modelValue:a,value:o}=t,l=c(),u=e=>{l.value=e},d=c(!1),f=s(()=>a.value===o),p=s(()=>e(f.value));return{...t,triggerElement:l,onTriggerElementChange:u,focusProxyElement:n,setFocusProxyElement:i,wasEscapeCloseRef:d,open:f,dataState:p}}),[y,b]=i(`NavigationMenuUi`);export{m as provideCollectionContext,_ as provideNavigationMenuItemContext,f as provideNavigationMenuRootContext,y as provideNavigationMenuUi,h as useCollectionContext,g as useCollectionItem,v as useNavigationMenuItemContext,p as useNavigationMenuRootContext,b as useNavigationMenuUi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useArrowNavigation as e}from"../../composables/use-arrow-navigation.js";import{getActiveElement as t}from"../../shared/dom.js";import{getTabbableCandidates as n,tryFocusFirst as r}from"../../shared/focus.js";import"../../shared/index.js";import{useDismissableLayer as i}from"../../composables/use-dismissable-layer.js";import{useExposedElement as a}from"../../composables/use-exposed-element.js";import"../../composables/index.js";import{
|
|
1
|
+
import{useArrowNavigation as e}from"../../composables/use-arrow-navigation.js";import{getActiveElement as t}from"../../shared/dom.js";import{getTabbableCandidates as n,tryFocusFirst as r}from"../../shared/focus.js";import"../../shared/index.js";import{useDismissableLayer as i}from"../../composables/use-dismissable-layer.js";import{useExposedElement as a}from"../../composables/use-exposed-element.js";import"../../composables/index.js";import{EVENT_ROOT_CONTENT_DISMISS as o}from"./shared.js";import{useCollectionContext as s,useNavigationMenuItemContext as c,useNavigationMenuRootContext as l,useNavigationMenuUi as u}from"./context.js";import{computed as d,createElementBlock as f,defineComponent as p,normalizeClass as m,normalizeStyle as h,openBlock as g,renderSlot as _,shallowRef as v,unref as y,watchEffect as b}from"vue";const x=[`id`,`aria-labelledby`,`data-orientation`,`data-motion`,`data-state`],S=p({name:`NavigationMenuContentImpl`,__name:`navigation-menu-content-impl`,props:{disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(p,{emit:S}){let C=p,w=S,{dir:T,orientation:E,modelValue:D,previousValue:O,rootElement:k,viewportElement:A,isRoot:j,onItemDismiss:M}=l(`NavigationMenuContentImpl`),{value:N,triggerId:P,contentId:F,triggerElement:I,dataState:L,wasEscapeCloseRef:R,focusProxyElement:z,onContentFocusOutside:B,onRootContentClose:V}=c(`NavigationMenuContentImpl`),H=u(`content`),{getOrderedElements:U}=s(`NavigationMenuContentImpl`),[W,G]=a(),{pointerEvents:K}=i(W,{disableOutsidePointerEvents:()=>C.disableOutsidePointerEvents,onEscapeKeyDown:e=>{w(`escapeKeyDown`,e),!e.defaultPrevented&&(M(),I.value?.focus(),R.value=!0)},onPointerDownOutside:e=>{if(w(`pointerDownOutside`,e),e.defaultPrevented)return;let t=e.target,n=U().some(e=>e.contains(t)),r=j&&A.value?.contains(t);(n||r||!j)&&e.preventDefault()},onFocusOutside:e=>{w(`focusOutside`,e),w(`interactOutside`,e),e.detail.originalEvent.target.hasAttribute(`data-soybean-navigation-menu-trigger`)&&e.preventDefault(),!e.defaultPrevented&&(B(),k.value?.contains(e.target)&&e.preventDefault())},onDismiss:()=>{let e=new Event(o,{bubbles:!0,cancelable:!0});W.value?.dispatchEvent(e)}}),q=v(null),J=d(()=>{let e=U().map(e=>e.id.split(`trigger-`)[1]);T.value===`rtl`&&e.reverse();let t=e.indexOf(O.value??``),n=N===D.value,r=t===e.indexOf(N);if(!n&&!r)return q.value;let i=e.indexOf(D.value);if(i!==t){if(n&&t!==-1)return i>t?`from-end`:`from-start`;if(r&&i!==-1)return i>t?`to-start`:`to-end`}return null}),Y=d(()=>({pointerEvents:K.value})),X=i=>{if(i.target.closest(`[data-soybean-navigation-menu]`)!==k.value)return;let a=i.altKey||i.ctrlKey||i.metaKey,o=i.key===`Tab`&&!a,s=n(i.currentTarget);if(o){let e=t(),n=s.findIndex(t=>t===e);if(r(i.shiftKey?s.slice(0,n).reverse():s.slice(n+1,s.length)))i.preventDefault();else{z.value?.focus();return}}e(i,t(),void 0,{itemsArray:s,loop:!1,enableIgnoredElement:!0})?.focus()};return b(()=>{q.value=J.value}),b(e=>{let n=W.value;if(j&&n){let r=()=>{M(),V(),n.contains(t())&&I.value?.focus()};n.addEventListener(o,r),e(()=>n.removeEventListener(o,r))}}),(e,t)=>(g(),f(`div`,{id:y(F),ref:y(G),class:m(y(H)),"aria-labelledby":y(P),"data-dismissable-layer":``,"data-orientation":y(E),"data-motion":J.value,"data-state":y(L),style:h(Y.value),onKeydown:X},[_(e.$slots,`default`)],46,x))}});export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardElement as e}from"../../composables/use-forward-element.js";import{usePresence as t}from"../../composables/use-presence.js";import"../../composables/index.js";import{
|
|
1
|
+
import{useForwardElement as e}from"../../composables/use-forward-element.js";import{usePresence as t}from"../../composables/use-presence.js";import"../../composables/index.js";import{navigationMenuIndicatorCssVars as n}from"./shared.js";import{useNavigationMenuRootContext as r,useNavigationMenuUi as i}from"./context.js";import{Teleport as a,computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,defineComponent as u,mergeProps as d,openBlock as f,renderSlot as p,shallowRef as m,unref as h,useAttrs as g,watchEffect as _}from"vue";import{useResizeObserver as v}from"@vueuse/core";const y=[`data-state`],b=u({name:`NavigationMenuIndicator`,inheritAttrs:!1,__name:`navigation-menu-indicator`,props:{forceMount:{type:Boolean}},setup(u){let b=u,x=g(),{orientation:S,activeTriggerElement:C,modelValue:w,indicatorTrackElement:T}=r(`NavigationMenuIndicator`),[E,D]=e(),O=i(`indicator`),k=o(()=>!!w.value),A=b.forceMount?m(!0):t(E,()=>k.value),j=m(),M=o(()=>{if(!j.value)return{};let{size:e,position:t}=j.value;return{[n.size]:`${e}px`,[n.position]:`${t}px`}}),N=()=>{if(!C.value)return;let{offsetWidth:e,offsetHeight:t,offsetLeft:n,offsetTop:r}=C.value,i=S.value===`horizontal`;j.value={size:i?e:t,position:i?n:r}};return _(()=>{if(!w.value){j.value=void 0;return}N()}),v(C,N),v(T,N),(e,t)=>h(T)?(f(),s(a,{key:0,to:h(T)},[h(A)?(f(),l(`div`,d({key:0},h(x),{ref:h(D),class:h(O),"aria-hidden":`true`,"data-state":k.value?`visible`:`hidden`,style:M.value}),[p(e.$slots,`default`)],16,y)):c(`v-if`,!0)],8,[`to`])):c(`v-if`,!0)}});export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useArrowNavigation as e}from"../../composables/use-arrow-navigation.js";import{getActiveElement as t}from"../../shared/dom.js";import{getTabbableCandidates as n,removeFromTabOrder as r,tryFocusFirst as i}from"../../shared/focus.js";import"../../shared/index.js";import"../../composables/index.js";import{
|
|
1
|
+
import{useArrowNavigation as e}from"../../composables/use-arrow-navigation.js";import{getActiveElement as t}from"../../shared/dom.js";import{getTabbableCandidates as n,removeFromTabOrder as r,tryFocusFirst as i}from"../../shared/focus.js";import"../../shared/index.js";import"../../composables/index.js";import{createContentId as a,createTriggerId as o}from"./shared.js";import{provideNavigationMenuItemContext as s,useCollectionContext as c,useNavigationMenuRootContext as l,useNavigationMenuUi as u}from"./context.js";import{computed as d,createElementBlock as f,defineComponent as p,normalizeClass as m,onBeforeUnmount as h,openBlock as g,renderSlot as _,useId as v,withKeys as y}from"vue";const b=p({name:`NavigationMenuItem`,__name:`navigation-menu-item`,props:{value:{}},setup(p){let b=p,{isRoot:x,baseId:S,modelValue:C,onItemDismiss:w,addValue:T,removeValue:E}=l(`NavigationMenuItem`),{getOrderedElements:D}=c(`NavigationMenuItem`),O=u(),k=d(()=>x?O.value?.item:O.value?.subItem),A=b.value??v(),j=a(S,A),M=o(S,A),N=()=>({}),P=async(e=`start`)=>{let t=document.getElementById(j);if(!t)return;N();let r=n(t);r.length&&i(e===`start`?r:r.slice().reverse())},F=()=>{let e=document.getElementById(j);if(!e)return;let t=n(e);t.length&&(N=r(t))},{triggerElement:I}=s({value:A,modelValue:C,contentId:j,triggerId:M,onEntryKeyDown:P,onFocusProxyEnter:P,onContentFocusOutside:F,onRootContentClose:F}),L=()=>{w(),I.value?.focus()},R=n=>{let r=t();if(!r)return;if(n.key===`Enter`||n.key===` `){if(C.value===A){L(),n.preventDefault();return}n.target.click(),n.preventDefault();return}let i=D().filter(e=>e.parentElement?.hasAttribute(`data-menu-item`));i.includes(r)&&(e(n,r,void 0,{itemsArray:i,loop:!1})?.focus?.(),n.preventDefault(),n.stopPropagation())};return T(A),h(()=>{E(A)}),(e,t)=>(g(),f(`li`,{class:m(k.value),"data-menu-item":``,onKeydown:y(R,[`up`,`down`,`left`,`right`,`home`,`end`,`space`])},[_(e.$slots,`default`)],34))}});export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useOmitProps as e}from"../../composables/use-props.js";import"../../composables/index.js";import t from"../link/link.js";import{
|
|
1
|
+
import{useOmitProps as e}from"../../composables/use-props.js";import"../../composables/index.js";import t from"../link/link.js";import{EVENT_ROOT_CONTENT_DISMISS as n,LINK_SELECT as r}from"./shared.js";import{useCollectionItem as i,useNavigationMenuRootContext as a,useNavigationMenuUi as o}from"./context.js";import{computed as s,createBlock as c,defineComponent as l,guardReactiveProps as u,mergeProps as d,normalizeProps as f,openBlock as p,renderSlot as m,unref as h,withCtx as g}from"vue";const _=l({name:`NavigationMenuLink`,__name:`navigation-menu-link`,props:{active:{type:Boolean},to:{},replace:{type:Boolean},href:{},disabled:{type:Boolean},activeClass:{},exactActiveClass:{},inactiveClass:{},prefetchedClass:{},external:{type:Boolean},ariaCurrentValue:{},viewTransition:{type:Boolean},target:{},rel:{},noRel:{type:Boolean},prefetch:{type:Boolean},prefetchOn:{},noPrefetch:{type:Boolean},trailingSlash:{},asChild:{type:Boolean},as:{}},emits:[`select`],setup(l,{emit:_}){let v=l,y=_,{isRoot:b}=a(`NavigationMenuLink`),x=o(),S=s(()=>b?x.value?.link:x.value?.subLink),{itemProps:C,setItemElement:w}=i(),T=e(v,[`active`],C),E=async e=>{let t=new CustomEvent(r,{bubbles:!0,cancelable:!0,detail:{originalEvent:e}});if(y(`select`,t),t.defaultPrevented||e.metaKey)return;let i=new CustomEvent(n,{bubbles:!0,cancelable:!0});e.target?.dispatchEvent(i)};return(e,n)=>(p(),c(t,d(h(T),{ref:h(w),class:S.value,"data-active":l.active?``:void 0,"aria-current":l.active?`page`:void 0,onClick:E}),{default:g(t=>[m(e.$slots,`default`,f(u(t)))]),_:3},16,[`class`,`data-active`,`aria-current`]))}});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformPropsToContext as e}from"../../shared/vue.js";import"../../shared/index.js";import{useControllableState as t}from"../../composables/use-controllable-state.js";import{useForwardElement as n}from"../../composables/use-forward-element.js";import"../../composables/index.js";import{provideCollectionContext as r,provideNavigationMenuRootContext as i,useNavigationMenuUi as a}from"./context.js";import{createElementBlock as o,defineComponent as s,normalizeClass as c,openBlock as l,renderSlot as u,unref as d,watchEffect as f}from"vue";const p=[`data-orientation`,`dir`],m=s({name:`NavigationMenuRoot`,__name:`navigation-menu-root`,props:{modelValue:{},defaultValue:{},dir:{default:`ltr`},orientation:{default:`horizontal`},delayDuration:{default:200},skipDelayDuration:{default:300},disableClickTrigger:{type:Boolean},disableHoverTrigger:{type:Boolean},disablePointerLeaveClose:{type:Boolean},unmountOnHide:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(s,{emit:m}){let h=s,g=m,_=a(`root`),v=t(()=>h.modelValue,e=>{g(`update:modelValue`,e)},h.defaultValue),{onRootElementChange:y,onActiveTriggerElementChange:b}=i({isRoot:!0,modelValue:v,...e(h,[`dir`,`orientation`,`unmountOnHide`,`skipDelayDuration`,`delayDuration`,`disableClickTrigger`,`disableHoverTrigger`,`disablePointerLeaveClose`])}),{onContainerElementChange:x,getOrderedElements:S}=r(),[C,w]=n(e=>{y(e),x(e)});return f(()=>{if(!v.value)return;let e=S().find(e=>e.id.includes(v.value));e&&b(e)}),(e,t)=>(l(),o(`nav`,{ref:d(w),class:c(d(_)),"
|
|
1
|
+
import{transformPropsToContext as e}from"../../shared/vue.js";import"../../shared/index.js";import{useControllableState as t}from"../../composables/use-controllable-state.js";import{useForwardElement as n}from"../../composables/use-forward-element.js";import"../../composables/index.js";import{provideCollectionContext as r,provideNavigationMenuRootContext as i,useNavigationMenuUi as a}from"./context.js";import{createElementBlock as o,defineComponent as s,normalizeClass as c,openBlock as l,renderSlot as u,unref as d,watchEffect as f}from"vue";const p=[`data-orientation`,`dir`],m=s({name:`NavigationMenuRoot`,__name:`navigation-menu-root`,props:{modelValue:{},defaultValue:{},dir:{default:`ltr`},orientation:{default:`horizontal`},delayDuration:{default:200},skipDelayDuration:{default:300},disableClickTrigger:{type:Boolean},disableHoverTrigger:{type:Boolean},disablePointerLeaveClose:{type:Boolean},unmountOnHide:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(s,{emit:m}){let h=s,g=m,_=a(`root`),v=t(()=>h.modelValue,e=>{g(`update:modelValue`,e)},h.defaultValue),{onRootElementChange:y,onActiveTriggerElementChange:b}=i({isRoot:!0,modelValue:v,...e(h,[`dir`,`orientation`,`unmountOnHide`,`skipDelayDuration`,`delayDuration`,`disableClickTrigger`,`disableHoverTrigger`,`disablePointerLeaveClose`])}),{onContainerElementChange:x,getOrderedElements:S}=r(),[C,w]=n(e=>{y(e),x(e)});return f(()=>{if(!v.value)return;let e=S().find(e=>e.id.includes(v.value));e&&b(e)}),(e,t)=>(l(),o(`nav`,{ref:d(w),class:c(d(_)),"data-orientation":s.orientation,"data-soybean-navigation-menu":``,dir:s.dir},[u(e.$slots,`default`,{modelValue:d(v)})],10,p))}});export{m as default};
|
|
@@ -17,9 +17,9 @@ declare const __VLS_base: vue.DefineComponent<NavigationMenuRootProps, {}, {}, {
|
|
|
17
17
|
}>, {
|
|
18
18
|
dir: Direction;
|
|
19
19
|
orientation: DataOrientation;
|
|
20
|
-
unmountOnHide: boolean;
|
|
21
20
|
delayDuration: number;
|
|
22
21
|
skipDelayDuration: number;
|
|
22
|
+
unmountOnHide: boolean;
|
|
23
23
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
25
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getDisclosureState as e}from"../../shared/value.js";import{isMouseEvent as t}from"../../shared/event.js";import"../../shared/index.js";import{usePresence as n}from"../../composables/use-presence.js";import"../../composables/index.js";import{
|
|
1
|
+
import{getDisclosureState as e}from"../../shared/value.js";import{isMouseEvent as t}from"../../shared/event.js";import"../../shared/index.js";import{usePresence as n}from"../../composables/use-presence.js";import"../../composables/index.js";import{getNavigationMenuViewportPosition as r,navigationMenuViewportCssVars as i}from"./shared.js";import{useNavigationMenuRootContext as a,useNavigationMenuUi as o}from"./context.js";import{computed as s,createCommentVNode as c,createElementBlock as l,defineComponent as u,nextTick as d,normalizeClass as f,normalizeStyle as p,openBlock as m,renderSlot as h,shallowRef as g,unref as _,watch as v}from"vue";import{useResizeObserver as y}from"@vueuse/core";const b=[`data-state`,`hidden`],x=u({name:`NavigationMenuViewport`,__name:`navigation-menu-viewport`,props:{align:{default:`start`},forceMount:{type:Boolean}},setup(u){let x=u,{isRoot:S,open:C,unmountOnHide:w,rootElement:T,activeTriggerElement:E,modelValue:D,viewportElement:O,setViewportElement:k,onContentEnter:A,onContentLeave:j}=a(`NavigationMenuViewport`),M=o(`viewport`),N=x.forceMount?g(!0):n(O,C),P=s(()=>e(C.value)),F=g(),I=g(),L=s(()=>{let{width:e,height:t}=F.value||{},{left:n,top:r}=I.value||{};return{pointerEvents:!C.value&&S?`none`:void 0,[i.width]:e&&`${e}px`,[i.height]:t&&`${t}px`,[i.left]:n&&`${n}px`,[i.top]:r&&`${r}px`}});function R(){!T.value||!O.value||!E.value||(I.value=r({rootElement:T.value,contentElement:O.value,activeTriggerElement:E.value,align:x.align}))}let z=g(null);function B(){O.value&&requestAnimationFrame(()=>{z.value=O.value?.querySelector(`[data-state=open]`)})}let V=()=>{D.value&&A(D.value)},H=e=>{t(e)&&j()};return y(z,()=>{if(!z.value)return;let{offsetWidth:e,offsetHeight:t}=z.value;F.value={width:e,height:t},R()}),v([O,D,C],()=>{d(()=>{B()})},{immediate:!0}),y([()=>globalThis?.document?.body,T],()=>{R()}),(e,t)=>_(N)?(m(),l(`div`,{key:0,ref:_(k),class:f(_(M)),"data-state":P.value,hidden:!_(N),style:p(L.value),onPointerenter:V,onPointerleave:H},[!_(w)||_(N)?h(e.$slots,`default`,{key:0}):c(`v-if`,!0)],46,b)):c(`v-if`,!0)}});export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNullish as e}from"../../shared/guard.js";import{clamp as t,snapValueToStep as n}from"../../shared/value.js";import"../../shared/index.js";import{useContext as r}from"../../composables/use-context.js";import{useForwardElement as i}from"../../composables/use-forward-element.js";import{useUiContext as a}from"../../composables/use-ui-context.js";import"../../composables/index.js";import{useLocale as o}from"../config-provider/context.js";import{handleDecimalOperation as s}from"./shared.js";import{computed as c}from"vue";import{reactiveComputed as l}from"@vueuse/core";import{NumberFormatter as u,NumberParser as d}from"@internationalized/number";const[f,p]=r(`NumberInputRoot`,r=>{let{disabled:a,readonly:f,modelValue:p,
|
|
1
|
+
import{isNullish as e}from"../../shared/guard.js";import{clamp as t,snapValueToStep as n}from"../../shared/value.js";import"../../shared/index.js";import{useContext as r}from"../../composables/use-context.js";import{useForwardElement as i}from"../../composables/use-forward-element.js";import{useUiContext as a}from"../../composables/use-ui-context.js";import"../../composables/index.js";import{useLocale as o}from"../config-provider/context.js";import{handleDecimalOperation as s}from"./shared.js";import{computed as c}from"vue";import{reactiveComputed as l}from"@vueuse/core";import{NumberFormatter as u,NumberParser as d}from"@internationalized/number";const[f,p]=r(`NumberInputRoot`,r=>{let{disabled:a,readonly:f,modelValue:p,focusOnChange:m,formatOptions:h,min:g,max:_,step:v,stepSnapping:y}=r,[b,x]=i(),S=o(r.locale),C=l(()=>new d(S.value,h.value)),w=l(()=>new u(S.value,h.value)),T=c(()=>w.resolvedOptions().maximumFractionDigits>0?`decimal`:`numeric`),E=c(()=>e(p.value)?!1:j(p.value)===g.value||g.value&&!Number.isNaN(p.value)?s(`-`,p.value,v.value)<Number(g.value):!1),D=c(()=>e(p.value)?!1:j(p.value)===_.value||_.value&&!Number.isNaN(p.value)?s(`+`,p.value,v.value)>Number(_.value):!1),O=l(()=>new u(S.value,h.value)),k=c(()=>e(p.value)||Number.isNaN(p.value)?``:O.format(p.value));function A(e){return C.isValidPartialNumber(e,g.value,_.value)}function j(e){let r;return r=v.value===void 0||Number.isNaN(v.value)||!y.value?t(e,g.value,_.value):n(e,g.value,_.value,v.value),r=C.parse(w.format(r)),r}function M(e,t=1){if(m.value&&b.value?.focus(),a.value||f.value)return;let n=C.parse(b.value?.value??``);if(Number.isNaN(n)){p.value=g.value??0;return}let r=e===`increase`?1:-1;p.value=j(n+(v.value??1)*t*r)}function N(e=1){M(`increase`,e)}function P(e=1){M(`decrease`,e)}function F(e){e===`min`&&g.value!==void 0?p.value=j(g.value):e===`max`&&_.value!==void 0&&(p.value=j(_.value))}function I(e){b.value&&(b.value.value=e)}function L(e){let t=C.parse(e);return p.value=Number.isNaN(t)?void 0:j(t),e.length?I(k.value):I(e)}return{...r,isDecreaseDisabled:E,isIncreaseDisabled:D,inputElement:b,inputMode:T,textValue:k,setInputElement:x,applyInputValue:L,validate:A,onIncrease:N,onDecrease:P,onMinMaxValue:F}}),[m,h]=a(`NumberInputUi`);export{f as provideNumberInputRootContext,m as provideNumberInputUi,p as useNumberInputRootContext,h as useNumberInputUi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isFormControl as e,transformPropsToContext as t}from"../../shared/vue.js";import"../../shared/index.js";import{useControllableState as n}from"../../composables/use-controllable-state.js";import{useForwardElement as r}from"../../composables/use-forward-element.js";import"../../composables/index.js";import i from"../visually-hidden/visually-hidden-input.js";import{provideNumberInputRootContext as a,useNumberInputUi as o}from"./context.js";import{computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,defineComponent as d,normalizeClass as f,openBlock as p,renderSlot as m,unref as h}from"vue";const g=[`data-disabled`,`data-readonly`],_=d({name:`NumberInputRoot`,__name:`number-input-root`,props:{defaultValue:{},modelValue:{default:void 0},min:{},max:{},step:{default:1},stepSnapping:{type:Boolean,default:!0},formatOptions:{},locale:{},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},autofocus:{type:Boolean},disabled:{type:Boolean},maxlength:{},minlength:{},pattern:{},placeholder:{},readonly:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`],setup(d,{emit:_}){let v=d,y=_,[b,x]=r(),S=o(`root`),C=n(()=>v.modelValue,e=>{y(`update:modelValue`,e)},v.defaultValue),w=s(()=>e(b.value)),T=()=>{C.value=null};return a({modelValue:C,...t(v,[`id`,`autofocus`,`disabled`,`maxlength`,`minlength`,`pattern`,`placeholder`,`readonly`,`locale`,`formatOptions`,`max`,`min`,`step`,`stepSnapping`,`disableWheelChange`,`invertWheelChange`])}),(e,t)=>(p(),u(`div`,{ref:h(x),class:f(h(S)),role:`group`,"data-disabled":d.disabled?``:void 0,"data-readonly":d.readonly?``:void 0},[m(e.$slots,`default`,{modelValue:h(C),clear:T}),w.value&&d.name?(p(),c(i,{key:0,type:`text`,value:h(C),name:d.name,disabled:d.disabled,readonly:d.readonly,required:d.required},null,8,[`value`,`name`,`disabled`,`readonly`,`required`])):l(`v-if`,!0)],10,g))}});export{_ as default};
|
|
1
|
+
import{isFormControl as e,transformPropsToContext as t}from"../../shared/vue.js";import"../../shared/index.js";import{useControllableState as n}from"../../composables/use-controllable-state.js";import{useForwardElement as r}from"../../composables/use-forward-element.js";import"../../composables/index.js";import i from"../visually-hidden/visually-hidden-input.js";import{provideNumberInputRootContext as a,useNumberInputUi as o}from"./context.js";import{computed as s,createBlock as c,createCommentVNode as l,createElementBlock as u,defineComponent as d,normalizeClass as f,openBlock as p,renderSlot as m,unref as h}from"vue";const g=[`data-disabled`,`data-readonly`],_=d({name:`NumberInputRoot`,__name:`number-input-root`,props:{defaultValue:{},modelValue:{default:void 0},min:{},max:{},step:{default:1},stepSnapping:{type:Boolean,default:!0},focusOnChange:{type:Boolean,default:!0},formatOptions:{},locale:{},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},autofocus:{type:Boolean},disabled:{type:Boolean},maxlength:{},minlength:{},pattern:{},placeholder:{},readonly:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`],setup(d,{emit:_}){let v=d,y=_,[b,x]=r(),S=o(`root`),C=n(()=>v.modelValue,e=>{y(`update:modelValue`,e)},v.defaultValue),w=s(()=>e(b.value)),T=()=>{C.value=null};return a({modelValue:C,...t(v,[`id`,`autofocus`,`disabled`,`maxlength`,`minlength`,`pattern`,`placeholder`,`readonly`,`locale`,`focusOnChange`,`formatOptions`,`max`,`min`,`step`,`stepSnapping`,`disableWheelChange`,`invertWheelChange`])}),(e,t)=>(p(),u(`div`,{ref:h(x),class:f(h(S)),role:`group`,"data-disabled":d.disabled?``:void 0,"data-readonly":d.readonly?``:void 0},[m(e.$slots,`default`,{modelValue:h(C),clear:T}),w.value&&d.name?(p(),c(i,{key:0,type:`text`,value:h(C),name:d.name,disabled:d.disabled,readonly:d.readonly,required:d.required},null,8,[`value`,`name`,`disabled`,`readonly`,`required`])):l(`v-if`,!0)],10,g))}});export{_ as default};
|
|
@@ -17,6 +17,7 @@ declare const __VLS_base: vue.DefineComponent<NumberInputRootProps, {}, {}, {},
|
|
|
17
17
|
modelValue: number | null;
|
|
18
18
|
step: number;
|
|
19
19
|
stepSnapping: boolean;
|
|
20
|
+
focusOnChange: boolean;
|
|
20
21
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
21
22
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
23
|
declare const _default: typeof __VLS_export;
|
|
@@ -19,6 +19,8 @@ interface NumberInputRootProps extends InputBaseProps, FormFieldCommonProps, /**
|
|
|
19
19
|
step?: number;
|
|
20
20
|
/** When `false`, prevents the value from snapping to the nearest increment of the step value */
|
|
21
21
|
stepSnapping?: boolean;
|
|
22
|
+
/** When `true`, the input will be focused when the value changes. */
|
|
23
|
+
focusOnChange?: boolean;
|
|
22
24
|
/**
|
|
23
25
|
* Formatting options for the value displayed in the number field. This also affects what characters are allowed to be
|
|
24
26
|
* typed by the user.
|
|
@@ -14,10 +14,10 @@ declare const __VLS_base: vue.DefineComponent<PaginationRootProps, {}, {}, {}, {
|
|
|
14
14
|
}, string, vue.PublicProps, Readonly<PaginationRootProps> & Readonly<{
|
|
15
15
|
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
+
defaultPage: number;
|
|
17
18
|
total: number;
|
|
18
19
|
siblingCount: number;
|
|
19
20
|
showEdges: boolean;
|
|
20
|
-
defaultPage: number;
|
|
21
21
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
23
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useBodyScrollLock as e}from"../../composables/use-body-scroll-lock.js";import{useDismissableLayer as t}from"../../composables/use-dismissable-layer.js";import{useForwardElement as n}from"../../composables/use-forward-element.js";import{useFocusGuards as r}from"../../composables/use-focus-guards.js";import{useFocusScope as i}from"../../composables/use-focus-scope.js";import{useHideOthers as a}from"../../composables/use-hide-others.js";import{useOmitProps as o}from"../../composables/use-props.js";import"../../composables/index.js";import s from"../popper/popper-positioner.js";import"../popper/index.js";import{usePopoverRootContext as c}from"./context.js";import{createBlock as l,defineComponent as u,mergeProps as d,onWatcherCleanup as f,openBlock as p,renderSlot as m,unref as h,watchEffect as g,watchPostEffect as _,withCtx as v}from"vue";const y=u({name:`PopoverPositionerImpl`,__name:`popover-positioner-impl`,props:{placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(u,{emit:y}){let b=u,x=y,{modal:S,popupElement:C,onOpenChange:w}=c(`PopoverPositionerImpl`),[T,E]=n(),{pointerEvents:D}=t(T,{disableOutsidePointerEvents:()=>b.disableOutsidePointerEvents,onEscapeKeyDown:e=>{x(`escapeKeyDown`,e)},onPointerDownOutside:e=>{x(`pointerDownOutside`,e)},onFocusOutside:e=>{x(`focusOutside`,e)},onInteractOutside:e=>{x(`interactOutside`,e)},onDismiss:()=>{w(!1)}}),{onKeydown:O}=i(T,{trapped:()=>b.trapFocus,loop:!0,onOpenAutoFocus:e=>{x(`openAutoFocus`,e)},onCloseAutoFocus:e=>{x(`closeAutoFocus`,e)}}),k=o(b,[`disableOutsidePointerEvents`,`trapFocus`]);return r(),a(T,S),g(()=>{S.value&&f(e())}),_(()=>{C.value&&D.value&&(C.value.style.pointerEvents=D.value)}),(e,t)=>(p(),l(h(s),d(h(k),{ref:h(E),onKeydown:h(O)}),{default:v(()=>[m(e.$slots,`default`)]),_:3},16,[`onKeydown`]))}});export{y as default};
|
|
1
|
+
import{useBodyScrollLock as e}from"../../composables/use-body-scroll-lock.js";import{useDismissableLayer as t}from"../../composables/use-dismissable-layer.js";import{useForwardElement as n}from"../../composables/use-forward-element.js";import{useFocusGuards as r}from"../../composables/use-focus-guards.js";import{useFocusScope as i}from"../../composables/use-focus-scope.js";import{useHideOthers as a}from"../../composables/use-hide-others.js";import{useOmitProps as o}from"../../composables/use-props.js";import"../../composables/index.js";import s from"../popper/popper-positioner.js";import"../popper/index.js";import{usePopoverRootContext as c}from"./context.js";import{createBlock as l,defineComponent as u,mergeProps as d,onWatcherCleanup as f,openBlock as p,renderSlot as m,unref as h,watchEffect as g,watchPostEffect as _,withCtx as v}from"vue";const y=u({name:`PopoverPositionerImpl`,__name:`popover-positioner-impl`,props:{placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(u,{emit:y}){let b=u,x=y,{modal:S,popupElement:C,onOpenChange:w}=c(`PopoverPositionerImpl`),[T,E]=n(),{pointerEvents:D}=t(T,{disableOutsidePointerEvents:()=>b.disableOutsidePointerEvents,onEscapeKeyDown:e=>{x(`escapeKeyDown`,e)},onPointerDownOutside:e=>{x(`pointerDownOutside`,e)},onFocusOutside:e=>{x(`focusOutside`,e)},onInteractOutside:e=>{x(`interactOutside`,e)},onDismiss:()=>{w(!1)}}),{onKeydown:O}=i(T,{trapped:()=>b.trapFocus,loop:!0,onOpenAutoFocus:e=>{x(`openAutoFocus`,e)},onCloseAutoFocus:e=>{x(`closeAutoFocus`,e)}}),k=o(b,[`disableOutsidePointerEvents`,`trapFocus`]);return r(),a(T,S),g(()=>{S.value&&f(e())}),_(()=>{C.value&&D.value&&(C.value.style.pointerEvents=D.value)}),(e,t)=>(p(),l(h(s),d(h(k),{ref:h(E),onKeydown:h(O)}),{default:v(()=>[m(e.$slots,`default`)]),_:3},16,[`onKeydown`]))}});export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePopupEvents as t}from"../../composables/use-popup-events.js";import{usePresence as n}from"../../composables/use-presence.js";import{useOmitProps as r}from"../../composables/use-props.js";import"../../composables/index.js";import{usePopoverRootContext as i}from"./context.js";import a from"./popover-positioner-impl.js";import{computed as o,createBlock as s,createCommentVNode as c,defineComponent as l,mergeProps as u,openBlock as d,renderSlot as f,shallowRef as p,toHandlers as m,unref as h,withCtx as g}from"vue";const _=l({name:`PopoverPositioner`,__name:`popover-positioner`,props:{placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(l,{emit:_}){let v=l,y=r(v,[`forceMount`]),b=e(_),{popupElement:x,open:S,modal:C,triggerElement:w}=i(`PopoverPositioner`),T=v.forceMount?p(!0):n(x,S),E=o(()=>C.value&&S.value),{onPointerDownOutside:D,onFocusOutside:O,onInteractOutside:k,onCloseAutoFocus:A}=t({modal:C,triggerElement:w});return(e,t)=>h(T)?(d(),s(a,u({key:0},h(y),{"trap-focus":E.value,"disable-outside-pointer-events":h(C)},m(h(b)),{onPointerDownOutside:h(D),onFocusOutside:h(O),onInteractOutside:h(k),onCloseAutoFocus:h(A)}),{default:g(()=>[f(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`,`onCloseAutoFocus`])):c(`v-if`,!0)}});export{_ as default};
|
|
1
|
+
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePopupEvents as t}from"../../composables/use-popup-events.js";import{usePresence as n}from"../../composables/use-presence.js";import{useOmitProps as r}from"../../composables/use-props.js";import"../../composables/index.js";import{usePopoverRootContext as i}from"./context.js";import a from"./popover-positioner-impl.js";import{computed as o,createBlock as s,createCommentVNode as c,defineComponent as l,mergeProps as u,openBlock as d,renderSlot as f,shallowRef as p,toHandlers as m,unref as h,withCtx as g}from"vue";const _=l({name:`PopoverPositioner`,__name:`popover-positioner`,props:{placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(l,{emit:_}){let v=l,y=r(v,[`forceMount`]),b=e(_),{popupElement:x,open:S,modal:C,triggerElement:w}=i(`PopoverPositioner`),T=v.forceMount?p(!0):n(x,S),E=o(()=>C.value&&S.value),{onPointerDownOutside:D,onFocusOutside:O,onInteractOutside:k,onCloseAutoFocus:A}=t({modal:C,triggerElement:w});return(e,t)=>h(T)?(d(),s(a,u({key:0},h(y),{"trap-focus":E.value,"disable-outside-pointer-events":h(C)},m(h(b)),{onPointerDownOutside:h(D),onFocusOutside:h(O),onInteractOutside:h(k),onCloseAutoFocus:h(A)}),{default:g(()=>[f(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`,`onCloseAutoFocus`])):c(`v-if`,!0)}});export{_ as default};
|
|
@@ -9,19 +9,19 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
default?: (props: typeof __VLS_13) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: vue.DefineComponent<PopoverPositionerProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
12
|
+
closeAutoFocus: (event: Event) => any;
|
|
12
13
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
13
14
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
14
15
|
focusOutside: (event: FocusOutsideEvent) => any;
|
|
15
16
|
interactOutside: (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
16
17
|
openAutoFocus: (event: Event) => any;
|
|
17
|
-
closeAutoFocus: (event: Event) => any;
|
|
18
18
|
}, string, vue.PublicProps, Readonly<PopoverPositionerProps> & Readonly<{
|
|
19
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
19
20
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
20
21
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
21
22
|
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
22
23
|
onInteractOutside?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
23
24
|
onOpenAutoFocus?: ((event: Event) => any) | undefined;
|
|
24
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
25
25
|
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
27
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OPPOSITE_SIDE as e}from"../../constants/common.js";import t from"../arrow/arrow.js";import"../arrow/index.js";import{usePopperPositionerContext as n,usePopperUi as r}from"./context.js";import{computed as i,createElementBlock as a,createVNode as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,openBlock as u,unref as d}from"vue";const f=s({name:`PopperArrow`,__name:`popper-arrow`,setup(s){let f=r(`arrow`),{setArrowElement:p,arrowX:m,arrowY:h,
|
|
1
|
+
import{OPPOSITE_SIDE as e}from"../../constants/common.js";import t from"../arrow/arrow.js";import"../arrow/index.js";import{usePopperPositionerContext as n,usePopperUi as r}from"./context.js";import{computed as i,createElementBlock as a,createVNode as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,openBlock as u,unref as d}from"vue";const f=s({name:`PopperArrow`,__name:`popper-arrow`,setup(s){let f=r(`arrow`),{setArrowElement:p,arrowX:m,arrowY:h,hideArrow:g,placedSide:_}=n(`PopperArrow`),v={top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`},y={top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`},b=i(()=>e[_.value]),x=i(()=>({position:`absolute`,left:m.value?`${m.value}px`:void 0,top:h.value?`${h.value}px`:void 0,[b.value]:0,transformOrigin:v[_.value],transform:y[_.value],visibility:g.value?`hidden`:void 0}));return(e,n)=>(u(),a(`span`,{ref:d(p),class:c(d(f)),style:l(x.value)},[o(d(t))],6))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardElement as e}from"../../composables/use-forward-element.js";import{useFloating as t}from"../../composables/use-floating.js";import"../../composables/index.js";import{providePopperPositionerContext as n,usePopperRootContext as r,usePopperUi as i}from"./context.js";import{createPopperPositionerDefaultProps as a,getFloatingUiMiddleware as o,getPlacement as s,popperCssVars as c}from"./shared.js";import{computed as l,createElementBlock as u,defineComponent as d,mergeDefaults as f,normalizeClass as p,normalizeStyle as m,openBlock as h,renderSlot as g,shallowRef as _,unref as v,watchPostEffect as y}from"vue";import{autoUpdate as b}from"@floating-ui/dom";import{getAlignment as x,getSide as S}from"@floating-ui/utils";const C=d({name:`PopperPositioner`,__name:`popper-positioner`,props:f({placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{}},a()),emits:[`placed`],setup(a,{emit:d}){let f=a,C=d,w=i(`positioner`),[T,E]=e(),[D,O]=e(),{anchorElement:k,popupElement:A}=r(`PopperPositioner`),{floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=t(l(()=>f.reference??k.value),T,{strategy:()=>f.positionStrategy,placement:()=>f.placement??s(f.side,f.align),whileElementsMounted:(...e)=>b(...e,{layoutShift:!f.disableUpdateOnLayoutShift,animationFrame:f.updatePositionStrategy===`always`}),middleware:()=>o(f,D.value)}),F=l(()=>S(M.value)),I=l(()=>x(M.value)??`center`),L=l(()=>P.value.arrow?.centerOffset===0),R=l(()=>P.value.arrow?.x??0),z=l(()=>P.value.arrow?.y??0),B=
|
|
1
|
+
import{useForwardElement as e}from"../../composables/use-forward-element.js";import{useFloating as t}from"../../composables/use-floating.js";import"../../composables/index.js";import{providePopperPositionerContext as n,usePopperRootContext as r,usePopperUi as i}from"./context.js";import{createPopperPositionerDefaultProps as a,getFloatingUiMiddleware as o,getPlacement as s,popperCssVars as c}from"./shared.js";import{computed as l,createElementBlock as u,defineComponent as d,mergeDefaults as f,normalizeClass as p,normalizeStyle as m,openBlock as h,renderSlot as g,shallowRef as _,unref as v,watchPostEffect as y}from"vue";import{autoUpdate as b}from"@floating-ui/dom";import{getAlignment as x,getSide as S}from"@floating-ui/utils";const C=d({name:`PopperPositioner`,__name:`popper-positioner`,props:f({placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{}},a()),emits:[`placed`],setup(a,{emit:d}){let f=a,C=d,w=i(`positioner`),[T,E]=e(),[D,O]=e(),{anchorElement:k,popupElement:A}=r(`PopperPositioner`),{floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=t(l(()=>f.reference??k.value),T,{strategy:()=>f.positionStrategy,placement:()=>f.placement??s(f.side,f.align),whileElementsMounted:(...e)=>b(...e,{layoutShift:!f.disableUpdateOnLayoutShift,animationFrame:f.updatePositionStrategy===`always`}),middleware:()=>o(f,D.value)}),F=l(()=>S(M.value)),I=l(()=>x(M.value)??`center`),L=l(()=>P.value.arrow?.centerOffset===0),R=l(()=>P.value.arrow?.x??0),z=l(()=>P.value.arrow?.y??0),B=l(()=>f.hideShiftedArrow&&!L.value),V=_(),H=l(()=>{let{transformOrigin:e,hide:t}=P.value;return{...j.value,zIndex:V.value,transform:N.value?j.value.transform:`translate(0, -200%)`,[c.transformOrigin]:[e?.x,e?.y].join(` `),...t?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}}});return n({arrowX:R,arrowY:z,hideArrow:B,placedSide:F,placedAlign:I,isPositioned:l(()=>N.value),setArrowElement:O}),y(()=>{N.value&&C(`placed`)}),y(()=>{A.value&&(V.value=window.getComputedStyle(A.value).zIndex)}),(e,t)=>(h(),u(`div`,{ref:v(E),class:p(v(w)),"data-soybean-popper-positioner":``,style:m(H.value)},[g(e.$slots,`default`)],6))}});export{C as default};
|
|
@@ -21,6 +21,7 @@ declare const __VLS_base: vue.DefineComponent<PopperPositionerProps, {}, {}, {},
|
|
|
21
21
|
contextmenu: string;
|
|
22
22
|
onInput: (payload: InputEvent) => void;
|
|
23
23
|
onSelect: (payload: Event) => void;
|
|
24
|
+
onFocus: (payload: FocusEvent) => void;
|
|
24
25
|
onError: (payload: Event) => void;
|
|
25
26
|
onProgress: (payload: ProgressEvent<EventTarget>) => void;
|
|
26
27
|
onFullscreenchange: (payload: Event) => void;
|
|
@@ -55,7 +56,6 @@ declare const __VLS_base: vue.DefineComponent<PopperPositionerProps, {}, {}, {},
|
|
|
55
56
|
onDurationchange: (payload: Event) => void;
|
|
56
57
|
onEmptied: (payload: Event) => void;
|
|
57
58
|
onEnded: (payload: Event) => void;
|
|
58
|
-
onFocus: (payload: FocusEvent) => void;
|
|
59
59
|
onFocusin: (payload: FocusEvent) => void;
|
|
60
60
|
onFocusout: (payload: FocusEvent) => void;
|
|
61
61
|
onFormdata: (payload: FormDataEvent) => void;
|
|
@@ -119,8 +119,8 @@ declare const __VLS_base: vue.DefineComponent<PopperPositionerProps, {}, {}, {},
|
|
|
119
119
|
contenteditable: (boolean | "true" | "false") | "inherit" | "plaintext-only";
|
|
120
120
|
dir: string;
|
|
121
121
|
draggable: boolean | "true" | "false";
|
|
122
|
-
enterkeyhint: "done" | "next" | "
|
|
123
|
-
enterKeyHint: "done" | "next" | "
|
|
122
|
+
enterkeyhint: "done" | "next" | "search" | "enter" | "go" | "previous" | "send";
|
|
123
|
+
enterKeyHint: "done" | "next" | "search" | "enter" | "go" | "previous" | "send";
|
|
124
124
|
hidden: "" | "hidden" | (boolean | "true" | "false") | "until-found";
|
|
125
125
|
id: string;
|
|
126
126
|
inert: boolean | "true" | "false";
|
|
@@ -151,7 +151,7 @@ declare const __VLS_base: vue.DefineComponent<PopperPositionerProps, {}, {}, {},
|
|
|
151
151
|
results: string | number;
|
|
152
152
|
security: string;
|
|
153
153
|
unselectable: "on" | "off";
|
|
154
|
-
inputmode: "
|
|
154
|
+
inputmode: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
155
155
|
is: string;
|
|
156
156
|
exportparts: string;
|
|
157
157
|
part: string;
|
|
@@ -215,6 +215,7 @@ declare const __VLS_base: vue.DefineComponent<PopperPositionerProps, {}, {}, {},
|
|
|
215
215
|
collisionBoundary: Element | null | Array<Element | null>;
|
|
216
216
|
collisionPadding: _floating_ui_utils0.Padding;
|
|
217
217
|
arrowPadding: number;
|
|
218
|
+
hideShiftedArrow: boolean;
|
|
218
219
|
sticky: "partial" | "always";
|
|
219
220
|
hideWhenDetached: boolean;
|
|
220
221
|
positionStrategy: "absolute" | "fixed";
|
|
@@ -86,6 +86,13 @@ interface PopperPositionerProps extends /** @vue-ignore */HTMLAttributes {
|
|
|
86
86
|
* @defaultValue 0
|
|
87
87
|
*/
|
|
88
88
|
arrowPadding?: number;
|
|
89
|
+
/**
|
|
90
|
+
* When `true`, hides the arrow when it cannot be centered
|
|
91
|
+
* to the reference element.
|
|
92
|
+
*
|
|
93
|
+
* @defaultValue true
|
|
94
|
+
*/
|
|
95
|
+
hideShiftedArrow?: boolean;
|
|
89
96
|
/**
|
|
90
97
|
* The sticky behavior on the align axis. `partial` will keep the content in the boundary as long as the trigger is at
|
|
91
98
|
* least partially in the boundary whilst "always" will keep the content in the boundary regardless.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../popper/popper-arrow.js";import"../popper/index.js";import{useSelectContentContext as t
|
|
1
|
+
import e from"../popper/popper-arrow.js";import"../popper/index.js";import{useSelectContentContext as t}from"./context.js";import{computed as n,createBlock as r,createCommentVNode as i,defineComponent as a,openBlock as o,renderSlot as s,unref as c,withCtx as l}from"vue";const u=a({name:`SelectArrow`,__name:`select-arrow`,setup(a){let{position:u}=t(`SelectArrow`),d=n(()=>u.value===`popper`);return(t,n)=>d.value?(o(),r(c(e),{key:0},{default:l(()=>[s(t.$slots,`default`)]),_:3})):i(`v-if`,!0)}});export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tryFocusFirst as e}from"../../shared/focus.js";import"../../shared/index.js";import{useBodyScrollLock as t}from"../../composables/use-body-scroll-lock.js";import{useDismissableLayer as n}from"../../composables/use-dismissable-layer.js";import{useForwardElement as r}from"../../composables/use-forward-element.js";import{useFocusGuards as ee}from"../../composables/use-focus-guards.js";import{useFocusScope as te}from"../../composables/use-focus-scope.js";import{useHideOthers as i}from"../../composables/use-hide-others.js";import{useOmitProps as a}from"../../composables/use-props.js";import{useTypeahead as ne}from"../../composables/use-typeahead.js";import"../../composables/index.js";import re from"../popper/popper-positioner.js";import"../popper/index.js";import{provideSelectContentContext as o,useCollectionContext as s,useSelectPopupElementContext as c,useSelectRootContext as l}from"./context.js";import{CONTENT_MARGIN as u}from"./shared.js";import d from"./select-popper-popup.js";import f from"./select-item-aligned-popup.js";import p from"./select-item-aligned-positioner.js";import{computed as m,createBlock as h,createVNode as g,defineComponent as _,mergeProps as v,onWatcherCleanup as y,openBlock as b,renderSlot as x,unref as S,watch as C,watchEffect as w,withCtx as T,withModifiers as E}from"vue";const D=_({name:`SelectContentImpl`,__name:`select-content-impl`,props:{position:{default:`popper`},bodyLock:{type:Boolean,default:!0},popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{default:`start`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{default:u},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(u,{emit:_}){let D=u,O=_,{onOpenChange:k,dataState:A,modelValue:j,isMultiple:M,dir:N,contentId:P,triggerElement:F,triggerPointerDownPosition:I,resetTriggerPointerDownPosition:L}=l(`SelectContentImpl`),{onPopupElementChange:R}=c(`SelectContentImpl`),{onContainerElementChange:z,getOrderedItems:B,getOrderedElements:V}=s(`SelectContentImpl`),[H,U]=r(),[W,G]=r(e=>{R(e),z(e)}),{search:K,handleTypeaheadSearch:q}=ne(),{pointerEvents:J}=n(H,{disableOutsidePointerEvents
|
|
1
|
+
import{tryFocusFirst as e}from"../../shared/focus.js";import"../../shared/index.js";import{useBodyScrollLock as t}from"../../composables/use-body-scroll-lock.js";import{useDismissableLayer as n}from"../../composables/use-dismissable-layer.js";import{useForwardElement as r}from"../../composables/use-forward-element.js";import{useFocusGuards as ee}from"../../composables/use-focus-guards.js";import{useFocusScope as te}from"../../composables/use-focus-scope.js";import{useHideOthers as i}from"../../composables/use-hide-others.js";import{useOmitProps as a}from"../../composables/use-props.js";import{useTypeahead as ne}from"../../composables/use-typeahead.js";import"../../composables/index.js";import re from"../popper/popper-positioner.js";import"../popper/index.js";import{provideSelectContentContext as o,useCollectionContext as s,useSelectPopupElementContext as c,useSelectRootContext as l}from"./context.js";import{CONTENT_MARGIN as u}from"./shared.js";import d from"./select-popper-popup.js";import f from"./select-item-aligned-popup.js";import p from"./select-item-aligned-positioner.js";import{computed as m,createBlock as h,createVNode as g,defineComponent as _,mergeProps as v,onWatcherCleanup as y,openBlock as b,renderSlot as x,unref as S,watch as C,watchEffect as w,withCtx as T,withModifiers as E}from"vue";const D=_({name:`SelectContentImpl`,__name:`select-content-impl`,props:{position:{default:`popper`},bodyLock:{type:Boolean,default:!0},popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{default:`start`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{default:u},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},disableOutsidePointerEvents:{type:Boolean,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(u,{emit:_}){let D=u,O=_,{onOpenChange:k,dataState:A,modelValue:j,isMultiple:M,dir:N,contentId:P,triggerElement:F,triggerPointerDownPosition:I,resetTriggerPointerDownPosition:L}=l(`SelectContentImpl`),{onPopupElementChange:R}=c(`SelectContentImpl`),{onContainerElementChange:z,getOrderedItems:B,getOrderedElements:V}=s(`SelectContentImpl`),[H,U]=r(),[W,G]=r(e=>{R(e),z(e)}),{search:K,handleTypeaheadSearch:q}=ne(),{pointerEvents:J}=n(H,{disableOutsidePointerEvents:()=>D.disableOutsidePointerEvents,onEscapeKeyDown:e=>{O(`escapeKeyDown`,e)},onPointerDownOutside:e=>{O(`pointerDownOutside`,e)},onFocusOutside:e=>{e.preventDefault()},onDismiss:()=>{k(!1)}}),{onKeydown:Y}=te(H,{onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{O(`closeAutoFocus`,e),!e.defaultPrevented&&(F.value?.focus({preventScroll:!0}),e.preventDefault())}}),{isPositioned:X,focusSelectedItem:ie}=o({position:m(()=>D.position),modelValue:j,isMultiple:M,search:K,popupElement:W}),ae=a(D,[`position`,`bodyLock`,`popupProps`]),Z=m(()=>({display:`flex`,flexDirection:`column`,outline:`none`,pointerEvents:J.value})),Q=t=>{Y(t);let n=t.ctrlKey||t.altKey||t.metaKey;if(t.key===`Tab`&&t.preventDefault(),!n&&t.key.length===1&&q(t.key,B()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(t.key)){let n=[...V()];if([`ArrowUp`,`End`].includes(t.key)&&(n=n.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(t.key)){let e=t.target,r=n.indexOf(e);n=n.slice(r+1)}setTimeout(()=>{e(n)}),t.preventDefault()}},$=()=>{X.value=!0};return ee(),i(W),C(X,()=>{ie()}),w(()=>{D.bodyLock&&y(t())}),w(()=>{if(!W.value)return;let e={x:0,y:0},t=t=>{let{x:n,y:r}=I.value??{x:0,y:0};e={x:Math.abs(Math.round(t.pageX)-n),y:Math.abs(Math.round(t.pageY)-r)}},n=n=>{n.pointerType!==`touch`&&(e.x<=10&&e.y<=10?n.preventDefault():W.value?.contains(n.target)||k(!1),document.removeEventListener(`pointermove`,t),L())};I.value!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),y(()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})})}),(e,t)=>u.position===`popper`?(b(),h(S(re),v({key:0,ref:S(U)},S(ae),{onContextmenu:t[0]||(t[0]=E(()=>{},[`prevent`])),onPlaced:$,onKeydown:Q}),{default:T(()=>[g(d,v({id:S(P),ref:S(G)},u.popupProps,{"data-dismissable-layer":``,"data-state":S(A),dir:S(N),role:`listbox`,tabindex:`-1`,style:Z.value}),{default:T(()=>[x(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`style`])]),_:3},16)):(b(),h(p,{key:1,ref:S(U),onContextmenu:t[1]||(t[1]=E(()=>{},[`prevent`])),onPlaced:$,onKeydown:Q},{default:T(()=>[g(f,v({id:S(P),ref:S(G)},u.popupProps,{"data-dismissable-layer":``,"data-state":S(A),dir:S(N),role:`listbox`,tabindex:`-1`,style:Z.value}),{default:T(()=>[x(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`style`])]),_:3},512))}});export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import{useOmitProps as n}from"../../composables/use-props.js";import"../../composables/index.js";import{provideSelectPopupElementContext as r,useSelectRootContext as i}from"./context.js";import a from"./select-content-impl.js";import o from"./select-teleport-provider.js";import{Teleport as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createVNode as d,defineComponent as f,mergeProps as p,onMounted as m,openBlock as h,ref as g,renderSlot as _,shallowRef as v,toHandlers as y,unref as b,useAttrs as x,withCtx as S}from"vue";const C={key:1},w=f({name:`SelectContent`,inheritAttrs:!1,__name:`select-content`,props:{position:{default:`popper`},bodyLock:{type:Boolean,default:!0},popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean,default:!0},reference:{},forceMount:{type:Boolean}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(f,{emit:w}){let T=f,E=w,D=n(T,[`forceMount`],x()),O=e(E),{open:k}=i(`SelectContent`),{popupElement:A}=r(),j=T.forceMount?v(!0):t(A,k),M=g();return m(()=>{M.value=new DocumentFragment}),(e,t)=>b(j)?(h(),c(a,p({key:0},b(D),y(b(O))),{default:S(()=>[_(e.$slots,`default`)]),_:3},16)):M.value?(h(),u(`div`,C,[(h(),c(s,{to:M.value},[d(o,{position:f.position,"popup-element":b(A)},{default:S(()=>[_(e.$slots,`default`)]),_:3},8,[`position`,`popup-element`])],8,[`to`]))])):l(`v-if`,!0)}});export{w as default};
|
|
1
|
+
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import{useOmitProps as n}from"../../composables/use-props.js";import"../../composables/index.js";import{provideSelectPopupElementContext as r,useSelectRootContext as i}from"./context.js";import a from"./select-content-impl.js";import o from"./select-teleport-provider.js";import{Teleport as s,createBlock as c,createCommentVNode as l,createElementBlock as u,createVNode as d,defineComponent as f,mergeProps as p,onMounted as m,openBlock as h,ref as g,renderSlot as _,shallowRef as v,toHandlers as y,unref as b,useAttrs as x,withCtx as S}from"vue";const C={key:1},w=f({name:`SelectContent`,inheritAttrs:!1,__name:`select-content`,props:{position:{default:`popper`},bodyLock:{type:Boolean,default:!0},popupProps:{},placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean,default:!0},reference:{},disableOutsidePointerEvents:{type:Boolean},forceMount:{type:Boolean}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(f,{emit:w}){let T=f,E=w,D=n(T,[`forceMount`],x()),O=e(E),{open:k}=i(`SelectContent`),{popupElement:A}=r(),j=T.forceMount?v(!0):t(A,k),M=g();return m(()=>{M.value=new DocumentFragment}),(e,t)=>b(j)?(h(),c(a,p({key:0},b(D),y(b(O))),{default:S(()=>[_(e.$slots,`default`)]),_:3},16)):M.value?(h(),u(`div`,C,[(h(),c(s,{to:M.value},[d(o,{position:f.position,"popup-element":b(A)},{default:S(()=>[_(e.$slots,`default`)]),_:3},8,[`position`,`popup-element`])],8,[`to`]))])):l(`v-if`,!0)}});export{w as default};
|
|
@@ -11,18 +11,18 @@ type __VLS_Slots = {} & {
|
|
|
11
11
|
default?: (props: typeof __VLS_22) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: vue.DefineComponent<SelectContentProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
14
|
+
closeAutoFocus: (event: Event) => any;
|
|
14
15
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
15
16
|
pointerDownOutside: (event: PointerDownOutsideEvent) => any;
|
|
16
|
-
closeAutoFocus: (event: Event) => any;
|
|
17
17
|
}, string, vue.PublicProps, Readonly<SelectContentProps> & Readonly<{
|
|
18
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
18
19
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
19
20
|
onPointerDownOutside?: ((event: PointerDownOutsideEvent) => any) | undefined;
|
|
20
|
-
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
21
21
|
}>, {
|
|
22
|
-
avoidCollisions: boolean;
|
|
23
|
-
prioritizePosition: boolean;
|
|
24
22
|
position: SelectPosition;
|
|
25
23
|
bodyLock: boolean;
|
|
24
|
+
avoidCollisions: boolean;
|
|
25
|
+
prioritizePosition: boolean;
|
|
26
26
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
@@ -6,8 +6,8 @@ import * as vue from "vue";
|
|
|
6
6
|
//#region src/components/select/select-root.vue.d.ts
|
|
7
7
|
declare const __VLS_export: <T extends DefinedValue, M extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
8
|
props: vue.PublicProps & __VLS_PrettifyLocal<SelectRootProps<T, M> & {
|
|
9
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
10
9
|
"onUpdate:modelValue"?: ((value: M extends true ? T[] : T) => any) | undefined;
|
|
10
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
11
11
|
}> & (typeof globalThis extends {
|
|
12
12
|
__VLS_PROPS_FALLBACK: infer P;
|
|
13
13
|
} ? P : {});
|
|
@@ -19,7 +19,7 @@ declare const __VLS_export: <T extends DefinedValue, M extends boolean = false>(
|
|
|
19
19
|
open: boolean;
|
|
20
20
|
}) => any;
|
|
21
21
|
};
|
|
22
|
-
emit: ((evt: "update:
|
|
22
|
+
emit: ((evt: "update:modelValue", value: M extends true ? T[] : T) => void) & ((evt: "update:open", value: boolean) => void);
|
|
23
23
|
}>) => vue.VNode & {
|
|
24
24
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
25
25
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefinedValue, Direction, SelectionEmits, SelectionProps, UiClass } from "../../types/common.js";
|
|
2
2
|
import { PointerDownOutsideEvent } from "../../types/event.js";
|
|
3
|
-
import { ForceMountProps, FormFieldCommonProps } from "../../types/component.js";
|
|
3
|
+
import { DismissableLayerProps, ForceMountProps, FormFieldCommonProps } from "../../types/component.js";
|
|
4
4
|
import "../../types/index.js";
|
|
5
5
|
import { PrimitiveProps } from "../primitive/types.js";
|
|
6
6
|
import { PopperAnchorProps, PopperArrowProps, PopperPositionerProps } from "../popper/types.js";
|
|
@@ -27,7 +27,7 @@ type SelectRootEmits<T extends DefinedValue = DefinedValue, M extends boolean =
|
|
|
27
27
|
};
|
|
28
28
|
interface SelectPopupProps extends /** @vue-ignore */HTMLAttributes {}
|
|
29
29
|
type SelectPosition = 'item-aligned' | 'popper';
|
|
30
|
-
interface SelectContentImplProps extends PopperPositionerProps {
|
|
30
|
+
interface SelectContentImplProps extends PopperPositionerProps, DismissableLayerProps {
|
|
31
31
|
/**
|
|
32
32
|
* The positioning mode to use
|
|
33
33
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNullish as e}from"../../shared/guard.js";import"../../shared/index.js";import{useContext as t}from"../../composables/use-context.js";import{useUiContext as n}from"../../composables/use-ui-context.js";import"../../composables/index.js";import{useDirection as r}from"../config-provider/context.js";import{computed as i,
|
|
1
|
+
import{isNullish as e}from"../../shared/guard.js";import"../../shared/index.js";import{useContext as t}from"../../composables/use-context.js";import{useUiContext as n}from"../../composables/use-ui-context.js";import"../../composables/index.js";import{useDirection as r}from"../config-provider/context.js";import{computed as i,ref as a,shallowRef as o,toValue as s}from"vue";const[c,l]=t(`TabsRoot`,t=>{let n=r(t.dir),c=o(),l=e=>{c.value=e},u=n=>{e(n)||(t.modelValue.value=n)},d=a([]),f=e=>{d.value.push(e)},p=e=>{let t=d.value.indexOf(e);t!==-1&&d.value.splice(t,1)},m=e=>{let t=s(e),n=i(()=>`soybean-tabs-content-${t}`);return{contentId:n,triggerId:i(()=>`soybean-tabs-trigger-${t}`),existContentId:i(()=>d.value.includes(n.value))}};return{...t,dir:n,changeModelValue:u,listElement:c,onListElementChange:l,getId:m,registerContentId:f,unregisterContentId:p}}),[u,d]=n(`TabsUi`);export{c as provideTabsRootContext,u as provideTabsUi,l as useTabsRootContext,d as useTabsUi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardElement as e}from"../../composables/use-forward-element.js";import{usePresence as t}from"../../composables/use-presence.js";import"../../composables/index.js";import{useTabsRootContext as n,useTabsUi as r}from"./context.js";import{computed as i,createCommentVNode as a,createElementBlock as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,
|
|
1
|
+
import{useForwardElement as e}from"../../composables/use-forward-element.js";import{usePresence as t}from"../../composables/use-presence.js";import"../../composables/index.js";import{useTabsRootContext as n,useTabsUi as r}from"./context.js";import{computed as i,createCommentVNode as a,createElementBlock as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,onBeforeUnmount as u,onMounted as d,openBlock as f,renderSlot as p,shallowRef as m,unref as h}from"vue";const g=[`id`,`aria-labelledby`,`data-state`,`hidden`],_=s({name:`TabsContent`,__name:`tabs-content`,props:{value:{},forceMount:{type:Boolean}},setup(s){let _=s,{modelValue:v,unmountOnHide:y,getId:b,registerContentId:x,unregisterContentId:S}=n(`TabsContent`),[C,w]=e(),T=r(`content`),{contentId:E,triggerId:D}=b(_.value),O=i(()=>_.value===v.value),k=i(()=>O.value?`active`:`inactive`),A=_.forceMount?m(!0):t(C,O),j=m(O.value),M=i(()=>({animationDuration:j.value?`0s`:void 0}));return d(()=>{x(E.value),requestAnimationFrame(()=>{j.value=!1})}),u(()=>{S(E.value)}),(e,t)=>(f(),o(`div`,{id:h(E),ref:h(w),class:c(h(T)),"aria-labelledby":h(D),"data-state":k.value,hidden:!h(A),role:`tabpanel`,tabindex:`0`,style:l(M.value)},[!h(y)||h(A)?p(e.$slots,`default`,{key:0,active:O.value}):a(`v-if`,!0)],14,g))}});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Primitive as e}from"../primitive/primitive.js";import"../primitive/index.js";import{useTabsRootContext as t,useTabsUi as n}from"./context.js";import{tabsCssVars as r}from"./shared.js";import{computed as i,createBlock as a,createCommentVNode as o,defineComponent as s,
|
|
1
|
+
import{Primitive as e}from"../primitive/primitive.js";import"../primitive/index.js";import{useTabsRootContext as t,useTabsUi as n}from"./context.js";import{tabsCssVars as r}from"./shared.js";import{computed as i,createBlock as a,createCommentVNode as o,defineComponent as s,normalizeClass as c,normalizeStyle as l,openBlock as u,ref as d,renderSlot as f,unref as p,watch as m,watchPostEffect as h,withCtx as g}from"vue";import{useResizeObserver as _}from"@vueuse/core";const v=s({name:`TabsIndicator`,__name:`tabs-indicator`,props:{asChild:{type:Boolean},as:{}},setup(s){let{listElement:v,modelValue:y,dir:b,orientation:x}=t(`TabsIndicator`),S=n(`indicator`),C=d({size:null,position:null}),w=i(()=>({[r.indicatorSize]:`${C.value.size}px`,[r.indicatorPosition]:`${C.value.position}px`})),T=d([]);function E(){let e=v.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(x.value===`horizontal`?C.value={size:e.offsetWidth,position:e.offsetLeft}:C.value={size:e.offsetHeight,position:e.offsetTop})}return _(i(()=>[v.value,...T.value]),E),h(()=>{T.value=Array.from(v.value?.querySelectorAll(`[role="tab"]`)??[])}),m(()=>[y.value,b.value],()=>{E()},{immediate:!0,flush:`post`}),(t,n)=>typeof C.value.size==`number`?(u(),a(p(e),{key:0,as:s.as,"as-child":s.asChild,class:c(p(S)),style:l(w.value)},{default:g(()=>[f(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`,`style`])):o(`v-if`,!0)}});export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Primitive as e}from"../primitive/primitive.js";import"../primitive/index.js";import t from"../roving-focus/roving-focus-item.js";import"../roving-focus/index.js";import{useTabsRootContext as n,useTabsUi as r}from"./context.js";import{computed as i,createBlock as a,createVNode as o,defineComponent as s,normalizeClass as c,openBlock as l,renderSlot as u,unref as d,withCtx as f,withKeys as p,withModifiers as m}from"vue";const h=s({name:`TabsTrigger`,__name:`tabs-trigger`,props:{value:{},disabled:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`button`}},setup(s){let h=s,{modelValue:g,orientation:_,changeModelValue:v,activationMode:y,getId:b}=n(`TabsTrigger`),x=r(`trigger`),{contentId:S,triggerId:C}=b(h.value),
|
|
1
|
+
import{Primitive as e}from"../primitive/primitive.js";import"../primitive/index.js";import t from"../roving-focus/roving-focus-item.js";import"../roving-focus/index.js";import{useTabsRootContext as n,useTabsUi as r}from"./context.js";import{computed as i,createBlock as a,createVNode as o,defineComponent as s,normalizeClass as c,openBlock as l,renderSlot as u,unref as d,withCtx as f,withKeys as p,withModifiers as m}from"vue";const h=s({name:`TabsTrigger`,__name:`tabs-trigger`,props:{value:{},disabled:{type:Boolean,default:!1},asChild:{type:Boolean},as:{default:`button`}},setup(s){let h=s,{modelValue:g,orientation:_,changeModelValue:v,activationMode:y,getId:b}=n(`TabsTrigger`),x=r(`trigger`),{contentId:S,triggerId:C,existContentId:w}=b(h.value),T=i(()=>h.value===g.value),E=i(()=>T.value?`active`:`inactive`),D=i(()=>h.as===`button`?`button`:void 0),O=i(()=>w.value?S.value:void 0),k=e=>{!h.disabled&&e.ctrlKey===!1?v(h.value):e.preventDefault()},A=()=>{v(h.value)},j=()=>{T.value||h.disabled||y.value!==`manual`&&v(h.value)};return(n,r)=>(l(),a(d(t),{"as-child":``,focusable:!s.disabled,active:T.value},{default:f(()=>[o(d(e),{id:d(C),as:s.as,"as-child":s.asChild,class:c(d(x)),"aria-controls":O.value,"aria-selected":T.value?`true`:`false`,"data-disabled":s.disabled?``:void 0,"data-orientation":d(_),"data-state":E.value,role:`tab`,type:D.value,onMousedown:m(k,[`left`]),onKeydown:p(A,[`enter`,`space`]),onFocus:j},{default:f(()=>[u(n.$slots,`default`,{active:T.value})]),_:3},8,[`id`,`as`,`as-child`,`class`,`aria-controls`,`aria-selected`,`data-disabled`,`data-orientation`,`data-state`,`type`])]),_:3},8,[`focusable`,`active`]))}});export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformPropsToContext as e}from"../../shared/vue.js";import"../../shared/index.js";import{provideCollectionContext as t,provideToastProviderContext as n}from"./context.js";import{defineComponent as r,renderSlot as i}from"vue";const a=r({name:`ToastProvider`,__name:`toast-provider`,props:{label:{default:`Notification`},duration:{default:5e3},swipeDirection:{default:`right`},swipeThreshold:{default:50}},setup(r){let a=r;return t(),n(e(a)),(e,t)=>i(e.$slots,`default`)}});export{a as default};
|
|
1
|
+
import{transformPropsToContext as e}from"../../shared/vue.js";import"../../shared/index.js";import{provideCollectionContext as t,provideToastProviderContext as n}from"./context.js";import{defineComponent as r,renderSlot as i}from"vue";const a=r({name:`ToastProvider`,__name:`toast-provider`,props:{label:{default:`Notification`},duration:{default:5e3},disableSwipe:{type:Boolean},swipeDirection:{default:`right`},swipeThreshold:{default:50}},setup(r){let a=r;return t(),n(e(a)),(e,t)=>i(e.$slots,`default`)}});export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getDisclosureState as e}from"../../shared/value.js";import{getActiveElement as t}from"../../shared/dom.js";import{isClient as n}from"../../shared/env.js";import{handleAndDispatchCustomEvent as r}from"../../shared/event.js";import{isDeltaInDirection as i}from"../../shared/geometry.js";import"../../shared/index.js";import{useControllableState as a}from"../../composables/use-controllable-state.js";import{usePresence as o}from"../../composables/use-presence.js";import"../../composables/index.js";import{Primitive as s}from"../primitive/primitive.js";import"../primitive/index.js";import{provideToastRootContext as c,useCollectionItem as l,useToastProviderContext as u,useToastUi as d}from"./context.js";import f from"./toast-announce.js";import{TOAST_DATA_SWIPE as p,TOAST_SWIPE_CANCEL as m,TOAST_SWIPE_END as h,TOAST_SWIPE_MOVE as
|
|
1
|
+
import{getDisclosureState as e}from"../../shared/value.js";import{getActiveElement as t}from"../../shared/dom.js";import{isClient as n}from"../../shared/env.js";import{handleAndDispatchCustomEvent as r}from"../../shared/event.js";import{isDeltaInDirection as i}from"../../shared/geometry.js";import"../../shared/index.js";import{useControllableState as a}from"../../composables/use-controllable-state.js";import{usePresence as o}from"../../composables/use-presence.js";import"../../composables/index.js";import{Primitive as s}from"../primitive/primitive.js";import"../primitive/index.js";import{provideToastRootContext as c,useCollectionItem as l,useToastProviderContext as u,useToastUi as d}from"./context.js";import f from"./toast-announce.js";import{TOAST_DATA_SWIPE as p,TOAST_SWIPE_CANCEL as m,TOAST_SWIPE_END as h,TOAST_SWIPE_MOVE as g,TOAST_SWIPE_START as ee,VIEWPORT_PAUSE as _,VIEWPORT_RESUME as v,getAnnounceTextContent as te,toastCssVars as y,toastSwipe as b}from"./shared.js";import{Fragment as ne,Teleport as re,computed as x,createBlock as S,createCommentVNode as C,createElementBlock as ie,createTextVNode as ae,createVNode as w,defineComponent as T,mergeProps as oe,onMounted as se,onUnmounted as ce,onWatcherCleanup as le,openBlock as E,renderSlot as ue,shallowRef as D,toDisplayString as de,unref as O,useAttrs as fe,watch as pe,watchEffect as me,withCtx as k,withModifiers as he}from"vue";import{onKeyStroke as ge,useRafFn as _e}from"@vueuse/core";const A=T({name:`ToastRoot`,inheritAttrs:!1,__name:`toast-root`,props:{liveType:{default:`foreground`},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!0},duration:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{default:`li`}},emits:[`escapeKeyDown`,`pause`,`resume`,`swipeStart`,`swipeMove`,`swipeCancel`,`swipeEnd`,`update:open`],setup(T,{emit:A}){let j=T,M=A,N=fe(),P=d(`root`),{swipeDirection:F,swipeThreshold:I,disableSwipe:L,viewportElement:R,isFocusedToastEscapeKeyDownRef:ve,isClosePausedRef:z,duration:ye,onToastAdd:B,onToastRemove:be}=u(`ToastRoot`),{itemElement:V,setItemElement:xe,itemProps:Se}=l(),H=a(()=>j.open,e=>{M(`update:open`,e??!1)},j.defaultOpen),Ce=j.forceMount?D(!0):o(V,H),we=x(()=>L.value?``:`user-select: none; touch-action: none`),U=x(()=>typeof j.duration==`number`?j.duration:ye.value||5e3),Te=x(()=>e(H.value)),W=D(null),G=D(null),K=D(0),q=D(U.value),J=D(0),Y=D(U.value),X=_e(()=>{let e=new Date().getTime()-K.value;Y.value=Math.max(q.value-e,0)},{fpsLimit:60}),Z=x(()=>V.value?te(V.value):null),Q=e=>{let n=e?.pointerType===``;V.value?.contains(t())&&n&&R.value?.focus(),n&&(z.value=!1),H.value=!1},$=e=>{!e||e===1/0||n&&(window.clearTimeout(J.value),K.value=new Date().getTime(),J.value=window.setTimeout(Q,e))},Ee=e=>{M(`swipeStart`,e),!e.defaultPrevented&&e.currentTarget.setAttribute(p,b.start)},De=e=>{if(M(`swipeMove`,e),e.defaultPrevented)return;let{x:t,y:n}=e.detail.delta,r=e.currentTarget;r.setAttribute(p,b.move),r.style.setProperty(y.swipeMoveX,`${t}px`),r.style.setProperty(y.swipeMoveY,`${n}px`)},Oe=e=>{if(M(`swipeCancel`,e),e.defaultPrevented)return;let t=e.currentTarget;t.setAttribute(p,b.cancel),Object.values(y).forEach(e=>{t.style.removeProperty(e)})},ke=e=>{if(M(`swipeEnd`,e),e.defaultPrevented)return;let{x:t,y:n}=e.detail.delta,r=e.currentTarget;r.setAttribute(p,b.end),r.style.removeProperty(y.swipeMoveX),r.style.removeProperty(y.swipeMoveY),r.style.setProperty(y.swipeEndX,`${t}px`),r.style.setProperty(y.swipeEndY,`${n}px`),H.value=!1},Ae=e=>{if(L.value)return;let{clientX:t,clientY:n}=e;W.value={x:t,y:n}},je=e=>{if(L.value||!W.value)return;let{clientX:t,clientY:n}=e,{x:a,y:o}=W.value,s=t-a,c=n-o,l=[`left`,`right`].includes(F.value),u=[`left`,`up`].includes(F.value)?Math.min:Math.max,d=l?u(0,s):0,f=l?0:u(0,c),p=e.pointerType===`touch`?10:2,m={x:d,y:f},h={originalEvent:e,delta:m};if(G.value){G.value=m,r(g,De,h);return}if(i(m,F.value,p)){G.value=m,r(ee,Ee,h),e.target.setPointerCapture(e.pointerId);return}(Math.abs(s)>p||Math.abs(c)>p)&&(W.value=null)},Me=e=>{if(L.value)return;let t=G.value,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),G.value=null,W.value=null,!t)return;let a=e.currentTarget,o={originalEvent:e,delta:t};i(t,F.value,I.value)?r(h,ke,o):r(m,Oe,o),a?.addEventListener(`click`,e=>e.preventDefault(),{once:!0})};return ge(`Escape`,e=>{M(`escapeKeyDown`,e),e.defaultPrevented||(ve.value=!0,Q())}),me(()=>{let e=R.value;if(!e)return;let t=()=>{$(q.value),X.resume(),M(`resume`)},n=()=>{let e=new Date().getTime()-K.value;q.value-=e,window.clearTimeout(J.value),X.pause(),M(`pause`)};e.addEventListener(_,n),e.addEventListener(v,t),le(()=>{e.removeEventListener(_,n),e.removeEventListener(v,t)})}),pe(()=>[j.open,U.value],()=>{q.value=U.value,j.open&&!z.value&&$(U.value)},{immediate:!0}),c({onClose:Q}),se(()=>{B()}),ce(()=>{be()}),(e,t)=>O(Ce)?(E(),ie(ne,{key:0},[Z.value?(E(),S(f,{key:0,role:`alert`,"aria-live":T.liveType===`foreground`?`assertive`:`polite`,"aria-atomic":`true`},{default:k(()=>[ae(de(Z.value),1)]),_:1},8,[`aria-live`])):C(`v-if`,!0),O(R)?(E(),S(re,{key:1,to:O(R)},[w(O(s),oe({ref:O(xe)},{...O(N),...O(Se)},{as:T.as,"as-child":T.asChild,class:O(P),"aria-atomic":`true`,"aria-live":`off`,"data-swipe-direction":O(F),"data-state":Te.value,role:`alert`,tabindex:`0`,style:we.value,onPointerdown:he(Ae,[`left`]),onPointermove:je,onPointerup:Me}),{default:k(()=>[ue(e.$slots,`default`,{remaining:Y.value,duration:U.value})]),_:3},16,[`as`,`as-child`,`class`,`data-swipe-direction`,`data-state`,`style`])],8,[`to`])):C(`v-if`,!0)],64)):C(`v-if`,!0)}});export{A as default};
|
|
@@ -32,8 +32,8 @@ declare const __VLS_base: vue.DefineComponent<ToastRootProps, {}, {}, {}, {}, vu
|
|
|
32
32
|
onSwipeCancel?: ((event: SwipeEvent) => any) | undefined;
|
|
33
33
|
onSwipeEnd?: ((event: SwipeEvent) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
|
-
as: AsTag | vue.Component;
|
|
36
35
|
open: boolean;
|
|
36
|
+
as: AsTag | vue.Component;
|
|
37
37
|
defaultOpen: boolean;
|
|
38
38
|
liveType: ToastLiveType;
|
|
39
39
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -19,6 +19,12 @@ interface ToastProviderProps {
|
|
|
19
19
|
* @defaultValue 5000
|
|
20
20
|
*/
|
|
21
21
|
duration?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to disable the ability to swipe to close the toast.
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue false
|
|
26
|
+
*/
|
|
27
|
+
disableSwipe?: boolean;
|
|
22
28
|
/**
|
|
23
29
|
* Direction of pointer swipe that should close the toast.
|
|
24
30
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useForwardElement as e}from"../../composables/use-forward-element.js";import"../../composables/index.js";import t from"../visually-hidden/visually-hidden.js";import"../visually-hidden/index.js";import{popperCssVars as n}from"../popper/shared.js";import r from"../popper/popper-popup.js";import"../popper/index.js";import{useTooltipRootContext as i}from"./context.js";import{tooltipCssVars as a}from"./shared.js";import{computed as o,createBlock as s,createTextVNode as c,createVNode as l,defineComponent as u,openBlock as d,renderSlot as f,toDisplayString as p,unref as m,withCtx as h}from"vue";const g=u({name:`TooltipPopup`,__name:`tooltip-popup`,props:{ariaLabel:{}},setup(u){let g=u,{popupId:_,dataState:v,initPopupId:y,onPopupElementChange:b}=i(`TooltipPopup`),[x,S]=e(b),C={[a.transformOrigin]:`var(${n.transformOrigin})`,[a.availableWidth]:`var(${n.availableWidth})`,[a.availableHeight]:`var(${n.availableHeight})`,[a.anchorWidth]:`var(${n.anchorWidth})`,[a.anchorHeight]:`var(${n.anchorHeight})`},w=o(()=>g.ariaLabel??x.value?.textContent);return y(),(e,n)=>(d(),s(m(r),{ref:m(S),"data-dismissable-layer":``,"data-state":m(v),style:C},{default:h(()=>[f(e.$slots,`default`),l(m(t),{id:m(_),role:`tooltip`},{default:h(()=>[c(p(w.value),1)]),_:1},8,[`id`])]),_:3},8,[`data-state`]))}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useDismissableLayer as e}from"../../composables/use-dismissable-layer.js";import{useForwardElement as t}from"../../composables/use-forward-element.js";import{useGraceArea as n}from"../../composables/use-grace-area.js";import"../../composables/index.js";import r from"../popper/popper-positioner.js";import"../popper/index.js";import{useTooltipOpenDelayedContext as i,useTooltipRootContext as a}from"./context.js";import{TOOLTIP_OPEN as o}from"./shared.js";import{createBlock as s,defineComponent as c,mergeProps as l,onWatcherCleanup as u,openBlock as d,renderSlot as f,unref as p,watchPostEffect as m,withCtx as h}from"vue";const g=c({name:`TooltipPositionerImpl`,__name:`tooltip-positioner-impl`,props:{placement:{},side:{default:`top`},sideOffset:{default:0},sideFlip:{type:Boolean},align:{default:`center`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:`partial`},hideWhenDetached:{type:Boolean,default:!1},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(c,{emit:g}){let _=c,v=g,{isPointerInTransitRef:y}=i(`TooltipPositionerImpl`),{triggerElement:b,popupElement:x,disableClosingTrigger:S,disableHoverableContent:C,onClose:w}=a(`TooltipPositionerImpl`),[T,E]=t();n({triggerElement:b,areaElement:T,onPointerInTransitChange:e=>{y.value=e},onPointerExit:()=>{w()},disabled:C});let{pointerEvents:D}=e(T,{disableOutsidePointerEvents:!1,onEscapeKeyDown:e=>{v(`escapeKeyDown`,e)},onPointerDownOutside:e=>{S.value&&b.value?.contains(e.target)&&e.preventDefault(),v(`pointerDownOutside`,e)},onFocusOutside:e=>{e.preventDefault()},onDismiss:()=>{w()}});return m(()=>{let e=e=>{e.target?.contains(b.value)&&w()};window.addEventListener(`scroll`,e),window.addEventListener(o,w),u(()=>{window.removeEventListener(`scroll`,e),window.removeEventListener(o,w)})}),m(()=>{x.value&&D.value&&(x.value.style.pointerEvents=D.value)}),(e,t)=>(d(),s(p(r),l(_,{ref:p(E)}),{default:h(()=>[f(e.$slots,`default`)]),_:3},16))}});export{g as default};
|
|
1
|
+
import{useDismissableLayer as e}from"../../composables/use-dismissable-layer.js";import{useForwardElement as t}from"../../composables/use-forward-element.js";import{useGraceArea as n}from"../../composables/use-grace-area.js";import"../../composables/index.js";import r from"../popper/popper-positioner.js";import"../popper/index.js";import{useTooltipOpenDelayedContext as i,useTooltipRootContext as a}from"./context.js";import{TOOLTIP_OPEN as o}from"./shared.js";import{createBlock as s,defineComponent as c,mergeProps as l,onWatcherCleanup as u,openBlock as d,renderSlot as f,unref as p,watchPostEffect as m,withCtx as h}from"vue";const g=c({name:`TooltipPositionerImpl`,__name:`tooltip-positioner-impl`,props:{placement:{},side:{default:`top`},sideOffset:{default:0},sideFlip:{type:Boolean},align:{default:`center`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},hideShiftedArrow:{type:Boolean},sticky:{default:`partial`},hideWhenDetached:{type:Boolean,default:!1},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(c,{emit:g}){let _=c,v=g,{isPointerInTransitRef:y}=i(`TooltipPositionerImpl`),{triggerElement:b,popupElement:x,disableClosingTrigger:S,disableHoverableContent:C,onClose:w}=a(`TooltipPositionerImpl`),[T,E]=t();n({triggerElement:b,areaElement:T,onPointerInTransitChange:e=>{y.value=e},onPointerExit:()=>{w()},disabled:C});let{pointerEvents:D}=e(T,{disableOutsidePointerEvents:!1,onEscapeKeyDown:e=>{v(`escapeKeyDown`,e)},onPointerDownOutside:e=>{S.value&&b.value?.contains(e.target)&&e.preventDefault(),v(`pointerDownOutside`,e)},onFocusOutside:e=>{e.preventDefault()},onDismiss:()=>{w()}});return m(()=>{let e=e=>{e.target?.contains(b.value)&&w()};window.addEventListener(`scroll`,e),window.addEventListener(o,w),u(()=>{window.removeEventListener(`scroll`,e),window.removeEventListener(o,w)})}),m(()=>{x.value&&D.value&&(x.value.style.pointerEvents=D.value)}),(e,t)=>(d(),s(p(r),l(_,{ref:p(E)}),{default:h(()=>[f(e.$slots,`default`)]),_:3},16))}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import{useOmitProps as n}from"../../composables/use-props.js";import"../../composables/index.js";import{useTooltipRootContext as r}from"./context.js";import i from"./tooltip-positioner-impl.js";import{createBlock as a,createCommentVNode as o,defineComponent as s,mergeProps as c,openBlock as l,renderSlot as u,shallowRef as d,toHandlers as f,unref as p,withCtx as m}from"vue";const h=s({name:`TooltipPositioner`,__name:`tooltip-positioner`,props:{placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(s,{emit:h}){let g=s,_=h,v=n(g,[`forceMount`]),y=e(_),{popupElement:b,open:x}=r(`TooltipPositioner`),S=g.forceMount?d(!0):t(b,x);return(e,t)=>p(S)?(l(),a(i,c({key:0},p(v),f(p(y))),{default:m(()=>[u(e.$slots,`default`)]),_:3},16)):o(`v-if`,!0)}});export{h as default};
|
|
1
|
+
import{useForwardListeners as e}from"../../composables/use-forward-listeners.js";import{usePresence as t}from"../../composables/use-presence.js";import{useOmitProps as n}from"../../composables/use-props.js";import"../../composables/index.js";import{useTooltipRootContext as r}from"./context.js";import i from"./tooltip-positioner-impl.js";import{createBlock as a,createCommentVNode as o,defineComponent as s,mergeProps as c,openBlock as l,renderSlot as u,shallowRef as d,toHandlers as f,unref as p,withCtx as m}from"vue";const h=s({name:`TooltipPositioner`,__name:`tooltip-positioner`,props:{placement:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},forceMount:{type:Boolean}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(s,{emit:h}){let g=s,_=h,v=n(g,[`forceMount`]),y=e(_),{popupElement:b,open:x}=r(`TooltipPositioner`),S=g.forceMount?d(!0):t(b,x);return(e,t)=>p(S)?(l(),a(i,c({key:0},p(v),f(p(y))),{default:m(()=>[u(e.$slots,`default`)]),_:3},16)):o(`v-if`,!0)}});export{h as default};
|
|
@@ -16,8 +16,8 @@ declare const __VLS_base: vue.DefineComponent<TreeMenuRootProps, {}, {}, {}, {},
|
|
|
16
16
|
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
18
|
defaultValue: string;
|
|
19
|
-
collapsed: boolean;
|
|
20
19
|
defaultExpanded: string[];
|
|
20
|
+
collapsed: boolean;
|
|
21
21
|
defaultCollapsed: boolean;
|
|
22
22
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GRACE_AREA_TRIGGER_ATTR as e}from"../constants/attr.js";import{isClient as t}from"../shared/env.js";import{getExitSideFromRect as n,getHull as r,getPaddedExitPoints as i,getPointsFromRect as a,isPointInPolygon as o}from"../shared/geometry.js";import"../shared/index.js";import{onWatcherCleanup as s,ref as c,watchEffect as l}from"vue";import{refAutoReset as u}from"@vueuse/core";function
|
|
1
|
+
import{GRACE_AREA_TRIGGER_ATTR as e}from"../constants/attr.js";import{isClient as t}from"../shared/env.js";import{getExitSideFromRect as n,getHull as r,getPaddedExitPoints as i,getPointsFromRect as a,isPointInPolygon as o}from"../shared/geometry.js";import"../shared/index.js";import{onWatcherCleanup as s,ref as c,watchEffect as l}from"vue";import{refAutoReset as u,tryOnScopeDispose as d}from"@vueuse/core";function f(n){let{triggerElement:r,areaElement:i,onPointerInTransitChange:a,onPointerExit:f,disabled:m,subAreaAttribute:h,onSubAreaEnter:g,onSubAreaExit:_}=n,v=u(!1,300),y=c(),b=c(),x=()=>{y.value=void 0,b.value=void 0,a?.(!1)};l(()=>{if(!t||m?.value===!0)return;let e=r.value,n=i.value;if(!e||!n)return;function a(e,t){let{currentTarget:n,clientX:r,clientY:i}=e;n instanceof HTMLElement&&(y.value=p({x:r,y:i},n,t),v.value=!0)}function o(t){if(!h)return;let n=t.target.closest(`[${h}]`);if(n&&i.value?.contains(n)){if(b.value!==n){b.value&&_?.(b.value),b.value=n,g?.(n);let{clientX:r,clientY:i}=t;y.value=p({x:r,y:i},e,n),v.value=!0}}else b.value&&(_?.(b.value),b.value=void 0)}let c=e=>a(e,n),l=t=>a(t,e),u=e=>o(e);e.addEventListener(`pointerleave`,c),n.addEventListener(`pointerleave`,l),h&&n.addEventListener(`pointermove`,u),s(()=>{e.removeEventListener(`pointerleave`,c),n.removeEventListener(`pointerleave`,l),h&&n.removeEventListener(`pointermove`,u)})}),l(()=>{if(!t||m?.value===!0||!y.value)return;let n=t=>{if(!y.value)return;let n=t.target;if(!(n instanceof Element))return;let{clientX:a,clientY:s}=t,c=r.value?.contains(n)||i.value?.contains(n),l=h&&n.closest(`[${h}]`)&&i.value?.contains(n);if(c||l){c&&x();return}let u=!o({x:a,y:s},y.value),d=!!n.closest(`[${e}]`),p=!r.value?.contains(n)&&!i.value?.contains(n)&&!(h&&n.closest(`[${h}]`));(u&&p||d)&&(x(),f())};r.value?.ownerDocument.addEventListener(`pointermove`,n),s(()=>{r.value?.ownerDocument.removeEventListener(`pointermove`,n)})}),l(()=>{let e=v.value;a?.(e)}),d(()=>{v.value=!1})}function p(e,t,o){let s=i(e,n(e,t.getBoundingClientRect()),1),c=a(o.getBoundingClientRect());return r([...s,...c])}export{f as useGraceArea};
|
package/dist/shared/dom.d.ts
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { VNode } from "vue";
|
|
2
|
-
|
|
3
1
|
//#region src/shared/dom.d.ts
|
|
4
2
|
declare function removeLinks(items: HTMLElement[]): HTMLElement[];
|
|
5
3
|
declare function getActiveElement<T extends Element = HTMLElement>(): T | null;
|
|
6
4
|
declare function isElementHasAttribute(element: HTMLElement, attribute: string): boolean;
|
|
7
5
|
declare function getCollectionItemElements(element: HTMLElement): HTMLElement[];
|
|
8
6
|
declare function getAriaLabel(element?: HTMLElement | null, id?: string, ariaLabel?: string): string | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Extract text content from VNode for generating aria-label. Use iteration instead of recursion to avoid stack
|
|
11
|
-
* overflow.
|
|
12
|
-
*
|
|
13
|
-
* @param node VNode node
|
|
14
|
-
* @returns Extracted text content
|
|
15
|
-
*/
|
|
16
|
-
declare function getAriaLabelByVNode(node?: VNode | null): string;
|
|
17
|
-
declare function getAriaLabelByVNodeList(nodes?: VNode[] | null): string;
|
|
18
7
|
declare function isHTMLElement(node: any): node is HTMLElement;
|
|
19
8
|
//#endregion
|
|
20
|
-
export { getActiveElement, getAriaLabel,
|
|
9
|
+
export { getActiveElement, getAriaLabel, getCollectionItemElements, isElementHasAttribute, isHTMLElement, removeLinks };
|
package/dist/shared/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COLLECTION_ITEM_ATTRIBUTE as e}from"../constants/attr.js";
|
|
1
|
+
import{COLLECTION_ITEM_ATTRIBUTE as e}from"../constants/attr.js";function t(e){return e.filter(e=>e.tagName!==`A`)}function n(){let e=document.activeElement;if(e===null)return null;for(;e!==null&&e.shadowRoot!==null&&e.shadowRoot.activeElement!==null;)e=e.shadowRoot.activeElement;return e}function r(e,t){return[e.getAttribute(t),e.getAttribute(`data-${t}`)].some(e=>e===``||e===`true`)}function i(t){return Array.from(t.querySelectorAll(`[${e}]`))}function a(e,t,n){if(n)return n;if(!(!t||!e))return document.querySelector(`[for="${t}"]`)?.textContent??void 0}function o(e){return e.nodeType===e.ELEMENT_NODE}export{n as getActiveElement,a as getAriaLabel,i as getCollectionItemElements,r as isElementHasAttribute,o as isHTMLElement,t as removeLinks};
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import { isKey, stringToPath, toCamelCase, toKebabCase, toPascalCase } from "./s
|
|
|
4
4
|
import { isValueEqualOrExist } from "./comparison.js";
|
|
5
5
|
import { clamp, getBinaryCheckedState, getCheckedState, getDisclosureState, getOpenFromSingleOrMultiple, getValue, isIndeterminate, roundToStepPrecision, setValue, snapValueToStep } from "./value.js";
|
|
6
6
|
import { createFieldName, parseArrayValue, parseFormValue, parseObjectValue, parsePrimitiveValue } from "./form.js";
|
|
7
|
-
import { getActiveElement, getAriaLabel,
|
|
7
|
+
import { getActiveElement, getAriaLabel, getCollectionItemElements, isElementHasAttribute, isHTMLElement, removeLinks } from "./dom.js";
|
|
8
8
|
import { focus, focusFirstAndSelect, getDirectionAwareKey, getFocusIntent, getTabbableCandidates, getTabbableEdges, removeFromTabOrder, tryFocusFirst } from "./focus.js";
|
|
9
9
|
import { getElFromTemplateRef, getLifeCycleTarget, getRawChildren, isFormControl, transformPropsToContext } from "./vue.js";
|
|
10
10
|
import { isBrowser, isClient, isIOS, refreshIOSDetection } from "./env.js";
|
|
11
11
|
import { handleAndDispatchCustomEvent, isMouseEvent } from "./event.js";
|
|
12
12
|
import { getExitSideFromRect, getHull, getPaddedExitPoints, getPointsFromRect, isDeltaInDirection, isPointInPolygon, isPointerInGraceArea } from "./geometry.js";
|
|
13
13
|
import { getTreePaths } from "./tree.js";
|
|
14
|
-
export { appendAt, arrayRemove, clamp, compact, createFieldName, findValuesBetween, flattenChildren, focus, focusFirstAndSelect, getActiveElement, getAriaLabel,
|
|
14
|
+
export { appendAt, arrayRemove, clamp, compact, createFieldName, findValuesBetween, flattenChildren, focus, focusFirstAndSelect, getActiveElement, getAriaLabel, getBinaryCheckedState, getCheckedState, getCollectionItemElements, getDirectionAwareKey, getDisclosureState, getElFromTemplateRef, getExitSideFromRect, getFocusIntent, getHull, getLifeCycleTarget, getNextMatch, getOpenFromSingleOrMultiple, getPaddedExitPoints, getPointsFromRect, getRawChildren, getTabbableCandidates, getTabbableEdges, getTreePaths, getValue, handleAndDispatchCustomEvent, insertAt, isArrayValue, isBlankString, isBrowser, isClient, isDateObject, isDeltaInDirection, isElementHasAttribute, isFormControl, isFunction, isHTMLElement, isIOS, isIndeterminate, isKey, isMouseEvent, isNonNullObject, isNullish, isObject, isObjectType, isPointInPolygon, isPointerInGraceArea, isPrimitive, isPromise, isString, isValueEqualOrExist, keysOf, moveAt, omit, parseArrayValue, parseFormValue, parseObjectValue, parsePrimitiveValue, pick, prependAt, refreshIOSDetection, removeAt, removeFromTabOrder, removeLinks, roundToStepPrecision, setValue, snapValueToStep, stringToPath, swapAt, toCamelCase, toKebabCase, toPascalCase, transformPropsToContext, tryFocusFirst, updateAt, wrapArray };
|
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArrayValue as e,isBlankString as t,isDateObject as n,isFunction as r,isNonNullObject as i,isNullish as a,isObject as o,isObjectType as s,isPrimitive as c,isPromise as l,isString as u,keysOf as d}from"./guard.js";import{appendAt as f,arrayRemove as p,compact as m,findValuesBetween as h,flattenChildren as g,getNextMatch as _,insertAt as v,moveAt as y,omit as b,pick as x,prependAt as S,removeAt as C,swapAt as w,updateAt as T,wrapArray as E}from"./object.js";import{isKey as D,stringToPath as O,toCamelCase as k,toKebabCase as A,toPascalCase as j}from"./string.js";import{isValueEqualOrExist as M}from"./comparison.js";import{clamp as N,getBinaryCheckedState as P,getCheckedState as F,getDisclosureState as I,getOpenFromSingleOrMultiple as L,getValue as R,isIndeterminate as z,roundToStepPrecision as B,setValue as V,snapValueToStep as H}from"./value.js";import{createFieldName as U,parseArrayValue as W,parseFormValue as G,parseObjectValue as K,parsePrimitiveValue as q}from"./form.js";import{getActiveElement as J,getAriaLabel as Y,
|
|
1
|
+
import{isArrayValue as e,isBlankString as t,isDateObject as n,isFunction as r,isNonNullObject as i,isNullish as a,isObject as o,isObjectType as s,isPrimitive as c,isPromise as l,isString as u,keysOf as d}from"./guard.js";import{appendAt as f,arrayRemove as p,compact as m,findValuesBetween as h,flattenChildren as g,getNextMatch as _,insertAt as v,moveAt as y,omit as b,pick as x,prependAt as S,removeAt as C,swapAt as w,updateAt as T,wrapArray as E}from"./object.js";import{isKey as D,stringToPath as O,toCamelCase as k,toKebabCase as A,toPascalCase as j}from"./string.js";import{isValueEqualOrExist as M}from"./comparison.js";import{clamp as N,getBinaryCheckedState as P,getCheckedState as F,getDisclosureState as I,getOpenFromSingleOrMultiple as L,getValue as R,isIndeterminate as z,roundToStepPrecision as B,setValue as V,snapValueToStep as H}from"./value.js";import{createFieldName as U,parseArrayValue as W,parseFormValue as G,parseObjectValue as K,parsePrimitiveValue as q}from"./form.js";import{getActiveElement as J,getAriaLabel as Y,getCollectionItemElements as X,isElementHasAttribute as Z,isHTMLElement as Q,removeLinks as $}from"./dom.js";import{focus as ee,focusFirstAndSelect as te,getDirectionAwareKey as ne,getFocusIntent as re,getTabbableCandidates as ie,getTabbableEdges as ae,removeFromTabOrder as oe,tryFocusFirst as se}from"./focus.js";import{getElFromTemplateRef as ce,getLifeCycleTarget as le,getRawChildren as ue,isFormControl as de,transformPropsToContext as fe}from"./vue.js";import{isBrowser as pe,isClient as me,isIOS as he,refreshIOSDetection as ge}from"./env.js";import{handleAndDispatchCustomEvent as _e,isMouseEvent as ve}from"./event.js";import{getExitSideFromRect as ye,getHull as be,getPaddedExitPoints as xe,getPointsFromRect as Se,isDeltaInDirection as Ce,isPointInPolygon as we,isPointerInGraceArea as Te}from"./geometry.js";import{getTreePaths as Ee}from"./tree.js";export{f as appendAt,p as arrayRemove,N as clamp,m as compact,U as createFieldName,h as findValuesBetween,g as flattenChildren,ee as focus,te as focusFirstAndSelect,J as getActiveElement,Y as getAriaLabel,P as getBinaryCheckedState,F as getCheckedState,X as getCollectionItemElements,ne as getDirectionAwareKey,I as getDisclosureState,ce as getElFromTemplateRef,ye as getExitSideFromRect,re as getFocusIntent,be as getHull,le as getLifeCycleTarget,_ as getNextMatch,L as getOpenFromSingleOrMultiple,xe as getPaddedExitPoints,Se as getPointsFromRect,ue as getRawChildren,ie as getTabbableCandidates,ae as getTabbableEdges,Ee as getTreePaths,R as getValue,_e as handleAndDispatchCustomEvent,v as insertAt,e as isArrayValue,t as isBlankString,pe as isBrowser,me as isClient,n as isDateObject,Ce as isDeltaInDirection,Z as isElementHasAttribute,de as isFormControl,r as isFunction,Q as isHTMLElement,he as isIOS,z as isIndeterminate,D as isKey,ve as isMouseEvent,i as isNonNullObject,a as isNullish,o as isObject,s as isObjectType,we as isPointInPolygon,Te as isPointerInGraceArea,c as isPrimitive,l as isPromise,u as isString,M as isValueEqualOrExist,d as keysOf,y as moveAt,b as omit,W as parseArrayValue,G as parseFormValue,K as parseObjectValue,q as parsePrimitiveValue,x as pick,S as prependAt,ge as refreshIOSDetection,C as removeAt,oe as removeFromTabOrder,$ as removeLinks,B as roundToStepPrecision,V as setValue,H as snapValueToStep,O as stringToPath,w as swapAt,k as toCamelCase,A as toKebabCase,j as toPascalCase,fe as transformPropsToContext,se as tryFocusFirst,T as updateAt,E as wrapArray};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soybeanjs/headless",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "SoybeanHeadless is a collection unstyled components for Vue 3. It is designed to be lightweight and easy to use.",
|
|
5
5
|
"homepage": "https://github.com/soybeanjs/soybean-ui",
|
|
6
6
|
"bugs": {
|