Junyi a951d49f55
Fix(plugin-workflow): client refactor (#1163)
* fix(plugin-workflow): avoid to delete using node

* fix(plugin-workflow): refactor operand

* fix(plugin-workflow): simplify code

* fix(plugin-workflow): fix condition calculator
2022-12-06 02:18:40 -08:00

36 lines
880 B
TypeScript

import React from 'react';
import { css } from '@emotion/css';
import { Calculation } from '../calculators';
import { NAMESPACE, useWorkflowTranslation } from '../locale';
export default {
title: `{{t("Calculation", { ns: "${NAMESPACE}" })}}`,
type: 'calculation',
group: 'control',
fieldset: {
'config.calculation': {
type: 'object',
title: `{{t("Configure calculation", { ns: "${NAMESPACE}" })}}`,
name: 'config.calculation',
required: true,
'x-decorator': 'FormItem',
'x-component': 'CalculationConfig',
}
},
view: {
},
components: {
CalculationConfig({ value, onChange }) {
return (
<Calculation {...value} onChange={onChange} />
);
}
},
getter() {
const { t } = useWorkflowTranslation();
return <div className={css`flex-shrink: 0`}>{t('Calculation result')}</div>;
}
};