Set default properties. Args: **kwargs: The kwargs to pass to the superclass.
(cls, **kwargs)
| 167 | |
| 168 | @classmethod |
| 169 | def __init_subclass__(cls, **kwargs): |
| 170 | """Set default properties. |
| 171 | |
| 172 | Args: |
| 173 | **kwargs: The kwargs to pass to the superclass. |
| 174 | """ |
| 175 | super().__init_subclass__(**kwargs) |
| 176 | |
| 177 | # Get all the props for the component. |
| 178 | props = cls.get_props() |
| 179 | |
| 180 | # Convert fields to props, setting default values. |
| 181 | for field in cls.get_fields().values(): |
| 182 | # If the field is not a component prop, skip it. |
| 183 | if field.name not in props: |
| 184 | continue |
| 185 | |
| 186 | # Set default values for any props. |
| 187 | if types._issubclass(field.type_, Var): |
| 188 | field.required = False |
| 189 | field.default = Var.create(field.default) |
| 190 | |
| 191 | def __init__(self, *args, **kwargs): |
| 192 | """Initialize the component. |
nothing calls this directly
no test coverage detected