From 56d5a0b8f6fbc0e265bdc0068f253d601d56c62a Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 1 Nov 2023 16:01:45 +0000 Subject: [PATCH] Further read only settings --- packages/bbui/src/Form/Core/Checkbox.svelte | 6 ++ packages/bbui/src/Form/Core/DatePicker.svelte | 4 +- packages/bbui/src/Form/DatePicker.svelte | 2 + packages/client/manifest.json | 57 ++++++++++++++++++- .../components/app/forms/BooleanField.svelte | 2 + .../components/app/forms/DateTimeField.svelte | 2 + .../src/components/app/forms/JSONField.svelte | 2 + .../app/forms/RelationshipField.svelte | 2 + 8 files changed, 75 insertions(+), 2 deletions(-) diff --git a/packages/bbui/src/Form/Core/Checkbox.svelte b/packages/bbui/src/Form/Core/Checkbox.svelte index 3efc737bfb..3eaaf4dede 100644 --- a/packages/bbui/src/Form/Core/Checkbox.svelte +++ b/packages/bbui/src/Form/Core/Checkbox.svelte @@ -8,6 +8,7 @@ export let id = null export let text = null export let disabled = false + export let readonly = false export let size export let indeterminate = false @@ -29,6 +30,11 @@ checked={value} {disabled} on:change={onChange} + on:click={e => { + if (readonly) { + e.preventDefault() + } + }} type="checkbox" class="spectrum-Checkbox-input" {id} diff --git a/packages/bbui/src/Form/Core/DatePicker.svelte b/packages/bbui/src/Form/Core/DatePicker.svelte index 7ce15292be..786aee40b6 100644 --- a/packages/bbui/src/Form/Core/DatePicker.svelte +++ b/packages/bbui/src/Form/Core/DatePicker.svelte @@ -9,6 +9,7 @@ export let id = null export let disabled = false + export let readonly = false export let error = null export let enableTime = true export let value = null @@ -186,7 +187,7 @@ >
option._id}