Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Negotiate Button

The lens-negotiate-button component allows users to initiate a data request. It becomes active when one or more (site/data sources) are selected. Depending on the configuration, it either dispatches a general event or starts a negotiation through the BBMRI-ERIC Negotiator service. The button is disabled by default when no data source is selected. Fires a global lens-negotiate-triggered event when clicked.

Optionally integrates with the BBMRI-ERIC Negotiator when type is set to "Negotiator".

Props

PropTypeDefaultDescription
titlestring"Request Data"The label shown on the button.
typestring""Determines the negotiation behavior. Use "Negotiator" to enable integration with BBMRI-ERIC.

Behavior

  • The button is disabled when no data sources are selected (datarequestsStore is empty).

  • Clicking the button always triggers a global browser event:

    window.dispatchEvent(new CustomEvent("lens-negotiate-triggered"));
    
  • If type is "Negotiator", the internal bbmriNegotiate() function is also called, passing the current data request list.

Usage

<lens-negotiate-button type="Negotiator"></lens-negotiate-button>

Or with a custom label:

<lens-negotiate-button
    type="Custom"
    title="Start Request"
></lens-negotiate-button>

Styling

Part nameDescription
lens-negotiate-buttonBase button styling.
lens-negotiate-button-activeApplied when the button is enabled and clickable.
lens-negotiate-button-disabledApplied when the button is inactive (no data selected).
lens-negotiate-button-titleStyles the text inside the button.

Example

lens-negotiate-button::part(lens-negotiate-button-active) {
    background-color: var(--custom-green);
}