This commit is contained in:
rizky 2024-08-02 05:14:07 -07:00
parent f2fb7ed35a
commit b2a44937c9
5 changed files with 21 additions and 7 deletions

View File

@ -54,9 +54,18 @@ export const Breadcrumb: FC<BreadcrumbProps> = ({ value, className }) => {
<FieldLoading /> <FieldLoading />
) : ( ) : (
<> <>
{(!local.value || local.value.length === 0) && {(!local.value || local.value.length === 0) && isEditor && (
isEditor && <>
"Breadcrumb"} {" "}
{isDesktop ? (
"Breadcrumb"
) : (
<h1 className="bredcrumb-label c-font-semibold c-flex c-px-3 c-items-center c-text-xs md:c-text-base">
Breadcrumb
</h1>
)}
</>
)}
{isDesktop && ( {isDesktop && (
<> <>
{list.map((cur, index): ReactNode => { {list.map((cur, index): ReactNode => {

View File

@ -22,6 +22,7 @@ export const MasterDetail: FC<MDProps> = (arg) => {
tab_mode, tab_mode,
editor_tab, editor_tab,
gen_fields, gen_fields,
footer,
gen_table, gen_table,
on_init, on_init,
_item, _item,
@ -69,7 +70,7 @@ export const MasterDetail: FC<MDProps> = (arg) => {
masterDetailApplyParams(md); masterDetailApplyParams(md);
}, },
}, },
master: { render() {} }, master: { render() {}, reload() {} },
panel: { panel: {
size: 25, size: 25,
min_size: 0, min_size: 0,
@ -128,6 +129,7 @@ export const MasterDetail: FC<MDProps> = (arg) => {
md.header.render(); md.header.render();
}, [title]); }, [title]);
} }
return ( return (
<div <div
className={cx( className={cx(
@ -140,6 +142,7 @@ export const MasterDetail: FC<MDProps> = (arg) => {
{md.props.mode === "full" && <ModeFull md={md} mdr={mdr} />} {md.props.mode === "full" && <ModeFull md={md} mdr={mdr} />}
{md.props.mode === "v-split" && <ModeVSplit md={md} mdr={mdr} />} {md.props.mode === "v-split" && <ModeVSplit md={md} mdr={mdr} />}
{md.props.mode === "h-split" && <ModeHSplit md={md} mdr={mdr} />} {md.props.mode === "h-split" && <ModeHSplit md={md} mdr={mdr} />}
<PassProp md={md}>{[footer]}</PassProp>
</> </>
)} )}
</div> </div>

View File

@ -17,6 +17,7 @@ export const MDDetail: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
if (!detail) { if (!detail) {
return null; return null;
} }
return ( return (
<> <>
{md.props.show_head === "only-child" && <MDHeader md={md} mdr={mdr} />} {md.props.show_head === "only-child" && <MDHeader md={md} mdr={mdr} />}

View File

@ -10,16 +10,16 @@ export const mdRenderLoop = (md: MDLocal, mdr: MDRef, props: MDProps) => {
return e.component?.id === "c68415ca-dac5-44fe-aeb6-936caf8cc491"; return e.component?.id === "c68415ca-dac5-44fe-aeb6-936caf8cc491";
}); });
if (master) { if (master) {
if (!md.master) md.master = { render() {} }; if (!md.master) md.master = { render() {}, reload() {} };
} }
mdr.master = master; mdr.master = master;
const tablist = [] const tablist = [];
for (const c of childs) { for (const c of childs) {
const props = c.edit?.props; const props = c.edit?.props;
if (props && props.name.mode === "string") { if (props && props.name.mode === "string") {
const name = props.name.value || ""; const name = props.name.value || "";
if (name) { if (name) {
tablist.push(name) tablist.push(name);
mdr.childs[name] = c; mdr.childs[name] = c;
if (!md.childs[name]) { if (!md.childs[name]) {
md.childs[name] = { md.childs[name] = {

View File

@ -21,6 +21,7 @@ export type MDProps = {
tab_mode: "h-tab" | "v-tab" | "hidden"; tab_mode: "h-tab" | "v-tab" | "hidden";
editor_tab: string; editor_tab: string;
gen_fields: any; gen_fields: any;
footer: any;
gen_table: string; gen_table: string;
on_init: (md: MDLocal) => void; on_init: (md: MDLocal) => void;
_item: PrasiItem; _item: PrasiItem;