UNPKG

react-proforma

Version:

React Proforma helps you build simple to complex web forms with ease in React. -- Simplicity where you want it. Flexibility where you need it.

51 lines (50 loc) 2.58 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importDefault(require("react")); var ProformaContext_1 = require("./ProformaContext"); function Debug(props) { var _a = react_1.default.useContext(ProformaContext_1.ProformaContext), values = _a.values, errors = _a.errors, touched = _a.touched; return (react_1.default.createElement("div", { className: "react-proforma-debug", style: { margin: '20px 0', padding: '10px', border: '3px solid #2c3e50', borderRadius: '10px', boxShadow: '1px 1px 3px #7b7b80', backgroundColor: '#dedee3', maxWidth: '800px', fontFamily: 'Arial, Helvetica, sans-serif' } }, react_1.default.createElement("h3", { style: { margin: '10px 0 15px 0', textShadow: '0.3px 0.3px #919191', color: '#2c3e50' } }, "-- React-Proforma Debug --"), react_1.default.createElement("div", { style: { border: '1px solid #2c3e50', borderRadius: '10px', marginBottom: '10px', padding: '10px 5px' } }, react_1.default.createElement("h4", { style: { margin: '3px 0 5px 0' } }, "Values"), react_1.default.createElement("pre", { style: { margin: '0', fontSize: '1.2rem' } }, JSON.stringify(values, null, 2))), react_1.default.createElement("div", { style: { border: '1px solid #2c3e50', borderRadius: '10px', marginBottom: '10px', padding: '10px 5px' } }, react_1.default.createElement("h4", { style: { margin: '3px 0 5px 0' } }, "Errors"), react_1.default.createElement("pre", { style: { margin: '0', fontSize: '1.2rem' } }, JSON.stringify(errors, null, 2))), react_1.default.createElement("div", { style: { border: '1px solid #2c3e50', borderRadius: '10px', marginBottom: '10px', padding: '10px 5px' } }, react_1.default.createElement("h4", { style: { margin: '3px 0 5px 0' } }, "Touched"), react_1.default.createElement("pre", { style: { margin: '0', fontSize: '1.2rem' } }, JSON.stringify(touched, null, 2))))); } exports.Debug = Debug;