|
@@ -5,7 +5,7 @@ import { IconCrossCircleStroked } from '@douyinfe/semi-icons';
|
|
|
|
|
|
|
|
import { TypeSelector } from '../type-selector';
|
|
import { TypeSelector } from '../type-selector';
|
|
|
import { JsonSchema } from '../../typings';
|
|
import { JsonSchema } from '../../typings';
|
|
|
-import { VariableSelector } from '../../plugins/variable-plugin/variable-selector';
|
|
|
|
|
|
|
+import { VariableSelector } from '../../plugins/sync-variable-plugin/variable-selector';
|
|
|
import { LeftColumn, Row } from './styles';
|
|
import { LeftColumn, Row } from './styles';
|
|
|
|
|
|
|
|
export interface PropertyEditProps {
|
|
export interface PropertyEditProps {
|
|
@@ -17,7 +17,7 @@ export interface PropertyEditProps {
|
|
|
onDelete?: () => void;
|
|
onDelete?: () => void;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export const PropertyEdit: React.FC<PropertyEditProps> = props => {
|
|
|
|
|
|
|
+export const PropertyEdit: React.FC<PropertyEditProps> = (props) => {
|
|
|
const { value, disabled } = props;
|
|
const { value, disabled } = props;
|
|
|
const [inputKey, updateKey] = useState(props.propertyKey);
|
|
const [inputKey, updateKey] = useState(props.propertyKey);
|
|
|
const updateProperty = (key: keyof JsonSchema, val: any) => {
|
|
const updateProperty = (key: keyof JsonSchema, val: any) => {
|
|
@@ -34,12 +34,12 @@ export const PropertyEdit: React.FC<PropertyEditProps> = props => {
|
|
|
value={value.type}
|
|
value={value.type}
|
|
|
disabled={disabled}
|
|
disabled={disabled}
|
|
|
style={{ position: 'absolute', top: 6, left: 4, zIndex: 1 }}
|
|
style={{ position: 'absolute', top: 6, left: 4, zIndex: 1 }}
|
|
|
- onChange={val => updateProperty('type', val)}
|
|
|
|
|
|
|
+ onChange={(val) => updateProperty('type', val)}
|
|
|
/>
|
|
/>
|
|
|
<Input
|
|
<Input
|
|
|
value={inputKey}
|
|
value={inputKey}
|
|
|
disabled={disabled}
|
|
disabled={disabled}
|
|
|
- onChange={v => updateKey(v.trim())}
|
|
|
|
|
|
|
+ onChange={(v) => updateKey(v.trim())}
|
|
|
onBlur={() => {
|
|
onBlur={() => {
|
|
|
if (inputKey !== '') {
|
|
if (inputKey !== '') {
|
|
|
props.onChange(value, props.propertyKey, inputKey);
|
|
props.onChange(value, props.propertyKey, inputKey);
|
|
@@ -54,14 +54,14 @@ export const PropertyEdit: React.FC<PropertyEditProps> = props => {
|
|
|
<VariableSelector
|
|
<VariableSelector
|
|
|
value={value.default}
|
|
value={value.default}
|
|
|
disabled={disabled}
|
|
disabled={disabled}
|
|
|
- onChange={val => updateProperty('default', val)}
|
|
|
|
|
|
|
+ onChange={(val) => updateProperty('default', val)}
|
|
|
style={{ flexGrow: 1, height: 32 }}
|
|
style={{ flexGrow: 1, height: 32 }}
|
|
|
/>
|
|
/>
|
|
|
) : (
|
|
) : (
|
|
|
<Input
|
|
<Input
|
|
|
disabled={disabled}
|
|
disabled={disabled}
|
|
|
value={value.default}
|
|
value={value.default}
|
|
|
- onChange={val => updateProperty('default', val)}
|
|
|
|
|
|
|
+ onChange={(val) => updateProperty('default', val)}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
{props.onDelete && !disabled && (
|
|
{props.onDelete && !disabled && (
|