@@ -105,7 +105,7 @@ export const FilamentCreate: React.FC<IResourceComponentsProps & CreateOrClonePr
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g/cm³" precision={3} formatter={numberFormatter} parser={numberParser} />
|
||||
<InputNumber min={0} addonAfter="g/cm³" precision={2} formatter={numberFormatter} parser={numberParser} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("filament.fields.diameter")}
|
||||
@@ -128,7 +128,7 @@ export const FilamentCreate: React.FC<IResourceComponentsProps & CreateOrClonePr
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g" precision={0} />
|
||||
<InputNumber min={0} addonAfter="g" precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("filament.fields.spool_weight")}
|
||||
@@ -140,7 +140,7 @@ export const FilamentCreate: React.FC<IResourceComponentsProps & CreateOrClonePr
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g" precision={0} />
|
||||
<InputNumber min={0} addonAfter="g" precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("filament.fields.settings_extruder_temp")}
|
||||
|
||||
@@ -127,7 +127,7 @@ export const FilamentEdit: React.FC<IResourceComponentsProps> = () => {
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g/cm³" precision={3} formatter={numberFormatter} parser={numberParser} />
|
||||
<InputNumber min={0} addonAfter="g/cm³" precision={2} formatter={numberFormatter} parser={numberParser} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("filament.fields.diameter")}
|
||||
@@ -150,7 +150,7 @@ export const FilamentEdit: React.FC<IResourceComponentsProps> = () => {
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g" precision={0} />
|
||||
<InputNumber min={0} addonAfter="g" precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("filament.fields.spool_weight")}
|
||||
@@ -162,7 +162,7 @@ export const FilamentEdit: React.FC<IResourceComponentsProps> = () => {
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g" precision={0} />
|
||||
<InputNumber min={0} addonAfter="g" precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("filament.fields.settings_extruder_temp")}
|
||||
|
||||
@@ -45,6 +45,7 @@ export const FilamentShow: React.FC<IResourceComponentsProps> = () => {
|
||||
unit="g/cm³"
|
||||
options={{
|
||||
maximumFractionDigits: 2,
|
||||
minimumFractionDigits: 2,
|
||||
}}
|
||||
/>
|
||||
<Title level={5}>{t("filament.fields.diameter")}</Title>
|
||||
@@ -53,6 +54,7 @@ export const FilamentShow: React.FC<IResourceComponentsProps> = () => {
|
||||
unit="mm"
|
||||
options={{
|
||||
maximumFractionDigits: 2,
|
||||
minimumFractionDigits: 2,
|
||||
}}
|
||||
/>
|
||||
<Title level={5}>{t("filament.fields.weight")}</Title>
|
||||
@@ -61,6 +63,7 @@ export const FilamentShow: React.FC<IResourceComponentsProps> = () => {
|
||||
unit="g"
|
||||
options={{
|
||||
maximumFractionDigits: 1,
|
||||
minimumFractionDigits: 1,
|
||||
}}
|
||||
/>
|
||||
<Title level={5}>{t("filament.fields.spool_weight")}</Title>
|
||||
@@ -69,6 +72,7 @@ export const FilamentShow: React.FC<IResourceComponentsProps> = () => {
|
||||
unit="g"
|
||||
options={{
|
||||
maximumFractionDigits: 1,
|
||||
minimumFractionDigits: 1,
|
||||
}}
|
||||
/>
|
||||
<Title level={5}>{t("filament.fields.settings_extruder_temp")}</Title>
|
||||
|
||||
@@ -6,6 +6,7 @@ import dayjs from "dayjs";
|
||||
import TextArea from "antd/es/input/TextArea";
|
||||
import { IFilament } from "../filaments/model";
|
||||
import { ISpool } from "./model";
|
||||
import { numberFormatter, numberParser } from "../../utils/parsing";
|
||||
|
||||
interface CreateOrCloneProps {
|
||||
mode: "create" | "clone";
|
||||
@@ -107,7 +108,7 @@ export const SpoolCreate: React.FC<IResourceComponentsProps & CreateOrCloneProps
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g" precision={0} />
|
||||
<InputNumber min={0} addonAfter="g" precision={1} formatter={numberFormatter} parser={numberParser} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("spool.fields.location")}
|
||||
|
||||
@@ -6,6 +6,7 @@ import dayjs from "dayjs";
|
||||
import TextArea from "antd/es/input/TextArea";
|
||||
import { IFilament } from "../filaments/model";
|
||||
import { ISpool } from "./model";
|
||||
import { numberFormatter, numberParser } from "../../utils/parsing";
|
||||
|
||||
export const SpoolEdit: React.FC<IResourceComponentsProps> = () => {
|
||||
const t = useTranslate();
|
||||
@@ -118,10 +119,14 @@ export const SpoolEdit: React.FC<IResourceComponentsProps> = () => {
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} addonAfter="g" precision={0} />
|
||||
{/* TODO: Allow higher precision here.
|
||||
However, that requires that we can handle the , -> . replacement in the number parser
|
||||
more elegantly for locales which use , as a thousands separator. */}
|
||||
<InputNumber
|
||||
min={0}
|
||||
addonAfter="g"
|
||||
precision={1}
|
||||
max={1e6}
|
||||
formatter={numberFormatter}
|
||||
parser={numberParser}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("spool.fields.location")}
|
||||
|
||||
@@ -262,7 +262,7 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
|
||||
id: "used_length",
|
||||
i18ncat: "spool",
|
||||
unit: "mm",
|
||||
decimals: 0,
|
||||
decimals: 1,
|
||||
dataSource,
|
||||
tableState,
|
||||
})}
|
||||
@@ -270,7 +270,7 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
|
||||
id: "remaining_length",
|
||||
i18ncat: "spool",
|
||||
unit: "mm",
|
||||
decimals: 0,
|
||||
decimals: 1,
|
||||
defaultText: t("unknown"),
|
||||
dataSource,
|
||||
tableState,
|
||||
|
||||
@@ -55,6 +55,7 @@ export const SpoolShow: React.FC<IResourceComponentsProps> = () => {
|
||||
unit="g"
|
||||
options={{
|
||||
maximumFractionDigits: 1,
|
||||
minimumFractionDigits: 1,
|
||||
}}
|
||||
/>
|
||||
<Title level={5}>{t("spool.fields.used_weight")}</Title>
|
||||
@@ -63,6 +64,7 @@ export const SpoolShow: React.FC<IResourceComponentsProps> = () => {
|
||||
unit="g"
|
||||
options={{
|
||||
maximumFractionDigits: 1,
|
||||
minimumFractionDigits: 1,
|
||||
}}
|
||||
/>
|
||||
<Title level={5}>{t("spool.fields.location")}</Title>
|
||||
|
||||
Reference in New Issue
Block a user