@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codezee/sixtify-brahma",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.194",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"@types/luxon": "^3.4.2",
|
|
32
32
|
"@types/node": "^22.10.0",
|
|
33
33
|
"@types/react-date-range": "^1.4.9",
|
|
34
|
-
"@types/react-image-gallery": "^1.2.4",
|
|
35
34
|
"@types/uuid": "^10.0.0",
|
|
36
35
|
"eslint-config-prettier": "^9.1.0",
|
|
37
36
|
"eslint-import-resolver-typescript": "^4.3.4",
|
|
@@ -62,60 +61,13 @@
|
|
|
62
61
|
"@mui/material": "^5.15.20",
|
|
63
62
|
"@mui/styled-engine-sc": "6.0.0-alpha.18",
|
|
64
63
|
"@mui/x-charts": "^8.12.0",
|
|
65
|
-
"@mui/x-data-grid": "^7.6.2",
|
|
66
64
|
"@mui/x-date-pickers": "^7.8.0",
|
|
67
|
-
"@tanstack/react-query": "^5.48.0",
|
|
68
|
-
"@tanstack/react-query-devtools": "^5.48.0",
|
|
69
65
|
"@tanstack/react-table": "^8.21.3",
|
|
70
66
|
"@tanstack/react-virtual": "^3.13.12",
|
|
71
|
-
"@tiptap/core": "^3.4.4",
|
|
72
|
-
"@tiptap/extension-blockquote": "^3.4.4",
|
|
73
|
-
"@tiptap/extension-bold": "^3.4.4",
|
|
74
|
-
"@tiptap/extension-bubble-menu": "^3.4.4",
|
|
75
|
-
"@tiptap/extension-bullet-list": "^3.4.4",
|
|
76
|
-
"@tiptap/extension-code": "^3.4.4",
|
|
77
|
-
"@tiptap/extension-code-block": "^3.4.4",
|
|
78
|
-
"@tiptap/extension-color": "^3.4.4",
|
|
79
|
-
"@tiptap/extension-document": "^3.4.4",
|
|
80
|
-
"@tiptap/extension-dropcursor": "^3.4.4",
|
|
81
|
-
"@tiptap/extension-floating-menu": "^3.4.4",
|
|
82
|
-
"@tiptap/extension-font-family": "^3.4.4",
|
|
83
|
-
"@tiptap/extension-gapcursor": "^3.4.4",
|
|
84
|
-
"@tiptap/extension-hard-break": "^3.4.4",
|
|
85
|
-
"@tiptap/extension-heading": "^3.4.4",
|
|
86
|
-
"@tiptap/extension-highlight": "^3.4.4",
|
|
87
|
-
"@tiptap/extension-history": "^3.4.4",
|
|
88
|
-
"@tiptap/extension-horizontal-rule": "^3.4.4",
|
|
89
|
-
"@tiptap/extension-image": "^3.4.4",
|
|
90
|
-
"@tiptap/extension-italic": "^3.4.4",
|
|
91
|
-
"@tiptap/extension-link": "^3.4.4",
|
|
92
|
-
"@tiptap/extension-list-item": "^3.4.4",
|
|
93
|
-
"@tiptap/extension-mention": "^3.4.4",
|
|
94
|
-
"@tiptap/extension-ordered-list": "^3.4.4",
|
|
95
|
-
"@tiptap/extension-paragraph": "^3.4.4",
|
|
96
|
-
"@tiptap/extension-placeholder": "^3.4.4",
|
|
97
|
-
"@tiptap/extension-strike": "^3.4.4",
|
|
98
|
-
"@tiptap/extension-subscript": "^3.4.4",
|
|
99
|
-
"@tiptap/extension-superscript": "^3.4.4",
|
|
100
|
-
"@tiptap/extension-table": "^3.4.4",
|
|
101
|
-
"@tiptap/extension-table-cell": "^3.4.4",
|
|
102
|
-
"@tiptap/extension-table-header": "^3.4.4",
|
|
103
|
-
"@tiptap/extension-table-row": "^3.4.4",
|
|
104
|
-
"@tiptap/extension-task-item": "^3.4.4",
|
|
105
|
-
"@tiptap/extension-task-list": "^3.4.4",
|
|
106
|
-
"@tiptap/extension-text": "^3.4.4",
|
|
107
|
-
"@tiptap/extension-text-align": "^3.4.4",
|
|
108
|
-
"@tiptap/extension-text-style": "^3.4.4",
|
|
109
|
-
"@tiptap/extension-underline": "^3.4.4",
|
|
110
|
-
"@tiptap/pm": "^3.4.4",
|
|
111
|
-
"@tiptap/react": "^3.4.4",
|
|
112
|
-
"@tiptap/starter-kit": "^3.4.4",
|
|
113
|
-
"@tiptap/suggestion": "^3.4.4",
|
|
114
67
|
"@types/file-saver": "^2.0.7",
|
|
115
68
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
116
69
|
"ag-grid-community": "^34.3.1",
|
|
117
70
|
"ag-grid-react": "^34.3.1",
|
|
118
|
-
"axios": "^1.7.2",
|
|
119
71
|
"date-fns": "^4.1.0",
|
|
120
72
|
"eslint-plugin-sonarjs": "1.0.4-alpha.1",
|
|
121
73
|
"exceljs": "^4.4.0",
|
|
@@ -123,24 +75,18 @@
|
|
|
123
75
|
"file64": "1.0.1",
|
|
124
76
|
"gh-pages": "^6.3.0",
|
|
125
77
|
"html2canvas": "^1.4.1",
|
|
126
|
-
"i18next": "^23.12.1",
|
|
127
78
|
"iconoir-react": "^7.11.0",
|
|
128
|
-
"jszip": "^3.10.1",
|
|
129
79
|
"lodash": "^4.17.21",
|
|
130
80
|
"luxon": "^3.4.4",
|
|
131
|
-
"mui-tiptap": "^1.26.0",
|
|
132
81
|
"next": "^14.2.5",
|
|
133
|
-
"next-auth": "^4.24.7",
|
|
134
82
|
"react-date-range": "^2.0.1",
|
|
135
83
|
"react-i18next": "^14.1.2",
|
|
136
|
-
"react-multi-carousel": "^2.8.5",
|
|
137
84
|
"react-number-format": "^5.4.4",
|
|
138
85
|
"react-phone-input-2": "^2.15.1",
|
|
139
86
|
"react-syntax-highlighter": "^16.1.0",
|
|
140
87
|
"react-toastify": "^10.0.5",
|
|
141
88
|
"react-webcam": "7.2.0",
|
|
142
89
|
"styled-components": "^6.1.11",
|
|
143
|
-
"tippy.js": "^6.3.7",
|
|
144
90
|
"usehooks-ts": "^3.1.0",
|
|
145
91
|
"uuid": "^10.0.0",
|
|
146
92
|
"zod": "^3.23.8"
|
|
@@ -76,7 +76,7 @@ exports.AgGrid = (0, react_1.forwardRef)((props, ref) => {
|
|
|
76
76
|
if (datasource) {
|
|
77
77
|
setTimeout(() => {
|
|
78
78
|
const displayedCount = api.getDisplayedRowCount();
|
|
79
|
-
const renderedNodes = api.getRenderedNodes()
|
|
79
|
+
const renderedNodes = api.getRenderedNodes()?.length ?? 0;
|
|
80
80
|
updateNoRowsOverlay(api, displayedCount === 0 && renderedNodes === 0);
|
|
81
81
|
}, 50);
|
|
82
82
|
}
|
|
@@ -84,7 +84,7 @@ exports.AgGrid = (0, react_1.forwardRef)((props, ref) => {
|
|
|
84
84
|
else {
|
|
85
85
|
setTimeout(() => {
|
|
86
86
|
const displayedCount = api.getDisplayedRowCount();
|
|
87
|
-
const renderedNodes = api.getRenderedNodes()
|
|
87
|
+
const renderedNodes = api.getRenderedNodes()?.length ?? 0;
|
|
88
88
|
updateNoRowsOverlay(api, displayedCount === 0 && renderedNodes === 0);
|
|
89
89
|
}, 50);
|
|
90
90
|
}
|
|
@@ -117,13 +117,13 @@ exports.AgGrid = (0, react_1.forwardRef)((props, ref) => {
|
|
|
117
117
|
const datasource = api.getGridOption("datasource");
|
|
118
118
|
if (datasource) {
|
|
119
119
|
setTimeout(() => {
|
|
120
|
-
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()
|
|
120
|
+
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()?.length);
|
|
121
121
|
}, 50);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
125
|
setTimeout(() => {
|
|
126
|
-
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()
|
|
126
|
+
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()?.length);
|
|
127
127
|
}, 50);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -136,13 +136,13 @@ exports.AgGrid = (0, react_1.forwardRef)((props, ref) => {
|
|
|
136
136
|
const datasource = api.getGridOption("datasource");
|
|
137
137
|
if (datasource) {
|
|
138
138
|
setTimeout(() => {
|
|
139
|
-
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()
|
|
139
|
+
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()?.length);
|
|
140
140
|
}, 50);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
else {
|
|
144
144
|
setTimeout(() => {
|
|
145
|
-
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()
|
|
145
|
+
updateNoRowsOverlay(api, !api.getDisplayedRowCount() && !api.getRenderedNodes()?.length);
|
|
146
146
|
}, 50);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridSelection.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridSelection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAgGridSelection.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridSelection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,sBAAsB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI;IACtD,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC;QAC5C,IAAI,EAAE,CAAC,EAAE,CAAC;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;IACH,cAAc,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,KAAK,OAAO,CAAC;CACpD,CAAC;AAEF,KAAK,wBAAwB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI;IACxD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IACzB,kBAAkB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,aAAa,EAAE;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,EAAE;QACP,IAAI,EAAE,OAAO,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,IAAI,CAAC;KAC3B,GAAG,IAAI,CAAC;CACV,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,2GAQ1D,sBAAsB,CAAC,CAAC,CAAC,KAAG,wBAAwB,CAAC,CAAC,CAucxD,CAAC"}
|
|
@@ -8,6 +8,24 @@ const useAgGridSelection = ({ gridRef, currentPageItems, totalRecords, selectedE
|
|
|
8
8
|
const originalSelectableCountRef = (0, react_1.useRef)(null);
|
|
9
9
|
const lastQueryParamsRef = (0, react_1.useRef)(null);
|
|
10
10
|
const previousTotalRecordsRef = (0, react_1.useRef)(totalRecords);
|
|
11
|
+
const previousExtraParamsRef = (0, react_1.useRef)("");
|
|
12
|
+
const currentExtraParams = (0, react_1.useMemo)(() => {
|
|
13
|
+
try {
|
|
14
|
+
return JSON.stringify(getExtraParams());
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return "";
|
|
18
|
+
}
|
|
19
|
+
}, [getExtraParams]);
|
|
20
|
+
(0, react_1.useEffect)(() => {
|
|
21
|
+
const previousExtraParams = previousExtraParamsRef.current;
|
|
22
|
+
if (previousExtraParams !== "" &&
|
|
23
|
+
currentExtraParams !== previousExtraParams) {
|
|
24
|
+
setAllDataCache(null);
|
|
25
|
+
originalSelectableCountRef.current = null;
|
|
26
|
+
}
|
|
27
|
+
previousExtraParamsRef.current = currentExtraParams;
|
|
28
|
+
}, [currentExtraParams]);
|
|
11
29
|
(0, react_1.useEffect)(() => {
|
|
12
30
|
if ((originalSelectableCountRef.current === null && totalRecords > 0) ||
|
|
13
31
|
(originalSelectableCountRef.current !== null &&
|
|
@@ -69,9 +87,12 @@ const useAgGridSelection = ({ gridRef, currentPageItems, totalRecords, selectedE
|
|
|
69
87
|
});
|
|
70
88
|
}, [currentPageItems, isRowSelectable]);
|
|
71
89
|
const deselectCurrentPage = (0, react_1.useCallback)(() => {
|
|
72
|
-
const
|
|
90
|
+
const selectableItems = isRowSelectable
|
|
91
|
+
? currentPageItems.filter((item) => isRowSelectable({ data: item }))
|
|
92
|
+
: currentPageItems;
|
|
93
|
+
const currentPageIds = new Set(selectableItems.map(({ id }) => id));
|
|
73
94
|
setSelectedIds((prev) => prev.filter((id) => !currentPageIds.has(id)));
|
|
74
|
-
}, [currentPageItems]);
|
|
95
|
+
}, [currentPageItems, isRowSelectable]);
|
|
75
96
|
const selectAll = (0, react_1.useCallback)(async (params) => {
|
|
76
97
|
const extraParams = getExtraParams();
|
|
77
98
|
const base = params ??
|
|
@@ -173,18 +194,87 @@ const useAgGridSelection = ({ gridRef, currentPageItems, totalRecords, selectedE
|
|
|
173
194
|
onButtonClick: () => void selectAll(),
|
|
174
195
|
};
|
|
175
196
|
}, [selectedRecords, displayRecordsCount, clearSelection, selectAll]);
|
|
197
|
+
const isDialogOnTop = (0, react_1.useCallback)(() => {
|
|
198
|
+
const backdrop = document.querySelector('.MuiBackdrop-root:not([style*="display: none"])');
|
|
199
|
+
if (backdrop) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
const dialogs = document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiModal-root');
|
|
203
|
+
if (dialogs.length === 0) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
for (const dialog of Array.from(dialogs)) {
|
|
207
|
+
const dialogElement = dialog;
|
|
208
|
+
const style = window.getComputedStyle(dialogElement);
|
|
209
|
+
const isVisible = style.display !== "none" &&
|
|
210
|
+
style.visibility !== "hidden" &&
|
|
211
|
+
parseFloat(style.opacity) > 0;
|
|
212
|
+
if (isVisible) {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
}, []);
|
|
176
218
|
const isInputFieldActive = (0, react_1.useCallback)(() => {
|
|
177
219
|
const activeElement = document.activeElement;
|
|
178
220
|
return (activeElement?.tagName === "INPUT" ||
|
|
179
221
|
activeElement?.tagName === "TEXTAREA" ||
|
|
180
222
|
activeElement?.contentEditable === "true");
|
|
181
223
|
}, []);
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
224
|
+
const isFilterFieldActive = (0, react_1.useCallback)((target) => {
|
|
225
|
+
if (!target) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
return (target.classList.contains("ag-floating-filter") ||
|
|
229
|
+
target.classList.contains("ag-text-field-input") ||
|
|
230
|
+
target.closest(".ag-floating-filter") !== null ||
|
|
231
|
+
target.closest(".ag-text-field-input") !== null);
|
|
187
232
|
}, []);
|
|
233
|
+
const isHeaderCheckboxActive = (0, react_1.useCallback)((target) => {
|
|
234
|
+
const element = target || document.activeElement;
|
|
235
|
+
return (element?.closest(".ag-header-cell") !== null ||
|
|
236
|
+
element?.closest(".ag-selection-checkbox") !== null ||
|
|
237
|
+
element?.getAttribute("role") === "columnheader");
|
|
238
|
+
}, []);
|
|
239
|
+
const handleCtrlA = (0, react_1.useCallback)((event) => {
|
|
240
|
+
if (isDialogOnTop()) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
event.preventDefault();
|
|
244
|
+
selectCurrentPage();
|
|
245
|
+
}, [selectCurrentPage, isDialogOnTop]);
|
|
246
|
+
const handleAltA = (0, react_1.useCallback)((event) => {
|
|
247
|
+
if (isDialogOnTop()) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const activeElement = document.activeElement;
|
|
251
|
+
const isInputField = activeElement?.tagName === "INPUT" ||
|
|
252
|
+
activeElement?.tagName === "TEXTAREA" ||
|
|
253
|
+
activeElement?.contentEditable === "true";
|
|
254
|
+
if (isInputField) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
event.preventDefault();
|
|
258
|
+
deselectCurrentPage();
|
|
259
|
+
}, [deselectCurrentPage, isFilterFieldActive, isDialogOnTop]);
|
|
260
|
+
const handleSpaceKey = (0, react_1.useCallback)((event) => {
|
|
261
|
+
const target = event.target;
|
|
262
|
+
if (isFilterFieldActive(target)) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
event.preventDefault();
|
|
266
|
+
if (currentPageState.checked) {
|
|
267
|
+
deselectCurrentPage();
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
selectCurrentPage();
|
|
271
|
+
}
|
|
272
|
+
}, [
|
|
273
|
+
currentPageState.checked,
|
|
274
|
+
deselectCurrentPage,
|
|
275
|
+
selectCurrentPage,
|
|
276
|
+
isFilterFieldActive,
|
|
277
|
+
]);
|
|
188
278
|
(0, react_1.useEffect)(() => {
|
|
189
279
|
const handleKeyDown = (event) => {
|
|
190
280
|
if (isInputFieldActive() || !currentPageItems.length) {
|
|
@@ -192,24 +282,17 @@ const useAgGridSelection = ({ gridRef, currentPageItems, totalRecords, selectedE
|
|
|
192
282
|
}
|
|
193
283
|
const key = event.key.toLowerCase();
|
|
194
284
|
if (key === "a" && (event.ctrlKey || event.metaKey)) {
|
|
195
|
-
event
|
|
196
|
-
selectCurrentPage();
|
|
285
|
+
handleCtrlA(event);
|
|
197
286
|
return;
|
|
198
287
|
}
|
|
199
|
-
if (
|
|
200
|
-
event
|
|
201
|
-
deselectCurrentPage();
|
|
288
|
+
if (event.code === "KeyA" && event.altKey) {
|
|
289
|
+
handleAltA(event);
|
|
202
290
|
return;
|
|
203
291
|
}
|
|
204
|
-
if ((event.code === "Space" || event.key === " ") &&
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (currentPageState.checked) {
|
|
209
|
-
deselectCurrentPage();
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
selectCurrentPage();
|
|
292
|
+
if ((event.code === "Space" || event.key === " ") && gridRef.current) {
|
|
293
|
+
const target = event.target;
|
|
294
|
+
if (isHeaderCheckboxActive(target) && !isFilterFieldActive(target)) {
|
|
295
|
+
handleSpaceKey(event);
|
|
213
296
|
}
|
|
214
297
|
}
|
|
215
298
|
};
|
|
@@ -217,11 +300,12 @@ const useAgGridSelection = ({ gridRef, currentPageItems, totalRecords, selectedE
|
|
|
217
300
|
return () => document.removeEventListener("keydown", handleKeyDown, true);
|
|
218
301
|
}, [
|
|
219
302
|
currentPageItems.length,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
303
|
+
handleCtrlA,
|
|
304
|
+
handleAltA,
|
|
305
|
+
handleSpaceKey,
|
|
223
306
|
isInputFieldActive,
|
|
224
307
|
isHeaderCheckboxActive,
|
|
308
|
+
gridRef,
|
|
225
309
|
]);
|
|
226
310
|
return {
|
|
227
311
|
selectedIds,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type StackOwnProps, type StackProps, type SxProps } from "@mui/material";
|
|
2
2
|
import { type RadioProps as MuiRadioProps } from "@mui/material/Radio";
|
|
3
|
-
import type
|
|
3
|
+
import { type ReactNode } from "react";
|
|
4
4
|
import { type ControllerRenderProps, type FieldValues, type UseControllerProps } from "react-hook-form";
|
|
5
5
|
import { type NavigationKey } from "../../utils/hooks/useFormFieldFocus";
|
|
6
6
|
type Options = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupField.d.ts","sourceRoot":"","sources":["../../../src/FormFields/RadioGroupField/RadioGroupField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AACvB,OAAc,EAAE,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"RadioGroupField.d.ts","sourceRoot":"","sources":["../../../src/FormFields/RadioGroupField/RadioGroupField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AACvB,OAAc,EAAE,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,qCAAqC,CAAC;AAG7C,KAAK,OAAO,GAAG;IACb,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,IACpD,kBAAkB,CAAC,CAAC,CAAC,GACnB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAC,GAAG;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEN,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,EACrD,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAY,EACZ,IAAc,EACd,KAAmB,EACnB,OAAe,EACf,QAAgB,EAChB,SAAiB,EACjB,EAAO,EACP,cAAc,EACd,YAAoB,EACpB,aAAqB,EACrB,cAAc,EACd,GAAG,oBAAoB,EACxB,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAwIzB"}
|
|
@@ -7,12 +7,14 @@ exports.RadioGroupField = RadioGroupField;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
9
|
const Radio_1 = __importDefault(require("@mui/material/Radio"));
|
|
10
|
+
const react_1 = require("react");
|
|
10
11
|
const react_hook_form_1 = require("react-hook-form");
|
|
11
12
|
const useFormFieldFocus_1 = require("../../utils/hooks/useFormFieldFocus");
|
|
12
13
|
const Skeleton_1 = require("./Skeleton");
|
|
13
14
|
function RadioGroupField({ name, rules, label, control, options, defaultValue, size = "small", color = "secondary", loading = false, required = false, direction = "row", sx = {}, containerProps, isHorizontal = false, navigationKey = "tab", customOnChange, ...restRadioButtonProps }) {
|
|
14
15
|
const { field: { value, onChange, ref, ...restField }, } = (0, react_hook_form_1.useController)({ name, control, defaultValue, rules });
|
|
15
16
|
const { inputRef, handleKeyDown: handleNavigationKeyDown, maintainFocus, } = (0, useFormFieldFocus_1.useFormFieldFocus)({ navigationKey });
|
|
17
|
+
const fallbackInputRef = (0, react_1.useRef)(null);
|
|
16
18
|
const handleKeyDown = (event) => {
|
|
17
19
|
handleNavigationKeyDown(event, undefined, false);
|
|
18
20
|
};
|
|
@@ -23,19 +25,19 @@ function RadioGroupField({ name, rules, label, control, options, defaultValue, s
|
|
|
23
25
|
whiteSpace: "normal",
|
|
24
26
|
overflow: "visible",
|
|
25
27
|
textOverflow: "unset",
|
|
26
|
-
}, required: required, disabled: restRadioButtonProps.disabled, children: label })), (0, jsx_runtime_1.jsx)(material_1.RadioGroup, { name: name, value: value, onKeyDown: handleKeyDown, onChange: (
|
|
28
|
+
}, required: required, disabled: restRadioButtonProps.disabled, children: label })), (0, jsx_runtime_1.jsx)(material_1.RadioGroup, { name: name, value: value, onKeyDown: handleKeyDown, onChange: (event, radioValue) => {
|
|
27
29
|
let selectedValue;
|
|
28
|
-
if (
|
|
30
|
+
if (radioValue === "true") {
|
|
29
31
|
selectedValue = true;
|
|
30
32
|
onChange(true);
|
|
31
33
|
}
|
|
32
|
-
else if (
|
|
34
|
+
else if (radioValue === "false") {
|
|
33
35
|
selectedValue = false;
|
|
34
36
|
onChange(false);
|
|
35
37
|
}
|
|
36
38
|
else {
|
|
37
|
-
selectedValue =
|
|
38
|
-
onChange(
|
|
39
|
+
selectedValue = radioValue;
|
|
40
|
+
onChange(radioValue);
|
|
39
41
|
}
|
|
40
42
|
if (customOnChange) {
|
|
41
43
|
const selectedOption = options.find(({ values }) => values === selectedValue);
|
|
@@ -43,20 +45,36 @@ function RadioGroupField({ name, rules, label, control, options, defaultValue, s
|
|
|
43
45
|
customOnChange(selectedOption);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
48
|
+
const targetInput = event.target;
|
|
49
|
+
if (targetInput) {
|
|
50
|
+
inputRef.current = targetInput;
|
|
51
|
+
}
|
|
52
|
+
else if (!inputRef.current && fallbackInputRef.current) {
|
|
53
|
+
inputRef.current = fallbackInputRef.current;
|
|
54
|
+
}
|
|
46
55
|
maintainFocus();
|
|
47
56
|
}, children: (0, jsx_runtime_1.jsx)(material_1.Stack, { gap: direction === "column" ? "5px" : "10px", direction: direction, ...containerProps, children: options?.map(({ label, values, disabled }, index) => {
|
|
48
57
|
return (
|
|
49
58
|
// eslint-disable-next-line sonarjs/no-array-index-key
|
|
50
|
-
(0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: values, control: (0, jsx_runtime_1.jsx)(Radio_1.default, { ...restField, ...restRadioButtonProps,
|
|
51
|
-
if (el
|
|
59
|
+
(0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: values, control: (0, jsx_runtime_1.jsx)(Radio_1.default, { ...restField, ...restRadioButtonProps, color: color, size: size, inputRef: (el) => {
|
|
60
|
+
if (!el) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const shouldUseAsPrimaryRef = value === values ||
|
|
64
|
+
(!inputRef.current && index === 0);
|
|
65
|
+
if (shouldUseAsPrimaryRef) {
|
|
52
66
|
inputRef.current = el;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
fallbackInputRef.current = el;
|
|
68
|
+
}
|
|
69
|
+
else if (!fallbackInputRef.current && index === 0) {
|
|
70
|
+
fallbackInputRef.current = el;
|
|
71
|
+
}
|
|
72
|
+
if (ref) {
|
|
73
|
+
if (typeof ref === "function") {
|
|
74
|
+
ref(el);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
ref.current = el;
|
|
60
78
|
}
|
|
61
79
|
}
|
|
62
80
|
} }), disabled: disabled, label: label, sx: sx }) }, index));
|
|
@@ -82,7 +82,7 @@ function Select({ control, defaultValue, name, required = false, label, multiple
|
|
|
82
82
|
gap: 0.5,
|
|
83
83
|
overflow: "hidden",
|
|
84
84
|
}, children: [visibleItems.map((option) => ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", noWrap: true, color: disabledColor, sx: {
|
|
85
|
-
|
|
85
|
+
WebkitTextFillColor: disabledColor,
|
|
86
86
|
backgroundColor: slate[800],
|
|
87
87
|
padding: "2px 5px",
|
|
88
88
|
borderRadius: "12px",
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArranger.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Control, type UseFieldArrayReturn, type UseFormSetValue } from "react-hook-form";
|
|
2
|
+
import type { AppColumnDef } from "../../types";
|
|
3
|
+
type ColumnArrangerProps<T> = {
|
|
4
|
+
lockedColumns: AppColumnDef<T>[];
|
|
5
|
+
fields: UseFieldArrayReturn<{
|
|
6
|
+
columns: AppColumnDef<T>[];
|
|
7
|
+
}, "columns">["fields"];
|
|
8
|
+
control: Control<{
|
|
9
|
+
columns: AppColumnDef<T>[];
|
|
10
|
+
}>;
|
|
11
|
+
setValue: UseFormSetValue<{
|
|
12
|
+
columns: AppColumnDef<T>[];
|
|
13
|
+
}>;
|
|
14
|
+
filterVisibleOnly?: boolean;
|
|
15
|
+
searchTerm?: string;
|
|
16
|
+
grouping?: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare const ColumnArranger: <T>({ lockedColumns, fields, control, setValue, filterVisibleOnly, searchTerm, grouping, }: Readonly<ColumnArrangerProps<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=ColumnArranger.d.ts.map
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArranger.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnArranger.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/ColumnChooser/ColumnArranger.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,KAAK,mBAAmB,CAAC,CAAC,IAAI;IAC5B,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACjC,MAAM,EAAE,mBAAmB,CACzB;QAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;KAAE,EAC9B,SAAS,CACV,CAAC,QAAQ,CAAC,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;QAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;KAAE,CAAC,CAAC;IACjD,QAAQ,EAAE,eAAe,CAAC;QAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;KAAE,CAAC,CAAC;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,CAAC,EAAG,wFAQhC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,4CAyElC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColumnArranger = 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 LockedColumnItem_1 = require("./LockedColumnItem");
|
|
8
|
+
const ColumnItem_1 = require("./ColumnItem");
|
|
9
|
+
const ColumnArranger = ({ lockedColumns, fields, control, setValue, filterVisibleOnly = false, searchTerm = "", grouping, }) => {
|
|
10
|
+
// Watch all column hide values
|
|
11
|
+
const columnsData = (0, react_hook_form_1.useWatch)({
|
|
12
|
+
control,
|
|
13
|
+
name: "columns",
|
|
14
|
+
defaultValue: [],
|
|
15
|
+
});
|
|
16
|
+
// Filter fields based on filterVisibleOnly and searchTerm
|
|
17
|
+
const filteredFields = (0, react_1.useMemo)(() => {
|
|
18
|
+
let result = fields;
|
|
19
|
+
// Apply visibility filter
|
|
20
|
+
if (filterVisibleOnly) {
|
|
21
|
+
result = result.filter((field, index) => {
|
|
22
|
+
const columnData = columnsData[index];
|
|
23
|
+
return columnData && columnData.hide;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
// Apply search filter by label/header
|
|
27
|
+
if (searchTerm.trim()) {
|
|
28
|
+
const lowerSearchTerm = searchTerm.toLowerCase();
|
|
29
|
+
result = result.filter((field, index) => {
|
|
30
|
+
const columnData = columnsData[index];
|
|
31
|
+
const header = columnData?.header ?? field.header ?? "";
|
|
32
|
+
// Match against header/label (case-insensitive)
|
|
33
|
+
return (typeof header === "string" &&
|
|
34
|
+
header.toLowerCase().includes(lowerSearchTerm));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}, [fields, filterVisibleOnly, searchTerm, columnsData]);
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [lockedColumns.map((column) => {
|
|
40
|
+
return (0, jsx_runtime_1.jsx)(LockedColumnItem_1.LockedColumnItem, { column: column }, column.accessorKey);
|
|
41
|
+
}), (0, jsx_runtime_1.jsxs)("div", { style: { margin: 0, padding: 0 }, children: [!filteredFields.length && ((0, jsx_runtime_1.jsx)("p", { style: { textAlign: "center", fontSize: "13px", color: "gray" }, children: "No columns to show" })), filteredFields
|
|
42
|
+
.filter((field) => !grouping?.includes(field.accessorKey ?? ""))
|
|
43
|
+
.map((field) => {
|
|
44
|
+
// Find the original index in the fields array
|
|
45
|
+
const actualIndex = fields.findIndex(({ id }) => id === field.id);
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(ColumnItem_1.ColumnItem, { field: field, control: control, index: actualIndex, setValue: setValue }, field.id));
|
|
47
|
+
})] })] }));
|
|
48
|
+
};
|
|
49
|
+
exports.ColumnArranger = ColumnArranger;
|
package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerDialog.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AppColumnDef, SmartColumnAlignmentType } from "../../types";
|
|
2
|
+
import type { OnAction } from "../../../utils/types";
|
|
3
|
+
type ColumnArrangerDialogProps<T> = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: OnAction;
|
|
6
|
+
title?: string;
|
|
7
|
+
columns?: AppColumnDef<T>[];
|
|
8
|
+
grouping?: string[];
|
|
9
|
+
onSave: (args: Record<string, {
|
|
10
|
+
hide: boolean;
|
|
11
|
+
align: SmartColumnAlignmentType;
|
|
12
|
+
header: string;
|
|
13
|
+
}>) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const ColumnArrangerDialog: <T>({ open, onClose, title, columns, grouping, onSave, }: ColumnArrangerDialogProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ColumnArrangerDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnArrangerDialog.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/ColumnChooser/ColumnArrangerDialog.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,KAAK,yBAAyB,CAAC,CAAC,IAAI;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,CACN,IAAI,EAAE,MAAM,CACV,MAAM,EACN;QACE,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,wBAAwB,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC;KAChB,CACF,KACE,IAAI,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAG,sDAOtC,yBAAyB,CAAC,CAAC,CAAC,4CAkM9B,CAAC"}
|