schummar-table 0.49.0 → 0.49.1

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
@@ -1,5 +1,5 @@
1
1
  import { __export } from "./chunk-CTAAG5j7.js";
2
- import { Popover, Store, StoreScope, TableSettingsContext, TableSettingsProvider, configureTableTheme, defaultClasses, globalTableTheme, mergeThemes, throttle } from "./tableSettings-DFnt2SZO.js";
2
+ import { Popover, Store, StoreScope, TableSettingsContext, TableSettingsProvider, configureTableTheme, defaultClasses, globalTableTheme, mergeThemes, throttle } from "./tableSettings-BRhj6F3f.js";
3
3
  import "./csvExporter-DRm4V8We.js";
4
4
  import { Fragment, cloneElement, createContext, forwardRef, memo, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
5
5
  import { castDraft } from "immer";
@@ -244,7 +244,6 @@ const IconButton = (props) => {
244
244
  //#endregion
245
245
  //#region src/theme/defaultTheme/textField.tsx
246
246
  const TextField = ({ startIcon, endIcon, className: className$2, inputRef, onBlur,...props }) => {
247
- const [focus, setFocus] = useState(false);
248
247
  return /* @__PURE__ */ jsxs("div", {
249
248
  className: className$2,
250
249
  css: [{
@@ -252,10 +251,11 @@ const TextField = ({ startIcon, endIcon, className: className$2, inputRef, onBlu
252
251
  display: "flex",
253
252
  alignItems: "center",
254
253
  border: "1px solid var(--table-textfield-border, var(--table-border, #777777))",
255
- borderRadius: 4
256
- }, focus && {
257
- border: "2px solid var(--primaryMain)",
258
- margin: -1
254
+ borderRadius: 4,
255
+ "&:focus-within": {
256
+ border: "2px solid var(--primaryMain)",
257
+ margin: -1
258
+ }
259
259
  }],
260
260
  children: [
261
261
  startIcon,
@@ -263,11 +263,7 @@ const TextField = ({ startIcon, endIcon, className: className$2, inputRef, onBlu
263
263
  ref: inputRef,
264
264
  ...props,
265
265
  value: props.value ?? "",
266
- onFocus: () => setFocus(true),
267
- onBlur: (event) => {
268
- setFocus(false);
269
- onBlur?.(event);
270
- },
266
+ onBlur,
271
267
  css: {
272
268
  minWidth: 0,
273
269
  width: "100%",
@@ -638,7 +634,9 @@ function AutoFocusTextField(props) {
638
634
  const ref = useRef(null);
639
635
  const { isActive } = useContext(FilterControlContext);
640
636
  useLayoutEffect(() => {
641
- if (isActive && ref.current) ref.current.focus();
637
+ if (isActive && ref.current) setTimeout(() => {
638
+ ref.current?.focus();
639
+ });
642
640
  }, [isActive]);
643
641
  return /* @__PURE__ */ jsx(TextField$1, {
644
642
  ...props,
@@ -2708,6 +2706,7 @@ function calcItems(state) {
2708
2706
  return castArray((filter.filterBy ?? ((x) => x))(column.value(item.value), item.value)).some((value) => filter.test(filterValue, value));
2709
2707
  });
2710
2708
  if (isActive && item.parentId !== void 0 && item.parentId !== null) {
2709
+ activeSet.add(item.parentId);
2711
2710
  if (revealFiltered && Array.from(filters.entries()).some(([id$1, filter]) => {
2712
2711
  const filterValue = filterValues.get(id$1);
2713
2712
  return !!filter && filterValue !== void 0 && filter.isActive(filterValue);
@@ -2716,7 +2715,6 @@ function calcItems(state) {
2716
2715
  draft.expanded.add(item.parentId);
2717
2716
  } else if (!draft.expanded.has(item.parentId)) isActive = false;
2718
2717
  }
2719
- if (isActive && item.parentId !== void 0 && item.parentId !== null) activeSet.add(item.parentId);
2720
2718
  if (isActive) activeItemsById.set(item.id, item);
2721
2719
  return isActive;
2722
2720
  }).reverse();