2022-06-05 17:10:44 +03:00
|
|
|
<template>
|
|
|
|
|
<span
|
|
|
|
|
v-if="matchesExpertLevel"
|
2024-04-24 15:58:26 +03:00
|
|
|
class="UnitSetting"
|
2022-06-05 17:10:44 +03:00
|
|
|
>
|
|
|
|
|
<label
|
|
|
|
|
:for="path"
|
|
|
|
|
class="size-label"
|
|
|
|
|
>
|
|
|
|
|
<slot />
|
|
|
|
|
</label>
|
2024-07-23 21:35:29 +03:00
|
|
|
{{ ' ' }}
|
2024-12-01 22:20:13 +02:00
|
|
|
<span class="no-break">
|
|
|
|
|
<input
|
|
|
|
|
:id="path"
|
|
|
|
|
class="input number-input"
|
|
|
|
|
type="number"
|
|
|
|
|
:step="step"
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
:min="min || 0"
|
|
|
|
|
:value="stateValue"
|
|
|
|
|
@change="updateValue"
|
|
|
|
|
>
|
|
|
|
|
<Select
|
|
|
|
|
:id="path"
|
|
|
|
|
:model-value="stateUnit"
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
class="unit-input unstyled"
|
|
|
|
|
@change="updateUnit"
|
2022-06-05 17:10:44 +03:00
|
|
|
>
|
2024-12-01 22:20:13 +02:00
|
|
|
<option
|
|
|
|
|
v-for="option in units"
|
|
|
|
|
:key="option"
|
|
|
|
|
:value="option"
|
|
|
|
|
>
|
|
|
|
|
{{ getUnitString(option) }}
|
|
|
|
|
</option>
|
|
|
|
|
</Select>
|
|
|
|
|
</span>
|
2022-06-05 17:10:44 +03:00
|
|
|
{{ ' ' }}
|
|
|
|
|
<ModifiedIndicator
|
|
|
|
|
:changed="isChanged"
|
|
|
|
|
:onclick="reset"
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-04-24 15:58:26 +03:00
|
|
|
<script src="./unit_setting.js"></script>
|
2022-06-05 17:10:44 +03:00
|
|
|
|
|
|
|
|
<style lang="scss">
|
2024-04-24 15:58:26 +03:00
|
|
|
.UnitSetting {
|
2024-12-01 22:20:13 +02:00
|
|
|
.no-break {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-08 21:13:07 +03:00
|
|
|
.number-input {
|
|
|
|
|
max-width: 6.5em;
|
2024-04-24 15:58:26 +03:00
|
|
|
text-align: right;
|
2023-05-08 21:13:07 +03:00
|
|
|
}
|
|
|
|
|
|
2024-04-24 15:58:26 +03:00
|
|
|
.unit-input,
|
|
|
|
|
.unit-input select {
|
2023-05-08 21:13:07 +03:00
|
|
|
min-width: 4em;
|
2024-04-24 15:58:26 +03:00
|
|
|
width: auto;
|
2023-05-08 21:13:07 +03:00
|
|
|
}
|
2022-06-05 17:10:44 +03:00
|
|
|
}
|
2023-05-08 21:13:07 +03:00
|
|
|
|
2022-06-05 17:10:44 +03:00
|
|
|
</style>
|