@natoora-libs/core 0.2.12 → 0.2.14

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.
@@ -55,6 +55,7 @@ type TableDesktopToolbarProps = {
55
55
  disableBulkChangesMode?: boolean;
56
56
  isBulkChangesMode: boolean;
57
57
  onChangeBulkChangesMode: (checked: boolean) => void;
58
+ onActivateBulkChangesMode?: () => void;
58
59
  renderExportCsvDialog?: (props: ExportCsvDialogProps) => ReactNode;
59
60
  renderBulkChangesDialog?: (props: BulkChangesDialogProps) => ReactNode;
60
61
  renderTableColumnConfigurationMenu?: (props: TableColumnConfigurationMenuProps) => ReactNode;
@@ -55,6 +55,7 @@ type TableDesktopToolbarProps = {
55
55
  disableBulkChangesMode?: boolean;
56
56
  isBulkChangesMode: boolean;
57
57
  onChangeBulkChangesMode: (checked: boolean) => void;
58
+ onActivateBulkChangesMode?: () => void;
58
59
  renderExportCsvDialog?: (props: ExportCsvDialogProps) => ReactNode;
59
60
  renderBulkChangesDialog?: (props: BulkChangesDialogProps) => ReactNode;
60
61
  renderTableColumnConfigurationMenu?: (props: TableColumnConfigurationMenuProps) => ReactNode;
@@ -480,7 +480,9 @@ var AlertDialog = ({
480
480
  rejectCopy,
481
481
  acceptCopy,
482
482
  content,
483
- disabledContentPadding
483
+ disabledContentPadding,
484
+ disableEnforceFocus,
485
+ disableRestoreFocus
484
486
  }) => {
485
487
  const { classes } = useStyles();
486
488
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
@@ -491,6 +493,8 @@ var AlertDialog = ({
491
493
  maxWidth,
492
494
  fullScreen,
493
495
  fullWidth,
496
+ disableEnforceFocus,
497
+ disableRestoreFocus,
494
498
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Box, { children: [
495
499
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Box, { className: classes.topSection, children: [
496
500
  alertTitle ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "h5", className: classes.title, children: alertTitle }) : null,
@@ -3559,7 +3563,8 @@ var RoundButton = ({
3559
3563
  knife: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(IconKnife_default, {}),
3560
3564
  bicycle: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(IconBicycle_default, {}),
3561
3565
  heart: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(IconHeart_default, {}),
3562
- airplane: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(IconAirplane_default, {})
3566
+ airplane: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(IconAirplane_default, {}),
3567
+ swapHoriz: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_icons_material5.SwapHoriz, { fontSize: iconSize })
3563
3568
  };
3564
3569
  const filteredSize = size === "double" ? void 0 : size;
3565
3570
  const handleClick = (e) => {
@@ -5144,10 +5149,12 @@ var useStyles27 = (0, import_mui29.makeStyles)()((theme) => ({
5144
5149
  borderTop: `1px solid ${colors.neutral400}`,
5145
5150
  width: "100%",
5146
5151
  height: footerHeight,
5147
- padding: theme.spacing(0, 2)
5152
+ padding: theme.spacing(0, 2),
5153
+ zIndex: 999
5148
5154
  },
5149
5155
  fixedOffset: {
5150
- height: footerHeight
5156
+ height: footerHeight,
5157
+ backgroundColor: "white"
5151
5158
  }
5152
5159
  }));
5153
5160
  var FixedFooter = ({ justifyContent, children }) => {
@@ -5842,7 +5849,8 @@ var useStyles34 = (0, import_mui36.makeStyles)()((theme) => ({
5842
5849
  left: 0
5843
5850
  },
5844
5851
  fixedOffset: {
5845
- height: paginationHeight
5852
+ height: paginationHeight,
5853
+ backgroundColor: "white"
5846
5854
  }
5847
5855
  }));
5848
5856
  var PaginationForTable = ({
@@ -6504,7 +6512,7 @@ var RenderAvatar_default = RenderAvatar;
6504
6512
 
6505
6513
  // src/components/RenderContentList/RenderContentList.tsx
6506
6514
  var import_react29 = require("react");
6507
- var import_icons_material8 = require("@mui/icons-material");
6515
+ var import_WarningAmber = __toESM(require("@mui/icons-material/WarningAmber"), 1);
6508
6516
  var import_material53 = require("@mui/material");
6509
6517
  var import_mui41 = require("tss-react/mui");
6510
6518
 
@@ -6536,8 +6544,31 @@ var RenderContentList = ({
6536
6544
  const { classes } = useStyles36();
6537
6545
  const [active, setActive] = (0, import_react29.useState)(activeSection);
6538
6546
  const observer = (0, import_react29.useRef)(null);
6547
+ const isScrolling = (0, import_react29.useRef)(false);
6548
+ const timeoutScrolling = (0, import_react29.useRef)(null);
6539
6549
  (0, import_react29.useEffect)(() => {
6540
- setActive(activeSection);
6550
+ if (!activeSection) {
6551
+ return void 0;
6552
+ }
6553
+ isScrolling.current = true;
6554
+ const targetId = transformNameToID(activeSection);
6555
+ setActive(targetId);
6556
+ const element = document.getElementById(targetId);
6557
+ if (element) {
6558
+ element.scrollIntoView({
6559
+ behavior: "smooth",
6560
+ block: "start"
6561
+ });
6562
+ }
6563
+ if (timeoutScrolling.current) {
6564
+ clearTimeout(timeoutScrolling.current);
6565
+ }
6566
+ timeoutScrolling.current = setTimeout(() => {
6567
+ isScrolling.current = false;
6568
+ }, 1e3);
6569
+ return () => {
6570
+ if (timeoutScrolling.current) clearTimeout(timeoutScrolling.current);
6571
+ };
6541
6572
  }, [activeSection]);
6542
6573
  (0, import_react29.useEffect)(() => {
6543
6574
  const sections = items.map((item) => ({
@@ -6547,9 +6578,14 @@ var RenderContentList = ({
6547
6578
  if (observer.current) {
6548
6579
  observer.current.disconnect();
6549
6580
  }
6550
- if (sections.length === 0) return;
6581
+ if (sections.length === 0) {
6582
+ return void 0;
6583
+ }
6551
6584
  observer.current = new IntersectionObserver(
6552
6585
  (entries) => {
6586
+ if (isScrolling.current) {
6587
+ return;
6588
+ }
6553
6589
  const visibleSection = entries.find((entry) => entry.isIntersecting);
6554
6590
  if (visibleSection) {
6555
6591
  setActive(visibleSection.target.id);
@@ -6568,6 +6604,21 @@ var RenderContentList = ({
6568
6604
  observer.current?.disconnect();
6569
6605
  };
6570
6606
  }, [items]);
6607
+ const handleMenuClick = (id) => {
6608
+ isScrolling.current = true;
6609
+ setActive(id);
6610
+ const element = document.getElementById(id);
6611
+ if (element) {
6612
+ element.scrollIntoView({
6613
+ behavior: "smooth",
6614
+ block: "start"
6615
+ });
6616
+ }
6617
+ if (timeoutScrolling.current) clearTimeout(timeoutScrolling.current);
6618
+ timeoutScrolling.current = setTimeout(() => {
6619
+ isScrolling.current = false;
6620
+ }, 1e3);
6621
+ };
6571
6622
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
6572
6623
  import_material53.List,
6573
6624
  {
@@ -6581,19 +6632,10 @@ var RenderContentList = ({
6581
6632
  {
6582
6633
  selected: active === id,
6583
6634
  classes: { root: classes.root, selected: classes.selected },
6584
- onClick: () => {
6585
- setActive(id);
6586
- const element = document.getElementById(id);
6587
- if (element) {
6588
- element.scrollIntoView({
6589
- behavior: "smooth",
6590
- block: "start"
6591
- });
6592
- }
6593
- },
6635
+ onClick: () => handleMenuClick(id),
6594
6636
  children: [
6595
6637
  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material53.ListItemText, { primary: item }),
6596
- (warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material53.Tooltip, { title: warningMessage, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_icons_material8.WarningAmber, { color: "warning" }) })
6638
+ (warningItems?.includes(item) || warningItems?.includes(id)) && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_material53.Tooltip, { title: warningMessage, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_WarningAmber.default, { color: "warning" }) })
6597
6639
  ]
6598
6640
  },
6599
6641
  id
@@ -6841,7 +6883,7 @@ var import_mui45 = require("tss-react/mui");
6841
6883
  // src/components/SearchWithFilters/SearchWithFilters.tsx
6842
6884
  var import_react31 = require("react");
6843
6885
  var React6 = __toESM(require("react"), 1);
6844
- var import_icons_material9 = require("@mui/icons-material");
6886
+ var import_icons_material8 = require("@mui/icons-material");
6845
6887
  var import_material56 = require("@mui/material");
6846
6888
  var import_mui44 = require("tss-react/mui");
6847
6889
  var import_jsx_runtime109 = require("react/jsx-runtime");
@@ -6905,7 +6947,7 @@ var SearchWithFilters = ({
6905
6947
  setSearchText(searchValue);
6906
6948
  }, [searchValue]);
6907
6949
  return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_material56.Paper, { className: classes.searchContainer, children: [
6908
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material9.Search, { className: classes.icon, fontSize: "small" }),
6950
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material8.Search, { className: classes.icon, fontSize: "small" }),
6909
6951
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
6910
6952
  import_material56.InputBase,
6911
6953
  {
@@ -6927,7 +6969,7 @@ var SearchWithFilters = ({
6927
6969
  disabled,
6928
6970
  children: [
6929
6971
  "Filters",
6930
- showFilters ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material9.ArrowDropUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material9.ArrowDropDown, {})
6972
+ showFilters ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material8.ArrowDropUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_icons_material8.ArrowDropDown, {})
6931
6973
  ]
6932
6974
  }
6933
6975
  )
@@ -7002,7 +7044,7 @@ var import_mui47 = require("tss-react/mui");
7002
7044
 
7003
7045
  // src/components/SearchWithFilters/SearchWithFiltersForTable.tsx
7004
7046
  var import_react32 = require("react");
7005
- var import_icons_material10 = require("@mui/icons-material");
7047
+ var import_icons_material9 = require("@mui/icons-material");
7006
7048
  var import_material58 = require("@mui/material");
7007
7049
  var import_mui46 = require("tss-react/mui");
7008
7050
  var import_jsx_runtime111 = require("react/jsx-runtime");
@@ -7079,9 +7121,9 @@ var SearchWithFiltersForTable = (props) => {
7079
7121
  enterPressedInSearch();
7080
7122
  }
7081
7123
  };
7082
- const ArrowIcon = isOpen ? import_icons_material10.ArrowDropUp : import_icons_material10.ArrowDropDown;
7124
+ const ArrowIcon = isOpen ? import_icons_material9.ArrowDropUp : import_icons_material9.ArrowDropDown;
7083
7125
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_material58.Paper, { className: classes.c_search, children: [
7084
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material58.Box, { className: classes.c_search__icon, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_icons_material10.Search, { className: classes.icon, fontSize: "small" }) }),
7126
+ /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_material58.Box, { className: classes.c_search__icon, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_icons_material9.Search, { className: classes.icon, fontSize: "small" }) }),
7085
7127
  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
7086
7128
  import_material58.InputBase,
7087
7129
  {
@@ -7215,7 +7257,8 @@ var SearchHeader = (0, import_react33.memo)(
7215
7257
  );
7216
7258
 
7217
7259
  // src/components/SectionName/SectionName.tsx
7218
- var import_icons_material11 = require("@mui/icons-material");
7260
+ var import_History = __toESM(require("@mui/icons-material/History"), 1);
7261
+ var import_Info = __toESM(require("@mui/icons-material/Info"), 1);
7219
7262
  var import_material61 = require("@mui/material");
7220
7263
  var import_mui48 = require("tss-react/mui");
7221
7264
  var import_jsx_runtime114 = require("react/jsx-runtime");
@@ -7261,20 +7304,32 @@ var SectionName = ({
7261
7304
  openHistoryLog
7262
7305
  }) => {
7263
7306
  const { classes } = useStyles43();
7307
+ const handleScroll = (e) => {
7308
+ e.preventDefault();
7309
+ if (sectionId) {
7310
+ const targetId = sectionId.startsWith("#") ? sectionId.slice(1) : sectionId;
7311
+ const element = document.getElementById(targetId);
7312
+ if (element) {
7313
+ element.scrollIntoView({
7314
+ behavior: "smooth",
7315
+ block: "start"
7316
+ });
7317
+ }
7318
+ }
7319
+ };
7264
7320
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material61.Box, { className: classes.container, children: [
7265
7321
  /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_material61.Box, { className: classes.titleContainer, children: [
7266
7322
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7267
7323
  import_material61.Typography,
7268
7324
  {
7269
7325
  variant: "h5",
7270
- component: "a",
7271
- href: sectionId,
7326
+ onClick: handleScroll,
7272
7327
  className: classes.typography,
7273
7328
  children: name
7274
7329
  }
7275
7330
  ),
7276
7331
  tooltipDescription ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.Tooltip, { title: tooltipDescription, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
7277
- import_icons_material11.Info,
7332
+ import_Info.default,
7278
7333
  {
7279
7334
  fontSize: "small",
7280
7335
  "data-testid": "InfoIcon",
@@ -7297,7 +7352,7 @@ var SectionName = ({
7297
7352
  }
7298
7353
  ) : null,
7299
7354
  openHistoryLog && buttonText && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.Divider, { orientation: "vertical", sx: { height: "24px" } }),
7300
- openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_icons_material11.History, {}) })
7355
+ openHistoryLog && /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_material61.IconButton, { size: "small", onClick: () => openHistoryLog(), children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_History.default, {}) })
7301
7356
  ] })
7302
7357
  ] });
7303
7358
  };
@@ -8445,12 +8500,12 @@ var TableDesktop = ({
8445
8500
  setIsBulkChangesMode(checked);
8446
8501
  if (!checked) {
8447
8502
  resetSelectedRows();
8503
+ refetchData?.();
8448
8504
  }
8449
8505
  };
8450
8506
  (0, import_react41.useEffect)(() => {
8451
8507
  if (isRowsFromAllPagesSelected) {
8452
8508
  selectAllRowsInPage();
8453
- selectAllRowsInPage();
8454
8509
  }
8455
8510
  }, [isRowsFromAllPagesSelected, data]);
8456
8511
  const renderBody = () => {
@@ -9169,6 +9224,7 @@ var TableDesktopToolbar = ({
9169
9224
  disableBulkChangesMode = false,
9170
9225
  isBulkChangesMode,
9171
9226
  onChangeBulkChangesMode,
9227
+ onActivateBulkChangesMode,
9172
9228
  refetchData,
9173
9229
  renderExportCsvDialog,
9174
9230
  renderBulkChangesDialog,
@@ -9193,8 +9249,8 @@ var TableDesktopToolbar = ({
9193
9249
  const handleChangeBulkChangesMode = (_, checked) => {
9194
9250
  setBulkChanges([]);
9195
9251
  onChangeBulkChangesMode(checked);
9196
- if (!checked) {
9197
- refetchData?.();
9252
+ if (checked) {
9253
+ onActivateBulkChangesMode?.();
9198
9254
  }
9199
9255
  };
9200
9256
  const handleUpdateEditableCell = ({
@@ -9401,7 +9457,7 @@ var TableDesktopToolbar = ({
9401
9457
 
9402
9458
  // src/components/TableHeader/TableHeader.tsx
9403
9459
  var import_react48 = require("react");
9404
- var import_icons_material12 = require("@mui/icons-material");
9460
+ var import_icons_material10 = require("@mui/icons-material");
9405
9461
  var import_material80 = require("@mui/material");
9406
9462
  var import_mui53 = require("tss-react/mui");
9407
9463
  var import_jsx_runtime137 = require("react/jsx-runtime");
@@ -9454,7 +9510,7 @@ var TableHeader = ({ cells, onSort = null }) => {
9454
9510
  {
9455
9511
  className: classes.sortLabel,
9456
9512
  direction: cell?.direction || "asc",
9457
- IconComponent: import_icons_material12.ImportExport,
9513
+ IconComponent: import_icons_material10.ImportExport,
9458
9514
  onClick: () => handleSortClick(cell),
9459
9515
  children: cell.label
9460
9516
  }
@@ -9648,7 +9704,11 @@ var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
9648
9704
  topBar: {
9649
9705
  display: "flex",
9650
9706
  gap: theme.spacing(1),
9651
- backgroundColor: colors.topBar
9707
+ backgroundColor: colors.topBar,
9708
+ maxWidth: 2e3,
9709
+ margin: "0 auto",
9710
+ left: 0,
9711
+ right: 0
9652
9712
  }
9653
9713
  }));
9654
9714
  var TheToolbar = ({