🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@rc-component/form

Package Overview
Dependencies
Maintainers
5
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rc-component/form - npm Package Compare versions

Comparing version
1.8.4
to
1.8.5
+1
-1
es/Field.js

@@ -24,3 +24,3 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

// We use Class instead of Hooks here since it will cost much code by using Hooks.
class Field extends React.Component {
class Field extends React.PureComponent {
static contextType = FieldContext;

@@ -27,0 +27,0 @@ state = {

@@ -9,3 +9,3 @@ import * as React from 'react';

children?: RenderProps | React.ReactNode;
component?: false | string | React.FC<any> | React.ComponentClass<any>;
component?: false | string | React.ComponentType<any>;
fields?: FieldData[];

@@ -12,0 +12,0 @@ name?: string;

@@ -8,19 +8,20 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import ListContext from "./ListContext";
const Form = ({
name,
initialValues,
fields,
form,
preserve,
children,
component: Component = 'form',
validateMessages,
validateTrigger = 'onChange',
onValuesChange,
onFieldsChange,
onFinish,
onFinishFailed,
clearOnDestroy,
...restProps
}, ref) => {
const Form = (props, ref) => {
const {
name,
initialValues,
fields,
form,
preserve,
children,
component: Component = 'form',
validateMessages,
validateTrigger = 'onChange',
onValuesChange,
onFieldsChange,
onFinish,
onFinishFailed,
clearOnDestroy,
...restProps
} = props;
const nativeElementRef = React.useRef(null);

@@ -27,0 +28,0 @@ const formContext = React.useContext(FormContext);

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

// We use Class instead of Hooks here since it will cost much code by using Hooks.
class Field extends React.Component {
class Field extends React.PureComponent {
static contextType = _FieldContext.default;

@@ -36,0 +36,0 @@ state = {

@@ -9,3 +9,3 @@ import * as React from 'react';

children?: RenderProps | React.ReactNode;
component?: false | string | React.FC<any> | React.ComponentClass<any>;
component?: false | string | React.ComponentType<any>;
fields?: FieldData[];

@@ -12,0 +12,0 @@ name?: string;

@@ -17,19 +17,20 @@ "use strict";

function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
const Form = ({
name,
initialValues,
fields,
form,
preserve,
children,
component: Component = 'form',
validateMessages,
validateTrigger = 'onChange',
onValuesChange,
onFieldsChange,
onFinish,
onFinishFailed,
clearOnDestroy,
...restProps
}, ref) => {
const Form = (props, ref) => {
const {
name,
initialValues,
fields,
form,
preserve,
children,
component: Component = 'form',
validateMessages,
validateTrigger = 'onChange',
onValuesChange,
onFieldsChange,
onFinish,
onFinishFailed,
clearOnDestroy,
...restProps
} = props;
const nativeElementRef = React.useRef(null);

@@ -36,0 +37,0 @@ const formContext = React.useContext(_FormContext.default);

{
"name": "@rc-component/form",
"version": "1.8.4",
"version": "1.8.5",
"description": "React Form Component",

@@ -5,0 +5,0 @@ "typings": "es/index.d.ts",

@@ -124,3 +124,2 @@ # rc-field-form

};
render() {

@@ -127,0 +126,0 @@ return <Form ref={this.setRef} />;