@mailstep/design-system 0.5.0-beta.47 → 0.5.0-beta.49
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 +2 -7
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +2 -2
- package/ui/Blocks/CommonGrid/StandardButtons.d.ts +0 -2
- package/ui/Blocks/CommonGrid/StandardButtons.js +0 -14
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +2 -1
- package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +2 -1
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +2 -0
- package/ui/Blocks/CommonGrid/styles.d.ts +1 -1
- package/ui/Blocks/CommonGrid/styles.js +8 -8
- package/ui/Blocks/CommonGrid/translations.js +1 -1
- package/ui/Elements/DatePicker/DatePicker.js +1 -1
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +1 -1
- package/ui/Elements/Select/themes/CustomComponents.d.ts +0 -1
- package/ui/Elements/Select/themes/CustomComponents.js +12 -18
- package/ui/Elements/Select/themes/baseStyles.js +17 -0
- package/ui/Elements/Select/themes/formStyles.d.ts +2 -1
- package/ui/Elements/Select/themes/formStyles.js +13 -15
- package/ui/Elements/Select/themes/index.js +5 -23
- package/ui/Elements/Select/types.d.ts +1 -1
- package/ui/ThemeProvider/ThemeProvider.d.ts +3 -1
- package/ui/ThemeProvider/ThemeProvider.js +4 -2
- package/ui/index.d.ts +1 -3
- package/ui/index.es.js +12290 -12568
- package/ui/index.js +1 -3
- package/ui/index.umd.js +471 -469
- package/ui/Elements/Select/themes/headingStyles.d.ts +0 -17
- package/ui/Elements/Select/themes/headingStyles.js +0 -99
- package/ui/Elements/Select/themes/leftMenuStyles.d.ts +0 -18
- package/ui/Elements/Select/themes/leftMenuStyles.js +0 -57
- package/ui/Providers/LanguageProvider/index.d.ts +0 -8
- package/ui/Providers/LanguageProvider/index.js +0 -13
- package/ui/locales/catalogs.d.ts +0 -9
- package/ui/locales/catalogs.js +0 -16
- package/ui/locales/cs/messages.d.ts +0 -1
- package/ui/locales/cs/messages.js +0 -1
- package/ui/locales/el/messages.d.ts +0 -1
- package/ui/locales/el/messages.js +0 -1
- package/ui/locales/en/messages.d.ts +0 -1
- package/ui/locales/en/messages.js +0 -1
- package/ui/locales/es/messages.d.ts +0 -1
- package/ui/locales/es/messages.js +0 -1
- package/ui/locales/it/messages.d.ts +0 -1
- package/ui/locales/it/messages.js +0 -1
- package/ui/locales/ru/messages.d.ts +0 -1
- package/ui/locales/ru/messages.js +0 -1
- package/ui/locales/sk/messages.d.ts +0 -1
- package/ui/locales/sk/messages.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.49",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -16,10 +16,7 @@
|
|
|
16
16
|
"build-storybook": "storybook build",
|
|
17
17
|
"deploy": "npm run build && npm publish ./build",
|
|
18
18
|
"dev": "yarn storybook",
|
|
19
|
-
"test": "echo \"The tests are still waiting to be written, but it seems like they're really good at procrastinating!\""
|
|
20
|
-
"locale-clean": "lingui extract --clean",
|
|
21
|
-
"locale-extract": "lingui extract",
|
|
22
|
-
"locale-compile": "lingui compile --typescript"
|
|
19
|
+
"test": "echo \"The tests are still waiting to be written, but it seems like they're really good at procrastinating!\""
|
|
23
20
|
},
|
|
24
21
|
"devDependencies": {
|
|
25
22
|
"@babel/core": "^7.20.12",
|
|
@@ -35,7 +32,6 @@
|
|
|
35
32
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
36
33
|
"@lingui/react": "3.17.2",
|
|
37
34
|
"@lingui/core": "3.17.2",
|
|
38
|
-
"@lingui/cli": "3.17.2",
|
|
39
35
|
"@popperjs/core": "^2.11.8",
|
|
40
36
|
"@storybook/addon-controls": "7.6.8",
|
|
41
37
|
"@storybook/addon-essentials": "7.6.8",
|
|
@@ -103,7 +99,6 @@
|
|
|
103
99
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
104
100
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
105
101
|
"@lingui/react": "3.17.2",
|
|
106
|
-
"@lingui/cli": "3.17.2",
|
|
107
102
|
"@lingui/core": "3.17.2",
|
|
108
103
|
"@popperjs/core": "^2.11.8",
|
|
109
104
|
"@xstyled/styled-components": "^3.8.0",
|
|
@@ -31,7 +31,6 @@ import { CommonGridWithStyles, BottomWrapper, CommonGridWrap, ContentContainer,
|
|
|
31
31
|
import { H6 } from '../../Elements/Typography';
|
|
32
32
|
import HidePrint from '../HidePrint/HidePrint';
|
|
33
33
|
import ControlButtons from './components/ControlButtons';
|
|
34
|
-
import { Rows } from '../../Elements/Icon/icons/Rows';
|
|
35
34
|
import { x } from '@xstyled/styled-components';
|
|
36
35
|
import ActionHead from './components/ActionHead';
|
|
37
36
|
import { Pagination } from '../../Elements/Pagination';
|
|
@@ -39,6 +38,7 @@ import TablePagination from './components/TablePagination';
|
|
|
39
38
|
import Modal from '../Modal';
|
|
40
39
|
import ManageColumnForm from './components/ManageColumnForm';
|
|
41
40
|
import { Trans } from '@lingui/react';
|
|
41
|
+
import { Settings2 } from '../../Elements/Icon/icons/Settings2';
|
|
42
42
|
var StyledCommonGrid = function (props) {
|
|
43
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"]);
|
|
44
44
|
var gridActions = passDownProps.gridActions, gridSelectors = passDownProps.gridSelectors, rowsData = passDownProps.rowsData, actionColumnDefinition = passDownProps.actionColumnDefinition;
|
|
@@ -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;
|
|
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", appearance: "ghost", icon: _jsx(
|
|
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, 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: onClose, onCancel: onClose, 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: columns, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions }) }))] }));
|
|
65
65
|
};
|
|
66
66
|
export default StyledCommonGrid;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ExtraControlButton } from './types';
|
|
2
|
-
import { Option, ValueType } from '../../Elements/Select/types';
|
|
3
2
|
export declare const getCreateButton: (onCreate: () => void, canCreate: boolean, disabled?: boolean) => ExtraControlButton;
|
|
4
3
|
export declare const getImportButton: (onImport: () => void, canImport: boolean, disabled?: boolean) => ExtraControlButton;
|
|
5
4
|
export declare const getMoreButton: (onExport: () => void, onImport?: () => void, canImport?: boolean) => ExtraControlButton;
|
|
6
|
-
export declare const getEshopSelect: (eshopOptions: Option[], selectedEshop: string, onChange: (eshopOption: ValueType) => void, isClearable?: boolean) => ExtraControlButton[];
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Trans } from '@lingui/react';
|
|
3
|
-
import { x } from '@xstyled/styled-components';
|
|
4
|
-
import Select from '../../Elements/Select';
|
|
5
3
|
import ButtonMore from './components/ButtonMore/ButtonMore';
|
|
6
|
-
import { i18n } from '@lingui/core';
|
|
7
4
|
export var getCreateButton = function (onCreate, canCreate, disabled) { return ({
|
|
8
5
|
label: _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }),
|
|
9
6
|
style: 'primary',
|
|
@@ -37,14 +34,3 @@ export var getMoreButton = function (onExport, onImport, canImport) {
|
|
|
37
34
|
node: _jsx(ButtonMore, { items: items }),
|
|
38
35
|
};
|
|
39
36
|
};
|
|
40
|
-
export var getEshopSelect = function (eshopOptions, selectedEshop, onChange, isClearable) {
|
|
41
|
-
if (isClearable === void 0) { isClearable = true; }
|
|
42
|
-
var eshops = [];
|
|
43
|
-
if (eshopOptions.length > 1) {
|
|
44
|
-
eshops.push({
|
|
45
|
-
position: 'top-right',
|
|
46
|
-
node: (_jsx(x.div, { w: "200px", "data-cy": "eshopSelect", children: _jsx(Select, { name: "eshop", options: eshopOptions, value: selectedEshop, onChange: onChange, isSearchable: false, isClearable: isClearable, disabled: !eshopOptions.length, placeholder: i18n._({ id: 'products.eshopFilterPlaceholder', message: 'Select eshop...' }) }) })),
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return eshops;
|
|
50
|
-
};
|
|
@@ -8,7 +8,7 @@ import { Trans } from '@lingui/react';
|
|
|
8
8
|
import ExtraControlButtons from '../ExtraControlButtons';
|
|
9
9
|
import { ExtraControlButtonPosition } from '../../types';
|
|
10
10
|
import Button from '../../../../Elements/Button/Button';
|
|
11
|
-
export var Row = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
11
|
+
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"])));
|
|
12
12
|
var ControlButtons = function (_a) {
|
|
13
13
|
var extraControlButtons = _a.extraControlButtons, eshopSelect = _a.eshopSelect, gridActions = _a.gridActions, gridSelectors = _a.gridSelectors;
|
|
14
14
|
var resetFilters = gridActions.resetFilters;
|
|
@@ -2,12 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import CommonGrid from '../../CommonGridContainer';
|
|
3
3
|
import { createRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
|
|
4
4
|
import { columnDefinitions } from '../utils/columnDefinition';
|
|
5
|
+
import withTheme from '../utils/withTheme';
|
|
5
6
|
import withRouter from '../utils/withRouter';
|
|
6
7
|
import withRedux from '../utils/withRedux';
|
|
7
8
|
import { LinguiContainer } from '../utils/linguiContainer';
|
|
8
9
|
export default {
|
|
9
10
|
title: '@Blocks/CommonGrid',
|
|
10
|
-
decorators: [withRouter, withRedux],
|
|
11
|
+
decorators: [withTheme, withRouter, withRedux],
|
|
11
12
|
};
|
|
12
13
|
export var Default = function () {
|
|
13
14
|
return (_jsx(LinguiContainer, { children: _jsx(CommonGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), gridActions: gridDummyActions, gridSelectors: gridSelectors }) }));
|
|
@@ -2,12 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ReduxGrid, createRandomData, gridSelectors, gridDummyActions } from '../utils/utils';
|
|
3
3
|
import { onRowAction } from '../utils/actions';
|
|
4
4
|
import { columnDefinitions } from '../utils/columnDefinition';
|
|
5
|
+
import withTheme from '../utils/withTheme';
|
|
5
6
|
import withRouter from '../utils/withRouter';
|
|
6
7
|
import withRedux from '../utils/withRedux';
|
|
7
8
|
import { LinguiContainer } from '../utils/linguiContainer';
|
|
8
9
|
export default {
|
|
9
10
|
title: '@Blocks/CommonGrid',
|
|
10
|
-
decorators: [withRouter, withRedux],
|
|
11
|
+
decorators: [withTheme, withRouter, withRedux],
|
|
11
12
|
};
|
|
12
13
|
export var Styled = function () {
|
|
13
14
|
return (_jsx(LinguiContainer, { children: _jsx("div", { className: "styled", children: _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, gridActions: gridDummyActions, gridSelectors: gridSelectors }) }) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const BottomWrapper: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme> & {
|
|
3
|
-
|
|
3
|
+
isFixed?: boolean | undefined;
|
|
4
4
|
}, "color">;
|
|
5
5
|
export declare const ContentContainer: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
|
|
6
6
|
export declare const CommonGridWrap: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
|
|
@@ -6,17 +6,17 @@ import styled, { x } from '@xstyled/styled-components';
|
|
|
6
6
|
import { th } from '@xstyled/system';
|
|
7
7
|
import { Button } from '../../Elements/Button';
|
|
8
8
|
import CommonGrid from './CommonGrid';
|
|
9
|
-
export var BottomWrapper = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
10
|
-
var
|
|
11
|
-
return (
|
|
9
|
+
export var BottomWrapper = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-bottom: 11px;\n padding-top: 10px;\n position: ", ";\n bottom: 0;\n left: 0;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n position: relative;\n padding-bottom: 11px;\n margin-bottom: 0;\n }\n & > * {\n @media (min-width: 1024px) {\n justify-content: flex-end;\n }\n }\n"], ["\n padding-bottom: 11px;\n padding-top: 10px;\n position: ", ";\n bottom: 0;\n left: 0;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n position: relative;\n padding-bottom: 11px;\n margin-bottom: 0;\n }\n & > * {\n @media (min-width: 1024px) {\n justify-content: flex-end;\n }\n }\n"])), function (_a) {
|
|
10
|
+
var isFixed = _a.isFixed;
|
|
11
|
+
return (isFixed ? 'fixed' : 'relative');
|
|
12
12
|
}, function (_a) {
|
|
13
|
-
var
|
|
14
|
-
return (
|
|
13
|
+
var isFixed = _a.isFixed, theme = _a.theme;
|
|
14
|
+
return (isFixed ? theme.colors.bgLightGray : 'transparent');
|
|
15
15
|
});
|
|
16
|
-
export var ContentContainer = styled(x.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n
|
|
16
|
+
export var ContentContainer = styled(x.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n background-color: white;\n box-shadow: gridShadow;\n border-radius: 8px;\n flex-grow: 1;\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n background-color: white;\n box-shadow: gridShadow;\n border-radius: 8px;\n flex-grow: 1;\n"])));
|
|
17
17
|
export var CommonGridWrap = styled(x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
|
|
18
|
-
export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n border-bottom: 0.5px solid ", ";\n"], ["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n border-bottom: 0.5px solid ", ";\n"])), th('colors.lightGray6'));
|
|
19
|
-
export var StyledColumnButton = styled(Button)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"], ["\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"])));
|
|
18
|
+
export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n z-index: 2;\n border-bottom: 0.5px solid ", ";\n"], ["\n position: relative;\n padding: 18px 20px;\n display: flex;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n z-index: 2;\n border-bottom: 0.5px solid ", ";\n"])), th('colors.lightGray6'));
|
|
19
|
+
export var StyledColumnButton = styled(Button)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: sticky;\n right: 20px;\n > span > svg {\n stroke: ", ";\n width: 18px;\n height: 18px;\n }\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"], ["\n position: sticky;\n right: 20px;\n > span > svg {\n stroke: ", ";\n width: 18px;\n height: 18px;\n }\n > span > H6 {\n display: none;\n }\n @media (min-width: 1024px) {\n > span > H6 {\n display: flex;\n margin-left: 5px;\n }\n }\n"])), th('colors.blue2'));
|
|
20
20
|
export var CommonGridWithStyles = styled(CommonGrid)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: 40px;\n }\n & .gridHead {\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 1;\n padding-left: 20px;\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n position: relative;\n }\n & .sticky {\n background-color: #fafbfc;\n }\n }\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n & .sticky {\n background-color: #fafbfc;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n & .body {\n margin: 0 1px 1px 1px; // matching margin with .gridHead\n padding-left: 20px;\n flex-grow: 1;\n }\n & .gridWrapper {\n background-color: ", ";\n width: ", ";\n padding-bottom: ", ";\n\n @media (min-width: 1024px) {\n height: ", ";\n width: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 2px;\n padding-right: 2px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n & .sticky {\n background-color: #fff;\n :hover {\n background-color: #fdf4f3;\n }\n }\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &.selected,\n &.selected > .sticky {\n background-color: #fdf4f3;\n }\n\n :hover {\n background-color: #fdf4f3;\n\n .sticky {\n background-color: #fdf4f3;\n }\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n max-width: 88px;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: 40px;\n }\n & .gridHead {\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 1;\n padding-left: 20px;\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n position: relative;\n }\n & .sticky {\n background-color: #fafbfc;\n }\n }\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n & .sticky {\n background-color: #fafbfc;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n & .body {\n margin: 0 1px 1px 1px; // matching margin with .gridHead\n padding-left: 20px;\n flex-grow: 1;\n }\n & .gridWrapper {\n background-color: ", ";\n width: ", ";\n padding-bottom: ", ";\n\n @media (min-width: 1024px) {\n height: ", ";\n width: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 2px;\n padding-right: 2px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n & .sticky {\n background-color: #fff;\n :hover {\n background-color: #fdf4f3;\n }\n }\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &.selected,\n &.selected > .sticky {\n background-color: #fdf4f3;\n }\n\n :hover {\n background-color: #fdf4f3;\n\n .sticky {\n background-color: #fdf4f3;\n }\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n max-width: 88px;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), th('fonts.primary'), th('fonts.primary'), function (_a) {
|
|
21
21
|
var theme = _a.theme;
|
|
22
22
|
return theme.colors.white;
|
|
@@ -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
|
|
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." }), ","] }));
|
|
6
6
|
};
|
|
@@ -34,7 +34,7 @@ import { x } from '@xstyled/styled-components';
|
|
|
34
34
|
import { DatePickerBase } from './styles';
|
|
35
35
|
import SpaceAroundWrap from '../SpaceAround';
|
|
36
36
|
import Input from '../../Forms/Input';
|
|
37
|
-
import { LanguageContext } from '../../
|
|
37
|
+
import { LanguageContext } from '../../ThemeProvider/ThemeProvider';
|
|
38
38
|
var defaultDateFormat = 'DD.MM.YYYY';
|
|
39
39
|
var DatePicker = function (_a) {
|
|
40
40
|
var name = _a.name, value = _a.value, initialViewDate = _a.initialViewDate, error = _a.error, label = _a.label, disabled = _a.disabled, isValidDate = _a.isValidDate, onChange = _a.onChange, _b = _a.dateFormat, dateFormat = _b === void 0 ? defaultDateFormat : _b, _c = _a.timeFormat, timeFormat = _c === void 0 ? false : _c, open = _a.open, _d = _a.secondValue, secondValue = _d === void 0 ? null : _d, input = _a.input, _e = _a.icon, icon = _e === void 0 ? true : _e, _f = _a.showInputLabel, showInputLabel = _f === void 0 ? false : _f, _g = _a.showCalendarLabel, showCalendarLabel = _g === void 0 ? true : _g, _h = _a.spaceAround, spaceAround = _h === void 0 ? false : _h, className = _a.className, onClear = _a.onClear, passProps = __rest(_a, ["name", "value", "initialViewDate", "error", "label", "disabled", "isValidDate", "onChange", "dateFormat", "timeFormat", "open", "secondValue", "input", "icon", "showInputLabel", "showCalendarLabel", "spaceAround", "className", "onClear"]);
|
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
import styled, { css } from '@xstyled/styled-components';
|
|
7
|
-
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 10px;\n font-size: 12px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n
|
|
7
|
+
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 10px;\n font-size: 12px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"], ["\n padding: 10px;\n font-size: 12px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"])), function (props) {
|
|
8
8
|
return props.hasSeparator && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-top: slim;\n border-color: lightGray2;\n "], ["\n border-top: slim;\n border-color: lightGray2;\n "])));
|
|
9
9
|
});
|
|
10
10
|
var IconWrap = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-right: 10px;\n"], ["\n margin-right: 10px;\n"])));
|
|
@@ -3,7 +3,6 @@ export declare const SimplifiedOption: React.MemoExoticComponent<(props: any) =>
|
|
|
3
3
|
export declare const IconValueContainer: (props: any) => any;
|
|
4
4
|
export declare const CountMultiValue: (props: any) => any;
|
|
5
5
|
export declare const ChevronOption: (props: any) => any;
|
|
6
|
-
export declare const HighlightOption: (props: any) => any;
|
|
7
6
|
export declare const ConnectedMenu: (props: any) => any;
|
|
8
7
|
export declare const CustomInput: (props: any) => any;
|
|
9
8
|
export declare const DropdownIndicator: (props: any) => any;
|
|
@@ -27,7 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
28
|
import { useCallback, useMemo, memo, useState, useEffect, useRef } from 'react';
|
|
29
29
|
import { components } from 'react-select';
|
|
30
|
-
import styled from '@xstyled/styled-components';
|
|
30
|
+
import styled, { th } from '@xstyled/styled-components';
|
|
31
31
|
import { components as selectComponents } from 'react-select';
|
|
32
32
|
import { Trans } from '@lingui/react';
|
|
33
33
|
import Icon from '../../Icon/Icon';
|
|
@@ -66,33 +66,27 @@ export var CountMultiValue = function (props) {
|
|
|
66
66
|
};
|
|
67
67
|
// Option with chevron form new design
|
|
68
68
|
var ChevronDiv = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: center;\n display: flex;\n"], ["\n align-self: center;\n display: flex;\n"])));
|
|
69
|
-
var SelectedIndicator = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n
|
|
69
|
+
var SelectedIndicator = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-right: 12px;\n"], ["\n padding-right: 12px;\n"])));
|
|
70
70
|
export var ChevronOption = function (props) {
|
|
71
71
|
var theme = props.theme, isSelected = props.isSelected, selectOption = props.selectOption, children = props.children, data = props.data;
|
|
72
|
-
var showCheckbox = theme.optionVariant == 'checkbox';
|
|
73
|
-
var showToggle = theme.optionVariant == 'toggle';
|
|
74
|
-
return (_jsxs(selectComponents.Option, __assign({}, props, { children: [
|
|
75
|
-
};
|
|
76
|
-
// Option with background highlight
|
|
77
|
-
var OptionInnerWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: 4px;\n & > div {\n margin-right: 2;\n }\n"], ["\n display: flex;\n align-items: center;\n margin: 4px;\n & > div {\n margin-right: 2;\n }\n"])));
|
|
78
|
-
export var HighlightOption = function (props) {
|
|
79
|
-
var children = props.children, data = props.data;
|
|
80
|
-
return (_jsx(selectComponents.Option, __assign({}, props, { children: _jsx(OptionInnerWrap, { className: "optionInner", "data-cy": "dropdownModalOption".concat(data.index), children: _jsx("span", { className: "label", children: children }) }) })));
|
|
72
|
+
var showCheckbox = !!(theme.optionVariant == 'checkbox');
|
|
73
|
+
var showToggle = !!(theme.optionVariant == 'toggle');
|
|
74
|
+
return (_jsxs(selectComponents.Option, __assign({}, props, { children: [(showCheckbox || showToggle) && (_jsxs(SelectedIndicator, { children: [showCheckbox && _jsx(Checkbox, { checked: isSelected, size: 2, readOnly: true }), showToggle && _jsx(Toggle, { name: "", onChange: selectOption, checked: isSelected, spaceAround: false, variant: 'grid' })] })), _jsx("span", { className: "label", "data-cy": "dropdownModalOption".concat(data.index), children: children })] })));
|
|
81
75
|
};
|
|
82
76
|
// menu with check all and reset config button
|
|
83
|
-
var SelectAll = styled.div(
|
|
77
|
+
var SelectAll = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n margin: 4px 18px -10px 8px;\n padding: ", ";\n font-weight: 400;\n background-color: ", ";\n color: blue2;\n border-radius: 6px;\n height: 36px;\n :hover {\n cursor: pointer;\n background-color: bgLightGray1;\n }\n"], ["\n display: flex;\n margin: 4px 18px -10px 8px;\n padding: ", ";\n font-weight: 400;\n background-color: ", ";\n color: blue2;\n border-radius: 6px;\n height: 36px;\n :hover {\n cursor: pointer;\n background-color: bgLightGray1;\n }\n"])), function (_a) {
|
|
84
78
|
var additionalPadding = _a.additionalPadding;
|
|
85
79
|
return (additionalPadding ? '8px 27px 8px 10px' : '8px 10px');
|
|
86
80
|
}, function (_a) {
|
|
87
81
|
var isSelected = _a.isSelected;
|
|
88
|
-
return (isSelected ? '
|
|
82
|
+
return (isSelected ? th.color('red20') : 'transparent');
|
|
89
83
|
});
|
|
90
|
-
var ConfigWrap = styled.div(
|
|
84
|
+
var ConfigWrap = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-align: center;\n cursor: pointer;\n color: red1;\n text-decoration: underline;\n margin: 0 30px 0 20px;\n padding-bottom: 7px;\n :first-letter {\n text-transform: capitalize;\n }\n :hover {\n color: red3;\n }\n"], ["\n text-align: center;\n cursor: pointer;\n color: red1;\n text-decoration: underline;\n margin: 0 30px 0 20px;\n padding-bottom: 7px;\n :first-letter {\n text-transform: capitalize;\n }\n :hover {\n color: red3;\n }\n"])));
|
|
91
85
|
export var ConnectedMenu = function (props) {
|
|
92
86
|
var theme = props.theme;
|
|
93
87
|
var _a = props.selectProps, resetGrid = _a.resetGrid, onCustomSelectAll = _a.onCustomSelectAll, onCustomDeselectAll = _a.onCustomDeselectAll, value = _a.value, options = _a.options, resetGridButton = _a.resetGridButton, selectAllButton = _a.selectAllButton, maxMenuHeight = _a.maxMenuHeight;
|
|
94
|
-
var showCheckbox = theme.optionVariant === 'checkbox';
|
|
95
|
-
var showToggle = theme.optionVariant === 'toggle';
|
|
88
|
+
var showCheckbox = !!(theme.optionVariant === 'checkbox');
|
|
89
|
+
var showToggle = !!(theme.optionVariant === 'toggle');
|
|
96
90
|
var _b = useState(false), isSelected = _b[0], setIsSelected = _b[1];
|
|
97
91
|
var _c = useState(false), additionalPadding = _c[0], setAdditionalPadding = _c[1];
|
|
98
92
|
var ref = useRef(null);
|
|
@@ -117,7 +111,7 @@ export var ConnectedMenu = function (props) {
|
|
|
117
111
|
onCustomDeselectAll();
|
|
118
112
|
}
|
|
119
113
|
}, [isSelected, onCustomDeselectAll, onCustomSelectAll]);
|
|
120
|
-
return (_jsxs(selectComponents.Menu, __assign({}, props, { children: [selectAllButton && (_jsxs(SelectAll, { isSelected: isSelected, onClick: selectAll, ref: ref, additionalPadding: additionalPadding, children: [
|
|
114
|
+
return (_jsxs(selectComponents.Menu, __assign({}, props, { children: [selectAllButton && (_jsxs(SelectAll, { isSelected: isSelected, onClick: selectAll, ref: ref, additionalPadding: additionalPadding, children: [(showCheckbox || showToggle) && (_jsxs(SelectedIndicator, { children: [showCheckbox && _jsx(Checkbox, { checked: isSelected, size: 2, readOnly: true }), showToggle && _jsx(Toggle, { name: "", checked: isSelected, spaceAround: false, variant: 'grid' })] })), _jsx(Trans, { id: "datagrid.filterCell.selectAllLabel", message: 'select all' })] })), props.children, resetGridButton && (_jsx(ConfigWrap, { onClick: resetGrid, children: _jsx(Paragraph3, { variant: "semiBold", children: _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }) }) }))] })));
|
|
121
115
|
};
|
|
122
116
|
export var CustomInput = function (props) {
|
|
123
117
|
var name = props.selectProps.name;
|
|
@@ -128,4 +122,4 @@ export var DropdownIndicator = function (props) {
|
|
|
128
122
|
var _a = props.selectProps, menuIsOpen = _a.menuIsOpen, name = _a.name;
|
|
129
123
|
return (_jsx(selectComponents.DropdownIndicator, __assign({}, props, { children: _jsx(ChevronDiv, { className: "chevron", "data-cy": "".concat(name, "ChevronBtn"), children: _jsx(Icon, { icon: menuIsOpen ? 'goUp' : 'goDown', size: '100%' }) }) })));
|
|
130
124
|
};
|
|
131
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5
|
|
125
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -67,4 +67,21 @@ export var baseStylesConfig = {
|
|
|
67
67
|
var theme = _a.theme;
|
|
68
68
|
return (__assign(__assign({}, styles), { color: theme.colors.optionTextColor }));
|
|
69
69
|
},
|
|
70
|
+
menuList: function (styles, _a) {
|
|
71
|
+
var theme = _a.theme;
|
|
72
|
+
return __assign(__assign({}, styles), { margin: '8px 4px 8px 8px', '::-webkit-scrollbar-thumb': {
|
|
73
|
+
border: 'none',
|
|
74
|
+
borderRadius: '4px',
|
|
75
|
+
height: '47px',
|
|
76
|
+
backgroundColor: theme.colors.scrollbarThumbColor,
|
|
77
|
+
'&:hover': {
|
|
78
|
+
backgroundColor: theme.colors.dropdownIndicatorColor,
|
|
79
|
+
},
|
|
80
|
+
}, '::-webkit-scrollbar': {
|
|
81
|
+
width: '10px',
|
|
82
|
+
}, '::-webkit-scrollbar-track': {
|
|
83
|
+
backgroundColor: theme.colors.scrollbarTrackColor,
|
|
84
|
+
borderRadius: '6px',
|
|
85
|
+
} });
|
|
86
|
+
},
|
|
70
87
|
};
|
|
@@ -2,8 +2,9 @@ import { SelectProps } from '../types';
|
|
|
2
2
|
import { BaseStylesTheme, BaseState, StylesConfig } from './baseStyles';
|
|
3
3
|
type CustomTheme = Omit<BaseStylesTheme, 'colors'> & {
|
|
4
4
|
colors: Omit<BaseStylesTheme['colors'], 'primary50' | 'primary25'> & {
|
|
5
|
-
|
|
5
|
+
activeOptionBackground: string;
|
|
6
6
|
valueTextColor: string;
|
|
7
|
+
inputTextColor: string;
|
|
7
8
|
inputBorderHoverColor: string;
|
|
8
9
|
menuHoverBackgroundColor: string;
|
|
9
10
|
dropdownIndicatorColor: string;
|
|
@@ -40,32 +40,30 @@ export var CustomStyles = __assign(__assign({}, baseStylesConfig), { control: fu
|
|
|
40
40
|
var base = (_a = baseStylesConfig.placeholder) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
41
41
|
return __assign(__assign({}, base), { fontSize: '14px', fontWeight: theme.textWeightSemiBold });
|
|
42
42
|
}, option: function (styles, _a) {
|
|
43
|
-
var isSelected = _a.isSelected, theme = _a.theme,
|
|
43
|
+
var isSelected = _a.isSelected, theme = _a.theme, isDisabled = _a.isDisabled, selectProps = _a.selectProps;
|
|
44
44
|
var defaultColor = theme.colors.optionTextColor;
|
|
45
45
|
var disabledColor = theme.colors.placeholderTextColor;
|
|
46
46
|
return {
|
|
47
|
-
color:
|
|
48
|
-
|
|
47
|
+
color: isSelected ? theme.colors.primary : defaultColor,
|
|
48
|
+
backgroundColor: isSelected ? theme.colors.activeOptionBackground : undefined,
|
|
49
|
+
fontWeight: 400,
|
|
49
50
|
fontSize: '14px',
|
|
50
51
|
cursor: !isDisabled ? 'pointer' : 'default',
|
|
51
52
|
display: 'flex',
|
|
52
53
|
flexDirection: 'row',
|
|
53
|
-
|
|
54
|
-
padding: '
|
|
55
|
-
|
|
56
|
-
marginRight: '
|
|
57
|
-
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
padding: '7px 10px',
|
|
56
|
+
height: '36px',
|
|
57
|
+
marginRight: '4px',
|
|
58
|
+
marginBottom: '2px',
|
|
59
|
+
lineHeight: '22px',
|
|
60
|
+
borderRadius: th.radius('ml')({ theme: selectProps === null || selectProps === void 0 ? void 0 : selectProps.systemTheme }),
|
|
58
61
|
'&:hover': { backgroundColor: !isDisabled ? theme.colors.menuHoverBackgroundColor : undefined },
|
|
59
|
-
'.chevron': {
|
|
60
|
-
display: isFocused ? 'block' : 'none',
|
|
61
|
-
paddingRight: '8px',
|
|
62
|
-
color: theme.colors.primary,
|
|
63
|
-
},
|
|
64
62
|
};
|
|
65
63
|
}, menu: function (styles, state) {
|
|
66
64
|
var _a;
|
|
67
65
|
var base = (_a = baseStylesConfig.menu) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
68
|
-
return __assign(__assign({}, base), { boxShadow: '0
|
|
66
|
+
return __assign(__assign({}, base), { boxShadow: '0 2px 20px 0 rgba(0, 0, 0, 0.10);', marginTop: '-0', paddingTop: '0', borderRadius: '10px', zIndex: 3 });
|
|
69
67
|
}, dropdownIndicator: function (styles, state) {
|
|
70
68
|
var _a;
|
|
71
69
|
var base = (_a = baseStylesConfig.dropdownIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
|
|
@@ -93,7 +91,7 @@ export var getCustomTheme = function (theme, optionVariant, useFilterSubvariant)
|
|
|
93
91
|
inputBackgroundColor: "white",
|
|
94
92
|
inputBorderColor: th.color('lightGray3')({ theme: theme }),
|
|
95
93
|
inputBorderHoverColor: th.color('gray5')({ theme: theme }),
|
|
96
|
-
|
|
94
|
+
activeOptionBackground: th.color('red20')({ theme: theme }),
|
|
97
95
|
menuBackgroundColor: th.color('white')({ theme: theme }),
|
|
98
96
|
menuHoverBackgroundColor: th.color('bgLightGray1')({ theme: theme }),
|
|
99
97
|
dropdownIndicatorColor: th.color('gray1')({ theme: theme }),
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { SimplifiedOption, IconValueContainer, CountMultiValue, ChevronOption,
|
|
1
|
+
import { SimplifiedOption, IconValueContainer, CountMultiValue, ChevronOption, DropdownIndicator, CustomInput, ConnectedMenu, } from './CustomComponents';
|
|
2
2
|
import { getCustomTheme as getFormCustomTheme, CustomStyles as FormCustomStyles } from './formStyles';
|
|
3
|
-
import { getCustomTheme as getLeftMenuCustomTheme, CustomStyles as LeftMenuCustomStyles } from './leftMenuStyles';
|
|
4
|
-
import { getCustomTheme as getHeadingCustomTheme, CustomStyles as HeadingCustomStyles } from './headingStyles';
|
|
5
3
|
import { useTheme } from '@xstyled/styled-components';
|
|
6
4
|
import { useMemo } from 'react';
|
|
7
5
|
export var useStylesAndComponents = function (style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton, showResetGridButton) {
|
|
@@ -23,27 +21,11 @@ export var useStylesAndComponents = function (style, optionVariant, multiLabelVa
|
|
|
23
21
|
if (showResetGridButton || showSelectAllButton) {
|
|
24
22
|
components.Menu = ConnectedMenu;
|
|
25
23
|
}
|
|
26
|
-
var themes;
|
|
27
|
-
var styles;
|
|
28
24
|
components.Input = CustomInput;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
else if (style == 'heading') {
|
|
35
|
-
themes = getHeadingCustomTheme(systemTheme);
|
|
36
|
-
styles = HeadingCustomStyles;
|
|
37
|
-
components.DropdownIndicator = DropdownIndicator;
|
|
38
|
-
components.Option = HighlightOption;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
// (style == 'form' || style == 'gridFilter')
|
|
42
|
-
themes = getFormCustomTheme(systemTheme, optionVariant, style == 'gridFilter');
|
|
43
|
-
styles = FormCustomStyles;
|
|
44
|
-
components.Option = ChevronOption;
|
|
45
|
-
components.DropdownIndicator = DropdownIndicator;
|
|
46
|
-
}
|
|
25
|
+
var themes = getFormCustomTheme(systemTheme, optionVariant, style == 'gridFilter');
|
|
26
|
+
var styles = FormCustomStyles;
|
|
27
|
+
components.Option = ChevronOption;
|
|
28
|
+
components.DropdownIndicator = DropdownIndicator;
|
|
47
29
|
// performance reasons
|
|
48
30
|
if (useSimplifiedOptions)
|
|
49
31
|
components.Option = SimplifiedOption;
|
|
@@ -40,7 +40,7 @@ export type SelectProps = {
|
|
|
40
40
|
menuIsOpen?: boolean;
|
|
41
41
|
defaultMenuIsOpen?: boolean;
|
|
42
42
|
isDarkPlaceholderText?: boolean;
|
|
43
|
-
style?: 'form' | '
|
|
43
|
+
style?: 'form' | 'gridFilter';
|
|
44
44
|
optionVariant?: 'default' | 'checkbox' | 'toggle';
|
|
45
45
|
multiLabelVariant?: 'default' | 'count';
|
|
46
46
|
containerVariant?: 'default' | 'search';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { Props } from './types';
|
|
2
|
-
declare const
|
|
3
|
+
export declare const LanguageContext: import("react").Context<string>;
|
|
4
|
+
declare const MailstepThemeProvider: ({ children, theme, preflight, language }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
export default MailstepThemeProvider;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ThemeProvider, Preflight } from '@xstyled/styled-components';
|
|
3
3
|
import themes from './themes';
|
|
4
|
+
import { createContext } from 'react';
|
|
5
|
+
export var LanguageContext = createContext('en');
|
|
4
6
|
var MailstepThemeProvider = function (_a) {
|
|
5
|
-
var children = _a.children, _b = _a.theme, theme = _b === void 0 ? 'default' : _b, _c = _a.preflight, preflight = _c === void 0 ? true : _c;
|
|
6
|
-
return (_jsxs(ThemeProvider, { theme: themes[theme], children: [preflight && _jsx(Preflight, {}), children] }));
|
|
7
|
+
var children = _a.children, _b = _a.theme, theme = _b === void 0 ? 'default' : _b, _c = _a.preflight, preflight = _c === void 0 ? true : _c, _d = _a.language, language = _d === void 0 ? 'en' : _d;
|
|
8
|
+
return (_jsx(LanguageContext.Provider, { value: language, children: _jsxs(ThemeProvider, { theme: themes[theme], children: [preflight && _jsx(Preflight, {}), children] }) }));
|
|
7
9
|
};
|
|
8
10
|
export default MailstepThemeProvider;
|
package/ui/index.d.ts
CHANGED
|
@@ -41,8 +41,7 @@ import MultiSelect from './Elements/MultiSelect';
|
|
|
41
41
|
import Select from './Elements/Select';
|
|
42
42
|
import DropdownSelect from './Elements/DropdownSelect';
|
|
43
43
|
import TextArea from './Forms/TextArea';
|
|
44
|
-
|
|
45
|
-
export { DropdownSelect, DatePicker, CommonGrid, Popover, SingleSelect, MultiSelect, Select, Card, CornerDialog, ImageList, LightBox, Modal, Tabs, Alert, Avatar, Badge, BorderedBox, Button, Dropdown, ErrorMessage, Icon, Image, Label, Line, Link, Logo, Pagination, Paragraph, Portal, ProgressBar, SimpleLink, SpaceAround, Spinner, Tag, Toast, Toggle, Typography, Checkbox, Input, RadioButton, ThemeProvider, LanguageProvider, utils, TextArea, };
|
|
44
|
+
export { DropdownSelect, DatePicker, CommonGrid, Popover, SingleSelect, MultiSelect, Select, Card, CornerDialog, ImageList, LightBox, Modal, Tabs, Alert, Avatar, Badge, BorderedBox, Button, Dropdown, ErrorMessage, Icon, Image, Label, Line, Link, Logo, Pagination, Paragraph, Portal, ProgressBar, SimpleLink, SpaceAround, Spinner, Tag, Toast, Toggle, Typography, Checkbox, Input, RadioButton, ThemeProvider, utils, TextArea, };
|
|
46
45
|
export * from './Blocks/CornerDialog';
|
|
47
46
|
export * from './Blocks/ImageList';
|
|
48
47
|
export * from './Blocks/LightBox';
|
|
@@ -86,4 +85,3 @@ export * from './Elements/MultiSelect';
|
|
|
86
85
|
export * from './Elements/Select';
|
|
87
86
|
export * from './Elements/DropdownSelect';
|
|
88
87
|
export * from './Forms/TextArea';
|
|
89
|
-
export * from './Providers/LanguageProvider';
|