@mailstep/design-system 0.6.90-beta.1 → 0.6.90-beta.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.6.90-beta.1",
3
+ "version": "0.6.90-beta.11",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -81,7 +81,7 @@
81
81
  "moment": "^2.30.1",
82
82
  "prettier": "2.8.8",
83
83
  "react": "^18.2.0",
84
- "react-beautiful-dnd": "^13.0.0",
84
+ "react-beautiful-dnd": "^13.1.1",
85
85
  "react-dom": "^18.2.0",
86
86
  "react-helmet": "^6.1.0",
87
87
  "react-image": "^4.1.0",
@@ -1,9 +1,9 @@
1
- import { CommonGridProps, FiltersConfig, ColumnDefinition } from './types';
2
1
  import { DropResult } from 'react-beautiful-dnd';
2
+ import { CommonGridProps, FiltersConfig, ColumnDefinition } from './types';
3
3
  type Props = CommonGridProps & {
4
4
  filters?: FiltersConfig;
5
5
  handleDragEnd: (item: DropResult) => void;
6
6
  displayColumnsDefinitions: ColumnDefinition[];
7
7
  };
8
- declare const CommonGrid: ({ filters, comparators, handleDragEnd, gridSelectors, gridActions, isLoading, rowsData, hasColouredRows, columnsDefinitions, actionColumnDefinition, allowRowSelect, allowRowSelectOnAction, onRowAction, onRowEditClick, onRowReadClick, onRowClick, columnLayout, displayColumnsDefinitions, className, gridRef, minColumnWidth, errorMessage, floatingButtonProps, }: Props) => JSX.Element;
8
+ declare const CommonGrid: ({ filters, comparators, handleDragEnd, gridSelectors, gridActions, isLoading, rowsData, hasColouredRows, columnsDefinitions, actionColumnDefinition, allowRowSelect, allowRowSelectOnAction, onRowAction, onRowEditClick, onRowReadClick, onRowClick, columnLayout, displayColumnsDefinitions, className, gridRef, minColumnWidth, errorMessage, floatingButtonProps }: Props) => JSX.Element;
9
9
  export default CommonGrid;
@@ -11,20 +11,20 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
13
  import React from 'react';
14
- import { x } from '@xstyled/styled-components';
15
- import { Row, MessageCell } from './components/Table';
16
- import OversizedScroll from './components/OversizedScroll';
17
- import GroupRow from './components/GroupRow';
18
- import FilterRow from './components/FilterRow';
19
14
  import DataRow from './components/DataRow';
15
+ import FilterRow from './components/FilterRow';
16
+ import FloatingButton from './components/FloatingButton/FloatingButton';
17
+ import GroupRow from './components/GroupRow';
20
18
  import HeadRow from './components/HeadRow';
21
- import useUxReset from './hooks/useUxReset';
22
- import useRowsKeyControls from './hooks/useRowsKeyControls';
19
+ import OversizedScroll from './components/OversizedScroll';
20
+ import { Row, MessageCell } from './components/Table';
23
21
  import useColumnSizes from './hooks/useColumnSizes';
24
- import { getGroups } from './utils';
25
- import { initialState } from './store';
22
+ import useRowsKeyControls from './hooks/useRowsKeyControls';
23
+ import useUxReset from './hooks/useUxReset';
26
24
  import { Trans } from '@lingui/react';
27
- import FloatingButton from './components/FloatingButton/FloatingButton';
25
+ import { x } from '@xstyled/styled-components';
26
+ import { initialState } from './store';
27
+ import { getGroups } from './utils';
28
28
  var rowsStyles = { outline: 'none' };
29
29
  var defaultVoidFunction = function () {
30
30
  var args = [];
@@ -3,7 +3,7 @@ import { SortingValueType } from '../types';
3
3
  declare const _default: React.NamedExoticComponent<{
4
4
  title?: string | JSX.Element | undefined;
5
5
  isSortable: boolean;
6
- onSetSort: (value: SortingValueType) => void;
6
+ onSetSort?: ((value: SortingValueType) => void) | undefined;
7
7
  sortValue: SortingValueType;
8
8
  }>;
9
9
  export default _default;
@@ -17,5 +17,5 @@ type DataRowProps = {
17
17
  groups: Group[];
18
18
  isEven?: boolean;
19
19
  };
20
- declare const DataRow: ({ columns, actionColumn, rowData, rowIndex, uxState, allowRowSelect, allowRowSelectOnAction, onUxChange, onRowEditClick, onRowReadClick, onRowClick, onRowAction, displayColumnsWidth, groups, isEven, }: DataRowProps) => JSX.Element;
20
+ declare const DataRow: ({ columns, actionColumn, rowData, rowIndex, uxState, allowRowSelect, allowRowSelectOnAction, onUxChange, onRowEditClick, onRowReadClick, onRowClick, onRowAction, displayColumnsWidth, groups, isEven }: DataRowProps) => JSX.Element;
21
21
  export default DataRow;
@@ -22,18 +22,18 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import React from 'react';
25
- import { x } from '@xstyled/styled-components';
26
25
  import { Link } from 'react-router-dom';
27
- import { Cell, StyledDataRow } from './Table';
28
- import MemoDataCell from './DataCell';
26
+ import Button from '../../../Elements/Button/Button';
27
+ import Checkbox from '../../../Forms/Checkbox';
28
+ import { rowClassSymbol } from '../types';
29
+ import { getActionCellSizeProps } from '../utils';
29
30
  import EditIcon from './icons/Edit';
30
31
  import EyeOpenIcon from './icons/EyeOpen';
31
- import { getActionCellSizeProps } from '../utils';
32
- import { rowClassSymbol } from '../types';
32
+ import { x } from '@xstyled/styled-components';
33
33
  import { isFunction } from 'lodash/fp';
34
+ import MemoDataCell from './DataCell';
35
+ import { Cell, StyledDataRow } from './Table';
34
36
  import { useTimeMeasurement } from './utils';
35
- import Checkbox from '../../../Forms/Checkbox';
36
- import Button from '../../../Elements/Button/Button';
37
37
  var EmptySpan = function (_a) {
38
38
  var children = _a.children, props = __rest(_a, ["children"]);
39
39
  return _jsx("span", __assign({}, props, { children: children }));
@@ -105,6 +105,6 @@ var DataRow = function (_a) {
105
105
  return actionColumn ? __assign({}, getActionCellSizeProps(actionColumn)) : {};
106
106
  }, [actionColumn]);
107
107
  var displayReadEditCell = ((_c = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _c === void 0 ? void 0 : _c.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowEdit) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowRead) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes);
108
- return (_jsxs(StyledDataRow, { className: rowClassName, hasRowClick: !!onRowClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, isEven: isEven, children: [actionColumn && (_jsxs(_Fragment, { children: [displayReadEditCell && (_jsxs(Cell, { className: "cell", style: actionColumnStyle, children: [((_d = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _d === void 0 ? void 0 : _d.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes) ? (_jsx(Checkbox, { checked: isChecked, onChange: onCheckboxChange, label: "" })) : null, _jsxs(x.div, { children: [(isFunction(actionColumn.canRowRead) ? actionColumn.canRowRead(rowData) : actionColumn.canRowRead) && (_jsx(RowActionComponent, __assign({}, rowActionProps('read'), { children: _jsx(Button, { type: "button", variant: "default", appearance: "primary", children: _jsx(EyeOpenIcon, { width: "16px", height: "16px" }) }) }))), (isFunction(actionColumn.canRowEdit) ? actionColumn.canRowEdit(rowData) : actionColumn.canRowEdit) && (_jsx(RowActionComponent, __assign({}, rowActionProps('edit'), { children: _jsx(Button, { type: "button", variant: "default", appearance: "primary", children: _jsx(EditIcon, { width: "16px", height: "16px" }) }) })))] })] })), (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbers) && (_jsx(Cell, { className: "cell", style: actionColumnStyle, children: _jsx(x.div, { children: rowIndex }) }))] })), columns.map(function (column, key) { return (_jsx(MemoDataCell, { column: column, rowData: rowData, onRowAction: handleRowAction, displayColumnWidth: displayColumnsWidth[column.name], group: groups === null || groups === void 0 ? void 0 : groups[key] }, column.name)); })] }));
108
+ return (_jsxs(StyledDataRow, { className: rowClassName, hasRowClick: !!onRowClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, isEven: !!isEven, children: [actionColumn && (_jsxs(_Fragment, { children: [displayReadEditCell && (_jsxs(Cell, { className: "cell", style: actionColumnStyle, children: [((_d = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _d === void 0 ? void 0 : _d.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes) ? (_jsx(Checkbox, { checked: isChecked, onChange: onCheckboxChange, label: "" })) : null, _jsxs(x.div, { children: [(isFunction(actionColumn.canRowRead) ? actionColumn.canRowRead(rowData) : actionColumn.canRowRead) && (_jsx(RowActionComponent, __assign({}, rowActionProps('read'), { children: _jsx(Button, { type: "button", variant: "default", appearance: "primary", children: _jsx(EyeOpenIcon, { width: "16px", height: "16px" }) }) }))), (isFunction(actionColumn.canRowEdit) ? actionColumn.canRowEdit(rowData) : actionColumn.canRowEdit) && (_jsx(RowActionComponent, __assign({}, rowActionProps('edit'), { children: _jsx(Button, { type: "button", variant: "default", appearance: "primary", children: _jsx(EditIcon, { width: "16px", height: "16px" }) }) })))] })] })), (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbers) && (_jsx(Cell, { className: "cell", style: actionColumnStyle, children: _jsx(x.div, { children: rowIndex }) }))] })), columns.map(function (column, key) { return (_jsx(MemoDataCell, { column: column, rowData: rowData, onRowAction: handleRowAction, displayColumnWidth: displayColumnsWidth[column.name], group: groups === null || groups === void 0 ? void 0 : groups[key] }, column.name)); })] }));
109
109
  };
110
110
  export default DataRow;
@@ -86,7 +86,6 @@ var NumberRange = function (props) {
86
86
  }
87
87
  // two values for between comparation
88
88
  if (values.length === 2) {
89
- console.log('TRTEEEEEST', values);
90
89
  var normalizedValues = values.map(function (value) { return normalizeValue(value, 0); });
91
90
  onChange({ comparator: comparator, value: normalizedValues.join(',') });
92
91
  return;
@@ -13,6 +13,7 @@ export var GridModals = function (_a) {
13
13
  var _b = useSelectPreset({
14
14
  gridName: gridName,
15
15
  gridActions: gridActions,
16
+ selectedPresetName: selectedPresetName,
16
17
  setSelectedPresetName: setSelectedPresetName,
17
18
  onClosePresetsModal: onClosePresetsModal,
18
19
  filters: gridSelectors.filter
@@ -12,12 +12,16 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import React, { useEffect, useState } from 'react';
14
14
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
15
- import { getActionCellSizeProps, getCellSizeProps, getSortName } from '../utils';
16
- import HeadCell from './HeadCell';
15
+ import { getActionCellSizeProps, getCellSizeProps, getGroupClassNames, getSortName, getStickyCollClassNames } from '../utils';
16
+ import ColumnTitle from './ColumnTitle';
17
+ import Resize from './Resize';
17
18
  import { Row, Cell } from './Table';
18
19
  var getStickyComponent = function (columns, stickyTo, displayColumnsWidth) {
19
20
  var _a;
20
- return (_a = columns === null || columns === void 0 ? void 0 : columns.filter(function (item) { return item.sticky && item.stickTo === stickyTo; })) === null || _a === void 0 ? void 0 : _a.map(function (column) { return (_jsx(HeadCell, __assign({ name: column.name, systemName: column.systemName, isSortable: false, hasResize: false, isDragging: false, sortValue: null }, getCellSizeProps(column, displayColumnsWidth[column.name]), { title: column.title, sticky: column.sticky, stickTo: column.stickTo }), column.name)); });
21
+ return (_a = columns === null || columns === void 0 ? void 0 : columns.filter(function (item) { return item.sticky && item.stickTo === stickyTo; })) === null || _a === void 0 ? void 0 : _a.map(function (column) {
22
+ var cellClassName = "cell".concat(getStickyCollClassNames(!!column.sticky, column.stickTo), "}");
23
+ return (_jsx(Cell, __assign({}, getCellSizeProps(column, displayColumnsWidth[column.name]), { className: cellClassName, children: _jsx(ColumnTitle, { title: column === null || column === void 0 ? void 0 : column.title, isSortable: false, sortValue: null }) }), column.name));
24
+ });
21
25
  };
22
26
  var HeadRow = function (_a) {
23
27
  var _b;
@@ -34,11 +38,20 @@ var HeadRow = function (_a) {
34
38
  setIsDragDisabled(false);
35
39
  }, [setIsDragDisabled]);
36
40
  var displayReadEditCell = ((_b = actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.actionOptions) === null || _b === void 0 ? void 0 : _b.length) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowEdit) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.canRowRead) || (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.forceCheckboxes);
37
- return (_jsx(_Fragment, { children: showUIElements && (_jsx(DragDropContext, { onDragEnd: handleDragEnd, children: _jsx(Droppable, { droppableId: "droppable", direction: "horizontal", isDropDisabled: isDragDisabled, isCombineEnabled: false, ignoreContainerClipping: true, children: function (droppableProvided) { return (_jsxs(Row, __assign({ className: "headRow", accountForScrollbar: false, ref: droppableProvided.innerRef }, droppableProvided.droppableProps, { children: [actionColumn && (_jsxs(_Fragment, { children: [displayReadEditCell && (_jsx(Cell, { className: "cell", style: Object.assign(__assign({}, getActionCellSizeProps(actionColumn))) })), (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbers) && (_jsx(Cell, { className: "cell", style: Object.assign(__assign({}, getActionCellSizeProps(actionColumn))) }))] })), getStickyComponent(columns, 'left', displayColumnsWidth), columns
41
+ var onResize = React.useCallback(function (name) { return function (width) {
42
+ handleResizeDrag === null || handleResizeDrag === void 0 ? void 0 : handleResizeDrag(name, width);
43
+ }; }, [handleResizeDrag]);
44
+ var onSetSort = React.useCallback(function (name, systemName) { return function (value) {
45
+ onAddSort && onAddSort(systemName || name, value);
46
+ }; }, [onAddSort]);
47
+ return (_jsx(_Fragment, { children: showUIElements && (_jsx(DragDropContext, { onDragEnd: handleDragEnd, children: _jsx(Droppable, { droppableId: "droppable", direction: "horizontal", isDropDisabled: isDragDisabled, isCombineEnabled: false, ignoreContainerClipping: false, children: function (droppableProvided) { return (_jsxs(Row, __assign({ className: "headRow", accountForScrollbar: false, ref: droppableProvided.innerRef }, droppableProvided.droppableProps, { children: [actionColumn && (_jsxs(_Fragment, { children: [displayReadEditCell && (_jsx(Cell, { className: "cell", style: Object.assign(__assign({}, getActionCellSizeProps(actionColumn))) })), (actionColumn === null || actionColumn === void 0 ? void 0 : actionColumn.addRowNumbers) && (_jsx(Cell, { className: "cell", style: Object.assign(__assign({}, getActionCellSizeProps(actionColumn))) }))] })), getStickyComponent(columns, 'left', displayColumnsWidth), columns
38
48
  .filter(function (item) { return !item.sticky; })
39
- .map(function (column, key) { return (_jsx(Draggable, { draggableId: column.name, index: key, isDragDisabled: isDragDisabled || column.sticky, children: function (draggableProvided, snapshot) {
40
- var _a;
41
- return (_jsx(HeadCell, __assign({ name: column.name, systemName: column.systemName, onAddSort: onAddSort, isSortable: !!column.sorting, sortValue: ((_a = sortingValues.find(function (sorting) { return sorting.column == getSortName(column); })) === null || _a === void 0 ? void 0 : _a.direction) || null, innerRef: draggableProvided.innerRef, handleResizeDrag: handleResizeDrag, hasResize: columnLayout == 'normal' || !!columns[key + 1], draggableProps: draggableProvided.draggableProps, dragHandleProps: draggableProvided.dragHandleProps, isDragging: snapshot.isDragging, onResizeOver: onResizeOver, onResizeOut: onResizeOut }, getCellSizeProps(column, displayColumnsWidth[column.name]), { group: groups[key], title: column.title, sticky: column.sticky, stickTo: column.stickTo })));
49
+ .map(function (column, index) { return (_jsx(Draggable, { draggableId: column.name, index: index, isDragDisabled: isDragDisabled || column.sticky, children: function (_a) {
50
+ var _b;
51
+ var innerRef = _a.innerRef, draggableProps = _a.draggableProps, dragHandleProps = _a.dragHandleProps;
52
+ var hasResize = columnLayout == 'normal' || !!columns[index + 1];
53
+ var cellClassName = "cell".concat(getStickyCollClassNames(!!(column === null || column === void 0 ? void 0 : column.sticky), column === null || column === void 0 ? void 0 : column.stickTo), " ").concat(getGroupClassNames(groups[index]));
54
+ return (_jsxs(Cell, __assign({}, getCellSizeProps(column, displayColumnsWidth[column.name]), draggableProps, dragHandleProps, { ref: innerRef, className: cellClassName, children: [_jsx(ColumnTitle, { title: column === null || column === void 0 ? void 0 : column.title, isSortable: !!column.sorting, onSetSort: onSetSort(column.name, column.systemName), sortValue: ((_b = sortingValues.find(function (sorting) { return sorting.column == getSortName(column); })) === null || _b === void 0 ? void 0 : _b.direction) || null }), hasResize && onResizeOut && onResizeOver && (_jsx(Resize, { onResize: onResize(column.name), onResizeOver: onResizeOver, onResizeOut: onResizeOut }))] })));
42
55
  } }, column.name)); }), getStickyComponent(columns, 'right', displayColumnsWidth), droppableProvided.placeholder] }))); } }) })) }));
43
56
  };
44
57
  export default HeadRow;
@@ -25,8 +25,8 @@ var ManageColumnForm = function (_a) {
25
25
  var clear = useCallback(function () {
26
26
  setSearchedValue('');
27
27
  }, [setSearchedValue]);
28
- return (_jsxs(x.div, { children: [_jsx(Input, { icon: "search", type: "text", value: searchedValue, placeholder: i18n._({ id: 'manageColumn.searchPlaceholder', message: 'Find column...' }), onChange: onChangeInputValue, onClear: clear, variant: "gray" }), _jsx(DragDropContext, { onDragEnd: handleDragEnd, children: _jsx(Droppable, { droppableId: "droppable", direction: "vertical", isCombineEnabled: false, ignoreContainerClipping: false, children: function (droppableProvided) { return (_jsx(x.div, __assign({ h: "400px", overflowY: "scroll", mt: "20px", ref: droppableProvided.innerRef }, droppableProvided.droppableProps, { children: columns === null || columns === void 0 ? void 0 : columns.map(function (column, index) {
29
- return (_jsx(Draggable, { draggableId: column.name, index: index, isDragDisabled: !!searchedValue, children: function (draggableProvided, snapshot) { return (_jsx(ActionRow, { column: column, innerRef: draggableProvided.innerRef, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions, searchedValue: searchedValue, draggableProps: draggableProvided.draggableProps, dragHandleProps: draggableProvided.dragHandleProps }, index)); } }, column.name));
28
+ return (_jsxs(x.div, { children: [_jsx(Input, { icon: "search", type: "text", value: searchedValue, placeholder: i18n._({ id: 'manageColumn.searchPlaceholder', message: 'Find column...' }), onChange: onChangeInputValue, onClear: clear, variant: "gray" }), _jsx(DragDropContext, { onDragEnd: handleDragEnd, children: _jsx(Droppable, { droppableId: "droppable", direction: "vertical", isCombineEnabled: false, ignoreContainerClipping: false, isDropDisabled: !!searchedValue, children: function (droppableProvided) { return (_jsx(x.div, __assign({ h: "400px", overflowY: "scroll", mt: "20px", ref: droppableProvided.innerRef }, droppableProvided.droppableProps, { children: columns === null || columns === void 0 ? void 0 : columns.map(function (column, index) {
29
+ return (_jsx(Draggable, { draggableId: column.name, index: index, isDragDisabled: !!searchedValue, children: function (draggableProvided) { return (_jsx(ActionRow, { column: column, innerRef: draggableProvided.innerRef, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions, searchedValue: searchedValue, draggableProps: draggableProvided.draggableProps, dragHandleProps: draggableProvided.dragHandleProps }, index)); } }, column.name));
30
30
  }) }))); } }) })] }));
31
31
  };
32
32
  export default ManageColumnForm;
@@ -14,7 +14,7 @@ var __assign = (this && this.__assign) || function () {
14
14
  return __assign.apply(this, arguments);
15
15
  };
16
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
- import { useCallback, useMemo, useState } from 'react';
17
+ import { useCallback, useState } from 'react';
18
18
  import { isObject } from 'lodash';
19
19
  import styled from 'styled-components';
20
20
  import { Group } from '../../../../../Elements/Icon/icons/Group';
@@ -30,7 +30,6 @@ export var ActionRow = function (_a) {
30
30
  var _b, _c, _d, _e, _f;
31
31
  var column = _a.column, columnsConfigValues = _a.columnsConfigValues, setColumnsConfigOptions = _a.setColumnsConfigOptions, searchedValue = _a.searchedValue, innerRef = _a.innerRef, draggableProps = _a.draggableProps, dragHandleProps = _a.dragHandleProps;
32
32
  var _g = useState((_b = columnsConfigValues === null || columnsConfigValues === void 0 ? void 0 : columnsConfigValues.includes(column.name)) !== null && _b !== void 0 ? _b : false), isSelected = _g[0], setIsSelected = _g[1];
33
- var style = useMemo(function () { return (__assign({}, draggableProps === null || draggableProps === void 0 ? void 0 : draggableProps.style)); }, [draggableProps]);
34
33
  var translatedValue = (isObject(column === null || column === void 0 ? void 0 : column.title) &&
35
34
  'props' in column.title &&
36
35
  ((_c = column.title) === null || _c === void 0 ? void 0 : _c.props) &&
@@ -44,6 +43,6 @@ export var ActionRow = function (_a) {
44
43
  });
45
44
  setIsSelected(!isSelected);
46
45
  }, [setColumnsConfigOptions, isSelected, column.name]);
47
- return (_jsxs(RowLayout, __assign({ "$isVisible": isVisible }, draggableProps, dragHandleProps, { ref: innerRef, style: style, children: [_jsxs(x.div, { display: "flex", alignItems: "center", children: [_jsx(x.div, { w: "28px", children: _jsx(Toggle, { name: "", variant: "grid", onChange: handleToggleChange, spaceAround: false, checked: isSelected }) }), _jsx(H6, { variant: "medium", ml: "8px", children: translatedValue })] }), _jsx(Group, {})] })));
46
+ return (_jsxs(RowLayout, __assign({ "$isVisible": isVisible }, draggableProps, dragHandleProps, { ref: innerRef, children: [_jsxs(x.div, { display: "flex", alignItems: "center", children: [_jsx(x.div, { w: "28px", children: _jsx(Toggle, { name: "", variant: "grid", onChange: handleToggleChange, spaceAround: false, checked: isSelected }) }), _jsx(H6, { variant: "medium", ml: "8px", children: translatedValue })] }), _jsx(Group, {})] })));
48
47
  };
49
48
  var templateObject_1;
@@ -1,12 +1,23 @@
1
- export declare const StyledRow: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
2
- hasRowClick: boolean;
1
+ export declare const Row: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
2
+ hasRowClick?: boolean | undefined;
3
+ accountForScrollbar?: boolean | undefined;
4
+ align?: string | undefined;
3
5
  }, never>;
4
- export declare const Row: (props: any) => JSX.Element;
5
- export declare const StyledDataRow: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {
6
+ export declare const Cell: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
7
+ align?: string | undefined;
8
+ }, never>;
9
+ export declare const StyledDataRow: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
10
+ hasRowClick?: boolean | undefined;
11
+ accountForScrollbar?: boolean | undefined;
12
+ align?: string | undefined;
13
+ } & {
6
14
  isEven: boolean;
7
15
  }, never>;
8
- export declare const Cell: (props: any) => JSX.Element;
9
- export declare const TextCell: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
10
- export declare const MessageCell: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {
16
+ export declare const TextCell: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
17
+ align?: string | undefined;
18
+ }, never>;
19
+ export declare const MessageCell: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
20
+ align?: string | undefined;
21
+ } & {
11
22
  width: number;
12
23
  }, never>;
@@ -2,24 +2,10 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
2
2
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
3
  return cooked;
4
4
  };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
5
  import styled, { system, th } from '@xstyled/styled-components';
18
- export var StyledRow = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n display: flex;\n min-height: 32px;\n border-bottom: 1px solid rgb(228, 231, 235);\n cursor: ", ";\n"], ["\n ", ";\n display: flex;\n min-height: 32px;\n border-bottom: 1px solid rgb(228, 231, 235);\n cursor: ", ";\n"])), system, function (props) { return (props.hasRowClick ? 'pointer' : 'cursor'); });
19
- export var Row = function (props) { return _jsx(StyledRow, __assign({ ref: props.innerRef }, props)); };
20
- var StyledCell = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: ", ";\n"], ["\n ", ";\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: ", ";\n"])), system, function (props) { return props.align; });
6
+ export var Row = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n display: flex;\n min-height: 32px;\n border-bottom: 1px solid rgb(228, 231, 235);\n cursor: ", ";\n"], ["\n ", ";\n display: flex;\n min-height: 32px;\n border-bottom: 1px solid rgb(228, 231, 235);\n cursor: ", ";\n"])), system, function (props) { return (props.hasRowClick ? 'pointer' : 'cursor'); });
7
+ export var Cell = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: ", ";\n"], ["\n ", ";\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: ", ";\n"])), system, function (props) { return props.align; });
21
8
  export var StyledDataRow = styled(Row)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (props) { return (props.isEven ? th('colors.bgLightGray') : 'white'); });
22
- export var Cell = function (props) { return _jsx(StyledCell, __assign({ ref: props.innerRef }, props)); };
23
9
  export var TextCell = styled(Cell)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n text-overflow: ellipsis;\n white-space: nowrap;\n"], ["\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
24
10
  export var MessageCell = styled(Cell)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: ", "px;\n position: sticky;\n left: 0;\n"], ["\n width: ", "px;\n position: sticky;\n left: 0;\n"])), function (props) { return props.width; });
25
11
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -1,8 +1,9 @@
1
+ import { MouseEvent } from 'react';
1
2
  type Props = {
2
- handleRowClick: (e: MouseEvent) => void;
3
+ handleRowClick: (e: MouseEvent<HTMLDivElement>) => void;
3
4
  };
4
5
  export declare const useTimeMeasurement: ({ handleRowClick }: Props) => {
5
6
  handleMouseDown: () => void;
6
- handleMouseUp: (e: MouseEvent) => void;
7
+ handleMouseUp: (e: MouseEvent<HTMLDivElement>) => void;
7
8
  };
8
9
  export {};
@@ -80,7 +80,7 @@ var useManageColumn = function (_a) {
80
80
  if (to === from || !destination) {
81
81
  return;
82
82
  }
83
- var columns = isManageModal ? manageColumnsFormDefinitions : displayColumnsDefinitions;
83
+ var columns = isManageModal ? manageColumnsFormDefinitions : displayColumnsDefinitions.filter(function (item) { return !item.sticky; });
84
84
  var newOrderColumns = __spreadArray([], (isManageModal ? updatedColumnsOrder : columnsOrderValue), true);
85
85
  var fromIndex = newOrderColumns.findIndex(function (column) { return columns[from].name === column; });
86
86
  var toIndex = newOrderColumns.findIndex(function (column) { return columns[to !== null && to !== void 0 ? to : 0].name === column; });
@@ -2,6 +2,7 @@ import { Filtering, GridActionsType } from '../types';
2
2
  type Props = {
3
3
  gridName?: string;
4
4
  gridActions: GridActionsType;
5
+ selectedPresetName: string;
5
6
  setSelectedPresetName: (value: string) => void;
6
7
  onClosePresetsModal: () => void;
7
8
  filters?: Filtering;
@@ -15,7 +15,7 @@ var getInitialPresets = function (gridName) {
15
15
  }
16
16
  };
17
17
  export var useSelectPreset = function (_a) {
18
- var gridName = _a.gridName, gridActions = _a.gridActions, setSelectedPresetName = _a.setSelectedPresetName, onClosePresetsModal = _a.onClosePresetsModal, filters = _a.filters;
18
+ var gridName = _a.gridName, gridActions = _a.gridActions, selectedPresetName = _a.selectedPresetName, setSelectedPresetName = _a.setSelectedPresetName, onClosePresetsModal = _a.onClosePresetsModal, filters = _a.filters;
19
19
  var _b = useState(false), isFilterChangeFromButton = _b[0], setIsFilterChangeFromButton = _b[1];
20
20
  var _c = useState(getInitialPresets(gridName)), gridPresets = _c[0], setGridPresets = _c[1];
21
21
  var handleSelectPreset = useCallback(function (presetName, filters) { return function () {
@@ -26,7 +26,14 @@ export var useSelectPreset = function (_a) {
26
26
  setIsFilterChangeFromButton(true);
27
27
  }; }, [gridActions]);
28
28
  useEffect(function () {
29
+ var _a;
30
+ if (!selectedPresetName || !gridName)
31
+ return;
29
32
  if (!isFilterChangeFromButton) {
33
+ var activePreset = (_a = gridPresets[selectedPresetName]) !== null && _a !== void 0 ? _a : {};
34
+ var isSame = isEqual(activePreset, filters);
35
+ if (isSame)
36
+ return;
30
37
  setSelectedPresetName('');
31
38
  return;
32
39
  }
@@ -5,7 +5,7 @@ export declare const BottomWrapper: import("styled-components").StyledComponent<
5
5
  export declare const ContentContainer: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
6
6
  export declare const CommonGridWrap: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
7
7
  export declare const StyledButtonStrip: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
8
- export declare const CommonGridWithStyles: import("styled-components").StyledComponent<({ filters, comparators, handleDragEnd, gridSelectors, gridActions, isLoading, rowsData, hasColouredRows, columnsDefinitions, actionColumnDefinition, allowRowSelect, allowRowSelectOnAction, onRowAction, onRowEditClick, onRowReadClick, onRowClick, columnLayout, displayColumnsDefinitions, className, gridRef, minColumnWidth, errorMessage, floatingButtonProps, }: import("./types").CommonGridProps & {
8
+ export declare const CommonGridWithStyles: import("styled-components").StyledComponent<({ filters, comparators, handleDragEnd, gridSelectors, gridActions, isLoading, rowsData, hasColouredRows, columnsDefinitions, actionColumnDefinition, allowRowSelect, allowRowSelectOnAction, onRowAction, onRowEditClick, onRowReadClick, onRowClick, columnLayout, displayColumnsDefinitions, className, gridRef, minColumnWidth, errorMessage, floatingButtonProps }: import("./types").CommonGridProps & {
9
9
  filters?: import("./types").FiltersConfig | undefined;
10
10
  handleDragEnd: (item: import("react-beautiful-dnd").DropResult) => void;
11
11
  displayColumnsDefinitions: import("./types").ColumnDefinition[];
@@ -46,7 +46,7 @@ export type FilterComponentProps<VT> = {
46
46
  export type ColumnTitleComponentType = React.ComponentType<{
47
47
  title?: string | JSX.Element;
48
48
  isSortable: boolean;
49
- onSetSort: (value: SortingValueType) => void;
49
+ onSetSort?: (value: SortingValueType) => void;
50
50
  sortValue: SortingValueType;
51
51
  }>;
52
52
  export type ComponentsProps = {
@@ -7,7 +7,7 @@ var defaultTheme = {
7
7
  md: 768,
8
8
  lg: 1024,
9
9
  xl: 1280,
10
- '2xl': 1536,
10
+ '2xl': 1536
11
11
  },
12
12
  colors: {
13
13
  white: '#fff',
@@ -71,7 +71,7 @@ var defaultTheme = {
71
71
  yellow2: '#F2E871',
72
72
  red10: '#FFF6F4',
73
73
  red20: '#FFEBE6',
74
- red30: '#fec1cb',
74
+ red30: '#FFDAD1',
75
75
  red50: '#ff7c7b',
76
76
  red1: '#DB2B19',
77
77
  red2: '#E94324',
@@ -92,11 +92,11 @@ var defaultTheme = {
92
92
  primary: '#626262',
93
93
  black: '#333333',
94
94
  error: '#ea5455',
95
- secondary: '#E15B63',
95
+ secondary: '#E15B63'
96
96
  },
97
97
  fonts: {
98
98
  primary: 'Inter, sans-serif',
99
- heading: 'Inter, sans-serif',
99
+ heading: 'Inter, sans-serif'
100
100
  },
101
101
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
102
102
  // @ts-ignore
@@ -116,13 +116,13 @@ var defaultTheme = {
116
116
  7: '1.2',
117
117
  8: '1.2',
118
118
  9: '1.2',
119
- 10: '1.2',
119
+ 10: '1.2'
120
120
  },
121
121
  fontWeights: {
122
122
  normal: 400,
123
123
  medium: 500,
124
124
  semiBold: 600,
125
- bold: 700,
125
+ bold: 700
126
126
  },
127
127
  letterSpacings: {
128
128
  tighter: '2',
@@ -130,21 +130,21 @@ var defaultTheme = {
130
130
  normal: '4',
131
131
  wide: '8',
132
132
  wider: '8',
133
- widest: '8',
133
+ widest: '8'
134
134
  },
135
135
  borders: {
136
136
  slim: '1px solid',
137
137
  mediumSlim: '2px solid',
138
138
  medium: '3px solid',
139
139
  mediumThick: '6px solid',
140
- thick: '10px solid',
140
+ thick: '10px solid'
141
141
  },
142
142
  radii: {
143
143
  sm: '2px',
144
144
  md: '4px',
145
145
  ml: '6px',
146
146
  lg: '8px',
147
- xl: '16px',
147
+ xl: '16px'
148
148
  },
149
149
  shadows: {
150
150
  boxShadow: '0px 5px 60px rgba(0, 0, 0, 0.1)',
@@ -160,7 +160,7 @@ var defaultTheme = {
160
160
  headerShadow: '1px 2px 3px #00000029',
161
161
  headerShadowB: '1px 1px 3px #00000029',
162
162
  headerShadowNotifications: '1px 1px 2px #00000029',
163
- cornerDialogShadow: '1px 1px 3px 1px #00000029',
163
+ cornerDialogShadow: '1px 1px 3px 1px #00000029'
164
164
  },
165
165
  space: {
166
166
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -199,12 +199,12 @@ var defaultTheme = {
199
199
  64: '16rem',
200
200
  72: '18rem',
201
201
  80: '20rem',
202
- 96: '24rem',
202
+ 96: '24rem'
203
203
  },
204
204
  transitions: {
205
205
  simpleLong: 'all 2s',
206
- inputTransition: 'border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out',
206
+ inputTransition: 'border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out'
207
207
  },
208
- zIndices: [0, 1, 2, 3, 5, 30, 40, 100, 200, 300, 9999],
208
+ zIndices: [0, 1, 2, 3, 5, 30, 40, 100, 200, 300, 9999]
209
209
  };
210
210
  export default defaultTheme;