@mailstep/design-system 0.8.15 → 0.8.16-beta.1
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 +1 -1
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +9 -3
- package/ui/Blocks/CommonGrid/HoC/withReduxActions.js +1 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +3 -0
- package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +16 -8
- package/ui/Blocks/CommonGrid/components/ControlButtons/styles.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +29 -10
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +17 -5
- package/ui/Blocks/CommonGrid/components/Filters/GridSelect/GridSelect.js +2 -2
- package/ui/Blocks/CommonGrid/components/GridInfo/index.js +3 -1
- package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +1 -1
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/styles.d.ts +2 -2
- package/ui/Blocks/CommonGrid/components/MobileFilterModal.d.ts +20 -0
- package/ui/Blocks/CommonGrid/components/MobileFilterModal.js +69 -0
- package/ui/Blocks/CommonGrid/components/MobileOverlayWrapper.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/MobileOverlayWrapper.js +7 -0
- package/ui/Blocks/CommonGrid/components/MobileSortModal.d.ts +13 -0
- package/ui/Blocks/CommonGrid/components/MobileSortModal.js +34 -0
- 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/components/Table.d.ts +28 -28
- package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useColumnSizes.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useEvent.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +1 -1
- package/ui/Blocks/CommonGrid/hooks/useUxReset.d.ts +1 -1
- package/ui/Blocks/CommonGrid/store/index.d.ts +17 -19
- package/ui/Blocks/CommonGrid/store/index.js +9 -2
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +30 -0
- package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +59 -9
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.d.ts +2 -0
- package/ui/Blocks/CommonGrid/storybook/utils/columnDefinition.js +19 -9
- package/ui/Blocks/CommonGrid/styles.d.ts +7 -5
- package/ui/Blocks/CommonGrid/styles.js +6 -3
- package/ui/Blocks/CommonGrid/types.d.ts +1 -0
- package/ui/Blocks/CommonGrid/utils/index.d.ts +3 -1
- package/ui/Blocks/CommonGrid/utils/index.js +10 -0
- package/ui/Blocks/Header/components/MenuItems/styles.d.ts +1 -1
- package/ui/Blocks/Header/stories/Header.stories.d.ts +16 -16
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +2 -2
- package/ui/Blocks/ImageList/components/AddPhoto/styles.d.ts +2 -2
- package/ui/Blocks/ImageList/components/CloseButton/styles.d.ts +1 -1
- package/ui/Blocks/ImageList/components/ImageElement/styles.d.ts +1 -1
- package/ui/Blocks/ImageList/styles.d.ts +2 -2
- package/ui/Blocks/LanguageSwitch/styles.d.ts +3 -3
- package/ui/Blocks/LoginPage/stories/LoginPage.stories.js +2 -2
- package/ui/Blocks/LoginPage/styles.d.ts +2 -3
- package/ui/Blocks/Modal/styles.d.ts +7 -7
- package/ui/Blocks/Scheduler/components/Groups/styles.d.ts +1 -1
- package/ui/Blocks/Scheduler/components/TimeSlots/styles.d.ts +1 -1
- package/ui/Blocks/SideMenu/components/Footer.d.ts +1 -1
- package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +1 -0
- package/ui/Blocks/SideMenu/styles.d.ts +15 -15
- package/ui/Blocks/Stepper/components/StepCircle/styles.d.ts +2 -2
- package/ui/Blocks/Stepper/components/StepItem/styles.d.ts +3 -3
- package/ui/Blocks/Table/stories/Table.stories.d.ts +3 -2
- package/ui/Blocks/Tabs/styles.d.ts +6 -5
- package/ui/Elements/Alert/styles.d.ts +18 -17
- package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +2 -1
- package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.js +2 -2
- package/ui/Elements/BarChartSymbol/styles.d.ts +2 -2
- package/ui/Elements/BorderedBox/types.d.ts +1 -0
- package/ui/Elements/Button/styles.d.ts +6 -5
- package/ui/Elements/Card/styles.d.ts +2 -2
- package/ui/Elements/Card/types.d.ts +1 -0
- package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +2 -2
- package/ui/Elements/DatePicker/Datetime/components/FooterRow.d.ts +1 -1
- package/ui/Elements/DatePicker/Datetime/views/DaysView.js +1 -1
- package/ui/Elements/DatePicker/styles.d.ts +2 -1
- package/ui/Elements/DropdownMenu/components/MenuItem.js +1 -1
- package/ui/Elements/Icon/Icon.js +6 -6
- package/ui/Elements/Icon/icons/Filter.d.ts +4 -0
- package/ui/Elements/Icon/icons/Filter.js +13 -0
- package/ui/Elements/Icon/icons/Sort.d.ts +4 -0
- package/ui/Elements/Icon/icons/Sort.js +13 -0
- package/ui/Elements/Icon/icons/index.d.ts +2 -0
- package/ui/Elements/Icon/icons/index.js +2 -0
- package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +1 -1
- package/ui/Elements/Label/Label.d.ts +1 -1
- package/ui/Elements/Label/stories/Label.stories.d.ts +1 -1
- package/ui/Elements/Link/stories/Link.stories.d.ts +12 -12
- package/ui/Elements/Logo/Logo.js +2 -2
- package/ui/Elements/Pagination/styled.d.ts +2 -1
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +5 -5
- package/ui/Elements/ProgressBar/styles.d.ts +1 -1
- package/ui/Elements/Select/Select.js +2 -2
- package/ui/Elements/Select/components/SimplifiedOption.d.ts +1 -0
- package/ui/Elements/Select/themes/index.d.ts +1 -1
- package/ui/Elements/Select/themes/selectStyles.d.ts +1 -1
- package/ui/Elements/SingleSelect/SingleSelect.js +2 -2
- package/ui/Elements/SpaceAround/types.d.ts +1 -0
- package/ui/Elements/Spinner/styles.d.ts +1 -1
- package/ui/Elements/Tag/types.d.ts +1 -0
- package/ui/Elements/Toast/styles.d.ts +1 -1
- package/ui/Forms/Checkbox/styles.d.ts +2 -1
- package/ui/Forms/Input/styles.d.ts +3 -3
- package/ui/Forms/TextArea/styles.d.ts +5 -5
- package/ui/ThemeProvider/themes/default.js +1 -1
- package/ui/ThemeProvider/themes/mailwise.js +1 -1
- package/ui/index.es.js +16063 -16501
- package/ui/index.umd.js +502 -464
- package/ui/utils/translations.js +1 -1
|
@@ -9,5 +9,5 @@ type ReturnProps = {
|
|
|
9
9
|
gridBoxRef: React.MutableRefObject<HTMLElement>;
|
|
10
10
|
handleResizeDrag: (column: string, width: number) => void;
|
|
11
11
|
};
|
|
12
|
-
declare const useColumnSizes: (displayColumnsDefinitions: CommonGridProps[
|
|
12
|
+
declare const useColumnSizes: (displayColumnsDefinitions: CommonGridProps['columnsDefinitions'], storeColumnsWidth: Required<GridSelectorsType>['columnsWidth'], storeColumnsWidthVariant: GridSelectorsType['columnsWidthVariant'], setColumnWidth: Required<GridActionsType>['setColumnWidth'], columnLayout: Required<CommonGridProps>['columnLayout'], minColumnWidth?: number) => ReturnProps;
|
|
13
13
|
export default useColumnSizes;
|
|
@@ -5,5 +5,5 @@ import { RowProps, UxState, ActionColumn, OnBatchActionFn } from '../types';
|
|
|
5
5
|
* returns [subset of actions that are enabled, onSelect(value) - param1: selected action value]
|
|
6
6
|
*/
|
|
7
7
|
type GridActionTriggerRet = [Required<ActionColumn>['actionOptions'], (value: any) => void];
|
|
8
|
-
export declare const useGridActionTrigger: (rowsData: RowProps[], uxState: UxState, actionOptions?: ActionColumn[
|
|
8
|
+
export declare const useGridActionTrigger: (rowsData: RowProps[], uxState: UxState, actionOptions?: ActionColumn['actionOptions'], onBatchAction?: OnBatchActionFn) => GridActionTriggerRet;
|
|
9
9
|
export {};
|
|
@@ -11,7 +11,7 @@ declare const useManageColumn: ({ columns, gridSelectors, gridActions, onClose }
|
|
|
11
11
|
columnsConfigValues: string[];
|
|
12
12
|
setColumnsConfigOptions: import('react').Dispatch<import('react').SetStateAction<{
|
|
13
13
|
[x: string]: {
|
|
14
|
-
isHidden?: boolean;
|
|
14
|
+
isHidden?: boolean | undefined;
|
|
15
15
|
};
|
|
16
16
|
}>>;
|
|
17
17
|
onConfirmForm: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { RowProps, UxState } from '../types';
|
|
3
3
|
|
|
4
|
-
declare const useRowsKeyControls: (rowsData: RowProps[], uxState: UxState, onUxChange?: (uxKey: keyof UxState, uxValue: any) => void) => (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
4
|
+
declare const useRowsKeyControls: (rowsData: RowProps[], uxState: UxState, onUxChange?: ((uxKey: keyof UxState, uxValue: any) => void) | undefined) => (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
5
5
|
export default useRowsKeyControls;
|
|
@@ -5,5 +5,5 @@ import { RowProps, GridActionsType, UxState } from '../types';
|
|
|
5
5
|
* returns [checked state, toggleAllHandler()] for checkbox
|
|
6
6
|
*/
|
|
7
7
|
type ToggleAllCheckboxRet = [boolean, () => void];
|
|
8
|
-
export declare const useToggleAllCheckbox: (rowsData?: RowProps[], uxState?: UxState, handleUxChange?: GridActionsType[
|
|
8
|
+
export declare const useToggleAllCheckbox: (rowsData?: RowProps[], uxState?: UxState, handleUxChange?: GridActionsType['handleUxChange']) => ToggleAllCheckboxRet;
|
|
9
9
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RowProps, GridActionsType, UxState } from '../types';
|
|
2
2
|
|
|
3
|
-
declare const useUxReset: (rowsData: RowProps[], uxState: UxState, clearUxState: GridActionsType[
|
|
3
|
+
declare const useUxReset: (rowsData: RowProps[], uxState: UxState, clearUxState: GridActionsType['clearUxState']) => any;
|
|
4
4
|
export default useUxReset;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { FilterProps, SortingValueType, InitProps, GridState, GridSelectorsType, ColumnConfig, Filtering, GridPresets } from '../types';
|
|
2
2
|
|
|
3
3
|
type DefaultRootState = {};
|
|
4
|
-
export type MultiState =
|
|
5
|
-
[key: string]: GridState;
|
|
6
|
-
};
|
|
4
|
+
export type MultiState = Record<string, GridState>;
|
|
7
5
|
export declare const initialState: GridState;
|
|
8
6
|
export declare const actionPrefix = "@store/CommonGrid";
|
|
9
7
|
export declare const actionTypes: {
|
|
@@ -22,6 +20,7 @@ export declare const actionTypes: {
|
|
|
22
20
|
addFilter: string;
|
|
23
21
|
setFilters: string;
|
|
24
22
|
addSorting: string;
|
|
23
|
+
resetSorting: string;
|
|
25
24
|
clearSettings: string;
|
|
26
25
|
resetGrid: string;
|
|
27
26
|
setColumnWidth: string;
|
|
@@ -32,7 +31,7 @@ export default _default;
|
|
|
32
31
|
export declare const createActions: (gridName: string) => {
|
|
33
32
|
init: (initProps?: InitProps) => Action;
|
|
34
33
|
clearUxState: () => Action;
|
|
35
|
-
handleUxChange: (uxKey: keyof GridState[
|
|
34
|
+
handleUxChange: (uxKey: keyof GridState['uxState'], uxValue: any) => Action;
|
|
36
35
|
openConfigForm: () => Action;
|
|
37
36
|
closeConfigForm: () => Action;
|
|
38
37
|
setColumnConfig: (columnConfig: ColumnConfig) => Action;
|
|
@@ -40,9 +39,7 @@ export declare const createActions: (gridName: string) => {
|
|
|
40
39
|
setPresets: (presets: GridPresets) => Action;
|
|
41
40
|
createPreset: (presetName: string, filters: Filtering) => Action;
|
|
42
41
|
deletePreset: (presetName: string) => Action;
|
|
43
|
-
setColumnWidth: (columnsWidth: null |
|
|
44
|
-
[anyKey: string]: number;
|
|
45
|
-
}, columnLayout: "normal" | "no-scroll" | "sticky") => Action;
|
|
42
|
+
setColumnWidth: (columnsWidth: null | Record<string, number>, columnLayout: 'normal' | 'no-scroll' | 'sticky') => Action;
|
|
46
43
|
resetGrid: () => Action;
|
|
47
44
|
setColumnsOrder: (columnsOrder: string[]) => Action;
|
|
48
45
|
setRowsPerPage: (rowsPerPage: number) => Action;
|
|
@@ -50,19 +47,20 @@ export declare const createActions: (gridName: string) => {
|
|
|
50
47
|
addFilter: (column: string, value: any, filterProps: FilterProps, others?: any) => Action;
|
|
51
48
|
setFilters: (filters: Filtering) => Action;
|
|
52
49
|
addSorting: (column: string, direction: SortingValueType) => Action;
|
|
50
|
+
resetSorting: () => Action;
|
|
53
51
|
clearSettings: () => Action;
|
|
54
52
|
};
|
|
55
53
|
export declare const createSelectors: (gridName: string) => {
|
|
56
|
-
getUxState: (state: DefaultRootState) => GridState[
|
|
57
|
-
isConfigFormOpen: (state: DefaultRootState) => GridState[
|
|
58
|
-
getColumnConfig: (state: DefaultRootState) => GridState[
|
|
59
|
-
getPage: (state: DefaultRootState) => GridState[
|
|
60
|
-
getPresets: (state: DefaultRootState) => GridState[
|
|
61
|
-
getRowsPerPage: (state: DefaultRootState) => GridState[
|
|
62
|
-
getFilter: (state: DefaultRootState) => GridState[
|
|
63
|
-
getSorting: (state: DefaultRootState) => GridState[
|
|
64
|
-
getColumnsWidth: (state: DefaultRootState) => GridState[
|
|
65
|
-
getColumnsWidthVariant: (state: DefaultRootState) => GridState[
|
|
66
|
-
getColumnsOrder: (state: DefaultRootState) => GridState[
|
|
54
|
+
getUxState: (state: DefaultRootState) => GridState['uxState'];
|
|
55
|
+
isConfigFormOpen: (state: DefaultRootState) => GridState['isConfigFormOpen'];
|
|
56
|
+
getColumnConfig: (state: DefaultRootState) => GridState['columnConfig'];
|
|
57
|
+
getPage: (state: DefaultRootState) => GridState['page'];
|
|
58
|
+
getPresets: (state: DefaultRootState) => GridState['presets'];
|
|
59
|
+
getRowsPerPage: (state: DefaultRootState) => GridState['rowsPerPage'];
|
|
60
|
+
getFilter: (state: DefaultRootState) => GridState['filter'];
|
|
61
|
+
getSorting: (state: DefaultRootState) => GridState['sorting'];
|
|
62
|
+
getColumnsWidth: (state: DefaultRootState) => GridState['columnsWidth'];
|
|
63
|
+
getColumnsWidthVariant: (state: DefaultRootState) => GridState['columnsWidthVariant'];
|
|
64
|
+
getColumnsOrder: (state: DefaultRootState) => GridState['columnsOrder'];
|
|
67
65
|
};
|
|
68
|
-
export declare const createFullSelector: (gridName: string) => (
|
|
66
|
+
export declare const createFullSelector: (gridName: string) => (state: DefaultRootState) => GridSelectorsType;
|
|
@@ -46,6 +46,7 @@ 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"),
|
|
49
50
|
clearSettings: "".concat(actionPrefix, "/clearSettings"),
|
|
50
51
|
resetGrid: "".concat(actionPrefix, "/resetGrid"),
|
|
51
52
|
setColumnWidth: "".concat(actionPrefix, "/setColumnWidth"),
|
|
@@ -56,7 +57,7 @@ export default (function (state, action) {
|
|
|
56
57
|
if (state === void 0) { state = {}; }
|
|
57
58
|
return produce(state, function (draft) {
|
|
58
59
|
var _a, _b, _c;
|
|
59
|
-
var _d, _e, _f, _g, _h;
|
|
60
|
+
var _d, _e, _f, _g, _h, _j;
|
|
60
61
|
// version migrations
|
|
61
62
|
if (!migrationChecked && state && Object.keys(state).length > 0) {
|
|
62
63
|
draft = migrateState(draft);
|
|
@@ -118,6 +119,9 @@ export default (function (state, action) {
|
|
|
118
119
|
}
|
|
119
120
|
draft[gridName].sorting = sorting;
|
|
120
121
|
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;
|
|
121
125
|
case actionTypes.clearSettings:
|
|
122
126
|
draft[gridName].page = initialState.page;
|
|
123
127
|
draft[gridName].filter = initialState.filter;
|
|
@@ -211,6 +215,7 @@ export var createActions = function (gridName) { return ({
|
|
|
211
215
|
column: column,
|
|
212
216
|
direction: direction
|
|
213
217
|
}); },
|
|
218
|
+
resetSorting: function () { return ({ gridName: gridName, type: actionTypes.resetSorting }); },
|
|
214
219
|
clearSettings: function () { return ({ gridName: gridName, type: actionTypes.clearSettings }); }
|
|
215
220
|
}); };
|
|
216
221
|
export var createSelectors = function (gridName) { return ({
|
|
@@ -224,7 +229,9 @@ export var createSelectors = function (gridName) { return ({
|
|
|
224
229
|
return getOr(initialState.columnConfig, "commonGrid.".concat(gridName, ".columnConfig"), state);
|
|
225
230
|
},
|
|
226
231
|
getPage: function (state) { return getOr(initialState.page, "commonGrid.".concat(gridName, ".page"), state); },
|
|
227
|
-
getPresets: function (state) {
|
|
232
|
+
getPresets: function (state) {
|
|
233
|
+
return getOr(initialState.presets, "commonGrid.".concat(gridName, ".presets"), state);
|
|
234
|
+
},
|
|
228
235
|
getRowsPerPage: function (state) {
|
|
229
236
|
return getOr(initialState.rowsPerPage, "commonGrid.".concat(gridName, ".rowsPerPage"), state);
|
|
230
237
|
},
|
|
@@ -9,3 +9,33 @@ 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,16 +5,9 @@ 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 } from '../utils/columnDefinition';
|
|
8
|
+
import { columnDefinitions, enumColumn, columnDefinitionsWithSticky } 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
|
-
};
|
|
18
11
|
var FilterSetter = function (_a) {
|
|
19
12
|
var gridActions = _a.gridActions;
|
|
20
13
|
var handleAddFilter = useAddFilter(gridActions === null || gridActions === void 0 ? void 0 : gridActions.addFilter);
|
|
@@ -30,6 +23,29 @@ var extraControlButtons = [
|
|
|
30
23
|
position: ExtraControlButtonPosition.TopRight,
|
|
31
24
|
label: 'Create',
|
|
32
25
|
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
|
+
]
|
|
33
49
|
}
|
|
34
50
|
];
|
|
35
51
|
var comparators = {
|
|
@@ -47,7 +63,41 @@ export default {
|
|
|
47
63
|
title: 'Blocks/CommonGrid',
|
|
48
64
|
decorators: [withRedux]
|
|
49
65
|
};
|
|
50
|
-
export var ComplexWithPaginationAndRedux = function () { return (_jsxs(LinguiContainer, { children: [_jsx(ConnectedFilterSetter, { gridActions: gridDummyActions }), _jsx(ReduxGrid, { columnsDefinitions: columnDefinitions,
|
|
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" })] })); };
|
|
51
67
|
ComplexWithPaginationAndRedux.story = {
|
|
52
68
|
name: 'Complex, with pagination and redux'
|
|
53
69
|
};
|
|
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,3 +8,5 @@ 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[];
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
1
10
|
import { ComplexCell } from '../components/ComplexCell';
|
|
2
11
|
import { EnumCellExample } from '../components/EnumCellExample';
|
|
3
12
|
import { enumValues } from './utils';
|
|
@@ -101,18 +110,19 @@ export var columnDefinitions = [
|
|
|
101
110
|
flexBasis: 350,
|
|
102
111
|
cellComponent: ComplexCell
|
|
103
112
|
},
|
|
104
|
-
{
|
|
105
|
-
name: 'stickyColumn',
|
|
106
|
-
title: 'Sticky Column',
|
|
107
|
-
flexBasis: 160,
|
|
108
|
-
alwaysOn: true,
|
|
109
|
-
sticky: true,
|
|
110
|
-
stickTo: 'right'
|
|
111
|
-
},
|
|
112
113
|
{
|
|
113
114
|
name: 'alwaysOffColumn',
|
|
114
115
|
title: 'Always Off Column',
|
|
115
116
|
flexBasis: 0,
|
|
116
|
-
alwaysOff: true
|
|
117
|
+
alwaysOff: true
|
|
117
118
|
}
|
|
118
119
|
];
|
|
120
|
+
export var stickyColumn = {
|
|
121
|
+
name: 'stickyColumn',
|
|
122
|
+
title: 'Sticky Column',
|
|
123
|
+
flexBasis: 160,
|
|
124
|
+
alwaysOn: true,
|
|
125
|
+
sticky: true,
|
|
126
|
+
stickTo: 'right'
|
|
127
|
+
};
|
|
128
|
+
export var columnDefinitionsWithSticky = __spreadArray(__spreadArray([], columnDefinitions, true), [stickyColumn], false);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const BottomWrapper: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements, "color">) => import('react').ReactElement<any, string>, import('@xstyled/system').Theme, import('@xstyled/system').SystemProps<import('@xstyled/system').Theme> & {
|
|
2
3
|
withPagination: boolean;
|
|
3
4
|
}, "color">;
|
|
4
|
-
export declare const ContentContainer: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements
|
|
5
|
-
export declare const CommonGridWrap: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements
|
|
5
|
+
export declare const ContentContainer: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements, "color">) => import('react').ReactElement<any, string>, import('@xstyled/system').Theme, import('@xstyled/system').SystemProps<import('@xstyled/system').Theme>, "color">;
|
|
6
|
+
export declare const CommonGridWrap: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements, "color">) => import('react').ReactElement<any, string>, import('@xstyled/system').Theme, import('@xstyled/system').SystemProps<import('@xstyled/system').Theme> & {
|
|
6
7
|
withPagination: boolean;
|
|
7
8
|
}, "color">;
|
|
8
|
-
export declare const StyledButtonStrip: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements
|
|
9
|
+
export declare const StyledButtonStrip: import('styled-components').StyledComponent<(props: Omit<JSX.IntrinsicElements, "color">) => import('react').ReactElement<any, string>, import('@xstyled/system').Theme, import('@xstyled/system').SystemProps<import('@xstyled/system').Theme>, "color">;
|
|
9
10
|
export declare const CommonGridWithStyles: import('styled-components').StyledComponent<import('react').FC<import('./types').CommonGridProps & {
|
|
10
|
-
filters?: import('./types').FiltersConfig;
|
|
11
|
+
filters?: import('./types').FiltersConfig | undefined;
|
|
11
12
|
handleDragEnd: (item: import('@dnd-kit/core').DragEndEvent) => void;
|
|
12
13
|
displayColumnsDefinitions: import('./types').ColumnDefinition[];
|
|
13
14
|
hasGroups: boolean;
|
|
@@ -15,4 +16,5 @@ export declare const CommonGridWithStyles: import('styled-components').StyledCom
|
|
|
15
16
|
}>, import('@xstyled/system').Theme, {
|
|
16
17
|
withButtonStrip: boolean;
|
|
17
18
|
hasGroupsOrFilters: boolean;
|
|
19
|
+
hasGroups: boolean;
|
|
18
20
|
}, never>;
|
|
@@ -21,14 +21,17 @@ export var CommonGridWrap = styled(x.div)(templateObject_3 || (templateObject_3
|
|
|
21
21
|
var withPagination = _a.withPagination;
|
|
22
22
|
return (withPagination ? gridFooterHeight : 0);
|
|
23
23
|
});
|
|
24
|
-
export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n
|
|
25
|
-
export var CommonGridWithStyles = styled(CommonGrid)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: calc(100% - ", "px);\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: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\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 max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: 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: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\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 z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n height: calc(100% - ", "px);\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: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\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 max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: 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: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\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 z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), function (_a) {
|
|
24
|
+
export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: auto;\n padding: 10px;\n flex-wrap: wrap;\n z-index: 3;\n\n @media (min-width: 768px) {\n min-height: ", "px;\n padding: 18px 20px;\n }\n"], ["\n position: relative;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: auto;\n padding: 10px;\n flex-wrap: wrap;\n z-index: 3;\n\n @media (min-width: 768px) {\n min-height: ", "px;\n padding: 18px 20px;\n }\n"])), gridButtonStripHeight);
|
|
25
|
+
export var CommonGridWithStyles = styled(CommonGrid)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: calc(100% - ", "px);\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: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n & .filterRow {\n display: none;\n }\n\n @media (min-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: flex;\n }\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 max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: 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: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\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 z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n height: calc(100% - ", "px);\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: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n & .filterRow {\n display: none;\n }\n\n @media (min-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: flex;\n }\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 max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: 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: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\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 z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), function (_a) {
|
|
26
26
|
var withButtonStrip = _a.withButtonStrip;
|
|
27
27
|
return (withButtonStrip ? gridButtonStripHeight : 0);
|
|
28
28
|
}, th('fonts.primary'), gridRowHeight, function (_a) {
|
|
29
|
+
var hasGroups = _a.hasGroups;
|
|
30
|
+
return gridHeadHeight + (hasGroups ? gridFilterHeight : 0);
|
|
31
|
+
}, th('colors.lightGray6'), function (_a) {
|
|
29
32
|
var hasGroupsOrFilters = _a.hasGroupsOrFilters;
|
|
30
33
|
return gridHeadHeight + (hasGroupsOrFilters ? gridFilterHeight : 0);
|
|
31
|
-
}, th('
|
|
34
|
+
}, th('fonts.primary'), function (_a) {
|
|
32
35
|
var theme = _a.theme;
|
|
33
36
|
return theme.colors.white;
|
|
34
37
|
});
|
|
@@ -229,6 +229,7 @@ export type GridActionsType = {
|
|
|
229
229
|
setFilters?: (filters: Filtering) => void;
|
|
230
230
|
resetFilters?: () => void;
|
|
231
231
|
addSorting?: (column: string, direction: SortingValueType) => void;
|
|
232
|
+
resetSorting?: () => void;
|
|
232
233
|
openConfigForm?: () => void;
|
|
233
234
|
closeConfigForm?: () => void;
|
|
234
235
|
clearSettings?: () => void;
|
|
@@ -14,10 +14,12 @@ export declare const calculatePaginator: (page: number, rowsPerPage: number) =>
|
|
|
14
14
|
offset: number;
|
|
15
15
|
limit: number;
|
|
16
16
|
};
|
|
17
|
-
export declare const createFilterType: (columnDefinition: ColumnDefinition) => FilterProps[
|
|
17
|
+
export declare const createFilterType: (columnDefinition: ColumnDefinition) => FilterProps['type'];
|
|
18
18
|
export declare const getGroups: (columns: ColumnDefinition[]) => Group[];
|
|
19
19
|
export declare const getGroupClassNames: (group?: Group) => string;
|
|
20
20
|
export declare const getStickyCollClassNames: (sticky: boolean, stickTo?: StickTo) => string;
|
|
21
21
|
export declare const getFilters: (optimizeFilters: boolean) => FiltersConfig;
|
|
22
|
+
/** Returns true when a filter value should be counted / applied */
|
|
23
|
+
export declare const isFilterActive: (value: any) => boolean;
|
|
22
24
|
export declare const checksColumnsOrder: (colsOrder: string[], columnsDefinitions: ColumnDefinition[]) => void;
|
|
23
25
|
export {};
|
|
@@ -76,6 +76,16 @@ export var getFilters = function (optimizeFilters) {
|
|
|
76
76
|
}
|
|
77
77
|
return filters;
|
|
78
78
|
};
|
|
79
|
+
/** Returns true when a filter value should be counted / applied */
|
|
80
|
+
export var isFilterActive = function (value) {
|
|
81
|
+
if (value == null)
|
|
82
|
+
return false;
|
|
83
|
+
if (Array.isArray(value))
|
|
84
|
+
return !!value.length;
|
|
85
|
+
if (typeof value === 'object')
|
|
86
|
+
return value.value != null && value.value !== '';
|
|
87
|
+
return value !== '';
|
|
88
|
+
};
|
|
79
89
|
export var checksColumnsOrder = function (colsOrder, columnsDefinitions) {
|
|
80
90
|
var stickyRightColls = columnsDefinitions.filter(function (col) { return col.sticky === true && col.stickTo === 'right'; });
|
|
81
91
|
var stickyLeftColls = columnsDefinitions.filter(function (col) { return col.sticky === true && col.stickTo !== 'right'; });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const MenuItemsList: import('styled-components').StyledComponent<"ul", import('@xstyled/system').Theme, {}, never>;
|
|
2
2
|
export declare const MenuItemsListItem: import('styled-components').StyledComponent<"li", import('@xstyled/system').Theme, {
|
|
3
|
-
pointer?: boolean;
|
|
3
|
+
pointer?: boolean | undefined;
|
|
4
4
|
}, never>;
|
|
@@ -4,22 +4,22 @@ declare const meta: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
component: FC<{
|
|
6
6
|
homeLink: string;
|
|
7
|
-
isMobileMenuOpen?: boolean;
|
|
8
|
-
logo?: import('../../..').Brand;
|
|
9
|
-
logoVariant?: import('../../..').Variant;
|
|
10
|
-
logoSrc?: string;
|
|
11
|
-
logoSrcWidth?: string;
|
|
12
|
-
user?: import('../types').User | null;
|
|
13
|
-
currentLanguage?: string;
|
|
14
|
-
hasUserMenu?: boolean;
|
|
15
|
-
rightMenuItems?: import('../../SideMenu').MenuItemType[];
|
|
16
|
-
languageItems?: import('../../LanguageSwitch').LanguageItem[];
|
|
17
|
-
showLanguageWithTitle?: boolean;
|
|
18
|
-
languageFlagWrapBackgroundColor?: string;
|
|
19
|
-
onOpenMobileSideMenu?: () => void;
|
|
20
|
-
onChangeLanguage?: (language: string) => void;
|
|
21
|
-
onLogout?: () => void;
|
|
22
|
-
withLanguageSwitch?: boolean;
|
|
7
|
+
isMobileMenuOpen?: boolean | undefined;
|
|
8
|
+
logo?: import('../../..').Brand | undefined;
|
|
9
|
+
logoVariant?: import('../../..').Variant | undefined;
|
|
10
|
+
logoSrc?: string | undefined;
|
|
11
|
+
logoSrcWidth?: string | undefined;
|
|
12
|
+
user?: import('../types').User | null | undefined;
|
|
13
|
+
currentLanguage?: string | undefined;
|
|
14
|
+
hasUserMenu?: boolean | undefined;
|
|
15
|
+
rightMenuItems?: import('../../SideMenu').MenuItemType[] | undefined;
|
|
16
|
+
languageItems?: import('../../LanguageSwitch').LanguageItem[] | undefined;
|
|
17
|
+
showLanguageWithTitle?: boolean | undefined;
|
|
18
|
+
languageFlagWrapBackgroundColor?: string | undefined;
|
|
19
|
+
onOpenMobileSideMenu?: (() => void) | undefined;
|
|
20
|
+
onChangeLanguage?: ((language: string) => void) | undefined;
|
|
21
|
+
onLogout?: (() => void) | undefined;
|
|
22
|
+
withLanguageSwitch?: boolean | undefined;
|
|
23
23
|
}>;
|
|
24
24
|
tags: string[];
|
|
25
25
|
argTypes: {};
|
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
12
|
-
return g
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const Container: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
2
|
-
isDisabled?: boolean;
|
|
3
|
-
hasRemove?: boolean;
|
|
2
|
+
isDisabled?: boolean | undefined;
|
|
3
|
+
hasRemove?: boolean | undefined;
|
|
4
4
|
}, never>;
|
|
5
5
|
export declare const HiddenInput: import('styled-components').StyledComponent<"input", import('@xstyled/system').Theme, {}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const Container: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|
|
2
2
|
export declare const Image: import('styled-components').StyledComponent<"img", import('@xstyled/system').Theme, {
|
|
3
|
-
selected?: boolean;
|
|
3
|
+
selected?: boolean | undefined;
|
|
4
4
|
}, never>;
|
|
5
5
|
export declare const ImageWrapper: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
6
6
|
visible: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const ImageListContainer: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|
|
2
2
|
export declare const Control: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
3
|
-
isLeft?: boolean;
|
|
3
|
+
isLeft?: boolean | undefined;
|
|
4
4
|
isDisabled: boolean;
|
|
5
|
-
hasRemove?: boolean;
|
|
5
|
+
hasRemove?: boolean | undefined;
|
|
6
6
|
}, never>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Placement } from './types';
|
|
2
2
|
|
|
3
3
|
export declare const StyledFlag: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|
|
4
|
-
export declare const StyledDropdownMenu: import('styled-components').StyledComponent<(<T extends import('../../Elements/DropdownMenu/types').Item>({ items, showMenu, className, ItemComponent, header, footer, ...rest }: import('../../Elements/DropdownMenu/types').DropdownMenuProps<T>) => import('react').ReactElement), import('@xstyled/system').Theme, {
|
|
4
|
+
export declare const StyledDropdownMenu: import('styled-components').StyledComponent<(<T extends import('../../Elements/DropdownMenu/types').Item>({ items, showMenu, className, ItemComponent, header, footer, ...rest }: import('../../Elements/DropdownMenu/types').DropdownMenuProps<T>) => import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>), import('@xstyled/system').Theme, {
|
|
5
5
|
placement: Placement;
|
|
6
6
|
}, never>;
|
|
7
7
|
export declare const LanguageSwitchWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|
|
8
8
|
export declare const LanguageFlagWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
9
|
-
backgroundColor?: string;
|
|
10
|
-
withTitle?: boolean;
|
|
9
|
+
backgroundColor?: string | undefined;
|
|
10
|
+
withTitle?: boolean | undefined;
|
|
11
11
|
}, never>;
|
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
12
|
-
return g
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
export declare const Wrapper: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
4
|
-
backgroundImage?:
|
|
3
|
+
backgroundImage?: "mailship" | undefined;
|
|
5
4
|
}, never>;
|
|
6
5
|
export declare const LanguageBox: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|
|
7
6
|
export declare const CardBodyWithLanguage: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|