wip fix
This commit is contained in:
parent
83dfec16bc
commit
6c6eaac5e9
|
|
@ -176,6 +176,7 @@ export const EdSidePropInstance: FC<{ meta: IMeta }> = ({ meta }) => {
|
||||||
mprop={mprop}
|
mprop={mprop}
|
||||||
name={name}
|
name={name}
|
||||||
labelClick={labelClick}
|
labelClick={labelClick}
|
||||||
|
onEditCode={createEditScript(p, "value", mprop, name)}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ export const createEditScript = (
|
||||||
mprop: FMCompDef,
|
mprop: FMCompDef,
|
||||||
name: string
|
name: string
|
||||||
) => {
|
) => {
|
||||||
return ((e) => {
|
return (e: any) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
|
|
@ -21,5 +21,5 @@ export const createEditScript = (
|
||||||
p.ui.popup.script.prop_name = name;
|
p.ui.popup.script.prop_name = name;
|
||||||
p.render();
|
p.render();
|
||||||
}
|
}
|
||||||
}) as MouseEventHandler<HTMLButtonElement>;
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ export const EdPropInstanceCode: FC<{
|
||||||
name: string;
|
name: string;
|
||||||
mprop: FMCompDef;
|
mprop: FMCompDef;
|
||||||
labelClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
labelClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
||||||
}> = ({ name, labelClick }) => {
|
onEditCode: React.MouseEventHandler<HTMLDivElement> | undefined;
|
||||||
|
}> = ({ name, labelClick, onEditCode }) => {
|
||||||
const p = useGlobal(EDGlobal, "EDITOR");
|
const p = useGlobal(EDGlobal, "EDITOR");
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center min-h-[28px]">
|
<div className="flex items-center min-h-[28px]">
|
||||||
|
|
@ -16,21 +17,7 @@ export const EdPropInstanceCode: FC<{
|
||||||
<div className="flex-1 flex justify-end pr-1">
|
<div className="flex-1 flex justify-end pr-1">
|
||||||
<div
|
<div
|
||||||
className="m-1 px-1 bg-white cursor-pointer hover:bg-blue-500 hover:text-white hover:border-blue-500 font-mono border border-slate-300 text-[11px] select-none"
|
className="m-1 px-1 bg-white cursor-pointer hover:bg-blue-500 hover:text-white hover:border-blue-500 font-mono border border-slate-300 text-[11px] select-none"
|
||||||
onClick={() => {
|
onClick={onEditCode}
|
||||||
p.ui.popup.script.prop_name = name;
|
|
||||||
p.ui.popup.script.type = "prop-instance";
|
|
||||||
p.ui.popup.script.prop_kind = "value";
|
|
||||||
p.ui.popup.script.open = true;
|
|
||||||
|
|
||||||
if (active.instance.item_id && active.comp_id) {
|
|
||||||
active.item_id = active.instance.item_id;
|
|
||||||
active.comp_id = active.instance.comp_id;
|
|
||||||
active.instance.item_id = "";
|
|
||||||
active.instance.comp_id = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
p.render();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
EDIT CODE
|
EDIT CODE
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue