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