@codezee/sixtify-brahma 0.2.192 → 0.2.194
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 -55
- package/packages/shared-components/dist/AgGrid/AgGrid.js +6 -6
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridSelection.d.ts.map +1 -1
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridSelection.js +108 -24
- package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.js +32 -14
- package/packages/shared-components/dist/FormFields/Select/Select.js +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArranger.d.ts +20 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArranger.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArranger.js +49 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerDialog.d.ts +17 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerDialog.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerDialog.js +117 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerForm.d.ts +17 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerForm.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerForm.js +47 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnItem.d.ts +16 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnItem.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnItem.js +122 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/LockedColumnItem.d.ts +6 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/LockedColumnItem.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/LockedColumnItem.js +17 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/hooks/useRefinedColumns.d.ts +13 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/hooks/useRefinedColumns.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/hooks/useRefinedColumns.js +24 -0
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.js +11 -5
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.d.ts +3 -1
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.js +25 -6
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedPanel.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedPanel.js +14 -5
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/HeaderCell.js +2 -2
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/SearchFilterRow.js +2 -2
- package/packages/shared-components/dist/SmartGrid/Components/SmartAlignments.d.ts +9 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartAlignments.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartAlignments.js +63 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartButton.d.ts +7 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartButton.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartButton.js +21 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartDialog.d.ts +12 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartDialog.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartDialog.js +42 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartSwitch.d.ts +7 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartSwitch.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/SmartSwitch.js +53 -0
- package/packages/shared-components/dist/SmartGrid/Components/Svgs/HideIcon.d.ts +3 -0
- package/packages/shared-components/dist/SmartGrid/Components/Svgs/HideIcon.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/Svgs/HideIcon.js +6 -0
- package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.js +48 -3
- package/packages/shared-components/dist/SmartGrid/SmartGrid.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/SmartGrid.js +221 -70
- package/packages/shared-components/dist/SmartGrid/hooks/useGetColumnWidth.d.ts +2 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetColumnWidth.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetGroupedColumn.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetGroupedColumn.js +4 -0
- package/packages/shared-components/dist/SmartGrid/hooks/useTableState.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useTableState.js +1 -7
- package/packages/shared-components/dist/SmartGrid/index.d.ts +0 -1
- package/packages/shared-components/dist/SmartGrid/index.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/index.js +0 -1
- package/packages/shared-components/dist/SmartGrid/types/index.d.ts +9 -0
- package/packages/shared-components/dist/SmartGrid/types/index.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/utils/summaryCalculations.d.ts.map +1 -1
- package/packages/shared-components/dist/Svgs/BookMarkSvg.d.ts +3 -0
- package/packages/shared-components/dist/Svgs/BookMarkSvg.d.ts.map +1 -0
- package/packages/shared-components/dist/Svgs/BookMarkSvg.js +6 -0
- package/packages/shared-components/dist/Svgs/index.d.ts +1 -0
- package/packages/shared-components/dist/Svgs/index.d.ts.map +1 -1
- package/packages/shared-components/dist/Svgs/index.js +1 -0
- package/packages/shared-components/dist/index.d.ts +0 -1
- package/packages/shared-components/dist/index.d.ts.map +1 -1
- package/packages/shared-components/dist/index.js +0 -1
- package/packages/shared-components/dist/RichTextEditor/EditorMenuControls.d.ts +0 -2
- package/packages/shared-components/dist/RichTextEditor/EditorMenuControls.d.ts.map +0 -1
- package/packages/shared-components/dist/RichTextEditor/EditorMenuControls.js +0 -12
- package/packages/shared-components/dist/RichTextEditor/RichTextEditor.d.ts +0 -19
- package/packages/shared-components/dist/RichTextEditor/RichTextEditor.d.ts.map +0 -1
- package/packages/shared-components/dist/RichTextEditor/RichTextEditor.js +0 -88
- package/packages/shared-components/dist/RichTextEditor/index.d.ts +0 -2
- package/packages/shared-components/dist/RichTextEditor/index.d.ts.map +0 -1
- package/packages/shared-components/dist/RichTextEditor/index.js +0 -17
- package/packages/shared-components/dist/RichTextEditor/useExtensions.d.ts +0 -13
- package/packages/shared-components/dist/RichTextEditor/useExtensions.d.ts.map +0 -1
- package/packages/shared-components/dist/RichTextEditor/useExtensions.js +0 -169
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartSelectField.d.ts +0 -7
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartSelectField.d.ts.map +0 -1
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartSelectField.js +0 -58
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.d.ts +0 -5
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.d.ts.map +0 -1
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.js +0 -59
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTooltip.d.ts +0 -9
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTooltip.d.ts.map +0 -1
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTooltip.js +0 -113
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/index.d.ts +0 -4
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/index.d.ts.map +0 -1
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/index.js +0 -19
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/GroupingIcons.d.ts +0 -8
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/GroupingIcons.d.ts.map +0 -1
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/GroupingIcons.js +0 -41
- package/packages/shared-components/dist/SmartGrid/Components/index.d.ts +0 -2
- package/packages/shared-components/dist/SmartGrid/Components/index.d.ts.map +0 -1
- package/packages/shared-components/dist/SmartGrid/Components/index.js +0 -17
- package/packages/shared-components/dist/SmartGrid/hooks/useProcessColumnsForGroupDisplay.d.ts +0 -11
- package/packages/shared-components/dist/SmartGrid/hooks/useProcessColumnsForGroupDisplay.d.ts.map +0 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useProcessColumnsForGroupDisplay.js +0 -30
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerDialog.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ColumnArrangerDialog = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const iconoir_react_1 = require("iconoir-react");
|
|
10
|
+
const fromPairs_1 = __importDefault(require("lodash/fromPairs"));
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
13
|
+
const ColumnArrangerForm_1 = require("./ColumnArrangerForm");
|
|
14
|
+
const useRefinedColumns_1 = require("./hooks/useRefinedColumns");
|
|
15
|
+
const DebouncedInput_1 = require("../SearchFilterRow/DebouncedInput");
|
|
16
|
+
const SmartButton_1 = require("../SmartButton");
|
|
17
|
+
const SmartDialog_1 = require("../SmartDialog");
|
|
18
|
+
const SmartSwitch_1 = require("../SmartSwitch");
|
|
19
|
+
const ColumnArrangerDialog = ({ open, onClose, title = "Column Chooser", columns = [], grouping = [], onSave, }) => {
|
|
20
|
+
const theme = (0, material_1.useTheme)();
|
|
21
|
+
const reFinedColumn = (0, useRefinedColumns_1.useRefinedColumns)({ columns });
|
|
22
|
+
const { butterflyBlue, iron } = theme.palette.app.color;
|
|
23
|
+
const [searchTerm, setSearchTerm] = (0, react_1.useState)("");
|
|
24
|
+
const { control } = (0, react_hook_form_1.useForm)({
|
|
25
|
+
defaultValues: {
|
|
26
|
+
column_list: false, // OFF = show all
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
// Watch the column_list switch value
|
|
30
|
+
const columnListFilter = (0, react_hook_form_1.useWatch)({
|
|
31
|
+
control,
|
|
32
|
+
name: "column_list",
|
|
33
|
+
defaultValue: false,
|
|
34
|
+
});
|
|
35
|
+
// Clear search term when dialog closes
|
|
36
|
+
(0, react_1.useEffect)(() => {
|
|
37
|
+
if (!open) {
|
|
38
|
+
setSearchTerm("");
|
|
39
|
+
}
|
|
40
|
+
}, [open]);
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(ColumnArrangerForm_1.ColumnArrangerForm, { columns: reFinedColumn, filterVisibleOnly: columnListFilter, searchTerm: searchTerm, grouping: grouping, children: ({ columnList, reset, getValues }) => ((0, jsx_runtime_1.jsx)(SmartDialog_1.SmartDialog, { open: open, onClose: () => {
|
|
42
|
+
setSearchTerm("");
|
|
43
|
+
reset();
|
|
44
|
+
onClose();
|
|
45
|
+
}, width: 450, actions: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
46
|
+
display: "flex",
|
|
47
|
+
justifyContent: "space-between",
|
|
48
|
+
padding: "10px 24px",
|
|
49
|
+
borderTop: `1px solid ${iron[300]}`,
|
|
50
|
+
gap: 2,
|
|
51
|
+
}, children: [(0, jsx_runtime_1.jsx)(SmartButton_1.SmartButton, { onClick: () => {
|
|
52
|
+
reset();
|
|
53
|
+
setSearchTerm("");
|
|
54
|
+
}, onMouseEnter: (e) => {
|
|
55
|
+
e.currentTarget.style.backgroundColor = "#f5f5f5";
|
|
56
|
+
}, onMouseLeave: (e) => {
|
|
57
|
+
e.currentTarget.style.backgroundColor = "white";
|
|
58
|
+
}, children: "Reset" }), (0, jsx_runtime_1.jsx)(SmartButton_1.SmartButton, { onClick: () => {
|
|
59
|
+
const values = getValues();
|
|
60
|
+
setSearchTerm("");
|
|
61
|
+
const result = (0, fromPairs_1.default)(values.columns.map((col) => {
|
|
62
|
+
return [
|
|
63
|
+
col.accessorKey,
|
|
64
|
+
{
|
|
65
|
+
hide: col.hide,
|
|
66
|
+
align: col.align ?? "left",
|
|
67
|
+
header: col.header,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}));
|
|
71
|
+
onSave(result);
|
|
72
|
+
onClose();
|
|
73
|
+
}, onMouseEnter: (e) => {
|
|
74
|
+
e.currentTarget.style.opacity = "0.9";
|
|
75
|
+
}, onMouseLeave: (e) => {
|
|
76
|
+
e.currentTarget.style.opacity = "1";
|
|
77
|
+
}, style: {
|
|
78
|
+
backgroundColor: butterflyBlue[900],
|
|
79
|
+
color: "white",
|
|
80
|
+
}, children: "Save" })] }), children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
81
|
+
display: "flex",
|
|
82
|
+
flexDirection: "row",
|
|
83
|
+
alignItems: "center",
|
|
84
|
+
justifyContent: "space-between",
|
|
85
|
+
padding: "5px 24px",
|
|
86
|
+
borderBottom: `1px solid ${iron[300]}`,
|
|
87
|
+
}, children: [(0, jsx_runtime_1.jsx)("p", { style: {
|
|
88
|
+
fontWeight: 500,
|
|
89
|
+
fontSize: "18px",
|
|
90
|
+
color: iron[900],
|
|
91
|
+
lineHeight: "1px",
|
|
92
|
+
}, children: title }), (0, jsx_runtime_1.jsx)(iconoir_react_1.Xmark, { width: 20, height: 20, strokeWidth: 2, onClick: () => {
|
|
93
|
+
setSearchTerm("");
|
|
94
|
+
onClose();
|
|
95
|
+
reset();
|
|
96
|
+
}, style: {
|
|
97
|
+
border: `1px solid ${iron[700]}`,
|
|
98
|
+
borderRadius: "5px",
|
|
99
|
+
color: iron[900],
|
|
100
|
+
} })] }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
101
|
+
padding: "8px 24px",
|
|
102
|
+
display: "flex",
|
|
103
|
+
flexDirection: "column",
|
|
104
|
+
gap: "12px",
|
|
105
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
106
|
+
display: "flex",
|
|
107
|
+
flexDirection: "row",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
justifyContent: "space-between",
|
|
110
|
+
}, children: [(0, jsx_runtime_1.jsx)(DebouncedInput_1.DebouncedInput, { value: searchTerm, onChange: (value) => setSearchTerm(value), placeholder: "Search by label...", debounce: 300, inputFontSize: "13px", inputHeight: "14px", style: { width: "80%" } }, open ? "dialog-open" : "dialog-closed"), (0, jsx_runtime_1.jsx)(SmartSwitch_1.SmartSwitch, { name: "column_list", control: control })] }) }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
111
|
+
maxHeight: "600px",
|
|
112
|
+
minHeight: "500px",
|
|
113
|
+
overflowY: "auto",
|
|
114
|
+
outline: "none",
|
|
115
|
+
}, children: columnList })] }) })) }));
|
|
116
|
+
};
|
|
117
|
+
exports.ColumnArrangerDialog = ColumnArrangerDialog;
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerForm.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { AppColumnDef } from "../../types";
|
|
3
|
+
export type ColumnArrangerFormProps<T> = {
|
|
4
|
+
columns: AppColumnDef<T>[];
|
|
5
|
+
filterVisibleOnly?: boolean;
|
|
6
|
+
searchTerm?: string;
|
|
7
|
+
grouping?: string[];
|
|
8
|
+
children: (args: {
|
|
9
|
+
columnList: ReactNode;
|
|
10
|
+
reset: (values?: AppColumnDef<T> | Record<string, unknown>) => void;
|
|
11
|
+
getValues: () => {
|
|
12
|
+
columns: AppColumnDef<T>[];
|
|
13
|
+
};
|
|
14
|
+
}) => JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
export declare const ColumnArrangerForm: <T>({ columns, filterVisibleOnly, searchTerm, children, grouping, }: ColumnArrangerFormProps<T>) => JSX.Element;
|
|
17
|
+
//# sourceMappingURL=ColumnArrangerForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnArrangerForm.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/ColumnChooser/ColumnArrangerForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;IACvC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE;QACf,UAAU,EAAE,SAAS,CAAC;QACtB,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;QACpE,SAAS,EAAE,MAAM;YAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;SAAE,CAAC;KACjD,KAAK,GAAG,CAAC,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAG,iEAMpC,uBAAuB,CAAC,CAAC,CAAC,gBA+D5B,CAAC"}
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerForm.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColumnArrangerForm = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
7
|
+
const ColumnArranger_1 = require("./ColumnArranger");
|
|
8
|
+
const ColumnArrangerForm = ({ columns, filterVisibleOnly = false, searchTerm = "", children, grouping, }) => {
|
|
9
|
+
const lockedColumns = (0, react_1.useMemo)(() => columns.filter((col) => !("hide" in col)), [columns]);
|
|
10
|
+
const unlockedColumns = (0, react_1.useMemo)(() => columns
|
|
11
|
+
.filter((col) => "hide" in col)
|
|
12
|
+
.map((col) => ({
|
|
13
|
+
...col,
|
|
14
|
+
hide: !col.hide,
|
|
15
|
+
align: col.align ?? "left",
|
|
16
|
+
})), [columns]);
|
|
17
|
+
const { control, reset, getValues, setValue } = (0, react_hook_form_1.useForm)({
|
|
18
|
+
defaultValues: {
|
|
19
|
+
columns: unlockedColumns,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const wrappedReset = (values) => {
|
|
23
|
+
reset({
|
|
24
|
+
columns: values
|
|
25
|
+
? // eslint-disable-next-line sonarjs/no-nested-conditional
|
|
26
|
+
Array.isArray(values)
|
|
27
|
+
? values
|
|
28
|
+
: [values]
|
|
29
|
+
: unlockedColumns,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const { fields } = (0, react_hook_form_1.useFieldArray)({
|
|
33
|
+
name: "columns",
|
|
34
|
+
control,
|
|
35
|
+
});
|
|
36
|
+
// Update form values when unlockedColumns changes (e.g., when grouping changes)
|
|
37
|
+
// Use reset to fully update the form and trigger field array re-render
|
|
38
|
+
(0, react_1.useEffect)(() => {
|
|
39
|
+
reset({ columns: unlockedColumns }, { keepDefaultValues: false });
|
|
40
|
+
}, [unlockedColumns, reset]);
|
|
41
|
+
return children({
|
|
42
|
+
reset: wrappedReset,
|
|
43
|
+
getValues,
|
|
44
|
+
columnList: ((0, jsx_runtime_1.jsx)(ColumnArranger_1.ColumnArranger, { fields: fields, lockedColumns: lockedColumns, control: control, setValue: setValue, filterVisibleOnly: filterVisibleOnly, searchTerm: searchTerm, grouping: grouping })),
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.ColumnArrangerForm = ColumnArrangerForm;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Control, type FieldArrayWithId, type UseFormSetValue } from "react-hook-form";
|
|
2
|
+
import type { AppColumnDef } from "../../types";
|
|
3
|
+
export type ColumnItemProps<T> = {
|
|
4
|
+
field: FieldArrayWithId<{
|
|
5
|
+
columns: AppColumnDef<T>[];
|
|
6
|
+
}, "columns">;
|
|
7
|
+
control: Control<{
|
|
8
|
+
columns: AppColumnDef<T>[];
|
|
9
|
+
}>;
|
|
10
|
+
index: number;
|
|
11
|
+
setValue: UseFormSetValue<{
|
|
12
|
+
columns: AppColumnDef<T>[];
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
export declare function ColumnItem<T>({ field, control, index, setValue, }: Readonly<ColumnItemProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=ColumnItem.d.ts.map
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnItem.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnItem.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/ColumnChooser/ColumnItem.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,KAAK,EAAE,gBAAgB,CAAC;QAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;KAAE,EAAE,SAAS,CAAC,CAAC;IACnE,OAAO,EAAE,OAAO,CAAC;QAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;KAAE,CAAC,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,eAAe,CAAC;QAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;KAAE,CAAC,CAAC;CAC3D,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAC5B,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,GACT,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,2CA4L9B"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColumnItem = ColumnItem;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const iconoir_react_1 = require("iconoir-react");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
9
|
+
const DebouncedInput_1 = require("../SearchFilterRow/DebouncedInput");
|
|
10
|
+
const SmartAlignments_1 = require("../SmartAlignments");
|
|
11
|
+
const SmartSwitch_1 = require("../SmartSwitch");
|
|
12
|
+
function ColumnItem({ field, control, index, setValue, }) {
|
|
13
|
+
const theme = (0, styles_1.useTheme)();
|
|
14
|
+
const { iron } = theme.palette.app.color;
|
|
15
|
+
// State for editing mode
|
|
16
|
+
const [isEditing, setIsEditing] = (0, react_1.useState)(false);
|
|
17
|
+
const [editedHeaderName, setEditedHeaderName] = (0, react_1.useState)("");
|
|
18
|
+
const [previousHeaderName, setPreviousHeaderName] = (0, react_1.useState)("");
|
|
19
|
+
const inputContainerRef = (0, react_1.useRef)(null);
|
|
20
|
+
// Watch the actual form value for the header to get real-time updates
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
const watchedHeader = (0, react_hook_form_1.useWatch)({
|
|
23
|
+
control,
|
|
24
|
+
name: `columns.${index}.header`,
|
|
25
|
+
});
|
|
26
|
+
// Watch the hide value to determine if Edit and Align should be disabled
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
const watchedHide = (0, react_hook_form_1.useWatch)({
|
|
29
|
+
control,
|
|
30
|
+
name: `columns.${index}.hide`,
|
|
31
|
+
});
|
|
32
|
+
// Column is hidden when hide is true, so Edit and Align should be disabled
|
|
33
|
+
const isColumnHidden = Boolean(!watchedHide);
|
|
34
|
+
// Get current header name as string - use watched value if available, otherwise fallback to field
|
|
35
|
+
const currentHeaderName = typeof watchedHeader === "string"
|
|
36
|
+
? watchedHeader
|
|
37
|
+
: // eslint-disable-next-line sonarjs/no-nested-conditional
|
|
38
|
+
typeof field.header === "string"
|
|
39
|
+
? field.header
|
|
40
|
+
: (field.header?.toString() ?? "");
|
|
41
|
+
// Initialize edited header name when entering edit mode
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
if (isEditing) {
|
|
44
|
+
const headerName = currentHeaderName;
|
|
45
|
+
setEditedHeaderName(headerName);
|
|
46
|
+
setPreviousHeaderName(headerName);
|
|
47
|
+
// Focus input after a brief delay to ensure it's rendered
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
const input = inputContainerRef.current?.querySelector("input");
|
|
50
|
+
if (input) {
|
|
51
|
+
input.focus();
|
|
52
|
+
input.select();
|
|
53
|
+
}
|
|
54
|
+
}, 0);
|
|
55
|
+
}
|
|
56
|
+
}, [isEditing, currentHeaderName]);
|
|
57
|
+
// Exit edit mode if column becomes hidden
|
|
58
|
+
(0, react_1.useEffect)(() => {
|
|
59
|
+
if (isColumnHidden && isEditing) {
|
|
60
|
+
setIsEditing(false);
|
|
61
|
+
setEditedHeaderName(previousHeaderName);
|
|
62
|
+
}
|
|
63
|
+
}, [isColumnHidden, isEditing, previousHeaderName]);
|
|
64
|
+
const handleEditAction = (e) => {
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
// Prevent editing if column is hidden
|
|
67
|
+
if (isColumnHidden) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
setIsEditing(true);
|
|
71
|
+
};
|
|
72
|
+
const handleSave = (value) => {
|
|
73
|
+
const trimmedValue = value.trim();
|
|
74
|
+
// If empty, revert to previous value
|
|
75
|
+
if (trimmedValue === "") {
|
|
76
|
+
setEditedHeaderName(previousHeaderName);
|
|
77
|
+
setIsEditing(false);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Update the header in the form using setValue
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
+
setValue(`columns.${index}.header`, trimmedValue, {
|
|
83
|
+
shouldValidate: true,
|
|
84
|
+
shouldDirty: true,
|
|
85
|
+
});
|
|
86
|
+
setPreviousHeaderName(trimmedValue);
|
|
87
|
+
setIsEditing(false);
|
|
88
|
+
};
|
|
89
|
+
const handleKeyDown = (e) => {
|
|
90
|
+
if (e.key === "Enter") {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
e.stopPropagation();
|
|
93
|
+
handleSave(editedHeaderName);
|
|
94
|
+
}
|
|
95
|
+
else if (e.key === "Escape") {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
setEditedHeaderName(previousHeaderName);
|
|
99
|
+
setIsEditing(false);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const handleBlur = () => {
|
|
103
|
+
handleSave(editedHeaderName);
|
|
104
|
+
};
|
|
105
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { padding: "0px 20px", border: `1px solid ${iron[700]}` }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
106
|
+
display: "flex",
|
|
107
|
+
flexDirection: "row",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
justifyContent: "space-between",
|
|
110
|
+
height: "45px",
|
|
111
|
+
}, children: [isEditing ? ((0, jsx_runtime_1.jsx)("div", { ref: inputContainerRef, style: { flex: 1, minWidth: 0 }, children: (0, jsx_runtime_1.jsx)(DebouncedInput_1.DebouncedInput, { value: editedHeaderName, onChange: (value) => setEditedHeaderName(value), onKeyDown: handleKeyDown, onBlur: handleBlur, debounce: 0, inputFontSize: "12px", inputHeight: "14px", style: { width: "200px" }, onClick: (e) => e.stopPropagation(), onMouseDown: (e) => e.stopPropagation(), placeholder: "Enter header name" }) })) : ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
112
|
+
fontSize: "13px",
|
|
113
|
+
fontWeight: 500,
|
|
114
|
+
cursor: "pointer",
|
|
115
|
+
}, onDoubleClick: handleEditAction, children: currentHeaderName })), (0, jsx_runtime_1.jsxs)("div", { style: { display: "flex", gap: "10px", alignItems: "center" }, children: [!isEditing && ((0, jsx_runtime_1.jsx)(iconoir_react_1.EditPencil, { width: 18, height: 18, onClick: handleEditAction, style: {
|
|
116
|
+
border: `1px solid ${iron[700]}`,
|
|
117
|
+
borderRadius: "4px",
|
|
118
|
+
padding: "4px",
|
|
119
|
+
cursor: isColumnHidden ? "not-allowed" : "pointer",
|
|
120
|
+
opacity: isColumnHidden ? 0.5 : 1,
|
|
121
|
+
} })), (0, jsx_runtime_1.jsx)(SmartAlignments_1.SmartAlignments, { control: control, name: `columns.${index}.align`, defaultValue: field.align ?? "left", disabled: isColumnHidden }), (0, jsx_runtime_1.jsx)(SmartSwitch_1.SmartSwitch, { control: control, name: `columns.${index}.hide` })] })] }) }));
|
|
122
|
+
}
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/LockedColumnItem.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AppColumnDef } from "../../types";
|
|
2
|
+
export type LockedColumnItemProps<T> = {
|
|
3
|
+
column: AppColumnDef<T>;
|
|
4
|
+
};
|
|
5
|
+
export declare function LockedColumnItem<T>({ column, }: Readonly<LockedColumnItemProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=LockedColumnItem.d.ts.map
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/LockedColumnItem.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LockedColumnItem.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/ColumnChooser/LockedColumnItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;IAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAEnE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,EAClC,MAAM,GACP,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,2CAsBpC"}
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/LockedColumnItem.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LockedColumnItem = LockedColumnItem;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const iconoir_react_1 = require("iconoir-react");
|
|
7
|
+
function LockedColumnItem({ column, }) {
|
|
8
|
+
const theme = (0, material_1.useTheme)();
|
|
9
|
+
const { iron } = theme.palette.app.color;
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { padding: "0px 20px", border: `1px solid ${iron[700]}` }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: "row",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "space-between",
|
|
15
|
+
height: "38px",
|
|
16
|
+
}, children: [(0, jsx_runtime_1.jsx)("p", { style: { fontSize: "14px" }, children: column.header?.toString() }), (0, jsx_runtime_1.jsx)(iconoir_react_1.Lock, { color: iron[800] })] }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AppColumnDef } from "../../../types";
|
|
2
|
+
type RefinedColumn = {
|
|
3
|
+
accessorKey: string;
|
|
4
|
+
hide?: boolean;
|
|
5
|
+
header: string;
|
|
6
|
+
align?: "left" | "center" | "right";
|
|
7
|
+
};
|
|
8
|
+
type useRefinedColumnsArgs<T> = {
|
|
9
|
+
columns: AppColumnDef<T>[];
|
|
10
|
+
};
|
|
11
|
+
export declare const useRefinedColumns: <T>({ columns }: useRefinedColumnsArgs<T>) => RefinedColumn[];
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=useRefinedColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRefinedColumns.d.ts","sourceRoot":"","sources":["../../../../../src/SmartGrid/Components/ColumnChooser/hooks/useRefinedColumns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,KAAK,aAAa,GAAG;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC,CAAC;AAEF,KAAK,qBAAqB,CAAC,CAAC,IAAI;IAC9B,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;CAC5B,CAAC;AACF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,aAAa,qBAAqB,CAAC,CAAC,CAAC,oBAqBzE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRefinedColumns = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useRefinedColumns = ({ columns }) => {
|
|
6
|
+
return (0, react_1.useMemo)(() => {
|
|
7
|
+
return columns
|
|
8
|
+
.filter((col) => !!col.accessorKey)
|
|
9
|
+
.map(({ accessorKey, hide, header, align }) => {
|
|
10
|
+
const result = {
|
|
11
|
+
accessorKey: accessorKey ?? "",
|
|
12
|
+
header: header,
|
|
13
|
+
};
|
|
14
|
+
if (hide !== undefined) {
|
|
15
|
+
result.hide = hide;
|
|
16
|
+
}
|
|
17
|
+
if (align !== undefined) {
|
|
18
|
+
result.align = align;
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
});
|
|
22
|
+
}, [columns]);
|
|
23
|
+
};
|
|
24
|
+
exports.useRefinedColumns = useRefinedColumns;
|
package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AASpD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,8BAG/B,kBAAkB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AASpD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,8BAG/B,kBAAkB,CAAC,CAAC,CAAC,4CAgVvB,CAAC"}
|
|
@@ -45,7 +45,9 @@ const FacetedFilter = ({ header, resetAllFilters, }) => {
|
|
|
45
45
|
if (valueToUse.length === 0) {
|
|
46
46
|
return false;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
// Use Set for O(1) lookups instead of O(n) array.includes()
|
|
49
|
+
const valueSet = new Set(valueToUse);
|
|
50
|
+
return filteredOptions.every((opt) => valueSet.has(String(opt)));
|
|
49
51
|
}, [filterValue, localFilterData, filteredOptions, isOptionsEmpty]);
|
|
50
52
|
const manageIntermidiate = (0, react_1.useMemo)(() => {
|
|
51
53
|
const valueToUse = localFilterData ?? filterValue;
|
|
@@ -53,7 +55,9 @@ const FacetedFilter = ({ header, resetAllFilters, }) => {
|
|
|
53
55
|
if (isOptionsEmpty || isCurrentNoneMode || allSelected) {
|
|
54
56
|
return false;
|
|
55
57
|
}
|
|
56
|
-
|
|
58
|
+
// Use Set for O(1) lookups instead of O(n) array.includes()
|
|
59
|
+
const valueSet = new Set(valueToUse);
|
|
60
|
+
const selectedFilteredCount = filteredOptions.filter((opt) => valueSet.has(String(opt))).length;
|
|
57
61
|
return (selectedFilteredCount > 0 &&
|
|
58
62
|
selectedFilteredCount < filteredOptions.length);
|
|
59
63
|
}, [
|
|
@@ -84,8 +88,10 @@ const FacetedFilter = ({ header, resetAllFilters, }) => {
|
|
|
84
88
|
const handleSelectAll = () => {
|
|
85
89
|
const allOptions = filteredOptions.map(String);
|
|
86
90
|
const valueToUse = localFilterData ?? filterValue;
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
// Use Set for O(1) lookups instead of O(n*m) array operations
|
|
92
|
+
const valueSet = new Set(valueToUse);
|
|
93
|
+
const isAllSelected = valueToUse.length > 0 && allOptions.every((opt) => valueSet.has(opt));
|
|
94
|
+
// Use startTransition to make state updates non-blocking for large datasets
|
|
89
95
|
if (isAllSelected) {
|
|
90
96
|
setLocalFilterData([]);
|
|
91
97
|
}
|
|
@@ -140,7 +146,7 @@ const FacetedFilter = ({ header, resetAllFilters, }) => {
|
|
|
140
146
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: "relative" }, children: [(0, jsx_runtime_1.jsxs)(material_1.IconButton, { ref: buttonRef, onClick: (e) => {
|
|
141
147
|
e.stopPropagation();
|
|
142
148
|
setIsOpen(!isOpen);
|
|
143
|
-
}, sx: { padding: 0, position: "relative" }, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Faceted Filter", children: (0, jsx_runtime_1.jsx)(icons_material_1.FilterListRounded, {}) }), activeFilterCount > 0 && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
149
|
+
}, sx: { padding: 0, position: "relative" }, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Faceted Filter", children: (0, jsx_runtime_1.jsx)(icons_material_1.FilterListRounded, { sx: { fontSize: "20px" } }) }), activeFilterCount > 0 && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
144
150
|
backgroundColor: butterflyBlue[900],
|
|
145
151
|
border: `2px solid ${iron[600]}`,
|
|
146
152
|
borderRadius: "50%",
|
|
@@ -4,7 +4,9 @@ type GroupAreaOverlayProps<T> = {
|
|
|
4
4
|
activeDragOver: string | null;
|
|
5
5
|
table: Table<T>;
|
|
6
6
|
defaultGrouping: Array<keyof T>;
|
|
7
|
+
isOutsideGrid?: boolean;
|
|
8
|
+
currentGrouping?: string[];
|
|
7
9
|
};
|
|
8
|
-
export declare const GroupAreaOverlay: <T>({ activeDragId, activeDragOver, table, defaultGrouping, }: GroupAreaOverlayProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const GroupAreaOverlay: <T>({ activeDragId, activeDragOver, table, defaultGrouping, isOutsideGrid, currentGrouping, }: GroupAreaOverlayProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=GroupAreaOverlay.d.ts.map
|
package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupAreaOverlay.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupAreaOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupAreaOverlay.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupAreaOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,KAAK,qBAAqB,CAAC,CAAC,IAAI;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAG,2FAOlC,qBAAqB,CAAC,CAAC,CAAC,4CA4I1B,CAAC"}
|
|
@@ -5,7 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const core_1 = require("@dnd-kit/core");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const iconoir_react_1 = require("iconoir-react");
|
|
8
|
-
const
|
|
8
|
+
const HideIcon_1 = require("../Svgs/HideIcon");
|
|
9
|
+
const GroupAreaOverlay = ({ activeDragId, activeDragOver, table, defaultGrouping = [], isOutsideGrid = false, currentGrouping = [], }) => {
|
|
9
10
|
const theme = (0, material_1.useTheme)();
|
|
10
11
|
const { iron, lipstickRed, slate } = theme.palette.app.color;
|
|
11
12
|
const { getColumn, getHeaderGroups } = table;
|
|
@@ -33,16 +34,34 @@ const GroupAreaOverlay = ({ activeDragId, activeDragOver, table, defaultGrouping
|
|
|
33
34
|
const isGroupable = enableGrouping === true;
|
|
34
35
|
// Check if dragging over the group panel
|
|
35
36
|
const isOverGroupPanel = activeDragOver === "grouping-panel";
|
|
37
|
+
// Check if this is a grouped chip being dragged
|
|
38
|
+
const isGroupedChip = currentGrouping.includes(activeDragId);
|
|
39
|
+
// Check if outside grid and should show hide icon (only for column headers, not grouped chips)
|
|
40
|
+
const shouldShowHideIcon = isOutsideGrid && !isGroupedChip;
|
|
41
|
+
// Check if already at max grouping limit (4 columns)
|
|
42
|
+
const MAX_GROUPING_COLUMNS = 4;
|
|
43
|
+
const isAtMaxLimit = !isGroupedChip &&
|
|
44
|
+
isGroupable &&
|
|
45
|
+
currentGrouping.length >= MAX_GROUPING_COLUMNS &&
|
|
46
|
+
isOverGroupPanel;
|
|
36
47
|
// If defaultGrouping exists and enableGrouping is true, prohibit dragging to group area
|
|
37
|
-
const shouldProhibit = defaultGrouping.length > 0 && isGroupable && isOverGroupPanel
|
|
48
|
+
const shouldProhibit = (defaultGrouping.length > 0 && isGroupable && isOverGroupPanel) ||
|
|
49
|
+
isAtMaxLimit;
|
|
38
50
|
// Determine border color and icon based on groupability and drag location
|
|
39
|
-
const borderColor =
|
|
40
|
-
? lipstickRed[
|
|
51
|
+
const borderColor = shouldShowHideIcon
|
|
52
|
+
? lipstickRed[700]
|
|
41
53
|
: // eslint-disable-next-line sonarjs/no-nested-conditional
|
|
42
|
-
|
|
54
|
+
shouldProhibit
|
|
43
55
|
? lipstickRed[900]
|
|
44
|
-
:
|
|
56
|
+
: // eslint-disable-next-line sonarjs/no-nested-conditional
|
|
57
|
+
isOverGroupPanel && !isGroupable
|
|
58
|
+
? lipstickRed[900]
|
|
59
|
+
: iron[700];
|
|
45
60
|
const manageIcon = () => {
|
|
61
|
+
// Show hide icon when dragging outside grid (only for column headers)
|
|
62
|
+
if (shouldShowHideIcon) {
|
|
63
|
+
return (0, jsx_runtime_1.jsx)(HideIcon_1.HideIcon, { width: 20, height: 20 });
|
|
64
|
+
}
|
|
46
65
|
if (shouldProhibit) {
|
|
47
66
|
return (0, jsx_runtime_1.jsx)(iconoir_react_1.Prohibition, { width: 18, height: 18 });
|
|
48
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupedPanel.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupedPanel.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAG,4DAK9B,kBAAkB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"GroupedPanel.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/Grouped/GroupedPanel.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACpD,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,EAAG,4DAK9B,kBAAkB,CAAC,CAAC,CAAC,4CA2GvB,CAAC"}
|
|
@@ -44,10 +44,19 @@ const GroupedPanel = ({ groupedColumns, onRemoveGroup, table, defaultGrouping =
|
|
|
44
44
|
lineHeight: 1.5,
|
|
45
45
|
margin: 0,
|
|
46
46
|
padding: 0,
|
|
47
|
-
}, children: "Grouped By:" }), (0, jsx_runtime_1.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
}, children: "Grouped By:" }), (0, jsx_runtime_1.jsxs)(sortable_1.SortableContext, { items: groupedColumns, strategy: sortable_1.horizontalListSortingStrategy, children: [groupedColumns.map((columnId, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GroupChip_1.GroupChip, { columnId: columnId, onRemove: onRemoveGroup, table: table, defaultGrouping: defaultGrouping }), index < groupedColumns.length - 1 && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
48
|
+
color: iron[400],
|
|
49
|
+
fontSize: "12px",
|
|
50
|
+
fontWeight: 600,
|
|
51
|
+
}, children: ">" }))] }, columnId))), groupedColumns.length >= 4 && ((0, jsx_runtime_1.jsx)("p", { style: {
|
|
52
|
+
color: iron[400],
|
|
53
|
+
fontSize: 12,
|
|
54
|
+
fontWeight: 400,
|
|
55
|
+
lineHeight: 1.5,
|
|
56
|
+
margin: 0,
|
|
57
|
+
marginLeft: "auto",
|
|
58
|
+
padding: 0,
|
|
59
|
+
fontStyle: "italic",
|
|
60
|
+
}, children: "(Maximum 4 columns)" }))] })] })) }));
|
|
52
61
|
};
|
|
53
62
|
exports.GroupedPanel = GroupedPanel;
|
|
@@ -20,7 +20,7 @@ const HeaderCell = ({ dragAttributes, dragListeners, dragRef, dragTransform, dra
|
|
|
20
20
|
const transformStyle = dragTransform
|
|
21
21
|
? utilities_1.CSS.Transform.toString(dragTransform)
|
|
22
22
|
: undefined;
|
|
23
|
-
const backgroundColor = isReorderable && isDragOver ? slate[700] :
|
|
23
|
+
const backgroundColor = isReorderable && isDragOver ? slate[700] : "#fafafb";
|
|
24
24
|
const draggableAttributes = dragAttributes ?? {};
|
|
25
25
|
const draggableListeners = dragListeners ?? {};
|
|
26
26
|
const manageZIndex = () => {
|
|
@@ -89,7 +89,7 @@ const HeaderCell = ({ dragAttributes, dragListeners, dragRef, dragTransform, dra
|
|
|
89
89
|
}, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
90
90
|
color: iron[400],
|
|
91
91
|
fontFamily: "Poppins",
|
|
92
|
-
fontSize: "
|
|
92
|
+
fontSize: "13px",
|
|
93
93
|
fontWeight: 600,
|
|
94
94
|
lineHeight: "20px",
|
|
95
95
|
overflow: "hidden",
|
package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/SearchFilterRow.js
CHANGED
|
@@ -6,14 +6,14 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const GetRenderInputs_1 = require("./GetRenderInputs");
|
|
7
7
|
const SearchFilterRow = ({ header, resetAllFilters, }) => {
|
|
8
8
|
const theme = (0, material_1.useTheme)();
|
|
9
|
-
const { iron
|
|
9
|
+
const { iron } = theme.palette.app.color;
|
|
10
10
|
const headerDyanmicWidth = header.column.getIsPinned()
|
|
11
11
|
? header.getSize() - 8
|
|
12
12
|
: header.getSize();
|
|
13
13
|
const columnDef = header.column.columnDef;
|
|
14
14
|
const filterVariant = columnDef.filterVariant;
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)("th", { style: {
|
|
16
|
-
backgroundColor:
|
|
16
|
+
backgroundColor: "#fafafb",
|
|
17
17
|
borderBottom: `1px solid ${iron[700]}`,
|
|
18
18
|
height: "40px",
|
|
19
19
|
left: header.column.getIsPinned() === "left"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FieldValues, type UseControllerProps } from "react-hook-form";
|
|
2
|
+
import type { SmartColumnAlignmentType } from "../types";
|
|
3
|
+
type SmartAlignmentsProps<P extends FieldValues> = Omit<UseControllerProps<P>, "defaultValue"> & {
|
|
4
|
+
defaultValue?: SmartColumnAlignmentType;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const SmartAlignments: <P extends FieldValues>({ name, control, defaultValue, rules, disabled, }: SmartAlignmentsProps<P>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=SmartAlignments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmartAlignments.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/SmartAlignments.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAQzD,KAAK,oBAAoB,CAAC,CAAC,SAAS,WAAW,IAAI,IAAI,CACrD,kBAAkB,CAAC,CAAC,CAAC,EACrB,cAAc,CACf,GAAG;IACF,YAAY,CAAC,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,EAAE,mDAMpD,oBAAoB,CAAC,CAAC,CAAC,4CAgFzB,CAAC"}
|