More models organization
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import {
|
||||
Standards,
|
||||
type Standard,
|
||||
type StandardsParameters,
|
||||
type StandardsParams,
|
||||
} from "@blade-and-brawn/calculator";
|
||||
import {
|
||||
Activity,
|
||||
@@ -17,7 +17,7 @@
|
||||
selected: {
|
||||
activity: Activity;
|
||||
metrics: Metrics;
|
||||
params: StandardsParameters;
|
||||
params: StandardsParams;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {
|
||||
DEFAULT_STANDARDS_DATASET,
|
||||
DEFAULT_STANDARDS_DATA,
|
||||
Standards,
|
||||
type StandardsParameters,
|
||||
type StandardsParams,
|
||||
} from "@blade-and-brawn/calculator";
|
||||
import {
|
||||
Activity,
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
let activeTab = $state("standards");
|
||||
|
||||
const defaultStandards = new Standards(DEFAULT_STANDARDS_DATASET);
|
||||
const defaultStandards = new Standards(DEFAULT_STANDARDS_DATA);
|
||||
|
||||
let input = $state({
|
||||
activity: Activity.BenchPress,
|
||||
@@ -24,7 +24,7 @@
|
||||
age: null as number | null,
|
||||
weight: null as number | null, // lb
|
||||
},
|
||||
params: structuredClone(defaultStandards.params) as StandardsParameters,
|
||||
params: structuredClone(defaultStandards.params) as StandardsParams,
|
||||
});
|
||||
|
||||
const selected = $derived({
|
||||
@@ -38,7 +38,7 @@
|
||||
});
|
||||
|
||||
const allStandards = $derived(
|
||||
new Standards(DEFAULT_STANDARDS_DATASET, selected.params),
|
||||
new Standards(DEFAULT_STANDARDS_DATA, selected.params),
|
||||
);
|
||||
|
||||
$effect(() => {
|
||||
@@ -124,8 +124,9 @@
|
||||
input.params.activity[selected.activity]
|
||||
.weightModifier
|
||||
}
|
||||
disabled={!selected.params.activity[selected.activity]
|
||||
.enableGeneration}
|
||||
disabled={!selected.params.activity[
|
||||
selected.activity
|
||||
].enableGeneration}
|
||||
/>
|
||||
</label>
|
||||
<!-- <label> -->
|
||||
@@ -156,8 +157,9 @@
|
||||
input.params.activity[selected.activity]
|
||||
.difficultyModifier
|
||||
}
|
||||
disabled={!selected.params.activity[selected.activity]
|
||||
.enableGeneration}
|
||||
disabled={!selected.params.activity[
|
||||
selected.activity
|
||||
].enableGeneration}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
@@ -172,8 +174,9 @@
|
||||
input.params.activity[selected.activity]
|
||||
.ageModifier
|
||||
}
|
||||
disabled={!selected.params.activity[selected.activity]
|
||||
.enableGeneration}
|
||||
disabled={!selected.params.activity[
|
||||
selected.activity
|
||||
].enableGeneration}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
@@ -187,8 +190,9 @@
|
||||
bind:value={
|
||||
input.params.activity[selected.activity].peakAge
|
||||
}
|
||||
disabled={!selected.params.activity[selected.activity]
|
||||
.enableGeneration}
|
||||
disabled={!selected.params.activity[
|
||||
selected.activity
|
||||
].enableGeneration}
|
||||
/>
|
||||
</label>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user