move: move i18n descreptor to legao-design

This commit is contained in:
shuaige.zsg 2020-05-11 17:33:03 +08:00
parent f961096542
commit 242ec93e48
2 changed files with 2 additions and 23 deletions

View File

@ -142,19 +142,8 @@ export default class MixedSetter extends Component<{
// dirty fix vision variable setter logic
private hasVariableSetter = this.setters.some((item) => item.name === 'VariableSetter');
private getDefaultValueWhenUseSetter(oldUsed?: string): any {
if (this.used === 'I18nSetter') {
return {
type: 'i18n',
zh_CN: '',
en_US: '',
}
}
}
private useSetter = (name: string) => {
const { field, onChange } = this.props;
const oldUsed = this.used;
if (name === 'VariableSetter') {
const setterComponent = getSetter('VariableSetter')?.component as any;
if (setterComponent && setterComponent.isPopup) {
@ -167,10 +156,7 @@ export default class MixedSetter extends Component<{
}
const setter = this.setters.find((item) => item.name === name);
this.used = name;
const newValue = this.getDefaultValueWhenUseSetter(oldUsed);
if (newValue !== undefined) {
onChange && onChange(newValue);
} else if (setter) {
if (setter) {
this.handleInitial(setter);
}
};

View File

@ -370,14 +370,7 @@ export function upgradePropConfig(config: OldPropConfig, addInitial: AddIntial)
},
];
if (allowTextInput !== false) {
setters.unshift({
componentName: 'I18nSetter',
title: {
'type': 'i18n',
'zh-CN': '国际化输入',
'en-US': 'Internationalized Input'
},
});
setters.unshift('I18nSetter');
}
if (supportVariable) {
setters.push('VariableSetter');