slick-table 1.1.16 → 1.1.18
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 +85 -85
- package/dist/index.es.js +4648 -4583
- package/dist/types/entities/popup-summary/index.d.ts +0 -1
- package/dist/types/entities/popup-summary/index.d.ts.map +1 -1
- package/dist/types/entities/popup-summary/lib/getTotals.d.ts.map +1 -1
- package/dist/types/entities/popup-summary/model/index.d.ts +0 -1
- package/dist/types/entities/popup-summary/model/index.d.ts.map +1 -1
- package/dist/types/entities/popup-summary/model/types/ITotal.d.ts +5 -0
- package/dist/types/entities/popup-summary/model/types/ITotal.d.ts.map +1 -1
- package/dist/types/entities/popup-summary/ui/PopupSummary.d.ts.map +1 -1
- package/dist/types/entities/popup-summary/ui/PopupSummary.style.d.ts +13 -0
- package/dist/types/entities/popup-summary/ui/PopupSummary.style.d.ts.map +1 -0
- package/dist/types/entities/popup-summary/ui/TotalByColumn/TotalByColumn.d.ts +2 -0
- package/dist/types/entities/popup-summary/ui/TotalByColumn/TotalByColumn.d.ts.map +1 -1
- package/dist/types/entities/popup-summary/ui/TotalByColumn/TotalByColumn.style.d.ts.map +1 -1
- package/dist/types/entities/popup-summary/ui/styles/StyledDialogContentText.d.ts +4 -0
- package/dist/types/entities/popup-summary/ui/styles/StyledDialogContentText.d.ts.map +1 -0
- package/dist/types/entities/popup-summary/ui/styles/index.d.ts +2 -0
- package/dist/types/entities/popup-summary/ui/styles/index.d.ts.map +1 -0
- package/dist/types/features/column-filters/ui/ButtonReset/ButtonReset.style.d.ts +1 -1
- package/dist/types/features/context-menu/ui/ButtonSummary/ButtonSummary.d.ts.map +1 -1
- package/dist/types/features/header-context-menu/ui/Item/Item.style.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/index.d.ts +1 -1
- package/dist/types/shared/lib/slickgrid/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/lib/hotKeys/hotKeysOpenSummary.d.ts +3 -0
- package/dist/types/shared/lib/slickgrid/lib/hotKeys/hotKeysOpenSummary.d.ts.map +1 -0
- package/dist/types/shared/lib/slickgrid/lib/hotKeys/index.d.ts +1 -0
- package/dist/types/shared/lib/slickgrid/lib/hotKeys/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/lib/index.d.ts +1 -1
- package/dist/types/shared/lib/slickgrid/lib/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/WithSummary.d.ts +7 -0
- package/dist/types/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/WithSummary.d.ts.map +1 -0
- package/dist/types/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/index.d.ts +1 -0
- package/dist/types/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/model/SlickTable/hotKeys/index.d.ts +1 -1
- package/dist/types/shared/lib/slickgrid/model/SlickTable/hotKeys/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/model/SlickTable/index.d.ts +1 -1
- package/dist/types/shared/lib/slickgrid/model/SlickTable/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/model/events/eventSummary.d.ts +13 -0
- package/dist/types/shared/lib/slickgrid/model/events/eventSummary.d.ts.map +1 -0
- package/dist/types/shared/lib/slickgrid/model/events/index.d.ts +1 -0
- package/dist/types/shared/lib/slickgrid/model/events/index.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/model/index.d.ts +2 -2
- package/dist/types/shared/lib/slickgrid/model/index.d.ts.map +1 -1
- package/dist/types/shared/model/enums/EKeyCode.d.ts +1 -0
- package/dist/types/shared/model/enums/EKeyCode.d.ts.map +1 -1
- package/dist/types/shared/ui/ContextSelect/ContextSelect.style.d.ts +1 -1
- package/package.json +1 -1
- package/src/app/styles/icons.scss +16 -0
- package/src/app/styles/mixins.scss +12 -0
- package/src/entities/popup-summary/index.ts +0 -1
- package/src/entities/popup-summary/lib/getTotals.ts +16 -1
- package/src/entities/popup-summary/model/index.ts +0 -1
- package/src/entities/popup-summary/model/types/ITotal.ts +23 -1
- package/src/entities/popup-summary/ui/PopupSummary.style.ts +21 -0
- package/src/entities/popup-summary/ui/PopupSummary.tsx +24 -24
- package/src/entities/popup-summary/ui/TotalByColumn/TotalByColumn.style.ts +3 -0
- package/src/entities/popup-summary/ui/TotalByColumn/TotalByColumn.tsx +13 -4
- package/src/entities/popup-summary/ui/styles/StyledDialogContentText.ts +7 -0
- package/src/entities/popup-summary/ui/styles/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonSummary/ButtonSummary.tsx +2 -4
- package/src/index.scss +2 -1
- package/src/index.ts +2 -0
- package/src/shared/lib/slickgrid/index.ts +2 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysOpenSummary.ts +7 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/index.ts +1 -0
- package/src/shared/lib/slickgrid/lib/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/WithSummary.ts +28 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/index.ts +1 -0
- package/src/{entities/popup-summary/model/event → shared/lib/slickgrid/model/events}/eventSummary.ts +9 -0
- package/src/shared/lib/slickgrid/model/events/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/index.ts +6 -1
- package/src/shared/model/enums/EKeyCode.ts +1 -0
- package/dist/types/entities/popup-summary/model/event/eventSummary.d.ts +0 -9
- package/dist/types/entities/popup-summary/model/event/eventSummary.d.ts.map +0 -1
- package/dist/types/entities/popup-summary/model/event/index.d.ts +0 -2
- package/dist/types/entities/popup-summary/model/event/index.d.ts.map +0 -1
- package/src/entities/popup-summary/model/event/index.ts +0 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Tooltip } from "@mui/material";
|
|
2
2
|
import { FC, useState } from "react";
|
|
3
|
+
import { FormatterResultWithHtml, FormatterResultWithText } from "slickgrid";
|
|
4
|
+
|
|
5
|
+
import { StyledDialogContentText } from "../styles";
|
|
3
6
|
|
|
4
7
|
import Styled from "./TotalByColumn.style";
|
|
5
8
|
|
|
6
|
-
export const TotalByColumn: FC<IProps> = ({ label, total }) => {
|
|
9
|
+
export const TotalByColumn: FC<IProps> = ({ label, total, totalFormatted }) => {
|
|
7
10
|
const [open, setOpen] = useState(false);
|
|
8
11
|
|
|
9
12
|
function copyToClipboard() {
|
|
@@ -15,8 +18,8 @@ export const TotalByColumn: FC<IProps> = ({ label, total }) => {
|
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
return (
|
|
18
|
-
<
|
|
19
|
-
<Styled.Text>{
|
|
21
|
+
<StyledDialogContentText>
|
|
22
|
+
<Styled.Text>{`total ${label}: ${totalFormatted}`}</Styled.Text>
|
|
20
23
|
{open ? (
|
|
21
24
|
<Styled.Icon className={"sgi sgi-check"}></Styled.Icon>
|
|
22
25
|
) : (
|
|
@@ -27,11 +30,17 @@ export const TotalByColumn: FC<IProps> = ({ label, total }) => {
|
|
|
27
30
|
/>
|
|
28
31
|
</Tooltip>
|
|
29
32
|
)}
|
|
30
|
-
</
|
|
33
|
+
</StyledDialogContentText>
|
|
31
34
|
);
|
|
32
35
|
};
|
|
33
36
|
|
|
34
37
|
interface IProps {
|
|
35
38
|
label: string;
|
|
36
39
|
total: number;
|
|
40
|
+
totalFormatted:
|
|
41
|
+
| string
|
|
42
|
+
| HTMLElement
|
|
43
|
+
| DocumentFragment
|
|
44
|
+
| FormatterResultWithHtml
|
|
45
|
+
| FormatterResultWithText;
|
|
37
46
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StyledDialogContentText } from "./StyledDialogContentText";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Dispatch, FC, SetStateAction } from "react";
|
|
2
2
|
|
|
3
|
-
import { eventContextMenu } from "shared/lib/slickgrid";
|
|
4
|
-
|
|
5
|
-
import { eventSummary } from "entities/popup-summary";
|
|
3
|
+
import { eventContextMenu, eventSummary } from "shared/lib/slickgrid";
|
|
6
4
|
|
|
7
5
|
import Styled from "../ContextMenu.style";
|
|
8
6
|
|
|
@@ -14,7 +12,7 @@ export const ButtonSummary: FC<IProps> = ({ setIsOpened }) => {
|
|
|
14
12
|
function openSummary() {
|
|
15
13
|
if (!table) return;
|
|
16
14
|
setIsOpened(false);
|
|
17
|
-
|
|
15
|
+
eventSummary.table = table;
|
|
18
16
|
eventSummary.open = true;
|
|
19
17
|
}
|
|
20
18
|
|
package/src/index.scss
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { hotKeysCopy } from "./hotKeysCopy";
|
|
2
2
|
export { hotKeysDelete } from "./hotKeysDelete";
|
|
3
|
+
export { hotKeysOpenSummary } from "./hotKeysOpenSummary";
|
|
3
4
|
export { hotKeysRedo } from "./hotKeysRedo";
|
|
4
5
|
export { hotKeysReverse } from "./hotKeysReverse";
|
|
5
6
|
export { hotKeysUndo } from "./hotKeysUndo";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OnKeyDownEventArgs, SlickEventData } from "slickgrid";
|
|
2
|
+
|
|
3
|
+
import { eventSummary } from "shared/lib/slickgrid";
|
|
4
|
+
import { ISlickTable } from "shared/model/types";
|
|
5
|
+
|
|
6
|
+
import { hotKeysOpenSummary } from "../../../../lib";
|
|
7
|
+
import { HotKeysDecorator } from "./HotKeysDecorator";
|
|
8
|
+
|
|
9
|
+
export class WithSummary extends HotKeysDecorator {
|
|
10
|
+
public handleKeyboardEvent(
|
|
11
|
+
event: SlickEventData<OnKeyDownEventArgs>,
|
|
12
|
+
table: ISlickTable,
|
|
13
|
+
): void {
|
|
14
|
+
if (!table.isActive) return;
|
|
15
|
+
if (hotKeysOpenSummary(event)) {
|
|
16
|
+
if (!table.summaryColumnIds.length) return;
|
|
17
|
+
const grid = table.grid;
|
|
18
|
+
if (!grid) return;
|
|
19
|
+
if (grid.getSelectedRows().length < 2) return;
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
event.stopImmediatePropagation();
|
|
22
|
+
eventSummary.table = table;
|
|
23
|
+
eventSummary.open = true;
|
|
24
|
+
} else {
|
|
25
|
+
super.handleKeyboardEvent.call(this, event, table);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -2,3 +2,4 @@ export { HotKeysDecorator } from "./HotKeysDecorator";
|
|
|
2
2
|
export { PreventCopying } from "./PreventCopying";
|
|
3
3
|
export { RedoUndoOnly } from "./RedoUndoOnly";
|
|
4
4
|
export { WithConfirmationOfDeletion } from "./WithConfirmationOfDeletion";
|
|
5
|
+
export { WithSummary } from "./WithSummary";
|
package/src/{entities/popup-summary/model/event → shared/lib/slickgrid/model/events}/eventSummary.ts
RENAMED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AnEvent } from "shared/lib/an-event";
|
|
2
|
+
import { ISlickTable } from "shared/model/types";
|
|
2
3
|
|
|
3
4
|
class EventSummary extends AnEvent {
|
|
4
5
|
private _open = false;
|
|
6
|
+
private _table: ISlickTable | undefined;
|
|
5
7
|
|
|
6
8
|
get open() {
|
|
7
9
|
return this._open;
|
|
@@ -10,6 +12,13 @@ class EventSummary extends AnEvent {
|
|
|
10
12
|
this._open = open;
|
|
11
13
|
this.notify();
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
get table() {
|
|
17
|
+
return this._table;
|
|
18
|
+
}
|
|
19
|
+
set table(table) {
|
|
20
|
+
this._table = table;
|
|
21
|
+
}
|
|
13
22
|
}
|
|
14
23
|
|
|
15
24
|
export const eventSummary = new EventSummary();
|
|
@@ -14,6 +14,11 @@ export {
|
|
|
14
14
|
RedoUndoOnly,
|
|
15
15
|
SlickTable,
|
|
16
16
|
WithConfirmationOfDeletion,
|
|
17
|
+
WithSummary,
|
|
17
18
|
WithoutHotKeys,
|
|
18
19
|
} from "./SlickTable";
|
|
19
|
-
export {
|
|
20
|
+
export {
|
|
21
|
+
eventContextMenu,
|
|
22
|
+
eventHeaderContextMenu,
|
|
23
|
+
eventSummary,
|
|
24
|
+
} from "./events";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AnEvent } from '../../../../shared/lib/an-event';
|
|
2
|
-
declare class EventSummary extends AnEvent {
|
|
3
|
-
private _open;
|
|
4
|
-
get open(): boolean;
|
|
5
|
-
set open(open: boolean);
|
|
6
|
-
}
|
|
7
|
-
export declare const eventSummary: EventSummary;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=eventSummary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/entities/popup-summary/model/event/eventSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,cAAM,YAAa,SAAQ,OAAO;IACjC,OAAO,CAAC,KAAK,CAAS;IAEtB,IAAI,IAAI,YAEP;IACD,IAAI,IAAI,CAAC,IAAI,SAAA,EAGZ;CACD;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/entities/popup-summary/model/event/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { eventSummary } from "./eventSummary";
|