@mailstep/design-system 0.6.12 → 0.6.14

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.12",
3
+ "version": "0.6.14",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -40,7 +40,7 @@ import ManageColumnForm from './components/ManageColumnForm';
40
40
  import { Trans } from '@lingui/react';
41
41
  import { Settings2 } from '../../Elements/Icon/icons/Settings2';
42
42
  var StyledCommonGrid = function (props) {
43
- var _a = props.optimizeFilters, optimizeFilters = _a === void 0 ? false : _a, extraControlButtons = props.extraControlButtons, eshopSelect = props.eshopSelect, onBatchAction = props.onBatchAction, processCheckedValues = props.processCheckedValues, processCheckedValuesTitle = props.processCheckedValuesTitle, hideControlButtons = props.hideControlButtons, floatingButtonProps = props.floatingButtonProps, queryRowsParam = props.queryRowsParam, customPaginationHandler = props.customPaginationHandler, passDownProps = __rest(props, ["optimizeFilters", "extraControlButtons", "eshopSelect", "onBatchAction", "processCheckedValues", "processCheckedValuesTitle", "hideControlButtons", "floatingButtonProps", "queryRowsParam", "customPaginationHandler"]);
43
+ var _a = props.optimizeFilters, optimizeFilters = _a === void 0 ? false : _a, extraControlButtons = props.extraControlButtons, eshopSelect = props.eshopSelect, onBatchAction = props.onBatchAction, processCheckedValues = props.processCheckedValues, processCheckedValuesTitle = props.processCheckedValuesTitle, hideControlButtons = props.hideControlButtons, quickFilter = props.quickFilter, floatingButtonProps = props.floatingButtonProps, queryRowsParam = props.queryRowsParam, customPaginationHandler = props.customPaginationHandler, passDownProps = __rest(props, ["optimizeFilters", "extraControlButtons", "eshopSelect", "onBatchAction", "processCheckedValues", "processCheckedValuesTitle", "hideControlButtons", "quickFilter", "floatingButtonProps", "queryRowsParam", "customPaginationHandler"]);
44
44
  var gridActions = passDownProps.gridActions, gridSelectors = passDownProps.gridSelectors, rowsData = passDownProps.rowsData, actionColumnDefinition = passDownProps.actionColumnDefinition;
45
45
  var _b = useGetGridHeight(), gridHeight = _b.gridHeight, gridRef = _b.gridRef, paginationRef = _b.paginationRef;
46
46
  useEffect(function () {
@@ -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", variant: "ghost", appearance: "primary", iconLeft: _jsx(Settings2, {}), onClick: openManageColumnForm, children: _jsx(H6, { variant: "semiBold", mt: 0, mb: 0, 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) }) }))] }));
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, quickFilter: quickFilter, displayColumnsDefinitions: displayColumnsDefinitions, filters: filters })), _jsx(StyledColumnButton, { type: "button", variant: "ghost", appearance: "primary", iconLeft: _jsx(Settings2, {}), onClick: openManageColumnForm, children: _jsx(H6, { variant: "semiBold", mt: 0, mb: 0, 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;
@@ -1,4 +1,4 @@
1
- import { CommonGridProps, GridActionsType, GridSelectorsType } from '../../types';
1
+ import { CommonGridProps, GridActionsType, GridSelectorsType, ColumnDefinition, FiltersConfig } from '../../types';
2
2
  export declare const Row: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
3
3
  type Props = {
4
4
  columns?: CommonGridProps['columnsDefinitions'];
@@ -6,6 +6,9 @@ type Props = {
6
6
  eshopSelect: CommonGridProps['extraControlButtons'];
7
7
  gridActions: GridActionsType;
8
8
  gridSelectors: GridSelectorsType;
9
+ quickFilter?: CommonGridProps['quickFilter'];
10
+ displayColumnsDefinitions?: ColumnDefinition<string>[];
11
+ filters?: FiltersConfig;
9
12
  };
10
- declare const ControlButtons: ({ extraControlButtons, eshopSelect, gridActions, gridSelectors }: Props) => JSX.Element;
13
+ declare const ControlButtons: ({ extraControlButtons, eshopSelect, gridActions, gridSelectors, quickFilter, displayColumnsDefinitions, filters, }: Props) => JSX.Element;
11
14
  export default ControlButtons;
@@ -3,18 +3,63 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ import { useCallback, useEffect, useState } from 'react';
6
7
  import styled, { x } from '@xstyled/styled-components';
7
8
  import { Trans } from '@lingui/react';
8
9
  import ExtraControlButtons from '../ExtraControlButtons';
9
- import { ExtraControlButtonPosition } from '../../types';
10
+ import { ExtraControlButtonPosition, } from '../../types';
10
11
  import Button from '../../../../Elements/Button/Button';
12
+ import { i18n } from '@lingui/core';
13
+ import { useAddFilter } from '../../hooks/useAddFilter';
14
+ import { createFilterType } from '../../utils';
15
+ import { isObject } from 'lodash';
16
+ import QuickFilter from '../QuickFilter';
11
17
  export var Row = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n position: sticky;\n left: 20px;\n"], ["\n display: flex;\n position: sticky;\n left: 20px;\n"])));
18
+ var defaultVoidFunction = function () {
19
+ var args = [];
20
+ for (var _i = 0; _i < arguments.length; _i++) {
21
+ args[_i] = arguments[_i];
22
+ }
23
+ return null;
24
+ };
12
25
  var ControlButtons = function (_a) {
13
- var extraControlButtons = _a.extraControlButtons, eshopSelect = _a.eshopSelect, gridActions = _a.gridActions, gridSelectors = _a.gridSelectors;
14
- var resetFilters = gridActions.resetFilters;
26
+ var _b, _c, _d, _e, _f, _g;
27
+ var extraControlButtons = _a.extraControlButtons, eshopSelect = _a.eshopSelect, gridActions = _a.gridActions, gridSelectors = _a.gridSelectors, _h = _a.quickFilter, quickFilter = _h === void 0 ? '' : _h, displayColumnsDefinitions = _a.displayColumnsDefinitions, filters = _a.filters;
28
+ var resetFilters = gridActions.resetFilters, _j = gridActions.addFilter, addFilter = _j === void 0 ? defaultVoidFunction : _j;
15
29
  var filter = gridSelectors.filter;
30
+ var _k = useState(''), searchedValue = _k[0], setSearchedValue = _k[1];
31
+ var handleAddFilter = useAddFilter(addFilter);
32
+ var quickFilterValues = (_b = filter === null || filter === void 0 ? void 0 : filter[quickFilter]) === null || _b === void 0 ? void 0 : _b.value;
33
+ var searchedColumnsDefinitions = (displayColumnsDefinitions === null || displayColumnsDefinitions === void 0 ? void 0 : displayColumnsDefinitions.find(function (item) { return item.name === quickFilter; })) || null;
34
+ var filterType = createFilterType(searchedColumnsDefinitions || {});
35
+ var filtersDefaultComparator = (_c = filters === null || filters === void 0 ? void 0 : filters[filterType].defaultExtraProps) === null || _c === void 0 ? void 0 : _c.defaultComparator;
36
+ var searchComparator = (quickFilterValues && quickFilterValues.comparator) || filtersDefaultComparator;
16
37
  var filtersOn = !!filter && Object.values(filter).some(function (item) { var _a; return ((_a = item.value) === null || _a === void 0 ? void 0 : _a.value) !== '' && item.value !== ''; });
17
- return (_jsxs(Row, { children: [eshopSelect && (_jsx(x.div, { children: _jsx(ExtraControlButtons, { extraControlButtons: eshopSelect, targetPosition: ExtraControlButtonPosition.TopRight }) })), _jsx(ExtraControlButtons, { extraControlButtons: extraControlButtons, targetPosition: ExtraControlButtonPosition.TopLeft }), _jsx(x.div, { children: filtersOn && (_jsx(Button, { type: "button", onClick: resetFilters, variant: "default", appearance: "secondary", "data-cy": "resetFiltersBtn", children: _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }) })) })] }));
38
+ useEffect(function () {
39
+ quickFilterValues && setSearchedValue(quickFilterValues.value);
40
+ }, [quickFilterValues, quickFilter]);
41
+ var onChangeInputValue = useCallback(function (e) {
42
+ setSearchedValue(e.target.value);
43
+ var value = {
44
+ comparator: searchComparator,
45
+ value: e.target.value,
46
+ };
47
+ searchedColumnsDefinitions && handleAddFilter(value, searchedColumnsDefinitions);
48
+ }, [setSearchedValue, searchComparator, handleAddFilter, searchedColumnsDefinitions]);
49
+ var onResetFilters = useCallback(function () {
50
+ resetFilters === null || resetFilters === void 0 ? void 0 : resetFilters();
51
+ setSearchedValue === null || setSearchedValue === void 0 ? void 0 : setSearchedValue('');
52
+ }, []);
53
+ var translatedValue = searchedColumnsDefinitions &&
54
+ isObject(searchedColumnsDefinitions === null || searchedColumnsDefinitions === void 0 ? void 0 : searchedColumnsDefinitions.title) &&
55
+ 'props' in (searchedColumnsDefinitions === null || searchedColumnsDefinitions === void 0 ? void 0 : searchedColumnsDefinitions.title) &&
56
+ ((_d = searchedColumnsDefinitions.title) === null || _d === void 0 ? void 0 : _d.props) &&
57
+ i18n._({ id: (_f = (_e = searchedColumnsDefinitions.title) === null || _e === void 0 ? void 0 : _e.props) === null || _f === void 0 ? void 0 : _f.id, message: (_g = searchedColumnsDefinitions.title) === null || _g === void 0 ? void 0 : _g.props.message });
58
+ return (_jsxs(Row, { children: [quickFilter && (_jsx(QuickFilter, { searchedValue: searchedValue, placeholderText: i18n._({
59
+ id: 'controlButtons.searchPlaceholder',
60
+ message: "Search ".concat(translatedValue, " ..."),
61
+ values: { translatedValue: translatedValue },
62
+ }), onChange: onChangeInputValue })), eshopSelect && (_jsx(x.div, { children: _jsx(ExtraControlButtons, { extraControlButtons: eshopSelect, targetPosition: ExtraControlButtonPosition.TopRight }) })), _jsx(ExtraControlButtons, { extraControlButtons: extraControlButtons, targetPosition: ExtraControlButtonPosition.TopLeft }), _jsx(x.div, { children: filtersOn && (_jsx(Button, { type: "button", onClick: onResetFilters, variant: "default", appearance: "secondary", "data-cy": "resetFiltersBtn", children: _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }) })) })] }));
18
63
  };
19
64
  export default ControlButtons;
20
65
  var templateObject_1;
@@ -0,0 +1,8 @@
1
+ import { ChangeEvent } from 'react';
2
+ type QuickFilterProps = {
3
+ searchedValue: string;
4
+ placeholderText?: string;
5
+ onChange: (e: ChangeEvent<HTMLInputElement>) => void;
6
+ };
7
+ declare const QuickFilter: ({ searchedValue, placeholderText, onChange }: QuickFilterProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default QuickFilter;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Input from '../../../../Forms/Input';
3
+ import { x } from '@xstyled/styled-components';
4
+ var QuickFilter = function (_a) {
5
+ var searchedValue = _a.searchedValue, placeholderText = _a.placeholderText, onChange = _a.onChange;
6
+ return (_jsx(x.div, { mr: "12px", children: _jsx(Input, { icon: "search", type: "text", value: searchedValue, placeholder: placeholderText, onChange: onChange, variant: "gray" }) }));
7
+ };
8
+ export default QuickFilter;
@@ -0,0 +1,2 @@
1
+ import QuickFilter from './QuickFilter';
2
+ export default QuickFilter;
@@ -0,0 +1,2 @@
1
+ import QuickFilter from './QuickFilter';
2
+ export default QuickFilter;
@@ -4,7 +4,6 @@ type Props = {
4
4
  appearanceMap: Record<string, FlagAppearanceType>;
5
5
  enumObj: Record<string, () => string>;
6
6
  size?: 'default' | 'small' | 'wide' | 'fitContent';
7
- onClick?: () => void;
8
7
  };
9
- export declare const EnumInCell: ({ value, enumObj, appearanceMap, size, onClick }: Props) => JSX.Element | null;
8
+ export declare const EnumInCell: ({ value, enumObj, appearanceMap, size }: Props) => JSX.Element | null;
10
9
  export {};
@@ -19,7 +19,7 @@ import styled from '@xstyled/styled-components';
19
19
  import HighlightBox from '../../../../Elements/HighlightBox';
20
20
  var Center = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: flex-start;\n width: 100%;\n"], ["\n display: flex;\n justify-content: flex-start;\n width: 100%;\n"])));
21
21
  export var EnumInCell = function (_a) {
22
- var value = _a.value, enumObj = _a.enumObj, appearanceMap = _a.appearanceMap, size = _a.size, onClick = _a.onClick;
22
+ var value = _a.value, enumObj = _a.enumObj, appearanceMap = _a.appearanceMap, size = _a.size;
23
23
  var finalLabel = useMemo(function () {
24
24
  return enumObj[value] ? enumObj[value]() : value;
25
25
  }, [enumObj, value]);
@@ -28,6 +28,6 @@ export var EnumInCell = function (_a) {
28
28
  }, [appearanceMap, value]);
29
29
  if (!finalLabel)
30
30
  return null;
31
- return (_jsx(Center, { onClick: onClick, children: _jsx(HighlightBox, __assign({}, coloringProp, { size: size, prefix: "grid", children: finalLabel })) }));
31
+ return (_jsx(Center, { children: _jsx(HighlightBox, __assign({ className: "cell" }, coloringProp, { size: size, prefix: "grid", children: finalLabel })) }));
32
32
  };
33
33
  var templateObject_1;
@@ -2,5 +2,5 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { Trans } from '@lingui/react';
3
3
  /** catalog for lungui to track commonGrid translations - DO NOT REMOVE */
4
4
  var Translations = function () {
5
- return (_jsxs(_Fragment, { children: [_jsx(Trans, { id: "dataGrid.status.loadingData", message: "... loading data ..." }), _jsx(Trans, { id: "dataGrid.status.noDataFound", message: "No data found." }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), _jsx(Trans, { id: "dataGrid.buttonGridConfig", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.title", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.buttonReset", message: "Reset all" }), _jsx(Trans, { id: "dataGrid.resultsPerPage", message: "Results per page" }), _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "form.buttonImport", message: "Import" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" }), ",", _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "dataGrid.checkAll", message: "Check all" }), ",", _jsx(Trans, { id: "datagrid.filterCell.selectAllLabel", message: "select all" }), _jsx(Trans, { id: "datagrid.filterCell.optionsSelectedLabel", message: '{count} options' }), ",", _jsx(Trans, { id: "dataGrid.deleteItem", message: "Delete" }), ",", _jsx(Trans, { id: "dataGrid.columnLot.NA", message: "N/A" }), ",", _jsx(Trans, { id: "dataGrid.buttonActions", message: "Actions" }), ",", _jsx(Trans, { id: "dataGrid.errors.ipValidationError", message: "Value is not valid ip" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.all", message: "All" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.yes", message: "Yes" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.no", message: "No" }), _jsx(Trans, { id: "products.eshopFilterPlaceholder", message: "Select eshop..." }), ",", _jsx(Trans, { id: "dataGrid.checkedRowsCount", message: "Selected {checkedRowsCount} items" }), ",", _jsx(Trans, { id: "dataGrid.filterCell", message: "Type to filter" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.from", message: "From" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.to", message: "To" }), ",", _jsx(Trans, { id: "manageColumn.searchPlaceholder", message: "Find column..." }), ",", _jsx(Trans, { id: "dataGrid.comparator.equals", message: "Equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notEquals", message: "Not equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThan", message: "Less than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThanOrEquals", message: "Less than or equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThan", message: "Greater than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThanOrEquals", message: "Greater than or equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.contains", message: "Contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notContains", message: "Not contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.startsWith", message: "Starts with'" }), ",", _jsx(Trans, { id: "dataGrid.comparator.endsWith", message: "Ends with" }), ",", _jsx(Trans, { id: "select.noOptions", message: "no options" }), ",", _jsx(Trans, { id: "components.dropdown.loading", message: "Loading..." }), ",", _jsx(Trans, { id: "components.dropdown.placeholder", message: "Select..." }), ",", _jsx(Trans, { id: "components.dropdown.notReact", message: "Select related values first..." }), ",", _jsx(Trans, { id: "components.dropdown.writeMoreChars", message: "Write at least ${asyncLoadMinChars} characters." }), ",", _jsx(Trans, { id: "components.dropdown.noOptions", message: "No options" }), ",", _jsx(Trans, { id: "components.dropdown.newOption", message: "new value" }), ",", _jsx(Trans, { id: "form.general.min2Chars", message: "Minimal length is 2 characters." }), ","] }));
5
+ return (_jsxs(_Fragment, { children: [_jsx(Trans, { id: "dataGrid.status.loadingData", message: "... loading data ..." }), _jsx(Trans, { id: "dataGrid.status.noDataFound", message: "No data found." }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), _jsx(Trans, { id: "dataGrid.buttonGridConfig", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.title", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.buttonReset", message: "Reset all" }), _jsx(Trans, { id: "dataGrid.resultsPerPage", message: "Results per page" }), _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "form.buttonImport", message: "Import" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" }), ",", _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "dataGrid.checkAll", message: "Check all" }), ",", _jsx(Trans, { id: "datagrid.filterCell.selectAllLabel", message: "select all" }), _jsx(Trans, { id: "datagrid.filterCell.optionsSelectedLabel", message: '{count} options' }), ",", _jsx(Trans, { id: "dataGrid.deleteItem", message: "Delete" }), ",", _jsx(Trans, { id: "dataGrid.columnLot.NA", message: "N/A" }), ",", _jsx(Trans, { id: "dataGrid.buttonActions", message: "Actions" }), ",", _jsx(Trans, { id: "dataGrid.errors.ipValidationError", message: "Value is not valid ip" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.all", message: "All" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.yes", message: "Yes" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.no", message: "No" }), _jsx(Trans, { id: "products.eshopFilterPlaceholder", message: "Select eshop..." }), ",", _jsx(Trans, { id: "dataGrid.checkedRowsCount", message: "Selected {checkedRowsCount} items" }), ",", _jsx(Trans, { id: "dataGrid.filterCell", message: "Type to filter" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.from", message: "From" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.to", message: "To" }), ",", _jsx(Trans, { id: "manageColumn.searchPlaceholder", message: "Find column..." }), ",", _jsx(Trans, { id: "dataGrid.comparator.equals", message: "Equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notEquals", message: "Not equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThan", message: "Less than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThanOrEquals", message: "Less than or equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThan", message: "Greater than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThanOrEquals", message: "Greater than or equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.contains", message: "Contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notContains", message: "Not contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.startsWith", message: "Starts with'" }), ",", _jsx(Trans, { id: "dataGrid.comparator.endsWith", message: "Ends with" }), ",", _jsx(Trans, { id: "select.noOptions", message: "no options" }), ",", _jsx(Trans, { id: "components.dropdown.loading", message: "Loading..." }), ",", _jsx(Trans, { id: "components.dropdown.placeholder", message: "Select..." }), ",", _jsx(Trans, { id: "components.dropdown.notReact", message: "Select related values first..." }), ",", _jsx(Trans, { id: "components.dropdown.writeMoreChars", message: "Write at least ${asyncLoadMinChars} characters." }), ",", _jsx(Trans, { id: "components.dropdown.noOptions", message: "No options" }), ",", _jsx(Trans, { id: "components.dropdown.newOption", message: "new value" }), ",", _jsx(Trans, { id: "form.general.min2Chars", message: "Minimal length is 2 characters." }), ",", _jsx(Trans, { id: "controlButtons.searchPlaceholder", message: "Search ${translatedValue} ..." }), ","] }));
6
6
  };
@@ -255,6 +255,7 @@ export type CommonGridProps<TData extends RowProps = RowProps> = {
255
255
  onRowClick?: (id: string, props: TData) => void;
256
256
  onBatchAction?: OnBatchActionFn;
257
257
  columnLayout?: ColumnLayout;
258
+ quickFilter?: string;
258
259
  confirmOnReset?: () => boolean;
259
260
  className?: string;
260
261
  gridRef?: React.MutableRefObject<HTMLElement>;
@@ -44,7 +44,8 @@ type HighlightBoxType = {
44
44
  children: React.ReactNode;
45
45
  appearance: FlagAppearanceType;
46
46
  size?: 'default' | 'small' | 'wide' | 'fitContent';
47
+ className?: string;
47
48
  prefix?: string;
48
49
  };
49
- declare const HighlightBox: ({ children, appearance, size, prefix }: HighlightBoxType) => JSX.Element;
50
+ declare const HighlightBox: ({ children, appearance, size, className, prefix }: HighlightBoxType) => JSX.Element;
50
51
  export default HighlightBox;
@@ -5,7 +5,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import styled, { useTheme } from '@xstyled/styled-components';
7
7
  import { th } from '@xstyled/system';
8
- var StyledHighlightBox = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"])), function (_a) {
8
+ var StyledHighlightBox = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px !important;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: flex-start;\n border-radius: ml;\n font-size: 12px;\n text-align: center;\n line-height: 19.2px;\n min-width: 0;\n font-weight: semiBold;\n .default {\n height: 24px;\n padding: 2px 8px !important;\n }\n .small {\n height: 18px;\n padding: 1px 6px;\n }\n .wide {\n height: 2.75em;\n display: flex;\n flex-flow: row wrap;\n width: 11rem;\n align-content: center;\n line-height: 14px;\n padding: 0.5px 12px;\n }\n .fitContent {\n width: fit-content;\n height: auto;\n padding: 4px 5px;\n font-size: 13px;\n line-height: 15px;\n font-weight: 400;\n }\n background-color: ", ";\n color: ", ";\n"])), function (_a) {
9
9
  var $bgcolor = _a.$bgcolor;
10
10
  return $bgcolor;
11
11
  }, function (_a) {
@@ -54,12 +54,12 @@ export var flagAppearanceToFontColorMap = {
54
54
  redSubtle: 'red80',
55
55
  };
56
56
  var HighlightBox = function (_a) {
57
- var children = _a.children, appearance = _a.appearance, _b = _a.size, size = _b === void 0 ? 'default' : _b, prefix = _a.prefix;
57
+ var children = _a.children, appearance = _a.appearance, _b = _a.size, size = _b === void 0 ? 'default' : _b, className = _a.className, prefix = _a.prefix;
58
58
  var theme = useTheme();
59
59
  var bgColor = th.color(appearance ? flagAppearanceToColorMap[appearance] : 'transparent')({ theme: theme });
60
60
  var fontColor = th.color(appearance ? flagAppearanceToFontColorMap[appearance] : 'typoPrimary')({ theme: theme });
61
61
  var name = !!prefix ? "".concat(prefix, "Label") : 'label';
62
- return (_jsx(StyledHighlightBox, { "$bgcolor": bgColor, "$fontColor": fontColor, "data-cy": name, children: _jsx(OverflowWrap, { className: size, children: children }) }));
62
+ return (_jsx(StyledHighlightBox, { "$bgcolor": bgColor, "$fontColor": fontColor, "data-cy": name, children: _jsx(OverflowWrap, { className: size + ' ' + className, children: children }) }));
63
63
  };
64
64
  export default HighlightBox;
65
65
  var templateObject_1, templateObject_2;