UNPKG

@react-form-builder/core

Version:

React JSON Schema Form Builder to create complex, validated, reusable forms with no deep React knowledge required

33 lines (32 loc) 943 B
import { ActionDefinition as a } from "../ActionDefinition.js"; import { closeModal as r, openModal as e } from "./modalActions.js"; import { removeRowAction as i, addRowAction as c } from "./repeaterActions.js"; const s = { // eslint-disable-next-line no-console log: a.functionalAction(console.log), validate: a.functionalAction(async (o, t) => { const n = o.store.form.componentTree; if (await n.validate(), t.failOnError === !0 && n.hasErrors) throw n.errors; }, { failOnError: "boolean" }), clear: a.functionalAction((o, t) => { o.store.form.componentTree.clear(t.clearInitialData); }, { clearInitialData: "boolean" }), reset: a.functionalAction((o, t) => { o.store.form.componentTree.reset(t.clearInitialData); }, { clearInitialData: "boolean" }), addRow: c, removeRow: i, openModal: e, closeModal: r }; export { s as commonActions }; //# sourceMappingURL=actions.js.map