Describes the properties of a Text Comparison Instance Toolbar Item.
Extends
Members
Type Definitions
Members
Useful to set a custom CSS class name on the item.
For default text comparison instance toolbar items the className
is appended to the default
item ones.
Type:
- string
- Overrides:
Whether the item is disabled or not.
The property can be used to force a default item to be
disabled by setting it to true
.
Type:
- boolean
- Overrides:
Icon for the item.
The icon should either be an URL, a base64 encoded image or the HTML for an inline SVG. This property can override the default items' ones.
Type:
- string
- Overrides:
Unique identifier for the item.
This is useful to identify items whose type
is custom
.
Type:
- string
- Overrides:
Example
// In your JavaScript
const innerToolbarItems = PSPDFKit.defaultTextComparisonInnerToolbarItems
innerToolbarItems.push({ type: 'custom', id: 'my-button', ... })
PSPDFKit.loadTextComparison({
...otherOptions,
innerToolbarItems,
});
Note: It is ***not*** possible to override this option for built-in text comparison toolbar items.
Optionally custom
tool items can define a DOM node.
PSPDFKit renders this node instead of a standard tool button.
In this case the tool item is rendered inside of a container
which gets the title
and className
attributes set.
The icon
property is ignored.
The selected
and disabled
are used just to toggle the
PSPDFKit-Tool-Node-active and PSPDFKit-Tool-Node-disabled
class names but making the node effectively selected or disabled is up to
the implementation of the item.
The onPress
event is registered and fires any time the item is either clicked
or selected with keyboard (if part of a dropdownGroup
).
Type:
- Node
- Inherited From:
Callback to invoke when the item is clicked or tapped (on touch devices). It gets the event
as
first argument, a document editor UI handler object as the second, and the id
of the tool item as the third.
Type:
- Overrides:
Whether a custom item is selected or not.
The selected status of default items cannot be altered.
Note: It is not possible to override this option for built-in text comparison instance toolbar items.
Type:
- boolean
- Overrides:
Title for the tool items.
It is shown on hover or when the item doesn't have an icon.
Type:
- string
- Inherited From:
required
The type of a text comparison instance toolbar item.
It can either be custom
for user defined items or one from the PSPDFKit.defaultTextComparisonInnerToolbarItems.
Note: It is not possible to override this option for built-in toolbar items.
Type:
- string
- Overrides:
Example
// In your JavaScript
const innerToolbarItems = PSPDFKit.defaultTextComparisonInnerToolbarItems
innerToolbarItems.push({ type: 'custom', ... })
PSPDFKit.loadTextComparison({
...otherOptions,
innerToolbarItems,
});
Type Definitions
Parameters:
Name | Type | Description |
---|---|---|
event |
MouseEvent | KeyboardEvent | The event that is fired on press. |
documentEditorUIHandler |
PSPDFKit.DocumentEditorUIHandler | An instance object to set and retrieve different state properties of the document editor UI. |
id |
string | The tool item id. |
See also
-
PSPDFKit.TextComparisonConfiguration#instanceToolbarItems