From f9d07c62a091bf44a36b38454c5b1ba86559270a Mon Sep 17 00:00:00 2001
From: mm <25961416+mlmoravek@users.noreply.github.com>
Date: Tue, 23 Apr 2024 13:34:10 +0200
Subject: [PATCH] fix(field): fix slot invoked outside render function (#906)
---
packages/docs/components/Field.md | 37 ++---
packages/oruga/src/components/field/Field.vue | 135 +++++++++++-------
.../oruga/src/components/field/FieldBody.vue | 63 --------
.../src/components/field/examples/index.vue | 2 +-
.../src/components/field/fieldInjection.ts | 3 +-
packages/oruga/src/utils/helpers.ts | 11 ++
6 files changed, 119 insertions(+), 132 deletions(-)
delete mode 100644 packages/oruga/src/components/field/FieldBody.vue
diff --git a/packages/docs/components/Field.md b/packages/docs/components/Field.md
index 8d7af153f..b87ff70bd 100644
--- a/packages/docs/components/Field.md
+++ b/packages/docs/components/Field.md
@@ -37,27 +37,28 @@ title: Field
### Props
-| Prop name | Description | Type | Values | Default |
-| ---------------- | ------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| addons | Field automatically attach controls together | boolean | - | true
|
-| groupMultiline | Allow controls to fill up multiple lines, making it responsive | boolean | - | false
|
-| grouped | Direct child components/elements of Field will be grouped horizontally
(see which ones at the top of the page). | boolean | - | false
|
-| horizontal | Group label and control on the same line for horizontal forms | boolean | - | false
|
-| label | Field label | string | - | |
-| labelFor | Same as native for set on the label | string | - | |
-| labelSize | Vertical size of input | string | `small`, `medium`, `large` |
field: {
labelsize: undefined
}
|
-| message | Help message text | string | - | |
-| mobileBreakpoint | Mobile breakpoint as max-width value | string | - | field: {
mobileBreakpoint: undefined
}
|
-| override | Override existing theme classes completely | boolean | - | |
-| variant | Color of the field and help message, also adds a matching icon.true
|
+| groupMultiline | Allow controls to fill up multiple lines, making it responsive | boolean | - | false
|
+| grouped | Direct child components/elements of Field will be grouped horizontallyfalse
|
+| horizontal | Group label and control on the same line for horizontal forms | boolean | - | false
|
+| label | Field label | string | - | |
+| labelFor | Same as native for set on the label | string | - | |
+| labelSize | Vertical size of input | string | `small`, `medium`, `large` | field: {
labelsize: undefined
}
|
+| message | Help message text | string | - | |
+| messageTag | | DynamicComponent | - | field: {
messageTag: "p"
}
|
+| mobileBreakpoint | Mobile breakpoint as max-width value | string | - | field: {
mobileBreakpoint: undefined
}
|
+| override | Override existing theme classes completely | boolean | - | |
+| variant | Color of the field and help message, also adds a matching icon.