react-better-html 1.1.134 → 1.1.136

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
@@ -6494,7 +6494,6 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
6494
6494
  const newTime = `${internalValue?.toString().split("T")?.[1]?.split(":")[0] || "00"}:${minute.toString().padStart(2, "0")}`;
6495
6495
  const today = `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
6496
6496
  const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
6497
- console.log(newValue);
6498
6497
  inputFieldProps.onChangeValue?.(newValue);
6499
6498
  setInternalValue(newValue);
6500
6499
  },
@@ -7409,12 +7408,8 @@ var TableComponent = forwardRef15(function Table({
7409
7408
  const mediaQuery = useMediaQuery();
7410
7409
  const { colorTheme } = useBetterHtmlContextInternal();
7411
7410
  const filterModalRef = useRef6(null);
7412
- const onChangePageRef = useRef6(onChangePage);
7413
- onChangePageRef.current = onChangePage;
7414
- const onChangeFilterRef = useRef6(onChangeFilter);
7415
- onChangeFilterRef.current = onChangeFilter;
7416
- const onChangeFilterDataValueRef = useRef6(onChangeFilterDataValue);
7417
- onChangeFilterDataValueRef.current = onChangeFilterDataValue;
7411
+ const columnsRef = useRef6(columns);
7412
+ columnsRef.current = columns;
7418
7413
  const [checkedItems, setCheckedItems] = useState9([]);
7419
7414
  const [expandedRows, setExpandedRows] = useState9([]);
7420
7415
  const [currentPage, setCurrentPage] = useState9(1);
@@ -7662,7 +7657,7 @@ var TableComponent = forwardRef15(function Table({
7662
7657
  () => data.filter(
7663
7658
  (item) => Object.entries(filterData).every(([columnIndex, filter]) => {
7664
7659
  if (!filter) return true;
7665
- const column = columns[parseInt(columnIndex)];
7660
+ const column = columnsRef.current[parseInt(columnIndex)];
7666
7661
  if (!column) return true;
7667
7662
  if (column.filter === "number" && filter.type === "number") {
7668
7663
  const itemValue = column.getValue?.(item) ?? (column.type === "text" && column.keyName ? Number(item[column.keyName]) : 0);
@@ -7681,7 +7676,7 @@ var TableComponent = forwardRef15(function Table({
7681
7676
  return true;
7682
7677
  })
7683
7678
  ),
7684
- [data, filterData, columns]
7679
+ [data, filterData]
7685
7680
  );
7686
7681
  const dataAfterPagination = useMemo8(() => {
7687
7682
  if (pageSize === void 0) return dataAfterFilter;
@@ -7749,14 +7744,14 @@ var TableComponent = forwardRef15(function Table({
7749
7744
  );
7750
7745
  const onClickDeselectAllFilterListItems = useCallback11(() => setFilterListSelectedItems([]), []);
7751
7746
  useEffect10(() => {
7752
- onChangePageRef.current?.(currentPage);
7753
- }, [currentPage]);
7747
+ onChangePage?.(currentPage);
7748
+ }, [onChangePage, currentPage]);
7754
7749
  useEffect10(() => {
7755
- onChangeFilterRef.current?.(filterData);
7756
- }, [filterData]);
7750
+ onChangeFilter?.(filterData);
7751
+ }, [onChangeFilter, filterData]);
7757
7752
  useEffect10(() => {
7758
- onChangeFilterDataValueRef.current?.(dataAfterFilter);
7759
- }, [dataAfterFilter]);
7753
+ onChangeFilterDataValue?.(dataAfterFilter);
7754
+ }, [onChangeFilterDataValue, dataAfterFilter]);
7760
7755
  useImperativeHandle2(
7761
7756
  ref,
7762
7757
  () => {
@@ -8217,6 +8212,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
8217
8212
  content,
8218
8213
  contentWidth,
8219
8214
  contentMinWidth,
8215
+ childrenWrapperWidth = "fit-content",
8220
8216
  withArrow,
8221
8217
  isSmall,
8222
8218
  backgroundColor,
@@ -8314,12 +8310,12 @@ var TooltipComponent = forwardRef16(function Tooltip({
8314
8310
  Div_default,
8315
8311
  {
8316
8312
  position: "relative",
8317
- width: "fit-content",
8313
+ width: childrenWrapperWidth,
8318
8314
  onClick: onClickHolder,
8319
8315
  onMouseEnter,
8320
8316
  onMouseLeave,
8321
8317
  children: [
8322
- /* @__PURE__ */ jsx23(Div_default, { width: "fit-content", isTabAccessed, ref: triggerHolderRef, children }),
8318
+ /* @__PURE__ */ jsx23(Div_default, { width: childrenWrapperWidth, isTabAccessed, ref: triggerHolderRef, children }),
8323
8319
  /* @__PURE__ */ jsx23(
8324
8320
  TooltipContainer,
8325
8321
  {