@mailstep/design-system 0.6.90-beta.1 → 0.6.90-beta.10
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 +1 -1
- package/ui/Blocks/CommonGrid/components/ColumnTitle.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/DataRow.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/DataRow.js +8 -8
- package/ui/Blocks/CommonGrid/components/GridModals/index.js +1 -0
- package/ui/Blocks/CommonGrid/components/HeadRow.js +20 -7
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +2 -2
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +2 -3
- package/ui/Blocks/CommonGrid/components/Table.d.ts +18 -7
- package/ui/Blocks/CommonGrid/components/Table.js +2 -16
- package/ui/Blocks/CommonGrid/components/utils.d.ts +3 -2
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +2 -0
- package/ui/Blocks/CommonGrid/hooks/useSelectPreset.d.ts +1 -0
- package/ui/Blocks/CommonGrid/hooks/useSelectPreset.js +8 -1
- package/ui/Blocks/CommonGrid/types.d.ts +1 -1
- package/ui/ThemeProvider/themes/mailwise.js +13 -13
- package/ui/index.es.js +10787 -10710
- package/ui/index.umd.js +401 -403
- package/ui/Blocks/CommonGrid/components/HeadCell.d.ts +0 -27
- package/ui/Blocks/CommonGrid/components/HeadCell.js +0 -42
package/package.json
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
28
|
-
import
|
|
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 {
|
|
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;
|
|
@@ -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
|
|
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) {
|
|
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
|
-
|
|
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,
|
|
40
|
-
var
|
|
41
|
-
|
|
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
|
|
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,
|
|
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,
|
|
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
|
|
2
|
-
hasRowClick
|
|
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
|
|
5
|
-
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
19
|
-
export var
|
|
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,6 +80,7 @@ var useManageColumn = function (_a) {
|
|
|
80
80
|
if (to === from || !destination) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
+
console.log('from ', from, ', to', to, 'destination', destination, 'source', source);
|
|
83
84
|
var columns = isManageModal ? manageColumnsFormDefinitions : displayColumnsDefinitions;
|
|
84
85
|
var newOrderColumns = __spreadArray([], (isManageModal ? updatedColumnsOrder : columnsOrderValue), true);
|
|
85
86
|
var fromIndex = newOrderColumns.findIndex(function (column) { return columns[from].name === column; });
|
|
@@ -88,6 +89,7 @@ var useManageColumn = function (_a) {
|
|
|
88
89
|
var column = newOrderColumns[fromIndex];
|
|
89
90
|
newOrderColumns.splice(fromIndex, 1);
|
|
90
91
|
newOrderColumns.splice(toIndex === -1 ? 0 : toIndex, 0, column);
|
|
92
|
+
console.log('fromIndex', fromIndex, 'toIndex', toIndex, 'columnsOrderValue', columnsOrderValue, ' newOrderColumns', newOrderColumns);
|
|
91
93
|
if (!isManageModal) {
|
|
92
94
|
setColumnsOrder === null || setColumnsOrder === void 0 ? void 0 : setColumnsOrder(newOrderColumns);
|
|
93
95
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
|
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: '#
|
|
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;
|