@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
23 lines (22 loc) • 761 B
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { emptyStringByArrayHandler, objectObjectHandler, parseJson, setState } from "../utils";
export const validateTableData = (component, value, setStateHooks) => {
emptyStringByArrayHandler(value, () => {
objectObjectHandler(value, () => {
if (typeof value === 'undefined') {
value = [];
}
try {
value = parseJson(value);
}
catch (_a) {
}
if (Array.isArray(value) && value.every((data) => typeof data === 'object' && data !== null)) {
setState(component, '_data', value, setStateHooks);
}
});
});
};
//# sourceMappingURL=table-data.js.map