@codezee/sixtify-brahma 0.2.144 → 0.2.146
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/packages/shared-components/dist/ActionButtons/ActionButtons.js +1 -1
- package/packages/shared-components/dist/AgGrid/hooks/index.d.ts +0 -1
- package/packages/shared-components/dist/AgGrid/hooks/index.d.ts.map +1 -1
- package/packages/shared-components/dist/AgGrid/hooks/index.js +0 -1
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridCheckBoxSelection.js +1 -1
- package/packages/shared-components/dist/AppBar/AppBar.d.ts +4 -3
- package/packages/shared-components/dist/AppBar/AppBar.d.ts.map +1 -1
- package/packages/shared-components/dist/AppBar/AppBar.js +2 -2
- package/packages/shared-components/dist/utils/hooks/useGlobalKeyboardShortcut.d.ts +1 -1
- package/packages/shared-components/dist/utils/hooks/useGlobalKeyboardShortcut.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/hooks/useGlobalKeyboardShortcut.js +12 -9
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridKeyboardShortcuts.d.ts +0 -8
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridKeyboardShortcuts.d.ts.map +0 -1
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridKeyboardShortcuts.js +0 -37
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ const material_1 = require("@mui/material");
|
|
|
9
9
|
const noop_1 = __importDefault(require("lodash/noop"));
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const utils_1 = require("../utils");
|
|
12
|
-
function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOpenMenuOnShortcut = false, shortcutKey = "
|
|
12
|
+
function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOpenMenuOnShortcut = false, shortcutKey = "a", }) {
|
|
13
13
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
14
14
|
const [openMenuKey, setOpenMenuKey] = (0, react_1.useState)(null);
|
|
15
15
|
const buttonRefs = (0, react_1.useRef)({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
|
|
@@ -19,4 +19,3 @@ __exportStar(require("./useAgGridSummaryRow"), exports);
|
|
|
19
19
|
__exportStar(require("./useAgGridSummaryRowUpdate"), exports);
|
|
20
20
|
__exportStar(require("./useAgGridRowSelectionConfig"), exports);
|
|
21
21
|
__exportStar(require("./useAgGridFilteredData"), exports);
|
|
22
|
-
__exportStar(require("./useAgGridKeyboardShortcuts"), exports);
|
|
@@ -89,7 +89,7 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
89
89
|
});
|
|
90
90
|
(0, utils_1.useGlobalKeyboardShortcut)({
|
|
91
91
|
key: "a",
|
|
92
|
-
modifierKeys:
|
|
92
|
+
modifierKeys: "alt",
|
|
93
93
|
onTrigger: () => {
|
|
94
94
|
if (isDialogOnTop(gridRef)) {
|
|
95
95
|
return;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type AppBarOwnProps } from "@mui/material";
|
|
1
2
|
import type { PropsWithChildren } from "react";
|
|
2
|
-
export type AppBarProps = {
|
|
3
|
-
drawerOpen
|
|
3
|
+
export type AppBarProps = AppBarOwnProps & {
|
|
4
|
+
drawerOpen?: boolean;
|
|
4
5
|
};
|
|
5
|
-
export declare const AppBar: ({ drawerOpen, children, }: PropsWithChildren<AppBarProps>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const AppBar: ({ drawerOpen, children, ...props }: PropsWithChildren<AppBarProps>) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=AppBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppBar.d.ts","sourceRoot":"","sources":["../../src/AppBar/AppBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppBar.d.ts","sourceRoot":"","sources":["../../src/AppBar/AppBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAS,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,oCAIpB,iBAAiB,CAAC,WAAW,CAAC,4CAkBhC,CAAC"}
|
|
@@ -6,8 +6,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const PadBox_1 = require("../PadBox");
|
|
8
8
|
const AppBar_styled_1 = require("./AppBar.styled");
|
|
9
|
-
const AppBar = ({ drawerOpen, children, }) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(AppBar_styled_1.StyledAppBar, { position: "fixed", open: drawerOpen, children: (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", alignItems: "center", minHeight: { xs: "58px", lg: "64px" }, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: {
|
|
9
|
+
const AppBar = ({ drawerOpen, children, ...props }) => {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(AppBar_styled_1.StyledAppBar, { position: "fixed", open: drawerOpen, ...props, children: (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", alignItems: "center", minHeight: { xs: "58px", lg: "64px" }, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: {
|
|
11
11
|
padding: { lg: "0 20px", xs: "0px 5px" },
|
|
12
12
|
}, children: children }) }) }));
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGlobalKeyboardShortcut.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useGlobalKeyboardShortcut.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"useGlobalKeyboardShortcut.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/useGlobalKeyboardShortcut.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAEpD,KAAK,6BAA6B,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,QAAQ,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,qDAKvC,6BAA6B,SA8E/B,CAAC"}
|
|
@@ -14,9 +14,10 @@ const useGlobalKeyboardShortcut = ({ key, onTrigger, modifierKeys = "ctrl", with
|
|
|
14
14
|
const normalizedCode = key.length === 1 ? `Key${key.toUpperCase()}` : key;
|
|
15
15
|
const keyMatch = e.code?.toLowerCase() === normalizedCode?.toLowerCase();
|
|
16
16
|
if (withoutModifiers) {
|
|
17
|
-
const hasNoModifiers = !e.ctrlKey && !e.
|
|
17
|
+
const hasNoModifiers = !e.ctrlKey && !e.shiftKey && !e.altKey;
|
|
18
18
|
if (keyMatch && hasNoModifiers && !e.repeat) {
|
|
19
19
|
e.preventDefault();
|
|
20
|
+
e.stopImmediatePropagation();
|
|
20
21
|
e.stopPropagation();
|
|
21
22
|
onTrigger();
|
|
22
23
|
}
|
|
@@ -26,34 +27,36 @@ const useGlobalKeyboardShortcut = ({ key, onTrigger, modifierKeys = "ctrl", with
|
|
|
26
27
|
const modifierMatch = (0, every_1.default)(normalizedModifierKeys, (mod) => {
|
|
27
28
|
switch (mod) {
|
|
28
29
|
case "ctrl":
|
|
29
|
-
return e.ctrlKey
|
|
30
|
+
return e.ctrlKey;
|
|
30
31
|
case "shift":
|
|
31
32
|
return e.shiftKey;
|
|
32
|
-
case "
|
|
33
|
-
return e.
|
|
33
|
+
case "alt":
|
|
34
|
+
return e.altKey;
|
|
34
35
|
default:
|
|
35
36
|
return true;
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
const requiredModifiers = normalizedModifierKeys;
|
|
39
40
|
let requiredModifiersCount = 0;
|
|
40
|
-
if (requiredModifiers.includes("ctrl") &&
|
|
41
|
+
if (requiredModifiers.includes("ctrl") && e.ctrlKey) {
|
|
41
42
|
requiredModifiersCount++;
|
|
42
43
|
}
|
|
43
44
|
if (requiredModifiers.includes("shift") && e.shiftKey) {
|
|
44
45
|
requiredModifiersCount++;
|
|
45
46
|
}
|
|
47
|
+
if (requiredModifiers.includes("alt") && e.altKey) {
|
|
48
|
+
requiredModifiersCount++;
|
|
49
|
+
}
|
|
46
50
|
const hasExtraModifiers = (e.ctrlKey && !requiredModifiers.includes("ctrl")) ||
|
|
47
|
-
(e.
|
|
48
|
-
|
|
49
|
-
!requiredModifiers.includes("meta")) ||
|
|
50
|
-
(e.shiftKey && !requiredModifiers.includes("shift"));
|
|
51
|
+
(e.shiftKey && !requiredModifiers.includes("shift")) ||
|
|
52
|
+
(e.altKey && !requiredModifiers.includes("alt"));
|
|
51
53
|
if (keyMatch &&
|
|
52
54
|
modifierMatch &&
|
|
53
55
|
requiredModifiersCount === normalizedModifierKeys.length &&
|
|
54
56
|
!hasExtraModifiers &&
|
|
55
57
|
!e.repeat) {
|
|
56
58
|
e.preventDefault();
|
|
59
|
+
e.stopImmediatePropagation();
|
|
57
60
|
e.stopPropagation();
|
|
58
61
|
onTrigger();
|
|
59
62
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AgGridReact } from "ag-grid-react";
|
|
2
|
-
import type { RefObject } from "react";
|
|
3
|
-
type UseAgGridKeyboardShortcutsArgs<T = unknown> = {
|
|
4
|
-
gridRef: RefObject<AgGridReact<T>>;
|
|
5
|
-
};
|
|
6
|
-
export declare const useAgGridKeyboardShortcuts: <T = unknown>({ gridRef, }: UseAgGridKeyboardShortcutsArgs<T>) => void;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=useAgGridKeyboardShortcuts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridKeyboardShortcuts.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridKeyboardShortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,8BAA8B,CAAC,CAAC,GAAG,OAAO,IAAI;IACjD,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,CAAC,GAAG,OAAO,EAAE,cAErD,8BAA8B,CAAC,CAAC,CAAC,SAoCnC,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAgGridKeyboardShortcuts = void 0;
|
|
4
|
-
const utils_1 = require("../../utils");
|
|
5
|
-
const useAgGridKeyboardShortcuts = ({ gridRef, }) => {
|
|
6
|
-
(0, utils_1.useGlobalKeyboardShortcut)({
|
|
7
|
-
key: "a",
|
|
8
|
-
modifierKeys: "ctrl",
|
|
9
|
-
onTrigger: () => {
|
|
10
|
-
if (!gridRef.current?.api) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const api = gridRef.current.api;
|
|
14
|
-
api.forEachNodeAfterFilterAndSort((node) => {
|
|
15
|
-
if (node.displayed && node.data) {
|
|
16
|
-
node.setSelected(true);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
(0, utils_1.useGlobalKeyboardShortcut)({
|
|
22
|
-
key: "a",
|
|
23
|
-
modifierKeys: ["ctrl", "shift"],
|
|
24
|
-
onTrigger: () => {
|
|
25
|
-
if (!gridRef.current?.api) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const api = gridRef.current.api;
|
|
29
|
-
api.forEachNodeAfterFilterAndSort((node) => {
|
|
30
|
-
if (node.displayed && node.data) {
|
|
31
|
-
node.setSelected(false);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
exports.useAgGridKeyboardShortcuts = useAgGridKeyboardShortcuts;
|