index.js 823 B

1234567891011121314151617181920212223
  1. Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
  2. require("../../constants/form.js");
  3. let _vueuse_core = require("@vueuse/core");
  4. let vue = require("vue");
  5. //#region ../../packages/hooks/use-calc-input-width/index.ts
  6. function useCalcInputWidth() {
  7. const calculatorRef = (0, vue.shallowRef)();
  8. const calculatorWidth = (0, vue.ref)(0);
  9. const inputStyle = (0, vue.computed)(() => ({ minWidth: `${Math.max(calculatorWidth.value, 11)}px` }));
  10. const resetCalculatorWidth = () => {
  11. calculatorWidth.value = calculatorRef.value?.getBoundingClientRect().width ?? 0;
  12. };
  13. (0, _vueuse_core.useResizeObserver)(calculatorRef, resetCalculatorWidth);
  14. return {
  15. calculatorRef,
  16. calculatorWidth,
  17. inputStyle
  18. };
  19. }
  20. //#endregion
  21. exports.useCalcInputWidth = useCalcInputWidth;
  22. //# sourceMappingURL=index.js.map