amis-editor 5.4.0 → 5.4.1
Sign up to get free protection for your applications and to get access to all the features.
- package/esm/component/TableViewEditor.d.ts +2 -2
- package/esm/locale/en-US.js +57 -1
- package/esm/locale/zh-CN.js +57 -1
- package/esm/plugin/CRUD.d.ts +3 -2
- package/esm/plugin/CRUD.js +157 -1
- package/esm/plugin/Dialog.d.ts +1 -1
- package/esm/plugin/Dialog.js +4 -4
- package/esm/plugin/Form/Combo.d.ts +5 -2
- package/esm/plugin/Form/Combo.js +34 -11
- package/esm/plugin/Form/Form.js +6 -2
- package/esm/plugin/Form/InputDateRange.js +4 -24
- package/esm/plugin/Form/InputRichText.d.ts +0 -1
- package/esm/plugin/Form/InputRichText.js +0 -1
- package/esm/plugin/Form/InputTable.d.ts +4 -1
- package/esm/plugin/Form/InputTable.js +100 -77
- package/esm/plugin/TableView.d.ts +2 -1
- package/esm/plugin/Tabs.d.ts +2 -1
- package/esm/renderer/APIAdaptorControl.d.ts +1 -1
- package/esm/renderer/APIControl.d.ts +4 -4
- package/esm/renderer/ActionApiControl.d.ts +3 -3
- package/esm/renderer/BadgeControl.d.ts +1 -1
- package/esm/renderer/ButtonGroupControl.d.ts +1 -1
- package/esm/renderer/ColumnControl.d.ts +1 -1
- package/esm/renderer/DataBindingControl.d.ts +2 -2
- package/esm/renderer/DataPickerControl.d.ts +1 -1
- package/esm/renderer/DateShortCutControl.d.ts +53 -29
- package/esm/renderer/DateShortCutControl.js +182 -140
- package/esm/renderer/ExpressionFormulaControl.d.ts +1 -1
- package/esm/renderer/FeatureControl.d.ts +2 -2
- package/esm/renderer/FlexSettingControl.d.ts +1 -1
- package/esm/renderer/FormulaControl.d.ts +8 -3
- package/esm/renderer/FormulaControl.js +76 -8
- package/esm/renderer/GoConfigControl.d.ts +1 -1
- package/esm/renderer/MapSourceControl.d.ts +3 -3
- package/esm/renderer/NavBadgeControl.d.ts +1 -1
- package/esm/renderer/NavSourceControl.d.ts +4 -4
- package/esm/renderer/OptionControl.d.ts +3 -3
- package/esm/renderer/RangePartsControl.d.ts +5 -5
- package/esm/renderer/StatusControl.d.ts +2 -2
- package/esm/renderer/SwitchMoreControl.d.ts +4 -4
- package/esm/renderer/TimelineItemControl.d.ts +4 -4
- package/esm/renderer/TplFormulaControl.d.ts +1 -1
- package/esm/renderer/TransferTableControl.d.ts +3 -3
- package/esm/renderer/TreeOptionControl.d.ts +3 -3
- package/esm/renderer/ValidationControl.d.ts +4 -4
- package/esm/renderer/ValidationItem.d.ts +3 -3
- package/esm/renderer/event-control/comp-action-select.d.ts +1 -1
- package/esm/renderer/event-control/index.d.ts +2 -2
- package/esm/renderer/style-control/Background.d.ts +1 -1
- package/esm/renderer/style-control/Border.d.ts +2 -2
- package/esm/renderer/style-control/BoxModel.d.ts +2 -2
- package/esm/renderer/style-control/BoxShadow.d.ts +2 -2
- package/esm/renderer/style-control/Display.d.ts +1 -1
- package/esm/renderer/style-control/Font.d.ts +1 -1
- package/esm/renderer/style-control/InsetBoxModel.d.ts +2 -2
- package/esm/renderer/style-control/ThemeCssCode.d.ts +1 -1
- package/esm/renderer/textarea-formula/TextareaFormulaControl.d.ts +1 -1
- package/esm/tpl/common.js +2 -1
- package/lib/component/TableViewEditor.d.ts +2 -2
- package/lib/locale/en-US.js +57 -1
- package/lib/locale/zh-CN.js +57 -1
- package/lib/plugin/CRUD.d.ts +3 -2
- package/lib/plugin/CRUD.js +157 -1
- package/lib/plugin/Dialog.d.ts +1 -1
- package/lib/plugin/Dialog.js +4 -4
- package/lib/plugin/Form/Combo.d.ts +5 -2
- package/lib/plugin/Form/Combo.js +32 -9
- package/lib/plugin/Form/Form.js +6 -2
- package/lib/plugin/Form/InputDateRange.js +4 -24
- package/lib/plugin/Form/InputRichText.d.ts +0 -1
- package/lib/plugin/Form/InputRichText.js +0 -1
- package/lib/plugin/Form/InputTable.d.ts +4 -1
- package/lib/plugin/Form/InputTable.js +99 -76
- package/lib/plugin/TableView.d.ts +2 -1
- package/lib/plugin/Tabs.d.ts +2 -1
- package/lib/renderer/APIAdaptorControl.d.ts +1 -1
- package/lib/renderer/APIControl.d.ts +4 -4
- package/lib/renderer/ActionApiControl.d.ts +3 -3
- package/lib/renderer/BadgeControl.d.ts +7 -7
- package/lib/renderer/ButtonGroupControl.d.ts +1 -1
- package/lib/renderer/ColumnControl.d.ts +1 -1
- package/lib/renderer/DataBindingControl.d.ts +2 -2
- package/lib/renderer/DataPickerControl.d.ts +1 -1
- package/lib/renderer/DateShortCutControl.d.ts +53 -29
- package/lib/renderer/DateShortCutControl.js +181 -139
- package/lib/renderer/ExpressionFormulaControl.d.ts +1 -1
- package/lib/renderer/FeatureControl.d.ts +2 -2
- package/lib/renderer/FlexSettingControl.d.ts +1 -1
- package/lib/renderer/FormulaControl.d.ts +8 -3
- package/lib/renderer/FormulaControl.js +76 -8
- package/lib/renderer/GoConfigControl.d.ts +1 -1
- package/lib/renderer/MapSourceControl.d.ts +3 -3
- package/lib/renderer/NavBadgeControl.d.ts +7 -7
- package/lib/renderer/NavSourceControl.d.ts +4 -4
- package/lib/renderer/OptionControl.d.ts +3 -3
- package/lib/renderer/RangePartsControl.d.ts +5 -5
- package/lib/renderer/StatusControl.d.ts +2 -2
- package/lib/renderer/SwitchMoreControl.d.ts +4 -4
- package/lib/renderer/TimelineItemControl.d.ts +4 -4
- package/lib/renderer/TplFormulaControl.d.ts +1 -1
- package/lib/renderer/TransferTableControl.d.ts +3 -3
- package/lib/renderer/TreeOptionControl.d.ts +3 -3
- package/lib/renderer/ValidationControl.d.ts +4 -4
- package/lib/renderer/ValidationItem.d.ts +3 -3
- package/lib/renderer/event-control/comp-action-select.d.ts +1 -1
- package/lib/renderer/event-control/index.d.ts +2 -2
- package/lib/renderer/style-control/Background.d.ts +1 -1
- package/lib/renderer/style-control/Border.d.ts +2 -2
- package/lib/renderer/style-control/BoxModel.d.ts +2 -2
- package/lib/renderer/style-control/BoxShadow.d.ts +2 -2
- package/lib/renderer/style-control/Display.d.ts +1 -1
- package/lib/renderer/style-control/Font.d.ts +1 -1
- package/lib/renderer/style-control/InsetBoxModel.d.ts +2 -2
- package/lib/renderer/style-control/ThemeCssCode.d.ts +1 -1
- package/lib/renderer/textarea-formula/TextareaFormulaControl.d.ts +1 -1
- package/lib/tpl/common.js +2 -1
- package/package.json +2 -2
package/lib/locale/zh-CN.js
CHANGED
@@ -3197,5 +3197,61 @@ i18nRuntime.extendLocale('zh-CN', {
|
|
3197
3197
|
'e8bf039de5dc6751c4045f55930e0c83': '鼠标移出行事件',
|
3198
3198
|
'f1ca0d305f3251a81f361a2dc8e11fff': '移出整行时触发',
|
3199
3199
|
'41c5c859a80b635c23b3b4d1d8b44efb': '已选中行',
|
3200
|
-
'f87912f19be48f36e4e261e585764d6e': '未选中行'
|
3200
|
+
'f87912f19be48f36e4e261e585764d6e': '未选中行',
|
3201
|
+
'f97f8b90f09fb7df39c5c9ae3554b4c7': '更新列表记录',
|
3202
|
+
'0449dab523020003eee89a0751e1c003': '内容区域自适应高度',
|
3203
|
+
'e406488d1b9545168eb1896e35139bf2': '确认按钮文案',
|
3204
|
+
'd919d62d7e5ec5cb63ad47e5dc347a7e': '取消按钮文案',
|
3205
|
+
'b12df8decf62700970e08b9b2ebce1f8': '确认按钮样式',
|
3206
|
+
'7f29931020c2d8ce97b8043a933db151': '取消按钮样式',
|
3207
|
+
'1b43b43e692a5b6b2f6ec1417791a550': '远程请求轮询结束',
|
3208
|
+
'0de773dedbe5875ca4529e7d0ce9d2bf': 'asyncApi 远程请求轮询结束后触发',
|
3209
|
+
'9bf078fb5589f2c09031f1f2b5a8d2b1': '设置此属性后,表单提交发送保存接口后,还会继续轮询请求该接口,直到返回 finished 属性为 true 才 结束',
|
3210
|
+
'f63ba7e3c9d8de0b8b4f769055a36d2e': '设置此属性后,表单请求 initApi 后,还会继续轮询请求该接口,直到返回 finished 属性为 true 才 结束',
|
3211
|
+
'58477471b3bb8ad53fe9ab18a244868b': '添加行',
|
3212
|
+
'6070fdf451b08e4302a7dab560771222': '点击左下角添加按钮 或 某一行右侧操作栏添加按钮时触发',
|
3213
|
+
'c9f63503ee66082fc00c3e6eac57a95f': '列表记录',
|
3214
|
+
'7b25d5ff93da66fe95b5409731bb9838': '新增行记录索引',
|
3215
|
+
'5e3640e4bc8efbe00a7b7c6ba169560c': '确认添加',
|
3216
|
+
'008ae858112dcc7739985045e4326f3a': '开启”确认模式“,点击添加按钮,填入数据后点击“保存”按钮后触发',
|
3217
|
+
'1fb1cbe49c3e72c2b5f4e0151a4cb5d9': '新增行记录',
|
3218
|
+
'3fdaeadf0e8a3154ae62784f04138c28': '添加成功',
|
3219
|
+
'bd4ef227fe8aae88ae6aa97236c0e9bb': '开启”确认模式“并且配置”新增接口“,点击“保存”后成功添加时触发',
|
3220
|
+
'6452a05591d7402a8bcd9fadc950c449': '添加失败',
|
3221
|
+
'bd7c39d10dbf6985d2be2d9a4fdcccf7': '开启”确认模式“并且配置”新增接口“,点击“保存”后调用接口失败时触发',
|
3222
|
+
'37122b9e4499da38258b3d51b09d68a1': '请求失败后接口返回的错误信息',
|
3223
|
+
'88ebffeee507da0f0d039eb2d05f7e2c': '编辑行',
|
3224
|
+
'daf24d1f83e1b4fce2f57a6b041ddba6': '点击某一行右侧操作栏“编辑”按钮时触发',
|
3225
|
+
'a9e009a9936bf5bcc9d4eabcb3e952e0': '所在行记录',
|
3226
|
+
'e756ec22a0f897c4dd886c5f4a95b7a6': '所在行记录索引',
|
3227
|
+
'4271f29faca65d7840ad6bb2c4a7b8c6': '确认编辑',
|
3228
|
+
'562f54a2fec7a68f85ff192a68cf69f2': '开启”确认模式“,点击“编辑”按钮,填入数据后点击“保存”按钮后触发',
|
3229
|
+
'3bb47b67994cb374e601fab35f63bc8e': '编辑成功',
|
3230
|
+
'b394745a8a77179da0000293638e8a56': '开启”确认模式“并且配置”编辑接口“,点击“保存”后成功编辑时触发',
|
3231
|
+
'9304e8f4c324b5882b550caa971b64b8': '编辑失败',
|
3232
|
+
'b9d277c3ffab7d4b955ad10308c7ae0a': '开启”确认模式“并且配置”编辑接口“,点击“保存”后调用接口失败时触发',
|
3233
|
+
'650bccdd6f99fe5fc4ca6cb8788e7cb4': '请求错误后返回的错误信息',
|
3234
|
+
'947fa341a6d676d7f25bae6bef8342cd': '删除行',
|
3235
|
+
'7508f6d66d920323d87a9f9d58487a40': '点击某一行右侧操作栏“删除”按钮时触发',
|
3236
|
+
'0007d170de017dafc266aa03926d7f00': '删除成功',
|
3237
|
+
'13640e78822f62b7b71bfabb4604025e': '配置了“删除接口”,调用接口成功时触发',
|
3238
|
+
'acf0664a54dc58d9d0377bb56e162092': '删除失败',
|
3239
|
+
'14d36ca583bcbfc5516a000eb06ccedd': '配置了“删除接口”,调用接口失败时触发',
|
3240
|
+
'692dc28abc42931daca8fa12d69d5c99': '表格数据发生改变时触发',
|
3241
|
+
'f8692d409bb7f122a374872e01efd03a': '添加行数据',
|
3242
|
+
'459fd144ee129b501545d19c169269e9': '插入位置',
|
3243
|
+
'196e71fa869b8410088b4ceb54aa7988': '请输入行号,为空则在头部插入',
|
3244
|
+
'a26858cccbc451fd53515416a5968550': '新增一行',
|
3245
|
+
'c520ed9911d349c7974116d3d1e1423e': '新增字段',
|
3246
|
+
'344c1c96f9cb3275f972929755b4e238': '删除某一行数据',
|
3247
|
+
'8910acd418e45a30f01e7e531b90b61b': '删除方式',
|
3248
|
+
'ebf62450c3fb11c0b7e06da2d7535d6c': '指定行号',
|
3249
|
+
'4bf7636a84714fac140e42b4cee242d4': '条件表达式',
|
3250
|
+
'7708fb1394ce722ee73326437a66c77a': '删除范围',
|
3251
|
+
'015f108b96c70bba6511091e159db0ac': '请输入行号,输入多个则用英文逗号分隔',
|
3252
|
+
'63aeb2082d7cc0a316fc1e44913d7749': '删除条件',
|
3253
|
+
'4622a4ce221f9b79aa3396cc461adc75': '清空组件数据',
|
3254
|
+
'800dfdd90200bd47bb4bb83def4fea56': '今天',
|
3255
|
+
'a6a93b404bc039cded728683af5d625d': '快捷键名称',
|
3256
|
+
'快去添加事件,让你的产品动起来吧': '快去添加事件,让你的产品动起来吧'
|
3201
3257
|
});
|
package/lib/plugin/CRUD.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import { BasePlugin, BasicRendererInfo, BasicSubRenderInfo, ChangeEventContext, PluginEvent, RendererEventContext, RendererInfoResolveEventContext, ScaffoldForm, SubRendererInfo } from 'amis-editor-core';
|
2
3
|
import type { CRUDCommonSchema } from 'amis';
|
3
4
|
import type { EditorNodeType, RendererPluginAction, RendererPluginEvent } from 'amis-editor-core';
|
@@ -122,8 +123,8 @@ export declare class CRUDPlugin extends BasePlugin {
|
|
122
123
|
*/
|
123
124
|
buildSubRenderers(context: RendererEventContext, renderers: Array<SubRendererInfo>): BasicSubRenderInfo | Array<BasicSubRenderInfo> | void;
|
124
125
|
getRendererInfo(context: RendererInfoResolveEventContext): BasicRendererInfo | void;
|
125
|
-
renderEditableComponents(props: any): JSX.Element | null;
|
126
|
-
renderRenderer(props: any): JSX.Element;
|
126
|
+
renderEditableComponents(props: any): React.JSX.Element | null;
|
127
|
+
renderRenderer(props: any): React.JSX.Element;
|
127
128
|
filterProps(props: any): any;
|
128
129
|
afterUpdate(event: PluginEvent<ChangeEventContext>): void;
|
129
130
|
buildDataSchemas(node: EditorNodeType, region?: EditorNodeType, trigger?: EditorNodeType): Promise<any>;
|
package/lib/plugin/CRUD.js
CHANGED
@@ -12,6 +12,7 @@ var amis = require('amis');
|
|
12
12
|
var get = require('lodash/get');
|
13
13
|
var cloneDeep = require('lodash/cloneDeep');
|
14
14
|
var React = require('react');
|
15
|
+
var helper = require('../renderer/event-control/helper.js');
|
15
16
|
var amisEditorCore = require('amis-editor-core');
|
16
17
|
var amisCore = require('amis-core');
|
17
18
|
var mobxStateTree = require('mobx-state-tree');
|
@@ -83,11 +84,160 @@ var CRUDPlugin = /** @class */function (_super) {
|
|
83
84
|
}
|
84
85
|
}
|
85
86
|
}]
|
87
|
+
}, {
|
88
|
+
eventName: 'selectedChange',
|
89
|
+
eventLabel: i18nRuntime.i18n("257f5a3886d87d2255206f86b880d07e"),
|
90
|
+
description: i18nRuntime.i18n("6130b1f75d624b2f73f5d923492e92f7"),
|
91
|
+
dataSchema: [{
|
92
|
+
type: 'object',
|
93
|
+
properties: {
|
94
|
+
'event.data.selectedItems': {
|
95
|
+
type: 'array',
|
96
|
+
title: i18nRuntime.i18n("aeddca0456d8fe520dc95545a83458e9")
|
97
|
+
},
|
98
|
+
'event.data.unSelectedItems': {
|
99
|
+
type: 'array',
|
100
|
+
title: i18nRuntime.i18n("4f907cb94921bb62a8399adec922bb60")
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}]
|
104
|
+
}, {
|
105
|
+
eventName: 'columnSort',
|
106
|
+
eventLabel: i18nRuntime.i18n("f3d21138c8ecf5683503c4f814cc7199"),
|
107
|
+
description: i18nRuntime.i18n("d84464cfb2a5828a200fe9c28a323122"),
|
108
|
+
dataSchema: [{
|
109
|
+
type: 'object',
|
110
|
+
properties: {
|
111
|
+
'event.data.orderBy': {
|
112
|
+
type: 'string',
|
113
|
+
title: i18nRuntime.i18n("652f155e644e82ebb0a1aed97ab6ab23")
|
114
|
+
},
|
115
|
+
'event.data.orderDir': {
|
116
|
+
type: 'string',
|
117
|
+
title: i18nRuntime.i18n("460e3a697d1680445a47139c0816fbe6")
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}]
|
121
|
+
}, {
|
122
|
+
eventName: 'columnFilter',
|
123
|
+
eventLabel: i18nRuntime.i18n("3d0b957a99d0c366612c01913e17a0c7"),
|
124
|
+
description: i18nRuntime.i18n("b35963687361af98e6acdc004e87fc3c"),
|
125
|
+
dataSchema: [{
|
126
|
+
type: 'object',
|
127
|
+
properties: {
|
128
|
+
'event.data.filterName': {
|
129
|
+
type: 'string',
|
130
|
+
title: i18nRuntime.i18n("ad11fba3ac676233f3105e76e7de0501")
|
131
|
+
},
|
132
|
+
'event.data.filterValue': {
|
133
|
+
type: 'string',
|
134
|
+
title: i18nRuntime.i18n("8e4b9c88c51aaad1a28a28e8b536697f")
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}]
|
138
|
+
}, {
|
139
|
+
eventName: 'columnSearch',
|
140
|
+
eventLabel: i18nRuntime.i18n("93a5a0253f11e3a2e58f4e87a52fb094"),
|
141
|
+
description: i18nRuntime.i18n("6d4c4990ab2c32efe8a17c5f22e10cb5"),
|
142
|
+
dataSchema: [{
|
143
|
+
type: 'object',
|
144
|
+
properties: {
|
145
|
+
'event.data.searchName': {
|
146
|
+
type: 'string',
|
147
|
+
title: i18nRuntime.i18n("a80a4486100baf3f45fab3a59e4a816d")
|
148
|
+
},
|
149
|
+
'event.data.searchValue': {
|
150
|
+
type: 'object',
|
151
|
+
title: i18nRuntime.i18n("b9a565fe1dc488efae1d63464f277f09")
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}]
|
155
|
+
}, {
|
156
|
+
eventName: 'orderChange',
|
157
|
+
eventLabel: i18nRuntime.i18n("85ddd38957256b6e9026f42ed570bc35"),
|
158
|
+
description: i18nRuntime.i18n("d7a66def82af88cd5d408e38feb8a65a"),
|
159
|
+
dataSchema: [{
|
160
|
+
type: 'object',
|
161
|
+
properties: {
|
162
|
+
'event.data.movedItems': {
|
163
|
+
type: 'array',
|
164
|
+
title: i18nRuntime.i18n("1987561c006c7192ab619f81103d2a2f")
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}]
|
168
|
+
}, {
|
169
|
+
eventName: 'columnToggled',
|
170
|
+
eventLabel: i18nRuntime.i18n("ecfebbc91e2c18a512aeb11b7da15193"),
|
171
|
+
description: i18nRuntime.i18n("c94f45773a42dc386b9c9dcdc6fa542b"),
|
172
|
+
dataSchema: [{
|
173
|
+
type: 'object',
|
174
|
+
properties: {
|
175
|
+
'event.data.columns': {
|
176
|
+
type: 'array',
|
177
|
+
title: i18nRuntime.i18n("70567329ee851a5ba7e7301bd8e9d9a1")
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}]
|
181
|
+
}, {
|
182
|
+
eventName: 'rowClick',
|
183
|
+
eventLabel: i18nRuntime.i18n("76e47871d654c3b0b0e301c0a076e55a"),
|
184
|
+
description: i18nRuntime.i18n("cc13521eab2c7423b3fb857772405cc3"),
|
185
|
+
dataSchema: [{
|
186
|
+
type: 'object',
|
187
|
+
properties: {
|
188
|
+
'event.data.item': {
|
189
|
+
type: 'object',
|
190
|
+
title: i18nRuntime.i18n("7bb4a8abc423086dbd1edeed4cd3f718")
|
191
|
+
},
|
192
|
+
'event.data.index': {
|
193
|
+
type: 'number',
|
194
|
+
title: i18nRuntime.i18n("f74fd69ce55e3f96fe9a032c0da42330")
|
195
|
+
}
|
196
|
+
}
|
197
|
+
}]
|
198
|
+
}, {
|
199
|
+
eventName: 'rowMouseEnter',
|
200
|
+
eventLabel: i18nRuntime.i18n("5db079b140feffa84c84d1b51d824dea"),
|
201
|
+
description: i18nRuntime.i18n("90a5608bcd85a3cfcfbb5263a229915c"),
|
202
|
+
dataSchema: [{
|
203
|
+
type: 'object',
|
204
|
+
properties: {
|
205
|
+
'event.data.item': {
|
206
|
+
type: 'object',
|
207
|
+
title: i18nRuntime.i18n("7bb4a8abc423086dbd1edeed4cd3f718")
|
208
|
+
},
|
209
|
+
'event.data.index': {
|
210
|
+
type: 'number',
|
211
|
+
title: i18nRuntime.i18n("f74fd69ce55e3f96fe9a032c0da42330")
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}]
|
215
|
+
}, {
|
216
|
+
eventName: 'rowMouseLeave',
|
217
|
+
eventLabel: i18nRuntime.i18n("e8bf039de5dc6751c4045f55930e0c83"),
|
218
|
+
description: i18nRuntime.i18n("f1ca0d305f3251a81f361a2dc8e11fff"),
|
219
|
+
dataSchema: [{
|
220
|
+
type: 'object',
|
221
|
+
properties: {
|
222
|
+
'event.data.item': {
|
223
|
+
type: 'object',
|
224
|
+
title: i18nRuntime.i18n("7bb4a8abc423086dbd1edeed4cd3f718")
|
225
|
+
},
|
226
|
+
'event.data.index': {
|
227
|
+
type: 'number',
|
228
|
+
title: i18nRuntime.i18n("f74fd69ce55e3f96fe9a032c0da42330")
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}]
|
86
232
|
}];
|
87
233
|
_this.actions = [{
|
88
234
|
actionType: 'reload',
|
89
235
|
actionLabel: i18nRuntime.i18n("64ca9bab920a2983bcf270320d850d00"),
|
90
236
|
description: i18nRuntime.i18n("9ef5597ac0b4da662bcd967da37eceb4")
|
237
|
+
}, {
|
238
|
+
actionLabel: i18nRuntime.i18n("e22855f53b7a1ab33e920375c0cd0e3d"),
|
239
|
+
actionType: 'setValue',
|
240
|
+
description: i18nRuntime.i18n("f97f8b90f09fb7df39c5c9ae3554b4c7")
|
91
241
|
}];
|
92
242
|
_this.btnSchemas = {
|
93
243
|
create: {
|
@@ -888,7 +1038,7 @@ var CRUDPlugin = /** @class */function (_super) {
|
|
888
1038
|
label: i18nRuntime.i18n("fa9417bacb7714e82663655345ca213d")
|
889
1039
|
}), amisEditorCore.getSchemaTpl('switch', {
|
890
1040
|
name: 'autoFillHeight',
|
891
|
-
label:
|
1041
|
+
label: i18nRuntime.i18n("0449dab523020003eee89a0751e1c003")
|
892
1042
|
}), amisEditorCore.getSchemaTpl('switch', {
|
893
1043
|
name: 'hideCheckToggler',
|
894
1044
|
label: i18nRuntime.i18n("e3d2a85f20608a5bde7d539969d03167"),
|
@@ -897,6 +1047,12 @@ var CRUDPlugin = /** @class */function (_super) {
|
|
897
1047
|
name: 'bodyClassName',
|
898
1048
|
label: i18nRuntime.i18n("af1af0a7fad9e8bdcd21694d0e036e12")
|
899
1049
|
})]
|
1050
|
+
}, {
|
1051
|
+
title: i18nRuntime.i18n("10b2761db5a8e089049df39675abc550"),
|
1052
|
+
className: 'p-none',
|
1053
|
+
body: [amisEditorCore.getSchemaTpl('eventControl', tslib.__assign({
|
1054
|
+
name: 'onEvent'
|
1055
|
+
}, helper.getEventControlConfig(_this.manager, context)))]
|
900
1056
|
}, {
|
901
1057
|
title: i18nRuntime.i18n("0d98c74797e49d00bcc4c17c9d557a2b"),
|
902
1058
|
body: [amisEditorCore.getSchemaTpl('ref'), {
|
package/lib/plugin/Dialog.d.ts
CHANGED
package/lib/plugin/Dialog.js
CHANGED
@@ -119,13 +119,13 @@ var DialogPlugin = /** @class */function (_super) {
|
|
119
119
|
}, amisEditorCore.getSchemaTpl('layout:originPosition', {
|
120
120
|
value: 'left-top'
|
121
121
|
}), {
|
122
|
-
label:
|
122
|
+
label: i18nRuntime.i18n("e406488d1b9545168eb1896e35139bf2"),
|
123
123
|
type: 'input-text',
|
124
124
|
name: 'confirmText'
|
125
125
|
}, amisEditorCore.getSchemaTpl('layout:originPosition', {
|
126
126
|
value: 'left-top'
|
127
127
|
}), {
|
128
|
-
label:
|
128
|
+
label: i18nRuntime.i18n("d919d62d7e5ec5cb63ad47e5dc347a7e"),
|
129
129
|
type: 'input-text',
|
130
130
|
name: 'cancelText'
|
131
131
|
}, amisEditorCore.getSchemaTpl('switch', {
|
@@ -164,10 +164,10 @@ var DialogPlugin = /** @class */function (_super) {
|
|
164
164
|
return value ? value : undefined;
|
165
165
|
}
|
166
166
|
}, amisEditorCore.getSchemaTpl('buttonLevel', {
|
167
|
-
label:
|
167
|
+
label: i18nRuntime.i18n("b12df8decf62700970e08b9b2ebce1f8"),
|
168
168
|
name: 'confirmBtnLevel'
|
169
169
|
}), amisEditorCore.getSchemaTpl('buttonLevel', {
|
170
|
-
label:
|
170
|
+
label: i18nRuntime.i18n("7f29931020c2d8ce97b8043a933db151"),
|
171
171
|
name: 'cancelBtnLevel'
|
172
172
|
})]
|
173
173
|
}])
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BasePlugin, RendererPluginEvent, RendererPluginAction, RegionConfig } from 'amis-editor-core';
|
1
|
+
import { BasePlugin, RendererPluginEvent, RendererPluginAction, RegionConfig, EditorNodeType, EditorManager, DSBuilderManager } from 'amis-editor-core';
|
2
2
|
export declare class ComboControlPlugin extends BasePlugin {
|
3
3
|
rendererName: string;
|
4
4
|
$schema: string;
|
@@ -39,12 +39,15 @@ export declare class ComboControlPlugin extends BasePlugin {
|
|
39
39
|
})[];
|
40
40
|
};
|
41
41
|
previewSchema: any;
|
42
|
+
regions: Array<RegionConfig>;
|
42
43
|
events: RendererPluginEvent[];
|
43
44
|
actions: RendererPluginAction[];
|
44
45
|
panelTitle: string;
|
45
46
|
notRenderFormZone: boolean;
|
46
47
|
panelJustify: boolean;
|
48
|
+
dsBuilderManager: DSBuilderManager;
|
49
|
+
constructor(manager: EditorManager);
|
47
50
|
panelBodyCreator: (context: BaseEventContext) => any;
|
48
51
|
filterProps(props: any): any;
|
49
|
-
|
52
|
+
getAvailableContextFields(scopeNode: EditorNodeType, target: EditorNodeType, region?: EditorNodeType): Promise<any>;
|
50
53
|
}
|
package/lib/plugin/Form/Combo.js
CHANGED
@@ -16,8 +16,8 @@ var i18nRuntime = require('i18n-runtime');
|
|
16
16
|
|
17
17
|
var ComboControlPlugin = /** @class */function (_super) {
|
18
18
|
tslib.__extends(ComboControlPlugin, _super);
|
19
|
-
function ComboControlPlugin() {
|
20
|
-
var _this = _super
|
19
|
+
function ComboControlPlugin(manager) {
|
20
|
+
var _this = _super.call(this, manager) || this;
|
21
21
|
// 关联渲染器名字
|
22
22
|
_this.rendererName = 'combo';
|
23
23
|
_this.$schema = '/schemas/ComboControlSchema.json';
|
@@ -72,6 +72,13 @@ var ComboControlPlugin = /** @class */function (_super) {
|
|
72
72
|
}, {}]
|
73
73
|
})]
|
74
74
|
};
|
75
|
+
// 容器配置
|
76
|
+
_this.regions = [{
|
77
|
+
key: 'items',
|
78
|
+
label: i18nRuntime.i18n("132a78bdf68d6d17bde00aa807bbf032"),
|
79
|
+
preferTag: i18nRuntime.i18n("132a78bdf68d6d17bde00aa807bbf032"),
|
80
|
+
renderMethod: 'renderItems'
|
81
|
+
}];
|
75
82
|
// 事件定义
|
76
83
|
_this.events = [{
|
77
84
|
eventName: 'add',
|
@@ -458,13 +465,7 @@ var ComboControlPlugin = /** @class */function (_super) {
|
|
458
465
|
}, helper.getEventControlConfig(_this.manager, context)))]
|
459
466
|
}]);
|
460
467
|
};
|
461
|
-
|
462
|
-
_this.regions = [{
|
463
|
-
key: 'items',
|
464
|
-
label: i18nRuntime.i18n("132a78bdf68d6d17bde00aa807bbf032"),
|
465
|
-
preferTag: i18nRuntime.i18n("132a78bdf68d6d17bde00aa807bbf032"),
|
466
|
-
renderMethod: 'renderItems'
|
467
|
-
}];
|
468
|
+
_this.dsBuilderManager = new amisEditorCore.DSBuilderManager('combo', 'api');
|
468
469
|
return _this;
|
469
470
|
}
|
470
471
|
ComboControlPlugin.prototype.filterProps = function (props) {
|
@@ -481,6 +482,28 @@ var ComboControlPlugin = /** @class */function (_super) {
|
|
481
482
|
}
|
482
483
|
return props;
|
483
484
|
};
|
485
|
+
ComboControlPlugin.prototype.getAvailableContextFields = function (scopeNode, target, region) {
|
486
|
+
var _a, _b;
|
487
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
488
|
+
var scope, builder;
|
489
|
+
return tslib.__generator(this, function (_c) {
|
490
|
+
if (target.parent.isRegion && target.parent.region === 'items') {
|
491
|
+
scope = scopeNode.parent.parent;
|
492
|
+
builder = this.dsBuilderManager.resolveBuilderBySchema(scope.schema, 'api');
|
493
|
+
if (builder && scope.schema.api) {
|
494
|
+
return [2 /*return*/, builder.getAvailableContextFileds({
|
495
|
+
schema: scope.schema,
|
496
|
+
sourceKey: 'api',
|
497
|
+
feat: (_b = (_a = scope.schema) === null || _a === void 0 ? void 0 : _a.feat) !== null && _b !== void 0 ? _b : 'List',
|
498
|
+
scopeNode: scopeNode
|
499
|
+
}, target)];
|
500
|
+
}
|
501
|
+
}
|
502
|
+
return [2 /*return*/];
|
503
|
+
});
|
504
|
+
});
|
505
|
+
};
|
506
|
+
|
484
507
|
return ComboControlPlugin;
|
485
508
|
}(amisEditorCore.BasePlugin);
|
486
509
|
amisEditorCore.registerEditorPlugin(ComboControlPlugin);
|
package/lib/plugin/Form/Form.js
CHANGED
@@ -276,6 +276,10 @@ var FormPlugin = /** @class */function (_super) {
|
|
276
276
|
}
|
277
277
|
}
|
278
278
|
}]
|
279
|
+
}, {
|
280
|
+
eventName: 'asyncApiFinished',
|
281
|
+
eventLabel: i18nRuntime.i18n("1b43b43e692a5b6b2f6ec1417791a550"),
|
282
|
+
description: i18nRuntime.i18n("0de773dedbe5875ca4529e7d0ce9d2bf")
|
279
283
|
}];
|
280
284
|
// 动作定义
|
281
285
|
_this.actions = [{
|
@@ -448,7 +452,7 @@ var FormPlugin = /** @class */function (_super) {
|
|
448
452
|
name: 'asyncApi',
|
449
453
|
label: i18nRuntime.i18n("daf3aec137ac74941adb1b1d3e3dd1d3"),
|
450
454
|
visibleOn: 'data.asyncApi != null',
|
451
|
-
description: i18nRuntime.i18n("
|
455
|
+
description: i18nRuntime.i18n("9bf078fb5589f2c09031f1f2b5a8d2b1")
|
452
456
|
}), {
|
453
457
|
type: 'divider'
|
454
458
|
}, amisEditorCore.getSchemaTpl('apiControl', {
|
@@ -520,7 +524,7 @@ var FormPlugin = /** @class */function (_super) {
|
|
520
524
|
name: 'initAsyncApi',
|
521
525
|
label: i18nRuntime.i18n("daf3aec137ac74941adb1b1d3e3dd1d3"),
|
522
526
|
visibleOn: 'data.initAsyncApi != null',
|
523
|
-
description: i18nRuntime.i18n("
|
527
|
+
description: i18nRuntime.i18n("f63ba7e3c9d8de0b8b4f769055a36d2e")
|
524
528
|
}), {
|
525
529
|
type: 'divider'
|
526
530
|
}, amisEditorCore.getSchemaTpl('loadingConfig', {
|
@@ -277,7 +277,7 @@ var DateRangeControlPlugin = /** @class */function (_super) {
|
|
277
277
|
type: 'input-date'
|
278
278
|
}),
|
279
279
|
placeholder: i18nRuntime.i18n("8f7ae284d0039fe05b9f57fd5ae3ede9"),
|
280
|
-
needDeleteProps: ['minDate'],
|
280
|
+
needDeleteProps: ['minDate', 'ranges', 'shortcuts'],
|
281
281
|
label: amisEditorCore.tipedLabel(i18nRuntime.i18n("c322edb884724d04842fc35f4d29a24e"), dateTooltip)
|
282
282
|
}), amisEditorCore.getSchemaTpl('valueFormula', {
|
283
283
|
name: 'maxDate',
|
@@ -288,7 +288,7 @@ var DateRangeControlPlugin = /** @class */function (_super) {
|
|
288
288
|
type: 'input-date'
|
289
289
|
}),
|
290
290
|
placeholder: i18nRuntime.i18n("8f7ae284d0039fe05b9f57fd5ae3ede9"),
|
291
|
-
needDeleteProps: ['maxDate'],
|
291
|
+
needDeleteProps: ['maxDate', 'ranges', 'shortcuts'],
|
292
292
|
label: amisEditorCore.tipedLabel(i18nRuntime.i18n("5da893141114a59da868052b3a17a79a"), dateTooltip)
|
293
293
|
}), amisEditorCore.getSchemaTpl('valueFormula', {
|
294
294
|
name: 'minDuration',
|
@@ -315,28 +315,8 @@ var DateRangeControlPlugin = /** @class */function (_super) {
|
|
315
315
|
}), amisEditorCore.getSchemaTpl('dateShortCutControl', {
|
316
316
|
name: 'shortcuts',
|
317
317
|
mode: 'normal',
|
318
|
-
|
319
|
-
|
320
|
-
thisweek: i18nRuntime.i18n("0dc86a275145ad5a7774e594f0d94a06"),
|
321
|
-
prevweek: i18nRuntime.i18n("79abd4ee3661ff70c7d79716c8aaed83"),
|
322
|
-
thismonth: i18nRuntime.i18n("8f2a5a5f6e3777c7a0e1ce9484a2f7d7"),
|
323
|
-
prevmonth: i18nRuntime.i18n("d5578d93388a5b2552316418cd1124da"),
|
324
|
-
thisquarter: i18nRuntime.i18n("ffb2b7fbf227d9d21e03d0f160fb2a34"),
|
325
|
-
prevquarter: i18nRuntime.i18n("dd657784cc0d5511d2f25459e49ead1a"),
|
326
|
-
thisyear: i18nRuntime.i18n("d3dbc7a7fd9fc5ccd168084c8579c1ec")
|
327
|
-
},
|
328
|
-
customDropDownOption: {
|
329
|
-
daysago: i18nRuntime.i18n("fd312ae2f1c24b8a14d9412bb3c6bb76"),
|
330
|
-
dayslater: i18nRuntime.i18n("68cba5f27ab003cfada5eb4c1f29eb21"),
|
331
|
-
weeksago: i18nRuntime.i18n("34b06708894a178c440e6f6539e95e9e"),
|
332
|
-
weekslater: i18nRuntime.i18n("f0e1b8d8a6e731360d7348bc8301d44a"),
|
333
|
-
monthsago: i18nRuntime.i18n("5cad2778bb8f01d1a1b1226082eb2117"),
|
334
|
-
monthslater: i18nRuntime.i18n("ff76f60b3da86a0d2c6663b170a7955a"),
|
335
|
-
quartersago: i18nRuntime.i18n("9ff9b56c9ed633ee09396830e93113ad"),
|
336
|
-
quarterslater: i18nRuntime.i18n("2b80b20008b3ae81136217ae10a1fbaf"),
|
337
|
-
yearsago: i18nRuntime.i18n("84752114d27119dc50d8a7b9ac0b788b"),
|
338
|
-
yearslater: i18nRuntime.i18n("5df2352afebd73d1f568ebaa81e2db28")
|
339
|
-
}
|
318
|
+
certainOptions: ['today', 'yesterday', 'thisweek', 'prevweek', 'thismonth', 'prevmonth', 'thisquarter', 'prevquarter', 'thisyear'],
|
319
|
+
modifyOptions: ['$daysago', '$dayslater', '$weeksago', '$weekslater', '$monthsago', '$monthslater', '$quartersago', '$quarterslater', '$yearsago', '$yearslater']
|
340
320
|
}), amisEditorCore.getSchemaTpl('remark'), amisEditorCore.getSchemaTpl('labelRemark'), amisEditorCore.getSchemaTpl('startPlaceholder'), amisEditorCore.getSchemaTpl('endPlaceholder'), amisEditorCore.getSchemaTpl('autoFillApi')]
|
341
321
|
}, amisEditorCore.getSchemaTpl('status', {
|
342
322
|
isFormItem: true
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BasePlugin, InsertEventContext, PluginEvent, ScaffoldForm, RegionConfig, RendererPluginEvent, RendererPluginAction, EditorNodeType } from 'amis-editor-core';
|
1
|
+
import { BasePlugin, InsertEventContext, PluginEvent, ScaffoldForm, RegionConfig, RendererPluginEvent, RendererPluginAction, EditorNodeType, EditorManager, DSBuilderManager } from 'amis-editor-core';
|
2
2
|
export declare class TableControlPlugin extends BasePlugin {
|
3
3
|
rendererName: string;
|
4
4
|
$schema: string;
|
@@ -59,8 +59,11 @@ export declare class TableControlPlugin extends BasePlugin {
|
|
59
59
|
panelTitle: string;
|
60
60
|
events: RendererPluginEvent[];
|
61
61
|
actions: RendererPluginAction[];
|
62
|
+
dsBuilderManager: DSBuilderManager;
|
63
|
+
constructor(manager: EditorManager);
|
62
64
|
panelBodyCreator: (context: BaseEventContext) => any;
|
63
65
|
filterProps(props: any): any;
|
64
66
|
beforeInsert(event: PluginEvent<InsertEventContext>): void;
|
65
67
|
buildDataSchemas(node: EditorNodeType, region?: EditorNodeType): Promise<any>;
|
68
|
+
getAvailableContextFields(scopeNode: EditorNodeType, target: EditorNodeType, region?: EditorNodeType): Promise<any>;
|
66
69
|
}
|