Add number cell
This commit is contained in:
parent
e26163e274
commit
8316692ecf
|
@ -0,0 +1,5 @@
|
|||
<script>
|
||||
import TextCell from "./TextCell.svelte"
|
||||
</script>
|
||||
|
||||
<TextCell {...$$props} type="number" />
|
|
@ -6,6 +6,7 @@
|
|||
import OptionsCell from "./OptionsCell.svelte"
|
||||
import DateCell from "./DateCell.svelte"
|
||||
import MultiSelectCell from "./MultiSelectCell.svelte"
|
||||
import NumberCell from "./NumberCell.svelte"
|
||||
|
||||
export let table
|
||||
export let filter
|
||||
|
@ -83,6 +84,8 @@
|
|||
return DateCell
|
||||
} else if (type === "array") {
|
||||
return MultiSelectCell
|
||||
} else if (type === "number") {
|
||||
return NumberCell
|
||||
}
|
||||
return TextCell
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
export let value
|
||||
export let selected = false
|
||||
export let onChange
|
||||
export let type = "text"
|
||||
|
||||
const handleChange = e => {
|
||||
onChange(e.target.value)
|
||||
|
@ -9,7 +10,7 @@
|
|||
</script>
|
||||
|
||||
{#if selected}
|
||||
<input type="text" value={value || ""} on:change={handleChange} />
|
||||
<input {type} value={value || ""} on:change={handleChange} />
|
||||
{:else}
|
||||
<div class="text-cell">
|
||||
{value || ""}
|
||||
|
|
Loading…
Reference in New Issue