@stimulus-library/mixins
Version:
A library of useful controllers for Stimulus
20 lines (19 loc) • 1.48 kB
TypeScript
import { Controller } from "@hotwired/stimulus";
export declare function useDirtyInputTracking(controller: Controller, element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): {
restore: () => void;
teardown: () => void;
};
export declare function useDirtyFormTracking(controller: Controller, form: HTMLFormElement): {
restore: () => void;
teardown: () => void;
};
export declare function getElementValue(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): boolean | string;
export declare function getMultiSelectLoadValues(element: HTMLSelectElement): string[];
export declare function getMultiSelectValues(element: HTMLSelectElement): string[];
export declare function getElementLoadValue(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): boolean | string;
export declare function elementHasCachedLoadValue(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): boolean;
export declare function isElementDirty(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): boolean;
export declare function restoreElementFromLoadValue(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): void;
export declare function restoreMultiSelect(element: HTMLSelectElement, cacheValue: string): void;
export declare function cacheLoadValues(element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): void;
export declare function isDirty(element: HTMLElement): boolean;