@mailstep/design-system 0.6.5 → 0.6.7

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.5",
3
+ "version": "0.6.7",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -63,7 +63,7 @@ var CommonGrid = function (_a) {
63
63
  gridBoxRef.current = node;
64
64
  !!gridRef && (gridRef.current = node);
65
65
  }, []);
66
- return (_jsxs(_Fragment, { children: [_jsx(x.div, { className: className || '', children: _jsxs(OversizedScroll, { columnLayout: columnLayout, isLoading: isLoading, totalColumnsWidth: totalColumnsWidth, floatingChildren: GridMessage && (_jsx(Row, { className: "dataRow", align: "center", children: _jsx(MessageCell, { align: "center", className: "gridMessage ".concat(messageClass), children: GridMessage }) })), ref: commonGridRef, children: [_jsxs("div", { className: "gridHead", children: [columnsDefinitions.find(function (col) { return col.group; }) && (_jsx(GroupRow, { actionColumn: actionColumnDefinition, columns: displayColumnsDefinitions, displayColumnsWidth: displayColumnsWidth, groups: groups })), _jsx(HeadRow, { columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onAddSort: addSorting, columnLayout: columnLayout, sortingValues: sorting, displayColumnsWidth: displayColumnsWidth, handleResizeDrag: handleResizeDrag, groups: groups, handleDragEnd: handleDragEnd }), columnsDefinitions.find(function (col) { return col.filtering; }) && (_jsx(FilterRow, { filters: filters, columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onChange: addFilter, filterValues: filter, displayColumnsWidth: displayColumnsWidth, groups: groups, rowsData: rowsData, uxState: uxState, handleUxChange: handleUxChange }))] }), _jsx("div", { className: "body flx_1", style: rowsStyles, tabIndex: -1, onKeyDown: handleRowsKeyDown, children: !isLoading &&
66
+ return (_jsxs(_Fragment, { children: [_jsx(x.div, { className: className || '', children: _jsxs(OversizedScroll, { columnLayout: columnLayout, isLoading: isLoading, totalColumnsWidth: totalColumnsWidth, floatingChildren: GridMessage && (_jsx(Row, { className: "dataRow", align: "center", children: _jsx(MessageCell, { align: "center", className: "gridMessage ".concat(messageClass), width: window.innerWidth, children: GridMessage }) })), ref: commonGridRef, children: [_jsxs("div", { className: "gridHead", children: [columnsDefinitions.find(function (col) { return col.group; }) && (_jsx(GroupRow, { actionColumn: actionColumnDefinition, columns: displayColumnsDefinitions, displayColumnsWidth: displayColumnsWidth, groups: groups })), _jsx(HeadRow, { columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onAddSort: addSorting, columnLayout: columnLayout, sortingValues: sorting, displayColumnsWidth: displayColumnsWidth, handleResizeDrag: handleResizeDrag, groups: groups, handleDragEnd: handleDragEnd }), columnsDefinitions.find(function (col) { return col.filtering; }) && (_jsx(FilterRow, { filters: filters, columns: displayColumnsDefinitions, actionColumn: actionColumnDefinition, onChange: addFilter, filterValues: filter, displayColumnsWidth: displayColumnsWidth, groups: groups, rowsData: rowsData, uxState: uxState, handleUxChange: handleUxChange }))] }), _jsx("div", { className: "body flx_1", style: rowsStyles, tabIndex: -1, onKeyDown: handleRowsKeyDown, children: !isLoading &&
67
67
  rowsData &&
68
68
  displayColumnsDefinitions &&
69
69
  rowsData.map(function (row, index) {
@@ -61,6 +61,6 @@ var StyledCommonGrid = function (props) {
61
61
  gridSelectors: gridSelectors,
62
62
  onClose: onClose,
63
63
  }), columnsConfigValues = _d.columnsConfigValues, setColumnsConfigOptions = _d.setColumnsConfigOptions, onConfirmForm = _d.onConfirmForm, resetColumnConfig = _d.resetColumnConfig, handleDragEnd = _d.handleDragEnd, onCloseForm = _d.onCloseForm, displayColumnsDefinitions = _d.displayColumnsDefinitions, manageColumnsFormDefinitions = _d.manageColumnsFormDefinitions;
64
- return (_jsxs(ContentContainer, { children: [_jsxs(CommonGridWrap, { children: [_jsx(HidePrint, { children: _jsxs(StyledButtonStrip, { className: "buttonsStrip", children: [!hideControlButtons && (_jsx(ControlButtons, { extraControlButtons: extraControlButtons, gridActions: gridActions, gridSelectors: gridSelectors, eshopSelect: eshopSelect })), _jsx(StyledColumnButton, { type: "button", sizing: "iconLg", appearance: "ghost", icon: _jsx(Settings2, {}), onClick: openManageColumnForm, children: _jsx(H6, { variant: "semiBold", children: _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }) }) })] }) }), _jsx(CommonGridWithStyles, __assign({}, passDownProps, modifiedPassDownProps, { filters: filters, gridRef: gridRef, height: gridHeight, floatingButtonProps: floatingButtonProps, handleDragEnd: handleDragEnd(false), displayColumnsDefinitions: displayColumnsDefinitions, hasColouredRows: true }))] }), _jsx(HidePrint, { children: _jsxs(BottomWrapper, { ref: paginationRef, isFixed: !!gridHeight, children: [processCheckedValues && (_jsx(ActionHead, { rowsData: rowsData, onBatchAction: onBatchAction, gridActions: gridActions, gridSelectors: gridSelectors, actionColumn: actionColumnDefinition, processCheckedValues: processCheckedValues, processCheckedValuesTitle: processCheckedValuesTitle })), _jsxs(x.div, { display: "flex", justifyContent: "center", alignItems: "center", className: "paginatorWrapper", w: "100%", h: window.innerWidth > 1204 ? '60px' : '32px', children: [_jsx(Pagination, { page: gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.page, itemCount: passDownProps === null || passDownProps === void 0 ? void 0 : passDownProps.totalRowsCount, itemPerPage: (gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.rowsPerPage) || 10, onPageChange: gridActions === null || gridActions === void 0 ? void 0 : gridActions.setPage, customPaginationHandler: customPaginationHandler }), _jsx(TablePagination, { gridActions: gridActions, gridSelectors: gridSelectors, customPaginationHandler: customPaginationHandler })] })] }) }), manageColumnFormVisible && (_jsx(Modal, { title: _jsx(Trans, { id: "manageColumn.title", message: "Manage columns" }), onClose: onCloseForm, onCancel: onCloseForm, onExtraAction: resetColumnConfig, onConfirm: onConfirmForm, width: "auto", minWidth: "350px", hasFooter: true, extraActionLabel: _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), cancelLabel: _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), confirmLabel: _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), children: _jsx(ManageColumnForm, { columns: manageColumnsFormDefinitions, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions, handleDragEnd: handleDragEnd(true) }) }))] }));
64
+ return (_jsxs(ContentContainer, { children: [_jsxs(CommonGridWrap, { children: [_jsx(HidePrint, { children: _jsxs(StyledButtonStrip, { className: "buttonsStrip", children: [!hideControlButtons && (_jsx(ControlButtons, { extraControlButtons: extraControlButtons, gridActions: gridActions, gridSelectors: gridSelectors, eshopSelect: eshopSelect })), _jsx(StyledColumnButton, { type: "button", sizing: "iconLg", appearance: "ghost", icon: _jsx(Settings2, {}), onClick: openManageColumnForm, children: _jsx(H6, { variant: "semiBold", children: _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }) }) })] }) }), _jsx(CommonGridWithStyles, __assign({}, passDownProps, modifiedPassDownProps, { filters: filters, gridRef: gridRef, height: gridHeight, floatingButtonProps: floatingButtonProps, handleDragEnd: handleDragEnd(false), displayColumnsDefinitions: displayColumnsDefinitions, hasColouredRows: true }))] }), _jsx(HidePrint, { children: _jsxs(BottomWrapper, { ref: paginationRef, isFixed: !!gridHeight, children: [processCheckedValues && (_jsx(ActionHead, { rowsData: rowsData, onBatchAction: onBatchAction, gridActions: gridActions, gridSelectors: gridSelectors, actionColumn: actionColumnDefinition, processCheckedValues: processCheckedValues, processCheckedValuesTitle: processCheckedValuesTitle })), _jsxs(x.div, { display: "flex", justifyContent: "center", alignItems: "center", className: "paginatorWrapper", w: "100%", h: window.innerWidth > 1204 ? '60px' : '32px', children: [_jsx(Pagination, { page: gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.page, itemCount: passDownProps === null || passDownProps === void 0 ? void 0 : passDownProps.totalRowsCount, itemPerPage: (gridSelectors === null || gridSelectors === void 0 ? void 0 : gridSelectors.rowsPerPage) || 10, onPageChange: gridActions === null || gridActions === void 0 ? void 0 : gridActions.setPage, customPaginationHandler: customPaginationHandler, radius: window.innerWidth < 768 ? 3 : 5, rate: window.innerWidth < 768 ? 1 : 4 }), _jsx(TablePagination, { gridActions: gridActions, gridSelectors: gridSelectors, customPaginationHandler: customPaginationHandler })] })] }) }), manageColumnFormVisible && (_jsx(Modal, { title: _jsx(Trans, { id: "manageColumn.title", message: "Manage columns" }), onClose: onCloseForm, onCancel: onCloseForm, onExtraAction: resetColumnConfig, onConfirm: onConfirmForm, width: "auto", minWidth: "350px", hasFooter: true, extraActionLabel: _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), cancelLabel: _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), confirmLabel: _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), children: _jsx(ManageColumnForm, { columns: manageColumnsFormDefinitions, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions, handleDragEnd: handleDragEnd(true) }) }))] }));
65
65
  };
66
66
  export default StyledCommonGrid;
@@ -7,4 +7,6 @@ export declare const StyledDataRow: import("styled-components").StyledComponent<
7
7
  }, never>;
8
8
  export declare const Cell: (props: any) => JSX.Element;
9
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, {}, never>;
10
+ export declare const MessageCell: import("styled-components").StyledComponent<(props: any) => JSX.Element, import("@xstyled/system").Theme, {
11
+ width: number;
12
+ }, never>;
@@ -21,5 +21,5 @@ var StyledCell = styled.div(templateObject_2 || (templateObject_2 = __makeTempla
21
21
  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
22
  export var Cell = function (props) { return _jsx(StyledCell, __assign({ ref: props.innerRef }, props)); };
23
23
  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
- export var MessageCell = styled(Cell)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
24
+ 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
25
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -1,9 +1,11 @@
1
- export type Props = {
1
+ export type PaginationProps = {
2
2
  page?: number;
3
3
  itemCount?: number;
4
4
  itemPerPage: number;
5
+ radius?: number;
6
+ rate?: number;
5
7
  onPageChange?: (number: number, rows: number) => void;
6
8
  customPaginationHandler?: (page: number, rows: number) => void;
7
9
  };
8
- declare const Pagination: ({ onPageChange, itemPerPage, itemCount, page, customPaginationHandler }: Props) => JSX.Element;
10
+ declare const Pagination: ({ onPageChange, itemPerPage, itemCount, page, radius, rate, customPaginationHandler, }: PaginationProps) => JSX.Element;
9
11
  export default Pagination;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo } from 'react';
3
3
  import { Btn, GoIcon, Wrapper, PageBtn, DotsWrapper } from './styled';
4
4
  var Pagination = function (_a) {
5
- var onPageChange = _a.onPageChange, itemPerPage = _a.itemPerPage, itemCount = _a.itemCount, page = _a.page, customPaginationHandler = _a.customPaginationHandler;
5
+ var onPageChange = _a.onPageChange, _b = _a.itemPerPage, itemPerPage = _b === void 0 ? 3 : _b, _c = _a.itemCount, itemCount = _c === void 0 ? 0 : _c, page = _a.page, _d = _a.radius, radius = _d === void 0 ? 5 : _d, _e = _a.rate, rate = _e === void 0 ? 4 : _e, customPaginationHandler = _a.customPaginationHandler;
6
6
  var setPage = useCallback(function (number) { return function () {
7
7
  if (customPaginationHandler) {
8
8
  customPaginationHandler(number, itemPerPage);
@@ -13,31 +13,27 @@ var Pagination = function (_a) {
13
13
  }
14
14
  }; }, [itemPerPage, onPageChange, customPaginationHandler]);
15
15
  var pageX = page !== null && page !== void 0 ? page : 1;
16
- var pageCount = Math.max(Math.ceil((itemCount !== null && itemCount !== void 0 ? itemCount : 0) / (itemPerPage !== null && itemPerPage !== void 0 ? itemPerPage : 3)), 1);
16
+ var pageCount = Math.max(Math.ceil(itemCount / itemPerPage), 1);
17
17
  var arrayOfPages = useMemo(function () {
18
18
  var pageNumbers = Array.from({ length: pageCount }, function (_, i) { return i + 1; });
19
19
  // first and last page are still visible
20
20
  // if number of pages is less than 6 (display all pages without dots and duplication of first and last char)
21
- if (pageCount < 6) {
21
+ if (pageCount < radius + 1) {
22
22
  return pageNumbers.slice(1, pageCount - 1);
23
- // if current page is less than 5 (display first 5 pages)
23
+ // if current page is less than radius (display first radius pages)
24
24
  }
25
- else if (pageX < 5) {
26
- return pageNumbers.slice(1, 5);
27
- // display last 5 pages
25
+ else if (pageX < radius) {
26
+ return pageNumbers.slice(1, Math.min(pageX + rate, radius));
27
+ // display last radius pages
28
28
  }
29
- else if (pageX > pageCount - 4) {
30
- return pageNumbers.slice(pageCount - 5, pageCount - 1);
31
- }
32
- else if (window.innerWidth < 768) {
33
- // display dispersion of 1 chars from current page (part between dots)
34
- return pageNumbers.slice(pageX - 2, pageX + 1);
29
+ else if (pageX > pageCount - Math.floor(radius / 2)) {
30
+ return pageNumbers.slice(pageCount - rate - 1, pageCount - 1);
35
31
  }
36
32
  else {
37
33
  // display dispersion of 2 chars from current page (part between dots)
38
- return pageNumbers.slice(pageX - 3, pageX + 2);
34
+ return pageNumbers.slice(pageX - Math.ceil(radius / 2), Math.min(pageX + Math.floor(radius / 2), pageCount - 1));
39
35
  }
40
36
  }, [pageCount, pageX]);
41
- return (_jsxs(Wrapper, { children: [_jsx(Btn, { disabled: pageX <= 1, onClick: setPage(pageX - 1), children: _jsx(GoIcon, { icon: "goLeft", isActive: pageX > 1 }) }), _jsx(PageBtn, { isCurrent: pageX === 1, onClick: setPage(1), children: 1 }), pageX >= 5 && pageCount > 6 && _jsx(DotsWrapper, { children: "..." }), arrayOfPages === null || arrayOfPages === void 0 ? void 0 : arrayOfPages.map(function (number) { return (_jsx(PageBtn, { isCurrent: pageX === number, onClick: setPage(number !== null && number !== void 0 ? number : 1), children: number }, number)); }), pageX < pageCount - 3 && pageCount > 6 && _jsx(DotsWrapper, { children: "..." }), pageCount !== 1 && (_jsx(PageBtn, { isCurrent: pageX === pageCount, onClick: setPage(pageCount), children: pageCount })), _jsx(Btn, { disabled: pageX >= pageCount, onClick: setPage(pageX + 1), children: _jsx(GoIcon, { icon: "goRight", isActive: pageX < pageCount }) })] }));
37
+ return (_jsxs(Wrapper, { children: [_jsx(Btn, { disabled: pageX <= 1, onClick: setPage(pageX - 1), children: _jsx(GoIcon, { icon: "goLeft", isActive: pageX > 1 }) }), _jsx(PageBtn, { isCurrent: pageX === 1, onClick: setPage(1), children: 1 }), arrayOfPages[0] > 2 && _jsx(DotsWrapper, { children: "..." }), arrayOfPages === null || arrayOfPages === void 0 ? void 0 : arrayOfPages.map(function (number) { return (_jsx(PageBtn, { isCurrent: pageX === number, onClick: setPage(number !== null && number !== void 0 ? number : 1), children: number }, number)); }), arrayOfPages[arrayOfPages.length - 1] < pageCount - 1 && _jsx(DotsWrapper, { children: "..." }), pageCount !== 1 && (_jsx(PageBtn, { isCurrent: pageX === pageCount, onClick: setPage(pageCount), children: pageCount })), _jsx(Btn, { disabled: pageX >= pageCount, onClick: setPage(pageX + 1), children: _jsx(GoIcon, { icon: "goRight", isActive: pageX < pageCount }) })] }));
42
38
  };
43
39
  export default Pagination;
@@ -1,3 +1,4 @@
1
1
  import Pagination from './Pagination';
2
+ export type { PaginationProps } from './Pagination';
2
3
  export { Pagination };
3
4
  export default Pagination;
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
2
1
  import type { StoryObj } from '@storybook/react';
2
+ import { PaginationProps } from '../';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ onPageChange, itemPerPage, itemCount, page, customPaginationHandler }: import("../Pagination").Props) => JSX.Element;
5
+ component: ({ onPageChange, itemPerPage, itemCount, page, radius, rate, customPaginationHandler, }: PaginationProps) => JSX.Element;
6
6
  tags: string[];
7
7
  argTypes: {};
8
8
  };
@@ -10,3 +10,4 @@ export default meta;
10
10
  type Story = StoryObj<typeof meta>;
11
11
  export declare const Default: Story;
12
12
  export declare const ManyPages: Story;
13
+ export declare const Shorter: Story;
@@ -1,3 +1,16 @@
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 } from "react/jsx-runtime";
13
+ import { useState } from 'react';
1
14
  import { Pagination } from '../';
2
15
  var meta = {
3
16
  title: 'Elements/Pagination',
@@ -6,17 +19,30 @@ var meta = {
6
19
  argTypes: {},
7
20
  };
8
21
  export default meta;
22
+ var withSetState = function (arg) {
23
+ var _a = useState(1), page = _a[0], setPage = _a[1];
24
+ return _jsx(Pagination, __assign({}, arg, { page: page, onPageChange: setPage }));
25
+ };
9
26
  export var Default = {
10
27
  args: {
11
28
  itemCount: 100,
12
29
  itemPerPage: 8,
13
- page: 1,
14
30
  },
31
+ render: withSetState,
15
32
  };
16
33
  export var ManyPages = {
17
34
  args: {
18
35
  itemCount: 1000,
19
36
  itemPerPage: 8,
20
- page: 1,
21
37
  },
38
+ render: withSetState,
39
+ };
40
+ export var Shorter = {
41
+ args: {
42
+ itemCount: 100,
43
+ itemPerPage: 8,
44
+ radius: 3,
45
+ rate: 1,
46
+ },
47
+ render: withSetState,
22
48
  };
@@ -2,8 +2,7 @@ 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
- import styled, { th } from '@xstyled/styled-components';
6
- import { keyframes } from 'styled-components';
5
+ import styled, { th, keyframes } from '@xstyled/styled-components';
7
6
  var KeyframesCircularDash = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0px;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"], ["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0px;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])));
8
7
  var KeyframesCircularRotate = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n 100% {\n transform: rotate(360deg);\n }\n"], ["\n 100% {\n transform: rotate(360deg);\n }\n"])));
9
8
  export var Svg = styled.svg(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n animation: ", " 1.4s linear infinite;\n"], ["\n width: ", "px;\n height: ", "px;\n animation: ", " 1.4s linear infinite;\n"])), function (_a) {
package/ui/index.es.js CHANGED
@@ -17519,31 +17519,33 @@ const Cce = (e, t) => Object.entries(e).map(([r, n]) => `${n} ${r}`).join(", "),
17519
17519
  }
17520
17520
  `, Vce = ({
17521
17521
  onPageChange: e,
17522
- itemPerPage: t,
17523
- itemCount: r,
17522
+ itemPerPage: t = 3,
17523
+ itemCount: r = 0,
17524
17524
  page: n,
17525
- customPaginationHandler: i
17525
+ radius: i = 5,
17526
+ rate: o = 4,
17527
+ customPaginationHandler: l
17526
17528
  }) => {
17527
- const o = Oe((f) => () => {
17528
- if (i) {
17529
- i(f, t);
17529
+ const c = Oe((g) => () => {
17530
+ if (l) {
17531
+ l(g, t);
17530
17532
  return;
17531
17533
  }
17532
- e && e(f, t);
17533
- }, [t, e, i]), l = n ?? 1, c = Math.max(Math.ceil((r ?? 0) / (t ?? 3)), 1), u = it(() => {
17534
- const f = Array.from({
17535
- length: c
17536
- }, (h, g) => g + 1);
17537
- return c < 6 ? f.slice(1, c - 1) : l < 5 ? f.slice(1, 5) : l > c - 4 ? f.slice(c - 5, c - 1) : window.innerWidth < 768 ? f.slice(l - 2, l + 1) : f.slice(l - 3, l + 2);
17538
- }, [c, l]);
17534
+ e && e(g, t);
17535
+ }, [t, e, l]), u = n ?? 1, f = Math.max(Math.ceil(r / t), 1), h = it(() => {
17536
+ const g = Array.from({
17537
+ length: f
17538
+ }, (v, m) => m + 1);
17539
+ return f < i + 1 ? g.slice(1, f - 1) : u < i ? g.slice(1, Math.min(u + o, i)) : u > f - Math.floor(i / 2) ? g.slice(f - o - 1, f - 1) : g.slice(u - Math.ceil(i / 2), Math.min(u + Math.floor(i / 2), f - 1));
17540
+ }, [f, u]);
17539
17541
  return /* @__PURE__ */ b.jsxs(Bce, { children: [
17540
- /* @__PURE__ */ b.jsx(uk, { disabled: l <= 1, onClick: o(l - 1), children: /* @__PURE__ */ b.jsx(dk, { icon: "goLeft", isActive: l > 1 }) }),
17541
- /* @__PURE__ */ b.jsx(L8, { isCurrent: l === 1, onClick: o(1), children: 1 }),
17542
- l >= 5 && c > 6 && /* @__PURE__ */ b.jsx(fk, { children: "..." }),
17543
- u == null ? void 0 : u.map((f) => /* @__PURE__ */ b.jsx(L8, { isCurrent: l === f, onClick: o(f ?? 1), children: f }, f)),
17544
- l < c - 3 && c > 6 && /* @__PURE__ */ b.jsx(fk, { children: "..." }),
17545
- c !== 1 && /* @__PURE__ */ b.jsx(L8, { isCurrent: l === c, onClick: o(c), children: c }),
17546
- /* @__PURE__ */ b.jsx(uk, { disabled: l >= c, onClick: o(l + 1), children: /* @__PURE__ */ b.jsx(dk, { icon: "goRight", isActive: l < c }) })
17542
+ /* @__PURE__ */ b.jsx(uk, { disabled: u <= 1, onClick: c(u - 1), children: /* @__PURE__ */ b.jsx(dk, { icon: "goLeft", isActive: u > 1 }) }),
17543
+ /* @__PURE__ */ b.jsx(L8, { isCurrent: u === 1, onClick: c(1), children: 1 }),
17544
+ h[0] > 2 && /* @__PURE__ */ b.jsx(fk, { children: "..." }),
17545
+ h == null ? void 0 : h.map((g) => /* @__PURE__ */ b.jsx(L8, { isCurrent: u === g, onClick: c(g ?? 1), children: g }, g)),
17546
+ h[h.length - 1] < f - 1 && /* @__PURE__ */ b.jsx(fk, { children: "..." }),
17547
+ f !== 1 && /* @__PURE__ */ b.jsx(L8, { isCurrent: u === f, onClick: c(f), children: f }),
17548
+ /* @__PURE__ */ b.jsx(uk, { disabled: u >= f, onClick: c(u + 1), children: /* @__PURE__ */ b.jsx(dk, { icon: "goRight", isActive: u < f }) })
17547
17549
  ] });
17548
17550
  }, jce = ae.div`
17549
17551
  position: relative;
@@ -37759,7 +37761,9 @@ const Cs = /* @__PURE__ */ ho(V4e), ISe = ({
37759
37761
  text-overflow: ellipsis;
37760
37762
  white-space: nowrap;
37761
37763
  `, f6e = ae(Pi)`
37762
- width: 100%;
37764
+ width: ${(e) => e.width}px;
37765
+ position: sticky;
37766
+ left: 0;
37763
37767
  `, h6e = ae.div`
37764
37768
  ${(e) => e.columnLayout != "no-scroll" && Pt`
37765
37769
  overflow-x: ${e.columnLayout == "sticky" ? "inherit" : "auto"};
@@ -46508,7 +46512,7 @@ const XAe = ae.div`
46508
46512
  ie.current = pe, I && (I.current = pe);
46509
46513
  }, []);
46510
46514
  return /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
46511
- /* @__PURE__ */ b.jsx(gt.div, { className: C || "", children: /* @__PURE__ */ b.jsxs(m6e, { columnLayout: E, isLoading: i, totalColumnsWidth: ge, floatingChildren: X && /* @__PURE__ */ b.jsx(jh, { className: "dataRow", align: "center", children: /* @__PURE__ */ b.jsx(f6e, { align: "center", className: `gridMessage ${se}`, children: X }) }), ref: ce, children: [
46515
+ /* @__PURE__ */ b.jsx(gt.div, { className: C || "", children: /* @__PURE__ */ b.jsxs(m6e, { columnLayout: E, isLoading: i, totalColumnsWidth: ge, floatingChildren: X && /* @__PURE__ */ b.jsx(jh, { className: "dataRow", align: "center", children: /* @__PURE__ */ b.jsx(f6e, { align: "center", className: `gridMessage ${se}`, width: window.innerWidth, children: X }) }), ref: ce, children: [
46512
46516
  /* @__PURE__ */ b.jsxs("div", { className: "gridHead", children: [
46513
46517
  c.find((pe) => pe.group) && /* @__PURE__ */ b.jsx(y6e, { actionColumn: u, columns: S, displayColumnsWidth: oe, groups: te }),
46514
46518
  /* @__PURE__ */ b.jsx(B9e, { columns: S, actionColumn: u, onAddSort: he, columnLayout: E, sortingValues: V, displayColumnsWidth: oe, handleResizeDrag: q, groups: te, handleDragEnd: t }),
@@ -50855,7 +50859,7 @@ const KCe = ki.div`
50855
50859
  /* @__PURE__ */ b.jsx(sM, { children: /* @__PURE__ */ b.jsxs(aCe, { ref: I, isFixed: !!S, children: [
50856
50860
  o && /* @__PURE__ */ b.jsx(YCe, { rowsData: w, onBatchAction: i, gridActions: v, gridSelectors: m, actionColumn: E, processCheckedValues: o, processCheckedValuesTitle: l }),
50857
50861
  /* @__PURE__ */ b.jsxs(gt.div, { display: "flex", justifyContent: "center", alignItems: "center", className: "paginatorWrapper", w: "100%", h: window.innerWidth > 1204 ? "60px" : "32px", children: [
50858
- /* @__PURE__ */ b.jsx(Vce, { page: m == null ? void 0 : m.page, itemCount: g == null ? void 0 : g.totalRowsCount, itemPerPage: (m == null ? void 0 : m.rowsPerPage) || 10, onPageChange: v == null ? void 0 : v.setPage, customPaginationHandler: h }),
50862
+ /* @__PURE__ */ b.jsx(Vce, { page: m == null ? void 0 : m.page, itemCount: g == null ? void 0 : g.totalRowsCount, itemPerPage: (m == null ? void 0 : m.rowsPerPage) || 10, onPageChange: v == null ? void 0 : v.setPage, customPaginationHandler: h, radius: window.innerWidth < 768 ? 3 : 5, rate: window.innerWidth < 768 ? 1 : 4 }),
50859
50863
  /* @__PURE__ */ b.jsx(qCe, { gridActions: v, gridSelectors: m, customPaginationHandler: h })
50860
50864
  ] })
50861
50865
  ] }) }),
package/ui/index.umd.js CHANGED
@@ -1960,7 +1960,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1960
1960
  &:hover {
1961
1961
  color: blue2;
1962
1962
  }
1963
- `,nN=({onPageChange:e,itemPerPage:t,itemCount:r,page:n,customPaginationHandler:i})=>{const o=I.useCallback(f=>()=>{if(i){i(f,t);return}e&&e(f,t)},[t,e,i]),l=n??1,u=Math.max(Math.ceil((r??0)/(t??3)),1),c=I.useMemo(()=>{const f=Array.from({length:u},(h,g)=>g+1);return u<6?f.slice(1,u-1):l<5?f.slice(1,5):l>u-4?f.slice(u-5,u-1):window.innerWidth<768?f.slice(l-2,l+1):f.slice(l-3,l+2)},[u,l]);return b.jsxs(Mce,{children:[b.jsx(eN,{disabled:l<=1,onClick:o(l-1),children:b.jsx(tN,{icon:"goLeft",isActive:l>1})}),b.jsx(jb,{isCurrent:l===1,onClick:o(1),children:1}),l>=5&&u>6&&b.jsx(rN,{children:"..."}),c==null?void 0:c.map(f=>b.jsx(jb,{isCurrent:l===f,onClick:o(f??1),children:f},f)),l<u-3&&u>6&&b.jsx(rN,{children:"..."}),u!==1&&b.jsx(jb,{isCurrent:l===u,onClick:o(u),children:u}),b.jsx(eN,{disabled:l>=u,onClick:o(l+1),children:b.jsx(tN,{icon:"goRight",isActive:l<u})})]})},Nce=oe.div`
1963
+ `,nN=({onPageChange:e,itemPerPage:t=3,itemCount:r=0,page:n,radius:i=5,rate:o=4,customPaginationHandler:l})=>{const u=I.useCallback(g=>()=>{if(l){l(g,t);return}e&&e(g,t)},[t,e,l]),c=n??1,f=Math.max(Math.ceil(r/t),1),h=I.useMemo(()=>{const g=Array.from({length:f},(v,m)=>m+1);return f<i+1?g.slice(1,f-1):c<i?g.slice(1,Math.min(c+o,i)):c>f-Math.floor(i/2)?g.slice(f-o-1,f-1):g.slice(c-Math.ceil(i/2),Math.min(c+Math.floor(i/2),f-1))},[f,c]);return b.jsxs(Mce,{children:[b.jsx(eN,{disabled:c<=1,onClick:u(c-1),children:b.jsx(tN,{icon:"goLeft",isActive:c>1})}),b.jsx(jb,{isCurrent:c===1,onClick:u(1),children:1}),h[0]>2&&b.jsx(rN,{children:"..."}),h==null?void 0:h.map(g=>b.jsx(jb,{isCurrent:c===g,onClick:u(g??1),children:g},g)),h[h.length-1]<f-1&&b.jsx(rN,{children:"..."}),f!==1&&b.jsx(jb,{isCurrent:c===f,onClick:u(f),children:f}),b.jsx(eN,{disabled:c>=f,onClick:u(c+1),children:b.jsx(tN,{icon:"goRight",isActive:c<f})})]})},Nce=oe.div`
1964
1964
  position: relative;
1965
1965
  display: flex;
1966
1966
  width: 100%;
@@ -3083,7 +3083,9 @@ function print() { __p += __j.call(arguments, '') }
3083
3083
  text-overflow: ellipsis;
3084
3084
  white-space: nowrap;
3085
3085
  `,f5e=oe(fi)`
3086
- width: 100%;
3086
+ width: ${e=>e.width}px;
3087
+ position: sticky;
3088
+ left: 0;
3087
3089
  `,h5e=oe.div`
3088
3090
  ${e=>e.columnLayout!="no-scroll"&&Et`
3089
3091
  overflow-x: ${e.columnLayout=="sticky"?"inherit":"auto"};
@@ -3406,7 +3408,7 @@ Avoid returning a new reference inside your input selector, e.g.
3406
3408
  > :nth-child(2) {
3407
3409
  transform: ${({isOpen:e})=>e?"rotate(45deg) translate(-1px, -1px)":"rotate(90deg) translate(-2px, 0)"};
3408
3410
  }
3409
- `,KCe=({options:e,onSelect:t,onClick:r})=>{const[n,i]=I.useState(!1),o=I.useRef(null),l=I.useCallback(()=>i(!1),[]),u=I.useCallback(()=>{e&&(e==null?void 0:e.length)>0&&i(h=>!h),r==null||r()},[r,e]),c=I.useCallback(h=>{i(!1),t==null||t(h.value)},[t]),f=I.useMemo(()=>e==null?void 0:e.map(h=>({title:h.label,onClick:()=>c(h),link:"#",name:h.name})),[c,e]);return b.jsx(JCe,{children:b.jsxs(qCe,{ref:o,onClick:u,children:[b.jsxs(QCe,{isOpen:n,children:[b.jsx("span",{className:"line"}),b.jsx("span",{className:"line"})]}),n&&b.jsx(y9,{parentRef:o,onClose:l,placement:"left-end",children:b.jsx(XCe,{showMenu:!0,items:f})})]})})},$Ce={outline:"none"},rv=(...e)=>null,exe=Xn.uxState,txe={},rxe=({filters:e,handleDragEnd:t,gridSelectors:r,gridActions:n,isLoading:i,rowsData:o,hasColouredRows:l,columnsDefinitions:u,actionColumnDefinition:c,allowRowSelect:f,allowRowSelectOnAction:h,onRowAction:g,onRowEditClick:v,onRowReadClick:m,onRowClick:w,columnLayout:E="normal",displayColumnsDefinitions:S,className:C,gridRef:k,minColumnWidth:P,errorMessage:T,floatingButtonProps:D})=>{const{uxState:B=exe,columnConfig:F,columnsWidth:W=txe,columnsWidthVariant:G,page:J=1,filter:R,sorting:j,rowsPerPage:V=10}=r,{clearUxState:te,handleUxChange:Y,addFilter:ie=rv,addSorting:pe=rv,setColumnWidth:be=rv,setColumnsOrder:fe=rv}=n,Z=Vwe(o,B,Y);Fwe(o,B,te);let q,le="info";i&&(q=b.jsx(Tr,{id:"dataGrid.status.loadingData",message:"... loading data ..."})),!i&&(!o||o.length<1)&&(q=b.jsx(Tr,{id:"dataGrid.status.noDataFound",message:"No data found."})),!i&&T&&(q=T,le="error");const{displayColumnsWidth:se,totalColumnsWidth:ve,gridBoxRef:ae,handleResizeDrag:K}=Uwe(S,W,G,be,E,P),re=I.useMemo(()=>x6e(S),[S]),de=I.useCallback(ge=>{ae.current=ge,k&&(k.current=ge)},[]);return b.jsxs(b.Fragment,{children:[b.jsx(dt.div,{className:C||"",children:b.jsxs(m5e,{columnLayout:E,isLoading:i,totalColumnsWidth:ve,floatingChildren:q&&b.jsx(E1,{className:"dataRow",align:"center",children:b.jsx(f5e,{align:"center",className:`gridMessage ${le}`,children:q})}),ref:de,children:[b.jsxs("div",{className:"gridHead",children:[u.find(ge=>ge.group)&&b.jsx(y5e,{actionColumn:c,columns:S,displayColumnsWidth:se,groups:re}),b.jsx(Bwe,{columns:S,actionColumn:c,onAddSort:pe,columnLayout:E,sortingValues:j,displayColumnsWidth:se,handleResizeDrag:K,groups:re,handleDragEnd:t}),u.find(ge=>ge.filtering)&&b.jsx(F5e,{filters:e,columns:S,actionColumn:c,onChange:ie,filterValues:R,displayColumnsWidth:se,groups:re,rowsData:o,uxState:B,handleUxChange:Y})]}),b.jsx("div",{className:"body flx_1",style:$Ce,tabIndex:-1,onKeyDown:Z,children:!i&&o&&S&&o.map((ge,Te)=>{const Ce=V*J+(Te+1)-V;return b.jsx(Z5e,{rowData:ge,rowIndex:Ce,uxState:B,isEven:l&&(Te+1)%2===0,allowRowSelect:f,allowRowSelectOnAction:h,onRowAction:g,onUxChange:Y,onRowEditClick:v,onRowReadClick:m,onRowClick:w,columns:S,actionColumn:c,displayColumnsWidth:se,groups:re},ge.id)})})]})}),D&&b.jsx(KCe,{...D})]})},nxe=oe(dt.div)`
3411
+ `,KCe=({options:e,onSelect:t,onClick:r})=>{const[n,i]=I.useState(!1),o=I.useRef(null),l=I.useCallback(()=>i(!1),[]),u=I.useCallback(()=>{e&&(e==null?void 0:e.length)>0&&i(h=>!h),r==null||r()},[r,e]),c=I.useCallback(h=>{i(!1),t==null||t(h.value)},[t]),f=I.useMemo(()=>e==null?void 0:e.map(h=>({title:h.label,onClick:()=>c(h),link:"#",name:h.name})),[c,e]);return b.jsx(JCe,{children:b.jsxs(qCe,{ref:o,onClick:u,children:[b.jsxs(QCe,{isOpen:n,children:[b.jsx("span",{className:"line"}),b.jsx("span",{className:"line"})]}),n&&b.jsx(y9,{parentRef:o,onClose:l,placement:"left-end",children:b.jsx(XCe,{showMenu:!0,items:f})})]})})},$Ce={outline:"none"},rv=(...e)=>null,exe=Xn.uxState,txe={},rxe=({filters:e,handleDragEnd:t,gridSelectors:r,gridActions:n,isLoading:i,rowsData:o,hasColouredRows:l,columnsDefinitions:u,actionColumnDefinition:c,allowRowSelect:f,allowRowSelectOnAction:h,onRowAction:g,onRowEditClick:v,onRowReadClick:m,onRowClick:w,columnLayout:E="normal",displayColumnsDefinitions:S,className:C,gridRef:k,minColumnWidth:P,errorMessage:T,floatingButtonProps:D})=>{const{uxState:B=exe,columnConfig:F,columnsWidth:W=txe,columnsWidthVariant:G,page:J=1,filter:R,sorting:j,rowsPerPage:V=10}=r,{clearUxState:te,handleUxChange:Y,addFilter:ie=rv,addSorting:pe=rv,setColumnWidth:be=rv,setColumnsOrder:fe=rv}=n,Z=Vwe(o,B,Y);Fwe(o,B,te);let q,le="info";i&&(q=b.jsx(Tr,{id:"dataGrid.status.loadingData",message:"... loading data ..."})),!i&&(!o||o.length<1)&&(q=b.jsx(Tr,{id:"dataGrid.status.noDataFound",message:"No data found."})),!i&&T&&(q=T,le="error");const{displayColumnsWidth:se,totalColumnsWidth:ve,gridBoxRef:ae,handleResizeDrag:K}=Uwe(S,W,G,be,E,P),re=I.useMemo(()=>x6e(S),[S]),de=I.useCallback(ge=>{ae.current=ge,k&&(k.current=ge)},[]);return b.jsxs(b.Fragment,{children:[b.jsx(dt.div,{className:C||"",children:b.jsxs(m5e,{columnLayout:E,isLoading:i,totalColumnsWidth:ve,floatingChildren:q&&b.jsx(E1,{className:"dataRow",align:"center",children:b.jsx(f5e,{align:"center",className:`gridMessage ${le}`,width:window.innerWidth,children:q})}),ref:de,children:[b.jsxs("div",{className:"gridHead",children:[u.find(ge=>ge.group)&&b.jsx(y5e,{actionColumn:c,columns:S,displayColumnsWidth:se,groups:re}),b.jsx(Bwe,{columns:S,actionColumn:c,onAddSort:pe,columnLayout:E,sortingValues:j,displayColumnsWidth:se,handleResizeDrag:K,groups:re,handleDragEnd:t}),u.find(ge=>ge.filtering)&&b.jsx(F5e,{filters:e,columns:S,actionColumn:c,onChange:ie,filterValues:R,displayColumnsWidth:se,groups:re,rowsData:o,uxState:B,handleUxChange:Y})]}),b.jsx("div",{className:"body flx_1",style:$Ce,tabIndex:-1,onKeyDown:Z,children:!i&&o&&S&&o.map((ge,Te)=>{const Ce=V*J+(Te+1)-V;return b.jsx(Z5e,{rowData:ge,rowIndex:Ce,uxState:B,isEven:l&&(Te+1)%2===0,allowRowSelect:f,allowRowSelectOnAction:h,onRowAction:g,onUxChange:Y,onRowEditClick:v,onRowReadClick:m,onRowClick:w,columns:S,actionColumn:c,displayColumnsWidth:se,groups:re},ge.id)})})]})}),D&&b.jsx(KCe,{...D})]})},nxe=oe(dt.div)`
3410
3412
  padding-bottom: 11px;
3411
3413
  padding-top: 10px;
3412
3414
  position: ${({isFixed:e})=>e?"fixed":"relative"};
@@ -3789,7 +3791,7 @@ function print() { __p += __j.call(arguments, '') }
3789
3791
  border: 1px solid ${ne.color("lightGray6")};
3790
3792
  border-radius: 8px;
3791
3793
  margin-bottom: 15px;
3792
- `,Kxe=({column:e,columnsConfigValues:t,setColumnsConfigOptions:r,searchedValue:n,innerRef:i,draggableProps:o,dragHandleProps:l})=>{var m,w,E,S;const[u,c]=I.useState((t==null?void 0:t.includes(e.name))??!1),f=I.useMemo(()=>({...o==null?void 0:o.style}),[o]),h=qxe.isObject(e==null?void 0:e.title)&&"props"in e.title&&((m=e.title)==null?void 0:m.props)&&pt._({id:(E=(w=e.title)==null?void 0:w.props)==null?void 0:E.id,message:(S=e.title)==null?void 0:S.props.message}),g=h&&h.toLocaleLowerCase().includes(n.toLocaleLowerCase()),v=I.useCallback(()=>{r(C=>({...C,[e.name]:u?{isHidden:!0}:{}})),c(!u)},[r,u,e.name]);return b.jsxs(Qxe,{$isVisible:g,...o,...l,ref:i,style:f,children:[b.jsxs(dt.div,{display:"flex",alignItems:"center",children:[b.jsx(dt.div,{w:"28px",children:b.jsx(Zf,{name:"",variant:"grid",onChange:v,spaceAround:!1,checked:u})}),b.jsx(Mp,{variant:"medium",ml:"8px",children:h})]}),b.jsx(tO,{})]})},$xe=({columns:e,columnsConfigValues:t,setColumnsConfigOptions:r,handleDragEnd:n})=>{const[i,o]=I.useState(""),l=I.useCallback(c=>{o(c.target.value)},[o]),u=I.useCallback(()=>{o("")},[o]);return b.jsxs(dt.div,{children:[b.jsx(tc,{icon:"search",type:"text",value:i,placeholder:pt._({id:"manageColumn.searchPlaceholder",message:"Find column..."}),onChange:l,onClear:u,variant:"gray"}),b.jsx(NV,{onDragEnd:n,children:b.jsx(U7,{droppableId:"droppable",direction:"vertical",children:c=>b.jsx(dt.div,{h:"400px",overflowY:"scroll",mt:"20px",ref:c.innerRef,...c.droppableProps,children:e==null?void 0:e.map((f,h)=>b.jsx(YV,{draggableId:f.name,index:h,isDragDisabled:!!i,children:(g,v)=>b.jsx(Kxe,{column:f,innerRef:g.innerRef,columnsConfigValues:t,setColumnsConfigOptions:r,searchedValue:i,draggableProps:g.draggableProps,dragHandleProps:g.dragHandleProps},h)},f.name))})})})]})},eEe=e=>{const{optimizeFilters:t=!1,extraControlButtons:r,eshopSelect:n,onBatchAction:i,processCheckedValues:o,processCheckedValuesTitle:l,hideControlButtons:u,floatingButtonProps:c,queryRowsParam:f,customPaginationHandler:h,...g}=e,{gridActions:v,gridSelectors:m,rowsData:w,actionColumnDefinition:E}=g,{gridHeight:S,gridRef:C,paginationRef:k}=Qhe();I.useEffect(()=>{var pe;if(!f&&S&&S>0){const be=Math.max(Math.floor(S/S6e-2),E6e);be&&((pe=v.setRowsPerPage)==null||pe.call(v,be))}},[S,v,f]);const P=o5e(g),T=I.useMemo(()=>I6e(t),[t]),D=P.columnsDefinitions,{onOpen:B,isOpen:F,onClose:W}=ab(),{columnsConfigValues:G,setColumnsConfigOptions:J,onConfirmForm:R,resetColumnConfig:j,handleDragEnd:V,onCloseForm:te,displayColumnsDefinitions:Y,manageColumnsFormDefinitions:ie}=s5e({columns:D,gridActions:v,gridSelectors:m,onClose:W});return b.jsxs(ixe,{children:[b.jsxs(axe,{children:[b.jsx(Pj,{children:b.jsxs(oxe,{className:"buttonsStrip",children:[!u&&b.jsx(bxe,{extraControlButtons:r,gridActions:v,gridSelectors:m,eshopSelect:n}),b.jsx(sxe,{type:"button",sizing:"iconLg",appearance:"ghost",icon:b.jsx($k,{}),onClick:B,children:b.jsx(Mp,{variant:"semiBold",children:b.jsx(Tr,{id:"manageColumn.title",message:"Manage column"})})})]})}),b.jsx(lxe,{...g,...P,filters:T,gridRef:C,height:S,floatingButtonProps:c,handleDragEnd:V(!1),displayColumnsDefinitions:Y,hasColouredRows:!0})]}),b.jsx(Pj,{children:b.jsxs(nxe,{ref:k,isFixed:!!S,children:[o&&b.jsx(Gxe,{rowsData:w,onBatchAction:i,gridActions:v,gridSelectors:m,actionColumn:E,processCheckedValues:o,processCheckedValuesTitle:l}),b.jsxs(dt.div,{display:"flex",justifyContent:"center",alignItems:"center",className:"paginatorWrapper",w:"100%",h:window.innerWidth>1204?"60px":"32px",children:[b.jsx(nN,{page:m==null?void 0:m.page,itemCount:g==null?void 0:g.totalRowsCount,itemPerPage:(m==null?void 0:m.rowsPerPage)||10,onPageChange:v==null?void 0:v.setPage,customPaginationHandler:h}),b.jsx(Xxe,{gridActions:v,gridSelectors:m,customPaginationHandler:h})]})]})}),F&&b.jsx(ib,{title:b.jsx(Tr,{id:"manageColumn.title",message:"Manage columns"}),onClose:te,onCancel:te,onExtraAction:j,onConfirm:R,width:"auto",minWidth:"350px",hasFooter:!0,extraActionLabel:b.jsx(Tr,{id:"dataGrid.buttonClearConfig",message:"Reset config"}),cancelLabel:b.jsx(Tr,{id:"form.buttonCancel",message:"Cancel"}),confirmLabel:b.jsx(Tr,{id:"form.buttonConfirm",message:"Confirm"}),children:b.jsx($xe,{columns:ie,columnsConfigValues:G,setColumnsConfigOptions:J,handleDragEnd:V(!0)})})]})};var w9={};/**
3794
+ `,Kxe=({column:e,columnsConfigValues:t,setColumnsConfigOptions:r,searchedValue:n,innerRef:i,draggableProps:o,dragHandleProps:l})=>{var m,w,E,S;const[u,c]=I.useState((t==null?void 0:t.includes(e.name))??!1),f=I.useMemo(()=>({...o==null?void 0:o.style}),[o]),h=qxe.isObject(e==null?void 0:e.title)&&"props"in e.title&&((m=e.title)==null?void 0:m.props)&&pt._({id:(E=(w=e.title)==null?void 0:w.props)==null?void 0:E.id,message:(S=e.title)==null?void 0:S.props.message}),g=h&&h.toLocaleLowerCase().includes(n.toLocaleLowerCase()),v=I.useCallback(()=>{r(C=>({...C,[e.name]:u?{isHidden:!0}:{}})),c(!u)},[r,u,e.name]);return b.jsxs(Qxe,{$isVisible:g,...o,...l,ref:i,style:f,children:[b.jsxs(dt.div,{display:"flex",alignItems:"center",children:[b.jsx(dt.div,{w:"28px",children:b.jsx(Zf,{name:"",variant:"grid",onChange:v,spaceAround:!1,checked:u})}),b.jsx(Mp,{variant:"medium",ml:"8px",children:h})]}),b.jsx(tO,{})]})},$xe=({columns:e,columnsConfigValues:t,setColumnsConfigOptions:r,handleDragEnd:n})=>{const[i,o]=I.useState(""),l=I.useCallback(c=>{o(c.target.value)},[o]),u=I.useCallback(()=>{o("")},[o]);return b.jsxs(dt.div,{children:[b.jsx(tc,{icon:"search",type:"text",value:i,placeholder:pt._({id:"manageColumn.searchPlaceholder",message:"Find column..."}),onChange:l,onClear:u,variant:"gray"}),b.jsx(NV,{onDragEnd:n,children:b.jsx(U7,{droppableId:"droppable",direction:"vertical",children:c=>b.jsx(dt.div,{h:"400px",overflowY:"scroll",mt:"20px",ref:c.innerRef,...c.droppableProps,children:e==null?void 0:e.map((f,h)=>b.jsx(YV,{draggableId:f.name,index:h,isDragDisabled:!!i,children:(g,v)=>b.jsx(Kxe,{column:f,innerRef:g.innerRef,columnsConfigValues:t,setColumnsConfigOptions:r,searchedValue:i,draggableProps:g.draggableProps,dragHandleProps:g.dragHandleProps},h)},f.name))})})})]})},eEe=e=>{const{optimizeFilters:t=!1,extraControlButtons:r,eshopSelect:n,onBatchAction:i,processCheckedValues:o,processCheckedValuesTitle:l,hideControlButtons:u,floatingButtonProps:c,queryRowsParam:f,customPaginationHandler:h,...g}=e,{gridActions:v,gridSelectors:m,rowsData:w,actionColumnDefinition:E}=g,{gridHeight:S,gridRef:C,paginationRef:k}=Qhe();I.useEffect(()=>{var pe;if(!f&&S&&S>0){const be=Math.max(Math.floor(S/S6e-2),E6e);be&&((pe=v.setRowsPerPage)==null||pe.call(v,be))}},[S,v,f]);const P=o5e(g),T=I.useMemo(()=>I6e(t),[t]),D=P.columnsDefinitions,{onOpen:B,isOpen:F,onClose:W}=ab(),{columnsConfigValues:G,setColumnsConfigOptions:J,onConfirmForm:R,resetColumnConfig:j,handleDragEnd:V,onCloseForm:te,displayColumnsDefinitions:Y,manageColumnsFormDefinitions:ie}=s5e({columns:D,gridActions:v,gridSelectors:m,onClose:W});return b.jsxs(ixe,{children:[b.jsxs(axe,{children:[b.jsx(Pj,{children:b.jsxs(oxe,{className:"buttonsStrip",children:[!u&&b.jsx(bxe,{extraControlButtons:r,gridActions:v,gridSelectors:m,eshopSelect:n}),b.jsx(sxe,{type:"button",sizing:"iconLg",appearance:"ghost",icon:b.jsx($k,{}),onClick:B,children:b.jsx(Mp,{variant:"semiBold",children:b.jsx(Tr,{id:"manageColumn.title",message:"Manage column"})})})]})}),b.jsx(lxe,{...g,...P,filters:T,gridRef:C,height:S,floatingButtonProps:c,handleDragEnd:V(!1),displayColumnsDefinitions:Y,hasColouredRows:!0})]}),b.jsx(Pj,{children:b.jsxs(nxe,{ref:k,isFixed:!!S,children:[o&&b.jsx(Gxe,{rowsData:w,onBatchAction:i,gridActions:v,gridSelectors:m,actionColumn:E,processCheckedValues:o,processCheckedValuesTitle:l}),b.jsxs(dt.div,{display:"flex",justifyContent:"center",alignItems:"center",className:"paginatorWrapper",w:"100%",h:window.innerWidth>1204?"60px":"32px",children:[b.jsx(nN,{page:m==null?void 0:m.page,itemCount:g==null?void 0:g.totalRowsCount,itemPerPage:(m==null?void 0:m.rowsPerPage)||10,onPageChange:v==null?void 0:v.setPage,customPaginationHandler:h,radius:window.innerWidth<768?3:5,rate:window.innerWidth<768?1:4}),b.jsx(Xxe,{gridActions:v,gridSelectors:m,customPaginationHandler:h})]})]})}),F&&b.jsx(ib,{title:b.jsx(Tr,{id:"manageColumn.title",message:"Manage columns"}),onClose:te,onCancel:te,onExtraAction:j,onConfirm:R,width:"auto",minWidth:"350px",hasFooter:!0,extraActionLabel:b.jsx(Tr,{id:"dataGrid.buttonClearConfig",message:"Reset config"}),cancelLabel:b.jsx(Tr,{id:"form.buttonCancel",message:"Cancel"}),confirmLabel:b.jsx(Tr,{id:"form.buttonConfirm",message:"Confirm"}),children:b.jsx($xe,{columns:ie,columnsConfigValues:G,setColumnsConfigOptions:J,handleDragEnd:V(!0)})})]})};var w9={};/**
3793
3795
  * @license React
3794
3796
  * use-sync-external-store-with-selector.production.min.js
3795
3797
  *