From 28f965fd1b85d91d53165efb96e7346eb6ebdb8d Mon Sep 17 00:00:00 2001 From: ipula Date: Tue, 28 Mar 2023 10:56:18 +0200 Subject: [PATCH] pkp/pkp-lib#8850 Add disabled property for form text in ui-library --- src/components/Form/fields/FieldBase.vue | 1 + src/components/Form/fields/FieldText.vue | 20 +++++++------- .../Form/fields/FieldBase/readme.md | 1 + .../fields/FieldText/ComponentFieldText.vue | 7 +++++ .../previews/PreviewFieldTextDisable.vue | 27 +++++++++++++++++++ .../previews/PreviewFieldTextOptIntoEdit.vue | 10 +++++++ .../Form/helpers/field-text-given-name.js | 1 + 7 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 src/docs/components/Form/fields/FieldText/previews/PreviewFieldTextDisable.vue diff --git a/src/components/Form/fields/FieldBase.vue b/src/components/Form/fields/FieldBase.vue index fbf8f97b1..5f2e3d4e8 100644 --- a/src/components/Form/fields/FieldBase.vue +++ b/src/components/Form/fields/FieldBase.vue @@ -26,6 +26,7 @@ export default { formId: String, isMultilingual: Boolean, isRequired: Boolean, + disabled: Boolean, showWhen: [String, Array], primaryLocale: String, localeKey: String, diff --git a/src/components/Form/fields/FieldText.vue b/src/components/Form/fields/FieldText.vue index acf00abce..d0debc4c3 100644 --- a/src/components/Form/fields/FieldText.vue +++ b/src/components/Form/fields/FieldText.vue @@ -46,14 +46,13 @@ :name="localizedName" :aria-describedby="describedByIds" :aria-invalid="errors && errors.length" - :disabled="isDisabled" + :disabled="disabled" :required="isRequired" :style="inputStyles" /> {{ optIntoEditLabel }} @@ -80,7 +79,6 @@ - diff --git a/src/docs/components/Form/fields/FieldBase/readme.md b/src/docs/components/Form/fields/FieldBase/readme.md index fb7dbb2b7..a1ec4a635 100644 --- a/src/docs/components/Form/fields/FieldBase/readme.md +++ b/src/docs/components/Form/fields/FieldBase/readme.md @@ -12,6 +12,7 @@ | `groupId` | The ID of the group this field should appear in. | | `formId` | The ID of the form this field should appear in. This is passed down from the `Form`. | | `isRequired` | Whether or not a value for this field should be required. | +| `disabled` | Used in the `disabled` attribute of ``, `