- number-поля теперь рендерятся как text + inputMode=numeric, чтобы браузер не округлял значения через input type=number - пробелы при вставке в number-поля удаляются - бэкенд нормализует значения number-полей в строку перед сохранением - добавлен хелпер normalizeFieldValueForStorage Closes: искажение расчётного счёта и других длинных числовых полей
25 lines
703 B
TypeScript
25 lines
703 B
TypeScript
import { lazy, Suspense } from "react";
|
|
import { Loader2 } from "lucide-react";
|
|
import type { EditorProps } from "@monaco-editor/react";
|
|
|
|
const MonacoEditor = lazy(() => import("@monaco-editor/react"));
|
|
|
|
function EditorFallback({ height }: { height?: string | number }) {
|
|
return (
|
|
<div
|
|
className="flex items-center justify-center bg-[#1e1e1e] rounded-md"
|
|
style={{ height: height ?? 300 }}
|
|
>
|
|
<Loader2 className="h-5 w-5 animate-spin text-muted-foreground" />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default function LazyMonacoEditor(props: EditorProps) {
|
|
return (
|
|
<Suspense fallback={<EditorFallback height={props.height} />}>
|
|
<MonacoEditor {...props} />
|
|
</Suspense>
|
|
);
|
|
}
|