Releases: atomicojs/hooks
Releases · atomicojs/hooks
useClickCoordinates
This hook captures the click event coordinates (Touch) and gives a callback in the following format:
interface Point {
x: number;
y: number;
offset: {
x: number;
y: number;
};
}Where :
- x: MouseEvent.clientX
- y: MouseEvent.clientY
- offset.x : MouseEvent.offsetX
- offset.Y : MouseEvent.offsetY
Module
import { useClickCoordinates } from "@atomico/hooks/use-click-coordinates";Syntax
useClickCoordinates(ref, handlerClick);fix use-debounce-state
fixed status updater
fix use-css-light-dom
Remove the reading of locaName to build the selector
Add the hook useDisabled and useCss
useDisabled
Inherit the disabled status of a fieldset tag, under certain rules:
- the tag must be in the lightDOM
- the component that uses this hook must declare the prop disabled
Import
import { useDisabled } from "@atomico/hooks/use-disabled";Syntax
const disabled:boolean = useDisabled();useCss
Inject in tag style in shadowRoot with content given as parameter to useCss
Import
import { useCss } from "@atomico/hooks/use-css";Syntax
useCss(cssText: string);the hook useParentPath is added
This hook creates a list with the parents of the component in ascending order:
Import
import { useParentPath } from "@atomico/hooks/use-parent";Syntax
const path = useParentPath(composed?: boolean);check if the reference for current has been defined
This avoids errors by not relating the reference
Change the behavior of useFormValue
useFormValue
Improves the experience of forms with webcomponents in lightDOM and ShadowDOM situations
const [value, setValue] = useFormValue();Where:
- value : represents the inherited value of the form
- setValue: create a hidden input layers to define a value in the form
fix argument for using FormData
3.12.5 fix useFormData target
use formData for form capture
3.12.4 use formData for form capture
Improves value capture for useFormValue
3.12.3 improves value capture for useFormValue