yuyeon 0.0.50 → 0.0.52-rc.1
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/yuyeon.js +1160 -1148
- package/dist/yuyeon.umd.cjs +5 -5
- package/lib/components/layer/YLayer.mjs +5 -1
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/composables/communication.mjs.map +1 -1
- package/lib/composables/coordinate/index.mjs +1 -1
- package/lib/composables/coordinate/index.mjs.map +1 -1
- package/lib/composables/coordinate/levitation.mjs +17 -7
- package/lib/composables/coordinate/levitation.mjs.map +1 -1
- package/package.json +1 -1
- package/types/components/date-picker/YDateCalendar.d.ts +3 -3
- package/types/components/dialog/YDialog.d.ts +40 -11
- package/types/components/dropdown/YDropdown.d.ts +7 -7
- package/types/components/field-input/YFieldInput.d.ts +1 -1
- package/types/components/layer/YLayer.d.ts +27 -7
- package/types/components/menu/YMenu.d.ts +29 -7
- package/types/components/pagination/YPagination.d.ts +1 -1
- package/types/components/select/YSelect.d.ts +74 -32
- package/types/components/snackbar/YSnackbar.d.ts +1 -1
- package/types/components/table/composibles/pagination.d.ts +2 -2
- package/types/components/table/composibles/sorting.d.ts +1 -1
- package/types/components/tooltip/YTooltip.d.ts +24 -6
- package/types/composables/communication.d.ts +2 -3
- package/types/composables/coordinate/index.d.ts +4 -4
- package/types/composables/focus.d.ts +1 -1
- package/types/composables/form.d.ts +1 -1
|
@@ -53,6 +53,10 @@ export const pressYLayerProps = propsFactory({
|
|
|
53
53
|
type: Number,
|
|
54
54
|
default: 200
|
|
55
55
|
},
|
|
56
|
+
zIndex: {
|
|
57
|
+
type: [Number, String],
|
|
58
|
+
default: 2000
|
|
59
|
+
},
|
|
56
60
|
...pressThemePropsOptions(),
|
|
57
61
|
...polyTransitionPropOptions,
|
|
58
62
|
...pressBasePropsOptions(),
|
|
@@ -172,7 +176,7 @@ export const YLayer = defineComponent({
|
|
|
172
176
|
}
|
|
173
177
|
const computedStyle = computed(() => {
|
|
174
178
|
return {
|
|
175
|
-
zIndex: '2000'
|
|
179
|
+
zIndex: (props.zIndex ?? '2000').toString()
|
|
176
180
|
};
|
|
177
181
|
});
|
|
178
182
|
const computedClass = computed(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YLayer.mjs","names":["Teleport","Transition","computed","defineComponent","getCurrentInstance","mergeProps","reactive","ref","shallowRef","toRef","useRender","pressCoordinateProps","useCoordinate","pressDimensionPropsOptions","useDimension","useLayerGroup","pressThemePropsOptions","useLocalTheme","useLazy","PolyTransition","polyTransitionPropOptions","usePolyTransition","ComplementClick","bindClasses","propsFactory","pressBasePropsOptions","useBase","pressYLayerProps","modelValue","type","Boolean","scrim","scrimOpacity","Number","eager","classes","Array","String","Object","contentClasses","closeClickScrim","contentStyles","default","disabled","openOnHover","openDelay","closeDelay","YLayer","name","inheritAttrs","components","directives","props","modal","emits","value","mouseEvent","afterLeave","slots","setup","_ref","emit","expose","attrs","vm","scrim$","content$","base","base$","baseEl","baseSlot","themeClasses","layerGroup","layerGroupState","getActiveLayers","polyTransitionBindProps","dimensionStyles","active","get","set","v","finish","hovered","lazyValue","onAfterUpdate","rendered","coordinateStyles","updateCoordinate","contentEl","onClickComplementLayer","target","closeConditional","complementClickOption","handler","determine","include","onAfterEnter","onAfterLeave","onClickScrim","onMouseenter","event","onMouseleave","computedStyle","zIndex","computedClass","boundClasses","computedContentClasses","isMe","vnode","slotBase","class","_createVNode","_Fragment","_mergeProps","_withDirectives","_vShow","_resolveDirective"],"sources":["../../../src/components/layer/YLayer.tsx"],"sourcesContent":["import type {\r\n CSSProperties,\r\n ComponentInternalInstance,\r\n PropType,\r\n SlotsType,\r\n} from 'vue';\r\nimport {\r\n Teleport,\r\n Transition,\r\n computed,\r\n defineComponent,\r\n getCurrentInstance,\r\n mergeProps,\r\n reactive,\r\n ref,\r\n shallowRef,\r\n toRef,\r\n watchEffect,\r\n} from 'vue';\r\n\r\nimport { useRender } from '../../composables/component';\r\nimport {\r\n pressCoordinateProps,\r\n useCoordinate,\r\n} from '../../composables/coordinate';\r\nimport {\r\n pressDimensionPropsOptions,\r\n useDimension,\r\n} from '../../composables/dimension';\r\nimport { useLayerGroup } from '../../composables/layer-group';\r\nimport { pressThemePropsOptions, useLocalTheme } from '../../composables/theme';\r\nimport { useLazy } from '../../composables/timing';\r\nimport {\r\n PolyTransition,\r\n polyTransitionPropOptions,\r\n usePolyTransition,\r\n} from '../../composables/transition';\r\nimport {\r\n ComplementClick,\r\n ComplementClickBindingOptions,\r\n} from '../../directives/complement-click';\r\nimport { bindClasses, propsFactory } from '../../util/vue-component';\r\n\r\nimport './YLayer.scss';\r\nimport { pressBasePropsOptions, useBase } from './base';\r\n\r\nexport const pressYLayerProps = propsFactory(\r\n {\r\n modelValue: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n scrim: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n scrimOpacity: {\r\n type: Number as PropType<number>,\r\n },\r\n eager: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n classes: {\r\n type: [Array, String, Object] as PropType<\r\n string[] | string | Record<string, any>\r\n >,\r\n },\r\n contentClasses: {\r\n type: [Array, String, Object] as PropType<\r\n string[] | string | Record<string, any>\r\n >,\r\n },\r\n closeClickScrim: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n contentStyles: {\r\n type: Object as PropType<CSSProperties>,\r\n default: () => {},\r\n },\r\n disabled: {\r\n type: Boolean as PropType<boolean>,\r\n default: false,\r\n },\r\n openOnHover: {\r\n type: Boolean as PropType<boolean>,\r\n default: false,\r\n },\r\n openDelay: {\r\n type: Number as PropType<number>,\r\n default: 200,\r\n },\r\n closeDelay: {\r\n type: Number as PropType<number>,\r\n default: 200,\r\n },\r\n ...pressThemePropsOptions(),\r\n ...polyTransitionPropOptions,\r\n ...pressBasePropsOptions(),\r\n ...pressCoordinateProps(),\r\n ...pressDimensionPropsOptions(),\r\n },\r\n 'YLayer',\r\n);\r\n\r\nexport const YLayer = defineComponent({\r\n name: 'YLayer',\r\n inheritAttrs: false,\r\n components: {\r\n PolyTransition,\r\n },\r\n directives: {\r\n ComplementClick,\r\n },\r\n props: {\r\n modal: Boolean as PropType<boolean>,\r\n ...pressYLayerProps(),\r\n },\r\n emits: {\r\n 'update:modelValue': (value: boolean) => true,\r\n 'click:complement': (mouseEvent: MouseEvent) => true,\r\n afterLeave: () => true,\r\n },\r\n slots: Object as SlotsType<{\r\n base: any;\r\n default: any;\r\n }>,\r\n setup(props, { emit, expose, attrs, slots }) {\r\n const vm = getCurrentInstance();\r\n\r\n const scrim$ = ref<HTMLElement>();\r\n const content$ = ref<HTMLElement>();\r\n\r\n const { base, base$, baseEl, baseSlot } = useBase(props);\r\n\r\n const { themeClasses } = useLocalTheme(props);\r\n const { layerGroup, layerGroupState, getActiveLayers } = useLayerGroup();\r\n const { polyTransitionBindProps } = usePolyTransition(props);\r\n const { dimensionStyles } = useDimension(props);\r\n const active = computed<boolean>({\r\n get: (): boolean => {\r\n return !!props.modelValue;\r\n },\r\n set: (v: boolean) => {\r\n emit('update:modelValue', v);\r\n },\r\n });\r\n const finish = shallowRef(false);\r\n const hovered = ref(false);\r\n\r\n const disabled = toRef(props, 'disabled');\r\n const { lazyValue, onAfterUpdate } = useLazy(toRef(props, 'eager'), active);\r\n const rendered = computed<boolean>(\r\n () => !disabled.value && (lazyValue.value || active.value),\r\n );\r\n\r\n const { coordinateStyles, updateCoordinate } = useCoordinate(props, {\r\n contentEl: content$,\r\n base,\r\n active,\r\n });\r\n\r\n function onClickComplementLayer(mouseEvent: MouseEvent) {\r\n emit('click:complement', mouseEvent);\r\n if (!props.modal) {\r\n if (\r\n scrim$.value !== null &&\r\n scrim$.value === mouseEvent.target &&\r\n props.closeClickScrim\r\n ) {\r\n active.value = false;\r\n }\r\n } else {\r\n // TODO: shrug ani\r\n }\r\n }\r\n\r\n function closeConditional(): boolean {\r\n return (\r\n (!props.openOnHover || (props.openOnHover && !hovered.value)) &&\r\n active.value && finish.value\r\n ); // TODO: && groupTopLevel.value;\r\n }\r\n\r\n const complementClickOption = reactive<ComplementClickBindingOptions>({\r\n handler: onClickComplementLayer,\r\n determine: closeConditional,\r\n include: () => [baseEl.value],\r\n });\r\n\r\n function onAfterEnter() {\r\n finish.value = true;\r\n }\r\n\r\n function onAfterLeave() {\r\n onAfterUpdate();\r\n finish.value = false;\r\n emit('afterLeave');\r\n }\r\n\r\n function onClickScrim() {\r\n if (props.closeClickScrim) {\r\n active.value = false;\r\n }\r\n }\r\n\r\n function onMouseenter(event: Event) {\r\n hovered.value = true;\r\n }\r\n\r\n function onMouseleave(event: Event) {\r\n hovered.value = false;\r\n }\r\n\r\n const computedStyle = computed(() => {\r\n return {\r\n zIndex: '2000',\r\n };\r\n });\r\n\r\n const computedClass = computed<Record<string, boolean>>(() => {\r\n const { classes } = props;\r\n const boundClasses = bindClasses(classes);\r\n return {\r\n ...boundClasses,\r\n 'y-layer--active': !!active.value,\r\n };\r\n });\r\n\r\n const computedContentClasses = computed<Record<string, boolean>>(() => {\r\n const boundClasses = bindClasses(props.contentClasses);\r\n return {\r\n ...boundClasses,\r\n };\r\n });\r\n\r\n expose({\r\n scrim$,\r\n base$,\r\n content$: computed(() => content$.value),\r\n baseEl,\r\n active,\r\n onAfterUpdate,\r\n updateCoordinate,\r\n hovered,\r\n finish,\r\n modal: computed(() => props.modal),\r\n getActiveLayers,\r\n isMe: (vnode: ComponentInternalInstance) => {\r\n return vnode === vm;\r\n },\r\n });\r\n\r\n useRender(() => {\r\n const slotBase = slots.base?.({\r\n active: active.value,\r\n props: mergeProps({\r\n ref: base$,\r\n class: {\r\n 'y-layer-base': true,\r\n 'y-layer-base--active': active.value,\r\n },\r\n }),\r\n });\r\n baseSlot.value = slotBase;\r\n return (\r\n <>\r\n {slotBase}\r\n <Teleport disabled={!layerGroup.value} to={layerGroup.value as any}>\r\n {rendered.value && (\r\n <div\r\n class={{\r\n 'y-layer': true,\r\n 'y-layer--finish': finish.value,\r\n ...computedClass.value,\r\n [themeClasses.value ?? '']: true,\r\n }}\r\n onMouseenter={onMouseenter}\r\n onMouseleave={onMouseleave}\r\n style={computedStyle.value}\r\n {...attrs}\r\n >\r\n <Transition name=\"fade\" appear>\r\n {active.value && props.scrim && (\r\n <div\r\n class=\"y-layer__scrim\"\r\n style={{ '--y-layer-scrim-opacity': props.scrimOpacity }}\r\n onClick={onClickScrim}\r\n ref=\"scrim$\"\r\n ></div>\r\n )}\r\n </Transition>\r\n <PolyTransition\r\n onAfterEnter={onAfterEnter}\r\n onAfterLeave={onAfterLeave}\r\n appear\r\n {...polyTransitionBindProps.value}\r\n >\r\n <div\r\n v-show={active.value}\r\n v-complement-click={{ ...complementClickOption }}\r\n class={{\r\n 'y-layer__content': true,\r\n ...computedContentClasses.value,\r\n }}\r\n style={[\r\n {\r\n ...dimensionStyles.value,\r\n ...coordinateStyles.value,\r\n ...props.contentStyles,\r\n },\r\n ]}\r\n ref={content$}\r\n >\r\n {slots.default?.({ active: active.value })}\r\n </div>\r\n </PolyTransition>\r\n </div>\r\n )}\r\n </Teleport>\r\n </>\r\n );\r\n });\r\n\r\n return {\r\n complementClickOption,\r\n layerGroup,\r\n active,\r\n finish,\r\n rendered,\r\n lazyValue,\r\n onAfterUpdate: onAfterUpdate as () => void,\r\n scrim$,\r\n content$,\r\n base$,\r\n baseEl,\r\n polyTransitionBindProps,\r\n coordinateStyles,\r\n layerGroupState,\r\n getActiveLayers,\r\n };\r\n },\r\n});\r\n\r\nexport type YLayer = InstanceType<typeof YLayer>;\r\n"],"mappings":";AAMA,SACEA,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,eAAe,EACfC,kBAAkB,EAClBC,UAAU,EACVC,QAAQ,EACRC,GAAG,EACHC,UAAU,EACVC,KAAK,QAEA,KAAK;AAAC,SAEJC,SAAS;AAAA,SAEhBC,oBAAoB,EACpBC,aAAa;AAAA,SAGbC,0BAA0B,EAC1BC,YAAY;AAAA,SAELC,aAAa;A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Instance","mergeProps","reactive","ref","shallowRef","toRef","useRender","pressCoordinateProps","useCoordinate","pressDimensionPropsOptions","useDimension","useLayerGroup","pressThemePropsOptions","useLocalTheme","useLazy","PolyTransition","polyTransitionPropOptions","usePolyTransition","ComplementClick","bindClasses","propsFactory","pressBasePropsOptions","useBase","pressYLayerProps","modelValue","type","Boolean","scrim","scrimOpacity","Number","eager","classes","Array","String","Object","contentClasses","closeClickScrim","contentStyles","default","disabled","openOnHover","openDelay","closeDelay","zIndex","YLayer","name","inheritAttrs","components","directives","props","modal","emits","value","mouseEvent","afterLeave","slots","setup","_ref","emit","expose","attrs","vm","scrim$","content$","base","base$","baseEl","baseSlot","themeClasses","layerGroup","layerGroupState","getActiveLayers","polyTransitionBindProps","dimensionStyles","active","get","set","v","finish","hovered","lazyValue","onAfterUpdate","rendered","coordinateStyles","updateCoordinate","contentEl","onClickComplementLayer","target","closeConditional","complementClickOption","handler","determine","include","onAfterEnter","onAfterLeave","onClickScrim","onMouseenter","event","onMouseleave","computedStyle","toString","computedClass","boundClasses","computedContentClasses","isMe","vnode","slotBase","class","_createVNode","_Fragment","_mergeProps","_withDirectives","_vShow","_resolveDirective"],"sources":["../../../src/components/layer/YLayer.tsx"],"sourcesContent":["import type {\r\n CSSProperties,\r\n ComponentInternalInstance,\r\n PropType,\r\n SlotsType,\r\n} from 'vue';\r\nimport {\r\n Teleport,\r\n Transition,\r\n computed,\r\n defineComponent,\r\n getCurrentInstance,\r\n mergeProps,\r\n reactive,\r\n ref,\r\n shallowRef,\r\n toRef,\r\n watchEffect,\r\n} from 'vue';\r\n\r\nimport { useRender } from '../../composables/component';\r\nimport {\r\n pressCoordinateProps,\r\n useCoordinate,\r\n} from '../../composables/coordinate';\r\nimport {\r\n pressDimensionPropsOptions,\r\n useDimension,\r\n} from '../../composables/dimension';\r\nimport { useLayerGroup } from '../../composables/layer-group';\r\nimport { pressThemePropsOptions, useLocalTheme } from '../../composables/theme';\r\nimport { useLazy } from '../../composables/timing';\r\nimport {\r\n PolyTransition,\r\n polyTransitionPropOptions,\r\n usePolyTransition,\r\n} from '../../composables/transition';\r\nimport {\r\n ComplementClick,\r\n ComplementClickBindingOptions,\r\n} from '../../directives/complement-click';\r\nimport { bindClasses, propsFactory } from '../../util/vue-component';\r\n\r\nimport './YLayer.scss';\r\nimport { pressBasePropsOptions, useBase } from './base';\r\n\r\nexport const pressYLayerProps = propsFactory(\r\n {\r\n modelValue: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n scrim: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n scrimOpacity: {\r\n type: Number as PropType<number>,\r\n },\r\n eager: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n classes: {\r\n type: [Array, String, Object] as PropType<\r\n string[] | string | Record<string, any>\r\n >,\r\n },\r\n contentClasses: {\r\n type: [Array, String, Object] as PropType<\r\n string[] | string | Record<string, any>\r\n >,\r\n },\r\n closeClickScrim: {\r\n type: Boolean as PropType<boolean>,\r\n },\r\n contentStyles: {\r\n type: Object as PropType<CSSProperties>,\r\n default: () => {},\r\n },\r\n disabled: {\r\n type: Boolean as PropType<boolean>,\r\n default: false,\r\n },\r\n openOnHover: {\r\n type: Boolean as PropType<boolean>,\r\n default: false,\r\n },\r\n openDelay: {\r\n type: Number as PropType<number>,\r\n default: 200,\r\n },\r\n closeDelay: {\r\n type: Number as PropType<number>,\r\n default: 200,\r\n },\r\n zIndex: {\r\n type: [Number, String] as PropType<number | string>,\r\n default: 2000,\r\n },\r\n ...pressThemePropsOptions(),\r\n ...polyTransitionPropOptions,\r\n ...pressBasePropsOptions(),\r\n ...pressCoordinateProps(),\r\n ...pressDimensionPropsOptions(),\r\n },\r\n 'YLayer',\r\n);\r\n\r\nexport const YLayer = defineComponent({\r\n name: 'YLayer',\r\n inheritAttrs: false,\r\n components: {\r\n PolyTransition,\r\n },\r\n directives: {\r\n ComplementClick,\r\n },\r\n props: {\r\n modal: Boolean as PropType<boolean>,\r\n ...pressYLayerProps(),\r\n },\r\n emits: {\r\n 'update:modelValue': (value: boolean) => true,\r\n 'click:complement': (mouseEvent: MouseEvent) => true,\r\n afterLeave: () => true,\r\n },\r\n slots: Object as SlotsType<{\r\n base: any;\r\n default: any;\r\n }>,\r\n setup(props, { emit, expose, attrs, slots }) {\r\n const vm = getCurrentInstance();\r\n\r\n const scrim$ = ref<HTMLElement>();\r\n const content$ = ref<HTMLElement>();\r\n\r\n const { base, base$, baseEl, baseSlot } = useBase(props);\r\n\r\n const { themeClasses } = useLocalTheme(props);\r\n const { layerGroup, layerGroupState, getActiveLayers } = useLayerGroup();\r\n const { polyTransitionBindProps } = usePolyTransition(props);\r\n const { dimensionStyles } = useDimension(props);\r\n const active = computed<boolean>({\r\n get: (): boolean => {\r\n return !!props.modelValue;\r\n },\r\n set: (v: boolean) => {\r\n emit('update:modelValue', v);\r\n },\r\n });\r\n const finish = shallowRef(false);\r\n const hovered = ref(false);\r\n\r\n const disabled = toRef(props, 'disabled');\r\n const { lazyValue, onAfterUpdate } = useLazy(toRef(props, 'eager'), active);\r\n const rendered = computed<boolean>(\r\n () => !disabled.value && (lazyValue.value || active.value),\r\n );\r\n\r\n const { coordinateStyles, updateCoordinate } = useCoordinate(props, {\r\n contentEl: content$,\r\n base,\r\n active,\r\n });\r\n\r\n function onClickComplementLayer(mouseEvent: MouseEvent) {\r\n emit('click:complement', mouseEvent);\r\n if (!props.modal) {\r\n if (\r\n scrim$.value !== null &&\r\n scrim$.value === mouseEvent.target &&\r\n props.closeClickScrim\r\n ) {\r\n active.value = false;\r\n }\r\n } else {\r\n // TODO: shrug ani\r\n }\r\n }\r\n\r\n function closeConditional(): boolean {\r\n return (\r\n (!props.openOnHover || (props.openOnHover && !hovered.value)) &&\r\n active.value && finish.value\r\n ); // TODO: && groupTopLevel.value;\r\n }\r\n\r\n const complementClickOption = reactive<ComplementClickBindingOptions>({\r\n handler: onClickComplementLayer,\r\n determine: closeConditional,\r\n include: () => [baseEl.value],\r\n });\r\n\r\n function onAfterEnter() {\r\n finish.value = true;\r\n }\r\n\r\n function onAfterLeave() {\r\n onAfterUpdate();\r\n finish.value = false;\r\n emit('afterLeave');\r\n }\r\n\r\n function onClickScrim() {\r\n if (props.closeClickScrim) {\r\n active.value = false;\r\n }\r\n }\r\n\r\n function onMouseenter(event: Event) {\r\n hovered.value = true;\r\n }\r\n\r\n function onMouseleave(event: Event) {\r\n hovered.value = false;\r\n }\r\n\r\n const computedStyle = computed(() => {\r\n return {\r\n zIndex: (props.zIndex ?? '2000').toString(),\r\n };\r\n });\r\n\r\n const computedClass = computed<Record<string, boolean>>(() => {\r\n const { classes } = props;\r\n const boundClasses = bindClasses(classes);\r\n return {\r\n ...boundClasses,\r\n 'y-layer--active': !!active.value,\r\n };\r\n });\r\n\r\n const computedContentClasses = computed<Record<string, boolean>>(() => {\r\n const boundClasses = bindClasses(props.contentClasses);\r\n return {\r\n ...boundClasses,\r\n };\r\n });\r\n\r\n expose({\r\n scrim$,\r\n base$,\r\n content$: computed(() => content$.value),\r\n baseEl,\r\n active,\r\n onAfterUpdate,\r\n updateCoordinate,\r\n hovered,\r\n finish,\r\n modal: computed(() => props.modal),\r\n getActiveLayers,\r\n isMe: (vnode: ComponentInternalInstance) => {\r\n return vnode === vm;\r\n },\r\n });\r\n\r\n useRender(() => {\r\n const slotBase = slots.base?.({\r\n active: active.value,\r\n props: mergeProps({\r\n ref: base$,\r\n class: {\r\n 'y-layer-base': true,\r\n 'y-layer-base--active': active.value,\r\n },\r\n }),\r\n });\r\n baseSlot.value = slotBase;\r\n return (\r\n <>\r\n {slotBase}\r\n <Teleport disabled={!layerGroup.value} to={layerGroup.value as any}>\r\n {rendered.value && (\r\n <div\r\n class={{\r\n 'y-layer': true,\r\n 'y-layer--finish': finish.value,\r\n ...computedClass.value,\r\n [themeClasses.value ?? '']: true,\r\n }}\r\n onMouseenter={onMouseenter}\r\n onMouseleave={onMouseleave}\r\n style={computedStyle.value}\r\n {...attrs}\r\n >\r\n <Transition name=\"fade\" appear>\r\n {active.value && props.scrim && (\r\n <div\r\n class=\"y-layer__scrim\"\r\n style={{ '--y-layer-scrim-opacity': props.scrimOpacity }}\r\n onClick={onClickScrim}\r\n ref=\"scrim$\"\r\n ></div>\r\n )}\r\n </Transition>\r\n <PolyTransition\r\n onAfterEnter={onAfterEnter}\r\n onAfterLeave={onAfterLeave}\r\n appear\r\n {...polyTransitionBindProps.value}\r\n >\r\n <div\r\n v-show={active.value}\r\n v-complement-click={{ ...complementClickOption }}\r\n class={{\r\n 'y-layer__content': true,\r\n ...computedContentClasses.value,\r\n }}\r\n style={[\r\n {\r\n ...dimensionStyles.value,\r\n ...coordinateStyles.value,\r\n ...props.contentStyles,\r\n },\r\n ]}\r\n ref={content$}\r\n >\r\n {slots.default?.({ active: active.value })}\r\n </div>\r\n </PolyTransition>\r\n </div>\r\n )}\r\n </Teleport>\r\n </>\r\n );\r\n });\r\n\r\n return {\r\n complementClickOption,\r\n layerGroup,\r\n active,\r\n finish,\r\n rendered,\r\n lazyValue,\r\n onAfterUpdate: onAfterUpdate as () => void,\r\n scrim$,\r\n content$,\r\n base$,\r\n baseEl,\r\n polyTransitionBindProps,\r\n coordinateStyles,\r\n layerGroupState,\r\n getActiveLayers,\r\n };\r\n },\r\n});\r\n\r\nexport type YLayer = InstanceType<typeof YLayer>;\r\n"],"mappings":";AAMA,SACEA,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,eAAe,EACfC,kBAAkB,EAClBC,UAAU,EACVC,QAAQ,EACRC,GAAG,EACHC,UAAU,EACVC,KAAK,QAEA,KAAK;AAAC,SAEJC,SAAS;AAAA,SAEhBC,oBAAoB,EACpBC,aAAa;AAAA,SAGbC,0BAA0B,EAC1BC,YAAY;AAAA,SAELC,aAAa;AAAA,SACbC,sBAAsB,EAAEC,aAAa;AAAA,SACrCC,OAAO;AAAA,SAEdC,cAAc,EACdC,yBAAyB,EACzBC,iBAAiB;AAAA,SAGjBC,eAAe;AAAA,SAGRC,WAAW,EAAEC,YAAY;AAEl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ance","ref","toRaw","watch","hasOwnProperty","kebabToCamel","toKebabCase","useToggleScope","useModelDuplex","props","prop","arguments","length","undefined","defaultValue","getIn","v","setOut","vm","kebabProp","property","txValue","getProp","isDefinedProp","registeredProps","vnode","value","model","get","set","neo","current","emit","Object","defineProperty","useProvided","provided","internal"],"sources":["../../src/composables/communication.ts"],"sourcesContent":["import { WritableComputedRef } from '@vue/runtime-core';\nimport { computed, getCurrentInstance, ref, toRaw, watch } from 'vue';\nimport type { Ref } from 'vue';\n\nimport { hasOwnProperty } from '../util/common';\nimport { kebabToCamel, toKebabCase } from '../util/string';\nimport { useToggleScope } from './scope';\n\nexport function useModelDuplex(\n props: any,\n prop: string = 'modelValue',\n defaultValue?: any,\n getIn: (value?: any) => any = (v: any) => v,\n setOut: (value: any) => any = (v: any) => v,\n) {\n const vm = getCurrentInstance()!;\n const kebabProp = toKebabCase(prop);\n const property = kebabProp === prop ? kebabToCamel(prop) : prop;\n const txValue = ref(\n props[property] !== undefined ? props[property] : defaultValue,\n );\n\n function getProp() {\n return props[property];\n }\n\n const isDefinedProp = computed(() => {\n getProp();\n const registeredProps = vm.vnode.props;\n return (\n (hasOwnProperty(registeredProps, kebabProp) ||\n hasOwnProperty(registeredProps, property)) &&\n (hasOwnProperty(registeredProps, `onUpdate:${kebabProp}`) ||\n hasOwnProperty(registeredProps, `onUpdate:${property}`))\n );\n });\n\n useToggleScope(\n () => !isDefinedProp.value,\n () => {\n watch(\n () => getProp(),\n (value) => {\n txValue.value = value;\n },\n );\n },\n );\n\n const model = computed({\n get(): any {\n return getIn(isDefinedProp.value ? getProp() : txValue.value);\n },\n set(value) {\n const neo = setOut(value);\n const current = toRaw(isDefinedProp.value ? getProp() : txValue.value);\n if (current === neo || getIn(current) === value) {\n return;\n }\n txValue.value = neo;\n vm?.emit(`update:${property}`, neo);\n },\n }) as
|
|
1
|
+
{"version":3,"file":"communication.mjs","names":["computed","getCurrentInstance","ref","toRaw","watch","hasOwnProperty","kebabToCamel","toKebabCase","useToggleScope","useModelDuplex","props","prop","arguments","length","undefined","defaultValue","getIn","v","setOut","vm","kebabProp","property","txValue","getProp","isDefinedProp","registeredProps","vnode","value","model","get","set","neo","current","emit","Object","defineProperty","useProvided","provided","internal"],"sources":["../../src/composables/communication.ts"],"sourcesContent":["import { WritableComputedRef } from '@vue/runtime-core';\nimport { computed, getCurrentInstance, ref, toRaw, watch } from 'vue';\nimport type { Ref } from 'vue';\n\nimport { hasOwnProperty } from '../util/common';\nimport { kebabToCamel, toKebabCase } from '../util/string';\nimport { useToggleScope } from './scope';\n\nexport function useModelDuplex(\n props: any,\n prop: string = 'modelValue',\n defaultValue?: any,\n getIn: (value?: any) => any = (v: any) => v,\n setOut: (value: any) => any = (v: any) => v,\n) {\n const vm = getCurrentInstance()!;\n const kebabProp = toKebabCase(prop);\n const property = kebabProp === prop ? kebabToCamel(prop) : prop;\n const txValue = ref(\n props[property] !== undefined ? props[property] : defaultValue,\n );\n\n function getProp() {\n return props[property];\n }\n\n const isDefinedProp = computed(() => {\n getProp();\n const registeredProps = vm.vnode.props;\n return (\n (hasOwnProperty(registeredProps, kebabProp) ||\n hasOwnProperty(registeredProps, property)) &&\n (hasOwnProperty(registeredProps, `onUpdate:${kebabProp}`) ||\n hasOwnProperty(registeredProps, `onUpdate:${property}`))\n );\n });\n\n useToggleScope(\n () => !isDefinedProp.value,\n () => {\n watch(\n () => getProp(),\n (value) => {\n txValue.value = value;\n },\n );\n },\n );\n\n const model = computed({\n get(): any {\n return getIn(isDefinedProp.value ? getProp() : txValue.value);\n },\n set(value) {\n const neo = setOut(value);\n const current = toRaw(isDefinedProp.value ? getProp() : txValue.value);\n if (current === neo || getIn(current) === value) {\n return;\n }\n txValue.value = neo;\n vm?.emit(`update:${property}`, neo);\n },\n }) as any as Ref<any> & { readonly rxValue: any };\n\n Object.defineProperty(model, 'rxValue', {\n get: () => (isDefinedProp.value ? getProp() : txValue.value),\n });\n\n return model;\n}\n\nexport function useProvided<T>(props: any, prop: string, provided: Ref<T>) {\n const internal = useModelDuplex(props, prop, props[prop] ?? provided.value);\n\n watch(provided, (value) => {\n if (props[prop] == null) {\n internal.value = value;\n }\n });\n return internal;\n}\n"],"mappings":"AACA,SAASA,QAAQ,EAAEC,kBAAkB,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAG7DC,cAAc;AAAA,SACdC,YAAY,EAAEC,WAAW;AAAA,SACzBC,cAAc;AAEvB,OAAO,SAASC,cAAcA,CAC5BC,KAAU,EAKV;EAAA,IAJAC,IAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,YAAY;EAAA,IAC3BG,YAAkB,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAAA,IAClBE,KAA2B,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAIK,CAAM,IAAKA,CAAC;EAAA,IAC3CC,MAA2B,GAAAN,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAIK,CAAM,IAAKA,CAAC;EAE3C,MAAME,EAAE,GAAGlB,kBAAkB,CAAC,CAAE;EAChC,MAAMmB,SAAS,GAAGb,WAAW,CAACI,IAAI,CAAC;EACnC,MAAMU,QAAQ,GAAGD,SAAS,KAAKT,IAAI,GAAGL,YAAY,CAACK,IAAI,CAAC,GAAGA,IAAI;EAC/D,MAAMW,OAAO,GAAGpB,GAAG,CACjBQ,KAAK,CAACW,QAAQ,CAAC,KAAKP,SAAS,GAAGJ,KAAK,CAACW,QAAQ,CAAC,GAAGN,YACpD,CAAC;EAED,SAASQ,OAAOA,CAAA,EAAG;IACjB,OAAOb,KAAK,CAACW,QAAQ,CAAC;EACxB;EAEA,MAAMG,aAAa,GAAGxB,QAAQ,CAAC,MAAM;IACnCuB,OAAO,CAAC,CAAC;IACT,MAAME,eAAe,GAAGN,EAA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ACK;EACxD,CAAC,CAAC;EAEF,OAAOC,KAAK;AACd;AAEA,OAAO,SAASQ,WAAWA,CAAI1B,KAAU,EAAEC,IAAY,EAAE0B,QAAgB,EAAE;EACzE,MAAMC,QAAQ,GAAG7B,cAAc,CAACC,KAAK,EAAEC,IAAI,EAAED,KAAK,CAACC,IAAI,CAAC,IAAI0B,QAAQ,CAACV,KAAK,CAAC;EAE3EvB,KAAK,CAACiC,QAAQ,EAAGV,KAAK,IAAK;IACzB,IAAIjB,KAAK,CAACC,IAAI,CAAC,IAAI,IAAI,EAAE;MACvB2B,QAAQ,CAACX,KAAK,GAAGA,KAAK;IACxB;EACF,CAAC,CAAC;EACF,OAAOW,QAAQ;AACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["onScopeDispose","ref","watch","propsFactory","useToggleScope","applyArrangement","applyLevitation","coordinateStrategies","levitation","arrangement","pressCoordinateProps","coordinateStrategy","type","String","Function","default","position","align","origin","offset","Number","Array","viewportMargin","useCoordinate","props","state","updateCoordinate","coordinate","coordinateStyles","active","value","reset","undefined","strategy","window","addEventListener","onResize","passive","removeEventListener","e"],"sources":["../../../src/composables/coordinate/index.ts"],"sourcesContent":["import type { CSSProperties, PropType, Ref } from 'vue';\nimport { onScopeDispose, ref, watch } from 'vue';\n\nimport { Rect } from '../../util/rect';\nimport { propsFactory } from '../../util/vue-component';\nimport { useToggleScope } from '../scope';\nimport { applyArrangement } from './arrangement';\nimport { applyLevitation } from './levitation';\n\nimport { CoordinateState } from './types';\n\nconst coordinateStrategies = {\n levitation: applyLevitation,\n arrangement: applyArrangement,\n};\n\nexport type CoordinateStrategyFn = (\n props: any,\n state: CoordinateState,\n coordinate: Ref<Rect | undefined>,\n coordinateStyles: Ref<CSSProperties>,\n) => undefined | { updateCoordinate: (e: Event) => void };\n\nexport const pressCoordinateProps = propsFactory(\n {\n coordinateStrategy: {\n type: [String, Function] as PropType<keyof typeof coordinateStrategies | CoordinateStrategyFn>,\n default: 'arrangement',\n },\n position: {\n type: String as PropType<\n 'default' | 'top' | 'end' | 'right' | 'bottom' | 'left' | 'start'\n >,\n default: 'default',\n },\n align: {\n type: String as PropType<'start' | 'center' | 'end' | 'top' | 'bottom'>,\n default: 'start',\n },\n origin: {\n type: String,\n default: 'auto'\n },\n offset: {\n type: [Number, String, Array] as PropType<number | string | string[]>,\n },\n viewportMargin: {\n type: Number,\n default: 16,\n }\n },\n 'Coordinate',\n);\n\nexport function useCoordinate(props: any, state: CoordinateState) {\n const updateCoordinate = ref<(e: Event) => void>();\n const coordinate = ref<Rect | undefined>();\n const coordinateStyles = ref<CSSProperties>({});\n\n useToggleScope(\n () => !!(state.active.value && props.coordinateStrategy),\n (reset) => {\n watch(() => props.coordinateStrategy, reset);\n onScopeDispose(() => {\n updateCoordinate.value = undefined;\n });\n\n if (typeof props.coordinateStrategy === 'function') {\n updateCoordinate.value = props.coordinateStrategy(\n props,\n state,\n coordinate,\n coordinateStyles,\n )?.updateCoordinate;\n } else {\n const strategy =\n coordinateStrategies[\n props.coordinateStrategy as keyof typeof coordinateStrategies\n ];\n updateCoordinate.value = strategy?.(\n props,\n state,\n coordinate,\n coordinateStyles,\n )?.updateCoordinate;\n }\n },\n );\n\n window.addEventListener('resize', onResize, { passive: true });\n\n onScopeDispose(() => {\n window.removeEventListener('resize', onResize);\n updateCoordinate.value = undefined;\n });\n\n function onResize(e: Event) {\n updateCoordinate.value?.(e);\n }\n\n return {\n coordinate,\n coordinateStyles,\n updateCoordinate,\n };\n}\n"],"mappings":"AACA,SAASA,cAAc,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAGxCC,YAAY;AAAA,SACZC,cAAc;AAAA,SACdC,gBAAgB;AAAA,SAChBC,eAAe;AAIxB,MAAMC,oBAAoB,GAAG;EAC3BC,UAAU,EAAEF,eAAe;EAC3BG,WAAW,EAAEJ;AACf,CAAC;AASD,OAAO,MAAMK,oBAAoB,GAAGP,YAAY,CAC9C;EACEQ,kBAAkB,EAAE;IAClBC,IAAI,EAAE,CAACC,MAAM,EAAEC,QAAQ,CAAuE;IAC9FC,OAAO,EAAE;EACX,CAAC;EACDC,QAAQ,EAAE;IACRJ,IAAI,EAAEC,MAEL;IACDE,OAAO,EAAE;EACX,CAAC;EACDE,KAAK,EAAE;IACLL,IAAI,EAAEC,MAAiE;IACvEE,OAAO,EAAE;EACX,CAAC;EACDG,MAAM,EAAE;IACNN,IAAI,EAAEC,MAAM;IACZE,OAAO,EAAE;EACX,CAAC;EACDI,MAAM,EAAE;IACNP,IAAI,EAAE,CAACQ,MAAM,EAAEP,MAAM,EAAEQ,KAAK;EAC9B,CAAC;EACDC,cAAc,EAAE;IACdV,IAAI,EAAEQ,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["onScopeDispose","ref","watch","propsFactory","useToggleScope","applyArrangement","applyLevitation","coordinateStrategies","levitation","arrangement","pressCoordinateProps","coordinateStrategy","type","String","Function","default","position","align","origin","offset","Number","Array","viewportMargin","useCoordinate","props","state","updateCoordinate","coordinate","coordinateStyles","active","value","reset","undefined","strategy","window","addEventListener","onResize","passive","removeEventListener","e"],"sources":["../../../src/composables/coordinate/index.ts"],"sourcesContent":["import type { CSSProperties, PropType, Ref } from 'vue';\nimport { onScopeDispose, ref, watch } from 'vue';\n\nimport { Rect } from '../../util/rect';\nimport { propsFactory } from '../../util/vue-component';\nimport { useToggleScope } from '../scope';\nimport { applyArrangement } from './arrangement';\nimport { applyLevitation } from './levitation';\n\nimport { CoordinateState } from './types';\n\nconst coordinateStrategies = {\n levitation: applyLevitation,\n arrangement: applyArrangement,\n};\n\nexport type CoordinateStrategyFn = (\n props: any,\n state: CoordinateState,\n coordinate: Ref<Rect | undefined>,\n coordinateStyles: Ref<CSSProperties>,\n) => undefined | { updateCoordinate: (e: Event) => void };\n\nexport const pressCoordinateProps = propsFactory(\n {\n coordinateStrategy: {\n type: [String, Function] as PropType<keyof typeof coordinateStrategies | CoordinateStrategyFn>,\n default: 'arrangement',\n },\n position: {\n type: String as PropType<\n 'default' | 'top' | 'end' | 'right' | 'bottom' | 'left' | 'start'\n >,\n default: 'default',\n },\n align: {\n type: String as PropType<'start' | 'center' | 'end' | 'top' | 'bottom'>,\n default: 'start',\n },\n origin: {\n type: String,\n default: 'auto'\n },\n offset: {\n type: [Number, String, Array] as PropType<number | string | string[]>,\n },\n viewportMargin: {\n type: [Number, String, Array],\n default: 16,\n }\n },\n 'Coordinate',\n);\n\nexport function useCoordinate(props: any, state: CoordinateState) {\n const updateCoordinate = ref<(e: Event) => void>();\n const coordinate = ref<Rect | undefined>();\n const coordinateStyles = ref<CSSProperties>({});\n\n useToggleScope(\n () => !!(state.active.value && props.coordinateStrategy),\n (reset) => {\n watch(() => props.coordinateStrategy, reset);\n onScopeDispose(() => {\n updateCoordinate.value = undefined;\n });\n\n if (typeof props.coordinateStrategy === 'function') {\n updateCoordinate.value = props.coordinateStrategy(\n props,\n state,\n coordinate,\n coordinateStyles,\n )?.updateCoordinate;\n } else {\n const strategy =\n coordinateStrategies[\n props.coordinateStrategy as keyof typeof coordinateStrategies\n ];\n updateCoordinate.value = strategy?.(\n props,\n state,\n coordinate,\n coordinateStyles,\n )?.updateCoordinate;\n }\n },\n );\n\n window.addEventListener('resize', onResize, { passive: true });\n\n onScopeDispose(() => {\n window.removeEventListener('resize', onResize);\n updateCoordinate.value = undefined;\n });\n\n function onResize(e: Event) {\n updateCoordinate.value?.(e);\n }\n\n return {\n coordinate,\n coordinateStyles,\n updateCoordinate,\n };\n}\n"],"mappings":"AACA,SAASA,cAAc,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAGxCC,YAAY;AAAA,SACZC,cAAc;AAAA,SACdC,gBAAgB;AAAA,SAChBC,eAAe;AAIxB,MAAMC,oBAAoB,GAAG;EAC3BC,UAAU,EAAEF,eAAe;EAC3BG,WAAW,EAAEJ;AACf,CAAC;AASD,OAAO,MAAMK,oBAAoB,GAAGP,YAAY,CAC9C;EACEQ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B;IACrB,CAAC,MAAM;MACL,MAAMO,QAAQ,GACZ1B,oBAAoB,CAClBiB,KAAK,CAACb,kBAAkB,CACzB;MACHe,gBAAgB,CAACI,KAAK,GAAGG,QAAQ,GAC/BT,KAAK,EACLC,KAAK,EACLE,UAAU,EACVC,gBACF,CAAC,EAAEF,gBAAgB;IACrB;EACF,CACF,CAAC;EAEDQ,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAEC,QAAQ,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC,CAAC;EAE9DrC,cAAc,CAAC,MAAM;IACnBkC,MAAM,CAACI,mBAAmB,CAAC,QAAQ,EAAEF,QAAQ,CAAC;IAC9CV,gBAAgB,CAACI,KAAK,GAAGE,SAAS;EACpC,CAAC,CAAC;EAEF,SAASI,QAAQA,CAACG,CAAQ,EAAE;IAC1Bb,gBAAgB,CAACI,KAAK,GAAGS,CAAC,CAAC;EAC7B;EAEA,OAAO;IACLZ,UAAU;IACVC,gBAAgB;IAChBF;EACF,CAAC;AACH"}
|
|
@@ -35,6 +35,19 @@ export function applyLevitation(props, state, coordinate, coordinateStyles) {
|
|
|
35
35
|
return typeof props.offset === 'number' ? [props.offset, 0] : [0, 0];
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
/* Viewport Margin */
|
|
39
|
+
const viewportMargin = computed(() => {
|
|
40
|
+
if (Array.isArray(props.viewportMargin)) {
|
|
41
|
+
return props.viewportMargin;
|
|
42
|
+
}
|
|
43
|
+
if (typeof props.viewportMargin === 'string') {
|
|
44
|
+
const offset = props.viewportMargin.split(' ').map(parseFloat);
|
|
45
|
+
if (offset.length < 2) offset.push(0);
|
|
46
|
+
return offset;
|
|
47
|
+
}
|
|
48
|
+
return typeof props.viewportMargin === 'number' ? [props.viewportMargin, 0] : [0, 0];
|
|
49
|
+
});
|
|
50
|
+
|
|
38
51
|
/* Observing Update */
|
|
39
52
|
let observe = false;
|
|
40
53
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -67,9 +80,6 @@ export function applyLevitation(props, state, coordinate, coordinateStyles) {
|
|
|
67
80
|
requestAnimationFrame(() => observe = true);
|
|
68
81
|
});
|
|
69
82
|
if (!$base || !$content) return;
|
|
70
|
-
const {
|
|
71
|
-
viewportMargin
|
|
72
|
-
} = props;
|
|
73
83
|
const baseRect = Array.isArray($base) ? new MutableRect({
|
|
74
84
|
x: $base?.[0] ?? 0,
|
|
75
85
|
y: $base?.[1] ?? 0,
|
|
@@ -103,10 +113,10 @@ export function applyLevitation(props, state, coordinate, coordinateStyles) {
|
|
|
103
113
|
}
|
|
104
114
|
return scrollBox;
|
|
105
115
|
}, undefined);
|
|
106
|
-
viewport.x += viewportMargin;
|
|
107
|
-
viewport.y += viewportMargin;
|
|
108
|
-
viewport.width -= viewportMargin * 2;
|
|
109
|
-
viewport.height -= viewportMargin * 2;
|
|
116
|
+
viewport.x += viewportMargin.value[0];
|
|
117
|
+
viewport.y += viewportMargin.value[1];
|
|
118
|
+
viewport.width -= viewportMargin.value[0] * 2;
|
|
119
|
+
viewport.height -= viewportMargin.value[1] * 2;
|
|
110
120
|
const {
|
|
111
121
|
preferredAnchor,
|
|
112
122
|
preferredOrigin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levitation.mjs","names":["computed","nextTick","onScopeDispose","ref","watch","flipAlign","flipCorner","flipSide","getAxis","parseAnchor","clamp","$computed","MutableRect","getOverflow","getScrollParents","getBoundingPureRect","pixelCeil","pixelRound","toStyleSizeValue","anchorToPoint","getOffset","applyLevitation","props","state","coordinate","coordinateStyles","contentEl","base","active","isRtl","minWidth","minHeight","maxWidth","maxHeight","map","key","val","parseFloat","isNaN","Infinity","offset","Array","isArray","split","length","push","observe","resizeObserver","ResizeObserver","updateCoordinate","_ref","_ref2","neoBaseEl","neoContentEl","oldBaseEl","oldContentEl","nodeType","unobserve","immediate","disconnect","getIgnoreInsetRect","el","rect","x","style","left","y","top","$base","value","$content","requestAnimationFrame","viewportMargin","baseRect","width","height","getBoundingClientRect","contentRect","scrollParents","document","documentElement","viewport","reduce","box","scrollBox","clientWidth","clientHeight","Math","max","min","right","bottom","undefined","preferredAnchor","preferredOrigin","location","position","align","parsedAnchor","parsedOrigin","origin","side","placement","anchor","checkOverflow","_placement","targetPoint","contentPoint","overflows","available","flipped","resets","_x","_y","axis","hasOverflowX","before","after","hasOverflowY","reset","forEach","newPlacement","flip","newOverflows","Object","assign","transformOrigin","result"],"sources":["../../../src/composables/coordinate/levitation.ts"],"sourcesContent":["import type { CSSProperties, Ref } from 'vue';\nimport { computed, nextTick, onScopeDispose, ref, watch } from 'vue';\n\nimport {\n Anchor,\n flipAlign,\n flipCorner,\n flipSide,\n getAxis,\n parseAnchor,\n} from '../../util/anchor';\nimport { clamp } from '../../util/common';\nimport { $computed } from '../../util/reactivity';\nimport { MutableRect, Rect, getOverflow } from '../../util/rect';\nimport { getScrollParents } from '../../util/scroll';\nimport {\n getBoundingPureRect,\n pixelCeil,\n pixelRound,\n toStyleSizeValue,\n} from '../../util/ui';\nimport { CoordinateState } from './types';\nimport { anchorToPoint, getOffset } from './utils/point';\n\nexport function applyLevitation(\n props: any,\n state: CoordinateState,\n coordinate: Ref<Rect | undefined>,\n coordinateStyles: Ref<CSSProperties>,\n) {\n const { contentEl, base, active } = state;\n\n const isRtl = ref(false);\n\n /* Content Limitations */\n const [minWidth, minHeight, maxWidth, maxHeight] = (\n ['minWidth', 'minHeight', 'maxWidth', 'maxHeight'] as const\n ).map((key) => {\n return computed(() => {\n const val = parseFloat(props[key]!);\n return isNaN(val) ? Infinity : val;\n });\n });\n\n /* Offset */\n const offset = computed(() => {\n if (Array.isArray(props.offset)) {\n return props.offset;\n }\n if (typeof props.offset === 'string') {\n const offset = props.offset.split(' ').map(parseFloat);\n if (offset.length < 2) offset.push(0);\n return offset;\n }\n return typeof props.offset === 'number' ? [props.offset, 0] : [0, 0];\n });\n\n /* Observing Update */\n let observe = false;\n const resizeObserver = new ResizeObserver(() => {\n if (observe) updateCoordinate();\n });\n watch(\n [state.base, state.contentEl],\n ([neoBaseEl, neoContentEl], [oldBaseEl, oldContentEl]) => {\n if (oldBaseEl && !Array.isArray(oldBaseEl) && oldBaseEl.nodeType === 1)\n resizeObserver.unobserve(oldBaseEl);\n if (neoBaseEl && !Array.isArray(neoBaseEl) && neoBaseEl.nodeType === 1)\n resizeObserver.observe(neoBaseEl);\n\n if (oldContentEl) resizeObserver.unobserve(oldContentEl);\n if (neoContentEl) resizeObserver.observe(neoContentEl);\n },\n { immediate: true },\n );\n onScopeDispose(() => {\n resizeObserver.disconnect();\n });\n\n function getIgnoreInsetRect(el: HTMLElement) {\n const rect = getBoundingPureRect(el);\n rect.x -= parseFloat(el.style.left || '0');\n rect.y -= parseFloat(el.style.top || '0');\n return rect;\n }\n\n function updateCoordinate(): any {\n observe = false;\n const $base = base.value;\n const $content = contentEl.value;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => (observe = true));\n });\n\n if (!$base || !$content) return;\n\n const { viewportMargin } = props;\n\n const baseRect = Array.isArray($base)\n ? new MutableRect({\n x: $base?.[0] ?? 0,\n y: $base?.[1] ?? 0,\n width: 0,\n height: 0,\n })\n : $base.getBoundingClientRect();\n const contentRect = getIgnoreInsetRect($content);\n const scrollParents = getScrollParents($content);\n\n if (scrollParents.length < 1) {\n scrollParents.push(document.documentElement);\n }\n\n /**\n * Viewport area\n */\n const viewport = scrollParents.reduce<MutableRect>(\n (box: MutableRect | undefined, el) => {\n const rect = el.getBoundingClientRect();\n const scrollBox = new MutableRect({\n x: el === document.documentElement ? 0 : rect.x,\n y: el === document.documentElement ? 0 : rect.y,\n width: el.clientWidth,\n height: el.clientHeight,\n });\n\n if (box) {\n return new MutableRect({\n x: Math.max(box.left, scrollBox.left),\n y: Math.max(box.top, scrollBox.top),\n width:\n Math.min(box.right, scrollBox.right) -\n Math.max(box.left, scrollBox.left),\n height:\n Math.min(box.bottom, scrollBox.bottom) -\n Math.max(box.top, scrollBox.top),\n });\n }\n return scrollBox;\n },\n undefined!,\n );\n viewport.x += viewportMargin;\n viewport.y += viewportMargin;\n viewport.width -= viewportMargin * 2;\n viewport.height -= viewportMargin * 2;\n\n const { preferredAnchor, preferredOrigin } = $computed(() => {\n const location = `${props.position} ${props.align}` as Anchor;\n const parsedAnchor = parseAnchor(location, false);\n const parsedOrigin =\n props.origin === 'overlap'\n ? parsedAnchor\n : props.origin === 'auto'\n ? flipSide(parsedAnchor)\n : parseAnchor(props.origin, false);\n\n // Some combinations of props may produce an invalid origin\n if (\n parsedAnchor.side === parsedOrigin.side &&\n parsedAnchor.align === flipAlign(parsedOrigin).align\n ) {\n return {\n preferredAnchor: flipCorner(parsedAnchor),\n preferredOrigin: flipCorner(parsedOrigin),\n };\n } else {\n return {\n preferredAnchor: parsedAnchor,\n preferredOrigin: parsedOrigin,\n };\n }\n });\n\n let placement = {\n anchor: preferredAnchor.value,\n origin: preferredOrigin.value,\n };\n\n function checkOverflow(_placement: typeof placement) {\n const box = new MutableRect(contentRect);\n const targetPoint = anchorToPoint(_placement.anchor, baseRect);\n const contentPoint = anchorToPoint(_placement.origin, box);\n\n let { x, y } = getOffset(targetPoint, contentPoint);\n\n switch (_placement.anchor.side) {\n case 'top':\n y -= offset.value[0];\n break;\n case 'bottom':\n y += offset.value[0];\n break;\n case 'left':\n x -= offset.value[0];\n break;\n case 'right':\n x += offset.value[0];\n break;\n }\n\n switch (_placement.anchor.align) {\n case 'top':\n y -= offset.value[1];\n break;\n case 'bottom':\n y += offset.value[1];\n break;\n case 'left':\n x -= offset.value[1];\n break;\n case 'right':\n x += offset.value[1];\n break;\n }\n\n box.x += x;\n box.y += y;\n\n box.width = Math.min(box.width, maxWidth.value);\n box.height = Math.min(box.height, maxHeight.value);\n\n const overflows = getOverflow(box, viewport);\n\n return { overflows, x, y };\n }\n\n let x = 0;\n let y = 0;\n const available = { x: 0, y: 0 };\n const flipped = { x: false, y: false };\n let resets = -1;\n while (true) {\n if (resets++ > 10) {\n break;\n }\n\n const { x: _x, y: _y, overflows } = checkOverflow(placement);\n\n x += _x;\n y += _y;\n\n contentRect.x += _x;\n contentRect.y += _y;\n\n // flip\n {\n const axis = getAxis(placement.anchor);\n const hasOverflowX = overflows.x.before || overflows.x.after;\n const hasOverflowY = overflows.y.before || overflows.y.after;\n\n let reset = false;\n ['x', 'y'].forEach((key) => {\n if (\n (key === 'x' && hasOverflowX && !flipped.x) ||\n (key === 'y' && hasOverflowY && !flipped.y)\n ) {\n const newPlacement = {\n anchor: { ...placement.anchor },\n origin: { ...placement.origin },\n };\n const flip =\n key === 'x'\n ? axis === 'y'\n ? flipAlign\n : flipSide\n : axis === 'y'\n ? flipSide\n : flipAlign;\n newPlacement.anchor = flip(newPlacement.anchor);\n newPlacement.origin = flip(newPlacement.origin);\n const { overflows: newOverflows } = checkOverflow(newPlacement);\n if (\n (newOverflows[key].before <= overflows[key].before &&\n newOverflows[key].after <= overflows[key].after) ||\n newOverflows[key].before + newOverflows[key].after <\n (overflows[key].before + overflows[key].after) / 2\n ) {\n placement = newPlacement;\n reset = flipped[key] = true;\n }\n }\n });\n if (reset) continue;\n }\n\n // shift\n if (overflows.x.before) {\n x += overflows.x.before;\n contentRect.x += overflows.x.before;\n }\n if (overflows.x.after) {\n x -= overflows.x.after;\n contentRect.x -= overflows.x.after;\n }\n if (overflows.y.before) {\n y += overflows.y.before;\n contentRect.y += overflows.y.before;\n }\n if (overflows.y.after) {\n y -= overflows.y.after;\n contentRect.y -= overflows.y.after;\n }\n\n // size\n {\n const overflows = getOverflow(contentRect, viewport);\n available.x = viewport.width - overflows.x.before - overflows.x.after;\n available.y = viewport.height - overflows.y.before - overflows.y.after;\n\n x += overflows.x.before;\n contentRect.x += overflows.x.before;\n y += overflows.y.before;\n contentRect.y += overflows.y.before;\n }\n\n break;\n }\n\n const axis = getAxis(placement.anchor);\n\n Object.assign(coordinateStyles.value, {\n '--y-levitation-anchor-origin': `${placement.anchor.side} ${placement.anchor.align}`,\n transformOrigin: `${placement.origin.side} ${placement.origin.align}`,\n top: toStyleSizeValue(pixelRound(y)),\n left: isRtl.value ? undefined : toStyleSizeValue(pixelRound(x)),\n right: isRtl.value ? toStyleSizeValue(pixelRound(-x)) : undefined,\n minWidth: toStyleSizeValue(\n axis === 'y'\n ? Math.min(minWidth.value, baseRect.width)\n : minWidth.value,\n ),\n maxWidth: toStyleSizeValue(\n pixelCeil(\n clamp(\n available.x,\n minWidth.value === Infinity ? 0 : minWidth.value,\n maxWidth.value,\n ),\n ),\n ),\n maxHeight: toStyleSizeValue(\n pixelCeil(\n clamp(\n available.y,\n minHeight.value === Infinity ? 0 : minHeight.value,\n maxHeight.value,\n ),\n ),\n ),\n });\n\n return {\n available,\n contentRect,\n };\n }\n\n watch(\n () => [\n props.offset,\n props.minWidth,\n props.minHeight,\n props.maxWidth,\n props.maxHeight,\n ],\n () => updateCoordinate(),\n );\n\n nextTick(() => {\n const result = updateCoordinate();\n if (!result) return;\n const { available, contentRect } = result;\n if (contentRect.height > available.y) {\n requestAnimationFrame(() => {\n updateCoordinate();\n requestAnimationFrame(() => {\n updateCoordinate();\n });\n });\n }\n });\n\n return {\n updateCoordinate,\n };\n}\n"],"mappings":"AACA,SAASA,QAAQ,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAInEC,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,OAAO,EACPC,WAAW;AAAA,SAEJC,KAAK;AAAA,SACLC,SAAS;AAAA,SACTC,WAAW,EAAQC,WAAW;AAAA,SAC9BC,gBAAgB;AAAA,SAEvBC,mBAAmB,EACnBC,SAAS,EACTC,UAAU,EACVC,gBAAgB;AAAA,SAGTC,aAAa,EAAEC,SAAS;AAEjC,OAAO,SAASC,eAAeA,CAC7BC,KAAU,EACVC,KAAsB,EACtBC,UAAiC,EACjCC,gBAAoC,EACpC;EACA,MAAM;IAAEC,SAAS;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAGL,KAAK;EAEzC,MAAMM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QAC1BtB,gBAAgB,CAAC,CAAC;QAClBsB,qBAAqB,CAAC,MAAM;UAC1BtB,gBAAgB,CAAC,CAAC;QACpB,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EAEF,OAAO;IACLA;EACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"levitation.mjs","names":["computed","nextTick","onScopeDispose","ref","watch","flipAlign","flipCorner","flipSide","getAxis","parseAnchor","clamp","$computed","MutableRect","getOverflow","getScrollParents","getBoundingPureRect","pixelCeil","pixelRound","toStyleSizeValue","anchorToPoint","getOffset","applyLevitation","props","state","coordinate","coordinateStyles","contentEl","base","active","isRtl","minWidth","minHeight","maxWidth","maxHeight","map","key","val","parseFloat","isNaN","Infinity","offset","Array","isArray","split","length","push","viewportMargin","observe","resizeObserver","ResizeObserver","updateCoordinate","_ref","_ref2","neoBaseEl","neoContentEl","oldBaseEl","oldContentEl","nodeType","unobserve","immediate","disconnect","getIgnoreInsetRect","el","rect","x","style","left","y","top","$base","value","$content","requestAnimationFrame","baseRect","width","height","getBoundingClientRect","contentRect","scrollParents","document","documentElement","viewport","reduce","box","scrollBox","clientWidth","clientHeight","Math","max","min","right","bottom","undefined","preferredAnchor","preferredOrigin","location","position","align","parsedAnchor","parsedOrigin","origin","side","placement","anchor","checkOverflow","_placement","targetPoint","contentPoint","overflows","available","flipped","resets","_x","_y","axis","hasOverflowX","before","after","hasOverflowY","reset","forEach","newPlacement","flip","newOverflows","Object","assign","transformOrigin","result"],"sources":["../../../src/composables/coordinate/levitation.ts"],"sourcesContent":["import type { CSSProperties, Ref } from 'vue';\nimport { computed, nextTick, onScopeDispose, ref, watch } from 'vue';\n\nimport {\n Anchor,\n flipAlign,\n flipCorner,\n flipSide,\n getAxis,\n parseAnchor,\n} from '../../util/anchor';\nimport { clamp } from '../../util/common';\nimport { $computed } from '../../util/reactivity';\nimport { MutableRect, Rect, getOverflow } from '../../util/rect';\nimport { getScrollParents } from '../../util/scroll';\nimport {\n getBoundingPureRect,\n pixelCeil,\n pixelRound,\n toStyleSizeValue,\n} from '../../util/ui';\nimport { CoordinateState } from './types';\nimport { anchorToPoint, getOffset } from './utils/point';\n\nexport function applyLevitation(\n props: any,\n state: CoordinateState,\n coordinate: Ref<Rect | undefined>,\n coordinateStyles: Ref<CSSProperties>,\n) {\n const { contentEl, base, active } = state;\n\n const isRtl = ref(false);\n\n /* Content Limitations */\n const [minWidth, minHeight, maxWidth, maxHeight] = (\n ['minWidth', 'minHeight', 'maxWidth', 'maxHeight'] as const\n ).map((key) => {\n return computed(() => {\n const val = parseFloat(props[key]!);\n return isNaN(val) ? Infinity : val;\n });\n });\n\n /* Offset */\n const offset = computed(() => {\n if (Array.isArray(props.offset)) {\n return props.offset;\n }\n if (typeof props.offset === 'string') {\n const offset = props.offset.split(' ').map(parseFloat);\n if (offset.length < 2) offset.push(0);\n return offset;\n }\n return typeof props.offset === 'number' ? [props.offset, 0] : [0, 0];\n });\n\n /* Viewport Margin */\n const viewportMargin = computed(() => {\n if (Array.isArray(props.viewportMargin)) {\n return props.viewportMargin;\n }\n if (typeof props.viewportMargin === 'string') {\n const offset = props.viewportMargin.split(' ').map(parseFloat);\n if (offset.length < 2) offset.push(0);\n return offset;\n }\n return typeof props.viewportMargin === 'number'\n ? [props.viewportMargin, 0]\n : [0, 0];\n });\n\n /* Observing Update */\n let observe = false;\n const resizeObserver = new ResizeObserver(() => {\n if (observe) updateCoordinate();\n });\n watch(\n [state.base, state.contentEl],\n ([neoBaseEl, neoContentEl], [oldBaseEl, oldContentEl]) => {\n if (oldBaseEl && !Array.isArray(oldBaseEl) && oldBaseEl.nodeType === 1)\n resizeObserver.unobserve(oldBaseEl);\n if (neoBaseEl && !Array.isArray(neoBaseEl) && neoBaseEl.nodeType === 1)\n resizeObserver.observe(neoBaseEl);\n\n if (oldContentEl) resizeObserver.unobserve(oldContentEl);\n if (neoContentEl) resizeObserver.observe(neoContentEl);\n },\n { immediate: true },\n );\n onScopeDispose(() => {\n resizeObserver.disconnect();\n });\n\n function getIgnoreInsetRect(el: HTMLElement) {\n const rect = getBoundingPureRect(el);\n rect.x -= parseFloat(el.style.left || '0');\n rect.y -= parseFloat(el.style.top || '0');\n return rect;\n }\n\n function updateCoordinate(): any {\n observe = false;\n const $base = base.value;\n const $content = contentEl.value;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => (observe = true));\n });\n\n if (!$base || !$content) return;\n\n const baseRect = Array.isArray($base)\n ? new MutableRect({\n x: $base?.[0] ?? 0,\n y: $base?.[1] ?? 0,\n width: 0,\n height: 0,\n })\n : $base.getBoundingClientRect();\n const contentRect = getIgnoreInsetRect($content);\n const scrollParents = getScrollParents($content);\n\n if (scrollParents.length < 1) {\n scrollParents.push(document.documentElement);\n }\n\n /**\n * Viewport area\n */\n const viewport = scrollParents.reduce<MutableRect>(\n (box: MutableRect | undefined, el) => {\n const rect = el.getBoundingClientRect();\n const scrollBox = new MutableRect({\n x: el === document.documentElement ? 0 : rect.x,\n y: el === document.documentElement ? 0 : rect.y,\n width: el.clientWidth,\n height: el.clientHeight,\n });\n\n if (box) {\n return new MutableRect({\n x: Math.max(box.left, scrollBox.left),\n y: Math.max(box.top, scrollBox.top),\n width:\n Math.min(box.right, scrollBox.right) -\n Math.max(box.left, scrollBox.left),\n height:\n Math.min(box.bottom, scrollBox.bottom) -\n Math.max(box.top, scrollBox.top),\n });\n }\n return scrollBox;\n },\n undefined!,\n );\n viewport.x += viewportMargin.value[0];\n viewport.y += viewportMargin.value[1];\n viewport.width -= viewportMargin.value[0] * 2;\n viewport.height -= viewportMargin.value[1] * 2;\n\n const { preferredAnchor, preferredOrigin } = $computed(() => {\n const location = `${props.position} ${props.align}` as Anchor;\n const parsedAnchor = parseAnchor(location, false);\n const parsedOrigin =\n props.origin === 'overlap'\n ? parsedAnchor\n : props.origin === 'auto'\n ? flipSide(parsedAnchor)\n : parseAnchor(props.origin, false);\n\n // Some combinations of props may produce an invalid origin\n if (\n parsedAnchor.side === parsedOrigin.side &&\n parsedAnchor.align === flipAlign(parsedOrigin).align\n ) {\n return {\n preferredAnchor: flipCorner(parsedAnchor),\n preferredOrigin: flipCorner(parsedOrigin),\n };\n } else {\n return {\n preferredAnchor: parsedAnchor,\n preferredOrigin: parsedOrigin,\n };\n }\n });\n\n let placement = {\n anchor: preferredAnchor.value,\n origin: preferredOrigin.value,\n };\n\n function checkOverflow(_placement: typeof placement) {\n const box = new MutableRect(contentRect);\n const targetPoint = anchorToPoint(_placement.anchor, baseRect);\n const contentPoint = anchorToPoint(_placement.origin, box);\n\n let { x, y } = getOffset(targetPoint, contentPoint);\n\n switch (_placement.anchor.side) {\n case 'top':\n y -= offset.value[0];\n break;\n case 'bottom':\n y += offset.value[0];\n break;\n case 'left':\n x -= offset.value[0];\n break;\n case 'right':\n x += offset.value[0];\n break;\n }\n\n switch (_placement.anchor.align) {\n case 'top':\n y -= offset.value[1];\n break;\n case 'bottom':\n y += offset.value[1];\n break;\n case 'left':\n x -= offset.value[1];\n break;\n case 'right':\n x += offset.value[1];\n break;\n }\n\n box.x += x;\n box.y += y;\n\n box.width = Math.min(box.width, maxWidth.value);\n box.height = Math.min(box.height, maxHeight.value);\n\n const overflows = getOverflow(box, viewport);\n\n return { overflows, x, y };\n }\n\n let x = 0;\n let y = 0;\n const available = { x: 0, y: 0 };\n const flipped = { x: false, y: false };\n let resets = -1;\n while (true) {\n if (resets++ > 10) {\n break;\n }\n\n const { x: _x, y: _y, overflows } = checkOverflow(placement);\n\n x += _x;\n y += _y;\n\n contentRect.x += _x;\n contentRect.y += _y;\n\n // flip\n {\n const axis = getAxis(placement.anchor);\n const hasOverflowX = overflows.x.before || overflows.x.after;\n const hasOverflowY = overflows.y.before || overflows.y.after;\n\n let reset = false;\n ['x', 'y'].forEach((key) => {\n if (\n (key === 'x' && hasOverflowX && !flipped.x) ||\n (key === 'y' && hasOverflowY && !flipped.y)\n ) {\n const newPlacement = {\n anchor: { ...placement.anchor },\n origin: { ...placement.origin },\n };\n const flip =\n key === 'x'\n ? axis === 'y'\n ? flipAlign\n : flipSide\n : axis === 'y'\n ? flipSide\n : flipAlign;\n newPlacement.anchor = flip(newPlacement.anchor);\n newPlacement.origin = flip(newPlacement.origin);\n const { overflows: newOverflows } = checkOverflow(newPlacement);\n if (\n (newOverflows[key].before <= overflows[key].before &&\n newOverflows[key].after <= overflows[key].after) ||\n newOverflows[key].before + newOverflows[key].after <\n (overflows[key].before + overflows[key].after) / 2\n ) {\n placement = newPlacement;\n reset = flipped[key] = true;\n }\n }\n });\n if (reset) continue;\n }\n\n // shift\n if (overflows.x.before) {\n x += overflows.x.before;\n contentRect.x += overflows.x.before;\n }\n if (overflows.x.after) {\n x -= overflows.x.after;\n contentRect.x -= overflows.x.after;\n }\n if (overflows.y.before) {\n y += overflows.y.before;\n contentRect.y += overflows.y.before;\n }\n if (overflows.y.after) {\n y -= overflows.y.after;\n contentRect.y -= overflows.y.after;\n }\n\n // size\n {\n const overflows = getOverflow(contentRect, viewport);\n available.x = viewport.width - overflows.x.before - overflows.x.after;\n available.y = viewport.height - overflows.y.before - overflows.y.after;\n\n x += overflows.x.before;\n contentRect.x += overflows.x.before;\n y += overflows.y.before;\n contentRect.y += overflows.y.before;\n }\n\n break;\n }\n\n const axis = getAxis(placement.anchor);\n\n Object.assign(coordinateStyles.value, {\n '--y-levitation-anchor-origin': `${placement.anchor.side} ${placement.anchor.align}`,\n transformOrigin: `${placement.origin.side} ${placement.origin.align}`,\n top: toStyleSizeValue(pixelRound(y)),\n left: isRtl.value ? undefined : toStyleSizeValue(pixelRound(x)),\n right: isRtl.value ? toStyleSizeValue(pixelRound(-x)) : undefined,\n minWidth: toStyleSizeValue(\n axis === 'y'\n ? Math.min(minWidth.value, baseRect.width)\n : minWidth.value,\n ),\n maxWidth: toStyleSizeValue(\n pixelCeil(\n clamp(\n available.x,\n minWidth.value === Infinity ? 0 : minWidth.value,\n maxWidth.value,\n ),\n ),\n ),\n maxHeight: toStyleSizeValue(\n pixelCeil(\n clamp(\n available.y,\n minHeight.value === Infinity ? 0 : minHeight.value,\n maxHeight.value,\n ),\n ),\n ),\n });\n\n return {\n available,\n contentRect,\n };\n }\n\n watch(\n () => [\n props.offset,\n props.minWidth,\n props.minHeight,\n props.maxWidth,\n props.maxHeight,\n ],\n () => updateCoordinate(),\n );\n\n nextTick(() => {\n const result = updateCoordinate();\n if (!result) return;\n const { available, contentRect } = result;\n if (contentRect.height > available.y) {\n requestAnimationFrame(() => {\n updateCoordinate();\n requestAnimationFrame(() => {\n updateCoordinate();\n });\n });\n }\n });\n\n return {\n updateCoordinate,\n };\n}\n"],"mappings":"AACA,SAASA,QAAQ,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAInEC,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,OAAO,EACPC,WAAW;AAAA,SAEJC,KAAK;AAAA,SACLC,SAAS;AAAA,SACTC,WAAW,EAAQC,WAAW;AAAA,SAC9BC,gBAAgB;AAAA,SAEvBC,mBAAmB,EACnBC,SAAS,EACTC,UAAU,EACVC,gBAAgB;AAAA,SAGTC,aAAa,EAAEC,SAAS;AAEjC,OAAO,SAASC,eAAeA,CAC7BC,KAAU,EACVC,KAAsB,EACtBC,UAAiC,EACjCC,gBAAoC,EACpC;EACA,MAAM;IAAEC,SAAS;IAAEC,IAAI;IAAEC;EAAO,CAAC,GAAGL,KAAK;EAEzC,MAAMM,KAAK,GAAG1B,GAAG,CAAC,KAAK,CAAC;;EAExB;EACA,MAAM,CAAC2B,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,SAAS,CAAC,GAC9C,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,CAClDC,GAAG,CAAEC,GAAG,IAAK;IACb,OAAOnC,QAAQ,CAAC,MAAM;MACpB,MAAMoC,GAAG,GAAGC,UAAU,CAACf,KAAK,CAACa,GAAG,CAAE,CAAC;MACnC,OAAOG,KAAK,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AAK,CAACW,SAAS,CAChB,EACD,MAAMiB,gBAAgB,CAAC,CACzB,CAAC;EAEDjD,QAAQ,CAAC,MAAM;IACb,MAAM8H,MAAM,GAAG7E,gBAAgB,CAAC,CAAC;IACjC,IAAI,CAAC6E,MAAM,EAAE;IACb,MAAM;MAAElB,SAAS;MAAEhC;IAAY,CAAC,GAAGkD,MAAM;IACzC,IAAIlD,WAAW,CAACF,MAAM,GAAGkC,SAAS,CAAC1C,CAAC,EAAE;MACpCK,qBAAqB,CAAC,MAAM;QAC1BtB,gBAAgB,CAAC,CAAC;QAClBsB,qBAAqB,CAAC,MAAM;UAC1BtB,gBAAgB,CAAC,CAAC;QACpB,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EAEF,OAAO;IACLA;EACF,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -95,15 +95,15 @@ export declare const YDateCalendar: import("vue").DefineComponent<{
|
|
|
95
95
|
container$: import("vue").Ref<any>;
|
|
96
96
|
dateUtil: import("../../composables/date/types").DateInstance<unknown>;
|
|
97
97
|
displayValue: import("vue").ComputedRef<unknown>;
|
|
98
|
-
month: import("vue").
|
|
98
|
+
month: import("vue").Ref<any> & {
|
|
99
99
|
readonly rxValue: any;
|
|
100
100
|
};
|
|
101
|
-
year: import("vue").
|
|
101
|
+
year: import("vue").Ref<any> & {
|
|
102
102
|
readonly rxValue: any;
|
|
103
103
|
};
|
|
104
104
|
rangeStart: import("vue").ComputedRef<any>;
|
|
105
105
|
rangeEnd: import("vue").ComputedRef<any>;
|
|
106
|
-
model: import("vue").
|
|
106
|
+
model: import("vue").Ref<any> & {
|
|
107
107
|
readonly rxValue: any;
|
|
108
108
|
};
|
|
109
109
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -14,6 +14,7 @@ export declare const pressYDialogPropsOptions: <Defaults extends {
|
|
|
14
14
|
openOnHover?: unknown;
|
|
15
15
|
openDelay?: unknown;
|
|
16
16
|
closeDelay?: unknown;
|
|
17
|
+
zIndex?: unknown;
|
|
17
18
|
base?: unknown;
|
|
18
19
|
coordinateStrategy?: unknown;
|
|
19
20
|
position?: unknown;
|
|
@@ -147,6 +148,16 @@ export declare const pressYDialogPropsOptions: <Defaults extends {
|
|
|
147
148
|
type: PropType<unknown extends Defaults["closeDelay"] ? number : number | Defaults["closeDelay"]>;
|
|
148
149
|
default: unknown extends Defaults["closeDelay"] ? number : number | Defaults["closeDelay"];
|
|
149
150
|
};
|
|
151
|
+
zIndex: unknown extends Defaults["zIndex"] ? {
|
|
152
|
+
type: PropType<string | number>;
|
|
153
|
+
default: number;
|
|
154
|
+
} : Omit<{
|
|
155
|
+
type: PropType<string | number>;
|
|
156
|
+
default: number;
|
|
157
|
+
}, "type" | "default"> & {
|
|
158
|
+
type: PropType<unknown extends Defaults["zIndex"] ? string | number : NonNullable<string | number> | Defaults["zIndex"]>;
|
|
159
|
+
default: unknown extends Defaults["zIndex"] ? string | number : NonNullable<string | number> | Defaults["zIndex"];
|
|
160
|
+
};
|
|
150
161
|
base: unknown extends Defaults["base"] ? PropType<import("../layer/base").BaseType> : {
|
|
151
162
|
type: PropType<unknown extends Defaults["base"] ? import("../layer/base").BaseType : Defaults["base"] | NonNullable<import("../layer/base").BaseType>>;
|
|
152
163
|
default: unknown extends Defaults["base"] ? import("../layer/base").BaseType : Defaults["base"] | NonNullable<import("../layer/base").BaseType>;
|
|
@@ -192,14 +203,14 @@ export declare const pressYDialogPropsOptions: <Defaults extends {
|
|
|
192
203
|
default: unknown extends Defaults["origin"] ? string : string | Defaults["origin"];
|
|
193
204
|
};
|
|
194
205
|
viewportMargin: unknown extends Defaults["viewportMargin"] ? {
|
|
195
|
-
type: NumberConstructor;
|
|
206
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
196
207
|
default: number;
|
|
197
208
|
} : Omit<{
|
|
198
|
-
type: NumberConstructor;
|
|
209
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
199
210
|
default: number;
|
|
200
211
|
}, "type" | "default"> & {
|
|
201
|
-
type: PropType<unknown extends Defaults["viewportMargin"] ?
|
|
202
|
-
default: unknown extends Defaults["viewportMargin"] ?
|
|
212
|
+
type: PropType<unknown extends Defaults["viewportMargin"] ? string | number | unknown[] : Defaults["viewportMargin"] | NonNullable<string | number | unknown[]>>;
|
|
213
|
+
default: unknown extends Defaults["viewportMargin"] ? string | number | unknown[] : Defaults["viewportMargin"] | NonNullable<string | number | unknown[]>;
|
|
203
214
|
};
|
|
204
215
|
minWidth: unknown extends Defaults["minWidth"] ? PropType<string | number> : {
|
|
205
216
|
type: PropType<unknown extends Defaults["minWidth"] ? string | number : NonNullable<string | number> | Defaults["minWidth"]>;
|
|
@@ -319,6 +330,10 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
319
330
|
type: PropType<number>;
|
|
320
331
|
default: number;
|
|
321
332
|
};
|
|
333
|
+
zIndex: {
|
|
334
|
+
type: PropType<string | number>;
|
|
335
|
+
default: number;
|
|
336
|
+
};
|
|
322
337
|
base: PropType<import("../layer/base").BaseType>;
|
|
323
338
|
coordinateStrategy: {
|
|
324
339
|
type: PropType<"levitation" | "arrangement" | import("../../composables/coordinate").CoordinateStrategyFn>;
|
|
@@ -337,7 +352,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
337
352
|
default: string;
|
|
338
353
|
};
|
|
339
354
|
viewportMargin: {
|
|
340
|
-
type: NumberConstructor;
|
|
355
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
341
356
|
default: number;
|
|
342
357
|
};
|
|
343
358
|
minWidth: PropType<string | number>;
|
|
@@ -363,7 +378,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
363
378
|
type: PropType<string>;
|
|
364
379
|
};
|
|
365
380
|
}, {
|
|
366
|
-
active: import("vue").
|
|
381
|
+
active: import("vue").Ref<any> & {
|
|
367
382
|
readonly rxValue: any;
|
|
368
383
|
};
|
|
369
384
|
layer: import("vue").Ref<import("vue").DefineComponent<{
|
|
@@ -393,7 +408,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
393
408
|
type: PropType<string | number | string[]>;
|
|
394
409
|
};
|
|
395
410
|
viewportMargin: {
|
|
396
|
-
type: NumberConstructor;
|
|
411
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
397
412
|
default: number;
|
|
398
413
|
};
|
|
399
414
|
base: PropType<import("../layer/base").BaseType>;
|
|
@@ -445,6 +460,10 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
445
460
|
type: PropType<number>;
|
|
446
461
|
default: number;
|
|
447
462
|
};
|
|
463
|
+
zIndex: {
|
|
464
|
+
type: PropType<string | number>;
|
|
465
|
+
default: number;
|
|
466
|
+
};
|
|
448
467
|
modal: PropType<boolean>;
|
|
449
468
|
}, {
|
|
450
469
|
complementClickOption: {
|
|
@@ -2060,7 +2079,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
2060
2079
|
type: PropType<string | number | string[]>;
|
|
2061
2080
|
};
|
|
2062
2081
|
viewportMargin: {
|
|
2063
|
-
type: NumberConstructor;
|
|
2082
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
2064
2083
|
default: number;
|
|
2065
2084
|
};
|
|
2066
2085
|
base: PropType<import("../layer/base").BaseType>;
|
|
@@ -2112,6 +2131,10 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
2112
2131
|
type: PropType<number>;
|
|
2113
2132
|
default: number;
|
|
2114
2133
|
};
|
|
2134
|
+
zIndex: {
|
|
2135
|
+
type: PropType<string | number>;
|
|
2136
|
+
default: number;
|
|
2137
|
+
};
|
|
2115
2138
|
modal: PropType<boolean>;
|
|
2116
2139
|
}>> & {
|
|
2117
2140
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -2123,11 +2146,12 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
2123
2146
|
openOnHover: boolean;
|
|
2124
2147
|
openDelay: number;
|
|
2125
2148
|
closeDelay: number;
|
|
2149
|
+
zIndex: string | number;
|
|
2126
2150
|
coordinateStrategy: "levitation" | "arrangement" | import("../../composables/coordinate").CoordinateStrategyFn;
|
|
2127
2151
|
position: "default" | "top" | "end" | "right" | "bottom" | "left" | "start";
|
|
2128
2152
|
align: "top" | "end" | "bottom" | "start" | "center";
|
|
2129
2153
|
origin: string;
|
|
2130
|
-
viewportMargin: number;
|
|
2154
|
+
viewportMargin: string | number | unknown[];
|
|
2131
2155
|
transition: string | (import("vue").TransitionProps & {
|
|
2132
2156
|
is?: import("vue").Component | undefined;
|
|
2133
2157
|
});
|
|
@@ -2184,6 +2208,10 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
2184
2208
|
type: PropType<number>;
|
|
2185
2209
|
default: number;
|
|
2186
2210
|
};
|
|
2211
|
+
zIndex: {
|
|
2212
|
+
type: PropType<string | number>;
|
|
2213
|
+
default: number;
|
|
2214
|
+
};
|
|
2187
2215
|
base: PropType<import("../layer/base").BaseType>;
|
|
2188
2216
|
coordinateStrategy: {
|
|
2189
2217
|
type: PropType<"levitation" | "arrangement" | import("../../composables/coordinate").CoordinateStrategyFn>;
|
|
@@ -2202,7 +2230,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
2202
2230
|
default: string;
|
|
2203
2231
|
};
|
|
2204
2232
|
viewportMargin: {
|
|
2205
|
-
type: NumberConstructor;
|
|
2233
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
2206
2234
|
default: number;
|
|
2207
2235
|
};
|
|
2208
2236
|
minWidth: PropType<string | number>;
|
|
@@ -2236,11 +2264,12 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
2236
2264
|
openOnHover: boolean;
|
|
2237
2265
|
openDelay: number;
|
|
2238
2266
|
closeDelay: number;
|
|
2267
|
+
zIndex: string | number;
|
|
2239
2268
|
coordinateStrategy: "levitation" | "arrangement" | import("../../composables/coordinate").CoordinateStrategyFn;
|
|
2240
2269
|
position: "default" | "top" | "end" | "right" | "bottom" | "left" | "start";
|
|
2241
2270
|
align: "top" | "end" | "bottom" | "start" | "center";
|
|
2242
2271
|
origin: string;
|
|
2243
|
-
viewportMargin: number;
|
|
2272
|
+
viewportMargin: string | number | unknown[];
|
|
2244
2273
|
transition: string | (import("vue").TransitionProps & {
|
|
2245
2274
|
is?: import("vue").Component | undefined;
|
|
2246
2275
|
});
|
|
@@ -110,14 +110,14 @@ export declare const pressYDropdownPropsOptions: <Defaults extends {
|
|
|
110
110
|
default: unknown extends Defaults["offset"] ? string | number | string[] : NonNullable<string | number | string[]> | Defaults["offset"];
|
|
111
111
|
};
|
|
112
112
|
viewportMargin: unknown extends Defaults["viewportMargin"] ? {
|
|
113
|
-
type: NumberConstructor;
|
|
113
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
114
114
|
default: number;
|
|
115
115
|
} : Omit<{
|
|
116
|
-
type: NumberConstructor;
|
|
116
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
117
117
|
default: number;
|
|
118
118
|
}, "type" | "default"> & {
|
|
119
|
-
type: PropType<unknown extends Defaults["viewportMargin"] ? number : number | Defaults["viewportMargin"]>;
|
|
120
|
-
default: unknown extends Defaults["viewportMargin"] ? number : number | Defaults["viewportMargin"];
|
|
119
|
+
type: PropType<unknown extends Defaults["viewportMargin"] ? string | number | unknown[] : NonNullable<string | number | unknown[]> | Defaults["viewportMargin"]>;
|
|
120
|
+
default: unknown extends Defaults["viewportMargin"] ? string | number | unknown[] : NonNullable<string | number | unknown[]> | Defaults["viewportMargin"];
|
|
121
121
|
};
|
|
122
122
|
modelValue: unknown extends Defaults["modelValue"] ? PropType<boolean> : {
|
|
123
123
|
type: PropType<unknown extends Defaults["modelValue"] ? boolean : boolean | Defaults["modelValue"]>;
|
|
@@ -172,7 +172,7 @@ export declare const YDropdown: import("vue").DefineComponent<{
|
|
|
172
172
|
type: PropType<string | number | string[]>;
|
|
173
173
|
};
|
|
174
174
|
viewportMargin: {
|
|
175
|
-
type: NumberConstructor;
|
|
175
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
176
176
|
default: number;
|
|
177
177
|
};
|
|
178
178
|
modelValue: PropType<boolean>;
|
|
@@ -218,7 +218,7 @@ export declare const YDropdown: import("vue").DefineComponent<{
|
|
|
218
218
|
type: PropType<string | number | string[]>;
|
|
219
219
|
};
|
|
220
220
|
viewportMargin: {
|
|
221
|
-
type: NumberConstructor;
|
|
221
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
222
222
|
default: number;
|
|
223
223
|
};
|
|
224
224
|
modelValue: PropType<boolean>;
|
|
@@ -231,7 +231,7 @@ export declare const YDropdown: import("vue").DefineComponent<{
|
|
|
231
231
|
position: NonNullable<"default" | "top" | "end" | "right" | "bottom" | "left" | "start">;
|
|
232
232
|
align: "top" | "end" | "bottom" | "start" | "center";
|
|
233
233
|
origin: string;
|
|
234
|
-
viewportMargin: number;
|
|
234
|
+
viewportMargin: string | number | unknown[];
|
|
235
235
|
items: any[];
|
|
236
236
|
itemKey: string;
|
|
237
237
|
itemText: string;
|