@farmzone/fz-react-ui 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +29 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +29 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8853,11 +8853,7 @@ function DetailContent(props) {
|
|
|
8853
8853
|
layout = "compact",
|
|
8854
8854
|
className
|
|
8855
8855
|
} = props;
|
|
8856
|
-
const containerClass = cn(
|
|
8857
|
-
"overflow-y-auto",
|
|
8858
|
-
layout === "compact" ? "max-h-[60vh]" : "min-h-0 flex-1",
|
|
8859
|
-
className
|
|
8860
|
-
);
|
|
8856
|
+
const containerClass = layout === "none" ? cn(className) : cn("overflow-y-auto", layout === "compact" ? "max-h-[60vh]" : "min-h-0 flex-1", className);
|
|
8861
8857
|
if (!data) {
|
|
8862
8858
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(containerClass, "flex items-center justify-center p-8"), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-400", children: "\uB370\uC774\uD130\uB97C \uBD88\uB7EC\uC624\uB294 \uC911..." }) });
|
|
8863
8859
|
}
|
|
@@ -8894,9 +8890,15 @@ function DetailModalFrame(props) {
|
|
|
8894
8890
|
renderEditBody,
|
|
8895
8891
|
mode,
|
|
8896
8892
|
onModeChange,
|
|
8897
|
-
contentClassName
|
|
8893
|
+
contentClassName,
|
|
8894
|
+
renderExtraContent,
|
|
8895
|
+
renderFooterExtra,
|
|
8896
|
+
onDirtyChange
|
|
8898
8897
|
} = props;
|
|
8899
8898
|
const controller = useDetailController({ mode, onModeChange });
|
|
8899
|
+
React6.useEffect(() => {
|
|
8900
|
+
onDirtyChange?.(controller.isDirty);
|
|
8901
|
+
}, [controller.isDirty, onDirtyChange]);
|
|
8900
8902
|
const handleClose = React6.useCallback(async () => {
|
|
8901
8903
|
if (controller.isDirty) {
|
|
8902
8904
|
const confirmed = await new Promise((resolve) => {
|
|
@@ -8934,24 +8936,30 @@ function DetailModalFrame(props) {
|
|
|
8934
8936
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-semibold text-gray-900", children: title }),
|
|
8935
8937
|
!isEditMode && canEdit && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm", onClick: handleEdit, children: "\uC218\uC815" })
|
|
8936
8938
|
] }),
|
|
8937
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8939
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ModalBody, { className: "flex-1 min-h-0 p-0", children: [
|
|
8940
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8941
|
+
DetailContent,
|
|
8942
|
+
{
|
|
8943
|
+
controller,
|
|
8944
|
+
data,
|
|
8945
|
+
readFields,
|
|
8946
|
+
editSchema,
|
|
8947
|
+
editFields,
|
|
8948
|
+
onSave,
|
|
8949
|
+
renderReadBody,
|
|
8950
|
+
renderEditBody,
|
|
8951
|
+
layout: "none"
|
|
8952
|
+
}
|
|
8953
|
+
),
|
|
8954
|
+
renderExtraContent?.({ isEditMode })
|
|
8955
|
+
] }),
|
|
8951
8956
|
/* @__PURE__ */ jsxRuntime.jsx(ModalFooter, { className: "flex justify-end gap-2", children: isEditMode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8952
8957
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleCancelEdit, disabled: controller.isSaving, children: "\uCDE8\uC18C" }),
|
|
8953
8958
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", form: controller.formId, variant: "save", disabled: controller.isSaving, children: controller.isSaving ? "\uC800\uC7A5 \uC911..." : "\uC800\uC7A5" })
|
|
8954
|
-
] }) : /* @__PURE__ */ jsxRuntime.
|
|
8959
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8960
|
+
renderFooterExtra,
|
|
8961
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleClose, children: "\uB2EB\uAE30" })
|
|
8962
|
+
] }) })
|
|
8955
8963
|
] });
|
|
8956
8964
|
}
|
|
8957
8965
|
function useBlockModalConfirm() {
|