FlexiTarget
A 'target' for widgets, or a dropzone. Stores a series of widget instances in a managed grid layout.
FlexiTarget (component)
Props
header Snippet<[{ target: FlexiTargetController }]>The header content of the target, above the grid.
children SnippetThe child content of the target, which should contain inner FlexiWidget definitions.
footer Snippet<[{ target: FlexiTargetController }]>The footer content of the target, below the grid.
containerClass stringThe class names to apply to the target's container element.
class stringThe class names to apply to the target's root element.
config FlexiTargetConfigurationThe configuration object for the target.
key stringThe unique identifier for the target. Used to identify the target when layouts are imported or exported.
controller FlexiBoardController (bindable)The controller for the board.
onfirstcreate (controller: FlexiBoardController) => voidA callback that fires when the board's controller is first created.
FlexiTargetController
FlexiTargetController uses a controller to manage its state and behaviour. You can access the controller via binding to the controller prop or using the onfirstcreate callback.
The FlexiTargetController allows you to manage the target directly and carry out actions.
Properties
widgets SvelteSet<FlexiWidgetController>The widgets currently in this target.
config FlexiTargetConfigurationThe reactive configuration of the target.
providerWidgetDefaults FlexiWidgetDefaults | undefinedThe reactive default widget configuration passed through from the provider, if it exists.
prepared booleanWhether the target is prepared and ready to render widgets.
columns numberThe number of columns currently being used in the target grid.
rows numberThe number of rows currently being used in the target grid.
Methods
createWidget (config: FlexiWidgetConfiguration) => FlexiWidgetController | undefinedCreates a new widget under this target.
More methods will be added in a future version.
FlexiTargetConfiguration
The configuration object for the FlexiTarget component, which supports reactivity where specified.
To use reactivity, ensure that the config prop has a reactive source (proxy).
Properties
rowSizing string | ({ target, grid }: { target: FlexiTargetController, grid: FlexiGrid }) => stringAllows the specifying of the value inside the `repeat()` function of the `grid-template-rows` CSS property for the target. Defaults to 'minmax(1rem, auto)'. Reactive.
columnSizing string | ({ target, grid }: { target: FlexiTargetController, grid: FlexiGrid }) => stringAllows the specifying of the value inside the `repeat()` function of the `grid-template-columns` CSS property for the target. Defaults to 'minmax(0, 1fr)'. Reactive.
layout TargetLayoutThe layout algorithm and parameters to use for the target grid.
widgetDefaults FlexiWidgetDefaultsThe default configuration for widgets. Reactive.
FlexiWidgetDefaults
The default configuration for widgets.
Properties
draggable booleanWhether the widget is draggable. Defaults to true. Reactive.
resizability 'none' | 'horizontal' | 'vertical' | 'both'The resizability of the widget. Defaults to 'both'. Reactive.
width numberThe width of the widget in units. Defaults to 1. Not reactive.
height numberThe height of the widget in units. Defaults to 1. Not reactive.
snippet SnippetThe snippet that is rendered by this widget. Reactive.
component ComponentThe component that is rendered by this widget. Reactive.
componentProps Record<string, any>The props applied to the component rendered, if it has one. Reactive.
className ClassValueThe class names to apply to this widget. Reactive.
grabTrigger FlexiWidgetTriggerConfigurationThe configuration for how pointer events should trigger a grab event on the widget. E.g. a long press.
resizeTrigger FlexiWidgetTriggerConfigurationThe configuration for how pointer events should trigger a resize event on the widget. E.g. a long press.
transitionConfig FlexiWidgetTransitionConfigurationGets the transition configuration for this widget.