Merge pull request #10435 from Budibase/more-grid-tweaks

Fix number cell issue with grids and external SQL tables
This commit is contained in:
Andrew Kingston 2023-04-27 14:40:01 +01:00 committed by GitHub
commit bd5184694c
4 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,6 @@
<script> <script>
import { onMount, tick } from "svelte" import { onMount, tick } from "svelte"
import { clickOutside } from "@budibase/bbui"
export let value export let value
export let focused = false export let focused = false
@ -60,6 +61,7 @@
on:change={handleChange} on:change={handleChange}
on:wheel|stopPropagation on:wheel|stopPropagation
spellcheck="false" spellcheck="false"
use:clickOutside={close}
/> />
{:else} {:else}
<div class="long-form-cell" on:click={editable ? open : null} class:editable> <div class="long-form-cell" on:click={editable ? open : null} class:editable>

View File

@ -2,6 +2,13 @@
import TextCell from "./TextCell.svelte" import TextCell from "./TextCell.svelte"
export let api export let api
export let onChange
const numberOnChange = value => {
const float = parseFloat(value)
const newValue = isNaN(float) ? null : float
onChange(newValue)
}
</script> </script>
<TextCell {...$$props} bind:api type="number" /> <TextCell {...$$props} onChange={numberOnChange} bind:api type="number" />

View File

@ -1,5 +1,5 @@
<script> <script>
import { Icon } from "@budibase/bbui" import { Icon, clickOutside } from "@budibase/bbui"
import { getColor } from "../lib/utils" import { getColor } from "../lib/utils"
import { onMount } from "svelte" import { onMount } from "svelte"
@ -118,6 +118,7 @@
class:invertX class:invertX
class:invertY class:invertY
on:wheel={e => e.stopPropagation()} on:wheel={e => e.stopPropagation()}
use:clickOutside={close}
> >
{#each options as option, idx} {#each options as option, idx}
{@const color = getOptionColor(option)} {@const color = getOptionColor(option)}

View File

@ -18,7 +18,7 @@
<script> <script>
import { getColor } from "../lib/utils" import { getColor } from "../lib/utils"
import { onMount, getContext } from "svelte" import { onMount, getContext } from "svelte"
import { Icon, Input, ProgressCircle } from "@budibase/bbui" import { Icon, Input, ProgressCircle, clickOutside } from "@budibase/bbui"
import { debounce } from "../../../utils/utils" import { debounce } from "../../../utils/utils"
export let value export let value
@ -284,7 +284,13 @@
</div> </div>
{#if isOpen} {#if isOpen}
<div class="dropdown" class:invertX class:invertY on:wheel|stopPropagation> <div
class="dropdown"
class:invertX
class:invertY
on:wheel|stopPropagation
use:clickOutside={close}
>
<div class="search"> <div class="search">
<Input <Input
autofocus autofocus