| 1 |
- {"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,WAAwB;CAC9C,MAAM,kBAAkB,IAAI,CAAC;CAE7B,MAAM,aAAa,gBAAgB,EACjC,UAAU,GAAG,KAAK,IAAI,gBAAgB,OAAA,EAA0B,EAAE,IACpE,EAAE;CAEF,MAAM,6BAA6B;EACjC,gBAAgB,QACd,cAAc,OAAO,sBAAsB,CAAC,CAAC,SAAS;CAC1D;CAEA,kBAAkB,eAAe,oBAAoB;CAErD,OAAO;EACL;EACA;EACA;CACF;AACF"}
|