Design
Lozenges are used to indicate metadata, usually to demonstrate the selections that define or summarise the information directly below the Lozenges.
Lozenges can be displayed on their own, within a form field as part of an Autocomplete or as part of components such as the Expander Panel.
Reflecting choices
Lozenges frequently display the results of choices made in a form on the previous view. For example, this form selects priorities to include in a report:
Resulting lozenges on updated view:
Updating data sets
Closeable Lozenges allow a selection to be removed from the current set. When the Lozenge is removed, the displayed data should be updated.
In this example a user activity report shows activity by all users on the previous day:
Q&A Summary
When the closeable 'Yesterday' Lozenge is removed, the report should immediately update to show activity from all time. The 'yesterday' metadata no longer applies, no other timeframe has been set, so the logical default is all time. The other Lozenges are not closeable as the data set can not logically remove all users from a report about users.
If the report had been created specifying specific users groups, then those group Lozenges would be closeable:
Q&A Summary
If the team Blue or Maroon lozenge is removed, the data set would remove that team from the report. If both were removed, the data set would display data for all groups.
Code
When implementing Lozenge, note that in most cases they should be enclosed in another element. If they are set 'on their own', for example between a heading and a table, wrap them in a Lozenge Group.
Example | Notes | Code | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Macaw
|
Lozenge |
ASP Attributes
|
||||||||||||||
Macaw
|
Closeable lozenge |
|
||||||||||||||
Macaw
|
Closeable lozenge custom icon text |
|
||||||||||||||
Hyperlink lozenge |
|
|||||||||||||||
Closable lozenge with hyperlink |
|
|||||||||||||||
Open
Closed
Undecided
|
Lozenge groups enclose sets of Lozenges, adding padding when no other parent element is available. |
|
Lozenges Attributes
Element | Attributes | Description |
---|---|---|
.ace-lozenge
|
data-ace-closeable="true"
|
Makes the lozenge closable. |
.ace-lozenge
|
data-ace-closeabletext="text"
|
Adds alternative text for closeable icon control. |
.ace-lozenge
|
.ace-lozenge-interactive
|
Used for styling of interactive elements such as clocable and link lozenges |
Name | Description |
---|---|
customclass | Adds a custom class |
closeable | Makes lozenges closeable. options:[True, Empty]
|
Javascript
Events
Event | Description | Example |
---|---|---|
removeLozenge | Fires when Lozenge has been removed |
|
Optional Methods
Function | Arguments | Description | Example |
---|---|---|---|
init | $parentEl | Initialises all children lozenges of an element |
|
destroy | $parentEl | Removes all children lozenges of an element |
|
remove | lozengeId | Removes the lozenge element from the DOM |
|