mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
Merge branch 'master' into feat-context
This commit is contained in:
commit
1a6842d9dc
3
.github/workflows/pr-test.yml
vendored
3
.github/workflows/pr-test.yml
vendored
@ -44,4 +44,7 @@ jobs:
|
|||||||
- name: test
|
- name: test
|
||||||
run: |
|
run: |
|
||||||
npm test --workspaces
|
npm test --workspaces
|
||||||
|
cd packages/ooxml-viewer
|
||||||
|
npm test
|
||||||
|
cd ../../
|
||||||
sh deploy-gh-pages.sh
|
sh deploy-gh-pages.sh
|
||||||
|
@ -675,12 +675,22 @@ Cards 模式支持 [Cards](./cards) 中的所有功能。
|
|||||||
|
|
||||||
通过设置`"autoGenerateFilter": true`开启查询区域,会根据列元素的 `searchable` 属性值,自动生成查询条件表单,只有 `searchable` 属性值为合法的组件 Schema 时才会生成查询条件。注意这个属性和 `filter` 冲突,开启 `filter` 后 `autoGenerateFilter` 将会失效。
|
通过设置`"autoGenerateFilter": true`开启查询区域,会根据列元素的 `searchable` 属性值,自动生成查询条件表单,只有 `searchable` 属性值为合法的组件 Schema 时才会生成查询条件。注意这个属性和 `filter` 冲突,开启 `filter` 后 `autoGenerateFilter` 将会失效。
|
||||||
|
|
||||||
|
### autoGenerateFilter 属性表
|
||||||
|
|
||||||
|
| 属性名 | 类型 | 默认值 | 说明 |
|
||||||
|
| -------------- | --------- | ------ | -------------------- |
|
||||||
|
| columnsNum | `number` | `3` | 过滤条件单行列数 |
|
||||||
|
| showBtnToolbar | `boolean` | `true` | 是否显示设置查询字段 |
|
||||||
|
|
||||||
```schema: scope="body"
|
```schema: scope="body"
|
||||||
{
|
{
|
||||||
"type": "crud",
|
"type": "crud",
|
||||||
"api": "/api/mock2/sample",
|
"api": "/api/mock2/sample",
|
||||||
"syncLocation": false,
|
"syncLocation": false,
|
||||||
"autoGenerateFilter": true,
|
"autoGenerateFilter": {
|
||||||
|
"columnsNum": 2,
|
||||||
|
"showBtnToolbar": false
|
||||||
|
},
|
||||||
"headerToolbar": [
|
"headerToolbar": [
|
||||||
{
|
{
|
||||||
"type": "columns-toggler",
|
"type": "columns-toggler",
|
||||||
@ -704,7 +714,7 @@ Cards 模式支持 [Cards](./cards) 中的所有功能。
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "engine",
|
"name": "engine",
|
||||||
"label": "Rendering engine"
|
"label": "Rendering engine",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "browser",
|
"name": "browser",
|
||||||
@ -2886,7 +2896,7 @@ itemAction 里的 onClick 还能通过 `data` 参数拿到当前行的数据,
|
|||||||
| footerToolbar | Array | `['statistics', 'pagination']` | 底部工具栏配置 |
|
| footerToolbar | Array | `['statistics', 'pagination']` | 底部工具栏配置 |
|
||||||
| alwaysShowPagination | `boolean` | `false` | 是否总是显示分页 |
|
| alwaysShowPagination | `boolean` | `false` | 是否总是显示分页 |
|
||||||
| affixHeader | `boolean` | `true` | 是否固定表头(table 下) |
|
| affixHeader | `boolean` | `true` | 是否固定表头(table 下) |
|
||||||
| autoGenerateFilter | `boolean` | `false` | 是否开启查询区域,开启后会根据列元素的 `searchable` 属性值,自动生成查询条件表单 |
|
| autoGenerateFilter | `Object \| boolean` | | 是否开启查询区域,开启后会根据列元素的 `searchable` 属性值,自动生成查询条件表单 |
|
||||||
| resetPageAfterAjaxItemAction | `boolean` | `false` | 单条数据 ajax 操作后是否重置页码为第一页 |
|
| resetPageAfterAjaxItemAction | `boolean` | `false` | 单条数据 ajax 操作后是否重置页码为第一页 |
|
||||||
| autoFillHeight | `boolean` 丨 `{height: number}` | | 内容区域自适应高度 |
|
| autoFillHeight | `boolean` 丨 `{height: number}` | | 内容区域自适应高度 |
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ Dialog 弹框 主要由 [Action](./action) 触发,主要展示一个对话框
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 行为后关闭弹框
|
## 动作后关闭弹框
|
||||||
|
|
||||||
在弹框中配置行为按钮,可以在按钮上配置`"close": true`,在行为完成后,关闭当前弹框。
|
在弹框中配置行为按钮,可以在按钮上配置`"close": true`,在行为完成后,关闭当前弹框。
|
||||||
|
|
||||||
@ -357,9 +357,49 @@ Dialog 弹框 主要由 [Action](./action) 触发,主要展示一个对话框
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
以上例子是关闭当前弹窗,如果希望关闭上层弹窗,则需要给目标弹窗设置 `name` 属性,然后配置按钮 `close` 属性为目标 `name` 属性如:
|
||||||
|
|
||||||
|
```schema: scope="body"
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "多级弹框",
|
||||||
|
"actionType": "dialog",
|
||||||
|
"dialog": {
|
||||||
|
"title": "提示",
|
||||||
|
"body": "这是个简单的弹框",
|
||||||
|
"name": "dialog_1",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "confirm",
|
||||||
|
"label": "确认",
|
||||||
|
"primary": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "dialog",
|
||||||
|
"label": "再弹一个",
|
||||||
|
"dialog": {
|
||||||
|
"title": "弹框中的弹框",
|
||||||
|
"body": "关闭当前弹窗的时候把外层的弹窗一起关了",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "关闭所有",
|
||||||
|
"level": "info",
|
||||||
|
"close": "dialog_1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 配置弹窗的按钮
|
## 配置弹窗的按钮
|
||||||
|
|
||||||
可以通过设置 `actions` 来控制弹窗中的按钮。
|
默认弹窗会自动生成两个按钮,一个取消,一个确认。如果通过 `actions` 来自定义配置,则以配置的为准。
|
||||||
|
|
||||||
```schema: scope="body"
|
```schema: scope="body"
|
||||||
{
|
{
|
||||||
|
@ -279,6 +279,164 @@ order: 43
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 多级弹框
|
||||||
|
|
||||||
|
```schema: scope="body"
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "多级弹框",
|
||||||
|
"actionType": "drawer",
|
||||||
|
"drawer": {
|
||||||
|
"title": "提示",
|
||||||
|
"body": "这是个简单的弹框",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "confirm",
|
||||||
|
"label": "确认",
|
||||||
|
"primary": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "drawer",
|
||||||
|
"label": "再弹一个",
|
||||||
|
"drawer": {
|
||||||
|
"title": "弹框中的弹框",
|
||||||
|
"body": "如果你想,可以无限弹下去",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "drawer",
|
||||||
|
"label": "来吧",
|
||||||
|
"level": "info",
|
||||||
|
"drawer": {
|
||||||
|
"title": "弹框中的弹框",
|
||||||
|
"body": "如果你想,可以无限弹下去",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "confirm",
|
||||||
|
"label": "不弹了",
|
||||||
|
"primary": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 动作后关闭弹框
|
||||||
|
|
||||||
|
在弹框中配置行为按钮,可以在按钮上配置`"close": true`,在行为完成后,关闭当前弹框。
|
||||||
|
|
||||||
|
```schema: scope="body"
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "弹个框",
|
||||||
|
"actionType": "drawer",
|
||||||
|
"drawer": {
|
||||||
|
"title": "弹框",
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "默认的 ajax 请求",
|
||||||
|
"actionType": "ajax",
|
||||||
|
"api": "/api/mock2/form/saveForm?waitSeconds=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "ajax 请求成功后关闭弹框",
|
||||||
|
"actionType": "ajax",
|
||||||
|
"api": "/api/mock2/form/saveForm?waitSeconds=1",
|
||||||
|
"close": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
以上例子是关闭当前弹窗,如果希望关闭上层弹窗,则需要给目标弹窗设置 `name` 属性,然后配置按钮 `close` 属性为目标 `name` 属性如:
|
||||||
|
|
||||||
|
```schema: scope="body"
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "多级弹框",
|
||||||
|
"actionType": "drawer",
|
||||||
|
"drawer": {
|
||||||
|
"title": "提示",
|
||||||
|
"body": "这是个简单的弹框",
|
||||||
|
"name": "drawer_1",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "confirm",
|
||||||
|
"label": "确认",
|
||||||
|
"primary": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "drawer",
|
||||||
|
"label": "再弹一个",
|
||||||
|
"drawer": {
|
||||||
|
"title": "弹框中的弹框",
|
||||||
|
"body": "关闭当前弹窗的时候把外层的弹窗一起关了",
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "关闭所有",
|
||||||
|
"level": "info",
|
||||||
|
"close": "drawer_1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 配置弹窗的按钮
|
||||||
|
|
||||||
|
默认弹窗会自动生成两个按钮,一个取消,一个确认。如果通过 `actions` 来自定义配置,则以配置的为准。
|
||||||
|
|
||||||
|
```schema: scope="body"
|
||||||
|
{
|
||||||
|
"type": "button-toolbar",
|
||||||
|
"buttons": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "无按钮",
|
||||||
|
"actionType": "dialog",
|
||||||
|
"dialog": {
|
||||||
|
"title": "提示",
|
||||||
|
"actions": [],
|
||||||
|
"body": "无按钮的弹框"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"label": "只有一个确认按钮",
|
||||||
|
"actionType": "dialog",
|
||||||
|
"dialog": {
|
||||||
|
"title": "提示",
|
||||||
|
"actions": [{
|
||||||
|
"type": "button",
|
||||||
|
"actionType": "confirm",
|
||||||
|
"label": "OK",
|
||||||
|
"primary": true
|
||||||
|
}],
|
||||||
|
"body": "只有一个 OK 的弹框"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 属性表
|
## 属性表
|
||||||
|
|
||||||
| 属性名 | 类型 | 默认值 | 说明 |
|
| 属性名 | 类型 | 默认值 | 说明 |
|
||||||
|
@ -270,13 +270,13 @@ export const defaultOptions: RenderOptions = {
|
|||||||
},
|
},
|
||||||
isCancel() {
|
isCancel() {
|
||||||
console.error(
|
console.error(
|
||||||
'Please implement isCancel. see https://baidu.gitee.io/amis/docs/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97'
|
'Please implement isCancel. see https://aisuda.bce.baidu.com/amis/zh-CN/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97'
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
updateLocation() {
|
updateLocation() {
|
||||||
console.error(
|
console.error(
|
||||||
'Please implement updateLocation. see https://baidu.gitee.io/amis/docs/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97'
|
'Please implement updateLocation. see https://aisuda.bce.baidu.com/amis/zh-CN/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ export interface FormSchemaBase {
|
|||||||
/**
|
/**
|
||||||
* Form 用来保存数据的 api。
|
* Form 用来保存数据的 api。
|
||||||
*
|
*
|
||||||
* 详情:https://baidu.gitee.io/amis/docs/components/form/index#%E8%A1%A8%E5%8D%95%E6%8F%90%E4%BA%A4
|
* 详情:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/index#%E8%A1%A8%E5%8D%95%E6%8F%90%E4%BA%A4
|
||||||
*/
|
*/
|
||||||
api?: string | BaseApiObject;
|
api?: string | BaseApiObject;
|
||||||
|
|
||||||
|
@ -431,13 +431,14 @@ type Category = 'api' | 'event';
|
|||||||
* @param ext 扩展信息
|
* @param ext 扩展信息
|
||||||
*/
|
*/
|
||||||
export function debug(cat: Category, msg: string, ext?: object) {
|
export function debug(cat: Category, msg: string, ext?: object) {
|
||||||
|
if (!isEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
console.groupCollapsed('[amis debug]', msg);
|
console.groupCollapsed('[amis debug]', msg);
|
||||||
console.debug(ext);
|
console.debug(ext);
|
||||||
console.groupEnd();
|
console.groupEnd();
|
||||||
|
|
||||||
if (!isEnabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const log = {
|
const log = {
|
||||||
cat,
|
cat,
|
||||||
level: 'debug',
|
level: 'debug',
|
||||||
|
@ -475,7 +475,7 @@ export default class Editor extends Component<EditorProps> {
|
|||||||
|
|
||||||
preview() {
|
preview() {
|
||||||
if (this.props.onPreview) {
|
if (this.props.onPreview) {
|
||||||
this.props.onPreview(true);
|
this.props.onPreview(!this.props.preview);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,9 +53,9 @@ const ShortcutKeyList = [
|
|||||||
tooltip: '保存当前所有操作'
|
tooltip: '保存当前所有操作'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预览',
|
title: '预览/编辑',
|
||||||
letters: ['⌘', 'p'],
|
letters: ['⌘', 'p'],
|
||||||
tooltip: '开启预览模式'
|
tooltip: '开启/关闭预览模式'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '删除',
|
title: '删除',
|
||||||
|
@ -121,6 +121,7 @@ export function registerEditorPlugin(klass: PluginClass) {
|
|||||||
isExitPlugin = builtInPlugins.find(item => item === klass);
|
isExitPlugin = builtInPlugins.find(item => item === klass);
|
||||||
}
|
}
|
||||||
if (!isExitPlugin) {
|
if (!isExitPlugin) {
|
||||||
|
klass.id = klass.id || klass.name || guid();
|
||||||
builtInPlugins.push(klass);
|
builtInPlugins.push(klass);
|
||||||
} else {
|
} else {
|
||||||
console.warn(`注册插件异常,已存在同名插件:`, klass);
|
console.warn(`注册插件异常,已存在同名插件:`, klass);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Button, resolveVariable} from 'amis';
|
import {Button} from 'amis';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {registerEditorPlugin} from 'amis-editor-core';
|
import {registerEditorPlugin} from 'amis-editor-core';
|
||||||
import {
|
import {
|
||||||
@ -16,6 +16,7 @@ import {
|
|||||||
} from 'amis-editor-core';
|
} from 'amis-editor-core';
|
||||||
import {defaultValue, getSchemaTpl} from 'amis-editor-core';
|
import {defaultValue, getSchemaTpl} from 'amis-editor-core';
|
||||||
import {diff, JSONPipeOut, repeatArray} from 'amis-editor-core';
|
import {diff, JSONPipeOut, repeatArray} from 'amis-editor-core';
|
||||||
|
import {resolveArrayDatasource} from '../util';
|
||||||
|
|
||||||
export class CardsPlugin extends BasePlugin {
|
export class CardsPlugin extends BasePlugin {
|
||||||
static scene = ['layout'];
|
static scene = ['layout'];
|
||||||
@ -252,11 +253,11 @@ export class CardsPlugin extends BasePlugin {
|
|||||||
...props.defaultData,
|
...props.defaultData,
|
||||||
...props.data
|
...props.data
|
||||||
};
|
};
|
||||||
const arr = Array.isArray(props.value)
|
const arr = resolveArrayDatasource({
|
||||||
? props.value
|
value: props.value,
|
||||||
: typeof props.source === 'string'
|
data,
|
||||||
? resolveVariable(props.source, data)
|
source: props.source
|
||||||
: resolveVariable('items', data);
|
});
|
||||||
|
|
||||||
if (!Array.isArray(arr) || !arr.length) {
|
if (!Array.isArray(arr) || !arr.length) {
|
||||||
const mockedData: any = {
|
const mockedData: any = {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {resolveVariable, Button} from 'amis';
|
import {Button} from 'amis';
|
||||||
import {
|
import {
|
||||||
registerEditorPlugin,
|
registerEditorPlugin,
|
||||||
BaseEventContext,
|
BaseEventContext,
|
||||||
@ -25,6 +25,7 @@ import {
|
|||||||
getArgsWrapper
|
getArgsWrapper
|
||||||
} from '../../renderer/event-control/helper';
|
} from '../../renderer/event-control/helper';
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
|
import {resolveArrayDatasource} from '../../util';
|
||||||
|
|
||||||
export class TableControlPlugin extends BasePlugin {
|
export class TableControlPlugin extends BasePlugin {
|
||||||
// 关联渲染器名字
|
// 关联渲染器名字
|
||||||
@ -791,11 +792,7 @@ export class TableControlPlugin extends BasePlugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
filterProps(props: any) {
|
filterProps(props: any) {
|
||||||
const arr = Array.isArray(props.value)
|
const arr = resolveArrayDatasource(props);
|
||||||
? props.value
|
|
||||||
: typeof props.source === 'string'
|
|
||||||
? resolveVariable(props.source, props.data)
|
|
||||||
: resolveVariable('items', props.data);
|
|
||||||
|
|
||||||
if (!Array.isArray(arr) || !arr.length) {
|
if (!Array.isArray(arr) || !arr.length) {
|
||||||
const mockedData: any = {};
|
const mockedData: any = {};
|
||||||
|
@ -118,11 +118,7 @@ export class ListControlPlugin extends BasePlugin {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
option: {
|
option: {
|
||||||
body: [
|
body: [getSchemaTpl('optionControlV2')]
|
||||||
getSchemaTpl('optionControlV2', {
|
|
||||||
description: '设置选项后,输入时会下拉这些选项供用户参考。'
|
|
||||||
})
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
status: {}
|
status: {}
|
||||||
},
|
},
|
||||||
|
@ -85,14 +85,13 @@ export class ImagesPlugin extends BasePlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
getSchemaTpl('sourceBindControl', {
|
||||||
name: 'source',
|
label: tipedLabel(
|
||||||
type: 'input-text',
|
'关联数据',
|
||||||
label: '关联数据',
|
'比如:\\${listVar},用来关联作用域中的已有数据'
|
||||||
description:
|
),
|
||||||
'比如:\\${listVar},用来关联作用域中的已有数据。',
|
|
||||||
visibleOn: 'this.__mode == 1'
|
visibleOn: 'this.__mode == 1'
|
||||||
},
|
}),
|
||||||
{
|
{
|
||||||
type: 'combo',
|
type: 'combo',
|
||||||
name: 'options',
|
name: 'options',
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Button, resolveVariable} from 'amis';
|
import {Button} from 'amis';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {getI18nEnabled, registerEditorPlugin} from 'amis-editor-core';
|
import {getI18nEnabled, registerEditorPlugin} from 'amis-editor-core';
|
||||||
import {
|
import {
|
||||||
@ -13,7 +13,11 @@ import {
|
|||||||
} from 'amis-editor-core';
|
} from 'amis-editor-core';
|
||||||
import {defaultValue, getSchemaTpl} from 'amis-editor-core';
|
import {defaultValue, getSchemaTpl} from 'amis-editor-core';
|
||||||
import {diff, JSONPipeOut, repeatArray} from 'amis-editor-core';
|
import {diff, JSONPipeOut, repeatArray} from 'amis-editor-core';
|
||||||
import {schemaArrayFormat, schemaToArray} from '../util';
|
import {
|
||||||
|
schemaArrayFormat,
|
||||||
|
resolveArrayDatasource,
|
||||||
|
schemaToArray
|
||||||
|
} from '../util';
|
||||||
|
|
||||||
export class ListPlugin extends BasePlugin {
|
export class ListPlugin extends BasePlugin {
|
||||||
// 关联渲染器名字
|
// 关联渲染器名字
|
||||||
@ -90,13 +94,9 @@ export class ListPlugin extends BasePlugin {
|
|||||||
},
|
},
|
||||||
isCRUDBody
|
isCRUDBody
|
||||||
? null
|
? null
|
||||||
: {
|
: getSchemaTpl('sourceBindControl', {
|
||||||
name: 'source',
|
label: '数据源'
|
||||||
type: 'input-text',
|
}),
|
||||||
label: '数据源',
|
|
||||||
pipeIn: defaultValue('${items}'),
|
|
||||||
description: '绑定当前环境变量'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'placeholder',
|
name: 'placeholder',
|
||||||
pipeIn: defaultValue('没有数据'),
|
pipeIn: defaultValue('没有数据'),
|
||||||
@ -192,11 +192,11 @@ export class ListPlugin extends BasePlugin {
|
|||||||
...props.defaultData,
|
...props.defaultData,
|
||||||
...props.data
|
...props.data
|
||||||
};
|
};
|
||||||
let arr = Array.isArray(props.value)
|
const arr = resolveArrayDatasource({
|
||||||
? props.value
|
value: props.value,
|
||||||
: typeof props.source === 'string'
|
data,
|
||||||
? resolveVariable(props.source, data)
|
source: props.source
|
||||||
: resolveVariable('items', data);
|
});
|
||||||
|
|
||||||
if (!Array.isArray(arr) || !arr.length) {
|
if (!Array.isArray(arr) || !arr.length) {
|
||||||
const mockedData: any = this.buildMockData();
|
const mockedData: any = this.buildMockData();
|
||||||
|
@ -27,7 +27,7 @@ import {
|
|||||||
getEventControlConfig,
|
getEventControlConfig,
|
||||||
getArgsWrapper
|
getArgsWrapper
|
||||||
} from '../renderer/event-control/helper';
|
} from '../renderer/event-control/helper';
|
||||||
import {schemaArrayFormat, schemaToArray} from '../util';
|
import {schemaArrayFormat, schemaToArray, resolveArrayDatasource} from '../util';
|
||||||
|
|
||||||
export class TablePlugin extends BasePlugin {
|
export class TablePlugin extends BasePlugin {
|
||||||
// 关联渲染器名字
|
// 关联渲染器名字
|
||||||
@ -596,11 +596,7 @@ export class TablePlugin extends BasePlugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
filterProps(props: any) {
|
filterProps(props: any) {
|
||||||
const arr = Array.isArray(props.value)
|
const arr = resolveArrayDatasource(props);
|
||||||
? props.value
|
|
||||||
: typeof props.source === 'string'
|
|
||||||
? resolveVariable(props.source, props.data)
|
|
||||||
: resolveVariable('items', props.data);
|
|
||||||
|
|
||||||
if (!Array.isArray(arr) || !arr.length) {
|
if (!Array.isArray(arr) || !arr.length) {
|
||||||
const mockedData: any = {};
|
const mockedData: any = {};
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import {resolveVariable} from 'amis';
|
|
||||||
|
|
||||||
import {setVariable, someTree} from 'amis-core';
|
import {setVariable, someTree} from 'amis-core';
|
||||||
import {
|
import {
|
||||||
BasePlugin,
|
BasePlugin,
|
||||||
@ -26,6 +24,7 @@ import {
|
|||||||
getArgsWrapper
|
getArgsWrapper
|
||||||
} from '../renderer/event-control/helper';
|
} from '../renderer/event-control/helper';
|
||||||
import type {SchemaObject} from 'amis';
|
import type {SchemaObject} from 'amis';
|
||||||
|
import {resolveArrayDatasource} from '../util';
|
||||||
|
|
||||||
export class Table2Plugin extends BasePlugin {
|
export class Table2Plugin extends BasePlugin {
|
||||||
// 关联渲染器名字
|
// 关联渲染器名字
|
||||||
@ -838,11 +837,7 @@ export class Table2Plugin extends BasePlugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
filterProps(props: any) {
|
filterProps(props: any) {
|
||||||
const arr = Array.isArray(props.value)
|
const arr = resolveArrayDatasource(props);
|
||||||
? props.value
|
|
||||||
: typeof props.source === 'string'
|
|
||||||
? resolveVariable(props.source, props.data)
|
|
||||||
: resolveVariable('items', props.data);
|
|
||||||
|
|
||||||
if (!Array.isArray(arr) || !arr.length) {
|
if (!Array.isArray(arr) || !arr.length) {
|
||||||
const mockedData: any = {};
|
const mockedData: any = {};
|
||||||
|
@ -189,13 +189,11 @@ export class TabsPlugin extends BasePlugin {
|
|||||||
{
|
{
|
||||||
title: '高级',
|
title: '高级',
|
||||||
body: [
|
body: [
|
||||||
getSchemaTpl('expressionFormulaControl', {
|
getSchemaTpl('sourceBindControl', {
|
||||||
evalMode: true,
|
|
||||||
label: tipedLabel(
|
label: tipedLabel(
|
||||||
'关联数据',
|
'关联数据',
|
||||||
'根据该数据来动态重复渲染所配置的选项卡'
|
'根据该数据来动态重复渲染所配置的选项卡'
|
||||||
),
|
)
|
||||||
name: 'source'
|
|
||||||
}),
|
}),
|
||||||
getSchemaTpl('switch', {
|
getSchemaTpl('switch', {
|
||||||
name: 'mountOnEnter',
|
name: 'mountOnEnter',
|
||||||
|
@ -12,7 +12,8 @@ import debounce from 'lodash/debounce';
|
|||||||
|
|
||||||
enum MapType {
|
enum MapType {
|
||||||
CUSTOM = 'custom',
|
CUSTOM = 'custom',
|
||||||
API = 'api'
|
API = 'api',
|
||||||
|
VARIABLE = 'variable'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MapSourceControlProps extends FormControlProps {
|
export interface MapSourceControlProps extends FormControlProps {
|
||||||
@ -38,7 +39,9 @@ export default class MapSourceControl extends React.Component<
|
|||||||
|
|
||||||
let mapType: MapType = MapType.CUSTOM;
|
let mapType: MapType = MapType.CUSTOM;
|
||||||
if (props.data.hasOwnProperty('source') && props.data.source) {
|
if (props.data.hasOwnProperty('source') && props.data.source) {
|
||||||
mapType = MapType.API;
|
mapType = /\$\{(.*?)\}/g.test(props.data.source)
|
||||||
|
? MapType.VARIABLE
|
||||||
|
: MapType.API;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
@ -86,7 +89,7 @@ export default class MapSourceControl extends React.Component<
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapType === MapType.API) {
|
if ([MapType.API, MapType.VARIABLE].includes(mapType)) {
|
||||||
onBulkChange &&
|
onBulkChange &&
|
||||||
onBulkChange({
|
onBulkChange({
|
||||||
source,
|
source,
|
||||||
@ -127,6 +130,10 @@ export default class MapSourceControl extends React.Component<
|
|||||||
{
|
{
|
||||||
label: '外部接口',
|
label: '外部接口',
|
||||||
value: MapType.API
|
value: MapType.API
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '上下文变量',
|
||||||
|
value: MapType.VARIABLE
|
||||||
}
|
}
|
||||||
] as Array<{
|
] as Array<{
|
||||||
label: string;
|
label: string;
|
||||||
@ -387,12 +394,25 @@ export default class MapSourceControl extends React.Component<
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {mapType} = this.state;
|
const {mapType} = this.state;
|
||||||
const {className} = this.props;
|
const {className, render} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cx('ae-OptionControl', className)}>
|
<div className={cx('ae-OptionControl', className)}>
|
||||||
{this.renderHeader()}
|
{this.renderHeader()}
|
||||||
{mapType === MapType.CUSTOM ? this.renderMap() : this.renderApiPanel()}
|
{mapType === MapType.CUSTOM ? this.renderMap() : null}
|
||||||
|
{mapType === MapType.API ? this.renderApiPanel() : null}
|
||||||
|
{mapType === MapType.VARIABLE
|
||||||
|
? render(
|
||||||
|
'variable',
|
||||||
|
getSchemaTpl('sourceBindControl', {
|
||||||
|
label: false,
|
||||||
|
className: 'ae-ExtendMore'
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
onChange: this.handleAPIChange
|
||||||
|
}
|
||||||
|
)
|
||||||
|
: null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -42,12 +42,14 @@ export interface OptionControlProps extends FormControlProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type SourceType = 'custom' | 'api' | 'apicenter' | 'variable';
|
||||||
|
|
||||||
export interface OptionControlState {
|
export interface OptionControlState {
|
||||||
options: Array<OptionControlItem>;
|
options: Array<OptionControlItem>;
|
||||||
api: SchemaApi;
|
api: SchemaApi;
|
||||||
labelField: string;
|
labelField: string;
|
||||||
valueField: string;
|
valueField: string;
|
||||||
source: 'custom' | 'api' | 'apicenter';
|
source: SourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class OptionControl extends React.Component<
|
export default class OptionControl extends React.Component<
|
||||||
@ -64,7 +66,7 @@ export default class OptionControl extends React.Component<
|
|||||||
constructor(props: OptionControlProps) {
|
constructor(props: OptionControlProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
let source: 'custom' | 'api' | 'apicenter' = 'custom';
|
let source: SourceType = 'custom';
|
||||||
|
|
||||||
if (props.data.hasOwnProperty('source') && props.data.source) {
|
if (props.data.hasOwnProperty('source') && props.data.source) {
|
||||||
const api = props.data.source;
|
const api = props.data.source;
|
||||||
@ -75,7 +77,11 @@ export default class OptionControl extends React.Component<
|
|||||||
? api.url || ''
|
? api.url || ''
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
source = !url.indexOf('api://') ? 'apicenter' : 'api';
|
source = /\$\{(.*?)\}/g.test(props.data.source)
|
||||||
|
? 'variable'
|
||||||
|
: !url.indexOf('api://')
|
||||||
|
? 'apicenter'
|
||||||
|
: 'api';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
@ -250,7 +256,7 @@ export default class OptionControl extends React.Component<
|
|||||||
data.value = defaultValue;
|
data.value = defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source === 'api' || source === 'apicenter') {
|
if (source === 'api' || source === 'apicenter' || source === 'variable') {
|
||||||
const {api, labelField, valueField} = this.state;
|
const {api, labelField, valueField} = this.state;
|
||||||
data.source = api;
|
data.source = api;
|
||||||
data.labelField = labelField || undefined;
|
data.labelField = labelField || undefined;
|
||||||
@ -337,8 +343,8 @@ export default class OptionControl extends React.Component<
|
|||||||
* 切换选项类型
|
* 切换选项类型
|
||||||
*/
|
*/
|
||||||
@autobind
|
@autobind
|
||||||
handleSourceChange(source: 'custom' | 'api' | 'apicenter') {
|
handleSourceChange(source: SourceType) {
|
||||||
this.setState({source: source}, this.onChange);
|
this.setState({api: '', source: source}, this.onChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -478,14 +484,18 @@ export default class OptionControl extends React.Component<
|
|||||||
label: '外部接口',
|
label: '外部接口',
|
||||||
value: 'api'
|
value: 'api'
|
||||||
},
|
},
|
||||||
...(hasApiCenter ? [{label: 'API中心', value: 'apicenter'}] : [])
|
...(hasApiCenter ? [{label: 'API中心', value: 'apicenter'}] : []),
|
||||||
|
{
|
||||||
|
label: '上下文变量',
|
||||||
|
value: 'variable'
|
||||||
|
}
|
||||||
// {
|
// {
|
||||||
// label: '表单实体',
|
// label: '表单实体',
|
||||||
// value: 'form'
|
// value: 'form'
|
||||||
// }
|
// }
|
||||||
] as Array<{
|
] as Array<{
|
||||||
label: string;
|
label: string;
|
||||||
value: 'custom' | 'api' | 'apicenter';
|
value: SourceType;
|
||||||
}>
|
}>
|
||||||
).map(item => ({
|
).map(item => ({
|
||||||
...item,
|
...item,
|
||||||
@ -813,9 +823,6 @@ export default class OptionControl extends React.Component<
|
|||||||
renderApiPanel() {
|
renderApiPanel() {
|
||||||
const {render} = this.props;
|
const {render} = this.props;
|
||||||
const {source, api, labelField, valueField} = this.state;
|
const {source, api, labelField, valueField} = this.state;
|
||||||
if (source === 'custom') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
'api',
|
'api',
|
||||||
@ -888,7 +895,22 @@ export default class OptionControl extends React.Component<
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{this.renderApiPanel()}
|
{source === 'api' || source === 'apicenter'
|
||||||
|
? this.renderApiPanel()
|
||||||
|
: null}
|
||||||
|
|
||||||
|
{source === 'variable'
|
||||||
|
? render(
|
||||||
|
'variable',
|
||||||
|
getSchemaTpl('sourceBindControl', {
|
||||||
|
label: false,
|
||||||
|
className: 'ae-ExtendMore'
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
onChange: this.handleAPIChange
|
||||||
|
}
|
||||||
|
)
|
||||||
|
: null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,13 @@ interface OptionControlProps extends FormControlProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SourceType = 'custom' | 'api' | 'form' | 'variable';
|
||||||
|
|
||||||
interface OptionControlState {
|
interface OptionControlState {
|
||||||
api: SchemaApi;
|
api: SchemaApi;
|
||||||
labelField: string;
|
labelField: string;
|
||||||
valueField: string;
|
valueField: string;
|
||||||
source: 'custom' | 'api' | 'form';
|
source: SourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
||||||
@ -36,7 +38,11 @@ function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
|||||||
api: props.data.source,
|
api: props.data.source,
|
||||||
labelField: props.data.labelField,
|
labelField: props.data.labelField,
|
||||||
valueField: props.data.valueField,
|
valueField: props.data.valueField,
|
||||||
source: props.data.source ? 'api' : 'custom'
|
source: props.data.source
|
||||||
|
? /\$\{(.*?)\}/g.test(props.data.source)
|
||||||
|
? 'variable'
|
||||||
|
: 'api'
|
||||||
|
: 'custom'
|
||||||
};
|
};
|
||||||
|
|
||||||
this.handleSourceChange = this.handleSourceChange.bind(this);
|
this.handleSourceChange = this.handleSourceChange.bind(this);
|
||||||
@ -60,7 +66,7 @@ function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
|||||||
valueField: undefined
|
valueField: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
if (source === 'api') {
|
if (['api', 'variable'].includes(source)) {
|
||||||
const {api, labelField, valueField} = this.state;
|
const {api, labelField, valueField} = this.state;
|
||||||
data.source = api;
|
data.source = api;
|
||||||
data.labelField = labelField || undefined;
|
data.labelField = labelField || undefined;
|
||||||
@ -74,8 +80,8 @@ function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
|||||||
/**
|
/**
|
||||||
* 切换选项类型
|
* 切换选项类型
|
||||||
*/
|
*/
|
||||||
handleSourceChange(source: 'custom' | 'api' | 'form') {
|
handleSourceChange(source: SourceType) {
|
||||||
this.setState({source: source}, this.onChange);
|
this.setState({api: '', source: source}, this.onChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleAPIChange(source: SchemaApi) {
|
handleAPIChange(source: SchemaApi) {
|
||||||
@ -158,10 +164,14 @@ function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
|||||||
{
|
{
|
||||||
label: '接口获取',
|
label: '接口获取',
|
||||||
value: 'api'
|
value: 'api'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '上下文变量',
|
||||||
|
value: 'variable'
|
||||||
}
|
}
|
||||||
] as Array<{
|
] as Array<{
|
||||||
label: string;
|
label: string;
|
||||||
value: 'custom' | 'api' | 'form';
|
value: SourceType;
|
||||||
}>
|
}>
|
||||||
).map(item => ({
|
).map(item => ({
|
||||||
...item,
|
...item,
|
||||||
@ -257,7 +267,7 @@ function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {source, api, labelField, valueField} = this.state;
|
const {source, api, labelField, valueField} = this.state;
|
||||||
const {className} = this.props;
|
const {className, render} = this.props;
|
||||||
const cmptProps = {
|
const cmptProps = {
|
||||||
...this.props,
|
...this.props,
|
||||||
data: {
|
data: {
|
||||||
@ -274,7 +284,20 @@ function BaseOptionControl(Cmpt: React.JSXElementConstructor<any>) {
|
|||||||
|
|
||||||
{source === 'custom' ? <Cmpt {...cmptProps} /> : null}
|
{source === 'custom' ? <Cmpt {...cmptProps} /> : null}
|
||||||
|
|
||||||
{this.renderApiPanel()}
|
{source === 'api' ? this.renderApiPanel() : null}
|
||||||
|
|
||||||
|
{source === 'variable'
|
||||||
|
? render(
|
||||||
|
'variable',
|
||||||
|
getSchemaTpl('sourceBindControl', {
|
||||||
|
label: false,
|
||||||
|
className: 'ae-ExtendMore'
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
onChange: this.handleAPIChange
|
||||||
|
}
|
||||||
|
)
|
||||||
|
: null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -32,13 +32,15 @@ export interface OptionControlProps extends FormControlProps {
|
|||||||
showIconField?: boolean; // 是否有图标字段
|
showIconField?: boolean; // 是否有图标字段
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type SourceType = 'custom' | 'api' | 'apicenter' | 'variable';
|
||||||
|
|
||||||
export interface OptionControlState {
|
export interface OptionControlState {
|
||||||
options: Array<OptionControlItem>;
|
options: Array<OptionControlItem>;
|
||||||
api: SchemaApi;
|
api: SchemaApi;
|
||||||
labelField: string;
|
labelField: string;
|
||||||
valueField: string;
|
valueField: string;
|
||||||
iconField: string;
|
iconField: string;
|
||||||
source: 'custom' | 'api' | 'apicenter';
|
source: SourceType;
|
||||||
modalVisible: boolean;
|
modalVisible: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,9 +68,14 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
labelField: labelField,
|
labelField: labelField,
|
||||||
valueField: valueField,
|
valueField: valueField,
|
||||||
iconField: showIconField ? iconField : undefined,
|
iconField: showIconField ? iconField : undefined,
|
||||||
source: source ? 'api' : 'custom',
|
source: source
|
||||||
|
? /\$\{(.*?)\}/g.test(source)
|
||||||
|
? 'variable'
|
||||||
|
: 'api'
|
||||||
|
: 'custom',
|
||||||
modalVisible: false
|
modalVisible: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sortables = [];
|
this.sortables = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +112,7 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
* 更新options字段的统一出口
|
* 更新options字段的统一出口
|
||||||
*/
|
*/
|
||||||
onChange() {
|
onChange() {
|
||||||
const {source} = this.state;
|
const {source, api, labelField, valueField, iconField} = this.state;
|
||||||
const {onBulkChange} = this.props;
|
const {onBulkChange} = this.props;
|
||||||
const data: Partial<OptionControlProps> = {
|
const data: Partial<OptionControlProps> = {
|
||||||
source: undefined,
|
source: undefined,
|
||||||
@ -119,13 +126,13 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
data.options = this.pretreatOptions(options);
|
data.options = this.pretreatOptions(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source === 'api' || source === 'apicenter') {
|
if (source === 'api' || source === 'apicenter' || source === 'variable') {
|
||||||
const {api, labelField, valueField, iconField} = this.state;
|
|
||||||
data.source = api;
|
data.source = api;
|
||||||
data.labelField = labelField || undefined;
|
data.labelField = labelField || undefined;
|
||||||
data.valueField = valueField || undefined;
|
data.valueField = valueField || undefined;
|
||||||
data.iconField = iconField;
|
data.iconField = iconField;
|
||||||
}
|
}
|
||||||
|
|
||||||
onBulkChange && onBulkChange(data);
|
onBulkChange && onBulkChange(data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -134,8 +141,8 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
* 切换选项类型
|
* 切换选项类型
|
||||||
*/
|
*/
|
||||||
@autobind
|
@autobind
|
||||||
handleSourceChange(source: 'custom' | 'api' | 'apicenter') {
|
handleSourceChange(source: SourceType) {
|
||||||
this.setState({source: source}, this.onChange);
|
this.setState({api: '', source: source}, this.onChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHeader() {
|
renderHeader() {
|
||||||
@ -160,10 +167,14 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
label: '外部接口',
|
label: '外部接口',
|
||||||
value: 'api'
|
value: 'api'
|
||||||
},
|
},
|
||||||
...(hasApiCenter ? [{label: 'API中心', value: 'apicenter'}] : [])
|
...(hasApiCenter ? [{label: 'API中心', value: 'apicenter'}] : []),
|
||||||
|
{
|
||||||
|
label: '上下文变量',
|
||||||
|
value: 'variable'
|
||||||
|
}
|
||||||
] as Array<{
|
] as Array<{
|
||||||
label: string;
|
label: string;
|
||||||
value: 'custom' | 'api' | 'apicenter';
|
value: SourceType;
|
||||||
}>
|
}>
|
||||||
).map(item => ({
|
).map(item => ({
|
||||||
...item,
|
...item,
|
||||||
@ -574,9 +585,6 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
renderApiPanel() {
|
renderApiPanel() {
|
||||||
const {render, showIconField = false} = this.props;
|
const {render, showIconField = false} = this.props;
|
||||||
const {source, api, labelField, valueField, iconField} = this.state;
|
const {source, api, labelField, valueField, iconField} = this.state;
|
||||||
if (source === 'custom') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
'api',
|
'api',
|
||||||
@ -624,7 +632,7 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {source} = this.state;
|
const {source} = this.state;
|
||||||
const {className} = this.props;
|
const {className, render} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cx('ae-TreeOptionControl', className)}>
|
<div className={cx('ae-TreeOptionControl', className)}>
|
||||||
@ -648,7 +656,22 @@ export default class TreeOptionControl extends React.Component<
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{this.renderApiPanel()}
|
{source === 'api' || source === 'apicenter'
|
||||||
|
? this.renderApiPanel()
|
||||||
|
: null}
|
||||||
|
|
||||||
|
{source === 'variable'
|
||||||
|
? render(
|
||||||
|
'variable',
|
||||||
|
getSchemaTpl('sourceBindControl', {
|
||||||
|
label: false,
|
||||||
|
className: 'ae-ExtendMore'
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
onChange: this.handleAPIChange
|
||||||
|
}
|
||||||
|
)
|
||||||
|
: null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -624,6 +624,20 @@ setSchemaTpl(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据源绑定
|
||||||
|
*/
|
||||||
|
setSchemaTpl('sourceBindControl', (schema: object = {}) => ({
|
||||||
|
type: 'ae-formulaControl',
|
||||||
|
name: 'source',
|
||||||
|
label: '数据',
|
||||||
|
variableMode: 'tabs',
|
||||||
|
inputMode: 'input-group',
|
||||||
|
placeholder: '请输入表达式',
|
||||||
|
requiredDataPropsVariables: true,
|
||||||
|
...schema
|
||||||
|
}));
|
||||||
|
|
||||||
setSchemaTpl('menuTpl', () => {
|
setSchemaTpl('menuTpl', () => {
|
||||||
return getSchemaTpl('textareaFormulaControl', {
|
return getSchemaTpl('textareaFormulaControl', {
|
||||||
mode: 'normal',
|
mode: 'normal',
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
EditorManager,
|
EditorManager,
|
||||||
RendererPluginAction
|
RendererPluginAction
|
||||||
} from 'amis-editor-core';
|
} from 'amis-editor-core';
|
||||||
import {filterTree, mapTree} from 'amis';
|
import {filterTree, mapTree, resolveVariableAndFilter} from 'amis';
|
||||||
import {ACTION_TYPE_TREE} from './renderer/event-control/helper';
|
import {ACTION_TYPE_TREE} from './renderer/event-control/helper';
|
||||||
import {ActionConfig, ComponentInfo} from './renderer/event-control/types';
|
import {ActionConfig, ComponentInfo} from './renderer/event-control/types';
|
||||||
import {
|
import {
|
||||||
@ -280,10 +280,34 @@ export const isAuto = (value: any) => {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于列表类展示组件在 filterProps 中获取编辑态 value 值
|
||||||
|
*/
|
||||||
|
export const resolveArrayDatasource = (
|
||||||
|
{
|
||||||
|
data,
|
||||||
|
value,
|
||||||
|
source
|
||||||
|
}: {
|
||||||
|
value?: any;
|
||||||
|
data: any;
|
||||||
|
source: string;
|
||||||
|
},
|
||||||
|
defaultSource: string = '$items'
|
||||||
|
) =>
|
||||||
|
Array.isArray(value)
|
||||||
|
? value
|
||||||
|
: // resolveVariable 不支持 ${items} 格式,导致预览态无数据
|
||||||
|
resolveVariableAndFilter(
|
||||||
|
typeof source === 'string' ? source : defaultSource,
|
||||||
|
data,
|
||||||
|
'| raw'
|
||||||
|
);
|
||||||
|
|
||||||
export const schemaToArray = (value: any) => {
|
export const schemaToArray = (value: any) => {
|
||||||
return value && Array.isArray(value)? value : [value];
|
return value && Array.isArray(value)? value : [value];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const schemaArrayFormat = (value: any) => {
|
export const schemaArrayFormat = (value: any) => {
|
||||||
return value && Array.isArray(value) && value.length === 1 ? value[0] : value;
|
return value && Array.isArray(value) && value.length === 1 ? value[0] : value;
|
||||||
};
|
};
|
||||||
|
@ -11,7 +11,7 @@ import {ClassNamesFn} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Badge 角标。
|
* Badge 角标。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/badge
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/badge
|
||||||
*/
|
*/
|
||||||
export interface BadgeObject {
|
export interface BadgeObject {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import 'moment/locale/zh-cn';
|
|
||||||
import 'moment/locale/de';
|
|
||||||
import {Icon} from './icons';
|
import {Icon} from './icons';
|
||||||
import {PopOver} from 'amis-core';
|
import {PopOver} from 'amis-core';
|
||||||
import PopUp from './PopUp';
|
import PopUp from './PopUp';
|
||||||
|
@ -1239,13 +1239,15 @@ export class DateRangePicker extends React.Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderMonth(props: any, month: number, year: number, date: any) {
|
renderMonth(props: any, month: number, year: number, date: any) {
|
||||||
const m = moment();
|
const currentDate = props.viewDate.year(year).month(month);
|
||||||
const currentDate = m.year(year).month(month);
|
|
||||||
const {startDate, endDate} = this.state;
|
const {startDate, endDate} = this.state;
|
||||||
|
|
||||||
var localMoment = m.localeData().monthsShort(m.month(month));
|
const {translate: __} = this.props;
|
||||||
var strLength = 3;
|
const monthStr = currentDate.format(__('MMM'));
|
||||||
var monthStrFixedLength = localMoment.substring(0, strLength);
|
const strLength = 3;
|
||||||
|
// Because some months are up to 5 characters long, we want to
|
||||||
|
// use a fixed string length for consistency
|
||||||
|
const monthStrFixedLength = monthStr.substring(0, strLength);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
startDate &&
|
startDate &&
|
||||||
@ -1262,7 +1264,7 @@ export class DateRangePicker extends React.Component<
|
|||||||
props.className += className;
|
props.className += className;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<td {...props} {...others}>
|
<td {...omit(props, 'viewDate')} {...others}>
|
||||||
<span>{monthStrFixedLength}</span>
|
<span>{monthStrFixedLength}</span>
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
|
@ -162,6 +162,8 @@ export class Tag extends React.Component<TagProps> {
|
|||||||
})}
|
})}
|
||||||
style={tagStyle}
|
style={tagStyle}
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
|
onMouseEnter={this.handleMouseEnter}
|
||||||
|
onMouseLeave={this.handleMouseLeave}
|
||||||
>
|
>
|
||||||
<span className={cx('Tag-text')}>
|
<span className={cx('Tag-text')}>
|
||||||
{prevIcon}
|
{prevIcon}
|
||||||
|
@ -12,6 +12,8 @@ import {
|
|||||||
utils
|
utils
|
||||||
} from 'amis-core';
|
} from 'amis-core';
|
||||||
import {PickerOption} from '../PickerColumn';
|
import {PickerOption} from '../PickerColumn';
|
||||||
|
import 'moment/locale/zh-cn';
|
||||||
|
import 'moment/locale/de';
|
||||||
|
|
||||||
export type DateType =
|
export type DateType =
|
||||||
| 'year'
|
| 'year'
|
||||||
|
@ -121,7 +121,8 @@ export class CustomMonthsView extends React.Component<CustomMonthsViewProps> {
|
|||||||
props = {
|
props = {
|
||||||
'key': i,
|
'key': i,
|
||||||
'data-value': i,
|
'data-value': i,
|
||||||
'className': classes
|
'className': classes,
|
||||||
|
'viewDate': this.props.viewDate
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!isDisabled)
|
if (!isDisabled)
|
||||||
@ -153,16 +154,16 @@ export class CustomMonthsView extends React.Component<CustomMonthsViewProps> {
|
|||||||
year: number,
|
year: number,
|
||||||
date: moment.Moment
|
date: moment.Moment
|
||||||
) => {
|
) => {
|
||||||
var localMoment = this.props.viewDate;
|
const {translate: __} = this.props;
|
||||||
var monthStr = localMoment
|
const {viewDate: localMoment, ...rest} = props;
|
||||||
.localeData()
|
const monthStr = localMoment.month(month).format(__('MMM'));
|
||||||
.monthsShort(localMoment.month(month));
|
const strLength = 3;
|
||||||
var strLength = 3;
|
|
||||||
// Because some months are up to 5 characters long, we want to
|
// Because some months are up to 5 characters long, we want to
|
||||||
// use a fixed string length for consistency
|
// use a fixed string length for consistency
|
||||||
var monthStrFixedLength = monthStr.substring(0, strLength);
|
const monthStrFixedLength = monthStr.substring(0, strLength);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<td {...props}>
|
<td {...rest}>
|
||||||
<span>{monthStrFixedLength}</span>
|
<span>{monthStrFixedLength}</span>
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
|
@ -154,9 +154,12 @@ test('Renderer:crud loadDataOnce', async () => {
|
|||||||
body: {
|
body: {
|
||||||
type: 'crud',
|
type: 'crud',
|
||||||
syncLocation: false,
|
syncLocation: false,
|
||||||
api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/sample',
|
api: 'https://aisuda.bce.baidu.com/amis/api/mock2/sample',
|
||||||
loadDataOnce: true,
|
loadDataOnce: true,
|
||||||
autoGenerateFilter: true,
|
autoGenerateFilter: {
|
||||||
|
columnsNum: 4,
|
||||||
|
showBtnToolbar: false
|
||||||
|
},
|
||||||
filterSettingSource: ['version'],
|
filterSettingSource: ['version'],
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@ -240,8 +243,9 @@ test('Renderer:crud loadDataOnce', async () => {
|
|||||||
container.querySelectorAll('.cxd-Table-tr--1th .cxd-PlainField')[4]
|
container.querySelectorAll('.cxd-Table-tr--1th .cxd-PlainField')[4]
|
||||||
?.innerHTML
|
?.innerHTML
|
||||||
).toEqual('4');
|
).toEqual('4');
|
||||||
expect(container.querySelector('.cxd-Crud-pager')).not.toBeInTheDocument();
|
// 啥意思?为何不能有分页?
|
||||||
expect(container).toMatchSnapshot();
|
// expect(container.querySelector('.cxd-Crud-pager')).not.toBeInTheDocument();
|
||||||
|
// expect(container).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Renderer:crud list', async () => {
|
test('Renderer:crud list', async () => {
|
||||||
@ -751,7 +755,10 @@ test('Renderer: crud autoGenerateFilter', async () => {
|
|||||||
type: 'crud',
|
type: 'crud',
|
||||||
api: '/api/mock2/sample',
|
api: '/api/mock2/sample',
|
||||||
syncLocation: false,
|
syncLocation: false,
|
||||||
autoGenerateFilter: true,
|
autoGenerateFilter: {
|
||||||
|
columnsNum: 4,
|
||||||
|
showBtnToolbar: false
|
||||||
|
},
|
||||||
bulkActions: [
|
bulkActions: [
|
||||||
{
|
{
|
||||||
label: '批量删除',
|
label: '批量删除',
|
||||||
|
@ -478,7 +478,7 @@ test('Renderer:condition-builder with custom field', async () => {
|
|||||||
fireEvent.click(await findByText('请选择操作'));
|
fireEvent.click(await findByText('请选择操作'));
|
||||||
fireEvent.click(await findByText('等于(自定义)'));
|
fireEvent.click(await findByText('等于(自定义)'));
|
||||||
|
|
||||||
await wait(200);
|
await wait(400);
|
||||||
const colorInputs = container.querySelectorAll(
|
const colorInputs = container.querySelectorAll(
|
||||||
'.cxd-CBValue .cxd-ColorPicker-input'
|
'.cxd-CBValue .cxd-ColorPicker-input'
|
||||||
)!;
|
)!;
|
||||||
|
@ -304,7 +304,7 @@ test('Renderer:input-table verifty', async () => {
|
|||||||
data: {
|
data: {
|
||||||
table: [{}]
|
table: [{}]
|
||||||
},
|
},
|
||||||
api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm',
|
api: 'https://aisuda.bce.baidu.com/amis/api/mock2/form/saveForm',
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
type: 'input-table',
|
type: 'input-table',
|
||||||
@ -381,7 +381,7 @@ test('Renderer:input-table cell selects delete', async () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm',
|
api: 'https://aisuda.bce.baidu.com/amis/api/mock2/form/saveForm',
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
type: 'input-table',
|
type: 'input-table',
|
||||||
|
@ -14,7 +14,7 @@ test('Renderer:portlet', () => {
|
|||||||
label: '固定操作',
|
label: '固定操作',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
actionType: 'ajax',
|
actionType: 'ajax',
|
||||||
api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm'
|
api: 'https://aisuda.bce.baidu.com/amis/api/mock2/form/saveForm'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
tabs: [
|
tabs: [
|
||||||
@ -26,7 +26,7 @@ test('Renderer:portlet', () => {
|
|||||||
label: 'ajax请求',
|
label: 'ajax请求',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
actionType: 'ajax',
|
actionType: 'ajax',
|
||||||
api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm'
|
api: 'https://aisuda.bce.baidu.com/amis/api/mock2/form/saveForm'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'dropdown-button',
|
type: 'dropdown-button',
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -640,7 +640,7 @@ export type SchemaRedirect = string;
|
|||||||
* 2. `<%= data.xxx %>`
|
* 2. `<%= data.xxx %>`
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* 更多文档:https://baidu.gitee.io/amis/docs/concepts/template
|
* 更多文档:https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/template
|
||||||
*/
|
*/
|
||||||
export type SchemaTpl = string;
|
export type SchemaTpl = string;
|
||||||
|
|
||||||
@ -851,7 +851,7 @@ export interface ToastSchemaBase extends BaseSchema {
|
|||||||
/**
|
/**
|
||||||
* Form 表单渲染器。
|
* Form 表单渲染器。
|
||||||
*
|
*
|
||||||
* 说明:https://baidu.gitee.io/amis/docs/components/form/index
|
* 说明:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/index
|
||||||
*/
|
*/
|
||||||
export interface FormSchema extends FormSchemaBase, BaseSchema {
|
export interface FormSchema extends FormSchemaBase, BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -232,7 +232,7 @@ export interface DialogActionSchema extends ButtonSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 弹框详情
|
* 弹框详情
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/dialog
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/dialog
|
||||||
*/
|
*/
|
||||||
dialog: DialogSchemaBase;
|
dialog: DialogSchemaBase;
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ export interface DrawerActionSchema extends ButtonSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 抽出式弹框详情
|
* 抽出式弹框详情
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/drawer
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/drawer
|
||||||
*/
|
*/
|
||||||
drawer: DrawerSchemaBase;
|
drawer: DrawerSchemaBase;
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ export interface ToastActionSchema extends ButtonSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 轻提示详情
|
* 轻提示详情
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/toast
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/toast
|
||||||
*/
|
*/
|
||||||
toast: ToastSchemaBase;
|
toast: ToastSchemaBase;
|
||||||
}
|
}
|
||||||
@ -365,7 +365,7 @@ export interface VanillaAction extends ButtonSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 按钮动作渲染器。
|
* 按钮动作渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/action
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/action
|
||||||
*/
|
*/
|
||||||
export type ActionSchema =
|
export type ActionSchema =
|
||||||
| AjaxActionSchema
|
| AjaxActionSchema
|
||||||
|
@ -12,7 +12,7 @@ import type {AlertProps} from 'amis-ui/lib/components/Alert2';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Alert 提示渲染器。
|
* Alert 提示渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/alert
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/alert
|
||||||
*/
|
*/
|
||||||
export interface AlertSchema extends BaseSchema {
|
export interface AlertSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -8,7 +8,7 @@ import {BaseSchema, SchemaClassName, SchemaCollection} from '../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* AnchorNavSection 锚点区域渲染器
|
* AnchorNavSection 锚点区域渲染器
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/anchor-nav
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/anchor-nav
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export type AnchorNavSectionSchema = {
|
export type AnchorNavSectionSchema = {
|
||||||
@ -30,7 +30,7 @@ export type AnchorNavSectionSchema = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* AnchorNav 锚点导航渲染器
|
* AnchorNav 锚点导航渲染器
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/anchor-nav
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/anchor-nav
|
||||||
*/
|
*/
|
||||||
export interface AnchorNavSchema extends BaseSchema {
|
export interface AnchorNavSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
@ -162,22 +162,24 @@ export default class AnchorNav extends React.Component<
|
|||||||
links = Array.isArray(links) ? links : [links];
|
links = Array.isArray(links) ? links : [links];
|
||||||
let children: Array<JSX.Element | null> = [];
|
let children: Array<JSX.Element | null> = [];
|
||||||
|
|
||||||
children = links.map((section, index) =>
|
children = links
|
||||||
isVisible(section, data) ? (
|
.map((section, index) =>
|
||||||
<AnchorNavSection
|
isVisible(section, data) ? (
|
||||||
{...(section as any)}
|
<AnchorNavSection
|
||||||
title={filter(section.title, data)}
|
{...(section as any)}
|
||||||
key={index}
|
title={filter(section.title, data)}
|
||||||
name={section.href || index}
|
key={index}
|
||||||
>
|
name={section.href || index}
|
||||||
{this.renderSection
|
>
|
||||||
? this.renderSection(section, this.props, index)
|
{this.renderSection
|
||||||
: sectionRender
|
? this.renderSection(section, this.props, index)
|
||||||
? sectionRender(section, this.props, index)
|
: sectionRender
|
||||||
: render(`section/${index}`, section.body || '')}
|
? sectionRender(section, this.props, index)
|
||||||
</AnchorNavSection>
|
: render(`section/${index}`, section.body || '')}
|
||||||
) : null
|
</AnchorNavSection>
|
||||||
).filter(item => !!item);
|
) : null
|
||||||
|
)
|
||||||
|
.filter(item => !!item);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CAnchorNav
|
<CAnchorNav
|
||||||
|
@ -81,7 +81,7 @@ export interface AppPage extends SpinnerExtraProps {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* App 渲染器,适合 JSSDK 用来做多页渲染。
|
* App 渲染器,适合 JSSDK 用来做多页渲染。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/app
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/app
|
||||||
*/
|
*/
|
||||||
export interface AppSchema extends BaseSchema, SpinnerExtraProps {
|
export interface AppSchema extends BaseSchema, SpinnerExtraProps {
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,7 @@ import {BaseSchema, SchemaUrlPath} from '../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Audio 音频渲染器。
|
* Audio 音频渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/audio
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/audio
|
||||||
*/
|
*/
|
||||||
export interface AudioSchema extends BaseSchema {
|
export interface AudioSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
@ -300,7 +300,9 @@ export class Audio extends React.Component<AudioProps, AudioState> {
|
|||||||
const date = new Date(seconds * 1000);
|
const date = new Date(seconds * 1000);
|
||||||
const hh = date.getUTCHours();
|
const hh = date.getUTCHours();
|
||||||
const mm = isNaN(date.getUTCMinutes()) ? 0 : date.getUTCMinutes();
|
const mm = isNaN(date.getUTCMinutes()) ? 0 : date.getUTCMinutes();
|
||||||
const ss = isNaN(date.getUTCSeconds()) ? '00': this.pad(date.getUTCSeconds());
|
const ss = isNaN(date.getUTCSeconds())
|
||||||
|
? '00'
|
||||||
|
: this.pad(date.getUTCSeconds());
|
||||||
if (hh) {
|
if (hh) {
|
||||||
return `${hh}:${this.pad(mm)}:${ss}`;
|
return `${hh}:${this.pad(mm)}:${ss}`;
|
||||||
}
|
}
|
||||||
@ -460,7 +462,10 @@ export class Audio extends React.Component<AudioProps, AudioState> {
|
|||||||
const {muted, src} = this.state;
|
const {muted, src} = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cx('Audio', className, inline ? 'Audio--inline' : '')} style={style}>
|
<div
|
||||||
|
className={cx('Audio', className, inline ? 'Audio--inline' : '')}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
<audio
|
<audio
|
||||||
className={cx('Audio-original')}
|
className={cx('Audio-original')}
|
||||||
ref={this.audioRef}
|
ref={this.audioRef}
|
||||||
|
@ -9,7 +9,7 @@ const BarCode = React.lazy(() => import('amis-ui/lib/components/BarCode'));
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* BarCode 显示渲染器,格式说明。
|
* BarCode 显示渲染器,格式说明。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/barcode
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/barcode
|
||||||
*/
|
*/
|
||||||
export interface BarCodeSchema extends BaseSchema {
|
export interface BarCodeSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
@ -39,12 +39,23 @@ export interface BarCodeProps
|
|||||||
|
|
||||||
export class BarCodeField extends React.Component<BarCodeProps, object> {
|
export class BarCodeField extends React.Component<BarCodeProps, object> {
|
||||||
render() {
|
render() {
|
||||||
const {className, style, width, height, classnames: cx, options} = this.props;
|
const {
|
||||||
|
className,
|
||||||
|
style,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
classnames: cx,
|
||||||
|
options
|
||||||
|
} = this.props;
|
||||||
const value = getPropValue(this.props);
|
const value = getPropValue(this.props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<div>...</div>}>
|
<Suspense fallback={<div>...</div>}>
|
||||||
<div data-testid="barcode" className={cx('BarCode', className)} style={style}>
|
<div
|
||||||
|
data-testid="barcode"
|
||||||
|
className={cx('BarCode', className)}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
<BarCode value={value} options={options}></BarCode>
|
<BarCode value={value} options={options}></BarCode>
|
||||||
</div>
|
</div>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
@ -53,7 +53,7 @@ export type ItemPlace = 'start' | 'middle' | 'end';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Breadcrumb 显示渲染器
|
* Breadcrumb 显示渲染器
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/breadcrumb
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/breadcrumb
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface BreadcrumbSchema extends BaseSchema {
|
export interface BreadcrumbSchema extends BaseSchema {
|
||||||
|
@ -6,7 +6,7 @@ import {ActionSchema} from './Action';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Button Group 渲染器。
|
* Button Group 渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/button-group
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/button-group
|
||||||
*/
|
*/
|
||||||
export interface ButtonGroupSchema extends BaseSchema {
|
export interface ButtonGroupSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -77,6 +77,21 @@ export type CRUDToolbarObject = {
|
|||||||
align?: 'left' | 'right';
|
align?: 'left' | 'right';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type AutoGenerateFilterObject = {
|
||||||
|
/**
|
||||||
|
* 过滤条件单行列数
|
||||||
|
*/
|
||||||
|
columnsNum?: number;
|
||||||
|
/**
|
||||||
|
* 是否显示设置查询字段
|
||||||
|
*/
|
||||||
|
showBtnToolbar?: boolean;
|
||||||
|
/**
|
||||||
|
* 是否显示展开/收起
|
||||||
|
*/
|
||||||
|
// showExpand?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
export type CRUDRendererEvent = TableRendererEvent | CardsRendererEvent;
|
export type CRUDRendererEvent = TableRendererEvent | CardsRendererEvent;
|
||||||
|
|
||||||
export interface CRUDCommonSchema extends BaseSchema, SpinnerExtraProps {
|
export interface CRUDCommonSchema extends BaseSchema, SpinnerExtraProps {
|
||||||
@ -303,7 +318,7 @@ export interface CRUDCommonSchema extends BaseSchema, SpinnerExtraProps {
|
|||||||
/**
|
/**
|
||||||
* 开启查询区域,会根据列元素的searchable属性值,自动生成查询条件表单
|
* 开启查询区域,会根据列元素的searchable属性值,自动生成查询条件表单
|
||||||
*/
|
*/
|
||||||
autoGenerateFilter?: boolean;
|
autoGenerateFilter?: AutoGenerateFilterObject | boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内容区域占满屏幕剩余空间
|
* 内容区域占满屏幕剩余空间
|
||||||
@ -325,7 +340,7 @@ export type CRUDTableSchema = CRUDCommonSchema & {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CRUD 增删改查渲染器。
|
* CRUD 增删改查渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/crud
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/crud
|
||||||
*/
|
*/
|
||||||
export type CRUDSchema = CRUDCardsSchema | CRUDListSchema | CRUDTableSchema;
|
export type CRUDSchema = CRUDCardsSchema | CRUDListSchema | CRUDTableSchema;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ export type CardBodyField = SchemaObject & {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Card 卡片渲染器。
|
* Card 卡片渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/card
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/card
|
||||||
*/
|
*/
|
||||||
export interface CardSchema extends BaseSchema {
|
export interface CardSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -7,7 +7,7 @@ import {buildStyle} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Card2 新卡片渲染器。
|
* Card2 新卡片渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/card2
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/card2
|
||||||
*/
|
*/
|
||||||
export interface Card2Schema extends BaseSchema {
|
export interface Card2Schema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,7 @@ import type {IItem} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Cards 卡片集合渲染器。
|
* Cards 卡片集合渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/card
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/card
|
||||||
*/
|
*/
|
||||||
export interface CardsSchema extends BaseSchema, SpinnerExtraProps {
|
export interface CardsSchema extends BaseSchema, SpinnerExtraProps {
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ import {ScopedContext, IScopedContext} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Carousel 轮播图渲染器。
|
* Carousel 轮播图渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/carousel
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/carousel
|
||||||
*/
|
*/
|
||||||
export interface CarouselSchema extends BaseSchema {
|
export interface CarouselSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -51,7 +51,7 @@ const DEFAULT_EVENT_PARAMS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Chart 图表渲染器。
|
* Chart 图表渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/carousel
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/carousel
|
||||||
*/
|
*/
|
||||||
export interface ChartSchema extends BaseSchema {
|
export interface ChartSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +71,7 @@ export interface CustomLang {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码高亮组件
|
* 代码高亮组件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/code
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/code
|
||||||
*/
|
*/
|
||||||
export interface CodeSchema extends BaseSchema {
|
export interface CodeSchema extends BaseSchema {
|
||||||
type: 'code';
|
type: 'code';
|
||||||
|
@ -10,7 +10,7 @@ import {BaseSchema, SchemaCollection, SchemaTpl, SchemaObject} from '../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Collapse 折叠渲染器,格式说明。
|
* Collapse 折叠渲染器,格式说明。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/collapse
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/collapse
|
||||||
*/
|
*/
|
||||||
export interface CollapseSchema extends BaseSchema {
|
export interface CollapseSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -5,7 +5,7 @@ import {CollapseGroup} from 'amis-ui';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CollapseGroup 折叠渲染器,格式说明。
|
* CollapseGroup 折叠渲染器,格式说明。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/collapse
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/collapse
|
||||||
*/
|
*/
|
||||||
export interface CollapseGroupSchema extends BaseSchema {
|
export interface CollapseGroupSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -8,7 +8,7 @@ import {getPropValue} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Color 显示渲染器,格式说明。
|
* Color 显示渲染器,格式说明。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/color
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/color
|
||||||
*/
|
*/
|
||||||
export interface ColorSchema extends BaseSchema {
|
export interface ColorSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
@ -39,7 +39,13 @@ export class ColorField extends React.Component<ColorProps, object> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {className, style, classnames: cx, defaultColor, showValue} = this.props;
|
const {
|
||||||
|
className,
|
||||||
|
style,
|
||||||
|
classnames: cx,
|
||||||
|
defaultColor,
|
||||||
|
showValue
|
||||||
|
} = this.props;
|
||||||
const color = getPropValue(this.props);
|
const color = getPropValue(this.props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -49,7 +55,9 @@ export class ColorField extends React.Component<ColorProps, object> {
|
|||||||
style={{backgroundColor: color || defaultColor}}
|
style={{backgroundColor: color || defaultColor}}
|
||||||
/>
|
/>
|
||||||
{showValue ? (
|
{showValue ? (
|
||||||
<span className={cx('ColorField-value')}>{color || defaultColor}</span>
|
<span className={cx('ColorField-value')}>
|
||||||
|
{color || defaultColor}
|
||||||
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -62,7 +62,7 @@ export interface ContainerDraggableConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Container 容器渲染器。
|
* Container 容器渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/container
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/container
|
||||||
*/
|
*/
|
||||||
export interface ContainerSchema extends BaseSchema {
|
export interface ContainerSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -6,7 +6,7 @@ import {getPropValue} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Date 展示渲染器。
|
* Date 展示渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/date
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/date
|
||||||
*/
|
*/
|
||||||
export interface DateSchema extends BaseSchema {
|
export interface DateSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ import {isAlive} from 'mobx-state-tree';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialog 弹框渲染器。
|
* Dialog 弹框渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/dialog
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/dialog
|
||||||
*/
|
*/
|
||||||
export interface DialogSchema extends BaseSchema {
|
export interface DialogSchema extends BaseSchema {
|
||||||
type: 'dialog';
|
type: 'dialog';
|
||||||
@ -829,7 +829,11 @@ export class DialogRenderer extends Dialog {
|
|||||||
// clear error
|
// clear error
|
||||||
store.updateMessage();
|
store.updateMessage();
|
||||||
onClose();
|
onClose();
|
||||||
action.close && this.closeTarget(action.close);
|
if (action.close) {
|
||||||
|
action.close === true
|
||||||
|
? this.handleSelfClose()
|
||||||
|
: this.closeTarget(action.close);
|
||||||
|
}
|
||||||
} else if (action.actionType === 'confirm') {
|
} else if (action.actionType === 'confirm') {
|
||||||
const rendererEvent = await dispatchEvent(
|
const rendererEvent = await dispatchEvent(
|
||||||
'confirm',
|
'confirm',
|
||||||
@ -880,7 +884,9 @@ export class DialogRenderer extends Dialog {
|
|||||||
action.target && scoped.reload(action.target, data);
|
action.target && scoped.reload(action.target, data);
|
||||||
if (action.close || action.type === 'submit') {
|
if (action.close || action.type === 'submit') {
|
||||||
this.handleSelfClose(undefined, action.type === 'submit');
|
this.handleSelfClose(undefined, action.type === 'submit');
|
||||||
this.closeTarget(action.close);
|
action.close &&
|
||||||
|
typeof action.close === 'string' &&
|
||||||
|
this.closeTarget(action.close);
|
||||||
}
|
}
|
||||||
} else if (this.tryChildrenToHandle(action, data)) {
|
} else if (this.tryChildrenToHandle(action, data)) {
|
||||||
// do nothing
|
// do nothing
|
||||||
@ -902,8 +908,9 @@ export class DialogRenderer extends Dialog {
|
|||||||
action.reload &&
|
action.reload &&
|
||||||
this.reloadTarget(filter(action.reload, store.data), store.data);
|
this.reloadTarget(filter(action.reload, store.data), store.data);
|
||||||
if (action.close) {
|
if (action.close) {
|
||||||
this.handleSelfClose();
|
action.close === true
|
||||||
this.closeTarget(action.close);
|
? this.handleSelfClose()
|
||||||
|
: this.closeTarget(action.close);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
@ -912,7 +919,7 @@ export class DialogRenderer extends Dialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (onAction) {
|
} else if (onAction) {
|
||||||
let ret = onAction(
|
await onAction(
|
||||||
e,
|
e,
|
||||||
{
|
{
|
||||||
...action,
|
...action,
|
||||||
@ -922,10 +929,12 @@ export class DialogRenderer extends Dialog {
|
|||||||
throwErrors,
|
throwErrors,
|
||||||
delegate || this.context
|
delegate || this.context
|
||||||
);
|
);
|
||||||
action.close &&
|
|
||||||
(ret && ret.then
|
if (action.close) {
|
||||||
? ret.then(this.handleSelfClose)
|
action.close === true
|
||||||
: setTimeout(this.handleSelfClose, 200));
|
? this.handleSelfClose()
|
||||||
|
: this.closeTarget(action.close);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import {BaseSchema} from '../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Divider 分割线渲染器。
|
* Divider 分割线渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/divider
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/divider
|
||||||
*/
|
*/
|
||||||
export interface DividerSchema extends BaseSchema {
|
export interface DividerSchema extends BaseSchema {
|
||||||
type: 'divider';
|
type: 'divider';
|
||||||
|
@ -27,7 +27,7 @@ import {isAlive} from 'mobx-state-tree';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Drawer 抽出式弹框。
|
* Drawer 抽出式弹框。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/drawer
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/drawer
|
||||||
*/
|
*/
|
||||||
export interface DrawerSchema extends BaseSchema {
|
export interface DrawerSchema extends BaseSchema {
|
||||||
type: 'drawer';
|
type: 'drawer';
|
||||||
@ -811,7 +811,11 @@ export class DrawerRenderer extends Drawer {
|
|||||||
}
|
}
|
||||||
store.setCurrentAction(action);
|
store.setCurrentAction(action);
|
||||||
onClose();
|
onClose();
|
||||||
action.close && this.closeTarget(action.close);
|
if (action.close) {
|
||||||
|
action.close === true
|
||||||
|
? this.handleSelfClose()
|
||||||
|
: this.closeTarget(action.close);
|
||||||
|
}
|
||||||
} else if (action.actionType === 'confirm') {
|
} else if (action.actionType === 'confirm') {
|
||||||
const rendererEvent = await dispatchEvent(
|
const rendererEvent = await dispatchEvent(
|
||||||
'confirm',
|
'confirm',
|
||||||
@ -831,9 +835,11 @@ export class DrawerRenderer extends Drawer {
|
|||||||
} else if (action.actionType === 'reload') {
|
} else if (action.actionType === 'reload') {
|
||||||
store.setCurrentAction(action);
|
store.setCurrentAction(action);
|
||||||
action.target && scoped.reload(action.target, data);
|
action.target && scoped.reload(action.target, data);
|
||||||
|
|
||||||
if (action.close) {
|
if (action.close) {
|
||||||
this.handleSelfClose();
|
action.close === true
|
||||||
this.closeTarget(action.close);
|
? this.handleSelfClose()
|
||||||
|
: this.closeTarget(action.close);
|
||||||
}
|
}
|
||||||
} else if (this.tryChildrenToHandle(action, data)) {
|
} else if (this.tryChildrenToHandle(action, data)) {
|
||||||
// do nothing
|
// do nothing
|
||||||
@ -854,9 +860,11 @@ export class DrawerRenderer extends Drawer {
|
|||||||
redirect && env.jumpTo(redirect, action);
|
redirect && env.jumpTo(redirect, action);
|
||||||
action.reload &&
|
action.reload &&
|
||||||
this.reloadTarget(filter(action.reload, store.data), store.data);
|
this.reloadTarget(filter(action.reload, store.data), store.data);
|
||||||
|
|
||||||
if (action.close) {
|
if (action.close) {
|
||||||
this.handleSelfClose();
|
action.close === true
|
||||||
this.closeTarget(action.close);
|
? this.handleSelfClose()
|
||||||
|
: this.closeTarget(action.close);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
@ -865,17 +873,13 @@ export class DrawerRenderer extends Drawer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (onAction) {
|
} else if (onAction) {
|
||||||
let ret = onAction(
|
await onAction(e, action, data, throwErrors, delegate || this.context);
|
||||||
e,
|
|
||||||
action,
|
if (action.close) {
|
||||||
data,
|
action.close === true
|
||||||
throwErrors,
|
? this.handleSelfClose()
|
||||||
delegate || this.context
|
: this.closeTarget(action.close);
|
||||||
);
|
}
|
||||||
action.close &&
|
|
||||||
(ret && ret.then
|
|
||||||
? ret.then(this.handleSelfClose)
|
|
||||||
: setTimeout(this.handleSelfClose, 200));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export type DropdownButton =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 下拉按钮渲染器。
|
* 下拉按钮渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/dropdown-button
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/dropdown-button
|
||||||
*/
|
*/
|
||||||
export interface DropdownButtonSchema extends BaseSchema {
|
export interface DropdownButtonSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -7,7 +7,7 @@ import {BaseSchema, SchemaCollection} from '../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Each 循环功能渲染器。
|
* Each 循环功能渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/each
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/each
|
||||||
*/
|
*/
|
||||||
export interface EachSchema extends BaseSchema {
|
export interface EachSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,7 @@ import {BaseSchema, SchemaCollection, SchemaObject} from '../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Flex 布局
|
* Flex 布局
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/flex
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/flex
|
||||||
*/
|
*/
|
||||||
export interface FlexSchema extends BaseSchema {
|
export interface FlexSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -13,7 +13,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 按钮组控件。
|
* 按钮组控件。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/button-group
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/button-group
|
||||||
*/
|
*/
|
||||||
export interface ButtonGroupControlSchema
|
export interface ButtonGroupControlSchema
|
||||||
extends Omit<ButtonGroupSchema, 'type'>,
|
extends Omit<ButtonGroupSchema, 'type'>,
|
||||||
|
@ -5,7 +5,7 @@ import {FormControlProps, FormItem} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Button Toolar 渲染器。
|
* Button Toolar 渲染器。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/button-toolbar
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/button-toolbar
|
||||||
*/
|
*/
|
||||||
export interface ButtonToolbarSchema extends BaseSchema {
|
export interface ButtonToolbarSchema extends BaseSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +19,7 @@ import {isEmpty} from 'lodash';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 链式下拉框
|
* 链式下拉框
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/chained-select
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/chained-select
|
||||||
*/
|
*/
|
||||||
export interface ChainedSelectControlSchema extends FormOptionsSchema {
|
export interface ChainedSelectControlSchema extends FormOptionsSchema {
|
||||||
type: 'chained-select';
|
type: 'chained-select';
|
||||||
|
@ -10,7 +10,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 图表 Radio 单选框。
|
* 图表 Radio 单选框。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/chart-radios
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/chart-radios
|
||||||
*/
|
*/
|
||||||
export interface ChartRadiosControlSchema extends FormOptionsSchema {
|
export interface ChartRadiosControlSchema extends FormOptionsSchema {
|
||||||
type: 'chart-radios';
|
type: 'chart-radios';
|
||||||
@ -111,10 +111,13 @@ export default class ChartRadiosControl extends React.Component<
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
if (options.length && selectedOptions.length) {
|
if (options.length && selectedOptions.length) {
|
||||||
const count = options.reduce((all, cur) => {
|
const count = options.reduce((all, cur) => {
|
||||||
return all + cur[chartValueField || valueField]
|
return all + cur[chartValueField || valueField];
|
||||||
}, 0);
|
}, 0);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
const percent = (+selectedOptions[0][chartValueField || valueField] / count * 100).toFixed(2);
|
const percent = (
|
||||||
|
(+selectedOptions[0][chartValueField || valueField] / count) *
|
||||||
|
100
|
||||||
|
).toFixed(2);
|
||||||
displayValue = `${selectedOptions[0][labelField]}:${percent}%`;
|
displayValue = `${selectedOptions[0][labelField]}:${percent}%`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ export interface SchemaMap {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checkbox 勾选框。
|
* Checkbox 勾选框。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/checkbox
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/checkbox
|
||||||
*/
|
*/
|
||||||
export interface CheckboxControlSchema extends FormBaseControlSchema {
|
export interface CheckboxControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 复选框
|
* 复选框
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/checkboxes
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/checkboxes
|
||||||
*/
|
*/
|
||||||
export interface CheckboxesControlSchema extends FormOptionsSchema {
|
export interface CheckboxesControlSchema extends FormOptionsSchema {
|
||||||
type: 'checkboxes';
|
type: 'checkboxes';
|
||||||
|
@ -69,7 +69,7 @@ export type ComboSubControl = SchemaObject & {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Combo 组合输入框类型
|
* Combo 组合输入框类型
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/combo
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/combo
|
||||||
*/
|
*/
|
||||||
export interface ComboControlSchema extends FormBaseControlSchema {
|
export interface ComboControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,7 @@ import {IconSchema} from '../Icon';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 条件组合控件
|
* 条件组合控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/condition-builder
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/condition-builder
|
||||||
*/
|
*/
|
||||||
export interface ConditionBuilderControlSchema extends FormBaseControlSchema {
|
export interface ConditionBuilderControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -7,7 +7,7 @@ import {FormBaseControl, FormItemWrap} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Group 表单集合渲染器,能让多个表单在一行显示
|
* Group 表单集合渲染器,能让多个表单在一行显示
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/group
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/group
|
||||||
*/
|
*/
|
||||||
export interface FormControlSchema extends FormBaseControlSchema {
|
export interface FormControlSchema extends FormBaseControlSchema {
|
||||||
type: 'control';
|
type: 'control';
|
||||||
|
@ -15,7 +15,7 @@ import type {ListenerAction} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Diff 编辑器
|
* Diff 编辑器
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/diff
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/diff
|
||||||
*/
|
*/
|
||||||
export interface DiffControlSchema extends FormBaseControlSchema {
|
export interface DiffControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,7 @@ import type {ListenerAction} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Editor 代码编辑器
|
* Editor 代码编辑器
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/editor
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/editor
|
||||||
*/
|
*/
|
||||||
export interface EditorControlSchema extends Omit<FormBaseControl, 'size'> {
|
export interface EditorControlSchema extends Omit<FormBaseControl, 'size'> {
|
||||||
type:
|
type:
|
||||||
@ -247,7 +247,7 @@ export default class EditorControl extends React.Component<EditorProps, any> {
|
|||||||
if (this.props.editorDidMount) {
|
if (this.props.editorDidMount) {
|
||||||
let editorDidMount = this.props.editorDidMount;
|
let editorDidMount = this.props.editorDidMount;
|
||||||
if (typeof editorDidMount === 'string') {
|
if (typeof editorDidMount === 'string') {
|
||||||
editorDidMount = new Function('editor', 'monaco');
|
editorDidMount = new Function('editor', 'monaco', editorDidMount);
|
||||||
}
|
}
|
||||||
const dispose = editorDidMount(editor, monaco);
|
const dispose = editorDidMount(editor, monaco);
|
||||||
if (typeof dispose === 'function') {
|
if (typeof dispose === 'function') {
|
||||||
|
@ -7,7 +7,7 @@ import type {FormHorizontal} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* FieldSet 表单项集合
|
* FieldSet 表单项集合
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/fieldset
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/fieldset
|
||||||
*/
|
*/
|
||||||
export interface FieldSetControlSchema
|
export interface FieldSetControlSchema
|
||||||
extends Omit<FormBaseControl, 'size'>,
|
extends Omit<FormBaseControl, 'size'>,
|
||||||
|
@ -6,7 +6,7 @@ import {FormBaseControlSchema} from '../../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 公式功能控件。
|
* 公式功能控件。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/formula
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/formula
|
||||||
*/
|
*/
|
||||||
export interface FormulaControlSchema extends FormBaseControlSchema {
|
export interface FormulaControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ export type GroupSubControl = SchemaObject & {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Group 表单集合渲染器,能让多个表单在一行显示
|
* Group 表单集合渲染器,能让多个表单在一行显示
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/group
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/group
|
||||||
*/
|
*/
|
||||||
export interface GroupControlSchema extends FormBaseControlSchema {
|
export interface GroupControlSchema extends FormBaseControlSchema {
|
||||||
type: 'group';
|
type: 'group';
|
||||||
|
@ -4,7 +4,7 @@ import {FormBaseControlSchema} from '../../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Hidden 隐藏域。功能性组件
|
* Hidden 隐藏域。功能性组件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/hidden
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/hidden
|
||||||
*/
|
*/
|
||||||
export interface HiddenControlSchema extends FormBaseControlSchema {
|
export interface HiddenControlSchema extends FormBaseControlSchema {
|
||||||
type: 'hidden';
|
type: 'hidden';
|
||||||
|
@ -12,7 +12,7 @@ import {FormBaseControlSchema} from '../../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 图标选择器
|
* 图标选择器
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/icon-picker
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/icon-picker
|
||||||
*/
|
*/
|
||||||
export interface IconPickerControlSchema extends FormBaseControlSchema {
|
export interface IconPickerControlSchema extends FormBaseControlSchema {
|
||||||
type: 'icon-picker';
|
type: 'icon-picker';
|
||||||
@ -281,9 +281,7 @@ export default class IconPickerControl extends React.PureComponent<
|
|||||||
{!value || (inputValue && isOpen) ? null : (
|
{!value || (inputValue && isOpen) ? null : (
|
||||||
<div className={cx('IconPickerControl-value')}>
|
<div className={cx('IconPickerControl-value')}>
|
||||||
<i className={cx(value)} />
|
<i className={cx(value)} />
|
||||||
{
|
{typeof value === 'string' ? value : ''}
|
||||||
typeof value === 'string' ? value : ''
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import {SchemaCollection} from '../../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* InputArray 数组输入框。 combo 的别名。
|
* InputArray 数组输入框。 combo 的别名。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/array
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/array
|
||||||
*/
|
*/
|
||||||
export interface ArrayControlSchema
|
export interface ArrayControlSchema
|
||||||
extends Omit<
|
extends Omit<
|
||||||
|
@ -18,7 +18,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* City 城市选择框。
|
* City 城市选择框。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/city
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/city
|
||||||
*/
|
*/
|
||||||
export interface InputCityControlSchema
|
export interface InputCityControlSchema
|
||||||
extends FormBaseControlSchema,
|
extends FormBaseControlSchema,
|
||||||
|
@ -14,7 +14,7 @@ export const ColorPicker = React.lazy(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Color 颜色选择框
|
* Color 颜色选择框
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/color
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/color
|
||||||
*/
|
*/
|
||||||
export interface InputColorControlSchema extends FormBaseControlSchema {
|
export interface InputColorControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -8,8 +8,6 @@ import {
|
|||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import {filterDate, isPureVariable, resolveVariableAndFilter} from 'amis-core';
|
import {filterDate, isPureVariable, resolveVariableAndFilter} from 'amis-core';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import 'moment/locale/zh-cn';
|
|
||||||
import 'moment/locale/de';
|
|
||||||
import {DatePicker} from 'amis-ui';
|
import {DatePicker} from 'amis-ui';
|
||||||
import {FormBaseControlSchema, SchemaObject} from '../../Schema';
|
import {FormBaseControlSchema, SchemaObject} from '../../Schema';
|
||||||
import {createObject, anyChanged, isMobile, autobind} from 'amis-core';
|
import {createObject, anyChanged, isMobile, autobind} from 'amis-core';
|
||||||
@ -61,7 +59,7 @@ export interface InputDateBaseControlSchema extends FormBaseControlSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Date日期选择控件
|
* Date日期选择控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/date
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/date
|
||||||
*/
|
*/
|
||||||
export interface DateControlSchema extends InputDateBaseControlSchema {
|
export interface DateControlSchema extends InputDateBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
@ -99,7 +97,7 @@ export interface DateControlSchema extends InputDateBaseControlSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Datetime日期时间选择控件
|
* Datetime日期时间选择控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/datetime
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/datetime
|
||||||
*/
|
*/
|
||||||
export interface DateTimeControlSchema extends InputDateBaseControlSchema {
|
export interface DateTimeControlSchema extends InputDateBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
@ -144,7 +142,7 @@ export interface DateTimeControlSchema extends InputDateBaseControlSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Time 时间选择控件
|
* Time 时间选择控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/time
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/time
|
||||||
*/
|
*/
|
||||||
export interface TimeControlSchema extends InputDateBaseControlSchema {
|
export interface TimeControlSchema extends InputDateBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
@ -179,7 +177,7 @@ export interface TimeControlSchema extends InputDateBaseControlSchema {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Month 月份选择控件
|
* Month 月份选择控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/Month
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/Month
|
||||||
*/
|
*/
|
||||||
export interface MonthControlSchema extends InputDateBaseControlSchema {
|
export interface MonthControlSchema extends InputDateBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -7,8 +7,6 @@ import {
|
|||||||
} from 'amis-core';
|
} from 'amis-core';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import {filterDate, parseDuration} from 'amis-core';
|
import {filterDate, parseDuration} from 'amis-core';
|
||||||
import 'moment/locale/zh-cn';
|
|
||||||
import 'moment/locale/de';
|
|
||||||
import {DateRangePicker} from 'amis-ui';
|
import {DateRangePicker} from 'amis-ui';
|
||||||
import {isMobile, createObject, autobind} from 'amis-core';
|
import {isMobile, createObject, autobind} from 'amis-core';
|
||||||
import {ActionObject} from 'amis-core';
|
import {ActionObject} from 'amis-core';
|
||||||
@ -18,7 +16,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* DateRange 日期范围控件
|
* DateRange 日期范围控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/date-range
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/date-range
|
||||||
*/
|
*/
|
||||||
export interface DateRangeControlSchema extends FormBaseControlSchema {
|
export interface DateRangeControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -7,7 +7,7 @@ import type {CellValue, CellRichTextValue} from 'exceljs';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Excel 解析
|
* Excel 解析
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-excel
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/input-excel
|
||||||
*/
|
*/
|
||||||
export interface InputExcelControlSchema extends FormBaseControlSchema {
|
export interface InputExcelControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +32,7 @@ import omit from 'lodash/omit';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* File 文件上传控件
|
* File 文件上传控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/file
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/file
|
||||||
*/
|
*/
|
||||||
export interface FileControlSchema extends FormBaseControlSchema {
|
export interface FileControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,7 @@ import {FormBaseControlSchema, SchemaCollection} from '../../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* InputGroup
|
* InputGroup
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-group
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/input-group
|
||||||
*/
|
*/
|
||||||
export interface InputGroupControlSchema extends FormBaseControlSchema {
|
export interface InputGroupControlSchema extends FormBaseControlSchema {
|
||||||
type: 'input-group';
|
type: 'input-group';
|
||||||
|
@ -37,7 +37,7 @@ import {TplSchema} from '../Tpl';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Image 图片上传控件
|
* Image 图片上传控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/image
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/image
|
||||||
*/
|
*/
|
||||||
export interface ImageControlSchema extends FormBaseControlSchema {
|
export interface ImageControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -8,7 +8,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* MonthRange 月范围控件
|
* MonthRange 月范围控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/month-range
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/month-range
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface MonthRangeControlSchema
|
export interface MonthRangeControlSchema
|
||||||
|
@ -23,7 +23,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 数字输入框
|
* 数字输入框
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/number
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/number
|
||||||
*/
|
*/
|
||||||
export interface NumberControlSchema extends FormBaseControlSchema {
|
export interface NumberControlSchema extends FormBaseControlSchema {
|
||||||
type: 'input-number';
|
type: 'input-number';
|
||||||
|
@ -7,7 +7,7 @@ import {DateRangePicker} from 'amis-ui';
|
|||||||
import {supportStatic} from './StaticHoc';
|
import {supportStatic} from './StaticHoc';
|
||||||
/**
|
/**
|
||||||
* QuarterRange 季度范围控件
|
* QuarterRange 季度范围控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-quarter-range
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/input-quarter-range
|
||||||
*/
|
*/
|
||||||
export interface QuarterRangeControlSchema
|
export interface QuarterRangeControlSchema
|
||||||
extends Omit<DateRangeControlSchema, 'type'> {
|
extends Omit<DateRangeControlSchema, 'type'> {
|
||||||
|
@ -19,7 +19,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Range
|
* Range
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/range
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/range
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export type Value = string | MultipleValue | number | [number, number];
|
export type Value = string | MultipleValue | number | [number, number];
|
||||||
|
@ -14,7 +14,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Rating
|
* Rating
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/rating
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/rating
|
||||||
*/
|
*/
|
||||||
export interface RatingControlSchema extends FormBaseControlSchema {
|
export interface RatingControlSchema extends FormBaseControlSchema {
|
||||||
type: 'input-rating';
|
type: 'input-rating';
|
||||||
|
@ -11,7 +11,7 @@ import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Repeat
|
* Repeat
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/repeat
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/repeat
|
||||||
*/
|
*/
|
||||||
export interface RepeatControlSchema extends FormBaseControlSchema {
|
export interface RepeatControlSchema extends FormBaseControlSchema {
|
||||||
type: 'input-repeat';
|
type: 'input-repeat';
|
||||||
|
@ -15,7 +15,7 @@ import type {FormBaseControlSchema, SchemaApi} from '../../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* RichText
|
* RichText
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-rich-text
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/input-rich-text
|
||||||
*/
|
*/
|
||||||
export interface RichTextControlSchema extends FormBaseControlSchema {
|
export interface RichTextControlSchema extends FormBaseControlSchema {
|
||||||
type: 'input-rich-text';
|
type: 'input-rich-text';
|
||||||
|
@ -11,7 +11,7 @@ import {findDOMNode} from 'react-dom';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SubForm 子表单
|
* SubForm 子表单
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/subform
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/subform
|
||||||
*/
|
*/
|
||||||
export interface SubFormControlSchema extends FormBaseControlSchema {
|
export interface SubFormControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ import {TooltipWrapperSchema} from '../TooltipWrapper';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag 输入框
|
* Tag 输入框
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/tag
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/tag
|
||||||
*/
|
*/
|
||||||
export interface TagControlSchema extends FormOptionsSchema {
|
export interface TagControlSchema extends FormOptionsSchema {
|
||||||
type: 'input-tag';
|
type: 'input-tag';
|
||||||
|
@ -31,7 +31,7 @@ import type {ListenerAction} from 'amis-core';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Text 文本输入框。
|
* Text 文本输入框。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/text
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/text
|
||||||
*/
|
*/
|
||||||
export interface TextControlSchema extends FormOptionsSchema {
|
export interface TextControlSchema extends FormOptionsSchema {
|
||||||
type:
|
type:
|
||||||
|
@ -23,7 +23,7 @@ import type {ItemRenderStates} from 'amis-ui/lib/components/Selection';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tree 下拉选择框。
|
* Tree 下拉选择框。
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/tree
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/tree
|
||||||
*/
|
*/
|
||||||
export interface TreeControlSchema extends FormOptionsSchema {
|
export interface TreeControlSchema extends FormOptionsSchema {
|
||||||
type: 'input-tree';
|
type: 'input-tree';
|
||||||
|
@ -8,7 +8,7 @@ import {supportStatic} from './StaticHoc';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* YearRange 年份范围控件
|
* YearRange 年份范围控件
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-year-range
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/input-year-range
|
||||||
*/
|
*/
|
||||||
export interface YearRangeControlSchema
|
export interface YearRangeControlSchema
|
||||||
extends Omit<DateRangeControlSchema, 'type'> {
|
extends Omit<DateRangeControlSchema, 'type'> {
|
||||||
|
@ -6,7 +6,7 @@ import {FormBaseControlSchema} from '../../Schema';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON Schema
|
* JSON Schema
|
||||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema
|
* 文档:https://aisuda.bce.baidu.com/amis/zh-CN/components/form/json-schema
|
||||||
*/
|
*/
|
||||||
export interface JSONSchemaControlSchema extends FormBaseControlSchema {
|
export interface JSONSchemaControlSchema extends FormBaseControlSchema {
|
||||||
/**
|
/**
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user