Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix(type): placeholder #6891

Merged
merged 1 commit into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions packages/field/src/components/Digit/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { InputNumber } from 'antd';
import { isNil } from '@ant-design/pro-utils';
import React, { useCallback } from 'react';
import { InputNumber } from 'antd';
import omit from 'omit.js';
import React, { useCallback } from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/lib/input-number/style';
import { useIntl } from '@ant-design/pro-provider';
import 'antd/lib/input-number/style';
//----------------------

export type FieldDigitProps = {
text: number;
placeholder?: any;
placeholder?: string;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Money/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type FieldMoneyProps = {
/**
* 输入框内容为空的提示内容
*/
placeholder?: any;
placeholder?: string;
/**
* 自定义 money 的 Symbol
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/field/src/components/Percent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { ProFieldFC } from '../../index';
import { getColorByRealValue, getRealTextWithPrecision, getSymbolByRealValue } from './util';

// 兼容代码-----------
import 'antd/lib/input-number/style';
import { useIntl } from '@ant-design/pro-provider';
import 'antd/lib/input-number/style';
//------------

export type PercentPropInt = {
Expand All @@ -17,7 +17,7 @@ export type PercentPropInt = {
precision?: number;
showColor?: boolean;
showSymbol?: boolean | ((value: any) => boolean);
placeholder?: any;
placeholder?: string;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/field/src/components/Progress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import React, { useMemo } from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import { useIntl } from '@ant-design/pro-provider';
import 'antd/lib/input-number/style';
import 'antd/lib/progress/style';
import { useIntl } from '@ant-design/pro-provider';
//------------

export function getProgressStatus(text: number): 'success' | 'exception' | 'normal' | 'active' {
Expand All @@ -30,7 +30,7 @@ export function getProgressStatus(text: number): 'success' | 'exception' | 'norm
*/
const FieldProgress: ProFieldFC<{
text: number | string;
placeholder?: any;
placeholder?: string;
}> = ({ text, mode, render, plain, renderFormItem, fieldProps, placeholder }, ref) => {
const intl = useIntl();
const placeholderValue = placeholder || intl.getMessage('tableForm.inputPlaceholder', '请输入');
Expand Down
4 changes: 2 additions & 2 deletions packages/field/src/components/Second/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { InputNumber } from 'antd';
import React from 'react';
import type { ProFieldFC } from '../../index';
// 兼容代码-----------
import 'antd/lib/input-number/style';
import { useIntl } from '@ant-design/pro-provider';
import 'antd/lib/input-number/style';
//------------

export type FieldDigitProps = {
text: number;
placeholder?: any;
placeholder?: string;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface SearchSelectProps<T = Record<string, any>>
*
* @default 请输入关键字搜索
*/
placeholder?: any;
placeholder?: string;
/**
* 是否在输入框聚焦时触发搜索
*
Expand Down