使用VUE重构项目
Some checks failed
build / build (api, amd64, linux) (push) Failing after -51s
build / build (api, arm64, linux) (push) Failing after -52s
build / build (api.exe, amd64, windows) (push) Failing after -51s

This commit is contained in:
2026-04-20 00:19:11 +08:00
parent c080bb8d4a
commit db7f1ba82f
12743 changed files with 1250466 additions and 359982 deletions

View File

@@ -0,0 +1,12 @@
import * as vue from "vue";
//#region ../../packages/hooks/use-calc-input-width/index.d.ts
declare function useCalcInputWidth(): {
calculatorRef: vue.ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
calculatorWidth: vue.Ref<number, number>;
inputStyle: vue.ComputedRef<{
minWidth: string;
}>;
};
//#endregion
export { useCalcInputWidth };

View File

@@ -0,0 +1,23 @@
import { MINIMUM_INPUT_WIDTH } from "../../constants/form.mjs";
import { useResizeObserver } from "@vueuse/core";
import { computed, ref, shallowRef } from "vue";
//#region ../../packages/hooks/use-calc-input-width/index.ts
function useCalcInputWidth() {
const calculatorRef = shallowRef();
const calculatorWidth = ref(0);
const inputStyle = computed(() => ({ minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px` }));
const resetCalculatorWidth = () => {
calculatorWidth.value = calculatorRef.value?.getBoundingClientRect().width ?? 0;
};
useResizeObserver(calculatorRef, resetCalculatorWidth);
return {
calculatorRef,
calculatorWidth,
inputStyle
};
}
//#endregion
export { useCalcInputWidth };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +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,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"}