@farmzone/fz-react-ui 0.0.7 → 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.cjs CHANGED
@@ -3094,46 +3094,36 @@ function EmptyContent(props) {
3094
3094
  const hasHeader = icon || title || description;
3095
3095
  const isPage = layout === "page";
3096
3096
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3097
- hasHeader && /* @__PURE__ */ jsxRuntime.jsxs(
3098
- "div",
3099
- {
3100
- className: cn(
3101
- "flex flex-col items-center gap-2",
3102
- isPage && "mt-14 mb-10 gap-3",
3103
- !isPage && "max-w-sm"
3104
- ),
3105
- children: [
3106
- icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(emptyIconVariants({ iconVariant }), iconClassName), children: icon }),
3107
- title && /* @__PURE__ */ jsxRuntime.jsx(
3108
- "div",
3109
- {
3110
- className: cn(
3111
- isPage && "text-2xl font-bold",
3112
- !isPage && "text-lg font-medium tracking-tight text-foreground",
3113
- titleClassName
3114
- ),
3115
- children: title
3116
- }
3097
+ hasHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col items-center gap-2", isPage && "mt-14 mb-10 gap-3", !isPage && "max-w-sm"), children: [
3098
+ icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(emptyIconVariants({ iconVariant }), iconClassName), children: icon }),
3099
+ title && /* @__PURE__ */ jsxRuntime.jsx(
3100
+ "div",
3101
+ {
3102
+ className: cn(
3103
+ isPage && "text-2xl font-bold",
3104
+ !isPage && "text-lg font-medium tracking-tight text-foreground",
3105
+ titleClassName
3117
3106
  ),
3118
- description && /* @__PURE__ */ jsxRuntime.jsx(
3119
- "p",
3120
- {
3121
- className: cn(
3122
- isPage && "text-lg text-gray-500",
3123
- !isPage && "text-sm leading-relaxed text-muted-foreground",
3124
- descriptionClassName
3125
- ),
3126
- children: description
3127
- }
3128
- )
3129
- ]
3130
- }
3131
- ),
3107
+ children: title
3108
+ }
3109
+ ),
3110
+ description && /* @__PURE__ */ jsxRuntime.jsx(
3111
+ "p",
3112
+ {
3113
+ className: cn(
3114
+ isPage && "text-lg text-gray-500",
3115
+ !isPage && "text-sm leading-relaxed text-muted-foreground",
3116
+ descriptionClassName
3117
+ ),
3118
+ children: description
3119
+ }
3120
+ )
3121
+ ] }),
3132
3122
  action && /* @__PURE__ */ jsxRuntime.jsx(
3133
3123
  "div",
3134
3124
  {
3135
3125
  className: cn(
3136
- isPage && "flex-center w-full",
3126
+ isPage && "flex items-center justify-center w-full",
3137
3127
  !isPage && "flex w-full max-w-sm flex-col items-center gap-3",
3138
3128
  actionClassName
3139
3129
  ),
@@ -8904,9 +8894,15 @@ function DetailModalFrame(props) {
8904
8894
  renderEditBody,
8905
8895
  mode,
8906
8896
  onModeChange,
8907
- contentClassName
8897
+ contentClassName,
8898
+ renderExtraContent,
8899
+ renderFooterExtra,
8900
+ onDirtyChange
8908
8901
  } = props;
8909
8902
  const controller = useDetailController({ mode, onModeChange });
8903
+ React6.useEffect(() => {
8904
+ onDirtyChange?.(controller.isDirty);
8905
+ }, [controller.isDirty, onDirtyChange]);
8910
8906
  const handleClose = React6.useCallback(async () => {
8911
8907
  if (controller.isDirty) {
8912
8908
  const confirmed = await new Promise((resolve) => {
@@ -8944,24 +8940,31 @@ function DetailModalFrame(props) {
8944
8940
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-semibold text-gray-900", children: title }),
8945
8941
  !isEditMode && canEdit && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm", onClick: handleEdit, children: "\uC218\uC815" })
8946
8942
  ] }),
8947
- /* @__PURE__ */ jsxRuntime.jsx(ModalBody, { className: "p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
8948
- DetailContent,
8949
- {
8950
- controller,
8951
- data,
8952
- readFields,
8953
- editSchema,
8954
- editFields,
8955
- onSave,
8956
- renderReadBody,
8957
- renderEditBody,
8958
- layout: "compact"
8959
- }
8960
- ) }),
8943
+ /* @__PURE__ */ jsxRuntime.jsxs(ModalBody, { className: "flex-1 min-h-0 p-0", children: [
8944
+ /* @__PURE__ */ jsxRuntime.jsx(
8945
+ DetailContent,
8946
+ {
8947
+ controller,
8948
+ data,
8949
+ readFields,
8950
+ editSchema,
8951
+ editFields,
8952
+ onSave,
8953
+ renderReadBody,
8954
+ renderEditBody,
8955
+ layout: "compact",
8956
+ className: "overflow-visible max-h-none"
8957
+ }
8958
+ ),
8959
+ renderExtraContent?.({ isEditMode })
8960
+ ] }),
8961
8961
  /* @__PURE__ */ jsxRuntime.jsx(ModalFooter, { className: "flex justify-end gap-2", children: isEditMode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8962
8962
  /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleCancelEdit, disabled: controller.isSaving, children: "\uCDE8\uC18C" }),
8963
8963
  /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", form: controller.formId, variant: "save", disabled: controller.isSaving, children: controller.isSaving ? "\uC800\uC7A5 \uC911..." : "\uC800\uC7A5" })
8964
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleClose, children: "\uB2EB\uAE30" }) })
8964
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8965
+ renderFooterExtra,
8966
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleClose, children: "\uB2EB\uAE30" })
8967
+ ] }) })
8965
8968
  ] });
8966
8969
  }
8967
8970
  function useBlockModalConfirm() {