@farmzone/fz-react-ui 0.0.8 → 0.0.9

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.d.cts CHANGED
@@ -1200,6 +1200,14 @@ interface DetailModalFrameProps<T, S extends z.ZodTypeAny = z.ZodTypeAny> {
1200
1200
  mode?: UseDetailControllerParams["mode"];
1201
1201
  onModeChange?: UseDetailControllerParams["onModeChange"];
1202
1202
  contentClassName?: string;
1203
+ /** ModalBody 내 DetailContent 하단 추가 컨텐츠 (프로필 사진 등) */
1204
+ renderExtraContent?: (ctx: {
1205
+ isEditMode: boolean;
1206
+ }) => ReactNode;
1207
+ /** read 모드 footer 추가 버튼 — 닫기 앞에 삽입 */
1208
+ renderFooterExtra?: ReactNode;
1209
+ /** isDirty 상태 외부 노출 — 라우터 blocker 등에서 활용 */
1210
+ onDirtyChange?: (isDirty: boolean) => void;
1203
1211
  }
1204
1212
  declare function DetailModalFrame<T, S extends z.ZodTypeAny = z.ZodTypeAny>(props: DetailModalFrameProps<T, S>): React$1.JSX.Element;
1205
1213
 
package/dist/index.d.ts CHANGED
@@ -1200,6 +1200,14 @@ interface DetailModalFrameProps<T, S extends z.ZodTypeAny = z.ZodTypeAny> {
1200
1200
  mode?: UseDetailControllerParams["mode"];
1201
1201
  onModeChange?: UseDetailControllerParams["onModeChange"];
1202
1202
  contentClassName?: string;
1203
+ /** ModalBody 내 DetailContent 하단 추가 컨텐츠 (프로필 사진 등) */
1204
+ renderExtraContent?: (ctx: {
1205
+ isEditMode: boolean;
1206
+ }) => ReactNode;
1207
+ /** read 모드 footer 추가 버튼 — 닫기 앞에 삽입 */
1208
+ renderFooterExtra?: ReactNode;
1209
+ /** isDirty 상태 외부 노출 — 라우터 blocker 등에서 활용 */
1210
+ onDirtyChange?: (isDirty: boolean) => void;
1203
1211
  }
1204
1212
  declare function DetailModalFrame<T, S extends z.ZodTypeAny = z.ZodTypeAny>(props: DetailModalFrameProps<T, S>): React$1.JSX.Element;
1205
1213
 
package/dist/index.js CHANGED
@@ -8860,9 +8860,15 @@ function DetailModalFrame(props) {
8860
8860
  renderEditBody,
8861
8861
  mode,
8862
8862
  onModeChange,
8863
- contentClassName
8863
+ contentClassName,
8864
+ renderExtraContent,
8865
+ renderFooterExtra,
8866
+ onDirtyChange
8864
8867
  } = props;
8865
8868
  const controller = useDetailController({ mode, onModeChange });
8869
+ useEffect(() => {
8870
+ onDirtyChange?.(controller.isDirty);
8871
+ }, [controller.isDirty, onDirtyChange]);
8866
8872
  const handleClose = useCallback(async () => {
8867
8873
  if (controller.isDirty) {
8868
8874
  const confirmed = await new Promise((resolve) => {
@@ -8900,24 +8906,31 @@ function DetailModalFrame(props) {
8900
8906
  /* @__PURE__ */ jsx("span", { className: "text-base font-semibold text-gray-900", children: title }),
8901
8907
  !isEditMode && canEdit && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: handleEdit, children: "\uC218\uC815" })
8902
8908
  ] }),
8903
- /* @__PURE__ */ jsx(ModalBody, { className: "p-0", children: /* @__PURE__ */ jsx(
8904
- DetailContent,
8905
- {
8906
- controller,
8907
- data,
8908
- readFields,
8909
- editSchema,
8910
- editFields,
8911
- onSave,
8912
- renderReadBody,
8913
- renderEditBody,
8914
- layout: "compact"
8915
- }
8916
- ) }),
8909
+ /* @__PURE__ */ jsxs(ModalBody, { className: "flex-1 min-h-0 p-0", children: [
8910
+ /* @__PURE__ */ jsx(
8911
+ DetailContent,
8912
+ {
8913
+ controller,
8914
+ data,
8915
+ readFields,
8916
+ editSchema,
8917
+ editFields,
8918
+ onSave,
8919
+ renderReadBody,
8920
+ renderEditBody,
8921
+ layout: "compact",
8922
+ className: "overflow-visible max-h-none"
8923
+ }
8924
+ ),
8925
+ renderExtraContent?.({ isEditMode })
8926
+ ] }),
8917
8927
  /* @__PURE__ */ jsx(ModalFooter, { className: "flex justify-end gap-2", children: isEditMode ? /* @__PURE__ */ jsxs(Fragment, { children: [
8918
8928
  /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: handleCancelEdit, disabled: controller.isSaving, children: "\uCDE8\uC18C" }),
8919
8929
  /* @__PURE__ */ jsx(Button, { type: "submit", form: controller.formId, variant: "save", disabled: controller.isSaving, children: controller.isSaving ? "\uC800\uC7A5 \uC911..." : "\uC800\uC7A5" })
8920
- ] }) : /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: handleClose, children: "\uB2EB\uAE30" }) })
8930
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
8931
+ renderFooterExtra,
8932
+ /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: handleClose, children: "\uB2EB\uAE30" })
8933
+ ] }) })
8921
8934
  ] });
8922
8935
  }
8923
8936
  function useBlockModalConfirm() {