import { shallowRef, computed } from 'vue';

var useStretchStyle = (stretch) => {
  const targetSize = shallowRef({ width: 0, height: 0 });
  function measureStretch(element) {
    targetSize.value = {
      width: element.offsetWidth,
      height: element.offsetHeight
    };
  }
  const style = computed(() => {
    const sizeStyle = {};
    if (stretch.value) {
      const { width, height } = targetSize.value;
      if (stretch.value.includes("height") && height)
        sizeStyle.height = `${height}px`;
      else if (stretch.value.includes("minHeight") && height)
        sizeStyle.minHeight = `${height}px`;
      if (stretch.value.includes("width") && width)
        sizeStyle.width = `${width}px`;
      else if (stretch.value.includes("minWidth") && width)
        sizeStyle.minWidth = `${width}px`;
    }
    return sizeStyle;
  });
  return [style, measureStretch];
};

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