@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.js CHANGED
@@ -2370,18 +2370,19 @@ function useCalendarState(props) {
2370
2370
  var CALENDAR_GAP = 4;
2371
2371
  var CALENDAR_MIN_WIDTH = 280;
2372
2372
  function useFloatingCalendarPosition(anchorRef, isOpen2, placement, align = "start") {
2373
- const [style, setStyle] = useState({ visibility: "hidden" });
2373
+ const [style, setStyle] = useState({ position: "fixed", visibility: "hidden" });
2374
2374
  useLayoutEffect(() => {
2375
2375
  if (!isOpen2 || !anchorRef.current) return;
2376
2376
  const update = () => {
2377
2377
  const rect = anchorRef.current.getBoundingClientRect();
2378
- const left = align === "end" ? Math.max(8, rect.right - CALENDAR_MIN_WIDTH) : rect.left;
2379
2378
  const base = {
2380
2379
  position: "fixed",
2381
- left,
2382
2380
  zIndex: CALENDAR_PORTAL_Z_INDEX,
2383
2381
  minWidth: CALENDAR_MIN_WIDTH,
2384
- visibility: "visible"
2382
+ visibility: "visible",
2383
+ ...align === "end" ? { left: rect.left } : { right: window.innerWidth - rect.right }
2384
+ // ? { right: window.innerWidth - rect.right }
2385
+ // : { left: rect.left }),
2385
2386
  };
2386
2387
  if (placement === "top") {
2387
2388
  setStyle({ ...base, bottom: window.innerHeight - rect.top + CALENDAR_GAP });
@@ -4149,18 +4150,22 @@ function TableHeader(props) {
4149
4150
  idx > 0 && /* @__PURE__ */ jsx("wbr", {}),
4150
4151
  /* @__PURE__ */ jsx("span", { style: { whiteSpace: "nowrap" }, children: part })
4151
4152
  ] }, idx)) : column.title;
4152
- const paddingClass = hasSortIcon ? column.align === "center" ? "pl-1" : "pl-3" : "px-3";
4153
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center w-full", children: [
4154
- hasSortIcon && column.align === "center" && !column.isWrap && /* @__PURE__ */ jsx("div", { className: "w-5 shrink-0" }),
4153
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex items-center w-full", children: [
4155
4154
  /* @__PURE__ */ jsx(
4156
4155
  "span",
4157
4156
  {
4158
- className: `flex-1 min-w-0 ${paddingClass} ${textAlignClass} ${baseClasses} ${isClickableHead} ${subTitleClasses}`,
4157
+ className: `w-full px-3 ${hasSortIcon && column.align !== "center" ? "pr-6" : ""} ${textAlignClass} ${baseClasses} ${isClickableHead} ${subTitleClasses}`,
4159
4158
  style: hasWrapParts ? { wordBreak: "keep-all" } : void 0,
4160
4159
  children: titleContent
4161
4160
  }
4162
4161
  ),
4163
- hasSortIcon && /* @__PURE__ */ jsx("div", { className: `w-6 shrink-0 flex items-center justify-center cursor-pointer ${isClickableHead}`, children: renderSortIcon(column.key) })
4162
+ hasSortIcon && /* @__PURE__ */ jsx(
4163
+ "div",
4164
+ {
4165
+ className: `absolute right-0 top-1/2 -translate-y-1/2 w-5 flex items-center justify-start cursor-pointer ${isClickableHead}`,
4166
+ children: renderSortIcon(column.key)
4167
+ }
4168
+ )
4164
4169
  ] });
4165
4170
  };
4166
4171
  const createGroupHeaders = () => {