# Tap Event

Defines the behavior when a mouse click or touch event occurs on the component.

## Behavior

### Press Effect

When a tap event occurs on the component, the configured shadow effect disappears temporarily, and the component moves by the specified X and Y offsets before returning to its original state. This creates a button-like pressed effect.

### Actions

- Goto target board:
  - Navigates to the specified target board.
  - Supported viewers will switch the screen from the current board to the target board. Users can navigate back using the viewer's "back" functionality or by clicking a component in the target board with the tap event set to "close current board".
  - Parameters:
    - Target: Specifies the target board to be displayed as a popup.
- Open new window for target link:
  - Opens the specified link page in a new browser tab.
  - Parameters:
    - Target: Specifies the URL of the page to be opened in a new browser tab.
- Move to target link:
  - Opens the specified link page in the current browser tab.
  - Parameters:
    - Target: Specifies the URL of the page to be opened in the current browser tab.
- Route to page:
  - Navigates to another page within the Things Factory framework.
  - For example, setting the target page as 'settings' will navigate to the settings page.
  - Parameters:
    - Target: Specifies the route to the page. It can be in the format of ':page[/:resource]', excluding the context path.
- Popup target board:
  - Displays the specified target board in a popup window.
  - The position of the popup window is determined based on the size of the target board and the position of the hovered component. It can be displayed in one of the following positions: top-left, top-right, bottom-left, bottom-right, center.
  - The size of the popup window should not exceed the size of the current board. If the target board is larger than the current board, it will be difficult to view the entire content of the target board.
  - To close the popup window, users can click the 'X' close button in the top-right corner or click a component in the target board with the tap event set to "close current board".
  - Parameters:
    - Target: Specifies the target board to be displayed as a popup.
    - Input Data: Initial values to be passed to the target board. The data value specified in this parameter will be passed as the initial value of the corresponding component.
    - Will Get Return: When the target board is closed, the returned value will be reflected in the data value of this component.
- Modal popup target board:
  - Similar to the 'popup target board', but the popup window behaves as a modal. Users can close the popup window by clicking the backdrop around it or pressing the Esc key.
- Close current board:
  - If this component belongs to a board that was opened as a 'popup target board', it will close the popup.
  - If this component belongs to a board that was navigated using 'goto target board', it will navigate back to the previous board.
- Open info window:
  - Displays an info window at a position near the hovered point based on the settings of the 'info-window' component.
  - Parameters:
    - Target: Specifies the ID of the target info window.
- Toggle open info window:
  - Displays or closes an info window at a position near the hovered point based on the settings of the 'info-window' component.
  - Parameters:
    - Target: Specifies the ID of the target info window.
- Toggle target component data:
  - Toggles the data of the target component between true and false based on its current data value.
  - Parameters:
    - Target: The target component for toggling the data.
- Tristate (0/1/2) target component data:
  - Cycles the data of the target component between the numbers 0, 1, and 2 based on its current data value.
  - Parameters:
    - Target: The target component for cycling the data.
- Forcefully execute data spreading of the target component.
  - Execute forced data propagation using the current data of the target component.
  - Parameters:
    - Target: The target component to change the data.
- Set value to target component data:
  - Changes the 'data' of the target component to the specified value.
  - Changing the data of a component triggers the corresponding data spread in the target component.
  - Parameters:
    - Target: The target component to change the data.
    - Value: The value to be set in the target component (can be a string, number, or object).
- Set value to target component value:
  - Changes the 'value' of the target component to the specified value.
  - Changing the value of a component triggers the specified behavior in the target component.
  - Parameters:
    - Target: The target component to change the value.
    - Value: The value to be set in the target component (can be a string, number, or object).
- Start the given scenario:
  - Starts the specified scenario with the provided value.
  - Only starts the target scenario and does not wait for its completion. If the scenario is already in progress, it will not start a new instance.
  - Parameters:
    - Target: The scenario to start.
    - Value: The parameter to be passed to the scenario.
- Run the given scenario:
  - Executes the specified scenario with the provided value.
  - Starts a new instance of the target scenario, waits for its completion, and stores the final scenario result directly in the component's data attribute. This triggers data propagation.
  - Parameters:
    - Target: The scenario to run.
    - Value: The parameter to be passed to the scenario.
- export data
  - can download the component's data as an Excel file with the specified filename.
  - parameters
    - target(target): the name of the Excel file to be downloaded
- import data
  - open the Excel file and set the data from the first sheet as the component's data.
