@@ -2,6 +2,7 @@ import { defineComponent, computed, h } from "vue"
2
2
import {
3
3
chakra ,
4
4
ComponentWithProps ,
5
+ DeepPartial ,
5
6
HTMLChakraProps ,
6
7
ThemingProps ,
7
8
useStyleConfig ,
@@ -24,7 +25,7 @@ export const CFormLabel = defineComponent({
24
25
if ( slots . indicator ) {
25
26
return slots . indicator ?.( )
26
27
} else {
27
- return h ( CRequiredIndicator )
28
+ return < CRequiredIndicator />
28
29
}
29
30
} )
30
31
@@ -52,24 +53,25 @@ export interface CRequiredIndicatorProps extends HTMLChakraProps<"span"> {}
52
53
* Used to show a "required" text or an asterisks (*) to indicate that
53
54
* a field is required.
54
55
*/
55
- export const CRequiredIndicator : ComponentWithProps < CRequiredIndicatorProps > =
56
- defineComponent ( {
57
- name : "CRequiredIndicator" ,
58
- setup ( _ , { attrs } ) {
59
- const field = useFormControlContext ( )
60
- const styles = useStyles ( )
56
+ export const CRequiredIndicator : ComponentWithProps <
57
+ DeepPartial < CRequiredIndicatorProps >
58
+ > = defineComponent ( {
59
+ name : "CRequiredIndicator" ,
60
+ setup ( _ , { attrs } ) {
61
+ const field = useFormControlContext ( )
62
+ const styles = useStyles ( )
61
63
62
- if ( ! field ?. value ?. isRequired ?. value ) return null
64
+ if ( ! field ?. value ?. isRequired ?. value ) return null
63
65
64
- return ( ) => (
65
- < chakra . span
66
- { ...field ?. value ?. requiredIndicatorProps . value }
67
- __css = { styles . value . requiredIndicator }
68
- __label = "form__required-indicator"
69
- { ...attrs }
70
- >
71
- *
72
- </ chakra . span >
73
- )
74
- } ,
75
- } )
66
+ return ( ) => (
67
+ < chakra . span
68
+ { ...field ?. value ?. requiredIndicatorProps . value }
69
+ __css = { styles . value . requiredIndicator }
70
+ __label = "form__required-indicator"
71
+ { ...attrs }
72
+ >
73
+ *
74
+ </ chakra . span >
75
+ )
76
+ } ,
77
+ } )
0 commit comments