Skip to main content

Unit of Measure Tree

Overview

The Unit of Measure Tree component is a custom Perspective component that provides a list of units of measure in a tree view. Although UoMs are not hierarchical, the tree structure allows for easy integration with other tree components and provides a consistent user experience.

Props

The Unit of Measure Tree component has the following props:

Prop NameTypeDescriptionInput/Output
showSearchbooleanIf true, shows a search box at the top of the tree to filter unit of measures.Input
selectedItemobjectThe currently selected item in the tree. Contains the properties id (string), notes (string), symbol (string), enabled (boolean), name (string), spare1 (string), spare2 (string), spare3 (string)Output
currentItemIdstringThe ID of the item most recently clicked on. This is useful for tracking user interaction with the tree.Output
forceRefreshbooleanIf true, forces the tree to refresh its data from the server. Automatically resets to false after 500ms.Input
allowEditbooleanIf true, allows the user to edit the tree (add, edit, delete, cut, paste, etc.).Input
hideItemsarray[string]An array of unit of measure IDs to hide from the tree.Input
showImportbooleanIf true, shows an "Import" button to allow importing unit of measures from a CSV or JSON file.Input
showExportbooleanIf true, shows an "Export" button in the context menu to allow exporting unit of measures to a CSV or JSON file.Input
importTooltipstringThe tooltip text to show when hovering over the "Import" button.Input

Events

The Unit of Measure Tree component emits the following events:

Event NameDescriptionPayload
onAddEmitted when the user adds a new unit of measure.None
onDeleteEmitted when the user deletes a unit of measure.{ currentItemId: string }
onImportEmitted when the user imports unit of measures.None
onExportEmitted when the user exports unit of measures.{ currentItemId: string}