@farmzone/fz-react-ui 1.0.22 → 1.1.0
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 +14 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2404,18 +2404,19 @@ function useCalendarState(props) {
|
|
|
2404
2404
|
var CALENDAR_GAP = 4;
|
|
2405
2405
|
var CALENDAR_MIN_WIDTH = 280;
|
|
2406
2406
|
function useFloatingCalendarPosition(anchorRef, isOpen2, placement, align = "start") {
|
|
2407
|
-
const [style, setStyle] = React6.useState({ visibility: "hidden" });
|
|
2407
|
+
const [style, setStyle] = React6.useState({ position: "fixed", visibility: "hidden" });
|
|
2408
2408
|
React6.useLayoutEffect(() => {
|
|
2409
2409
|
if (!isOpen2 || !anchorRef.current) return;
|
|
2410
2410
|
const update = () => {
|
|
2411
2411
|
const rect = anchorRef.current.getBoundingClientRect();
|
|
2412
|
-
const left = align === "end" ? Math.max(8, rect.right - CALENDAR_MIN_WIDTH) : rect.left;
|
|
2413
2412
|
const base = {
|
|
2414
2413
|
position: "fixed",
|
|
2415
|
-
left,
|
|
2416
2414
|
zIndex: CALENDAR_PORTAL_Z_INDEX,
|
|
2417
2415
|
minWidth: CALENDAR_MIN_WIDTH,
|
|
2418
|
-
visibility: "visible"
|
|
2416
|
+
visibility: "visible",
|
|
2417
|
+
...align === "end" ? { left: rect.left } : { right: window.innerWidth - rect.right }
|
|
2418
|
+
// ? { right: window.innerWidth - rect.right }
|
|
2419
|
+
// : { left: rect.left }),
|
|
2419
2420
|
};
|
|
2420
2421
|
if (placement === "top") {
|
|
2421
2422
|
setStyle({ ...base, bottom: window.innerHeight - rect.top + CALENDAR_GAP });
|
|
@@ -4183,18 +4184,22 @@ function TableHeader(props) {
|
|
|
4183
4184
|
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx("wbr", {}),
|
|
4184
4185
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { whiteSpace: "nowrap" }, children: part })
|
|
4185
4186
|
] }, idx)) : column.title;
|
|
4186
|
-
|
|
4187
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center w-full", children: [
|
|
4188
|
-
hasSortIcon && column.align === "center" && !column.isWrap && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-5 shrink-0" }),
|
|
4187
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center w-full", children: [
|
|
4189
4188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4190
4189
|
"span",
|
|
4191
4190
|
{
|
|
4192
|
-
className: `
|
|
4191
|
+
className: `w-full px-3 ${hasSortIcon && column.align !== "center" ? "pr-6" : ""} ${textAlignClass} ${baseClasses} ${isClickableHead} ${subTitleClasses}`,
|
|
4193
4192
|
style: hasWrapParts ? { wordBreak: "keep-all" } : void 0,
|
|
4194
4193
|
children: titleContent
|
|
4195
4194
|
}
|
|
4196
4195
|
),
|
|
4197
|
-
hasSortIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4196
|
+
hasSortIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4197
|
+
"div",
|
|
4198
|
+
{
|
|
4199
|
+
className: `absolute right-0 top-1/2 -translate-y-1/2 w-5 flex items-center justify-start cursor-pointer ${isClickableHead}`,
|
|
4200
|
+
children: renderSortIcon(column.key)
|
|
4201
|
+
}
|
|
4202
|
+
)
|
|
4198
4203
|
] });
|
|
4199
4204
|
};
|
|
4200
4205
|
const createGroupHeaders = () => {
|