@mailstep/design-system 0.8.16-beta.1 → 0.8.16-beta.3
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 +12 -6
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +3 -9
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +0 -1
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +0 -3
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +8 -16
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +0 -1
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +10 -29
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.d.ts +0 -1
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +5 -17
- package/ui/Blocks/CommonGrid/components/GridInfo/index.js +1 -3
- package/ui/Blocks/CommonGrid/components/QuickFilter/QuickFilter.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/QuickFilter/QuickFilter.js +2 -2
- package/ui/Blocks/CommonGrid/store/index.d.ts +6 -4
- package/ui/Blocks/CommonGrid/store/index.js +2 -9
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +0 -30
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +9 -59
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.d.ts +0 -2
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +9 -19
- package/ui/Blocks/CommonGrid/styles.d.ts +0 -1
- package/ui/Blocks/CommonGrid/styles.js +3 -6
- package/ui/Blocks/CommonGrid/types.d.ts +0 -1
- package/ui/Blocks/CommonGrid/utils/index.d.ts +0 -2
- package/ui/Blocks/CommonGrid/utils/index.js +0 -10
- package/ui/Elements/DropdownMenu/components/MenuItem.js +1 -1
- package/ui/Elements/Icon/icons/index.d.ts +0 -2
- package/ui/Elements/Icon/icons/index.js +0 -2
- package/ui/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/ui/ThemeProvider/ThemeProvider.js +1 -1
- package/ui/ThemeProvider/themes/dark.d.ts +152 -0
- package/ui/ThemeProvider/themes/dark.js +14 -0
- package/ui/ThemeProvider/themes/index.d.ts +151 -1
- package/ui/ThemeProvider/themes/index.js +3 -3
- package/ui/ThemeProvider/types.d.ts +13 -33
- package/ui/index.es.js +15239 -15327
- package/ui/index.umd.js +462 -500
- package/ui/utils/index.js +1 -1
- package/ui/utils/translations.d.ts +4 -1
- package/ui/utils/translations.js +2 -2
- package/ui/Blocks/CommonGrid/components/MobileFilterModal.d.ts +0 -20
- package/ui/Blocks/CommonGrid/components/MobileFilterModal.js +0 -69
- package/ui/Blocks/CommonGrid/components/MobileOverlayWrapper.d.ts +0 -1
- package/ui/Blocks/CommonGrid/components/MobileOverlayWrapper.js +0 -7
- package/ui/Blocks/CommonGrid/components/MobileSortModal.d.ts +0 -13
- package/ui/Blocks/CommonGrid/components/MobileSortModal.js +0 -34
- package/ui/Elements/Icon/icons/Filter.d.ts +0 -4
- package/ui/Elements/Icon/icons/Filter.js +0 -13
- package/ui/Elements/Icon/icons/Sort.d.ts +0 -4
- package/ui/Elements/Icon/icons/Sort.js +0 -13
- package/ui/ThemeProvider/themes/light.d.ts +0 -4
- package/ui/ThemeProvider/themes/light.js +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.8.16-beta.
|
|
3
|
+
"version": "0.8.16-beta.3",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
"deploy:win": "npm run build:win && npm publish ./build",
|
|
20
20
|
"dev": "yarn storybook",
|
|
21
21
|
"test": "echo \"The tests are still waiting to be written, but it seems like they're really good at procrastinating!\"",
|
|
22
|
-
"lint": "eslint
|
|
22
|
+
"lint": "eslint ./packages/ui/**/*.{ts,tsx}",
|
|
23
|
+
"prepare": "husky install"
|
|
24
|
+
},
|
|
25
|
+
"lint-staged": {
|
|
26
|
+
"*.{js,ts,tsx}": "yarn eslint --fix"
|
|
23
27
|
},
|
|
24
28
|
"devDependencies": {
|
|
25
29
|
"@babel/core": "^7.20.12",
|
|
@@ -40,6 +44,7 @@
|
|
|
40
44
|
"@lingui/react": "3.17.2",
|
|
41
45
|
"@popperjs/core": "^2.11.8",
|
|
42
46
|
"@storybook/addon-designs": "^11.1.2",
|
|
47
|
+
"@storybook/addon-docs": "10.2.8",
|
|
43
48
|
"@storybook/addon-links": "10.2.8",
|
|
44
49
|
"@storybook/react-webpack5": "10.2.8",
|
|
45
50
|
"@svgr/rollup": "^8.0.1",
|
|
@@ -74,7 +79,9 @@
|
|
|
74
79
|
"eslint-plugin-react-perf": "^3.3.2",
|
|
75
80
|
"eslint-plugin-storybook": "10.2.8",
|
|
76
81
|
"faker": "^5.1.0",
|
|
82
|
+
"husky": "^9.1.7",
|
|
77
83
|
"immer": "9.0.7",
|
|
84
|
+
"lint-staged": "^16.4.0",
|
|
78
85
|
"lodash": "^4.17.21",
|
|
79
86
|
"luxon": "^3.4.4",
|
|
80
87
|
"moment": "^2.30.1",
|
|
@@ -98,12 +105,11 @@
|
|
|
98
105
|
"styled-components": "^5.3.10",
|
|
99
106
|
"swiper": "^11.0.3",
|
|
100
107
|
"tslib": "^2.6.2",
|
|
101
|
-
"typescript": "
|
|
108
|
+
"typescript": "5.1.3",
|
|
102
109
|
"vite": "^5.0.10",
|
|
103
110
|
"vite-plugin-dts": "^3.6.4",
|
|
104
111
|
"vite-plugin-static-copy": "^1.0.0",
|
|
105
|
-
"webpack": "^5.82.1"
|
|
106
|
-
"@storybook/addon-docs": "10.2.8"
|
|
112
|
+
"webpack": "^5.82.1"
|
|
107
113
|
},
|
|
108
114
|
"peerDependencies": {
|
|
109
115
|
"@dnd-kit/core": "^6.3.1",
|
|
@@ -141,7 +147,7 @@
|
|
|
141
147
|
"styled-components": "^5.3.10",
|
|
142
148
|
"swiper": "^11.0.3",
|
|
143
149
|
"tslib": "^2.6.2",
|
|
144
|
-
"typescript": "
|
|
150
|
+
"typescript": "5.1.3"
|
|
145
151
|
},
|
|
146
152
|
"resolutions": {
|
|
147
153
|
"jackspeak": "2.1.1"
|
|
@@ -23,15 +23,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
24
|
import { useRef, useMemo, useState } from 'react';
|
|
25
25
|
import { Pagination } from '../../Elements/Pagination';
|
|
26
|
-
import { useCheckDeviceWidth } from '../../utils/CheckDeviceWidth/checkDeviceWidth';
|
|
27
26
|
import HidePrint from '../HidePrint/HidePrint';
|
|
28
27
|
import { useModal } from '../Modal/hooks/useModal';
|
|
29
28
|
import ActionHead from './components/ActionHead';
|
|
30
29
|
import ControlButtons from './components/ControlButtons';
|
|
31
30
|
import { GridInfo } from './components/GridInfo';
|
|
32
31
|
import { GridModals } from './components/GridModals';
|
|
33
|
-
import MobileFilterModal from './components/MobileFilterModal';
|
|
34
|
-
import MobileSortModal from './components/MobileSortModal';
|
|
35
32
|
import TablePagination from './components/TablePagination';
|
|
36
33
|
import useEditReadAsColumn from './hooks/useEditReadAsColumn';
|
|
37
34
|
import { useGridAutoRowsPerPage } from './hooks/useGridAutoRowsPerPage';
|
|
@@ -55,7 +52,6 @@ var CommonGridContainer = function (props) {
|
|
|
55
52
|
var hasFilters = !!props.columnsDefinitions.find(function (col) { return col.filtering; });
|
|
56
53
|
var hasGroupsOrFilters = hasGroups || hasFilters;
|
|
57
54
|
var autoRowsPerPage = getRowsPerPage(gridRef, withPagination, withButtonStrip, hasGroupsOrFilters);
|
|
58
|
-
var isMobile = useCheckDeviceWidth().isMobile;
|
|
59
55
|
useGridAutoRowsPerPage({
|
|
60
56
|
autoHeight: autoHeight,
|
|
61
57
|
gridActions: gridActions,
|
|
@@ -74,12 +70,10 @@ var CommonGridContainer = function (props) {
|
|
|
74
70
|
onClose: onClose
|
|
75
71
|
}), columnsConfigValues = _j.columnsConfigValues, setColumnsConfigOptions = _j.setColumnsConfigOptions, onConfirmForm = _j.onConfirmForm, resetColumnConfig = _j.resetColumnConfig, handleDragEnd = _j.handleDragEnd, onCloseForm = _j.onCloseForm, displayColumnsDefinitions = _j.displayColumnsDefinitions, manageColumnsFormDefinitions = _j.manageColumnsFormDefinitions;
|
|
76
72
|
var _k = usePresetState(), isPresetsModalOpen = _k.isPresetsModalOpen, onClosePresetsModal = _k.onClosePresetsModal, onOpenPresetsModal = _k.onOpenPresetsModal, setSelectedPresetName = _k.setSelectedPresetName, selectedPresetName = _k.selectedPresetName;
|
|
77
|
-
var _l =
|
|
78
|
-
var _m = useModal(), isMobileSortOpen = _m.isOpen, onOpenMobileSort = _m.onOpen, closeMobileSort = _m.onClose;
|
|
79
|
-
var _o = hasSortTerminated({
|
|
73
|
+
var _l = hasSortTerminated({
|
|
80
74
|
allowSortingOnlyUnderTotalRows: allowSortingOnlyUnderTotalRows,
|
|
81
75
|
totalRowsCount: passDownProps === null || passDownProps === void 0 ? void 0 : passDownProps.totalRowsCount
|
|
82
|
-
}), isSortTerminatedAppeal =
|
|
83
|
-
return (_jsxs(_Fragment, { children: [_jsxs(ContentContainer, { ref: gridRef, children: [_jsxs(CommonGridWrap, { withPagination: withPagination, children: [withButtonStrip && (_jsx(HidePrint, { children: _jsx(StyledButtonStrip, { className: "buttonsStrip", children: _jsx(ControlButtons, { hideControlButtons: hideControlButtons, extraControlButtons: extendedExtraControlButtons, gridActions: gridActions, gridSelectors: gridSelectors, quickFilter: quickFilter, columns: columns, filters: filters, setDisplayManageColumnButton: setDisplayManageColumnButton, displayManageColumnButton: displayManageColumnButton, openManageColumnForm: openManageColumnForm, onOpenPresetsModal: onOpenPresetsModal, selectedPresetName: selectedPresetName, withPresets: withPresets, gridName: gridName, withManageColumnButton: withManageColumnButton
|
|
76
|
+
}), isSortTerminatedAppeal = _l.isSortTerminatedAppeal, isSortTerminated = _l.isSortTerminated;
|
|
77
|
+
return (_jsxs(_Fragment, { children: [_jsxs(ContentContainer, { ref: gridRef, children: [_jsxs(CommonGridWrap, { withPagination: withPagination, children: [withButtonStrip && (_jsx(HidePrint, { children: _jsx(StyledButtonStrip, { className: "buttonsStrip", children: _jsx(ControlButtons, { hideControlButtons: hideControlButtons, extraControlButtons: extendedExtraControlButtons, gridActions: gridActions, gridSelectors: gridSelectors, quickFilter: quickFilter, columns: columns, filters: filters, setDisplayManageColumnButton: setDisplayManageColumnButton, displayManageColumnButton: displayManageColumnButton, openManageColumnForm: openManageColumnForm, onOpenPresetsModal: onOpenPresetsModal, selectedPresetName: selectedPresetName, withPresets: withPresets, gridName: gridName, withManageColumnButton: withManageColumnButton }) }) })), _jsx(CommonGridWithStyles, __assign({}, passDownProps, modifiedPassDownProps, { withButtonStrip: withButtonStrip, hasGroupsOrFilters: hasGroupsOrFilters, filters: filters, floatingButtonProps: floatingButtonProps, handleDragEnd: handleDragEnd(false), displayColumnsDefinitions: displayColumnsDefinitions, hasFilters: hasFilters, hasGroups: hasGroups, isSortTerminated: isSortTerminated, hasColouredRows: true }))] }), _jsxs(BottomWrapper, { withPagination: withPagination, children: [(processCheckedValues || !!((_a = actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.actionOptions) === null || _a === void 0 ? void 0 : _a.length)) && (_jsx(ActionHead, { rowsData: rowsData, onBatchAction: onBatchAction, gridActions: gridActions, gridSelectors: gridSelectors, actionOptions: actionColumnDefinition === null || actionColumnDefinition === void 0 ? void 0 : actionColumnDefinition.actionOptions, processCheckedValues: processCheckedValues, processCheckedValuesTitle: processCheckedValuesTitle })), _jsxs(x.div, { display: "flex", justifyContent: "space-between", alignItems: "center", w: "100%", children: [_jsx(GridInfo, { isSortTerminatedAppeal: isSortTerminatedAppeal, isSortTerminated: isSortTerminated }), withPagination && (_jsxs(x.div, { display: "flex", alignItems: "center", className: "paginatorWrapper", 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, autoRowsPerPage: autoRowsPerPage })] }))] })] })] }), _jsx(GridModals, { manageColumnFormVisible: manageColumnFormVisible, onCloseForm: onCloseForm, resetColumnConfig: resetColumnConfig, onConfirmForm: onConfirmForm, manageColumnsFormDefinitions: manageColumnsFormDefinitions, columnsConfigValues: columnsConfigValues, setColumnsConfigOptions: setColumnsConfigOptions, handleDragEnd: handleDragEnd(true), gridName: gridName, gridActions: gridActions, gridSelectors: gridSelectors, onClosePresetsModal: onClosePresetsModal, isPresetsModalOpen: isPresetsModalOpen, selectedPresetName: selectedPresetName, setSelectedPresetName: setSelectedPresetName })] }));
|
|
84
78
|
};
|
|
85
79
|
export default CommonGridContainer;
|
|
@@ -29,7 +29,6 @@ var withReduxActions = function (gridName, prefix) {
|
|
|
29
29
|
setFilters: actions.setFilters,
|
|
30
30
|
resetFilters: actions.resetFilters,
|
|
31
31
|
addSorting: actions.addSorting,
|
|
32
|
-
resetSorting: actions.resetSorting,
|
|
33
32
|
clearSettings: actions.clearSettings,
|
|
34
33
|
setColumnWidth: actions.setColumnWidth,
|
|
35
34
|
resetGrid: actions.resetGrid,
|
|
@@ -17,9 +17,6 @@ type Props = {
|
|
|
17
17
|
selectedPresetName: string;
|
|
18
18
|
withPresets?: boolean;
|
|
19
19
|
withManageColumnButton?: boolean;
|
|
20
|
-
onOpenMobileFilters?: () => void;
|
|
21
|
-
onOpenMobileSorting?: () => void;
|
|
22
|
-
isSortTerminated: boolean;
|
|
23
20
|
};
|
|
24
21
|
declare const ControlButtons: FC<Props>;
|
|
25
22
|
export default ControlButtons;
|
|
@@ -10,45 +10,37 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useEffect
|
|
13
|
+
import { useEffect } from 'react';
|
|
14
14
|
import Button from '../../../../Elements/Button/Button';
|
|
15
|
-
import { Filter } from '../../../../Elements/Icon/icons/Filter';
|
|
16
15
|
import { Settings2 } from '../../../../Elements/Icon/icons/Settings2';
|
|
17
|
-
import { Sort } from '../../../../Elements/Icon/icons/Sort';
|
|
18
16
|
import Tag from '../../../../Elements/Tag/Tag';
|
|
19
17
|
import { palettes } from '../../../../Elements/Tag/palettes';
|
|
20
18
|
import { H6 } from '../../../../Elements/Typography';
|
|
21
19
|
import useQuickFilter from '../../hooks/useQuickFilter';
|
|
22
20
|
import { ExtraControlButtonPosition } from '../../types';
|
|
23
|
-
import { isFilterActive } from '../../utils';
|
|
24
21
|
import ExtraControlButtons from '../ExtraControlButtons';
|
|
25
22
|
import QuickFilter from '../QuickFilter';
|
|
26
23
|
import { i18n } from '@lingui/core';
|
|
27
24
|
import { Trans } from '@lingui/react';
|
|
28
|
-
import {
|
|
25
|
+
import { x } from '@xstyled/styled-components';
|
|
29
26
|
import { ControlButtonsContainer, Left, Right, StyledColumnButton } from './styles';
|
|
30
27
|
var ControlButtons = function (_a) {
|
|
31
|
-
var _b,
|
|
32
|
-
var
|
|
33
|
-
var _e = useQuickFilter({
|
|
28
|
+
var extraControlButtons = _a.extraControlButtons, gridActions = _a.gridActions, gridSelectors = _a.gridSelectors, _b = _a.quickFilter, quickFilter = _b === void 0 ? '' : _b, columns = _a.columns, filters = _a.filters, hideControlButtons = _a.hideControlButtons, displayManageColumnButton = _a.displayManageColumnButton, openManageColumnForm = _a.openManageColumnForm, setDisplayManageColumnButton = _a.setDisplayManageColumnButton, onOpenPresetsModal = _a.onOpenPresetsModal, gridName = _a.gridName, selectedPresetName = _a.selectedPresetName, withPresets = _a.withPresets, withManageColumnButton = _a.withManageColumnButton;
|
|
29
|
+
var _c = useQuickFilter({
|
|
34
30
|
gridActions: gridActions,
|
|
35
31
|
gridSelectors: gridSelectors,
|
|
36
32
|
quickFilter: quickFilter,
|
|
37
33
|
columns: columns,
|
|
38
34
|
filters: filters
|
|
39
|
-
}), searchedValue =
|
|
35
|
+
}), searchedValue = _c.searchedValue, translatedValue = _c.translatedValue, onChangeInputValue = _c.onChangeInputValue, onClear = _c.onClear, onClearSettings = _c.onClearSettings, onDisplayInput = _c.onDisplayInput, displayInput = _c.displayInput, isMobileInputView = _c.isMobileInputView, isMobile = _c.isMobile, filter = _c.filter;
|
|
40
36
|
useEffect(function () {
|
|
41
37
|
setDisplayManageColumnButton(!isMobileInputView && !!withManageColumnButton);
|
|
42
38
|
}, [isMobileInputView, withManageColumnButton, setDisplayManageColumnButton]);
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
var hasFilterableColumns = !!(columns === null || columns === void 0 ? void 0 : columns.some(function (col) { return col.filtering; }));
|
|
46
|
-
var hasSortableColumns = !!(columns === null || columns === void 0 ? void 0 : columns.some(function (col) { return col.sorting; }));
|
|
47
|
-
var sortCount = (_c = (_b = gridSelectors.sorting) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
|
|
48
|
-
return (_jsxs(ControlButtonsContainer, { children: [_jsxs(Left, { children: [!hideControlButtons && (_jsxs(_Fragment, { children: [quickFilter && !isMobile && (_jsx(QuickFilter, { searchedValue: searchedValue, placeholderText: i18n._({
|
|
39
|
+
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 !== ''; });
|
|
40
|
+
return (_jsxs(ControlButtonsContainer, { children: [_jsxs(Left, { children: [!hideControlButtons && (_jsxs(_Fragment, { children: [quickFilter && (_jsx(QuickFilter, { searchedValue: searchedValue, placeholderText: i18n._({
|
|
49
41
|
id: 'controlButtons.searchPlaceholder',
|
|
50
42
|
message: "Search ".concat(translatedValue, " ..."),
|
|
51
43
|
values: { translatedValue: translatedValue }
|
|
52
|
-
}), onChange: onChangeInputValue, onClear: onClear, onClick: onDisplayInput, displayInput: displayInput, isMobileInputView: isMobileInputView })), _jsx(ExtraControlButtons, { extraControlButtons: extraControlButtons, targetPosition: ExtraControlButtonPosition.TopLeft }), _jsx(x.div, { children:
|
|
44
|
+
}), onChange: onChangeInputValue, onClear: onClear, onClick: onDisplayInput, displayInput: displayInput, isMobileInputView: isMobileInputView, alwaysShowClear: isMobile })), _jsx(ExtraControlButtons, { extraControlButtons: extraControlButtons, targetPosition: ExtraControlButtonPosition.TopLeft }), _jsx(x.div, { children: filtersOn && (_jsx(Button, { type: "button", onClick: onClearSettings, variant: "default", appearance: "secondary", "data-cy": "resetFiltersBtn", children: _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset" }) })) })] })), withPresets && gridName && (_jsxs(_Fragment, { children: [_jsx(x.div, { mx: "12px", children: _jsx(Button, { onClick: onOpenPresetsModal, type: "button", variant: "default", appearance: "tertiary", children: _jsx(Trans, { id: "dataGrid.presets.title", message: "Presets" }) }) }), selectedPresetName && (_jsx(Tag, __assign({ size: "medium" }, palettes.redWhite, { children: _jsx(H6, { mt: 0, mb: 0, variant: "semiBold", children: selectedPresetName }) })))] }))] }), _jsxs(Right, { children: [_jsx(ExtraControlButtons, { extraControlButtons: extraControlButtons, targetPosition: ExtraControlButtonPosition.TopRight }), displayManageColumnButton && (_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" }) }) }))] })] }));
|
|
53
45
|
};
|
|
54
46
|
export default ControlButtons;
|
|
@@ -5,7 +5,6 @@ export declare const Row: import('styled-components').StyledComponent<"div", imp
|
|
|
5
5
|
type Props = {
|
|
6
6
|
extraControlButtons: CommonGridProps['extraControlButtons'];
|
|
7
7
|
targetPosition: ExtraControlButton['position'];
|
|
8
|
-
isMobile?: boolean;
|
|
9
8
|
};
|
|
10
9
|
declare const ExtraControlButtons: FC<Props>;
|
|
11
10
|
export default ExtraControlButtons;
|
|
@@ -16,9 +16,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import Button from '../../../../Elements/Button/Button';
|
|
18
18
|
import DropdownSelect from '../../../../Elements/DropdownSelect';
|
|
19
|
-
import ButtonMore from '../ButtonMore/ButtonMore';
|
|
20
19
|
import styled, { x } from '@xstyled/styled-components';
|
|
21
20
|
export var Row = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n & > * {\n margin-right: 12px;\n }\n z-index: 2;\n"], ["\n display: flex;\n & > * {\n margin-right: 12px;\n }\n z-index: 2;\n"])));
|
|
21
|
+
var StyledButton = styled(Button)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: none;\n\n @media (min-width: 1024px) {\n display: block;\n }\n"], ["\n display: none;\n\n @media (min-width: 1024px) {\n display: block;\n }\n"])));
|
|
22
22
|
var ControlButton = function (_a) {
|
|
23
23
|
var hide = _a.hide, node = _a.node, label = _a.label, appearance = _a.appearance, variant = _a.variant, disabled = _a.disabled, onClick = _a.onClick, onSelect = _a.onSelect, options = _a.options, hideChevron = _a.hideChevron, iconLeft = _a.iconLeft, buttonProps = _a.buttonProps;
|
|
24
24
|
if (hide) {
|
|
@@ -30,36 +30,17 @@ var ControlButton = function (_a) {
|
|
|
30
30
|
return (_jsx(DropdownSelect, { label: label || '', appearance: appearance || 'secondary', variant: variant || 'default', options: options, showChevron: !hideChevron, onSelect: onSelect, disabled: disabled }));
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
return (_jsx(
|
|
33
|
+
return (_jsx(StyledButton, __assign({ type: "button", onClick: onClick, disabled: disabled, variant: variant || 'default', appearance: appearance || 'primary', iconLeft: iconLeft }, buttonProps, { children: label })));
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
var ExtraControlButtons = function (_a) {
|
|
37
|
-
var extraControlButtons = _a.extraControlButtons, targetPosition = _a.targetPosition
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var onSelect = _a.onSelect, onClick = _a.onClick, options = _a.options, label = _a.label;
|
|
45
|
-
if (options && onSelect) {
|
|
46
|
-
return options.map(function (option) { return ({
|
|
47
|
-
title: typeof label === 'string' && !option.label.startsWith(String(label)) ? "".concat(label, ": ").concat(option.label) : option.label,
|
|
48
|
-
onClick: function () {
|
|
49
|
-
onSelect(option.value);
|
|
50
|
-
}
|
|
51
|
-
}); });
|
|
52
|
-
}
|
|
53
|
-
if (label && onClick) {
|
|
54
|
-
return [{ title: label, onClick: onClick }];
|
|
55
|
-
}
|
|
56
|
-
return [];
|
|
57
|
-
});
|
|
58
|
-
if (items.length === 0)
|
|
59
|
-
return null;
|
|
60
|
-
return _jsx(ButtonMore, { items: items });
|
|
61
|
-
}
|
|
62
|
-
return (_jsx(Row, { children: buttons.map(function (button, idx) { return (_jsx(x.div, { children: _jsx(ControlButton, __assign({}, button)) }, idx)); }) }));
|
|
37
|
+
var extraControlButtons = _a.extraControlButtons, targetPosition = _a.targetPosition;
|
|
38
|
+
return (_jsx(Row, { children: (extraControlButtons || [])
|
|
39
|
+
.filter(function (_a) {
|
|
40
|
+
var position = _a.position;
|
|
41
|
+
return position == targetPosition;
|
|
42
|
+
})
|
|
43
|
+
.map(function (button, idx) { return (_jsx(x.div, { children: _jsx(ControlButton, __assign({}, button)) }, idx)); }) }));
|
|
63
44
|
};
|
|
64
45
|
export default ExtraControlButtons;
|
|
65
|
-
var templateObject_1;
|
|
46
|
+
var templateObject_1, templateObject_2;
|
|
@@ -11,7 +11,6 @@ type DatePickerRangeProps = FilterComponentProps<Date[]> & {
|
|
|
11
11
|
type DateRangeProps = DatePickerRangeProps & {
|
|
12
12
|
error?: string;
|
|
13
13
|
label?: string;
|
|
14
|
-
compact?: boolean;
|
|
15
14
|
};
|
|
16
15
|
declare const DatePickerRange: FC<DateRangeProps>;
|
|
17
16
|
export default DatePickerRange;
|
|
@@ -33,27 +33,15 @@ import { useClickOutside } from '../../../../Modal/hooks/useClickOutside';
|
|
|
33
33
|
import { getCleanValues } from './utils/getCleanValues';
|
|
34
34
|
import { pickerRangeToString } from './utils/pickerRangeToString';
|
|
35
35
|
import { i18n } from '@lingui/core';
|
|
36
|
-
import styled
|
|
37
|
-
var RangeWrapper = styled.div(
|
|
38
|
-
var $compact = _a.$compact;
|
|
39
|
-
return ($compact ? 'flex' : 'inline-flex');
|
|
40
|
-
}, function (_a) {
|
|
41
|
-
var $compact = _a.$compact;
|
|
42
|
-
return ($compact ? 'column' : 'row');
|
|
43
|
-
}, function (_a) {
|
|
44
|
-
var $compact = _a.$compact;
|
|
45
|
-
return ($compact ? '0' : '20px');
|
|
46
|
-
}, function (_a) {
|
|
47
|
-
var $compact = _a.$compact;
|
|
48
|
-
return $compact && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .rdtPicker {\n min-width: unset;\n width: 100%;\n box-sizing: border-box;\n padding: 0.5rem 0.5rem;\n }\n .rdtPicker .rdtDays {\n min-width: unset;\n }\n .rdtPicker td {\n padding: 0 0.2rem;\n }\n "], ["\n .rdtPicker {\n min-width: unset;\n width: 100%;\n box-sizing: border-box;\n padding: 0.5rem 0.5rem;\n }\n .rdtPicker .rdtDays {\n min-width: unset;\n }\n .rdtPicker td {\n padding: 0 0.2rem;\n }\n "])));
|
|
49
|
-
});
|
|
36
|
+
import styled from '@xstyled/styled-components';
|
|
37
|
+
var RangeWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n margin-right: 20px;\n"], ["\n display: inline-flex;\n margin-right: 20px;\n"])));
|
|
50
38
|
var OverlayComponentDefault = function (_a) {
|
|
51
39
|
var children = _a.children;
|
|
52
40
|
return _jsx("div", { children: children });
|
|
53
41
|
};
|
|
54
42
|
var DatePickerRange = function (props) {
|
|
55
43
|
var _a, _b, _c;
|
|
56
|
-
var onChange = props.onChange, error = props.error, label = props.label, value = props.value, others = props.others, filterTime = props.filterTime, initialView = props.initialView,
|
|
44
|
+
var onChange = props.onChange, error = props.error, label = props.label, value = props.value, others = props.others, filterTime = props.filterTime, initialView = props.initialView, _d = props.OverlayComponent, OverlayComponent = _d === void 0 ? OverlayComponentDefault : _d, rest = __rest(props, ["onChange", "error", "label", "value", "others", "filterTime", "initialView", "OverlayComponent"]);
|
|
57
45
|
var _e = useState((_a = value === null || value === void 0 ? void 0 : value[0]) !== null && _a !== void 0 ? _a : undefined), startRangeValue = _e[0], setStartRangeValue = _e[1];
|
|
58
46
|
var _f = useState((_b = value === null || value === void 0 ? void 0 : value[1]) !== null && _b !== void 0 ? _b : undefined), endRangeValue = _f[0], setEndRangeValue = _f[1];
|
|
59
47
|
var timeFormat = filterTime ? 'HH:mm' : false;
|
|
@@ -106,7 +94,7 @@ var DatePickerRange = function (props) {
|
|
|
106
94
|
// Check if the second value is not selected and the first value is the same as the initial value
|
|
107
95
|
var secondDatePickerValue = cleanValue[1] === null ? cleanValue[0] : cleanValue[1];
|
|
108
96
|
var ref = useClickOutside({ onClose: onClose });
|
|
109
|
-
return (_jsxs("div", { ref: ref, children: [_jsx(Input, { name: props.name, placeholder: placeholder, type: "text", icon: "calendar", value: pickerRangeToString(cleanValue, others), label: props.label, onFocus: openPicker, iconOnClick: openPicker, onClear: clear, error: error, readOnly: true }), _jsx(OverlayComponent, { children: _jsx(_Fragment, { children: isOpen && (_jsxs(RangeWrapper, {
|
|
97
|
+
return (_jsxs("div", { ref: ref, children: [_jsx(Input, { name: props.name, placeholder: placeholder, type: "text", icon: "calendar", value: pickerRangeToString(cleanValue, others), label: props.label, onFocus: openPicker, iconOnClick: openPicker, onClear: clear, error: error, readOnly: true }), _jsx(OverlayComponent, { children: _jsx(_Fragment, { children: isOpen && (_jsxs(RangeWrapper, { className: "ignore-element-for-closing-hook", children: [_jsx(DatePicker, __assign({}, rest, { timeFormat: timeFormat, value: (_c = cleanValue[0]) !== null && _c !== void 0 ? _c : '', initialViewDate: initialViewDate[0], secondValue: endRangeValue, onChange: setDateFrom, others: others === null || others === void 0 ? void 0 : others[0], onChangeOthers: handleOthersChangeFrom, icon: false, label: isOpen && i18n._({ id: 'dataGrid.filterCell.from', message: 'From' }), isValidDate: isValidDateFrom, input: false, spaceAround: true, open: true })), _jsx(DatePicker, __assign({}, rest, { timeFormat: timeFormat, value: secondDatePickerValue, initialViewDate: initialViewDate[1], secondValue: startRangeValue, onChange: setDateTo, others: others === null || others === void 0 ? void 0 : others[1], onChangeOthers: handleOthersChangeTo, icon: false, label: isOpen && i18n._({ id: 'dataGrid.filterCell.to', message: 'To' }), isValidDate: isValidDateTo, input: false, spaceAround: true, open: true, isSecondDatePicker: true }))] })) }) })] }));
|
|
110
98
|
};
|
|
111
99
|
export default DatePickerRange;
|
|
112
|
-
var templateObject_1
|
|
100
|
+
var templateObject_1;
|
|
@@ -4,7 +4,5 @@ import { Trans } from '@lingui/react';
|
|
|
4
4
|
import { x } from '@xstyled/styled-components';
|
|
5
5
|
export var GridInfo = function (_a) {
|
|
6
6
|
var isSortTerminatedAppeal = _a.isSortTerminatedAppeal, isSortTerminated = _a.isSortTerminated;
|
|
7
|
-
|
|
8
|
-
return null;
|
|
9
|
-
return (_jsxs(x.span, { w: "100%", ml: "8px", fontSize: "12px", display: "flex", gap: "8px", alignItems: "center", children: [isSortTerminatedAppeal && !isSortTerminated && (_jsxs(_Fragment, { children: [_jsx(Icon, { icon: "circleTriangle", size: "20px", fill: "yellow70" }), _jsx(Trans, { id: "dataGrid.sortingTerminatedAppeal", message: "Too many results, please set a filter" })] })), isSortTerminated && (_jsxs(_Fragment, { children: [_jsx(Icon, { icon: "circleTriangle", size: "20px", fill: "dangerColor" }), _jsx(Trans, { id: "dataGrid.sortingTerminated", message: "Too many results, sorting cannot be used" })] }))] }));
|
|
7
|
+
return (_jsxs(x.span, { ml: "8px", fontSize: "12px", display: "flex", gap: "8px", alignItems: "center", children: [isSortTerminatedAppeal && !isSortTerminated && (_jsxs(_Fragment, { children: [_jsx(Icon, { icon: "circleTriangle", size: "20px", fill: "yellow70" }), _jsx(Trans, { id: "dataGrid.sortingTerminatedAppeal", message: "Too many results, please set a filter" })] })), isSortTerminated && (_jsxs(_Fragment, { children: [_jsx(Icon, { icon: "circleTriangle", size: "20px", fill: "dangerColor" }), _jsx(Trans, { id: "dataGrid.sortingTerminated", message: "Too many results, sorting cannot be used" })] }))] }));
|
|
10
8
|
};
|
|
@@ -10,5 +10,5 @@ type QuickFilterProps = {
|
|
|
10
10
|
isMobileInputView?: boolean;
|
|
11
11
|
alwaysShowClear?: boolean;
|
|
12
12
|
};
|
|
13
|
-
declare const QuickFilter: ({ searchedValue, placeholderText, onChange, onClick, displayInput, onClear, isMobileInputView, alwaysShowClear }: QuickFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const QuickFilter: ({ searchedValue, placeholderText, onChange, onClick, displayInput, onClear, isMobileInputView, alwaysShowClear, }: QuickFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default QuickFilter;
|
|
@@ -3,9 +3,9 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import Button from '../../../../Elements/Button';
|
|
7
6
|
import Input from '../../../../Forms/Input';
|
|
8
7
|
import styled, { x } from '@xstyled/styled-components';
|
|
8
|
+
import Button from '../../../../Elements/Button';
|
|
9
9
|
var StyledInput = styled(Input)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: ", ";\n z-index: ", ";\n width: ", ";\n"], ["\n position: ", ";\n z-index: ", ";\n width: ", ";\n"])), function (_a) {
|
|
10
10
|
var isMobileInputView = _a.isMobileInputView;
|
|
11
11
|
return (isMobileInputView ? 'absolute' : 'relative');
|
|
@@ -14,7 +14,7 @@ var StyledInput = styled(Input)(templateObject_1 || (templateObject_1 = __makeTe
|
|
|
14
14
|
return (isMobileInputView ? '3' : '1');
|
|
15
15
|
}, function (_a) {
|
|
16
16
|
var isMobileInputView = _a.isMobileInputView;
|
|
17
|
-
return (isMobileInputView ? '
|
|
17
|
+
return (isMobileInputView ? '90vw' : 'auto');
|
|
18
18
|
});
|
|
19
19
|
var QuickFilter = function (_a) {
|
|
20
20
|
var searchedValue = _a.searchedValue, placeholderText = _a.placeholderText, onChange = _a.onChange, onClick = _a.onClick, displayInput = _a.displayInput, onClear = _a.onClear, isMobileInputView = _a.isMobileInputView, alwaysShowClear = _a.alwaysShowClear;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FilterProps, SortingValueType, InitProps, GridState, GridSelectorsType, ColumnConfig, Filtering, GridPresets } from '../types';
|
|
2
2
|
|
|
3
3
|
type DefaultRootState = {};
|
|
4
|
-
export type MultiState =
|
|
4
|
+
export type MultiState = {
|
|
5
|
+
[key: string]: GridState;
|
|
6
|
+
};
|
|
5
7
|
export declare const initialState: GridState;
|
|
6
8
|
export declare const actionPrefix = "@store/CommonGrid";
|
|
7
9
|
export declare const actionTypes: {
|
|
@@ -20,7 +22,6 @@ export declare const actionTypes: {
|
|
|
20
22
|
addFilter: string;
|
|
21
23
|
setFilters: string;
|
|
22
24
|
addSorting: string;
|
|
23
|
-
resetSorting: string;
|
|
24
25
|
clearSettings: string;
|
|
25
26
|
resetGrid: string;
|
|
26
27
|
setColumnWidth: string;
|
|
@@ -39,7 +40,9 @@ export declare const createActions: (gridName: string) => {
|
|
|
39
40
|
setPresets: (presets: GridPresets) => Action;
|
|
40
41
|
createPreset: (presetName: string, filters: Filtering) => Action;
|
|
41
42
|
deletePreset: (presetName: string) => Action;
|
|
42
|
-
setColumnWidth: (columnsWidth:
|
|
43
|
+
setColumnWidth: (columnsWidth: {
|
|
44
|
+
[anyKey: string]: number;
|
|
45
|
+
} | null, columnLayout: 'normal' | 'no-scroll' | 'sticky') => Action;
|
|
43
46
|
resetGrid: () => Action;
|
|
44
47
|
setColumnsOrder: (columnsOrder: string[]) => Action;
|
|
45
48
|
setRowsPerPage: (rowsPerPage: number) => Action;
|
|
@@ -47,7 +50,6 @@ export declare const createActions: (gridName: string) => {
|
|
|
47
50
|
addFilter: (column: string, value: any, filterProps: FilterProps, others?: any) => Action;
|
|
48
51
|
setFilters: (filters: Filtering) => Action;
|
|
49
52
|
addSorting: (column: string, direction: SortingValueType) => Action;
|
|
50
|
-
resetSorting: () => Action;
|
|
51
53
|
clearSettings: () => Action;
|
|
52
54
|
};
|
|
53
55
|
export declare const createSelectors: (gridName: string) => {
|
|
@@ -46,7 +46,6 @@ export var actionTypes = {
|
|
|
46
46
|
addFilter: "".concat(actionPrefix, "/addFilter"),
|
|
47
47
|
setFilters: "".concat(actionPrefix, "/setFilters"),
|
|
48
48
|
addSorting: "".concat(actionPrefix, "/addSorting"),
|
|
49
|
-
resetSorting: "".concat(actionPrefix, "/resetSorting"),
|
|
50
49
|
clearSettings: "".concat(actionPrefix, "/clearSettings"),
|
|
51
50
|
resetGrid: "".concat(actionPrefix, "/resetGrid"),
|
|
52
51
|
setColumnWidth: "".concat(actionPrefix, "/setColumnWidth"),
|
|
@@ -57,7 +56,7 @@ export default (function (state, action) {
|
|
|
57
56
|
if (state === void 0) { state = {}; }
|
|
58
57
|
return produce(state, function (draft) {
|
|
59
58
|
var _a, _b, _c;
|
|
60
|
-
var _d, _e, _f, _g, _h
|
|
59
|
+
var _d, _e, _f, _g, _h;
|
|
61
60
|
// version migrations
|
|
62
61
|
if (!migrationChecked && state && Object.keys(state).length > 0) {
|
|
63
62
|
draft = migrateState(draft);
|
|
@@ -119,9 +118,6 @@ export default (function (state, action) {
|
|
|
119
118
|
}
|
|
120
119
|
draft[gridName].sorting = sorting;
|
|
121
120
|
break;
|
|
122
|
-
case actionTypes.resetSorting:
|
|
123
|
-
draft[gridName].sorting = ((_j = draft[gridName].defaultSorting) === null || _j === void 0 ? void 0 : _j.length) ? draft[gridName].defaultSorting : initialState.sorting;
|
|
124
|
-
break;
|
|
125
121
|
case actionTypes.clearSettings:
|
|
126
122
|
draft[gridName].page = initialState.page;
|
|
127
123
|
draft[gridName].filter = initialState.filter;
|
|
@@ -215,7 +211,6 @@ export var createActions = function (gridName) { return ({
|
|
|
215
211
|
column: column,
|
|
216
212
|
direction: direction
|
|
217
213
|
}); },
|
|
218
|
-
resetSorting: function () { return ({ gridName: gridName, type: actionTypes.resetSorting }); },
|
|
219
214
|
clearSettings: function () { return ({ gridName: gridName, type: actionTypes.clearSettings }); }
|
|
220
215
|
}); };
|
|
221
216
|
export var createSelectors = function (gridName) { return ({
|
|
@@ -229,9 +224,7 @@ export var createSelectors = function (gridName) { return ({
|
|
|
229
224
|
return getOr(initialState.columnConfig, "commonGrid.".concat(gridName, ".columnConfig"), state);
|
|
230
225
|
},
|
|
231
226
|
getPage: function (state) { return getOr(initialState.page, "commonGrid.".concat(gridName, ".page"), state); },
|
|
232
|
-
getPresets: function (state) {
|
|
233
|
-
return getOr(initialState.presets, "commonGrid.".concat(gridName, ".presets"), state);
|
|
234
|
-
},
|
|
227
|
+
getPresets: function (state) { return getOr(initialState.presets, "commonGrid.".concat(gridName, ".presets"), state); },
|
|
235
228
|
getRowsPerPage: function (state) {
|
|
236
229
|
return getOr(initialState.rowsPerPage, "commonGrid.".concat(gridName, ".rowsPerPage"), state);
|
|
237
230
|
},
|
|
@@ -9,33 +9,3 @@ export declare const ComplexWithPaginationAndRedux: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
export declare const ComplexWithReload: {
|
|
13
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
story: {
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const ComplexWithTooManyResults: {
|
|
19
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
story: {
|
|
21
|
-
name: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare const ComplexWithCheckbox: {
|
|
25
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
story: {
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare const ComplexWithEditButton: {
|
|
31
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
story: {
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export declare const ComplexWithStickyColumn: {
|
|
37
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
story: {
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
@@ -5,9 +5,16 @@ import withReduxActions from '../../HoC/withReduxActions';
|
|
|
5
5
|
import { useAddFilter } from '../../hooks/useAddFilter';
|
|
6
6
|
import { ExtraControlButtonPosition } from '../../types';
|
|
7
7
|
import { onRowEditClick, onRowReadClick, onRowAction, onRowClick, onBatchAction } from '../utils/actions';
|
|
8
|
-
import { columnDefinitions, enumColumn
|
|
8
|
+
import { columnDefinitions, enumColumn } from '../utils/columnDefinition';
|
|
9
9
|
import { ReduxGrid, createRandomData, enumValues, gridDummyActions, onAsyncLoadFilterOptions } from '../utils/utils';
|
|
10
10
|
import withRedux from '../utils/withRedux';
|
|
11
|
+
var ActionColumnButtons = {
|
|
12
|
+
flexBasis: 80,
|
|
13
|
+
forceCheckboxes: true,
|
|
14
|
+
addRowNumbers: false,
|
|
15
|
+
canRowEdit: true,
|
|
16
|
+
canRowRead: false
|
|
17
|
+
};
|
|
11
18
|
var FilterSetter = function (_a) {
|
|
12
19
|
var gridActions = _a.gridActions;
|
|
13
20
|
var handleAddFilter = useAddFilter(gridActions === null || gridActions === void 0 ? void 0 : gridActions.addFilter);
|
|
@@ -23,29 +30,6 @@ var extraControlButtons = [
|
|
|
23
30
|
position: ExtraControlButtonPosition.TopRight,
|
|
24
31
|
label: 'Create',
|
|
25
32
|
onClick: alert
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
position: ExtraControlButtonPosition.TopRight,
|
|
29
|
-
label: 'Print',
|
|
30
|
-
onSelect: function (value) {
|
|
31
|
-
console.log(value);
|
|
32
|
-
},
|
|
33
|
-
options: [
|
|
34
|
-
{ label: 'CSV', value: 'CSV' },
|
|
35
|
-
{ label: 'ODS', value: 'ODS' },
|
|
36
|
-
{ label: 'XLSX', value: 'XLSX' }
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
position: ExtraControlButtonPosition.TopRight,
|
|
41
|
-
label: 'Allocate',
|
|
42
|
-
onSelect: function (value) {
|
|
43
|
-
console.log(value);
|
|
44
|
-
},
|
|
45
|
-
options: [
|
|
46
|
-
{ label: 'Allocate all', value: 'all' },
|
|
47
|
-
{ label: 'Allocate selected', value: 'selected' }
|
|
48
|
-
]
|
|
49
33
|
}
|
|
50
34
|
];
|
|
51
35
|
var comparators = {
|
|
@@ -63,41 +47,7 @@ export default {
|
|
|
63
47
|
title: 'Blocks/CommonGrid',
|
|
64
48
|
decorators: [withRedux]
|
|
65
49
|
};
|
|
66
|
-
export var ComplexWithPaginationAndRedux = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName" })] })); };
|
|
50
|
+
export var ComplexWithPaginationAndRedux = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, actionColumnDefinition: ActionColumnButtons, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName" })] })); };
|
|
67
51
|
ComplexWithPaginationAndRedux.story = {
|
|
68
52
|
name: 'Complex, with pagination and redux'
|
|
69
53
|
};
|
|
70
|
-
export var ComplexWithReload = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName", onReload: function () {
|
|
71
|
-
console.log('reload');
|
|
72
|
-
} })] })); };
|
|
73
|
-
ComplexWithReload.story = {
|
|
74
|
-
name: 'Complex, with reload button'
|
|
75
|
-
};
|
|
76
|
-
export var ComplexWithTooManyResults = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName", allowSortingOnlyUnderTotalRows: [10, 10] })] })); };
|
|
77
|
-
ComplexWithTooManyResults.story = {
|
|
78
|
-
name: 'Complex, with too many results'
|
|
79
|
-
};
|
|
80
|
-
export var ComplexWithCheckbox = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName", actionColumnDefinition: {
|
|
81
|
-
flexBasis: 40,
|
|
82
|
-
forceCheckboxes: true,
|
|
83
|
-
addRowNumbers: false,
|
|
84
|
-
canRowEdit: false,
|
|
85
|
-
canRowRead: false
|
|
86
|
-
} })] })); };
|
|
87
|
-
ComplexWithCheckbox.story = {
|
|
88
|
-
name: 'Complex, with checkbox'
|
|
89
|
-
};
|
|
90
|
-
export var ComplexWithEditButton = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridName", actionColumnDefinition: {
|
|
91
|
-
flexBasis: 70,
|
|
92
|
-
forceCheckboxes: true,
|
|
93
|
-
addRowNumbers: false,
|
|
94
|
-
canRowEdit: true,
|
|
95
|
-
canRowRead: false
|
|
96
|
-
} })] })); };
|
|
97
|
-
ComplexWithEditButton.story = {
|
|
98
|
-
name: 'Complex, with edit button'
|
|
99
|
-
};
|
|
100
|
-
export var ComplexWithStickyColumn = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitionsWithSticky, rowsData: createRandomData(10), onRowAction: onRowAction, onRowClick: onRowClick, onRowReadClick: onRowReadClick, onRowEditClick: onRowEditClick, totalRowsCount: 200, onBatchAction: onBatchAction, getRowsPerPage: getRowsPerPage, onAsyncLoadFilterOptions: onAsyncLoadFilterOptions, quickFilter: "textColumn", extraControlButtons: extraControlButtons, comparators: comparators, gridName: "gridNameSticky" })] })); };
|
|
101
|
-
ComplexWithStickyColumn.story = {
|
|
102
|
-
name: 'Complex, with sticky column'
|
|
103
|
-
};
|
|
@@ -8,5 +8,3 @@ export declare const oversizedColumnDefinition: {
|
|
|
8
8
|
}[];
|
|
9
9
|
export declare const enumColumn: ColumnDefinition;
|
|
10
10
|
export declare const columnDefinitions: ColumnDefinition[];
|
|
11
|
-
export declare const stickyColumn: ColumnDefinition;
|
|
12
|
-
export declare const columnDefinitionsWithSticky: ColumnDefinition[];
|