@rehagro/ui 1.0.50 → 1.0.51
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.js +53 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2108,6 +2108,21 @@ var DateSelect = forwardRef(
|
|
|
2108
2108
|
if (!isControlled) setInternalValue(newValue);
|
|
2109
2109
|
props.onChange?.(newValue);
|
|
2110
2110
|
};
|
|
2111
|
+
const handleMonthClear = () => {
|
|
2112
|
+
const newValue = { mode: "month" };
|
|
2113
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2114
|
+
props.onChange?.(newValue);
|
|
2115
|
+
};
|
|
2116
|
+
const handleDayClear = () => {
|
|
2117
|
+
const newValue = { mode: "day" };
|
|
2118
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2119
|
+
props.onChange?.(newValue);
|
|
2120
|
+
};
|
|
2121
|
+
const handleYearClear = () => {
|
|
2122
|
+
const newValue = { mode: "year" };
|
|
2123
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2124
|
+
props.onChange?.(newValue);
|
|
2125
|
+
};
|
|
2111
2126
|
const displayText = useMemo(() => {
|
|
2112
2127
|
if (value.mode === "year" && value.year) return value.year.toString();
|
|
2113
2128
|
if (value.mode === "month" && value.year != null)
|
|
@@ -2228,7 +2243,18 @@ var DateSelect = forwardRef(
|
|
|
2228
2243
|
},
|
|
2229
2244
|
year
|
|
2230
2245
|
);
|
|
2231
|
-
}) })
|
|
2246
|
+
}) }),
|
|
2247
|
+
/* @__PURE__ */ jsx("div", { className: "rh-flex rh-items-center rh-justify-between rh-pt-3 rh-mt-3 rh-border-t rh-border-border/30", children: /* @__PURE__ */ jsxs(
|
|
2248
|
+
"button",
|
|
2249
|
+
{
|
|
2250
|
+
onClick: handleYearClear,
|
|
2251
|
+
className: "rh-flex rh-items-center rh-gap-1.5 rh-text-sm rh-text-text rh-font-medium rh-px-2 rh-py-1.5 rh-rounded-sm hover:rh-bg-background rh-transition-colors rh-duration-150",
|
|
2252
|
+
children: [
|
|
2253
|
+
/* @__PURE__ */ jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
|
|
2254
|
+
"Limpar"
|
|
2255
|
+
]
|
|
2256
|
+
}
|
|
2257
|
+
) })
|
|
2232
2258
|
] });
|
|
2233
2259
|
const renderMonthGrid = () => /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
|
|
2234
2260
|
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
@@ -2276,7 +2302,18 @@ var DateSelect = forwardRef(
|
|
|
2276
2302
|
},
|
|
2277
2303
|
month
|
|
2278
2304
|
);
|
|
2279
|
-
}) })
|
|
2305
|
+
}) }),
|
|
2306
|
+
/* @__PURE__ */ jsx("div", { className: "rh-flex rh-items-center rh-justify-between rh-pt-3 rh-mt-3 rh-border-t rh-border-border/30", children: /* @__PURE__ */ jsxs(
|
|
2307
|
+
"button",
|
|
2308
|
+
{
|
|
2309
|
+
onClick: handleMonthClear,
|
|
2310
|
+
className: "rh-flex rh-items-center rh-gap-1.5 rh-text-sm rh-text-text rh-font-medium rh-px-2 rh-py-1.5 rh-rounded-sm hover:rh-bg-background rh-transition-colors rh-duration-150",
|
|
2311
|
+
children: [
|
|
2312
|
+
/* @__PURE__ */ jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
|
|
2313
|
+
"Limpar"
|
|
2314
|
+
]
|
|
2315
|
+
}
|
|
2316
|
+
) })
|
|
2280
2317
|
] });
|
|
2281
2318
|
const renderIntervalNav = () => /* @__PURE__ */ jsxs("div", { children: [
|
|
2282
2319
|
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-gap-4 rh-p-1", children: [
|
|
@@ -2534,7 +2571,18 @@ var DateSelect = forwardRef(
|
|
|
2534
2571
|
},
|
|
2535
2572
|
i
|
|
2536
2573
|
)) }),
|
|
2537
|
-
renderDayGrid(selectedYear, selectedMonth)
|
|
2574
|
+
renderDayGrid(selectedYear, selectedMonth),
|
|
2575
|
+
/* @__PURE__ */ jsx("div", { className: "rh-flex rh-items-center rh-justify-between rh-pt-3 rh-mt-3 rh-border-t rh-border-border/30", children: /* @__PURE__ */ jsxs(
|
|
2576
|
+
"button",
|
|
2577
|
+
{
|
|
2578
|
+
onClick: handleDayClear,
|
|
2579
|
+
className: "rh-flex rh-items-center rh-gap-1.5 rh-text-sm rh-text-text rh-font-medium rh-px-2 rh-py-1.5 rh-rounded-sm hover:rh-bg-background rh-transition-colors rh-duration-150",
|
|
2580
|
+
children: [
|
|
2581
|
+
/* @__PURE__ */ jsx(EraserIcon, { className: "rh-w-4 rh-h-4" }),
|
|
2582
|
+
"Limpar"
|
|
2583
|
+
]
|
|
2584
|
+
}
|
|
2585
|
+
) })
|
|
2538
2586
|
] });
|
|
2539
2587
|
case "month":
|
|
2540
2588
|
return renderMonthGrid();
|
|
@@ -4295,7 +4343,7 @@ function TableInner({
|
|
|
4295
4343
|
style: bodyStyleInline,
|
|
4296
4344
|
className: [
|
|
4297
4345
|
"rh-border-b rh-border-border rh-transition-colors",
|
|
4298
|
-
"hover:rh-bg-background",
|
|
4346
|
+
"hover:rh-bg-background/50",
|
|
4299
4347
|
variant === "striped" && index % 2 === 1 ? "rh-bg-background/50" : ""
|
|
4300
4348
|
].filter(Boolean).join(" "),
|
|
4301
4349
|
children: columns.map((column) => /* @__PURE__ */ jsx(
|
|
@@ -4317,7 +4365,7 @@ function TableInner({
|
|
|
4317
4365
|
onChange: (value) => column.onEditChange?.(row, index, value),
|
|
4318
4366
|
className: "rh-w-full rh-h-full"
|
|
4319
4367
|
}
|
|
4320
|
-
) : /* @__PURE__ */ jsx("span", { children: column.render(row, index) }),
|
|
4368
|
+
) : /* @__PURE__ */ jsx("span", { style: { width: "100%" }, children: column.render(row, index) }),
|
|
4321
4369
|
column.actionIcon && /* @__PURE__ */ jsx(
|
|
4322
4370
|
"span",
|
|
4323
4371
|
{
|