@natoora-libs/core 0.2.43 → 0.2.45

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.
@@ -928,11 +928,12 @@ type SearchHeaderProps = {
928
928
  children?: ReactNode;
929
929
  onSearch?: (value: string) => void;
930
930
  value?: string;
931
+ initialValue?: string;
931
932
  onChange?: (e: React__default.ChangeEvent<HTMLInputElement>) => void;
932
933
  onKeyDown?: (e: React__default.KeyboardEvent<HTMLInputElement>) => void;
933
934
  width?: number;
934
935
  };
935
- declare const SearchHeader: ({ renderButton, renderExtraAction, children, onSearch, value, onChange, onKeyDown, width, }: SearchHeaderProps) => react_jsx_runtime.JSX.Element;
936
+ declare const SearchHeader: ({ renderButton, renderExtraAction, children, onSearch, value, onChange, onKeyDown, width, initialValue }: SearchHeaderProps) => react_jsx_runtime.JSX.Element;
936
937
 
937
938
  interface ISearchWithFiltersProps {
938
939
  enterPressedInSearch?: () => void;
@@ -928,11 +928,12 @@ type SearchHeaderProps = {
928
928
  children?: ReactNode;
929
929
  onSearch?: (value: string) => void;
930
930
  value?: string;
931
+ initialValue?: string;
931
932
  onChange?: (e: React__default.ChangeEvent<HTMLInputElement>) => void;
932
933
  onKeyDown?: (e: React__default.KeyboardEvent<HTMLInputElement>) => void;
933
934
  width?: number;
934
935
  };
935
- declare const SearchHeader: ({ renderButton, renderExtraAction, children, onSearch, value, onChange, onKeyDown, width, }: SearchHeaderProps) => react_jsx_runtime.JSX.Element;
936
+ declare const SearchHeader: ({ renderButton, renderExtraAction, children, onSearch, value, onChange, onKeyDown, width, initialValue }: SearchHeaderProps) => react_jsx_runtime.JSX.Element;
936
937
 
937
938
  interface ISearchWithFiltersProps {
938
939
  enterPressedInSearch?: () => void;
@@ -8043,7 +8043,8 @@ var SearchHeader = ({
8043
8043
  value,
8044
8044
  onChange,
8045
8045
  onKeyDown,
8046
- width
8046
+ width,
8047
+ initialValue
8047
8048
  }) => {
8048
8049
  return /* @__PURE__ */ jsxs81(
8049
8050
  Paper11,
@@ -8071,7 +8072,8 @@ var SearchHeader = ({
8071
8072
  onSearch,
8072
8073
  value,
8073
8074
  onChange,
8074
- onKeyDown
8075
+ onKeyDown,
8076
+ initialValue
8075
8077
  }
8076
8078
  ),
8077
8079
  renderExtraAction
@@ -10639,8 +10641,8 @@ var ThemedDateRangePicker = ({
10639
10641
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
10640
10642
 
10641
10643
  // src/components/TheToolbar/TheToolbar.tsx
10642
- import { memo as memo24, useLayoutEffect as useLayoutEffect2, useRef as useRef12, useState as useState28 } from "react";
10643
- import { AppBar, Box as Box50, Toolbar, useMediaQuery, useTheme as useTheme3 } from "@mui/material";
10644
+ import { memo as memo24 } from "react";
10645
+ import { AppBar, Box as Box50, Toolbar } from "@mui/material";
10644
10646
  import { makeStyles as makeStyles49 } from "tss-react/mui";
10645
10647
  import { jsx as jsx145, jsxs as jsxs97 } from "react/jsx-runtime";
10646
10648
  var useStyles49 = makeStyles49()((theme) => ({
@@ -10656,8 +10658,6 @@ var useStyles49 = makeStyles49()((theme) => ({
10656
10658
  }
10657
10659
  }
10658
10660
  }));
10659
- var CENTER_MIN_WIDTH = 320;
10660
- var SAFETY_BUFFER = 24;
10661
10661
  var TheToolbar = ({
10662
10662
  imageLogoDarkSmall,
10663
10663
  imageLogoLightSmall,
@@ -10669,48 +10669,9 @@ var TheToolbar = ({
10669
10669
  isAuthenticated = true
10670
10670
  }) => {
10671
10671
  const { classes } = useStyles49();
10672
- const theme = useTheme3();
10673
- const belowXl = useMediaQuery(theme.breakpoints.down("xl"));
10674
- const toolbarRef = useRef12(null);
10675
- const leftSectionMeasureRef = useRef12(null);
10676
- const rightSectionMeasureRef = useRef12(null);
10677
- const logoRef = useRef12(null);
10678
- const rightSectionRef = useRef12(null);
10679
- const menuButtonRef = useRef12(null);
10680
- const [hideLeftSection, setHideLeftSection] = useState28(false);
10681
- const [hideRightSection, setHideRightSection] = useState28(false);
10682
- useLayoutEffect2(() => {
10683
- if (belowXl) {
10684
- setHideLeftSection(true);
10685
- }
10686
- const toolbar = toolbarRef.current;
10687
- const leftMeasure = leftSectionMeasureRef.current;
10688
- const rightMeasure = rightSectionMeasureRef.current;
10689
- if (!toolbar) return void 0;
10690
- const update = () => {
10691
- const toolbarWidth = toolbar.clientWidth;
10692
- const leftWidth = leftMeasure?.scrollWidth ?? 0;
10693
- const rightWidth = rightMeasure?.scrollWidth ?? 0;
10694
- const logoWidth = logoRef.current?.offsetWidth ?? 0;
10695
- const menuWidth = menuButtonRef.current?.offsetWidth ?? 0;
10696
- const availableWithoutLeft = toolbarWidth - logoWidth - menuWidth - CENTER_MIN_WIDTH - SAFETY_BUFFER;
10697
- const nextHideRight = rightWidth > availableWithoutLeft;
10698
- setHideRightSection(nextHideRight);
10699
- if (!belowXl) {
10700
- const effectiveRightWidth = nextHideRight ? 0 : rightWidth;
10701
- setHideLeftSection(leftWidth > availableWithoutLeft - effectiveRightWidth);
10702
- }
10703
- };
10704
- update();
10705
- const observer = new ResizeObserver(update);
10706
- observer.observe(toolbar);
10707
- if (leftMeasure) observer.observe(leftMeasure);
10708
- if (rightMeasure) observer.observe(rightMeasure);
10709
- return () => observer.disconnect();
10710
- }, [belowXl, leftSection, rightSection]);
10711
10672
  return /* @__PURE__ */ jsxs97(Box50, { children: [
10712
- /* @__PURE__ */ jsx145(AppBar, { children: /* @__PURE__ */ jsxs97(Toolbar, { className: classes.topBar, ref: toolbarRef, children: [
10713
- isAuthenticated ? /* @__PURE__ */ jsx145(Box50, { ref: menuButtonRef, sx: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ jsx145(
10673
+ /* @__PURE__ */ jsx145(AppBar, { children: /* @__PURE__ */ jsxs97(Toolbar, { className: classes.topBar, children: [
10674
+ isAuthenticated ? /* @__PURE__ */ jsx145(Box50, { sx: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ jsx145(
10714
10675
  RoundButton_default,
10715
10676
  {
10716
10677
  className: classes.menuButton,
@@ -10719,30 +10680,20 @@ var TheToolbar = ({
10719
10680
  onClick: handleOpen
10720
10681
  }
10721
10682
  ) }) : null,
10722
- /* @__PURE__ */ jsx145(
10723
- Box50,
10683
+ /* @__PURE__ */ jsx145(Box50, { sx: { display: { xs: "none", lg: "block" }, flexShrink: 0 }, children: /* @__PURE__ */ jsx145(
10684
+ CompanyLogo_default,
10724
10685
  {
10725
- ref: logoRef,
10726
- sx: { display: { xs: "none", lg: "block" }, flexShrink: 0 },
10727
- children: /* @__PURE__ */ jsx145(
10728
- CompanyLogo_default,
10729
- {
10730
- size: "small",
10731
- color: "light",
10732
- imageLogoDarkSmall,
10733
- imageLogoLightSmall
10734
- }
10735
- )
10686
+ size: "small",
10687
+ color: "light",
10688
+ imageLogoDarkSmall,
10689
+ imageLogoLightSmall
10736
10690
  }
10737
- ),
10691
+ ) }),
10738
10692
  /* @__PURE__ */ jsx145(
10739
10693
  Box50,
10740
10694
  {
10741
10695
  ml: { xs: 0, lg: 2 },
10742
- sx: {
10743
- display: hideLeftSection ? "none" : "block",
10744
- flexShrink: 0
10745
- },
10696
+ sx: { flexShrink: 0, display: { xs: "none", xl: "block" } },
10746
10697
  children: leftSection
10747
10698
  }
10748
10699
  ),
@@ -10758,49 +10709,8 @@ var TheToolbar = ({
10758
10709
  children: centerSection
10759
10710
  }
10760
10711
  ) : /* @__PURE__ */ jsx145(Box50, { sx: { flexGrow: 1 } }),
10761
- /* @__PURE__ */ jsx145(
10762
- Box50,
10763
- {
10764
- ref: rightSectionRef,
10765
- sx: { flexShrink: 0, display: hideRightSection ? "none" : "block" },
10766
- children: rightSection
10767
- }
10768
- )
10712
+ /* @__PURE__ */ jsx145(Box50, { sx: { flexShrink: 0, display: { xs: "none", xl: "block" } }, children: rightSection })
10769
10713
  ] }) }),
10770
- /* @__PURE__ */ jsx145(
10771
- Box50,
10772
- {
10773
- ref: leftSectionMeasureRef,
10774
- "aria-hidden": true,
10775
- sx: {
10776
- position: "fixed",
10777
- top: 0,
10778
- left: 0,
10779
- visibility: "hidden",
10780
- pointerEvents: "none",
10781
- whiteSpace: "nowrap",
10782
- display: "inline-flex"
10783
- },
10784
- children: leftSection
10785
- }
10786
- ),
10787
- /* @__PURE__ */ jsx145(
10788
- Box50,
10789
- {
10790
- ref: rightSectionMeasureRef,
10791
- "aria-hidden": true,
10792
- sx: {
10793
- position: "fixed",
10794
- top: 0,
10795
- left: 0,
10796
- visibility: "hidden",
10797
- pointerEvents: "none",
10798
- whiteSpace: "nowrap",
10799
- display: "inline-flex"
10800
- },
10801
- children: rightSection
10802
- }
10803
- ),
10804
10714
  LeftDrawer
10805
10715
  ] });
10806
10716
  };