Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

formula-one

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formula-one - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

dist/test/Field.test.js

8

dist/index.js

@@ -6,3 +6,3 @@ "use strict";

});
exports.TestUtils = exports.makeField = exports.ErrorsHelper = exports.ArrayField = exports.ObjectField = exports.Form = undefined;
exports.TestUtils = exports.Field = exports.ErrorsHelper = exports.ArrayField = exports.ObjectField = exports.Form = undefined;

@@ -45,8 +45,8 @@ var _Form = require("./Form");

var _makeField = require("./makeField");
var _Field = require("./Field");
Object.defineProperty(exports, "makeField", {
Object.defineProperty(exports, "Field", {
enumerable: true,
get: function get() {
return _interopRequireDefault(_makeField).default;
return _interopRequireDefault(_Field).default;
}

@@ -53,0 +53,0 @@ });

@@ -14,5 +14,5 @@ "use strict";

var _makeField = require("../makeField");
var _Field = require("../Field");
var _makeField2 = _interopRequireDefault(_makeField);
var _Field2 = _interopRequireDefault(_Field);

@@ -58,2 +58,37 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = (0, _makeField2.default)(TestInput);
var TestField = function (_React$Component2) {
_inherits(TestField, _React$Component2);
function TestField() {
_classCallCheck(this, TestField);
return _possibleConstructorReturn(this, (TestField.__proto__ || Object.getPrototypeOf(TestField)).apply(this, arguments));
}
_createClass(TestField, [{
key: "render",
value: function render() {
return React.createElement(
_Field2.default,
{ link: this.props.link, validation: this.props.validation },
function (value, errors, onChange, onBlur) {
return React.createElement(TestInput, {
value: value,
errors: errors,
onChange: onChange,
onBlur: onBlur
});
}
);
}
}]);
return TestField;
}(React.Component);
TestField.defaultProps = {
validation: function validation() {
return [];
}
};
exports.default = TestField;
{
"name": "formula-one",
"version": "0.1.1",
"version": "0.2.0",
"description": "Strongly-typed React form state management",

@@ -5,0 +5,0 @@ "author": "Zach Gotsch",

@@ -8,3 +8,3 @@ // @flow strict

export {default as ErrorsHelper} from "./ErrorsHelper";
export {default as makeField} from "./makeField";
export {default as Field} from "./Field";

@@ -11,0 +11,0 @@ export type {FeedbackStrategy} from "./Form";

import * as React from "react";
import makeField from "../makeField";
import Field from "../Field";

@@ -22,2 +22,26 @@ export class TestInput extends React.Component<{|

export default makeField(TestInput);
type Props = {|
link: FieldLink<T>,
validation: Validation<T>,
|};
export default class TestField extends React.Component<Props> {
static defaultProps = {
validation: () => [],
};
render() {
return (
<Field link={this.props.link} validation={this.props.validation}>
{(value, errors, onChange, onBlur) => (
<TestInput
value={value}
errors={errors}
onChange={onChange}
onBlur={onBlur}
/>
)}
</Field>
);
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc