BetaBetachangeEvent emitter to emit layout change events
When the user modifies layout settings, emit a new layout object through this event emitter. The parent component will listen for these events and update its layout state accordingly.
The emitter's emit() method returns a CustomEvent that can be cancelled
by the parent if needed.
import {
ViewLayout,
ViewLayoutConfigurationComponent,
} from '@limetech/lime-web-components';
class SortConfiguration implements ViewLayoutConfigurationComponent {
// The parent supplies the current layout and listens for the event.
public layout: ViewLayout;
public changeLayout: ViewLayoutConfigurationComponent['changeLayout'];
private sortBy(name: string, direction: 'ASC' | 'DESC') {
this.changeLayout.emit({
...this.layout,
order: [{ name, direction }],
});
}
}
BetalayoutThe current layout configuration
This property receives the current layout state from the parent component. The configuration UI should reflect these values and allow users to modify them.
Interface for components that render a configuration UI for a ViewLayout
This interface defines the contract for layout configuration components, which allow users to customize how a view displays data. A configuration component receives the current layout, shows controls for the settings it supports, and emits
changeLayoutwith the whole updated layout when the user changes something. The parent replaces its layout state with what the event carries.Example: A configuration component
Example: Handling layout changes in the parent view