WidgetGridRegistry
This service provides the list of widgets that could be added to a widget grid. You could use it to register your own widgets.
Properties
Section titled “Properties”translate
Section titled “translate”Type: unknown
Default Value: inject(TranslateService)
Methods
Section titled “Methods”clearRegisteredWidget
Section titled “clearRegisteredWidget”clearRegisteredWidget(): voidgetNoopWidget
Section titled “getNoopWidget”Get the noop component. This component will be rendered in the grid tile if not matching widget could be found in the list of registered widgets. It will show some kind of ‘not found’ message and provide the controls to remove that none existing component from the widget grid.
getNoopWidget(): GridWidget<unknown>getRegisteredWidgets
Section titled “getRegisteredWidgets”Get registered widgets. This list could be narrowed down by a list of buckets. Buckets are lists of registered widgets registered for a certain key (the buckets name).
getRegisteredWidgets(buckets?: string[]): GridWidget[]Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| buckets | string[] |
getWidgetComponent
Section titled “getWidgetComponent”Get the component for a widget. This is the component that will be rendered in a grid tile. no component registered with the given name
getWidgetComponent(widgetName: string): unknown | TypeArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| widgetName | string |
getWidgetSetupComponent
Section titled “getWidgetSetupComponent”Setup components are the administrative part of a widget. They are used to set up a widget. Not all the widgets will have a setup component. is not widget registered with the given name
getWidgetSetupComponent(widgetName: string): Type | undefinedArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| widgetName | string |
isWidgetApplicable
Section titled “isWidgetApplicable”Evaluates whether the widget with the given name is applicable for the current runtime context. Widgets without an isApplicable predicate are considered applicable. Unknown widgets are reported as applicable so the noop fallback can still render.
isWidgetApplicable(widgetName: string): booleanArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| widgetName | string |
registerGridWidget
Section titled “registerGridWidget”Adds a new widget to the list of registered widgets. That way you can create custom widgets that are then available to be added to a users widget grid. not exist it’ll be created.
registerGridWidget(widget: GridWidget<unknown>, buckets?: string[]): voidArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| widget | GridWidget<unknown> | |
| buckets | string[] |
registerGridWidgets
Section titled “registerGridWidgets”Register a collection of widgets not exist it’ll be created.
registerGridWidgets(widgets: GridWidget<unknown>[], buckets?: string[]): voidArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| widgets | GridWidget<unknown>[] | |
| buckets | string[] |
removeRegisteredWidget
Section titled “removeRegisteredWidget”removeRegisteredWidget(id: string): voidArguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
| id | string |