diff --git a/comps/custom/Popover.tsx b/comps/custom/Popover.tsx
index 6607642..357805a 100755
--- a/comps/custom/Popover.tsx
+++ b/comps/custom/Popover.tsx
@@ -9,7 +9,7 @@ import {
offset,
shift,
useClick,
- useDismiss,
+ useDismiss,
useFloating,
useId,
useInteractions,
diff --git a/comps/form/field/table-edit/TableEdit.tsx b/comps/form/field/table-edit/TableEdit.tsx
index ec687ba..65af597 100755
--- a/comps/form/field/table-edit/TableEdit.tsx
+++ b/comps/form/field/table-edit/TableEdit.tsx
@@ -2,6 +2,7 @@ import { TableList } from "lib/comps/list/TableList";
import { useLocal } from "lib/utils/use-local";
import { FC, useEffect, useRef } from "react";
import { FMLocal } from "../../typings";
+import get from "lodash.get";
export const TableEdit: FC<{
on_init: () => FMLocal;
@@ -30,11 +31,268 @@ export const TableEdit: FC<{
}
}
const value = fm.data[name];
-
useEffect(() => {
- local.tbl.render();
- }, [3000]);
+ local.tbl = {
+ data: value,
+ render: () => {},
+ };
+ local.render();
+ }, []);
+ const raw_childs = get(
+ child,
+ "props.meta.item.component.props.child.content.childs"
+ );
+ let columns: any[] = [];
+ let childs: any[] = [];
+ const mode_child = raw_childs.find((e: any) =>
+ ["tbl-col", "table: columns"].includes(e.name)
+ );
+ const tbl = item.edit.childs[0].edit.childs.find(
+ (e: any) => get(e, "id") === mode_child.id
+ );
+ const meta = tbl;
+ if (meta && meta.childs) {
+ childs = meta.childs;
+ }
+ for (const child of childs) {
+ let key = getProp(child, "name", {});
+ const label = getProp(child, "title", "");
+ const type = getProp(child, "type", "");
+ const width = parseInt(getProp(child, "width", {}));
+ if (type === "checkbox") {
+ const on_click = getProp(child, "opt__on_click", "");
+ columns.push({
+ key,
+ name,
+ width: 35,
+ minWidth: 45,
+ resizable: true,
+ sortable: true,
+ frozen: true,
+ renderCell(arg: any) {
+ // return <>>;
+ const { props, tbl } = arg;
+ const fm_row = { ...fm, render: local.render };
+ return (
+
| 0
+ ? css`
+ width: ${header.width}px;
+ `
+ : ""
+ )}
+ >
+ 0
+ ? css`
+ width: ${header.width}px;
+ `
+ : ""
+ )}
+ >
+ {header.label}
+
+ |
+ );
+ })}
+
|---|
|
+
+ {header.renderCell({
+ props: {
+ row: row,
+ rowIdx: idx,
+ column: header,
+ },
+ tbl: {
+ data: value,
+ },
+ })}
+
+ |
+ );
+ })}
+