@sustaina/shared-ui 1.21.0 → 1.22.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.mjs CHANGED
@@ -1231,14 +1231,14 @@ var Input = React4.forwardRef(
1231
1231
  type = "text",
1232
1232
  ...rest
1233
1233
  }, ref) => {
1234
+ const inputProps = rest;
1234
1235
  const hasPrefix = Boolean(prefix);
1235
1236
  const hasSuffix = Boolean(suffix) || loading;
1236
1237
  const isFullWidth = fullWidth ?? true;
1237
1238
  const {
1238
1239
  "aria-invalid": ariaInvalidProp,
1239
1240
  "aria-describedby": ariaDescribedByProp,
1240
- onChange: onChangeProp,
1241
- ...inputProps
1241
+ onChange: onChangeProp
1242
1242
  } = rest;
1243
1243
  const ariaInvalid = invalid ?? ariaInvalidProp;
1244
1244
  const messageId = React4.useId();
@@ -1315,7 +1315,7 @@ var Input = React4.forwardRef(
1315
1315
  return inputWithAffixes;
1316
1316
  }
1317
1317
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", isFullWidth ? "w-full" : "w-fit", wrapperClassName), children: [
1318
- hasPrefix || hasSuffix ? inputWithAffixes : inputElement,
1318
+ inputWithAffixes,
1319
1319
  /* @__PURE__ */ jsxs(
1320
1320
  "p",
1321
1321
  {
@@ -4356,9 +4356,6 @@ var DataTable = ({
4356
4356
  columnResizeMode: columnResizing?.enabled ? columnResizing?.resizeMode ?? "onChange" : "onChange"
4357
4357
  })
4358
4358
  });
4359
- if (isDefined(tableRef) && !isDefined(tableRef?.current)) {
4360
- tableRef.current = table;
4361
- }
4362
4359
  const tableContainerRef = useRef(null);
4363
4360
  const isTableEmpty = table.getCoreRowModel().rows.length === 0;
4364
4361
  const isTableEmptyAfterFiltering = table.getRowModel().rows.length === 0;
@@ -4436,6 +4433,13 @@ var DataTable = ({
4436
4433
  // eslint-disable-next-line react-hooks/exhaustive-deps
4437
4434
  [scrollFetch?.enabled, scrollFetch?.isFetchingMore, scrollFetch?.hasMore, scrollFetch?.fetchMore]
4438
4435
  );
4436
+ useEffect(() => {
4437
+ if (!tableRef) return;
4438
+ tableRef.current = table;
4439
+ return () => {
4440
+ tableRef.current = null;
4441
+ };
4442
+ }, [tableRef, table]);
4439
4443
  useEffect(() => {
4440
4444
  fetchMoreOnScrollReached(tableContainerRef.current);
4441
4445
  }, [fetchMoreOnScrollReached]);