Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-field-form",
"version": "2.7.0",
"name": "@rc-component/form",
"version": "1.0.0",
"description": "React Form Component",
"typings": "es/index.d.ts",
"engines": {
Expand Down Expand Up @@ -51,7 +51,7 @@
"dependencies": {
"@babel/runtime": "^7.18.0",
"@rc-component/async-validator": "^5.0.3",
"rc-util": "^5.32.2"
"@rc-component/util": "^1.1.0"
},
"devDependencies": {
"@rc-component/father-plugin": "^1.0.0",
Expand Down
15 changes: 5 additions & 10 deletions src/Field.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import toChildrenArray from 'rc-util/lib/Children/toArray';
import isEqual from 'rc-util/lib/isEqual';
import warning from 'rc-util/lib/warning';
import toChildrenArray from '@rc-component/util/lib/Children/toArray';
import isEqual from '@rc-component/util/lib/isEqual';
import warning from '@rc-component/util/lib/warning';
import * as React from 'react';
import FieldContext, { HOOK_MARK } from './FieldContext';
import type {
Expand Down Expand Up @@ -112,11 +112,6 @@ export interface FieldState {
class Field extends React.Component<InternalFieldProps, FieldState> implements FieldEntity {
public static contextType = FieldContext;

public static defaultProps = {
trigger: 'onChange',
valuePropName: 'value',
};

public state = {
resetCount: 0,
};
Expand Down Expand Up @@ -566,11 +561,11 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
public getControlled = (childProps: ChildProps = {}) => {
const {
name,
trigger,
trigger = 'onChange',
validateTrigger,
getValueFromEvent,
normalize,
valuePropName,
valuePropName = 'value',
getValueProps,
fieldContext,
} = this.props;
Expand Down
2 changes: 1 addition & 1 deletion src/FieldContext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import warning from 'rc-util/lib/warning';
import warning from '@rc-component/util/lib/warning';
import * as React from 'react';
import type { InternalFormInstance } from './interface';

Expand Down
2 changes: 1 addition & 1 deletion src/List.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import warning from 'rc-util/lib/warning';
import warning from '@rc-component/util/lib/warning';
import type { InternalNamePath, NamePath, StoreValue, ValidatorRule, Meta } from './interface';
import FieldContext from './FieldContext';
import Field from './Field';
Expand Down
4 changes: 2 additions & 2 deletions src/useForm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { merge } from 'rc-util/lib/utils/set';
import warning from 'rc-util/lib/warning';
import { merge } from '@rc-component/util/lib/utils/set';
import warning from '@rc-component/util/lib/warning';
import * as React from 'react';
import { HOOK_MARK } from './FieldContext';
import type {
Expand Down
2 changes: 1 addition & 1 deletion src/useWatch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import warning from 'rc-util/lib/warning';
import warning from '@rc-component/util/lib/warning';
import { useContext, useEffect, useMemo, useRef, useState } from 'react';
import FieldContext, { HOOK_MARK } from './FieldContext';
import type {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/validateUtil.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import RawAsyncValidator from '@rc-component/async-validator';
import * as React from 'react';
import warning from 'rc-util/lib/warning';
import warning from '@rc-component/util/lib/warning';
import type {
InternalNamePath,
InternalValidateOptions,
Expand All @@ -9,7 +9,7 @@ import type {
RuleError,
} from '../interface';
import { defaultValidateMessages } from './messages';
import { merge } from 'rc-util/lib/utils/set';
import { merge } from '@rc-component/util/lib/utils/set';

// Remove incorrect original ts define
const AsyncValidator: any = RawAsyncValidator;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/valueUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getValue from 'rc-util/lib/utils/get';
import setValue from 'rc-util/lib/utils/set';
import getValue from '@rc-component/util/lib/utils/get';
import setValue from '@rc-component/util/lib/utils/set';
import type { InternalNamePath, NamePath, Store, EventArgs } from '../interface';
import { toArray } from './typeUtil';

Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { act, fireEvent, render } from '@testing-library/react';
import { resetWarned } from 'rc-util/lib/warning';
import { resetWarned } from '@rc-component/util/lib/warning';
import React from 'react';
import type { FormInstance } from '../src';
import Form, { Field, useForm } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/initialValue.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { act, fireEvent, render } from '@testing-library/react';
import { resetWarned } from 'rc-util/lib/warning';
import { resetWarned } from '@rc-component/util/lib/warning';
import React, { useState } from 'react';
import Form, { Field, List, useForm, type FormInstance } from '../src';
import { changeValue, getInput } from './common';
Expand Down
2 changes: 1 addition & 1 deletion tests/list.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { fireEvent, render, act } from '@testing-library/react';
import { resetWarned } from 'rc-util/lib/warning';
import { resetWarned } from '@rc-component/util/lib/warning';
import Form, { Field, List } from '../src';
import type { FormProps } from '../src';
import type { ListField, ListOperations, ListProps } from '../src/List';
Expand Down
Loading