removed InputGroup (not used)
This commit is contained in:
parent
6214a2a7ea
commit
01798b137b
2 changed files with 1 additions and 52 deletions
|
@ -1,50 +0,0 @@
|
||||||
<script>
|
|
||||||
import { onMount } from "svelte"
|
|
||||||
import Input from "../Input.svelte"
|
|
||||||
|
|
||||||
export let meta = []
|
|
||||||
export let label = ""
|
|
||||||
export let value = ["0", "0", "0", "0"]
|
|
||||||
export let suffix = ""
|
|
||||||
|
|
||||||
export let onChange = () => {}
|
|
||||||
|
|
||||||
function handleChange(val, idx) {
|
|
||||||
value.splice(idx, 1, val !== "auto" && suffix ? val + suffix : val)
|
|
||||||
|
|
||||||
value = value
|
|
||||||
let _value = value.map(v =>
|
|
||||||
suffix && !v.endsWith(suffix) && v !== "auto" ? v + suffix : v
|
|
||||||
)
|
|
||||||
onChange(_value)
|
|
||||||
}
|
|
||||||
|
|
||||||
$: displayValues =
|
|
||||||
value && suffix
|
|
||||||
? value.map(v => v.replace(new RegExp(`${suffix}$`), ""))
|
|
||||||
: value || []
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="input-container">
|
|
||||||
<div class="label">{label}</div>
|
|
||||||
<div class="inputs-group">
|
|
||||||
{#each meta as m, i}
|
|
||||||
<Input
|
|
||||||
width="37px"
|
|
||||||
textAlign="center"
|
|
||||||
placeholder={m.placeholder || ''}
|
|
||||||
value={!displayValues || displayValues[i] === '0' ? '' : displayValues[i]}
|
|
||||||
onChange={value => handleChange(value || 0, i)} />
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.label {
|
|
||||||
flex: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inputs-group {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import PropertyControl from "./PropertyControl.svelte"
|
import PropertyControl from "./PropertyControl.svelte"
|
||||||
import InputGroup from "../common/Inputs/InputGroup.svelte"
|
import Input from "./PropertyPanelControls/Input.svelte"
|
||||||
import Input from "../common/Input.svelte"
|
|
||||||
import { goto } from "@sveltech/routify"
|
import { goto } from "@sveltech/routify"
|
||||||
import { excludeProps } from "./propertyCategories.js"
|
import { excludeProps } from "./propertyCategories.js"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue