diff --git a/comps/form/field/FieldInput.tsx b/comps/form/field/FieldInput.tsx
index 92ef009..ad23475 100755
--- a/comps/form/field/FieldInput.tsx
+++ b/comps/form/field/FieldInput.tsx
@@ -147,7 +147,10 @@ export const FieldInput: FC<{
className={cx(
"field-inner c-flex-1 c-flex c-items-center",
field.focused && "focused",
- disabled && "c-pointer-events-none c-bg-gray-50"
+ disabled && "c-pointer-events-none",
+ disabled &&
+ !["checkbox"].includes(arg.sub_type) &&
+ " c-bg-gray-50"
)}
>
{not_ready ? (
diff --git a/comps/form/field/type/TypeSingleCheckbox.tsx b/comps/form/field/type/TypeSingleCheckbox.tsx
index 2f70628..889bd29 100755
--- a/comps/form/field/type/TypeSingleCheckbox.tsx
+++ b/comps/form/field/type/TypeSingleCheckbox.tsx
@@ -12,6 +12,8 @@ export const FieldSingleCheckbox: FC<{
list: [] as any[],
change_timeout: null as any,
});
+ const disabled =
+ typeof field.disabled === "function" ? field.disabled() : field.disabled;
const renderOnChange = () => {
local.render();
if (field.on_change) {
@@ -47,14 +49,16 @@ export const FieldSingleCheckbox: FC<{
{
- fm.data[field.name] = !value;
- fm.render();
- if (field.on_change) {
- field.on_change({
- value: !value,
- name: field.name,
- fm,
- });
+ if(!disabled){
+ fm.data[field.name] = !value;
+ fm.render();
+ if (field.on_change) {
+ field.on_change({
+ value: !value,
+ name: field.name,
+ fm,
+ });
+ }
}
}}
className="c-flex c-flex-row c-space-x-1 cursor-pointer c-items-center rounded-full p-0.5"
diff --git a/comps/form/field/type/TypeUpload.tsx b/comps/form/field/type/TypeUpload.tsx
index 907efc5..3bbd182 100755
--- a/comps/form/field/type/TypeUpload.tsx
+++ b/comps/form/field/type/TypeUpload.tsx
@@ -4,7 +4,9 @@ import { FC } from "react";
import { FMLocal, FieldLocal } from "../../typings";
import { PropTypeInput } from "./TypeInput";
import * as XLSX from "xlsx";
-
+const w = window as unknown as {
+ serverurl: string
+}
export const FieldUpload: FC<{
field: FieldLocal;
@@ -97,7 +99,7 @@ export const FieldUpload: FC<{
let url = siteurl("/_upload");
if (location.hostname === 'prasi.avolut.com' || location.host === 'localhost:4550') {
const newurl = new URL(location.href);
- newurl.pathname = `/_proxy/https://julong-dev.avolut.com/_upload`;
+ newurl.pathname = `/_proxy/${w.serverurl}/_upload`;
url = newurl.toString();
}
diff --git a/comps/list/lib/export_excel.tsx b/comps/list/lib/export_excel.tsx
new file mode 100755
index 0000000..0d1e5ed
--- /dev/null
+++ b/comps/list/lib/export_excel.tsx
@@ -0,0 +1,61 @@
+import * as XLSX from "xlsx";
+import { TableListProp } from "../TableList";
+import { filterWhere } from "lib/comps/filter/parser/filter-where";
+import { call_prasi_events } from "lib/exports";
+
+export const export_excel = async ({
+ list,
+ tbl,
+ on_load,
+}: {
+ list: TableListProp;
+ tbl: {
+ columns: any[];
+ sort: {
+ columns: any;
+ orderBy: any;
+ };
+ render: () => void;
+ };
+ on_load: () => any;
+}) => {
+ const where = filterWhere(list.filter_name, list.__props);
+
+ call_prasi_events("tablelist", "where", [list.__props?.gen__table, where]);
+ const orderBy = tbl.sort.orderBy || undefined;
+ const load_args: any = {
+ async reload() {},
+ orderBy,
+ where,
+ paging: {},
+ };
+ if (typeof list.on_load === "function") {
+ const result = await list.on_load({ ...load_args, mode: "query" });
+ const data = [] as any[];
+ const res = [
+ {
+ id: "ff4105af-aa81-4432-847b-1c97fc9eb505",
+ name_goal: "Top Down",
+ definition: null,
+ threshold: 1,
+ description: "Top Down",
+ goal_employee: [
+ {
+ id: "440dd52c-1a18-4b53-b0da-a45f47251f36",
+ },
+ ],
+ },
+ ];
+ const l = document.getElementsByClassName("rdg-row");
+ if (res.length) {
+ res.map((e, id) => {
+ if (tbl.columns.length) {
+ tbl.columns.map((ex, idx) => {
+ const r = null;
+ console.log({ r });
+ });
+ }
+ });
+ }
+ }
+};
diff --git a/exports.tsx b/exports.tsx
index b4436cc..c1a5a14 100755
--- a/exports.tsx
+++ b/exports.tsx
@@ -67,7 +67,7 @@ export const HeaderProfile = lazify(
/** charts */
export { PieChart } from "@/comps/charts/pie";
-// export { BarChart } from "@/comps/charts/bar";
+export { BarChart } from "@/comps/charts/bar";
// export { LineChart } from "@/comps/charts/line";
/** Generator */
diff --git a/preset/menu/Menu.tsx b/preset/menu/Menu.tsx
index 0844ade..e3d0c26 100755
--- a/preset/menu/Menu.tsx
+++ b/preset/menu/Menu.tsx
@@ -21,6 +21,7 @@ type MLocal = typeof local_default & { render: () => void };
export const Menu: FC = (props) => {
const imenu = props.menu;
+ console.log({imenu})
let role = props.role;
role = props.on_init();
let menu = get(imenu, role) || [];
@@ -76,10 +77,12 @@ export const SideBar: FC<{
parent?: string;
}> = ({ data: _data, local, depth, pm, mode, expanded, parent }) => {
const PassProp = pm.PassProp;
-
- w.prasi_menu.pm = pm;
+ w.prasi_menu = {
+ ...w.prasi_menu,
+ pm
+ }
const data: IMenu[] = (typeof _data[0] === "string" ? [_data] : _data) as any;
-
+console.log({data})
useEffect(() => {
data.map((item) => {
const menu = {
diff --git a/preset/menu/utils/type-menu.ts b/preset/menu/utils/type-menu.ts
index ad1bb7f..97446ca 100755
--- a/preset/menu/utils/type-menu.ts
+++ b/preset/menu/utils/type-menu.ts
@@ -11,6 +11,7 @@ export type MenuProp = {
item: PrasiItem;
style: "navbar" | "sidebar";
on_load?: (on_done: (exec: () => void) => void) => void;
+ get_menu?: (mn: Array>) => Array>
};
export type MenuActive = {
data: any;