[amis-saas-6692]merge pre-release code

Change-Id: I336d46180fae1d9b2807a6254af545da1d0312db
This commit is contained in:
qianchuan 2022-09-08 17:10:43 +08:00
commit 886c30d6f5
13 changed files with 5607 additions and 13 deletions

View File

@ -0,0 +1,37 @@
module.exports = {
entry: {
dir: './src'
},
file: {
test: /.*(ts|tsx|js|jsx)$/
},
ignore: {
list: ['src/icons', 'src/locale']
},
importInfo: {
source: 'i18n-runtime',
imported: 'i18n',
local: '_i18n'
},
i18nModule: 'i18n-runtime',
languages: [
{
name: 'en-US',
path: './src/locale'
},
{
name: 'zh-CN',
path: './src/locale'
}
],
output: {
fileName: 'editor-i18n',
fileExtension: 'xlsx',
path: './'
},
translate: {
appId: '20220810001301703',
key: 'WW7jKaJJBrtCawTOkCpk',
host: 'http://api.fanyi.baidu.com'
}
};

View File

@ -1,6 +1,6 @@
{
"name": "amis-editor",
"version": "5.2.0-beta.50",
"version": "5.2.0-beta.62",
"description": "amis 可视化编辑器",
"main": "lib/index.js",
"module": "esm/index.js",
@ -8,7 +8,9 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npm run clean-dist && NODE_ENV=production rollup -c ",
"clean-dist": "rimraf lib/* esm/*"
"clean-dist": "rimraf lib/* esm/*",
"i18n:update": "npx i18n update --config=./i18nConfig.js",
"i18n:translate": "npx i18n translate --config=./i18nConfig.js --l=en-US"
},
"keywords": [
"amis",
@ -22,12 +24,16 @@
"lint-staged": {
"{src,scss,examples}/**/**/*.{js,jsx,ts,tsx,scss,json}": [
"prettier --write"
],
"{src,scss,examples}/**/**/*.scss": [
"stylelint"
]
},
"dependencies": {
"@webcomponents/webcomponentsjs": "^2.6.0",
"amis-editor-core": "*",
"lodash": "^4.17.15"
"lodash": "^4.17.15",
"i18n-runtime": "0.0.4"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.15.3",
@ -87,6 +93,7 @@
"sass": "^1.49.7",
"sass-loader": "^12.5.0",
"style-loader": "^3.2.1",
"stylelint": "^14.11.0",
"ts-jest": "^28.0.3",
"ts-json-schema-generator": "0.96.0",
"ts-loader": "^9.2.5",
@ -102,6 +109,7 @@
"amis": "*",
"amis-core": "*",
"amis-formula": "*",
"amis-ui": "*"
"amis-ui": "*",
"i18n-runtime": "*"
}
}

View File

@ -16,6 +16,9 @@ import {
import path from 'path';
import svgr from '@svgr/rollup';
import fs from 'fs';
import i18nPlugin from 'plugin-react-i18n';
const i18nConfig = require('./i18nConfig');
const settings = {
globals: {}
@ -48,6 +51,22 @@ export default [
],
external,
plugins: getPlugins('cjs')
},
{
input,
output: [
{
...settings,
dir: path.dirname(module),
format: 'esm',
exports: 'named',
preserveModulesRoot: './src',
preserveModules: true // Keep directory structure and files
}
],
external,
plugins: getPlugins('esm')
}
];
@ -97,6 +116,7 @@ function getPlugins(format = 'esm') {
};
return [
i18nPlugin(i18nConfig),
typescript(typeScriptOptions),
svgr({
svgProps: {

View File

@ -1,3 +1,5 @@
import 'amis';
import './locale/index';
export * from 'amis-editor-core';
import './tpl/index';

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
import './en-US';
import './zh-CN';

File diff suppressed because it is too large Load Diff

View File

@ -200,8 +200,9 @@ export class RangeControlPlugin extends BasePlugin {
value: 0
},
{
type: 'tpl',
tpl: '-'
type: 'html',
html: '-',
className: 'inputGroup-split-line'
},
{
type: 'input-number',

View File

@ -13,7 +13,7 @@ import isString from 'lodash/isString';
import isEqual from 'lodash/isEqual';
import omit from 'lodash/omit';
import cx from 'classnames';
import {FormItem, Button, InputBox, Icon, ResultBox} from 'amis';
import {FormItem, Button, InputBox, Icon, ResultBox, render} from 'amis';
import {FormulaExec, isExpression} from 'amis';
import {PickerContainer} from 'amis';
import {FormulaEditor} from 'amis-ui/lib/components/formula/Editor';
@ -300,7 +300,8 @@ export default class FormulaControl extends React.Component<
if (rendererSchema) {
curRendererSchema = Object.assign({}, rendererSchema, data, {
type: rendererSchema.type ?? data.type,
value: this.props.value ?? rendererSchema.value ?? data.value
// 说明: props.value 最后会同步到 rendererSchema.value 中
value: rendererSchema.value // this.props.value ?? rendererSchema.value ?? data.value
});
// 默认要剔除的字段
@ -334,7 +335,7 @@ export default class FormulaControl extends React.Component<
'unitOptions',
'keyboard',
'kilobitSeparator',
'value'
// 'value'
];
// 当前组件要剔除的字段
@ -362,7 +363,8 @@ export default class FormulaControl extends React.Component<
// 设置统一的占位提示
if (curRendererSchema.type === 'select') {
curRendererSchema.placeholder = '请选择默认值';
curRendererSchema.inputClassName= 'ae-editor-FormulaControl-select-style'
curRendererSchema.inputClassName =
'ae-editor-FormulaControl-select-style';
} else {
curRendererSchema.placeholder = '请输入静态默认值';
}
@ -405,7 +407,7 @@ export default class FormulaControl extends React.Component<
rendererWrapper,
manager,
useExternalFormData = false,
render,
// render,
...rest
} = this.props;
@ -461,7 +463,7 @@ export default class FormulaControl extends React.Component<
rendererWrapper ? 'border-wrapper' : ''
)}
>
{render('left', this.filterCustomRendererProps(rendererSchema), {
{render(this.filterCustomRendererProps(rendererSchema), {
inputOnly: true,
value: value,
data: useExternalFormData

View File

@ -77,6 +77,7 @@ export default class ActionDialog extends React.Component<ActionDialogProp> {
labelField: 'actionLabel',
valueField: 'actionType',
inputClassName: 'no-border action-tree-control',
placeholder: '未匹配到数据',
onChange: (value: string, oldVal: any, data: any, form: any) => {
// 因为不知道动作都有哪些字段,这里只保留基础配置
let removeKeys: {
@ -163,11 +164,12 @@ export default class ActionDialog extends React.Component<ActionDialogProp> {
title: '动作配置',
headerClassName: 'font-bold',
className: 'action-config-dialog',
bodyClassName: "action-config-dialog-body",
closeOnEsc: true,
closeOnOutside: false,
show,
showCloseButton: true,
size: 'lg',
size: "md",
body: [
{
type: 'form',
@ -200,6 +202,7 @@ export default class ActionDialog extends React.Component<ActionDialogProp> {
type: 'input-text',
name: '__keywords',
className: 'action-tree-search',
inputClassName: 'action-tree-search-input',
placeholder: '请搜索执行动作',
clearable: true,
onChange: (

View File

@ -161,6 +161,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
value: 'dialog',
required: true,
pipeIn: defaultValue('dialog'),
inputClassName: 'event-action-radio',
options: [
{
label: '弹窗',
@ -248,6 +249,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
value: 'closeDialog',
required: true,
pipeIn: defaultValue('closeDialog'),
inputClassName: 'event-action-radio',
options: [
{
label: '弹窗',
@ -584,6 +586,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
value: 'show',
required: true,
pipeIn: defaultValue('show'),
inputClassName: 'event-action-radio',
options: [
{
label: '显示',
@ -643,6 +646,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
label: '启用/禁用',
name: 'groupType',
mode: 'horizontal',
inputClassName: 'event-action-radio',
value: 'enabled',
required: true,
pipeIn: defaultValue('enabled'),
@ -710,6 +714,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
type: 'radios',
required: true,
name: '__comboType',
inputClassName: 'event-action-radio',
mode: 'horizontal',
label: '赋值方式',
visibleOn: `data.__rendererName && __rendererName === 'combo'`,

View File

@ -1053,6 +1053,7 @@ setSchemaTpl(
visibleOn,
label: '图标',
type: 'icon-picker',
className: 'fix-icon-picker-overflow',
placeholder: '点击选择图标',
clearable: true,
description: ''