mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
merge: 合并master 解决冲突
This commit is contained in:
commit
1692b5668f
@ -73,17 +73,17 @@ test('options:linkage', async () => {
|
|||||||
|
|
||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
fireEvent.click(getByText('选项1'));
|
fireEvent.click(getByText('选项1'));
|
||||||
await wait(300);
|
await wait(600);
|
||||||
|
|
||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
|
|
||||||
fireEvent.click(getByText('选项2'));
|
fireEvent.click(getByText('选项2'));
|
||||||
await wait(300);
|
await wait(600);
|
||||||
|
|
||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
|
|
||||||
fireEvent.click(getByText('选项3'));
|
fireEvent.click(getByText('选项3'));
|
||||||
await wait(300);
|
await wait(600);
|
||||||
|
|
||||||
expect(container).toMatchSnapshot();
|
expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
@ -142,6 +142,28 @@ order: 13
|
|||||||
- `month`或`months`: 月
|
- `month`或`months`: 月
|
||||||
- `year`或`years`: 年
|
- `year`或`years`: 年
|
||||||
|
|
||||||
|
### 通过公式配置默认值
|
||||||
|
|
||||||
|
> 1.7.0 及以上版本
|
||||||
|
|
||||||
|
可以通过日期公式来动态计算。
|
||||||
|
|
||||||
|
```schema: scope="body"
|
||||||
|
{
|
||||||
|
"type": "form",
|
||||||
|
"debug": true,
|
||||||
|
"api": "/api/mock2/form/saveForm",
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"type": "input-date",
|
||||||
|
"name": "date",
|
||||||
|
"label": "日期",
|
||||||
|
"value": "${DATEMODIFY(NOW(), 2, 'days')}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 限制范围
|
## 限制范围
|
||||||
|
|
||||||
可以通过配置`maxDate`和`minDate`显示可选范围
|
可以通过配置`maxDate`和`minDate`显示可选范围
|
||||||
@ -224,7 +246,7 @@ order: 13
|
|||||||
## 快捷键
|
## 快捷键
|
||||||
|
|
||||||
你也可以配置`shortcuts`属性支持快捷选择日期
|
你也可以配置`shortcuts`属性支持快捷选择日期
|
||||||
注:移动端picker的形式不支持快捷键
|
注:移动端 picker 的形式不支持快捷键
|
||||||
|
|
||||||
```schema: scope="body"
|
```schema: scope="body"
|
||||||
{
|
{
|
||||||
|
@ -179,4 +179,5 @@ order: 50
|
|||||||
| itemClassName | `string` | `` | 值元素 CSS 类名 |
|
| itemClassName | `string` | `` | 值元素 CSS 类名 |
|
||||||
| itemsClassName | `string` | `` | 值包裹元素 CSS 类名 |
|
| itemsClassName | `string` | `` | 值包裹元素 CSS 类名 |
|
||||||
| form | [Form](./index) | | 子表单配置,同 [Form](./index) |
|
| form | [Form](./index) | | 子表单配置,同 [Form](./index) |
|
||||||
| addButtonText | `string` | `` | 自定义新增一项的文本 |
|
| addButtonText | `string` | `` | 自定义新增一项的文本 |
|
||||||
|
| showErrorMsg | `boolean` | `true` | 是否在左下角显示报错信息 |
|
||||||
|
@ -31,6 +31,11 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/x-jsx">
|
<script type="text/x-jsx">
|
||||||
|
// gitee 最近特别慢
|
||||||
|
if (location.hostname === 'baidu.gitee.io') {
|
||||||
|
location.hostname = 'aisuda.bce.baidu.com';
|
||||||
|
}
|
||||||
|
|
||||||
let theme = localStorage.getItem('amis-theme') || 'cxd';
|
let theme = localStorage.getItem('amis-theme') || 'cxd';
|
||||||
if (theme === 'default') {
|
if (theme === 'default') {
|
||||||
theme = 'cxd';
|
theme = 'cxd';
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"amis-formula": "^1.3.9",
|
"amis-formula": "^1.3.10",
|
||||||
"ansi-to-react": "^6.1.6",
|
"ansi-to-react": "^6.1.6",
|
||||||
"async": "2.6.0",
|
"async": "2.6.0",
|
||||||
"attr-accept": "2.2.2",
|
"attr-accept": "2.2.2",
|
||||||
|
@ -338,7 +338,7 @@ export class Cascader extends React.Component<CascaderProps, CascaderState> {
|
|||||||
const parentTree = this.getParentTree(option, [option]);
|
const parentTree = this.getParentTree(option, [option]);
|
||||||
const scrollLeft = (parentTree.length - 2) * tabWidth;
|
const scrollLeft = (parentTree.length - 2) * tabWidth;
|
||||||
if (scrollLeft !== 0) {
|
if (scrollLeft !== 0) {
|
||||||
(this.tabsRef.current as HTMLElement).scrollTo(scrollLeft, 0);
|
(this.tabsRef.current as HTMLElement)?.scrollTo(scrollLeft, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ import {RendererProps} from '../factory';
|
|||||||
import Overlay from './Overlay';
|
import Overlay from './Overlay';
|
||||||
import {ThemeProps, themeable} from '../theme';
|
import {ThemeProps, themeable} from '../theme';
|
||||||
import {autobind, camel} from '../utils/helper';
|
import {autobind, camel} from '../utils/helper';
|
||||||
import {Icon} from '../../src';
|
|
||||||
import {
|
import {
|
||||||
MultipleValue,
|
MultipleValue,
|
||||||
Value,
|
Value,
|
||||||
@ -24,6 +23,7 @@ import {
|
|||||||
} from '../renderers/Form/InputRange';
|
} from '../renderers/Form/InputRange';
|
||||||
import {stripNumber} from '../utils/tpl-builtin';
|
import {stripNumber} from '../utils/tpl-builtin';
|
||||||
import {findDOMNode} from 'react-dom';
|
import {findDOMNode} from 'react-dom';
|
||||||
|
import {Icon} from './icons';
|
||||||
|
|
||||||
type MarksType = {
|
type MarksType = {
|
||||||
[index: number | string]: Record<
|
[index: number | string]: Record<
|
||||||
|
@ -932,7 +932,7 @@ export default class ComboControl extends React.Component<ComboProps> {
|
|||||||
removable !== false; // 是否可以删除
|
removable !== false; // 是否可以删除
|
||||||
|
|
||||||
if (!Array.isArray(value)) {
|
if (!Array.isArray(value)) {
|
||||||
return this.renderPlaceholder();
|
value = []; // 让 tabs 输出,否则会没有新增按钮。
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo 支持拖拽排序。
|
// todo 支持拖拽排序。
|
||||||
@ -987,7 +987,7 @@ export default class ComboControl extends React.Component<ComboProps> {
|
|||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{value.map((value, index) => {
|
{value.map((value: any, index: number) => {
|
||||||
const data = this.formatValue(value, index);
|
const data = this.formatValue(value, index);
|
||||||
let condition: ComboCondition | null | undefined = null;
|
let condition: ComboCondition | null | undefined = null;
|
||||||
let toolbar = undefined;
|
let toolbar = undefined;
|
||||||
|
@ -91,6 +91,11 @@ export interface SubFormControlSchema extends FormBaseControl {
|
|||||||
*/
|
*/
|
||||||
itemsClassName?: SchemaClassName;
|
itemsClassName?: SchemaClassName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否在左下角显示报错信息
|
||||||
|
*/
|
||||||
|
showErrorMsg?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子表单详情
|
* 子表单详情
|
||||||
*/
|
*/
|
||||||
@ -312,6 +317,7 @@ export default class SubFormControl extends React.PureComponent<
|
|||||||
'size',
|
'size',
|
||||||
'closeOnEsc',
|
'closeOnEsc',
|
||||||
'closeOnOutside',
|
'closeOnOutside',
|
||||||
|
'showErrorMsg',
|
||||||
'showCloseButton',
|
'showCloseButton',
|
||||||
'bodyClassName',
|
'bodyClassName',
|
||||||
'type'
|
'type'
|
||||||
|
Loading…
Reference in New Issue
Block a user