@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.cjs
CHANGED
|
@@ -248,7 +248,7 @@ function TooltipContent({
|
|
|
248
248
|
var Z_INDEX = {
|
|
249
249
|
TABLE_COL_STICKY: 1,
|
|
250
250
|
TABLE_FIXED_CELL: 5,
|
|
251
|
-
TABLE_FIXED_HEADER_CELL:
|
|
251
|
+
TABLE_FIXED_HEADER_CELL: 15,
|
|
252
252
|
LOCAL_OVERLAY: 10,
|
|
253
253
|
LAYOUT_HEADER: 20,
|
|
254
254
|
DROPDOWN_LOCAL: 20,
|
|
@@ -3753,7 +3753,7 @@ function confirmModal(options) {
|
|
|
3753
3753
|
}
|
|
3754
3754
|
function TableFooter(props) {
|
|
3755
3755
|
const { paginationInfo, renderLeft, renderRight } = props;
|
|
3756
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-4 min-h-16", children: [
|
|
3756
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between py-4 min-h-16 border-t-1 border-gray-100", children: [
|
|
3757
3757
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-start flex-1 min-w-0", children: renderLeft }),
|
|
3758
3758
|
paginationInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-5", children: /* @__PURE__ */ jsxRuntime.jsx(Pagination, { ...paginationInfo }) }),
|
|
3759
3759
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end flex-1 min-w-0", children: renderRight })
|
|
@@ -5019,7 +5019,7 @@ function Table(props) {
|
|
|
5019
5019
|
id: `${col.key}-body`,
|
|
5020
5020
|
"data-row-cell": "true",
|
|
5021
5021
|
"data-col-key": col.key,
|
|
5022
|
-
className: `${isCheckbox ? "p-0" : "
|
|
5022
|
+
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`,
|
|
5023
5023
|
style: {
|
|
5024
5024
|
width,
|
|
5025
5025
|
minWidth: minWidth || width,
|
|
@@ -5111,7 +5111,7 @@ function Table(props) {
|
|
|
5111
5111
|
const rest = baseRows.filter((row) => !effectiveRowOrder.includes(String(getRowKey(row.original, row.index))));
|
|
5112
5112
|
return [...ordered, ...rest];
|
|
5113
5113
|
}, [baseRows, effectiveRowOrder, getRowKey]);
|
|
5114
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded shadow-
|
|
5114
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded shadow-table border border-gray-200 overflow-hidden", children: [
|
|
5115
5115
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5116
5116
|
"div",
|
|
5117
5117
|
{
|
|
@@ -5119,7 +5119,7 @@ function Table(props) {
|
|
|
5119
5119
|
ref: scrollRef,
|
|
5120
5120
|
className: "relative w-full overflow-y-auto overflow-x-auto custom-view-scrollbar bg-white",
|
|
5121
5121
|
style: { height: `${tableHeight}px` },
|
|
5122
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full table-fixed", children: [
|
|
5122
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full table-fixed border-spacing-0", children: [
|
|
5123
5123
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5124
5124
|
TableHeader,
|
|
5125
5125
|
{
|
|
@@ -7658,7 +7658,7 @@ var SubmitForm = Object.assign(SubmitFormRoot, {
|
|
|
7658
7658
|
});
|
|
7659
7659
|
function LabeledFilterOption(props) {
|
|
7660
7660
|
const { label, children, gap } = props;
|
|
7661
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginLeft: gap }, className: "flex flex-row items-center gap-
|
|
7661
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginLeft: gap }, className: "flex flex-row items-center gap-4", children: [
|
|
7662
7662
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-gray-60 shrink-0", children: label }),
|
|
7663
7663
|
children
|
|
7664
7664
|
] });
|
|
@@ -7670,47 +7670,42 @@ function PageFilter(props) {
|
|
|
7670
7670
|
onSubmit,
|
|
7671
7671
|
onReset,
|
|
7672
7672
|
containerClassName,
|
|
7673
|
-
rowGap =
|
|
7673
|
+
rowGap = 28,
|
|
7674
7674
|
colGap = 0,
|
|
7675
7675
|
submitButtonText = "\uAC80\uC0C9",
|
|
7676
7676
|
resetButtonText = "\uCD08\uAE30\uD654",
|
|
7677
7677
|
values,
|
|
7678
7678
|
primaryColor
|
|
7679
7679
|
} = props;
|
|
7680
|
-
const [localValues, setLocalValues] = React6.useState(values);
|
|
7681
7680
|
const initialValuesRef = React6.useRef(values);
|
|
7682
|
-
const updateLocal = (updates) => {
|
|
7683
|
-
setLocalValues((prev) => ({ ...prev, ...updates }));
|
|
7684
|
-
};
|
|
7685
7681
|
const handleInputChange = (key) => (e) => {
|
|
7686
|
-
|
|
7682
|
+
onChange({ [key]: e.target.value });
|
|
7687
7683
|
};
|
|
7688
7684
|
const handleSelectChange = (key) => (value) => {
|
|
7689
|
-
|
|
7685
|
+
onChange({ [key]: value });
|
|
7690
7686
|
};
|
|
7691
7687
|
const handleRadioChange = (key) => (value) => {
|
|
7692
|
-
|
|
7688
|
+
onChange({ [key]: value });
|
|
7693
7689
|
};
|
|
7694
7690
|
const handleDateChange = (key) => (date) => {
|
|
7695
|
-
|
|
7691
|
+
onChange({ [key]: date });
|
|
7696
7692
|
};
|
|
7697
7693
|
const handleRangeChangeCurried = (startKey, endKey) => (start, end) => {
|
|
7698
|
-
|
|
7694
|
+
onChange({ [startKey]: start, [endKey]: end });
|
|
7699
7695
|
};
|
|
7700
7696
|
const handleCheckboxChange = (key) => (checked) => {
|
|
7701
|
-
|
|
7697
|
+
onChange({ [key]: checked ? "true" : "false" });
|
|
7702
7698
|
};
|
|
7703
7699
|
const handleSubmit = () => {
|
|
7704
|
-
onChange(localValues);
|
|
7705
7700
|
onSubmit();
|
|
7706
7701
|
};
|
|
7707
7702
|
const handleReset = () => {
|
|
7708
|
-
|
|
7703
|
+
onChange(initialValuesRef.current);
|
|
7709
7704
|
onReset?.();
|
|
7710
7705
|
};
|
|
7711
7706
|
const renderFilterOption = (option, gap, index) => {
|
|
7712
7707
|
const optionKey = option.key;
|
|
7713
|
-
const currentValue = String(
|
|
7708
|
+
const currentValue = String(values[optionKey] ?? "");
|
|
7714
7709
|
const rowGap2 = index !== 0 ? option.label ? gap : 5 : 0;
|
|
7715
7710
|
switch (option.type) {
|
|
7716
7711
|
case "input":
|
|
@@ -7785,16 +7780,13 @@ function PageFilter(props) {
|
|
|
7785
7780
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7786
7781
|
"div",
|
|
7787
7782
|
{
|
|
7788
|
-
className: cn(
|
|
7789
|
-
"flex flex-col gap-3 bg-white py-3 px-5 border-t-main border-t-1 shadow-panel",
|
|
7790
|
-
containerClassName
|
|
7791
|
-
),
|
|
7783
|
+
className: cn("flex flex-col gap-3 bg-white py-3 px-5 border-t-main border-t-1 shadow-panel", containerClassName),
|
|
7792
7784
|
style: primaryColor ? { borderTopColor: primaryColor } : void 0,
|
|
7793
7785
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex flex-col", style: { gap: `${colGap}px` }, children: rows.map((row, ix) => {
|
|
7794
7786
|
const isLastRow = rows.length - 1 === ix;
|
|
7795
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row min-h-
|
|
7787
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row min-h-11", children: [
|
|
7796
7788
|
row.options.map((option, index) => renderFilterOption(option, rowGap, index)),
|
|
7797
|
-
isLastRow && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-
|
|
7789
|
+
isLastRow && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-2 flex flex-row items-center gap-2", children: [
|
|
7798
7790
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "search", onClick: handleSubmit, children: submitButtonText }),
|
|
7799
7791
|
onReset && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "reset", onClick: handleReset, children: resetButtonText })
|
|
7800
7792
|
] })
|
|
@@ -9540,7 +9532,8 @@ function DetailModalFrame(props) {
|
|
|
9540
9532
|
contentClassName,
|
|
9541
9533
|
renderExtraContent,
|
|
9542
9534
|
renderFooterExtra,
|
|
9543
|
-
onDirtyChange
|
|
9535
|
+
onDirtyChange,
|
|
9536
|
+
headerType
|
|
9544
9537
|
} = props;
|
|
9545
9538
|
const controller = useDetailController({ mode, onModeChange });
|
|
9546
9539
|
React6.useEffect(() => {
|
|
@@ -9579,7 +9572,14 @@ function DetailModalFrame(props) {
|
|
|
9579
9572
|
const isEditMode = controller.mode === "edit";
|
|
9580
9573
|
const canEdit = Boolean(editSchema && (editFields || renderEditBody));
|
|
9581
9574
|
return /* @__PURE__ */ jsxRuntime.jsxs(Modal, { isOpen: open, onClose: handleClose, contentClassName: cn("max-w-2xl", contentClassName), children: [
|
|
9582
|
-
|
|
9575
|
+
headerType ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9576
|
+
ModalIconHeader,
|
|
9577
|
+
{
|
|
9578
|
+
type: isEditMode ? "edit" : headerType,
|
|
9579
|
+
title,
|
|
9580
|
+
onClose: handleClose
|
|
9581
|
+
}
|
|
9582
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(ModalHeader, { className: "flex flex-row items-center justify-between", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-semibold text-gray-900", children: title }) }),
|
|
9583
9583
|
/* @__PURE__ */ jsxRuntime.jsxs(ModalBody, { className: "flex-1 min-h-0 overflow-hidden p-0 flex flex-col", children: [
|
|
9584
9584
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9585
9585
|
DetailContent,
|