[#3113] added NoDecimal number field option

This commit is contained in:
Gani Georgiev
2023-08-29 18:34:48 +03:00
parent 17974d534e
commit 916c74c218
38 changed files with 222 additions and 140 deletions
@@ -225,7 +225,7 @@
<i
class="ri-information-line link-hint"
use:tooltip={{
text: `Whether the field should be preferred in the Admin UI relation listings.`,
text: `Whether the field should be preferred in the Admin UI relation listings (default to auto).`,
}}
/>
</label>
@@ -1,4 +1,5 @@
<script>
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
@@ -29,4 +30,19 @@
</div>
</div>
</svelte:fragment>
<svelte:fragment slot="optionsFooter">
<Field class="form-field form-field-toggle" name="schema.{key}.options.noDecimals" let:uniqueId>
<input type="checkbox" id={uniqueId} bind:checked={field.options.noDecimals} />
<label for={uniqueId}>
<span class="txt">No decimals</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: `Existing decimal values will not be affected.`,
}}
/>
</label>
</Field>
</svelte:fragment>
</SchemaField>