From d63e3bd045cec4df106dcd0391861982fe3022bc Mon Sep 17 00:00:00 2001 From: Phillip Rak Date: Thu, 17 Oct 2024 10:21:44 -0700 Subject: [PATCH] Add disabled prop to `ColorInput.vue` Signed-off-by: Phillip Rak --- shell/components/form/ColorInput.vue | 15 +++++++++-- .../form/__tests__/ColorInput.test.ts | 27 +++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 shell/components/form/__tests__/ColorInput.test.ts diff --git a/shell/components/form/ColorInput.vue b/shell/components/form/ColorInput.vue index f447f5cce22..eccbeaba752 100644 --- a/shell/components/form/ColorInput.vue +++ b/shell/components/form/ColorInput.vue @@ -40,6 +40,11 @@ export default { componentTestid: { type: String, default: 'color-input' + }, + + disabled: { + type: Boolean, + default: false, } }, @@ -56,6 +61,12 @@ export default { */ inputValue() { return this.value ? this.value : this.defaultValue; + }, + + isDisabled() { + const disabled = this.disabled; + + return this.mode !== this.editMode || disabled; } }, @@ -69,7 +80,7 @@ export default {