slick-table 1.1.56 → 1.1.57
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 +23 -23
- package/dist/index.es.js +189 -189
- package/dist/types/entities/popup-summary/ui/PopupSummary.d.ts +5 -1
- package/dist/types/entities/popup-summary/ui/PopupSummary.d.ts.map +1 -1
- package/dist/types/features/column-filters/lib/hooks/useSubscribeToEvent.d.ts +1 -1
- package/dist/types/features/column-filters/lib/hooks/useSubscribeToEvent.d.ts.map +1 -1
- package/dist/types/features/column-filters/ui/ColumnFilters.d.ts +5 -1
- package/dist/types/features/column-filters/ui/ColumnFilters.d.ts.map +1 -1
- package/dist/types/features/context-menu/lib/hooks/useSubscribeToEvent.d.ts +1 -1
- package/dist/types/features/context-menu/lib/hooks/useSubscribeToEvent.d.ts.map +1 -1
- package/dist/types/features/context-menu/ui/ContextMenu.d.ts +5 -1
- package/dist/types/features/context-menu/ui/ContextMenu.d.ts.map +1 -1
- package/dist/types/features/header-context-menu/lib/hooks/useSubscribeToEvent.d.ts +1 -1
- package/dist/types/features/header-context-menu/lib/hooks/useSubscribeToEvent.d.ts.map +1 -1
- package/dist/types/features/header-context-menu/ui/HeaderContextMenu.d.ts +5 -1
- package/dist/types/features/header-context-menu/ui/HeaderContextMenu.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/entities/popup-summary/ui/PopupSummary.tsx +8 -3
- package/src/features/column-filters/lib/hooks/useSubscribeToEvent.ts +3 -1
- package/src/features/column-filters/ui/ColumnFilters.tsx +6 -2
- package/src/features/context-menu/lib/hooks/useSubscribeToEvent.ts +4 -2
- package/src/features/context-menu/ui/ContextMenu.tsx +6 -2
- package/src/features/header-context-menu/lib/hooks/useSubscribeToEvent.ts +4 -2
- package/src/features/header-context-menu/ui/HeaderContextMenu.tsx +6 -2
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.tsx +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupSummary.d.ts","sourceRoot":"","sources":["../../../../../src/entities/popup-summary/ui/PopupSummary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAWhD,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"PopupSummary.d.ts","sourceRoot":"","sources":["../../../../../src/entities/popup-summary/ui/PopupSummary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAWhD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,CAuDlC,CAAC;AAEF,UAAU,KAAK;IACd,OAAO,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
export declare function useSubscribeToEvent(setIsOpened: Dispatch<SetStateAction<boolean
|
|
2
|
+
export declare function useSubscribeToEvent(setIsOpened: Dispatch<SetStateAction<boolean>>, tableId: string): void;
|
|
3
3
|
//# sourceMappingURL=useSubscribeToEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSubscribeToEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/column-filters/lib/hooks/useSubscribeToEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAI5D,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"useSubscribeToEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/column-filters/lib/hooks/useSubscribeToEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAI5D,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAC9C,OAAO,EAAE,MAAM,QAYf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnFilters.d.ts","sourceRoot":"","sources":["../../../../../src/features/column-filters/ui/ColumnFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAe/C,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"ColumnFilters.d.ts","sourceRoot":"","sources":["../../../../../src/features/column-filters/ui/ColumnFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAe/C,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,KAAK,CA4BnC,CAAC;AAEF,UAAU,KAAK;IACd,OAAO,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
export declare function useSubscribeToEvent(setIsOpened: Dispatch<SetStateAction<boolean
|
|
2
|
+
export declare function useSubscribeToEvent(setIsOpened: Dispatch<SetStateAction<boolean>>, tableId: string): void;
|
|
3
3
|
//# sourceMappingURL=useSubscribeToEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSubscribeToEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/context-menu/lib/hooks/useSubscribeToEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAQ5D,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"useSubscribeToEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/context-menu/lib/hooks/useSubscribeToEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAQ5D,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAC9C,OAAO,EAAE,MAAM,QAkBf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/features/context-menu/ui/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAkB/C,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/features/context-menu/ui/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAkB/C,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,KAAK,CAyBjC,CAAC;AAEF,UAAU,KAAK;IACd,OAAO,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
export declare function useSubscribeToEvent(setIsOpened: Dispatch<SetStateAction<boolean
|
|
2
|
+
export declare function useSubscribeToEvent(setIsOpened: Dispatch<SetStateAction<boolean>>, tableId: string): void;
|
|
3
3
|
//# sourceMappingURL=useSubscribeToEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSubscribeToEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/header-context-menu/lib/hooks/useSubscribeToEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAQ5D,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"useSubscribeToEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/header-context-menu/lib/hooks/useSubscribeToEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAa,MAAM,OAAO,CAAC;AAQ5D,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAC9C,OAAO,EAAE,MAAM,QAkBf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/features/header-context-menu/ui/HeaderContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAiC,MAAM,OAAO,CAAC;AAe1D,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"HeaderContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/features/header-context-menu/ui/HeaderContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAiC,MAAM,OAAO,CAAC;AAe1D,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CA6CvC,CAAC;AAEF,UAAU,KAAK;IACd,OAAO,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { StyledDialogContentText } from "./styles";
|
|
|
10
10
|
|
|
11
11
|
import Styled from "./PopupSummary.style";
|
|
12
12
|
|
|
13
|
-
export const PopupSummary: FC = () => {
|
|
13
|
+
export const PopupSummary: FC<Props> = ({ tableId }) => {
|
|
14
14
|
const [rowsNumber, setRowsNumber] = useState(0);
|
|
15
15
|
const [isOpened, setIsOpened] = useState(false);
|
|
16
16
|
const [totals, setTotals] = useState<ITotal>({});
|
|
@@ -21,7 +21,8 @@ export const PopupSummary: FC = () => {
|
|
|
21
21
|
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
function callback() {
|
|
24
|
-
const open = eventSummary
|
|
24
|
+
const { open, table } = eventSummary;
|
|
25
|
+
if (table?.id !== tableId) return;
|
|
25
26
|
if (open) {
|
|
26
27
|
const table = eventSummary.table;
|
|
27
28
|
const grid = table?.grid;
|
|
@@ -34,7 +35,7 @@ export const PopupSummary: FC = () => {
|
|
|
34
35
|
return () => {
|
|
35
36
|
eventSummary.unsubscribe(callback);
|
|
36
37
|
};
|
|
37
|
-
}, []);
|
|
38
|
+
}, [tableId]);
|
|
38
39
|
|
|
39
40
|
if (!isOpened) return null;
|
|
40
41
|
|
|
@@ -65,3 +66,7 @@ export const PopupSummary: FC = () => {
|
|
|
65
66
|
</Styled.Dialog>
|
|
66
67
|
);
|
|
67
68
|
};
|
|
69
|
+
|
|
70
|
+
interface Props {
|
|
71
|
+
tableId: string;
|
|
72
|
+
}
|
|
@@ -4,14 +4,16 @@ import { eventOpenColumnFilters } from "shared/lib/slickgrid";
|
|
|
4
4
|
|
|
5
5
|
export function useSubscribeToEvent(
|
|
6
6
|
setIsOpened: Dispatch<SetStateAction<boolean>>,
|
|
7
|
+
tableId: string,
|
|
7
8
|
) {
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
function callback() {
|
|
11
|
+
if (eventOpenColumnFilters.table?.id !== tableId) return;
|
|
10
12
|
setIsOpened(true);
|
|
11
13
|
}
|
|
12
14
|
eventOpenColumnFilters.subscribe(callback);
|
|
13
15
|
return () => {
|
|
14
16
|
eventOpenColumnFilters.unsubscribe(callback);
|
|
15
17
|
};
|
|
16
|
-
}, []);
|
|
18
|
+
}, [tableId]);
|
|
17
19
|
}
|
|
@@ -13,14 +13,14 @@ import { SelectFilter } from "./SelectFilter";
|
|
|
13
13
|
|
|
14
14
|
import Styled from "./ColumnFilters.style";
|
|
15
15
|
|
|
16
|
-
export const ColumnFilters: FC = () => {
|
|
16
|
+
export const ColumnFilters: FC<Props> = ({ tableId }) => {
|
|
17
17
|
const [value, setValue] = useState<IColumnFilterValue>(defaultValue);
|
|
18
18
|
const [filterId, setFilterId] = useState<EColumnFilter>(
|
|
19
19
|
EColumnFilter.TextContain,
|
|
20
20
|
);
|
|
21
21
|
const [isOpened, setIsOpened] = useState(false);
|
|
22
22
|
|
|
23
|
-
useSubscribeToEvent(setIsOpened);
|
|
23
|
+
useSubscribeToEvent(setIsOpened, tableId);
|
|
24
24
|
useOpenMenu(isOpened, setFilterId, setValue);
|
|
25
25
|
|
|
26
26
|
if (!isOpened) return null;
|
|
@@ -42,3 +42,7 @@ export const ColumnFilters: FC = () => {
|
|
|
42
42
|
</Fragment>
|
|
43
43
|
);
|
|
44
44
|
};
|
|
45
|
+
|
|
46
|
+
interface Props {
|
|
47
|
+
tableId: string;
|
|
48
|
+
}
|
|
@@ -8,14 +8,16 @@ import { CONTEXT_MENU } from "../../model";
|
|
|
8
8
|
|
|
9
9
|
export function useSubscribeToEvent(
|
|
10
10
|
setIsOpened: Dispatch<SetStateAction<boolean>>,
|
|
11
|
+
tableId: string,
|
|
11
12
|
) {
|
|
12
13
|
useEffect(() => {
|
|
13
14
|
function callback() {
|
|
15
|
+
const { table, x, y } = eventContextMenu;
|
|
16
|
+
if (table?.id !== tableId) return;
|
|
14
17
|
setIsOpened(true);
|
|
15
18
|
setTimeout(() => {
|
|
16
19
|
const menu = document.getElementById(CONTEXT_MENU);
|
|
17
20
|
if (!menu) return;
|
|
18
|
-
const { x, y } = eventContextMenu;
|
|
19
21
|
makeVisible(menu, x, y);
|
|
20
22
|
}, 0);
|
|
21
23
|
}
|
|
@@ -23,5 +25,5 @@ export function useSubscribeToEvent(
|
|
|
23
25
|
return () => {
|
|
24
26
|
eventContextMenu.unsubscribe(callback);
|
|
25
27
|
};
|
|
26
|
-
}, []);
|
|
28
|
+
}, [tableId]);
|
|
27
29
|
}
|
|
@@ -16,10 +16,10 @@ import { Print } from "./Print";
|
|
|
16
16
|
|
|
17
17
|
import Styled from "./ContextMenu.style";
|
|
18
18
|
|
|
19
|
-
export const ContextMenu: FC = () => {
|
|
19
|
+
export const ContextMenu: FC<Props> = ({ tableId }) => {
|
|
20
20
|
const [isOpened, setIsOpened] = useState(false);
|
|
21
21
|
|
|
22
|
-
useSubscribeToEvent(setIsOpened);
|
|
22
|
+
useSubscribeToEvent(setIsOpened, tableId);
|
|
23
23
|
|
|
24
24
|
if (!isOpened) return null;
|
|
25
25
|
|
|
@@ -42,3 +42,7 @@ export const ContextMenu: FC = () => {
|
|
|
42
42
|
</Fragment>
|
|
43
43
|
);
|
|
44
44
|
};
|
|
45
|
+
|
|
46
|
+
interface Props {
|
|
47
|
+
tableId: string;
|
|
48
|
+
}
|
|
@@ -8,14 +8,16 @@ import { HEADER_CONTEXT_MENU } from "../../model";
|
|
|
8
8
|
|
|
9
9
|
export function useSubscribeToEvent(
|
|
10
10
|
setIsOpened: Dispatch<SetStateAction<boolean>>,
|
|
11
|
+
tableId: string,
|
|
11
12
|
) {
|
|
12
13
|
useEffect(() => {
|
|
13
14
|
function callback() {
|
|
15
|
+
const { table, x, y } = eventHeaderContextMenu;
|
|
16
|
+
if (table?.id !== tableId) return;
|
|
14
17
|
setIsOpened(true);
|
|
15
18
|
setTimeout(() => {
|
|
16
19
|
const menu = document.getElementById(HEADER_CONTEXT_MENU);
|
|
17
20
|
if (!menu) return;
|
|
18
|
-
const { x, y } = eventHeaderContextMenu;
|
|
19
21
|
makeVisible(menu, x, y);
|
|
20
22
|
}, 0);
|
|
21
23
|
}
|
|
@@ -23,5 +25,5 @@ export function useSubscribeToEvent(
|
|
|
23
25
|
return () => {
|
|
24
26
|
eventHeaderContextMenu.unsubscribe(callback);
|
|
25
27
|
};
|
|
26
|
-
}, []);
|
|
28
|
+
}, [tableId]);
|
|
27
29
|
}
|
|
@@ -13,11 +13,11 @@ import { Title } from "./Title";
|
|
|
13
13
|
|
|
14
14
|
import Styled from "./HeaderContextMenu.style";
|
|
15
15
|
|
|
16
|
-
export const HeaderContextMenu: FC = () => {
|
|
16
|
+
export const HeaderContextMenu: FC<Props> = ({ tableId }) => {
|
|
17
17
|
const [checked, setChecked] = useState<string[]>([]);
|
|
18
18
|
const [isOpened, setIsOpened] = useState(false);
|
|
19
19
|
|
|
20
|
-
useSubscribeToEvent(setIsOpened);
|
|
20
|
+
useSubscribeToEvent(setIsOpened, tableId);
|
|
21
21
|
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
if (!isOpened) return;
|
|
@@ -59,3 +59,7 @@ export const HeaderContextMenu: FC = () => {
|
|
|
59
59
|
</Fragment>
|
|
60
60
|
);
|
|
61
61
|
};
|
|
62
|
+
|
|
63
|
+
interface Props {
|
|
64
|
+
tableId: string;
|
|
65
|
+
}
|
|
@@ -37,7 +37,7 @@ export const SlickgridTable: FC<Props> = ({
|
|
|
37
37
|
return <Styled.Skeleton animation="wave" variant={"rectangular"} />;
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
|
-
<Styled.Wrapper
|
|
40
|
+
<Styled.Wrapper className={"slick-table"}>
|
|
41
41
|
<Table
|
|
42
42
|
SlickDataView={SlickDataView}
|
|
43
43
|
applyCellCssStyles={applyCellCssStyles}
|
|
@@ -59,10 +59,10 @@ export const SlickgridTable: FC<Props> = ({
|
|
|
59
59
|
options={options}
|
|
60
60
|
table={table}
|
|
61
61
|
/>
|
|
62
|
-
<HeaderContextMenu />
|
|
63
|
-
<ColumnFilters />
|
|
64
|
-
<ContextMenu />
|
|
65
|
-
<PopupSummary />
|
|
62
|
+
<HeaderContextMenu tableId={table.id} />
|
|
63
|
+
<ColumnFilters tableId={table.id} />
|
|
64
|
+
<ContextMenu tableId={table.id} />
|
|
65
|
+
<PopupSummary tableId={table.id} />
|
|
66
66
|
</Styled.Wrapper>
|
|
67
67
|
);
|
|
68
68
|
};
|