DOM Helper
The DOM Helper offers utility functions to simplify Node-RED editor DOM manipulation, reducing development effort. Optimized for tree-shaking, it ensures a lightweight and efficient final bundle. 🚀
Usage
All functions can be imported from the package like this for example:
typescript
import { initSelect, watchInput } from '@keload/node-red-dxp/editor/dom-helper';And you benefit from tree-shaking in the final bundle 🚀
INFO
This documentation is automatically generated from the source code.
Functions
| Function | Description |
|---|---|
| addClassesOnSelectors | Adds the specified CSS classes to multiple DOM elements. |
| applyTypedInput | Applies a typed input widget to a DOM element. |
| getFormValues | Retrieves values from form inputs within a specific prefix in their id. |
| handleAddRemoveClassesOnSelectors | Handles adding or removing CSS classes on multiple DOM elements based on the specified action. |
| initSelect | Initializes a <select> element with the given options. |
| initTabs | Initializes a tab system with the provided configuration and handles tab switching behavior. This function creates a set of tabs and associates them with a specified container. It also sets an initial active tab and switches between tabs when a tab is clicked. |
| isCheckboxChecked | Checks whether a checkbox is checked based on a CSS selector. |
| isNodeInput | Checks if a given selector is a node input selector. |
| jqSelector | Resolves a given selector string into a jQuery object based on predefined rules. |
| removeClassesOnSelectors | Removes the specified CSS classes from multiple DOM elements. |
| resolveInputKey | Extracts the key part from a resolved input selector. |
| resolveSelector | Resolves a selector string into a specific format based on predefined rules. |
| setFormValues | Sets values into form inputs identified by a specific prefix in their id. |
| setInputValue | Sets the value of an input element. |
| setText | Sets the text content of a DOM element. |
| watchInput | Watches for changes on input elements and triggers a callback with the updated values. |