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.
Files changed (23) hide show
  1. package/dist/index.cjs.js +80 -80
  2. package/dist/index.es.js +1498 -1552
  3. package/dist/types/features/column-filters/ui/SelectFilter/model/options/options.d.ts +2 -2
  4. package/dist/types/features/column-filters/ui/SelectFilter/model/options/options.d.ts.map +1 -1
  5. package/dist/types/features/column-filters/ui/SelectFilter/model/types/IMenuItem.d.ts +6 -0
  6. package/dist/types/features/column-filters/ui/SelectFilter/model/types/IMenuItem.d.ts.map +1 -0
  7. package/dist/types/features/column-filters/ui/SelectFilter/model/types/index.d.ts +2 -0
  8. package/dist/types/features/column-filters/ui/SelectFilter/model/types/index.d.ts.map +1 -0
  9. package/dist/types/features/column-filters/ui/SelectFilter/ui/SelectFilter.d.ts.map +1 -1
  10. package/package.json +1 -1
  11. package/src/features/column-filters/ui/SelectFilter/model/options/options.ts +15 -14
  12. package/src/features/column-filters/ui/SelectFilter/model/types/IMenuItem.ts +6 -0
  13. package/src/features/column-filters/ui/SelectFilter/model/types/index.ts +1 -0
  14. package/src/features/column-filters/ui/SelectFilter/ui/SelectFilter.tsx +17 -10
  15. package/dist/types/shared/ui/ContextSelect/ContextSelect.d.ts +0 -23
  16. package/dist/types/shared/ui/ContextSelect/ContextSelect.d.ts.map +0 -1
  17. package/dist/types/shared/ui/ContextSelect/ContextSelect.style.d.ts +0 -7
  18. package/dist/types/shared/ui/ContextSelect/ContextSelect.style.d.ts.map +0 -1
  19. package/dist/types/shared/ui/ContextSelect/index.d.ts +0 -3
  20. package/dist/types/shared/ui/ContextSelect/index.d.ts.map +0 -1
  21. package/src/shared/ui/ContextSelect/ContextSelect.style.ts +0 -9
  22. package/src/shared/ui/ContextSelect/ContextSelect.tsx +0 -87
  23. package/src/shared/ui/ContextSelect/index.ts +0 -2
@@ -1,6 +1,6 @@
1
1
  import { EColumnFiltersGroup } from '../../../../../../shared/model/enums';
2
- import { IContextSelectValue } from '../../../../../../shared/ui/ContextSelect';
2
+ import { IMenuItem } from '../types';
3
3
  export declare const options: IOptions;
4
- type IOptions = Record<EColumnFiltersGroup, IContextSelectValue[]>;
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;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAkD9D,eAAO,MAAM,OAAO,EAAE,QAYrB,CAAC;AAEF,KAAK,QAAQ,GAAG,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,CAAC,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,6 @@
1
+ import { EColumnFilter } from '../../../../../../shared/model/enums';
2
+ export interface IMenuItem {
3
+ id: EColumnFilter;
4
+ name: string;
5
+ }
6
+ //# sourceMappingURL=IMenuItem.d.ts.map
@@ -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,2 @@
1
+ export type { IMenuItem } from './IMenuItem';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,MAAM,CAmCnC,CAAC;AAEF,UAAU,MAAM;IACf,QAAQ,EAAE,aAAa,CAAC;IACxB,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;CACrD"}
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,6 +1,6 @@
1
1
  {
2
2
  "name": "slick-table",
3
- "version": "1.1.60",
3
+ "version": "1.1.61",
4
4
  "description": "Enhanced version of SlickGrid library",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1,48 +1,49 @@
1
1
  import { EColumnFilter, EColumnFiltersGroup } from "shared/model/enums";
2
- import { IContextSelectValue } from "shared/ui/ContextSelect";
3
2
 
4
- const dateBetween: IContextSelectValue = {
3
+ import { IMenuItem } from "../types";
4
+
5
+ const dateBetween: IMenuItem = {
5
6
  id: EColumnFilter.DateBetween,
6
7
  name: "Between",
7
8
  };
8
- const dateEqual: IContextSelectValue = {
9
+ const dateEqual: IMenuItem = {
9
10
  id: EColumnFilter.DateEqual,
10
11
  name: "Equal",
11
12
  };
12
- const dateFrom: IContextSelectValue = {
13
+ const dateFrom: IMenuItem = {
13
14
  id: EColumnFilter.DateFrom,
14
15
  name: "From",
15
16
  };
16
- const dateTo: IContextSelectValue = { id: EColumnFilter.DateTo, name: "To" };
17
- const numberBetween: IContextSelectValue = {
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: IContextSelectValue = {
22
+ const numberEqual: IMenuItem = {
22
23
  id: EColumnFilter.NumberEqual,
23
24
  name: "Equal",
24
25
  };
25
- const numberFrom: IContextSelectValue = {
26
+ const numberFrom: IMenuItem = {
26
27
  id: EColumnFilter.NumberFrom,
27
28
  name: "From",
28
29
  };
29
- const numberTo: IContextSelectValue = {
30
+ const numberTo: IMenuItem = {
30
31
  id: EColumnFilter.NumberTo,
31
32
  name: "To",
32
33
  };
33
- const textContain: IContextSelectValue = {
34
+ const textContain: IMenuItem = {
34
35
  id: EColumnFilter.TextContain,
35
36
  name: "Contains",
36
37
  };
37
- const textEqual: IContextSelectValue = {
38
+ const textEqual: IMenuItem = {
38
39
  id: EColumnFilter.TextEqual,
39
40
  name: "Equal",
40
41
  };
41
- const textNotContain: IContextSelectValue = {
42
+ const textNotContain: IMenuItem = {
42
43
  id: EColumnFilter.TextNotContain,
43
44
  name: "Does not contain",
44
45
  };
45
- const textNotEqual: IContextSelectValue = {
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, IContextSelectValue[]>;
67
+ type IOptions = Record<EColumnFiltersGroup, IMenuItem[]>;
@@ -0,0 +1,6 @@
1
+ import { EColumnFilter } from "shared/model/enums";
2
+
3
+ export interface IMenuItem {
4
+ id: EColumnFilter;
5
+ name: string;
6
+ }
@@ -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
- <ContextSelect
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,3 +0,0 @@
1
- export { ContextSelect } from './ContextSelect';
2
- export type { IContextSelectValue } from './ContextSelect';
3
- //# sourceMappingURL=index.d.ts.map
@@ -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,9 +0,0 @@
1
- import { MenuItem, styled } from "@mui/material";
2
-
3
- const StyledMenuItem = styled(MenuItem)({
4
- fontSize: "12px",
5
- });
6
-
7
- export default {
8
- MenuItem: StyledMenuItem,
9
- };
@@ -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
- }
@@ -1,2 +0,0 @@
1
- export { ContextSelect } from "./ContextSelect";
2
- export type { IContextSelectValue } from "./ContextSelect";