{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/hooks/use-calc-input-width/index.ts"],"sourcesContent":["import { computed, ref, shallowRef } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { MINIMUM_INPUT_WIDTH } from '@element-plus/constants'\n\nexport function useCalcInputWidth() {\n  const calculatorRef = shallowRef<HTMLElement>()\n  const calculatorWidth = ref(0)\n\n  const inputStyle = computed(() => ({\n    minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px`,\n  }))\n\n  const resetCalculatorWidth = () => {\n    calculatorWidth.value =\n      calculatorRef.value?.getBoundingClientRect().width ?? 0\n  }\n\n  useResizeObserver(calculatorRef, resetCalculatorWidth)\n\n  return {\n    calculatorRef,\n    calculatorWidth,\n    inputStyle,\n  }\n}\n"],"mappings":";;;;;AAIA,SAAgB,oBAAoB;CAClC,MAAM,gBAAgB,YAAyB;CAC/C,MAAM,kBAAkB,IAAI,EAAE;CAE9B,MAAM,aAAa,gBAAgB,EACjC,UAAU,GAAG,KAAK,IAAI,gBAAgB,OAAO,oBAAoB,CAAC,KACnE,EAAE;CAEH,MAAM,6BAA6B;AACjC,kBAAgB,QACd,cAAc,OAAO,uBAAuB,CAAC,SAAS;;AAG1D,mBAAkB,eAAe,qBAAqB;AAEtD,QAAO;EACL;EACA;EACA;EACD"}