@mailstep/design-system 0.7.53-beta.6 → 0.7.54
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 +3 -6
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +2 -2
- package/ui/Blocks/CommonGrid/CommonGrid.js +1 -1
- package/ui/Blocks/CommonGrid/components/GridModals/index.d.ts +3 -3
- package/ui/Blocks/CommonGrid/components/HeadRow.d.ts +5 -4
- package/ui/Blocks/CommonGrid/components/HeadRow.js +13 -12
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +8 -7
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +25 -10
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +30 -0
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/styles.d.ts +0 -2
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/styles.js +2 -8
- package/ui/Blocks/CommonGrid/components/Table.d.ts +2 -6
- package/ui/Blocks/CommonGrid/components/Table.js +1 -1
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +2 -2
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +12 -17
- package/ui/Blocks/CommonGrid/store/index.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +13 -21
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.d.ts +0 -1
- package/ui/Blocks/CommonGrid/storybook/utils/withRedux.js +3 -5
- package/ui/Blocks/CommonGrid/styles.d.ts +1 -1
- package/ui/Elements/ErrorMessage/ErrorMessage.js +1 -1
- package/ui/index.es.js +27157 -23939
- package/ui/index.umd.js +822 -653
- package/ui/Blocks/CommonGrid/components/HeadCell.d.ts +0 -16
- package/ui/Blocks/CommonGrid/components/HeadCell.js +0 -29
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ManageColumnRow.d.ts +0 -11
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ManageColumnRow.js +0 -41
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { Group, Settings, ColumnDefinition, SortingValueType } from '../types';
|
|
3
|
-
type HeadCellProps = {
|
|
4
|
-
column: ColumnDefinition;
|
|
5
|
-
isDragDisabled: boolean;
|
|
6
|
-
displayColumnsWidth: Record<string, number>;
|
|
7
|
-
onResizeOut: () => void;
|
|
8
|
-
onResizeOver: () => void;
|
|
9
|
-
onResize: (column: string) => (width: number) => void;
|
|
10
|
-
sortingValues: Settings['sorting'];
|
|
11
|
-
onSetSort: (column: string, systemName?: string) => (value: SortingValueType) => void;
|
|
12
|
-
group: Group;
|
|
13
|
-
hasResize: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare const HeadCell: FC<HeadCellProps>;
|
|
16
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { getCellSizeProps, getGroupClassNames, getSortName, getStickyCollClassNames } from '../utils';
|
|
14
|
-
import { useSortable } from '@dnd-kit/sortable';
|
|
15
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
16
|
-
import ColumnTitle from './ColumnTitle';
|
|
17
|
-
import Resize from './Resize';
|
|
18
|
-
import { Cell } from './Table';
|
|
19
|
-
export var HeadCell = function (_a) {
|
|
20
|
-
var _b;
|
|
21
|
-
var column = _a.column, isDragDisabled = _a.isDragDisabled, displayColumnsWidth = _a.displayColumnsWidth, onResizeOut = _a.onResizeOut, onResizeOver = _a.onResizeOver, onResize = _a.onResize, sortingValues = _a.sortingValues, onSetSort = _a.onSetSort, group = _a.group, hasResize = _a.hasResize;
|
|
22
|
-
var _c = useSortable({
|
|
23
|
-
id: column.name,
|
|
24
|
-
disabled: isDragDisabled || !!column.sticky,
|
|
25
|
-
animateLayoutChanges: function () { return false; }
|
|
26
|
-
}), attributes = _c.attributes, listeners = _c.listeners, setNodeRef = _c.setNodeRef, transform = _c.transform, transition = _c.transition;
|
|
27
|
-
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(group));
|
|
28
|
-
return (_jsxs(Cell, __assign({}, getCellSizeProps(column, displayColumnsWidth[column.name]), attributes, listeners, { className: cellClassName, transition: transition, transform: CSS.Transform.toString(transform), ref: setNodeRef, 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 }))] })));
|
|
29
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FC } from 'react';
|
|
3
|
-
import type { ColumnConfig, ColumnDefinition } from '../../../types';
|
|
4
|
-
type ActionRowProps = {
|
|
5
|
-
column: ColumnDefinition;
|
|
6
|
-
columnsConfigValues: string[] | undefined;
|
|
7
|
-
setColumnsConfigOptions: (value: React.SetStateAction<Record<string, ColumnConfig | {}>>) => void;
|
|
8
|
-
searchedValue: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const ManageColumnRow: FC<ActionRowProps>;
|
|
11
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useCallback, useState } from 'react';
|
|
14
|
-
import { Group } from '../../../../../Elements/Icon/icons/Group';
|
|
15
|
-
import Toggle from '../../../../../Elements/Toggle/Toggle';
|
|
16
|
-
import { H6 } from '../../../../../Elements/Typography/Typography';
|
|
17
|
-
import { RowLayout } from '../styles';
|
|
18
|
-
import { getTranslatedValue } from '../utils';
|
|
19
|
-
import { useSortable } from '@dnd-kit/sortable';
|
|
20
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
21
|
-
import { x } from '@xstyled/styled-components';
|
|
22
|
-
export var ManageColumnRow = function (_a) {
|
|
23
|
-
var _b;
|
|
24
|
-
var column = _a.column, columnsConfigValues = _a.columnsConfigValues, setColumnsConfigOptions = _a.setColumnsConfigOptions, searchedValue = _a.searchedValue;
|
|
25
|
-
var _c = useState((_b = columnsConfigValues === null || columnsConfigValues === void 0 ? void 0 : columnsConfigValues.includes(column.name)) !== null && _b !== void 0 ? _b : false), isSelected = _c[0], setIsSelected = _c[1];
|
|
26
|
-
var handleToggleChange = useCallback(function () {
|
|
27
|
-
setColumnsConfigOptions(function (prevOptions) {
|
|
28
|
-
var _a;
|
|
29
|
-
return __assign(__assign({}, prevOptions), (_a = {}, _a[column.name] = !isSelected ? {} : { isHidden: true }, _a));
|
|
30
|
-
});
|
|
31
|
-
setIsSelected(!isSelected);
|
|
32
|
-
}, [setColumnsConfigOptions, isSelected, column.name]);
|
|
33
|
-
var translatedValue = getTranslatedValue(column);
|
|
34
|
-
var isVisible = (translatedValue === null || translatedValue === void 0 ? void 0 : translatedValue.toLocaleLowerCase().includes(searchedValue.toLocaleLowerCase())) && !column.alwaysOn;
|
|
35
|
-
var _d = useSortable({
|
|
36
|
-
id: column.name,
|
|
37
|
-
disabled: !!searchedValue || !!column.sticky,
|
|
38
|
-
animateLayoutChanges: function () { return false; }
|
|
39
|
-
}), attributes = _d.attributes, listeners = _d.listeners, setNodeRef = _d.setNodeRef, transform = _d.transform, transition = _d.transition;
|
|
40
|
-
return (_jsx(RowLayout, { "$isVisible": isVisible, transition: transition, transform: CSS.Transform.toString(transform), ref: setNodeRef, children: _jsxs(x.div, { display: "flex", alignItems: "center", w: "100%", children: [_jsx(x.div, { w: "28px", children: _jsx(Toggle, { name: "", variant: "grid", onChange: handleToggleChange, spaceAround: false, checked: isSelected }) }), _jsxs(H6, __assign({ variant: "medium", ml: "8px", m: "0", w: "100%", p: "8px" }, attributes, listeners, { display: "flex", alignItems: "center", justifyContent: "space-between", children: [translatedValue, _jsx(Group, {})] }))] }) }));
|
|
41
|
-
};
|