@codezee/sixtify-brahma 0.2.151 → 0.2.152
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/AgGrid/hooks/useAgGridCheckBoxSelection.d.ts.map +1 -1
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridCheckBoxSelection.js +27 -11
- package/packages/shared-components/dist/HighlightedText/HighlightedText.d.ts +7 -0
- package/packages/shared-components/dist/HighlightedText/HighlightedText.d.ts.map +1 -0
- package/packages/shared-components/dist/HighlightedText/HighlightedText.js +25 -0
- package/packages/shared-components/dist/HighlightedText/index.d.ts +2 -0
- package/packages/shared-components/dist/HighlightedText/index.d.ts.map +1 -0
- package/packages/shared-components/dist/HighlightedText/index.js +17 -0
- package/packages/shared-components/dist/index.d.ts +3 -2
- package/packages/shared-components/dist/index.d.ts.map +1 -1
- package/packages/shared-components/dist/index.js +3 -2
- package/packages/shared-components/dist/utils/regex.d.ts +1 -0
- package/packages/shared-components/dist/utils/regex.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/regex.js +2 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridCheckBoxSelection.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridCheckBoxSelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI9E,KAAK,8BAA8B,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI;IAC9D,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxD,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAqCF,eAAO,MAAM,0BAA0B,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,uEAKlE,8BAA8B,CAAC,CAAC,CAAC;;6BAyCF,WAAW,CAAC,gBAAgB,CAAC;;;
|
|
1
|
+
{"version":3,"file":"useAgGridCheckBoxSelection.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridCheckBoxSelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI9E,KAAK,8BAA8B,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI;IAC9D,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxD,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAqCF,eAAO,MAAM,0BAA0B,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,uEAKlE,8BAA8B,CAAC,CAAC,CAAC;;6BAyCF,WAAW,CAAC,gBAAgB,CAAC;;;CAoJ9D,CAAC"}
|
|
@@ -32,12 +32,12 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
const api = gridRef.current.api;
|
|
35
|
-
return currentPageItems.forEach((
|
|
36
|
-
api.getRowNode(
|
|
35
|
+
return currentPageItems.forEach(({ id }) => {
|
|
36
|
+
api.getRowNode(id)?.setSelected(isChecked);
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
const commonCheckBoxMethod = () => {
|
|
40
|
-
const currentPageItemsId = currentPageItems.map((
|
|
40
|
+
const currentPageItemsId = currentPageItems.map(({ id }) => id);
|
|
41
41
|
if (!isChecked) {
|
|
42
42
|
handleRowCheckBox(true);
|
|
43
43
|
setIsChecked(true);
|
|
@@ -64,16 +64,24 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
64
64
|
if (isDialogOnTop(gridRef)) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
+
// Check if user is focused on an input field
|
|
68
|
+
const activeElement = document.activeElement;
|
|
69
|
+
const isInputField = activeElement?.tagName === "INPUT" ||
|
|
70
|
+
activeElement?.tagName === "TEXTAREA" ||
|
|
71
|
+
activeElement?.contentEditable === "true";
|
|
72
|
+
if (isInputField) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
67
75
|
if (!currentPageItems.length) {
|
|
68
76
|
return;
|
|
69
77
|
}
|
|
70
|
-
const currentPageItemsId = currentPageItems.map((
|
|
78
|
+
const currentPageItemsId = currentPageItems.map(({ id }) => id);
|
|
71
79
|
if (!gridRef.current) {
|
|
72
80
|
return;
|
|
73
81
|
}
|
|
74
82
|
const api = gridRef.current.api;
|
|
75
|
-
currentPageItems.forEach((
|
|
76
|
-
api.getRowNode(
|
|
83
|
+
currentPageItems.forEach(({ id }) => {
|
|
84
|
+
api.getRowNode(id)?.setSelected(true);
|
|
77
85
|
});
|
|
78
86
|
setIsChecked(true);
|
|
79
87
|
setSelectedEmployee((prev) => {
|
|
@@ -94,16 +102,24 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
94
102
|
if (isDialogOnTop(gridRef)) {
|
|
95
103
|
return;
|
|
96
104
|
}
|
|
105
|
+
// Check if user is focused on an input field
|
|
106
|
+
const activeElement = document.activeElement;
|
|
107
|
+
const isInputField = activeElement?.tagName === "INPUT" ||
|
|
108
|
+
activeElement?.tagName === "TEXTAREA" ||
|
|
109
|
+
activeElement?.contentEditable === "true";
|
|
110
|
+
if (isInputField) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
97
113
|
if (!currentPageItems.length) {
|
|
98
114
|
return;
|
|
99
115
|
}
|
|
100
|
-
const currentPageItemsId = currentPageItems.map((
|
|
116
|
+
const currentPageItemsId = currentPageItems.map(({ id }) => id);
|
|
101
117
|
if (!gridRef.current) {
|
|
102
118
|
return;
|
|
103
119
|
}
|
|
104
120
|
const api = gridRef.current.api;
|
|
105
|
-
currentPageItems.forEach((
|
|
106
|
-
api.getRowNode(
|
|
121
|
+
currentPageItems.forEach(({ id }) => {
|
|
122
|
+
api.getRowNode(id)?.setSelected(false);
|
|
107
123
|
});
|
|
108
124
|
setIsChecked(false);
|
|
109
125
|
setSelectedEmployee((prev) => prev.filter((id) => !currentPageItemsId.includes(id)));
|
|
@@ -111,7 +127,7 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
111
127
|
});
|
|
112
128
|
(0, react_1.useEffect)(() => {
|
|
113
129
|
const isCurrentPageDataChecked = currentPageItems.length > 0 &&
|
|
114
|
-
currentPageItems.every((
|
|
130
|
+
currentPageItems.every(({ id }) => selectedEmployee.includes(id));
|
|
115
131
|
setIsChecked(isCurrentPageDataChecked);
|
|
116
132
|
const handler = (event) => {
|
|
117
133
|
if (event.code !== "Space") {
|
|
@@ -130,7 +146,7 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
130
146
|
header?.removeEventListener("keydown", handler);
|
|
131
147
|
};
|
|
132
148
|
}, [currentPageItems, selectedEmployee]);
|
|
133
|
-
const currentPageSelectedItems = currentPageItems.filter((
|
|
149
|
+
const currentPageSelectedItems = currentPageItems.filter(({ id }) => selectedEmployee.includes(id)).length;
|
|
134
150
|
const isIndeterminate = (currentPageSelectedItems &&
|
|
135
151
|
currentPageSelectedItems < currentPageItems.length) ||
|
|
136
152
|
false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../src/HighlightedText/HighlightedText.tsx"],"names":[],"mappings":"AAIA,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,2BAG7B,oBAAoB,KAAG,GAAG,CAAC,OA2C7B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HighlightedText = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const regex_1 = require("../utils/regex");
|
|
7
|
+
const HighlightedText = ({ text, highlightWords, }) => {
|
|
8
|
+
const theme = (0, material_1.useTheme)();
|
|
9
|
+
const { slate } = theme.palette.app.color;
|
|
10
|
+
if (!highlightWords?.length) {
|
|
11
|
+
return (0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", children: text });
|
|
12
|
+
}
|
|
13
|
+
const escapedWords = highlightWords.map((w) => w.replace(regex_1.highlightWordsRegex, "\\$&"));
|
|
14
|
+
const pattern = new RegExp(`(${escapedWords.join("|")})`, "gi");
|
|
15
|
+
const segments = text.split(pattern);
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", children: segments.map((segment, index) => pattern.test(segment) ? ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: {
|
|
17
|
+
padding: "2px 4px",
|
|
18
|
+
backgroundColor: slate[800],
|
|
19
|
+
border: `1px solid ${slate[700]}`,
|
|
20
|
+
borderRadius: "5px",
|
|
21
|
+
fontFamily: "monospace",
|
|
22
|
+
fontSize: "0.9em",
|
|
23
|
+
}, children: segment }, `highlight-${index}-${segment}`)) : ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", children: segment }, `text-${index}-${segment}`))) }));
|
|
24
|
+
};
|
|
25
|
+
exports.HighlightedText = HighlightedText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HighlightedText/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./HighlightedText"), exports);
|
|
@@ -8,14 +8,15 @@ export * from "./Button";
|
|
|
8
8
|
export * from "./Card";
|
|
9
9
|
export * from "./CellSelectionTable";
|
|
10
10
|
export * from "./Charts";
|
|
11
|
-
export * from "./codeSnippetBox";
|
|
12
11
|
export * from "./Chips";
|
|
12
|
+
export * from "./codeSnippetBox";
|
|
13
13
|
export * from "./ColumnArranger";
|
|
14
14
|
export * from "./ContentBox";
|
|
15
15
|
export * from "./Dialog";
|
|
16
16
|
export * from "./Drawer";
|
|
17
17
|
export * from "./FilterList";
|
|
18
18
|
export * from "./FormFields";
|
|
19
|
+
export * from "./HighlightedText";
|
|
19
20
|
export * from "./Indicator";
|
|
20
21
|
export * from "./Layouts";
|
|
21
22
|
export * from "./Loader";
|
|
@@ -31,7 +32,7 @@ export * from "./TabBar";
|
|
|
31
32
|
export * from "./Timeline";
|
|
32
33
|
export * from "./Toast";
|
|
33
34
|
export * from "./Tooltip";
|
|
35
|
+
export * from "./Tree";
|
|
34
36
|
export * from "./UserProfileMenu";
|
|
35
37
|
export * from "./utils";
|
|
36
|
-
export * from "./Tree";
|
|
37
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -24,14 +24,15 @@ __exportStar(require("./Button"), exports);
|
|
|
24
24
|
__exportStar(require("./Card"), exports);
|
|
25
25
|
__exportStar(require("./CellSelectionTable"), exports);
|
|
26
26
|
__exportStar(require("./Charts"), exports);
|
|
27
|
-
__exportStar(require("./codeSnippetBox"), exports);
|
|
28
27
|
__exportStar(require("./Chips"), exports);
|
|
28
|
+
__exportStar(require("./codeSnippetBox"), exports);
|
|
29
29
|
__exportStar(require("./ColumnArranger"), exports);
|
|
30
30
|
__exportStar(require("./ContentBox"), exports);
|
|
31
31
|
__exportStar(require("./Dialog"), exports);
|
|
32
32
|
__exportStar(require("./Drawer"), exports);
|
|
33
33
|
__exportStar(require("./FilterList"), exports);
|
|
34
34
|
__exportStar(require("./FormFields"), exports);
|
|
35
|
+
__exportStar(require("./HighlightedText"), exports);
|
|
35
36
|
__exportStar(require("./Indicator"), exports);
|
|
36
37
|
__exportStar(require("./Layouts"), exports);
|
|
37
38
|
__exportStar(require("./Loader"), exports);
|
|
@@ -47,6 +48,6 @@ __exportStar(require("./TabBar"), exports);
|
|
|
47
48
|
__exportStar(require("./Timeline"), exports);
|
|
48
49
|
__exportStar(require("./Toast"), exports);
|
|
49
50
|
__exportStar(require("./Tooltip"), exports);
|
|
51
|
+
__exportStar(require("./Tree"), exports);
|
|
50
52
|
__exportStar(require("./UserProfileMenu"), exports);
|
|
51
53
|
__exportStar(require("./utils"), exports);
|
|
52
|
-
__exportStar(require("./Tree"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAoB,CAAC;AAEzD,eAAO,MAAM,UAAU,QACmvB,CAAC;AAE3wB,eAAO,MAAM,SAAS,QAA6B,CAAC;AAEpD,eAAO,MAAM,eAAe,QACqD,CAAC;AAElF,eAAO,MAAM,SAAS,QAAqD,CAAC"}
|
|
1
|
+
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAoB,CAAC;AAEzD,eAAO,MAAM,UAAU,QACmvB,CAAC;AAE3wB,eAAO,MAAM,SAAS,QAA6B,CAAC;AAEpD,eAAO,MAAM,eAAe,QACqD,CAAC;AAElF,eAAO,MAAM,SAAS,QAAqD,CAAC;AAE5E,eAAO,MAAM,mBAAmB,QAAwB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hslaRegex = exports.accessorFnRegex = exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
|
|
3
|
+
exports.highlightWordsRegex = exports.hslaRegex = exports.accessorFnRegex = exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
|
|
4
4
|
/* eslint-disable sonarjs/unnecessary-character-escapes */
|
|
5
5
|
/* eslint-disable no-useless-escape */
|
|
6
6
|
/* eslint-disable sonarjs/single-character-alternation */
|
|
@@ -16,3 +16,4 @@ exports.emailRegex = /^(((?!.*[^\x00-\x7F])[^<>()[\]\\.,;:\s@"](\.[^<>()[\]\\.,;
|
|
|
16
16
|
exports.timeRegex = /^\d{1,3}:\d{2}(:\d{2})?$/;
|
|
17
17
|
exports.accessorFnRegex = /([a-zA-Z0-9_$.\[\]]+)\s*!==\s*null\s*&&\s*\1\s*!==\s*void 0\s*\?\s*\1\s*:\s*/g;
|
|
18
18
|
exports.hslaRegex = /hsla?\((\d+),\s*(\d+)%,\s*(\d+)%,?\s*([\d.]+)?\)/;
|
|
19
|
+
exports.highlightWordsRegex = /[.*+?^${}()|[\]\\]/g;
|