fix lib
This commit is contained in:
parent
34f9c3a631
commit
051bc65e4e
|
|
@ -6,7 +6,7 @@ export const generateMasterDetail = async (item: PrasiItem) => {
|
|||
);
|
||||
|
||||
if (master) {
|
||||
master.edit.setProp("on_load", {
|
||||
master.edit.setProp("on_init", {
|
||||
mode: "raw",
|
||||
value: `async (text: string) => {
|
||||
alert("ASdas");
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import { FC } from "react";
|
||||
import { MDMain } from "../parts/MDMaster";
|
||||
import { MDMaster } from "../parts/MDMaster";
|
||||
import { MDLocal, MDRef } from "../utils/typings";
|
||||
import { MDTab, should_show_tab } from "../parts/MDTab";
|
||||
import { MDDetail, should_show_tab } from "../parts/MDDetail";
|
||||
|
||||
export const ModeFull: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
||||
if (should_show_tab(md)) {
|
||||
return <MDTab md={md} mdr={mdr} />;
|
||||
return <MDDetail md={md} mdr={mdr} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{!md.selected && <MDMain md={md} mdr={mdr} />}
|
||||
{md.selected && <MDTab md={md} mdr={mdr} />}
|
||||
{!md.selected && <MDMaster md={md} mdr={mdr} />}
|
||||
{md.selected && <MDDetail md={md} mdr={mdr} />}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { FC } from "react";
|
||||
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
||||
import { MDMain } from "../parts/MDMaster";
|
||||
import { MDTab } from "../parts/MDTab";
|
||||
import { MDMaster } from "../parts/MDMaster";
|
||||
import { MDDetail } from "../parts/MDDetail";
|
||||
import { MDLocal, MDRef } from "../utils/typings";
|
||||
|
||||
export const ModeHSplit: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
||||
|
|
@ -13,7 +13,7 @@ export const ModeHSplit: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
|||
defaultSize={md.panel.size}
|
||||
minSize={md.panel.min_size}
|
||||
>
|
||||
<MDMain md={md} mdr={mdr} />
|
||||
<MDMaster md={md} mdr={mdr} />
|
||||
</Panel>
|
||||
<>
|
||||
<PanelResizeHandle />
|
||||
|
|
@ -29,7 +29,7 @@ export const ModeHSplit: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
|||
}
|
||||
}}
|
||||
>
|
||||
<MDTab md={md} mdr={mdr} />
|
||||
<MDDetail md={md} mdr={mdr} />
|
||||
</Panel>
|
||||
</>
|
||||
</PanelGroup>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { FC } from "react";
|
||||
import { MDMain } from "../parts/MDMaster";
|
||||
import { MDMaster } from "../parts/MDMaster";
|
||||
import { MDLocal, MDRef } from "../utils/typings";
|
||||
import { MDTab, should_show_tab } from "../parts/MDTab";
|
||||
import { MDDetail, should_show_tab } from "../parts/MDDetail";
|
||||
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
||||
|
||||
export const ModeVSplit: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
||||
|
|
@ -13,7 +13,7 @@ export const ModeVSplit: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
|||
defaultSize={md.panel.size}
|
||||
minSize={md.panel.min_size}
|
||||
>
|
||||
<MDMain md={md} mdr={mdr} />
|
||||
<MDMaster md={md} mdr={mdr} />
|
||||
</Panel>
|
||||
<>
|
||||
<PanelResizeHandle />
|
||||
|
|
@ -29,7 +29,7 @@ export const ModeVSplit: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
|||
}
|
||||
}}
|
||||
>
|
||||
<MDTab md={md} mdr={mdr} />
|
||||
<MDDetail md={md} mdr={mdr} />
|
||||
</Panel>
|
||||
</>
|
||||
</PanelGroup>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { FC } from "react";
|
||||
import { MDLocal, MDRef, w } from "../utils/typings";
|
||||
import { MDLocal, MDRef } from "../utils/typings";
|
||||
import { MDHeader } from "./MDHeader";
|
||||
|
||||
export const should_show_tab = (md: MDLocal) => {
|
||||
|
|
@ -9,7 +9,7 @@ export const should_show_tab = (md: MDLocal) => {
|
|||
return false;
|
||||
};
|
||||
|
||||
export const MDTab: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
||||
export const MDDetail: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
||||
const detail = md.childs[md.tab.active];
|
||||
const PassProp = mdr.PassProp;
|
||||
if (!detail) {
|
||||
|
|
@ -27,7 +27,7 @@ export const MDTab: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
|||
{md.props.tab_mode !== "hidden" && md.tab.list.length > 1 && (
|
||||
<MDNavTab md={md} mdr={mdr} />
|
||||
)}
|
||||
{/* <PassProp md={md}>{detail.internal}</PassProp> */}
|
||||
<PassProp md={md}>{mdr.childs[md.tab.active]}</PassProp>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
@ -5,15 +5,15 @@ import { MDHeader } from "./MDHeader";
|
|||
const w = window as unknown as {
|
||||
md_panel_master: any;
|
||||
};
|
||||
export const MDMaster: FC<{
|
||||
export const MDRenderMaster: FC<{
|
||||
size: any;
|
||||
min_size: any;
|
||||
md: MDLocal;
|
||||
child: any;
|
||||
on_init: () => void;
|
||||
}> = ({ child, on_init, min_size, size, md }) => {
|
||||
let result = on_init();
|
||||
on_init: () => MDLocal;
|
||||
}> = ({ child, on_init, min_size, size }) => {
|
||||
let md = on_init();
|
||||
|
||||
if (md) {
|
||||
let width = 0;
|
||||
let min_width = 0;
|
||||
try {
|
||||
|
|
@ -26,15 +26,17 @@ export const MDMaster: FC<{
|
|||
});
|
||||
md.panel.min_size = min_width;
|
||||
md.panel.size = width;
|
||||
}
|
||||
|
||||
return <>{child}</>;
|
||||
};
|
||||
|
||||
export const MDMain: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
||||
export const MDMaster: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
|
||||
const PassProp = mdr.PassProp;
|
||||
return (
|
||||
<>
|
||||
{md.props.show_head === "only-master" && <MDHeader md={md} mdr={mdr} />}
|
||||
{/* <PassProp md={md}>{md.master.internal}</PassProp> */}
|
||||
<PassProp md={md}>{mdr.master}</PassProp>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
21
data.ts
21
data.ts
|
|
@ -4,8 +4,9 @@ import { lazify } from "./utils/lazify";
|
|||
export const MasterDetail = lazify(
|
||||
async () => (await import("@/comps/md/MasterDetail")).MasterDetail
|
||||
);
|
||||
export const MDMaster = lazify(
|
||||
async () => (await import("@/comps/md/parts/MDMaster")).MDMaster
|
||||
|
||||
export const MDRenderMaster = lazify(
|
||||
async () => (await import("@/comps/md/parts/MDMaster")).MDRenderMaster
|
||||
);
|
||||
export const MDAction = lazify(
|
||||
async () => (await import("@/comps/md/parts/MDAction")).MDAction
|
||||
|
|
@ -48,6 +49,7 @@ export { GetValue } from "@/utils/get-value";
|
|||
export { TableListType } from "lib/comps/list/utils/typings";
|
||||
export { Button, FloatButton } from "@/comps/ui/button";
|
||||
export { prasi_gen } from "@/gen/prasi_gen";
|
||||
export { password } from "@/utils/password";
|
||||
|
||||
/** Session */
|
||||
export {
|
||||
|
|
@ -61,29 +63,26 @@ export { logout } from "@/preset/login/utils/logout";
|
|||
export { generateLogin } from "@/preset/login/utils/generate";
|
||||
export { select as generateSelect } from "@/preset/login/utils/select";
|
||||
|
||||
// export card
|
||||
export { Card } from "@/comps/custom/Card";
|
||||
|
||||
|
||||
/** Layout */
|
||||
export { Layout } from "@/preset/menu/Layout";
|
||||
|
||||
/* MENU */
|
||||
export { Menu, MenuIcon } from "@/preset/menu/Menu";
|
||||
|
||||
/* Bcrypt */
|
||||
export { password } from "@/utils/password";
|
||||
|
||||
/*Panel Tab*/
|
||||
export { PanelTab } from "@/comps/tab/Tab";
|
||||
export { PanelBody } from "@/comps/tab/parts/PanelBody";
|
||||
export { PanelHeader } from "@/comps/tab/parts/PanelHead";
|
||||
export { ShowHidePanel } from "@/comps/custom/ShowHidePanel";
|
||||
|
||||
/*Popup*/
|
||||
export {Popup} from "@/comps/popup/PopUp"
|
||||
export { Popup } from "@/comps/popup/PopUp";
|
||||
|
||||
// Detail
|
||||
export { Detail } from "@/comps/custom/Detail";
|
||||
export {Profile} from "@/preset/profile/Profile"
|
||||
export {generateProfile} from "@/preset/profile/utils/generate"
|
||||
export {ButtonUpload} from "@/preset/profile/ButtonUpload"
|
||||
export { Profile } from "@/preset/profile/Profile";
|
||||
export { generateProfile } from "@/preset/profile/utils/generate";
|
||||
export { ButtonUpload } from "@/preset/profile/ButtonUpload";
|
||||
export { longDate, shortDate, timeAgo, formatTime } from "@/utils/date";
|
||||
Loading…
Reference in New Issue