Interface: IFlyout
Defined in: packages/blockly/core/interfaces/i_flyout.ts:18
Interface for a flyout.
Extends
Properties index
| Property | Description |
|---|---|
| horizontalLayout | Whether the flyout is laid out horizontally or not. |
| RTL | Is RTL vs LTR. |
| targetWorkspace | The target workspace |
| MARGIN | Margin around the edges of the blocks in the flyout. |
| autoClose | Does the flyout automatically close when a block is created? |
| CORNER_RADIUS | Corner radius of the flyout background. |
Methods index
| Method | Description |
|---|---|
| createDom | Creates the flyout's DOM. Only needs to be called once. The flyout can either exist as its own svg element or be a g element nested inside a separate svg element. |
| init | Initializes the flyout. |
| dispose | Dispose of this flyout. Unlink from all DOM elements to prevent memory leaks. |
| getWidth | Get the width of the flyout. |
| getHeight | Get the height of the flyout. |
| getWorkspace | Get the workspace inside the flyout. |
| isVisible | Is the flyout visible? |
| setVisible | Set whether the flyout is visible. A value of true does not necessarily mean that the flyout is shown. It could be hidden because its container is hidden. |
| setContainerVisible | Set whether this flyout's container is visible. |
| hide | Hide and empty the flyout. |
| show | Show and populate the flyout. |
| getContents | Returns the list of flyout items currently present in the flyout. The show method parses the flyout definition into a list of actual flyout items. This method should return those concrete items, which may be used for e.g. keyboard navigation. |
| reflow | Reflow blocks and their mats. |
| isScrollable | Returns true if this flyout may be scrolled with a scrollbar or by dragging. |
| getX | Calculates the x coordinate for the flyout position. |
| getY | Calculates the y coordinate for the flyout position. |
| position | Position the flyout. |
| scrollToStart | Scroll the flyout to the beginning of its contents. |
Properties
horizontalLayout
horizontalLayout: boolean;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:20
Whether the flyout is laid out horizontally or not.
RTL
RTL: boolean;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:23
Is RTL vs LTR.
targetWorkspace
targetWorkspace: WorkspaceSvg | null;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:26
The target workspace
MARGIN
readonly MARGIN: number;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:29
Margin around the edges of the blocks in the flyout.
autoClose
autoClose: boolean;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:32
Does the flyout automatically close when a block is created?
CORNER_RADIUS
readonly CORNER_RADIUS: number;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:35
Corner radius of the flyout background.
Methods
createDom()
createDom(tagName): SVGElement;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:46
Creates the flyout's DOM. Only needs to be called once. The flyout can either exist as its own svg element or be a g element nested inside a separate svg element.
Parameters
| Parameter | Type | Description |
|---|---|---|
tagName | | string | Svg<SVGSVGElement> | Svg<SVGGElement> | The type of tag to put the flyout in. This should be |
Returns
SVGElement
The flyout's SVG group.
init()
init(targetWorkspace): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:55
Initializes the flyout.
Parameters
| Parameter | Type | Description |
|---|---|---|
targetWorkspace | WorkspaceSvg | The workspace in which to create new blocks. |
Returns
void
dispose()
dispose(): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:61
Dispose of this flyout. Unlink from all DOM elements to prevent memory leaks.
Returns
void
getWidth()
getWidth(): number;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:68
Get the width of the flyout.
Returns
number
The width of the flyout.
getHeight()
getHeight(): number;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:75
Get the height of the flyout.
Returns
number
The height of the flyout.
getWorkspace()
getWorkspace(): WorkspaceSvg;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:82
Get the workspace inside the flyout.
Returns
The workspace inside the flyout.
isVisible()
isVisible(): boolean;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:89
Is the flyout visible?
Returns
boolean
True if visible.
setVisible()
setVisible(visible): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:98
Set whether the flyout is visible. A value of true does not necessarily mean that the flyout is shown. It could be hidden because its container is hidden.
Parameters
| Parameter | Type | Description |
|---|---|---|
visible | boolean | True if visible. |
Returns
void
setContainerVisible()
setContainerVisible(visible): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:105
Set whether this flyout's container is visible.
Parameters
| Parameter | Type | Description |
|---|---|---|
visible | boolean | Whether the container is visible. |
Returns
void
hide()
hide(): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:108
Hide and empty the flyout.
Returns
void
show()
show(flyoutDef): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:117
Show and populate the flyout.
Parameters
| Parameter | Type | Description |
|---|---|---|
flyoutDef | | string | FlyoutDefinition | Contents to display in the flyout. This is either an array of Nodes, a NodeList, a toolbox definition, or a string with the name of the dynamic category. |
Returns
void
getContents()
getContents(): FlyoutItem[];
Defined in: packages/blockly/core/interfaces/i_flyout.ts:127
Returns the list of flyout items currently present in the flyout.
The show method parses the flyout definition into a list of actual
flyout items. This method should return those concrete items, which
may be used for e.g. keyboard navigation.
Returns
List of flyout items.
reflow()
reflow(): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:130
Reflow blocks and their mats.
Returns
void
isScrollable()
isScrollable(): boolean;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:136
Returns
boolean
True if this flyout may be scrolled with a scrollbar or by dragging.
getX()
getX(): number;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:143
Calculates the x coordinate for the flyout position.
Returns
number
X coordinate.
getY()
getY(): number;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:150
Calculates the y coordinate for the flyout position.
Returns
number
Y coordinate.
position()
position(): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:153
Position the flyout.
Returns
void
scrollToStart()
scrollToStart(): void;
Defined in: packages/blockly/core/interfaces/i_flyout.ts:156
Scroll the flyout to the beginning of its contents.
Returns
void