added format command and added trailing commas to reduce conflicts

This commit is contained in:
dswbx
2025-02-26 20:06:03 +01:00
parent 88b5359f1c
commit 7743f71a11
414 changed files with 3622 additions and 3610 deletions

View File

@@ -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">;

View File

@@ -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",
},
};

View File

@@ -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",
},
};

View File

@@ -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",
},
};

View File

@@ -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,
};