PropertyEditors
The PropertyEditors category in the @itwin/components-react
package includes
classes and components for working with Property Editors.
Property editors are used by the Table, Tree and PropertyGrid components for cell editing of properties.
Property editors have two pieces:
- A class that extends PropertyEditorBase, is registered for a certain type name and optionally an editor name, and returns a React node for the editor component
- A React component that implements TypeEditor and renders the editor and processes user interaction
Each property editor must be registered with the PropertyEditorManager
for a given type name, and optionally an editor name,
by calling the registerEditor
method.
PropertyEditorManager.registerEditor("text", BasicPropertyEditor);
The EditorContainer component is used by the Table, Tree and PropertyGrid for cell editing. Those components render an EditorContainer in a cell when cell editing is invoked. The EditorContainer creates the appropriate property editor based on the cell's PropertyDescription, which contains the type name and optional editor name.
The following is a list of the provided property editors:
- BasicPropertyEditor - registered for the "text" and "string" type names
- BooleanPropertyEditor - registered for the "bool" and "boolean" type names
- ColorPropertyEditor - registered for the "number" type name and "color-picker" editor name
- EnumPropertyButtonGroupEditor - registered for the "enum" type name and the "enum-buttongroup" editor name
- EnumPropertyEditor - registered for the "enum" type name
- ImageCheckBoxPropertyEditor - registered for the "bool" and "boolean" type names and "image-check-box" editor name
- NumericInputPropertyEditor - registered for the "number" type name and "numeric-input" editor name
- SliderPropertyEditor - registered for the "number" type name and "slider" editor name
- TextareaPropertyEditor - registered for the "text" and "string" type names and "multi-line" editor name
- ThemedEnumPropertyEditor - registered for the "enum" type name and "themed-enum" editor name
- TogglePropertyEditor - registered for the "bool" and "boolean" type names and "toggle" editor name
- WeightPropertyEditor - registered for the "number" type name and "weight-picker" editor name
Note: PropertyEditorManager.registerEditor
is called by the system for these delivered property editors.
Standard Type Names and Editor Names
The StandardTypeNames and StandardEditorNames enums can be used when populating a PropertyDescription. These enums contain the type and editor names used when registering the editors listed above.
API Reference
Last Updated: 20 June, 2023