mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
added format command and added trailing commas to reduce conflicts
This commit is contained in:
@@ -25,7 +25,7 @@ export function DebugModal({ innerProps }: ContextModalProps<DebugProps>) {
|
||||
value: item,
|
||||
expand: 10,
|
||||
showCopy: true,
|
||||
...jsonViewerProps
|
||||
...jsonViewerProps,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@ export function DebugModal({ innerProps }: ContextModalProps<DebugProps>) {
|
||||
// @ts-expect-error
|
||||
...tabs[Object.keys(tabs)[0]],
|
||||
// @ts-expect-error
|
||||
title: tabs[Object.keys(tabs)[0]].label
|
||||
title: tabs[Object.keys(tabs)[0]].label,
|
||||
})
|
||||
)}
|
||||
</div>
|
||||
@@ -70,6 +70,6 @@ DebugModal.modalProps = {
|
||||
withCloseButton: false,
|
||||
size: "lg",
|
||||
classNames: {
|
||||
body: "!p-0"
|
||||
}
|
||||
body: "!p-0",
|
||||
},
|
||||
} satisfies Omit<ModalProps, "opened" | "onClose">;
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { ReactNode } from "react";
|
||||
export function OverlayModal({
|
||||
context,
|
||||
id,
|
||||
innerProps: { content }
|
||||
innerProps: { content },
|
||||
}: ContextModalProps<{ content?: ReactNode }>) {
|
||||
return content;
|
||||
}
|
||||
@@ -17,6 +17,6 @@ OverlayModal.modalProps = {
|
||||
root: "bknd-admin",
|
||||
content: "text-center justify-center",
|
||||
title: "font-bold !text-md",
|
||||
body: "py-3 px-5 gap-4 flex flex-col"
|
||||
}
|
||||
body: "py-3 px-5 gap-4 flex flex-col",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Button } from "ui/components/buttons/Button";
|
||||
import {
|
||||
JsonSchemaForm,
|
||||
type JsonSchemaFormProps,
|
||||
type JsonSchemaFormRef
|
||||
type JsonSchemaFormRef,
|
||||
} from "ui/components/form/json-schema";
|
||||
|
||||
import type { ContextModalProps } from "@mantine/modals";
|
||||
@@ -15,14 +15,14 @@ type Props = JsonSchemaFormProps & {
|
||||
data: any,
|
||||
context: {
|
||||
close: () => void;
|
||||
}
|
||||
},
|
||||
) => void | Promise<void>;
|
||||
};
|
||||
|
||||
export function SchemaFormModal({
|
||||
context,
|
||||
id,
|
||||
innerProps: { schema, uiSchema, onSubmit, autoCloseAfterSubmit }
|
||||
innerProps: { schema, uiSchema, onSubmit, autoCloseAfterSubmit },
|
||||
}: ContextModalProps<Props>) {
|
||||
const [valid, setValid] = useState(false);
|
||||
const formRef = useRef<JsonSchemaFormRef>(null);
|
||||
@@ -49,7 +49,7 @@ export function SchemaFormModal({
|
||||
setSubmitting(true);
|
||||
await onSubmit?.(formRef.current?.formData(), {
|
||||
close: handleClose,
|
||||
setError
|
||||
setError,
|
||||
});
|
||||
setSubmitting(false);
|
||||
|
||||
@@ -90,6 +90,6 @@ SchemaFormModal.modalProps = {
|
||||
header: "!bg-lightest !py-3 px-5 !h-auto !min-h-px",
|
||||
content: "rounded-lg select-none",
|
||||
title: "!font-bold !text-md",
|
||||
body: "!p-0"
|
||||
}
|
||||
body: "!p-0",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -17,6 +17,6 @@ TestModal.modalProps = {
|
||||
header: "!bg-primary/5 border-b border-b-muted !py-3 px-5 !h-auto !min-h-px",
|
||||
content: "rounded-lg select-none",
|
||||
title: "font-bold !text-md",
|
||||
body: "py-3 px-5 gap-4 flex flex-col"
|
||||
}
|
||||
body: "py-3 px-5 gap-4 flex flex-col",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ const modals = {
|
||||
debug: DebugModal,
|
||||
form: SchemaFormModal,
|
||||
overlay: OverlayModal,
|
||||
dataCreate: CreateModal
|
||||
dataCreate: CreateModal,
|
||||
};
|
||||
|
||||
declare module "@mantine/modals" {
|
||||
@@ -28,7 +28,7 @@ export function BkndModalsProvider({ children }) {
|
||||
function open<Modal extends keyof typeof modals>(
|
||||
modal: Modal,
|
||||
innerProps: ComponentProps<(typeof modals)[Modal]>["innerProps"],
|
||||
{ title: _title, ...modalProps }: Partial<ModalProps> = {}
|
||||
{ title: _title, ...modalProps }: Partial<ModalProps> = {},
|
||||
) {
|
||||
const title = _title ?? modals[modal].defaultTitle ?? undefined;
|
||||
const cmpModalProps = modals[modal].modalProps ?? {};
|
||||
@@ -37,12 +37,12 @@ function open<Modal extends keyof typeof modals>(
|
||||
...modalProps,
|
||||
...cmpModalProps,
|
||||
modal,
|
||||
innerProps
|
||||
innerProps,
|
||||
};
|
||||
openContextModal(props);
|
||||
return {
|
||||
close: () => close(modal),
|
||||
closeAll: $modals.closeAll
|
||||
closeAll: $modals.closeAll,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,5 +56,5 @@ export const bkndModals = {
|
||||
},
|
||||
open,
|
||||
close,
|
||||
closeAll: $modals.closeAll
|
||||
closeAll: $modals.closeAll,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user