slick-table 1.1.60 → 1.1.61
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/dist/index.cjs.js +80 -80
- package/dist/index.es.js +1498 -1552
- package/dist/types/features/column-filters/ui/SelectFilter/model/options/options.d.ts +2 -2
- package/dist/types/features/column-filters/ui/SelectFilter/model/options/options.d.ts.map +1 -1
- package/dist/types/features/column-filters/ui/SelectFilter/model/types/IMenuItem.d.ts +6 -0
- package/dist/types/features/column-filters/ui/SelectFilter/model/types/IMenuItem.d.ts.map +1 -0
- package/dist/types/features/column-filters/ui/SelectFilter/model/types/index.d.ts +2 -0
- package/dist/types/features/column-filters/ui/SelectFilter/model/types/index.d.ts.map +1 -0
- package/dist/types/features/column-filters/ui/SelectFilter/ui/SelectFilter.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/column-filters/ui/SelectFilter/model/options/options.ts +15 -14
- package/src/features/column-filters/ui/SelectFilter/model/types/IMenuItem.ts +6 -0
- package/src/features/column-filters/ui/SelectFilter/model/types/index.ts +1 -0
- package/src/features/column-filters/ui/SelectFilter/ui/SelectFilter.tsx +17 -10
- package/dist/types/shared/ui/ContextSelect/ContextSelect.d.ts +0 -23
- package/dist/types/shared/ui/ContextSelect/ContextSelect.d.ts.map +0 -1
- package/dist/types/shared/ui/ContextSelect/ContextSelect.style.d.ts +0 -7
- package/dist/types/shared/ui/ContextSelect/ContextSelect.style.d.ts.map +0 -1
- package/dist/types/shared/ui/ContextSelect/index.d.ts +0 -3
- package/dist/types/shared/ui/ContextSelect/index.d.ts.map +0 -1
- package/src/shared/ui/ContextSelect/ContextSelect.style.ts +0 -9
- package/src/shared/ui/ContextSelect/ContextSelect.tsx +0 -87
- package/src/shared/ui/ContextSelect/index.ts +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EColumnFiltersGroup } from '../../../../../../shared/model/enums';
|
|
2
|
-
import {
|
|
2
|
+
import { IMenuItem } from '../types';
|
|
3
3
|
export declare const options: IOptions;
|
|
4
|
-
type IOptions = Record<EColumnFiltersGroup,
|
|
4
|
+
type IOptions = Record<EColumnFiltersGroup, IMenuItem[]>;
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/column-filters/ui/SelectFilter/model/options/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/column-filters/ui/SelectFilter/model/options/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAkDrC,eAAO,MAAM,OAAO,EAAE,QAYrB,CAAC;AAEF,KAAK,QAAQ,GAAG,MAAM,CAAC,mBAAmB,EAAE,SAAS,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMenuItem.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/column-filters/ui/SelectFilter/model/types/IMenuItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,aAAa,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/column-filters/ui/SelectFilter/model/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectFilter.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/column-filters/ui/SelectFilter/ui/SelectFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"SelectFilter.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/column-filters/ui/SelectFilter/ui/SelectFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,cAAc,EAAU,MAAM,OAAO,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,MAAM,CA2CnC,CAAC;AAEF,UAAU,MAAM;IACf,QAAQ,EAAE,aAAa,CAAC;IACxB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;CACrD"}
|
package/package.json
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
import { EColumnFilter, EColumnFiltersGroup } from "shared/model/enums";
|
|
2
|
-
import { IContextSelectValue } from "shared/ui/ContextSelect";
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import { IMenuItem } from "../types";
|
|
4
|
+
|
|
5
|
+
const dateBetween: IMenuItem = {
|
|
5
6
|
id: EColumnFilter.DateBetween,
|
|
6
7
|
name: "Between",
|
|
7
8
|
};
|
|
8
|
-
const dateEqual:
|
|
9
|
+
const dateEqual: IMenuItem = {
|
|
9
10
|
id: EColumnFilter.DateEqual,
|
|
10
11
|
name: "Equal",
|
|
11
12
|
};
|
|
12
|
-
const dateFrom:
|
|
13
|
+
const dateFrom: IMenuItem = {
|
|
13
14
|
id: EColumnFilter.DateFrom,
|
|
14
15
|
name: "From",
|
|
15
16
|
};
|
|
16
|
-
const dateTo:
|
|
17
|
-
const numberBetween:
|
|
17
|
+
const dateTo: IMenuItem = { id: EColumnFilter.DateTo, name: "To" };
|
|
18
|
+
const numberBetween: IMenuItem = {
|
|
18
19
|
id: EColumnFilter.NumberBetween,
|
|
19
20
|
name: "Between",
|
|
20
21
|
};
|
|
21
|
-
const numberEqual:
|
|
22
|
+
const numberEqual: IMenuItem = {
|
|
22
23
|
id: EColumnFilter.NumberEqual,
|
|
23
24
|
name: "Equal",
|
|
24
25
|
};
|
|
25
|
-
const numberFrom:
|
|
26
|
+
const numberFrom: IMenuItem = {
|
|
26
27
|
id: EColumnFilter.NumberFrom,
|
|
27
28
|
name: "From",
|
|
28
29
|
};
|
|
29
|
-
const numberTo:
|
|
30
|
+
const numberTo: IMenuItem = {
|
|
30
31
|
id: EColumnFilter.NumberTo,
|
|
31
32
|
name: "To",
|
|
32
33
|
};
|
|
33
|
-
const textContain:
|
|
34
|
+
const textContain: IMenuItem = {
|
|
34
35
|
id: EColumnFilter.TextContain,
|
|
35
36
|
name: "Contains",
|
|
36
37
|
};
|
|
37
|
-
const textEqual:
|
|
38
|
+
const textEqual: IMenuItem = {
|
|
38
39
|
id: EColumnFilter.TextEqual,
|
|
39
40
|
name: "Equal",
|
|
40
41
|
};
|
|
41
|
-
const textNotContain:
|
|
42
|
+
const textNotContain: IMenuItem = {
|
|
42
43
|
id: EColumnFilter.TextNotContain,
|
|
43
44
|
name: "Does not contain",
|
|
44
45
|
};
|
|
45
|
-
const textNotEqual:
|
|
46
|
+
const textNotEqual: IMenuItem = {
|
|
46
47
|
id: EColumnFilter.TextNotEqual,
|
|
47
48
|
name: "Not equal",
|
|
48
49
|
};
|
|
@@ -63,4 +64,4 @@ export const options: IOptions = {
|
|
|
63
64
|
],
|
|
64
65
|
};
|
|
65
66
|
|
|
66
|
-
type IOptions = Record<EColumnFiltersGroup,
|
|
67
|
+
type IOptions = Record<EColumnFiltersGroup, IMenuItem[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IMenuItem } from "./IMenuItem";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { SelectChangeEvent } from "@mui/material";
|
|
2
|
-
import { Dispatch, FC, SetStateAction } from "react";
|
|
1
|
+
import { MenuItem, Select, SelectChangeEvent } from "@mui/material";
|
|
2
|
+
import { Dispatch, FC, SetStateAction, useRef } from "react";
|
|
3
3
|
|
|
4
4
|
import { eventOpenColumnFilters } from "shared/lib/slickgrid";
|
|
5
5
|
import { EColumnFilter } from "shared/model/enums";
|
|
6
|
-
import { ContextSelect } from "shared/ui/ContextSelect";
|
|
7
6
|
|
|
8
7
|
import { options } from "../model";
|
|
9
8
|
|
|
10
9
|
export const SelectFilter: FC<IProps> = ({ filterId, setFilterId }) => {
|
|
10
|
+
const refSelect = useRef<HTMLDivElement>(null);
|
|
11
11
|
const list = options[eventOpenColumnFilters.group];
|
|
12
12
|
const value = list.some(({ id }) => id === filterId) ? filterId : list[0]?.id;
|
|
13
13
|
|
|
@@ -33,14 +33,21 @@ export const SelectFilter: FC<IProps> = ({ filterId, setFilterId }) => {
|
|
|
33
33
|
if (!value) return null;
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<
|
|
37
|
-
name={""}
|
|
38
|
-
list={list}
|
|
39
|
-
onChange={onChange}
|
|
40
|
-
width={"100%"}
|
|
41
|
-
showSelect={false}
|
|
36
|
+
<Select
|
|
42
37
|
value={value}
|
|
43
|
-
|
|
38
|
+
onChange={onChange}
|
|
39
|
+
ref={refSelect}
|
|
40
|
+
size={"small"}
|
|
41
|
+
MenuProps={{
|
|
42
|
+
container: () => refSelect.current,
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{list.map(({ id, name }) => (
|
|
46
|
+
<MenuItem value={id} key={id}>
|
|
47
|
+
{name}
|
|
48
|
+
</MenuItem>
|
|
49
|
+
))}
|
|
50
|
+
</Select>
|
|
44
51
|
);
|
|
45
52
|
};
|
|
46
53
|
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SelectChangeEvent } from '@mui/material';
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
export declare const ContextSelect: FC<IProps>;
|
|
4
|
-
interface IProps {
|
|
5
|
-
onChange: (event: SelectChangeEvent<string | number>) => void;
|
|
6
|
-
dataTestId?: string;
|
|
7
|
-
defaultValue?: number;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
height?: string;
|
|
10
|
-
list: IContextSelectValue[];
|
|
11
|
-
name: string;
|
|
12
|
-
showSelect?: boolean;
|
|
13
|
-
value?: number | string;
|
|
14
|
-
width?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface IContextSelectValue {
|
|
17
|
-
id: number | string;
|
|
18
|
-
name: string;
|
|
19
|
-
labelForSelect?: string;
|
|
20
|
-
isDisabled?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=ContextSelect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSelect.d.ts","sourceRoot":"","sources":["../../../../../src/shared/ui/ContextSelect/ContextSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIN,iBAAiB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAI3B,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,MAAM,CAwDpC,CAAC;AAEF,UAAU,MAAM;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IACnC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
MenuItem: import('@emotion/styled').StyledComponent<import('@mui/material').MenuItemOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
3
|
-
ref?: ((instance: HTMLLIElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLLIElement> | null | undefined;
|
|
4
|
-
}, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "sx" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "selected" | "dense" | "disableGutters" | "divider"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
7
|
-
//# sourceMappingURL=ContextSelect.style.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSelect.style.d.ts","sourceRoot":"","sources":["../../../../../src/shared/ui/ContextSelect/ContextSelect.style.ts"],"names":[],"mappings":";;;;;AAMA,wBAEE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/ui/ContextSelect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormControl,
|
|
3
|
-
InputLabel,
|
|
4
|
-
Select,
|
|
5
|
-
SelectChangeEvent,
|
|
6
|
-
} from "@mui/material";
|
|
7
|
-
import { FC } from "react";
|
|
8
|
-
|
|
9
|
-
import Styled from "./ContextSelect.style";
|
|
10
|
-
|
|
11
|
-
export const ContextSelect: FC<IProps> = ({
|
|
12
|
-
name,
|
|
13
|
-
list,
|
|
14
|
-
onChange,
|
|
15
|
-
defaultValue,
|
|
16
|
-
value,
|
|
17
|
-
showSelect = true,
|
|
18
|
-
dataTestId,
|
|
19
|
-
width = "12.8em",
|
|
20
|
-
height,
|
|
21
|
-
disabled = false,
|
|
22
|
-
}) => {
|
|
23
|
-
return (
|
|
24
|
-
<FormControl variant="outlined" size={"small"}>
|
|
25
|
-
<InputLabel id="reportType">{name}</InputLabel>
|
|
26
|
-
<Select
|
|
27
|
-
labelId="reportType"
|
|
28
|
-
id={name}
|
|
29
|
-
label={name}
|
|
30
|
-
autoWidth={true}
|
|
31
|
-
value={`${value ?? (defaultValue || 0)}`}
|
|
32
|
-
defaultValue={`${defaultValue || 0}`}
|
|
33
|
-
onChange={onChange}
|
|
34
|
-
disabled={disabled}
|
|
35
|
-
data-testid={dataTestId}
|
|
36
|
-
MenuProps={{
|
|
37
|
-
anchorOrigin: {
|
|
38
|
-
vertical: "bottom",
|
|
39
|
-
horizontal: "left",
|
|
40
|
-
},
|
|
41
|
-
transformOrigin: {
|
|
42
|
-
vertical: "top",
|
|
43
|
-
horizontal: "left",
|
|
44
|
-
},
|
|
45
|
-
disableScrollLock: true,
|
|
46
|
-
}}
|
|
47
|
-
sx={{ height, width }}
|
|
48
|
-
>
|
|
49
|
-
{showSelect && (
|
|
50
|
-
<Styled.MenuItem value={0} id="Select">
|
|
51
|
-
Select
|
|
52
|
-
</Styled.MenuItem>
|
|
53
|
-
)}
|
|
54
|
-
{list.map((el, index: number) => (
|
|
55
|
-
<Styled.MenuItem
|
|
56
|
-
value={el.id}
|
|
57
|
-
key={index}
|
|
58
|
-
id="selectedReport"
|
|
59
|
-
disabled={el.isDisabled}
|
|
60
|
-
>
|
|
61
|
-
{el.labelForSelect || el.name}
|
|
62
|
-
</Styled.MenuItem>
|
|
63
|
-
))}
|
|
64
|
-
</Select>
|
|
65
|
-
</FormControl>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
interface IProps {
|
|
70
|
-
onChange: (event: SelectChangeEvent<string | number>) => void;
|
|
71
|
-
dataTestId?: string;
|
|
72
|
-
defaultValue?: number;
|
|
73
|
-
disabled?: boolean;
|
|
74
|
-
height?: string;
|
|
75
|
-
list: IContextSelectValue[];
|
|
76
|
-
name: string;
|
|
77
|
-
showSelect?: boolean;
|
|
78
|
-
value?: number | string;
|
|
79
|
-
width?: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface IContextSelectValue {
|
|
83
|
-
id: number | string;
|
|
84
|
-
name: string;
|
|
85
|
-
labelForSelect?: string;
|
|
86
|
-
isDisabled?: boolean;
|
|
87
|
-
}
|