import { computed } from 'vue';
import '../../../../utils/index.mjs';
import { canUseDom } from '../../../../utils/dom/canUseDom.mjs';

const defaultContainer = canUseDom() ? window : null;
function useSticky(stickyRef, prefixClsRef) {
  return computed(() => {
    const {
      offsetHeader = 0,
      offsetSummary = 0,
      offsetScroll = 0,
      getContainer = () => defaultContainer
    } = typeof stickyRef.value === "object" ? stickyRef.value : {};
    const container = getContainer() || defaultContainer;
    const isSticky = !!stickyRef.value;
    return {
      isSticky,
      stickyClassName: isSticky ? `${prefixClsRef.value}-sticky-holder` : "",
      offsetHeader,
      offsetSummary,
      offsetScroll,
      container
    };
  });
}

export { useSticky as default };
//# sourceMappingURL=useSticky.mjs.map
