mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-04-20 12:28:08 +00:00
move: move i18n descreptor to legao-design
This commit is contained in:
parent
f961096542
commit
242ec93e48
@ -142,19 +142,8 @@ export default class MixedSetter extends Component<{
|
|||||||
// dirty fix vision variable setter logic
|
// dirty fix vision variable setter logic
|
||||||
private hasVariableSetter = this.setters.some((item) => item.name === 'VariableSetter');
|
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) => {
|
private useSetter = (name: string) => {
|
||||||
const { field, onChange } = this.props;
|
const { field, onChange } = this.props;
|
||||||
const oldUsed = this.used;
|
|
||||||
if (name === 'VariableSetter') {
|
if (name === 'VariableSetter') {
|
||||||
const setterComponent = getSetter('VariableSetter')?.component as any;
|
const setterComponent = getSetter('VariableSetter')?.component as any;
|
||||||
if (setterComponent && setterComponent.isPopup) {
|
if (setterComponent && setterComponent.isPopup) {
|
||||||
@ -167,10 +156,7 @@ export default class MixedSetter extends Component<{
|
|||||||
}
|
}
|
||||||
const setter = this.setters.find((item) => item.name === name);
|
const setter = this.setters.find((item) => item.name === name);
|
||||||
this.used = name;
|
this.used = name;
|
||||||
const newValue = this.getDefaultValueWhenUseSetter(oldUsed);
|
if (setter) {
|
||||||
if (newValue !== undefined) {
|
|
||||||
onChange && onChange(newValue);
|
|
||||||
} else if (setter) {
|
|
||||||
this.handleInitial(setter);
|
this.handleInitial(setter);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -370,14 +370,7 @@ export function upgradePropConfig(config: OldPropConfig, addInitial: AddIntial)
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
if (allowTextInput !== false) {
|
if (allowTextInput !== false) {
|
||||||
setters.unshift({
|
setters.unshift('I18nSetter');
|
||||||
componentName: 'I18nSetter',
|
|
||||||
title: {
|
|
||||||
'type': 'i18n',
|
|
||||||
'zh-CN': '国际化输入',
|
|
||||||
'en-US': 'Internationalized Input'
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (supportVariable) {
|
if (supportVariable) {
|
||||||
setters.push('VariableSetter');
|
setters.push('VariableSetter');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user