a suite of UI Components for development of web apps
If you have any questions, don't hesitate to contact us at support@lidorsystems.com
Advanced User Interface Controls and Components
IntegralUI Toolbar is a native web component for Angular, React and Vue that displays a collection of different editor types in one line. It allows you to arrange multiple editors horizontally. In this article, you will find general information about the toolbar component, including its properties, events and methods that you can use.
If you have any questions, don't hesitate to contact us at support@lidorsystems.com
In this example, the toolbar shows different kind of items like: buttons, checkbox, progress bar, dropdown list, slider, numeric component and separators. All these components act like editors and are aligned in one horizontal line.
To use the Toolbar component you need to do the following:
@ViewChild('application', {read: ViewContainerRef, static: false}) applicationRef: ViewContainerRef;
public toolbar: Array;
constructor(){
this.toolbar = [
{ id: 1, icon: 'tlbr-ovw-tool-icons save', type: IntegralUIToolItemType.Button },
{ id: 2, type: IntegralUIToolItemType.Progress, value: 25, width: 100 },
{ id: 3, type: IntegralUIToolItemType.Separator },
// . . .
//
// The full data set is available at https://stackblitz.com/edit/integralui-toolbar-overview
//
];
}
<iui-toolbar [appRef]="applicationRef">
<iui-toolitem *ngFor="let item of toolbar" [data]="item" [type]="item.type" [settings]="item.settings">
</iui-toolitem>
</iui-toolbar>
The item type property determines its functionality and appearance. There are several built-in types:
Here is an example of some of these types set in code:
import { IntegralUICheckState, IntegralUIToolItemType } from './integralui/components/integralui.core';
// . . .
this.toolbar = [
// . . .
{
id: 4,
type: IntegralUIToolItemType.CheckBox,
settings: {
threeState: true,
style: {
button: {
checked: 'tlbr-ovw-tool-checked',
indeterminate: 'tlbr-ovw-tool-indeterminate',
unchecked: 'tlbr-ovw-tool-unchecked'
}
}
},
value: IntegralUICheckState.Checked
},
{
id: 5,
type: IntegralUIToolItemType.DropList,
settings: {
placeHolder: 'Print what ...',
items: [
{ text: "Document ", value: 0 },
{ text: "Document properties ", value: 1 },
{ text: "Document showing markup ", value: 2 },
{ text: "List of markup ", value: 3 },
{ text: "Styles", value: 4 },
{ text: "Building block entries", value: 5 },
{ text: "Key assignments", value: 6 }
]
},
width: 225
},
// . . .
];
If the item type is not specified, you can add any custom component or HTML elements as children of the iui-toolitem tag.
You can use the following properties to change the appearance and behavior of the Toolbar component:
Using the above properties, you can customize the Toolbar component in a way best suited for your application.
The following public methods are available:
Each tool item that is part of the toolbar also has its own properties:
Most of these properties are the same, because toolbar and toolitem inherit from the same IntegralUIBaseComponent class.
The settings property varies depending on the item type. For example, here is how it looks like for DropList and Numeric tool item:
To find more information about settings for each component type, check out the specific component overview article.
Here is a list of available events:
If the tool item is an editor, then the valueChanged event is fired, whenever editor value changes. You can handle this event in your code and add specific action based on event data. For example, for a dropdown list when a new option is selected, the event data contains the selected item:
itemValueWillChange(e: any){
//console.log(e.data.value, " value will change: " + e.value);
}
itemValueChanged(e: any){
//console.log(e.data, " value has changed: " + e.value);
}
<iui-toolbar [appRef]="applicationRef">
<iui-toolitem *ngFor="let item of toolbar" [data]="item"
[type]="item.type"
[settings]="item.settings"
(valueChanging)="itemValueWillChange($event)"
(valueChanged)="itemValueChanged($event)"
></iui-toolitem>
</iui-toolbar>
The e.data field contains the tool item data (in this case the dropdown list)), you can use it to determine the item type. The e.value field contains the value of the new selected item.
The following public methods are available for each toolbar item:
Toolbar on its own is empty. You can customize the toolbar by adding either items from built-in component types or provide your own custom items.
In addition, you can change the general toolbar appearance using the controlStyle property. You can override the default CSS style settings by providing your own CSS classes:
toolbarStyle = {
general: {
disabled: 'iui-toolbar-disabled',
focused: 'iui-toolbar-focused',
normal: 'iui-toolbar',
hovered: 'iui-toolbar-hovered',
selected: 'iui-toolbar-selected'
}
}
IntegralUI Toolbar is a web component that you can use in Angular, React and Vue. You can use the component to display a collection of different editor types in one line. Using different properties and events and by providing your own CSS classes, you can customize the toolbar appearance and behavior.
The Toolbar component is part of IntegralUI Web.