From def603a1ec0c7beecbc24b713986785a1622f56c Mon Sep 17 00:00:00 2001 From: TianTan Date: Thu, 5 Dec 2024 17:23:55 +0800 Subject: [PATCH] feat(plugin-form): disable scoped plugin toggle (#1816) * feat(plugin-form): disable scoped plugin toggle * test(plugin-form): adapt scope behavior change * chore(form): clear redundant spaces * chore(plugin-form): css correction and code refactoring * feat(plugin-form): backward compatibility for hideScopeSelection * chore(pluginform): change of description --- .../forms/src/components/FormGenerator.vue | 9 +++ .../core/forms/src/components/FormGroup.vue | 7 --- .../components/fields/FieldAutoSuggest.vue | 22 ++++++- .../components/fields/FieldSelectionGroup.vue | 63 +++++++++++++------ packages/core/forms/src/locales/en.json | 4 +- .../src/components/PluginForm.cy.ts | 56 +++++++++++++++++ .../src/components/PluginForm.vue | 16 +++++ 7 files changed, 148 insertions(+), 29 deletions(-) diff --git a/packages/core/forms/src/components/FormGenerator.vue b/packages/core/forms/src/components/FormGenerator.vue index f6bc99e556..85a1d756ae 100644 --- a/packages/core/forms/src/components/FormGenerator.vue +++ b/packages/core/forms/src/components/FormGenerator.vue @@ -599,9 +599,18 @@ export default { width: 10px; } + &:disabled { + background-color: $kui-color-background-disabled; + border-color: $kui-color-border-neutral-weak; + } + &:checked:after { background-color: currentColor; } + + &:checked:disabled:after { + background-color: $kui-color-background-neutral-weak; + } } .vue-form-generator { diff --git a/packages/core/forms/src/components/FormGroup.vue b/packages/core/forms/src/components/FormGroup.vue index 4e5836c175..7e3924e379 100644 --- a/packages/core/forms/src/components/FormGroup.vue +++ b/packages/core/forms/src/components/FormGroup.vue @@ -282,13 +282,6 @@ $errorColor: #f00; display: none; } - &.disabled { - > label { - color: #666; - font-style: italic; - } - } - &.error { input:not([type="checkbox"]), textarea, diff --git a/packages/core/forms/src/components/fields/FieldAutoSuggest.vue b/packages/core/forms/src/components/fields/FieldAutoSuggest.vue index df3e7f8af7..6a171792d0 100644 --- a/packages/core/forms/src/components/fields/FieldAutoSuggest.vue +++ b/packages/core/forms/src/components/fields/FieldAutoSuggest.vue @@ -1,10 +1,16 @@ - +