Here’s an expanded list of component features I’ll try to incorporate into all the BCA components. Obviously all these features are not applicable to every component, but I’ll attempt to include all I can. My hope is that using this checklist will help me produce a first class component library by updating this feature list and the existing components as I discover new features.
So if you use any of the components from this blog and later find one lacking a feature you need you might want to come back to the blog to see if I’ve added it. If you find I haven’t included a feature you need please leave a comment detailing what you’re looking for and I’ll try to accomodate you.
- HTML elements that commonly appear together.
- Example: Enclosing div, label, and input.
- Parameters
- Value
- Provides the means to set or read the components value via binding
- The type is dependent on the component
- Placeholder
- Provides the means to show a message in an input when the input is null
- Type string
- Label
- The text that will be displayed in the label element
- Type string
- Title
- The title (tooltip) attribute of the enclosing div.
- Type string
- Id
- The id attribute of the primary HTML element, such as the input
- Type string
- ExtraAttributes
- Any unmatched values supplied by the user that will be applied to the primary HTML element in the component
- Type Dictionary<string, object>
- Decorated with [Parameter(CaptureUnmatchedValues = true)]
- ClassDiv
- Class for the enclosing div element
- Type string
- ClassLabel
- Class for the label element
- Type string
- ClassInput
- Class for the Input element
- Type string
- Default value might be “form-control”
- ClassValid
- Class to be applied to an input with a valid input value
- Type string
- Default value is “valid” which should be the site specific input outline color
- ClassModified
- Class to be applied to an input with a modified input value
- Type string
- Default value is “valid modified” which usually is a green outline
- ClassInvalid
- Class to be applied to an input with an invalid input value
- Type string
- Default value is “invalid” which usually is a red outline
- ClassValidationMessage
- Class to be applied to the validation message
- Type string
- Default value is “validation-message” which is usually color red
- OnChanged
- EventCallback triggered after the component value changes
- EditContext
- The parents EditContext (if applicable) for data validation
- For
- Used to indicate the applicable EditContext field
- Type string
- Value
- Methods
- GetSelectedItems
- Returns currently selected items
- GetSelectedItems
- Documentation
- XML documentation
- Describe the purpose of parameters and public methods
- XML documentation