@mailstep/design-system 0.13.0-beta.1 → 0.13.0-beta.2

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.
Files changed (93) hide show
  1. package/package.json +1 -1
  2. package/ui/Blocks/Header/components/UserMenu/index.js +1 -1
  3. package/ui/Blocks/HidePrint/HidePrint.js +1 -1
  4. package/ui/Blocks/ImageList/ImageList.js +1 -1
  5. package/ui/Blocks/LoginPage/LoginPage.js +1 -1
  6. package/ui/Blocks/LoginPage/components/LoginForm.js +1 -1
  7. package/ui/Blocks/LoginPage/components/SocialLinks.js +1 -1
  8. package/ui/Blocks/Modal/Modal.js +1 -1
  9. package/ui/Blocks/Popover/index.js +1 -1
  10. package/ui/Blocks/Scheduler/components/BookedTimeSlots/index.js +1 -1
  11. package/ui/Blocks/Scheduler/components/DateChanger/index.js +1 -1
  12. package/ui/Blocks/SideMenu/components/Footer.js +1 -1
  13. package/ui/Blocks/SideMenu/components/HamburgerMenu.js +4 -4
  14. package/ui/Blocks/SideMenu/components/SubitemTooltip.js +1 -1
  15. package/ui/Blocks/Stepper/components/StepItem/index.js +1 -1
  16. package/ui/Elements/Alert/Alert.js +1 -1
  17. package/ui/Elements/Alert/styles.js +10 -10
  18. package/ui/Elements/Badge/Badge.js +1 -1
  19. package/ui/Elements/BarChartSymbol/BarChartSymbol.js +1 -1
  20. package/ui/Elements/BorderedBox/BorderedBox.js +1 -1
  21. package/ui/Elements/DatePicker/DatePicker.js +1 -1
  22. package/ui/Elements/DatePicker/Datetime/components/DateRepeater.js +1 -1
  23. package/ui/Elements/DatePicker/Datetime/components/Timepicker/Timepicker.js +1 -1
  24. package/ui/Elements/Dropdown/Dropdown.js +1 -1
  25. package/ui/Elements/DropdownMenu/DropdownMenu.js +1 -1
  26. package/ui/Elements/DropdownMenu/components/DefaultItem.js +1 -1
  27. package/ui/Elements/DropdownMenu/components/MenuItem.js +1 -1
  28. package/ui/Elements/DropdownSelect/DropdownSelect.js +1 -1
  29. package/ui/Elements/ErrorMessage/ErrorMessage.js +1 -1
  30. package/ui/Elements/HighlightBox/HighlightBox.js +1 -1
  31. package/ui/Elements/Icon/BadgeIcon.js +1 -1
  32. package/ui/Elements/Icon/Icon.js +1 -1
  33. package/ui/Elements/Line/Line.js +1 -1
  34. package/ui/Elements/Link/Link.js +1 -1
  35. package/ui/Elements/Logo/Logo.js +1 -1
  36. package/ui/Elements/Select/Select.js +1 -1
  37. package/ui/Elements/Select/components/CountMultiValue.js +1 -1
  38. package/ui/Elements/Select/components/DropdownIndicator.js +1 -1
  39. package/ui/Elements/Select/components/IconValueContainer.js +1 -1
  40. package/ui/Elements/Select/components/SelectAll.js +1 -1
  41. package/ui/Elements/SpaceAround/SpaceAround.js +1 -1
  42. package/ui/Elements/Tag/stories/components/predefinedTags.js +1 -1
  43. package/ui/Elements/Text/Text.js +1 -1
  44. package/ui/Elements/Toast/Toast.js +1 -1
  45. package/ui/Elements/Toggle/Toggle.js +1 -1
  46. package/ui/Elements/Tooltip/Tooltip.js +1 -1
  47. package/ui/Modules/CommonGrid/CommonGrid.d.ts +1 -1
  48. package/ui/Modules/CommonGrid/CommonGrid.js +7 -5
  49. package/ui/Modules/CommonGrid/CommonGridContainer.js +4 -4
  50. package/ui/Modules/CommonGrid/components/ActionHead/ActionHead.js +1 -1
  51. package/ui/Modules/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +1 -1
  52. package/ui/Modules/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +1 -1
  53. package/ui/Modules/CommonGrid/components/ButtonMore/ButtonMore.js +1 -1
  54. package/ui/Modules/CommonGrid/components/ColumnFilterCell.js +3 -2
  55. package/ui/Modules/CommonGrid/components/ColumnTitle/ColumnTitle.js +1 -1
  56. package/ui/Modules/CommonGrid/components/ColumnTitle.js +1 -1
  57. package/ui/Modules/CommonGrid/components/ControlButtons/ControlButtons.js +1 -1
  58. package/ui/Modules/CommonGrid/components/DropdownButton/DropdownButton.js +1 -1
  59. package/ui/Modules/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +1 -1
  60. package/ui/Modules/CommonGrid/components/FilterDropdown.js +1 -1
  61. package/ui/Modules/CommonGrid/components/FilterRow.d.ts +1 -0
  62. package/ui/Modules/CommonGrid/components/FilterRow.js +6 -1
  63. package/ui/Modules/CommonGrid/components/Filters/ActionsFilter/ActionsFilter.js +1 -1
  64. package/ui/Modules/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +1 -1
  65. package/ui/Modules/CommonGrid/components/FloatingButton/FloatingButton.js +1 -1
  66. package/ui/Modules/CommonGrid/components/GridInfo/index.js +1 -1
  67. package/ui/Modules/CommonGrid/components/HeadCell.js +1 -0
  68. package/ui/Modules/CommonGrid/components/HeadRow.d.ts +1 -0
  69. package/ui/Modules/CommonGrid/components/HeadRow.js +11 -6
  70. package/ui/Modules/CommonGrid/components/IconList/IconList.js +1 -1
  71. package/ui/Modules/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +1 -1
  72. package/ui/Modules/CommonGrid/components/ManageColumnForm/components/ManageColumnRow.js +1 -1
  73. package/ui/Modules/CommonGrid/components/MobileFilterModal.js +1 -1
  74. package/ui/Modules/CommonGrid/components/MobileSortModal.js +1 -1
  75. package/ui/Modules/CommonGrid/components/OversizedScroll.js +1 -1
  76. package/ui/Modules/CommonGrid/components/PresetsModalBody/index.js +1 -1
  77. package/ui/Modules/CommonGrid/components/QuickFilter/QuickFilter.js +1 -1
  78. package/ui/Modules/CommonGrid/components/Resize.js +1 -1
  79. package/ui/Modules/CommonGrid/components/TablePagination/TablePagination.js +1 -1
  80. package/ui/Modules/CommonGrid/components/gridCells/BoolIcon.js +1 -1
  81. package/ui/Modules/CommonGrid/components/gridCells/EnumInCell.js +1 -1
  82. package/ui/Modules/CommonGrid/components/gridCells/HoverBubble.js +1 -1
  83. package/ui/Modules/CommonGrid/components/gridCells/IconButtonInCell.js +1 -1
  84. package/ui/Modules/CommonGrid/components/gridCells/ImageCell.js +1 -1
  85. package/ui/Modules/CommonGrid/components/gridCells/RemoveItem.js +1 -1
  86. package/ui/Modules/CommonGrid/components/gridCells/RowActionsCell.js +1 -1
  87. package/ui/Modules/CommonGrid/styles.d.ts +1 -1
  88. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.js +1 -1
  89. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.js +1 -1
  90. package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.js +1 -1
  91. package/ui/Modules/Dashboard/errors/ErrorMessage.js +1 -1
  92. package/ui/ThemeProvider/ThemeProvider.js +1 -1
  93. package/ui/index.js +1 -1
@@ -1,8 +1,8 @@
1
+ import HidePrint from "../../Blocks/HidePrint/HidePrint.js";
2
+ import { useModal } from "../../Blocks/Modal/hooks/useModal.js";
1
3
  import Pagination from "../../Elements/Pagination/Pagination.js";
2
4
  import "../../Elements/Pagination/index.js";
3
5
  import { useCheckDeviceWidth } from "../../utils/CheckDeviceWidth/checkDeviceWidth.js";
4
- import HidePrint from "../../Blocks/HidePrint/HidePrint.js";
5
- import { useModal } from "../../Blocks/Modal/hooks/useModal.js";
6
6
  import ActionHead_default from "./components/ActionHead/index.js";
7
7
  import { getFilters } from "./utils/index.js";
8
8
  import { clearShareParams } from "./utils/shareUrl/clearShareParams.js";
@@ -25,8 +25,8 @@ import { getRowsPerPage } from "./utils/getRowsPerPage.js";
25
25
  import { hasSortTerminated } from "./utils/hasSortTerminated.js";
26
26
  import { BottomWrapper, CommonGridWithStyles, CommonGridWrap, ContentContainer, StyledButtonStrip } from "./styles.js";
27
27
  import { useCallback, useMemo, useRef, useState } from "react";
28
- import { x } from "@xstyled/styled-components";
29
28
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
29
+ import { x } from "@xstyled/styled-components";
30
30
  //#region packages/ui/Modules/CommonGrid/CommonGridContainer.tsx
31
31
  const CommonGridContainer = (props) => {
32
32
  const { optimizeFilters = false, extraControlButtons, onBatchAction, processCheckedValues, processCheckedValuesTitle, hideControlButtons, quickFilter, floatingButtonProps, queryRowsParam, customPaginationHandler, autoHeight = true, gridName, withPresets = true, withManageColumnButton = true, withPagination = true, withAggregation = true, withShare = true, allowSortingOnlyUnderTotalRows, onReload, ...passDownProps } = props;
@@ -114,7 +114,7 @@ const CommonGridContainer = (props) => {
114
114
  hasFilters,
115
115
  hasGroups,
116
116
  isSortTerminated,
117
- onCellClick: setActiveColumnName,
117
+ onSetActiveColumn: setActiveColumnName,
118
118
  hasColouredRows: true
119
119
  })]
120
120
  }), /* @__PURE__ */ jsxs(BottomWrapper, {
@@ -4,8 +4,8 @@ import { useGridActionTrigger } from "../../hooks/useGridActionTrigger.js";
4
4
  import { useToggleAllCheckbox } from "../../hooks/useToggleAllCheckbox.js";
5
5
  import ButtonMore from "../ButtonMore/ButtonMore.js";
6
6
  import { useCallback, useMemo } from "react";
7
- import styled$1 from "@xstyled/styled-components";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
+ import styled$1 from "@xstyled/styled-components";
9
9
  import { i18n } from "@lingui/core";
10
10
  import { Trans } from "@lingui/react";
11
11
  //#region packages/ui/Modules/CommonGrid/components/ActionHead/ActionHead.tsx
@@ -1,6 +1,6 @@
1
1
  import "react";
2
- import styled$1 from "@xstyled/styled-components";
3
2
  import { jsx } from "react/jsx-runtime";
3
+ import styled$1 from "@xstyled/styled-components";
4
4
  import { th as th$1 } from "@xstyled/system";
5
5
  //#region packages/ui/Modules/CommonGrid/components/ActionHead/components/ActionDropdownMenu.tsx
6
6
  const StyledDropdownWrap = styled$1.div`
@@ -2,8 +2,8 @@ import Icon from "../../../../../Elements/Icon/Icon.js";
2
2
  import Popover from "../../../../../Blocks/Popover/index.js";
3
3
  import ActionDropdownMenu from "./ActionDropdownMenu.js";
4
4
  import React, { memo, useRef } from "react";
5
- import styled$1 from "@xstyled/styled-components";
6
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import styled$1 from "@xstyled/styled-components";
7
7
  import { th as th$1 } from "@xstyled/system";
8
8
  import { Trans } from "@lingui/react";
9
9
  //#region packages/ui/Modules/CommonGrid/components/ActionHead/components/ActionDropdownSelect.tsx
@@ -3,8 +3,8 @@ import { DropdownMenu } from "../../../../Elements/DropdownMenu/DropdownMenu.js"
3
3
  import "../../../../Elements/DropdownMenu/index.js";
4
4
  import { useClickOutside } from "../../../../Blocks/Modal/hooks/useClickOutside.js";
5
5
  import { useCallback, useState } from "react";
6
- import styled$1 from "@xstyled/styled-components";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import styled$1 from "@xstyled/styled-components";
8
8
  //#region packages/ui/Modules/CommonGrid/components/ButtonMore/ButtonMore.tsx
9
9
  const ButtonWrapper = styled$1.div`
10
10
  position: relative;
@@ -3,8 +3,8 @@ import { useAddFilter } from "../hooks/useAddFilter.js";
3
3
  import { Cell } from "./Table.js";
4
4
  import OverlayComponent from "./FilterDropdown.js";
5
5
  import React from "react";
6
- import { x } from "@xstyled/styled-components";
7
6
  import { jsx } from "react/jsx-runtime";
7
+ import { x } from "@xstyled/styled-components";
8
8
  //#region packages/ui/Modules/CommonGrid/components/ColumnFilterCell.tsx
9
9
  const ColumnFilterCell = ({ onChange, value, others, displayColumnWidth, filters, column: columnDefinition, group, comparators, actionColumn, rowsData, uxState, handleUxChange, onAsyncLoadFilterOptions }) => {
10
10
  const cellSizeProps = getCellSizeProps(columnDefinition, displayColumnWidth);
@@ -28,6 +28,7 @@ const ColumnFilterCell = ({ onChange, value, others, displayColumnWidth, filters
28
28
  return /* @__PURE__ */ jsx(Cell, {
29
29
  className: cellClassName,
30
30
  ...cellSizeProps,
31
+ "data-column-name": columnDefinition.name,
31
32
  children: /* @__PURE__ */ jsx(x.div, { children: /* @__PURE__ */ jsx(RenderComponent, {
32
33
  asyncLoadKey: columnDefinition.asyncLoadKey,
33
34
  "data-test": columnDefinition.name,
@@ -44,7 +45,7 @@ const ColumnFilterCell = ({ onChange, value, others, displayColumnWidth, filters
44
45
  onAsyncLoadFilterOptions,
45
46
  ...filterConfig?.defaultExtraProps,
46
47
  ...columnDefinition.filterExtraProps,
47
- ...filterType == "options" && { options: columnDefinition.filterOptions },
48
+ ...filterType === "options" && { options: columnDefinition.filterOptions },
48
49
  columnWidth: cellSizeProps?.flexBasis
49
50
  }) })
50
51
  });
@@ -1,7 +1,7 @@
1
1
  import Icon from "../../../../Elements/Icon/Icon.js";
2
2
  import { useCallback, useEffect, useRef, useState } from "react";
3
- import styled$1, { css, x } from "@xstyled/styled-components";
4
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import styled$1, { css, x } from "@xstyled/styled-components";
5
5
  //#region packages/ui/Modules/CommonGrid/components/ColumnTitle/ColumnTitle.tsx
6
6
  const WRAPPER_WIDTH = 35;
7
7
  const Wrap = styled$1.div`
@@ -1,7 +1,7 @@
1
1
  import { SortingDown, SortingUp } from "./icons/Sorting.js";
2
2
  import React from "react";
3
- import styled$1, { th, useTheme } from "@xstyled/styled-components";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import styled$1, { th, useTheme } from "@xstyled/styled-components";
5
5
  //#region packages/ui/Modules/CommonGrid/components/ColumnTitle.tsx
6
6
  const Title = styled$1.span`
7
7
  & + * {
@@ -14,8 +14,8 @@ import ExtraControlButtons_default from "../ExtraControlButtons/index.js";
14
14
  import QuickFilter_default from "../QuickFilter/index.js";
15
15
  import { ControlButtonsContainer, CopiedMessage, Left, Right, ShareButtonWrapper, StyledColumnButton } from "./styles.js";
16
16
  import { useEffect, useMemo } from "react";
17
- import { useColor, x } from "@xstyled/styled-components";
18
17
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
+ import { useColor, x } from "@xstyled/styled-components";
19
19
  import { i18n } from "@lingui/core";
20
20
  import { Trans } from "@lingui/react";
21
21
  //#region packages/ui/Modules/CommonGrid/components/ControlButtons/ControlButtons.tsx
@@ -6,8 +6,8 @@ import { DropdownMenu } from "../../../../Elements/DropdownMenu/DropdownMenu.js"
6
6
  import "../../../../Elements/DropdownMenu/index.js";
7
7
  import { useClickOutside } from "../../../../Blocks/Modal/hooks/useClickOutside.js";
8
8
  import React, { useCallback, useState } from "react";
9
- import styled$1 from "@xstyled/styled-components";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
+ import styled$1 from "@xstyled/styled-components";
11
11
  import { th as th$1 } from "@xstyled/system";
12
12
  //#region packages/ui/Modules/CommonGrid/components/DropdownButton/DropdownButton.tsx
13
13
  const ButtonWrapper = styled$1.div`
@@ -2,8 +2,8 @@ import Button from "../../../../Elements/Button/Button.js";
2
2
  import ButtonMore from "../ButtonMore/ButtonMore.js";
3
3
  import DropdownSelect_default from "../../../../Elements/DropdownSelect/index.js";
4
4
  import "react";
5
- import styled$1, { x } from "@xstyled/styled-components";
6
5
  import { Fragment, jsx } from "react/jsx-runtime";
6
+ import styled$1, { x } from "@xstyled/styled-components";
7
7
  //#region packages/ui/Modules/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.tsx
8
8
  const Row = styled$1.div`
9
9
  display: flex;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import styled$1 from "@xstyled/styled-components";
3
2
  import { jsx } from "react/jsx-runtime";
3
+ import styled$1 from "@xstyled/styled-components";
4
4
  //#region packages/ui/Modules/CommonGrid/components/FilterDropdown.tsx
5
5
  const OverlayWrapper = styled$1.div`
6
6
  position: absolute;
@@ -13,6 +13,7 @@ type Props = {
13
13
  onAsyncLoadFilterOptions?: (key: string, value: string) => void;
14
14
  rowsData: RowProps[];
15
15
  uxState: UxState;
16
+ onCellClick?: (columnName: string) => void;
16
17
  };
17
18
  declare const FilterRow: FC<Props>;
18
19
  export default FilterRow;
@@ -1,14 +1,19 @@
1
1
  import { getFilterName } from "../utils/index.js";
2
2
  import { Row } from "./Table.js";
3
3
  import ColumnFilterCell from "./ColumnFilterCell.js";
4
+ import { useCallback } from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  import get from "lodash/fp/get";
6
7
  import throttle from "lodash/throttle";
7
8
  //#region packages/ui/Modules/CommonGrid/components/FilterRow.tsx
8
- const FilterRow = ({ columns, groups, actionColumn, onChange, filterValues = {}, displayColumnsWidth, filters, comparators, handleUxChange, onAsyncLoadFilterOptions, rowsData, uxState }) => {
9
+ const FilterRow = ({ columns, groups, actionColumn, onChange, filterValues = {}, displayColumnsWidth, filters, comparators, handleUxChange, onAsyncLoadFilterOptions, onCellClick, rowsData, uxState }) => {
9
10
  const handleOnChange = throttle(onChange, 500);
10
11
  return /* @__PURE__ */ jsx(Row, {
11
12
  className: "filterRow",
13
+ onMouseDown: useCallback((e) => {
14
+ const columnName = e.target.closest(".cell")?.dataset?.columnName;
15
+ if (columnName) onCellClick?.(columnName);
16
+ }, [onCellClick]),
12
17
  children: columns.map((column, index) => /* @__PURE__ */ jsx(ColumnFilterCell, {
13
18
  column,
14
19
  actionColumn,
@@ -1,7 +1,7 @@
1
1
  import { useToggleAllCheckbox } from "../../../hooks/useToggleAllCheckbox.js";
2
2
  import Checkbox_default from "../../../../../Forms/Checkbox/index.js";
3
- import { x } from "@xstyled/styled-components";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { x } from "@xstyled/styled-components";
5
5
  //#region packages/ui/Modules/CommonGrid/components/Filters/ActionsFilter/ActionsFilter.tsx
6
6
  const ActionsFilter = ({ actionColumn, rowsData, uxState, handleUxChange }) => {
7
7
  const [allChecked, toggleCheckbox] = useToggleAllCheckbox(rowsData, uxState, handleUxChange);
@@ -4,8 +4,8 @@ import DatePicker_default from "../../../../../Elements/DatePicker/index.js";
4
4
  import { getCleanValues } from "./utils/getCleanValues.js";
5
5
  import { pickerRangeToString } from "./utils/pickerRangeToString.js";
6
6
  import React, { useCallback, useMemo, useState } from "react";
7
- import styled$1, { css } from "@xstyled/styled-components";
8
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import styled$1, { css } from "@xstyled/styled-components";
9
9
  import { i18n } from "@lingui/core";
10
10
  import { DateTime } from "luxon";
11
11
  //#region packages/ui/Modules/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.tsx
@@ -2,8 +2,8 @@ import { DropdownMenu } from "../../../../Elements/DropdownMenu/DropdownMenu.js"
2
2
  import "../../../../Elements/DropdownMenu/index.js";
3
3
  import Popover from "../../../../Blocks/Popover/index.js";
4
4
  import { useCallback, useRef, useState } from "react";
5
- import styled$1 from "@xstyled/styled-components";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ import styled$1 from "@xstyled/styled-components";
7
7
  //#region packages/ui/Modules/CommonGrid/components/FloatingButton/FloatingButton.tsx
8
8
  const FloatingWrapper = styled$1.div`
9
9
  display: block;
@@ -1,7 +1,7 @@
1
1
  import Icon from "../../../../Elements/Icon/Icon.js";
2
2
  import "../../../../Elements/Icon/index.js";
3
- import { x } from "@xstyled/styled-components";
4
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { x } from "@xstyled/styled-components";
5
5
  import { Trans } from "@lingui/react";
6
6
  //#region packages/ui/Modules/CommonGrid/components/GridInfo/index.tsx
7
7
  const GridInfo = ({ isSortTerminatedAppeal, isSortTerminated }) => {
@@ -21,6 +21,7 @@ const HeadCell = ({ column, isDragDisabled, displayColumnsWidth, onResizeOut, on
21
21
  transition,
22
22
  transform: CSS.Transform.toString(transform),
23
23
  ref: setNodeRef,
24
+ "data-column-name": column.name,
24
25
  children: [/* @__PURE__ */ jsx(ColumnTitle_default, {
25
26
  title: column?.title,
26
27
  isSortable: !!column.sorting && !isSortTerminated,
@@ -11,6 +11,7 @@ type HeadRowProps = {
11
11
  handleDragEnd: (event: DragEndEvent) => void;
12
12
  groups: Group[];
13
13
  isSortTerminated?: boolean;
14
+ onCellClick?: (columnName: string) => void;
14
15
  };
15
16
  declare const HeadRow: FC<HeadRowProps>;
16
17
  export default HeadRow;
@@ -2,7 +2,7 @@ import { getCellSizeProps, getStickyCollClassNames } from "../utils/index.js";
2
2
  import { Cell, Row } from "./Table.js";
3
3
  import ColumnTitle_default from "./ColumnTitle.js";
4
4
  import { HeadCell } from "./HeadCell.js";
5
- import React, { useEffect, useState } from "react";
5
+ import { useCallback, useEffect, useState } from "react";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { SortableContext, horizontalListSortingStrategy } from "@dnd-kit/sortable";
8
8
  import { DndContext, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
@@ -19,24 +19,28 @@ const getStickyComponent = (columns, stickyTo, displayColumnsWidth) => columns?.
19
19
  })
20
20
  }, column.name);
21
21
  });
22
- const HeadRow = ({ columns, onAddSort, handleDragEnd, sortingValues = [], displayColumnsWidth, columnLayout, handleResizeDrag, groups, isSortTerminated }) => {
22
+ const HeadRow = ({ columns, onAddSort, handleDragEnd, sortingValues = [], displayColumnsWidth, columnLayout, handleResizeDrag, groups, isSortTerminated, onCellClick }) => {
23
23
  const [showUIElements, setShowUIElements] = useState(false);
24
24
  useEffect(() => {
25
25
  setShowUIElements(true);
26
26
  }, []);
27
27
  const [isDragDisabled, setIsDragDisabled] = useState(false);
28
- const onResizeOver = React.useCallback(() => {
28
+ const onResizeOver = useCallback(() => {
29
29
  setIsDragDisabled(true);
30
30
  }, [setIsDragDisabled]);
31
- const onResizeOut = React.useCallback(() => {
31
+ const onResizeOut = useCallback(() => {
32
32
  setIsDragDisabled(false);
33
33
  }, [setIsDragDisabled]);
34
- const onResize = React.useCallback((name) => (width) => {
34
+ const onResize = useCallback((name) => (width) => {
35
35
  handleResizeDrag?.(name, width);
36
36
  }, [handleResizeDrag]);
37
- const onSetSort = React.useCallback((name, systemName) => (value) => {
37
+ const onSetSort = useCallback((name, systemName) => (value) => {
38
38
  onAddSort?.(systemName || name, value);
39
39
  }, [onAddSort]);
40
+ const onRowClick = useCallback((e) => {
41
+ const columnName = e.target.closest(".cell")?.dataset?.columnName;
42
+ if (columnName) onCellClick?.(columnName);
43
+ }, [onCellClick]);
40
44
  const sensors = useSensors(useSensor(PointerSensor));
41
45
  return /* @__PURE__ */ jsx(Fragment, { children: showUIElements && /* @__PURE__ */ jsx(DndContext, {
42
46
  sensors,
@@ -47,6 +51,7 @@ const HeadRow = ({ columns, onAddSort, handleDragEnd, sortingValues = [], displa
47
51
  strategy: horizontalListSortingStrategy,
48
52
  children: /* @__PURE__ */ jsxs(Row, {
49
53
  className: "headRow",
54
+ onMouseDown: onRowClick,
50
55
  children: [
51
56
  getStickyComponent(columns, "left", displayColumnsWidth),
52
57
  columns.filter((item) => !item.sticky).map((column, index) => /* @__PURE__ */ jsx(HeadCell, {
@@ -1,7 +1,7 @@
1
1
  import Icon from "../../../../Elements/Icon/Icon.js";
2
2
  import React from "react";
3
- import styled$1 from "@xstyled/styled-components";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import styled$1 from "@xstyled/styled-components";
5
5
  import { th as th$1 } from "@xstyled/system";
6
6
  //#region packages/ui/Modules/CommonGrid/components/IconList/IconList.tsx
7
7
  const List = styled$1.ul`
@@ -1,8 +1,8 @@
1
1
  import { Input } from "../../../../Forms/Input/Input.js";
2
2
  import { ManageColumnRow } from "./components/ManageColumnRow.js";
3
3
  import { useCallback, useState } from "react";
4
- import { x } from "@xstyled/styled-components";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { x } from "@xstyled/styled-components";
6
6
  import { i18n } from "@lingui/core";
7
7
  import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
8
8
  import { DndContext, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
@@ -4,8 +4,8 @@ import { getTranslatedValue } from "../utils.js";
4
4
  import Toggle from "../../../../../Elements/Toggle/Toggle.js";
5
5
  import { RowLayout } from "../styles.js";
6
6
  import { useCallback, useState } from "react";
7
- import { x } from "@xstyled/styled-components";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { x } from "@xstyled/styled-components";
9
9
  import { useSortable } from "@dnd-kit/sortable";
10
10
  import { CSS } from "@dnd-kit/utilities";
11
11
  //#region packages/ui/Modules/CommonGrid/components/ManageColumnForm/components/ManageColumnRow.tsx
@@ -4,8 +4,8 @@ import { createFilterType, getFilterName, isFilterActive } from "../utils/index.
4
4
  import { Modal } from "../../../Blocks/Modal/Modal.js";
5
5
  import { MobileOverlayWrapper } from "./MobileOverlayWrapper.js";
6
6
  import { useCallback, useEffect, useState } from "react";
7
- import { x } from "@xstyled/styled-components";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { x } from "@xstyled/styled-components";
9
9
  import { Trans } from "@lingui/react";
10
10
  import get from "lodash/fp/get";
11
11
  //#region packages/ui/Modules/CommonGrid/components/MobileFilterModal.tsx
@@ -3,8 +3,8 @@ import { getSortName } from "../utils/index.js";
3
3
  import { Modal } from "../../../Blocks/Modal/Modal.js";
4
4
  import { SortingDown, SortingUp } from "./icons/Sorting.js";
5
5
  import { useCallback } from "react";
6
- import { x } from "@xstyled/styled-components";
7
6
  import { jsx } from "react/jsx-runtime";
7
+ import { x } from "@xstyled/styled-components";
8
8
  import { Trans } from "@lingui/react";
9
9
  //#region packages/ui/Modules/CommonGrid/components/MobileSortModal.tsx
10
10
  const AscIcon = /* @__PURE__ */ jsx(SortingUp, {
@@ -1,6 +1,6 @@
1
1
  import "react";
2
- import styled$1, { css } from "@xstyled/styled-components";
3
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import styled$1, { css } from "@xstyled/styled-components";
4
4
  //#region packages/ui/Modules/CommonGrid/components/OversizedScroll.tsx
5
5
  const ScrollWrapper = styled$1.div`
6
6
  ${(props) => props.columnLayout !== "no-scroll" && css`
@@ -5,8 +5,8 @@ import { palettes } from "../../../../Elements/Tag/palettes.js";
5
5
  import { H6 } from "../../../../Elements/Typography/Typography.js";
6
6
  import { TagRemove } from "./components/TagRemove.js";
7
7
  import { useMemo } from "react";
8
- import { x } from "@xstyled/styled-components";
9
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { x } from "@xstyled/styled-components";
10
10
  import { Trans } from "@lingui/react";
11
11
  import isEmpty from "lodash/isEmpty";
12
12
  //#region packages/ui/Modules/CommonGrid/components/PresetsModalBody/index.tsx
@@ -1,7 +1,7 @@
1
1
  import Button_default from "../../../../Elements/Button/index.js";
2
2
  import Input_default from "../../../../Forms/Input/index.js";
3
- import styled$1, { x } from "@xstyled/styled-components";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import styled$1, { x } from "@xstyled/styled-components";
5
5
  //#region packages/ui/Modules/CommonGrid/components/QuickFilter/QuickFilter.tsx
6
6
  const StyledInput = styled$1(Input_default)`
7
7
  position: ${({ isMobileInputView }) => isMobileInputView ? "absolute" : "relative"};
@@ -1,6 +1,6 @@
1
1
  import { useCallback } from "react";
2
- import styled$1 from "@xstyled/styled-components";
3
2
  import { jsx } from "react/jsx-runtime";
3
+ import styled$1 from "@xstyled/styled-components";
4
4
  //#region packages/ui/Modules/CommonGrid/components/Resize.tsx
5
5
  const Resizer = styled$1.div`
6
6
  height: 100%;
@@ -1,8 +1,8 @@
1
1
  import Select from "../../../../Elements/Select/Select.js";
2
2
  import { rowsPerPageOptions } from "../../utils/constants.js";
3
3
  import { useCallback, useMemo } from "react";
4
- import styled$1, { x } from "@xstyled/styled-components";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import styled$1, { x } from "@xstyled/styled-components";
6
6
  import { Trans } from "@lingui/react";
7
7
  //#region packages/ui/Modules/CommonGrid/components/TablePagination/TablePagination.tsx
8
8
  const Wrapper = styled$1.span`
@@ -2,8 +2,8 @@ import { ToastSuccess } from "../../../../Elements/Icon/icons/ToastSuccess.js";
2
2
  import { ToastError } from "../../../../Elements/Icon/icons/ToastError.js";
3
3
  import "../../../../Elements/Icon/index.js";
4
4
  import React from "react";
5
- import styled$1 from "@xstyled/styled-components";
6
5
  import { jsx } from "react/jsx-runtime";
6
+ import styled$1 from "@xstyled/styled-components";
7
7
  import get from "lodash/fp/get";
8
8
  //#region packages/ui/Modules/CommonGrid/components/gridCells/BoolIcon.tsx
9
9
  const Center = styled$1.div`
@@ -1,7 +1,7 @@
1
1
  import HighlightBox_default from "../../../../Elements/HighlightBox/index.js";
2
2
  import { useMemo } from "react";
3
- import styled$1 from "@xstyled/styled-components";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import styled$1 from "@xstyled/styled-components";
5
5
  //#region packages/ui/Modules/CommonGrid/components/gridCells/EnumInCell.tsx
6
6
  const Center = styled$1.div`
7
7
  display: flex;
@@ -1,6 +1,6 @@
1
1
  import "react";
2
- import styled$1 from "@xstyled/styled-components";
3
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import styled$1 from "@xstyled/styled-components";
4
4
  import get from "lodash/fp/get";
5
5
  //#region packages/ui/Modules/CommonGrid/components/gridCells/HoverBubble.tsx
6
6
  const Wrapper = styled$1.div`
@@ -1,8 +1,8 @@
1
1
  import Icon from "../../../../Elements/Icon/Icon.js";
2
2
  import { Spinner } from "../../../../Elements/Spinner/Spinner.js";
3
3
  import "react";
4
- import { x } from "@xstyled/styled-components";
5
4
  import { Fragment, jsx } from "react/jsx-runtime";
5
+ import { x } from "@xstyled/styled-components";
6
6
  import { Link } from "react-router-dom";
7
7
  //#region packages/ui/Modules/CommonGrid/components/gridCells/IconButtonInCell.tsx
8
8
  const IconButtonInCell = ({ icon, isLoading, onClick, linkTo }) => {
@@ -1,7 +1,7 @@
1
1
  import Image from "../../../../Elements/Image/Image.js";
2
2
  import "react";
3
- import styled$1 from "@xstyled/styled-components";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import styled$1 from "@xstyled/styled-components";
5
5
  import get from "lodash/fp/get";
6
6
  //#region packages/ui/Modules/CommonGrid/components/gridCells/ImageCell.tsx
7
7
  const ImageWrapper = styled$1.div`
@@ -1,7 +1,7 @@
1
1
  import Icon from "../../../../Elements/Icon/Icon.js";
2
2
  import React from "react";
3
- import styled$1 from "@xstyled/styled-components";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import styled$1 from "@xstyled/styled-components";
5
5
  import { Trans } from "@lingui/react";
6
6
  //#region packages/ui/Modules/CommonGrid/components/gridCells/RemoveItem.tsx
7
7
  const Wrap = styled$1.div`
@@ -1,8 +1,8 @@
1
1
  import Checkbox_default from "../../../../Forms/Checkbox/index.js";
2
2
  import { IconButtonInCell } from "./IconButtonInCell.js";
3
3
  import { useCallback, useMemo } from "react";
4
- import { x } from "@xstyled/styled-components";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { x } from "@xstyled/styled-components";
6
6
  import { isFunction, omit } from "lodash/fp";
7
7
  //#region packages/ui/Modules/CommonGrid/components/gridCells/RowActionsCell.tsx
8
8
  const RowActionsCell = ({ actionColumnDefinition, rowData, addRowNumbers, rowIndex, rowNumberWidth = 0, checkedRows, withCheckboxes, onUxChange, onRowAction }) => {
@@ -12,7 +12,7 @@ export declare const CommonGridWithStyles: import("styled-components").StyledCom
12
12
  displayColumnsDefinitions: import("./types").ColumnDefinition[];
13
13
  hasGroups: boolean;
14
14
  hasFilters: boolean;
15
- onCellClick?: (columnName: string) => void;
15
+ onSetActiveColumn?: (columnName: string) => void;
16
16
  }>, import("@xstyled/styled-components").Theme, {
17
17
  withButtonStrip: boolean;
18
18
  hasGroupsOrFilters: boolean;
@@ -2,8 +2,8 @@ import styles_default from "../../../../styles.js";
2
2
  import Text from "../../../Text/Text.js";
3
3
  import ComponentContext from "../../../../context/ComponentContext.js";
4
4
  import React from "react";
5
- import { x } from "@xstyled/styled-components";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { x } from "@xstyled/styled-components";
7
7
  //#region packages/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.tsx
8
8
  const ItemConfigControls = ({ onCancel, onSave, onRemove }) => {
9
9
  const { Button } = React.useContext(ComponentContext);
@@ -1,7 +1,7 @@
1
1
  import styles_default from "../styles.js";
2
2
  import "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import styled from "styled-components";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.tsx
6
6
  const BoldSpan = styled.span`
7
7
  font-weight: bold;
@@ -6,8 +6,8 @@ import { createWidgetColors } from "../utils/generic.js";
6
6
  import { getColorStringArray } from "../utils/helpers.js";
7
7
  import { Description, OtherText, Subtitle, Title, Wrapper, WrapperText, layers, margin } from "./styles.js";
8
8
  import React from "react";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
9
  import { useTheme } from "styled-components";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { ResponsivePie } from "@nivo/pie";
12
12
  //#region packages/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.tsx
13
13
  const defaultLegendRowMaxLength = 4;
@@ -1,6 +1,6 @@
1
1
  import "react";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import styled from "styled-components";
3
+ import { jsx } from "react/jsx-runtime";
4
4
  //#region packages/ui/Modules/Dashboard/errors/ErrorMessage.tsx
5
5
  const ErrorContainer = styled.div`
6
6
  color: red;
@@ -1,7 +1,7 @@
1
1
  import themes from "./themes/index.js";
2
2
  import { createContext } from "react";
3
- import { Preflight, ThemeProvider } from "@xstyled/styled-components";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Preflight, ThemeProvider } from "@xstyled/styled-components";
5
5
  //#region packages/ui/ThemeProvider/ThemeProvider.tsx
6
6
  const LanguageContext = createContext("en");
7
7
  const MailstepThemeProvider = ({ children, theme = "default", preflight = true, language = "en" }) => {
package/ui/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { useModal } from "./Blocks/Modal/hooks/useModal.js";
1
2
  import { Cancel } from "./Elements/Icon/icons/Cancel.js";
2
3
  import { FlagUSA } from "./Elements/Icon/icons/FlagUSA.js";
3
4
  import { FlagCZ } from "./Elements/Icon/icons/FlagCZ.js";
@@ -113,7 +114,6 @@ import { Break } from "./Elements/Icon/icons/Break.js";
113
114
  import { iconDictionary } from "./Elements/Icon/Icon.js";
114
115
  import Icon_default from "./Elements/Icon/index.js";
115
116
  import Pagination_default from "./Elements/Pagination/index.js";
116
- import { useModal } from "./Blocks/Modal/hooks/useModal.js";
117
117
  import Spinner_default from "./Elements/Spinner/index.js";
118
118
  import Button_default from "./Elements/Button/index.js";
119
119
  import themes from "./ThemeProvider/themes/index.js";