@farmzone/fz-react-ui 1.0.5 → 1.0.7
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 +28 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +28 -28
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tw.css +2 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1239,6 +1239,8 @@ interface DetailModalFrameProps<T, S extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
|
1239
1239
|
renderFooterExtra?: ReactNode;
|
|
1240
1240
|
/** isDirty 상태 외부 노출 — 라우터 blocker 등에서 활용 */
|
|
1241
1241
|
onDirtyChange?: (isDirty: boolean) => void;
|
|
1242
|
+
/** 제공 시 ModalIconHeader로 렌더링 (read 모드: 이 type, edit 모드: "edit" 자동 적용) */
|
|
1243
|
+
headerType?: ModalType;
|
|
1242
1244
|
}
|
|
1243
1245
|
declare function DetailModalFrame<T, S extends z.ZodTypeAny = z.ZodTypeAny>(props: DetailModalFrameProps<T, S>): react.JSX.Element;
|
|
1244
1246
|
|
|
@@ -1371,7 +1373,7 @@ declare const textVariants: (props?: ({
|
|
|
1371
1373
|
declare const Z_INDEX: {
|
|
1372
1374
|
readonly TABLE_COL_STICKY: 1;
|
|
1373
1375
|
readonly TABLE_FIXED_CELL: 5;
|
|
1374
|
-
readonly TABLE_FIXED_HEADER_CELL:
|
|
1376
|
+
readonly TABLE_FIXED_HEADER_CELL: 15;
|
|
1375
1377
|
readonly LOCAL_OVERLAY: 10;
|
|
1376
1378
|
readonly LAYOUT_HEADER: 20;
|
|
1377
1379
|
readonly DROPDOWN_LOCAL: 20;
|
package/dist/index.d.ts
CHANGED
|
@@ -1239,6 +1239,8 @@ interface DetailModalFrameProps<T, S extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
|
1239
1239
|
renderFooterExtra?: ReactNode;
|
|
1240
1240
|
/** isDirty 상태 외부 노출 — 라우터 blocker 등에서 활용 */
|
|
1241
1241
|
onDirtyChange?: (isDirty: boolean) => void;
|
|
1242
|
+
/** 제공 시 ModalIconHeader로 렌더링 (read 모드: 이 type, edit 모드: "edit" 자동 적용) */
|
|
1243
|
+
headerType?: ModalType;
|
|
1242
1244
|
}
|
|
1243
1245
|
declare function DetailModalFrame<T, S extends z.ZodTypeAny = z.ZodTypeAny>(props: DetailModalFrameProps<T, S>): react.JSX.Element;
|
|
1244
1246
|
|
|
@@ -1371,7 +1373,7 @@ declare const textVariants: (props?: ({
|
|
|
1371
1373
|
declare const Z_INDEX: {
|
|
1372
1374
|
readonly TABLE_COL_STICKY: 1;
|
|
1373
1375
|
readonly TABLE_FIXED_CELL: 5;
|
|
1374
|
-
readonly TABLE_FIXED_HEADER_CELL:
|
|
1376
|
+
readonly TABLE_FIXED_HEADER_CELL: 15;
|
|
1375
1377
|
readonly LOCAL_OVERLAY: 10;
|
|
1376
1378
|
readonly LAYOUT_HEADER: 20;
|
|
1377
1379
|
readonly DROPDOWN_LOCAL: 20;
|
package/dist/index.js
CHANGED
|
@@ -214,7 +214,7 @@ function TooltipContent({
|
|
|
214
214
|
var Z_INDEX = {
|
|
215
215
|
TABLE_COL_STICKY: 1,
|
|
216
216
|
TABLE_FIXED_CELL: 5,
|
|
217
|
-
TABLE_FIXED_HEADER_CELL:
|
|
217
|
+
TABLE_FIXED_HEADER_CELL: 15,
|
|
218
218
|
LOCAL_OVERLAY: 10,
|
|
219
219
|
LAYOUT_HEADER: 20,
|
|
220
220
|
DROPDOWN_LOCAL: 20,
|
|
@@ -3719,7 +3719,7 @@ function confirmModal(options) {
|
|
|
3719
3719
|
}
|
|
3720
3720
|
function TableFooter(props) {
|
|
3721
3721
|
const { paginationInfo, renderLeft, renderRight } = props;
|
|
3722
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-4 min-h-16", children: [
|
|
3722
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-4 min-h-16 border-t-1 border-gray-100", children: [
|
|
3723
3723
|
/* @__PURE__ */ jsx("div", { className: "flex justify-start flex-1 min-w-0", children: renderLeft }),
|
|
3724
3724
|
paginationInfo && /* @__PURE__ */ jsx("div", { className: "px-5", children: /* @__PURE__ */ jsx(Pagination, { ...paginationInfo }) }),
|
|
3725
3725
|
/* @__PURE__ */ jsx("div", { className: "flex justify-end flex-1 min-w-0", children: renderRight })
|
|
@@ -4985,7 +4985,7 @@ function Table(props) {
|
|
|
4985
4985
|
id: `${col.key}-body`,
|
|
4986
4986
|
"data-row-cell": "true",
|
|
4987
4987
|
"data-col-key": col.key,
|
|
4988
|
-
className: `${isCheckbox ? "p-0" : "
|
|
4988
|
+
className: `${isCheckbox ? "p-0" : "p-3"} whitespace-nowrap text-sm text-gray-900 border-r border-b border-gray-300/70 last:border-r-0 bg-inherit group-hover:bg-gray-100 transition-all`,
|
|
4989
4989
|
style: {
|
|
4990
4990
|
width,
|
|
4991
4991
|
minWidth: minWidth || width,
|
|
@@ -5077,7 +5077,7 @@ function Table(props) {
|
|
|
5077
5077
|
const rest = baseRows.filter((row) => !effectiveRowOrder.includes(String(getRowKey(row.original, row.index))));
|
|
5078
5078
|
return [...ordered, ...rest];
|
|
5079
5079
|
}, [baseRows, effectiveRowOrder, getRowKey]);
|
|
5080
|
-
return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded shadow-
|
|
5080
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded shadow-table border border-gray-200 overflow-hidden", children: [
|
|
5081
5081
|
/* @__PURE__ */ jsx(
|
|
5082
5082
|
"div",
|
|
5083
5083
|
{
|
|
@@ -5085,7 +5085,7 @@ function Table(props) {
|
|
|
5085
5085
|
ref: scrollRef,
|
|
5086
5086
|
className: "relative w-full overflow-y-auto overflow-x-auto custom-view-scrollbar bg-white",
|
|
5087
5087
|
style: { height: `${tableHeight}px` },
|
|
5088
|
-
children: /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed", children: [
|
|
5088
|
+
children: /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed border-spacing-0", children: [
|
|
5089
5089
|
/* @__PURE__ */ jsx(
|
|
5090
5090
|
TableHeader,
|
|
5091
5091
|
{
|
|
@@ -7624,7 +7624,7 @@ var SubmitForm = Object.assign(SubmitFormRoot, {
|
|
|
7624
7624
|
});
|
|
7625
7625
|
function LabeledFilterOption(props) {
|
|
7626
7626
|
const { label, children, gap } = props;
|
|
7627
|
-
return /* @__PURE__ */ jsxs("div", { style: { marginLeft: gap }, className: "flex flex-row items-center gap-
|
|
7627
|
+
return /* @__PURE__ */ jsxs("div", { style: { marginLeft: gap }, className: "flex flex-row items-center gap-4", children: [
|
|
7628
7628
|
label && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-gray-60 shrink-0", children: label }),
|
|
7629
7629
|
children
|
|
7630
7630
|
] });
|
|
@@ -7636,47 +7636,42 @@ function PageFilter(props) {
|
|
|
7636
7636
|
onSubmit,
|
|
7637
7637
|
onReset,
|
|
7638
7638
|
containerClassName,
|
|
7639
|
-
rowGap =
|
|
7639
|
+
rowGap = 28,
|
|
7640
7640
|
colGap = 0,
|
|
7641
7641
|
submitButtonText = "\uAC80\uC0C9",
|
|
7642
7642
|
resetButtonText = "\uCD08\uAE30\uD654",
|
|
7643
7643
|
values,
|
|
7644
7644
|
primaryColor
|
|
7645
7645
|
} = props;
|
|
7646
|
-
const [localValues, setLocalValues] = useState(values);
|
|
7647
7646
|
const initialValuesRef = useRef(values);
|
|
7648
|
-
const updateLocal = (updates) => {
|
|
7649
|
-
setLocalValues((prev) => ({ ...prev, ...updates }));
|
|
7650
|
-
};
|
|
7651
7647
|
const handleInputChange = (key) => (e) => {
|
|
7652
|
-
|
|
7648
|
+
onChange({ [key]: e.target.value });
|
|
7653
7649
|
};
|
|
7654
7650
|
const handleSelectChange = (key) => (value) => {
|
|
7655
|
-
|
|
7651
|
+
onChange({ [key]: value });
|
|
7656
7652
|
};
|
|
7657
7653
|
const handleRadioChange = (key) => (value) => {
|
|
7658
|
-
|
|
7654
|
+
onChange({ [key]: value });
|
|
7659
7655
|
};
|
|
7660
7656
|
const handleDateChange = (key) => (date) => {
|
|
7661
|
-
|
|
7657
|
+
onChange({ [key]: date });
|
|
7662
7658
|
};
|
|
7663
7659
|
const handleRangeChangeCurried = (startKey, endKey) => (start, end) => {
|
|
7664
|
-
|
|
7660
|
+
onChange({ [startKey]: start, [endKey]: end });
|
|
7665
7661
|
};
|
|
7666
7662
|
const handleCheckboxChange = (key) => (checked) => {
|
|
7667
|
-
|
|
7663
|
+
onChange({ [key]: checked ? "true" : "false" });
|
|
7668
7664
|
};
|
|
7669
7665
|
const handleSubmit = () => {
|
|
7670
|
-
onChange(localValues);
|
|
7671
7666
|
onSubmit();
|
|
7672
7667
|
};
|
|
7673
7668
|
const handleReset = () => {
|
|
7674
|
-
|
|
7669
|
+
onChange(initialValuesRef.current);
|
|
7675
7670
|
onReset?.();
|
|
7676
7671
|
};
|
|
7677
7672
|
const renderFilterOption = (option, gap, index) => {
|
|
7678
7673
|
const optionKey = option.key;
|
|
7679
|
-
const currentValue = String(
|
|
7674
|
+
const currentValue = String(values[optionKey] ?? "");
|
|
7680
7675
|
const rowGap2 = index !== 0 ? option.label ? gap : 5 : 0;
|
|
7681
7676
|
switch (option.type) {
|
|
7682
7677
|
case "input":
|
|
@@ -7751,16 +7746,13 @@ function PageFilter(props) {
|
|
|
7751
7746
|
return /* @__PURE__ */ jsx(
|
|
7752
7747
|
"div",
|
|
7753
7748
|
{
|
|
7754
|
-
className: cn(
|
|
7755
|
-
"flex flex-col gap-3 bg-white py-3 px-5 border-t-main border-t-1 shadow-panel",
|
|
7756
|
-
containerClassName
|
|
7757
|
-
),
|
|
7749
|
+
className: cn("flex flex-col gap-3 bg-white py-3 px-5 border-t-main border-t-1 shadow-panel", containerClassName),
|
|
7758
7750
|
style: primaryColor ? { borderTopColor: primaryColor } : void 0,
|
|
7759
7751
|
children: /* @__PURE__ */ jsx("div", { className: "relative flex flex-col", style: { gap: `${colGap}px` }, children: rows.map((row, ix) => {
|
|
7760
7752
|
const isLastRow = rows.length - 1 === ix;
|
|
7761
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-row min-h-
|
|
7753
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-row min-h-11", children: [
|
|
7762
7754
|
row.options.map((option, index) => renderFilterOption(option, rowGap, index)),
|
|
7763
|
-
isLastRow && /* @__PURE__ */ jsxs("div", { className: "ml-
|
|
7755
|
+
isLastRow && /* @__PURE__ */ jsxs("div", { className: "ml-2 flex flex-row items-center gap-2", children: [
|
|
7764
7756
|
/* @__PURE__ */ jsx(Button, { variant: "search", onClick: handleSubmit, children: submitButtonText }),
|
|
7765
7757
|
onReset && /* @__PURE__ */ jsx(Button, { variant: "reset", onClick: handleReset, children: resetButtonText })
|
|
7766
7758
|
] })
|
|
@@ -9506,7 +9498,8 @@ function DetailModalFrame(props) {
|
|
|
9506
9498
|
contentClassName,
|
|
9507
9499
|
renderExtraContent,
|
|
9508
9500
|
renderFooterExtra,
|
|
9509
|
-
onDirtyChange
|
|
9501
|
+
onDirtyChange,
|
|
9502
|
+
headerType
|
|
9510
9503
|
} = props;
|
|
9511
9504
|
const controller = useDetailController({ mode, onModeChange });
|
|
9512
9505
|
useEffect(() => {
|
|
@@ -9545,7 +9538,14 @@ function DetailModalFrame(props) {
|
|
|
9545
9538
|
const isEditMode = controller.mode === "edit";
|
|
9546
9539
|
const canEdit = Boolean(editSchema && (editFields || renderEditBody));
|
|
9547
9540
|
return /* @__PURE__ */ jsxs(Modal, { isOpen: open, onClose: handleClose, contentClassName: cn("max-w-2xl", contentClassName), children: [
|
|
9548
|
-
|
|
9541
|
+
headerType ? /* @__PURE__ */ jsx(
|
|
9542
|
+
ModalIconHeader,
|
|
9543
|
+
{
|
|
9544
|
+
type: isEditMode ? "edit" : headerType,
|
|
9545
|
+
title,
|
|
9546
|
+
onClose: handleClose
|
|
9547
|
+
}
|
|
9548
|
+
) : /* @__PURE__ */ jsx(ModalHeader, { className: "flex flex-row items-center justify-between", children: /* @__PURE__ */ jsx("span", { className: "text-base font-semibold text-gray-900", children: title }) }),
|
|
9549
9549
|
/* @__PURE__ */ jsxs(ModalBody, { className: "flex-1 min-h-0 overflow-hidden p-0 flex flex-col", children: [
|
|
9550
9550
|
/* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsx(
|
|
9551
9551
|
DetailContent,
|